codymaster 4.4.4 → 4.5.1

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 (190) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +29 -14
  3. package/commands/demo.md +1 -1
  4. package/dist/context-bus.js +70 -0
  5. package/dist/context-db.js +265 -0
  6. package/dist/continuity.js +12 -0
  7. package/dist/file-watcher.js +79 -0
  8. package/dist/index.js +152 -1
  9. package/dist/l0-indexer.js +158 -0
  10. package/dist/mcp-context-server.js +400 -0
  11. package/dist/migrate-json-to-sqlite.js +126 -0
  12. package/dist/skill-chain.js +19 -3
  13. package/dist/token-budget.js +108 -0
  14. package/dist/uri-resolver.js +203 -0
  15. package/package.json +7 -1
  16. package/skills/_shared/helpers.md +50 -14
  17. package/skills/cm-autopilot/SKILL.md +29 -0
  18. package/skills/cm-autopilot/scripts/autopilot.py +190 -0
  19. package/skills/cm-continuity/SKILL.md +90 -28
  20. package/skills/cm-quality-gate/SKILL.md +11 -1
  21. package/skills/cm-safe-deploy/SKILL.md +38 -2
  22. package/skills/cm-security-gate/SKILL.md +158 -34
  23. package/skills/cm-skill-chain/SKILL.md +47 -1
  24. package/skills/cm-start/SKILL.md +11 -2
  25. package/skills/cm-test-gate/SKILL.md +3 -0
  26. package/skills/boxme-git-config/SKILL.md +0 -56
  27. package/skills/boxme-local-dev/SKILL.md +0 -66
  28. package/skills/jobs-to-be-done/SKILL.md +0 -266
  29. package/skills/jobs-to-be-done/references/case-studies.md +0 -154
  30. package/skills/jobs-to-be-done/references/competitive-strategy.md +0 -280
  31. package/skills/jobs-to-be-done/references/diagnostics.md +0 -158
  32. package/skills/jobs-to-be-done/references/innovation-process.md +0 -392
  33. package/skills/jobs-to-be-done/references/organizational-change.md +0 -328
  34. package/skills/marketplace-report-crawler/SKILL.md +0 -176
  35. package/skills/marketplace-report-crawler/config/accounts.json +0 -41
  36. package/skills/marketplace-report-crawler/config/report-types.json +0 -422
  37. package/skills/marketplace-report-crawler/config/sessions.json +0 -3
  38. package/skills/marketplace-report-crawler/scripts/ab-wrapper.sh +0 -102
  39. package/skills/marketplace-report-crawler/scripts/browser-actions/lazada/lazada-actions.js +0 -114
  40. package/skills/marketplace-report-crawler/scripts/browser-actions/shopee/shopee-actions.js +0 -94
  41. package/skills/marketplace-report-crawler/scripts/browser-actions/tiktok/tiktok-actions.js +0 -272
  42. package/skills/marketplace-report-crawler/scripts/crawl-runner.js +0 -281
  43. package/skills/marketplace-report-crawler/scripts/session-check.sh +0 -72
  44. package/skills/marketplace-report-crawler/scripts/session-manager.sh +0 -349
  45. package/skills/marketplace-report-crawler/scripts/setup-folders.sh +0 -83
  46. package/skills/medical-research/SKILL.md +0 -194
  47. package/skills/medical-research/scripts/evidence_checker.py +0 -288
  48. package/skills/mom-test/SKILL.md +0 -267
  49. package/skills/mom-test/references/avoiding-bad-data.md +0 -221
  50. package/skills/mom-test/references/case-studies.md +0 -306
  51. package/skills/mom-test/references/commitment-advancement.md +0 -219
  52. package/skills/mom-test/references/finding-conversations.md +0 -251
  53. package/skills/mom-test/references/processing-learning.md +0 -256
  54. package/skills/mom-test/references/question-patterns.md +0 -198
  55. package/skills/pandasai-analytics/SKILL.md +0 -251
  56. package/skills/release-it/SKILL.md +0 -235
  57. package/skills/release-it/references/anti-patterns.md +0 -279
  58. package/skills/release-it/references/capacity-planning.md +0 -285
  59. package/skills/release-it/references/chaos-engineering.md +0 -325
  60. package/skills/release-it/references/deployment-strategies.md +0 -331
  61. package/skills/release-it/references/observability.md +0 -301
  62. package/skills/release-it/references/stability-patterns.md +0 -355
  63. package/skills/skill-creator-ultra/.agents/workflows/skill-audit.md +0 -37
  64. package/skills/skill-creator-ultra/.agents/workflows/skill-compare.md +0 -34
  65. package/skills/skill-creator-ultra/.agents/workflows/skill-export.md +0 -51
  66. package/skills/skill-creator-ultra/.agents/workflows/skill-generate.md +0 -39
  67. package/skills/skill-creator-ultra/.agents/workflows/skill-scaffold.md +0 -52
  68. package/skills/skill-creator-ultra/.agents/workflows/skill-simulate.md +0 -25
  69. package/skills/skill-creator-ultra/.agents/workflows/skill-stats.md +0 -31
  70. package/skills/skill-creator-ultra/.agents/workflows/skill-validate.md +0 -25
  71. package/skills/skill-creator-ultra/README.md +0 -1242
  72. package/skills/skill-creator-ultra/SKILL.md +0 -388
  73. package/skills/skill-creator-ultra/agents/analyzer.md +0 -274
  74. package/skills/skill-creator-ultra/agents/comparator.md +0 -202
  75. package/skills/skill-creator-ultra/agents/grader.md +0 -223
  76. package/skills/skill-creator-ultra/assets/eval_review.html +0 -146
  77. package/skills/skill-creator-ultra/eval-viewer/generate_review.py +0 -471
  78. package/skills/skill-creator-ultra/eval-viewer/viewer.html +0 -1325
  79. package/skills/skill-creator-ultra/examples/example_anthropic_frontend.md +0 -109
  80. package/skills/skill-creator-ultra/examples/example_anthropic_pdf.md +0 -116
  81. package/skills/skill-creator-ultra/examples/example_api_docs.md +0 -189
  82. package/skills/skill-creator-ultra/examples/example_db_migration.md +0 -253
  83. package/skills/skill-creator-ultra/examples/example_git_commit.md +0 -111
  84. package/skills/skill-creator-ultra/install.ps1 +0 -289
  85. package/skills/skill-creator-ultra/install.sh +0 -313
  86. package/skills/skill-creator-ultra/phases/phase1_interview.md +0 -202
  87. package/skills/skill-creator-ultra/phases/phase2_extract.md +0 -55
  88. package/skills/skill-creator-ultra/phases/phase3_detect.md +0 -57
  89. package/skills/skill-creator-ultra/phases/phase4_generate.md +0 -543
  90. package/skills/skill-creator-ultra/phases/phase5_test.md +0 -319
  91. package/skills/skill-creator-ultra/phases/phase6_eval.md +0 -301
  92. package/skills/skill-creator-ultra/phases/phase7_iterate.md +0 -103
  93. package/skills/skill-creator-ultra/phases/phase8_optimize.md +0 -113
  94. package/skills/skill-creator-ultra/resources/advanced_patterns.md +0 -499
  95. package/skills/skill-creator-ultra/resources/anti_patterns.md +0 -376
  96. package/skills/skill-creator-ultra/resources/blueprints.md +0 -498
  97. package/skills/skill-creator-ultra/resources/checklist.md +0 -243
  98. package/skills/skill-creator-ultra/resources/composition_cookbook.md +0 -291
  99. package/skills/skill-creator-ultra/resources/description_optimization.md +0 -90
  100. package/skills/skill-creator-ultra/resources/eval_guide.md +0 -133
  101. package/skills/skill-creator-ultra/resources/industry_questions.md +0 -189
  102. package/skills/skill-creator-ultra/resources/interview_questions.md +0 -200
  103. package/skills/skill-creator-ultra/resources/pattern_detection.md +0 -200
  104. package/skills/skill-creator-ultra/resources/prompt_engineering.md +0 -531
  105. package/skills/skill-creator-ultra/resources/schemas.md +0 -430
  106. package/skills/skill-creator-ultra/resources/script_integration.md +0 -593
  107. package/skills/skill-creator-ultra/resources/scripts_guide.md +0 -339
  108. package/skills/skill-creator-ultra/resources/skill_template.md +0 -124
  109. package/skills/skill-creator-ultra/resources/skill_writing_guide.md +0 -634
  110. package/skills/skill-creator-ultra/resources/versioning_guide.md +0 -193
  111. package/skills/skill-creator-ultra/scripts/ci_eval.py +0 -200
  112. package/skills/skill-creator-ultra/scripts/package_skill.py +0 -165
  113. package/skills/skill-creator-ultra/scripts/simulate_skill.py +0 -398
  114. package/skills/skill-creator-ultra/scripts/skill_audit.py +0 -611
  115. package/skills/skill-creator-ultra/scripts/skill_compare.py +0 -265
  116. package/skills/skill-creator-ultra/scripts/skill_export.py +0 -334
  117. package/skills/skill-creator-ultra/scripts/skill_scaffold.py +0 -403
  118. package/skills/skill-creator-ultra/scripts/skill_stats.py +0 -339
  119. package/skills/skill-creator-ultra/scripts/validate_skill.py +0 -411
  120. package/skills/tailwind-mastery/SKILL.md +0 -229
  121. package/skills/vercel-react-best-practices/AGENTS.md +0 -3373
  122. package/skills/vercel-react-best-practices/README.md +0 -123
  123. package/skills/vercel-react-best-practices/SKILL.md +0 -143
  124. package/skills/vercel-react-best-practices/rules/_sections.md +0 -46
  125. package/skills/vercel-react-best-practices/rules/_template.md +0 -28
  126. package/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  127. package/skills/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
  128. package/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
  129. package/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
  130. package/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
  131. package/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -51
  132. package/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
  133. package/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
  134. package/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
  135. package/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
  136. package/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
  137. package/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  138. package/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
  139. package/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
  140. package/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
  141. package/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
  142. package/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
  143. package/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
  144. package/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
  145. package/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
  146. package/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
  147. package/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
  148. package/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
  149. package/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
  150. package/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
  151. package/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
  152. package/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
  153. package/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
  154. package/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
  155. package/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
  156. package/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
  157. package/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  158. package/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
  159. package/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
  160. package/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  161. package/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  162. package/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
  163. package/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
  164. package/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
  165. package/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
  166. package/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
  167. package/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
  168. package/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
  169. package/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
  170. package/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
  171. package/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
  172. package/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  173. package/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
  174. package/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
  175. package/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
  176. package/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
  177. package/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
  178. package/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +0 -64
  179. package/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
  180. package/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md +0 -59
  181. package/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
  182. package/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
  183. package/skills/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
  184. package/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
  185. package/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
  186. package/skills/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
  187. package/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -142
  188. package/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
  189. package/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
  190. package/skills/web-design-guidelines/SKILL.md +0 -39
