cleargate 0.8.1 → 0.10.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/CHANGELOG.md +190 -0
- package/README.md +11 -0
- package/dist/MANIFEST.json +259 -28
- package/dist/{chunk-OM4FAEA7.js → chunk-Q3BTSXCK.js} +69 -3
- package/dist/chunk-Q3BTSXCK.js.map +1 -0
- package/dist/cli.cjs +2621 -548
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2548 -560
- package/dist/cli.js.map +1 -1
- package/dist/lib/ledger.cjs +120 -0
- package/dist/lib/ledger.cjs.map +1 -0
- package/dist/lib/ledger.d.cts +64 -0
- package/dist/lib/ledger.d.ts +64 -0
- package/dist/lib/ledger.js +96 -0
- package/dist/lib/ledger.js.map +1 -0
- package/dist/templates/cleargate-planning/.claude/agents/architect.md +10 -8
- package/dist/templates/cleargate-planning/.claude/agents/cleargate-wiki-contradict.md +108 -0
- package/dist/templates/cleargate-planning/.claude/agents/cleargate-wiki-ingest.md +49 -3
- package/dist/templates/cleargate-planning/.claude/agents/cleargate-wiki-lint.md +6 -1
- package/dist/templates/cleargate-planning/.claude/agents/developer.md +29 -2
- package/dist/templates/cleargate-planning/.claude/agents/qa.md +50 -1
- package/dist/templates/cleargate-planning/.claude/agents/reporter.md +31 -9
- package/dist/templates/cleargate-planning/.claude/hooks/pre-tool-use-task.sh +148 -0
- package/dist/templates/cleargate-planning/.claude/hooks/session-start.sh +6 -0
- package/dist/templates/cleargate-planning/.claude/hooks/token-ledger.sh +314 -96
- package/dist/templates/cleargate-planning/.claude/settings.json +4 -0
- package/dist/templates/cleargate-planning/.claude/skills/sprint-execution/SKILL.md +473 -0
- package/dist/templates/cleargate-planning/.cleargate/config.example.yml +19 -0
- package/dist/templates/cleargate-planning/.cleargate/knowledge/cleargate-enforcement.md +542 -0
- package/dist/templates/cleargate-planning/.cleargate/knowledge/cleargate-protocol.md +102 -428
- package/dist/templates/cleargate-planning/.cleargate/knowledge/readiness-gates.md +31 -0
- package/dist/templates/cleargate-planning/.cleargate/knowledge/sprint-closeout-checklist.md +71 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/assert_story_files.mjs +24 -2
- package/dist/templates/cleargate-planning/.cleargate/scripts/close_sprint.mjs +387 -27
- package/dist/templates/cleargate-planning/.cleargate/scripts/dedupe_frontmatter.mjs +219 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/lib/report-filename.mjs +54 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/prep_doc_refresh.mjs +378 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/prep_qa_context.mjs +888 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/sprint_trends.mjs +71 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/suggest_improvements.mjs +355 -13
- package/dist/templates/cleargate-planning/.cleargate/scripts/test/test_flashcard_gate.sh +20 -20
- package/dist/templates/cleargate-planning/.cleargate/scripts/test/test_prep_qa_context.sh +482 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/write_dispatch.sh +125 -0
- package/dist/templates/cleargate-planning/.cleargate/templates/Bug.md +33 -10
- package/dist/templates/cleargate-planning/.cleargate/templates/CR.md +41 -10
- package/dist/templates/cleargate-planning/.cleargate/templates/Sprint Plan Template.md +48 -14
- package/dist/templates/cleargate-planning/.cleargate/templates/epic.md +46 -12
- package/dist/templates/cleargate-planning/.cleargate/templates/hotfix.md +51 -1
- package/dist/templates/cleargate-planning/.cleargate/templates/initiative.md +98 -29
- package/dist/templates/cleargate-planning/.cleargate/templates/proposal.md +26 -13
- package/dist/templates/cleargate-planning/.cleargate/templates/sprint_report.md +23 -4
- package/dist/templates/cleargate-planning/.cleargate/templates/story.md +64 -12
- package/dist/templates/cleargate-planning/CLAUDE.md +28 -10
- package/dist/templates/cleargate-planning/MANIFEST.json +259 -28
- package/dist/{whoami-CX7CXJD5.js → whoami-W4U6DPVG.js} +17 -17
- package/dist/whoami-W4U6DPVG.js.map +1 -0
- package/package.json +13 -2
- package/templates/cleargate-planning/.claude/agents/architect.md +10 -8
- package/templates/cleargate-planning/.claude/agents/cleargate-wiki-contradict.md +108 -0
- package/templates/cleargate-planning/.claude/agents/cleargate-wiki-ingest.md +49 -3
- package/templates/cleargate-planning/.claude/agents/cleargate-wiki-lint.md +6 -1
- package/templates/cleargate-planning/.claude/agents/developer.md +29 -2
- package/templates/cleargate-planning/.claude/agents/qa.md +50 -1
- package/templates/cleargate-planning/.claude/agents/reporter.md +31 -9
- package/templates/cleargate-planning/.claude/hooks/pre-tool-use-task.sh +148 -0
- package/templates/cleargate-planning/.claude/hooks/session-start.sh +6 -0
- package/templates/cleargate-planning/.claude/hooks/token-ledger.sh +314 -96
- package/templates/cleargate-planning/.claude/settings.json +4 -0
- package/templates/cleargate-planning/.claude/skills/sprint-execution/SKILL.md +473 -0
- package/templates/cleargate-planning/.cleargate/config.example.yml +19 -0
- package/templates/cleargate-planning/.cleargate/knowledge/cleargate-enforcement.md +542 -0
- package/templates/cleargate-planning/.cleargate/knowledge/cleargate-protocol.md +102 -428
- package/templates/cleargate-planning/.cleargate/knowledge/readiness-gates.md +31 -0
- package/templates/cleargate-planning/.cleargate/knowledge/sprint-closeout-checklist.md +71 -0
- package/templates/cleargate-planning/.cleargate/scripts/assert_story_files.mjs +24 -2
- package/templates/cleargate-planning/.cleargate/scripts/close_sprint.mjs +387 -27
- package/templates/cleargate-planning/.cleargate/scripts/dedupe_frontmatter.mjs +219 -0
- package/templates/cleargate-planning/.cleargate/scripts/lib/report-filename.mjs +54 -0
- package/templates/cleargate-planning/.cleargate/scripts/prep_doc_refresh.mjs +378 -0
- package/templates/cleargate-planning/.cleargate/scripts/prep_qa_context.mjs +888 -0
- package/templates/cleargate-planning/.cleargate/scripts/sprint_trends.mjs +71 -0
- package/templates/cleargate-planning/.cleargate/scripts/suggest_improvements.mjs +355 -13
- package/templates/cleargate-planning/.cleargate/scripts/test/test_flashcard_gate.sh +20 -20
- package/templates/cleargate-planning/.cleargate/scripts/test/test_prep_qa_context.sh +482 -0
- package/templates/cleargate-planning/.cleargate/scripts/write_dispatch.sh +125 -0
- package/templates/cleargate-planning/.cleargate/templates/Bug.md +33 -10
- package/templates/cleargate-planning/.cleargate/templates/CR.md +41 -10
- package/templates/cleargate-planning/.cleargate/templates/Sprint Plan Template.md +48 -14
- package/templates/cleargate-planning/.cleargate/templates/epic.md +46 -12
- package/templates/cleargate-planning/.cleargate/templates/hotfix.md +51 -1
- package/templates/cleargate-planning/.cleargate/templates/initiative.md +98 -29
- package/templates/cleargate-planning/.cleargate/templates/sprint_report.md +23 -4
- package/templates/cleargate-planning/.cleargate/templates/story.md +64 -12
- package/templates/cleargate-planning/CLAUDE.md +28 -10
- package/templates/cleargate-planning/MANIFEST.json +259 -28
- package/dist/chunk-OM4FAEA7.js.map +0 -1
- package/dist/whoami-CX7CXJD5.js.map +0 -1
- package/templates/cleargate-planning/.cleargate/templates/proposal.md +0 -61
|
@@ -70,6 +70,12 @@ The asymmetry exists because Proposal documents are human-authored strategy arti
|
|
|
70
70
|
check: "section(4) has ≥1 listed-item"
|
|
71
71
|
- id: interrogation-resolved
|
|
72
72
|
check: "body does not contain 'Unresolved'"
|
|
73
|
+
- id: discovery-checked
|
|
74
|
+
check: "frontmatter(.).context_source != null"
|
|
75
|
+
- id: reuse-audit-recorded
|
|
76
|
+
check: "body contains '## Existing Surfaces'"
|
|
77
|
+
- id: simplest-form-justified
|
|
78
|
+
check: "body contains '## Why not simpler?'"
|
|
73
79
|
```
|
|
74
80
|
|
|
75
81
|
```yaml
|
|
@@ -87,6 +93,8 @@ The asymmetry exists because Proposal documents are human-authored strategy arti
|
|
|
87
93
|
check: "body does not contain marker 'TBD'"
|
|
88
94
|
- id: interrogation-resolved
|
|
89
95
|
check: "body does not contain 'Unresolved'"
|
|
96
|
+
- id: discovery-checked
|
|
97
|
+
check: "frontmatter(.).context_source != null"
|
|
90
98
|
```
|
|
91
99
|
|
|
92
100
|
```yaml
|
|
@@ -104,6 +112,12 @@ The asymmetry exists because Proposal documents are human-authored strategy arti
|
|
|
104
112
|
check: "section(4) has ≥1 listed-item"
|
|
105
113
|
- id: gherkin-present
|
|
106
114
|
check: "body contains 'Scenario:'"
|
|
115
|
+
- id: discovery-checked
|
|
116
|
+
check: "frontmatter(.).context_source != null"
|
|
117
|
+
- id: reuse-audit-recorded
|
|
118
|
+
check: "body contains '## Existing Surfaces'"
|
|
119
|
+
- id: simplest-form-justified
|
|
120
|
+
check: "body contains '## Why not simpler?'"
|
|
107
121
|
```
|
|
108
122
|
|
|
109
123
|
```yaml
|
|
@@ -117,6 +131,10 @@ The asymmetry exists because Proposal documents are human-authored strategy arti
|
|
|
117
131
|
check: "body does not contain marker 'TBD'"
|
|
118
132
|
- id: sandbox-paths-declared
|
|
119
133
|
check: "section(2) has ≥1 listed-item"
|
|
134
|
+
- id: discovery-checked
|
|
135
|
+
check: "frontmatter(.).context_source != null"
|
|
136
|
+
- id: reuse-audit-recorded
|
|
137
|
+
check: "body contains '## Existing Surfaces'"
|
|
120
138
|
```
|
|
121
139
|
|
|
122
140
|
```yaml
|
|
@@ -130,4 +148,17 @@ The asymmetry exists because Proposal documents are human-authored strategy arti
|
|
|
130
148
|
check: "frontmatter(.).severity != null"
|
|
131
149
|
- id: no-tbds
|
|
132
150
|
check: "body does not contain marker 'TBD'"
|
|
151
|
+
- id: discovery-checked
|
|
152
|
+
check: "frontmatter(.).context_source != null"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
- work_item_type: sprint
|
|
157
|
+
transition: ready-for-execution
|
|
158
|
+
severity: enforcing
|
|
159
|
+
criteria:
|
|
160
|
+
- id: risk-table-populated
|
|
161
|
+
check: "body contains '| Mitigation'"
|
|
162
|
+
- id: discovery-checked
|
|
163
|
+
check: "frontmatter(.).context_source != null"
|
|
133
164
|
```
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Sprint Closeout Doc & Metadata Refresh Checklist
|
|
2
|
+
|
|
3
|
+
> Read at sprint close (Gate 4 ack). Each item names a surface that may need
|
|
4
|
+
> updating based on what shipped this sprint. Trigger conditions tell you when
|
|
5
|
+
> review is required vs when the surface can be skipped.
|
|
6
|
+
>
|
|
7
|
+
> Use `node .cleargate/scripts/prep_doc_refresh.mjs <sprint-id>` to generate
|
|
8
|
+
> a per-sprint tailored checklist that pre-checks items based on actual
|
|
9
|
+
> changed files in the sprint window.
|
|
10
|
+
|
|
11
|
+
### 1. Project READMEs
|
|
12
|
+
| Surface | Trigger condition |
|
|
13
|
+
|---|---|
|
|
14
|
+
| `README.md` | Any feature shipped that changes user-visible product behavior |
|
|
15
|
+
| `cleargate-cli/README.md` | Any change to `cleargate-cli/src/commands/*.ts` |
|
|
16
|
+
| `cleargate-planning/README.md` | Any change under `cleargate-planning/` |
|
|
17
|
+
| `mcp/README.md` | Any change under `mcp/src/` (note: nested repo; check separately) |
|
|
18
|
+
| `admin/README.md` | Any change under `admin/` (currently stub) |
|
|
19
|
+
|
|
20
|
+
### 2. CHANGELOG files (Common-Changelog format per STORY-016-03)
|
|
21
|
+
| Surface | Trigger condition |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `cleargate-cli/CHANGELOG.md` | Any user-visible change in `cleargate-cli/` (CLI surface, error messages, package contents) |
|
|
24
|
+
| `mcp/CHANGELOG.md` | Any user-visible change in `mcp/` (if file exists) |
|
|
25
|
+
|
|
26
|
+
### 3. Manifest / package metadata
|
|
27
|
+
| Surface | Trigger condition |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `cleargate-planning/MANIFEST.json` | Any change to `.claude/agents/*.md`, `.cleargate/templates/*`, `.cleargate/knowledge/*`, or `.cleargate/scripts/*`. Run `cleargate doctor` to verify scaffold registry. |
|
|
30
|
+
| `cleargate-cli/package.json` | Version bump only if releasing this sprint (release lane is separate from sprint close) |
|
|
31
|
+
| `mcp/package.json` | Version bump only if releasing this sprint |
|
|
32
|
+
|
|
33
|
+
### 4. CLAUDE.md "Active state" subsection
|
|
34
|
+
| Surface | Trigger condition |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `CLAUDE.md` lines containing "Active state (as of YYYY-MM-DD)" | Any EPIC / CR / Bug / Hotfix archived this sprint, OR any stack version bumped |
|
|
37
|
+
| `cleargate-planning/CLAUDE.md` mirror | Same edit as live (CLEARGATE-tag-block region only — outside-block diverges intentionally) |
|
|
38
|
+
|
|
39
|
+
### 5. Wiki surfaces (auto-rebuilt by PostToolUse hooks; verify after close)
|
|
40
|
+
| Surface | Verify by |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `.cleargate/wiki/active-sprint.md` | Read top of file; confirm sprint ID, status, and date are current |
|
|
43
|
+
| `.cleargate/wiki/index.md` | Read; confirm new artifacts (epics, stories, CRs) appear in the relevant sections |
|
|
44
|
+
| `.cleargate/wiki/product-state.md` | Read; confirm shipped capabilities are listed |
|
|
45
|
+
| `.cleargate/wiki/roadmap.md` | Read; confirm closed sprint moved from Active to Completed section |
|
|
46
|
+
|
|
47
|
+
### 6. INDEX surfaces (manual updates)
|
|
48
|
+
| Surface | Trigger condition |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `.cleargate/INDEX.md` | If maintained as a curated roadmap; update when sprint closes |
|
|
51
|
+
| `.cleargate/delivery/INDEX.md` | Update epic/sprint map when new artifacts archived |
|
|
52
|
+
|
|
53
|
+
### 7. Frontmatter version stamps
|
|
54
|
+
| Surface | Action |
|
|
55
|
+
|---|---|
|
|
56
|
+
| Any `.cleargate/templates/*.md` modified this sprint | Run `cleargate stamp <path>` to bump `updated_at_version` |
|
|
57
|
+
| `.cleargate/knowledge/cleargate-protocol.md` (post-EPIC-024 slim) | Same |
|
|
58
|
+
| `.cleargate/knowledge/cleargate-enforcement.md` (post-EPIC-024 split) | Same |
|
|
59
|
+
| Any other `.cleargate/knowledge/*.md` modified | Same |
|
|
60
|
+
|
|
61
|
+
### 8. Knowledge doc cross-references
|
|
62
|
+
| Surface | Action |
|
|
63
|
+
|---|---|
|
|
64
|
+
| Any knowledge doc that cites `§N` of protocol or enforcement.md | Verify post-rewrite resolution still works (covered for SPRINT-17 specifically by STORY-024-02; revisit if any future § reorganization happens) |
|
|
65
|
+
|
|
66
|
+
### 9. Mirror parity audit
|
|
67
|
+
| Surface | Action |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `cleargate-planning/.claude/` | `diff -r .claude/agents/ cleargate-planning/.claude/agents/` empty (excluding skills/ flashcards/, hooks/, settings.json which differ intentionally) |
|
|
70
|
+
| `cleargate-planning/.cleargate/templates/` | `diff -r .cleargate/templates/ cleargate-planning/.cleargate/templates/` empty |
|
|
71
|
+
| `cleargate-planning/.cleargate/knowledge/` | `diff -r .cleargate/knowledge/ cleargate-planning/.cleargate/knowledge/` empty |
|
|
@@ -71,7 +71,7 @@ function extractDeliverablesSection(content) {
|
|
|
71
71
|
*
|
|
72
72
|
* STORY before CR/BUG/EPIC/HOTFIX, PROPOSAL before PROP — BUG-010 longest-first rule.
|
|
73
73
|
*/
|
|
74
|
-
function extractWorkItemIds(text) {
|
|
74
|
+
export function extractWorkItemIds(text) {
|
|
75
75
|
const re = /(STORY-\d+-\d+|(CR|BUG|EPIC|HOTFIX)-\d+|(PROPOSAL|PROP)-\d+)/g;
|
|
76
76
|
const raw = [];
|
|
77
77
|
let m;
|
|
@@ -87,7 +87,7 @@ function extractWorkItemIds(text) {
|
|
|
87
87
|
* Check whether pending-sync OR archive contains a file matching <ID>_*.md
|
|
88
88
|
* Returns the matching absolute path or null.
|
|
89
89
|
*/
|
|
90
|
-
function findWorkItemFile(repoRoot, workItemId) {
|
|
90
|
+
export function findWorkItemFile(repoRoot, workItemId) {
|
|
91
91
|
const searchDirs = [
|
|
92
92
|
path.join(repoRoot, '.cleargate', 'delivery', 'pending-sync'),
|
|
93
93
|
path.join(repoRoot, '.cleargate', 'delivery', 'archive'),
|
|
@@ -207,6 +207,28 @@ function main() {
|
|
|
207
207
|
|
|
208
208
|
const sprintFilePath = path.resolve(args[0]);
|
|
209
209
|
|
|
210
|
+
// CR-027: --emit-json flag — extract work-item IDs and print JSON to stdout.
|
|
211
|
+
// Used by sprint.ts checkPerItemReadinessGates (path-a shell-out protocol).
|
|
212
|
+
// When this flag is present, skip the file-presence/approval triage and exit 0.
|
|
213
|
+
if (args.includes('--emit-json')) {
|
|
214
|
+
let content;
|
|
215
|
+
try {
|
|
216
|
+
content = fs.readFileSync(sprintFilePath, 'utf8');
|
|
217
|
+
} catch (err) {
|
|
218
|
+
process.stderr.write(`Error: cannot read sprint file: ${err.message}\n`);
|
|
219
|
+
process.exit(2);
|
|
220
|
+
}
|
|
221
|
+
const section = extractDeliverablesSection(content);
|
|
222
|
+
if (section === null) {
|
|
223
|
+
// No §1 section found — emit empty list (not an error for this flag)
|
|
224
|
+
process.stdout.write(JSON.stringify({ workItemIds: [] }) + '\n');
|
|
225
|
+
process.exit(0);
|
|
226
|
+
}
|
|
227
|
+
const workItemIds = extractWorkItemIds(section);
|
|
228
|
+
process.stdout.write(JSON.stringify({ workItemIds }) + '\n');
|
|
229
|
+
process.exit(0);
|
|
230
|
+
}
|
|
231
|
+
|
|
210
232
|
// Allow test-isolation override of execution_mode
|
|
211
233
|
const execMode = process.env.CLEARGATE_EXEC_MODE ?? 'v2';
|
|
212
234
|
|