create-religion 0.1.1 → 0.3.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 (41) hide show
  1. package/dist/lib/doctor.js +5 -1
  2. package/package.json +1 -1
  3. package/template/.agents/skills/audit/SKILL.md +1 -0
  4. package/template/.agents/skills/auto/SKILL.md +75 -8
  5. package/template/.agents/skills/capture/SKILL.md +65 -0
  6. package/template/.agents/skills/complete/SKILL.md +29 -3
  7. package/template/.agents/skills/doctor/SKILL.md +1 -0
  8. package/template/.agents/skills/feature/SKILL.md +16 -0
  9. package/template/.agents/skills/fix/SKILL.md +6 -1
  10. package/template/.agents/skills/implement/SKILL.md +50 -5
  11. package/template/.agents/skills/refactor/SKILL.md +165 -0
  12. package/template/.agents/skills/rollback/SKILL.md +35 -1
  13. package/template/.agents/skills/spike/SKILL.md +92 -0
  14. package/template/.agents/skills/status/SKILL.md +1 -0
  15. package/template/.agents/skills/try/SKILL.md +1 -0
  16. package/template/.claude/hooks/guard-rendered-output.mjs +33 -4
  17. package/template/.claude/hooks/guard-tier-one.mjs +37 -5
  18. package/template/.claude/hooks/scan-untrusted-input.mjs +114 -0
  19. package/template/.claude/skills/audit/SKILL.md +1 -0
  20. package/template/.claude/skills/auto/SKILL.md +75 -8
  21. package/template/.claude/skills/capture/SKILL.md +65 -0
  22. package/template/.claude/skills/complete/SKILL.md +29 -3
  23. package/template/.claude/skills/doctor/SKILL.md +1 -0
  24. package/template/.claude/skills/feature/SKILL.md +16 -0
  25. package/template/.claude/skills/fix/SKILL.md +6 -1
  26. package/template/.claude/skills/implement/SKILL.md +50 -5
  27. package/template/.claude/skills/refactor/SKILL.md +165 -0
  28. package/template/.claude/skills/rollback/SKILL.md +35 -1
  29. package/template/.claude/skills/spike/SKILL.md +92 -0
  30. package/template/.claude/skills/status/SKILL.md +1 -0
  31. package/template/.claude/skills/try/SKILL.md +1 -0
  32. package/template/AGENTS.md +30 -2
  33. package/template/CLAUDE.md +26 -2
  34. package/template/religion/.state/settings-template.json +29 -3
  35. package/template/religion/config.json +12 -2
  36. package/template/religion/context/ai-interaction.md +16 -2
  37. package/template/religion/context/current-work.md +7 -5
  38. package/template/religion/context/inbox.md +10 -0
  39. package/template/religion/context/untrusted-input.md +57 -0
  40. package/template/religion/history/refactors/README.md +9 -0
  41. package/template/religion/history/spikes/README.md +9 -0
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: complete
3
3
  summary: run the final gate, archive the work, commit it, and close it out
4
- description: "Close out a finished feature, fix, or rollback. Runs the full Verify command and the final safety pass, applies the configured quality gates, archives the spec under religion/history/, ticks the build plan, prunes resolved findings into the archive, resets the active spec, and makes the work commit. Under branch-per-item it squash-merges only with explicit approval, then asks separately before pushing. Ends with a manual walkthrough of what landed. Use when the user runs /complete, or asks to finish, wrap up, close out, or merge the current work item once it is built and reviewed."
4
+ description: "Close out a finished feature, fix, rollback, or refactor campaign. Runs the full Verify command and the final safety pass, applies the configured quality gates, archives the spec under religion/history/, ticks the build plan, prunes resolved findings into the archive, resets the active spec, and makes the work commit. Under branch-per-item it squash-merges only with explicit approval, then asks separately before pushing. Under pull-request it pushes the branch and opens a pull request into the default branch, merging nothing. Ends with a manual walkthrough of what landed. Use when the user runs /complete, or asks to finish, wrap up, close out, or merge the current work item once it is built and reviewed."
5
5
  ---
6
6
 
7
7
  # complete - close out the finished work
@@ -80,6 +80,9 @@ Read the spec's type.
80
80
  - **Rollback** - archive to `religion/history/rollbacks/YYYY-MM-DD-NN-name.md`, leaving
81
81
  the original feature archive intact. Untick the target item, and append a short note to
82
82
  that line with the date and the rollback's archive path. Keep the number stable.
83
+ - **Refactor** - archive to `religion/history/refactors/area-lens.md`. A campaign is not a
84
+ plan item, so there is nothing to tick. Carry the deferred candidates across into the
85
+ archive, since they are what the next campaign over that area starts from.
83
86
 
84
87
  The number lives in the path. It never appears in the commit message.
85
88
 
@@ -149,10 +152,33 @@ Under **`branch-per-item`**:
149
152
  2. Delete the branch after a clean merge.
150
153
  3. Stop.
151
154
 
