bearings 0.5.1 → 0.5.3
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.
|
@@ -16,6 +16,9 @@ var SKILLS = STARTER_SKILL_NAMES;
|
|
|
16
16
|
var MANUAL_TESTPLAN_FILES = [
|
|
17
17
|
"SKILL.md"
|
|
18
18
|
];
|
|
19
|
+
var ORCHESTRATE_FILES = [
|
|
20
|
+
"SKILL.md"
|
|
21
|
+
];
|
|
19
22
|
var FORGE_A_SKILL_FILES = [
|
|
20
23
|
"SKILL.md",
|
|
21
24
|
"templates/guardrail.md",
|
|
@@ -63,6 +66,11 @@ var SCAFFOLD = [
|
|
|
63
66
|
target: `.agents/skills/manual-testplan/${file}`,
|
|
64
67
|
owner: "bearings"
|
|
65
68
|
})),
|
|
69
|
+
...ORCHESTRATE_FILES.map((file) => ({
|
|
70
|
+
template: `agents/skills/orchestrate/${file}`,
|
|
71
|
+
target: `.agents/skills/orchestrate/${file}`,
|
|
72
|
+
owner: "bearings"
|
|
73
|
+
})),
|
|
66
74
|
...FORGE_A_SKILL_FILES.map((file) => ({
|
|
67
75
|
template: `agents/skills/forge-a-skill/${file}`,
|
|
68
76
|
target: `.agents/skills/forge-a-skill/${file}`,
|
|
@@ -783,7 +791,7 @@ async function runFreshInit(repoDir, flags, version) {
|
|
|
783
791
|
async function runInit(repoDir, flags, version) {
|
|
784
792
|
const state = await inspectManifest(repoDir);
|
|
785
793
|
if (state.kind === "absent") return runFreshInit(repoDir, flags, version);
|
|
786
|
-
const { runUpdate } = await import("./update-
|
|
794
|
+
const { runUpdate } = await import("./update-4DZKUPFP.js");
|
|
787
795
|
return runUpdate(repoDir, flags, version, state);
|
|
788
796
|
}
|
|
789
797
|
|
package/dist/cli.js
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: First-time project tailoring after `bearings init`, and post-update reconciliation when `setupPending`. Not for map refresh.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# /setup-repo
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
12
|
|
|
13
13
|
This is the only operation the temporary `## Setup Required` gate in
|
|
14
|
-
`AGENTS.md` permits. Do not remove the gate until
|
|
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.
|
|
15
19
|
|
|
16
20
|
## Post-update reconciliation
|
|
17
21
|
|
|
@@ -21,19 +25,20 @@ When `.agents/bearings.json` is manifest v2 and has `setupPending`:
|
|
|
21
25
|
`migrationReconciliations` record.
|
|
22
26
|
2. Resolve every `migrationReconciliations` record through **Migrated checklist
|
|
23
27
|
repairs** below.
|
|
24
|
-
3. For each
|
|
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
|
|
25
31
|
the differences, and ask which backed-up changes to apply to the target.
|
|
26
|
-
|
|
32
|
+
5. Apply the developer's choice directly to the target regardless of owner,
|
|
27
33
|
delete the resolved Backup File, and remove its reconciliation record.
|
|
28
|
-
|
|
34
|
+
6. A `skippedTemplate` records a declined template revision.
|
|
29
35
|
Do not apply the declined template — normal project maintenance may
|
|
30
36
|
still update that file.
|
|
31
|
-
6. Run only setup steps supported by current drift; do not reset completed
|
|
32
|
-
project tailoring.
|
|
33
37
|
7. Run `bearings verify`. Resolve every failure and warning except the
|
|
34
38
|
expected `setup-pending` warning, then remove `setupPending` from the
|
|
35
39
|
manifest.
|
|
36
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`.
|
|
37
42
|
|
|
38
43
|
### Starter skill updates (`skill-update`)
|
|
39
44
|
|
|
@@ -87,28 +92,10 @@ follows `.agents/skills/checklist/SKILL.md`.
|
|
|
87
92
|
|
|
88
93
|
## Checklist opener
|
|
89
94
|
|
|
90
|
-
|
|
91
|
-
the repository's established local bearings
|
|
92
|
-
|
|
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.
|
|
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.
|
|
112
99
|
|
|
113
100
|
## Required workflow
|
|
114
101
|
|
|
@@ -117,25 +104,18 @@ the checklist payload and opens the static previewer.
|
|
|
117
104
|
summarise what it contained, and ask per file whether to merge into the
|
|
118
105
|
new scaffold, keep parts, or discard. Apply their choice, then remove
|
|
119
106
|
the resolved backup.
|
|
120
|
-
3.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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:
|
|
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:
|
|
129
111
|
- `.agents/skills/commit-convention/SKILL.md`
|
|
130
112
|
- `.agents/skills/defer-work/SKILL.md`
|
|
131
113
|
- `.agents/skills/resurface-deferred-work/SKILL.md`
|
|
132
114
|
- `.agents/skills/recording-decisions/SKILL.md`
|
|
133
|
-
- Explore the repo for format, lint-fix, lint, typecheck, test, build,
|
|
134
|
-
and docs verification commands.
|
|
135
115
|
- Replace every `<agent: fill during handoff — …>` marker with a real
|
|
136
116
|
command or explicit `not configured`.
|
|
137
117
|
- Light project tailoring only — do not remove the skill's safety workflow.
|
|
138
|
-
|
|
118
|
+
5. Claim starter skills in `.agents/bearings.json` (allowed manifest edit):
|
|
139
119
|
- Set each starter skill `owner` to `agent`.
|
|
140
120
|
- Set `hash` to the sha256 of the file contents (use the same algorithm as
|
|
141
121
|
bearings: UTF-8 body, `sha256:` + hex).
|
|
@@ -145,19 +125,14 @@ the checklist payload and opens the static previewer.
|
|
|
145
125
|
`lastTemplateHash` equals `hash`).
|
|
146
126
|
- Write `.agents/.bearings-baseline/skills/<name>/SKILL.md` equal to the
|
|
147
127
|
live file bytes.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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.
|
|
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.
|
|
161
136
|
|
|
162
137
|
## Rules
|
|
163
138
|
|
|
@@ -178,5 +153,3 @@ the checklist payload and opens the static previewer.
|
|
|
178
153
|
the path).
|
|
179
154
|
- Do not remove the `## Setup Required` section before `bearings verify`
|
|
180
155
|
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.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orchestrate
|
|
3
|
+
description: Run a large task as an orchestrator that plans and decides in the main context and delegates context-heavy work to sub-agents. Use only when the developer invokes /orchestrate by name.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Orchestrate
|
|
8
|
+
|
|
9
|
+
Act as the orchestrator. The main context holds the plan, the decisions, and
|
|
10
|
+
the synthesis; sub-agents absorb the raw material — file dumps, logs, command
|
|
11
|
+
output — and return conclusions, not transcripts. If this harness cannot start
|
|
12
|
+
sub-agents, tell the developer, then run the same plan inline.
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
1. Plan in the main context. Break the task into work items and mark each
|
|
17
|
+
`delegate` or `keep` using the Delegation table. The plan is done when every
|
|
18
|
+
item has a mark and the delegated items name their dependencies.
|
|
19
|
+
2. Dispatch a sub-agent for every `delegate` item, following Sub-agent briefs.
|
|
20
|
+
Run independent items concurrently; run items that touch the same files in
|
|
21
|
+
sequence or merge them into one brief.
|
|
22
|
+
3. Integrate. Read only the sub-agents' conclusions, make the decisions in the
|
|
23
|
+
main context, and dispatch follow-up sub-agents for gaps the conclusions
|
|
24
|
+
expose.
|
|
25
|
+
4. Report: the decisions made, what each sub-agent concluded, and the final
|
|
26
|
+
result with its verification.
|
|
27
|
+
|
|
28
|
+
## Delegation table
|
|
29
|
+
|
|
30
|
+
| Work | Sub-agent returns |
|
|
31
|
+
|---|---|
|
|
32
|
+
| Search and exploration across many files | `path#symbol` locations plus a one-paragraph answer |
|
|
33
|
+
| Bulk reading: large files, logs, external docs | Only the facts that bear on the task, with citations |
|
|
34
|
+
| Verbose commands: tests, builds, lints | Pass or fail, plus only the failing output |
|
|
35
|
+
| Implementation of an independent plan slice | Changed file list plus its self-check result |
|
|
36
|
+
|
|
37
|
+
Keep in the main context: the plan, choices between approaches, targeted reads
|
|
38
|
+
of already-located sections, and every question for the developer.
|
|
39
|
+
|
|
40
|
+
## Sub-agent briefs
|
|
41
|
+
|
|
42
|
+
A sub-agent starts with an empty context. Every brief carries:
|
|
43
|
+
|
|
44
|
+
- The goal and its completion criterion — how the sub-agent knows it is done.
|
|
45
|
+
- Every input it cannot discover cheaply: paths, commands, constraints, and
|
|
46
|
+
the repository conventions that apply.
|
|
47
|
+
- The return contract: the shortest artifact the orchestrator can act on,
|
|
48
|
+
in the shape the Delegation table names.
|
|
49
|
+
- For implementation work: the exact plan slice it owns and the boundary of
|
|
50
|
+
that slice.
|