bootstrap

SKILL.md

Bootstrap

Teach agents how to scaffold a new Rust+Node.js hybrid project with forge skills, GitHub Actions workflows, publish pipeline, and versioning infrastructure.

When to Use This Skill

Activate when any of the following are true:

  • The user wants to start a new Rust+Node.js project
  • The user says "bootstrap", "init", "scaffold", or "set up a new project"
  • The user wants to add forge infrastructure to an existing repository
  • An empty or near-empty repo needs CI, publishing, and versioning setup

What Gets Scaffolded

The bootstrap process sets up four integrated systems:

System Skill What It Creates
Spec-Driven Dev leanspec-sdd specs/ dir, .lean-spec/config.json
CI/CD hybrid-ci .github/workflows/ci.yml, copilot-setup-steps.yml
Publishing rust-npm-publish publish.config.ts, platform scripts
Versioning monorepo-version-sync Version sync scripts, workspace protocol handling

Bootstrap Flow

Step 1: Gather Project Info

Collect these from the user (or infer from existing files):

Field Example Required
Project name my-tool Yes
npm scope @myorg Yes
Rust binary name(s) my-cli Yes
Cargo package name(s) my-cli-rs Yes
Main npm packages packages/cli Yes
Repository URL github.com/myorg/my-tool Yes
Platforms darwin-x64, darwin-arm64, linux-x64, windows-x64 No (default: all 4)
Node version 22 No (default: 22)

Step 2: Scaffold Structure

Create the project skeleton. See references/project-structure.md for the full tree.

my-tool/
├── .github/workflows/       ← CI + publish workflows
├── .lean-spec/config.json   ← LeanSpec configuration
├── specs/                   ← Spec-driven development
├── packages/cli/            ← Main npm package(s)
├── rust/                    ← Rust workspace (or root Cargo.toml)
├── scripts/                 ← Publish & version scripts
├── publish.config.ts        ← Publish pipeline configuration
├── package.json             ← Root package.json (version source of truth)
├── pnpm-workspace.yaml      ← pnpm workspace definition
├── Cargo.toml               ← Rust workspace manifest
└── turbo.json               ← Turborepo config (optional)

Step 3: Generate Files

Use the templates in this skill to generate files. The templates are config-driven — fill in values from Step 1.

Order matters:

  1. Root configspackage.json, pnpm-workspace.yaml, Cargo.toml, turbo.json
  2. Publish configpublish.config.ts (drives script generation)
  3. Scripts — Copy from rust-npm-publish/templates/scripts/
  4. Workflows — Copy from hybrid-ci/templates/workflows/, customize matrix
  5. LeanSpec — Initialize .lean-spec/config.json and specs/
  6. AGENTS.md — Project-level agent instructions referencing skills

Step 4: Customize Workflows

Update the generated workflows with project-specific values:

  • ci.yml — Adjust build/test/lint commands
  • publish.yml — Set Cargo package names, npm scope, platform packages list
  • copilot-setup-steps.yml — Add project-specific tool installation

Step 5: Verify

Run these checks after scaffolding:

pnpm install                          # Dependencies resolve
pnpm build                            # TypeScript compiles
cargo check --workspace               # Rust compiles
pnpm tsx scripts/sync-versions.ts     # Version sync works

Decision Tree

Starting from scratch?
  YES → Full scaffold (all steps)
  NO  → Incremental setup ↓

Has package.json?
  NO  → Create root package.json + pnpm-workspace.yaml
  YES → Check for pnpm-workspace.yaml

Has Cargo.toml?
  NO  → Create Cargo workspace
  YES → Verify workspace structure

Has .github/workflows/?
  NO  → Generate from hybrid-ci templates
  YES → Review and update existing workflows

Has scripts/ with publish pipeline?
  NO  → Copy from rust-npm-publish templates
  YES → Verify publish.config.ts exists

Has specs/ or .lean-spec/?
  NO  → Initialize LeanSpec
  YES → Skip LeanSpec setup

Templates

This skill references templates from other skills:

Template Source Files
bootstrap/templates/ package.json, pnpm-workspace.yaml, Cargo.toml, turbo.json, AGENTS.md, .lean-spec/config.json, publish.config.ts
hybrid-ci/templates/ Workflow YAMLs, action READMEs
rust-npm-publish/templates/ Publish scripts, type definitions
monorepo-version-sync/templates/ Version sync scripts

References

Setup & Activation

Install via forge:

lean-spec skill install codervisor/forge --skill bootstrap

Auto-activation hints

  • Empty or near-empty repository
  • User mentions "bootstrap", "init", "scaffold", "new project"
  • No .github/workflows/ and no scripts/ directory
Weekly Installs
0
First Seen
12 days ago