152
- Then, in either mode, ask separately whether to push. **Approval to merge is not approval
153
- to push.** Push only after an explicit yes to pushing, in this conversation. If there is no
155
+ In those two modes, ask separately whether to push. **Approval to merge is not approval to
156
+ push.** Push only after an explicit yes to pushing, in this conversation. If there is no
154
157
  remote, say so rather than guessing.
155
158
 
159
+ Under **`pull-request`** nothing is merged here and the default branch is never written to.
160
+ The branch goes up, the pull request describes it, and the merge is the user's, on the host:
161
+
162
+ 1. Confirm the repository can host one: a remote exists and the host command works. If it
163
+ cannot, stop and say so plainly. The work is committed on its branch and the user can
164
+ open the pull request themselves. Never invent a remote, and never quietly fall back to
165
+ a local merge, which would swap the history model without saying so.
166
+ 2. Push the branch and set its upstream, only with an explicit yes in this conversation.
167
+ **That yes covers pushing this branch and nothing else.** Neither running this skill nor
168
+ "looks good" is that yes.
169
+ 3. Open the pull request from the branch into the default branch. Title it from the work
170
+ commit. The body carries what changed and why, the checks that ran with the exact command
171
+ or output proving each, the manual walkthrough from Step 5, and anything left open:
172
+ unresolved findings, deliberate omissions, follow-ups.
173
+ 4. Report the pull request URL and stop. Do not merge it, do not wait or poll for it, and do
174
+ not touch the default branch.
175
+
176
+ Deleting the branch is a separate, later action, because the merge happens outside this
177
+ session. When the user says it merged: check out the default branch, fast-forward it,
178
+ confirm the work commit is actually in it, and only then delete the branch locally and on
179
+ the remote. A squash-merge leaves no merge parent, so `git branch -d` will refuse; verify
180
+ the content landed before reaching for `-D`.
181
+
156
182
  ## Step 5 - say how to try it
157
183
 
158
184
  Always end with the manual walkthrough for what just landed: what to start, where to go,
@@ -2,6 +2,7 @@
2
2
  name: doctor
3
3
  summary: check the setup is healthy and explain anything that is not
4
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
+ allowed-tools: Read, Grep, Glob, Bash
5
6
  ---
6
7
 
7
8
  # doctor - is this set up correctly
@@ -22,6 +22,11 @@ lines into something buildable is this skill's whole job. It plans; it never bui
22
22
  - **A description with no match in the plan** - goes through **New work intake** below.
23
23
  - **`preview`** appended to any of the above - a read-only briefing, writing nothing.
24
24
 
25
+ Read `religion/context/inbox.md` before choosing. When it holds anything and no argument
26
+ named a specific item, list what is in it alongside the plan item you would otherwise take,
27
+ and let the user pick. A note that is specced leaves the inbox with the line removed; the
28
+ rest stay. An inbox nobody reads is a list of things nobody did.
29
+
25
30
  ## Step 0 - make sure the ground is solid
26
31
 
27
32
  Two checks before anything else.
@@ -127,9 +132,20 @@ visual spec from words alone when an image could exist.
127
132
 
128
133
  **Build steps** are the core of the file. Each is a small diff, ends with something that
129
134
  works, depends only on earlier steps, and carries an outcome that can actually be observed.
135
+
136
+ Where two steps genuinely do not depend on each other, mark the later one `(with N)`. It is
137
+ an assertion, not a hint: that these steps touch different files and neither needs the
138
+ other's result. Mark nothing you are unsure of. An unmarked spec is sequential, which is
139
+ always correct and never wrong, and a project with `workflow.parallelSteps` off ignores the
140
+ markers entirely.
130
141
  Read the Commands section of the entry file while writing the Testing section, so predicted
131
142
  coverage matches the gate that is actually on.
132
143
 
144
+ When writing the spec needed a broad read of the codebase first, run that read in a subagent
145
+ and have it return what it found. A survey large enough to be worth doing is large enough to
146
+ crowd out the context that has to write the spec from it. The subagent reads and returns; this
147
+ skill writes, as it always does.
148
+
133
149
  This is a draft. Do not present it yet.
134
150
 
135
151
  ## Step 4 - red-team the draft, then tighten
@@ -16,7 +16,12 @@ numbered, it ticks nothing, and it archives on its own.
16
16
  something wrong.
17
17
  - **A finding identifier** - `/fix F-03` specs the repair of that ledger entry.
18
18
 
19
- Without either, ask what is wrong. Do not guess.
19
+ - **Nothing** - read `religion/context/inbox.md` and offer what is there. Those notes were
20
+ taken mid-build precisely because they were not worth stopping for at the time, and this is
21
+ the moment they are worth something. Specced notes leave the inbox; the rest stay.
22
+
23
+ Without any of those, ask what is wrong. Do not guess, and do not scan the project hoping to
24
+ find something.
20
25
 
21
26
  ## Step 1 - understand the problem
22
27
 
