mcpField
C
cli-forge-scaffold

cli-forge-scaffold

github.com/bytelandtechnologyDevelopment036 installsUpdated 27w ago
Repository

About cli-forge-scaffold

cli-forge-scaffold generates a baseline Rust CLI project from an approved cli-plan.yml. It is for projects whose CLI design is already defined, and follows bundled templates before running Cargo build, lint, format, and test checks.

Key features

  1. 01Expands templates from an approved cli-plan.yml
  2. 02Creates the Rust CLI project structure and baseline files
  3. 03Checks for unresolved template placeholders
  4. 04Runs Cargo build, Clippy, formatting, and tests
  5. 05Generates a scaffold receipt

Use cases

  1. 01Create a project from an approved CLI plan
  2. 02Initialize a consistent Rust CLI baseline
  3. 03Verify a generated project before handoff
  4. 04Record scaffold output and deferred capabilities

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bytelandtechnology/cli-forge --skill cli-forge-scaffold

After installing, type/cli-forge-scaffoldin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

planning-brief.md
contracts/
scaffold-receipt.yml.tpl
instructions/
new.md
templates/
Cargo.toml.tpl
cli_test.rs.tpl
context.rs.tpl
dot-gitignore.tpl
help.rs.tpl
lib.rs.tpl
main.rs.tpl
README.md.tpl
SKILL.md.tpl

Details

From the project README

cli-forge Scaffold

Use this stage when the work is to create a brand-new Rust CLI Skill project from the baseline templates, and the detailed CLI contract (Plan) has already been explicitly defined and approved.

Purpose

Generate the baseline codebase for a new skill using the approved cli-plan.yml and the authoritative templates.

This stage does not make design decisions; it strictly follows the blueprint provided by the Plan stage.

Canonical References

Entry Gate

#CheckSource
1cli-plan.yml exists and is approvedPlan stage
2skill_name is knownPlan stage
3Target project directory DOES NOT existFilesystem

Required Inputs

  • skill_name
  • Approved cli-plan.yml
  • Optional author, version, rust_edition

Workflow

  1. Run the pre-checks from ./instructions/new.md: require the skill name, verify cli-plan.yml, and refuse to overwrite an existing directory.
  2. Create the directory structure.
  3. Expand the templates from ./templates/ EXACTLY as defined by cli-plan.yml and the instruction file, restoring any install-safe dot-* resource alias to its intended dot-prefixed output path.
  4. Verify that no {{token}} placeholders remain unresolved.
  5. Run the required verification commands from the generated project root:
    • cargo build
    • cargo clippy -- -D warnings
    • cargo fmt --check
    • cargo test
  6. Confirm the generated package layout stays within the documented boundary: baseline generated files plus feature-local support files. Repository-owned CI workflows and release scripts stay outside the generated project until Publish.
  7. Generate .cli-forge/scaffold-receipt.yml using the template at ./contracts/scaffold-receipt.yml.tpl.

Outputs

  • A new Rust CLI package directory
  • .cli-forge/scaffold-receipt.yml

Exit Gate

#Check
1All templates expanded with no unresolved tokens
2cargo build passes
3cargo clippy -- -D warnings passes
4cargo fmt --check passes
5cargo test passes
6scaffold-receipt.yml generated

Guardrails

  • Use templates EXCLUSIVELY from the bundled ./templates/ directory for this stage. Do not reach outside this skill package for scaffold templates.
  • Treat dot-* resource names inside ./templates/ as install-safe aliases only. Generated outputs must restore the intended dot-prefixed filename.
  • Do not improvise project structure or dependencies. Everything must be tied back to the cli-plan.yml.
  • The scaffold baseline generates a working one-shot CLI only. Optional capabilities (repl, stream, daemon) are not included in the baseline and must be added by the Extend stage (../cli-forge-extend/SKILL.md) after the baseline project is verified. If cli-plan.yml marks any capability as in_scope, proceed with baseline generation, record the deferred capabilities in scaffold-receipt.yml under deferred_capabilities, and inform the user which features require the Extend stage next.
  • If any Cargo verification step fails, block the workflow and fix the scaffolded files before handing the work forward.

Next Step

If scaffold-receipt.yml lists deferred capabilities, use AskUserQuestion to prompt before handing off. Offer to run extend immediately for each deferred capability. If the user confirms, invoke extend for each deferred capability in order. If the user declines, fall back to enumerating the exact /cli-forge-extend invocation for each (see instructions/new.md Capability Deferral). Otherwise, continue with ../cli-forge-validate/SKILL.md to run the full compliance rule set.

Comments

Markdown supported