codymaster 4.6.0 → 5.2.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 (161) hide show
  1. package/CHANGELOG.md +74 -8
  2. package/README.md +192 -95
  3. package/dist/advisory-handoff.js +89 -0
  4. package/dist/advisory-report.js +105 -0
  5. package/dist/browse-server.js +251 -0
  6. package/dist/cli/command-registry.js +34 -0
  7. package/dist/cli/commands/agent.js +120 -0
  8. package/dist/cli/commands/bench.js +69 -0
  9. package/dist/cli/commands/brain.js +108 -0
  10. package/dist/cli/commands/dashboard.js +93 -0
  11. package/dist/cli/commands/design-studio.js +111 -0
  12. package/dist/cli/commands/distro.js +25 -0
  13. package/dist/cli/commands/engineering.js +596 -0
  14. package/dist/cli/commands/evolve.js +123 -0
  15. package/dist/cli/commands/mcp-serve.js +104 -0
  16. package/dist/cli/commands/project.js +324 -0
  17. package/dist/cli/commands/skill-chain.js +269 -0
  18. package/dist/cli/commands/system.js +89 -0
  19. package/dist/cli/commands/task.js +254 -0
  20. package/dist/cli/update-check.js +83 -0
  21. package/dist/cm-config.js +92 -0
  22. package/dist/cm-suggest.js +77 -0
  23. package/dist/codybench/judges/automated.js +31 -0
  24. package/dist/codybench/runners/claude-code.js +32 -0
  25. package/dist/codybench/suites/memory-retention.js +85 -0
  26. package/dist/codybench/suites/tdd-regression.js +35 -0
  27. package/dist/codybench/suites/token-efficiency.js +55 -0
  28. package/dist/codybench/types.js +2 -0
  29. package/dist/context-db.js +157 -0
  30. package/dist/continuity.js +2 -6
  31. package/dist/distro-validate.js +54 -0
  32. package/dist/execution-analyzer.js +138 -0
  33. package/dist/guardian-core.js +74 -0
  34. package/dist/index.js +36 -2759
  35. package/dist/indexer/skills-lib.js +533 -0
  36. package/dist/indexer/skills-map.js +1374 -0
  37. package/dist/indexer/skills.js +16 -0
  38. package/dist/learning-promoter.js +246 -0
  39. package/dist/mcp-context-server.js +289 -1
  40. package/dist/mcp-skills-tools.js +81 -0
  41. package/dist/retro-summary.js +70 -0
  42. package/dist/second-opinion-providers.js +79 -0
  43. package/dist/skill-chain.js +63 -1
  44. package/dist/skill-evolver.js +456 -0
  45. package/dist/skill-execution-cache.js +254 -0
  46. package/dist/smart-brain-router.js +184 -0
  47. package/dist/sprint-pipeline.js +228 -0
  48. package/dist/storage-backend.js +14 -67
  49. package/dist/token-budget.js +88 -0
  50. package/dist/utils/cli-utils.js +76 -0
  51. package/dist/utils/skill-utils.js +32 -0
  52. package/package.json +17 -7
  53. package/scripts/build-skills.mjs +51 -0
  54. package/scripts/gate-0-repo-hygiene.js +75 -0
  55. package/scripts/postinstall.js +34 -28
  56. package/scripts/security-scan.js +1 -1
  57. package/scripts/validate-skills.mjs +42 -0
  58. package/skills/CLAUDE.md +2 -7
  59. package/skills/_shared/helpers.md +2 -8
  60. package/skills/cm-ads-tracker/SKILL.md +3 -6
  61. package/skills/cm-browse/SKILL.md +34 -0
  62. package/skills/cm-conductor-worktrees/SKILL.md +28 -0
  63. package/skills/cm-content-factory/SKILL.md +1 -1
  64. package/skills/cm-content-factory/landing/docs/content/changelog.md +36 -0
  65. package/skills/cm-content-factory/landing/docs/content/deployment.md +46 -0
  66. package/skills/cm-content-factory/landing/docs/content/execution-flow.md +67 -0
  67. package/skills/cm-content-factory/landing/docs/content/memory-system.md +38 -0
  68. package/skills/cm-content-factory/landing/docs/content/openspace.md +27 -0
  69. package/skills/cm-content-factory/landing/docs/content/use-cases.md +26 -0
  70. package/skills/cm-content-factory/landing/docs/content/v5-intro.md +28 -0
  71. package/skills/cm-content-factory/landing/docs/index.html +240 -0
  72. package/skills/cm-content-factory/landing/index.html +100 -100
  73. package/skills/cm-content-factory/landing/script.js +42 -0
  74. package/skills/cm-content-factory/landing/translations.js +400 -400
  75. package/skills/cm-continuity/SKILL.md +32 -33
  76. package/skills/cm-design-studio/SKILL.md +34 -0
  77. package/skills/cm-ecosystem-roadmap/SKILL.md +15 -0
  78. package/skills/cm-engineering-meta/SKILL.md +73 -0
  79. package/skills/cm-growth-hacking/SKILL.md +1 -12
  80. package/skills/cm-guardian-runtime/SKILL.md +26 -0
  81. package/skills/cm-mcp-engineering/SKILL.md +22 -0
  82. package/skills/cm-notebooklm/SKILL.md +1 -17
  83. package/skills/cm-post-deploy-canary/SKILL.md +22 -0
  84. package/skills/cm-project-bootstrap/SKILL.md +11 -0
  85. package/skills/cm-qa-visual-cli/SKILL.md +22 -0
  86. package/skills/cm-retro-cli/SKILL.md +23 -0
  87. package/skills/cm-second-opinion-cli/SKILL.md +23 -0
  88. package/skills/cm-secret-shield/SKILL.md +2 -2
  89. package/skills/cm-security-gate/SKILL.md +1 -0
  90. package/skills/cm-skill-chain/SKILL.md +25 -4
  91. package/skills/cm-skill-evolution/SKILL.md +83 -0
  92. package/skills/cm-skill-health/SKILL.md +83 -0
  93. package/skills/cm-skill-index/SKILL.md +11 -3
  94. package/skills/cm-skill-search/SKILL.md +49 -0
  95. package/skills/cm-skill-share/SKILL.md +58 -0
  96. package/skills/cm-sprint-bus/SKILL.md +33 -0
  97. package/skills/cm-start/SKILL.md +0 -10
  98. package/skills/cm-tdd/SKILL.md +59 -72
  99. package/skills/profiles/README.md +21 -0
  100. package/skills/profiles/core.txt +23 -0
  101. package/skills/profiles/design.txt +6 -0
  102. package/skills/profiles/full.txt +62 -0
  103. package/skills/profiles/growth.txt +10 -0
  104. package/skills/profiles/knowledge.txt +7 -0
  105. package/install.sh +0 -901
  106. package/scripts/test-gemini.js +0 -13
  107. package/skills/cm-frappe-agent/SKILL.md +0 -134
  108. package/skills/cm-frappe-agent/agents/doctype-architect.md +0 -596
  109. package/skills/cm-frappe-agent/agents/erpnext-customizer.md +0 -643
  110. package/skills/cm-frappe-agent/agents/frappe-backend.md +0 -814
  111. package/skills/cm-frappe-agent/agents/frappe-custom-frontend.md +0 -557
  112. package/skills/cm-frappe-agent/agents/frappe-debugger.md +0 -625
  113. package/skills/cm-frappe-agent/agents/frappe-fixer.md +0 -275
  114. package/skills/cm-frappe-agent/agents/frappe-frontend.md +0 -660
  115. package/skills/cm-frappe-agent/agents/frappe-installer.md +0 -158
  116. package/skills/cm-frappe-agent/agents/frappe-performance.md +0 -307
  117. package/skills/cm-frappe-agent/agents/frappe-planner.md +0 -419
  118. package/skills/cm-frappe-agent/agents/frappe-remote-ops.md +0 -153
  119. package/skills/cm-frappe-agent/agents/github-workflow.md +0 -286
  120. package/skills/cm-frappe-agent/commands/frappe-app.md +0 -351
  121. package/skills/cm-frappe-agent/commands/frappe-backend.md +0 -162
  122. package/skills/cm-frappe-agent/commands/frappe-bench.md +0 -254
  123. package/skills/cm-frappe-agent/commands/frappe-debug.md +0 -263
  124. package/skills/cm-frappe-agent/commands/frappe-doctype-create.md +0 -272
  125. package/skills/cm-frappe-agent/commands/frappe-doctype-field.md +0 -310
  126. package/skills/cm-frappe-agent/commands/frappe-erpnext.md +0 -210
  127. package/skills/cm-frappe-agent/commands/frappe-fix.md +0 -59
  128. package/skills/cm-frappe-agent/commands/frappe-frontend.md +0 -210
  129. package/skills/cm-frappe-agent/commands/frappe-fullstack.md +0 -243
  130. package/skills/cm-frappe-agent/commands/frappe-github.md +0 -57
  131. package/skills/cm-frappe-agent/commands/frappe-install.md +0 -52
  132. package/skills/cm-frappe-agent/commands/frappe-plan.md +0 -442
  133. package/skills/cm-frappe-agent/commands/frappe-remote.md +0 -58
  134. package/skills/cm-frappe-agent/commands/frappe-test.md +0 -356
  135. package/skills/cm-frappe-agent/docs/README.md +0 -51
  136. package/skills/cm-frappe-agent/docs/agents-catalog.md +0 -113
  137. package/skills/cm-frappe-agent/docs/architecture.md +0 -149
  138. package/skills/cm-frappe-agent/docs/commands-catalog.md +0 -82
  139. package/skills/cm-frappe-agent/docs/resources-catalog.md +0 -66
  140. package/skills/cm-frappe-agent/docs/sitemap-urls.txt +0 -52
  141. package/skills/cm-frappe-agent/docs/sitemap.md +0 -81
  142. package/skills/cm-frappe-agent/docs/sop/user-guide.md +0 -178
  143. package/skills/cm-frappe-agent/docs/sop/vibe-coding-guide.md +0 -122
  144. package/skills/cm-frappe-agent/resources/7-layer-architecture.md +0 -985
  145. package/skills/cm-frappe-agent/resources/bench_commands.md +0 -73
  146. package/skills/cm-frappe-agent/resources/code-patterns-guide.md +0 -948
  147. package/skills/cm-frappe-agent/resources/common_pitfalls.md +0 -266
  148. package/skills/cm-frappe-agent/resources/doctype-registry.md +0 -158
  149. package/skills/cm-frappe-agent/resources/installation-guide.md +0 -289
  150. package/skills/cm-frappe-agent/resources/rest-api-patterns.md +0 -182
  151. package/skills/cm-frappe-agent/resources/scaffold_checklist.md +0 -82
  152. package/skills/cm-frappe-agent/resources/upgrade_patterns.md +0 -113
  153. package/skills/cm-frappe-agent/resources/web-form-patterns.md +0 -252
  154. package/skills/cm-frappe-agent/skills/bench-commands/SKILL.md +0 -621
  155. package/skills/cm-frappe-agent/skills/client-scripts/SKILL.md +0 -642
  156. package/skills/cm-frappe-agent/skills/doctype-patterns/SKILL.md +0 -576
  157. package/skills/cm-frappe-agent/skills/frappe-api/SKILL.md +0 -740
  158. package/skills/cm-frappe-agent/skills/remote-operations/SKILL.md +0 -47
  159. package/skills/cm-frappe-agent/skills/server-scripts/SKILL.md +0 -608
  160. package/skills/cm-frappe-agent/skills/web-forms/SKILL.md +0 -46
  161. package/skills/frappe-app-builder.zip +0 -0