@@ -50,9 +50,11 @@ Read `git.mode`.
50
50
  If the current branch looks wrong for this work, say so and ask; do not switch or create
51
51
  one unprompted.
52
52
 
53
- **`branch-per-item`** creates and checks out a branch named from the spec using the
54
- configured prefix. On a resume the branch exists already, so check it out rather than
55
- creating a second one.
53
+ **`branch-per-item`** and **`pull-request`** both create and check out a branch named from
54
+ the spec, using the prefix configured for its kind: feature, fix, rollback, or refactor.
55
+ They differ only in how the work leaves the branch at completion, which is not this skill's
56
+ concern. On a resume the branch exists already, so check it out rather than creating a
57
+ second one.
56
58
 
57
59
  Either way, if the project is not a git repository, say so and ask the user to initialize
58
60
  one. The loop needs history to be reviewable.
@@ -63,7 +65,7 @@ Set the spec's status to `in progress` before the first code change of this run,
63
65
  whenever work resumes after a passing check and touches product code. That invalidates
64
66
  stale verification state.
65
67
 
66
- Work through the build steps **in order, one at a time**. For each:
68
+ Work through the build steps **in order, one at a time**, unless a wave applies. For each:
67
69
 
68
70
  1. **Implement just that step.** The smallest change that satisfies its stated outcome.
69
71
  Nothing from a later step, nothing nobody asked for.
@@ -90,8 +92,13 @@ Work through the build steps **in order, one at a time**. For each:
90
92
  is failing, and offer to hand it to /debug, which reproduces the failure and
91
93
  tests competing hypotheses in parallel. Do not keep trying variations.
92
94
  6. **Tick the step** (`- [x]`) once its gate is satisfied, so progress survives a cleared
93
- context. If the step repaired a finding, mark that finding `fixed` and note the repair
95
+ context. In a wave, tick each step that passed, and only those. If the step repaired a finding, mark that finding `fixed` and note the repair
94
96
  in its resolution line. Never mark it `closed`; see Step 3.
97
+
98
+ **Tick it then, not later.** Never save several ticks to write in one go. The spec on
99
+ disk is the only record of what is done, and a session that ends between the work and
100
+ the bookkeeping loses exactly the step it just finished: the next one rebuilds it,
101
+ because an unticked step is indistinguishable from one never started.
95
102
  7. **Then prompt, according to config.**
96
103
 
97
104
  With `workflow.stepReview: "item"`, do not prompt. Continue to the next step and
@@ -115,6 +122,44 @@ Work through the build steps **in order, one at a time**. For each:
115
122
  Never batch the whole item into one diff. A diff too large to read means the step was too
116
123
  large; split it.
117
124
 
125
+ ## Waves, when the spec asks for them
126
+
127
+ Off unless `workflow.parallelSteps` is `true`. When it is off, ignore every marker and build
128
+ in order: a spec carrying markers must behave identically in a project that never opted in.
129
+
130
+ A step marked `(with N)` may run alongside step `N`. Those steps and everything transitively
131
+ joined to them form one **wave**. A step with no marker waits for every step before it, which
132
+ is why an unmarked spec is exactly as sequential as it has always been.
133
+
134
+ - [ ] 1. Add the schema migration
135
+ - [ ] 2. Build the endpoint
136
+ - [ ] 3. Build the client (with 2)
137
+ - [ ] 4. Update the docs
138
+
139
+ Two waves of one, then a wave of two, then a wave of one.
140
+
141
+ **Refuse a wave rather than guess at one.** Run the wave sequentially, and say why, when:
142
+
143
+ - a marker names a later step, itself, or a step that does not exist
144
+ - two steps in the wave would change the same file, which is a conflict the spec did not
145
+ intend and the author is better placed to resolve than a merge
146
+ - the wave is larger than three steps, which usually means the spec is describing one step
147
+ badly rather than three independent ones
148
+
149
+ **Building a wave.** Each step runs in its own subagent with the step, the spec, the
150
+ standards, and nothing else. They build and **return**; they do not tick, do not write the
151
+ spec, and do not touch the ledger. The parent applies what comes back, runs the gate for each
152
+ step, and performs every write. This is the same rule audit's lenses follow, for the same
153
+ reason: concurrent writers to one file is the one thing waves must never introduce.
154
+
155
+ **A failure stops the wave.** Report which steps passed and which did not, tick only what
156
+ passed, and stop. Do not retry the wave; the next run resumes at the first unticked step,
157
+ sequentially, because a wave that failed once has already shown its independence was wrong.
158
+
159
+ **One packet per wave.** Steps that ran together are reviewed together: one diff with a
160
+ section per step and its evidence, prompted once. `workflow.stepReview` still decides whether
161
+ that prompt happens per wave or is collected to the end; a wave never lands unreviewed.
162
+
118
163
  ## Step 3 - clear the ledger before handing off
119
164
 
120
165
  Read `religion/context/findings.md`. A P0 or P1 finding that is `open` or `fixed` will
