Skip to content

Rename lean-spec to leanspec and publish skills repo#165

Merged
tikazyq merged 5 commits intomainfrom
claude/migrate-skills-repo-Ht5cr
Apr 6, 2026
Merged

Rename lean-spec to leanspec and publish skills repo#165
tikazyq merged 5 commits intomainfrom
claude/migrate-skills-repo-Ht5cr

Conversation

@tikazyq
Copy link
Copy Markdown
Contributor

@tikazyq tikazyq commented Apr 6, 2026

Summary

This PR completes the rename of the CLI from lean-spec to leanspec and establishes a public skills repository for distributing the LeanSpec SDD methodology to AI agents via the Agent Skills framework.

Key Changes

CLI Rename (lean-spec → leanspec)

  • Renamed primary CLI entry point from lean-spec to leanspec
  • Updated packages/cli/package.json to use leanspec as the main binary name
  • Renamed Rust binary from lean-spec to leanspec in rust/leanspec-cli/Cargo.toml
  • Created new packages/cli/bin/leanspec.js entry point
  • Created packages/cli/bin/leanspec-rust.js as the Rust binary wrapper with platform detection and fallback logic
  • Deprecated old lean-spec command with a warning message that delegates to leanspec
  • Updated all build scripts, CI workflows, and documentation to reference leanspec

Public Skills Repository

  • Created new codervisor/skills public repository structure with:
    • .agents/skills/leanspec/SKILL.md — Comprehensive SDD methodology guide covering:
      • Core principles (context economy, discovery-first, intent over implementation)
      • Complete SDD lifecycle (discover, create, refine, implement, check progress)
      • Managing specs (updating, organizing, relationships)
      • Tool reference for all leanspec CLI commands
      • Detailed guidance on choosing between parent/child vs. depends_on relationships
      • Best practices and verification patterns
    • references/workflow.md — Detailed workflow steps with decision points
    • references/best-practices.md — Do's, don'ts, and status verification patterns
    • references/commands.md — Complete CLI command reference
    • references/examples.md — Practical examples and templates
    • README.md — Skill catalog and installation instructions
    • LICENSE — MIT license
    • .github/workflows/validate.yml — CI validation for skill structure

Binary Wrapper Implementation

  • leanspec-rust.js provides robust platform detection:
    • Supports macOS (x64/arm64), Linux (x64), Windows (x64)
    • Validates binary headers (Mach-O, ELF, PE) before execution
    • Falls back through multiple search paths: Rust target directories → platform npm packages → local binaries
    • Includes debug mode (LEANSPEC_DEBUG=1) for troubleshooting
    • Provides helpful error messages with installation instructions

Documentation & Configuration Updates

  • Updated README.md with new skill installation command
  • Updated migration guide and agent configuration docs
  • Updated rust/leanspec-cli/src/commands/skill.rs to reference new skills repo
  • Updated rust/leanspec-cli/templates/AGENTS-with-skill.md with new skill name
  • Updated spec 379 status to in-progress and marked Phase 1 tasks complete

Notable Implementation Details

  • The binary wrapper validates file headers to ensure binaries are valid before execution, preventing cryptic errors from corrupted or missing binaries
  • Fallback search order prioritizes local development builds (Rust target directories) before npm packages, enabling seamless local testing
  • The deprecated lean-spec command shows a yellow warning but continues to work, providing a smooth migration path
  • The SKILL.md includes comprehensive guidance on spec relationships, with a decision flowchart to help agents choose between parent/child (umbrella decomposition) and depends_on (technical blockers)
  • All CLI references throughout the codebase have been updated to use leanspec consistently

https://claude.ai/code/session_018gK1o9NCRbj4paKqGw4Ftd

claude added 3 commits April 6, 2026 08:55
Recover deleted leanspec-sdd skill from git history, rename to leanspec,
and prepare staging directory (skills-repo/) for the codervisor/skills
GitHub repo. Update all references across CLI source, templates, docs,
and README to use `npx skills add codervisor/skills@leanspec`.

Phase 1 of spec 379 (skills content + CI ready, repo creation pending).

https://claude.ai/code/session_018gK1o9NCRbj4paKqGw4Ftd
…pec 379 phase 2)

- Rename Rust binary: [[bin]] name = "leanspec" in Cargo.toml
- Rename npm package: "lean-spec" → "leanspec" in package.json
- Add new leanspec.js / leanspec-rust.js entry points
- Keep lean-spec.js as deprecated alias with warning message
- Update all build scripts, CI workflows, and platform manifests
- Update repository URLs to codervisor/leanspec
- Binary wrapper supports both old and new binary names for transition

https://claude.ai/code/session_018gK1o9NCRbj4paKqGw4Ftd
Copilot AI review requested due to automatic review settings April 6, 2026 12:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames the primary CLI command/package from lean-spec to leanspec across the monorepo, and adds a distributable “skills repo” layout for publishing the LeanSpec SDD methodology via Agent Skills.

Changes:

  • Rename CLI package/binary and update wrappers + CI/scripts/docs to reference leanspec (with a deprecated lean-spec alias).
  • Add skills-repo/ directory containing the public skills repository structure and validation workflow.
  • Update publish/verification scripts and Rust templates/commands to point at codervisor/skills@leanspec.

