feat(cli): add @leadsolutions/lead-protocol for one-command project setup#17
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
mmilanez
approved these changes
Jun 17, 2026
mmilanez
left a comment
Owner
There was a problem hiding this comment.
Reviewed and tested locally. CLI commands (init, handoff, validate, status) work as documented. No .agents/ kernel or schema changes — purely additive cli/ directory. Merging as maintainer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
@leadsolutions/lead-protocol, a zero-install command-line tool for the Lead Protocol. Today, adopting the protocol means cloning a release tag by hand, copying.agents/into your project, and pasting the boot procedure intoCLAUDE.mdandAGENTS.md. This PR collapses that into a single command (npx @leadsolutions/lead-protocol init) and adds three commands to inspect protocol state without needing Python or a server.Problem
The current setup path (documented in the README "Quick Start") is manual and easy to get wrong:
cp -Rthe.agents/scaffold into your project. The exact steps differ between bash and PowerShell, so the docs carry two copies.CLAUDE.mdandAGENTS.mdboot procedures are copy-pasted by hand. There is nothing to keep them consistent, and re-pasting them is the only way to apply an update.handoff.md, whetherdecisions.jsonlandhandoff.mdare schema-valid, the overall picture) means reading files by hand or runningvalidate_state.py, which assumes a working Python install.For a framework whose whole pitch is "nothing forgotten, nothing re-explained", the onboarding and inspection story leans on manual file shuffling.
What this adds
A small TypeScript CLI, published as the scoped package
@leadsolutions/lead-protocol, exposing thelead-protocolbinary with four commands:init- copies the.agents/scaffold into the current directory and writesCLAUDE.mdandAGENTS.md. The generated boot procedure lives inside<lead-protocol>tags, so the command is idempotent: a new file gets the tagged block, an existing file without tags gets the block appended (your content is preserved), and an existing tagged block is replaced in place. It also creates or appends the protocol's.gitignoreentries.--yesskips the confirmation prompt.handoff- prints the current handoff state for an(actor, agent)pair, with--pair,--raw, and--json.validate- validatesdecisions.jsonlandhandoff.mdagainst their JSON schemas (auto-discovers them when no path is given). Exit codes:0passed,1validation errors,2config errors. This is a Node reimplementation, so it needs no Python.status- a one-screen summary of the current protocol state, with--json.The scaffold (
.agents/) is bundled into the package at build time, soinitworks with nogitand no network beyond fetching the package itself. Runtime requirements are Node >= 18 only: nogit, no Python, no server.Usage
Recommended, once the package is published (see "Publishing" below):
Or install globally:
Try it from this branch before it is published on npm:
Changes
cli/package@leadsolutions/lead-protocol(TypeScript, bundled withtsup,commanderfor arg parsing,@inquirer/promptsfor prompts,ajvfor schema validation,chalkfor output).cli/src/commands/:init,handoff,validate,status.cli/src/lib/: project detection, handoff parser, schema validator,<lead-protocol>guideline writer, and shared UI helpers.cli/scripts/sync-templates.mjscopies the.agents/scaffold into the build output so the package is self-contained.cli/scripts/test-pack.mjspacks the package and checks the resulting tarball.cli/README.mddocumenting installation and every command.No kernel, schema, or
.agents/changes: this PR only adds thecli/directory.Testing
npm run buildproducesdist/, andnode dist/index.js --helplists the four commands.init(into a scratch directory, verified.agents/,CLAUDE.md,AGENTS.md, and.gitignore),status,handoff, andvalidateagainst valid and intentionally broken fixtures (confirmed exit codes 0/1).npm run test:packpacks the package and verifies the published file set.npm run typecheckpasses.Publishing to npm (maintainer action)
This package is not on npm yet, so the
npxandnpm install -gcommands above only work after the first publish. Only a maintainer with access to the@leadsolutionsscope can do this. Steps:Create an npm account at https://www.npmjs.com/signup (username, email, password, then confirm the email).
Create the npm organization that owns the scope.
@leadsolutions/lead-protocolis a scoped package and@leadsolutionsis the scope, which must exist as an npm org. Go to https://www.npmjs.com/org/create, set the organization name toleadsolutions, and pick the free "Unlimited public packages" plan. Whoever creates the org can later invite other members as admin or developer.Log in from the terminal with
npm login(prompts for username, password, and the OTP if 2FA is enabled).Publish from the
cli/directory (thepackage.jsonlives there, not at the repo root):cd cli npm publish --access public--access publicis required on the first publish of a scoped package; without it npm tries to publish privately and fails on the free plan. The package already defines aprepublishOnlyscript that runsnpm run build, so the build runs automatically. Only thedist/folder is published (set via thefilesfield).Verify at https://www.npmjs.com/package/@leadsolutions/lead-protocol. After that, anyone can run
npx @leadsolutions/lead-protocol init.For future updates: bump the
versionincli/package.json(for example0.1.0to0.2.0), then runnpm publish --access publicagain fromcli/(the build runs viaprepublishOnly).Exact names used in the code, for reference:
leadsolutionscli/package.json):@leadsolutions/lead-protocollead-protocolnpx @leadsolutions/lead-protocol initChecklist
npm run test:pack)cli/README.md).agents/files were modified