@dzhechkov/keysarium 1.0.0 → 1.1.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 (35) hide show
  1. package/README.md +36 -20
  2. package/package.json +1 -1
  3. package/src/cli.js +5 -5
  4. package/src/commands/doctor.js +13 -13
  5. package/src/commands/init.js +2 -2
  6. package/src/commands/list.js +3 -3
  7. package/src/commands/remove.js +2 -2
  8. package/src/commands/update.js +2 -2
  9. package/templates/.claude/commands/brain-export.md +121 -0
  10. package/templates/.claude/commands/brain-import.md +115 -0
  11. package/templates/.claude/rules/checkpoint-protocol.md +46 -0
  12. package/templates/.claude/rules/feedback-loops.md +113 -0
  13. package/templates/.claude/rules/model-routing.md +65 -0
  14. package/templates/.claude/rules/trust-tiers.md +36 -0
  15. package/templates/.claude/shards/phase-0-discovery.shard.md +45 -0
  16. package/templates/.claude/shards/phase-1-explore.shard.md +32 -0
  17. package/templates/.claude/shards/phase-2-research.shard.md +42 -0
  18. package/templates/.claude/shards/phase-25-cjm.shard.md +47 -0
  19. package/templates/.claude/shards/phase-3-solve.shard.md +47 -0
  20. package/templates/.claude/shards/phase-4-architecture.shard.md +41 -0
  21. package/templates/.claude/shards/phase-5-presentation.shard.md +56 -0
  22. package/templates/.claude/skills/explore/SKILL.md +7 -4
  23. package/templates/.claude/skills/frontend-design/SKILL.md +3 -0
  24. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +3 -0
  25. package/templates/.claude/skills/presentation-storyteller/SKILL.md +5 -2
  26. package/templates/.claude/skills/problem-solver-enhanced/SKILL.md +3 -0
  27. package/templates/.claude/skills/reverse-engineering-unicorn/SKILL.md +3 -0
  28. package/templates/CLAUDE.md +55 -3
  29. package/templates/docs/improvement-directions.md +641 -0
  30. package/templates/docs/skills-bto/01-deployment-guide.md +33 -33
  31. package/templates/docs/skills-bto/02-admin-guide.md +13 -13
  32. package/templates/docs/skills-bto/03-user-guide.md +1 -1
  33. package/templates/docs/skills-bto/04-infrastructure-requirements.md +4 -4
  34. package/templates/docs/skills-bto/05-architecture.md +4 -4
  35. package/templates/docs/skills-bto/06-user-flows.md +1 -1
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # @dzhechko/keysarium
1
+ # @dzhechkov/keysarium
2
2
 
3
3
  **AI Case Research Toolkit for Claude Code**
4
4
 
