codymaster 4.6.0 → 4.8.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.
- package/CHANGELOG.md +19 -1
- package/README.md +80 -30
- package/dist/browse-server.js +251 -0
- package/dist/cli/command-registry.js +26 -0
- package/dist/cli/commands/agent.js +120 -0
- package/dist/cli/commands/dashboard.js +93 -0
- package/dist/cli/commands/design-studio.js +111 -0
- package/dist/cli/commands/distro.js +25 -0
- package/dist/cli/commands/engineering.js +488 -0
- package/dist/cli/commands/project.js +324 -0
- package/dist/cli/commands/skill-chain.js +269 -0
- package/dist/cli/commands/system.js +89 -0
- package/dist/cli/commands/task.js +254 -0
- package/dist/cli/update-check.js +83 -0
- package/dist/cm-config.js +110 -0
- package/dist/cm-suggest.js +77 -0
- package/dist/distro-validate.js +54 -0
- package/dist/guardian-core.js +74 -0
- package/dist/index.js +36 -2759
- package/dist/mcp-context-server.js +60 -1
- package/dist/mcp-skills-tools.js +81 -0
- package/dist/retro-summary.js +70 -0
- package/dist/second-opinion-providers.js +79 -0
- package/dist/sprint-pipeline.js +228 -0
- package/dist/storage-backend.js +5 -60
- package/dist/utils/cli-utils.js +76 -0
- package/dist/utils/skill-utils.js +32 -0
- package/install.sh +274 -50
- package/package.json +16 -5
- package/scripts/build-skills.mjs +51 -0
- package/scripts/gate-0-repo-hygiene.js +75 -0
- package/scripts/postinstall.js +55 -0
- package/scripts/security-scan.js +1 -1
- package/scripts/validate-skills.mjs +42 -0
- package/scripts/viking-demo.ts +105 -0
- package/skills/CLAUDE.md +2 -2
- package/skills/cm-ads-tracker/SKILL.md +3 -6
- package/skills/cm-browse/SKILL.md +28 -0
- package/skills/cm-conductor-worktrees/SKILL.md +24 -0
- package/skills/cm-content-factory/SKILL.md +1 -1
- package/skills/cm-content-factory/landing/docs/content/changelog.md +36 -0
- package/skills/cm-content-factory/landing/docs/content/deployment.md +46 -0
- package/skills/cm-content-factory/landing/docs/content/execution-flow.md +67 -0
- package/skills/cm-content-factory/landing/docs/content/openspace.md +27 -0
- package/skills/cm-content-factory/landing/docs/content/openviking.md +33 -0
- package/skills/cm-content-factory/landing/docs/content/use-cases.md +26 -0
- package/skills/cm-content-factory/landing/docs/content/v5-intro.md +28 -0
- package/skills/cm-content-factory/landing/docs/index.html +240 -0
- package/skills/cm-content-factory/landing/index.html +99 -99
- package/skills/cm-content-factory/landing/script.js +42 -0
- package/skills/cm-content-factory/landing/translations.js +400 -400
- package/skills/cm-design-studio/SKILL.md +30 -0
- package/skills/cm-ecosystem-roadmap/SKILL.md +11 -0
- package/skills/cm-engineering-meta/SKILL.md +69 -0
- package/skills/cm-growth-hacking/SKILL.md +1 -12
- package/skills/cm-guardian-runtime/SKILL.md +22 -0
- package/skills/cm-mcp-engineering/SKILL.md +18 -0
- package/skills/cm-notebooklm/SKILL.md +1 -17
- package/skills/cm-post-deploy-canary/SKILL.md +18 -0
- package/skills/cm-qa-visual-cli/SKILL.md +18 -0
- package/skills/cm-retro-cli/SKILL.md +19 -0
- package/skills/cm-second-opinion-cli/SKILL.md +19 -0
- package/skills/cm-secret-shield/SKILL.md +2 -2
- package/skills/cm-sprint-bus/SKILL.md +29 -0
- package/skills/cm-tdd/SKILL.md +61 -74
- package/skills/profiles/README.md +21 -0
- package/skills/profiles/core.txt +23 -0
- package/skills/profiles/design.txt +6 -0
- package/skills/profiles/full.txt +58 -0
- package/skills/profiles/growth.txt +10 -0
- package/skills/profiles/knowledge.txt +7 -0
- package/scripts/test-gemini.js +0 -13
- package/skills/cm-frappe-agent/SKILL.md +0 -134
- package/skills/cm-frappe-agent/agents/doctype-architect.md +0 -596
- package/skills/cm-frappe-agent/agents/erpnext-customizer.md +0 -643
- package/skills/cm-frappe-agent/agents/frappe-backend.md +0 -814
- package/skills/cm-frappe-agent/agents/frappe-custom-frontend.md +0 -557
- package/skills/cm-frappe-agent/agents/frappe-debugger.md +0 -625
- package/skills/cm-frappe-agent/agents/frappe-fixer.md +0 -275
- package/skills/cm-frappe-agent/agents/frappe-frontend.md +0 -660
- package/skills/cm-frappe-agent/agents/frappe-installer.md +0 -158
- package/skills/cm-frappe-agent/agents/frappe-performance.md +0 -307
- package/skills/cm-frappe-agent/agents/frappe-planner.md +0 -419
- package/skills/cm-frappe-agent/agents/frappe-remote-ops.md +0 -153
- package/skills/cm-frappe-agent/agents/github-workflow.md +0 -286
- package/skills/cm-frappe-agent/commands/frappe-app.md +0 -351
- package/skills/cm-frappe-agent/commands/frappe-backend.md +0 -162
- package/skills/cm-frappe-agent/commands/frappe-bench.md +0 -254
- package/skills/cm-frappe-agent/commands/frappe-debug.md +0 -263
- package/skills/cm-frappe-agent/commands/frappe-doctype-create.md +0 -272
- package/skills/cm-frappe-agent/commands/frappe-doctype-field.md +0 -310
- package/skills/cm-frappe-agent/commands/frappe-erpnext.md +0 -210
- package/skills/cm-frappe-agent/commands/frappe-fix.md +0 -59
- package/skills/cm-frappe-agent/commands/frappe-frontend.md +0 -210
- package/skills/cm-frappe-agent/commands/frappe-fullstack.md +0 -243
- package/skills/cm-frappe-agent/commands/frappe-github.md +0 -57
- package/skills/cm-frappe-agent/commands/frappe-install.md +0 -52
- package/skills/cm-frappe-agent/commands/frappe-plan.md +0 -442
- package/skills/cm-frappe-agent/commands/frappe-remote.md +0 -58
- package/skills/cm-frappe-agent/commands/frappe-test.md +0 -356
- package/skills/cm-frappe-agent/docs/README.md +0 -51
- package/skills/cm-frappe-agent/docs/agents-catalog.md +0 -113
- package/skills/cm-frappe-agent/docs/architecture.md +0 -149
- package/skills/cm-frappe-agent/docs/commands-catalog.md +0 -82
- package/skills/cm-frappe-agent/docs/resources-catalog.md +0 -66
- package/skills/cm-frappe-agent/docs/sitemap-urls.txt +0 -52
- package/skills/cm-frappe-agent/docs/sitemap.md +0 -81
- package/skills/cm-frappe-agent/docs/sop/user-guide.md +0 -178
- package/skills/cm-frappe-agent/docs/sop/vibe-coding-guide.md +0 -122
- package/skills/cm-frappe-agent/resources/7-layer-architecture.md +0 -985
- package/skills/cm-frappe-agent/resources/bench_commands.md +0 -73
- package/skills/cm-frappe-agent/resources/code-patterns-guide.md +0 -948
- package/skills/cm-frappe-agent/resources/common_pitfalls.md +0 -266
- package/skills/cm-frappe-agent/resources/doctype-registry.md +0 -158
- package/skills/cm-frappe-agent/resources/installation-guide.md +0 -289
- package/skills/cm-frappe-agent/resources/rest-api-patterns.md +0 -182
- package/skills/cm-frappe-agent/resources/scaffold_checklist.md +0 -82
- package/skills/cm-frappe-agent/resources/upgrade_patterns.md +0 -113
- package/skills/cm-frappe-agent/resources/web-form-patterns.md +0 -252
- package/skills/cm-frappe-agent/skills/bench-commands/SKILL.md +0 -621
- package/skills/cm-frappe-agent/skills/client-scripts/SKILL.md +0 -642
- package/skills/cm-frappe-agent/skills/doctype-patterns/SKILL.md +0 -576
- package/skills/cm-frappe-agent/skills/frappe-api/SKILL.md +0 -740
- package/skills/cm-frappe-agent/skills/remote-operations/SKILL.md +0 -47
- package/skills/cm-frappe-agent/skills/server-scripts/SKILL.md +0 -608
- package/skills/cm-frappe-agent/skills/web-forms/SKILL.md +0 -46
- package/skills/frappe-app-builder.zip +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# cm-design-studio
|
|
2
|
+
|
|
3
|
+
> Local design-variant workspace: checklist, named variants, and a handoff stub—no external MCP required.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- You want **2–3 UI/UX variants** documented before coding.
|
|
8
|
+
- You need a **repeatable handoff** from design choice to implementation agents.
|
|
9
|
+
- You prefer **files under `.cm/`** over ad-hoc chat-only decisions.
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. From the repo root: `cm design-studio init`
|
|
14
|
+
2. Edit `.cm/design-studio/CHECKLIST.md` and `VARIANTS.md` (name options A/B/C).
|
|
15
|
+
3. Pick a variant; complete `.cm/design-studio/HANDOFF.md` (screens, tokens, prompt stub).
|
|
16
|
+
4. Run implementation skills (e.g. `cm-execution`, `cm-tdd`) **using the HANDOFF prompt stub** as the single source of truth.
|
|
17
|
+
|
|
18
|
+
Optional: `cm design-studio status` — list artifact files.
|
|
19
|
+
|
|
20
|
+
## Output
|
|
21
|
+
|
|
22
|
+
- `.cm/design-studio/README.md` — happy path
|
|
23
|
+
- `.cm/design-studio/CHECKLIST.md`
|
|
24
|
+
- `.cm/design-studio/VARIANTS.md`
|
|
25
|
+
- `.cm/design-studio/HANDOFF.md`
|
|
26
|
+
|
|
27
|
+
## Related
|
|
28
|
+
|
|
29
|
+
- ADR 003 (`docs/adr/003-skill-distro-and-meta.md`) for pack layout when publishing skills.
|
|
30
|
+
- `cm suggest` may recommend other skills based on git + sprint state.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# cm-ecosystem-roadmap — marketplace & distros
|
|
2
|
+
|
|
3
|
+
**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.
|
|
4
|
+
|
|
5
|
+
**Backlog** (community scale-out):
|
|
6
|
+
|
|
7
|
+
- **`cm marketplace`** — starred skills, semver, dependency graph.
|
|
8
|
+
- **`cm install`** / **`cm distro create`** — preset skill packs + branding (SaaS, e-commerce, mobile, agency).
|
|
9
|
+
- **Publish** — npm and/or git tags as distribution channels.
|
|
10
|
+
|
|
11
|
+
Reuse **meta.json** + `SKILL.md.tmpl` from `scripts/build-skills.mjs` for reproducible skill packages.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# cm-engineering-meta — quick wins + access + voice map
|
|
2
|
+
|
|
3
|
+
## Search before building
|
|
4
|
+
|
|
5
|
+
Before adding infrastructure, search in three layers:
|
|
6
|
+
|
|
7
|
+
1. **Tried-and-true** — patterns already in this repo / sibling services.
|
|
8
|
+
2. **New-and-popular** — current docs for your stack version.
|
|
9
|
+
3. **First-principles** — only when 1–2 don’t apply.
|
|
10
|
+
|
|
11
|
+
## AskUserQuestion format
|
|
12
|
+
|
|
13
|
+
When asking the human to choose:
|
|
14
|
+
|
|
15
|
+
- Short **context** (what you already know).
|
|
16
|
+
- Clear **question**.
|
|
17
|
+
- **RECOMMENDATION** (one option you’d pick and why).
|
|
18
|
+
- Lettered options **A / B / C** (not vague yes/no).
|
|
19
|
+
|
|
20
|
+
## Review readiness dashboard (ASCII)
|
|
21
|
+
|
|
22
|
+
Before ship, print a table:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
| Gate | Status | Notes |
|
|
26
|
+
|-------------|--------|-------|
|
|
27
|
+
| Tests | ? | |
|
|
28
|
+
| Lint/Type | ? | |
|
|
29
|
+
| Secrets | ? | |
|
|
30
|
+
| Manual QA | ? | |
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Completeness gap (code review)
|
|
34
|
+
|
|
35
|
+
Flag when an **80% solution** is chosen but the **100%** path costs **< 30 minutes** (tests, edge case, docs).
|
|
36
|
+
|
|
37
|
+
## Investigate Iron Law
|
|
38
|
+
|
|
39
|
+
- Do **not** patch without a **root cause** hypothesis.
|
|
40
|
+
- After **three** failed fix attempts, stop and question architecture or gather more data.
|
|
41
|
+
|
|
42
|
+
## Access controls (Goose-style)
|
|
43
|
+
|
|
44
|
+
- Maintain lists: **autonomous_ok** vs **confirm_required** skill groups (see `.cm/config.example.yaml`).
|
|
45
|
+
- Respect “stop suggesting skill X” in session notes.
|
|
46
|
+
|
|
47
|
+
## Provider abstraction
|
|
48
|
+
|
|
49
|
+
Prefer interfaces for LLM calls so **cm-second-opinion** can swap `OPENAI_API_KEY` / future providers without rewriting skills.
|
|
50
|
+
|
|
51
|
+
## Proactive skill suggestion
|
|
52
|
+
|
|
53
|
+
Infer stage from files touched and git state:
|
|
54
|
+
|
|
55
|
+
- Many `test/` edits → suggest **cm-test-gate**.
|
|
56
|
+
- `Dockerfile` / deploy scripts → **cm-safe-deploy** + **cm canary**.
|
|
57
|
+
- `rm` / migration scripts → **cm-guardian** + **cm-secret-shield**.
|
|
58
|
+
|
|
59
|
+
## Voice-friendly triggers (examples)
|
|
60
|
+
|
|
61
|
+
| Phrase (approx.) | Skill / command |
|
|
62
|
+
|------------------|-----------------|
|
|
63
|
+
| “Run a security check” | cm-secret-shield / cm-security-gate |
|
|
64
|
+
| “Test the website” | cm browse + cm qa-visual |
|
|
65
|
+
| “Code review this” | cm-code-review |
|
|
66
|
+
| “Deploy safely” | cm-safe-deploy |
|
|
67
|
+
| “Log what went wrong” | `cm retro --note "…"` |
|
|
68
|
+
|
|
69
|
+
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,22 @@
|
|
|
1
|
+
# cm-guardian-runtime — destructive command & freeze checks
|
|
2
|
+
|
|
3
|
+
## Commands
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
cm guardian check -- git push --force origin main # exits 1 if blocked
|
|
7
|
+
cm guardian path-check --file ./src/app.ts --roots src,lib
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Behaviour
|
|
11
|
+
|
|
12
|
+
- Regex set for `rm -rf`, `DROP TABLE`, `git push --force`, `git reset --hard`, pipes to shell, etc.
|
|
13
|
+
- Prefix whitelist includes `npm run build`, `npm test`, `npx vitest`.
|
|
14
|
+
- Violations append to `.cm/guardian.log`.
|
|
15
|
+
|
|
16
|
+
## Investigate / debug mode
|
|
17
|
+
|
|
18
|
+
When using **cm-debugging** or root-cause work, treat **freeze roots** as mandatory: only edit inside allowed directories until the hypothesis is proven.
|
|
19
|
+
|
|
20
|
+
## Config
|
|
21
|
+
|
|
22
|
+
See `.cm/config.example.yaml` → `guardian:`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# cm-mcp-engineering — MCP tools on context server
|
|
2
|
+
|
|
3
|
+
The same binary as memory MCP (`dist/mcp-context-server.js`) now exposes **engineering bridge** tools:
|
|
4
|
+
|
|
5
|
+
| Tool | Purpose |
|
|
6
|
+
|------|---------|
|
|
7
|
+
| `cm_plan` | Sprint state + artifact paths + next skill hint |
|
|
8
|
+
| `cm_review` | Preview `.cm/sprint/artifacts/review.md` |
|
|
9
|
+
| `cm_qa` | Pointers to browse daemon + `cm qa-visual` |
|
|
10
|
+
| `cm_deploy` | Hints for safe deploy + canary |
|
|
11
|
+
| `cm_search` | Learnings + decisions search |
|
|
12
|
+
| `cm_memory_query` | Same backing store, alias-style |
|
|
13
|
+
|
|
14
|
+
Existing tools unchanged: `cm_query`, `cm_resolve`, `cm_bus_read`, `cm_bus_write`, `cm_budget_check`, `cm_memory_decay`, `cm_index_refresh`.
|
|
15
|
+
|
|
16
|
+
## Config
|
|
17
|
+
|
|
18
|
+
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,18 @@
|
|
|
1
|
+
# cm-post-deploy-canary — smoke + browse tail
|
|
2
|
+
|
|
3
|
+
## CLI
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
cm canary --url https://app.example.com
|
|
7
|
+
cm canary --url https://app.example.com --browse-port 17395 --token "$CM_BROWSE_TOKEN"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Flow
|
|
11
|
+
|
|
12
|
+
1. **HTTP GET** the URL (status < 400).
|
|
13
|
+
2. Optionally pull **browse daemon** `/console` for recent browser errors after deploy.
|
|
14
|
+
|
|
15
|
+
## Next
|
|
16
|
+
|
|
17
|
+
- Wire into **cm-safe-deploy** as a final step.
|
|
18
|
+
- Add programmatic CWV (Lighthouse) when you need baselines per PR.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# cm-qa-visual-cli — screenshot via browse daemon
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
`cm browse start` running with the same `CM_BROWSE_TOKEN`.
|
|
6
|
+
|
|
7
|
+
## CLI
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cm qa-visual --url http://localhost:5173 --port 17395
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Writes `cm-qa-visual.png` in the current working directory.
|
|
14
|
+
|
|
15
|
+
## Next
|
|
16
|
+
|
|
17
|
+
- Diff against golden images for visual regression.
|
|
18
|
+
- Map `git diff` → affected routes (project-specific heuristics).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# cm-retro-cli — operational learnings JSONL
|
|
2
|
+
|
|
3
|
+
## Append
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
cm retro --project . --tool claude --note "Forgot to run gate before push; CI failed on lint."
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Stored in `.cm/operational-learnings.jsonl`.
|
|
10
|
+
|
|
11
|
+
## Summary
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cm retro --project . --summary
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Use with skill evolution
|
|
18
|
+
|
|
19
|
+
Feed highlights into **cm-skill-evolution** / project learnings DB so future sessions avoid repeating mistakes.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# cm-second-opinion-cli — cross-model review stub
|
|
2
|
+
|
|
3
|
+
## CLI
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
cm second-opinion --file /tmp/my.diff
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
- With `OPENAI_API_KEY`, calls **OpenAI chat completions** (`CM_SECOND_OPINION_MODEL` optional, default `gpt-4o-mini`).
|
|
10
|
+
- Without key, prints a **stub** reminder (no network).
|
|
11
|
+
|
|
12
|
+
## Safety
|
|
13
|
+
|
|
14
|
+
- **Never** paste secrets or production credentials into the diff file.
|
|
15
|
+
- Prefer unified diffs of **application code** only.
|
|
16
|
+
|
|
17
|
+
## Roadmap
|
|
18
|
+
|
|
19
|
+
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 = "
|
|
83
|
-
fetch('https://api.example.com', { headers: { Authorization: 'Bearer
|
|
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;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# cm-sprint-bus — opinionated pipeline + artifacts
|
|
2
|
+
|
|
3
|
+
## Pipeline
|
|
4
|
+
|
|
5
|
+
`brainstorm → plan → design → tdd → build → review → qa → security → ship → monitor → retro`
|
|
6
|
+
|
|
7
|
+
## CLI
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cm sprint init --project .
|
|
11
|
+
cm sprint init --from plan --project . # jump in mid-pipeline
|
|
12
|
+
cm sprint status --project .
|
|
13
|
+
cm sprint complete plan -m "$(cat plan-notes.md)" --project .
|
|
14
|
+
cm sprint dry-run --project .
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Artifacts
|
|
18
|
+
|
|
19
|
+
- `.cm/sprint/state.json`
|
|
20
|
+
- `.cm/sprint/artifacts/<step>.md`
|
|
21
|
+
- `.cm/sprint/events.jsonl`
|
|
22
|
+
|
|
23
|
+
## Skill mapping (hints)
|
|
24
|
+
|
|
25
|
+
Each step maps to existing CodyMaster skills (see `skillMappingForStep` in `src/sprint-pipeline.ts`). Use `cm sprint status` for the **next** recommended skill.
|
|
26
|
+
|
|
27
|
+
## Context bus
|
|
28
|
+
|
|
29
|
+
This complements `.cm/context-bus.json` (skill-chain). Prefer **sprint files** for linear release trains; use **context bus** for ad-hoc chains.
|
package/skills/cm-tdd/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
## name: cm-tdd
|
|
3
4
|
description: Use when implementing any feature or bugfix, before writing implementation code
|
|
4
|
-
---
|
|
5
5
|
|
|
6
6
|
# Test-Driven Development (TDD)
|
|
7
7
|
|
|
@@ -16,12 +16,14 @@ Write the test first. Watch it fail. Write minimal code to pass.
|
|
|
16
16
|
## When to Use
|
|
17
17
|
|
|
18
18
|
**Always:**
|
|
19
|
+
|
|
19
20
|
- New features
|
|
20
21
|
- Bug fixes
|
|
21
22
|
- Refactoring
|
|
22
23
|
- Behavior changes
|
|
23
24
|
|
|
24
25
|
**Exceptions (ask your human partner):**
|
|
26
|
+
|
|
25
27
|
- Throwaway prototypes
|
|
26
28
|
- Generated code
|
|
27
29
|
- Configuration files
|
|
@@ -37,6 +39,7 @@ NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
|
|
|
37
39
|
Write code before the test? Delete it. Start over.
|
|
38
40
|
|
|
39
41
|
**No exceptions:**
|
|
42
|
+
|
|
40
43
|
- Don't keep it as "reference"
|
|
41
44
|
- Don't "adapt" it while writing tests
|
|
42
45
|
- Don't look at it
|
|
@@ -83,21 +86,14 @@ Before writing ANY test, check `.cm/CONTINUITY.md`:
|
|
|
83
86
|
|
|
84
87
|
Write one minimal test showing what should happen.
|
|
85
88
|
|
|
86
|
-
<
|
|
87
|
-
```typescript
|
|
88
|
-
test('retries failed operations 3 times', async () => {
|
|
89
|
-
let attempts = 0;
|
|
90
|
-
const operation = () => {
|
|
91
|
-
attempts++;
|
|
92
|
-
if (attempts < 3) throw new Error('fail');
|
|
93
|
-
return 'success';
|
|
94
|
-
};
|
|
89
|
+
```typescript test('retries failed operations 3 times', async () => { let attempts = 0; const operation = () => { attempts++; if (attempts < 3) throw new Error('fail'); return 'success'; };
|
|
95
90
|
|
|
96
91
|
const result = await retryOperation(operation);
|
|
97
92
|
|
|
98
93
|
expect(result).toBe('success');
|
|
99
94
|
expect(attempts).toBe(3);
|
|
100
95
|
});
|
|
96
|
+
|
|
101
97
|
```
|
|
102
98
|
Clear name, tests real behavior, one thing
|
|
103
99
|
</Good>
|
|
@@ -113,10 +109,12 @@ test('retry works', async () => {
|
|
|
113
109
|
expect(mock).toHaveBeenCalledTimes(3);
|
|
114
110
|
});
|
|
115
111
|
```
|
|
112
|
+
|
|
116
113
|
Vague name, tests mock not code
|
|
117
|
-
|
|
114
|
+
|
|
118
115
|
|
|
119
116
|
**Requirements:**
|
|
117
|
+
|
|
120
118
|
- One behavior
|
|
121
119
|
- Clear name
|
|
122
120
|
- Real code (no mocks unless unavoidable)
|
|
@@ -130,6 +128,7 @@ npm test path/to/test.test.ts
|
|
|
130
128
|
```
|
|
131
129
|
|
|
132
130
|
Confirm:
|
|
131
|
+
|
|
133
132
|
- Test fails (not errors)
|
|
134
133
|
- Failure message is expected
|
|
135
134
|
- Fails because feature missing (not typos)
|
|
@@ -142,37 +141,9 @@ Confirm:
|
|
|
142
141
|
|
|
143
142
|
Write simplest code to pass the test.
|
|
144
143
|
|
|
145
|
-
<
|
|
146
|
-
```typescript
|
|
147
|
-
async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
|
|
148
|
-
for (let i = 0; i < 3; i++) {
|
|
149
|
-
try {
|
|
150
|
-
return await fn();
|
|
151
|
-
} catch (e) {
|
|
152
|
-
if (i === 2) throw e;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
throw new Error('unreachable');
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
Just enough to pass
|
|
159
|
-
</Good>
|
|
144
|
+
```typescript async function retryOperation(fn: () => Promise): Promise { for (let i = 0; i < 3; i++) { try { return await fn(); } catch (e) { if (i === 2) throw e; } } throw new Error('unreachable'); } ``` Just enough to pass
|
|
160
145
|
|
|
161
|
-
|
|
162
|
-
```typescript
|
|
163
|
-
async function retryOperation<T>(
|
|
164
|
-
fn: () => Promise<T>,
|
|
165
|
-
options?: {
|
|
166
|
-
maxRetries?: number;
|
|
167
|
-
backoff?: 'linear' | 'exponential';
|
|
168
|
-
onRetry?: (attempt: number) => void;
|
|
169
|
-
}
|
|
170
|
-
): Promise<T> {
|
|
171
|
-
// YAGNI
|
|
172
|
-
}
|
|
173
|
-
```
|
|
174
|
-
Over-engineered
|
|
175
|
-
</Bad>
|
|
146
|
+
```typescript async function retryOperation( fn: () => Promise, options?: { maxRetries?: number; backoff?: 'linear' | 'exponential'; onRetry?: (attempt: number) => void; } ): Promise { // YAGNI } ``` Over-engineered
|
|
176
147
|
|
|
177
148
|
Don't add features, refactor other code, or "improve" beyond the test.
|
|
178
149
|
|
|
@@ -185,6 +156,7 @@ npm test path/to/test.test.ts
|
|
|
185
156
|
```
|
|
186
157
|
|
|
187
158
|
Confirm:
|
|
159
|
+
|
|
188
160
|
- Test passes
|
|
189
161
|
- Other tests still pass
|
|
190
162
|
- Output pristine (no errors, warnings)
|
|
@@ -196,6 +168,7 @@ Confirm:
|
|
|
196
168
|
### REFACTOR - Clean Up
|
|
197
169
|
|
|
198
170
|
After green only:
|
|
171
|
+
|
|
199
172
|
- Remove duplication
|
|
200
173
|
- Improve names
|
|
201
174
|
- Extract helpers
|
|
@@ -208,17 +181,20 @@ Next failing test for next feature.
|
|
|
208
181
|
|
|
209
182
|
## Good Tests
|
|
210
183
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
|
214
|
-
| **
|
|
215
|
-
| **
|
|
184
|
+
|
|
185
|
+
| Quality | Good | Bad |
|
|
186
|
+
| ---------------- | ----------------------------------- | --------------------------------------------------- |
|
|
187
|
+
| **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
|
|
188
|
+
| **Clear** | Name describes behavior | `test('test1')` |
|
|
189
|
+
| **Shows intent** | Demonstrates desired API | Obscures what code should do |
|
|
190
|
+
|
|
216
191
|
|
|
217
192
|
## Why Order Matters
|
|
218
193
|
|
|
219
194
|
**"I'll write tests after to verify it works"**
|
|
220
195
|
|
|
221
196
|
Tests written after code pass immediately. Passing immediately proves nothing:
|
|
197
|
+
|
|
222
198
|
- Might test wrong thing
|
|
223
199
|
- Might test implementation, not behavior
|
|
224
200
|
- Might miss edge cases you forgot
|
|
@@ -229,6 +205,7 @@ Test-first forces you to see the test fail, proving it actually tests something.
|
|
|
229
205
|
**"I already manually tested all the edge cases"**
|
|
230
206
|
|
|
231
207
|
Manual testing is ad-hoc. You think you tested everything but:
|
|
208
|
+
|
|
232
209
|
- No record of what you tested
|
|
233
210
|
- Can't re-run when code changes
|
|
234
211
|
- Easy to forget cases under pressure
|
|
@@ -239,6 +216,7 @@ Automated tests are systematic. They run the same way every time.
|
|
|
239
216
|
**"Deleting X hours of work is wasteful"**
|
|
240
217
|
|
|
241
218
|
Sunk cost fallacy. The time is already gone. Your choice now:
|
|
219
|
+
|
|
242
220
|
- Delete and rewrite with TDD (X more hours, high confidence)
|
|
243
221
|
- Keep it and add tests after (30 min, low confidence, likely bugs)
|
|
244
222
|
|
|
@@ -247,6 +225,7 @@ The "waste" is keeping code you can't trust. Working code without real tests is
|
|
|
247
225
|
**"TDD is dogmatic, being pragmatic means adapting"**
|
|
248
226
|
|
|
249
227
|
TDD IS pragmatic:
|
|
228
|
+
|
|
250
229
|
- Finds bugs before commit (faster than debugging after)
|
|
251
230
|
- Prevents regressions (tests catch breaks immediately)
|
|
252
231
|
- Documents behavior (tests show how to use code)
|
|
@@ -266,19 +245,21 @@ Tests-first force edge case discovery before implementing. Tests-after verify yo
|
|
|
266
245
|
|
|
267
246
|
## Common Rationalizations
|
|
268
247
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
|
272
|
-
| "
|
|
273
|
-
| "
|
|
274
|
-
| "
|
|
275
|
-
| "
|
|
276
|
-
| "
|
|
277
|
-
| "
|
|
278
|
-
| "
|
|
279
|
-
| "
|
|
280
|
-
| "
|
|
281
|
-
| "
|
|
248
|
+
|
|
249
|
+
| Excuse | Reality |
|
|
250
|
+
| -------------------------------------- | ----------------------------------------------------------------------- |
|
|
251
|
+
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
|
|
252
|
+
| "I'll test after" | Tests passing immediately prove nothing. |
|
|
253
|
+
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
|
|
254
|
+
| "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
|
|
255
|
+
| "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
|
|
256
|
+
| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
|
|
257
|
+
| "Need to explore first" | Fine. Throw away exploration, start with TDD. |
|
|
258
|
+
| "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
|
|
259
|
+
| "TDD will slow me down" | TDD faster than debugging. Pragmatic = test-first. |
|
|
260
|
+
| "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
|
|
261
|
+
| "Existing code has no tests" | You're improving it. Add tests for existing code. |
|
|
262
|
+
|
|
282
263
|
|
|
283
264
|
## Red Flags - STOP and Start Over
|
|
284
265
|
|
|
@@ -303,6 +284,7 @@ Tests-first force edge case discovery before implementing. Tests-after verify yo
|
|
|
303
284
|
**Bug:** Empty email accepted
|
|
304
285
|
|
|
305
286
|
**RED**
|
|
287
|
+
|
|
306
288
|
```typescript
|
|
307
289
|
test('rejects empty email', async () => {
|
|
308
290
|
const result = await submitForm({ email: '' });
|
|
@@ -311,12 +293,14 @@ test('rejects empty email', async () => {
|
|
|
311
293
|
```
|
|
312
294
|
|
|
313
295
|
**Verify RED**
|
|
296
|
+
|
|
314
297
|
```bash
|
|
315
298
|
$ npm test
|
|
316
299
|
FAIL: expected 'Email required', got undefined
|
|
317
300
|
```
|
|
318
301
|
|
|
319
302
|
**GREEN**
|
|
303
|
+
|
|
320
304
|
```typescript
|
|
321
305
|
function submitForm(data: FormData) {
|
|
322
306
|
if (!data.email?.trim()) {
|
|
@@ -327,6 +311,7 @@ function submitForm(data: FormData) {
|
|
|
327
311
|
```
|
|
328
312
|
|
|
329
313
|
**Verify GREEN**
|
|
314
|
+
|
|
330
315
|
```bash
|
|
331
316
|
$ npm test
|
|
332
317
|
PASS
|
|
@@ -339,25 +324,27 @@ Extract validation for multiple fields if needed.
|
|
|
339
324
|
|
|
340
325
|
Before marking work complete:
|
|
341
326
|
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
327
|
+
- Every new function/method has a test
|
|
328
|
+
- Watched each test fail before implementing
|
|
329
|
+
- Each test failed for expected reason (feature missing, not typo)
|
|
330
|
+
- Wrote minimal code to pass each test
|
|
331
|
+
- All tests pass
|
|
332
|
+
- Output pristine (no errors, warnings)
|
|
333
|
+
- Tests use real code (mocks only if unavoidable)
|
|
334
|
+
- Edge cases and errors covered
|
|
350
335
|
|
|
351
336
|
Can't check all boxes? You skipped TDD. Start over.
|
|
352
337
|
|
|
353
338
|
## When Stuck
|
|
354
339
|
|
|
355
|
-
|
|
356
|
-
|
|
340
|
+
|
|
341
|
+
| Problem | Solution |
|
|
342
|
+
| ---------------------- | -------------------------------------------------------------------- |
|
|
357
343
|
| Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
|
|
358
|
-
| Test too complicated
|
|
359
|
-
| Must mock everything
|
|
360
|
-
| Test setup huge
|
|
344
|
+
| Test too complicated | Design too complicated. Simplify interface. |
|
|
345
|
+
| Must mock everything | Code too coupled. Use dependency injection. |
|
|
346
|
+
| Test setup huge | Extract helpers. Still complex? Simplify design. |
|
|
347
|
+
|
|
361
348
|
|
|
362
349
|
## Debugging Integration
|
|
363
350
|
|
|
@@ -372,4 +359,4 @@ Production code → test exists and failed first
|
|
|
372
359
|
Otherwise → not TDD
|
|
373
360
|
```
|
|
374
361
|
|
|
375
|
-
No exceptions without your human partner's permission.
|
|
362
|
+
No exceptions without your human partner's permission.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Skill install profiles (Antigravity / Windsurf / token budget)
|
|
2
|
+
|
|
3
|
+
Use with `install.sh`:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bash install.sh --gemini --profile core
|
|
7
|
+
bash install.sh --antigravity --profile core
|
|
8
|
+
bash install.sh --windsurf --profile core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- **core** — Orchestration, TDD, debugging, quality gates, deploy, secrets, identity, terminal (~21 skills). Recommended for global `~/.gemini/antigravity/skills`.
|
|
12
|
+
- **growth** — Ads tracking, CRO, content factory, forms, dashboard, etc. Add on top of core (re-run install to the same target) or install only into a workspace project folder.
|
|
13
|
+
- **design** — UX Master, design system, UI preview, JTBD, brainstorm.
|
|
14
|
+
- **knowledge** — Dockit, NotebookLM skill, deep search, code intelligence, project bootstrap, reactor.
|
|
15
|
+
- **full** — All skills (default when `--profile` is omitted). Same set as [full.txt](full.txt).
|
|
16
|
+
|
|
17
|
+
**Global vs workspace:** Keep **core** in user global skills; add **growth** / **design** / **knowledge** under the project (e.g. `.gemini/antigravity/skills` in repo) so every session does not load the full catalog.
|
|
18
|
+
|
|
19
|
+
**MCP:** Disable unused MCP servers in the IDE to avoid retry loops when a server errors; heavy external tools belong in optional profiles, not core.
|
|
20
|
+
|
|
21
|
+
**Maintainers:** When adding a new `skills/cm-*` folder, update [full.txt](full.txt) and add the skill to the appropriate optional profile (`growth`, `design`, or `knowledge`) if it is not part of `core`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# CodyMaster profile: core — Antigravity/Windsurf token budget (orchestration + quality + safety)
|
|
2
|
+
# Install: bash install.sh --gemini --profile core
|
|
3
|
+
cm-skill-index
|
|
4
|
+
cm-how-it-work
|
|
5
|
+
cm-start
|
|
6
|
+
cm-planning
|
|
7
|
+
cm-execution
|
|
8
|
+
cm-continuity
|
|
9
|
+
cm-status
|
|
10
|
+
cm-tdd
|
|
11
|
+
cm-debugging
|
|
12
|
+
cm-code-review
|
|
13
|
+
cm-clean-code
|
|
14
|
+
cm-quality-gate
|
|
15
|
+
cm-test-gate
|
|
16
|
+
cm-safe-deploy
|
|
17
|
+
cm-secret-shield
|
|
18
|
+
cm-identity-guard
|
|
19
|
+
cm-security-gate
|
|
20
|
+
cm-safe-i18n
|
|
21
|
+
cm-skill-chain
|
|
22
|
+
cm-git-worktrees
|
|
23
|
+
cm-terminal
|