@@ -0,0 +1,165 @@
1
+ ---
2
+ name: refactor
3
+ summary: simplify existing code in one behaviour-preserving campaign at a time
4
+ description: "Simplify code that already exists, one behaviour-preserving campaign at a time. Takes a target that must be named (a single file, a folder, one package, or a monorepo root) and surveys it across five lenses: bloat, structure, over-implementation, duplication, and reinvention of what the language, the standard library, or an installed dependency already provides. Specs one lens in one area into religion/context/current-work.md and stops, leaving /implement to build it. Refuses to start when no test reaches the target, since a change meant to preserve behaviour needs something able to notice when it does not. Use when the user runs /refactor, asks to simplify, shrink, tidy, consolidate, or clean up existing or inherited code, says something is bloated or over-engineered, or wants a hand-rolled implementation replaced by something already available."
5
+ ---
6
+
7
+ # refactor - simplify what is already there
8
+
9
+ Refactoring is the one kind of change defined by what it must **not** do. The code gets
10
+ smaller; what it does stays identical. That constraint is the whole skill, and every rule
11
+ below exists to protect it.
12
+
13
+ This skill surveys and plans. It writes one campaign into
14
+ `religion/context/current-work.md` and stops, the same as /feature and /fix.
15
+ /implement builds it under the usual review gates.
16
+
17
+ ## Input
18
+
19
+ A **target is required**, and may be any size:
20
+
21
+ /refactor src/lib/date.ts a single file
22
+ /refactor src/legacy a folder
23
+ /refactor packages/api one package
24
+ /refactor . a monorepo root
25
+
26
+ There is no default and no implicit whole-project mode. Refactoring without a named target
27
+ is how a work item becomes unbounded. If no target is given, ask for one rather than
28
+ guessing at what looks worst.
29
+
30
+ A **lens** may follow, to survey only that axis: `/refactor packages/api duplication`.
31
+
32
+ ## The five lenses
33
+
34
+ Ordered as the campaign order is ordered, by how much each depends on a judgement about
35
+ equivalence. The earlier ones are safe because nothing has to be judged equal to anything.
36
+
37
+ | Lens | Finds | The judgement it rests on |
38
+ | --- | --- | --- |
39
+ | `bloat` | comments restating the code, banner blocks and section dividers, dead code, unreachable branches, unused imports, variables and exports | none: the code is not reached |
40
+ | `structure` | files and functions past the configured size, god objects, control flow nested past following | none: a move preserves behaviour by construction |
41
+ | `over-implementation` | abstraction layers, configuration options, generality and extension points nothing calls | that nothing calls it |
42
+ | `duplication` | the same utility, type, component or constant defined repeatedly, when one definition would serve | that the copies are actually the same |
43
+ | `reinvention` | hand-rolled implementations of what the language, the standard library, or an already-installed dependency provides | that the replacement matches every edge case |
44
+
45
+ `structure` reads its thresholds from `refactor.maxFileLines` and
46
+ `refactor.maxFunctionLines` in `religion/config.json`. They are defaults rather than a
47
+ standard this project agreed to, so a project that has set its own limits in a linter
48
+ should have those numbers copied into the configuration and used instead.
49
+
50
+ ## Step 1 - resolve the target
51
+
52
+ Establish what was named: a file, a folder, a package, or a workspace root holding several.
53
+ For a package or a workspace, read the manifests to learn where each package begins and
54
+ what each one publishes. That boundary matters twice over, in Step 4 and in Step 5.
55
+
56
+ Exclude what is not the project's to simplify: dependencies, generated files, build output,
57
+ caches, vendored code, minified assets, and anything the project's ignore rules already
58
+ exclude. State the exclusions before surveying, so nobody mistakes a skipped directory for
59
+ a clean one.
60
+
61
+ ## Step 2 - establish the safety net, or stop
62
+
63
+ **A declared test command is not the gate. Tests that reach the target are the gate.**
64
+
65
+ Run the project's declared test command and confirm the suite both passes and exercises the
66
+ target. A suite of six hundred green tests proves nothing about a directory none of them
67
+ import, and proceeding on it is worse than proceeding on nothing, because it feels safe.
68
+
69
+ When no test command is declared, or none reaches the target, stop and say so plainly:
70
+ name the target, say what the suite does cover, and point at /tests to cover the
71
+ target first. A required check that cannot run is a blocker, not a pass.
72
+
73
+ When the net holds, record the exact command and its result. That green baseline goes into
74
+ the spec in Step 5, so every step can be measured against the state before anything moved.
75
+
76
+ ## Step 3 - survey
77
+
78
+ **Run the survey in a subagent and have it return the map.** For anything larger than a
79
+ single file this is the difference between writing a campaign with room to think and writing
80
+ it from a context already full of the survey. The subagent reads and returns counts and
81
+ candidate locations; it never writes, and this skill performs the single write, exactly as
82
+ /audit does with its lenses.
83
+
84
+ Read the target across the selected lenses, or all five when none was named. Read
85
+ `religion/context/findings.md` as well: quality findings recorded by /audit against
86
+ this area are candidates already identified, and folding them in avoids rediscovering them
87
+ under a second name. **Never write to the ledger.** /audit owns that file, and a
88
+ finding's status stays its to change.
89
+
90
+ Report what was found as counts per area and per lens, densest first:
91
+
92
+ packages/api bloat 41 structure 7 duplication 12
93
+ packages/shared bloat 6 structure 2 duplication 21
94
+ packages/cli bloat 3 structure 0 duplication 1
95
+
96
+ For a single file the map is one row, which is fine. The point is that the size of the job
97
+ is visible before anyone commits to it.
98
+
99
+ ## Step 4 - choose one lens, in one area
100
+
101
+ **A campaign is one lens in one area.** Not five lenses, not the whole monorepo. A spec
102
+ mixing safe deletions with semantic replacements cannot be reviewed as one thing, because
103
+ the reviewer's attention is spent on the easy half.
104
+
105
+ Propose the widest win, say why, and let the user choose. Everything else stays in the
106
+ report, unspecced, waiting for the next run after this campaign completes.
107
+
108
+ Two boundaries constrain what may enter the campaign:
109
+
110
+ - **The published surface stops and asks.** Anything reachable only from inside the project
111
+ can be merged, renamed or reshaped freely, which is what makes the duplication lens work
112
+ at all. Anything a consumer can import, taken from the manifest's entry points, is a
113
+ breaking change wearing a refactor's clothes. Name it, say what would break, and let the
114
+ user decide whether it belongs in this campaign or in a feature.
115
+ - **A new dependency needs its own yes, and has to earn it.** When the language and the
116
+ installed dependencies genuinely cannot replace hand-rolled code, a new dependency may be
117
+ proposed, never assumed. Propose one only when it would be used in **several places**. A
118
+ dependency that saves fifty lines in a single file is a bad trade: the code leaves and the
119
+ supply chain stays.
120
+
121
+ ## Step 5 - write the campaign
122
+
123
+ Write the spec into `religion/context/current-work.md`: the target, the lens, the green
124
+ baseline from Step 2, and the change broken into steps small enough to read as diffs.
125
+
126
+ Order the steps so each one stands alone and can be verified against the baseline. Record
127
+ what would prove the behaviour unchanged, which is the test command from Step 2 for logic,
128
+ and for anything with a visible surface a route to walk and what should appear.
129
+
130
+ Candidates that were found but not specced go in as a short list at the end, so the next run
131
+ has them and nothing is rediscovered from scratch.
132
+
133
+ Completion archives the campaign under `religion/history/refactors/`. Refactor campaigns
134
+ are their own kind of work: they are not build-plan items, they tick nothing, and keeping
135
+ them separate is what makes the refactoring history of an area readable later.
136
+
137
+ ## Step 6 - report and stop
138
+
139
+ The target and what it resolved to, the baseline and the command that produced it, the
140
+ density map, the lens and area chosen and why, what the campaign contains, what was deferred,
141
+ and any published-surface or dependency decision waiting on the user.
142
+
143
+ Then stop. This skill does not build. /implement does.
144
+
145
+ ## Rules
146
+
147
+ - **Behaviour is the invariant.** Every step must leave the target doing exactly what it did.
148
+ - **Never fix a bug in a refactor step.** A refactor that uncovers a genuine defect stops and
149
+ points at /fix. Discovering that four copies of a function behave differently means
150
+ choosing one is a behaviour change, not a merge, and the reviewer cannot see it inside a
151
+ diff that also moves code.
152
+ - **Never delete a comment that carries a why.** The bloat lens removes comments restating
153
+ the code. A comment recording a decision, a gotcha, a workaround, or a link to a spec is
154
+ the opposite of bloat, and it is unrecoverable once gone.
155
+ - **Never reformat alongside a change.** Whitespace, import order and style churn never share
156
+ a step with a structural edit. A diff where fifteen real lines hide among three hundred
157
+ cosmetic ones gets rubber-stamped, which costs more than the formatting saved.
158
+ - One lens, one area, one campaign.
159
+ - A target is always named. Never scan the project hoping to find something worth doing.
160
+ - Read the findings ledger; never write it.
161
+
162
+ ## Formatting
163
+
164
+ Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
165
+ markdown, lists for enumerations and tables for matrices rather than dense paragraphs.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rollback
3
3
  summary: plan a guarded reversal of completed work, preserving its history