@@ -29,8 +29,25 @@ cm continuity init
29
29
  # Check current state
30
30
  cm continuity status
31
31
 
32
- # View captured learnings
32
+ # View captured learnings / decisions
33
33
  cm continuity learnings
34
+ cm continuity decisions
35
+
36
+ # ── Smart Spine v5 commands ──────────────────────────────
37
+ # Regenerate L0 compact indexes (learnings-index.md, skeleton-index.md)
38
+ cm continuity index
39
+
40
+ # Show token budget allocation + usage per category
41
+ cm continuity budget
42
+
43
+ # Pretty-print current context bus state (active skill chain)
44
+ cm continuity bus
45
+
46
+ # Print Claude Desktop MCP config snippet for cm-context server
47
+ cm continuity mcp
48
+
49
+ # Migrate learnings.json + decisions.json → SQLite (one-time)
50
+ cm continuity migrate
34
51
  ```
35
52
 
36
53
  ## The Protocol
@@ -130,45 +147,84 @@ Project: [project name]
130
147
  - [file path]: [what we're changing]
131
148
  ```
132
149
 
133
- ## 4-Tier Memory System (Brain-Inspired)
150
+ ## Memory Architecture (v5 — Smart Spine)
134
151
 
135
152
  ```
136
153
  Tier 1: SENSORY MEMORY (seconds — within current tool call)
137
154
  → Internal variables, intermediate results
138
155
  → NEVER written to file — discarded when action completes
139
- → Example: "File X has 200 lines" — no need to remember next session
140
156
 
141
157
  Tier 2: WORKING MEMORY (current session → 7 days)
142
- → CONTINUITY.md — the active scratchpad
158
+ → CONTINUITY.md — the active scratchpad (max 500 words / ~400 tokens)
143
159
  → Auto-rotates: entries > 7 days promote to Tier 3 or decay
144
- Max 500 words (~400 tokens)
145
-
146
- Tier 3: LONG-TERM MEMORY (30+ days, only if reinforced)
147
- .cm/learnings.json error patterns with TTL + scope
148
- → .cm/decisions.json — architecture decisions with supersedence
149
- → Entries MUST be reinforced (same pattern ≥ 2x) to survive
150
- → Decay: auto-archive if not relevant after TTL expires
160
+ Context bus (.cm/context-bus.json) — live skill chain state
161
+ · initBus() on chain start, updateBusStep() on each advance
162
+ · cm://pipeline/current resolves to bus JSON
163
+ · Read via: cm continuity bus | cm_bus_read MCP tool
151
164
 
152
- Tier 4: EXTERNAL SEMANTIC MEMORY (optional for large projects)
165
+ Tier 3: LONG-TERM MEMORY (30+ days, only if reinforced)
166
+ → Primary: .cm/context.db (SQLite + FTS5) ← v5 default
167
+ · learnings table + learnings_fts (BM25 keyword search)
168
+ · decisions table + decisions_fts
169
+ · skill_outputs per session/chain
170
+ · indexes table (cached L0/L1 content + staleness hash)
171
+ → Fallback: .cm/memory/learnings.json + decisions.json (kept for compat)
172
+ → L0 indexes: .cm/learnings-index.md (~100 tok), .cm/skeleton-index.md (~500 tok)
173
+ · Auto-regenerated on addLearning() + on demand via cm continuity index
174
+ · File watcher auto-refreshes learnings L0 on JSON change (300ms debounce)
175
+ → Token budget: .cm/token-budget.json — 200k window, per-category soft limits
176
+ · Enforced at load time: checkBudget() → allowed/remaining/suggestion
177
+ · View: cm continuity budget
178
+
179
+ Tier 4: EXTERNAL SEMANTIC MEMORY (optional — large projects)
153
180
  → tobi/qmd — BM25 + Vector + LLM re-ranking, 100% local
154
- Indexes entire docs/, src/, meeting notes folders
155
- → AI queries via MCP: qmd query "keyword" → relevant snippets
156
- → See cm-deep-search skill for setup & detection thresholds
157
- → ONLY suggested when project >50 docs or >200 source files
181
+ See cm-deep-search skill — ONLY when >50 docs or >200 source files
158
182
 
159
- Tier 5: STRUCTURAL CODE MEMORY (optional — for code-heavy projects)
183
+ Tier 5: STRUCTURAL CODE MEMORY (optional — code-heavy projects)
160
184
  → CodeGraph — tree-sitter AST → SQLite graph → MCP server
161
- Indexes symbols, call graphs, imports, class hierarchies
162
- → AI queries: codegraph_context, codegraph_impact, codegraph_callers
163
- → See cm-codeintell skill for setup & integration
164
- → ONLY suggested when project >50 source files
185
+ See cm-codeintell skill ONLY when >50 source files
165
186
  ```
