peaks-cli 1.4.1 โ†’ 2.0.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.
Files changed (219) hide show
  1. package/.claude-plugin/marketplace.json +51 -0
  2. package/CHANGELOG.md +238 -0
  3. package/README-en.md +226 -0
  4. package/README.md +142 -165
  5. package/dist/src/cli/commands/agent-commands.d.ts +20 -0
  6. package/dist/src/cli/commands/agent-commands.js +48 -0
  7. package/dist/src/cli/commands/audit-commands.d.ts +18 -0
  8. package/dist/src/cli/commands/audit-commands.js +138 -0
  9. package/dist/src/cli/commands/classify-classify-commands.d.ts +19 -0
  10. package/dist/src/cli/commands/classify-classify-commands.js +151 -0
  11. package/dist/src/cli/commands/code-review-commands.d.ts +34 -0
  12. package/dist/src/cli/commands/code-review-commands.js +83 -0
  13. package/dist/src/cli/commands/config-commands.js +90 -0
  14. package/dist/src/cli/commands/context-commands.d.ts +21 -0
  15. package/dist/src/cli/commands/context-commands.js +167 -0
  16. package/dist/src/cli/commands/core-artifact-commands.js +81 -2
  17. package/dist/src/cli/commands/hook-handle.js +50 -0
  18. package/dist/src/cli/commands/loop-commands.d.ts +21 -0
  19. package/dist/src/cli/commands/loop-commands.js +128 -0
  20. package/dist/src/cli/commands/memory-commands.d.ts +13 -0
  21. package/dist/src/cli/commands/memory-commands.js +60 -0
  22. package/dist/src/cli/commands/openspec-commands.js +37 -0
  23. package/dist/src/cli/commands/preferences-commands.d.ts +2 -0
  24. package/dist/src/cli/commands/preferences-commands.js +147 -0
  25. package/dist/src/cli/commands/retrospective-commands.d.ts +9 -0
  26. package/dist/src/cli/commands/retrospective-commands.js +58 -0
  27. package/dist/src/cli/commands/skill-conformance-commands.d.ts +9 -0
  28. package/dist/src/cli/commands/skill-conformance-commands.js +39 -0
  29. package/dist/src/cli/commands/understand-commands.js +34 -0
  30. package/dist/src/cli/commands/upgrade-commands.d.ts +23 -0
  31. package/dist/src/cli/commands/upgrade-commands.js +57 -0
  32. package/dist/src/cli/commands/workflow-commands.js +70 -0
  33. package/dist/src/cli/commands/workspace-commands.js +86 -0
  34. package/dist/src/cli/program.js +46 -22
  35. package/dist/src/services/agent/ecc-agent-service.d.ts +47 -0
  36. package/dist/src/services/agent/ecc-agent-service.js +143 -0
  37. package/dist/src/services/artifacts/request-artifact-service.js +14 -0
  38. package/dist/src/services/audit/backing-detector.d.ts +24 -0
  39. package/dist/src/services/audit/backing-detector.js +59 -0
  40. package/dist/src/services/audit/classifier.d.ts +38 -0
  41. package/dist/src/services/audit/classifier.js +127 -0
  42. package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +29 -0
  43. package/dist/src/services/audit/enforcers/active-skill-resolver.js +71 -0
  44. package/dist/src/services/audit/enforcers/design-draft-confirm.d.ts +25 -0
  45. package/dist/src/services/audit/enforcers/design-draft-confirm.js +54 -0
  46. package/dist/src/services/audit/enforcers/lint-audit-regression.d.ts +21 -0
  47. package/dist/src/services/audit/enforcers/lint-audit-regression.js +86 -0
  48. package/dist/src/services/audit/enforcers/lint-catalog-governance.d.ts +27 -0
  49. package/dist/src/services/audit/enforcers/lint-catalog-governance.js +38 -0
  50. package/dist/src/services/audit/enforcers/lint-cli-back.d.ts +16 -0
  51. package/dist/src/services/audit/enforcers/lint-cli-back.js +35 -0
  52. package/dist/src/services/audit/enforcers/lint-output-style.d.ts +11 -0
  53. package/dist/src/services/audit/enforcers/lint-output-style.js +94 -0
  54. package/dist/src/services/audit/enforcers/lint-reference-integrity.d.ts +6 -0
  55. package/dist/src/services/audit/enforcers/lint-reference-integrity.js +83 -0
  56. package/dist/src/services/audit/enforcers/lint-reference-shape.d.ts +30 -0
  57. package/dist/src/services/audit/enforcers/lint-reference-shape.js +272 -0
  58. package/dist/src/services/audit/enforcers/lint-style.d.ts +49 -0
  59. package/dist/src/services/audit/enforcers/lint-style.js +173 -0
  60. package/dist/src/services/audit/enforcers/lint-workflow-shape.d.ts +5 -0
  61. package/dist/src/services/audit/enforcers/lint-workflow-shape.js +141 -0
  62. package/dist/src/services/audit/enforcers/login-gate.d.ts +23 -0
  63. package/dist/src/services/audit/enforcers/login-gate.js +40 -0
  64. package/dist/src/services/audit/enforcers/mock-placement.d.ts +25 -0
  65. package/dist/src/services/audit/enforcers/mock-placement.js +48 -0
  66. package/dist/src/services/audit/enforcers/no-root-pollution.d.ts +21 -0
  67. package/dist/src/services/audit/enforcers/no-root-pollution.js +56 -0
  68. package/dist/src/services/audit/enforcers/pre-rd-scan.d.ts +22 -0
  69. package/dist/src/services/audit/enforcers/pre-rd-scan.js +23 -0
  70. package/dist/src/services/audit/enforcers/prototype-fidelity.d.ts +25 -0
  71. package/dist/src/services/audit/enforcers/prototype-fidelity.js +75 -0
  72. package/dist/src/services/audit/enforcers/resume-detection.d.ts +21 -0
  73. package/dist/src/services/audit/enforcers/resume-detection.js +52 -0
  74. package/dist/src/services/audit/enforcers/solo-code-ban.d.ts +23 -0
  75. package/dist/src/services/audit/enforcers/solo-code-ban.js +27 -0
  76. package/dist/src/services/audit/enforcers/sub-agent-sid.d.ts +25 -0
  77. package/dist/src/services/audit/enforcers/sub-agent-sid.js +63 -0
  78. package/dist/src/services/audit/enforcers/tech-doc-presence.d.ts +28 -0
  79. package/dist/src/services/audit/enforcers/tech-doc-presence.js +35 -0
  80. package/dist/src/services/audit/red-line-catalog-p2-a.d.ts +21 -0
  81. package/dist/src/services/audit/red-line-catalog-p2-a.js +233 -0
  82. package/dist/src/services/audit/red-line-catalog-p2-b.d.ts +19 -0
  83. package/dist/src/services/audit/red-line-catalog-p2-b.js +225 -0
  84. package/dist/src/services/audit/red-line-catalog.d.ts +51 -0
  85. package/dist/src/services/audit/red-line-catalog.js +210 -0
  86. package/dist/src/services/audit/red-lines-service.d.ts +23 -0
  87. package/dist/src/services/audit/red-lines-service.js +486 -0
  88. package/dist/src/services/audit/scanners/openspec-scanner.d.ts +15 -0
  89. package/dist/src/services/audit/scanners/openspec-scanner.js +55 -0
  90. package/dist/src/services/audit/scanners/rules-tree-scanner.d.ts +16 -0
  91. package/dist/src/services/audit/scanners/rules-tree-scanner.js +56 -0
  92. package/dist/src/services/audit/scanners/skills-tree-scanner.d.ts +17 -0
  93. package/dist/src/services/audit/scanners/skills-tree-scanner.js +46 -0
  94. package/dist/src/services/audit/static-service.d.ts +57 -0
  95. package/dist/src/services/audit/static-service.js +125 -0
  96. package/dist/src/services/audit/types.d.ts +69 -0
  97. package/dist/src/services/audit/types.js +13 -0
  98. package/dist/src/services/classify/classify-service.d.ts +42 -0
  99. package/dist/src/services/classify/classify-service.js +122 -0
  100. package/dist/src/services/classify/classify-types.d.ts +79 -0
  101. package/dist/src/services/classify/classify-types.js +90 -0
  102. package/dist/src/services/code-review/ocr-service.d.ts +129 -0
  103. package/dist/src/services/code-review/ocr-service.js +362 -0
  104. package/dist/src/services/config/config-migration.d.ts +32 -0
  105. package/dist/src/services/config/config-migration.js +92 -0
  106. package/dist/src/services/config/config-restore.d.ts +10 -0
  107. package/dist/src/services/config/config-restore.js +47 -0
  108. package/dist/src/services/config/config-rollback.d.ts +13 -0
  109. package/dist/src/services/config/config-rollback.js +26 -0
  110. package/dist/src/services/config/config-service.d.ts +35 -2
  111. package/dist/src/services/config/config-service.js +81 -0
  112. package/dist/src/services/config/config-types.d.ts +58 -0
  113. package/dist/src/services/config/config-types.js +6 -0
  114. package/dist/src/services/doctor/doctor-service.js +96 -0
  115. package/dist/src/services/fuzzy-matching/fuzzy-match-service.d.ts +15 -0
  116. package/dist/src/services/fuzzy-matching/fuzzy-match-service.js +56 -0
  117. package/dist/src/services/fuzzy-matching/types.d.ts +20 -0
  118. package/dist/src/services/fuzzy-matching/types.js +1 -0
  119. package/dist/src/services/ide/adapters/hermes-adapter.d.ts +21 -0
  120. package/dist/src/services/ide/adapters/hermes-adapter.js +51 -0
  121. package/dist/src/services/ide/adapters/openclaw-adapter.d.ts +14 -0
  122. package/dist/src/services/ide/adapters/openclaw-adapter.js +42 -0
  123. package/dist/src/services/ide/ide-registry.js +7 -0
  124. package/dist/src/services/ide/ide-types.d.ts +1 -1
  125. package/dist/src/services/memory/memory-search-service.d.ts +61 -0
  126. package/dist/src/services/memory/memory-search-service.js +80 -0
  127. package/dist/src/services/openspec/openspec-propose-from-doctor-service.d.ts +31 -0
  128. package/dist/src/services/openspec/openspec-propose-from-doctor-service.js +95 -0
  129. package/dist/src/services/preferences/preferences-service.d.ts +6 -0
  130. package/dist/src/services/preferences/preferences-service.js +43 -0
  131. package/dist/src/services/preferences/preferences-types.d.ts +90 -0
  132. package/dist/src/services/preferences/preferences-types.js +38 -0
  133. package/dist/src/services/recommendations/capability-seed-items.js +0 -1
  134. package/dist/src/services/recommendations/capability-seed-mappings.js +0 -1
  135. package/dist/src/services/recommendations/capability-seed-sources.js +0 -1
  136. package/dist/src/services/retrospective/retrospective-search-service.d.ts +37 -0
  137. package/dist/src/services/retrospective/retrospective-search-service.js +75 -0
  138. package/dist/src/services/skills/skill-conformance-service.d.ts +40 -0
  139. package/dist/src/services/skills/skill-conformance-service.js +136 -0
  140. package/dist/src/services/skills/skill-runbook-service.js +44 -10
  141. package/dist/src/services/skills/sync-service.d.ts +43 -0
  142. package/dist/src/services/skills/sync-service.js +99 -0
  143. package/dist/src/services/slice/slice-check-service.js +166 -13
  144. package/dist/src/services/slice/slice-check-types.d.ts +1 -1
  145. package/dist/src/services/standards/migrate-claude-rules-service.d.ts +19 -0
  146. package/dist/src/services/standards/migrate-claude-rules-service.js +193 -0
  147. package/dist/src/services/standards/project-context.d.ts +1 -1
  148. package/dist/src/services/standards/project-context.js +0 -4
  149. package/dist/src/services/standards/project-standards-service.js +1 -3
  150. package/dist/src/services/understand/understand-scan-service.js +15 -2
  151. package/dist/src/services/understand/understand-types.d.ts +26 -0
  152. package/dist/src/services/upgrade/1x-detector-service.d.ts +7 -0
  153. package/dist/src/services/upgrade/1x-detector-service.js +94 -0
  154. package/dist/src/services/upgrade/gitignore-migrate-service.d.ts +56 -0
  155. package/dist/src/services/upgrade/gitignore-migrate-service.js +170 -0
  156. package/dist/src/services/upgrade/upgrade-service.d.ts +47 -0
  157. package/dist/src/services/upgrade/upgrade-service.js +381 -0
  158. package/dist/src/services/workspace/migrate-1-4-1-service.js +1 -1
  159. package/dist/src/services/workspace/sid-naming-guard.d.ts +14 -0
  160. package/dist/src/services/workspace/sid-naming-guard.js +31 -0
  161. package/dist/src/services/workspace/workspace-archive-service.d.ts +19 -0
  162. package/dist/src/services/workspace/workspace-archive-service.js +32 -0
  163. package/dist/src/services/workspace/workspace-clean-service.d.ts +41 -0
  164. package/dist/src/services/workspace/workspace-clean-service.js +86 -0
  165. package/dist/src/services/workspace/workspace-state-service.d.ts +7 -0
  166. package/dist/src/services/workspace/workspace-state-service.js +43 -0
  167. package/dist/src/shared/change-id.js +4 -1
  168. package/dist/src/shared/version.d.ts +1 -1
  169. package/dist/src/shared/version.js +1 -1
  170. package/package.json +10 -8
  171. package/schemas/doctor-report.schema.json +1 -1
  172. package/scripts/install-skills.mjs +296 -12
  173. package/skills/peaks-doctor/SKILL.md +59 -0
  174. package/skills/peaks-doctor/references/doctor-check-catalog.md +31 -0
  175. package/skills/peaks-doctor/references/from-doctor-flow.md +64 -0
  176. package/skills/peaks-doctor/test_prompts.json +17 -0
  177. package/skills/peaks-ide/SKILL.md +2 -0
  178. package/skills/peaks-qa/SKILL.md +9 -7
  179. package/skills/peaks-qa/references/artifact-per-request.md +19 -5
  180. package/skills/peaks-qa/references/qa-perf-test-plan.md +6 -6
  181. package/skills/peaks-qa/references/qa-runbook.md +1 -1
  182. package/skills/peaks-rd/SKILL.md +25 -10
  183. package/skills/peaks-rd/references/ocr-integration.md +214 -0
  184. package/skills/peaks-rd/references/rd-fanout-contracts.md +70 -0
  185. package/skills/peaks-rd/references/rd-runbook.md +1 -1
  186. package/skills/peaks-solo/SKILL.md +11 -5
  187. package/skills/peaks-solo/references/completion-handoff.md +3 -1
  188. package/skills/peaks-solo/references/step-0-55-1x-detection.md +82 -0
  189. package/skills/peaks-solo/references/workflow-gates-and-types.md +9 -0
  190. package/dist/src/cli/commands/shadcn-commands.d.ts +0 -3
  191. package/dist/src/cli/commands/shadcn-commands.js +0 -35
  192. package/dist/src/cli/commands/skill-context-stats-command.d.ts +0 -40
  193. package/dist/src/cli/commands/skill-context-stats-command.js +0 -96
  194. package/dist/src/cli/commands/skill-scope-commands.d.ts +0 -51
  195. package/dist/src/cli/commands/skill-scope-commands.js +0 -310
  196. package/dist/src/services/shadcn/shadcn-service.d.ts +0 -27
  197. package/dist/src/services/shadcn/shadcn-service.js +0 -128
  198. package/dist/src/services/skill-scope/adapters/_stub-helper.d.ts +0 -39
  199. package/dist/src/services/skill-scope/adapters/_stub-helper.js +0 -98
  200. package/dist/src/services/skill-scope/adapters/claude-code.d.ts +0 -59
  201. package/dist/src/services/skill-scope/adapters/claude-code.js +0 -304
  202. package/dist/src/services/skill-scope/adapters/codex.d.ts +0 -2
  203. package/dist/src/services/skill-scope/adapters/codex.js +0 -12
  204. package/dist/src/services/skill-scope/adapters/cursor.d.ts +0 -2
  205. package/dist/src/services/skill-scope/adapters/cursor.js +0 -13
  206. package/dist/src/services/skill-scope/adapters/qoder.d.ts +0 -2
  207. package/dist/src/services/skill-scope/adapters/qoder.js +0 -13
  208. package/dist/src/services/skill-scope/adapters/tongyi.d.ts +0 -2
  209. package/dist/src/services/skill-scope/adapters/tongyi.js +0 -13
  210. package/dist/src/services/skill-scope/adapters/trae.d.ts +0 -2
  211. package/dist/src/services/skill-scope/adapters/trae.js +0 -12
  212. package/dist/src/services/skill-scope/detect.d.ts +0 -81
  213. package/dist/src/services/skill-scope/detect.js +0 -513
  214. package/dist/src/services/skill-scope/registry.d.ts +0 -41
  215. package/dist/src/services/skill-scope/registry.js +0 -83
  216. package/dist/src/services/skill-scope/source-of-truth.d.ts +0 -44
  217. package/dist/src/services/skill-scope/source-of-truth.js +0 -118
  218. package/dist/src/services/skill-scope/types.d.ts +0 -195
  219. package/dist/src/services/skill-scope/types.js +0 -97