5
- Full 7-phase pipeline for AI case studies, hackathons, and casariums. Provides skills, commands, rules, agent templates, and hooks for [Claude Code](https://docs.anthropic.com/en/docs/claude-code).
5
+ Full 7-phase pipeline for AI case studies, hackathons, and casariums. Provides skills, commands, rules, shards, agent templates, and brain portability for [Claude Code](https://docs.anthropic.com/en/docs/claude-code).
6
6
 
7
7
  ---
8
8
 
@@ -10,10 +10,10 @@ Full 7-phase pipeline for AI case studies, hackathons, and casariums. Provides s
10
10
 
11
11
  ```bash
12
12
  # One-command install via npx (no global install needed)
13
- npx @dzhechko/keysarium
13
+ npx @dzhechkov/keysarium
14
14
 
15
15
  # Or install globally
16
- npm install -g @dzhechko/keysarium
16
+ npm install -g @dzhechkov/keysarium
17
17
  keysarium init
18
18
 
19
19
  # Or without npm (standalone)
@@ -29,12 +29,12 @@ After installation, open Claude Code in your project directory and start using s
29
29
  | Component | Count | Description |
30
30
  |-----------|-------|-------------|
31
31
  | **Skills** | 6 | `explore`, `frontend-design`, `goap-research`, `presentation-storyteller`, `problem-solver`, `reverse-engineering` |
32
- | **Commands** | 11 | `/casarium`, `/new-research`, `/parallel-research`, `/discovery`, `/explore-case`, `/research`, `/cjm-prototype`, `/solve`, `/architecture-phase`, `/presentation`, `/harvest` |
33
- | **Rules** | 7 | `research-quality`, `checkpoint-protocol`, `agent-swarm`, `domain-specific`, `anti-patterns`, `file-conventions`, `modular-reuse` |
32
+ | **Commands** | 13 | `/casarium`, `/new-research`, `/parallel-research`, `/discovery`, `/explore-case`, `/research`, `/cjm-prototype`, `/solve`, `/architecture-phase`, `/presentation`, `/harvest`, `/brain-export`, `/brain-import` |
33
+ | **Rules** | 10 | `research-quality`, `checkpoint-protocol`, `agent-swarm`, `domain-specific`, `anti-patterns`, `file-conventions`, `modular-reuse`, `feedback-loops`, `model-routing`, `trust-tiers` |
34
+ | **Shards** | 8 | Context shards for each phase: `phase-0-discovery`, `phase-1-explore`, `phase-2-research`, `phase-25-cjm`, `phase-3-solve`, `phase-4-architecture`, `phase-5-presentation`, `bto-evaluation` |
34
35
  | **Agent Templates** | 5 | `discovery-worker`, `research-worker`, `cjm-variant-worker`, `presentation-worker`, `parallel-research-orchestrator` |
35
- | **Hooks** | 3 | PreToolUse validation, PostToolUse notifications, audit logging |
36
36
  | **Library** | 4 | `phase-utils`, `agent-patterns`, `skill-loader`, `domain-templates` |
37
- | **Documentation** | 6 | Deployment, admin, user guide, infrastructure, architecture, flows |
37
+ | **Documentation** | 12 | Deployment, admin, user guide, infrastructure, architecture, flows (for Keysarium and BTO) |
38
38
 
39
39
  Everything is installed into your project's `.claude/` directory and works natively with Claude Code.
40
40
 
@@ -65,22 +65,22 @@ Each phase produces concrete artifacts (Markdown documents, Mermaid diagrams, JS
65
65
  ## CLI Commands
66
66
 
67
67
  ```bash
68
- npx @dzhechko/keysarium # Full install (interactive, same as init)
69
- npx @dzhechko/keysarium init # Install all components
70
- npx @dzhechko/keysarium init --minimal # Only .claude/ (no docs, no lib)
71
- npx @dzhechko/keysarium init --with-docs # Include documentation
72
- npx @dzhechko/keysarium init --force # Overwrite existing files
73
- npx @dzhechko/keysarium init --dry-run # Preview without making changes
74
- npx @dzhechko/keysarium update # Update to latest version
75
- npx @dzhechko/keysarium remove # Clean uninstall
76
- npx @dzhechko/keysarium list # Show installed components
77
- npx @dzhechko/keysarium doctor # Health check
68
+ npx @dzhechkov/keysarium # Full install (interactive, same as init)
69
+ npx @dzhechkov/keysarium init # Install all components
70
+ npx @dzhechkov/keysarium init --minimal # Only .claude/ (no docs, no lib)
71
+ npx @dzhechkov/keysarium init --with-docs # Include documentation
72
+ npx @dzhechkov/keysarium init --force # Overwrite existing files
73
+ npx @dzhechkov/keysarium init --dry-run # Preview without making changes
74
+ npx @dzhechkov/keysarium update # Update to latest version
75
+ npx @dzhechkov/keysarium remove # Clean uninstall
76
+ npx @dzhechkov/keysarium list # Show installed components
77
+ npx @dzhechkov/keysarium doctor # Health check
78
78
  ```
79
79
 
80
80
  Flags can be combined:
81
81
 
82
82
  ```bash
83
- npx @dzhechko/keysarium init --minimal --force --dry-run
83
+ npx @dzhechkov/keysarium init --minimal --force --dry-run
84
84
  ```
85
85
 
86
86
  ---
@@ -266,6 +266,22 @@ After completing research, extract reusable patterns:
266
266
 
267
267
  The harvester reviews completed projects, identifies universal patterns, decontextualizes them, and updates `TOOLKIT_HARVEST.md`.
268
268
 
269
+ ### Brain Portability
270
+
271
+ Export and import accumulated knowledge between projects:
272
+
273
+ ```bash
274
+ # Export knowledge as a portable JSON container
275
+ /brain-export
276
+
277
+ # Import a brain container into another project
278
+ /brain-import path/to/brain.json
279
+ ```
280
+
281
+ ### Context Shards
282
+
283
+ Shards (`.claude/shards/`) are lightweight context fragments that phases load on demand. They keep the main CLAUDE.md lean while providing phase-specific instructions, semantic completion promises, and quality checklists.
284
+
269
285
  ---
270
286
 
271
287
  ## Requirements
@@ -286,4 +302,4 @@ The harvester reviews completed projects, identifies universal patterns, deconte
286
302
 
287
303
  - **GitHub:** [https://github.com/dzhechko/product-keysarium-2026](https://github.com/dzhechko/product-keysarium-2026)
288
304
  - **Issues:** [https://github.com/dzhechko/product-keysarium-2026/issues](https://github.com/dzhechko/product-keysarium-2026/issues)
289
- - **npm:** [https://www.npmjs.com/package/@dzhechko/keysarium](https://www.npmjs.com/package/@dzhechko/keysarium)
305
+ - **npm:** [https://www.npmjs.com/package/@dzhechkov/keysarium](https://www.npmjs.com/package/@dzhechkov/keysarium)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/keysarium",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "AI Case Research Toolkit for Claude Code — full 7-phase pipeline for AI case studies, hackathons, and casariums",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -27,7 +27,7 @@ function getVersion() {
27
27
  // Help
28
28
  // ---------------------------------------------------------------------------
29
29
  function showHelp() {
30
- console.log(bold('Usage:') + ' npx @dzhechko/keysarium ' + cyan('<command>') + dim(' [options]'));
30
+ console.log(bold('Usage:') + ' npx @dzhechkov/keysarium ' + cyan('<command>') + dim(' [options]'));
31
31
  console.log('');
32
32
  console.log(bold('Commands:'));
33
33
  console.log(' ' + green('init') + ' Install toolkit into current project ' + dim('(default)'));
@@ -45,10 +45,10 @@ function showHelp() {
45
45
  console.log(' ' + yellow('--version, -v') + ' Show version number');
46
46
  console.log('');
47
47
  console.log(bold('Examples:'));
48
- console.log(dim(' $ ') + 'npx @dzhechko/keysarium init');
49
- console.log(dim(' $ ') + 'npx @dzhechko/keysarium init --minimal --force');
50
- console.log(dim(' $ ') + 'npx @dzhechko/keysarium update --dry-run');
51
- console.log(dim(' $ ') + 'npx @dzhechko/keysarium doctor');
48
+ console.log(dim(' $ ') + 'npx @dzhechkov/keysarium init');
49
+ console.log(dim(' $ ') + 'npx @dzhechkov/keysarium init --minimal --force');
50
+ console.log(dim(' $ ') + 'npx @dzhechkov/keysarium update --dry-run');
51
+ console.log(dim(' $ ') + 'npx @dzhechkov/keysarium doctor');
52
52
  console.log('');
53
53
  }
54
54
 
@@ -60,7 +60,7 @@ function checkFilesExist(manifest, targetDir) {
60
60
  return {
61
61
  passed: false,
62
62
  detail: `${missing.length} file(s) missing: ${missing.slice(0, 5).join(', ')}${missing.length > 5 ? '...' : ''}`,
63
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore missing files.`,
63
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore missing files.`,
64
64
  };
65
65
  });
66
66
  }
@@ -76,7 +76,7 @@ function checkClaudeMd(targetDir) {
76
76
  return {
77
77
  passed: false,
78
78
  detail: 'CLAUDE.md not found',
79
- fix: `Run ${cyan('@dzhechko/keysarium update')} or ${cyan('@dzhechko/keysarium init --force')} to restore.`,
79
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} or ${cyan('@dzhechkov/keysarium init --force')} to restore.`,
80
80
  };
81
81
  }
