Agent skill

Alpaca CLI Regenerate

by alpacahq in alpacahq/cli

Keep the CLI in sync with upstream OpenAPI specs. An agent skill from alpacahq/cli.

Apache-2.0Auto-check passedBackend & APIs

Install Alpaca CLI Regenerate

skills CLI
$ npx skills add alpacahq/cli --skill alpaca-cli-regenerate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alpacahq/cli alpaca-cli-regenerate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alpacahq/cli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/alpaca-cli-regenerate .claude/skills/alpaca-cli-regenerate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
alpaca-cli-regenerate
GitHub stars
178
Token cost
~2k tokens
SKILL.md length
783 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

Keep the CLI in sync with upstream OpenAPI specs. An agent skill from alpacahq/cli.

  • Works in 6 steps: Pull latest specs → Generate code → Fix generator failures → …
  • Specs changed upstream
  • SKILL.md covers Pipeline, Quick reference, Key files and Anti-Patterns
  • Calls make, go and git

What it does

Alpaca CLI Regenerate is an agent skill from alpacahq/cli. Keep the CLI in sync with upstream OpenAPI specs. Pulls latest specs, runs the code generator, registers new operations, updates golden files, and runs all checks. Use when specs changed upstream, a new API endpoint was added, generation is stale, or the user says "regenerate", "generate", "sync specs", "update specs", or "spec-update".

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering OpenAPI specifications and REST APIs. It works with Alpaca. The licence is Apache-2.0.

When your agent uses it

  • Specs changed upstream
  • A new API endpoint was added
  • Generation is stale
  • The user says regenerate

Example prompts

  • “regenerate”
  • “generate”
  • “sync specs”
  • “/alpaca-cli-regenerate”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Pull latest specs
  2. Generate code
  3. Fix generator failures
  4. Update golden files
  5. Run all checks
  6. Verify completeness

What it can do on your machine

Read from SKILL.md and the folder at commit 5360627. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make
    • go
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Alpaca CLI Regenerate loads about 2k tokens when it runs. Until then it costs about 90 tokens; SKILL.md has 783 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alpacahq/cli at commit 5360627, republished under its Apache-2.0 licence (© alpacahq). 783 words, ~1,982 tokens.