4
- description: "Plan the safe reversal of a completed item using its archive and the commits it recorded when it landed. Verifies the recorded commits still resolve and are ancestors of HEAD, reviews later commits for work that depends on them, then writes a Type: Rollback spec to religion/context/current-work.md and stops before any code changes. The reversal applies only the product diff in reverse, never a whole-commit revert, so the archive and plan bookkeeping that landed in the same commits survive. Use when the user runs /rollback, asks to remove or undo completed work, or wants the project returned to its behavior before an item without erasing the record that it existed."
4
+ description: "Plan the safe reversal of a completed item using its archive and the commits it recorded when it landed. Verifies the recorded commits still resolve and are ancestors of HEAD, reviews later commits for work that depends on them, then writes a Type: Rollback spec to religion/context/current-work.md and stops before any code changes. The reversal applies only the product diff in reverse, never a whole-commit revert, so the archive and plan bookkeeping that landed in the same commits survive. Given `--steps N` instead, backs out the last N steps of the item in progress: stashes anything uncommitted first, reverts what those steps changed, and unticks them, after showing what it will do and being told yes. Use when the user runs /rollback, asks to remove or undo completed work, wants the project returned to its behavior before an item without erasing the record that it existed, or asks to back out or undo the last step or two of work still in progress."
5
5
  ---