166
187
 
167
- **CONTINUITY.md = "what am I doing NOW?"**
168
- **learnings.json = "what mistakes should I avoid?"**
169
- **decisions.json = "what architecture rules apply?"**
188
+ **CONTINUITY.md = "what am I doing NOW?"**
189
+ **context bus = "what did upstream skills produce in this chain?"**
190
+ **L0 indexes = "cheapest possible memory load (~600 tokens)"**
191
+ **context.db = "keyword search across all learnings + decisions"**
170
192
  **qmd (optional) = "find what was written across hundreds of docs"**
171
193
 
194
+ ### MCP Context Server (Claude Desktop integration)
195
+
196
+ Seven tools exposed over stdio to Claude Desktop and MCP-compatible clients:
197
+
198
+ | Tool | Purpose |
199
+ |---|---|
200
+ | `cm_query` | FTS5 keyword search — learnings, decisions, or both |
201
+ | `cm_resolve` | Load any `cm://` URI at L0/L1/L2 depth |
202
+ | `cm_bus_read` | Read live context bus state |
203
+ | `cm_bus_write` | Publish skill output to the bus |
204
+ | `cm_budget_check` | Pre-flight token check by category |
205
+ | `cm_memory_decay` | Archive expired learnings (supports dry_run) |
206
+ | `cm_index_refresh` | Regenerate L0 indexes on demand |
207
+
208
+ ```bash
209
+ # Get install snippet for Claude Desktop config
210
+ cm continuity mcp
211
+ ```
212
+
213
+ ### cm:// URI Scheme
214
+
215
+ Reference any memory resource by URI — resolver handles depth + caching:
216
+
217
+ ```
218
+ cm://memory/working → CONTINUITY.md
219
+ cm://memory/learnings → learnings-index.md (L0) or SQLite (L1/L2)
220
+ cm://memory/learnings/{id} → specific learning by ID
221
+ cm://memory/decisions → decisions index
222
+ cm://skills/{name} → SKILL.md at depth
223
+ cm://skills/{name}/L0 → front matter + description only (~50 tokens)
224
+ cm://resources/skeleton → skeleton-index.md (L0) or full
225
+ cm://pipeline/current → live context bus state
226
+ ```
227
+
172
228
  ---
