bearings 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/dist/chunk-VRWQ3OWC.js +654 -0
- package/dist/cli.js +54 -377
- package/dist/update-5F7TZEUH.js +799 -0
- package/package.json +1 -1
- package/templates/AGENTS.md +18 -33
- package/templates/agents/commands/refresh-repo-map.md +161 -0
- package/templates/agents/commands/setup-repo.md +66 -32
- package/templates/agents/skills/commit-convention/SKILL.md +83 -20
- package/templates/agents/skills/defer-work/SKILL.md +2 -2
- package/templates/agents/skills/recording-decisions/SKILL.md +51 -0
- package/templates/agents/skills/resurface-deferred-work/SKILL.md +2 -2
- package/templates/docs/ARCHITECTURE.md +37 -0
- package/templates/docs/CODEBASE_MAP.md +33 -0
- package/templates/docs/DOMAIN.md +33 -0
- package/templates/docs/adr/0000-template.md +12 -0
- package/templates/docs/adr/INDEX.md +6 -0
- package/templates/docs/deferred/INDEX.md +5 -3
- package/templates/agents/commands/current-state.md +0 -163
- package/templates/agents/skills/enforcement-gates/SKILL.md +0 -35
- package/templates/agents/skills/implementing-task/SKILL.md +0 -36
- package/templates/agents/skills/installing-dependencies/SKILL.md +0 -36
- package/templates/agents/skills/repo-navigation/SKILL.md +0 -34
- package/templates/agents/skills/secrets-handling/SKILL.md +0 -36
- package/templates/docs/CURRENT_STATE.md +0 -38
- package/templates/docs/conventions/current-state.md +0 -9
- package/templates/docs/conventions/doc-lifecycle.md +0 -16
package/package.json
CHANGED
package/templates/AGENTS.md
CHANGED
|
@@ -1,43 +1,28 @@
|
|
|
1
1
|
# <agent: project name> - Agent Seed
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Setup Required
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<agent: fill during handoff — Short summary of what this repo is, who uses it, and what it produces.>
|
|
8
|
-
|
|
9
|
-
## Where To Read What
|
|
5
|
+
Until this section is removed, do not inspect, modify, or run anything in this repository except `/setup-repo`. For every other request, respond only: Run `/setup-repo` to finalize bearings, then retry your request.
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|---|---|
|
|
13
|
-
| What exists today and where things live | `docs/CURRENT_STATE.md` |
|
|
14
|
-
| Durable architecture and decisions | `docs/ARCHITECTURE.md`, `docs/adr/` |
|
|
15
|
-
| Deferred work | `docs/deferred/INDEX.md` |
|
|
16
|
-
|
|
17
|
-
## Load On Demand
|
|
18
|
-
|
|
19
|
-
| When you are... | Load skill |
|
|
20
|
-
|---|---|
|
|
21
|
-
| finding where code lives or which docs to read | `repo-navigation` |
|
|
22
|
-
| touching secrets, credentials, keys, tokens, or config containing secrets | `secrets-handling` |
|
|
23
|
-
| implementing a planned task | `implementing-task` |
|
|
24
|
-
| adding dependencies | `installing-dependencies` |
|
|
25
|
-
| fixing failed checks | `enforcement-gates` |
|
|
26
|
-
| about to commit | `commit-convention` |
|
|
27
|
-
| building something listed in deferred work | `resurface-deferred-work` |
|
|
7
|
+
## Project
|
|
28
8
|
|
|
29
|
-
|
|
9
|
+
<agent: fill during handoff — One sentence: problem, primary users, and outcome.>
|
|
30
10
|
|
|
31
|
-
|
|
32
|
-
- <agent: fill during handoff — Invariant 2 with required verification.>
|
|
11
|
+
Primary stack: <agent: fill during handoff — language/runtime/framework/platform>. Details: `docs/ARCHITECTURE.md`.
|
|
33
12
|
|
|
34
|
-
##
|
|
13
|
+
## Knowledge Routing
|
|
35
14
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
15
|
+
| Work | Read | How |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| User behavior, requirements, workflows, terminology, scope, or domain rules | `docs/DOMAIN.md` | Read before behavior or requirements work. |
|
|
18
|
+
| Components, dependency direction, integrations, state ownership, significant dependencies, runtime/build shape, or local setup | `docs/ARCHITECTURE.md` | Read before structural or environment work. |
|
|
19
|
+
| Locating, explaining, changing, or debugging source | `docs/CODEBASE_MAP.md` | Read the entire file before source work, then follow its `path#symbol` anchors. |
|
|
20
|
+
| A consequential domain or technical decision | `docs/adr/INDEX.md` | Read the index first, then only matching ADRs. |
|
|
21
|
+
| Planning a new capability | `docs/deferred/INDEX.md` | Read the index first, then only matching deferred details. |
|
|
40
22
|
|
|
41
|
-
##
|
|
23
|
+
## Response Style
|
|
42
24
|
|
|
43
|
-
|
|
25
|
+
- Lead with the answer; omit preamble and restatement.
|
|
26
|
+
- Use the shortest clear structure: line, bullets, table, tree, or flow.
|
|
27
|
+
- Preserve exact identifiers, paths, commands, errors, and code.
|
|
28
|
+
- Report progress only for discoveries, decisions, or blockers; finish with changes and verification.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Reconcile the domain, architecture, current codebase map, and C4 component source when meaningful repository drift or staleness is detected
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /refresh-repo-map
|
|
6
|
+
|
|
7
|
+
Reconcile the repository's knowledge maps with current evidence. This command is
|
|
8
|
+
the exclusive writer for `docs/DOMAIN.md`, `docs/ARCHITECTURE.md`,
|
|
9
|
+
`docs/CODEBASE_MAP.md`, and `docs/diagrams/c4-component.puml`. No other task may
|
|
10
|
+
edit these four artifacts directly.
|
|
11
|
+
|
|
12
|
+
Run it when committed changes alter business capabilities, workflows,
|
|
13
|
+
terminology, domain rules, stable technical shape, dependencies, integrations,
|
|
14
|
+
environment, capability ownership, module routes, utilities, interfaces,
|
|
15
|
+
state, hazards, verification paths, or C4 component topology — or when an
|
|
16
|
+
agent or developer detects staleness. Do not run it after every code edit
|
|
17
|
+
when the maps remain accurate.
|
|
18
|
+
|
|
19
|
+
## Ownership
|
|
20
|
+
|
|
21
|
+
| Artifact | Owner |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `docs/DOMAIN.md` | this command |
|
|
24
|
+
| `docs/ARCHITECTURE.md` | this command |
|
|
25
|
+
| `docs/CODEBASE_MAP.md` | this command |
|
|
26
|
+
| `docs/diagrams/c4-component.puml` | this command |
|
|
27
|
+
|
|
28
|
+
Always create `docs/diagrams/` and `c4-component.puml` when absent. Maintain
|
|
29
|
+
source-only PlantUML: never render it and never modify another diagram.
|
|
30
|
+
|
|
31
|
+
## Artifact Contracts
|
|
32
|
+
|
|
33
|
+
| Artifact | Authority | Required output |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| `docs/DOMAIN.md` | User-confirmed business intent plus observable shipped behavior | problem and outcomes, actors, use cases, workflows, ubiquitous language, domain rules, boundaries/non-goals |
|
|
36
|
+
| `docs/ARCHITECTURE.md` | Accepted ADRs plus running configuration and code | system boundary, primary stack, significant dependencies, components/dependency direction, integrations/state ownership, runtime/deployment, development environment, architectural constraints |
|
|
37
|
+
| `docs/CODEBASE_MAP.md` | Running code, configuration, and tests | executable entry points, capabilities/concerns by `path#symbol`, critical flows, shared utilities/infrastructure, interfaces/state, change hazards, verification map |
|
|
38
|
+
| `docs/diagrams/c4-component.puml` | Reconciled architecture plus implemented component relationships | source-only PlantUML component topology; never render it |
|
|
39
|
+
|
|
40
|
+
`docs/CODEBASE_MAP.md` has no fixed size cap. Every retained line must route
|
|
41
|
+
source work, establish current behavior needed to select code, prevent an
|
|
42
|
+
unsafe change, or identify verification evidence.
|
|
43
|
+
|
|
44
|
+
Each Markdown artifact ends with this exact marker:
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
<!-- repo-map-synced: <commit-sha> -->
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The PlantUML artifact ends with this exact marker:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
' repo-map-synced: <commit-sha>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Each marker records the pre-command `HEAD` whose relevant evidence was
|
|
57
|
+
reconciled for that specific artifact. It is an incremental search baseline,
|
|
58
|
+
not freshness proof by itself.
|
|
59
|
+
|
|
60
|
+
## Evidence and Conflicts
|
|
61
|
+
|
|
62
|
+
Treat evidence in this order per artifact, using each artifact's own
|
|
63
|
+
authority row above: running code/configuration/tests, then accepted ADRs
|
|
64
|
+
and durable domain rules, then confirmed user/developer intent, then
|
|
65
|
+
existing map wording.
|
|
66
|
+
|
|
67
|
+
- Business intent versus implementation: expose the conflict and ask one
|
|
68
|
+
focused question with a recommended resolution. Never silently redefine
|
|
69
|
+
the domain from code.
|
|
70
|
+
- Implementation versus an accepted ADR or architectural constraint: ask
|
|
71
|
+
whether the implementation should change or the decision should be
|
|
72
|
+
superseded, and recommend a path from the available evidence.
|
|
73
|
+
- An unresolved conflict blocks that artifact's refresh: leave the affected artifact unchanged and report the conflict rather than publishing a falsely coherent map. Unaffected artifacts may still refresh independently.
|
|
74
|
+
|
|
75
|
+
## Baselines and Mode Selection
|
|
76
|
+
|
|
77
|
+
Each artifact records its own reconciliation baseline, so mode selection is
|
|
78
|
+
independent per artifact:
|
|
79
|
+
|
|
80
|
+
- Full reconciliation when the artifact (or the C4 source) is missing, its
|
|
81
|
+
marker is missing, malformed, unavailable locally, or not an ancestor of
|
|
82
|
+
pre-command `HEAD`, the user requests a full refresh, or incremental
|
|
83
|
+
evidence reveals structural drift outside the expected impact closure.
|
|
84
|
+
- Incremental reconciliation when the artifact exists and its marker names
|
|
85
|
+
an available ancestor of pre-command `HEAD`.
|
|
86
|
+
|
|
87
|
+
## Full Reconciliation
|
|
88
|
+
|
|
89
|
+
1. Capture pre-command `HEAD` as the reconciliation baseline.
|
|
90
|
+
2. Read manifests, build configuration, and executable entry points.
|
|
91
|
+
3. Identify module boundaries through exports, imports, registration sites,
|
|
92
|
+
and ownership directories.
|
|
93
|
+
4. Trace public interfaces, external integrations, state stores, and
|
|
94
|
+
schemas when present.
|
|
95
|
+
5. Trace implementations and tests for critical flows and hazards.
|
|
96
|
+
6. Read accepted ADRs and confirmed domain/business intent that constrain
|
|
97
|
+
current code.
|
|
98
|
+
7. Reconcile the artifact's complete required output and the C4 component
|
|
99
|
+
model when its topology is in scope.
|
|
100
|
+
8. Set that artifact's sync marker to the captured pre-command `HEAD` only
|
|
101
|
+
after its reconciliation succeeds.
|
|
102
|
+
|
|
103
|
+
File size is not an architecture signal. Never select a module by choosing
|
|
104
|
+
its largest file.
|
|
105
|
+
|
|
106
|
+
## Incremental Reconciliation
|
|
107
|
+
|
|
108
|
+
1. Capture pre-command `HEAD`; parse the artifact's own marker and verify
|
|
109
|
+
its commit exists locally.
|
|
110
|
+
2. Verify the marker is an ancestor of pre-command `HEAD`; otherwise switch
|
|
111
|
+
that artifact to full reconciliation.
|
|
112
|
+
3. Inspect every changed source, config, test, and durable-doc path from
|
|
113
|
+
the marker's commit through pre-command `HEAD` that is relevant to that
|
|
114
|
+
artifact's authority.
|
|
115
|
+
4. Expand each changed path to its direct callers/callees and co-change
|
|
116
|
+
relationships to establish impact closure.
|
|
117
|
+
5. Edit only the affected sections of that artifact and preserve unrelated
|
|
118
|
+
verified content.
|
|
119
|
+
6. Update the C4 model only when component boundaries or relationships
|
|
120
|
+
changed.
|
|
121
|
+
7. Set that artifact's sync marker to the captured pre-command `HEAD` only
|
|
122
|
+
after its reconciliation succeeds.
|
|
123
|
+
8. Escalate that artifact to full reconciliation when impact closure cannot
|
|
124
|
+
be established with confidence.
|
|
125
|
+
|
|
126
|
+
## Validation and Routing Probes
|
|
127
|
+
|
|
128
|
+
Before reporting completion:
|
|
129
|
+
|
|
130
|
+
1. Validate every retained path, symbol, command, and relationship against
|
|
131
|
+
the repository.
|
|
132
|
+
2. Run these probes in fresh context that receives only the draft
|
|
133
|
+
artifacts and the scenario, never the source-reading context:
|
|
134
|
+
- Explain: select a critical behavior; identify entry point, flow,
|
|
135
|
+
state/side effects, failure semantics, and targeted source.
|
|
136
|
+
- Feature: select a plausible extension; identify owner, extension seam,
|
|
137
|
+
affected contracts/state, co-change edges, and tests.
|
|
138
|
+
- Bug: select a plausible public symptom; narrow diagnosis to an owning
|
|
139
|
+
flow, likely files, and regression-test location.
|
|
140
|
+
3. Rerun any failed probe after adding the missing knowledge. A failed
|
|
141
|
+
probe blocks completion for the affected artifact.
|
|
142
|
+
|
|
143
|
+
## Completion
|
|
144
|
+
|
|
145
|
+
1. Show the diff for every changed owned artifact.
|
|
146
|
+
2. Show the evidence used per changed artifact and any unresolved
|
|
147
|
+
conflicts, naming the artifact each conflict blocked.
|
|
148
|
+
3. Update only the sync marker of each artifact whose reconciliation
|
|
149
|
+
succeeded; leave unresolved artifacts and their markers unchanged.
|
|
150
|
+
4. Leave all changes uncommitted for the normal review and commit workflow.
|
|
151
|
+
|
|
152
|
+
## Boundaries
|
|
153
|
+
|
|
154
|
+
- Keep this command generic: no project-specific scanning heuristics or
|
|
155
|
+
named project files beyond the four owned artifact paths.
|
|
156
|
+
- Do not create or register skills, render the PlantUML diagram, add a
|
|
157
|
+
fixed map size cap, or modify unrelated documentation.
|
|
158
|
+
- Do not create commits; leave staging and commit decisions to the
|
|
159
|
+
developer.
|
|
160
|
+
- Do not treat a marker, task intent, or existing wording as stronger
|
|
161
|
+
evidence than running code, configuration, and tests.
|
|
@@ -10,40 +10,74 @@ the developer relentlessly — one question at a time, with a recommended
|
|
|
10
10
|
answer per question — and explore the code before asking anything the code
|
|
11
11
|
can answer.
|
|
12
12
|
|
|
13
|
+
This is the only operation the temporary `## Setup Required` gate in
|
|
14
|
+
`AGENTS.md` permits. Do not remove the gate until step 10 below.
|
|
15
|
+
|
|
16
|
+
## Post-update reconciliation
|
|
17
|
+
|
|
18
|
+
When `.agents/bearings.json` is manifest v2 and has `setupPending`:
|
|
19
|
+
|
|
20
|
+
1. Read every file record's ordered `reconciliations`.
|
|
21
|
+
2. For each reconciliation, read its Backup File and current target, summarize
|
|
22
|
+
the differences, and ask which backed-up changes to apply to the target.
|
|
23
|
+
3. Apply the developer's choice directly to the target regardless of owner,
|
|
24
|
+
delete the resolved Backup File, and remove its reconciliation record.
|
|
25
|
+
4. A `skippedTemplate` records a declined template revision.
|
|
26
|
+
Do not apply the declined template — normal project maintenance may
|
|
27
|
+
still update that file.
|
|
28
|
+
5. Run only setup steps supported by current drift; do not reset completed
|
|
29
|
+
project tailoring.
|
|
30
|
+
6. Run `bearings verify`. Resolve every failure and warning except the
|
|
31
|
+
expected `setup-pending` warning, then remove `setupPending` from the
|
|
32
|
+
manifest.
|
|
33
|
+
7. Run `bearings verify` again and finish only at zero failures and warnings.
|
|
34
|
+
|
|
13
35
|
## Required workflow
|
|
14
36
|
|
|
15
|
-
1. Read `AGENTS.md
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
6.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
7.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
9.
|
|
38
|
-
|
|
39
|
-
10. Remove the `## Setup
|
|
37
|
+
1. Read `AGENTS.md` and `.agents/bearings.json`.
|
|
38
|
+
2. Review every recorded Backup File with the developer: read the backup,
|
|
39
|
+
summarise what it contained, and ask per file whether to merge into the
|
|
40
|
+
new scaffold, keep parts, or discard. Apply their choice, then remove
|
|
41
|
+
the resolved backup.
|
|
42
|
+
3. Explore the repo: stack, package manager, canonical install/run/build/
|
|
43
|
+
test/lint commands, CI, generated paths, secret/config paths, deployment
|
|
44
|
+
surfaces, project purpose, users/operators, and hard domain/technical
|
|
45
|
+
constraints. Interview the developer one question at a time for anything
|
|
46
|
+
the code cannot answer.
|
|
47
|
+
4. Fill only the `AGENTS.md` project-purpose and primary-stack placeholders.
|
|
48
|
+
Keep `AGENTS.md` a thin router — do not add a skill table, invariants
|
|
49
|
+
section, or always-on rules block.
|
|
50
|
+
5. Create a project-specific skill only when native skill discovery has no
|
|
51
|
+
adequate existing match. Every starter skill is bearings-owned — leave
|
|
52
|
+
them untouched.
|
|
53
|
+
6. Run the `/refresh-repo-map` workflow to initialize `docs/DOMAIN.md`,
|
|
54
|
+
`docs/ARCHITECTURE.md`, `docs/CODEBASE_MAP.md`, and
|
|
55
|
+
`docs/diagrams/c4-component.puml`.
|
|
56
|
+
7. Expose any newly created skills into each configured harness using the
|
|
57
|
+
manifest's existing symlink/copy mode.
|
|
58
|
+
8. Run `bearings verify`. Fix every failure and every warning.
|
|
59
|
+
9. Confirm the run reports zero failures and zero warnings before
|
|
60
|
+
proceeding.
|
|
61
|
+
10. Remove the `## Setup Required` section from `AGENTS.md` — only after
|
|
62
|
+
step 9 confirms zero failures and zero warnings.
|
|
63
|
+
11. Run `bearings verify` again and report the completed setup to the
|
|
64
|
+
developer.
|
|
40
65
|
|
|
41
66
|
## Rules
|
|
42
67
|
|
|
43
|
-
- Do not overwrite developer decisions silently — every merge/discard
|
|
44
|
-
|
|
45
|
-
- Do not edit `.agents/bearings.json` except where this
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
68
|
+
- Do not overwrite developer decisions silently — every merge/keep/discard
|
|
69
|
+
of a Backup File is the developer's call.
|
|
70
|
+
- Do not edit `.agents/bearings.json` except where this workflow requires
|
|
71
|
+
it.
|
|
72
|
+
- Do not change bearings-owned starter commands or skills. The one exception:
|
|
73
|
+
a reconciliation that records an explicit Merge decision permits applying
|
|
74
|
+
that Backup File's changes directly to its bearings-owned target.
|
|
75
|
+
- Do not add a skill registry row to `AGENTS.md` — native skill discovery
|
|
76
|
+
replaces it.
|
|
77
|
+
- Do not invent domain or technical constraints — every stated constraint
|
|
78
|
+
must come from the developer or from clear evidence in the code (cite
|
|
79
|
+
the path).
|
|
80
|
+
- Do not remove the `## Setup Required` section before `bearings verify`
|
|
81
|
+
reports zero failures and zero warnings.
|
|
82
|
+
- Re-running this command later is allowed: skip completed steps and focus
|
|
83
|
+
on drift between the maps and reality.
|
|
@@ -1,35 +1,98 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
name: commit-convention
|
|
3
|
+
description: Commit changes through a deterministic commit gate. Use when an agent is about to create a git commit.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
# Commit
|
|
6
|
+
# Commit Gate
|
|
6
7
|
|
|
7
|
-
##
|
|
8
|
+
## Project Commands
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
- Format intended files: `<agent: fill during handoff — formatter command accepting explicit file paths>`
|
|
11
|
+
- Fix lint errors in intended files: `<agent: fill during handoff — lint-fix command accepting explicit file paths>`
|
|
12
|
+
- Check lint: `<agent: fill during handoff — complete lint command>`
|
|
13
|
+
- Typecheck: `<agent: fill during handoff — typecheck command or "not configured">`
|
|
14
|
+
- Test suite: `<agent: fill during handoff — complete test-suite command>`
|
|
15
|
+
- Build: `<agent: fill during handoff — build command or "not configured">`
|
|
10
16
|
|
|
11
|
-
##
|
|
17
|
+
## Required Workflow
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
-
|
|
19
|
+
1. Establish the intended change set.
|
|
20
|
+
- Inspect `git status`, `git diff`, and `git diff --cached`.
|
|
21
|
+
- The current task defines the commit allowlist; repository dirtiness does not expand it.
|
|
22
|
+
- Classify every changed hunk as intended or unrelated.
|
|
23
|
+
- Preserve unrelated staged and unstaged changes exactly.
|
|
24
|
+
- For a mixed file, proceed only when tools and hunk staging can leave unrelated changes untouched.
|
|
25
|
+
- Completion: every hunk is classified and the intended changes can be isolated safely.
|
|
15
26
|
|
|
16
|
-
|
|
27
|
+
2. Format and lint-fix the intended files.
|
|
28
|
+
- Pass explicit intended file paths to each configured tool.
|
|
29
|
+
- Repository-wide auto-fixes are prohibited.
|
|
30
|
+
- Reinspect the diff after each command and require unrelated hunks to remain unchanged.
|
|
31
|
+
- Completion: every intended file is formatted and has no lint errors.
|
|
32
|
+
|
|
33
|
+
3. Run the quality gates.
|
|
34
|
+
- Run the complete lint check.
|
|
35
|
+
- Run typecheck when configured.
|
|
36
|
+
- Run the complete test suite.
|
|
37
|
+
- Run the build when configured.
|
|
38
|
+
- Completion: every configured gate must exit successfully.
|
|
39
|
+
|
|
40
|
+
4. Review and stage the intended changes.
|
|
41
|
+
- Reject secrets, debug code, generated noise, and unrelated changes.
|
|
42
|
+
- Stage explicit intended paths or hunks; `git add .` and `git add -A` are prohibited.
|
|
43
|
+
- Review `git diff --cached`.
|
|
44
|
+
- Completion: every staged hunk belongs to the current task.
|
|
45
|
+
|
|
46
|
+
5. Write the commit message.
|
|
47
|
+
- Follow the Conventional Commits policy below.
|
|
48
|
+
- Describe the staged change rather than the broader task or conversation.
|
|
49
|
+
- Completion: the message satisfies the documented grammar and rules.
|
|
50
|
+
|
|
51
|
+
6. Create and verify the commit.
|
|
52
|
+
- Commit without bypassing hooks.
|
|
53
|
+
- Amend only when the developer explicitly requests it.
|
|
54
|
+
- Verify the resulting commit hash and message.
|
|
55
|
+
- Report the commit and any unrelated changes left untouched.
|
|
56
|
+
- Completion: the commit exists with the intended tree and message.
|
|
57
|
+
|
|
58
|
+
## Conventional Commits
|
|
59
|
+
|
|
60
|
+
Use `<type>[optional scope][!]: <imperative summary>`.
|
|
17
61
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
62
|
+
| Type | Use |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `feat` | New user-visible behavior |
|
|
65
|
+
| `fix` | Defect correction |
|
|
66
|
+
| `docs` | Documentation only |
|
|
67
|
+
| `style` | Formatting with no behavior change |
|
|
68
|
+
| `refactor` | Internal change with no feature or fix |
|
|
69
|
+
| `perf` | Performance improvement |
|
|
70
|
+
| `test` | Tests only |
|
|
71
|
+
| `build` | Build system or dependency changes |
|
|
72
|
+
| `ci` | CI configuration |
|
|
73
|
+
| `chore` | Maintenance not covered above |
|
|
74
|
+
| `revert` | Revert a previous commit |
|
|
22
75
|
|
|
23
|
-
|
|
76
|
+
Message rules:
|
|
24
77
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
78
|
+
- Use a short, imperative summary beginning with lowercase text.
|
|
79
|
+
- Keep the complete subject line at or below 72 characters and omit a trailing period.
|
|
80
|
+
- Use a stable package or subsystem name as the optional scope.
|
|
81
|
+
- Mark breaking changes with `!` and add a `BREAKING CHANGE:` footer.
|
|
82
|
+
- Add a body only when the reason or migration impact is not clear from the subject.
|
|
83
|
+
- Add issue references as footers when applicable.
|
|
84
|
+
- Add co-author or agent attribution only when explicitly requested.
|
|
27
85
|
|
|
28
|
-
|
|
86
|
+
Examples:
|
|
29
87
|
|
|
30
|
-
-
|
|
88
|
+
- `feat(cli): add copy-mode verification`
|
|
89
|
+
- `fix(adapter): preserve unrelated staged changes`
|
|
90
|
+
- `docs: clarify setup workflow`
|
|
91
|
+
- `refactor(generator)!: replace manifest ownership model`
|
|
31
92
|
|
|
32
|
-
##
|
|
93
|
+
## Stop Conditions
|
|
33
94
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
95
|
+
- Unsafe change isolation -> report the overlap and create no commit.
|
|
96
|
+
- A required gate fails because of intended changes -> fix it and rerun that gate.
|
|
97
|
+
- A required gate fails for an unrelated or pre-existing reason -> report it and create no commit.
|
|
98
|
+
- A commit hook fails -> treat it as a required gate; keep the hook enabled.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
name: defer-work
|
|
2
3
|
description: Use when the developer explicitly parks, defers, postpones, skips-for-now, or chooses an interim solution instead of a fuller plan.
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -18,7 +19,7 @@ Record intentional "yes, later" work so future agents do not silently build or f
|
|
|
18
19
|
1. Confirm the deferred item -> get explicit developer approval to record it.
|
|
19
20
|
2. Capture business need, parked approach, reason, and revisit trigger -> make the future decision self-contained.
|
|
20
21
|
3. Create `docs/deferred/DEF-NNN-topic.md` -> assign the next available ID.
|
|
21
|
-
4. Add a row to `docs/deferred/INDEX.md` -> include ID,
|
|
22
|
+
4. Add a row to `docs/deferred/INDEX.md` -> include ID, postponed item, reason, revisit trigger, and detail path.
|
|
22
23
|
|
|
23
24
|
## Rules
|
|
24
25
|
|
|
@@ -32,4 +33,3 @@ Record intentional "yes, later" work so future agents do not silently build or f
|
|
|
32
33
|
## References
|
|
33
34
|
|
|
34
35
|
- `docs/deferred/INDEX.md` - registry of parked work.
|
|
35
|
-
- `docs/conventions/doc-lifecycle.md` - deferred-work lifecycle.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: recording-decisions
|
|
3
|
+
description: Use when the developer approves a consequential domain or technical decision that needs an ADR.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Recording Decisions
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Turn an approved consequential decision into a durable, discoverable ADR
|
|
11
|
+
without inventing approval or leaving the detail and index out of sync.
|
|
12
|
+
|
|
13
|
+
## Triggers
|
|
14
|
+
|
|
15
|
+
- The developer approves a consequential domain or technical decision.
|
|
16
|
+
- An accepted decision must supersede an existing ADR.
|
|
17
|
+
|
|
18
|
+
## Required Workflow
|
|
19
|
+
|
|
20
|
+
1. Confirm explicit developer approval and the exact decision scope -> never
|
|
21
|
+
invent or infer approval.
|
|
22
|
+
2. Read `docs/adr/INDEX.md` and any matching ADRs.
|
|
23
|
+
3. Choose the next four-digit ADR ID.
|
|
24
|
+
4. Create `docs/adr/NNNN-kebab-title.md` with Status, Context, Scope,
|
|
25
|
+
Decision, Alternatives, Consequences, and Supersession.
|
|
26
|
+
5. If this decision supersedes an existing ADR -> mark the old ADR
|
|
27
|
+
superseded and cross-link both records in their Supersession sections.
|
|
28
|
+
6. Add or update the row in `docs/adr/INDEX.md` in the same change -> update
|
|
29
|
+
both the new detail file and the index together.
|
|
30
|
+
7. Validate every path, status, ID, and supersession link before reporting
|
|
31
|
+
completion.
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
|
|
35
|
+
- Do: record only decisions with explicit developer approval.
|
|
36
|
+
- Do: update both `docs/adr/INDEX.md` and the ADR detail file in the same
|
|
37
|
+
change; never leave one without the other.
|
|
38
|
+
- Do not: invent or infer approval for a decision the developer has not
|
|
39
|
+
confirmed.
|
|
40
|
+
- Do not: edit implementation code as part of this workflow.
|
|
41
|
+
- Do not: leave the detail file and index inconsistent.
|
|
42
|
+
|
|
43
|
+
## Verification
|
|
44
|
+
|
|
45
|
+
- Run `<agent: fill during handoff — docs/link validation command>` when ADR
|
|
46
|
+
detail or index content changes.
|
|
47
|
+
|
|
48
|
+
## References
|
|
49
|
+
|
|
50
|
+
- `docs/adr/INDEX.md` - decision routing registry.
|
|
51
|
+
- `docs/adr/0000-template.md` - ADR detail contract.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
name: resurface-deferred-work
|
|
3
|
+
description: Use when building, planning, or designing work that matches an entry in docs/deferred/INDEX.md.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# Resurface Deferred Work
|
|
@@ -33,4 +34,3 @@ Prevent agents from silently building over parked decisions without confirming t
|
|
|
33
34
|
## References
|
|
34
35
|
|
|
35
36
|
- `docs/deferred/INDEX.md` - parked-work registry.
|
|
36
|
-
- `docs/conventions/doc-lifecycle.md` - lifecycle for deferred plans.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# ARCHITECTURE
|
|
2
|
+
|
|
3
|
+
Answers: how is the system technically shaped? Populated and kept current by `/refresh-repo-map`. Do not hand-edit outside that workflow.
|
|
4
|
+
|
|
5
|
+
## System Boundary
|
|
6
|
+
|
|
7
|
+
<agent: fill via /refresh-repo-map - the system and runtime boundary: what is inside versus outside this codebase.>
|
|
8
|
+
|
|
9
|
+
## Primary Stack
|
|
10
|
+
|
|
11
|
+
<agent: fill via /refresh-repo-map - primary language, runtime, framework, platform, and package manager.>
|
|
12
|
+
|
|
13
|
+
## Significant Dependencies
|
|
14
|
+
|
|
15
|
+
<agent: fill via /refresh-repo-map - architecture-significant dependencies and the role each plays.>
|
|
16
|
+
|
|
17
|
+
## Components and Dependency Direction
|
|
18
|
+
|
|
19
|
+
<agent: fill via /refresh-repo-map - major components and the direction dependencies flow between them.>
|
|
20
|
+
|
|
21
|
+
## Integrations and State Ownership
|
|
22
|
+
|
|
23
|
+
<agent: fill via /refresh-repo-map - external integrations and which component owns which state.>
|
|
24
|
+
|
|
25
|
+
## Runtime and Deployment
|
|
26
|
+
|
|
27
|
+
<agent: fill via /refresh-repo-map - runtime topology and how the system is deployed.>
|
|
28
|
+
|
|
29
|
+
## Development Environment
|
|
30
|
+
|
|
31
|
+
<agent: fill via /refresh-repo-map - local prerequisites and canonical install, run, build, test, and lint commands.>
|
|
32
|
+
|
|
33
|
+
## Architectural Constraints
|
|
34
|
+
|
|
35
|
+
<agent: fill via /refresh-repo-map - durable technical constraints and links to governing ADRs.>
|
|
36
|
+
|
|
37
|
+
<!-- repo-map-synced: <agent: fill via /refresh-repo-map> -->
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# CODEBASE_MAP
|
|
2
|
+
|
|
3
|
+
Answers: where is today's shipped implementation? Organized by capability and concern, not directory order. Populated and kept current by `/refresh-repo-map`. Do not hand-edit outside that workflow.
|
|
4
|
+
|
|
5
|
+
## Executable Entry Points
|
|
6
|
+
|
|
7
|
+
<agent: fill via /refresh-repo-map - the executable entry points into this codebase.>
|
|
8
|
+
|
|
9
|
+
## Capabilities and Concerns
|
|
10
|
+
|
|
11
|
+
<agent: fill via /refresh-repo-map - each shipped capability or technical concern and its owning `path#symbol` anchors.>
|
|
12
|
+
|
|
13
|
+
## Critical Flows
|
|
14
|
+
|
|
15
|
+
<agent: fill via /refresh-repo-map - critical flow chains where one owner table cannot show the route clearly.>
|
|
16
|
+
|
|
17
|
+
## Shared Utilities and Infrastructure
|
|
18
|
+
|
|
19
|
+
<agent: fill via /refresh-repo-map - shared utilities and infrastructure used across capabilities.>
|
|
20
|
+
|
|
21
|
+
## Interfaces and State
|
|
22
|
+
|
|
23
|
+
<agent: fill via /refresh-repo-map - interfaces, state, side effects, and external boundaries.>
|
|
24
|
+
|
|
25
|
+
## Change Hazards
|
|
26
|
+
|
|
27
|
+
<agent: fill via /refresh-repo-map - change hazards that affect safe routing or proof.>
|
|
28
|
+
|
|
29
|
+
## Verification Map
|
|
30
|
+
|
|
31
|
+
<agent: fill via /refresh-repo-map - relevant tests and verification commands per capability.>
|
|
32
|
+
|
|
33
|
+
<!-- repo-map-synced: <agent: fill via /refresh-repo-map> -->
|