@@ -52,21 +52,9 @@ cm continuity migrate
52
52
  # Export SQLite back to JSON (backup)
53
53
  cm continuity export
54
54
 
55
- # ── OpenViking backend (optional) ────────────────────────
56
- # 1. Install OpenViking server (Python 3.10+)
57
- pip install openviking --upgrade
58
-
59
- # 2. Configure ~/.openviking/ov.conf with embedding provider, then start:
60
- openviking start # Runs on localhost:1933 by default
61
-
62
- # 3. Switch CodyMaster to use OpenViking in .cm/config.yaml:
63
- # storage:
64
- # backend: viking
65
- # viking:
66
- # host: localhost
67
- # port: 1933
68
- # workspace: codymaster
69
- # timeout: 60000
55
+ # ── Legacy config note ────────────────────────────────────
56
+ # CodyMaster's supported default path is SQLite + FTS5.
57
+ # Older configs may still say `storage.backend: viking`; CodyMaster now warns and falls back to SQLite.
70
58
  ```
71
59
 
72
60
  ## The Protocol
@@ -187,12 +175,12 @@ Tier 3: LONG-TERM MEMORY (30+ days, only if reinforced)
187
175
  · decisions table + decisions_fts
188
176
  · skill_outputs per session/chain
189
177
  · indexes table (cached L0/L1 content + staleness hash)
190
- Optional: OpenViking backend (storage.backend: viking in .cm/config.yaml)
178
+ Legacy config note: `storage.backend: viking` now falls back to SQLite
191
179
  · True vector semantic search — finds "async timeout" even when you query "network delay"
192
180
  · L0/L1/L2 auto-generated by engine — no manual cm continuity index needed
193
181
  · Session compression + long-term memory extraction built-in
194
182
  · Graph relations between memories (link/unlink)
195
- · Setup: pip install openviking && openviking start
183
+ · No separate OpenViking setup remains in the supported runtime
196
184
  → Fallback: .cm/memory/learnings.json + decisions.json (kept for compat)
197
185
  → L0 indexes: .cm/learnings-index.md (~100 tok), .cm/skeleton-index.md (~500 tok)
198
186
  · Auto-regenerated on addLearning() + on demand via cm continuity index
@@ -215,27 +203,38 @@ Tier 5: STRUCTURAL CODE MEMORY (optional — code-heavy projects)
215
203
  **context bus = "what did upstream skills produce in this chain?"**
216
204
  **L0 indexes = "cheapest possible memory load (~600 tokens)"**
217
205
  **context.db = "keyword search across all learnings + decisions"**
218
- **OpenViking (opt.) = "semantic vector search + auto L0/L1 + session compression"**
206
+ **Legacy `viking` config = "compatibility fallback to SQLite, not a separate backend"**
219
207
  **qmd (optional) = "find what was written across hundreds of docs"**
220
208
 
221
- ### MCP Context Server (Claude Desktop integration)
222
-
223
- Seven tools exposed over stdio to Claude Desktop and MCP-compatible clients:
209
+ ### MCP Context Server (Claude Desktop, Goose, and any MCP client)
224
210
 
225
- | Tool | Purpose |
226
- |---|---|
227
- | `cm_query` | FTS5 keyword search — learnings, decisions, or both |
228
- | `cm_resolve` | Load any `cm://` URI at L0/L1/L2 depth |
229
- | `cm_bus_read` | Read live context bus state |
230
- | `cm_bus_write` | Publish skill output to the bus |
231
- | `cm_budget_check` | Pre-flight token check by category |
232
- | `cm_memory_decay` | Archive expired learnings (supports dry_run) |
233
- | `cm_index_refresh` | Regenerate L0 indexes on demand |
211
+ Fifteen tools exposed over stdio — start with `cm mcp-serve`:
234
212
 
