Skip to content

feat(quickstart): offer agent skill install before SDK generation - #1887

Closed
simplesagar wants to merge 18 commits into
mainfrom
feat/agent-setup-skills
Closed

feat(quickstart): offer agent skill install before SDK generation#1887
simplesagar wants to merge 18 commits into
mainfrom
feat/agent-setup-skills

Conversation

@simplesagar

@simplesagar simplesagar commented Feb 16, 2026

Copy link
Copy Markdown
Member

Summary

  • After speakeasy quickstart configures the project but before running SDK generation, prompts the user to install the speakeasy-context agent skill for AI coding assistants
  • Reuses the existing speakeasy agent setup-skills --auto command (runSetupSkills) — no duplicated logic
  • Skips the prompt if skills are already installed or running in non-interactive mode

Resolves GEN-2504

How to verify locally

1. Build and run quickstart (interactive, accept skill install)

go build -o speakeasy . && ./speakeasy quickstart

After project setup (schema, target, output dir) but before generation starts, you should see:

Install Speakeasy agent skills for AI coding assistants (Claude Code, Cursor, etc.)? (Y/n)

Press Enter (default yes) → verify .agents/skills/speakeasy-context/SKILL.md and agent-specific symlinks are created in the output directory, then generation proceeds normally.

2. Decline skill install

Run quickstart again in a fresh directory, select "no" at the prompt → verify no .agents/ directory is created and generation proceeds normally.

3. Already-installed (idempotent)

Run quickstart in a directory that already has .agents/skills/speakeasy-context/ → the prompt should be skipped entirely.

4. Non-interactive mode

go build -o speakeasy . && ./speakeasy quickstart --skip-compile --target typescript --schema https://petstore3.swagger.io/api/v3/openapi.json --out-dir /tmp/test-sdk --name TestSDK --package-name test-sdk

No skill install prompt should appear.

Test plan

  • Interactive quickstart → accept → skill files and symlinks created before generation runs
  • Interactive quickstart → decline → no files created, generation proceeds
  • Re-run in same dir → prompt skipped (already installed)
  • Non-interactive mode → no prompt appears
  • go build ./... passes

🤖 Generated with Claude Code

simplesagar and others added 17 commits February 12, 2026 11:10
Add `speakeasy agent setup-skills` with an interactive multi-select UI
for installing Speakeasy companion skills for AI coding assistants.
Hook into install.sh as a post-install step for interactive terminals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use --skill flags with single repo arg instead of per-skill repo paths.
Add --agent '*' -y to skip agent selection prompt. Remove
customize-sdk-runtime which doesn't exist in the skills repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Delegate skill selection to the skills CLI instead of maintaining a
hardcoded catalog. Add confirmation prompt warning users that npx
(Node.js) will be used before running any commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove 2>/dev/null from install.sh that would hide the bubbletea TUI.
Fix log message to include the --yes flag matching the actual command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion

Drop the npx/Node.js requirement entirely. Skills are now fetched
directly from the GitHub API and installed natively:
- Fetches skill catalog from GitHub Contents API
- Downloads SKILL.md via raw.githubusercontent.com
- Writes to .agents/skills/<name>/SKILL.md (canonical location)
- Creates symlinks from all known agent directories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
os.Remove fails silently on non-empty directories, which would cause
the subsequent os.Symlink to fail. Use os.RemoveAll instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address PR feedback from Thomas: let users pick which agents to install
for instead of creating dirs for all 31 agents. Claude Code, Cursor,
Windsurf, and Copilot are preselected by default. Also fixes agent
directory paths to match upstream skills registry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
They all share the canonical .agents/skills directory, so show them
as one entry instead of three separate options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear

linear Bot commented Feb 16, 2026

Copy link
Copy Markdown

devin-ai-integration[bot]

This comment was marked as resolved.

After quickstart configures the project but before running generation,
prompt the user to install the speakeasy-context agent skill for AI
coding assistants. Reuses `runSetupSkills` (the existing `speakeasy
agent setup-skills --auto` command). Skips if skills are already
installed or in non-interactive mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simplesagar
simplesagar force-pushed the feat/agent-setup-skills branch from 1250897 to 0816b3f Compare February 16, 2026 00:38
@simplesagar simplesagar changed the title feat(quickstart): offer agent skill install after SDK generation feat(quickstart): offer agent skill install before SDK generation Feb 16, 2026
@simplesagar

Copy link
Copy Markdown
Member Author

Superseded — rebasing onto main in a clean branch to remove already-merged commits from the diff.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 8 additional findings in Devin Review.

