leancraft 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/leancraft/SKILL.md +90 -0
- package/.cursor/rules/leancraft.mdc +70 -0
- package/.leancraft/README.md +26 -0
- package/.leancraft/SKILL.md +90 -0
- package/.leancraft/agent/context.md +37 -0
- package/.leancraft/agent/proposals/README.md +24 -0
- package/.leancraft/agent/status.md +31 -0
- package/.leancraft/config.json +357 -0
- package/.leancraft/human/definition/features/042-example-feature.md +32 -0
- package/.leancraft/human/definition/guardrails.md +37 -0
- package/.leancraft/human/definition/intent.md +31 -0
- package/.leancraft/human/definition/system.md +48 -0
- package/.leancraft/human/discovery/00-index.md +40 -0
- package/.leancraft/human/discovery/00-overview.md +31 -0
- package/.leancraft/human/discovery/01-vision.md +29 -0
- package/.leancraft/human/discovery/02-research.md +104 -0
- package/.leancraft/human/discovery/03-competitive.md +28 -0
- package/.leancraft/human/discovery/04-personas.md +24 -0
- package/.leancraft/human/discovery/05-jtbd.md +27 -0
- package/.leancraft/human/discovery/06-prd.md +101 -0
- package/.leancraft/human/sprint/map.md +22 -0
- package/.leancraft/joint/decisions.log.md +21 -0
- package/.leancraft/joint/ledger.jsonl +3 -0
- package/.leancraft/joint/test-report.md +20 -0
- package/.leancraft/templates/definition/feature.md +32 -0
- package/.leancraft/templates/definition/guardrails.md +39 -0
- package/.leancraft/templates/definition/intent.md +33 -0
- package/.leancraft/templates/definition/system.md +47 -0
- package/.leancraft/templates/discovery/00-index.md +40 -0
- package/.leancraft/templates/discovery/00-overview.md +31 -0
- package/.leancraft/templates/discovery/01-vision.md +28 -0
- package/.leancraft/templates/discovery/02-research.md +104 -0
- package/.leancraft/templates/discovery/03-competitive.md +27 -0
- package/.leancraft/templates/discovery/04-personas.md +26 -0
- package/.leancraft/templates/discovery/05-jtbd.md +27 -0
- package/.leancraft/templates/discovery/06-prd.md +102 -0
- package/.leancraft/templates/sprint/map.md +23 -0
- package/.mcp.json +10 -0
- package/AGENTS.md +70 -0
- package/CLAUDE.md +5 -0
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/bin/leancraft.js +128 -0
- package/package.json +55 -0
- package/scripts/install-hooks.mjs +27 -0
- package/scripts/leancraft-lock.mjs +30 -0
- package/scripts/leancraft-sync.mjs +105 -0
- package/scripts/leancraft-validate.mjs +159 -0
- package/scripts/mcp-server.mjs +122 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# 02 — Research — 12 Pain Themes (P1-P12)
|
|
2
|
+
|
|
3
|
+
> Status: DRAFT — Agent drafts, human verifies quotes. Min 12 themes (no max — add P13-P20 if needed). Sources Inventory holds your 50–100 raw posts — more sources = stronger themes. Validator checks ≥12.
|
|
4
|
+
|
|
5
|
+
## P1: [Theme]
|
|
6
|
+
|
|
7
|
+
- **Quote:** "[verbatim]"
|
|
8
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
9
|
+
- **Frequency:**
|
|
10
|
+
- **Severity:** high/medium/low
|
|
11
|
+
|
|
12
|
+
## P2: [Theme]
|
|
13
|
+
|
|
14
|
+
- **Quote:** "[verbatim]"
|
|
15
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
16
|
+
- **Frequency:**
|
|
17
|
+
- **Severity:** high/medium/low
|
|
18
|
+
|
|
19
|
+
## P3: [Theme]
|
|
20
|
+
|
|
21
|
+
- **Quote:** "[verbatim]"
|
|
22
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
23
|
+
- **Frequency:**
|
|
24
|
+
- **Severity:** high/medium/low
|
|
25
|
+
|
|
26
|
+
## P4: [Theme]
|
|
27
|
+
|
|
28
|
+
- **Quote:** "[verbatim]"
|
|
29
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
30
|
+
- **Frequency:**
|
|
31
|
+
- **Severity:** high/medium/low
|
|
32
|
+
|
|
33
|
+
## P5: [Theme]
|
|
34
|
+
|
|
35
|
+
- **Quote:** "[verbatim]"
|
|
36
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
37
|
+
- **Frequency:**
|
|
38
|
+
- **Severity:** high/medium/low
|
|
39
|
+
|
|
40
|
+
## P6: [Theme]
|
|
41
|
+
|
|
42
|
+
- **Quote:** "[verbatim]"
|
|
43
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
44
|
+
- **Frequency:**
|
|
45
|
+
- **Severity:** high/medium/low
|
|
46
|
+
|
|
47
|
+
## P7: [Theme]
|
|
48
|
+
|
|
49
|
+
- **Quote:** "[verbatim]"
|
|
50
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
51
|
+
- **Frequency:**
|
|
52
|
+
- **Severity:** high/medium/low
|
|
53
|
+
|
|
54
|
+
## P8: [Theme]
|
|
55
|
+
|
|
56
|
+
- **Quote:** "[verbatim]"
|
|
57
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
58
|
+
- **Frequency:**
|
|
59
|
+
- **Severity:** high/medium/low
|
|
60
|
+
|
|
61
|
+
## P9: [Theme]
|
|
62
|
+
|
|
63
|
+
- **Quote:** "[verbatim]"
|
|
64
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
65
|
+
- **Frequency:**
|
|
66
|
+
- **Severity:** high/medium/low
|
|
67
|
+
|
|
68
|
+
## P10: [Theme]
|
|
69
|
+
|
|
70
|
+
- **Quote:** "[verbatim]"
|
|
71
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
72
|
+
- **Frequency:**
|
|
73
|
+
- **Severity:** high/medium/low
|
|
74
|
+
|
|
75
|
+
## P11: [Theme]
|
|
76
|
+
|
|
77
|
+
- **Quote:** "[verbatim]"
|
|
78
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
79
|
+
- **Frequency:**
|
|
80
|
+
- **Severity:** high/medium/low
|
|
81
|
+
|
|
82
|
+
## P12: [Theme]
|
|
83
|
+
|
|
84
|
+
- **Quote:** "[verbatim]"
|
|
85
|
+
- **Source:** https://... — Date: YYYY-MM-DD — Platform: Reddit/X/HN/G2
|
|
86
|
+
- **Frequency:**
|
|
87
|
+
- **Severity:** high/medium/low
|
|
88
|
+
|
|
89
|
+
## Sources Inventory (50–100 raw posts — more = stronger)
|
|
90
|
+
|
|
91
|
+
| # | URL | Platform | Date | Pain |
|
|
92
|
+
|---|---|---|---|---|
|
|
93
|
+
| 1 | | | | P1 |
|
|
94
|
+
| ... | | | | |
|
|
95
|
+
|
|
96
|
+
## Synthesis
|
|
97
|
+
|
|
98
|
+
- Top 3 by frequency:
|
|
99
|
+
|
|
100
|
+
## Validation
|
|
101
|
+
|
|
102
|
+
- [ ] P1-P12 headings present (add P13+ if needed — validator checks ≥12)
|
|
103
|
+
- [ ] Each has Quote + URL + Date
|
|
104
|
+
- [ ] ≥12 unique URLs (50–100 recommended)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 03 — Competitive Teardown
|
|
2
|
+
|
|
3
|
+
> REQUIRED: competitors, pricing-table (with $), wedges. Min 9 competitors, min 5 wedges.
|
|
4
|
+
|
|
5
|
+
## Competitors (9+)
|
|
6
|
+
|
|
7
|
+
| # | Name | URL | Pricing | Strength | Weakness |
|
|
8
|
+
|---|---|---|---|---|---|
|
|
9
|
+
| 1 | [Competitor 1] | https://... | $X/mo | ... | ... |
|
|
10
|
+
| ... | ... | ... | ... | ... | ... |
|
|
11
|
+
|
|
12
|
+
## Pricing Table (must have $)
|
|
13
|
+
|
|
14
|
+
| Competitor | Free | Starter | Pro | Enterprise |
|
|
15
|
+
|---|---|---|---|---|
|
|
16
|
+
| | $0 | $ | $ | $ |
|
|
17
|
+
|
|
18
|
+
## Our 7 Wedges (why we win)
|
|
19
|
+
|
|
20
|
+
1. ...
|
|
21
|
+
2. ...
|
|
22
|
+
|
|
23
|
+
## Validation
|
|
24
|
+
|
|
25
|
+
- [ ] ≥9 competitors with URLs
|
|
26
|
+
- [ ] Pricing table has $ values (validator checks `$` or `€` or `£`)
|
|
27
|
+
- [ ] ≥5 wedges
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# 04 — Personas — 5 Personas + Affinity Map
|
|
2
|
+
|
|
3
|
+
> REQUIRED: 5 personas, each with goals/pains/jtbd, plus affinity map. Min 5.
|
|
4
|
+
|
|
5
|
+
## Persona 1: [Name] — [Role, e.g., Solo Sree, Agency Maria]
|
|
6
|
+
|
|
7
|
+
- **Demographics:** age, role, tech level
|
|
8
|
+
- **Goals:** ...
|
|
9
|
+
- **Pains:** (link to P# from 02-research.md)
|
|
10
|
+
- **JTBD:** When ... I want ... So ...
|
|
11
|
+
- **Behaviors:** ...
|
|
12
|
+
- **Quote:** "[from research]"
|
|
13
|
+
|
|
14
|
+
... (Persona 2-5 same structure) ...
|
|
15
|
+
|
|
16
|
+
## Affinity Map
|
|
17
|
+
|
|
18
|
+
| Theme | P1 | P2 | P3 | P4 | P5 |
|
|
19
|
+
|---|---|---|---|---|---|
|
|
20
|
+
| Pain X | ● | | ● | | ● |
|
|
21
|
+
|
|
22
|
+
## Validation
|
|
23
|
+
|
|
24
|
+
- [ ] 5 personas, each has goals/pains/jtbd
|
|
25
|
+
- [ ] Each pain links to P# from 02-research.md
|
|
26
|
+
- [ ] Affinity map present
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 05 — JTBD + Empathy Maps + Pain Matrix
|
|
2
|
+
|
|
3
|
+
> REQUIRED: jtbd-statements, empathy-maps, pain-matrix
|
|
4
|
+
|
|
5
|
+
## JTBD Statements (per persona)
|
|
6
|
+
|
|
7
|
+
- **When** [situation] **I want** [motivation] **So I can** [outcome] — Persona: [Name] — Pain: P#
|
|
8
|
+
|
|
9
|
+
## Empathy Maps (1 per persona)
|
|
10
|
+
|
|
11
|
+
### Persona: [Name]
|
|
12
|
+
- **Says:** ...
|
|
13
|
+
- **Thinks:** ...
|
|
14
|
+
- **Does:** ...
|
|
15
|
+
- **Feels:** ...
|
|
16
|
+
|
|
17
|
+
## Cross-Persona Pain Matrix
|
|
18
|
+
|
|
19
|
+
| Pain | P1 | P2 | P3 | P4 | P5 | Priority |
|
|
20
|
+
|---|---|---|---|---|---|---|
|
|
21
|
+
| P1: ... | 3 | 1 | 3 | 2 | 1 | P0 |
|
|
22
|
+
|
|
23
|
+
## Validation
|
|
24
|
+
|
|
25
|
+
- [ ] JTBD present per persona
|
|
26
|
+
- [ ] 5 empathy maps (says/thinks/does/feels)
|
|
27
|
+
- [ ] Pain matrix present
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# 06 — PRD — Goals, Flows, Reqs
|
|
2
|
+
|
|
3
|
+
> REQUIRED: goals, non-goals, user-flows (≥3), functional-reqs (≥10), nfrs, risks, success-metrics, assumptions, stakeholders, raci, pestel, 4-whys, timeline, legal. Lean overview, not 20 pages.
|
|
4
|
+
|
|
5
|
+
## Goals (P0/P1)
|
|
6
|
+
|
|
7
|
+
- P0: ...
|
|
8
|
+
- P1: ...
|
|
9
|
+
|
|
10
|
+
## Non-Goals (explicit)
|
|
11
|
+
|
|
12
|
+
- Not building: ...
|
|
13
|
+
|
|
14
|
+
## Success Metrics (North Star + Activation)
|
|
15
|
+
|
|
16
|
+
| Metric | Target | Source |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| North Star | ... | 01-vision.md |
|
|
19
|
+
| Activation | ... | 04-personas.md |
|
|
20
|
+
| Retention | ... | 05-jtbd.md |
|
|
21
|
+
|
|
22
|
+
## Assumptions + Open Questions
|
|
23
|
+
|
|
24
|
+
| Assumption | How to test | Owner |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| ... | ... | PM |
|
|
27
|
+
|
|
28
|
+
## User Flows (≥3, with steps)
|
|
29
|
+
|
|
30
|
+
### Flow 1: [Name] — Persona: [Name]
|
|
31
|
+
1. User ...
|
|
32
|
+
2. System ...
|
|
33
|
+
3. ...
|
|
34
|
+
|
|
35
|
+
## Functional Reqs (≥10, testable)
|
|
36
|
+
|
|
37
|
+
| ID | Req | Persona | Flow | Priority |
|
|
38
|
+
|---|---|---|---|---|
|
|
39
|
+
| FR-01 | As [persona] I can ... | P1 | F1 | P0 |
|
|
40
|
+
|
|
41
|
+
## NFRs
|
|
42
|
+
|
|
43
|
+
- Performance: ...
|
|
44
|
+
- Security: ...
|
|
45
|
+
- A11y: WCAG AA
|
|
46
|
+
- i18n:
|
|
47
|
+
|
|
48
|
+
## Stakeholders / Dependencies (overview)
|
|
49
|
+
|
|
50
|
+
| Role / System | Person / API | Dependency |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| ... | ... | ... |
|
|
53
|
+
|
|
54
|
+
## RACI (light)
|
|
55
|
+
|
|
56
|
+
| Decision | R | A | C | I |
|
|
57
|
+
|---|---|---|---|---|
|
|
58
|
+
| ... | ... | ... | ... | ... |
|
|
59
|
+
|
|
60
|
+
## PESTEL (light — 1 line each)
|
|
61
|
+
|
|
62
|
+
- P:
|
|
63
|
+
- E:
|
|
64
|
+
- S:
|
|
65
|
+
- T:
|
|
66
|
+
- E:
|
|
67
|
+
- L:
|
|
68
|
+
|
|
69
|
+
## 4 Whys
|
|
70
|
+
|
|
71
|
+
- Why now:
|
|
72
|
+
- Why us:
|
|
73
|
+
- Why this problem:
|
|
74
|
+
- Why not others:
|
|
75
|
+
|
|
76
|
+
## Timeline / Milestones (light Gantt)
|
|
77
|
+
|
|
78
|
+
| Milestone | Target | Owner | Depends on |
|
|
79
|
+
|---|---|---|---|
|
|
80
|
+
| M1 | Wk 4 | Eng | FR-01-05 |
|
|
81
|
+
|
|
82
|
+
## Legal / Compliance (overview)
|
|
83
|
+
|
|
84
|
+
- Data / PII:
|
|
85
|
+
- IP / License:
|
|
86
|
+
- Regulatory:
|
|
87
|
+
|
|
88
|
+
## Risks
|
|
89
|
+
|
|
90
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
91
|
+
|---|---|---|---|
|
|
92
|
+
| | | | |
|
|
93
|
+
|
|
94
|
+
## Validation
|
|
95
|
+
|
|
96
|
+
- [ ] ≥3 flows with steps
|
|
97
|
+
- [ ] ≥10 FRs with IDs
|
|
98
|
+
- [ ] Success Metrics (North Star + Activation)
|
|
99
|
+
- [ ] Assumptions + Open Questions
|
|
100
|
+
- [ ] RACI, PESTEL, 4 Whys, Timeline, Legal present (overview)
|
|
101
|
+
- [ ] Non-goals listed
|
|
102
|
+
- [ ] NFRs present
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Sprint — Map (Day 1)
|
|
2
|
+
|
|
3
|
+
> Design Sprint Day 1 — Human owns, agent READ-ONLY
|
|
4
|
+
|
|
5
|
+
## How-Might-We
|
|
6
|
+
|
|
7
|
+
- HMW ...
|
|
8
|
+
|
|
9
|
+
## Target
|
|
10
|
+
|
|
11
|
+
- Persona:
|
|
12
|
+
- Moment:
|
|
13
|
+
- Success metric:
|
|
14
|
+
|
|
15
|
+
## Map (user journey)
|
|
16
|
+
|
|
17
|
+
1. ...
|
|
18
|
+
2. ...
|
|
19
|
+
|
|
20
|
+
## Validation
|
|
21
|
+
|
|
22
|
+
- [ ] HMW present
|
|
23
|
+
- [ ] Target has persona + metric
|
package/.mcp.json
ADDED
package/AGENTS.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# AGENTS.md — Leancraft Doc-First Repo
|
|
2
|
+
|
|
3
|
+
> This file is auto-read by Claude Code, Opencode, Cursor. Do not skip.
|
|
4
|
+
|
|
5
|
+
You are in a **Leancraft** repo. This is a doc-first, human-owned system. Your job is to draft, not decide. Human locks, you propose.
|
|
6
|
+
|
|
7
|
+
## MANDATORY READ SEQUENCE (every run, no exceptions)
|
|
8
|
+
|
|
9
|
+
1. `.leancraft/config.json` — the registry. `locked`, `docRegistry`, `budget`, `researchMap`. This is law.
|
|
10
|
+
2. `.leancraft/human/discovery/00-index.md` → `00-overview.md` → target doc
|
|
11
|
+
3. `.leancraft/human/definition/intent.md` + `guardrails.md` — invariants + security rules you MUST obey
|
|
12
|
+
4. `.leancraft/agent/context.md` — 500-line compressed memory (anti context-rot)
|
|
13
|
+
5. Template in `.leancraft/templates/**` for the doc you are about to write
|
|
14
|
+
|
|
15
|
+
If any `human/**` is `DRAFT` or missing, **do not code**. Draft docs first, run `validate`, then ask to Lock.
|
|
16
|
+
|
|
17
|
+
## OWNERSHIP — HARD RULES
|
|
18
|
+
|
|
19
|
+
- `human/**` — READ-ONLY when `locked:true`. NEVER call `write`/`edit` on it. To change it, write `agent/proposals/NNN-<target>.md` with `Source, Why, Diff` and ask `[🔓 Unlock / ❌ Don't]`. Hook will reject direct edits.
|
|
20
|
+
- `agent/**` — You own. Keep `context.md` + `status.md` updated. Max 500 lines for `context.md`.
|
|
21
|
+
- `joint/**` — Append only, cite `source doc + line`.
|
|
22
|
+
|
|
23
|
+
## REGISTRY IS TIGHT — NO HALLUCINATION
|
|
24
|
+
|
|
25
|
+
- You may ONLY create docs listed in `config.json.docRegistry`. Do not invent `13-future.md`.
|
|
26
|
+
- Each doc has `required sections` + `min counts`. `validate` will block Lock if you miss one.
|
|
27
|
+
- **Never hallucinate URLs, quotes, or pricing.** Every quote in `02-research.md` needs verbatim `Quote + URL + Date + Platform` that is fetchable. Every competitor in `03-competitive.md` needs real URL + pricing with `$`. `validate` checks counts; human checks truth.
|
|
28
|
+
|
|
29
|
+
## RESEARCH MAP — WHAT TO SEARCH PER DOC (type, not tool name)
|
|
30
|
+
|
|
31
|
+
Your `web_search` may be `tavily_search`, `exa_search`, `brave_search`, or `WebSearch` — any counts. Your `web_fetch` may be `firecrawl`, `exa_fetch`, `WebFetch`, or `fetch` — any counts. Match by **type**, not name.
|
|
32
|
+
|
|
33
|
+
| Doc | Search / Derive | Type Needed | Examples | What to compile |
|
|
34
|
+
|---|---|---|---|---|
|
|
35
|
+
| `02-research.md` | Search `{idea} pain, {idea} reddit, {idea} alternative, {idea} complaint` on Reddit/X/HN/G2 | `web_search` + `web_fetch` | Tavily/Exa/Brave/WebSearch + Firecrawl/Exa_Fetch/WebFetch | 12 pains P1-P12, each with Quote + URL + Date |
|
|
36
|
+
| `03-competitive.md` | Search `{idea} vs, {idea} alternative, {idea} pricing` | `web_search` | Tavily/Exa/Brave/WebSearch | 9+ competitors with URL + pricing table ($), 5+ wedges |
|
|
37
|
+
| `04-personas.md` | **DERIVE FROM `02-research.md` P# ONLY** — no new search | — | — | 5 personas, each pain links to P#, + affinity map |
|
|
38
|
+
| `05-jtbd.md` | **DERIVE FROM `02,03,04`** | — | — | JTBD per persona + empathy maps + pain matrix |
|
|
39
|
+
| `06-prd.md` | **DERIVE FROM `02,04,05`** | — | — | ≥3 flows, ≥10 FRs (FR-01...), NFRs, risks |
|
|
40
|
+
| `intent.md` | **DISTILL FROM `06-prd.md`** | — | — | ≥3 invariants (I1:) with Check command + ≥2 oracles |
|
|
41
|
+
| `system.md` | **DISTILL FROM `06,02`** | repo scan | — | Pinned stack + architecture + decisions |
|
|
42
|
+
| `guardrails.md` | **DISTILL FROM `system.md`** | — | — | Security/perf/a11y/i18n with Check commands |
|
|
43
|
+
| `features/*.md` | **1 per flow from `06-prd.md`** — `042-kebab-case.md` | — | — | Invariants + oracles + acceptance + Source Trace |
|
|
44
|
+
|
|
45
|
+
**If you have no tool of that type:** STOP. Do NOT invent. Write to `agent/status.md`: `BLOCKED: No web_search available — human must provide 02-research.md or connect a search connector (Tavily/Exa/Brave)` and append to `joint/decisions.log.md`. Ask human directly in chat. Also log: `Inform user in chat + docs that web search is unavailable and human must paste research or enable a connector.`
|
|
46
|
+
|
|
47
|
+
**Anti-hallucination:** If your `web_search` returns 0 results, say so in `status.md`, do not invent. For `04,05,06,intent` you MUST cite `P#`/`FR-#` — inventing a new pain is a failure.
|
|
48
|
+
|
|
49
|
+
## ONE DOC PER FEATURE — HARD RULE
|
|
50
|
+
|
|
51
|
+
- `human/definition/features/` — `NNN-kebab-case.md` (e.g., `042-pdf-export.md`), 1 per flow from `06-prd.md`.
|
|
52
|
+
- Each feature doc has `intent, invariants (with Check), oracles, acceptance, Source Trace: FR-# + Persona`.
|
|
53
|
+
- Do not put 2 features in one doc. Do not create a feature doc before `06-prd.md` has that flow. `validate` will warn if feature has no trace.
|
|
54
|
+
|
|
55
|
+
## DEFINITION OF DONE — BEFORE CLAIMING DONE
|
|
56
|
+
|
|
57
|
+
- [ ] `npm run leancraft:validate` → PASS (no TODO, all sections, min counts, URLs)
|
|
58
|
+
- [ ] No fabricated URLs, quotes, or test results
|
|
59
|
+
- [ ] `npm run leancraft:sync` → `agent/context.md` + `status.md` updated, `ledger.jsonl` appended
|
|
60
|
+
- [ ] If `locked`, you did NOT edit `human/**`
|
|
61
|
+
- [ ] Teach-back ready: you can explain invariant + why without reading code
|
|
62
|
+
|
|
63
|
+
Never claim `done` while `validate` is red. Never fabricate.
|
|
64
|
+
|
|
65
|
+
## BUDGET & SANDBOX
|
|
66
|
+
|
|
67
|
+
- Max $5, 25 calls, 30 min. Network `deny-all` except `allowlist` in `.leancraft/config.json` (default: `registry.npmjs.org`, `registry.yarnpkg.com`, `pypi.org` — covers `npm`/`pnpm`/`bun`/`npx`, they all use the same registry). Never read `.env`, `DATABASE_URL`, `GITHUB_TOKEN` is read-only.
|
|
68
|
+
- **Non-tech: you never edit allowlist manually.** Agent detects needed hosts from `system.md` / `package.json` / network error, then asks you in chat: `[Allow api.stripe.com? / Deny]` + writes a proposal to `agent/proposals/`. You click Allow → agent updates `config.json` for you. No manual JSON edit.
|
|
69
|
+
|
|
70
|
+
Full skill: `.claude/skills/leancraft/SKILL.md` + `.leancraft/config.json`
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# CLAUDE.md — Leancraft
|
|
2
|
+
|
|
3
|
+
Read `AGENTS.md` — it is the single source of truth for this repo. Then read `.leancraft/config.json` + `.leancraft/human/discovery/00-index.md` + `.leancraft/human/definition/intent.md` + `.leancraft/human/definition/guardrails.md` + `.leancraft/agent/context.md` before any action.
|
|
4
|
+
|
|
5
|
+
You are in doc-first mode. Human owns `human/**` when locked. You own `agent/**`. See AGENTS.md for registry, research map, and definition of done.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sree-pm
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Leancraft - Doc-First Verified Agency
|
|
2
|
+
|
|
3
|
+
> Stop vibe coding. Start owning.
|
|
4
|
+
|
|
5
|
+
**Leancraft is a doc-first scaffold that locks human intent and leashes agentic coding.** Your agent can draft 12 pains, 5 personas, 50 reqs — but it cannot ship until `validate` passes and you click Lock. After Lock, `human/**` is read-only; agent must propose.
|
|
6
|
+
|
|
7
|
+
Fixes the 25 vibe-coding failures (62% vulns, 9-sec DB wipes, 19% slowdown, context rot) with one `npx` install.
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/leancraft) [](LICENSE)
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
Vibe coding: `Prompt → Code → Hope`. Leancraft: `Doc (locked) → Bounded Agency → Verification → Code is projection`.
|
|
14
|
+
|
|
15
|
+
- **Tight registry:** 13 docs with required sections + min counts (12 pains P1-P12, 9 competitors + $, 5 personas, 3 flows + 10 FRs). `validate` blocks Lock if you miss one.
|
|
16
|
+
- **Ownership:** `human/**` 🔒, `agent/**` 🤖 auto, `joint/**` 👥. Hook rejects agent writes to `human/**`.
|
|
17
|
+
- **Anti-hallucination:** Research map per doc — `02-research` must `web_search + web_fetch` (Tavily/Exa/Brave/WebSearch + Firecrawl/Exa_Fetch/WebFetch — any counts) on Reddit/X/HN/G2, each pain needs `Quote + URL + Date`. `03-competitive` needs real pricing with `$`.
|
|
18
|
+
- **One doc per feature:** `human/definition/features/042-kebab-case.md` — 1 per flow from PRD.
|
|
19
|
+
|
|
20
|
+
## Install — 1 Command
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx leancraft init
|
|
24
|
+
# scaffolds .leancraft/ + skills + hooks + .mcp.json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or with npm:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -D leancraft
|
|
31
|
+
npx leancraft init
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Quickstart (first idea)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 1. Agent drafts docs (first time, unlocked)
|
|
38
|
+
# Prompt your agent: "Bootstrap from idea: Infonaut — $10/mo infobots for solo founders"
|
|
39
|
+
|
|
40
|
+
# 2. Human reviews, then:
|
|
41
|
+
npx leancraft validate # must PASS (no TODO, all sections, min counts, URLs)
|
|
42
|
+
npx leancraft lock # 🔒 human owns, agent read-only
|
|
43
|
+
|
|
44
|
+
# 3. Agent now codes
|
|
45
|
+
# Agent reads .leancraft/human/definition/intent.md + guardrails.md + agent/context.md
|
|
46
|
+
# Needs change? → writes agent/proposals/NNN-*.md → asks [🔓 Unlock / ❌ Don't]
|
|
47
|
+
|
|
48
|
+
# 4. Keep in sync
|
|
49
|
+
npx leancraft sync # also auto on git commit
|
|
50
|
+
|
|
51
|
+
# Unlock if you must:
|
|
52
|
+
npx leancraft unlock
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Repo Layout After `init`
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
.leancraft/
|
|
59
|
+
├── config.json ← Registry: which docs, sections, budget, lock
|
|
60
|
+
├── human/ ← 🔒 HUMAN-OWNED — agent READ-ONLY
|
|
61
|
+
│ ├── discovery/ 00-index, 00-overview, 01-vision, 02-research, 03-competitive, 04-personas, 05-jtbd, 06-prd
|
|
62
|
+
│ ├── definition/ intent.md, system.md, guardrails.md, features/*.md
|
|
63
|
+
│ └── sprint/ map.md
|
|
64
|
+
├── agent/ ← 🤖 AUTO — human READ-ONLY
|
|
65
|
+
│ ├── context.md (500 lines, compressed memory)
|
|
66
|
+
│ ├── status.md (live tracker)
|
|
67
|
+
│ └── proposals/ (agent's PRs to human)
|
|
68
|
+
└── joint/ decisions.log.md + ledger.jsonl + test-report.md
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
See `.leancraft/README.md` for the full map. Templates live in `.leancraft/templates/**`.
|
|
72
|
+
|
|
73
|
+
## Agentic Tools — How To Connect
|
|
74
|
+
|
|
75
|
+
Leancraft works with any agent. Pick yours — same `init`, same docs.
|
|
76
|
+
|
|
77
|
+
### Claude Code
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npx leancraft init
|
|
81
|
+
# Skills auto-installed to .claude/skills/leancraft/SKILL.md + CLAUDE.md + AGENTS.md
|
|
82
|
+
# Claude Code reads AGENTS.md on every run automatically
|
|
83
|
+
# MCP: uses .mcp.json (leancraft mcp server)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Verify: open Claude Code, type `/skills` → `leancraft` should appear.
|
|
87
|
+
|
|
88
|
+
### Cursor
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx leancraft init
|
|
92
|
+
# Rule auto-installed to .cursor/rules/leancraft.mdc (alwaysApply: true)
|
|
93
|
+
# Cursor reads it on every chat automatically
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Also add MCP: Cursor Settings → Features → MCP → Add server → `node ./scripts/mcp-server.mjs` or point to `.mcp.json`.
|
|
97
|
+
|
|
98
|
+
### Opencode
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx leancraft init
|
|
102
|
+
# Skill auto-installed to .opencode/skills/leancraft/SKILL.md
|
|
103
|
+
# Opencode reads AGENTS.md at root automatically
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Windsurf / Codex / Cline
|
|
107
|
+
|
|
108
|
+
Any agent that reads `AGENTS.md` at repo root works out of the box. For MCP:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# .mcp.json is scaffolded. Point your agent's MCP config at:
|
|
112
|
+
node ./scripts/mcp-server.mjs
|
|
113
|
+
# Tools: leancraft_read_intent, leancraft_get_context, leancraft_propose_change, leancraft_validate
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### GitHub Copilot / VS Code
|
|
117
|
+
|
|
118
|
+
Works as file-based guardrails — no MCP needed. Copilot reads `AGENTS.md` + `.leancraft/human/definition/intent.md` via workspace context. For best results, add `#file:.leancraft/human/definition/intent.md` to your prompt.
|
|
119
|
+
|
|
120
|
+
### Generic (any agent)
|
|
121
|
+
|
|
122
|
+
1. Ensure `AGENTS.md` at repo root exists (scaffolded by `init`)
|
|
123
|
+
2. Ensure `.leancraft/config.json` exists — it is the contract
|
|
124
|
+
3. Agent's first prompt should be: `Read AGENTS.md and .leancraft/config.json, then bootstrap discovery per registry`
|
|
125
|
+
|
|
126
|
+
## MCP
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npx leancraft mcp # prints .mcp.json snippet
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`scripts/mcp-server.mjs` exposes:
|
|
133
|
+
|
|
134
|
+
- `leancraft_read_intent` — must call first (returns intent + guardrails + budget + registry)
|
|
135
|
+
- `leancraft_get_context` — compressed 500-line memory (anti context-rot)
|
|
136
|
+
- `leancraft_propose_change` — write to `agent/proposals/` when locked
|
|
137
|
+
- `leancraft_validate` — run registry checks
|
|
138
|
+
|
|
139
|
+
Add to your agent's MCP config:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{ "mcpServers": { "leancraft": { "command": "node", "args": ["./scripts/mcp-server.mjs"] } } }
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## CLI
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
npx leancraft --help
|
|
149
|
+
npx leancraft init [--force]
|
|
150
|
+
npx leancraft validate
|
|
151
|
+
npx leancraft sync
|
|
152
|
+
npx leancraft lock
|
|
153
|
+
npx leancraft unlock
|
|
154
|
+
npx leancraft status
|
|
155
|
+
npx leancraft mcp
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Validation
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npm run leancraft:validate # or npx leancraft validate
|
|
162
|
+
# Checks: required docs + required sections + min counts (12 pains, 9 competitors, 5 personas, 10 FRs, 3 invariants) + URLs + no TODO
|
|
163
|
+
# Exit 0 = PASS → Lock allowed, 1 = FAIL → Lock blocked
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Cost & ROI — Dogfooded
|
|
167
|
+
|
|
168
|
+
> Doc overhead is `3.2k` tokens/read (`~$0.01`), `30–40k` one-time to draft 13 docs. Per feature it saves `~10k` tokens & `~0.7h` after 2 features — measured on this repo itself (`45k chars / 11.3k tokens` total on disk, `3.2k` per run, 2026-08-30).
|
|
169
|
+
|
|
170
|
+
Assumptions: Claude pricing ($3/$15 per 1M), 1 feature = `10k` gen + `15k` debug vibe vs `13k` doc-first. Based on METR -19% slowdown without context and GitClear 41% churn. Your stack will vary — track `joint/ledger.jsonl` $/feature and `agent/status.md` time to verify. PR your numbers — we publish community ROI.
|
|
171
|
+
|
|
172
|
+
## Ownership
|
|
173
|
+
|
|
174
|
+
- `human/**` — READ-ONLY when `locked:true` (see `.github/CODEOWNERS`, `.git/hooks/pre-commit`). Agent must propose.
|
|
175
|
+
- `agent/**` — Agent owns, auto-generated
|
|
176
|
+
- `joint/**` — Both append
|
|
177
|
+
|
|
178
|
+
## Contributing
|
|
179
|
+
|
|
180
|
+
See `CONTRIBUTING.md`. Run `npm run leancraft:validate` before PR.
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
MIT — see `LICENSE`.
|
|
185
|
+
|
|
186
|
+
## Roadmap
|
|
187
|
+
|
|
188
|
+
- `leancraft import notion --url <url>` — import PM docs into `human/discovery/`
|
|
189
|
+
- `leancraft validate --fetch` — firecrawl URL fetch check (hallucination guard)
|
|
190
|
+
- Semgrep + axe + CodeQL wiring in `leancraft:security`
|