@@ -0,0 +1,51 @@
1
+ {
2
+ "metadata": {
3
+ "pluginRoot": ".",
4
+ "version": "2.0.1"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "peaks-cli",
9
+ "description": "Cross-AI-IDE workflow-gating CLI + 11-skill family. Turns LLM improvisation into auditable engineering process. Skills cover PRD / R&D / UI / QA / change-control / context / SOP definition / orchestration. Soft-fail gates block irreversible actions mid-conversation (even under --dangerously-skip-permissions).",
10
+ "version": "2.0.1",
11
+ "author": {
12
+ "name": "SquabbyZ"
13
+ },
14
+ "homepage": "https://github.com/SquabbyZ/peaks-cli",
15
+ "repository": "https://github.com/SquabbyZ/peaks-cli",
16
+ "license": "MIT",
17
+ "tags": [
18
+ "workflow",
19
+ "gating",
20
+ "sop",
21
+ "code-review",
22
+ "agent-team",
23
+ "cross-ide",
24
+ "claude-code",
25
+ "memory",
26
+ "second-opinion"
27
+ ],
28
+ "keywords": [
29
+ "AI IDE",
30
+ "agent guardrails",
31
+ "SOP engine",
32
+ "cross-IDE",
33
+ "developer workflow",
34
+ "irreversible-action gates"
35
+ ],
36
+ "skills": [
37
+ "./skills/peaks-solo",
38
+ "./skills/peaks-solo-resume",
39
+ "./skills/peaks-solo-status",
40
+ "./skills/peaks-solo-test",
41
+ "./skills/peaks-prd",
42
+ "./skills/peaks-rd",
43
+ "./skills/peaks-qa",
44
+ "./skills/peaks-ui",
45
+ "./skills/peaks-sc",
46
+ "./skills/peaks-txt",
47
+ "./skills/peaks-sop"
48
+ ]
49
+ }
50
+ ]
51
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,238 @@
1
+ # Changelog
2
+
3
+ All notable changes to peaks-cli are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [2.0.0] โ€” 2026-06-12
11
+
12
+ ### ๐ŸŽฏ Headline
13
+
14
+ **One-key 1.x โ†’ 2.0 upgrade.** `npm i -g peaks-cli@2.0` runs the full
15
+ upgrade umbrella in the consuming project automatically (gated by the
16
+ 1.x detector). The manual fallback is `peaks upgrade --to 2.0 --auto`.
17
+
18
+ The architecture moves to **skill-first / CLI-auxiliary**: skill SKILL.md
19
+ files are the primary surface the LLM consumes; CLI commands are
20
+ machine-enforced gates, structured-JSON probes, or side-effect primitives.
21
+ See `.claude/rules/common/dev-preference.md` (project-local) for the
22
+ operating tenet.
23
+
24
+ **ocr second-opinion code review (soft-optional).** Alibaba's
25
+ `@alibaba-group/open-code-review` is now an `optionalDependency`; when
26
+ installed + configured against a user-owned LLM endpoint, peaks-rd's
27
+ Gate B3 merges its findings into `code-review.md` as a second opinion
28
+ alongside the LLM-only review. Soft-fails so missing ocr never blocks
29
+ a slice. New CLI: `peaks code-review detect-ocr` / `run-ocr`. See
30
+ `skills/peaks-rd/references/ocr-integration.md` for the contract.
31
+
32
+ ### Breaking Changes
33
+
34
+ - **`.claude/rules/` is no longer the source of truth for project standards.**
35
+ The 2.0 canonical location is `.peaks/standards/{common,typescript}/*.md`.
36
+ The 1.x `.claude/rules/` tree is thinned to 2-line pointers during upgrade,
37
+ preserving the original under `.claude/rules/.peaks-2.0-backup-<ISO>/`.
38
+
39
+ - **`.gitignore` requires a granular `.peaks/` block**, not a wholesale
40
+ `/.peaks/` ignore. The upgrade umbrella migrates the consumer's
41
+ `.gitignore` automatically (with a timestamped backup); without it, 2.0
42
+ tracked artifacts (`.peaks/standards/`, durable `.peaks/memory/*.md`,
43
+ `.peaks/PROJECT.md`, opt-in markers) would be silently hidden from git.
44
+
45
+ - **Per-project config moved from `~/.peaks/config.json` to `<project>/.peaks/preferences.json`.**
46
+ `~/.peaks/config.json` retains only `{ "version": "2.0.0" }`. Fields
47
+ `economyMode`, `swarmMode`, headroom settings, etc. are now per-project.
48
+ The upgrade umbrella runs `peaks config migrate --apply` automatically.
49
+
50
+ - **Postinstall behavior changed.** `npm i -g peaks-cli@2.0` now:
51
+ 1. Symlinks bundled skills to **all 8 supported IDE platforms**
52
+ (Claude Code, Trae, Cursor, Qoder, Codex, Tongyi Lingma, Aider, Roo Code),
53
+ not just the auto-detected one. Per real Trae user feedback 2026-06-11.
54
+ 2. Installs bundled output styles.
55
+ 3. If `cwd` contains a 1.x peaks-cli project, fire-and-forgets
56
+ `peaks upgrade --to 2.0 --auto`. Opt out with `PEAKS_SKIP_AUTO_UPGRADE=1`.
57
+
58
+ ### Changed โ€” ocr source-of-truth moved into peaks-cli's config
59
+
60
+ Following the same-release user feedback that the original 2.0.0 ocr
61
+ config lived in `~/.opencodereview/config.json` (a file outside
62
+ peaks-cli's reach) and was set via the `ocr config set` CLI from the
63
+ upstream package, the ocr LLM endpoint config now lives under
64
+ `peaksConfig.ocr.llm` in `~/.peaks/config.json`. This makes the
65
+ user-managed LLM endpoint discoverable from a single, peaks-cli-owned
66
+ config surface.
67
+
68
+ - **`@alibaba-group/open-code-review` is now a hard `dependency`** (was
69
+ `optionalDependency`). The user no longer has to remember to install
70
+ it; `npm i -g peaks-cli` pulls it. Network-blocked installs that fail
71
+ to download the platform binary still soft-fail at runtime
72
+ (`binary-missing` state) โ€” the install-time failure risk is the
73
+ trade-off.
74
+ - **`detectOcr` / `runOcrReview` no longer read `~/.opencodereview/config.json`.**
75
+ The source of truth is `peaksConfig.ocr.llm` (parsed by
76
+ `getOcrLlmConfig()` in `config-service.ts`). Missing fields surface
77
+ in `data.missingKeys`; the `config-missing` state's `nextActions`
78
+ payload embeds the JSON template to paste.
79
+ - **Env-var injection replaces file writes.** `runOcrReview` injects
80
+ `OCR_LLM_URL` / `OCR_LLM_TOKEN` / `OCR_LLM_MODEL` /
81
+ `OCR_USE_ANTHROPIC` / `OCR_LLM_AUTH_HEADER` from `peaksConfig.ocr.llm`
82
+ when spawning the ocr subprocess โ€” the ocr package's highest-priority
83
+ config path. peaks-cli never has to materialise
84
+ `~/.opencodereview/config.json`, and does NOT auto-configure the
85
+ endpoint โ€” the user is the only party that touches the LLM
86
+ token / URL.
87
+ - **New CLI: `peaks code-review config-template`.** Prints the JSON
88
+ snippet the user pastes into `~/.peaks/config.json`. It does NOT
89
+ write anything. No `peaks ocr config set`, no `ocr config set` โ€” just
90
+ edit peaks-cli's config.json (or use
91
+ `peaks config set --key ocr.llm.url --value '...'` if preferred).
92
+ - **JSON envelope contract change:** `OcrDetectResult.configPath` now
93
+ points at the peaks-cli config (e.g. `~/.peaks/config.json`) instead
94
+ of the OCR package's legacy file. A new `missingKeys` field lists the
95
+ required `ocr.llm.*` keys the user has not yet populated. The
96
+ five-state contract and the soft-fail policy are unchanged.
97
+
98
+ ### Migration (ocr source-of-truth)
99
+
100
+ Users who already configured `~/.opencodereview/config.json` for the
101
+ soft-optional 2.0.0 release should:
102
+
103
+ 1. Run `peaks code-review config-template --json` to see the JSON
104
+ snippet.
105
+ 2. Paste the equivalent values into `~/.peaks/config.json` under
106
+ `ocr.llm` (peaks-cli handles the camelCase conversion; the
107
+ template shows the canonical shape).
108
+ 3. Re-run `peaks code-review detect-ocr --json` to verify
109
+ `state == "ready"`.
110
+
111
+ The old `~/.opencodereview/config.json` is no longer consulted by
112
+ peaks-cli. The user may delete it at their discretion (the ocr
113
+ subprocess ignores it when peaks-cli's env vars are present).
114
+
115
+ ### Added
116
+
117
+ - **`peaks upgrade --to 2.0`** โ€” umbrella that orchestrates the 1.x โ†’ 2.0
118
+ migration: config migrate, standards migrate (`--from-claude-rules`),
119
+ memory extract (with disk-based glob expansion for the consumer's
120
+ artifact tree), hooks install, skill sync, audit verify, plus
121
+ in-process preferences-ensure, gitignore-migrate, and upgrade-record
122
+ write. Soft-fail per sub-step; never blocks the whole upgrade.
123
+
124
+ - **`peaks upgrade --detect-1x`** โ€” read-only probe returning a JSON
125
+ envelope the peaks-solo skill consumes to gate the AskUserQuestion
126
+ in Step 0.55.
127
+
128
+ - **`peaks standards migrate --from-claude-rules`** โ€” thins `.claude/rules/`
129
+ to 2-line pointers and scaffolds `.peaks/standards/{common,typescript}/`.
130
+
131
+ - **`peaks skill sync`** โ€” distributes the skill family across all 8
132
+ supported IDE platforms in one command.
133
+
134
+ - **`peaks audit red-lines`** โ€” L2 catalog audit (P0/P1/P2-a/P2-b
135
+ enforcers) for skills/SKILL.md, references/*.md, and the agent shield.
136
+
137
+ - **`peaks agent run`** โ€” ECC 64 agents soft-optional integration
138
+ (spec ยง7.2). When the L3 stack is installed, peaks delegates to it;
139
+ otherwise degrades to peaks-cli's own core diagnostics.
140
+
141
+ - **`peaks memory search` / `peaks retrospective search`** โ€” new search
142
+ subcommands for the durable memory / retrospective stores.
143
+
144
+ - **`peaks workspace init / clean / archive`** โ€” workspace lifecycle
145
+ primitives with `--dry-run` default + `--apply` opt-in.
146
+
147
+ - **`peaks preferences set / get / reset`** โ€” per-project preferences
148
+ read/write CLI.
149
+
150
+ - **Two paired tenets** captured in `.peaks/memory/peaks-cli-tenet-one-key-completion.md`:
151
+ - **One-key completion** โ€” actions that can be done in one step
152
+ should not be designed as two-step operations.
153
+ - **Minimal user operation** โ€” features can be powerful, but the
154
+ user-facing surface should be minimal; the CLI/LLM figures it out.
155
+
156
+ ### Fixed
157
+
158
+ - **(2026-06-12) `upgrade-service.ts` was missing from develop HEAD**,
159
+ causing fresh clones to fail TS2307. Repaired in commit ec6f674.
160
+
161
+ - **(2026-06-12) `peaks standards migrate --from-claude-rules`** rejected
162
+ as `unknown option`. CLI flag wiring fixed in core-artifact-commands.ts.
163
+
164
+ - **(2026-06-12) `peaks memory extract`** failed with
165
+ `Artifact path must stay inside the project root` when the umbrella
166
+ passed literal glob strings (`skills/**/SKILL.md`). The umbrella now
167
+ expands globs on disk before spawning.
168
+
169
+ - **(2026-06-12) Three bugs surfaced by real-world ice-cola dogfood:**
170
+ - memory-extract was called without `--apply` โ†’ always dry-ran, never
171
+ actually wrote.
172
+ - `.claude/skills/**/SKILL.md` (the standard Claude-Code consumer
173
+ convention) was not walked; only `<root>/skills/` was scanned.
174
+ - `.peaks/preferences.json` was never created after upgrade, so the
175
+ 1.x detector kept returning `isOneX=true` and the user got stuck
176
+ in a re-prompt loop. Violated the one-key completion tenet.
177
+
178
+ - **(2026-06-12) `.gitignore` 1.x wholesale `/.peaks/` rule** silently
179
+ hid every 2.0 tracked artifact. New `gitignore-migrate-service.ts`
180
+ detects 4 wholesale forms (`.peaks`, `.peaks/`, `/.peaks`, `/.peaks/`),
181
+ removes them, and appends the canonical 2.0 granular block with a
182
+ sentinel comment. Idempotent; creates timestamped backup before write.
183
+
184
+ - **(2026-06-11) Windows: `peaks slice check`** was using `npx tsc` /
185
+ `npx vitest` which spawned `cmd.exe` indirectly via the npx shim and
186
+ failed with ENOENT. Now resolves local `node_modules/.bin/` binaries
187
+ directly via `runCommand(shell: true)`.
188
+
189
+ ### Deprecated
190
+
191
+ - **`peaks workspace migrate-1-4-1`** โ€” retained for 1.4.1 โ†’ 1.4.2
192
+ legacy session-layout backward compatibility. Will be removed in 2.1.
193
+ Use `peaks upgrade --to 2.0` for the canonical migration path.
194
+
195
+ ### Removed
196
+
197
+ - `~/.peaks/config.json` schema is now `{ "version": "2.0.0" }` only.
198
+ All other fields are migrated to per-project `.peaks/preferences.json`
199
+ by `peaks config migrate`.
200
+
201
+ ### Architecture
202
+
203
+ - **Skill-first / CLI-auxiliary.** SKILL.md is the primary surface;
204
+ CLI earns its keep only when (a) hook/script/CI-invokable, (b) the
205
+ consumer needs a structured JSON envelope to gate a decision, or
206
+ (c) destructive side-effect needs explicit `--apply`. See the
207
+ decision template in `.claude/rules/common/dev-preference.md`.
208
+
209
+ - **Two-axis naming convention** for `.peaks/` workspace:
210
+ `<changeId>` for reviewable artifacts under `.peaks/<changeId>/...`;
211
+ `<sessionId>` for ephemeral state under `.peaks/_runtime/<sessionId>/...`.
212
+ Regression test pins zero use of ambiguous `<sid>`.
213
+
214
+ - **`.peaks/_runtime/`** replaces `.peaks/runtime/` (defensive wrong-path
215
+ pattern still in .gitignore).
216
+
217
+ ### Verified
218
+
219
+ - 223 test files / 2768 tests pass / 16 skipped.
220
+ - `npx tsc --noEmit` clean.
221
+ - `npm run build` clean.
222
+ - End-to-end dogfood on real 1.x consumer project (ice-cola): 6/6
223
+ upgrade sub-steps pass; `.gitignore` migrated with backup; detector
224
+ returns `isOneX: false` after upgrade; all 2.0 tracked artifacts
225
+ surface in `git status`.
226
+
227
+ ### Migration Guide
228
+
229
+ See `docs/UPGRADING-2.0.md` for the manual fallback if the auto-upgrade
230
+ is skipped (`PEAKS_SKIP_AUTO_UPGRADE=1` or `npm i --ignore-scripts`).
231
+
232
+ ---
233
+
234
+ ## [1.4.2] โ€” 2026-06-08
235
+
236
+ Last 1.x release. See git history pre-2.0.0 for details.
237
+
238
+ [2.0.0]: https://github.com/SquabbyZ/peaks-cli/releases/tag/v2.0.0
package/README-en.md ADDED
@@ -0,0 +1,226 @@
1
+ <div align="center">
2
+
3
+ # โ›ฐ๏ธ Peaks
4
+
5
+ **Make your AI IDE work like a disciplined engineering team**
6
+
7
+ **English** | [็ฎ€ไฝ“ไธญๆ–‡](./README.md)
8
+
9
+ [![npm version](https://img.shields.io/npm/v/peaks-cli.svg)](https://www.npmjs.com/package/peaks-cli)
10
+ [![GitHub stars](https://img.shields.io/github/stars/SquabbyZ/peaks-cli?style=social)](https://github.com/SquabbyZ/peaks-cli/stargazers)
11
+ [![GitHub repo](https://img.shields.io/badge/GitHub-SquabbyZ%2Fpeaks--cli-181717?logo=github)](https://github.com/SquabbyZ/peaks-cli)
12
+ [![Skills.sh](https://img.shields.io/badge/discover%20on-skills.sh-181717)](https://skills.sh/SquabbyZ/peaks-cli)
13
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
14
+
15
+ **One CLI + 11 workflow skills. Turn LLM improvisation into auditable engineering process.**
16
+
17
+ [Install](#-30-seconds-to-running) ยท [5-min onboarding](#-5-minute-onboarding) ยท [Skill family](#-11-skills-in-the-family) ยท [Killer feature: un-bypassable gates](#-killer-feature-un-bypassable-gates)
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## ๐Ÿค” Why Peaks
24
+
25
+ > Do you put `git push --force`, `rm -rf`, `npm publish`, `DROP TABLE` into your `CLAUDE.md`?
26
+ > The LLM won't really listen. It has a 99% chance of "respecting your preference" โ€” then forgetting it in the next session.
27
+ > **CI can only block at merge time; prose rules rely on goodwill; only gates can stop the agent mid-swing.**
28
+
29
+ Peaks models the "engineering team" inside your AI IDE as 11 workflow skills + a set of **executable gates**:
30
+
31
+ - ๐Ÿงญ **Skills** โ€” `peaks-solo` orchestrates; `peaks-prd / rd / qa / ui / sc / txt / sop` each own a phase; the LLM picks the right role for the task
32
+ - ๐Ÿšง **Gates** โ€” SOP attaches checkable conditions (file-exists / grep / command exit code) to each phase; unmet gates block `git push` **in front of the agent itself** โ€” even under `--dangerously-skip-permissions`
33
+ - ๐Ÿง  **Project memory** โ€” `.peaks/memory/` captures decisions, gotchas, conventions into git; next session picks up where you left off
34
+ - ๐ŸŒ **Cross-IDE** โ€” one CLI, native-skill rendering for Claude Code / Trae / Cursor / Codex / Qoder
35
+ - ๐Ÿ“ฆ **Discoverable** โ€” the 11 skills are also published to [skills.sh](https://skills.sh); `npx skills add` to install on demand
36
+
37
+ ## ๐Ÿš€ 30 seconds to running
38
+
39
+ ```bash
40
+ # 1. Install the CLI
41
+ npm install -g peaks-cli
42
+
43
+ # 2. Open Claude Code in your project
44
+ cd /path/to/your-project && claude
45
+
46
+ # 3. Tell the AI what to do
47
+ > peaks-solo add OAuth callback to the login page
48
+ ```
49
+
50
+ That's it. First run bootstraps the `.peaks/` workspace, scans the project archetype, and dispatches the task to the right skills (PRD โ†’ RD โ†’ UI โ†’ QA โ†’ SC โ†’ TXT). All intermediate artifacts stay on disk. **In daily use, 1 skill (`peaks-solo`) covers โ‰ฅ 90% of needs.**
51
+
52
+ ## โฑ๏ธ 5-minute onboarding
53
+
54
+ In an adapted AI IDE conversation, just ask the AI to use a skill by name:
55
+
56
+ ```text
57
+ peaks-solo add OAuth callback to the login page # end-to-end orchestrator (the common case)
58
+ peaks-prd define goals, non-goals, acceptance for the invitation feature
59
+ peaks-rd analyze the smallest refactor slice and risks
60
+ peaks-qa design tests and regression checks for this change
61
+ peaks-ui design the login page interaction and visual approach
62
+ peaks-sc record change impact, artifact retention, commit boundaries
63
+ peaks-txt generate a context capsule with key decisions
64
+ peaks-sop turn my "publish a post" flow into a gated SOP
65
+ ```
66
+
67
+ **Two ways to use Peaks**:
68
+
69
+ 1. **Let `peaks-solo` orchestrate** (the common case) โ€” tell it what to do and it coordinates the PRD โ†’ RD โ†’ UI โ†’ QA โ†’ SC โ†’ TXT chain
70
+ 2. **Invoke a single role skill directly** (advanced) โ€” when you only want one phase of the workflow
71
+
72
+ Quick status check? Ask the AI to run:
73
+
74
+ ```bash
75
+ peaks -V # version
76
+ peaks doctor --json # environment / skills / config one-shot check
77
+ peaks project dashboard --project . --json # one-shot project view
78
+ ```
79
+
80
+ ## ๐Ÿงฐ 11 skills in the family
81
+
82
+ | Skill | What you use it for | Typical scenario |
83
+ |------|--------------------|------------------|
84
+ | `peaks-solo` | **End-to-end orchestrator** โ€” coordinates prd/rd/ui/qa/sc/txt | Full-cycle dev, PRD-to-ship, batched cross-slice iterations |
85
+ | `peaks-prd` | Fuzzy intent โ†’ **verifiable PRD** (goals / non-goals / preserved behavior / acceptance) | Requirements, PRD authoring, refactor goal definition |
86
+ | `peaks-rd` | Engineering analysis + slice planning + risk + execution contracts | Architecture analysis, minimum slices, risk review |
87
+ | `peaks-qa` | Test design + coverage + regression matrix + acceptance evidence | Test cases, regression, browser E2E |
88
+ | `peaks-ui` | Visual direction + interaction design + design-system constraints | Page design, interaction, prototypes, UI regression |
89
+ | `peaks-sc` | Change control + commit boundaries + retention + rollback evidence | Impact records, change control, audit |
90
+ | `peaks-txt` | Context capsules + decision records + knowledge compression | Module understanding, decision capture, retros |
91
+ | `peaks-sop` | **Turn any workflow into a gated SOP** (not just dev) | Content publishing, compliance checklists, data pipelines, ops runbooks |
92
+ | `peaks-solo-resume` | Continue the unfinished slice | "resume the unfinished slice" |
93
+ | `peaks-solo-status` | One-shot snapshot of where you are | "where are we now" |
94
+ | `peaks-solo-test` | Run the project test suite (auto-detects vitest / jest / pytest / ...) | "run the tests" |
95
+
96
+ **3 solo wrappers + 7 role skills + 1 orchestrator = 11 skills.** In daily use, 1 skill (`peaks-solo`) covers โ‰ฅ 90% of needs.
97
+
98
+ ## ๐Ÿšง Killer feature: un-bypassable gates
99
+
100
+ > CI only blocks at **merge time**; `CLAUDE.md` rules rely on agent **goodwill**. **SOPs do what neither can: stop an irreversible action mid-conversation, against the agent itself.**
101
+
102
+ ```jsonc
103
+ // sop.json
104
+ "guards": [ { "phase": "publish", "bash": "git +push" } ]
105
+ ```
106
+
107
+ ```bash
108
+ peaks hooks install --project <repo> # explicit opt-in: writes one PreToolUse entry
109
+ ```
110
+
111
+ After that, when the agent tries `git push` while a publish gate is failing, Claude Code receives `permissionDecision: "deny"` โ€” the command is blocked **before any permission check, even under `--dangerously-skip-permissions`**. Three gate types:
112
+
113
+ | Type | Meaning | Example |
114
+ |------|---------|---------|
115
+ | `file-exists` | File exists โ†’ pass | `CHANGELOG.md` exists |
116
+ | `grep` (+ `absent`) | Regex matches in file โ†’ pass; `absent: true` inverts ("must not contain X") | "post body has no `TODO`" |
117
+ | `command` | Run a command, judge by exit code (refused by default; needs `--allow-commands`) | run `npm test` |
118
+
119
+ Definitions (`sop.json` + `SKILL.md`) can live in the **global** layer `~/.peaks/sops/` (your personal cross-project SOPs) or the **project** layer `<repo>/.peaks/sops/` (committed into the repo, team-shared โ€” wins over global). **Emergency bypass**: `peaks gate bypass --sop <id> --phase <phase> --reason "<why>"` (one-shot, capped per project per SOP, reason audited).
120
+
121
+ ## ๐ŸŒ Real-world scenarios
122
+
123
+ **Scenario 1: ad-hoc refactor decision**
124
+
125
+ ```text
126
+ > peaks-rd analyze src/auth/ current state and give me the smallest-slice plan
127
+ ```
128
+ `peaks-rd` outputs: 3-phase slices, risk assessment, regression points, executable contracts. **Whether to actually code is your call.**
129
+
130
+ **Scenario 2: turn "blog publishing" into a controlled flow**
131
+
132
+ ```text
133
+ > peaks-sop turn "blog publishing" into a gated SOP: draft โ†’ self-check (no TODO / โ‰ฅ 800 words) โ†’ human review โ†’ publish
134
+ ```
135
+ `peaks-sop` generates `sop.json` + `SKILL.md`, registers globally, **the agent cannot publish if any step is skipped**.
136
+
137
+ **Scenario 3: browser E2E regression**
138
+
139
+ ```text
140
+ > peaks-qa run a browser over the full register โ†’ login โ†’ dashboard flow and list the blockers
141
+ ```
142
+ `peaks-qa` outputs: test matrix, regression checklist, `code-review.md`-style evidence document.
143
+
144
+ **Scenario 4: resume the slice from yesterday**
145
+
146
+ ```text
147
+ > peaks-solo-resume
148
+ ```
149
+ Detects the in-flight slice's deepest-completed gate, saves 3-5k tokens vs re-reading artifacts. **Sessions break, context survives.**
150
+
151
+ ## ๐Ÿ“ฆ Discover peaks on skills.sh
152
+
153
+ The 11 `peaks-*` skills auto-index on the [skills.sh](https://skills.sh) registry โ€” **no separate registration needed**. Indexing is driven by the config in this repo:
154
+
155
+ - 11 `skills/<name>/SKILL.md` files (each with `name` + `description` YAML frontmatter) โ€” the standard skills.sh discovery convention
156
+ - `.claude-plugin/marketplace.json` โ€” explicit manifest listing the 11 public skills (internal `peaks-doctor` / `peaks-ide` are hidden via `metadata.internal: true`)
157
+
158
+ Any environment with `npx skills` installed (Claude Code, Cursor, Codex, ...) can pull them directly:
159
+
160
+ ```bash
161
+ # Install all 11:
162
+ npx skills add SquabbyZ/peaks-cli
163
+
164
+ # Or just one:
165
+ npx skills add SquabbyZ/peaks-cli --skill peaks-solo
166
+ npx skills add SquabbyZ/peaks-cli --skill peaks-rd
167
+ npx skills add SquabbyZ/peaks-cli --skill peaks-sop
168
+ ```
169
+
170
+ Browse [skills.sh/SquabbyZ/peaks-cli](https://skills.sh/SquabbyZ/peaks-cli) for the full catalog. The skills shipped here and the skills shipped via `npm install -g peaks-cli` are the same artifact โ€” both paths deliver the same content.
171
+
172
+ ## ๐Ÿ› ๏ธ How it works: skills first, CLI as gates
173
+
174
+ The `peaks <cmd>` CLI is **not your daily driver**. It exists for three machine-level reasons only:
175
+
176
+ 1. **Explicit opt-in for irreversible side effects** (`peaks sop init --apply`, `peaks openspec archive --apply`) โ€” actions that must not happen on the LLM's discretion
177
+ 2. **Structured JSON contracts** (`peaks request show ... --json`, `peaks scan archetype ... --json`) โ€” let a skill read a machine verdict to gate its next decision
178
+ 3. **Invokable from hooks / CI / scripts** (`peaks hooks install`, `peaks gate enforce`) โ€” turn "satisfy these gates before X" from prose into enforcement
179
+
180
+ One line: **SKILL = the workflow's brain; CLI = the workflow's joints**.
181
+
182
+ ### CLI commands you'll *see* skills call
183
+
184
+ ```bash
185
+ peaks workspace init / reconcile / scan archetype / scan libraries
186
+ peaks request init / show / transition # PRD/RD/QA/SC state machine
187
+ peaks session list / info / title / rotate
188
+ peaks sop init / lint / check / advance / register
189
+ peaks code-review detect-ocr / config-template / run-ocr # Alibaba Open Code Review second opinion
190
+ peaks hooks install / gate enforce / gate bypass
191
+ peaks project dashboard / memories
192
+ ```
193
+
194
+ Full list: `peaks --help`.
195
+
196
+ ## ๐ŸŒ Supported IDEs
197
+
198
+ | IDE | Status |
199
+ |---|---|
200
+ | โœ… **Claude Code** | 11 skills + PreToolUse hook, agent team dogfooded |
201
+ | โš ๏ธ **Trae** | slim `IdeAdapter` registered, real-Trae dogfood is a follow-up slice |
202
+ | ๐Ÿ“‹ **Codex / Cursor / Qoder / Tongyi Lingma, and more** | On the roadmap |
203
+
204
+ ## ๐Ÿ—๏ธ Project status
205
+
206
+ - โœ… **11 skills** + cross-IDE CLI + 2,800+ tests
207
+ - โœ… **Gate mechanism** dogfooded on real projects
208
+ - ๐Ÿ“‹ Roadmap: real Trae / Codex / Cursor integration, `peaks-doc` / `peaks-i18n`, SOP template marketplace
209
+
210
+ See [`CHANGELOG.md`](./CHANGELOG.md) and [`docs/`](./docs/) for details.
211
+
212
+ ## ๐Ÿ“„ License
213
+
214
+ [MIT](LICENSE) โ€” commercial use, modification, private forks all welcome; keep the copyright notice.
215
+
216
+ ---
217
+
218
+ <div align="center">
219
+
220
+ **Find it useful?**
221
+
222
+ โญ [Star peaks-cli on GitHub](https://github.com/SquabbyZ/peaks-cli) ยท ๐Ÿ” [Browse on skills.sh](https://skills.sh/SquabbyZ/peaks-cli)
223
+
224
+ Make your AI IDE work like a disciplined engineering team.
225
+
226
+ </div>