235
213
  ```bash
236
- # Get install snippet for Claude Desktop config
237
- cm continuity mcp
238
- ```
214
+ # Start MCP server (stdio)
215
+ cm mcp-serve --project /path/to/project
216
+
217
+ # Print config snippet for Claude Desktop or Goose
218
+ cm mcp-serve --print-config
219
+ ```
220
+
221
+ | Tool | Purpose | Since |
222
+ |---|---|---|
223
+ | `cm_query` | FTS5 keyword search — learnings, decisions, or both | v4.5 |
224
+ | `cm_resolve` | Load any `cm://` URI at L0/L1/L2 depth | v4.5 |
225
+ | `cm_bus_read` | Read live context bus state | v4.5 |
226
+ | `cm_bus_write` | Publish skill output to the bus | v4.5 |
227
+ | `cm_budget_check` | Pre-flight token check by category | v4.5 |
228
+ | `cm_memory_decay` | Archive expired learnings (supports dry_run) | v4.5 |
229
+ | `cm_index_refresh` | Regenerate L0 indexes on demand | v4.5 |
230
+ | `cm_plan` | Sprint + pipeline snapshot bridge | v4.8 |
231
+ | `cm_review` | Review artifact hints | v4.8 |
232
+ | `cm_qa` | QA workflow hints | v4.8 |
233
+ | `cm_deploy` | Deploy workflow hints | v4.8 |
234
+ | `cm_search` | Search learnings/decisions (alias) | v4.8 |
235
+ | `cm_memory_query` | Memory search (alias) | v4.8 |
236
+ | `cm_memory_write` | Persist a learning with auto-detected category, scope, TTL | v5.1 |
237
+ | `cm_natural` | NLI router: "remember that…" / "forget…" / "what did we learn…" | v5.1 |
239
238
 
