forge-orkes 0.30.0 → 0.32.0
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/bin/create-forge.js +94 -118
- package/package.json +1 -1
- package/template/.claude/skills/chief-of-staff/SKILL.md +238 -0
- package/template/.claude/skills/discussing/SKILL.md +2 -0
- package/template/.claude/skills/forge/SKILL.md +31 -4
- package/template/.claude/skills/planning/SKILL.md +9 -0
- package/template/.claude/skills/upgrading/SKILL.md +21 -198
- package/template/.forge/FORGE.md +57 -23
- package/template/.forge/migrations/0.10.0-per-milestone-requirements.md +10 -6
- package/template/.forge/migrations/0.17.0-cross-layer-contracts.md +7 -7
- package/template/.forge/migrations/0.19.0-worktree-safe-state.md +9 -4
- package/template/.forge/migrations/0.20.0-nested-phase-layout.md +8 -4
- package/template/.forge/migrations/0.22.0-backlog-compaction.md +12 -8
- package/template/.forge/migrations/0.28.0-worktree-root.md +5 -5
- package/template/.forge/migrations/0.29.0-shared-state-taxonomy.md +7 -2
- package/template/.forge/migrations/0.32.0-chief-streams.md +159 -0
- package/template/.forge/releases.yml +85 -15
- package/template/.forge/templates/context.md +4 -0
- package/template/.forge/templates/migration-guide.md +111 -0
- package/template/.forge/templates/streams/active.yml +34 -0
- package/template/.forge/templates/streams/brief.md +47 -0
- package/template/.forge/templates/streams/stream.yml +56 -0
- package/template/.forge/templates/streams/work-package.yml +70 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Migration Guide: Chief/Streams (Forge 0.32.0)
|
|
2
|
+
|
|
3
|
+
Adds Project Chief / Streams support to existing Forge projects. This migration
|
|
4
|
+
installs framework-owned stream templates and adapter routing, and offers active
|
|
5
|
+
context compaction. It must never overwrite user-owned runtime stream state in
|
|
6
|
+
`.forge/streams/`.
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
|
|
10
|
+
1. Upgrade framework files first so this guide and the new templates are present.
|
|
11
|
+
2. Commit or stash unrelated work.
|
|
12
|
+
3. If `.forge/streams/` already exists, treat it as user state and preserve it.
|
|
13
|
+
|
|
14
|
+
## Detection
|
|
15
|
+
|
|
16
|
+
Prints `MIGRATE` when stream templates, Chief routing, active-context
|
|
17
|
+
compaction support, or active M10 adoption appears missing. Silent + exit 0
|
|
18
|
+
means no migration needed.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
need=0
|
|
22
|
+
|
|
23
|
+
for f in \
|
|
24
|
+
.forge/templates/streams/active.yml \
|
|
25
|
+
.forge/templates/streams/stream.yml \
|
|
26
|
+
.forge/templates/streams/brief.md \
|
|
27
|
+
.forge/templates/streams/work-package.yml
|
|
28
|
+
do
|
|
29
|
+
[ -f "$f" ] || need=1
|
|
30
|
+
done
|
|
31
|
+
|
|
32
|
+
if [ -f .claude/skills/forge/SKILL.md ] && ! grep -q 'chief-of-staff' .claude/skills/forge/SKILL.md; then
|
|
33
|
+
need=1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
if [ -f .claude/skills/chief-of-staff/SKILL.md ]; then
|
|
37
|
+
:
|
|
38
|
+
else
|
|
39
|
+
need=1
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if [ -f .forge/context.md ] && [ ! -f .forge/context-archive.md ]; then
|
|
43
|
+
bytes=$(wc -c < .forge/context.md | tr -d ' ')
|
|
44
|
+
[ "$bytes" -gt 12288 ] && need=1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if [ ! -f .forge/streams/active.yml ] && grep -R "worktree_mode: \\(active\\|degraded\\)" .forge/state/milestone-*.yml >/dev/null 2>&1; then
|
|
48
|
+
need=1
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
if [ "$need" -eq 1 ]; then
|
|
52
|
+
echo "MIGRATE - Chief/Streams templates, routing, context compaction, or M10 adoption missing"
|
|
53
|
+
fi
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Migration Steps
|
|
57
|
+
|
|
58
|
+
### 1. Add Stream Templates
|
|
59
|
+
|
|
60
|
+
Copy the framework-owned templates from the upgraded Forge source into:
|
|
61
|
+
|
|
62
|
+
- `.forge/templates/streams/active.yml`
|
|
63
|
+
- `.forge/templates/streams/stream.yml`
|
|
64
|
+
- `.forge/templates/streams/brief.md`
|
|
65
|
+
- `.forge/templates/streams/work-package.yml`
|
|
66
|
+
|
|
67
|
+
Create parent directories if needed. Do not copy anything into `.forge/streams/`
|
|
68
|
+
unless the user explicitly asks to instantiate a real stream.
|
|
69
|
+
|
|
70
|
+
### 2. Add Chief Skill And Routing
|
|
71
|
+
|
|
72
|
+
Copy the Chief skill into the platform adapter used by the project:
|
|
73
|
+
|
|
74
|
+
- Claude adapter: `.claude/skills/chief-of-staff/SKILL.md`
|
|
75
|
+
- Codex/AGENTS adapter, if present in that project: `.agents/skills/chief-of-staff/SKILL.md`
|
|
76
|
+
|
|
77
|
+
Update the Forge entry skill for the active adapter so stream intents route to
|
|
78
|
+
Chief before tier detection. Required intent examples:
|
|
79
|
+
|
|
80
|
+
- `show streams`
|
|
81
|
+
- `start stream`
|
|
82
|
+
- `pause stream`
|
|
83
|
+
- `resume stream`
|
|
84
|
+
- `delegate stream`
|
|
85
|
+
- `sync streams`
|
|
86
|
+
- `detect conflicts`
|
|
87
|
+
- `merge safe`
|
|
88
|
+
- `close stream`
|
|
89
|
+
- `Chief of Staff`
|
|
90
|
+
|
|
91
|
+
### 3. Preserve Runtime State
|
|
92
|
+
|
|
93
|
+
If `.forge/streams/` already exists, inspect it but never overwrite it. Runtime
|
|
94
|
+
stream files are user/project state, not framework templates. If a runtime file
|
|
95
|
+
is missing a field, add it only after showing the diff to the user.
|
|
96
|
+
|
|
97
|
+
### 4. Adopt Existing M10 Worktrees When Present
|
|
98
|
+
|
|
99
|
+
If `.forge/state/milestone-*.yml` contains `lifecycle.worktree_mode: active` or
|
|
100
|
+
`degraded`, adopt those M10 sessions as streams. Do not teardown, merge, rebase,
|
|
101
|
+
remove, or rename existing worktrees as part of migration.
|
|
102
|
+
|
|
103
|
+
For each active M10 worktree:
|
|
104
|
+
|
|
105
|
+
1. Read the milestone state and `git worktree list --porcelain`.
|
|
106
|
+
2. Create or update `.forge/streams/active.yml`.
|
|
107
|
+
3. Create or update:
|
|
108
|
+
- `.forge/streams/{stream-id}.yml`
|
|
109
|
+
- `.forge/streams/{stream-id}/brief.md`
|
|
110
|
+
- `.forge/streams/{stream-id}/packages/`
|
|
111
|
+
4. Map existing M10 fields into stream state:
|
|
112
|
+
- `lifecycle.worktree_path` -> `runtime.worktree`
|
|
113
|
+
- `lifecycle.worktree_branch` -> `runtime.branch`
|
|
114
|
+
- `lifecycle.session_id` / `claim_session_id` -> `runtime.worker_sessions`
|
|
115
|
+
- milestone id/name/status/phase -> stream goal, context, and brief
|
|
116
|
+
5. Leave ownership surfaces empty if unknown and mark them as needing
|
|
117
|
+
declaration. Missing ownership should surface as a conflict to resolve after
|
|
118
|
+
adoption; it should not block adoption.
|
|
119
|
+
6. Ask before setting `orchestration.auto: false` in `.forge/project.yml`.
|
|
120
|
+
Turning it off makes Chief/Streams the front door while keeping M10 available
|
|
121
|
+
as an optional backend.
|
|
122
|
+
|
|
123
|
+
Adoption is idempotent: if a stream already references the same worktree path or
|
|
124
|
+
branch, update that stream's summary/brief instead of creating a duplicate.
|
|
125
|
+
|
|
126
|
+
### 5. Compact Active Context When Needed
|
|
127
|
+
|
|
128
|
+
If `.forge/context.md` is over 12 KB and `.forge/context-archive.md` is missing:
|
|
129
|
+
|
|
130
|
+
1. Copy the original `.forge/context.md` to `.forge/context-archive.md`.
|
|
131
|
+
2. Keep current/open decisions, Deferred Ideas, Needs Resolution, and Amendment
|
|
132
|
+
Log in `.forge/context.md`.
|
|
133
|
+
3. Move completed historical milestone decision blocks into the archive.
|
|
134
|
+
4. Add a pointer in active context to `.forge/context-archive.md`.
|
|
135
|
+
|
|
136
|
+
This step must preserve decision text losslessly.
|
|
137
|
+
|
|
138
|
+
### 6. Confirm M10 Positioning
|
|
139
|
+
|
|
140
|
+
If the project has M10 installed, keep worktree and merge safety instructions.
|
|
141
|
+
Update wording so Chief/Streams is the user-facing orchestration model and M10
|
|
142
|
+
is an optional backend for worktree isolation, merge queue support, and optional
|
|
143
|
+
file claims.
|
|
144
|
+
|
|
145
|
+
## Validation
|
|
146
|
+
|
|
147
|
+
- Stream templates exist under `.forge/templates/streams/`.
|
|
148
|
+
- Chief skill exists in the active platform adapter.
|
|
149
|
+
- Forge routing mentions `chief-of-staff`, `show streams`, `start stream`, and
|
|
150
|
+
`merge safe`.
|
|
151
|
+
- `.forge/streams/` runtime state is unchanged unless the user approved a
|
|
152
|
+
specific migration of a runtime stream file.
|
|
153
|
+
- Existing active/degraded M10 worktrees, if any, are represented in
|
|
154
|
+
`.forge/streams/active.yml` and per-stream files without teardown.
|
|
155
|
+
- If context compaction ran, `.forge/context-archive.md` contains historical
|
|
156
|
+
decisions and `.forge/context.md` is under 12 KB.
|
|
157
|
+
- Running detection a second time is idempotent and prints no `MIGRATE` once the
|
|
158
|
+
project has templates, routing, Chief skill, compacted context, and adopted
|
|
159
|
+
active M10 worktrees.
|
|
@@ -1,29 +1,99 @@
|
|
|
1
1
|
# Forge Release Registry — version reservations across concurrent milestones
|
|
2
2
|
#
|
|
3
3
|
# PURPOSE: remove the version number + CHANGELOG slot from per-milestone scope so
|
|
4
|
-
# two milestones running in parallel sessions never collide on
|
|
4
|
+
# two milestones running in parallel sessions never collide on `package.json`
|
|
5
5
|
# version or pick the same number. This is the coordination point both sessions
|
|
6
6
|
# read and append to.
|
|
7
7
|
#
|
|
8
8
|
# COMMITTED + APPEND-ONLY. Each milestone appends exactly ONE entry when it
|
|
9
9
|
# reserves its version (at planning, or at delivery if planning predates this
|
|
10
10
|
# file). Appending — never editing prior entries — is what keeps two sessions
|
|
11
|
-
# from conflicting: distinct lines, no contention.
|
|
12
|
-
#
|
|
11
|
+
# from conflicting: distinct lines, no contention. The registry is committed and
|
|
12
|
+
# pushed so a parallel session pulls and sees reservations already taken.
|
|
13
13
|
#
|
|
14
14
|
# RULE: the next free version = highest `version:` in this file, bumped by the
|
|
15
|
-
# change's semver level (capability = minor; fix/doc = patch
|
|
16
|
-
#
|
|
15
|
+
# change's semver level (capability = minor 0.x.0; fix/doc = patch 0.x.y; see the
|
|
16
|
+
# version-bump criteria in FORGE.md / project memory). Delivery NEVER writes a
|
|
17
|
+
# `package.json` version that is not reserved here first.
|
|
17
18
|
#
|
|
18
19
|
# RACE NOTE: reserve EARLY (at planning), commit + push the reservation BEFORE
|
|
19
|
-
# editing
|
|
20
|
-
# push rebases onto the first (append-only → no conflict) and re-
|
|
21
|
-
# take the next number.
|
|
20
|
+
# editing package.json. If two sessions reserve near-simultaneously, the second
|
|
21
|
+
# push rebases onto the first (append-only → no conflict) and must re-read max()
|
|
22
|
+
# and take the next number.
|
|
22
23
|
|
|
23
|
-
releases:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
releases:
|
|
25
|
+
- milestone: 12
|
|
26
|
+
version: "0.21.0"
|
|
27
|
+
bump: minor
|
|
28
|
+
reserved_at: "2026-06-12"
|
|
29
|
+
summary: "CLAUDE.md @import extraction (framework prose → .forge/FORGE.md)"
|
|
30
|
+
- milestone: 13
|
|
31
|
+
version: "0.20.0"
|
|
32
|
+
bump: minor
|
|
33
|
+
reserved_at: "2026-06-12"
|
|
34
|
+
summary: "Nested phase layout (phases/milestone-{id}/{phase}-{name}/)"
|
|
35
|
+
- milestone: 14
|
|
36
|
+
version: "0.22.0"
|
|
37
|
+
bump: minor
|
|
38
|
+
reserved_at: "2026-06-13"
|
|
39
|
+
summary: "Refactor-backlog compaction migration + lifecycle (archive terminal items, size gate, status-vocab enforcement)"
|
|
40
|
+
- milestone: 10
|
|
41
|
+
version: "0.23.0"
|
|
42
|
+
bump: minor
|
|
43
|
+
reserved_at: "2026-06-14"
|
|
44
|
+
summary: "M10 auto-routing — forge routes Standard/Full through orchestrating when installed (install = consent); orchestration.auto opt-out"
|
|
45
|
+
- milestone: 15
|
|
46
|
+
version: "0.24.0"
|
|
47
|
+
bump: minor
|
|
48
|
+
reserved_at: "2026-06-14"
|
|
49
|
+
summary: "Disconfirm-before-commit rigor: debugging Confirmation Gate (blind-spot check), architecting Platform & Goal Validation + option-space framing, discussing widen-before-narrowing, CLAUDE.md principle 8"
|
|
50
|
+
- milestone: 16
|
|
51
|
+
version: "0.25.0"
|
|
52
|
+
bump: minor
|
|
53
|
+
reserved_at: "2026-06-14"
|
|
54
|
+
summary: "Worktree branch anchor in forge milestone selection — git branch deterministically selects the milestone (exact lifecycle.worktree_branch match, or milestone-id token in branch name) before the timestamp default; deferred/complete matches surface instead of auto-resuming"
|
|
55
|
+
- milestone: 16
|
|
56
|
+
version: "0.26.0"
|
|
57
|
+
bump: minor
|
|
58
|
+
reserved_at: "2026-06-14"
|
|
59
|
+
summary: "Milestone-anchored worktree naming in orchestrating — worktree dir + branch become forge/m-{id}-{session_id} (was forge/{uuid}), adds lifecycle.worktree_anchor. Makes the 0.25.0 branch-anchor id-token fallback work for orch worktrees so a moved/stale-state worktree still resolves to its milestone off the branch name alone; uuid suffix keeps collision-resistance, forge/ prefix keeps GC sweep"
|
|
60
|
+
- milestone: 17
|
|
61
|
+
version: "0.27.0"
|
|
62
|
+
bump: minor
|
|
63
|
+
reserved_at: "2026-06-15"
|
|
64
|
+
summary: "Human Verification Gate — hard block on milestone close + orchestration teardown until an explicit human sign-off is recorded as current.human_verified in milestone state. Code-level PASS is necessary but never sufficient to close. Captured by verifying (post-verdict prompt), enforced at reviewing-complete + orchestrating Step 5.0; recorded-override (method: override) is the only bypass and is surfaced. New current.human_verified state field — lazy migration: absent = prompt on next close, already-complete milestones never re-gated."
|
|
65
|
+
- milestone: 18
|
|
66
|
+
version: "0.28.0"
|
|
67
|
+
bump: minor
|
|
68
|
+
reserved_at: "2026-06-15"
|
|
69
|
+
summary: "Configurable repo-scoped worktree root — orchestration.worktree_root defaults to ../<repo-name>-worktrees/ (was shared ../forge-worktrees/). Fixes cross-repo worktree mixing when multiple repos share a parent dir, fixes cwd-sensitive resolution (relative roots now resolve against repo root, not shell cwd), and folds a gitignore-guard for repos with fully-ignored .claude/ trees (initializing writes correct carve-out for greenfield; upgrading detects + warns for brownfield)"
|
|
70
|
+
- milestone: 19
|
|
71
|
+
version: "0.29.0"
|
|
72
|
+
bump: minor
|
|
73
|
+
reserved_at: "2026-06-15"
|
|
74
|
+
summary: "Shared-state taxonomy for multi-worktree Forge — FORGE.md State Ownership expanded to enumerate all 5 file-sharing classes (single-owner mutable, derived, append-only shared, shared mutable, stable shared) with the rule each follows. Promotes 'do not touch another worktree's state files' to explicit rule. Adds structural rule for context.md + refactor-backlog.yml (write only to your milestone block, within-block append-only). New `forge` boot worktree-liveness view (lists live Forge worktrees + their owning milestones in main). Cross-tree write warnings in discussing (context.md) + reviewing (refactor-backlog.yml). Opt-in worktree-side rebase check at boot (gated by forge.worktree_rebase_check). Triggered by the canvaz 2026-06-15 case: main-session edits to m9's context block were invisible to the m9 worktree."
|
|
75
|
+
- milestone: 20
|
|
76
|
+
version: "0.30.0"
|
|
77
|
+
bump: minor
|
|
78
|
+
reserved_at: "2026-06-16"
|
|
79
|
+
summary: "Upstream desire-path feedback channel (ADR-012) — closes the capture→act loop in Principle 7. (1) Plan-anchor re-derivation guard already landed (commit 5ddf3a1): executing re-derives plan literals against HEAD before the first task; planning makes anchors drift-resistant. (2) `scope: project|framework` field added to the desire-path schema, set at capture by verifying/executing/planning (lazy migration: absent⇒project). (3) Single review owner = forge boot — retires verifying's duplicate 'Surface Recommendations', co-locates the type→evolution suggestion table, adds a decline-ledger (declined/) so declines stop re-nagging, adds a Quick-tier review trigger in quick-tasking. (4) Tiered upstream transport for scope:framework signals: always write a portable block to state/desire-paths/upstream/; offer `gh issue create` against forge.upstream_repo (default github.com/zayneupton/forge) when gh present; upgrading harvests upstream/ into {source}/docs/desire-paths-inbox/. Optional forge.upstream_repo added to project.yml. Triggered by the canvaz plan-anchor-drift signal that could only reach the framework via manual chat copy-paste."
|
|
80
|
+
- milestone: 15
|
|
81
|
+
version: "0.31.0"
|
|
82
|
+
bump: minor
|
|
83
|
+
reserved_at: "2026-06-17"
|
|
84
|
+
summary: "Data-driven migration detection — replaces hardcoded per-version detection blocks (SKILL Step 7 + bin detectLegacyLayouts) with a single loop over synced .forge/migrations/{v}-*.md guides, ranged (installed, source]. New uniform Detection-block contract: echo `MIGRATE` on stdout when the migration applies, silent/exit-0 for no-op. All 7 guides normalized to it (0.28.0 consolidated to one `## Detection`; 0.29.0 stays an explicit in-range no-op). Removes the staleness class entirely — a new guide is auto-covered the moment it ships in the template, zero per-version code, and the install-run blind spot is fixed (detection keys off freshly-synced guides + pre-bump installed version). Triggered by ptnrkit 0.19.2→0.30.0 upgrade where bin was 4 versions behind and 2 real on-disk migrations (0.20.0, 0.22.0) reported 'needs manual review: 0'."
|
|
85
|
+
- milestone: 16
|
|
86
|
+
version: "0.32.0"
|
|
87
|
+
bump: minor
|
|
88
|
+
reserved_at: "2026-06-18"
|
|
89
|
+
summary: "Project Chief / Streams orchestration — adds Project/Stream/Work Package runtime layers, Chief of Staff routing, stream/work-package templates, active context compaction, framework-wide size audit, and an idempotent migration guide. M10 is repositioned as an optional backend for worktree isolation, merge queue support, and experimental file claims."
|
|
90
|
+
|
|
91
|
+
# Note on the 15 / 0.24.0 ordering: reserved as max(0.23.0)+minor. origin/main was
|
|
92
|
+
# already at 0.23.0 when this shipped (M10/M12/M13/M14 all merged), so 0.24.0 is a
|
|
93
|
+
# clean increment — no publish-order coordination needed. (Earlier draft of this
|
|
94
|
+
# release was built on a stale 0.19.2 base before a fetch corrected it.)
|
|
95
|
+
|
|
96
|
+
# Note on the 12/13 ordering: both reserved 2026-06-12. M13 holds the lower number
|
|
97
|
+
# (0.20.0) and M12 the higher (0.21.0) by explicit user decision — they ship in the
|
|
98
|
+
# same package release, M12 topping the version. max() here is 0.21.0, so the next
|
|
99
|
+
# milestone reserves 0.22.0 (minor) regardless of which milestone id is higher.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Created during the discuss phase. This document is a contract between the user and all downstream agents.
|
|
4
4
|
|
|
5
|
+
Active context target: <= 12 KB. When completed historical milestone decision
|
|
6
|
+
blocks accumulate, copy them to `.forge/context-archive.md` and keep only
|
|
7
|
+
current/open decisions here.
|
|
8
|
+
|
|
5
9
|
**Rules:**
|
|
6
10
|
- **Locked Decisions** → MUST be implemented exactly as stated. No alternatives. No "better" solutions.
|
|
7
11
|
- **Deferred Ideas** → MUST NOT appear in plans, tasks, or code. Not even as TODOs.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Migration Guide Template
|
|
2
|
+
|
|
3
|
+
Copy to `.forge/migrations/{version}-{slug}.md` (e.g. `0.31.0-foo.md`) when a Forge
|
|
4
|
+
version changes an on-disk layout, a config field, or a state shape that older
|
|
5
|
+
projects need to migrate. Also mirror the file to `docs/migrations/{version}-{slug}.md`
|
|
6
|
+
(canonical) — the two copies must be byte-identical.
|
|
7
|
+
|
|
8
|
+
A guide written to this contract is **auto-covered** by the post-upgrade migration
|
|
9
|
+
check in BOTH routes (`upgrading` SKILL Step 7 and `npx forge-orkes upgrade`) the
|
|
10
|
+
moment it ships in the template. **You do not edit `upgrading/SKILL.md` or
|
|
11
|
+
`create-forge.js`** — they loop over the guides, so a conformant new guide just works.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## The Detection-block contract (load-bearing — read before writing the guide)
|
|
16
|
+
|
|
17
|
+
The data-driven migration loop in both routes finds each guide, decides whether it is
|
|
18
|
+
in range, and runs its Detection block. For that to work, every guide MUST follow this
|
|
19
|
+
contract:
|
|
20
|
+
|
|
21
|
+
1. **Exactly one `## Detection` heading per guide.** Not `### Detection`, not two of
|
|
22
|
+
them. If a guide has informational sub-checks (e.g. an inventory the user should see
|
|
23
|
+
but that does NOT trigger a migration), give them a different heading — only the one
|
|
24
|
+
`## Detection` block is run.
|
|
25
|
+
2. **Under it, exactly one fenced ` ```bash ` block.** It is run from the project root,
|
|
26
|
+
must tolerate absent files (`[ -f … ] || exit 0`, `2>/dev/null`), and must not depend
|
|
27
|
+
on the user's shell config. The loop runs it under `bash` explicitly — do not rely on
|
|
28
|
+
zsh-only or interactive features. (The Bash tool runs zsh; `$BASH_REMATCH` / `=~`
|
|
29
|
+
capture groups silently fail — avoid them.)
|
|
30
|
+
3. **Sentinel = `MIGRATE`.** The block echoes the literal token `MIGRATE` on stdout when
|
|
31
|
+
the migration applies. A trailing `— reason` after it is encouraged — it surfaces in
|
|
32
|
+
the prompt the user sees. When there is nothing to migrate (no-op guides included),
|
|
33
|
+
the block prints **no** `MIGRATE` token and exits 0.
|
|
34
|
+
4. **No-op guides still get the heading.** A documentation/skill-behavior-only change
|
|
35
|
+
(nothing on disk to migrate) keeps a `## Detection` heading with a bash block that
|
|
36
|
+
simply `exit 0`s, so the loop's heading-find stays uniform across all guides.
|
|
37
|
+
|
|
38
|
+
### Range gating (why you never touch the loop code)
|
|
39
|
+
|
|
40
|
+
The loop reads the project's **installed** version (`settings.json forge.version`, captured
|
|
41
|
+
BEFORE the upgrade stamps the new value) and the **source** version
|
|
42
|
+
(`packages/create-forge/package.json`). It runs only the guides where
|
|
43
|
+
`installed < {guide version} <= source`. So a guide ships, the next upgrade that crosses
|
|
44
|
+
its version runs it once, and after the version is stamped it falls out of range — no
|
|
45
|
+
ledger, no per-version code, no staleness. (It also closes the install-run blind spot:
|
|
46
|
+
detection keys off the freshly-synced guides on disk, not the skill's own pre-sync code.)
|
|
47
|
+
|
|
48
|
+
### Detection block skeleton (applies)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Detect the legacy shape; tolerate absent files; emit MIGRATE iff it applies.
|
|
52
|
+
F=.forge/some-file.yml
|
|
53
|
+
[ -f "$F" ] || exit 0
|
|
54
|
+
if grep -q 'legacy-marker' "$F"; then
|
|
55
|
+
echo "MIGRATE — <one-line reason the user will see>"
|
|
56
|
+
fi
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Detection block skeleton (no-op guide)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Documentation / skill-behavior change only — nothing on disk to migrate.
|
|
63
|
+
exit 0
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Guide skeleton
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
# Migration Guide: <Title> (Forge <version>)
|
|
72
|
+
|
|
73
|
+
Applies to <which projects>. <One-paragraph what-changed-and-why.>
|
|
74
|
+
|
|
75
|
+
## Prerequisites
|
|
76
|
+
|
|
77
|
+
1. <e.g. on the new version's framework files (run `npx forge-orkes upgrade` first)>
|
|
78
|
+
2. <e.g. working tree clean or changes committed — migration touches N files>
|
|
79
|
+
|
|
80
|
+
## Detection
|
|
81
|
+
|
|
82
|
+
<One sentence: prints `MIGRATE` when it applies; silent + exit 0 otherwise.>
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
<the single detection block per the contract above>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Migration steps
|
|
89
|
+
|
|
90
|
+
### 1. <step>
|
|
91
|
+
### 2. <step>
|
|
92
|
+
...
|
|
93
|
+
<The migration is NEVER auto-applied. In Claude Code it runs via the `quick-tasking`
|
|
94
|
+
skill, which the `upgrading` Step-7 prompt hands the guide to on "yes". Lossy steps
|
|
95
|
+
must be confirmed with the user.>
|
|
96
|
+
|
|
97
|
+
## Validation
|
|
98
|
+
|
|
99
|
+
<How to confirm the migration succeeded — greps, counts, conservation checks.>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Acceptance self-check before you ship the guide
|
|
105
|
+
|
|
106
|
+
- [ ] Exactly one `## Detection` heading; exactly one ` ```bash ` block under it.
|
|
107
|
+
- [ ] Block emits `MIGRATE` on stdout iff the migration applies; silent + exit 0 otherwise.
|
|
108
|
+
- [ ] Block is safe on a clean/empty project (no errors, exit 0).
|
|
109
|
+
- [ ] Any new accumulating artifact declares owner, size gate, archive/compaction rule, derived vs source-of-truth status, and future migration behavior.
|
|
110
|
+
- [ ] Mirrored byte-identical to `docs/migrations/{same-name}.md`.
|
|
111
|
+
- [ ] No edit to `upgrading/SKILL.md` or `create-forge.js` was needed (the loop covers it).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Forge Streams — Active Project Map
|
|
2
|
+
# Size gate: keep this file <= 20 KB. It is the Project Chief's default context.
|
|
3
|
+
# Store summaries only. Deep stream history belongs in streams/{stream}/.
|
|
4
|
+
|
|
5
|
+
version: 1
|
|
6
|
+
updated_at: null
|
|
7
|
+
|
|
8
|
+
project_chief:
|
|
9
|
+
current_stream: null
|
|
10
|
+
merge_policy: "chief-owned"
|
|
11
|
+
notes: ""
|
|
12
|
+
|
|
13
|
+
streams:
|
|
14
|
+
# - id: "billing-retries"
|
|
15
|
+
# status: active # draft | active | paused | delegated | blocked | ready | merged | closed
|
|
16
|
+
# goal: "Fix checkout retry handling"
|
|
17
|
+
# branch: "forge/stream-billing-retries"
|
|
18
|
+
# worktree: "../app-worktrees/billing-retries"
|
|
19
|
+
# owner: "" # session/thread/user label
|
|
20
|
+
# owned_surfaces:
|
|
21
|
+
# - "src/billing/**"
|
|
22
|
+
# shared_surfaces:
|
|
23
|
+
# - "src/lib/events.ts"
|
|
24
|
+
# risk: medium # low | medium | high | unknown
|
|
25
|
+
# blocked_by: []
|
|
26
|
+
# next_action: "Review event contract before editing shared surface"
|
|
27
|
+
# last_sync: null
|
|
28
|
+
[]
|
|
29
|
+
|
|
30
|
+
merge_queue:
|
|
31
|
+
# - stream: "billing-retries"
|
|
32
|
+
# status: waiting # waiting | merging | blocked | merged
|
|
33
|
+
# reason: "shared event contract pending"
|
|
34
|
+
[]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Stream Brief: {stream}
|
|
2
|
+
|
|
3
|
+
Size gate: keep this brief <= 8 KB. It is the first file loaded when resuming a stream.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
{One sentence describing the line of work.}
|
|
8
|
+
|
|
9
|
+
## Current State
|
|
10
|
+
|
|
11
|
+
Status: draft | active | paused | delegated | blocked | ready | merged | closed
|
|
12
|
+
|
|
13
|
+
{What is true right now? Include whether code has changed, whether workers are active, and whether merge is safe.}
|
|
14
|
+
|
|
15
|
+
## Ownership
|
|
16
|
+
|
|
17
|
+
Owned surfaces:
|
|
18
|
+
- {paths/modules this stream may edit}
|
|
19
|
+
|
|
20
|
+
Shared surfaces:
|
|
21
|
+
- {paths/modules requiring contract or Project Chief approval}
|
|
22
|
+
|
|
23
|
+
Read-only surfaces:
|
|
24
|
+
- {paths/modules this stream may inspect but not edit}
|
|
25
|
+
|
|
26
|
+
Forbidden surfaces:
|
|
27
|
+
- {paths/modules this stream must not touch}
|
|
28
|
+
|
|
29
|
+
## Decisions
|
|
30
|
+
|
|
31
|
+
- {Locked decisions that apply to this stream}
|
|
32
|
+
|
|
33
|
+
## Findings
|
|
34
|
+
|
|
35
|
+
- {Recent findings needed to resume without chat history}
|
|
36
|
+
|
|
37
|
+
## Work Packages
|
|
38
|
+
|
|
39
|
+
- {WP-id}: {status} — {short goal}
|
|
40
|
+
|
|
41
|
+
## Blockers
|
|
42
|
+
|
|
43
|
+
- {blocker or "none"}
|
|
44
|
+
|
|
45
|
+
## Next Action
|
|
46
|
+
|
|
47
|
+
{The next concrete action for the stream chief or worker.}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Forge Stream State
|
|
2
|
+
# Copy to .forge/streams/{stream}.yml.
|
|
3
|
+
# Size gate: keep per-stream state <= 15 KB. Put narrative in brief.md or findings.md.
|
|
4
|
+
|
|
5
|
+
version: 1
|
|
6
|
+
|
|
7
|
+
stream:
|
|
8
|
+
id: ""
|
|
9
|
+
goal: ""
|
|
10
|
+
status: draft # draft | active | paused | delegated | blocked | ready | merged | closed
|
|
11
|
+
tier: null # quick | standard | full | null until known
|
|
12
|
+
created_at: null
|
|
13
|
+
updated_at: null
|
|
14
|
+
owner: ""
|
|
15
|
+
|
|
16
|
+
runtime:
|
|
17
|
+
branch: ""
|
|
18
|
+
worktree: ""
|
|
19
|
+
chief_session: ""
|
|
20
|
+
worker_sessions: []
|
|
21
|
+
|
|
22
|
+
ownership:
|
|
23
|
+
owned_surfaces: []
|
|
24
|
+
shared_surfaces: []
|
|
25
|
+
read_only_surfaces: []
|
|
26
|
+
forbidden_surfaces: []
|
|
27
|
+
reservations:
|
|
28
|
+
# - surface: "src/lib/events.ts"
|
|
29
|
+
# reason: "Event contract update"
|
|
30
|
+
# status: proposed # proposed | approved | blocked | released
|
|
31
|
+
[]
|
|
32
|
+
|
|
33
|
+
dependencies:
|
|
34
|
+
blocked_by_streams: []
|
|
35
|
+
blocks_streams: []
|
|
36
|
+
contracts: []
|
|
37
|
+
|
|
38
|
+
context:
|
|
39
|
+
brief: ".forge/streams/{stream}/brief.md"
|
|
40
|
+
findings: ".forge/streams/{stream}/findings.md"
|
|
41
|
+
packages_dir: ".forge/streams/{stream}/packages"
|
|
42
|
+
|
|
43
|
+
blockers:
|
|
44
|
+
# - type: decision | conflict | external | human-action
|
|
45
|
+
# summary: ""
|
|
46
|
+
# since: null
|
|
47
|
+
# resolution: ""
|
|
48
|
+
[]
|
|
49
|
+
|
|
50
|
+
merge:
|
|
51
|
+
readiness: not_ready # not_ready | ready | blocked | merged
|
|
52
|
+
risk: unknown # low | medium | high | unknown
|
|
53
|
+
required_checks: []
|
|
54
|
+
notes: ""
|
|
55
|
+
|
|
56
|
+
next_action: ""
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Forge Work Package Template
|
|
2
|
+
# Bounded delegated work for a single stream.
|
|
3
|
+
# Copy to: .forge/streams/{stream}/packages/{id}.yml
|
|
4
|
+
|
|
5
|
+
package:
|
|
6
|
+
id: "{package-id}"
|
|
7
|
+
stream: "{stream-id}"
|
|
8
|
+
title: ""
|
|
9
|
+
status: draft # draft | assigned | active | blocked | ready | returned | closed
|
|
10
|
+
created_at: "{ISO-8601}"
|
|
11
|
+
updated_at: "{ISO-8601}"
|
|
12
|
+
owner: "" # worker session, person, or agent label
|
|
13
|
+
reports_to: "chief-of-staff" # Project Chief or stream chief
|
|
14
|
+
|
|
15
|
+
goal:
|
|
16
|
+
summary: ""
|
|
17
|
+
observable_outcome: ""
|
|
18
|
+
non_goals: []
|
|
19
|
+
|
|
20
|
+
scope:
|
|
21
|
+
owns:
|
|
22
|
+
# Files, dirs, modules, routes, or contracts this worker may edit.
|
|
23
|
+
- ""
|
|
24
|
+
may_read:
|
|
25
|
+
# Context surfaces the worker may inspect but should not edit.
|
|
26
|
+
- ""
|
|
27
|
+
shared_surfaces:
|
|
28
|
+
# APIs, schemas, data contracts, docs, or config shared with other streams.
|
|
29
|
+
- surface: ""
|
|
30
|
+
contract_owner: ""
|
|
31
|
+
rule: "report changes before editing"
|
|
32
|
+
must_not_touch:
|
|
33
|
+
# Explicit exclusions. Any need to edit these returns to the Chief.
|
|
34
|
+
- ""
|
|
35
|
+
|
|
36
|
+
dependencies:
|
|
37
|
+
blocked_by: []
|
|
38
|
+
provides_to: []
|
|
39
|
+
contracts_required: []
|
|
40
|
+
|
|
41
|
+
verify:
|
|
42
|
+
commands:
|
|
43
|
+
# - cmd: "npm test -- ..."
|
|
44
|
+
# advisory: false
|
|
45
|
+
manual_checks: []
|
|
46
|
+
evidence_required: []
|
|
47
|
+
|
|
48
|
+
stop_conditions:
|
|
49
|
+
- "Need to edit must_not_touch or undeclared shared surface"
|
|
50
|
+
- "Find conflicting ownership with another stream"
|
|
51
|
+
- "Contract is missing, ambiguous, or contradicted by implementation"
|
|
52
|
+
- "Task scope expands beyond the package goal"
|
|
53
|
+
- "Verification cannot be run or fails for reasons outside package scope"
|
|
54
|
+
|
|
55
|
+
deliverables:
|
|
56
|
+
- "Changed files or commits"
|
|
57
|
+
- "Verification evidence"
|
|
58
|
+
- "Decision notes or conflicts found"
|
|
59
|
+
- "Recommended next action"
|
|
60
|
+
|
|
61
|
+
handoff:
|
|
62
|
+
instructions: ""
|
|
63
|
+
report_back:
|
|
64
|
+
to: "chief-of-staff"
|
|
65
|
+
include:
|
|
66
|
+
- "what changed"
|
|
67
|
+
- "what was verified"
|
|
68
|
+
- "conflicts or scope expansion"
|
|
69
|
+
- "open risks"
|
|
70
|
+
- "next action"
|