173
229
 
174
230
  ## Memory Audit Protocol (Auto — Every Session Start)
@@ -383,22 +439,28 @@ WHY: Smaller scope = less noise = AI only reads what's relevant.
383
439
 
384
440
  ```
385
441
  ✅ DO:
386
- - Read CONTINUITY.md at session start (ALWAYS)
442
+ - Check context bus FIRST at session start (free, ~50 tokens)
443
+ - Load L0 indexes BEFORE full files (learnings-index + skeleton-index)
444
+ - Use cm_query for keyword search — don't scan JSON manually
445
+ - Read CONTINUITY.md after L0 indexes (not before)
387
446
  - Run Memory Audit at session start (decay + conflicts + scope filter)
388
447
  - Update CONTINUITY.md at session end (ALWAYS)
389
448
  - Tag EVERY learning/decision with scope (global/module/file)
390
449
  - Reinforce existing learnings instead of creating duplicates
391
450
  - Keep CONTINUITY.md under 500 words (rotate to Tier 3)
392
451
  - Be specific: "Fixed auth bug in login.ts:42" not "Fixed stuff"
452
+ - Run cm continuity index after bulk learning additions
393
453
 
394
454
  ❌ DON'T:
455
+ - Load full learnings.json or skeleton.md as first action (use L0 first)
456
+ - Skip context bus check when inside a skill chain
395
457
  - Skip Memory Audit ("I'll read everything, it's fine")
396
458
  - Write learnings without scope ("it applies everywhere" = almost never true)
397
459
  - Create duplicate learnings (reinforce existing ones instead)
398
- - Let learnings.json grow unbounded (TTL + decay handles this)
399
- - Read ALL learnings regardless of current module (use scope filter)
460
+ - Let learnings.json grow unbounded (TTL + decay + cm_memory_decay handles this)
461
+ - Read ALL learnings regardless of current module (use scope filter / cm_query)
400
462
  - Ignore superseded decisions (they cause conflicting code)
401
- - Keep stale context that no longer applies to current architecture
463
+ - Inject skeleton.md (20KB) when skeleton-index.md (~2KB) is sufficient
402
464
  ```
403
465
 
404
466
  ## The Bottom Line
@@ -186,7 +186,17 @@ After ANY gate fails, **FIRST run Memory Integrity Check:**
186
186
  | `cm-identity-guard` | Verify identity before using quality gate to ship |
187
187
  | `cm-tdd` | TDD creates the logic for Layer 3 |
188
188
  | `cm-safe-i18n` | Leverages Layer 4 for parity checks |
189
+ | `cm-security-gate` | **PRE-REQUISITE for production:** Security scan (Snyk + Aikido) PASS must be in deployment evidence. No production deploy without security clearance. |
190
+
191
+ ## Evidence Requirements for Production Deploy
192
+
193
+ | Evidence | Command | Required |
194
+ |----------|---------|----------|
195
+ | Test suite passes | `npm run test:gate` | ✅ Always |
196
+ | Build succeeds | `npm run build` | ✅ Always |
197
+ | Security scan passes | `snyk test && aikido-api-client scan-release ...` | ✅ For production / public releases |
198
+ | i18n parity | Included in test:gate | ✅ If multilingual |
189
199
 
190
200
  ## The Bottom Line
191
201
 
192
- **Test before deploy. Evidence before claims. Safety before shipping. Non-negotiable.**
202
+ **Test before deploy. Scan before release. Evidence before claims. Safety before shipping. Non-negotiable.**
@@ -31,12 +31,13 @@ SYNTAX CHECK IS GATE 1. IF IT FAILS, NOTHING ELSE RUNS.
31
31
  - After a production incident caused by untested code
32
32
  - Adding CI/CD to an existing project
33
33
 
34
- ## The 7-Gate Pipeline
34
+ ## The 8-Gate Pipeline
35
35
 