240
239
  ### cm:// URI Scheme
241
240
 
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: cm-design-studio
3
+ description: "Use when you need to create 2-3 UI/UX design variants and document a repeatable handoff before coding."
4
+ ---
5
+ # cm-design-studio
6
+
7
+ > Local design-variant workspace: checklist, named variants, and a handoff stub—no external MCP required.
8
+
9
+ ## When to use
10
+
11
+ - You want **2–3 UI/UX variants** documented before coding.
12
+ - You need a **repeatable handoff** from design choice to implementation agents.
13
+ - You prefer **files under `.cm/`** over ad-hoc chat-only decisions.
14
+
15
+ ## Steps
16
+
17
+ 1. From the repo root: `cm design-studio init`
18
+ 2. Edit `.cm/design-studio/CHECKLIST.md` and `VARIANTS.md` (name options A/B/C).
19
+ 3. Pick a variant; complete `.cm/design-studio/HANDOFF.md` (screens, tokens, prompt stub).
20
+ 4. Run implementation skills (e.g. `cm-execution`, `cm-tdd`) **using the HANDOFF prompt stub** as the single source of truth.
21
+
22
+ Optional: `cm design-studio status` — list artifact files.
23
+
24
+ ## Output
25
+
26
+ - `.cm/design-studio/README.md` — happy path
27
+ - `.cm/design-studio/CHECKLIST.md`
28
+ - `.cm/design-studio/VARIANTS.md`
29
+ - `.cm/design-studio/HANDOFF.md`
30
+
31
+ ## Related
32
+
33
+ - ADR 003 (`docs/adr/003-skill-distro-and-meta.md`) for pack layout when publishing skills.
34
+ - `cm suggest` may recommend other skills based on git + sprint state.
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: cm-ecosystem-roadmap
3
+ description: "Use when exploring the CodyMaster skill ecosystem roadmap, marketplace, or distro validation."
4
+ ---
5
+ # cm-ecosystem-roadmap — marketplace & distros
6
+
7
+ **In CLI today:** `cm distro validate <dir>` checks skill folder layout; see **ADR 003** (`docs/adr/003-skill-distro-and-meta.md`) for `meta.json` + tmpl rules.
8
+
9
+ **Backlog** (community scale-out):
10
+
11
+ - **`cm marketplace`** — starred skills, semver, dependency graph.
12
+ - **`cm install`** / **`cm distro create`** — preset skill packs + branding (SaaS, e-commerce, mobile, agency).
13
+ - **Publish** — npm and/or git tags as distribution channels.
14
+
15
+ Reuse **meta.json** + `SKILL.md.tmpl` from `scripts/build-skills.mjs` for reproducible skill packages.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: cm-engineering-meta
3
+ description: "Use when looking up quick wins, access patterns, or voice map for the engineering meta layer."
4
+ ---
5
+ # cm-engineering-meta — quick wins + access + voice map
6
+
7
+ ## Search before building
8
+
9
+ Before adding infrastructure, search in three layers:
10
+
11
+ 1. **Tried-and-true** — patterns already in this repo / sibling services.
12
+ 2. **New-and-popular** — current docs for your stack version.
13
+ 3. **First-principles** — only when 1–2 don’t apply.
14
+
15
+ ## AskUserQuestion format
16
+
17
+ When asking the human to choose:
18
+
19
+ - Short **context** (what you already know).
20
+ - Clear **question**.
21
+ - **RECOMMENDATION** (one option you’d pick and why).
22
+ - Lettered options **A / B / C** (not vague yes/no).
23
+
24
+ ## Review readiness dashboard (ASCII)
25
+
26
+ Before ship, print a table:
27
+
28
+ ```
29
+ | Gate | Status | Notes |
30
+ |-------------|--------|-------|
31
+ | Tests | ? | |
32
+ | Lint/Type | ? | |
33
+ | Secrets | ? | |
34
+ | Manual QA | ? | |
35
+ ```
36
+
37
+ ## Completeness gap (code review)
38
+
39
+ Flag when an **80% solution** is chosen but the **100%** path costs **< 30 minutes** (tests, edge case, docs).
40
+
41
+ ## Investigate Iron Law
42
+
43
+ - Do **not** patch without a **root cause** hypothesis.
44
+ - After **three** failed fix attempts, stop and question architecture or gather more data.
45
+
46
+ ## Access controls (Goose-style)
47
+
48
+ - Maintain lists: **autonomous_ok** vs **confirm_required** skill groups (see `.cm/config.example.yaml`).
49
+ - Respect “stop suggesting skill X” in session notes.
50
+
51
+ ## Provider abstraction
52
+
53
+ Prefer interfaces for LLM calls so **cm-second-opinion** can swap `OPENAI_API_KEY` / future providers without rewriting skills.
54
+
55
+ ## Proactive skill suggestion
56
+
57
+ Infer stage from files touched and git state:
58
+
59
+ - Many `test/` edits → suggest **cm-test-gate**.
60
+ - `Dockerfile` / deploy scripts → **cm-safe-deploy** + **cm canary**.
61
+ - `rm` / migration scripts → **cm-guardian** + **cm-secret-shield**.
62
+
63
+ ## Voice-friendly triggers (examples)
64
+
65
+ | Phrase (approx.) | Skill / command |
66
+ |------------------|-----------------|
67
+ | “Run a security check” | cm-secret-shield / cm-security-gate |
68
+ | “Test the website” | cm browse + cm qa-visual |
69
+ | “Code review this” | cm-code-review |
70
+ | “Deploy safely” | cm-safe-deploy |
71
+ | “Log what went wrong” | `cm retro --note "…"` |
72
+
73
+ Use Whisper / AquaVoice → paste transcript; map keywords to the table above.
@@ -1,17 +1,6 @@
1
1
  ---