6
6
 
7
7
  # rollback - plan a guarded reversal
@@ -17,6 +17,35 @@ record that the work ever existed, and would fight with whatever the plan says n
17
17
 
18
18
  This skill plans. It writes a spec and stops. No product file changes here.
19
19
 
20
+ **Except in one mode.** `/rollback --steps N` backs out the last N steps of the item currently
21
+ in progress, and does it rather than speccing it. The two jobs share a verb and nothing else:
22
+ reversing completed work is large, has consequences for anything built on top, and earns a
23
+ reviewed spec. Backing out two steps you just wrote is small, local, and speccing it would
24
+ mean writing into the very file whose steps are being undone.
25
+
26
+ ## Backing out steps in progress
27
+
28
+ Only for `--steps N`. For a completed item, skip to Step 1.
29
+
30
+ 1. **Read the active spec.** Take the last N ticked steps. If fewer than N are ticked, say so
31
+ and take what there is. If none are, there is nothing to undo and this stops.
32
+ 2. **Make it recoverable before making it gone.** Stash anything uncommitted with a named
33
+ entry, whatever `git.checkpoints` says, and keep the name. Undoing work git cannot recover
34
+ is a deletion, and the stash is what turns it back into a mistake that costs one command.
35
+ 3. **Show what will happen**, then ask once: the steps by number and title, the files that
36
+ change, and whether they came from commits or the working tree. Wait for a yes. This is
37
+ the only approval, and it does not extend to anything else.
38
+ 4. **Reverse it.** Where the steps are commits, revert their product diff. Where they are
39
+ uncommitted, restore the files to their state before those steps. Never rewrite pushed
40
+ history, and never reach past the current work item.
41
+ 5. **Untick the steps** in the active spec, so the next /implement resumes at the first
42
+ of them rather than believing they are done.
43
+ 6. **Report** what was reversed, what was left alone, and the exact command that recovers the
44
+ stash. Say the stash name; a recovery path nobody can find is not one.
45
+
46
+ The spec, the archive and the build plan are untouched: the item is still in progress, and
47
+ nothing about it has been completed or recorded.
48
+
20
49
  ## Step 1 - identify the target
21
50
 
22
51
  Take a build-plan number or name. Match it to a **checked** item and its archive under
@@ -102,6 +131,11 @@ work needs its own plan.
102
131
 
103
132
  ## Rules
104
133
 
134
+ - `--steps` acts; everything else plans. Never blur the two.
135
+ - `--steps` never touches the build plan, an archive, or a completed item.
136
+ - Stash before reverting, every time, even when the steps are committed. The cost is one
137
+ stash entry and the alternative is an unrecoverable mistake.
138
+
105
139
  - The archive is never deleted or rewritten. Completion adds a rollback record beside it.
106
140
  - Reverse only the recorded product diff. Never a whole-commit revert.
