peaks-cli 1.0.19 → 1.0.20

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.
@@ -8,6 +8,8 @@ export type ArtifactPrerequisite = {
8
8
  relativePath: string;
9
9
  /** Human-readable description of what this artifact represents. */
10
10
  description: string;
11
+ /** Optional content markers — when set, the file must contain ALL of these (case-insensitive substring). */
12
+ mustContain?: ReadonlyArray<string>;
11
13
  };
12
14
  export type PrerequisiteCheckResult = {
13
15
  ok: boolean;
@@ -1,4 +1,5 @@
1
1
  import { join } from 'node:path';
2
+ import { readFile } from 'node:fs/promises';
2
3
  import { pathExists } from '../../shared/fs.js';
3
4
  export const VALID_REQUEST_TYPES = [
4
5
  'feature',
@@ -21,7 +22,16 @@ const TEST_CASES = { relativePath: 'qa/test-cases/<rid>.md', description: 'Gener
21
22
  const TEST_REPORT = { relativePath: 'qa/test-reports/<rid>.md', description: 'Test execution report with actual pass/fail/coverage results' };
22
23
  const SECURITY_FINDINGS = { relativePath: 'qa/security-findings.md', description: 'Security test findings (record "no findings" inside if truly clean)' };
23
24
  const PERFORMANCE_FINDINGS = { relativePath: 'qa/performance-findings.md', description: 'Performance test findings (record baseline/after numbers or explicit "not applicable" rationale)' };
25
+ // PRD content prereq: ensures the PRD artifact has actual scope/acceptance content
26
+ // before handoff to RD/UI/QA. The SKILL says "Handoff to RD/UI/QA is blocked while
27
+ // the artifact is missing or in `draft` state" — this gives that claim a CLI gate.
28
+ const PRD_CONTENT = {
29
+ relativePath: 'prd/requests/<rid>.md',
30
+ description: 'PRD artifact must contain Goal and Acceptance criteria sections before handoff',
31
+ mustContain: ['## Goals', '## Acceptance']
32
+ };
24
33
  const FEATURE_TABLE = {
34
+ 'prd:handed-off': [PRD_CONTENT],
25
35
  'rd:implemented': [TECH_DOC],
26
36
  'rd:qa-handoff': [TECH_DOC, CODE_REVIEW, SECURITY_REVIEW],
27
37
  'qa:running': [TEST_CASES],
@@ -30,6 +40,7 @@ const FEATURE_TABLE = {
30
40
  // Bugfix: lighter planning artifact (bug-analysis instead of tech-doc), still requires code review + security review + regression test.
31
41
  // Performance findings not mandatory for non-perf bugs (use --allow-incomplete --reason if a perf bug requires it).
32
42
  const BUGFIX_TABLE = {
43
+ 'prd:handed-off': [PRD_CONTENT],
33
44
  'rd:implemented': [BUG_ANALYSIS],
34
45
  'rd:qa-handoff': [BUG_ANALYSIS, CODE_REVIEW, SECURITY_REVIEW],
35
46
  'qa:running': [TEST_CASES],
@@ -41,6 +52,7 @@ const REFACTOR_TABLE = FEATURE_TABLE;
41
52
  const NO_GATES = {};
42
53
  // Config: security review is the only mandatory check (config changes can break auth, CORS, CSP, secrets handling).
43
54
  const CONFIG_TABLE = {
55
+ 'prd:handed-off': [PRD_CONTENT],
44
56
  'rd:qa-handoff': [SECURITY_REVIEW],
45
57
  'qa:verdict-issued': [SECURITY_FINDINGS]
46
58
  };
@@ -71,6 +83,18 @@ export async function checkPrerequisites(options) {
71
83
  const absolute = join(sessionRoot, relative);
72
84
  if (!(await pathExists(absolute))) {
73
85
  missing.push({ path: relative, description: prerequisite.description });
86
+ continue;
87
+ }
88
+ if (prerequisite.mustContain && prerequisite.mustContain.length > 0) {
89
+ const body = await readFile(absolute, 'utf8');
90
+ const lowered = body.toLowerCase();
91
+ const missingMarkers = prerequisite.mustContain.filter((marker) => !lowered.includes(marker.toLowerCase()));
92
+ if (missingMarkers.length > 0) {
93
+ missing.push({
94
+ path: relative,
95
+ description: `${prerequisite.description} — missing section(s): ${missingMarkers.join(', ')}`
96
+ });
97
+ }
74
98
  }
75
99
  }
76
100
  return { ok: missing.length === 0, missing };
@@ -1 +1 @@
1
- export declare const CLI_VERSION = "1.0.19";
1
+ export declare const CLI_VERSION = "1.0.20";
@@ -1 +1 @@
1
- export const CLI_VERSION = "1.0.19";
1
+ export const CLI_VERSION = "1.0.20";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peaks-cli",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Peaks CLI and short skill family for Claude Code automation.",
5
5
  "author": "SquabbyZ",
6
6
  "license": "MIT",
@@ -34,9 +34,9 @@ Every QA invocation — feature, bug, refactor, clarification — must write **t
34
34
 
35
35
  | # | File | Path | Reader | Content |
36
36
  |---|------|------|--------|---------|
37
- | 1 | Test cases | `.peaks/<id>/qa/test-cases/<rid>.md` | RD (before impl), QA | Generated test scenarios with status |
38
- | 2 | Test report | `.peaks/<id>/qa/test-reports/<rid>.md` | QA, SC, Solo | Summary, coverage%, security, perf, risks |
39
- | 3 | Request artifact | `.peaks/<id>/qa/requests/<rid>.md` | Solo, RD↔QA loop | Verdict, boundary check, links to #1 and #2 |
37
+ | 1 | Test cases | `.peaks/<session-id>/qa/test-cases/<request-id>.md` | RD (before impl), QA | Generated test scenarios with status |
38
+ | 2 | Test report | `.peaks/<session-id>/qa/test-reports/<request-id>.md` | QA, SC, Solo | Summary, coverage%, security, perf, risks |
39
+ | 3 | Request artifact | `.peaks/<session-id>/qa/requests/<request-id>.md` | Solo, RD↔QA loop | Verdict, boundary check, links to #1 and #2 |
40
40
 
41
41
  Concrete template and rules: `references/artifact-per-request.md`.
42
42
 
@@ -442,11 +442,29 @@ Before RD work stops, finishes, blocks, or hands off to another role, emit a sho
442
442
 
443
443
  **Matt Pocock skills** (`diagnose`, `triage`, `tdd`, `improve-codebase-architecture`, `prototype`): Engineering references only. Inspect before applying; Peaks RD gates remain authoritative.
444
444
 
445
+ ## Matt Pocock skills integration
446
+
447
+ Engineering methods from `mattpocock/skills` can inform RD work but never replace Peaks gates. Inspect upstream skill content before applying any method.
448
+
449
+ - `diagnose` — root-cause investigation before fixing
450
+ - `triage` — prioritize bug surface area
451
+ - `tdd` — drive implementation from failing tests
452
+ - `improve-codebase-architecture` — opportunistic refactor framing
453
+ - `prototype` — throwaway exploration before committing to a slice
454
+
455
+ These are references only; Peaks RD gates remain authoritative for handoff, acceptance, and slice closure.
456
+
445
457
  **Understand Anything**: Consume via `peaks understand status/show --json`. Fall back to `peaks codegraph context` or local project scan when absent.
446
458
 
447
459
  **Codegraph**: Optional local analysis via `peaks codegraph context/affected`. Output as untrusted supporting evidence; never commit `.codegraph/` artifacts.
448
460
 
449
- **Other external resources** (Context7, SearchCode, everything-claude-code, GitNexus, etc.): Use `peaks capabilities --source access-repo/mcp-server --json` before recommending. Reference-only, no execute/install/persist. Peaks RD gates remain authoritative.
461
+ ## Codegraph project analysis
462
+
463
+ RD may use `peaks codegraph affected --project <path> <changed-files...> --json` as local project-analysis evidence to inform red-line scope boundaries before writing tech-doc or starting implementation. Treat the output as untrusted supporting evidence — verify against the actual code before relying on it.
464
+
465
+ Do not run upstream installer flows, mutate agent settings, or commit `.codegraph/` artifacts. Peaks RD gates remain authoritative for handoff and acceptance.
466
+
467
+ **Other external resources** (Context7, SearchCode, everything-claude-code, GitNexus, etc.): Use `peaks capabilities --source access-repo/mcp-server --json` for capability discovery before recommending. References only — do not execute upstream installers, do not install upstream resources, do not persist sensitive examples. Peaks RD gates remain authoritative.
450
468
 
451
469
  **OpenSpec and MCP CLI**: Route through Peaks CLI (`peaks openspec show/to-rd/render`, `peaks mcp list/plan/apply/call`). Do not hand-edit `openspec/changes/**` or `~/.claude/settings.json`. Recipes: `references/openspec-mcp-cli.md`.
452
470
 
@@ -71,7 +71,7 @@ Use the Peaks CLI for runtime side effects.
71
71
 
72
72
  Map gstack stages to Peaks role artifacts; preserve Peaks confirmation gates. Do not delegate orchestration to gstack commands.
73
73
 
74
- For frontend workflows, RD and QA must use Playwright MCP for real browser E2E (`peaks mcp plan/apply --capability playwright-mcp.browser-validation --yes`). Chrome DevTools MCP is a secondary CDP surface only. Sanitize browser artifacts before retention (no login URLs, cookies, tokens, PII). See `references/browser-workflow.md`.
74
+ For frontend workflows, RD and QA must use Playwright MCP (`mcp__playwright__` tool namespace) for real browser E2E (`peaks mcp plan/apply --capability playwright-mcp.browser-validation --yes`). Chrome DevTools MCP is a secondary CDP surface only. Sanitize browser artifacts before retention (no login URLs, cookies, tokens, PII). See `references/browser-workflow.md`.
75
75
 
76
76
  ## Local intermediate artifact workspace (MANDATORY)
77
77
 
@@ -731,7 +731,13 @@ Use Peaks TXT for the compact handoff capsule: mode, validated decisions, artifa
731
731
 
732
732
  **Codegraph**: Optional project-analysis before RD handoff. Use `peaks codegraph affected --project <path> <changed-files...> --json` for regression-surface hints. Output as untrusted supporting evidence only; never commit `.codegraph/` artifacts.
733
733
 
734
- **External skills**: All external skill references (`mattpocock/skills`, `awesome-design-md`, `taste-skill`, `shadcn/ui`, `Chrome DevTools MCP`, `Figma Context MCP`, `Context7`, etc.) follow the three-stage pattern: capability discovery before naming, reference-only (no execute/install/persist), Peaks CLI for all side effects. External skills inform, they do not approve.
734
+ ## Codegraph orchestration context
735
+
736
+ Solo treats `peaks codegraph affected --project <path> <changed-files...> --json` as an optional project-analysis enhancement that informs the role handoff between PRD, RD, and QA. The output is untrusted supporting evidence — Solo must not treat codegraph output as approval for scope, design, or QA verdict.
737
+
738
+ Do not run upstream installer flows, mutate agent settings, or commit `.codegraph/` artifacts into git. Peaks gates remain authoritative; codegraph context is a hint, never a substitute for role-skill output.
739
+
740
+ **External skills**: All external skill references (`mattpocock/skills`, `awesome-design-md`, `taste-skill`, `shadcn/ui`, `Chrome DevTools MCP`, `Figma Context MCP`, `Context7`, etc.) follow the three-stage pattern: capability discovery via `peaks capabilities` before naming, references only (no execute/install/persist), Peaks CLI for all side effects. Do not execute upstream installers, do not install upstream resources, do not persist sensitive examples — Peaks gates remain authoritative. External skills inform, they do not approve.
735
741
 
736
742
  **OpenSpec lifecycle**: `render → validate → show → to-rd → validate → archive`. Solo's default runbook handles the exit gate (validate → archive after QA pass). Entry-gate validation (to-rd before slicing) is available when `openspec/` exists pre-workflow; Solo delegates it to `peaks-rd` during implementation.
737
743
 
@@ -34,8 +34,8 @@ Every UI invocation that touches user-visible behavior — including bug fixes t
34
34
 
35
35
  | # | File | Purpose |
36
36
  |---|------|---------|
37
- | 1 | `.peaks/<id>/ui/design-draft.md` | Design direction, dials, component specs, anti-template checklist |
38
- | 2 | `.peaks/<id>/ui/requests/<rid>.md` | Links to #1, records visual direction decisions, regression seeds |
37
+ | 1 | `.peaks/<session-id>/ui/design-draft.md` | Design direction, dials, component specs, anti-template checklist |
38
+ | 2 | `.peaks/<session-id>/ui/requests/<request-id>.md` | Links to #1, records visual direction decisions, regression seeds |
39
39
 
40
40
  RD consumes the design-draft to implement; QA consumes it for visual regression checks.
41
41