2
2
  name: cm-growth-hacking
3
- description: |
4
- Growth Hacking Engine — Bottom Sheet + Calendar + Trigger + CRO Tracking.
5
- Modular system for booking popups, lead capture, flash sales, surveys, re-engagement.
6
- Auto-detect industry → select pattern → generate bottom sheet + calendar CTA + tracking.
7
- Zero dependencies, works on any static or dynamic site.
8
-
9
- Kế thừa và liên kết với: cm-booking-calendar, cm-ads-tracker, cm-google-form, cm-readit, cm-ux-master.
10
-
11
- ALWAYS trigger for: bottom sheet, popup, đặt lịch, booking popup, lead capture, exit intent,
12
- engagement, "tạo popup", "thêm bottom sheet", "popup đặt lịch", "nhắc lịch hẹn",
13
- "add to calendar", "google calendar", "apple calendar", flash sale popup, survey popup,
14
- "tăng conversion", "giảm bounce", re-engagement, "popup CTA"
3
+ description: "Bottom-sheet and popup growth system: booking CTAs, calendars, lead capture, surveys, re-engagement, with CRO tracking hooks. Zero-deps; works static or dynamic sites. Works with cm-booking-calendar, cm-ads-tracker, cm-google-form, cm-readit, cm-ux-master."
15
4
  allowed-tools: Read, Write, Edit, Glob, Grep, Browser
16
5
  version: 1.0
17
6
  priority: HIGH
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: cm-guardian-runtime
3
+ description: "Use when you need to check if a destructive command is blocked or run guardian freeze checks."
4
+ ---
5
+ # cm-guardian-runtime — destructive command & freeze checks
6
+
7
+ ## Commands
8
+
9
+ ```bash
10
+ cm guardian check -- git push --force origin main # exits 1 if blocked
11
+ cm guardian path-check --file ./src/app.ts --roots src,lib
12
+ ```
13
+
14
+ ## Behaviour
15
+
16
+ - Regex set for `rm -rf`, `DROP TABLE`, `git push --force`, `git reset --hard`, pipes to shell, etc.
17
+ - Prefix whitelist includes `npm run build`, `npm test`, `npx vitest`.
18
+ - Violations append to `.cm/guardian.log`.
19
+
20
+ ## Investigate / debug mode
21
+
22
+ When using **cm-debugging** or root-cause work, treat **freeze roots** as mandatory: only edit inside allowed directories until the hypothesis is proven.
23
+
24
+ ## Config
25
+
26
+ See `.cm/config.example.yaml` → `guardian:`. Hook patterns (Cursor / Codex): [docs/workflows/guardian-hooks.md](../../docs/workflows/guardian-hooks.md) (repo root).
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: cm-mcp-engineering
3
+ description: "Use when you need to interact with the MCP engineering bridge tools (cm_plan, cm_review, cm_qa, cm_deploy, cm_search)."
4
+ ---
5
+ # cm-mcp-engineering — MCP tools on context server
6
+
7
+ The same binary as memory MCP (`dist/mcp-context-server.js`) now exposes **engineering bridge** tools:
8
+
9
+ | Tool | Purpose |
10
+ |------|---------|
11
+ | `cm_plan` | Sprint state + artifact paths + next skill hint |
12
+ | `cm_review` | Preview `.cm/sprint/artifacts/review.md` |
13
+ | `cm_qa` | Pointers to browse daemon + `cm qa-visual` |
14
+ | `cm_deploy` | Hints for safe deploy + canary |
15
+ | `cm_search` | Learnings + decisions search |
16
+ | `cm_memory_query` | Same backing store, alias-style |
17
+
18
+ Existing tools unchanged: `cm_query`, `cm_resolve`, `cm_bus_read`, `cm_bus_write`, `cm_budget_check`, `cm_memory_decay`, `cm_index_refresh`.
19
+
20
+ ## Config
21
+
22
+ Point `--project` at the repo root (or `CM_PROJECT_PATH`).
@@ -1,22 +1,6 @@
1
1
  ---