Download SKILL.mdSave it as .claude/skills/alpaca-cli-regenerate/SKILL.md (or your agent's skills folder).
name
alpaca-cli-regenerate
description
Keep the CLI in sync with upstream OpenAPI specs. Pulls latest specs, runs the code generator, registers new operations, updates golden files, and runs all checks. Use when specs changed upstream, a new API endpoint was added, generation is stale, or the user says "regenerate", "generate", "sync specs", "update specs", or "spec-update".

Generate - Keep the CLI Up to Date

Pipeline

Run each phase in order. Stop and fix before moving to the next.

Phase 1: Pull latest specs

make spec-update requires network access (it curls docs.alpaca.markets). Request full_network permissions if running in a sandbox.

bash
make spec-update

Downloads trading-api.json and market-data-api.json from docs.alpaca.markets/openapi/ into api/specs/.

After pulling, check what changed:

bash
git diff --stat api/specs/

If nothing changed, specs are already current - skip to Phase 4 to verify generated code is still fresh.

Phase 2: Generate code
bash
make generate

This runs go run ./cmd/generate which reads the specs and writes:

Generated fileContents
internal/api/trading_types.gen.goStructs and enums from trading spec
internal/api/trading_client.gen.goTrading API client methods
internal/api/marketdata_types.gen.goStructs and enums from market data spec
internal/api/marketdata_client.gen.goMarket data API client methods
internal/api/descriptions.gen.goOp metadata, flags, response schemas
internal/cmd/commands.gen.goCobra command tree

Never edit *.gen.go files directly. Change the specs or generator, then re-run make generate.

Phase 3: Fix generator failures

The generator enforces exhaustiveness. Common failures and fixes:

New operation not registered
unregistered operation "FooBar" — add to cmdRegistry or cmdSkip

Every operationId in the specs must appear in either cmdRegistry or cmdSkip in cmd/generate/commands.go.

To register a new command, add an entry to cmdRegistry:

go
"FooBar": {
    parent:   "<parent-group>",   // key in cmdParents
    use:      "<subcommand-name>",
    examples: "  alpaca <parent> <subcommand> --flag value",
},

Rules for registry entries:

  • parent must be a key in cmdParents (or create a new parent group)
  • examples is required - the generator fails without it
  • Use kebab-case for use names
  • Add defaults for sensible default flag values
  • Add bodyAliases if a body field name collides with a query/path param
  • Add bodyHook / bodySkipFields for complex body construction
  • Add configureFunc for hand-written configure hooks (e.g. order submit's bracket legs)
  • Add normalize for path params that need URL normalization (e.g. symbols with /)

If the command IS its parent (e.g. alpaca clock runs directly, not alpaca clock get), use self: true and omit use:

go
"LegacyClock": {
    parent:   "clock",
    self:     true,
    examples: "  alpaca clock",
},

To skip an operation (intentionally exclude from the CLI):

go
var cmdSkip = map[string]string{
    "FooBar": "reason for skipping",
}
Body field collision
body field "name" collides with a query/path param — add bodyAliases

Fix by adding a bodyAliases entry that renames the body flag:

go
"UpdateFoo": {
    parent:      "foo",
    use:         "update",
    bodyAliases: map[string]string{"name": "new-name"},
    examples:    "  alpaca foo update --name old --new-name new",
},
New parent group needed

Add to cmdParents in cmd/generate/commands.go:

go
"myGroup": {
    use:   "my-group",
    short: "Short description",
    long:  "Longer description for --help.",
},

For nested groups, set parent:

go
"mySubGroup": {
    use:    "sub",
    short:  "Sub-group description",
    parent: "myGroup",
},

Top-level parent groups also need root wiring. If the new group is not nested under an existing parent, add it to addGroup() in internal/cmd/root.go. Pick the right group (tradingGroup, accountGroup, or utilGroup):

go
addGroup(rootCmd, tradingGroup.ID, orderCmd, ..., myGroupCmd)

Without this, the command won't appear in --help or --help-all.

After fixing, re-run make generate until it succeeds.

Phase 4: Update golden files

If the command tree or op metadata changed, golden files will be stale:

bash
go test ./internal/cmd -run TestCommandTreeGolden -update
go test ./internal/cmd -run TestOpsGolden -update
Phase 5: Run all checks
bash
make check

This runs golangci-lint, go test -race ./..., and go build. Fix any failures before proceeding.

If tests fail due to golden drift you missed, re-run Phase 4.

Show full SKILL.md (365 more words)Show less
Phase 6: Verify completeness

Review what changed end-to-end:

bash
git diff --stat

Verify:

  • api/specs/ - spec files updated
  • internal/api/*.gen.go - types and clients regenerated
  • internal/cmd/commands.gen.go - command tree regenerated
  • internal/cmd/testdata/*.golden - golden files updated if needed
  • cmd/generate/commands.go - new operations registered if needed
  • internal/cmd/root.go - new top-level parent groups wired via addGroup
  • test/integration/ - integration tests added for new commands

If commands were added, add integration tests in test/integration/. Follow the rules in the "Integration tests" section of AGENTS.md - one file per feature area, t.Parallel() for read-only tests, cleanup for writes. If the endpoint is unavailable on paper (see the paper-unavailable list in AGENTS.md), write a test that accepts either a valid response or a structured JSON error.

If commands or flags were added, removed, or renamed, follow the "Keep docs in sync" section in AGENTS.md.

Keep README.md concise. It should describe command areas and point to alpaca --help-all, <command> --help, and <command> --schema instead of listing generated command tables. Add README detail only when user-facing behavior, safety guidance, authentication, output, or install/update flow changes.

Quick reference

TaskCommand
Pull specsmake spec-update
Generate codemake generate
Update golden filesgo test ./internal/cmd -run TestCommandTreeGolden -update && go test ./internal/cmd -run TestOpsGolden -update
Lint + test + buildmake check
See what changedgit diff --stat
Integration testsmake test-integration (needs API keys)

Key files

FileRoleEditable?
api/specs/*.jsonOAS specs (read-only inputs)No - pull from upstream
cmd/generate/main.goGenerator logicYes
cmd/generate/commands.goCommand registry and parent groupsYes
internal/api/*.gen.goGenerated types and clientsNo - regenerate
internal/cmd/commands.gen.goGenerated Cobra commandsNo - regenerate
internal/cmd/root.goRoot command wiring (addGroup for top-level parents)Yes
internal/cmd/testdata/*.goldenGolden test snapshotsUpdate via -update flag

Anti-Patterns

  • NEVER edit *.gen.go files directly - they are overwritten by make generate. Change the specs or the generator instead.
  • NEVER edit spec files in api/specs/ - fix bugs upstream and re-import with make spec-update.
  • NEVER skip make check after generating - generated code can introduce lint failures or test regressions.
  • NEVER update golden files without reviewing the diff - golden updates should reflect intentional command tree changes, not mask bugs.
  • NEVER add a cmdRegistry entry without examples - the generator enforces this and will fail.
  • NEVER add an operation to cmdSkip without a reason - the reason documents why the endpoint is excluded from the CLI.

© alpacahq, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/alpaca-cli-regenerate of alpacahq/cli.

Open the folder on GitHubat commit 5360627

Compare with similar skills

Alpaca CLI Regenerate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Alpaca CLI Regenerate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Alpaca CLI Regenerate this skillalpacahq/cli178—~2kAutomated safety check: PassApache-2.0
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT
API DesignerJeffallan/claude-skills12k1 repos~2kAutomated safety check: PassMIT
Old Coder API DesignAmazingAng/old-coder750—~3.4kAutomated safety check: PassMIT
API CallerNVIDIA/SkillEvaluator554—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 1 repo~2k tokens
    Backend & APIsAuto-check passed
  • Old Coder API Design

    AmazingAng/old-coder

    Reviews or designs an HTTP/JSON API's endpoints, auth, pagination, versioning and deprecations, guarding against inventing a bespoke interface or silently breaking consumers.

    750 GitHub stars~3.4k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • API Caller

    NVIDIA/SkillEvaluator

    Official

    Call any REST API dynamically. An agent skill from NVIDIA/SkillEvaluator.

    554 GitHub stars~1.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • API Endpoint Contract

    trycompai/comp

    The contract every new or modified API endpoint must follow so it is correct for the public OpenAPI spec, the MCP server (npm @trycompai/mcp-server), the ValidationPipe, and the docs.

    2k GitHub stars~2.7k tokensUpdated today
    Backend & APIsAuto-check passed

More from alpacahq/cli

  • Alpaca CLI

    alpacahq/cli

    Install, configure, and use the Alpaca CLI - a command-line tool for the Alpaca Trading API.

    178 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Alpaca CLI Regenerate

What does Alpaca CLI Regenerate do?

Keep the CLI in sync with upstream OpenAPI specs. An agent skill from alpacahq/cli. Alpaca CLI Regenerate is an agent skill from alpacahq/cli. Keep the CLI in sync with upstream OpenAPI specs.

When should I use Alpaca CLI Regenerate?

Alpaca CLI Regenerate fits situations like: specs changed upstream; A new API endpoint was added; generation is stale; the user says regenerate.

How do I install Alpaca CLI Regenerate in Claude Code?

Run `npx skills add alpacahq/cli --skill alpaca-cli-regenerate -a claude-code`. Or copy the skill folder (.agents/skills/alpaca-cli-regenerate in alpacahq/cli) into .claude/skills/alpaca-cli-regenerate in your project. Claude Code loads it when a task matches its description.

How do I install Alpaca CLI Regenerate in Codex?

Run `npx skills add alpacahq/cli --skill alpaca-cli-regenerate -a codex`. Or copy the skill folder (.agents/skills/alpaca-cli-regenerate in alpacahq/cli) into .agents/skills/alpaca-cli-regenerate in your project. Codex loads it when a task matches its description.

Can I use Alpaca CLI Regenerate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alpacahq/cli --skill alpaca-cli-regenerate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/alpaca-cli-regenerate, .gemini/skills/alpaca-cli-regenerate, .github/skills/alpaca-cli-regenerate and .opencode/skills/alpaca-cli-regenerate in your project.

What does Alpaca CLI Regenerate need to run?

Going by SKILL.md and its folder, Alpaca CLI Regenerate needs the command-line tools its instructions call (make, go and git).

Does Alpaca CLI Regenerate access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Alpaca CLI Regenerate safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Alpaca CLI Regenerate use?

Alpaca CLI Regenerate is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Alpaca CLI Regenerate use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Alpaca CLI Regenerate?

Skills that share tags, products or a category with Alpaca CLI Regenerate: OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars), Use Yaak (mountain-loop/yaak, 19k stars), API Designer (Jeffallan/claude-skills, 12k stars) and Old Coder API Design (AmazingAng/old-coder, 750 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Alpaca CLI Regenerate?

alpacahq (a GitHub organization) maintains it in alpacahq/cli, which has 178 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 9, 2026.

Source: alpacahq/cli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.