36
36
  ```dot
37
37
  digraph pipeline {
38
38
  rankdir=LR;
39
39
  gate0 [label="Gate 0\nSecret\nHygiene", shape=box, style=filled, fillcolor="#ffc0cb"];
40
+ gate05 [label="Gate 0.5\nSecurity\nScan", shape=box, style=filled, fillcolor="#f0b3ff"];
40
41
  gate1 [label="Gate 1\nSyntax", shape=box, style=filled, fillcolor="#ffcccc"];
41
42
  gate2 [label="Gate 2\nTest\nSuite", shape=box, style=filled, fillcolor="#ffe0cc"];
42
43
  gate3 [label="Gate 3\ni18n\nParity", shape=box, style=filled, fillcolor="#e0ccff"];
@@ -45,8 +46,10 @@ digraph pipeline {
45
46
  gate6 [label="Gate 6\nDeploy +\nSmoke", shape=box, style=filled, fillcolor="#cce5ff"];
46
47
  fail [label="STOP\nFix first", shape=box, style=filled, fillcolor="#ff9999"];
47
48
 
48
- gate0 -> gate1 [label="pass"];
49
+ gate0 -> gate05 [label="pass"];
49
50
  gate0 -> fail [label="fail"];
51
+ gate05 -> gate1 [label="pass"];
52
+ gate05 -> fail [label="fail"];
50
53
  gate1 -> gate2 [label="pass"];
51
54
  gate1 -> fail [label="fail"];
52
55
  gate2 -> gate3 [label="pass"];
@@ -165,6 +168,39 @@ wrangler secret put SUPABASE_SERVICE_KEY
165
168
 
166
169
  ---
167
170
 
171
+ ### Gate 0.5: Security Scan (Snyk + Aikido — Parallel)
172
+
173
+ > [!IMPORTANT]
174
+ > **CodyMaster internal:** This gate is MANDATORY. Both Snyk and Aikido must pass.
175
+ > **User projects:** This gate is SUGGESTED by default. Becomes MANDATORY if CVEs or risk flags were detected during development.
176
+
177
+ **Run both scanners in parallel:**
178
+
179
+ ```bash
180
+ # Snyk — dependency vulnerabilities
181
+ snyk test
182
+
183
+ # Aikido — SAST + dependencies + secrets + IaC
184
+ aikido-api-client scan-release <repo> $(git rev-parse HEAD) \
185
+ --minimum-severity-level="HIGH"
186
+ ```
187
+
188
+ **For CodyMaster (maximum strictness):**
189
+ ```bash
190
+ aikido-api-client scan-release <repo> $(git rev-parse HEAD) \
191
+ --minimum-severity-level="HIGH" \
192
+ --fail-on-sast-scan \
193
+ --fail-on-secrets-scan
194
+ ```
195
+
196
+ **Gate decision:**
197
+ - Both pass → proceed to Gate 1
198
+ - Either fails → **STOP. Fix before continuing.** Invoke `cm-security-gate` for remediation.
199
+
200
+ > See `cm-security-gate` for full setup, flag reference, and remediation workflow.
201
+
202
+ ---
203
+
168
204
  ### Gate 1: Syntax Validation (FAST FAIL)
169
205
 
170
206
  > [!IMPORTANT]
@@ -1,10 +1,23 @@
1
1
  ---
2
- description: Pre-production security audit. Run vulnerability scans using Snyk and set up automated GitHub security checks with Jules.
2
+ description: Pre-production security audit and vulnerability scanning. Run Snyk + Aikido dependency scans, OWASP analysis, and set up automated GitHub security checks with Jules. Use when asked to 'run security check', 'security audit', 'kiểm tra bảo mật', 'vulnerability scan', 'Snyk', 'OWASP', or before open-sourcing / commercializing a project.
3
3
  ---
4
- # cm-security-gate — Pre-production Vulnerability Audit
4
+ # cm-security-gate — Mandatory Security Audit & Vulnerability Gate
5
5
 
6
6
  > **No code goes public without a security pass.**
7
- > This skill is the **SUPPLEMENTARY FINAL GATE** before making a project public, commercializing, or open-sourcing.
7
+ > **No CodyMaster release ships without Snyk + Aikido green.**
8
+
9
+ ## Enforcement Policy
10
+
11
+ | Context | Level | What Happens |
12
+ |---------|-------|-------------|
13
+ | **CodyMaster internal** | 🔴 MANDATORY | Both Snyk + Aikido MUST pass. No deploy, no PR merge without green. |
14
+ | **User projects (normal)** | 🟡 SUGGESTED | Recommend scanning, provide easy commands. User may skip. |
15
+ | **User projects (risk detected)** | 🔴 ESCALATED MANDATORY | If CVEs found, errors hit, or risk flags raised → block until resolved. |
16
+
17
+ > [!CAUTION]
18
+ > **The Escalation Rule:** When a user encounters security errors, CVE warnings, or suspicious dependency behavior during development, the agent MUST escalate from "suggested" to "mandatory" — triggering the full Snyk + Aikido scan before any further deploy or push.
19
+
20
+ ---
8
21
 
9
22
  ## When to Use
10
23
 
@@ -13,23 +26,56 @@ description: Pre-production security audit. Run vulnerability scans using Snyk a
13
26
  - Preparing to open-source a repository or launch a commercial product
14
27
  - Adding major third-party dependencies
15
28
  - The project is graduating from alpha/beta to a wider release
29
+ - A user encounters CVE warnings, npm audit alerts, or suspicious dependency behavior
30
+ - Before any CodyMaster release or PR merge
16
31
 
17
32
  **Skip when:**
18
- - Doing quick local prototyping
19
- - Exploring ideas without real user data or production intent
33
+ - Doing quick local prototyping with no real user data
34
+ - Exploring ideas without production intent
20
35
 
21
36
  ---
22
37
 
23
38
  ## Core Capabilities
24
39
 
25
- 1. **Snyk CLI & Aikido CLI Integration:** Scans for known vulnerabilities in open-source dependencies (e.g., `npm`, `pip`, `yarn`, `cargo`) and performs parallel release/PR scanning (SAST, IaC, Secrets).
26
- 2. **Jules CI/CD Recommendation:** Recommends integrating continuous automated security analysis via GitHub.
40
+ 1. **Aikido MCP Server:** Real-time scanning of AI-generated code inside the IDE (vulnerabilities + secrets)
41
+ 2. **Snyk CLI:** Dependency vulnerability scanning (`npm`, `pip`, `yarn`, `cargo`)
42
+ 3. **Aikido CLI:** SAST, IaC, Secrets, and Dependency scanning with release/PR gating
43
+ 4. **Continuous Monitoring:** Snyk dashboard + Aikido dashboard for ongoing protection
44
+ 5. **Jules CI/CD:** Automated security analysis via GitHub on every commit
27
45
 
28
46
  ---
29
47
 
30
48
  ## The Process
31
49
 
32
- ### Phase 1: Preparation (Tooling Check)
50
+ ### Phase 0: Aikido MCP Setup (IDE-Level Real-Time Scanning)
51
+
52
+ > [!IMPORTANT]
53
+ > **One-time setup.** Once configured, every AI coding session automatically scans generated code for vulnerabilities and hardcoded secrets — BEFORE the code is even committed.
54
+
55
+ **Step 1:** Create a Personal Access Token at [Aikido Settings → IDE → MCP](https://app.aikido.dev/settings/integrations/ide/mcp)
56
+
57
+ **Step 2:** Install Aikido MCP server:
58
+ ```bash
59
+ # For Antigravity / Gemini CLI
60
+ gemini mcp add aikido \
61
+ --env AIKIDO_API_KEY=YOUR_TOKEN \
62
+ npx -y @aikidosec/mcp
63
+ ```
64
+
65
+ **Step 3:** Download the Aikido agent rule:
66
+ ```bash
67
+ mkdir -p ~/.gemini/skills/
68
+ curl -fsSL "https://gist.githubusercontent.com/kidk/aa48cad6db80ba4a38493016aae67712/raw/3644397b7df43423e3da06434491b40bbb79dd47/aikido-rule.txt" \
69
+ -o ~/.gemini/skills/aikido-rule.txt
70
+ ```
71
+
72
+ **Step 4:** Restart Antigravity IDE. Aikido MCP is now active.
73
+
74
+ > **What this gives you:** Deterministic, independent security checks on EVERY AI-generated snippet. Not a replacement for CLI scanning — this is the first line of defense, catching issues at write-time.
75
+
76
+ ---
77
+
78
+ ### Phase 1: Preparation (CLI Tooling Check)
33
79
 
34
80
  Verify if the Snyk CLI and Aikido CLI are available:
35
81
  ```bash
