Skip to content

Submit solana anchor skill#147

Open
manueldezman wants to merge 4 commits into
solanabr:mainfrom
manueldezman:submit-solana-anchor-skill
Open

Submit solana anchor skill#147
manueldezman wants to merge 4 commits into
solanabr:mainfrom
manueldezman:submit-solana-anchor-skill

Conversation

@manueldezman

Copy link
Copy Markdown

Summary

Adds Solana Anchor Skill, a kit-style skill for building, recovering, testing, and debugging Anchor projects.

Anchor projects are easy to start, but builders repeatedly hit the same rough edges: missing Anchor CLI/AVM setup, unclear scaffold defaults, brittle PDA/account constraints, inconsistent test harnesses, and incomplete generated tests. This skill packages those workflows into one progressive, token-efficient skill that can be invoked naturally from prompts like “create an Anchor program,” “anchor command not found,” “debug PDA seeds,” or “generate Anchor tests.”

Canonical repo: https://github.com/manueldezman/solana-anchor-skill

What This Skill Does

This is one unified solana-anchor skill, not separate scaffold/test/install skills.

It supports:

  • Project creation: guides anchor init with preflight checks instead of blindly scaffolding.
  • CLI recovery: detects missing or broken Anchor CLI, AVM, Solana CLI, PATH, and shim issues with transparent user-approved recovery steps.
  • Program development: helps write/review Anchor instructions, account structs, constraints, PDAs, seeds, bumps, authorities, and custom errors.
  • Test harness detection: inspects the target project before generating tests, so it does not assume the old default TypeScript/Mocha setup when the project uses Rust/LiteSVM or solana-program-test.
  • Runnable test generation: produces actual .ts or .rs tests matching the detected framework, not pseudocode.
  • Coverage reporting: finishes test generation with a clear table of covered instructions, tested constraints, generated edge cases, PDA assertions, and remaining manual/live-state gaps.
  • Local-first testing: defaults to anchor test against local validator/LiteSVM-compatible setup, with Surfpool documented only as an opt-in path when external mainnet state cannot be faked locally.

Why It Matters

A lot of Anchor help stops at “run anchor init” or generates happy-path tests that look plausible but do not survive real projects.

This skill focuses on the parts that cost Solana builders time:

  • test setup detection before generation
  • failure-path coverage for account constraints
  • PDA seed/bump validation
  • wrong signer and authority checks
  • duplicate initialization and uninitialized-account flows
  • numeric boundary coverage for integer account fields and instruction args
  • Surfpool guidance only when live external state is truly required
  • explicit anti-patterns so agents do not silently install tools, assume TypeScript, or claim full coverage when constraints cannot be inferred

Structure

The submission follows the requested kit-style layout inspired by solana-game-skill:

  • README.md
  • LICENSE
  • install.sh
  • agents/openai.yaml
  • commands/
  • skill/SKILL.md
  • focused skill docs under skill/

The skill uses progressive routing from skill/SKILL.md into focused files:

  • scaffolding.md
  • cli-installation.md
  • testing-anchor.md
  • typescript-tests.md
  • rust-tests.md
  • program-patterns.md
  • resources.md
  • anti-patterns.md

Validation

This was not submitted blind. The workflow was exercised locally and the findings were folded back into the skill docs as reusable guidance.

Validation performed:

  • install.sh shell syntax checked successfully.
  • Skill routing and trigger metadata reviewed with rg.
  • Anchor CLI, AVM, and Solana CLI setup were installed/repaired during validation.
  • A disposable Anchor fixture was generated.
  • anchor test completed successfully on the generated fixture.
  • Real scaffold behavior from the current Anchor stack was reflected in the docs, including Rust/LiteSVM scaffold handling.
  • Failure modes discovered during validation were converted into neutral anti-pattern guidance, not incident logs.

Reviewer Notes

The skill is designed to be safe and transparent:

  • no opaque binaries
  • no hidden toolchain installation
  • user approval required before modifying host Anchor/Solana setup
  • MIT licensed
  • install script copies only the skill payload
  • Surfpool is opt-in, not the default
  • generated test guidance requires runnable files and explicit coverage-gap reporting

This should slot cleanly into the kit as a practical Solana builder skill for scaffolding, CLI recovery, Anchor program work, and serious test generation.

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