Skip to main content
Run stacksdapp init from the repository root to add the Scaffold Stacks frontend, TypeScript bindings, debug UI, git hooks, and agent skill to an existing Clarinet project.

Contents

Requirements

  • Clarinet 3.23+ (for Clarity 6 devnet support)
  • Run from the repo root where Clarinet lives today
Verify with:

What init does

  1. Normalizes layout to contracts/Clarinet.toml and frontend/ when needed
  2. Adds missing frontend template files
  3. Writes stacksdapp.toml if missing
  4. Installs git pre-commit hook (mnemonic guard)
  5. Installs bundled AI agent skill (.cursor/skills/scaffold-stacks/, AGENTS.md)
  6. Runs npm install in frontend/ and contracts/
  7. Runs stacksdapp generate
If frontend/ already exists but frontend/scripts/export-abi.mjs is missing, init exits with an error. Add that script, or move frontend/ temporarily, then run init again.

Standard Clarinet layout

Before:
After (typical):
Entries like path = "contracts/token.clar" in Clarinet.toml still resolve. The file ends up at contracts/contracts/token.clar, with Clarinet.toml under contracts/.

Already scaffold layout

Normalization is skipped. Missing files are filled in, then npm install and stacksdapp generate run.

Layout conflicts

init fails if both of these exist:
  • ./settings
  • ./contracts/settings
Merge or remove one set, then rerun.

Init vs upgrade

Next steps

For local development with auto-deploy:
After cloning, enable git hooks: