peaks-cli 1.3.7 → 1.3.9

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.
Files changed (98) hide show
  1. package/dist/src/cli/commands/core-artifact-commands.js +119 -14
  2. package/dist/src/cli/commands/project-commands.js +58 -1
  3. package/dist/src/cli/commands/request-commands.js +124 -4
  4. package/dist/src/cli/commands/retrospective-commands.d.ts +3 -0
  5. package/dist/src/cli/commands/retrospective-commands.js +113 -0
  6. package/dist/src/cli/program.js +2 -0
  7. package/dist/src/services/artifacts/request-artifact-service.d.ts +16 -0
  8. package/dist/src/services/artifacts/request-artifact-service.js +18 -2
  9. package/dist/src/services/memory/project-memory-service.d.ts +19 -0
  10. package/dist/src/services/memory/project-memory-service.js +33 -0
  11. package/dist/src/services/retrospective/migrate-from-md.d.ts +37 -0
  12. package/dist/src/services/retrospective/migrate-from-md.js +528 -0
  13. package/dist/src/services/retrospective/retrospective-index.d.ts +37 -0
  14. package/dist/src/services/retrospective/retrospective-index.js +110 -0
  15. package/dist/src/services/retrospective/retrospective-show.d.ts +40 -0
  16. package/dist/src/services/retrospective/retrospective-show.js +109 -0
  17. package/dist/src/services/session/caller-binding-service.d.ts +70 -0
  18. package/dist/src/services/session/caller-binding-service.js +148 -0
  19. package/dist/src/services/session/caller-id-types.d.ts +77 -0
  20. package/dist/src/services/session/caller-id-types.js +46 -0
  21. package/dist/src/services/session/index.d.ts +4 -0
  22. package/dist/src/services/session/index.js +5 -0
  23. package/dist/src/services/session/platform-fallbacks.d.ts +31 -0
  24. package/dist/src/services/session/platform-fallbacks.js +35 -0
  25. package/dist/src/services/session/resolve-caller-id.d.ts +57 -0
  26. package/dist/src/services/session/resolve-caller-id.js +88 -0
  27. package/dist/src/services/skills/skill-presence-service.d.ts +11 -0
  28. package/dist/src/services/skills/skill-presence-service.js +59 -0
  29. package/dist/src/shared/format-md-compact.d.ts +32 -0
  30. package/dist/src/shared/format-md-compact.js +297 -0
  31. package/dist/src/shared/stale-policy.d.ts +67 -0
  32. package/dist/src/shared/stale-policy.js +85 -0
  33. package/dist/src/shared/version.d.ts +1 -1
  34. package/dist/src/shared/version.js +1 -1
  35. package/package.json +1 -1
  36. package/skills/peaks-qa/SKILL.md +86 -515
  37. package/skills/peaks-qa/references/artifact-per-request.md +7 -79
  38. package/skills/peaks-qa/references/browser-validation-contracts.md +51 -0
  39. package/skills/peaks-qa/references/codegraph-regression-focus.md +5 -0
  40. package/skills/peaks-qa/references/external-capability-guidance.md +9 -0
  41. package/skills/peaks-qa/references/qa-compact-handoff.md +3 -0
  42. package/skills/peaks-qa/references/qa-context-governance.md +24 -0
  43. package/skills/peaks-qa/references/qa-fanout-contract.md +8 -0
  44. package/skills/peaks-qa/references/qa-gstack-integration.md +7 -0
  45. package/skills/peaks-qa/references/qa-local-artifacts.md +3 -0
  46. package/skills/peaks-qa/references/qa-matt-pocock-integration.md +9 -0
  47. package/skills/peaks-qa/references/qa-refactor-role.md +3 -0
  48. package/skills/peaks-qa/references/qa-runbook.md +74 -0
  49. package/skills/peaks-qa/references/qa-skill-presence.md +22 -0
  50. package/skills/peaks-qa/references/qa-standards-preflight.md +8 -0
  51. package/skills/peaks-qa/references/qa-sub-agent-dispatch.md +38 -0
  52. package/skills/peaks-qa/references/qa-transition-gates.md +79 -0
  53. package/skills/peaks-qa/references/requirement-boundary-recheck.md +9 -0
  54. package/skills/peaks-qa/references/test-case-generation.md +27 -0
  55. package/skills/peaks-qa/references/test-report-output.md +14 -0
  56. package/skills/peaks-rd/SKILL.md +85 -732
  57. package/skills/peaks-rd/references/artifact-and-standards-output.md +9 -0
  58. package/skills/peaks-rd/references/artifact-per-request.md +20 -0
  59. package/skills/peaks-rd/references/browser-self-test-contracts.md +29 -0
  60. package/skills/peaks-rd/references/codegraph-project-analysis.md +5 -0
  61. package/skills/peaks-rd/references/compact-handoff.md +3 -0
  62. package/skills/peaks-rd/references/external-references.md +11 -0
  63. package/skills/peaks-rd/references/frontend-project-generation.md +11 -0
  64. package/skills/peaks-rd/references/library-version-awareness.md +30 -0
  65. package/skills/peaks-rd/references/mandatory-perf-baseline.md +40 -0
  66. package/skills/peaks-rd/references/mandatory-tech-doc.md +18 -0
  67. package/skills/peaks-rd/references/matt-pocock-integration.md +11 -0
  68. package/skills/peaks-rd/references/mock-data-placement.md +40 -0
  69. package/skills/peaks-rd/references/parallel-review-fanout.md +81 -0
  70. package/skills/peaks-rd/references/rd-context-governance.md +36 -0
  71. package/skills/peaks-rd/references/rd-gstack-integration.md +16 -0
  72. package/skills/peaks-rd/references/rd-runbook.md +125 -0
  73. package/skills/peaks-rd/references/rd-standards-preflight.md +8 -0
  74. package/skills/peaks-rd/references/rd-sub-agent-dispatch.md +39 -0
  75. package/skills/peaks-rd/references/rd-transition-gates.md +148 -0
  76. package/skills/peaks-rd/references/skill-presence-and-title.md +22 -0
  77. package/skills/peaks-solo/SKILL.md +87 -786
  78. package/skills/peaks-solo/references/anchoring-and-session-info.md +25 -0
  79. package/skills/peaks-solo/references/boundaries.md +21 -0
  80. package/skills/peaks-solo/references/codegraph-orchestration.md +5 -0
  81. package/skills/peaks-solo/references/completion-handoff.md +16 -0
  82. package/skills/peaks-solo/references/context-governance.md +51 -0
  83. package/skills/peaks-solo/references/external-references.md +17 -0
  84. package/skills/peaks-solo/references/frontend-only-mode.md +87 -0
  85. package/skills/peaks-solo/references/gstack-integration.md +7 -0
  86. package/skills/peaks-solo/references/local-artifact-workspace.md +79 -0
  87. package/skills/peaks-solo/references/micro-cycle.md +68 -0
  88. package/skills/peaks-solo/references/mode-selection.md +21 -0
  89. package/skills/peaks-solo/references/openspec-workflow.md +43 -0
  90. package/skills/peaks-solo/references/project-memory-loading.md +17 -0
  91. package/skills/peaks-solo/references/project-scan-checklist.md +136 -0
  92. package/skills/peaks-solo/references/quality-gate-cheatsheet.md +13 -0
  93. package/skills/peaks-solo/references/resume-detection.md +63 -0
  94. package/skills/peaks-solo/references/runbook.md +1 -1
  95. package/skills/peaks-solo/references/skill-presence-and-title.md +31 -0
  96. package/skills/peaks-solo/references/standards-preflight.md +23 -0
  97. package/skills/peaks-solo/references/sub-agent-dispatch.md +46 -0
  98. package/skills/peaks-solo/references/swarm-dispatch-contract.md +56 -0
@@ -0,0 +1,148 @@
1
+ # Peaks-Cli RD transition verification gates
2
+
3
+ > Extracted from `skills/peaks-rd/SKILL.md` on 2026-06-09 (slice 019 — slim skill files to references) to keep SKILL.md under the 800-line cap from `common/coding-style.md`. The content below is the verbatim "Transition verification gates" section that was previously inline; nothing was paraphrased, just relocated.
4
+
5
+ ## Transition verification gates (MANDATORY — full per-gate contract)
6
+
7
+ You cannot declare a phase complete from memory. Each gate below is a `ls` or `grep` command you **MUST run** and whose output you **MUST see** before proceeding. If any file shows "No such file" or any command returns empty, the phase is incomplete.
8
+
9
+ > **CLI enforcement (NEW)**: the gates below are now ALSO enforced by `peaks request transition`. The CLI checks the same files before allowing the transition and fails with `code: PREREQUISITES_MISSING` if any are absent. The exact required files depend on the request type chosen at `peaks request init --type <feature|bugfix|refactor|docs|config|chore>` (default `feature`):
10
+ >
11
+ > | Type | rd:implemented requires | rd:qa-handoff also requires |
12
+ > |---|---|---|
13
+ > | feature / refactor | `rd/tech-doc.md` | `rd/code-review.md` + `rd/security-review.md` + `rd/perf-baseline.md` (filled Results table, or `N/A — no perf surface` in Notes) + **`qa/test-cases/<rid>.md`** (added in slice 004; pre-drafted by the 4th sub-agent in the parallel fan-out) |
14
+ > | bugfix | `rd/bug-analysis.md` (lighter than tech-doc; root cause + fix + regression test plan) | `rd/code-review.md` + `rd/security-review.md` + **`qa/test-cases/<rid>.md`**; `rd/perf-baseline.md` only when the bug is performance-shaped (matches the L449-452 "When this applies" criteria) |
15
+ > | config | (none) | `rd/security-review.md` only |
16
+ > | docs / chore | (none) | (none) |
17
+ >
18
+ > The escape hatch `--allow-incomplete --reason "<text>"` still exists for one-off exceptions; the bypass is recorded in the artifact transition note.
19
+
20
+ **Peaks-Cli Gate A — After project-scan read (before any implementation):**
21
+ ```bash
22
+ ls .peaks/<changeId>/rd/project-scan.md
23
+ # Expected output: .peaks/<changeId>/rd/project-scan.md
24
+ # "No such file" → STOP, create the project-scan first. Do not write code.
25
+ ```
26
+
27
+ **Peaks-Cli Gate A2 — Before tech-doc write: project structure verified (PATH CORRECTNESS — CRITICAL):**
28
+ ```bash
29
+ # Verify EVERY file path and directory in the tech-doc exists in the actual project.
30
+ # Do not assume paths. Do not guess directory structures. Open the files and verify.
31
+ # Example verification (adapt paths to the actual tech-doc):
32
+ ls <every-single-directory-path-in-tech-doc> 2>&1 | grep -c "No such file"
33
+ # Expected: 0 (zero "No such file" errors)
34
+ # Any "No such file" → WRONG PATH. Fix the tech-doc BEFORE writing another word.
35
+ # This gate exists because a tech-doc with wrong paths wastes QA time,
36
+ # breaks the implementation, and forces the user to correct the engineer.
37
+ ```
38
+
39
+ **Peaks-Cli Gate A3 — Before implementation: project standards files exist (CLAUDE.md + .claude/rules/):**
40
+ ```bash
41
+ ls CLAUDE.md .claude/rules/common/coding-style.md .claude/rules/common/code-review.md .claude/rules/common/security.md 2>&1 | grep -c "No such file"
42
+ # Expected: 0 (all four files exist)
43
+ # Any missing → BLOCKED. Run `peaks standards init --project .` to generate them FIRST.
44
+ # Do not write a single line of implementation code without standards files in place.
45
+ # Without CLAUDE.md and .claude/rules/, code review and security review triggers won't fire.
46
+ ```
47
+
48
+ **Peaks-Cli Gate B — Before QA handoff:**
49
+ ```bash
50
+ ls .peaks/<changeId>/rd/requests/<rid>.md \
51
+ .peaks/<changeId>/rd/tech-doc.md
52
+ # Both must exist. Missing either → BLOCKED, do not hand off to QA
53
+ ```
54
+
55
+ **Peaks-Cli Gate B2 — Before QA handoff: unit tests exist and pass for the changed surface:**
56
+ ```bash
57
+ # Run the project's test command against changed files. Record the output.
58
+ # Example (adapt to project test runner):
59
+ npx vitest run --changed --reporter=verbose 2>&1 | tail -20
60
+ # Expected: exit code 0, all changed-surface tests passing, coverage for new/changed code recorded
61
+ # Any failing test or zero tests for new code → BLOCKED. Write tests, then re-run.
62
+ #
63
+ # To run the FULL suite (slower; not the default for `peaks slice check`),
64
+ # drop `--changed` or use `npx vitest run --reporter=verbose`. The peaks-solo-test
65
+ # skill is the user-facing wrapper for the full suite; the slice check's
66
+ # `--run-tests` flag is the CLI opt-in.
67
+ ```
68
+
69
+ **Peaks-Cli Gate B3 — Before QA handoff: code review evidence exists:**
70
+ ```bash
71
+ ls .peaks/<changeId>/rd/code-review.md 2>&1
72
+ # Expected: .peaks/<changeId>/rd/code-review.md
73
+ # "No such file" → BLOCKED. Run code review (use code-reviewer agent or equivalent),
74
+ # record findings, fix CRITICAL/HIGH issues, then re-check.
75
+ ```
76
+
77
+ **Peaks-Cli Gate B4 — Before QA handoff: security review evidence exists:**
78
+ ```bash
79
+ ls .peaks/<changeId>/rd/security-review.md 2>&1
80
+ # Expected: .peaks/<changeId>/rd/security-review.md
81
+ # "No such file" → BLOCKED. Run security review (use security-reviewer agent or equivalent),
82
+ # fix CRITICAL/HIGH issues, record findings, then re-check.
83
+ ```
84
+
85
+ **Peaks-Cli Gate B5 — RD artifact body has no unfilled placeholders:**
86
+ ```bash
87
+ peaks request lint <rid> --role rd --project <repo> --session-id <session-id> --json
88
+ # Expected: ok=true. exit 0.
89
+ # ok=false → BLOCKED. The lint output lists every <placeholder>, "- ..." stub,
90
+ # and TBD/TODO marker with line numbers. Fill them in before attempting handoff.
91
+ ```
92
+
93
+ **Peaks-Cli Gate B6 — Declared --type matches the actual diff:**
94
+ ```bash
95
+ peaks scan request-type-sanity --project <repo> --type <type> --json
96
+ # Expected: consistent=true. exit 0.
97
+ # consistent=false → BLOCKED. Either the implementation scope-creeped beyond what
98
+ # the declared type covers, or the type was mis-classified at PRD time. Re-classify
99
+ # (`peaks request init` with the corrected --type) or trim the scope.
100
+ ```
101
+
102
+ **Peaks-Cli Gate B7 — Repair cycle cap (only relevant during RD↔QA repair loop):**
103
+ ```bash
104
+ peaks request repair-status <rid> --project <repo> --session-id <session-id> --json
105
+ # Expected: atCap=false. exit 0.
106
+ # atCap=true → BLOCKED. Three repair cycles already attempted; emit a blocked TXT
107
+ # handoff via Solo rather than entering a fourth cycle.
108
+ ```
109
+
110
+ **Peaks-Cli Gate B8 — Diff stays inside the declared red-line scope:**
111
+ ```bash
112
+ peaks scan diff-vs-scope --rid <rid> --project <repo> --session-id <session-id> --json
113
+ # Expected: ok=true. exit 0.
114
+ # violations[] non-empty → BLOCKED. A changed file matches an explicit out-of-scope
115
+ # pattern. Revert it, or — only with PRD approval — expand the RD red-line scope.
116
+ # unclassified[] non-empty → BLOCKED. A changed file does not match any declared
117
+ # in-scope pattern. Either add it to the in-scope list (intentional widening, requires
118
+ # PRD approval) or revert the change.
119
+ # patternsDeclared=false → BLOCKED. The RD artifact's `## Red-line scope` section has
120
+ # no concrete path or glob patterns. Fill it in with paths like `src/services/login/**`
121
+ # before re-running. Auto-allowed paths (test files, .peaks/, __mocks__/) never need a pattern.
122
+ ```
123
+
124
+ **Peaks-Cli Gate B9 — RD-side perf-baseline output present (when slice has a user-perceivable perf surface):**
125
+ ```bash
126
+ ls .peaks/<changeId>/rd/perf-baseline.md 2>&1
127
+ # Expected: .peaks/<changeId>/rd/perf-baseline.md
128
+ # "No such file" + slice is feature / refactor / bugfix-when-perf → BLOCKED.
129
+ # Run the perf-baseline sub-agent from "Parallel review fan-out" below (or
130
+ # `peaks perf baseline --apply` inline), then fill in the Results table
131
+ # with measurements (lighthouse / k6 / autocannon / project-local bench —
132
+ # the CLI does not run these; that is the RD's job), then re-verify.
133
+ # "No such file" + slice is docs / chore / pure-bugfix-no-perf → OK to proceed;
134
+ # this gate does not apply to those slice types.
135
+ # File exists but Results table is empty (only the header row, no data rows) →
136
+ # BLOCKED. The sub-agent scaffolds the file; the main RD loop must fill in
137
+ # the Path / route | Workload | Tool | Metric | Baseline | Threshold table
138
+ # with actual numbers before handoff.
139
+ # File contains the marker `N/A — no perf surface` in its Notes section →
140
+ # OK to proceed. This is the explicit opt-out the sub-agent writes when
141
+ # the slice has no user-perceivable perf surface (e.g. a feature that only
142
+ # adds an internal flag with no runtime cost, or a refactor that does not
143
+ # alter any hot path).
144
+ #
145
+ # The CLI enforcement table below the section header also gates this at the
146
+ # `peaks request transition rd:qa-handoff` call, so a missing or empty file
147
+ # is rejected by the CLI with `code: PREREQUISITES_MISSING`.
148
+ ```
@@ -0,0 +1,22 @@
1
+ # Skill presence (RD)
2
+
3
+ > Body of `## Skill presence (MANDATORY first action — main-loop context only)`. When this skill is running in the main Claude session (not as a sub-agent — i.e. user invoked `peaks-rd` directly, or `peaks-solo` is executing the role inline in assisted/strict mode), before any analysis or tool call, immediately run:
4
+
5
+ ```bash
6
+ peaks skill presence:set peaks-rd --project <repo> --mode <mode> --gate startup
7
+ ```
8
+
9
+ On the first presence:set in a project, ensure the out-of-band status bar is installed so the user can see at a glance that Peaks is orchestrating — it renders the active skill in Claude Code's terminal status line, independent of model output:
10
+
11
+ ```bash
12
+ peaks statusline install --project <repo> # idempotent; skips if already installed
13
+ ```
14
+
15
+ Read persistent project memory via CLI (durable, LLM-authored memories):
16
+
17
+ ```bash
18
+ peaks project memories --project <repo> --json
19
+ ```
20
+
21
+ This returns durable memories from `.peaks/memory` — decisions, conventions, modules, and rules captured in past sessions. Filter with `--kind <decision|convention|module|rule|reference|project>`. (`.peaks/PROJECT.md` is a human-readable session timeline only.)
22
+ Then display: `Peaks-Cli Skill: peaks-rd | Peaks-Cli Gate: startup | Next: <one short action>`. Update with `peaks skill presence:set peaks-rd --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.