107
141
  - The build-plan item is unticked and annotated, and keeps its number.
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: spike
3
+ summary: answer one feasibility question with throwaway code, then delete it
4
+ description: "Answer a single question about whether an approach will work, by building the smallest throwaway thing that settles it inside a stated time budget, then deleting the code and recording the answer under religion/history/spikes/. Nothing it writes ever ships. Use when the user runs /spike, asks whether something is possible or feasible, wants to know which of two approaches to take, says to try something and see, or is about to spec work that rests on an assumption nobody has tested. Not for a failure that already exists, which is /debug, and not for how something should look, which is /prototype."
5
+ allowed-tools: Read, Grep, Glob, Bash, Write, Edit, WebFetch
6
+ ---
7
+
8
+ # spike - find out, then throw it away
9
+
10
+ A spec written against an untested assumption is expensive twice: once when it is written and
11
+ reviewed, and again when implementation discovers the approach does not work and the whole
12
+ thing is revised. A spike moves that discovery in front of the spec, where it costs a
13
+ morning instead of a work item.
14
+
15
+ The code is not the output. The answer is.
16
+
17
+ ## Where it sits
18
+
19
+ a question the plans do not answer
20
+ |
21
+ [spike] -> answer recorded, code deleted
22
+ |
23
+ /feature or /fix, now speccing something known to work
24
+
25
+ ## Input
26
+
27
+ One question, and ideally a budget:
28
+
29
+ /spike "can we stream these updates over the platform's own APIs, or is a worker needed"
30
+ /spike "is the vendor SDK usable from an edge runtime" --budget 1h
31
+
32
+ With no question, ask for one. A spike without a question is just unplanned work.
33
+
34
+ **One question per spike.** Two questions is two spikes, because the answer to the first
35
+ usually changes whether the second is worth asking.
36
+
37
+ ## Step 1 - state the question and the budget
38
+
39
+ Write both down before touching anything: the question in a form that has a yes, a no, or a
40
+ named alternative as its answer, and what a good enough answer looks like. A question that
41
+ cannot be answered wrongly is not a question.
42
+
43
+ The budget defaults to something small. Say it out loud, and say what happens when it runs
44
+ out, which is that the answer becomes "not settled in the time given" and that is a real
45
+ result rather than a failure.
46
+
47
+ ## Step 2 - build the smallest thing that settles it
48
+
49
+ Write the least code that produces evidence. It may be ugly, it may be hardcoded, it may
50
+ have no error handling and no tests, because none of it is going to exist tomorrow.
51
+
52
+ Keep it out of the way of real code: a scratch directory, a single file, a branch you will
53
+ not merge. Never build the spike inside the shape the real work will take, because that is
54
+ how a spike quietly becomes the implementation.
55
+
56
+ Do not install anything the project has not agreed to. A spike that needs a new dependency to
57
+ answer its question has found part of its answer.
58
+
59
+ ## Step 3 - answer, with evidence
60
+
61
+ State the answer, the evidence that decided it, and what you did not test. Evidence is a
62
+ command and its output, a request and its response, a measurement. "It seemed to work" is not
63
+ an answer.
64
+
65
+ Then say what this means for the work that prompted it: which approach the spec should take,
66
+ and what is now known to be off the table.
67
+
68
+ ## Step 4 - delete the code, keep the answer
69
+
70
+ Delete what you built. This is the step that makes a spike a spike, and the one most often
71
+ skipped, because working code is hard to throw away. Keeping it means an unreviewed, untested
72
+ sketch becomes load-bearing later, which is worse than having no answer at all.
73
+
74
+ Record the result under `religion/history/spikes/`, named for the question: what was asked,
75
+ what the answer was, the evidence, the budget it took, and what is still unknown. That file
76
+ is what stops the same question being asked again in six months.
77
+
78
+ Deleting files is a first-tier action, so ask before removing anything that is not clearly
79
+ the throwaway you just made.
80
+
81
+ ## Rules
82
+
83
+ - One question, one spike, one answer.
84
+ - The code never ships. If it turns out to be worth keeping, that is a spec, not a spike.
85
+ - A budget that runs out produces "not settled", which is reported, not hidden.
86
+ - Never spike something the plans already answer.
87
+ - Never write to the findings ledger. A spike answers a question; it does not review code.
88
+
89
+ ## Formatting
90
+
91
+ Match the conventions in `religion/context/ai-interaction.md`: concise, scannable markdown,
92
+ lists for enumerations and tables for matrices rather than dense paragraphs.
@@ -2,6 +2,7 @@
2
2
  name: status
3
3
  summary: say where the work stands and what to do next
4
4
  description: "Report where the project stands: build-plan progress, the active spec and which of its steps are done, open findings, git state, and the one action that makes sense next. Uses the religion command-line tool when it is installed, since the parsing is deterministic, and reads the state files directly when it is not. Read-only. Use when the user runs /status, asks where things stand, what is next, what is in progress, or is picking work back up after a break or a cleared context."
5
+ allowed-tools: Read, Grep, Glob, Bash
5
6
  ---
6
7
 
7
8
  # status - where things stand
@@ -2,6 +2,7 @@
2
2
  name: try
3
3
  summary: write the human walkthrough for reviewing the work yourself
4
4
  description: "Generate the manual walkthrough for the current or most recently completed work: what to start, where to go, what to click or run, what to expect, and what would count as wrong. Read-only, and written for a person rather than an agent. /complete emits one for every completed item automatically, so this is for asking again later or for work still in progress. Use when the user runs /try, asks how to see or test a change themselves, asks where to click, or wants a manual review path."
5
+ allowed-tools: Read, Grep, Glob, Bash
5
6
  ---
6
7
 
7
8
  # try - the human review path
@@ -21,10 +21,12 @@ is done here, and they outrank anything you infer from the code alone.
21
21
  - `religion/config.json` - deterministic workflow settings
22
22
  - `religion/context/project-overview.md` - the project's source of truth
23
23
  - `religion/context/coding-standards.md` - conventions to follow
24
+ - `religion/context/untrusted-input.md` - what to do with text the project did not write
24
25
  - `religion/context/ai-interaction.md` - how to work with the user on this project
25
26
  - `religion/context/current-work.md` - the one feature, fix, or rollback in progress
26
27
  - `religion/context/handoff.md` - where the work sits and what to read first