Reviewed changes

Copilot reviewed 33 out of 38 changed files in this pull request and generated no comments.

Show a summary per file
File Description
specs/379-leanspec-rename-and-skills-distribution/README.md Marks spec status in-progress and checks off completed phase items.
skills-repo/README.md Documents the new public skills catalog and installation command.
skills-repo/LICENSE Adds MIT license text for the skills repository.
skills-repo/.github/workflows/validate.yml Adds CI workflow to validate skill folder structure/frontmatter.
skills-repo/.agents/skills/leanspec/SKILL.md Adds the main SDD methodology skill content for agents.
skills-repo/.agents/skills/leanspec/references/workflow.md Adds detailed workflow reference.
skills-repo/.agents/skills/leanspec/references/examples.md Adds examples for relationships and AGENTS usage.
skills-repo/.agents/skills/leanspec/references/commands.md Adds CLI command reference for the skill.
skills-repo/.agents/skills/leanspec/references/best-practices.md Adds best practices and verification guidance for agents.
scripts/verify-npm-publish.ts Updates publish verification to check leanspec main package.
scripts/verify-npm-packages.mjs Updates verification config to treat leanspec as the main CLI package.
scripts/validate-platform-binaries.ts Updates binary validation to expect leanspec binary names.
scripts/sync-rust-versions.ts Updates repository URL and binary name for CLI family.
scripts/publish-main-packages.ts Updates publish script messaging to leanspec.
scripts/prepare-publish.ts Updates workspace package mapping from lean-specleanspec.
scripts/generate-platform-manifests.ts Updates platform manifest generation to leanspec binary name and repo URL.
scripts/copy-rust-binaries.mjs Updates copied binary list to include leanspec.
scripts/copy-platform-binaries.sh Updates artifact copy/find patterns to leanspec*.
rust/leanspec-cli/templates/AGENTS-with-skill.md Updates template to reference leanspec skill + new install command.
rust/leanspec-cli/src/commands/skill.rs Updates leanspec skill install to install codervisor/skills@leanspec.
rust/leanspec-cli/src/commands/init.rs Updates retry instructions to the new npx skills add codervisor/skills@leanspec syntax.
rust/leanspec-cli/Cargo.toml Renames Rust CLI binary from lean-spec to leanspec.
rust/Cargo.toml Updates Rust workspace repository URL to codervisor/leanspec.
README.md Updates skill installation instructions and points to new skills repo.
packages/cli/package.json Renames npm package to leanspec and adds leanspec bin entry (keeps lean-spec alias).
packages/cli/bin/leanspec.js Adds new JS entry point delegating to the Rust wrapper.
packages/cli/bin/leanspec-rust.js Adds platform-resolving Rust binary wrapper with header validation + fallbacks.
packages/cli/bin/lean-spec.js Converts old entry point into a deprecated alias delegating to new wrapper.
package.json Updates repo-level cli script to call bin/leanspec.js.
docs-site/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guide/usage/advanced-features/agent-configuration.mdx Updates Chinese docs to new skills install command.
docs-site/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guide/migration.mdx Updates Chinese migration docs to new skills install command.
docs-site/docs/guide/usage/advanced-features/agent-configuration.mdx Updates English docs to new skills install command.
docs-site/docs/guide/migration.mdx Updates English migration docs to new skills install command.
bin/leanspec.js Adds root-level CLI shim used by CI to run leanspec wrapper.
bin/lean-spec.js Updates root-level legacy shim to print deprecation warning and delegate.
.github/workflows/publish.yml Updates binary copy paths and validation command to leanspec.
.github/workflows/copilot-setup-steps.yml Updates workflow step labels and verification command to leanspec.
.github/workflows/ci.yml Updates spec validation step to run node bin/leanspec.js ....
Comments suppressed due to low confidence (1)

scripts/verify-npm-publish.ts:152

  • checkOptionalDependencies() is looking for optional dependency names like leanspec-<platform>, but the platform packages are scoped (@leanspec/cli-<platform>), consistent with verifyPlatformPackages() above. This will incorrectly report missing platform deps for the leanspec package; update the expected prefixes to match the actual scoped package names.
    // Check if all platforms are included
    const expectedPrefixes = packageName === 'leanspec' ? 
      PLATFORMS.map(p => `leanspec-${p}`) :
      PLATFORMS.map(p => `@leanspec/mcp-${p}`);
    
    const missing = expectedPrefixes.filter(prefix => 
      !Object.keys(optDeps).some(dep => dep.includes(prefix))
    );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

claude added 2 commits April 6, 2026 12:50
cargo_bin_cmd!("lean-spec") and Command::cargo_bin("lean-spec") fail
because the Cargo binary was renamed to "leanspec" in the Cargo.toml.

https://claude.ai/code/session_018gK1o9NCRbj4paKqGw4Ftd
@tikazyq tikazyq merged commit 9c375e0 into main Apr 6, 2026
3 checks passed
@tikazyq tikazyq deleted the claude/migrate-skills-repo-Ht5cr branch April 6, 2026 13:28
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.

3 participants