82
82
 
@@ -117,7 +117,7 @@ function checkSkillsComplete(targetDir) {
117
117
  return {
118
118
  passed: false,
119
119
  detail: '.claude/skills/ directory not found',
120
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore skills.`,
120
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore skills.`,
121
121
  };
122
122
  }
123
123
 
@@ -188,7 +188,7 @@ function checkCommandsPresent(targetDir) {
188
188
  return {
189
189
  passed: false,
190
190
  detail: '.claude/commands/ directory not found',
191
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore commands.`,
191
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore commands.`,
192
192
  };
193
193
  }
194
194
 
@@ -209,7 +209,7 @@ function checkCommandsPresent(targetDir) {
209
209
  return {
210
210
  passed: false,
211
211
  detail: `Missing ${missing.length} command(s): ${missing.join(', ')}`,
212
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore missing commands.`,
212
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore missing commands.`,
213
213
  };
214
214
  });
215
215
  }
@@ -234,7 +234,7 @@ function checkRulesPresent(targetDir) {
234
234
  return {
235
235
  passed: false,
236
236
  detail: '.claude/rules/ directory not found',
237
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore rules.`,
237
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore rules.`,
238
238
  };
239
239
  }
240
240
 
@@ -255,7 +255,7 @@ function checkRulesPresent(targetDir) {
255
255
  return {
256
256
  passed: false,
257
257
  detail: `Missing ${missing.length} rule(s): ${missing.join(', ')}`,
258
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore missing rules.`,
258
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore missing rules.`,
259
259
  };
260
260
  });