27
28
  - `religion/context/findings.md` - the findings ledger, when it holds anything
29
+ - `religion/context/inbox.md` - notes taken mid-build, waiting to be specced or dropped
28
30
  - `religion/learning/lessons.md` - what previous runs learned about this project
29
31
 
30
32
  ## Workflow
@@ -53,6 +55,7 @@ and follow directly.
53
55
  - `audit` - review the code itself across four lenses, recording findings in the ledger
54
56
  - `auto` - run the loop unattended, within explicit bounds
55
57
  - `browser-tests` - set up a repeatable browser test harness and record its command
58
+ - `capture` - note something for later without breaking the one thing in progress
56
59
  - `check` - prove the current work does what its spec says, against the running project
57
60
  - `ci` - define one Verify command and the GitHub workflow that runs it
58
61
  - `complete` - run the final gate, archive the work, commit it, and close it out
@@ -66,9 +69,11 @@ and follow directly.
66
69
  - `implement` - build the current spec one reviewed step at a time
67
70
  - `overview` - distill the two planning documents into the project's source of truth
68
71
  - `prototype` - explore the look before building, as throwaway mockups or real components
72
+ - `refactor` - simplify existing code in one behaviour-preserving campaign at a time
69
73
  - `release` - prepare deployment readiness for Railway, Render, or Vercel
70
74
  - `rollback` - plan a guarded reversal of completed work, preserving its history
71
75
  - `setup` - tune the installation to this project, greenfield or existing
76
+ - `spike` - answer one feasibility question with throwaway code, then delete it
72
77
  - `status` - say where the work stands and what to do next
73
78
  - `tests` - set up unit testing, or backfill coverage for logic that already exists
74
79
  - `try` - write the human walkthrough for reviewing the work yourself
@@ -93,11 +98,14 @@ one is never approval for another, and an approval given earlier in a session do
93
98
  carry to a later instance.
94
99
 
95
100
  - merging into the default branch
96
- - pushing to any remote
101
+ - pushing to the default branch, and force-pushing anything anywhere
97
102
  - deploying, publishing, or sending anything outward
98
103
  - deleting files or data, and any rewrite of existing history
99
104
  - changing a remote service, its configuration, or its secrets
100
105
 
106
+ Pushing a branch that a run created itself is the single action that may be granted ahead
107
+ of time, and only in the narrow way set out below. Every other push is first tier.
108
+
101
109
  **Ask unless an automated run is underway.** In normal work these need an explicit yes at
102
110
  the time. Invoking an automated mode grants them for that run only, because that
103
111
  invocation is the approval:
@@ -106,6 +114,12 @@ invocation is the approval:
106
114
  - installing or upgrading dependencies
107
115
  - network calls that reach a remote service
108
116
 
117
+ Under `git.mode: pull-request` an automated run may also push the branches it created and
118
+ open pull requests into a branch it created, but only when its invocation stated exactly
119
+ that, in full, and the user agreed at that moment. A general yes to running is not that
120
+ agreement, and the enumeration is not boilerplate to skip. The run still never writes to
121
+ the default branch, and never merges the pull request it exists to produce.
122
+
109
123
  An automated run's grant never reaches the first tier. It commits freely and still stops
110
124
  to ask before it merges.
111
125
 
@@ -135,7 +149,18 @@ that belongs to you, not to a workflow.
135
149
  squash-merges it once the work is done and you have said yes. The merge and any push are
136
150
  asked for separately: agreeing to a merge is never agreement to push.
137
151
 
138
- `git.checkpoints` decides what happens to intermediate work, in either mode:
152
+ **`pull-request`** branches exactly as `branch-per-item` does, then pushes the branch and
153
+ opens a pull request into the default branch instead of merging anything locally. Nothing
154
+ merges that pull request and nothing writes to the default branch: the merge is yours, on
155
+ the host. How the work lands there, squash or merge commit or rebase, is the pull request's
156
+ setting rather than this workflow's business.
157
+
158
+ A repository that cannot host a pull request, having no remote or no usable host command,
159
+ is a stop rather than a reason to fall back to a local merge. Falling back would swap one
160
+ history model for another without saying so, and skip the review gate the mode exists to
161
+ create.
162
+
163
+ `git.checkpoints` decides what happens to intermediate work, in any mode:
139
164
 
140
165
  | Value | Behavior |
141
166
  | --- | --- |
@@ -157,6 +182,9 @@ Either way, implementation stops early and asks whenever a check fails, a decisi
157
182
  needed, a conflict appears, the work drifts outside its spec, or something in the first
158
183
  tier of the authority rules comes up.
159
184
 
185
+ `workflow.parallelSteps` ships `false`. Turned on, steps a spec marks as independent are
186
+ built together in one wave and reviewed as one packet, so nothing lands unreviewed either
187
+ way. While it is off, those markers are ignored and every spec builds in order.
160
188
  ## Activity
161
189
 
162
190
  Any skill that changes something writes an activity record to