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-QTWNGAGX.js");
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
@@ -8,7 +8,7 @@ import {
8
8
  skillBaselinePath,
9
9
  starterSkillNameFromTarget,
10
10
  validateHarnesses
11
- } from "./chunk-5D5YO3E3.js";
11
+ } from "./chunk-WYXKSCUW.js";
12
12
 
13
13
  // src/cli.ts
14
14
  import { Command } from "commander";
@@ -16,7 +16,7 @@ import {
16
16
  templatesDir,
17
17
  validateHarnesses,
18
18
  writeBackup
19
- } from "./chunk-5D5YO3E3.js";
19
+ } from "./chunk-WYXKSCUW.js";
20
20
 
21
21
  // src/semver.ts
22
22
  function parseSemver(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bearings",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Give your AI agents their bearings — scaffold an agent-friendly setup in any repository.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -1,17 +1,21 @@
1
1
  ---
2
- description: One-time (re-runnable) project tailoring after `bearings init`. Interviews the developer, explores the repo, and completes the agent-friendly setup.
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
- 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.
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 step 12 below.
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 non-`skill-update` reconciliation, read its Backup File and current target, summarize
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
- 4. Apply the developer's choice directly to the target regardless of owner,
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
- 5. A `skippedTemplate` records a declined template revision.
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
- 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.
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. 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:
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
- 6. Claim starter skills in `.agents/bearings.json` (allowed manifest edit):
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
- 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.
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.