create-religion 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.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -0
  3. package/dist/bin/religion.js +209 -0
  4. package/dist/lib/dashboard.js +123 -0
  5. package/dist/lib/doctor.js +164 -0
  6. package/dist/lib/install.js +170 -0
  7. package/dist/lib/paths.js +40 -0
  8. package/dist/lib/state.js +117 -0
  9. package/dist/lib/status.js +88 -0
  10. package/package.json +40 -0
  11. package/template/.agents/skills/audit/SKILL.md +169 -0
  12. package/template/.agents/skills/auto/SKILL.md +110 -0
  13. package/template/.agents/skills/browser-tests/SKILL.md +65 -0
  14. package/template/.agents/skills/check/SKILL.md +86 -0
  15. package/template/.agents/skills/ci/SKILL.md +79 -0
  16. package/template/.agents/skills/complete/SKILL.md +184 -0
  17. package/template/.agents/skills/debug/SKILL.md +72 -0
  18. package/template/.agents/skills/discovery/SKILL.md +83 -0
  19. package/template/.agents/skills/distill/SKILL.md +95 -0
  20. package/template/.agents/skills/doctor/SKILL.md +65 -0
  21. package/template/.agents/skills/extend/SKILL.md +102 -0
  22. package/template/.agents/skills/feature/SKILL.md +172 -0
  23. package/template/.agents/skills/feature/reference/spec-template.md +67 -0
  24. package/template/.agents/skills/fix/SKILL.md +76 -0
  25. package/template/.agents/skills/implement/SKILL.md +174 -0
  26. package/template/.agents/skills/overview/SKILL.md +150 -0
  27. package/template/.agents/skills/overview/reference/project-overview-template.md +101 -0
  28. package/template/.agents/skills/prototype/SKILL.md +90 -0
  29. package/template/.agents/skills/release/SKILL.md +88 -0
  30. package/template/.agents/skills/rollback/SKILL.md +114 -0
  31. package/template/.agents/skills/setup/SKILL.md +105 -0
  32. package/template/.agents/skills/status/SKILL.md +63 -0
  33. package/template/.agents/skills/tests/SKILL.md +90 -0
  34. package/template/.agents/skills/try/SKILL.md +59 -0
  35. package/template/.claude/hooks/guard-rendered-output.mjs +49 -0
  36. package/template/.claude/hooks/guard-tier-one.mjs +63 -0
  37. package/template/.claude/hooks/write-handoff.mjs +83 -0
  38. package/template/.claude/skills/audit/SKILL.md +169 -0
  39. package/template/.claude/skills/auto/SKILL.md +110 -0
  40. package/template/.claude/skills/browser-tests/SKILL.md +65 -0
  41. package/template/.claude/skills/check/SKILL.md +86 -0
  42. package/template/.claude/skills/ci/SKILL.md +79 -0
  43. package/template/.claude/skills/complete/SKILL.md +184 -0
  44. package/template/.claude/skills/debug/SKILL.md +72 -0
  45. package/template/.claude/skills/discovery/SKILL.md +83 -0
  46. package/template/.claude/skills/distill/SKILL.md +95 -0
  47. package/template/.claude/skills/doctor/SKILL.md +65 -0
  48. package/template/.claude/skills/extend/SKILL.md +102 -0
  49. package/template/.claude/skills/feature/SKILL.md +172 -0
  50. package/template/.claude/skills/feature/reference/spec-template.md +67 -0
  51. package/template/.claude/skills/fix/SKILL.md +76 -0
  52. package/template/.claude/skills/implement/SKILL.md +174 -0
  53. package/template/.claude/skills/overview/SKILL.md +150 -0
  54. package/template/.claude/skills/overview/reference/project-overview-template.md +101 -0
  55. package/template/.claude/skills/prototype/SKILL.md +90 -0
  56. package/template/.claude/skills/release/SKILL.md +88 -0
  57. package/template/.claude/skills/rollback/SKILL.md +114 -0
  58. package/template/.claude/skills/setup/SKILL.md +105 -0
  59. package/template/.claude/skills/status/SKILL.md +63 -0
  60. package/template/.claude/skills/tests/SKILL.md +90 -0
  61. package/template/.claude/skills/try/SKILL.md +59 -0
  62. package/template/AGENTS.md +206 -0
  63. package/template/CLAUDE.md +175 -0
  64. package/template/religion/.state/README.md +10 -0
  65. package/template/religion/.state/settings-template.json +19 -0
  66. package/template/religion/build-plan.md +43 -0
  67. package/template/religion/config.json +26 -0
  68. package/template/religion/context/ai-interaction.md +84 -0
  69. package/template/religion/context/coding-standards.md +77 -0
  70. package/template/religion/context/current-work.md +8 -0
  71. package/template/religion/context/findings.md +9 -0
  72. package/template/religion/context/handoff.md +8 -0
  73. package/template/religion/context/project-overview.md +8 -0
  74. package/template/religion/history/features/README.md +8 -0
  75. package/template/religion/history/fixes/README.md +6 -0
  76. package/template/religion/history/rollbacks/README.md +7 -0
  77. package/template/religion/learning/journal.md +7 -0
  78. package/template/religion/learning/lessons.md +8 -0
  79. package/template/religion/project-plan.md +49 -0
  80. package/template/religion/reference/README.md +7 -0
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: discovery
3
+ summary: a guided planning conversation that drafts the two plans
4
+ description: "An optional multi-turn planning conversation that develops a project plan and build plan through adaptive questioning, then drafts both files and writes them only after explicit approval. Never required: the plans can always be written directly or developed in any conversation. Use only when the user runs $discovery, asks for a guided planning session, or wants help thinking a product through before writing the plans. Do not suggest it merely because the plans are empty."
5
+ ---
6
+
7
+ # discovery - think the project through, then draft the plans
8
+
9
+ Optional. The plans can be written directly, and often should be. This exists for when
10
+ someone wants the questions asked.
11
+
12
+ Never suggest this as the default next step after installation. An empty plan is not a
13
+ reason to start an interview.
14
+
15
+ ## How this runs
16
+
17
+ A conversation over as many turns as it takes, then a draft. Nothing is written until the
18
+ user says the drafts are right.
19
+
20
+ Ask a few questions at a time, not a form. Follow what the answers actually say: a project
21
+ with no users to speak of does not need three questions about user tiers, and a project
22
+ whose whole difficulty is the data model deserves more than one.
23
+
24
+ ## What to establish
25
+
26
+ Enough to fill the required plan sections, and nothing more.
27
+
28
+ **The problem.** What is broken or missing, and for whom. Push past the first answer, which
29
+ is usually a solution wearing a problem's clothes: "people need a dashboard" is a solution.
30
+ Ask what goes wrong today without it.
31
+
32
+ **The users.** Who specifically, and what each needs. If the answer is "everyone", the
33
+ project has no users yet and that is worth knowing now.
34
+
35
+ **The features.** What the first version has to do. Then ask what it deliberately does not
36
+ do, which is the more useful question and the one nobody volunteers.
37
+
38
+ **The data.** What the project works with: stored entities, or the shapes it reads and
39
+ emits, or the interface it exposes. Ask what shape later work will depend on, since that is
40
+ what becomes expensive to change.
41
+
42
+ **The stack.** What it is built with, and anything already decided or already ruled out.
43
+
44
+ Then the optional sections, only where they apply: how it makes money, how it should look
45
+ and feel, where it deploys.
46
+
47
+ ## Things worth pushing on
48
+
49
+ - **Vagueness that will become a decision later.** "Some kind of auth" becomes a spec
50
+ someone has to write. Ask now.
51
+ - **Scope that grew during the conversation.** Say so, and ask what the first version drops.
52
+ - **Contradictions.** Note them as they appear rather than collecting them for the end,
53
+ where they will be an unpleasant list.
54
+ - **The build order.** What has to exist before what. That is what the build plan encodes.
55
+
56
+ ## Drafting
57
+
58
+ When the user says they are ready, show both drafts **in full, in the conversation**, before
59
+ writing anything.
60
+
61
+ - **Project plan** - as much depth as the answers support. Include the rationale,
62
+ constraints, and exclusions, since those are what later work needs and what a plan
63
+ usually loses.
64
+ - **Build plan** - a numbered checkbox list of feature-sized items in rough build order. No
65
+ detail; the depth belongs in each spec.
66
+
67
+ Mark anything you supplied rather than heard. A draft that quietly invents a monetization
68
+ model reads as though the user decided it.
69
+
70
+ Then ask for changes, and iterate. Write both files only after an explicit yes.
71
+
72
+ ## Rules
73
+
74
+ - Nothing is written before approval, including a partial draft "to make it concrete".
75
+ - The plans are the user's. Draft in their terms, not in yours.
76
+ - Do not fill a section the conversation did not cover. Leave it, and say what is missing.
77
+ - Stop when the plans are usable, not when they are exhaustive. $overview will flag
78
+ what is genuinely too thin.
79
+
80
+ ## Formatting
81
+
82
+ Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
83
+ markdown, lists for enumerations and tables for matrices rather than dense paragraphs.
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: distill
3
+ summary: promote proven observations from the journal into loaded lessons
4
+ description: "Read religion/learning/journal.md, promote observations that have proved stable into religion/learning/lessons.md, fold corrections about this project into its coding standards, and archive what was processed. Lessons are loaded every session, so promotion is deliberately strict: an observation earns a place only once it has recurred or been confirmed. Use when the user runs $distill, asks to consolidate what has been learned, or when the journal has grown enough to be worth a pass."
5
+ ---
6
+
7
+ # distill - turn observations into lessons
8
+
9
+ The journal is cheap and unfiltered: anything surprising goes in. Lessons are expensive,
10
+ because they are loaded into every session forever. This skill is the gate between them.
11
+
12
+ ## What goes in the journal, and when
13
+
14
+ Any skill appends to `religion/learning/journal.md` when something is worth remembering:
15
+
16
+ - a correction from the user, especially a repeated one
17
+ - an assumption that turned out to be wrong about this project
18
+ - a failure whose cause was non-obvious
19
+ - a convention discovered in the code that no document states
20
+
21
+ One entry, dated, in a sentence or two. What happened and what it implies. Appending is
22
+ cheap and unreviewed; nothing is loaded from here.
23
+
24
+ Do not journal the ordinary. "The build passed" is not an observation.
25
+
26
+ ## Step 1 - read and group
27
+
28
+ Read the journal. Group entries that are really the same observation seen more than once.
29
+ Recurrence is the main evidence that something is a lesson rather than an incident.
30
+
31
+ ## Step 2 - decide what has earned promotion
32
+
33
+ Promote an observation only when it is all of these:
34
+
35
+ - **Confirmed**, not suspected. Either seen more than once, or explicitly corrected by the
36
+ user.
37
+ - **General**, not incidental. It will apply again, to work not yet started.
38
+ - **Actionable**. It changes what someone would do, not just what they would know.
39
+ - **Not already written down.** If it belongs in the coding standards or the project plan,
40
+ it goes there instead, where it is already loaded and already owned.
41
+
42
+ Everything else stays in the journal or is dropped. A single surprising incident is not a
43
+ lesson; it is an incident.
44
+
45
+ ## Step 3 - route by kind
46
+
47
+ Two destinations, and the distinction matters.
48
+
49
+ **About this codebase** goes to `religion/context/coding-standards.md`. "Server actions in
50
+ this project take the organization identifier from the session, never from arguments" is a
51
+ convention, and conventions belong with the conventions. Propose the exact edit and wait:
52
+ the standards are the user's file.
53
+
54
+ **About how work goes here** goes to `religion/learning/lessons.md`. "Schema changes in
55
+ this project need the migration and the type change in the same step, or the typecheck
56
+ fails halfway through review" is a lesson about working, not a coding convention.
57
+
58
+ ## Step 4 - write, keeping it short
59
+
60
+ Each lesson is two or three lines: what to do, and why, since a lesson without its reason
61
+ gets discarded the first time it is inconvenient.
62
+
63
+ **Keep the file short.** It is loaded every session, so every line is paid for constantly.
64
+ Before adding, look for a lesson that is now wrong, superseded, or has become obvious
65
+ because the code changed, and remove it. A lessons file that only grows becomes a file
66
+ nobody reads, which is worse than no file.
67
+
68
+ If the file is getting long, that is a finding: report it rather than adding to it.
69
+
70
+ ## Step 5 - archive what was processed
71
+
72
+ Remove promoted and rejected entries from the journal, appending them to
73
+ `religion/learning/journal-archive.md` with what was decided. Nothing is deleted outright:
74
+ a rejected observation that recurs is exactly the evidence that promotes it next time.
75
+
76
+ ## Step 6 - report
77
+
78
+ - entries read, grouped, promoted, and rejected, with the reason for each rejection
79
+ - lessons added, and any removed
80
+ - standards edits proposed, and whether they were approved
81
+ - whether the lessons file is getting too long
82
+
83
+ ## Rules
84
+
85
+ - Promote on evidence, never on a good story. One incident is an incident.
86
+ - Codebase conventions belong in the standards. Do not duplicate them as lessons.
87
+ - Standards edits are proposed and wait. That file belongs to the user.
88
+ - Remove as readily as you add.
89
+ - Never promote something that is really a bug. That is a finding, and it belongs in the
90
+ ledger.
91
+
92
+ ## Formatting
93
+
94
+ Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
95
+ markdown, lists for enumerations and tables for matrices rather than dense paragraphs.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: doctor
3
+ summary: check the setup is healthy and explain anything that is not
4
+ description: "Read-only health check of the installation: required files present, adapter trees in sync, the entry file's commands accurate, configuration valid, plans usable, overview fresh, ignore rules sane, and git state workable. Runs the religion command-line tool for the deterministic checks when it is installed, then explains what any failure means and offers the fix. Use when the user runs $doctor, asks whether the setup is correct, wants a health check, or says something feels wrong before starting or resuming work."
5
+ ---
6
+
7
+ # doctor - is this set up correctly
8
+
9
+ $status says where the work stands. This says whether the machinery around it is
10
+ sound. Read-only.
11
+
12
+ ## Step 1 - run the checks
13
+
14
+ If the `religion` command is available, run `religion doctor --json`. Every check it
15
+ performs is deterministic, so a program should perform it.
16
+
17
+ Otherwise check directly:
18
+
19
+ - **Files** - `religion/config.json`, both plans, the four context files, and the history
20
+ and reference directories exist.
21
+ - **Configuration** - `config.json` parses, and every key and value is one the schema
22
+ allows. An unknown key is usually a typo, and a typo silently means the default.
23
+ - **Adapters** - for each installed tree, the skills present and, when more than one tree
24
+ exists, whether they hold the same skills.
25
+ - **Entry file** - the Commands section is filled in rather than the shipped placeholder,
26
+ and the commands it names exist in the project.
27
+ - **Plans** - required sections answered, build plan is a checkbox list.
28
+ - **Overview** - present, and its source hash matches the current plans.
29
+ - **Ignore rules** - the state directory is either committed or ignored deliberately, not
30
+ half of each, and nothing secret is about to be committed.
31
+ - **Git** - a repository exists, and it is not in a detached or mid-operation state that
32
+ will surprise the loop.
33
+
34
+ ## Step 2 - explain, do not just list
35
+
36
+ For each failure, say what it means and what it will cause. "Overview hash mismatch" is
37
+ not useful on its own; "the plans changed after the overview was generated, so the next
38
+ spec would be written against a data model that no longer matches" is.
39
+
40
+ Order by what actually blocks work. A missing history directory blocks the first
41
+ completion; an unfilled Commands section blocks verification; a cosmetic gap blocks nothing
42
+ and should be reported last or not at all.
43
+
44
+ Offer the fix, and where it is a single obvious action, offer to make it. Regenerating a
45
+ stale overview or creating a missing directory needs no deliberation. Anything touching the
46
+ plans, the configuration, or git is proposed and waits.
47
+
48
+ ## Step 3 - report
49
+
50
+ - **Healthy** or **N problems**, stated first.
51
+ - Each problem: what is wrong, what it will cause, how to fix it.
52
+ - What was checked, briefly, so the absence of a warning means something.
53
+ - Next action.
54
+
55
+ ## Rules
56
+
57
+ - Read-only by default. Fixes are offered and only made with a yes.
58
+ - Do not report a problem that is a deliberate choice. A project with no test runner has
59
+ not failed a check; testing is opt-in.
60
+ - Never claim a check passed that could not run.
61
+
62
+ ## Formatting
63
+
64
+ Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
65
+ markdown, lists for enumerations and tables for matrices rather than dense paragraphs.
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: extend
3
+ summary: author a new skill for this workflow, with its routing tests
4
+ description: "Add a capability to Religion itself: interview for what the skill must do, write its source with the required frontmatter, add routing tests that prove the right skill is selected for a request, render it into every adapter tree, and verify. Refuses to add a skill whose job an existing one already does, since an overlapping roster routes badly and the cost lands on every later request. Use when the user runs $extend, asks to add a skill or command to the workflow, or asks to extend Religion."
5
+ ---
6
+
7
+ # extend - add a capability to the workflow
8
+
9
+ This edits the workflow itself, not a project built with it. Run it in a Religion source
10
+ checkout, where `src/skills/` exists. In an installed project there is nothing here to edit.
11
+
12
+ ## Step 1 - argue against it first
13
+
14
+ A new skill is a permanent addition to a roster that every request is routed against. The
15
+ cost is paid by every later request, not just the ones that use it.
16
+
17
+ Read the existing roster and ask:
18
+
19
+ - **Does an existing skill already own this?** If so, extend that one. A mode or an
20
+ argument is nearly always better than a sibling: it keeps related behavior together and
21
+ adds no routing ambiguity.
22
+ - **Would this be selected reliably?** If a request that should reach it would plausibly
23
+ reach another skill, both get worse. Overlapping descriptions are the main way a roster
24
+ degrades.
25
+ - **Is it a skill at all?** A deterministic check belongs in the command-line tool. A rule
26
+ belongs in the constitution or the standards. A one-off belongs in the conversation.
27
+
28
+ Say what you concluded. If an existing skill should absorb it, propose that instead and
29
+ stop. Being talked out of a new skill is a successful outcome here.
30
+
31
+ ## Step 2 - establish what it does
32
+
33
+ - **The job**, in one sentence. If that takes two, it is two skills or it is a mode.
34
+ - **When it should be selected**, and just as importantly when it should not, named against
35
+ the skills it sits closest to.
36
+ - **What it reads and what it writes.** Every state file has exactly one writer; a new
37
+ writer for an existing file needs a reason and a rule for the overlap.
38
+ - **What it must never do**, beyond the authority tiers.
39
+ - **Where it sits in the loop**, and which skills hand to it or receive from it.
40
+
41
+ ## Step 3 - write the source
42
+
43
+ Create `src/skills/<name>/SKILL.md` with frontmatter carrying `name` matching the
44
+ directory, `summary` as a short clause for the roster, and `description` as the long
45
+ routing text.
46
+
47
+ **The description is what routing runs on.** Write it as the situations that should select
48
+ this skill, in the words a user would actually use, and name the neighbours it must not be
49
+ confused with. A description written as a feature list routes badly.
50
+
51
+ Reference other skills and paths through the token vocabulary rather than writing literal
52
+ syntax: the command token takes a skill name and renders that tool's own invocation, and
53
+ the state token renders the state directory. A literal slash is correct for one tree and
54
+ wrong for the others, and a literal directory name breaks if the system is ever renamed.
55
+ The vocabulary is defined in `src/lib/adapters.ts`.
56
+
57
+ Then the body: where it sits, its steps, its rules, and the formatting pointer. Match the
58
+ existing skills, which say **why** a rule exists rather than only stating it, because a rule
59
+ whose reason is written survives contact with a case its author did not foresee.
60
+
61
+ ## Step 4 - register and render
62
+
63
+ Add the name to the planned roster in `src/lib/skills.ts`, or the reference check will
64
+ reject every mention of it.
65
+
66
+ Run the build, which renders it into every adapter tree, then run the verification, which
67
+ confirms the frontmatter is complete, no token is unrendered, every reference resolves, and
68
+ nothing drifted.
69
+
70
+ ## Step 5 - prove it routes
71
+
72
+ Add `evals/routing/<name>.json`: prompts that must select this skill, and prompts belonging
73
+ to neighbouring skills that must not.
74
+
75
+ The negative cases matter more. A skill that fires when it should is easy; a skill that
76
+ stays quiet when a neighbour should have fired is what keeps a large roster usable. Write
77
+ the confusable cases deliberately, not the obvious ones.
78
+
79
+ Run the routing evaluation. A regression in a **neighbouring** skill's score is the expected
80
+ failure mode: the new description pulled requests away from it. Fix it by narrowing the
81
+ descriptions until each request has one clear owner.
82
+
83
+ ## Step 6 - wire it in
84
+
85
+ A skill nobody reaches is not a capability. Update whatever should point at it: the entry
86
+ files if it changes the loop, the interaction guide if it changes the sequence, the skills
87
+ that should hand off to it.
88
+
89
+ Report what was added, what it routes on, its eval results, and every file changed.
90
+
91
+ ## Rules
92
+
93
+ - Argue against it first, honestly.
94
+ - One job per skill. Two sentences means two skills, or a mode on one.
95
+ - The description is routing, not marketing.
96
+ - Never ship a skill without its routing tests.
97
+ - Never edit a rendered tree. Edit the source and rebuild.
98
+
99
+ ## Formatting
100
+
101
+ Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
102
+ markdown, lists for enumerations and tables for matrices rather than dense paragraphs.
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: feature
3
+ summary: turn a build-plan item into a reviewed, buildable spec
4
+ description: "Turn a feature from the build plan into a buildable spec in religion/context/current-work.md. With no argument it specs the first unchecked item; given a number or name it specs that one; add `preview` to get a read-only briefing that writes nothing. A genuinely new feature goes through an intake that proposes the plan line, waits for approval, and refreshes the overview before spec'ing. Sizes the work and splits anything too large into sub-items, writes small build steps with observable outcomes, then red-teams its own draft and reports what the critique changed before stopping for review. Use when the user runs $feature, names or numbers a feature, asks to start or break down the next feature, or asks what an upcoming feature involves."
5
+ ---
6
+
7
+ # feature - turn a build-plan item into a buildable spec
8
+
9
+ Where this sits:
10
+
11
+ build-plan.md -> [feature] -> current-work.md -> implement
12
+ (one line) (spec it) (the spec) (build it)
13
+
14
+ The build plan is deliberately thin: one line per item, no detail. Turning one of those
15
+ lines into something buildable is this skill's whole job. It plans; it never builds.
16
+
17
+ ## Input
18
+
19
+ - **No argument** - the first unchecked item in the build plan, including the first
20
+ unchecked sub-item under an item that was split.
21
+ - **A number or name** - `$feature 3`, `$feature "login"`.
22
+ - **A description with no match in the plan** - goes through **New work intake** below.
23
+ - **`preview`** appended to any of the above - a read-only briefing, writing nothing.
24
+
25
+ ## Step 0 - make sure the ground is solid
26
+
27
+ Two checks before anything else.
28
+
29
+ **Overview freshness.** Recompute the source hash over the two plans. If it does not match
30
+ the stamp in `religion/context/project-overview.md`, or the stamp is missing, follow the
31
+ `$overview` skill first, report what changed, then continue here. A spec written
32
+ against a stale overview encodes a data model the plans no longer describe.
33
+
34
+ **Open questions.** Read the overview's Open questions section. If any of them lists an
35
+ area this item touches in its `affects` line, the contradiction would be resolved by
36
+ guessing while writing the spec. Instead:
37
+
38
+ 1. Name the question and quote what the two plans each say.
39
+ 2. Ask the user to decide.
40
+ 3. Show the exact edit their answer implies, in the plan section that is wrong.
41
+ 4. On approval, write it, follow `$overview` to regenerate, then continue.
42
+
43
+ Only the user's own answer may resolve an open question, and only the edit they approved
44
+ is written. If they would rather not decide now, stop and say which item remains blocked.
45
+
46
+ An open question whose `affects` list does not cover this item does not block it.
47
+
48
+ ## Step 1 - pick the target
49
+
50
+ Given a number or name that matches a build-plan item, use it. With no argument, read the
51
+ plan top to bottom and take the first unchecked leaf. State which item you are spec'ing
52
+ before going further.
53
+
54
+ If the build plan is not a checklist yet, treat every item as unchecked, take the first,
55
+ and offer to convert the list so progress can be tracked from here on. Proceed either way.
56
+
57
+ ### New work intake
58
+
59
+ For a genuinely new capability, not a bug or small change. Those go to $fix.
60
+
61
+ 1. Search checked and unchecked items for an existing or near-duplicate item. If the
62
+ wording might just be a different name for something already planned, show the closest
63
+ matches instead of creating new scope.
64
+ 2. If it is genuinely new, propose one feature-sized checkbox line and where it belongs.
65
+ Preserve completed items and their numbers; take the next unused number.
66
+ 3. Check whether it materially changes product direction, users, data, stack, or
67
+ deployment. Include the exact proposed project-plan edits only when it does. Most
68
+ incremental work changes only the build plan.
69
+ 4. Stop for approval, showing the complete proposed plan change.
70
+ 5. After approval, write it, follow `$overview` to regenerate, then resume here with
71
+ the new item as the target.
72
+
73
+ Never add scope to a plan the user owns without showing the exact change and waiting.
74
+
75
+ ## Step 2 - size it, and split if it is too big
76
+
77
+ Read the target line, then take full context from the project overview: the data model,
78
+ the stack, the conventions. Then decide how big this is.
79
+
80
+ **Small enough to build and review as one unit** goes to Step 3.
81
+
82
+ **Too big for one reviewable spec** gets split. Propose a short list of sub-items, title
83
+ and one line each, let the user adjust it, then write them under the parent as an indented
84
+ checklist (`4a`, `4b`, `4c`). Spec only the first now; the rest are picked up later.
85
+
86
+ Two levels of breakdown, easily confused:
87
+
88
+ - **Sub-items** are each big enough to stand alone: their own spec, review, and archive.
89
+ - **Build steps** are small diffs inside one item.
90
+
91
+ "Authentication" is too big for one spec, so it becomes `4a` registration, `4b` login,
92
+ `4c` route protection. Inside `4a`, the page and its server action are steps, not items.
93
+
94
+ This sizing call is exactly why the build plan stays high level.
95
+
96
+ ### Preview mode
97
+
98
+ When the request ended in `preview`, stop here and report, writing nothing:
99
+
100
+ - what the item is, in a sentence
101
+ - what it depends on, and whether those are done
102
+ - what it will touch: routes, models, modules
103
+ - rough size, and how many steps it is likely to need
104
+ - whether it will split, and into what
105
+ - anything worth deciding before spec'ing it
106
+
107
+ That is the whole of preview mode. Do not write the spec, touch the plans, or create files.
108
+
109
+ ## Step 3 - write the spec
110
+
111
+ Write `religion/context/current-work.md` following `reference/spec-template.md`, filling
112
+ every section.
113
+
114
+ **Design reference.** If `prototypes/` exists, it is the reference and no image is needed.
115
+ Check what is in it:
116
+
117
+ - **Static mockups sharing a theme file** are throwaway. Link the relevant ones, treat the
118
+ theme as the source of truth for colour, type, and spacing, and make the **first build
119
+ step** port those tokens into the application's real stylesheet before any component is
120
+ built against them.
121
+ - **Real components** are not throwaway. Link them and build on them directly. There is no
122
+ token-porting step, because the tokens are already the project's.
123
+
124
+ If there are no prototypes and the work is visual or a replication of an existing design,
125
+ ask for a screenshot, save it under `religion/reference/`, and link it. Do not write a
126
+ visual spec from words alone when an image could exist.
127
+
128
+ **Build steps** are the core of the file. Each is a small diff, ends with something that
129
+ works, depends only on earlier steps, and carries an outcome that can actually be observed.
130
+ Read the Commands section of the entry file while writing the Testing section, so predicted
131
+ coverage matches the gate that is actually on.
132
+
133
+ This is a draft. Do not present it yet.
134
+
135
+ ## Step 4 - red-team the draft, then tighten
136
+
137
+ Turn on your own spec and try to break it. The cheapest place to catch a scope problem or
138
+ an oversized step is here, before any code exists.
139
+
140
+ - **Coverage.** What does this need that no step delivers? Push on what the happy path
141
+ skipped: empty, missing, or malformed input; the error, loading, and empty states; the
142
+ first-run case; failure of anything external it calls.
143
+ - **Step size.** Would any step's diff be too large to read in one sitting? Split it.
144
+ Oversized steps defeat the review gate, which is the point of the whole loop.
145
+ - **Order.** Does each step leave the project working, and depend only on earlier ones?
146
+ - **Contracts.** Is any type, route, or stored shape that later work will touch left
147
+ undefined? Lock it now and mark it load-bearing.
148
+ - **Scope honesty.** Is anything creeping in that belongs to a later item? Is anything
149
+ pushed out of scope that this item genuinely cannot ship without?
150
+ - **Outcomes.** Is each one observable and checkable, or is it a vague "it works"?
151
+ - **Visual fidelity.** If this is visual work, is a reference linked, or is it about to be
152
+ built blind from prose?
153
+ - **Testing.** Does the predicted coverage match the gate that is on?
154
+
155
+ Apply the fixes. Then stop and present the spec, leading with a short **what the critique
156
+ changed** note: the splits, gaps, or scope cuts made, or "nothing, the draft held up".
157
+
158
+ That note is the point. It shows the gate working before a line of code exists.
159
+
160
+ ## Rules
161
+
162
+ - Small, reviewable steps. A diff too large to read means the step was too large.
163
+ - Build in order. Each step leaves the project working.
164
+ - Lock data contracts early and mark load-bearing shapes.
165
+ - Scope honestly. State what is deferred so the item stays contained.
166
+ - The plans belong to the user. Propose, show the exact change, and wait.
167
+ - This skill plans. It never writes product code, and never starts building.
168
+
169
+ ## Formatting
170
+
171
+ Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
172
+ markdown, lists for enumerations and tables for matrices rather than dense paragraphs.
@@ -0,0 +1,67 @@
1
+ # <Feature name>
2
+
3
+ **Type:** Feature
4
+ **From build plan:** item <n>
5
+ **Status:** not started
6
+
7
+ ## Goal
8
+
9
+ What this delivers, in a sentence or two, and why it matters. Someone reading only this
10
+ section should know what will be true when the work is done.
11
+
12
+ ## Design reference
13
+
14
+ For visual or replication work, link the reference here: the mockups under `prototypes/`
15
+ when they exist, or an image saved under `religion/reference/`. Prose underspecifies a
16
+ visual target, and the approximation costs more to correct than the reference costs to
17
+ obtain. Delete this section when the work has no visual target.
18
+
19
+ ## In scope
20
+
21
+ - The specific things this work includes.
22
+
23
+ ## Out of scope
24
+
25
+ - What it deliberately does not touch, and which later item picks it up.
26
+
27
+ ## Build loop
28
+
29
+ Build one step at a time, never the whole item at once.
30
+
31
+ 1. The step is planned before any code is written.
32
+ 2. Just that step is implemented, as the smallest change that satisfies its outcome.
33
+ 3. The diff is shown, not whole files, and explained in plain language.
34
+ 4. Its stated outcome is proved with evidence, then the step is approved.
35
+
36
+ Never accept a step you have not read. If a diff is too large to review, the step was too
37
+ large, so split it.
38
+
39
+ ## Build steps
40
+
41
+ Small, reviewable units. Each ends with something that works, and each carries an
42
+ observable outcome that can be checked. These boxes are ticked as the steps land, which is
43
+ what lets a cleared context resume from the first unchecked one.
44
+
45
+ - [ ] **Step 1 - <what it builds>** - what changes. *Done when:* <observable outcome>.
46
+ - [ ] **Step 2 - <what it builds>** - what changes. *Done when:* <observable outcome>.
47
+
48
+ ## Files and areas
49
+
50
+ - The files or modules this creates or changes.
51
+
52
+ ## Data and contracts
53
+
54
+ - Types, stored shapes, or interface shapes involved, or "none".
55
+ - Mark anything later work will depend on as load-bearing.
56
+
57
+ ## Testing
58
+
59
+ - How the outcomes are verified, per step.
60
+ - When a test command is declared, name the in-scope logic that needs a test: parsers,
61
+ formatters, validators, server actions. Not components or integration surfaces.
62
+ - When no runner is configured, say so and rely on running it, a screenshot, and the build.
63
+
64
+ ## Notes for the agent
65
+
66
+ - Conventions and constraints this work must respect, drawn from the coding standards and
67
+ the project overview. Anything that would be wrong in a way review would not catch.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: fix
3
+ summary: spec an unplanned bug or small change, or repair a recorded finding
4
+ description: "Write a short spec for an unplanned bug or small change into religion/context/current-work.md so it runs through the same reviewed loop as planned work, then stop. Given a finding identifier instead, specs the repair of that recorded finding. Fixes are archived under religion/history/fixes/ and never touch the build plan. Use when the user runs $fix, reports a bug, asks to fix or change something that is not a planned item, or asks to pick up a finding from the ledger."
5
+ ---
6
+
7
+ # fix - spec an unplanned change
8
+
9
+ Same loop as planned work, smaller spec. A fix is not a build-plan item: it is not
10
+ numbered, it ticks nothing, and it archives on its own.
11
+
12
+ ## Input
13
+
14
+ - **A description** - `$fix "password reset email never sends"`. A problem stated in the
15
+ conversation already counts; this skill does not scan the project hoping to find
16
+ something wrong.
17
+ - **A finding identifier** - `$fix F-03` specs the repair of that ledger entry.
18
+
19
+ Without either, ask what is wrong. Do not guess.
20
+
21
+ ## Step 1 - understand the problem
22
+
23
+ **For a described problem**, establish what actually happens before writing what should.
24
+ Reproduce it if you can do so cheaply. If the cause is genuinely unclear and finding it
25
+ would mean exploring, stop and point at $debug, which isolates a failure without
26
+ changing anything. Writing a fix spec against a guessed cause produces a fix for the wrong
27
+ problem.
28
+
29
+ **For a finding**, read its entry in `religion/context/findings.md`: the file and line, why
30
+ it matters, the suggested fix. The finding is the problem statement.
31
+
32
+ If something is already in progress in `religion/context/current-work.md`, say so and ask
33
+ whether to set it aside. One thing at a time is the point.
34
+
35
+ ## Step 2 - write the spec
36
+
37
+ Write `religion/context/current-work.md` following the shape in
38
+ `$feature`'s spec template, marked `Type: Fix`, with no build-plan number. Keep it
39
+ short. A fix that needs a long spec is a feature that has not admitted it yet, and should
40
+ go through $feature instead.
41
+
42
+ Fill in:
43
+
44
+ - **Goal** - what is wrong, and what will be true afterwards.
45
+ - **Cause** - what actually produces the behavior, and how that was established. If the
46
+ cause is a guess, say so; a fix built on a guess needs review to know that.
47
+ - **In and out of scope** - especially what nearby brokenness is deliberately not being
48
+ fixed now. Fixes sprawl more easily than features because the surrounding code is already
49
+ under suspicion.
50
+ - **Build steps** - usually one or two, each with an observable outcome.
51
+ - **Testing** - when a test runner is configured and the fix touches logic, the fix ships a
52
+ test that fails without it. A bug that could recur silently is exactly what the test gate
53
+ is for.
54
+
55
+ For a finding repair, name the finding identifier in the Goal so the archive and the ledger
56
+ agree about what happened.
57
+
58
+ ## Step 3 - stop
59
+
60
+ Present the spec for review. This skill plans; $implement builds it.
61
+
62
+ For a finding repair, note that implementation marks the finding `fixed` and only a later
63
+ $audit moves it to `closed`.
64
+
65
+ ## Rules
66
+
67
+ - A fix needs a real problem statement. Do not invent one.
68
+ - Do not fix things nobody reported while you are in there. Note them instead.
69
+ - If the fix turns out to be feature-sized, stop and say so rather than growing the spec.
70
+ - Never mark a finding `accepted` or `invalid`. Those are the user's call and a review's
71
+ verdict.
72
+
73
+ ## Formatting
74
+
75
+ Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
76
+ markdown, lists for enumerations and tables for matrices rather than dense paragraphs.