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.
- package/CHANGELOG.md +33 -0
- package/README.md +29 -14
- package/commands/demo.md +1 -1
- package/dist/context-bus.js +70 -0
- package/dist/context-db.js +265 -0
- package/dist/continuity.js +12 -0
- package/dist/file-watcher.js +79 -0
- package/dist/index.js +152 -1
- package/dist/l0-indexer.js +158 -0
- package/dist/mcp-context-server.js +400 -0
- package/dist/migrate-json-to-sqlite.js +126 -0
- package/dist/skill-chain.js +19 -3
- package/dist/token-budget.js +108 -0
- package/dist/uri-resolver.js +203 -0
- package/package.json +7 -1
- package/skills/_shared/helpers.md +50 -14
- package/skills/cm-autopilot/SKILL.md +29 -0
- package/skills/cm-autopilot/scripts/autopilot.py +190 -0
- package/skills/cm-continuity/SKILL.md +90 -28
- package/skills/cm-quality-gate/SKILL.md +11 -1
- package/skills/cm-safe-deploy/SKILL.md +38 -2
- package/skills/cm-security-gate/SKILL.md +158 -34
- package/skills/cm-skill-chain/SKILL.md +47 -1
- package/skills/cm-start/SKILL.md +11 -2
- package/skills/cm-test-gate/SKILL.md +3 -0
- package/skills/boxme-git-config/SKILL.md +0 -56
- package/skills/boxme-local-dev/SKILL.md +0 -66
- package/skills/jobs-to-be-done/SKILL.md +0 -266
- package/skills/jobs-to-be-done/references/case-studies.md +0 -154
- package/skills/jobs-to-be-done/references/competitive-strategy.md +0 -280
- package/skills/jobs-to-be-done/references/diagnostics.md +0 -158
- package/skills/jobs-to-be-done/references/innovation-process.md +0 -392
- package/skills/jobs-to-be-done/references/organizational-change.md +0 -328
- package/skills/marketplace-report-crawler/SKILL.md +0 -176
- package/skills/marketplace-report-crawler/config/accounts.json +0 -41
- package/skills/marketplace-report-crawler/config/report-types.json +0 -422
- package/skills/marketplace-report-crawler/config/sessions.json +0 -3
- package/skills/marketplace-report-crawler/scripts/ab-wrapper.sh +0 -102
- package/skills/marketplace-report-crawler/scripts/browser-actions/lazada/lazada-actions.js +0 -114
- package/skills/marketplace-report-crawler/scripts/browser-actions/shopee/shopee-actions.js +0 -94
- package/skills/marketplace-report-crawler/scripts/browser-actions/tiktok/tiktok-actions.js +0 -272
- package/skills/marketplace-report-crawler/scripts/crawl-runner.js +0 -281
- package/skills/marketplace-report-crawler/scripts/session-check.sh +0 -72
- package/skills/marketplace-report-crawler/scripts/session-manager.sh +0 -349
- package/skills/marketplace-report-crawler/scripts/setup-folders.sh +0 -83
- package/skills/medical-research/SKILL.md +0 -194
- package/skills/medical-research/scripts/evidence_checker.py +0 -288
- package/skills/mom-test/SKILL.md +0 -267
- package/skills/mom-test/references/avoiding-bad-data.md +0 -221
- package/skills/mom-test/references/case-studies.md +0 -306
- package/skills/mom-test/references/commitment-advancement.md +0 -219
- package/skills/mom-test/references/finding-conversations.md +0 -251
- package/skills/mom-test/references/processing-learning.md +0 -256
- package/skills/mom-test/references/question-patterns.md +0 -198
- package/skills/pandasai-analytics/SKILL.md +0 -251
- package/skills/release-it/SKILL.md +0 -235
- package/skills/release-it/references/anti-patterns.md +0 -279
- package/skills/release-it/references/capacity-planning.md +0 -285
- package/skills/release-it/references/chaos-engineering.md +0 -325
- package/skills/release-it/references/deployment-strategies.md +0 -331
- package/skills/release-it/references/observability.md +0 -301
- package/skills/release-it/references/stability-patterns.md +0 -355
- package/skills/skill-creator-ultra/.agents/workflows/skill-audit.md +0 -37
- package/skills/skill-creator-ultra/.agents/workflows/skill-compare.md +0 -34
- package/skills/skill-creator-ultra/.agents/workflows/skill-export.md +0 -51
- package/skills/skill-creator-ultra/.agents/workflows/skill-generate.md +0 -39
- package/skills/skill-creator-ultra/.agents/workflows/skill-scaffold.md +0 -52
- package/skills/skill-creator-ultra/.agents/workflows/skill-simulate.md +0 -25
- package/skills/skill-creator-ultra/.agents/workflows/skill-stats.md +0 -31
- package/skills/skill-creator-ultra/.agents/workflows/skill-validate.md +0 -25
- package/skills/skill-creator-ultra/README.md +0 -1242
- package/skills/skill-creator-ultra/SKILL.md +0 -388
- package/skills/skill-creator-ultra/agents/analyzer.md +0 -274
- package/skills/skill-creator-ultra/agents/comparator.md +0 -202
- package/skills/skill-creator-ultra/agents/grader.md +0 -223
- package/skills/skill-creator-ultra/assets/eval_review.html +0 -146
- package/skills/skill-creator-ultra/eval-viewer/generate_review.py +0 -471
- package/skills/skill-creator-ultra/eval-viewer/viewer.html +0 -1325
- package/skills/skill-creator-ultra/examples/example_anthropic_frontend.md +0 -109
- package/skills/skill-creator-ultra/examples/example_anthropic_pdf.md +0 -116
- package/skills/skill-creator-ultra/examples/example_api_docs.md +0 -189
- package/skills/skill-creator-ultra/examples/example_db_migration.md +0 -253
- package/skills/skill-creator-ultra/examples/example_git_commit.md +0 -111
- package/skills/skill-creator-ultra/install.ps1 +0 -289
- package/skills/skill-creator-ultra/install.sh +0 -313
- package/skills/skill-creator-ultra/phases/phase1_interview.md +0 -202
- package/skills/skill-creator-ultra/phases/phase2_extract.md +0 -55
- package/skills/skill-creator-ultra/phases/phase3_detect.md +0 -57
- package/skills/skill-creator-ultra/phases/phase4_generate.md +0 -543
- package/skills/skill-creator-ultra/phases/phase5_test.md +0 -319
- package/skills/skill-creator-ultra/phases/phase6_eval.md +0 -301
- package/skills/skill-creator-ultra/phases/phase7_iterate.md +0 -103
- package/skills/skill-creator-ultra/phases/phase8_optimize.md +0 -113
- package/skills/skill-creator-ultra/resources/advanced_patterns.md +0 -499
- package/skills/skill-creator-ultra/resources/anti_patterns.md +0 -376
- package/skills/skill-creator-ultra/resources/blueprints.md +0 -498
- package/skills/skill-creator-ultra/resources/checklist.md +0 -243
- package/skills/skill-creator-ultra/resources/composition_cookbook.md +0 -291
- package/skills/skill-creator-ultra/resources/description_optimization.md +0 -90
- package/skills/skill-creator-ultra/resources/eval_guide.md +0 -133
- package/skills/skill-creator-ultra/resources/industry_questions.md +0 -189
- package/skills/skill-creator-ultra/resources/interview_questions.md +0 -200
- package/skills/skill-creator-ultra/resources/pattern_detection.md +0 -200
- package/skills/skill-creator-ultra/resources/prompt_engineering.md +0 -531
- package/skills/skill-creator-ultra/resources/schemas.md +0 -430
- package/skills/skill-creator-ultra/resources/script_integration.md +0 -593
- package/skills/skill-creator-ultra/resources/scripts_guide.md +0 -339
- package/skills/skill-creator-ultra/resources/skill_template.md +0 -124
- package/skills/skill-creator-ultra/resources/skill_writing_guide.md +0 -634
- package/skills/skill-creator-ultra/resources/versioning_guide.md +0 -193
- package/skills/skill-creator-ultra/scripts/ci_eval.py +0 -200
- package/skills/skill-creator-ultra/scripts/package_skill.py +0 -165
- package/skills/skill-creator-ultra/scripts/simulate_skill.py +0 -398
- package/skills/skill-creator-ultra/scripts/skill_audit.py +0 -611
- package/skills/skill-creator-ultra/scripts/skill_compare.py +0 -265
- package/skills/skill-creator-ultra/scripts/skill_export.py +0 -334
- package/skills/skill-creator-ultra/scripts/skill_scaffold.py +0 -403
- package/skills/skill-creator-ultra/scripts/skill_stats.py +0 -339
- package/skills/skill-creator-ultra/scripts/validate_skill.py +0 -411
- package/skills/tailwind-mastery/SKILL.md +0 -229
- package/skills/vercel-react-best-practices/AGENTS.md +0 -3373
- package/skills/vercel-react-best-practices/README.md +0 -123
- package/skills/vercel-react-best-practices/SKILL.md +0 -143
- package/skills/vercel-react-best-practices/rules/_sections.md +0 -46
- package/skills/vercel-react-best-practices/rules/_template.md +0 -28
- package/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
- package/skills/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
- package/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
- package/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
- package/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
- package/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -51
- package/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
- package/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
- package/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
- package/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
- package/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
- package/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
- package/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
- package/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
- package/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
- package/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
- package/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
- package/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
- package/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
- package/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
- package/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
- package/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
- package/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
- package/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
- package/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
- package/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
- package/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
- package/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
- package/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
- package/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
- package/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
- package/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
- package/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
- package/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
- package/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
- package/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
- package/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
- package/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
- package/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
- package/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
- package/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
- package/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
- package/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
- package/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
- package/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
- package/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
- package/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
- package/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
- package/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
- package/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
- package/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
- package/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
- package/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +0 -64
- package/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
- package/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md +0 -59
- package/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
- package/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
- package/skills/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
- package/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
- package/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
- package/skills/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
- package/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -142
- package/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
- package/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
- 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
|
-
##
|
|
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
|
-
→
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
|
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
|
-
→
|
|
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 —
|
|
183
|
+
Tier 5: STRUCTURAL CODE MEMORY (optional — code-heavy projects)
|
|
160
184
|
→ CodeGraph — tree-sitter AST → SQLite graph → MCP server
|
|
161
|
-
→
|
|
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
|
|
168
|
-
**
|
|
169
|
-
**
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
|
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 ->
|
|
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
|
|
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 —
|
|
4
|
+
# cm-security-gate — Mandatory Security Audit & Vulnerability Gate
|
|
5
5
|
|
|
6
6
|
> **No code goes public without a security pass.**
|
|
7
|
-
>
|
|
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
|
|
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. **
|
|
26
|
-
2. **
|
|
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
|
|
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
|
|
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
|
-
-
|
|
89
|
+
- Authenticate: `snyk auth`
|
|
44
90
|
|
|
45
|
-
**If Aikido CLI is NOT installed
|
|
91
|
+
**If Aikido CLI is NOT installed:**
|
|
46
92
|
- **npm:** `npm install -g @aikidosec/ci-api-client`
|
|
47
|
-
-
|
|
48
|
-
- *
|
|
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
|
|
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 <
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### Phase 4: Knowledge Retention (Memory Sync)
|
|
84
183
|
|
|
85
|
-
Once
|
|
184
|
+
Once vulnerabilities are remediated, the root causes and fixes **MUST** be memorized:
|
|
86
185
|
|
|
87
186
|
**Action Required:**
|
|
88
|
-
- Trigger
|
|
89
|
-
- If
|
|
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
|
-
|
|
190
|
+
---
|
|
92
191
|
|
|
93
|
-
|
|
192
|
+
### Phase 5: Automation Handoff (Jules + Continuous Monitoring)
|
|
94
193
|
|
|
95
|
-
> 🛡️ **Next Step: Automated Security Checks
|
|
194
|
+
> 🛡️ **Next Step: Automated Security Checks**
|
|
96
195
|
>
|
|
97
|
-
>
|
|
196
|
+
> Manual checks aren't enough for production. Automate on every commit and PR:
|
|
98
197
|
>
|
|
99
|
-
>
|
|
198
|
+
> **Option A — Google Jules** (GitHub automated analysis):
|
|
100
199
|
> 👉 [http://jules.google.com/](http://jules.google.com/)
|
|
101
200
|
>
|
|
102
|
-
>
|
|
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
|
|
112
|
-
| `cm-safe-deploy` |
|
|
113
|
-
| `cm-
|
|
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.
|
|
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
|
```
|
package/skills/cm-start/SKILL.md
CHANGED
|
@@ -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
|
-
|
|
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.
|