@@ -37,19 +83,24 @@ which snyk
37
83
  which aikido-api-client
38
84
  ```
39
85
 
40
- **If Snyk is NOT installed**, provide installation instructions before proceeding:
86
+ **If Snyk is NOT installed:**
41
87
  - **macOS (Homebrew):** `brew tap snyk/tap && brew install snyk`
42
88
  - **npm:** `npm install -g snyk`
43
- - Ensure the user authenticates via `snyk auth` after installation.
89
+ - Authenticate: `snyk auth`
44
90
 
45
- **If Aikido CLI is NOT installed**, provide installation instructions:
91
+ **If Aikido CLI is NOT installed:**
46
92
  - **npm:** `npm install -g @aikidosec/ci-api-client`
47
- - Tell the user to authenticate globally: `aikido-api-client apikey <API-KEY>`
48
- - *Note: API keys are found at [Aikido Integration Settings](https://app.aikido.dev/settings/integrations/continuous-integration).*
93
+ - Set API key: `aikido-api-client apikey <API-KEY>`
94
+ - *API keys: [Aikido CI Integration Settings](https://app.aikido.dev/settings/integrations/continuous-integration)*
95
+
96
+ > [!WARNING]
97
+ > **Two different API keys!** Aikido MCP (real-time IDE scanning) uses a *Personal Access Token*. Aikido CLI (release/PR gating) uses a *CI API key*. Don't mix them.
98
+
99
+ ---
49
100
 
50
101
  ### Phase 2: Execution (Parallel Vulnerability Scan)
51
102
 
52
- Execute security scanning using both tools. They should be run in parallel to save time.
103
+ Execute both tools **in parallel** to save time:
53
104
 
54
105
  **1. Snyk Dependency Scan:**
55
106
  ```bash
@@ -58,20 +109,66 @@ snyk test
58
109
 
59
110
  **2. Aikido Release Scan:**
60
111
  ```bash
61
- aikido-api-client scan-release <repository_id or repository_name> <commit_id> --minimum-severity-level="HIGH"
112
+ aikido-api-client scan-release <repository_id_or_name> <commit_id> \
113
+ --minimum-severity-level="HIGH"
62
114
  ```
63
- *(Tip: You can add `--fail-on-secrets-scan` or `--fail-on-sast-scan` depending on the project type).*
64
115
 
65
- Analyze the output from both tools:
116
+ #### Aikido Scan Flags Reference
117
+
118
+ | Flag | Purpose |
119
+ |------|---------|
120
+ | `--minimum-severity-level` | `LOW`, `MEDIUM`, `HIGH`, `CRITICAL` — set the minimum severity that triggers a failure |
121
+ | `--fail-on-sast-scan` | Fail if SAST (Static Analysis) issues are found |
122
+ | `--fail-on-iac-scan` | Fail if Infrastructure as Code misconfigurations are found |
123
+ | `--fail-on-secrets-scan` | Fail if hardcoded secrets are detected |
124
+
125
+ #### CodyMaster Internal (Maximum Strictness)
126
+ ```bash
127
+ aikido-api-client scan-release <repo> <commit> \
128
+ --minimum-severity-level="HIGH" \
129
+ --fail-on-sast-scan \
130
+ --fail-on-secrets-scan
131
+ ```
132
+
133
+ #### User Projects (Standard)
134
+ ```bash
135
+ aikido-api-client scan-release <repo> <commit> \
136
+ --minimum-severity-level="HIGH"
137
+ ```
138
+
139
+ #### Analyzing Results
66
140
  - **Critical/High:** Must be resolved before making the project public.
67
141
  - **Medium/Low:** Document as technical debt or evaluate for false positives.
68
142
  - Run `snyk monitor` if the user wants continuous monitoring on the Snyk dashboard.
69
143
 
70
- ### Phase 2.5: Vulnerability Remediation (Skill Discovery)
144
+ ---
145
+
146
+ ### Phase 2.5: PR Gating (GitHub Integration)
147
+
148
+ For projects with CI/CD pipelines, add Aikido PR gating to block merging PRs with security issues:
149
+
150
+ ```bash
151
+ # In GitHub Actions or CI script
152
+ aikido-api-client scan-pr <repository_id_or_name> <base_commit_id> <head_commit_id> \
153
+ --minimum-severity-level="HIGH"
154
+ ```
155
+
156
+ **package.json integration:**
157
+ ```json
158
+ {
159
+ "scripts": {
160
+ "test:security": "snyk test && aikido-api-client scan-release $npm_package_name $(git rev-parse HEAD) --minimum-severity-level=HIGH",
161
+ "test:security:strict": "snyk test && aikido-api-client scan-release $npm_package_name $(git rev-parse HEAD) --minimum-severity-level=HIGH --fail-on-dependency-scan --fail-on-sast-scan --fail-on-secrets-scan"
162
+ }
163
+ }
164
+ ```
165
+
166
+ ---
167
+
168
+ ### Phase 3: Vulnerability Remediation (Skill Discovery)
71
169
 
