new-lead
Prepare a lead's workspace, then run /business-analyst (when installed),
/analyze-requirements, /estimate and /proposal in that order, stopping
between each so the human sees what was produced. Also maintains the leads dashboard: a leads.json registry and a
self-contained local server.
Hard rules
- This skill never interviews. Every question about scope, stack, delivery or
the client belongs to the skill that needs it.
- This skill never renders and never writes a document. Each sub-skill owns its
own validation and its own output.
- The lead id is the folder name under
leads/, verbatim. The filesystem is
the source of truth; leads.json holds business metadata only, and is
written exclusively through scripts/lead-upsert.mjs.
- Stop after each sub-skill returns. The human decides whether the chain
continues.
Workspace
<root>/
├── leads.json the registry
├── start.sh starts the dashboard
├── leads/<lead-id>/ one directory per lead
└── scripts/ serve.mjs, the dashboard pages, lib/, vendor/
Flow
- Dependency check: Node ≥ 20 and
npx likec4 (needed downstream by
analyze-requirements). Either missing → stop before doing any work.
- Find the root: walk up from the working directory for
leads.json
(findLeadsRoot in scripts/lib/registry.mjs). Not found → confirm with the
user, then node scripts/init-root.mjs --root <dir> at cwd, and offer
git init.
- Resolve the target:
/new-lead @leads/<folder>/ → that folder.
/new-lead with no argument → diff readdir(<root>/leads) against
leads.json and print the state table below; the human picks one.
- Adopt (only when the folder has no registry entry) — see Adoption.
- Chain: when the
business-analyst skill is available, the chain is
/business-analyst, /analyze-requirements, /estimate, /proposal;
otherwise recommend installing the business-analyst plugin in one line
(requirements discovery before architecture) and run the three-step
chain. For each step — cd to the lead directory, invoke the skill,
and when it returns, report what it wrote and wait. Skip any step whose
artifact already exists unless the human asks for a re-run.
requirements.json is soft evidence for the later skills, never a
prerequisite.
- Sync the registry after
/proposal — see Registry sync.
- Wrap: start the dashboard (
sh <root>/start.sh) if it is not already
running, and report the URL.
Lead states
| State |
Condition |
Offer |
| new |
folder present, no registry entry |
adopt, then run the chain |
| WIP |
entry present, one of requirements.json (checked only when the business-analyst skill is installed) / ARCHITECTURE.md / estimation.json / proposal.md missing |
resume at the first gap |
| done |
entry present, no artifact from the WIP row missing |
nothing; re-run a named step on request |
| orphan |
entry present, folder gone |
report only — never delete |
Adoption
The folder name must match ^[a-z0-9]+(-[a-z0-9]+)*$. It does not → refuse,
print the exact mv command, and write nothing.
Ask two questions, both skippable:
- client company name — skipped writes
null
- project name — skipped writes Title Case of the folder name
Both answered, and the folder is not already named
<kebab(client)>-<kebab(project)> → offer that rename once. Accepted →
git mv (plain mv outside a repo). Declined, or a folder of that name
already exists → keep the current name and do not ask again.
Write the entry — after any rename, so the id can never name a folder that
no longer exists:
node scripts/lead-upsert.mjs --root <root> --id <folder-name> \
--patch '{"client":<string|null>,"title":"<project>","created":"YYYY-MM-DD"}'
created has no default and the registry rejects an entry without one.
Commit.
Ids need no collision handling: the id is the folder name, and a directory
cannot hold two entries with the same name.
Registry sync
Runs after /proposal, never after /estimate — /estimate emits several
scenarios and picks none; the pick is /proposal's interview.
| Field |
Source |
scenario |
proposal-figures.json .scenario |
value |
.cost.low / .cost.high, currency from proposal.md frontmatter |
client |
proposal.md frontmatter, only when the entry's client is null |
Apply with one lead-upsert.mjs call, then commit.
Failure
A sub-skill that stops short is reported as it stopped — its own error, its own
partial output, left in place. Options: fix the input and re-run that skill,
skip it, or stop the chain. Never re-run a later skill over a missing earlier
artifact; /proposal in particular hard-requires both ARCHITECTURE.md and
estimation.json.
Dependency
Node ≥ 20 and npx likec4. Check both at step 1 and stop if either is missing.
1---2name: new-lead3description: Set up a pre-sales lead workspace and walk the human through the solution-architect skills in order — business-analyst first when installed, then analyze-requirements, estimate, proposal — plus a local leads dashboard. Use when the user says "new lead", points at a folder under leads/, or asks to see their leads pipeline.4---56# new-lead78Prepare a lead's workspace, then run `/business-analyst` (when installed),9`/analyze-requirements`, `/estimate` and `/proposal` in that order, stopping10between each so the human sees what was produced. Also maintains the leads dashboard: a `leads.json` registry and a11self-contained local server.1213## Hard rules14151. This skill never interviews. Every question about scope, stack, delivery or16 the client belongs to the skill that needs it.172. This skill never renders and never writes a document. Each sub-skill owns its18 own validation and its own output.193. The lead id is the folder name under `leads/`, verbatim. The filesystem is20 the source of truth; `leads.json` holds business metadata only, and is21 written exclusively through `scripts/lead-upsert.mjs`.224. Stop after each sub-skill returns. The human decides whether the chain23 continues.2425## Workspace2627```28<root>/29├── leads.json the registry30├── start.sh starts the dashboard31├── leads/<lead-id>/ one directory per lead32└── scripts/ serve.mjs, the dashboard pages, lib/, vendor/33```3435## Flow36371. **Dependency check**: Node ≥ 20 and `npx likec4` (needed downstream by38 `analyze-requirements`). Either missing → stop before doing any work.392. **Find the root**: walk up from the working directory for `leads.json`40 (`findLeadsRoot` in `scripts/lib/registry.mjs`). Not found → confirm with the41 user, then `node scripts/init-root.mjs --root <dir>` at cwd, and offer42 `git init`.433. **Resolve the target**:44 - `/new-lead @leads/<folder>/` → that folder.45 - `/new-lead` with no argument → diff `readdir(<root>/leads)` against46 `leads.json` and print the state table below; the human picks one.474. **Adopt** (only when the folder has no registry entry) — see Adoption.485. **Chain**: when the `business-analyst` skill is available, the chain is49 `/business-analyst`, `/analyze-requirements`, `/estimate`, `/proposal`;50 otherwise recommend installing the business-analyst plugin in one line51 (requirements discovery before architecture) and run the three-step52 chain. For each step — `cd` to the lead directory, invoke the skill,53 and when it returns, report what it wrote and wait. Skip any step whose54 artifact already exists unless the human asks for a re-run.55 `requirements.json` is soft evidence for the later skills, never a56 prerequisite.576. **Sync the registry** after `/proposal` — see Registry sync.587. **Wrap**: start the dashboard (`sh <root>/start.sh`) if it is not already59 running, and report the URL.6061## Lead states6263| State | Condition | Offer |64| --- | --- | --- |65| new | folder present, no registry entry | adopt, then run the chain |66| WIP | entry present, one of `requirements.json` (checked only when the business-analyst skill is installed) / `ARCHITECTURE.md` / `estimation.json` / `proposal.md` missing | resume at the first gap |67| done | entry present, no artifact from the WIP row missing | nothing; re-run a named step on request |68| orphan | entry present, folder gone | report only — never delete |6970## Adoption71721. The folder name must match `^[a-z0-9]+(-[a-z0-9]+)*$`. It does not → refuse,73 print the exact `mv` command, and write nothing.742. Ask two questions, both skippable:75 - client company name — skipped writes `null`76 - project name — skipped writes Title Case of the folder name773. Both answered, and the folder is not already named78 `<kebab(client)>-<kebab(project)>` → offer that rename once. Accepted →79 `git mv` (plain `mv` outside a repo). Declined, or a folder of that name80 already exists → keep the current name and do not ask again.814. Write the entry — *after* any rename, so the id can never name a folder that82 no longer exists:8384 ```85 node scripts/lead-upsert.mjs --root <root> --id <folder-name> \86 --patch '{"client":<string|null>,"title":"<project>","created":"YYYY-MM-DD"}'87 ```8889 `created` has no default and the registry rejects an entry without one.905. Commit.9192Ids need no collision handling: the id is the folder name, and a directory93cannot hold two entries with the same name.9495## Registry sync9697Runs after `/proposal`, never after `/estimate` — `/estimate` emits several98scenarios and picks none; the pick is `/proposal`'s interview.99100| Field | Source |101| --- | --- |102| `scenario` | `proposal-figures.json` `.scenario` |103| `value` | `.cost.low` / `.cost.high`, currency from `proposal.md` frontmatter |104| `client` | `proposal.md` frontmatter, only when the entry's `client` is `null` |105106Apply with one `lead-upsert.mjs` call, then commit.107108## Failure109110A sub-skill that stops short is reported as it stopped — its own error, its own111partial output, left in place. Options: fix the input and re-run that skill,112skip it, or stop the chain. Never re-run a later skill over a missing earlier113artifact; `/proposal` in particular hard-requires both `ARCHITECTURE.md` and114`estimation.json`.115116## Dependency117118Node ≥ 20 and `npx likec4`. Check both at step 1 and stop if either is missing.