feat(quickstart): offer agent skill install before SDK generation - #1887
feat(quickstart): offer agent skill install before SDK generation#1887simplesagar wants to merge 18 commits into
Conversation
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>
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>
1250897 to
0816b3f
Compare
|
Superseded — rebasing onto main in a clean branch to remove already-merged commits from the diff. |
|
|
||
| // 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) |
There was a problem hiding this comment.
🔴 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
) ## 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>
Summary
speakeasy quickstartconfigures the project but before running SDK generation, prompts the user to install thespeakeasy-contextagent skill for AI coding assistantsspeakeasy agent setup-skills --autocommand (runSetupSkills) — no duplicated logicResolves GEN-2504
How to verify locally
1. Build and run quickstart (interactive, accept skill install)
After project setup (schema, target, output dir) but before generation starts, you should see:
Press Enter (default yes) → verify
.agents/skills/speakeasy-context/SKILL.mdand 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
No skill install prompt should appear.
Test plan
go build ./...passes🤖 Generated with Claude Code