Open in Devin Review

Comment thread cmd/agent_setup_skills.go

// fetchSkillContent downloads the raw SKILL.md for a given skill name.
func fetchSkillContent(ctx context.Context, skillName string) ([]byte, error) {
url := fmt.Sprintf("https://raw.githubusercontent.com/%s/%s/master/%s/%s/SKILL.md", skillsOwner, skillsRepo, skillsPath, skillName)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Branch reference inconsistency between fetchSkillNames (default branch) and fetchSkillContent (hardcoded master)

The two GitHub-fetching functions use inconsistent branch references, which will cause fetchSkillContent to fail with a 404 if the speakeasy-api/skills repo's default branch is not master.

Root Cause

fetchSkillNames at cmd/agent_setup_skills.go:117 uses the GitHub Contents API without specifying a branch, so it defaults to the repo's default branch (e.g. main):

url := fmt.Sprintf("https://api.github.com/repos/%s/%s/contents/%s", skillsOwner, skillsRepo, skillsPath)

fetchSkillContent at cmd/agent_setup_skills.go:150 hardcodes master in the raw URL:

url := fmt.Sprintf("https://raw.githubusercontent.com/%s/%s/master/%s/%s/SKILL.md", ...)

If the default branch is main (GitHub's default for new repos since 2020), fetchSkillNames successfully lists skills from main, but fetchSkillContent tries to fetch from master and returns a 404. This causes installSkillsNative to fail.

In the quickstart flow (cmd/quickstart.go:697), the error is caught as a warning, so the user sees "Failed to install agent skills" but quickstart continues. In the standalone speakeasy agent setup-skills --auto path, the error propagates up and the command fails entirely.

Prompt for agents
In cmd/agent_setup_skills.go, the fetchSkillContent function on line 150 hardcodes the branch name 'master' in the raw.githubusercontent.com URL. This is inconsistent with fetchSkillNames on line 117 which uses the GitHub Contents API and defaults to the repo's default branch. To fix this, either: (1) Add a constant for the branch name and use the GitHub Contents API's download_url field in fetchSkillContent instead of constructing the raw URL manually, or (2) Replace 'master' with 'main' if that is the actual default branch of the speakeasy-api/skills repo, or (3) Use the GitHub Contents API for both functions so neither hardcodes a branch name.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

simplesagar added a commit that referenced this pull request Feb 16, 2026
)

## Summary

- After `speakeasy quickstart` configures the project but **before**
running SDK generation, prompts the user to install the
`speakeasy-context` agent skill for AI coding assistants
- Reuses the existing `speakeasy agent setup-skills --auto` command
(`runSetupSkills`) — no duplicated logic
- Skips the prompt if skills are already installed or running in
non-interactive mode

Resolves GEN-2504

Supersedes #1887 (rebased onto main to remove already-merged #1881
commits from the diff)

## How to verify locally

### 1. Build and run quickstart (interactive, accept skill install)
```bash
go build -o speakeasy . && ./speakeasy quickstart
```
After project setup (schema, target, output dir) but **before generation
starts**, you should see:
```
Install Speakeasy agent skills for AI coding assistants (Claude Code, Cursor, etc.)? (Y/n)
```
Press Enter (default yes) → verify
`.agents/skills/speakeasy-context/SKILL.md` and agent-specific symlinks
are created in the output directory, then generation proceeds normally.

### 2. Decline skill install
Run quickstart again in a fresh directory, select "no" at the prompt →
verify no `.agents/` directory is created and generation proceeds
normally.

### 3. Already-installed (idempotent)
Run quickstart in a directory that already has
`.agents/skills/speakeasy-context/` → the prompt should be **skipped
entirely**.

### 4. Non-interactive mode
```bash
go build -o speakeasy . && ./speakeasy quickstart --skip-compile --target typescript --schema https://petstore3.swagger.io/api/v3/openapi.json --out-dir /tmp/test-sdk --name TestSDK --package-name test-sdk
```
No skill install prompt should appear.

## Test plan

- [x] Interactive quickstart → accept → skill files and symlinks created
before generation runs
- [x] Interactive quickstart → decline → no files created, generation
proceeds
- [x] Re-run in same dir → prompt skipped (already installed)
- [x] Non-interactive mode → no prompt appears
- [x] `go build ./...` passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->

---

<a href="https://app.devin.ai/review/speakeasy-api/speakeasy/pull/1888"
target="_blank">
  <picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
  </picture>
</a>
<!-- devin-review-badge-end -->

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant