Skip to content
anchor-project-scaffold logo

Anchor Project Scaffold

anchor-project-scaffold

Set up a production-ready Anchor workspace: program/client layout, env config, testing, and build hygiene. Use when starting new Anchor projects or re-baselining repos.

SKILL.md

Full skill instructions

Anchor Project Scaffold

Role framing: You are an Anchor setup expert. Your goal is to create a clean, reproducible project scaffold with reliable builds and tests.

Initial Assessment

  • Target cluster(s) and program upgradeability plan?
  • Rust/​Anchor versions pinned? Toolchain manager (rustup) in place?
  • CI/​CD target? (GitHub Actions, local scripts)
  • Expected clients (TS/​Rust) and language versions?
  • IDL distribution plan?

Core Principles

  • Pin versions: rust-toolchain.toml + Anchor.toml to avoid drift.
  • Deterministic IDs: use nchor keys list to capture program ids; commit keypairs or derive from env.
  • Separate configs per cluster; never mix devnet/​localnet ids.
  • Keep client sdk generated and checked in when stability needed.
  • Tests run against local validator with same features as prod.

Workflow

  1. Initialize project: nchor init <name>; set workspace in Anchor.toml.
  2. Configure programs: set programs.<cluster>.id and provider.cluster defaults; store keypairs in arget/​deploy or env.
  3. Set toolchain: create ust-toolchain.toml with pinned stable; update Cargo.toml edition.
  4. Scripts: add npm scripts for nchor build, nchor test, nchor deploy, pnpm lint.
  5. Client setup: generate TypeScript client via nchor build --verifiable; export IDL to pp/​sdk.
  6. Local validator profile: est.validator accounts and airdrops for needed mints; add custom programs if CPI needed.
  7. CI: cache cargo/​target; run nchor test headless; fail on fmt/​clippy.

Templates / Playbooks

  • Env files: .env.localnet, .env.devnet with RPC + keypaths.
  • Script chain: uild -> lint -> test -> deploy with explicit clusters.
  • IDL publish step: commit IDL and generated client; tag release with program id.

Common Failure Modes + Debugging

  • Mismatched program id between lib.rs and Anchor.toml -> re-run nchor keys list and update both.
  • Local validator missing required programs -> add --clone or est.validator entries.
  • CI failing due to solana-test-validator version drift -> pin solana-cli via rustup component.
  • IDL stale vs deployed program -> regenerate after code changes and redeploy.

Quality Bar / Validation

  • nchor test passes locally; fmt+clippy clean.
  • Program ids documented; env files per cluster exist.
  • Client SDK builds; IDL committed.
  • CI workflow present or scriptable.

Output Format

Provide scaffold checklist completion, generated files list, env notes, and next steps for deploy.

Examples

  • Simple: Single program with TS client; localnet config only; IDL generated and copied to pp/​sdk.
  • Complex: Multi-program workspace with shared crate; devnet+mainnet ids separated; CI matrix for lint/​build/​test; IDL published to npm package.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View