261
261
  }
@@ -271,7 +271,7 @@ function checkAgentsPresent(targetDir) {
271
271
  return {
272
272
  passed: false,
273
273
  detail: '.claude/agents/ directory not found',
274
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore agents.`,
274
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore agents.`,
275
275
  };
276
276
  }
277
277
 
@@ -298,7 +298,7 @@ function checkAgentsPresent(targetDir) {
298
298
  return {
299
299
  passed: false,
300
300
  detail: `Only ${mdFiles.length}/5 agent files found`,
301
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore missing agent templates.`,
301
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore missing agent templates.`,
302
302
  };
303
303
  });
304
304
  }
@@ -314,7 +314,7 @@ function checkSettingsValid(targetDir) {
314
314
  return {
315
315
  passed: false,
316
316
  detail: '.claude/settings.json not found',
317
- fix: `Run ${cyan('@dzhechko/keysarium update')} to restore settings.`,
317
+ fix: `Run ${cyan('@dzhechkov/keysarium update')} to restore settings.`,
318
318
  };
319
319
  }
320
320
 
@@ -378,7 +378,7 @@ function checkResearchDir(targetDir) {
378
378
  // ---------------------------------------------------------------------------
379
379
 
380
380
  /**
381
- * `@dzhechko/keysarium doctor` — Health check for the toolkit installation.
381
+ * `@dzhechkov/keysarium doctor` — Health check for the toolkit installation.
382
382
  *
383
383
  * @param {object} options
384
384
  * @param {string} options.targetDir — Project root directory
@@ -390,7 +390,7 @@ async function run(options) {
390
390
  // ── a) Check manifest exists ───────────────────────────────────────────
391
391
  if (!fileExists(manifestPath)) {
392
392
  logError('Keysarium is not installed in this directory.');
393
- info(`Run ${cyan('@dzhechko/keysarium init')} to install.`);
393
+ info(`Run ${cyan('@dzhechkov/keysarium init')} to install.`);
394
394
  process.exit(1);
395
395
  }
396
396
 
@@ -401,7 +401,7 @@ async function run(options) {
401
401
  }
402
402
 
403
403
  console.log('');
404
- info(bold(`Running health checks for @dzhechko/keysarium v${manifest.version}...`));
404
+ info(bold(`Running health checks for @dzhechkov/keysarium v${manifest.version}...`));
405
405
  console.log('');
406
406
 
407
407
  // ── b) Run all checks ─────────────────────────────────────────────────
@@ -65,7 +65,7 @@ function installComponent(comp, templatesDir, targetDir) {
65
65
  // ---------------------------------------------------------------------------
66
66
 
67
67
  /**
68
- * `@dzhechko/keysarium init` — Install the toolkit into the target project.
68
+ * `@dzhechkov/keysarium init` — Install the toolkit into the target project.
69
69
  *
70
70
  * @param {object} options
71
71
  * @param {boolean} options.minimal — Install only core (no lib)
@@ -82,7 +82,7 @@ async function run(options) {
82
82
  if (fileExists(manifestPath)) {
83
83
  if (!force) {
84
84
  warn('Keysarium is already installed in this directory.');
85
- info(`Run ${cyan('@dzhechko/keysarium update')} to update, or use ${yellow('--force')} to overwrite.`);
85
+ info(`Run ${cyan('@dzhechkov/keysarium update')} to update, or use ${yellow('--force')} to overwrite.`);
86
86
  process.exit(1);
87
87
  }
88
88
  warn('Existing installation found — overwriting (--force).');
@@ -53,7 +53,7 @@ function padRight(str, width) {
53
53
  // ---------------------------------------------------------------------------
54
54
 
55
55
  /**
56
- * `@dzhechko/keysarium list` — Show installed components and their status.
56
+ * `@dzhechkov/keysarium list` — Show installed components and their status.
57
57
  *
58
58
  * @param {object} options
59
59
  * @param {string} options.targetDir — Project root directory
@@ -65,7 +65,7 @@ async function run(options) {
65
65
  // ── a) Read manifest ───────────────────────────────────────────────────
66
66
  if (!fileExists(manifestPath)) {
67
67
  warn('Keysarium is not installed in this directory.');
68
- info(`Run ${cyan('@dzhechko/keysarium init')} to install.`);
68
+ info(`Run ${cyan('@dzhechkov/keysarium init')} to install.`);
69
69
  process.exit(1);
70
70
  }
71
71
 
@@ -79,7 +79,7 @@ async function run(options) {
79
79
 
80
80
  // ── Header ─────────────────────────────────────────────────────────────
81
81
  console.log('');
82
- console.log(bold(`@dzhechko/keysarium v${manifest.version}`));
82
+ console.log(bold(`@dzhechkov/keysarium v${manifest.version}`));
83
83
  console.log(`Installed: ${manifest.installedAt ? manifest.installedAt.split('T')[0] : 'unknown'}`);
84
84
  if (manifest.updatedAt) {
85
85
  console.log(`Updated: ${manifest.updatedAt.split('T')[0]}`);
@@ -82,7 +82,7 @@ function removeEmptyDirs(dirPath, stopDir) {
82
82
  // ---------------------------------------------------------------------------
83
83
 
84
84
  /**
85
- * `@dzhechko/keysarium remove` — Clean uninstall of the toolkit.
85
+ * `@dzhechkov/keysarium remove` — Clean uninstall of the toolkit.
86
86
  *
87
87
  * @param {object} options
88
88
  * @param {boolean} options.force — Skip confirmation prompt
@@ -187,7 +187,7 @@ async function run(options) {
187
187
  console.log(` ${dim('-')} ${skippedCount} file(s) already missing (skipped)`);
188
188
  }
189
189
  console.log('');
190
- info(`To reinstall, run: ${cyan('@dzhechko/keysarium init')}`);
190
+ info(`To reinstall, run: ${cyan('@dzhechkov/keysarium init')}`);
191
191
  console.log('');
192
192
 
193
193
  process.exit(0);
@@ -16,7 +16,7 @@ const {
16
16
  // ---------------------------------------------------------------------------
17
17
 
18
18
  /**
19
- * `@dzhechko/keysarium update` — Update an existing toolkit installation.
19
+ * `@dzhechkov/keysarium update` — Update an existing toolkit installation.
20
20
  *
21
21
  * @param {object} options
22
22
  * @param {boolean} options.dryRun — Preview without writing anything
@@ -30,7 +30,7 @@ async function run(options) {
30
30
  // ── a) Read existing manifest ───────────────────────────────────────────
31
31
  if (!fileExists(manifestPath)) {
32
32
  logError('Keysarium is not installed in this directory.');
33
- info(`Run ${cyan('@dzhechko/keysarium init')} to install.`);
33
+ info(`Run ${cyan('@dzhechkov/keysarium init')} to install.`);
34
34
  process.exit(1);
35
35
  }
36
36
 
@@ -0,0 +1,121 @@
1
+ ---
2
+ description: "Export accumulated knowledge as a portable brain container (JSON)"
3
+ argument: "optional path to specific research directory, or 'all' for everything"
4
+ ---
5
+
6
+ # Brain Export — Portable Knowledge Container
7
+
8
+ Export accumulated knowledge, patterns, and evaluations into a portable JSON container
9
+ that can be imported into other projects.
10
+
11
+ ## Protocol
12
+
13
+ ### Step 1: Scan Knowledge Sources
14
+
15
+ Scan the following sources for exportable knowledge:
16
+ 1. `TOOLKIT_HARVEST.md` — harvested patterns and learnings
17
+ 2. `researches/*/` — all completed research directories
18
+ 3. `.claude/skills/*/SKILL.md` — skill metadata and trust tiers
19
+ 4. BTO evaluation reports (if any exist in researches)
20
+
21
+ If `$ARGUMENTS` specifies a path, export only from that directory.
22
+ If `$ARGUMENTS` is "all" or empty, export from all sources.
23
+
24
+ ### Step 2: Build Brain Container
25
+
26
+ Construct a JSON structure:
27
+
28
+ ```json
29
+ {
30
+ "version": "1.0",
31
+ "format": "keysarium-brain",
32
+ "exported_at": "[ISO 8601 timestamp]",
33
+ "source_project": "product-keysarium-2026",
34
+ "source_branch": "[current git branch]",
35
+
36
+ "skills": {
37
+ "[skill-name]": {
38
+ "trust_tier": 0-3,
39
+ "trust_tier_label": "Advisory|Structured|Validated|Verified",
40
+ "bto_score": null or float,
41
+ "last_evaluated": null or ISO date
42
+ }
43
+ },
44
+
45
+ "domain_patterns": {
46
+ "[domain]": {
47
+ "rules_applied": ["list of domain rules"],
48
+ "common_pitfalls": ["list"],
49
+ "successful_strategies": ["list"]
50
+ }
51
+ },
52
+
53
+ "research_summaries": [
54
+ {
55
+ "slug": "[case-slug]",
56
+ "domain": "[detected domain]",
57
+ "phases_completed": ["list of completed phases"],
58
+ "key_findings": ["top 3-5 findings"],
59
+ "chosen_cjm_variant": "A|B|C|D or null",
60
+ "presentation_score": null or float
61
+ }
62
+ ],
63
+
64
+ "harvest_patterns": [
65
+ {
66
+ "category": "skills|commands|rules|templates|patterns|snippets",
67
+ "name": "[pattern name]",
68
+ "description": "[what it does]",
69
+ "maturity": "beta|stable",
70
+ "used_in": ["project list"],
71
+ "content_hash": "[SHA-256 of content]"
72
+ }
73
+ ],
74
+
75
+ "pipeline_metrics": {
76
+ "total_cases_processed": 0,
77
+ "avg_phase_times": {},
78
+ "most_common_domain": null,
79
+ "bto_evaluations_run": 0
80
+ },
81
+
82
+ "metadata": {
83
+ "export_scope": "all|[specific path]",
84
+ "files_scanned": 0,
85
+ "patterns_extracted": 0
86
+ }
87
+ }
88
+ ```
89
+
90
+ ### Step 3: Write Export File
91
+
92
+ Write the JSON to: `keysarium-brain-[YYYY-MM-DD].json` in the project root.
93
+
94
+ ### Step 4: Generate Summary
95
+
96
+ Display:
97
+ ```
98
+ ═══════════════════════════════════════════════════════
99
+ Brain Export Complete
100
+
101
+ File: keysarium-brain-[date].json
102
+ Size: [file size]
103
+ Skills exported: [N] (tiers: [breakdown])
104
+ Research summaries: [N]
105
+ Harvest patterns: [N]
106
+ Domain patterns: [N domains]
107
+
108
+ Import into another project:
109
+ /brain-import keysarium-brain-[date].json
110
+
111
+ • "ок" — done
112
+ • "покажи [section]" — preview section
113
+ ═══════════════════════════════════════════════════════
114
+ ```
115
+
116
+ ## Modular Reuse
117
+
118
+ This export format is project-agnostic. Any multi-phase pipeline can:
119
+ 1. Define its own brain schema extending the base format
120
+ 2. Export domain-specific patterns
121
+ 3. Import patterns from other pipelines
@@ -0,0 +1,115 @@
1
+ ---
2
+ description: "Import a portable brain container into the current project"
3
+ argument: "path to brain JSON file"
4
+ ---
5
+
6
+ # Brain Import — Load External Knowledge
7
+
8
+ Import a previously exported brain container to bootstrap knowledge in a new project.
9
+
10
+ ## Protocol
11
+
12
+ ### Step 1: Validate Brain File
13
+
14
+ 1. Read the JSON file from `$ARGUMENTS`
15
+ 2. Validate format:
16
+ - `version` field exists and is "1.0"
17
+ - `format` field is "keysarium-brain"
18
+ - Required sections present: `skills`, `harvest_patterns`, `metadata`
19
+ 3. If validation fails → show error and stop
20
+
21
+ ### Step 2: Selective Import
22
+
23
+ Ask user what to import:
24
+
25
+ ```
26
+ Brain file: [filename]
27
+ Source project: [source_project]
28
+ Exported: [exported_at]
29
+
30
+ Available sections:
31
+ [1] Skills metadata ([N] skills) — trust tiers and BTO scores
32
+ [2] Domain patterns ([N] domains) — rules, pitfalls, strategies
33
+ [3] Research summaries ([N] cases) — findings and CJM choices
34
+ [4] Harvest patterns ([N] patterns) — reusable patterns and snippets
35
+ [5] Pipeline metrics — timing and performance data
36
+ [A] All sections
37
+
38
+ Which sections to import? (comma-separated numbers or 'A' for all)
39
+ ```
40
+
41
+ ### Step 3: Merge Strategy
42
+
43
+ For each imported section:
44
+
45
+ **Skills metadata:**
46
+ - Update trust_tier in SKILL.md files if imported tier is HIGHER than current
47
+ - Never downgrade a tier
48
+ - Log: "Skill [name]: tier [old] → [new] (from [source_project])"
49
+
50
+ **Domain patterns:**
51
+ - Append to existing domain knowledge (no overwrite)
52
+ - Deduplicate by pattern name
53
+ - Mark imported patterns with source: `[imported from: source_project, date]`
54
+
55
+ **Research summaries:**
56
+ - Store in `TOOLKIT_HARVEST.md` under "## Imported Research Summaries"
57
+ - Read-only reference (don't create research directories)
58
+
59
+ **Harvest patterns:**
60
+ - Merge into `TOOLKIT_HARVEST.md`
61
+ - Deduplicate by content_hash
62
+ - Preserve maturity level from source
63
+
64
+ **Pipeline metrics:**
65
+ - Store as reference baseline
66
+ - Don't overwrite current project metrics
67
+
68
+ ### Step 4: Write Import Log
69
+
70
+ Create `brain-import-log-[YYYY-MM-DD].md` in project root:
71
+
72
+ ```markdown
73
+ # Brain Import Log
74
+
75
+ - Source: [filename]
76
+ - Source project: [source_project]
77
+ - Imported at: [timestamp]
78
+ - Sections imported: [list]
79
+
80
+ ## Changes Made
81
+ - [list of all changes with before/after]
82
+
83
+ ## Conflicts Resolved
84
+ - [any deduplication or merge decisions]
85
+ ```
86
+
87
+ ### Step 5: Summary
88
+
89
+ ```
90
+ ═══════════════════════════════════════════════════════
91
+ Brain Import Complete
92
+
93
+ Source: [filename]
94
+ Sections imported: [list]
95
+ Skills updated: [N]
96
+ Patterns merged: [N]
97
+ Conflicts resolved: [N]
98
+
99
+ Import log: brain-import-log-[date].md
100
+
101
+ • "ок" — done
102
+ • "покажи лог" — show full import log
103
+ ═══════════════════════════════════════════════════════
104
+ ```
105
+
106
+ ## Modular Reuse
107
+
108
+ The import protocol handles:
109
+ - Version compatibility checking
110
+ - Selective import (user chooses sections)
111
+ - Merge-not-overwrite strategy
112
+ - Conflict resolution with logging
113
+ - Audit trail via import log
114
+
115
+ These patterns work for any knowledge transfer between projects.
@@ -7,14 +7,60 @@ Display a checkpoint banner and WAIT for user confirmation before proceeding.
7
7
  ```
8
8
  ═══════════════════════════════════════════════════════
9
9
  ⏸️ CHECKPOINT N: [Phase Name] Complete
10
+ <promise>[PROMISE_TAG]</promise>
11
+
12
+ [2-3 line summary of what was done]
13
+ Files created: [list] ✅
14
+
15
+ • "ок" — next phase
16
+ • "углуби [section]" — elaborate
17
+ • "[specific feedback]" — adjust
18
+ ═══════════════════════════════════════════════════════
19
+ ```
20
+
21
+ ## Semantic Completion Promises
22
+
23
+ Each checkpoint MUST include the relevant promise tag to signal phase completion status.
24
+ Promises are machine-readable markers that formalize phase gates.
25
+
26
+ ### Promise Tags by Phase
27
+
28
+ | Phase | Promise Tag | Meaning |
29
+ |-------|------------|---------|
30
+ | Phase 0 | `<promise>DISCOVERY_COMPLETE</promise>` | JTBD + competitors + ROI analyzed |
31
+ | Phase 1 | `<promise>CASE_EXPLORED</promise>` | Case fully understood, brief created |
32
+ | Phase 2 | `<promise>RESEARCH_PARANOID_PASSED</promise>` | All claims verified, zero unverified |
33
+ | Phase 2.5 | `<promise>CJM_VALIDATED</promise>` | CJM prototype created and variant chosen |
34
+ | Phase 3 | `<promise>SOLUTION_DESIGNED</promise>` | Solution strategy formulated |
35
+ | Phase 4 | `<promise>ARCHITECTURE_DEFINED</promise>` | C4 diagrams + sequence flows ready |
36
+ | Phase 5 | `<promise>PRESENTATION_READY</promise>` | All 4 artifacts (05-08) created |
37
+ | BTO L0 | `<promise>BTO_LAYER0_PASSED</promise>` | Deterministic checks passed |
38
+ | BTO L2 | `<promise>BTO_LAYER2_SCORED</promise>` | Panel of 3 judges scored artifact |
39
+ | BTO Opt | `<promise>BTO_OPTIMIZED</promise>` | Optimization converged |
40
+
41
+ ### Enhanced Checkpoint Format
42
+
43
+ ```
44
+ ═══════════════════════════════════════════════════════
45
+ ⏸️ CHECKPOINT N: [Phase Name] Complete
46
+ <promise>[PROMISE_TAG]</promise>
47
+
10
48
  [2-3 line summary of what was done]
11
49
  Files created: [list] ✅
50
+
12
51
  • "ок" — next phase
13
52
  • "углуби [section]" — elaborate
14
53
  • "[specific feedback]" — adjust
15
54
  ═══════════════════════════════════════════════════════
16
55
  ```
17
56
 
57
+ ### Promise Validation Rules
58
+
59
+ - A promise tag MUST only be emitted AFTER its conditions are verifiably met
60
+ - If conditions are NOT met, emit `<promise>[TAG]_INCOMPLETE</promise>` instead
61
+ - Downstream phases SHOULD check for upstream promises before starting
62
+ - Promise tags serve as formal phase gates — they replace informal "phase done" signals
63
+
18
64
  ## Rules
19
65
  - NEVER skip checkpoints
20
66
  - NEVER auto-advance to the next phase without user confirmation