@johanesimm/fundamentum 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/README.md +185 -0
- package/bin/cli.mjs +167 -0
- package/blueprint/SKILL.md +96 -0
- package/blueprint/phases/architecture.md +78 -0
- package/blueprint/phases/engineering.md +146 -0
- package/blueprint/phases/foundation.md +78 -0
- package/blueprint/phases/planning.md +95 -0
- package/blueprint/phases/prd.md +97 -0
- package/excavate/SKILL.md +141 -0
- package/excavate/phases/engineering.md +96 -0
- package/excavate/phases/foundation.md +75 -0
- package/excavate/phases/planning.md +91 -0
- package/excavate/phases/prd.md +103 -0
- package/package.json +33 -0
- package/primer/SKILL.md +258 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Phase 4 — Forward Plan (docs/planning/), remaining work
|
|
2
|
+
|
|
3
|
+
> Extension of `excavate`. Read and follow this file when
|
|
4
|
+
> the orchestrator reaches the planning phase — the final step. Plans
|
|
5
|
+
> the work that is NOT yet built, not the code that already exists.
|
|
6
|
+
|
|
7
|
+
Requires the PRDs and the engineering reference. Unlike a greenfield
|
|
8
|
+
plan (which sequences the whole build), this plan sequences only the
|
|
9
|
+
**gap** between the current system and the desired one: everything the
|
|
10
|
+
foundation/PRD phases marked ⏳ Planned or recorded as a Known
|
|
11
|
+
Discrepancy, plus any cleanup the user wants. Confirm the priority cut
|
|
12
|
+
with the user. Do not re-plan already-shipped functionality.
|
|
13
|
+
|
|
14
|
+
## Inputs — assemble the gap list first
|
|
15
|
+
|
|
16
|
+
Collect, from the docs you just wrote:
|
|
17
|
+
|
|
18
|
+
- **Unbuilt requirements** — every PRD requirement marked ⏳ Planned.
|
|
19
|
+
- **Known Discrepancies** — code-vs-intent mismatches recorded in the
|
|
20
|
+
foundation/PRD/engineering docs (each becomes a fix or an accepted
|
|
21
|
+
decision).
|
|
22
|
+
- **API/schema gaps** — endpoints without requirements and
|
|
23
|
+
requirements without endpoints from doc 22; migration/DB drift from
|
|
24
|
+
doc 21.
|
|
25
|
+
- **User's stated priorities** — the capabilities from 08 (current-
|
|
26
|
+
state + gap) the user wants next.
|
|
27
|
+
|
|
28
|
+
If the gap list is empty (the system already matches intent), say so
|
|
29
|
+
plainly and produce a short "no outstanding work" overview instead of
|
|
30
|
+
inventing phases.
|
|
31
|
+
|
|
32
|
+
## Files to produce
|
|
33
|
+
|
|
34
|
+
**`00-Development-Plan-Overview.md`** containing:
|
|
35
|
+
|
|
36
|
+
- A **current-state summary**: what is already shipped (one line per
|
|
37
|
+
module, from the PRDs) so the plan is read against reality.
|
|
38
|
+
- Phase index table: number, file, one-line scope, priority
|
|
39
|
+
(P1 = must-fix/blocking → P3 = nice-to-have), depends-on, mapping to
|
|
40
|
+
the gap items above.
|
|
41
|
+
- Rationale for the priority cut (fix correctness/discrepancies first,
|
|
42
|
+
then desired capabilities, then polish).
|
|
43
|
+
- Working agreements: docs are authoritative (changes go through docs
|
|
44
|
+
first); checklist discipline; tracking via PROJECT_STATE/CHANGELOG;
|
|
45
|
+
a **Definition of Done** per deliverable (implements its cited
|
|
46
|
+
requirements with server-side guards, covered by tests, matches the
|
|
47
|
+
documented schema/API).
|
|
48
|
+
- **Out of Plan** list — everything the Master PRD defers, stated as
|
|
49
|
+
"do not build".
|
|
50
|
+
|
|
51
|
+
**One file per phase** (as many as the gap needs — often fewer than a
|
|
52
|
+
greenfield build). Each phase file:
|
|
53
|
+
|
|
54
|
+
- Header: goal (one paragraph), priority, depends-on, the PRD/eng
|
|
55
|
+
sections and gap items it closes
|
|
56
|
+
- **Deliverables as checkboxes**, grouped (backend / worker /
|
|
57
|
+
frontend), each citing its requirement IDs and, where it changes
|
|
58
|
+
existing code, naming the module/file it touches
|
|
59
|
+
- **Cross-phase seams made explicit**: stubs and the phase that wires
|
|
60
|
+
them; migrations that must run in order
|
|
61
|
+
- **Exit criteria**: numbered, verifiable, mapped to PRD acceptance
|
|
62
|
+
scenarios — including regression checks that existing behavior still
|
|
63
|
+
passes
|
|
64
|
+
|
|
65
|
+
## Wire it into the primer file
|
|
66
|
+
|
|
67
|
+
Add/replace the **Implementation Guide** section of the project's
|
|
68
|
+
agent-context (primer) file — `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, or
|
|
69
|
+
whichever the `primer` skill resolves for the user's tool: trigger
|
|
70
|
+
condition; "the docs describe the system as-built plus the planned gap —
|
|
71
|
+
do not invent behavior; if a spec doesn't answer, stop and update the
|
|
72
|
+
spec first"; the phase list with the rule that a phase starts only when
|
|
73
|
+
the previous exit criteria pass; a "which doc answers what" map; the
|
|
74
|
+
non-negotiables (don't regress shipped behavior, server-side guards,
|
|
75
|
+
matches the documented schema/API, the do-not-build list). Generate the
|
|
76
|
+
primer file itself with the `primer` skill (it asks which tool/file).
|
|
77
|
+
|
|
78
|
+
## Validation & bookkeeping
|
|
79
|
+
|
|
80
|
+
Cross-check every requirement ID cited in planning files against the
|
|
81
|
+
PRDs (same comm/grep as the engineering phase). Update PROJECT_STATE
|
|
82
|
+
(current milestone = first planned phase, or "documentation complete —
|
|
83
|
+
no outstanding work"), CHANGELOG, README (add the planning section),
|
|
84
|
+
ROADMAP (documentation ✅, remaining work 🚧 Next).
|
|
85
|
+
|
|
86
|
+
## Done when
|
|
87
|
+
|
|
88
|
+
Overview + any phase files exist with clean ID cross-checks, the plan
|
|
89
|
+
covers exactly the gap (nothing already-built is re-planned, nothing
|
|
90
|
+
⏳ Planned is dropped), the primer file guides a fresh session, and the state
|
|
91
|
+
files agree. Documentation of the existing project is complete.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Phase 2 — PRDs (docs/prd/): Master PRD 10 + Feature PRDs 11+, as-built
|
|
2
|
+
|
|
3
|
+
> Extension of `excavate`. Read and follow this file when
|
|
4
|
+
> the orchestrator reaches the PRD phase. Reverse-engineer current
|
|
5
|
+
> behavior into fully-decided PRDs; interview only to capture intent.
|
|
6
|
+
|
|
7
|
+
Requires the foundation docs (00–08). These PRDs document **what the
|
|
8
|
+
system already does** — every functional requirement must correspond to
|
|
9
|
+
real, existing behavior in the code (or be explicitly flagged as
|
|
10
|
+
*desired, not yet built* and handed to the planning phase). Since there
|
|
11
|
+
is no architecture phase, the PRDs cite **code modules and data
|
|
12
|
+
ownership read directly from the repo** instead of 09.x docs.
|
|
13
|
+
|
|
14
|
+
Read the code for each module and mine it for: what it does, its rules
|
|
15
|
+
(guards, validations, state machines), its endpoints, and its enums.
|
|
16
|
+
Then interview the user for **intent** — which behaviors are intended,
|
|
17
|
+
which are legacy, and the business rationale. Nothing is invented.
|
|
18
|
+
|
|
19
|
+
## Part 1 — Master PRD (10)
|
|
20
|
+
|
|
21
|
+
Recommend the **comprehensive** model (confirm with the user): the
|
|
22
|
+
Master PRD owns cross-cutting requirements; Feature PRDs inherit and
|
|
23
|
+
never restate.
|
|
24
|
+
|
|
25
|
+
Build chapter by chapter in `docs/prd/10-chapters/10.NN-<name>.md`,
|
|
26
|
+
then merge into `docs/prd/10-Master-PRD.md`:
|
|
27
|
+
|
|
28
|
+
1. **Executive Summary** — product, problem, solution, current MVP in
|
|
29
|
+
one paragraph, this document's role
|
|
30
|
+
2. **Goals & Success Metrics** — foundation criteria made measurable;
|
|
31
|
+
where metrics exist in code/analytics, cite the real definitions
|
|
32
|
+
3. **Personas & Roles** — persona → role → landing/workspace binding,
|
|
33
|
+
matching the roles actually enforced in code
|
|
34
|
+
4. **Scope** — what is built vs not, per module; a numbered **Scope
|
|
35
|
+
Decisions** table resolving each foundation ambiguity (SD-1, …),
|
|
36
|
+
flagging desired-but-unbuilt items
|
|
37
|
+
5. **Cross-Cutting Requirements** — the heart. Define the
|
|
38
|
+
requirement-ID convention (recommend module-prefixed `<MOD>-NNN` +
|
|
39
|
+
a cross-cutting prefix), then themed ID blocks describing the
|
|
40
|
+
**actual** cross-cutting behavior: workflow mechanics, permission
|
|
41
|
+
matrix (role × capability × scope — transcribed from the code's
|
|
42
|
+
authorization), notification behavior, controlled vocabularies
|
|
43
|
+
(from the real enums), metric/threshold definitions, events (if the
|
|
44
|
+
code emits any), AI guardrails (if applicable), terminology rules
|
|
45
|
+
6. **Feature PRD Index** — one Feature PRD per code module, each with a
|
|
46
|
+
scope paragraph, owned ID prefix, dependency order, and template
|
|
47
|
+
obligations
|
|
48
|
+
7. **Non-Functional Requirements** — security, performance,
|
|
49
|
+
reliability, usability as currently implemented; note intended
|
|
50
|
+
targets separately from observed reality
|
|
51
|
+
8. **Open Questions & Deferred Items** — the ONLY place unresolved
|
|
52
|
+
future questions may live: deliberate deferrals (DF-n), desired
|
|
53
|
+
behaviors not yet built (routed to planning), and any **Known
|
|
54
|
+
Discrepancies** (code vs intent) awaiting a decision
|
|
55
|
+
9. **Traceability** — chapter → code sources → consumers
|
|
56
|
+
|
|
57
|
+
## Part 2 — Feature PRDs (11+)
|
|
58
|
+
|
|
59
|
+
One per code module, in dependency order. **Do not start a PRD until
|
|
60
|
+
the previous is fully decided.** Per PRD, sections in order:
|
|
61
|
+
|
|
62
|
+
1. Metadata header + status table
|
|
63
|
+
2. Purpose & module boundary (cite the actual code folder/package and
|
|
64
|
+
the entities it owns)
|
|
65
|
+
3. Personas & permissions (reference the master matrix; deltas only)
|
|
66
|
+
4. Structural Decisions table (SD-NN.n) — decisions this PRD records,
|
|
67
|
+
distinguishing as-built from newly-decided intent
|
|
68
|
+
5. Functional requirements, `<PREFIX>-NNN`, themed blocks, each
|
|
69
|
+
testable and each traceable to real code (name the handler/service);
|
|
70
|
+
mark any not-yet-built requirement as ⏳ Planned
|
|
71
|
+
6. Business rules — inherited (cited) + module-specific (BR-NN.n),
|
|
72
|
+
each tied to the guard/validation in code that enforces it (or
|
|
73
|
+
flagged as intended-but-unenforced)
|
|
74
|
+
7. Workflows traceable to the user journeys and the real routes
|
|
75
|
+
8. Events emitted (only if the code actually emits them)
|
|
76
|
+
9. Notifications consumed (only what the code sends)
|
|
77
|
+
10. Acceptance criteria — concrete numbered scenarios describing
|
|
78
|
+
current behavior (usable as regression tests)
|
|
79
|
+
11. **Out of Scope (definitive)** — "This PRD is fully decided; it
|
|
80
|
+
contains no open questions." Future/desired items reference the
|
|
81
|
+
Master PRD deferred registry. NEVER an "Open Questions" section;
|
|
82
|
+
avoid "Pending" in status tables (use "⏳ Planned").
|
|
83
|
+
|
|
84
|
+
## Working loop per PRD
|
|
85
|
+
|
|
86
|
+
1. Read the module's code; list its real behavior, rules, endpoints,
|
|
87
|
+
and enums. Note anything intended-but-unenforced or accidental.
|
|
88
|
+
2. Grill the user only on intent/rationale and the discrepancies.
|
|
89
|
+
3. Write the PRD fully decided, every requirement tied to code (or
|
|
90
|
+
marked ⏳ Planned and pushed to the planning phase).
|
|
91
|
+
4. Apply ripple effects: glossary/domain amendments, Master-PRD
|
|
92
|
+
matrix/vocabulary amendments, merged-file regeneration.
|
|
93
|
+
5. Validate: `grep` for duplicate/dangling requirement IDs, unresolved
|
|
94
|
+
language, banned terms; spot-check that cited handlers exist.
|
|
95
|
+
6. Bookkeeping: PROJECT_STATE, CHANGELOG (decisions individually),
|
|
96
|
+
ROADMAP/README markers.
|
|
97
|
+
|
|
98
|
+
## Done when
|
|
99
|
+
|
|
100
|
+
Master PRD + all module PRDs exist, every functional requirement maps
|
|
101
|
+
to real code or is explicitly marked ⏳ Planned, validation greps are
|
|
102
|
+
clean, discrepancies are registered in Master PRD chapter 8, and
|
|
103
|
+
PROJECT_STATE points at engineering (`phases/engineering.md`).
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@johanesimm/fundamentum",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Documentation-first Claude Code skill suite (blueprint / excavate / primer) with a one-command installer.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": "Johanes <johanesimm95@gmail.com>",
|
|
7
|
+
"bin": {
|
|
8
|
+
"fundamentum": "bin/cli.mjs"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/",
|
|
15
|
+
"blueprint/",
|
|
16
|
+
"excavate/",
|
|
17
|
+
"primer/",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"claude",
|
|
25
|
+
"claude-code",
|
|
26
|
+
"skills",
|
|
27
|
+
"agents",
|
|
28
|
+
"agents.md",
|
|
29
|
+
"documentation",
|
|
30
|
+
"prd"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT"
|
|
33
|
+
}
|
package/primer/SKILL.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: primer
|
|
3
|
+
description: Generate the agent-context / instructions file that briefs an AI coding assistant on a project. Works for ANY project type and stack (web app, service, CLI, library, mobile, data pipeline, …) — it interviews for the project's real conventions and offers an opinionated house profile (containerized full-stack web app: section skeleton, root-compose layout, Clean-Architecture backend, test discipline, no-hard-coded-secrets with .env.example) as a recommended DEFAULT the user confirms, adapts, or replaces — never forced. Tool-agnostic: asks which agentic coding tool the user uses and writes the right file — CLAUDE.md (Claude Code), AGENTS.md (Codex/Cursor/generic), GEMINI.md (Gemini CLI), .github/copilot-instructions.md (Copilot), or a custom name. Use when the user asks to generate/create/bootstrap an agent context file, CLAUDE.md, AGENTS.md, or "AI instructions" for a project. MUST interview the user before writing anything — never generate from assumptions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Primer — brief an AI coding assistant (any project, house-style default)
|
|
7
|
+
|
|
8
|
+
You are generating the **agent-context file** that gets an AI coding
|
|
9
|
+
assistant up to speed on a project. You know nothing about that project
|
|
10
|
+
yet; the user does. This skill has three hard phases in strict order:
|
|
11
|
+
|
|
12
|
+
0. **Pick the target** — find out which agentic coding tool(s) the user
|
|
13
|
+
uses, so you write the correctly-named file (`CLAUDE.md`,
|
|
14
|
+
`AGENTS.md`, …). If they use none, there may be nothing to generate.
|
|
15
|
+
1. **Grill the user** (interview) — collect the project facts.
|
|
16
|
+
2. **Generate** the file(s) from the house template below, filled with
|
|
17
|
+
those facts.
|
|
18
|
+
|
|
19
|
+
Never skip Phases 0 or 1. Never invent domain facts, business rules,
|
|
20
|
+
user roles, or stack choices the user did not state — if something is
|
|
21
|
+
unknown after the interview, write it as an explicit `TBD` line in the
|
|
22
|
+
generated file, do not guess.
|
|
23
|
+
|
|
24
|
+
------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
## Phase 0 — Pick the target file(s)
|
|
27
|
+
|
|
28
|
+
Ask (AskUserQuestion) before anything else: **"Do you use an agentic
|
|
29
|
+
coding assistant, and which one(s)?"** Map the answer to filename(s):
|
|
30
|
+
|
|
31
|
+
| Tool | File written (at project root unless noted) |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Claude Code | `CLAUDE.md` |
|
|
34
|
+
| Codex | `AGENTS.md` |
|
|
35
|
+
| Cursor | `AGENTS.md` |
|
|
36
|
+
| Gemini CLI | `GEMINI.md` |
|
|
37
|
+
| GitHub Copilot | `.github/copilot-instructions.md` |
|
|
38
|
+
| Other / unsure | `AGENTS.md` (the emerging cross-tool standard), or a custom name the user gives |
|
|
39
|
+
|
|
40
|
+
Rules for this phase:
|
|
41
|
+
|
|
42
|
+
- **No agentic tool** → do not generate a file. Tell the user the
|
|
43
|
+
`docs/` set already documents the project and this skill can be
|
|
44
|
+
re-run anytime they adopt a tool. Stop here unless they still want a
|
|
45
|
+
generic `AGENTS.md` (then proceed treating the target as `AGENTS.md`).
|
|
46
|
+
- **One tool** → that single file is the target.
|
|
47
|
+
- **Multiple tools** → write ONE canonical file with the full content
|
|
48
|
+
(prefer `AGENTS.md` if any non-Claude tool is in the set, else
|
|
49
|
+
`CLAUDE.md`), and for each other tool a **thin pointer file** whose
|
|
50
|
+
entire body is e.g. `> See [AGENTS.md](./AGENTS.md) — single source
|
|
51
|
+
of truth for agent instructions.` This prevents the files from
|
|
52
|
+
drifting apart. (`.github/copilot-instructions.md` may hold either
|
|
53
|
+
the full content or the pointer.)
|
|
54
|
+
|
|
55
|
+
Throughout the rest of this skill, **"the primer file" means whichever
|
|
56
|
+
target(s) Phase 0 resolved** — everywhere the template says `CLAUDE.md`,
|
|
57
|
+
substitute the actual filename.
|
|
58
|
+
|
|
59
|
+
------------------------------------------------------------------------
|
|
60
|
+
|
|
61
|
+
## Phase 1 — Grill the user
|
|
62
|
+
|
|
63
|
+
Use the AskUserQuestion tool (max 4 questions per call, multiple
|
|
64
|
+
rounds). Provide concrete options with a recommended default where
|
|
65
|
+
sensible; always let the user type their own answer. Cover ALL of the
|
|
66
|
+
following areas — batch them into 2–3 rounds:
|
|
67
|
+
|
|
68
|
+
**Round 1 — Identity & domain**
|
|
69
|
+
1. What is the project? (one-sentence purpose; what it is NOT, if that
|
|
70
|
+
matters — e.g. "an execution platform, not a PM tool")
|
|
71
|
+
2. Who are the users/personas and their roles? (names + one-line
|
|
72
|
+
responsibility each)
|
|
73
|
+
3. What are the core domain entities and their hierarchy? (e.g.
|
|
74
|
+
Organization → Team → Member; the 5–10 nouns the product lives on)
|
|
75
|
+
4. What business rules are already locked/non-negotiable?
|
|
76
|
+
|
|
77
|
+
**Round 2 — Project type, stack & architecture**
|
|
78
|
+
1. What KIND of project is it? (web app, backend service/API, CLI tool,
|
|
79
|
+
library/SDK, mobile app, desktop app, data/ML pipeline, infra/IaC,
|
|
80
|
+
monorepo of several — this decides which sections and conventions
|
|
81
|
+
even apply; do not assume a full-stack web app)
|
|
82
|
+
2. Language(s) & stack per relevant tier? Offer the house default only
|
|
83
|
+
when it fits the project type, and always let the user replace it:
|
|
84
|
+
*frontend* (default React + Vite + Tailwind + shadcn/ui + TanStack
|
|
85
|
+
Query + Zustand + RHF + Zod — only if it has a UI); *backend*
|
|
86
|
+
(default Node/Express + PostgreSQL + JWT/refresh + Argon2id + RBAC +
|
|
87
|
+
worker — only if it has a server); or whatever the project actually
|
|
88
|
+
uses (Python, Go, Rust, Java, …).
|
|
89
|
+
3. Architecture style / deviations? (monolith vs services, API style,
|
|
90
|
+
event needs, AI involvement and its guardrails — as applicable)
|
|
91
|
+
4. Tooling & conventions the project already follows or wants:
|
|
92
|
+
containerized or run on host? test discipline (TDD / tests-after /
|
|
93
|
+
none)? datastore kind (relational / document / none)? secrets
|
|
94
|
+
handling? — used to fill the Engineering Conventions section with
|
|
95
|
+
the project's REAL rules, not an assumed house profile.
|
|
96
|
+
5. What documentation already exists or is planned? (PRDs, specs,
|
|
97
|
+
or greenfield — determines the Documentation Status and Rules
|
|
98
|
+
sections)
|
|
99
|
+
|
|
100
|
+
**Round 3 — only if gaps remain** (e.g. AI guardrails, integrations,
|
|
101
|
+
naming rules, glossary terms, out-of-scope list). Skip if Rounds 1–2
|
|
102
|
+
answered everything.
|
|
103
|
+
|
|
104
|
+
Confirm your understanding in one short summary paragraph before
|
|
105
|
+
generating. If the user corrects it, incorporate and proceed — do not
|
|
106
|
+
re-interview settled points.
|
|
107
|
+
|
|
108
|
+
------------------------------------------------------------------------
|
|
109
|
+
|
|
110
|
+
## Phase 2 — Generate the primer file
|
|
111
|
+
|
|
112
|
+
Write **the primer file resolved in Phase 0** (`CLAUDE.md` / `AGENTS.md`
|
|
113
|
+
/ `GEMINI.md` / …) at the target project root with EXACTLY this section
|
|
114
|
+
skeleton, in this order (omit a section only if genuinely inapplicable
|
|
115
|
+
and say so in a comment; `---` separators between sections). If Phase 0
|
|
116
|
+
resolved multiple tools, write the full skeleton once into the canonical
|
|
117
|
+
file and a one-line pointer into each other tool's file:
|
|
118
|
+
|
|
119
|
+
1. **Header blockquote** — project name + current status + where the
|
|
120
|
+
live status lives (e.g. `./docs/PROJECT_STATE.md`)
|
|
121
|
+
2. **Purpose** — what the project is and explicitly is not
|
|
122
|
+
3. **Rules** — ordered "read this first" file list (state files with
|
|
123
|
+
paths)
|
|
124
|
+
4. **Product Vision** — capabilities + primary users
|
|
125
|
+
5. **Core Philosophy** — the 3–5 principles the user gave
|
|
126
|
+
6. **Core Domain** — entity hierarchy from the interview
|
|
127
|
+
7. **Locked Business Rules** — verbatim from the interview
|
|
128
|
+
8. **AI Strategy** — only if the project has AI; must include the
|
|
129
|
+
guardrail pattern: AI recommends/humans decide, AI never writes
|
|
130
|
+
business data, AI isolation
|
|
131
|
+
9. **Architecture Decisions** — stack lists (frontend / backend /
|
|
132
|
+
architecture) from the interview
|
|
133
|
+
10. **Module Boundaries** — if known
|
|
134
|
+
11. **Repository Layout** — actual planned tree with paths
|
|
135
|
+
12. **Documentation Status** — completed vs next
|
|
136
|
+
13. **Working Rules for the AI agent** — adapt from the house list: read
|
|
137
|
+
state files first; don't redefine terminology; reference decisions
|
|
138
|
+
before changing them; docs are authoritative — update the spec
|
|
139
|
+
before the code; record decisions in a CHANGELOG. (Title this
|
|
140
|
+
section for the actual tool if you like, e.g. "Working Rules for
|
|
141
|
+
Claude" in a `CLAUDE.md`.)
|
|
142
|
+
14. **Engineering Conventions** — the project's real build/test/deploy
|
|
143
|
+
rules. Start from the recommended default profile below, but keep
|
|
144
|
+
only the rules that fit this project type and swap in whatever the
|
|
145
|
+
interview surfaced (see that section for how to adapt)
|
|
146
|
+
15. **Implementation Guide** — trigger condition + where the plan
|
|
147
|
+
lives + "which doc answers what" map (or a note that planning
|
|
148
|
+
docs come later, for greenfield)
|
|
149
|
+
16. **Folder Structure** — the actual project layout; use the
|
|
150
|
+
recommended shape below only if it fits, otherwise document the
|
|
151
|
+
project's real tree
|
|
152
|
+
|
|
153
|
+
## Engineering Conventions (recommended default profile — confirm, adapt, or replace)
|
|
154
|
+
|
|
155
|
+
The profile below is a strong, opinionated default for a **containerized
|
|
156
|
+
full-stack web application**. It is NOT mandatory and NOT universal.
|
|
157
|
+
Apply it like this:
|
|
158
|
+
|
|
159
|
+
1. **Keep only what fits the project type from Round 2.** A CLI, a
|
|
160
|
+
library, a mobile app, a pure data pipeline, or a serverless
|
|
161
|
+
function will drop or rewrite most of these (no Docker service
|
|
162
|
+
topology, no frontend rules, maybe no database).
|
|
163
|
+
2. **Prefer the project's real conventions.** Whatever the interview
|
|
164
|
+
surfaced (language, test discipline, run model, datastore) wins over
|
|
165
|
+
the default — transcribe the user's actual rules; offer a default
|
|
166
|
+
only where they had no opinion, and let them replace it.
|
|
167
|
+
3. **Generalize the principle, not the tooling.** Each rule below has a
|
|
168
|
+
stack-neutral intent (reproducible builds, no hard-coded secrets,
|
|
169
|
+
separation of concerns, tests as a gate, managed schema changes) —
|
|
170
|
+
carry the intent into whatever stack the project uses; don't force
|
|
171
|
+
the specific tool names.
|
|
172
|
+
4. Whatever the project settles on, write it down as concrete,
|
|
173
|
+
enforceable rules — a vague convention is worse than none.
|
|
174
|
+
|
|
175
|
+
Only the group **"Secrets & configuration"** is close to universal;
|
|
176
|
+
treat the rest as opt-in per project type.
|
|
177
|
+
|
|
178
|
+
- **Build & run (default: containerization)**: everything runs in
|
|
179
|
+
Docker (no host runtimes) — build, test, lint, migrations, and app
|
|
180
|
+
processes execute **inside containers** (e.g. `docker compose …
|
|
181
|
+
run/exec`), never as raw host commands; infrastructure in its own
|
|
182
|
+
root `docker-infra.yml` (databases, queues — stock images); two
|
|
183
|
+
container levels per service (`Dockerfile.dev` with bind-mounts +
|
|
184
|
+
hot reload, and a multi-stage slim non-root `Dockerfile`); dev/prod
|
|
185
|
+
compose diverge only in transports/seed/TLS/reload, never in guards/
|
|
186
|
+
migrations/schema; images versioned by git SHA, `latest` never
|
|
187
|
+
deployed. *Adapt:* for non-containerized projects, replace with the
|
|
188
|
+
project's real build/run model (e.g. `uv`/`cargo`/`go build`, a
|
|
189
|
+
lockfile + pinned toolchain) — keep the intent: **reproducible,
|
|
190
|
+
pinned, one documented way to build and run.**
|
|
191
|
+
- **Secrets & configuration** (near-universal): no hard-coded secrets
|
|
192
|
+
anywhere; all secrets from a gitignored `.env` (or the platform's
|
|
193
|
+
secret store), mirrored in a committed `.env.example` with
|
|
194
|
+
placeholders + one-line comments; env is for secrets/deployment
|
|
195
|
+
concerns only — runtime app/org settings belong in the datastore or
|
|
196
|
+
config service; secrets never in logs, errors, or API responses.
|
|
197
|
+
- **Code architecture (default: Clean / domain-oriented)** — only if
|
|
198
|
+
the project has meaningful business logic: dependencies point
|
|
199
|
+
**inward** (adapters → services/use-cases → domain; the domain
|
|
200
|
+
imports nothing outward); business logic is independent of the
|
|
201
|
+
framework and the DB driver/ORM; boundaries are lint-enforced.
|
|
202
|
+
*Adapt:* small tools/libraries may use a flatter structure — capture
|
|
203
|
+
whatever separation-of-concerns rule the project actually holds.
|
|
204
|
+
- **Code quality**: the language's strict/type settings on (e.g.
|
|
205
|
+
TypeScript strict, `mypy --strict`, `-Wall -Werror`, clippy);
|
|
206
|
+
shared validation schemas between boundaries where applicable;
|
|
207
|
+
modules/features don't import each other's internals. **Test
|
|
208
|
+
discipline per the interview** — if the project chose TDD, state it
|
|
209
|
+
as mandatory (failing test first, red→green→refactor, spec test
|
|
210
|
+
plans transcribed before coding); otherwise state the actual policy
|
|
211
|
+
(tests-after with a coverage bar, etc.). *If it has a frontend:*
|
|
212
|
+
shared components before new ones — check the shared library first,
|
|
213
|
+
extend/compose, promote generic components up, never duplicate.
|
|
214
|
+
- **Frontend design** — only if the project has a UI and the user uses
|
|
215
|
+
the design skill: run the design skill (`/design-taste-frontend`)
|
|
216
|
+
before building or restyling a screen.
|
|
217
|
+
- **Data & schema** — only if the project has a managed datastore: the
|
|
218
|
+
schema/migration is code you run, not a suggestion; numbered
|
|
219
|
+
forward-only migrations reflected back into the schema doc;
|
|
220
|
+
destructive changes require a spec revision first; constraints and
|
|
221
|
+
least-privilege roles applied in every environment including dev.
|
|
222
|
+
|
|
223
|
+
## Folder Structure (recommended shape — use only if it fits, else document the real tree)
|
|
224
|
+
|
|
225
|
+
The tree below suits a containerized web-app monorepo. For any other
|
|
226
|
+
project type, **document the project's actual layout instead** — a
|
|
227
|
+
Python package (`src/`, `pyproject.toml`), a Go module (`cmd/`,
|
|
228
|
+
`internal/`), a library, or a mobile app all have their own conventional
|
|
229
|
+
shapes; use those.
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
- CLAUDE.md / AGENTS.md # the primer file (name per the tool from Phase 0)
|
|
233
|
+
- docs/ # all documentation
|
|
234
|
+
- frontend/ # .env/.env.example, Dockerfile, Dockerfile.dev (if it has a UI)
|
|
235
|
+
- backend/ # .env/.env.example, Dockerfile, Dockerfile.dev (if it has a server)
|
|
236
|
+
- infra/ # infra config only (init SQL, proxy conf) — stock images, no Dockerfiles
|
|
237
|
+
- docker-infra.yml # infrastructure services (dev extras under a `dev` profile)
|
|
238
|
+
- docker-compose.yml # production app stack → Dockerfile targets
|
|
239
|
+
- docker-compose.dev.yml # dev app stack, hot reload → Dockerfile.dev; includes docker-infra.yml
|
|
240
|
+
- README.md
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
When this shape applies, compose files live at the **repository root** —
|
|
244
|
+
the single orchestration point; per-service folders hold Dockerfiles and
|
|
245
|
+
env files, never compose files.
|
|
246
|
+
|
|
247
|
+
## Final checks before writing
|
|
248
|
+
|
|
249
|
+
- Every fact in the generated file came from the interview or is
|
|
250
|
+
marked `TBD` — zero invented domain content.
|
|
251
|
+
- Tech Rules and Folder Structure present, complete, not weakened.
|
|
252
|
+
- Terminology consistent throughout (one name per concept — define
|
|
253
|
+
naming rules if the user gave them).
|
|
254
|
+
- File paths in Rules / Repository Layout point at files that will
|
|
255
|
+
actually exist.
|
|
256
|
+
- The primer file is named for the tool chosen in Phase 0; any
|
|
257
|
+
additional tools got a pointer file, not a duplicated copy.
|
|
258
|
+
- Show the user a 5-line summary of what was generated and where.
|