72
- If vulnerabilities are detected (e.g., CSRF, XSS, prototype pollution, outdated dependencies), **DO NOT just list the errors**. CodyMaster must actively search for and suggest specialized remediation skills to the user to fix the vulnerabilities.
170
+ If vulnerabilities are detected, **DO NOT just list errors**. CodyMaster must actively search for remediation skills:
73
171
 
74
- **Message to user:**
75
172
  > 🚨 **Vulnerabilities Detected: Initiating Remediation**
76
173
  >
77
174
  > Security issues were found. To systematically patch these risks, we need specialized weapons. I suggest finding and installing a dedicated remediation skill for your stack:
@@ -80,26 +177,48 @@ If vulnerabilities are detected (e.g., CSRF, XSS, prototype pollution, outdated
80
177
  > ```
81
178
  > *(Once you discover and install the appropriate security patch skills, we will use them to eradicate the vulnerabilities and eliminate all security risks).*
82
179
 
83
- ### Phase 2.6: Knowledge Retention (Memory Sync)
180
+ ---
181
+
182
+ ### Phase 4: Knowledge Retention (Memory Sync)
84
183
 
85
- Once the vulnerabilities have been successfully remediated, the exact root causes and their corresponding fixes **MUST** be memorized so that CodyMaster does not repeat the same mistakes in the future.
184
+ Once vulnerabilities are remediated, the root causes and fixes **MUST** be memorized:
86
185
 
87
186
  **Action Required:**
88
- - Trigger the `cm-continuity` skill to log the security flaw and the applied fix into `CONTINUITY.md` under a "Security Lessons" or "Hard Lessons" section.
89
- - If the project uses cloud memory, suggest tracking this in `cm-notebooklm` to sync this critical security knowledge to the permanent AI brain.
187
+ - Trigger `cm-continuity` to log flaw + fix into `CONTINUITY.md` "Security Lessons" section.
188
+ - If cloud memory is available, sync to `cm-notebooklm` for permanent retention.
90
189
 
91
- ### Phase 3: Automation Handoff (Jules Integration)
190
+ ---
92
191
 
93
- After the manual Snyk scan is complete and the results are presented to the user, **ALWAYS** provide the following suggestion to automate future security checks:
192
+ ### Phase 5: Automation Handoff (Jules + Continuous Monitoring)
94
193
 
95
- > 🛡️ **Next Step: Automated Security Checks via Jules**
194
+ > 🛡️ **Next Step: Automated Security Checks**
96
195
  >
97
- > Once your project is ready for commercial or public release, manual checks aren't enough. It's highly recommended to automate security scanning on every commit and Pull Request.
196
+ > Manual checks aren't enough for production. Automate on every commit and PR:
98
197
  >
99
- > Please use **Google Jules** for automated GitHub security analysis:
198
+ > **Option A Google Jules** (GitHub automated analysis):
100
199
  > 👉 [http://jules.google.com/](http://jules.google.com/)
101
200
  >
102
- > Integrating Jules will automatically catch vulnerabilities in your codebase, ensuring your commercial product remains secure as it scales.
201
+ > **Option B Snyk Continuous Monitoring:**
202
+ > ```bash
203
+ > snyk monitor
204
+ > ```
205
+ >
206
+ > **Option C — Aikido Dashboard** (full visibility):
207
+ > 👉 [https://app.aikido.dev/](https://app.aikido.dev/)
208
+
209
+ ---
210
+
211
+ ## Escalation Protocol
212
+
213
+ When the agent detects ANY of these signals, enforcement escalates from SUGGESTED → MANDATORY:
214
+
215
+ | Signal | Action |
216
+ |--------|--------|
217
+ | `npm audit` reports HIGH/CRITICAL | Trigger full Snyk + Aikido scan |
218
+ | User mentions "security error" or "hack" | Trigger full scan before proceeding |
219
+ | New major dependency added (e.g., new ORM, auth lib) | Suggest scan, escalate if dep has known CVEs |
220
+ | Pre-deploy / pre-PR-merge | Check if scan was run in this session, block if not (CodyMaster only) |
221
+ | `.snyk` policy file has expired ignores | Re-scan and update policy |
103
222
 
104
223
  ---
105
224
 
@@ -107,8 +226,13 @@ After the manual Snyk scan is complete and the results are presented to the user
107
226
 
108
227
  | Skill | Relationship |
109
228
  |-------|-------------|
110
- | `cm-quality-gate` | PRE-REQUISITE: Code should pass functional tests before security audits. |
111
- | `cm-secret-shield`| COMPLEMENTARY: Secret Shield catches hardcoded tokens; `cm-security-gate` catches vulnerable dependencies. Both are needed for public releases. |
112
- | `cm-safe-deploy` | POST-REQUISITE: Security gates should ideally be part of the automated deployment pipeline. |
113
- | `cm-continuity` | MEMORY LOGGING: Records discovered vulnerabilities and their fixes into the local working memory to prevent future recurrences. |
229
+ | `cm-quality-gate` | PRE-REQUISITE: Code should pass functional tests before security audits. Security scan PASS is required evidence for production deploy. |
230
+ | `cm-secret-shield`| COMPLEMENTARY: Secret Shield catches hardcoded tokens at write/commit time; `cm-security-gate` catches vulnerable dependencies and SAST issues. Both are needed. |
231
+ | `cm-safe-deploy` | INTEGRATED: Security scan is Gate 0.5 in the deploy pipeline (between Secret Hygiene and Syntax). |
232
+ | `cm-test-gate` | INTEGRATED: `test:security` script pattern uses Snyk + Aikido CLI for automated scanning in the test suite. |
233
+ | `cm-continuity` | MEMORY: Records discovered vulnerabilities and fixes into working memory. |
114
234
  | `cm-notebooklm` | LONG-TERM MEMORY: Syncs critical security lessons to the permanent cloud AI brain. |
235
+
236
+ ## The Bottom Line
237
+
238
+ **Scan before deploy. Remediate before release. Memorize before repeating. Non-negotiable.**
@@ -65,6 +65,47 @@ Full skill names: `cm-brainstorm-idea`, `cm-planning`, `cm-tdd`, `cm-execution`,
65
65
  - **cm-continuity**: Chain progress persists across sessions via CONTINUITY.md working memory
66
66
  - **cm-execution**: Each chain step delegates to cm-execution for actual implementation
67
67
  - **cm-quality-gate**: Automatically runs at end of each development chain
68
+ - **Context Bus (v5)**: Every chain automatically maintains `.cm/context-bus.json` — shared state across all steps
69
+
70
+ ## Context Bus — Inter-Skill Coordination (v5)
71
+
72
+ When `chain start` runs, the context bus is initialized automatically:
73
+
74
+ ```
75
+ chain start feature-development "add payment flow"
76
+ → Creates .cm/context-bus.json with:
77
+ pipeline: "feature-development"
78
+ session_id: "<uuid>"
79
+ current_step: "brainstorm-idea"
80
+ shared_context: {}
81
+ resource_state: { skeleton_generated: null, learnings_indexed: null, ... }
82
+ ```
83
+
84
+ When `chain advance` runs after each skill completes:
85
+
86
+ ```
87
+ chain advance <exec-id> "summary of what was done"
88
+ → Updates context-bus.json:
89
+ current_step: "planning" ← moved forward
90
+ shared_context.brainstorm-idea: { summary, affected_files, output_path }
91
+ ```
92
+
93
+ **What downstream skills gain:**
94
+ - `cm-planning` can read brainstorm output path → no re-read of full filesystem
95
+ - `cm-tdd` can see which files planning created → targeted test generation
96
+ - `cm-quality-gate` knows exactly which files changed → focused review
97
+
98
+ **Reading the bus:**
99
+ ```bash
100
+ cm continuity bus # terminal pretty-print
101
+ cm_bus_read # MCP tool (Claude Desktop)
102
+ cm://pipeline/current # URI resolver (in skill prompts)
103
+ ```
104
+
105
+ **Publishing to the bus (inside a skill):**
106
+ ```bash
107
+ cm_bus_write skill=cm-planning summary="tasks.md created" output_path=openspec/...
108
+ ```
68
109
 
69
110
  ## For AI Agents
70
111
 
@@ -74,5 +115,10 @@ When dispatching tasks that match a chain pattern:
74
115
  1. Check if task matches a chain: suggestChain(taskTitle)
75
116
  2. If match found, suggest to user: "This task matches the X chain pipeline"
76
117
  3. If user agrees, start the chain and invoke skills in order
77
- 4. After completing each skill, advance the chain
118
+ 4. At the START of each skill step:
119
+ → Read cm://pipeline/current to see upstream skill outputs
120
+ → Check shared_context to avoid re-doing work
121
+ 5. After completing each skill, advance the chain:
122
+ → chain advance <id> "summary"
123
+ → This updates context bus + CONTINUITY.md simultaneously
78
124
  ```
@@ -10,8 +10,15 @@ description: Start the CM Workflow to execute your objective from idea to produc
10
10
  When this workflow is called, the AI Assistant should execute the following action sequence in the spirit of the **CodyMaster Kit**:
11
11
 
12
12
  0. **Load Working Memory:**
13
- Per `_shared/helpers.md#Load-Working-Memory`
14
- - Update `CONTINUITY.md` → set Active Goal to the new objective
13
+ Per `_shared/helpers.md#Load-Working-Memory` — **use Smart Spine order:**
14
+ 1. Check `.cm/context-bus.json` → any active pipeline? any prior skill output to reuse?
15
+ 2. Load L0 indexes: `learnings-index.md` (~100 tok) + `skeleton-index.md` (~500 tok)
16
+ 3. Scope-filter learnings via `cm_query` — only load what matches current objective
17
+ 4. Read `CONTINUITY.md` → set Active Goal to the new objective
18
+ 5. Run token budget check: `cm continuity budget` → confirm no category is over soft limit
19
+
20
+ > ⚡ Total context load: ~700 tokens. Full load used to be ~3,200.
21
+ > Only escalate to L2 (full files) if L0 index explicitly flags a match.
15
22
 
16
23
  0.5. **Skill Coverage Check (Adaptive Discovery):**
17
24
  - Scan the objective for technologies, frameworks, or patterns mentioned
@@ -73,5 +80,7 @@ When this workflow is called, the AI Assistant should execute the following acti
73
80
  4. **Complete:**
74
81
  Per `_shared/helpers.md#Update-Continuity`
75
82
  - Record any new learnings or decisions made during this workflow
83
+ - If inside a skill chain: `cm continuity bus` → verify context bus reflects completed step
84
+ - Refresh L0 indexes: `cm continuity index` (auto-runs on `addLearning`, manual refresh here)
76
85
 
77
86
  > **Note for AI:** If this is a brand new project, suggest running `cm-project-bootstrap` first. If the working environment has a risk of accidentally switching accounts/projects, remind about `cm-identity-guard` (Per `_shared/helpers.md#Identity-Check`).
@@ -199,11 +199,14 @@ Wire these tests into `package.json` to make them easily executable by CI or oth
199
199
  "scripts": {
200
200
  "test": "vitest",
201
201
  "test:gate": "vitest run --reporter=verbose",
202
+ "test:security": "snyk test && aikido-api-client scan-release $npm_package_name $(git rev-parse HEAD) --minimum-severity-level=HIGH",
202
203
  "test:watch": "vitest watch"
203
204
  }
204
205
  }
205
206
  ```
206
207
 
208
+ > **Security Gate Check:** The `test:security` script runs the Snyk dependency check and the Aikido release scan in parallel. See `cm-security-gate` for advanced SAST/IaC flags.
209
+
207
210
  ### Phase 4: Secret Hygiene and Ignore Configuration
208
211
 
209
212
  **NEVER commit `.env` or `.dev.vars`.** Ensure tests do not expose actual production secrets.