peaks-cli 1.2.1 → 1.2.3

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/peaks.js CHANGED
File without changes
@@ -274,8 +274,13 @@ export function registerCoreAndArtifactCommands(program, io) {
274
274
  .description('Extract stable project memory from skill artifacts into project .peaks/memory')
275
275
  .requiredOption('--project <path>', 'target project root')
276
276
  .requiredOption('--artifact <path...>', 'skill artifact paths inside the project')
277
- .option('--dry-run', 'preview writes without changing files', true)
277
+ .option('--dry-run', 'preview writes without changing files')
278
278
  .option('--apply', 'write extracted memories into project .peaks/memory')).action((options) => {
279
+ if (options.dryRun === true && options.apply === true) {
280
+ printResult(io, fail('memory.extract', 'INVALID_MEMORY_EXTRACT_FLAGS', 'Use either --dry-run or --apply, not both', {}, ['Run without --apply to preview writes, or pass --apply to write memories']), options.json);
281
+ process.exitCode = 1;
282
+ return;
283
+ }
279
284
  try {
280
285
  const result = executeProjectMemoryExtract({ projectRoot: options.project, artifactPaths: options.artifact, apply: options.apply === true });
281
286
  printResult(io, ok('memory.extract', summarizeProjectMemoryExtractResult(result)), options.json);
@@ -290,8 +295,13 @@ export function registerCoreAndArtifactCommands(program, io) {
290
295
  .description('Back up project .peaks/memory into the artifact workspace')
291
296
  .requiredOption('--project <path>', 'target project root')
292
297
  .requiredOption('--workspace <path>', 'artifact workspace path')
293
- .option('--dry-run', 'preview copies without changing files', true)
298
+ .option('--dry-run', 'preview copies without changing files')
294
299
  .option('--apply', 'copy project .peaks/memory into artifact workspace backup')).action((options) => {
300
+ if (options.dryRun === true && options.apply === true) {
301
+ printResult(io, fail('memory.sync', 'INVALID_MEMORY_SYNC_FLAGS', 'Use either --dry-run or --apply, not both', {}, ['Run without --apply to preview copies, or pass --apply to back up memories']), options.json);
302
+ process.exitCode = 1;
303
+ return;
304
+ }
295
305
  try {
296
306
  const result = executeProjectMemoryBackup({ projectRoot: options.project, artifactWorkspacePath: options.workspace, apply: options.apply === true });
297
307
  printResult(io, ok('memory.sync', summarizeProjectMemoryBackupResult(result)), options.json);
@@ -1 +1 @@
1
- export declare const CLI_VERSION = "1.2.1";
1
+ export declare const CLI_VERSION = "1.2.3";
@@ -1 +1 @@
1
- export const CLI_VERSION = "1.2.1";
1
+ export const CLI_VERSION = "1.2.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peaks-cli",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Peaks CLI and short skill family for Claude Code automation.",
5
5
  "author": "SquabbyZ",
6
6
  "license": "MIT",
@@ -89,6 +89,20 @@ peaks codegraph affected --project <repo> <changed-files...> --json
89
89
  # - component library (antd, MUI, shadcn, etc.) and version
90
90
  # - CSS solution (Less, Sass, TailwindCSS, CSS-in-JS) and conflicts
91
91
  # - state management, routing, data fetching libraries
92
+ #
93
+ # After writing project-scan, embed durable memory markers for stable project facts.
94
+ # Append one <!-- peaks-memory:start --> block per fact at the end of project-scan.md:
95
+ #
96
+ # <!-- peaks-memory:start -->
97
+ # title: <component library>
98
+ # kind: module
99
+ # ---
100
+ # <Library> <version> — detected from package.json and source imports.
101
+ # <!-- peaks-memory:end -->
102
+ #
103
+ # Embed markers for: component library, CSS solution, build tool, state management,
104
+ # routing, data fetching, and any legacy constraints. These facts are session-invariant
105
+ # and valuable for future sessions. Do NOT embed secrets, credentials, or transient state.
92
106
 
93
107
  # 4.2 component library detection — verify against package.json, not assumptions
94
108
  # WRONG: "looks like a React project, let me use shadcn/ui"
@@ -761,8 +761,11 @@ peaks sc boundary --slice-id <rid> --artifact <artifact> --code <file> --json
761
761
  peaks openspec validate <cid> --project <repo> --json
762
762
  peaks openspec archive <cid> --project <repo> --apply --json
763
763
 
764
- # 10. Peaks-Cli TXT handoff
765
- peaks memory extract --project <repo> --artifact <qa-artifact> --dry-run --json
764
+ # 10. Peaks-Cli TXT handoff — invoke peaks-txt which embeds memory markers and extracts
765
+ # peaks-txt writes the handoff capsule to .peaks/<id>/txt/handoff.md with embedded
766
+ # <!-- peaks-memory:start --> blocks, then runs memory extract on it.
767
+ # --apply is REQUIRED to write .peaks/memory; without it the command only previews.
768
+ peaks memory extract --project <repo> --artifact .peaks/<id>/txt/handoff.md --apply --json
766
769
 
767
770
  # 11. Peaks-Cli Final snapshot
768
771
  peaks project dashboard --project <repo> --json
@@ -118,7 +118,7 @@ Stable memory body.
118
118
  <!-- peaks-memory:end -->
119
119
  ```
120
120
 
121
- The primary write target is the target project's `.peaks/memory`. Use `peaks memory extract --project <path> --artifact <artifact> --apply` only after the user or active profile allows durable project memory writes.
121
+ The primary write target is the target project's `.peaks/memory`. Use `peaks memory extract --project <path> --artifact <artifact> --apply` to write durable project memories; omit `--apply` to preview without writing.
122
122
 
123
123
  ## Matt Pocock skills integration
124
124
 
@@ -190,13 +190,28 @@ peaks understand show --project <repo> --json
190
190
  # 4. Discover external capabilities before recommending memory or context tools
191
191
  peaks capabilities --json
192
192
 
193
- # 5. Memory extraction dry-run by default, apply only when authorized
194
- peaks memory extract --project <repo> --artifact <artifact-path> --dry-run --json
195
- peaks memory extract --project <repo> --artifact <artifact-path> --apply --json
193
+ # 5. Write the handoff capsule (see template above), then embed memory markers
194
+ # For each stable project fact, decision, rule, or convention discovered this session,
195
+ # append a <!-- peaks-memory:start --> block inside the capsule body:
196
+ #
197
+ # <!-- peaks-memory:start -->
198
+ # title: Short project memory title
199
+ # kind: project | decision | convention | rule | reference | module
200
+ # ---
201
+ # Stable memory body. Concrete facts only — no secrets, no transient state.
202
+ # <!-- peaks-memory:end -->
203
+ #
204
+ # Mark ONLY facts that survive the session: architectural decisions, stack constraints,
205
+ # naming conventions, API patterns, approved refactors. Do NOT embed: secrets, credentials,
206
+ # transient debugging notes, or session-specific context.
207
+
208
+ # 6. Memory extraction — --apply is REQUIRED to write .peaks/memory
209
+ # (without --apply the command only previews; the directory will NOT be created)
210
+ peaks memory extract --project <repo> --artifact .peaks/<id>/txt/handoff.md --apply --json
196
211
  peaks skill presence:clear --project <repo> # handoff capsule complete, remove presence indicator
197
212
  ```
198
213
 
199
- The final `--apply` call requires explicit user or profile authorization. Without it, keep the capsule under `.peaks/<session-id>/txt/` and reference artifact paths from other roles instead of duplicating their content.
214
+ `peaks memory extract --apply` writes to `.peaks/memory` (without `--apply` it only previews). The handoff capsule `.peaks/<id>/txt/handoff.md` is the primary artifact for extraction embed `<!-- peaks-memory:start -->` blocks in it for stable project facts before running extract.
200
215
 
201
216
  ### Transition verification gates (MANDATORY — run the command, see the output)
202
217