2
2
  name: cm-notebooklm
3
- description: |
4
- CodyMaster NotebookLM — Cloud-based AI brain/soul engine. Stores the most
5
- valuable knowledge (skills, lessons learned, coding experiences, key decisions)
6
- into Google NotebookLM for cross-machine sync and AI-powered recall.
7
- Combines cm-dockit (codebase → docs) + cm-deep-search (local BM25) +
8
- NotebookLM (cloud AI memory + podcast + flashcards).
9
-
10
- Offers LOCAL vs CLOUD choice for large codebases. Auto-sync mechanism.
11
- Selective indexing — only high-value content, not everything.
12
-
13
- Use when user says: "notebooklm", "notebook lm", "nlm", "nạp kiến thức",
14
- "knowledge base", "create notebook", "sync skills to notebook", "tạo notebook",
15
- "knowledge memory", "podcast từ skills", "flashcards từ docs",
16
- "add to notebooklm", "query notebooklm", "hỏi notebooklm",
17
- "lưu kinh nghiệm", "bộ nhớ AI", "AI memory", "tạo podcast",
18
- "codymaster notebook", "skill notebook", "sync knowledge",
19
- "cloud brain", "soul sync", "cross-machine sync".
3
+ description: "Sync high-value dev knowledge (skills, decisions, lessons) into Google NotebookLM for cloud recall, podcasts, and flashcards. Pairs with Dockit/deep-search. Use for NotebookLM, nlm, knowledge base, skill sync, or cross-machine AI memory."
20
4
  ---
21
5
 
22
6
  # Goal
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: cm-post-deploy-canary
3
+ description: "Use after deployment to run smoke tests and post-deploy canary checks via the browse daemon."
4
+ ---
5
+ # cm-post-deploy-canary — smoke + browse tail
6
+
7
+ ## CLI
8
+
9
+ ```bash
10
+ cm canary --url https://app.example.com
11
+ cm canary --url https://app.example.com --browse-port 17395 --token "$CM_BROWSE_TOKEN"
12
+ ```
13
+
14
+ ## Flow
15
+
16
+ 1. **HTTP GET** the URL (status < 400).
17
+ 2. Optionally pull **browse daemon** `/console` for recent browser errors after deploy.
18
+
19
+ ## Next
20
+
21
+ - Wire into **cm-safe-deploy** as a final step.
22
+ - Add programmatic CWV (Lighthouse) when you need baselines per PR.
@@ -1318,6 +1318,16 @@ Add this line to the AGENTS.md "Important Rules" section:
1318
1318
 
1319
1319
  ```markdown
1320
1320
  - Read `.cm/CONTINUITY.md` at the start of every session for context
1321
+ - Rely on `.cm/project-skills.md` for skill discovery rather than external indexes
1322
+ ```
1323
+
1324
+ ### Step 5: Build Local Project Skills Index
1325
+
1326
+ Run the CodyMaster CLI indexer to detect the tech stack deterministically and pre-compile the needed community skills without wasting LLM tokens.
1327
+
1328
+ ```bash
1329
+ # This scans package.json/go.mod/etc and outputs to .cm/project-skills.md
1330
+ npx cm index skills
1321
1331
  ```
1322
1332
 
1323
1333
  ### Why This Saves Tokens
@@ -1373,4 +1383,5 @@ After bootstrap, the project MUST have:
1373
1383
  ✅ production branch — Production deploys
1374
1384
  ✅ First commit — "chore: bootstrap with cm-project-bootstrap v2.0"
1375
1385
  ✅ .cm/CONTINUITY.md — Working memory for AI context persistence
