bearings 0.5.2 → 0.5.4

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.
@@ -1,182 +0,0 @@
1
- ---
2
- description: One-time (re-runnable) project tailoring after `bearings init`. Interviews the developer, explores the repo, and completes the agent-friendly setup.
3
- ---
4
-
5
- # /setup-repo
6
-
7
- You are completing the agent-friendly setup that `bearings init` scaffolded.
8
- The scaffold is generic; your job is everything project-specific. Interview
9
- the developer relentlessly — one question at a time, with a recommended
10
- answer per question — and explore the code before asking anything the code
11
- can answer.
12
-
13
- This is the only operation the temporary `## Setup Required` gate in
14
- `AGENTS.md` permits. Do not remove the gate until step 12 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` and every top-level
21
- `migrationReconciliations` record.
22
- 2. Resolve every `migrationReconciliations` record through **Migrated checklist
23
- repairs** below.
24
- 3. For each non-`skill-update` reconciliation, read its Backup File and current target, summarize
25
- the differences, and ask which backed-up changes to apply to the target.
26
- 4. Apply the developer's choice directly to the target regardless of owner,
27
- delete the resolved Backup File, and remove its reconciliation record.
28
- 5. A `skippedTemplate` records a declined template revision.
29
- Do not apply the declined template — normal project maintenance may
30
- still update that file.
31
- 6. Run only setup steps supported by current drift; do not reset completed
32
- project tailoring.
33
- 7. Run `bearings verify`. Resolve every failure and warning except the
34
- expected `setup-pending` warning, then remove `setupPending` from the
35
- manifest.
36
- 8. Run `bearings verify` again and finish only at zero failures and warnings.
37
-
38
- ### Starter skill updates (`skill-update`)
39
-
40
- For each file record with a `skill-update` reconciliation:
41
-
42
- 1. Read `basePath`, the live skill path (local), and `incomingPath`. Check
43
- whether `basePath` exists before attempting any diff.
44
- 2. If `basePath` is missing, explain that Three-way merge is not available
45
- without a historical base. Do not fabricate one. Offer exactly these
46
- options (one skill at a time):
47
- - **Take new template**, **Keep local**, and **Freeform**. Apply the same
48
- manifest and baseline updates described below for the selected outcome.
49
- 3. If `basePath` exists, diff local vs base and incoming vs base; summarize
50
- both for the developer. If `basePath` exists, offer exactly these four options
51
- (one skill at a time), mark a recommendation:
52
- - **Take new template** — replace live skill with incoming; set manifest
53
- `hash` and `lastTemplateHash` to incoming hash; `owner: agent`.
54
- - **Keep local** — leave live skill; set `hash` to current content hash;
55
- keep `lastTemplateHash`; set `skippedTemplate` to the incoming
56
- version/hash; `owner: agent`.
57
- - **Three-way merge** (Recommended when both diffs are non-empty) — merge
58
- both sides into the live skill; then set `hash` to result hash and
59
- `lastTemplateHash` to incoming hash; `owner: agent`.
60
- - **Freeform** — developer/agent writes the resolved file; same baselining
61
- as merge (hash = result, `lastTemplateHash` = incoming hash) unless they
62
- explicitly choose to decline the template (then same as Keep local).
63
- 4. Refresh `.agents/.bearings-baseline/skills/<name>/SKILL.md` to match the
64
- new content hash.
65
- 5. Delete backup, incoming file, and the reconciliation entry.
66
-
67
- ### Migrated checklist repairs (`migrationReconciliations`)
68
-
69
- Resolve each record through the generic checklist workflow. Invoke the
70
- `checklist` skill directly, or delegate one record to a subagent that loads and
71
- follows `.agents/skills/checklist/SKILL.md`.
72
-
73
- 1. For `testplan-collision`, read the current `target` and the pre-existing
74
- checklist in `backup`. Summarize their authored content and ask the developer
75
- whether to keep either version or combine them. Write the choice to `target`.
76
- 2. For `invalid-testplan`, read `backup`, explain each contract problem, and
77
- repair its useful authored content into `target`. When the record has no
78
- `target`, ask the developer to choose a safe
79
- `checklists/<category...>/<slug>.json` path first. Do not discard content
80
- that cannot be repaired without the developer's decision.
81
- 3. Follow the checklist skill's schema, validation, and full-library build
82
- steps for the resolved target. Continue only after validation and build both
83
- pass.
84
- 4. Delete the resolved `backup` and remove its
85
- `migrationReconciliations` record. Remove the top-level property when no
86
- records remain.
87
-
88
- ## Checklist opener
89
-
90
- Add or reuse one project-native command that runs `npx bearings checklist` (or
91
- the repository's established local bearings invocation). This command builds
92
- the checklist payload and opens the static previewer.
93
-
94
- 1. Search existing automation and documentation for an existing equivalent
95
- runner command that already builds and opens the checklist previewer. Reuse
96
- it and report its exact invocation without editing its runner.
97
- 2. Otherwise, select the first existing safe automation home in this exact
98
- priority: `justfile`, `Makefile`, `Taskfile.yml`, `mise.toml`, then
99
- `package.json`.
100
- 3. Before editing an existing automation file, show the proposed command and
101
- ask the developer for approval. Edit it only after approval. If approval is
102
- declined, leave it unchanged and continue through the priority order.
103
- 4. If no existing home is safe and approved, ask the developer to choose
104
- between creating one missing automation file from the list above and using
105
- the direct fallback. Create a missing file only after the developer selects
106
- that strategy and file.
107
- 5. When no automation file is selected, make no automation edit and report the
108
- stack-agnostic direct build-and-open fallback: `npx bearings checklist`.
109
- 6. Run the selected command, or the direct fallback, and confirm that it builds
110
- successfully and opens the static previewer. Report its exact invocation for
111
- future use.
112
-
113
- ## Required workflow
114
-
115
- 1. Read `AGENTS.md` and `.agents/bearings.json`.
116
- 2. Review every recorded Backup File with the developer: read the backup,
117
- summarise what it contained, and ask per file whether to merge into the
118
- new scaffold, keep parts, or discard. Apply their choice, then remove
119
- the resolved backup.
120
- 3. Explore the repo: stack, package manager, canonical install/run/build/
121
- test/lint commands, CI, generated paths, secret/config paths, deployment
122
- surfaces, project purpose, users/operators, and hard domain/technical
123
- constraints. Interview the developer one question at a time for anything
124
- the code cannot answer.
125
- 4. Fill only the `AGENTS.md` project-purpose and primary-stack placeholders.
126
- Keep `AGENTS.md` a thin router — do not add a skill table, invariants
127
- section, or always-on rules block.
128
- 5. Adapt every starter skill:
129
- - `.agents/skills/commit-convention/SKILL.md`
130
- - `.agents/skills/defer-work/SKILL.md`
131
- - `.agents/skills/resurface-deferred-work/SKILL.md`
132
- - `.agents/skills/recording-decisions/SKILL.md`
133
- - Explore the repo for format, lint-fix, lint, typecheck, test, build,
134
- and docs verification commands.
135
- - Replace every `<agent: fill during handoff — …>` marker with a real
136
- command or explicit `not configured`.
137
- - Light project tailoring only — do not remove the skill's safety workflow.
138
- 6. Claim starter skills in `.agents/bearings.json` (allowed manifest edit):
139
- - Set each starter skill `owner` to `agent`.
140
- - Set `hash` to the sha256 of the file contents (use the same algorithm as
141
- bearings: UTF-8 body, `sha256:` + hex).
142
- - Set `lastTemplateHash` to the hash of the skill template as shipped in the
143
- installed bearings package (read from the package templates if needed;
144
- if the adapted file still matches the package template byte-for-byte,
145
- `lastTemplateHash` equals `hash`).
146
- - Write `.agents/.bearings-baseline/skills/<name>/SKILL.md` equal to the
147
- live file bytes.
148
- 7. Complete the **Checklist opener** workflow above.
149
- 8. Run the `/refresh-repo-map` workflow to initialize `docs/DOMAIN.md`,
150
- `docs/ARCHITECTURE.md`, `docs/CODEBASE_MAP.md`, and
151
- `docs/diagrams/c4-component.puml`.
152
- 9. Expose any newly created skills into each configured harness using the
153
- manifest's existing symlink/copy mode.
154
- 10. Run `bearings verify`. Fix every failure and every warning.
155
- 11. Confirm the run reports zero failures and zero warnings before
156
- proceeding.
157
- 12. Remove the `## Setup Required` section from `AGENTS.md` — only after
158
- step 11 confirms zero failures and zero warnings.
159
- 13. Run `bearings verify` again and report the completed setup to the
160
- developer.
161
-
162
- ## Rules
163
-
164
- - Do not overwrite developer decisions silently — every merge/keep/discard
165
- of a Backup File is the developer's call.
166
- - Do not edit bearings-owned **commands** except when a recorded Merge
167
- reconciliation explicitly permits applying backup changes.
168
- - Do edit starter **skills** during setup (adapt + claim). After claim they
169
- are agent-owned; maintainers may edit them freely.
170
- - Manifest edits are limited to: skill `owner` / `hash` / `lastTemplateHash` /
171
- `skippedTemplate` / `reconciliations`, resolving
172
- `migrationReconciliations`, deleting resolved backups/incoming, and clearing
173
- `setupPending`.
174
- - Do not add a skill registry row to `AGENTS.md` — native skill discovery
175
- replaces it.
176
- - Do not invent domain or technical constraints — every stated constraint
177
- must come from the developer or from clear evidence in the code (cite
178
- the path).
179
- - Do not remove the `## Setup Required` section before `bearings verify`
180
- reports zero failures and zero warnings.
181
- - Re-running this command later is allowed: skip completed steps and focus
182
- on drift between the maps and reality.