bearings 0.5.3 → 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.
- package/README.md +40 -22
- package/dist/chunk-MOZJECCW.js +1823 -0
- package/dist/cli.js +189 -158
- package/dist/{update-4DZKUPFP.js → update-YY5SLPDF.js} +84 -221
- package/package.json +1 -1
- package/templates/AGENTS.md +1 -5
- package/templates/agents/commands/refresh-repo-map.md +36 -13
- package/templates/agents/commands/update-bearings-setup.md +144 -0
- package/templates/agents/skills/checklist/previewer/index.html +44 -10
- package/templates/agents/skills/checklist/previewer/viewer.css +321 -77
- package/templates/agents/skills/checklist/previewer/viewer.js +797 -97
- package/templates/initial-setup.md +112 -0
- package/dist/chunk-WYXKSCUW.js +0 -818
- package/templates/agents/commands/setup-repo.md +0 -155
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: First-time project tailoring after `bearings init`, and post-update reconciliation when `setupPending`. Not for map refresh.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# /setup-repo
|
|
6
|
-
|
|
7
|
-
Pick one mode and stop when that mode finishes.
|
|
8
|
-
|
|
9
|
-
- Manifest has `setupPending` → **Post-update reconciliation**, then stop.
|
|
10
|
-
- `AGENTS.md` still has `## Setup Required` → **Required workflow**, then stop.
|
|
11
|
-
- Neither → already done. Map drift is `/refresh-repo-map`.
|
|
12
|
-
|
|
13
|
-
This is the only operation the temporary `## Setup Required` gate in
|
|
14
|
-
`AGENTS.md` permits. Do not remove the gate until the Required workflow's
|
|
15
|
-
verify step reports zero failures and zero warnings.
|
|
16
|
-
|
|
17
|
-
Explore the repo before asking. Ask one question at a time, with a
|
|
18
|
-
recommended answer, only for facts the code cannot answer.
|
|
19
|
-
|
|
20
|
-
## Post-update reconciliation
|
|
21
|
-
|
|
22
|
-
When `.agents/bearings.json` is manifest v2 and has `setupPending`:
|
|
23
|
-
|
|
24
|
-
1. Read every file record's ordered `reconciliations` and every top-level
|
|
25
|
-
`migrationReconciliations` record.
|
|
26
|
-
2. Resolve every `migrationReconciliations` record through **Migrated checklist
|
|
27
|
-
repairs** below.
|
|
28
|
-
3. For each `skill-update` reconciliation, follow **Starter skill updates**
|
|
29
|
-
below.
|
|
30
|
-
4. For each remaining reconciliation, read its Backup File and current target, summarize
|
|
31
|
-
the differences, and ask which backed-up changes to apply to the target.
|
|
32
|
-
5. Apply the developer's choice directly to the target regardless of owner,
|
|
33
|
-
delete the resolved Backup File, and remove its reconciliation record.
|
|
34
|
-
6. A `skippedTemplate` records a declined template revision.
|
|
35
|
-
Do not apply the declined template — normal project maintenance may
|
|
36
|
-
still update that file.
|
|
37
|
-
7. Run `bearings verify`. Resolve every failure and warning except the
|
|
38
|
-
expected `setup-pending` warning, then remove `setupPending` from the
|
|
39
|
-
manifest.
|
|
40
|
-
8. Run `bearings verify` again and finish only at zero failures and warnings.
|
|
41
|
-
Stop here. Do not continue into first-time setup. Do not run `/refresh-repo-map`.
|
|
42
|
-
|
|
43
|
-
### Starter skill updates (`skill-update`)
|
|
44
|
-
|
|
45
|
-
For each file record with a `skill-update` reconciliation:
|
|
46
|
-
|
|
47
|
-
1. Read `basePath`, the live skill path (local), and `incomingPath`. Check
|
|
48
|
-
whether `basePath` exists before attempting any diff.
|
|
49
|
-
2. If `basePath` is missing, explain that Three-way merge is not available
|
|
50
|
-
without a historical base. Do not fabricate one. Offer exactly these
|
|
51
|
-
options (one skill at a time):
|
|
52
|
-
- **Take new template**, **Keep local**, and **Freeform**. Apply the same
|
|
53
|
-
manifest and baseline updates described below for the selected outcome.
|
|
54
|
-
3. If `basePath` exists, diff local vs base and incoming vs base; summarize
|
|
55
|
-
both for the developer. If `basePath` exists, offer exactly these four options
|
|
56
|
-
(one skill at a time), mark a recommendation:
|
|
57
|
-
- **Take new template** — replace live skill with incoming; set manifest
|
|
58
|
-
`hash` and `lastTemplateHash` to incoming hash; `owner: agent`.
|
|
59
|
-
- **Keep local** — leave live skill; set `hash` to current content hash;
|
|
60
|
-
keep `lastTemplateHash`; set `skippedTemplate` to the incoming
|
|
61
|
-
version/hash; `owner: agent`.
|
|
62
|
-
- **Three-way merge** (Recommended when both diffs are non-empty) — merge
|
|
63
|
-
both sides into the live skill; then set `hash` to result hash and
|
|
64
|
-
`lastTemplateHash` to incoming hash; `owner: agent`.
|
|
65
|
-
- **Freeform** — developer/agent writes the resolved file; same baselining
|
|
66
|
-
as merge (hash = result, `lastTemplateHash` = incoming hash) unless they
|
|
67
|
-
explicitly choose to decline the template (then same as Keep local).
|
|
68
|
-
4. Refresh `.agents/.bearings-baseline/skills/<name>/SKILL.md` to match the
|
|
69
|
-
new content hash.
|
|
70
|
-
5. Delete backup, incoming file, and the reconciliation entry.
|
|
71
|
-
|
|
72
|
-
### Migrated checklist repairs (`migrationReconciliations`)
|
|
73
|
-
|
|
74
|
-
Resolve each record through the generic checklist workflow. Invoke the
|
|
75
|
-
`checklist` skill directly, or delegate one record to a subagent that loads and
|
|
76
|
-
follows `.agents/skills/checklist/SKILL.md`.
|
|
77
|
-
|
|
78
|
-
1. For `testplan-collision`, read the current `target` and the pre-existing
|
|
79
|
-
checklist in `backup`. Summarize their authored content and ask the developer
|
|
80
|
-
whether to keep either version or combine them. Write the choice to `target`.
|
|
81
|
-
2. For `invalid-testplan`, read `backup`, explain each contract problem, and
|
|
82
|
-
repair its useful authored content into `target`. When the record has no
|
|
83
|
-
`target`, ask the developer to choose a safe
|
|
84
|
-
`checklists/<category...>/<slug>.json` path first. Do not discard content
|
|
85
|
-
that cannot be repaired without the developer's decision.
|
|
86
|
-
3. Follow the checklist skill's schema, validation, and full-library build
|
|
87
|
-
steps for the resolved target. Continue only after validation and build both
|
|
88
|
-
pass.
|
|
89
|
-
4. Delete the resolved `backup` and remove its
|
|
90
|
-
`migrationReconciliations` record. Remove the top-level property when no
|
|
91
|
-
records remain.
|
|
92
|
-
|
|
93
|
-
## Checklist opener
|
|
94
|
-
|
|
95
|
-
Reuse an existing equivalent runner command that already invokes
|
|
96
|
-
`npx bearings checklist` (or the repository's established local bearings
|
|
97
|
-
invocation). If none exists, report `npx bearings checklist`. Do not create
|
|
98
|
-
or edit automation files. Do not open the previewer during setup.
|
|
99
|
-
|
|
100
|
-
## Required workflow
|
|
101
|
-
|
|
102
|
-
1. Read `AGENTS.md` and `.agents/bearings.json`.
|
|
103
|
-
2. Review every recorded Backup File with the developer: read the backup,
|
|
104
|
-
summarise what it contained, and ask per file whether to merge into the
|
|
105
|
-
new scaffold, keep parts, or discard. Apply their choice, then remove
|
|
106
|
-
the resolved backup.
|
|
107
|
-
3. Fill only the `AGENTS.md` project-purpose and primary-stack placeholders
|
|
108
|
-
from the repo. Keep `AGENTS.md` a thin router — do not add a skill table,
|
|
109
|
-
invariants section, or always-on rules block.
|
|
110
|
-
4. Adapt every starter skill:
|
|
111
|
-
- `.agents/skills/commit-convention/SKILL.md`
|
|
112
|
-
- `.agents/skills/defer-work/SKILL.md`
|
|
113
|
-
- `.agents/skills/resurface-deferred-work/SKILL.md`
|
|
114
|
-
- `.agents/skills/recording-decisions/SKILL.md`
|
|
115
|
-
- Replace every `<agent: fill during handoff — …>` marker with a real
|
|
116
|
-
command or explicit `not configured`.
|
|
117
|
-
- Light project tailoring only — do not remove the skill's safety workflow.
|
|
118
|
-
5. Claim starter skills in `.agents/bearings.json` (allowed manifest edit):
|
|
119
|
-
- Set each starter skill `owner` to `agent`.
|
|
120
|
-
- Set `hash` to the sha256 of the file contents (use the same algorithm as
|
|
121
|
-
bearings: UTF-8 body, `sha256:` + hex).
|
|
122
|
-
- Set `lastTemplateHash` to the hash of the skill template as shipped in the
|
|
123
|
-
installed bearings package (read from the package templates if needed;
|
|
124
|
-
if the adapted file still matches the package template byte-for-byte,
|
|
125
|
-
`lastTemplateHash` equals `hash`).
|
|
126
|
-
- Write `.agents/.bearings-baseline/skills/<name>/SKILL.md` equal to the
|
|
127
|
-
live file bytes.
|
|
128
|
-
6. Complete the **Checklist opener** workflow above.
|
|
129
|
-
7. If `docs/DOMAIN.md`, `docs/ARCHITECTURE.md`, or `docs/CODEBASE_MAP.md`
|
|
130
|
-
still contains a `<agent:` placeholder, run the `/refresh-repo-map` workflow
|
|
131
|
-
to initialize those files and `docs/diagrams/c4-component.puml`.
|
|
132
|
-
8. Run `bearings verify`. Fix every failure and every warning. Confirm
|
|
133
|
-
zero failures and zero warnings. Remove the `## Setup Required` section
|
|
134
|
-
from `AGENTS.md` — only after that confirmation. Run `bearings verify`
|
|
135
|
-
again and report the completed setup to the developer.
|
|
136
|
-
|
|
137
|
-
## Rules
|
|
138
|
-
|
|
139
|
-
- Do not overwrite developer decisions silently — every merge/keep/discard
|
|
140
|
-
of a Backup File is the developer's call.
|
|
141
|
-
- Do not edit bearings-owned **commands** except when a recorded Merge
|
|
142
|
-
reconciliation explicitly permits applying backup changes.
|
|
143
|
-
- Do edit starter **skills** during setup (adapt + claim). After claim they
|
|
144
|
-
are agent-owned; maintainers may edit them freely.
|
|
145
|
-
- Manifest edits are limited to: skill `owner` / `hash` / `lastTemplateHash` /
|
|
146
|
-
`skippedTemplate` / `reconciliations`, resolving
|
|
147
|
-
`migrationReconciliations`, deleting resolved backups/incoming, and clearing
|
|
148
|
-
`setupPending`.
|
|
149
|
-
- Do not add a skill registry row to `AGENTS.md` — native skill discovery
|
|
150
|
-
replaces it.
|
|
151
|
-
- Do not invent domain or technical constraints — every stated constraint
|
|
152
|
-
must come from the developer or from clear evidence in the code (cite
|
|
153
|
-
the path).
|
|
154
|
-
- Do not remove the `## Setup Required` section before `bearings verify`
|
|
155
|
-
reports zero failures and zero warnings.
|