1386
+ ✅ .cm/project-skills.md — Localized token-efficient skill discovery index
1376
1387
  ```
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: cm-qa-visual-cli
3
+ description: "Use when you need to take screenshots or run visual QA via the browse daemon CLI."
4
+ ---
5
+ # cm-qa-visual-cli — screenshot via browse daemon
6
+
7
+ ## Prerequisites
8
+
9
+ `cm browse start` running with the same `CM_BROWSE_TOKEN`.
10
+
11
+ ## CLI
12
+
13
+ ```bash
14
+ cm qa-visual --url http://localhost:5173 --port 17395
15
+ ```
16
+
17
+ Writes `cm-qa-visual.png` in the current working directory.
18
+
19
+ ## Next
20
+
21
+ - Diff against golden images for visual regression.
22
+ - Map `git diff` → affected routes (project-specific heuristics).
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: cm-retro-cli
3
+ description: "Use at end of sprint to append operational learnings as structured JSONL to the project retro log."
4
+ ---
5
+ # cm-retro-cli — operational learnings JSONL
6
+
7
+ ## Append
8
+
9
+ ```bash
10
+ cm retro --project . --tool claude --note "Forgot to run gate before push; CI failed on lint."
11
+ ```
12
+
13
+ Stored in `.cm/operational-learnings.jsonl`.
14
+
15
+ ## Summary
16
+
17
+ ```bash
18
+ cm retro --project . --summary
19
+ ```
20
+
21
+ ## Use with skill evolution
22
+
23
+ Feed highlights into **cm-skill-evolution** / project learnings DB so future sessions avoid repeating mistakes.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: cm-second-opinion-cli
3
+ description: "Use when you need a cross-model review or second opinion on a diff or code change."
4
+ ---
5
+ # cm-second-opinion-cli — cross-model review stub
6
+
7
+ ## CLI
8
+
9
+ ```bash
10
+ cm second-opinion --file /tmp/my.diff
11
+ ```
12
+
13
+ - With `OPENAI_API_KEY`, calls **OpenAI chat completions** (`CM_SECOND_OPINION_MODEL` optional, default `gpt-4o-mini`).
14
+ - Without key, prints a **stub** reminder (no network).
15
+
16
+ ## Safety
17
+
18
+ - **Never** paste secrets or production credentials into the diff file.
19
+ - Prefer unified diffs of **application code** only.
20
+
21
+ ## Roadmap
22
+
23
+ Add Anthropic / Google / Ollama providers via shared provider interface (see **cm-engineering-meta**).
@@ -79,8 +79,8 @@ ROTATION is not optional after a leak.
79
79
  // ❌ NEVER write code like this:
80
80
  const API_KEY = "sk-proj-abc123def456ghi789";
81
81
  const SUPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...";
82
- const DB_PASSWORD = "MyP@ssw0rd123!";
83
- fetch('https://api.example.com', { headers: { Authorization: 'Bearer sk-...' } });
82
+ const DB_PASSWORD = "<YOUR_SECURE_PASSWORD>";
83
+ fetch('https://api.example.com', { headers: { Authorization: 'Bearer <YOUR_TOKEN>' } });
84
84
 
85
85
  // ✅ ALWAYS write code like this:
86
86
  const API_KEY = process.env.API_KEY;
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: cm-security-gate
2
3
  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
4
  ---
4
5
  # cm-security-gate — Mandatory Security Audit & Vulnerability Gate
@@ -37,8 +37,9 @@ Full skill names: `cm-brainstorm-idea`, `cm-planning`, `cm-tdd`, `cm-execution`,
37
37
 
38
38
  ## Built-in Chains
39
39
 
40
- ### 🚀 feature-development (6 steps)
41
- `brainstorm-idea → planning → tdd → execution → quality-gate → safe-deploy`
40
+ ### 🚀 feature-development (up to 3 active steps)
41
+ `brainstorm-idea* → planning → tdd → execution → quality-gate → safe-deploy*`
42
+ *optional steps — only activated when task context scores them relevant
42
43
 
43
44
  ### 🐛 bug-fix (3 steps)
44
45
  `debugging → tdd → quality-gate`
@@ -46,12 +47,32 @@ Full skill names: `cm-brainstorm-idea`, `cm-planning`, `cm-tdd`, `cm-execution`,
46
47
  ### 📝 content-launch (3 steps)
47
48
  `content-factory → ads-tracker → cm-cro-methodology`
48
49
 
49
- ### 🏗️ new-project (6 steps)
50
- `project-bootstrap → planning → tdd → execution → quality-gate → safe-deploy`
50
+ ### 🏗️ new-project (up to 3 active steps)
51
+ `project-bootstrap → planning → tdd → execution → quality-gate → safe-deploy*`
52
+ *optional steps selected by task relevance
51
53
 
52
54
  ### 🔍 cm-code-review (3 steps)
53
55
  `cm-code-review → quality-gate → safe-deploy`
54
56
 
57
+ ## Intelligent Skill Selection (v5.1)
58
+
59
+ Chains no longer execute every step blindly. `selectTopSkills()` dynamically selects the **top 3 most relevant steps** for each task:
60
+
61
+ ```
62
+ Task: "fix login timeout bug"
63
+ → Scores each step by keyword overlap with task description
64
+ → Mandatory steps (condition='always', optional=false) always included first
65
+ → Optional steps ranked by relevance score, capped at 3 total
66
+ → Result: debugging (score 105) → tdd (score 101) → quality-gate (score 100)
67
+ ```
68
+
69
+ **Why it matters (SkillsBench research):**
70
+ - 2-3 focused skills → **+18.6pp** task performance
71
+ - 4+ skills → **+5.9pp**
72
+ - Monolithic loading → **-2.9pp**
73
+
74
+ If a chain has more than 3 mandatory steps, all mandatory steps run and a performance advisory is logged.
75
+
55
76
  ## Workflow
56
77
 
57
78
  1. **Start**: Use `chain auto` for auto-detection or `chain start` for specific chains
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: cm-skill-evolution
3
+ description: "Repair or extend CodyMaster skills with a three-mode loop: FIX, DERIVED, and CAPTURED, grounded in current repo tooling."
4
+ ---
5
+
6
+ # cm-skill-evolution
7
+
8
+ Use this skill after `cm-skill-health` identifies a degraded or broken skill, or when `cm advisory handoff --for cm-skill-evolution` produces a structured recovery note.
9
+
10
+ ## Modes
11
+
12
+ ### FIX
13
+ Use when the skill should exist already but is inaccurate, broken, or partially missing.
14
+
15
+ Checklist:
16
+ - repair broken references
17
+ - restore missing support files
18
+ - align docs and profiles
19
+ - re-run skill validation and test gate
20
+
21
+ ### DERIVED
22
+ Use when the original promise was too ambitious, but the repo has enough primitives to ship a truthful MVP.
23
+
24
+ Checklist:
25
+ - keep the same user problem
26
+ - reduce claims to what the code can support today
27
+ - reuse existing repo building blocks instead of inventing a new subsystem
28
+
29
+ ### CAPTURED
30
+ Use when the main value is operational learning rather than a new code path.
31
+
32
+ Checklist:
33
+ - append the lesson with `cm retro --project . --tool skill --note "..."`
34
+ - record durable context in `.cm/CONTINUITY.md`
35
+ - update the relevant skill so future sessions do not repeat the same failure
36
+
37
+ ## Evolution Loop
38
+
39
+ 1. Start from the health note.
40
+ - Preferred source: `cm advisory handoff --for cm-skill-evolution`
41
+ 2. Pick one mode only.
42
+ 3. Define the smallest truthful recovery.
43
+ 4. Patch the skill and its discovery surfaces.
44
+ 5. Verify:
45
+ - `npm run validate:skills`
46
+ - `npm run check:skills`
47
+ - repo test gate if code or docs wiring changed materially
48
+ 6. Capture the lesson in retro and continuity.
49
+
50
+ ## Decision guide
51
+
52
+ - The feature existed and drifted: `FIX`
53
+ - The changelog promised more than the repo ever shipped: `DERIVED`
54
+ - The issue is mainly process and should inform future work: `CAPTURED`
55
+
56
+ ## Output
57
+
58
+ ```md
59
+ ## Skill Evolution
60
+ - Skill: cm-...
61
+ - Mode: FIX | DERIVED | CAPTURED
62
+ - Change: ...
63
+ - Verification: ...
64
+ - Learning captured: yes | no
65
+ ```
66
+
67
+ Preferred advisory input:
68
+
69
+ ```md
70
+ ## Advisory Handoff
71
+ - Consumer: cm-skill-evolution
72
+ - Skill: cm-...
73
+ - Recovery path: FIX | DERIVED | CAPTURED | NONE
74
+ - Confidence: 0.xx
75
+ - Source analysis: EA-...
76
+ - Task: ...
77
+ - Status: completed | partial | failed
78
+ - Evidence: ...
79
+ - Selected skills: ...
80
+ - Target skills: ...
81
+ - Quality weight: 0.xx
82
+ - Next step: ...
83
+ ```
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: cm-skill-health
3
+ description: "Operational health review for CodyMaster skills using current repo signals: validate-skills, suggest, retro logs, memory, and test gates."
4
+ ---
5
+
6
+ # cm-skill-health
7
+
8
+ Use this skill when a CodyMaster skill feels stale, misleading, unreliable, or under-documented.
9
+
10
+ ## What it checks
11
+
12
+ 1. Discovery drift
13
+ - Is the skill present in `skills/`, docs indexes, profiles, and README surfaces?
14
+ 2. Invocation friction
15
+ - Does `cm suggest` point users to the skill when the task matches?
16
+ 3. Operational evidence
17
+ - Are there recurring failures or learnings in `.cm/operational-learnings.jsonl`?
18
+ 4. Contract health
19
+ - Does the skill reference commands, files, or paths that still exist?
20
+ 5. Release safety
21
+ - Does the repo still pass `npm run validate:skills`, `npm run check:skills`, and the test gate?
22
+
23
+ ## Workflow
24
+
25
+ 1. Confirm the symptom.
26
+ - Missing from docs
27
+ - Missing from profiles
28
+ - Broken references inside `SKILL.md`
29
+ - Repeated runtime pain in retro notes
30
+ 2. Compare the live skill against:
31
+ - `docs/skills/index.md`
32
+ - `skills/profiles/full.txt`
33
+ - `README.md`
34
+ - related changelog promises
35
+ 3. Scan evidence sources.
36
+ - `cm advisory handoff --for cm-skill-health`
37
+ - `cm suggest --project .`
38
+ - `cm retro summary --project .`
39
+ - `.cm/CONTINUITY.md`
40
+ - `rg` over `skills/`, `docs/`, and `src/`
41
+ 4. Score the issue.
42
+ - `healthy`: discoverable, accurate, references valid
43
+ - `degraded`: present but misleading or inconsistent
44
+ - `broken`: missing, invalid, or unusable
45
+ 5. Hand off to:
46
+ - `cm-skill-evolution` to repair or derive the next version
47
+
48
+ ## Output
49
+
50
+ Produce a short health note:
51
+
52
+ ```md
53
+ ## Skill Health
54
+ - Skill: cm-...
55
+ - Status: healthy | degraded | broken
56
+ - Symptoms: ...
57
+ - Evidence: ...
58
+ - Recovery path: FIX | DERIVED | CAPTURED
59
+ ```
60
+
61
+ Preferred input contract:
62
+
63
+ ```md
64
+ ## Advisory Handoff
65
+ - Consumer: cm-skill-health
66
+ - Skill: cm-...
67
+ - Recovery path: FIX | DERIVED | CAPTURED | NONE
68
+ - Confidence: 0.xx
69
+ - Source analysis: EA-...
70
+ - Task: ...
71
+ - Status: completed | partial | failed
72
+ - Evidence: ...
73
+ - Selected skills: ...
74
+ - Target skills: ...
75
+ - Quality weight: 0.xx
76
+ - Next step: ...
77
+ ```
78
+
79
+ ## Red flags
80
+
81
+ - Do not claim metric dashboards or automatic scoring unless the repo actually implements them.
82
+ - Do not treat README marketing copy as proof that a skill exists.
83
+ - Do not evolve the skill before identifying whether the problem is docs drift, packaging drift, or missing implementation.