create-religion 0.1.1 → 0.2.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/package.json +1 -1
- package/template/.agents/skills/complete/SKILL.md +4 -1
- package/template/.agents/skills/refactor/SKILL.md +159 -0
- package/template/.claude/skills/complete/SKILL.md +4 -1
- package/template/.claude/skills/refactor/SKILL.md +159 -0
- package/template/AGENTS.md +1 -0
- package/template/religion/config.json +4 -0
- package/template/religion/context/ai-interaction.md +2 -1
- package/template/religion/context/current-work.md +7 -5
- package/template/religion/history/refactors/README.md +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-religion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A file-backed, spec-driven AI development workflow. Spec before code, small reviewed diffs, and project state in markdown so a cleared context costs nothing.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nate",
|
|
@@ -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
|
|
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. 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
|
|
|
@@ -0,0 +1,159 @@
|
|
|
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
|
+
Read the target across the selected lenses, or all five when none was named. Read
|
|
79
|
+
`religion/context/findings.md` as well: quality findings recorded by $audit against
|
|
80
|
+
this area are candidates already identified, and folding them in avoids rediscovering them
|
|
81
|
+
under a second name. **Never write to the ledger.** $audit owns that file, and a
|
|
82
|
+
finding's status stays its to change.
|
|
83
|
+
|
|
84
|
+
Report what was found as counts per area and per lens, densest first:
|
|
85
|
+
|
|
86
|
+
packages/api bloat 41 structure 7 duplication 12
|
|
87
|
+
packages/shared bloat 6 structure 2 duplication 21
|
|
88
|
+
packages/cli bloat 3 structure 0 duplication 1
|
|
89
|
+
|
|
90
|
+
For a single file the map is one row, which is fine. The point is that the size of the job
|
|
91
|
+
is visible before anyone commits to it.
|
|
92
|
+
|
|
93
|
+
## Step 4 - choose one lens, in one area
|
|
94
|
+
|
|
95
|
+
**A campaign is one lens in one area.** Not five lenses, not the whole monorepo. A spec
|
|
96
|
+
mixing safe deletions with semantic replacements cannot be reviewed as one thing, because
|
|
97
|
+
the reviewer's attention is spent on the easy half.
|
|
98
|
+
|
|
99
|
+
Propose the widest win, say why, and let the user choose. Everything else stays in the
|
|
100
|
+
report, unspecced, waiting for the next run after this campaign completes.
|
|
101
|
+
|
|
102
|
+
Two boundaries constrain what may enter the campaign:
|
|
103
|
+
|
|
104
|
+
- **The published surface stops and asks.** Anything reachable only from inside the project
|
|
105
|
+
can be merged, renamed or reshaped freely, which is what makes the duplication lens work
|
|
106
|
+
at all. Anything a consumer can import, taken from the manifest's entry points, is a
|
|
107
|
+
breaking change wearing a refactor's clothes. Name it, say what would break, and let the
|
|
108
|
+
user decide whether it belongs in this campaign or in a feature.
|
|
109
|
+
- **A new dependency needs its own yes, and has to earn it.** When the language and the
|
|
110
|
+
installed dependencies genuinely cannot replace hand-rolled code, a new dependency may be
|
|
111
|
+
proposed, never assumed. Propose one only when it would be used in **several places**. A
|
|
112
|
+
dependency that saves fifty lines in a single file is a bad trade: the code leaves and the
|
|
113
|
+
supply chain stays.
|
|
114
|
+
|
|
115
|
+
## Step 5 - write the campaign
|
|
116
|
+
|
|
117
|
+
Write the spec into `religion/context/current-work.md`: the target, the lens, the green
|
|
118
|
+
baseline from Step 2, and the change broken into steps small enough to read as diffs.
|
|
119
|
+
|
|
120
|
+
Order the steps so each one stands alone and can be verified against the baseline. Record
|
|
121
|
+
what would prove the behaviour unchanged, which is the test command from Step 2 for logic,
|
|
122
|
+
and for anything with a visible surface a route to walk and what should appear.
|
|
123
|
+
|
|
124
|
+
Candidates that were found but not specced go in as a short list at the end, so the next run
|
|
125
|
+
has them and nothing is rediscovered from scratch.
|
|
126
|
+
|
|
127
|
+
Completion archives the campaign under `religion/history/refactors/`. Refactor campaigns
|
|
128
|
+
are their own kind of work: they are not build-plan items, they tick nothing, and keeping
|
|
129
|
+
them separate is what makes the refactoring history of an area readable later.
|
|
130
|
+
|
|
131
|
+
## Step 6 - report and stop
|
|
132
|
+
|
|
133
|
+
The target and what it resolved to, the baseline and the command that produced it, the
|
|
134
|
+
density map, the lens and area chosen and why, what the campaign contains, what was deferred,
|
|
135
|
+
and any published-surface or dependency decision waiting on the user.
|
|
136
|
+
|
|
137
|
+
Then stop. This skill does not build. $implement does.
|
|
138
|
+
|
|
139
|
+
## Rules
|
|
140
|
+
|
|
141
|
+
- **Behaviour is the invariant.** Every step must leave the target doing exactly what it did.
|
|
142
|
+
- **Never fix a bug in a refactor step.** A refactor that uncovers a genuine defect stops and
|
|
143
|
+
points at $fix. Discovering that four copies of a function behave differently means
|
|
144
|
+
choosing one is a behaviour change, not a merge, and the reviewer cannot see it inside a
|
|
145
|
+
diff that also moves code.
|
|
146
|
+
- **Never delete a comment that carries a why.** The bloat lens removes comments restating
|
|
147
|
+
the code. A comment recording a decision, a gotcha, a workaround, or a link to a spec is
|
|
148
|
+
the opposite of bloat, and it is unrecoverable once gone.
|
|
149
|
+
- **Never reformat alongside a change.** Whitespace, import order and style churn never share
|
|
150
|
+
a step with a structural edit. A diff where fifteen real lines hide among three hundred
|
|
151
|
+
cosmetic ones gets rubber-stamped, which costs more than the formatting saved.
|
|
152
|
+
- One lens, one area, one campaign.
|
|
153
|
+
- A target is always named. Never scan the project hoping to find something worth doing.
|
|
154
|
+
- Read the findings ledger; never write it.
|
|
155
|
+
|
|
156
|
+
## Formatting
|
|
157
|
+
|
|
158
|
+
Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
|
|
159
|
+
markdown, lists for enumerations and tables for matrices rather than dense paragraphs.
|
|
@@ -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
|
|
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. 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
|
|
|
@@ -0,0 +1,159 @@
|
|
|
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
|
+
Read the target across the selected lenses, or all five when none was named. Read
|
|
79
|
+
`religion/context/findings.md` as well: quality findings recorded by /audit against
|
|
80
|
+
this area are candidates already identified, and folding them in avoids rediscovering them
|
|
81
|
+
under a second name. **Never write to the ledger.** /audit owns that file, and a
|
|
82
|
+
finding's status stays its to change.
|
|
83
|
+
|
|
84
|
+
Report what was found as counts per area and per lens, densest first:
|
|
85
|
+
|
|
86
|
+
packages/api bloat 41 structure 7 duplication 12
|
|
87
|
+
packages/shared bloat 6 structure 2 duplication 21
|
|
88
|
+
packages/cli bloat 3 structure 0 duplication 1
|
|
89
|
+
|
|
90
|
+
For a single file the map is one row, which is fine. The point is that the size of the job
|
|
91
|
+
is visible before anyone commits to it.
|
|
92
|
+
|
|
93
|
+
## Step 4 - choose one lens, in one area
|
|
94
|
+
|
|
95
|
+
**A campaign is one lens in one area.** Not five lenses, not the whole monorepo. A spec
|
|
96
|
+
mixing safe deletions with semantic replacements cannot be reviewed as one thing, because
|
|
97
|
+
the reviewer's attention is spent on the easy half.
|
|
98
|
+
|
|
99
|
+
Propose the widest win, say why, and let the user choose. Everything else stays in the
|
|
100
|
+
report, unspecced, waiting for the next run after this campaign completes.
|
|
101
|
+
|
|
102
|
+
Two boundaries constrain what may enter the campaign:
|
|
103
|
+
|
|
104
|
+
- **The published surface stops and asks.** Anything reachable only from inside the project
|
|
105
|
+
can be merged, renamed or reshaped freely, which is what makes the duplication lens work
|
|
106
|
+
at all. Anything a consumer can import, taken from the manifest's entry points, is a
|
|
107
|
+
breaking change wearing a refactor's clothes. Name it, say what would break, and let the
|
|
108
|
+
user decide whether it belongs in this campaign or in a feature.
|
|
109
|
+
- **A new dependency needs its own yes, and has to earn it.** When the language and the
|
|
110
|
+
installed dependencies genuinely cannot replace hand-rolled code, a new dependency may be
|
|
111
|
+
proposed, never assumed. Propose one only when it would be used in **several places**. A
|
|
112
|
+
dependency that saves fifty lines in a single file is a bad trade: the code leaves and the
|
|
113
|
+
supply chain stays.
|
|
114
|
+
|
|
115
|
+
## Step 5 - write the campaign
|
|
116
|
+
|
|
117
|
+
Write the spec into `religion/context/current-work.md`: the target, the lens, the green
|
|
118
|
+
baseline from Step 2, and the change broken into steps small enough to read as diffs.
|
|
119
|
+
|
|
120
|
+
Order the steps so each one stands alone and can be verified against the baseline. Record
|
|
121
|
+
what would prove the behaviour unchanged, which is the test command from Step 2 for logic,
|
|
122
|
+
and for anything with a visible surface a route to walk and what should appear.
|
|
123
|
+
|
|
124
|
+
Candidates that were found but not specced go in as a short list at the end, so the next run
|
|
125
|
+
has them and nothing is rediscovered from scratch.
|
|
126
|
+
|
|
127
|
+
Completion archives the campaign under `religion/history/refactors/`. Refactor campaigns
|
|
128
|
+
are their own kind of work: they are not build-plan items, they tick nothing, and keeping
|
|
129
|
+
them separate is what makes the refactoring history of an area readable later.
|
|
130
|
+
|
|
131
|
+
## Step 6 - report and stop
|
|
132
|
+
|
|
133
|
+
The target and what it resolved to, the baseline and the command that produced it, the
|
|
134
|
+
density map, the lens and area chosen and why, what the campaign contains, what was deferred,
|
|
135
|
+
and any published-surface or dependency decision waiting on the user.
|
|
136
|
+
|
|
137
|
+
Then stop. This skill does not build. /implement does.
|
|
138
|
+
|
|
139
|
+
## Rules
|
|
140
|
+
|
|
141
|
+
- **Behaviour is the invariant.** Every step must leave the target doing exactly what it did.
|
|
142
|
+
- **Never fix a bug in a refactor step.** A refactor that uncovers a genuine defect stops and
|
|
143
|
+
points at /fix. Discovering that four copies of a function behave differently means
|
|
144
|
+
choosing one is a behaviour change, not a merge, and the reviewer cannot see it inside a
|
|
145
|
+
diff that also moves code.
|
|
146
|
+
- **Never delete a comment that carries a why.** The bloat lens removes comments restating
|
|
147
|
+
the code. A comment recording a decision, a gotcha, a workaround, or a link to a spec is
|
|
148
|
+
the opposite of bloat, and it is unrecoverable once gone.
|
|
149
|
+
- **Never reformat alongside a change.** Whitespace, import order and style churn never share
|
|
150
|
+
a step with a structural edit. A diff where fifteen real lines hide among three hundred
|
|
151
|
+
cosmetic ones gets rubber-stamped, which costs more than the formatting saved.
|
|
152
|
+
- One lens, one area, one campaign.
|
|
153
|
+
- A target is always named. Never scan the project hoping to find something worth doing.
|
|
154
|
+
- Read the findings ledger; never write it.
|
|
155
|
+
|
|
156
|
+
## Formatting
|
|
157
|
+
|
|
158
|
+
Match the conventions in `religion/context/ai-interaction.md`: concise, scannable
|
|
159
|
+
markdown, lists for enumerations and tables for matrices rather than dense paragraphs.
|
package/template/AGENTS.md
CHANGED
|
@@ -66,6 +66,7 @@ and follow directly.
|
|
|
66
66
|
- `implement` - build the current spec one reviewed step at a time
|
|
67
67
|
- `overview` - distill the two planning documents into the project's source of truth
|
|
68
68
|
- `prototype` - explore the look before building, as throwaway mockups or real components
|
|
69
|
+
- `refactor` - simplify existing code in one behaviour-preserving campaign at a time
|
|
69
70
|
- `release` - prepare deployment readiness for Railway, Render, or Vercel
|
|
70
71
|
- `rollback` - plan a guarded reversal of completed work, preserving its history
|
|
71
72
|
- `setup` - tune the installation to this project, greenfield or existing
|
|
@@ -29,7 +29,8 @@ The spec for the work in progress lives in `religion/context/current-work.md`.
|
|
|
29
29
|
|
|
30
30
|
1. **Spec.** Run `feature` with no argument to spec the first unchecked item in the
|
|
31
31
|
build plan, or name one. Add ` preview` to see what it involves without writing
|
|
32
|
-
anything. For a bug or small change that is not in the plan, run `fix`.
|
|
32
|
+
anything. For a bug or small change that is not in the plan, run `fix`. To simplify
|
|
33
|
+
code that already exists without changing what it does, run `refactor`. Review
|
|
33
34
|
the spec before any code exists.
|
|
34
35
|
2. **Implement.** Run `implement`. It builds one step at a time, never the whole
|
|
35
36
|
item at once.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Current Work
|
|
2
2
|
|
|
3
|
-
> **Generated file.** Holds the one feature, fix,
|
|
4
|
-
> `feature` to spec a build-plan item, `fix` for an
|
|
5
|
-
> or `rollback` to plan a safe reversal
|
|
6
|
-
> `complete` archives it under
|
|
3
|
+
> **Generated file.** Holds the one feature, fix, rollback, or refactor campaign being
|
|
4
|
+
> built right now. Run `feature` to spec a build-plan item, `fix` for an
|
|
5
|
+
> unplanned bug or change, `rollback` to plan a safe reversal, or `refactor` to
|
|
6
|
+
> simplify existing code. Build one thing at a time; `complete` archives it under
|
|
7
|
+
> `religion/history/` and resets this file.
|
|
7
8
|
|
|
8
|
-
_Nothing in progress. Run `feature`, `fix`,
|
|
9
|
+
_Nothing in progress. Run `feature`, `fix`, `rollback`, or
|
|
10
|
+
`refactor` to start._
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Completed refactors
|
|
2
|
+
|
|
3
|
+
One file per completed campaign, named for the area and the lens it covered. Written by
|
|
4
|
+
`complete`.
|
|
5
|
+
|
|
6
|
+
A campaign is not a build-plan item, so these carry no number and nothing is ticked when one
|
|
7
|
+
lands. They are kept apart from fixes because they answer a different question: not what went
|
|
8
|
+
wrong here, but what has already been simplified, so a later run does not repeat work or
|
|
9
|
+
undo a decision it cannot see.
|