liteagents 3.0.0 → 3.6.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 +158 -1
- package/README.md +113 -169
- package/installer/cli.js +4 -2
- package/installer/package-manager.js +3 -1
- package/package.json +4 -3
- package/packages/ampcode/AGENT.md +10 -18
- package/packages/ampcode/agents/code-developer.md +11 -17
- package/packages/ampcode/agents/orchestrator.md +1 -1
- package/packages/ampcode/agents/quality-assurance.md +3 -1
- package/packages/ampcode/{commands/brainstorming.md → skills/brainstorming/SKILL.md} +2 -3
- package/packages/ampcode/{commands/branch-review.md → skills/branch-review/SKILL.md} +27 -13
- package/packages/{claude/commands/docs-builder.md → ampcode/skills/docs-builder/SKILL.md} +1 -1
- package/packages/ampcode/{commands/live-canvas.md → skills/live-canvas/SKILL.md} +8 -4
- package/packages/ampcode/{commands/refactor.md → skills/refactor/SKILL.md} +49 -7
- package/packages/ampcode/{commands/release.md → skills/release/SKILL.md} +4 -4
- package/packages/{claude/commands → ampcode/skills}/remember/AGENT_RULES.md +44 -84
- package/packages/ampcode/{commands/remember.md → skills/remember/SKILL.md} +11 -6
- package/packages/ampcode/{commands → skills}/remember/friction.cjs +0 -0
- package/packages/ampcode/{commands → skills}/remember/stub-check.cjs +28 -19
- package/packages/ampcode/{commands → skills}/remember/sync-rules.cjs +28 -19
- package/packages/{claude/commands → ampcode/skills}/remember/version-check.cjs +1 -1
- package/packages/ampcode/skills/root-cause/SKILL.md +220 -0
- package/packages/ampcode/{commands/trace-back → skills/root-cause}/find-polluter.sh +0 -0
- package/packages/{claude/commands/security.md → ampcode/skills/security/SKILL.md} +1 -1
- package/packages/{claude/commands/ship.md → ampcode/skills/ship/SKILL.md} +1 -1
- package/packages/ampcode/skills/skill-creator/LICENSE.txt +202 -0
- package/packages/ampcode/{commands/skill-creator.md → skills/skill-creator/SKILL.md} +1 -2
- package/packages/ampcode/{commands → skills}/skill-creator/scripts/init_skill.py +0 -0
- package/packages/ampcode/{commands → skills}/skill-creator/scripts/package_skill.py +0 -0
- package/packages/ampcode/{commands → skills}/skill-creator/scripts/quick_validate.py +0 -0
- package/packages/ampcode/{commands/stash.md → skills/stash/SKILL.md} +2 -1
- package/packages/{claude/commands/test-generate.md → ampcode/skills/test-generate/SKILL.md} +2 -2
- package/packages/ampcode/variants.json +2 -2
- package/packages/claude/CLAUDE.md +10 -17
- package/packages/claude/agents/code-developer.md +11 -17
- package/packages/claude/agents/orchestrator.md +2 -3
- package/packages/claude/agents/quality-assurance.md +3 -1
- package/packages/claude/skills/brainstorming/SKILL.md +1 -2
- package/packages/claude/{commands/branch-review.md → skills/branch-review/SKILL.md} +15 -1
- package/packages/{ampcode/commands/docs-builder.md → claude/skills/docs-builder/SKILL.md} +7 -7
- package/packages/claude/skills/live-canvas/SKILL.md +5 -1
- package/packages/claude/{commands/refactor.md → skills/refactor/SKILL.md} +45 -3
- package/packages/claude/{commands/release.md → skills/release/SKILL.md} +1 -1
- package/packages/{ampcode/commands → claude/skills}/remember/AGENT_RULES.md +38 -78
- package/packages/claude/{commands/remember.md → skills/remember/SKILL.md} +11 -6
- package/packages/claude/{commands → skills}/remember/friction.cjs +0 -0
- package/packages/claude/{commands → skills}/remember/stub-check.cjs +28 -19
- package/packages/claude/{commands → skills}/remember/sync-rules.cjs +28 -19
- package/packages/{ampcode/commands → claude/skills}/remember/version-check.cjs +3 -3
- package/packages/claude/skills/root-cause/SKILL.md +220 -0
- package/packages/{ampcode/commands/security.md → claude/skills/security/SKILL.md} +2 -2
- package/packages/{ampcode/commands/ship.md → claude/skills/ship/SKILL.md} +2 -2
- package/packages/claude/skills/skill-creator/SKILL.md +1 -2
- package/packages/claude/{commands/stash.md → skills/stash/SKILL.md} +2 -1
- package/packages/{ampcode/commands/test-generate.md → claude/skills/test-generate/SKILL.md} +3 -3
- package/packages/claude/variants.json +1 -2
- package/packages/droid/AGENTS.md +10 -15
- package/packages/droid/commands/brainstorming.md +1 -4
- package/packages/droid/commands/branch-review.md +25 -14
- package/packages/droid/commands/docs-builder.md +0 -3
- package/packages/droid/commands/live-canvas.md +7 -5
- package/packages/droid/commands/refactor.md +47 -8
- package/packages/droid/commands/release.md +2 -5
- package/packages/droid/commands/remember/AGENT_RULES.md +38 -78
- package/packages/droid/commands/remember/stub-check.cjs +28 -19
- package/packages/droid/commands/remember/sync-rules.cjs +28 -19
- package/packages/droid/commands/remember/version-check.cjs +1 -1
- package/packages/droid/commands/remember.md +6 -4
- package/packages/droid/commands/root-cause.md +218 -0
- package/packages/droid/commands/security.md +0 -3
- package/packages/droid/commands/ship.md +0 -3
- package/packages/droid/commands/skill-creator/LICENSE.txt +202 -0
- package/packages/droid/commands/skill-creator.md +0 -4
- package/packages/droid/commands/stash.md +0 -2
- package/packages/droid/commands/test-generate.md +1 -4
- package/packages/droid/droids/1-create-prd.md +6 -2
- package/packages/droid/droids/2-generate-tasks.md +1 -2
- package/packages/droid/droids/3-process-task-list.md +1 -2
- package/packages/droid/droids/code-developer.md +12 -19
- package/packages/droid/droids/feature-planner.md +1 -2
- package/packages/droid/droids/market-researcher.md +1 -2
- package/packages/droid/droids/orchestrator.md +1 -2
- package/packages/droid/droids/quality-assurance.md +4 -3
- package/packages/droid/droids/system-architect.md +1 -2
- package/packages/droid/droids/ui-designer.md +1 -2
- package/packages/opencode/AGENTS.md +10 -15
- package/packages/opencode/agent/code-developer.md +11 -17
- package/packages/opencode/agent/quality-assurance.md +3 -1
- package/packages/opencode/command/brainstorming.md +1 -4
- package/packages/opencode/command/branch-review.md +25 -15
- package/packages/opencode/command/docs-builder.md +0 -4
- package/packages/opencode/command/live-canvas.md +7 -5
- package/packages/opencode/command/refactor.md +47 -9
- package/packages/opencode/command/release.md +2 -5
- package/packages/opencode/command/remember/AGENT_RULES.md +38 -78
- package/packages/opencode/command/remember/stub-check.cjs +28 -19
- package/packages/opencode/command/remember/sync-rules.cjs +28 -19
- package/packages/opencode/command/remember/version-check.cjs +1 -1
- package/packages/opencode/command/remember.md +6 -4
- package/packages/opencode/command/root-cause.md +218 -0
- package/packages/opencode/command/security.md +0 -4
- package/packages/opencode/command/ship.md +0 -3
- package/packages/opencode/command/skill-creator/LICENSE.txt +202 -0
- package/packages/opencode/command/skill-creator.md +0 -4
- package/packages/opencode/command/stash.md +0 -3
- package/packages/opencode/command/test-generate.md +1 -5
- package/packages/opencode/opencode.jsonc +4 -24
- package/packages/subagentic-manual.md +147 -314
- package/tools/ampcode/manifest-template.json +0 -1
- package/tools/claude/manifest-template.json +0 -1
- package/tools/droid/manifest-template.json +0 -1
- package/tools/opencode/manifest-template.json +0 -1
- package/packages/ampcode/commands/debug-method.md +0 -297
- package/packages/ampcode/commands/live-canvas/README.md +0 -264
- package/packages/ampcode/commands/optimize.md +0 -61
- package/packages/ampcode/commands/tdd-flow.md +0 -390
- package/packages/ampcode/commands/test-traps/example.ts +0 -158
- package/packages/ampcode/commands/test-traps.md +0 -378
- package/packages/ampcode/commands/trace-back.md +0 -176
- package/packages/ampcode/commands/verify-done.md +0 -152
- package/packages/claude/commands/optimize.md +0 -61
- package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md +0 -89
- package/packages/claude/skills/debug-method/CREATION-LOG.md +0 -119
- package/packages/claude/skills/debug-method/SKILL.md +0 -296
- package/packages/claude/skills/debug-method/test-academic.md +0 -14
- package/packages/claude/skills/debug-method/test-pressure-1.md +0 -58
- package/packages/claude/skills/debug-method/test-pressure-2.md +0 -68
- package/packages/claude/skills/debug-method/test-pressure-3.md +0 -69
- package/packages/claude/skills/live-canvas/README.md +0 -269
- package/packages/claude/skills/tdd-flow/SKILL.md +0 -392
- package/packages/claude/skills/test-traps/SKILL.md +0 -378
- package/packages/claude/skills/test-traps/example.ts +0 -158
- package/packages/claude/skills/trace-back/SKILL.md +0 -176
- package/packages/claude/skills/verify-done/SKILL.md +0 -152
- package/packages/droid/commands/debug-method.md +0 -297
- package/packages/droid/commands/live-canvas/README.md +0 -264
- package/packages/droid/commands/optimize.md +0 -61
- package/packages/droid/commands/tdd-flow.md +0 -390
- package/packages/droid/commands/test-traps/example.ts +0 -158
- package/packages/droid/commands/test-traps.md +0 -378
- package/packages/droid/commands/trace-back.md +0 -176
- package/packages/droid/commands/verify-done.md +0 -152
- package/packages/opencode/command/debug-method.md +0 -297
- package/packages/opencode/command/live-canvas/README.md +0 -264
- package/packages/opencode/command/optimize.md +0 -61
- package/packages/opencode/command/tdd-flow.md +0 -390
- package/packages/opencode/command/test-traps/example.ts +0 -158
- package/packages/opencode/command/test-traps.md +0 -378
- package/packages/opencode/command/trace-back.md +0 -176
- package/packages/opencode/command/verify-done.md +0 -152
- /package/packages/ampcode/{commands → skills}/docs-builder/docs-builder.cjs +0 -0
- /package/packages/ampcode/{commands → skills}/live-canvas/DESIGN_PRINCIPLES.md +0 -0
- /package/packages/ampcode/{commands → skills}/live-canvas/dev/post-variants.html +0 -0
- /package/packages/ampcode/{commands → skills}/live-canvas/templates/lab-banner.html +0 -0
- /package/packages/ampcode/{commands → skills}/live-canvas/templates/overlay-vanilla.js +0 -0
- /package/packages/claude/{commands → skills}/docs-builder/docs-builder.cjs +0 -0
- /package/packages/claude/skills/{trace-back → root-cause}/find-polluter.sh +0 -0
- /package/packages/droid/commands/{trace-back → root-cause}/find-polluter.sh +0 -0
- /package/packages/opencode/command/{trace-back → root-cause}/find-polluter.sh +0 -0
|
File without changes
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: stash
|
|
3
3
|
description: Stash session context [name]
|
|
4
|
-
usage: /stash ["optional-name"]
|
|
5
4
|
argument-hint: [optional stash name]
|
|
5
|
+
allowed-tools: Read, Grep, Glob
|
|
6
|
+
disable-model-invocation: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
Save session context for compaction recovery or handoffs.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-generate
|
|
3
3
|
description: Generate and run tests [file]
|
|
4
|
-
usage: /test-generate <file>
|
|
5
4
|
argument-hint: [file or symbol to test]
|
|
6
5
|
allowed-tools: Read, Edit, Write, Grep, Glob, Bash(npm test:*), Bash(npx jest:*), Bash(npx vitest:*), Bash(pnpm test:*), Bash(yarn test:*), Bash(pytest:*), Bash(python:*), Bash(go test:*), Bash(cargo test:*), Bash(make test:*)
|
|
6
|
+
disable-model-invocation: true
|
|
7
7
|
---
|
|
8
8
|
Generate tests for $ARGUMENTS, then run them. This is a generate → run →
|
|
9
9
|
verify loop, not just file generation.
|
|
@@ -28,7 +28,7 @@ Match existing patterns:
|
|
|
28
28
|
or new test-runner config.
|
|
29
29
|
- Do **not** add test-only public methods or exports to production code to
|
|
30
30
|
make a test possible — if the test wants a hook the prod code doesn't
|
|
31
|
-
expose, stop and ask
|
|
31
|
+
expose, stop and ask.
|
|
32
32
|
|
|
33
33
|
## 3. Run
|
|
34
34
|
Execute the project's real test command, scoped to just the new tests
|
|
@@ -21,26 +21,16 @@ These subagents are available when using Claude Code CLI. Droid can reference th
|
|
|
21
21
|
| system-architect | Architect | Use for system design, architecture documents, technology selection, API design, and infrastructure planning |
|
|
22
22
|
| ui-designer | UX Expert | Use for UI/UX design, wireframes, prototypes, front-end specifications, and user experience optimization |
|
|
23
23
|
|
|
24
|
-
### Skills (
|
|
25
|
-
|
|
26
|
-
| ID | Description | Usage | Auto |
|
|
27
|
-
|---|---|---|---|
|
|
28
|
-
| brainstorming | Refines rough ideas into fully-formed designs through collaborative questioning | /brainstorming <session-type> <topic> | false |
|
|
29
|
-
| trace-back | Systematically traces bugs backward through call stack to identify source | /trace-back <issue-description> | false |
|
|
30
|
-
| live-canvas | Conduct design interviews, generate UI variations, collect live click-to-annotate feedback via a browser overlay that streams into the session | /live-canvas | false |
|
|
31
|
-
| skill-creator | Guide for creating effective skills and extending Claude capabilities | /skill-creator <skill-type> <skill-description> | false |
|
|
32
|
-
| debug-method | Four-phase debugging framework - investigate root cause before any fixes | /debug-method <bug-or-error-description> | false |
|
|
33
|
-
| tdd-flow | Write test first, watch it fail, write minimal code to pass | /tdd-flow <feature-or-behavior-to-test> | true |
|
|
34
|
-
| test-traps | Prevents testing mock behavior and production pollution with test-only methods | /test-traps <testing-scenario> | true |
|
|
35
|
-
| verify-done | Requires running verification commands before making any success claims | /verify-done <work-to-verify> | true |
|
|
36
|
-
|
|
37
|
-
### Commands (10 total)
|
|
24
|
+
### Skills (13 total)
|
|
38
25
|
|
|
39
26
|
| ID | Description | Usage |
|
|
40
27
|
|---|---|---|
|
|
28
|
+
| brainstorming | Refines rough ideas into fully-formed designs through collaborative questioning | /brainstorming <session-type> <topic> |
|
|
29
|
+
| root-cause | Find the cause before changing code - evidence, backward trace, one hypothesis, fix at the source | /root-cause <bug-or-error-description> |
|
|
30
|
+
| live-canvas | Conduct design interviews, generate UI variations, collect live click-to-annotate feedback via a browser overlay that streams into the session | /live-canvas |
|
|
31
|
+
| skill-creator | Guide for creating effective skills and extending Claude capabilities | /skill-creator <skill-type> <skill-description> |
|
|
41
32
|
| docs-builder | Reorg a docs corpus, split an oversized doc, search it, keep pages current, index them | /docs-builder [reorg \| cleanup <file.md>] |
|
|
42
|
-
|
|
|
43
|
-
| refactor | Refactor code while maintaining behavior and tests | /refactor <code-section> |
|
|
33
|
+
| refactor | Refactor and optimize code while maintaining behavior and tests | /refactor <code-section> |
|
|
44
34
|
| remember | Consolidate stashes + friction into project memory | /remember |
|
|
45
35
|
| branch-review | Pre-merge review: general review + full security audit, verify pass, no fixes | /branch-review [target] [level] |
|
|
46
36
|
| security | Security audit — recurring six, injection, auth, trust boundaries; reports, never fixes | /security [target] |
|
|
@@ -52,4 +42,7 @@ These subagents are available when using Claude Code CLI. Droid can reference th
|
|
|
52
42
|
All resources are auto-discovered from frontmatter in their respective directories:
|
|
53
43
|
- **Agents**: `./agents/*.md`
|
|
54
44
|
- **Skills**: `./skills/*/SKILL.md`
|
|
55
|
-
|
|
45
|
+
|
|
46
|
+
Claude Code merged custom commands into skills, so every capability ships as
|
|
47
|
+
`skills/<name>/SKILL.md`. The nine that are deliberate actions carry
|
|
48
|
+
`disable-model-invocation: true`, so Claude only runs them when you type them.
|
|
@@ -37,29 +37,26 @@ digraph CodeDeveloper {
|
|
|
37
37
|
work_type [label="Work type?", shape=diamond];
|
|
38
38
|
|
|
39
39
|
// Context discovery (conditional)
|
|
40
|
-
needs_context [label="Debug
|
|
40
|
+
needs_context [label="Debug or\nrefactor?", shape=diamond];
|
|
41
41
|
context_discovery [label="Context Discovery\n(search related code,\ndeps, usages)", fillcolor=lightyellow];
|
|
42
42
|
|
|
43
43
|
// Debug path
|
|
44
|
-
use_debug [label="Use /
|
|
44
|
+
use_debug [label="Use /root-cause"];
|
|
45
45
|
|
|
46
46
|
// Refactor path
|
|
47
47
|
use_refactor [label="Use /refactor"];
|
|
48
48
|
|
|
49
|
-
// Optimize path
|
|
50
|
-
use_optimize [label="Use /optimize"];
|
|
51
|
-
|
|
52
49
|
// Implement path
|
|
53
50
|
implement [label="Implement changes"];
|
|
54
51
|
|
|
55
52
|
// Conditional testing
|
|
56
53
|
tdd_needed [label="TDD specified\nor tests needed?", shape=diamond];
|
|
57
|
-
use_tdd [label="Use /
|
|
54
|
+
use_tdd [label="Use /test-generate"];
|
|
58
55
|
|
|
59
56
|
// Validation
|
|
60
57
|
run_validations [label="Run validations\n(lint, build, tests)"];
|
|
61
58
|
validations_pass [label="Pass?", shape=diamond];
|
|
62
|
-
fix_issues [label="Fix issues\n(use /
|
|
59
|
+
fix_issues [label="Fix issues\n(use /root-cause if needed)"];
|
|
63
60
|
failure_count [label="3+ failures?", shape=diamond];
|
|
64
61
|
|
|
65
62
|
// Security check
|
|
@@ -76,7 +73,7 @@ digraph CodeDeveloper {
|
|
|
76
73
|
|
|
77
74
|
// Review and complete
|
|
78
75
|
code_review [label="Run /branch-review"];
|
|
79
|
-
verification [label="Run
|
|
76
|
+
verification [label="Run the proof", fillcolor=orange];
|
|
80
77
|
|
|
81
78
|
// Story-specific
|
|
82
79
|
update_story [label="Update story\n(checkbox, changelog)"];
|
|
@@ -100,12 +97,10 @@ digraph CodeDeveloper {
|
|
|
100
97
|
|
|
101
98
|
work_type -> use_debug [label="debug"];
|
|
102
99
|
work_type -> use_refactor [label="refactor"];
|
|
103
|
-
work_type -> use_optimize [label="optimize"];
|
|
104
100
|
work_type -> implement [label="implement"];
|
|
105
101
|
|
|
106
102
|
use_debug -> implement;
|
|
107
103
|
use_refactor -> implement;
|
|
108
|
-
use_optimize -> implement;
|
|
109
104
|
|
|
110
105
|
implement -> tdd_needed;
|
|
111
106
|
tdd_needed -> use_tdd [label="YES"];
|
|
@@ -184,14 +179,13 @@ All require `*` prefix. Invocation commands in table above. Additional:
|
|
|
184
179
|
|
|
185
180
|
| Situation | Delegate To |
|
|
186
181
|
|-----------|-------------|
|
|
187
|
-
| Bug encountered | `/
|
|
188
|
-
| Error deep in stack | `/
|
|
189
|
-
| Refactoring code | `/refactor` |
|
|
190
|
-
| Need tests (when required) | `/test-generate`
|
|
191
|
-
| Writing any test |
|
|
192
|
-
| Before completion |
|
|
182
|
+
| Bug encountered | `/root-cause` |
|
|
183
|
+
| Error deep in stack | `/root-cause` (Phase 1, step 5) |
|
|
184
|
+
| Refactoring code, or a perf problem | `/refactor` (its perf pass is on by default) |
|
|
185
|
+
| Need tests (when required) | `/test-generate` |
|
|
186
|
+
| Writing any test | AGENT_RULES.md → Testing Standards |
|
|
187
|
+
| Before completion | Run the proof and read its output |
|
|
193
188
|
| After code changes | `/security` |
|
|
194
189
|
| Task complete / general review | `/branch-review` (reviews the branch + full security audit, verifies claims, reports findings — never fixes) |
|
|
195
|
-
| Performance issues | `/optimize` |
|
|
196
190
|
|
|
197
191
|
You are an autonomous implementation specialist. Execute with precision, delegate appropriately, and communicate clearly when you need guidance or encounter blockers.
|
|
@@ -65,9 +65,8 @@ On-demand, read from these locations:
|
|
|
65
65
|
|
|
66
66
|
| Resource | Global Paths | Local Path |
|
|
67
67
|
|----------|--------------|------------|
|
|
68
|
-
| Agents |
|
|
69
|
-
|
|
|
70
|
-
| Skills | `~/.claude/skills/*/SKILL.md` | `./.claude/skills/*/SKILL.md` |
|
|
68
|
+
| Agents | `~/.claude/agents/*.md` | `./.claude/agents/*.md` |
|
|
69
|
+
| Skills | `~/.claude/skills/*/SKILL.md` | `./.claude/skills/*/SKILL.md` |
|
|
71
70
|
|
|
72
71
|
Parse frontmatter for `name`, `description`, `when_to_use`. Present as numbered list.
|
|
73
72
|
|
|
@@ -59,13 +59,15 @@ digraph QualityAssurance {
|
|
|
59
59
|
|
|
60
60
|
Before any analysis, read (if exists):
|
|
61
61
|
- `CLAUDE.md` - Project instructions, patterns, conventions
|
|
62
|
+
<!-- mirror:literal:start — names every tool's config file on purpose -->
|
|
62
63
|
- `AGENT.md` / `AGENTS.md` - Agent configurations
|
|
64
|
+
<!-- mirror:literal:end -->
|
|
63
65
|
- `README.md` - Project overview
|
|
64
66
|
- Test config files (`jest.config`, `pytest.ini`, etc.)
|
|
65
67
|
|
|
66
68
|
## Slash Commands Available
|
|
67
69
|
|
|
68
|
-
Use these during analysis: `/branch-review`, `/security
|
|
70
|
+
Use these during analysis: `/branch-review`, `/security`
|
|
69
71
|
|
|
70
72
|
## Analysis Areas
|
|
71
73
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: brainstorming
|
|
3
3
|
description: Use when creating or developing, before writing code or implementation plans - refines rough ideas into fully-formed designs through collaborative questioning, alternative exploration, and incremental validation. Don't use during clear 'mechanical' processes
|
|
4
|
-
|
|
5
|
-
auto_trigger: false
|
|
4
|
+
allowed-tools: Read, Grep, Glob
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Brainstorming Ideas Into Designs
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: branch-review
|
|
3
3
|
description: Review a branch before merge [target] [level]
|
|
4
|
-
usage: /branch-review [target] [low|medium|high|max]
|
|
5
4
|
argument-hint: [file, branch (e.g. main), range (main..HEAD), or empty] [effort level]
|
|
6
5
|
allowed-tools: Read, Grep, Glob, Agent, Bash(git diff:*), Bash(git log:*), Bash(git show:*), Bash(git status:*), Bash(git grep:*), Bash(git rev-parse:*), Bash(git merge-base:*), Bash(rg:*)
|
|
6
|
+
disable-model-invocation: true
|
|
7
7
|
---
|
|
8
8
|
Pre-merge review gate. Two stages — **general review** then a **full security
|
|
9
9
|
audit** — followed by an adversarial verify pass. It **never edits code**: it
|
|
@@ -100,6 +100,20 @@ was actually read rather than assuming.
|
|
|
100
100
|
you owe an answer on — take both from the file, never from the orchestrator's
|
|
101
101
|
recollection, for the same reason `/release` does. Then:
|
|
102
102
|
|
|
103
|
+
- **First, check the record belongs to this branch.** There is one record file
|
|
104
|
+
per repo, not one per branch. Validate `<that sha>` first with
|
|
105
|
+
`git rev-parse --verify <that sha>` — a value that fails this (e.g. a
|
|
106
|
+
corrupted or hand-edited record, or one starting with `-`, which git would
|
|
107
|
+
otherwise parse as an option) is a malformed record; treat it exactly as
|
|
108
|
+
**No file** below. If it validates, and its `branch:` line differs from the
|
|
109
|
+
current branch, or `git merge-base --is-ancestor <that sha> HEAD` exits
|
|
110
|
+
non-zero, the record describes a different or rewritten history — treat it
|
|
111
|
+
exactly as **No file** below and review the whole branch. Skipping this
|
|
112
|
+
resolves `<that sha>..HEAD` against a merged, renamed, or rebased sha, which
|
|
113
|
+
is not a subset of this branch but a range that never existed. Check both:
|
|
114
|
+
the branch name catches a switch, the ancestry check catches a rebase or
|
|
115
|
+
squash under the same name. Otherwise:
|
|
116
|
+
|
|
103
117
|
- **`sha:` ≠ HEAD** → this is a re-review. Target the range
|
|
104
118
|
`<that sha>..HEAD`. Stage 1 reads only the commits since, and stage 3
|
|
105
119
|
re-verifies each recorded blocker as fixed, unfixed, or dismissed with a
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docs-builder
|
|
3
3
|
description: Reorg a docs corpus, split an oversized doc, search it, keep pages current, index them
|
|
4
|
-
usage: /docs-builder [reorg | cleanup <file.md> | search <query words...>]
|
|
5
4
|
argument-hint: [reorg | cleanup <file.md> | search <query words...> — empty asks first run vs. drift]
|
|
6
5
|
allowed-tools: Read, Write, Edit, Grep, Glob, Task, AskUserQuestion, Bash(node:*), Bash(git:*), Bash(rg:*)
|
|
6
|
+
disable-model-invocation: true
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# docs-builder
|
|
@@ -152,7 +152,7 @@ marked `core: true`.
|
|
|
152
152
|
|
|
153
153
|
```
|
|
154
154
|
docs/
|
|
155
|
-
README.md entry point, referenced from
|
|
155
|
+
README.md entry point, referenced from CLAUDE.md
|
|
156
156
|
index.md GENERATED by index-flat/apply-reorg/cleanup-apply. never hand-edited.
|
|
157
157
|
READER-FACING. The WHOLE-CORPUS map — the only file with a completeness
|
|
158
158
|
guarantee. ## Product, ## Logs, ## Archive.
|
|
@@ -340,7 +340,7 @@ files with no gate at all.
|
|
|
340
340
|
### 3. Apply (script) — an ALREADY-CLASSIFIED plan, verified moves, survives a bad file
|
|
341
341
|
|
|
342
342
|
```bash
|
|
343
|
-
|
|
343
|
+
node $DB apply-reorg # defaults to the plan above
|
|
344
344
|
```
|
|
345
345
|
|
|
346
346
|
**Refuses outright if any row's `bucket` is still empty** — the interview-has-not-happened
|
|
@@ -362,13 +362,13 @@ a pointer to re-run `discover`.
|
|
|
362
362
|
- **After the scan, `apply-reorg` writes `docs/index.md` itself** — it calls `index-flat`
|
|
363
363
|
(see below) automatically, so a reorg-only corpus ends up indexed without a second command.
|
|
364
364
|
Runs every time, unconditionally.
|
|
365
|
-
- **`apply-reorg` also writes the docs pointer into `
|
|
365
|
+
- **`apply-reorg` also writes the docs pointer into `CLAUDE.md`** — a marker-wrapped
|
|
366
366
|
`<!-- DOCS_INDEX:START -->`/`<!-- DOCS_INDEX:END -->` block naming `docs/index.md` as a
|
|
367
367
|
**plain path, never an `@`-reference**: hot-loading a 100-row index into every session is
|
|
368
368
|
exactly what this avoids. The block also carries the `/docs-builder search` hint, and is
|
|
369
369
|
static — it never varies with row count, so a re-run rewrites identical bytes. Idempotent:
|
|
370
370
|
an existing block is replaced in place, never duplicated; other content is left alone.
|
|
371
|
-
The target is `CONFIG=` (default `CLAUDE.md`); this package uses `CONFIG=
|
|
371
|
+
The target is `CONFIG=` (default `CLAUDE.md`); this package uses `CONFIG=CLAUDE.md`.
|
|
372
372
|
- **The moves land STAGED in your git index — commit them promptly.** `git mv` stages each
|
|
373
373
|
rename immediately (that is what preserves history), so when `apply-reorg` returns the repo
|
|
374
374
|
is holding N staged renames. Any other session's `git add -A` or `git commit -a` will absorb
|
|
@@ -472,7 +472,7 @@ document in place.
|
|
|
472
472
|
|
|
473
473
|
`cleanup` takes exactly one named file — never zero, never more than one — and refuses
|
|
474
474
|
cleanly (exit non-zero) if the file doesn't exist, isn't a `.md`, or is one of the protected
|
|
475
|
-
entry-point docs (README,
|
|
475
|
+
entry-point docs (README, CLAUDE.md, etc.). It prints the file's line count and an estimated
|
|
476
476
|
write cost (the same cost law `plan` uses in step 4 below, priced as a 1-page floor since the
|
|
477
477
|
real page count isn't known until the model groups sections in step 2), runs step 1 (scan)
|
|
478
478
|
below for you, then measures the document's heading shape and **stops**:
|
|
@@ -687,7 +687,7 @@ once (old path, archive, and the new pages), which is duplication, not cleanup.
|
|
|
687
687
|
Archiving is also what frees the original's path for the **core page**, which `cleanup-apply`
|
|
688
688
|
then relocates there from `PAGES` (settled 2026-08-24). Splitting is internal maintenance
|
|
689
689
|
bookkeeping: a reader who knows where "the PRD" lives should still find it there afterwards.
|
|
690
|
-
MEASURED, real (bareagent): before this, a split left `
|
|
690
|
+
MEASURED, real (bareagent): before this, a split left `CLAUDE.md`'s canonical-PRD reference
|
|
691
691
|
pointing into `docs/archive/`, which reads as "the canonical spec is archived" — backwards.
|
|
692
692
|
|
|
693
693
|
**Exit codes are not interchangeable — they mean two opposite outcomes:**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: live-canvas
|
|
3
3
|
description: Conduct design interviews, generate UI variations, and collect live click-to-annotate feedback that streams into the session so edits land without leaving the browser. Use when the user wants rapid iterative UI refinement, not just batched feedback.
|
|
4
|
+
allowed-tools: Read, Grep, Glob
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Live Canvas Skill
|
|
@@ -26,7 +27,7 @@ Live Canvas supports two feedback transports. **The user picks every time** —
|
|
|
26
27
|
|
|
27
28
|
### Host detection — do this first
|
|
28
29
|
|
|
29
|
-
This SKILL.md is the Claude Code variant of the skill. Same content is mirrored as docs for Droid/Amp/Opencode under `packages/<tool
|
|
30
|
+
This SKILL.md is the Claude Code variant of the skill. Same content is mirrored as docs for Droid/Amp/Opencode under `packages/<tool>/` beside the other capabilities, but those tools don't support the MCP channel.
|
|
30
31
|
|
|
31
32
|
**If running under Droid, Amp, or Opencode (not Claude Code):**
|
|
32
33
|
- Skip the mode question entirely.
|
|
@@ -109,6 +110,8 @@ Or pick JSON now to stay in this session — feedback gets written to a file
|
|
|
109
110
|
you paste back here. No relaunch needed.
|
|
110
111
|
```
|
|
111
112
|
|
|
113
|
+
<!-- mirror:literal:start — Live mode is the Claude Code MCP plugin; these are
|
|
114
|
+
Claude's real paths in every kit, because no other tool can install it -->
|
|
112
115
|
**Case C — first-time setup block:**
|
|
113
116
|
|
|
114
117
|
```
|
|
@@ -125,6 +128,7 @@ Live mode needs a one-time install. Two steps:
|
|
|
125
128
|
That's it — once the plugin is installed, /live-canvas in any session can
|
|
126
129
|
claim the channel. Re-run /live-canvas and pick Live.
|
|
127
130
|
```
|
|
131
|
+
<!-- mirror:literal:end -->
|
|
128
132
|
|
|
129
133
|
Do not try to run any of these commands yourself. Three reasons:
|
|
130
134
|
1. The `/plugin` steps are Claude Code slash commands — not doable from inside a running session.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: refactor
|
|
3
|
-
description: Refactor [code]
|
|
4
|
-
usage: /refactor <code-section> | /refactor (no args = fix-ledger mode)
|
|
3
|
+
description: Refactor and optimize [code]
|
|
5
4
|
argument-hint: [file-or-function, or empty for the fix ledger]
|
|
6
5
|
allowed-tools: Read, Edit, Grep, Glob, Bash(npm test:*), Bash(npx jest:*), Bash(npx vitest:*), Bash(pnpm test:*), Bash(yarn test:*), Bash(pytest:*), Bash(python:*), Bash(go test:*), Bash(cargo test:*), Bash(make test:*), Bash(git diff:*), Bash(git grep:*), Bash(git status:*), Bash(git rev-parse:*), Bash(git switch:*)
|
|
6
|
+
disable-model-invocation: true
|
|
7
7
|
---
|
|
8
|
-
Refactor $ARGUMENTS.
|
|
8
|
+
Refactor $ARGUMENTS. A targeted refactor includes the performance pass
|
|
9
|
+
below — it is on by default, not a separate command.
|
|
9
10
|
|
|
10
11
|
## Guardrails
|
|
11
12
|
- **Spawn a worker and explicitly select your tool's mid tier.** State the
|
|
@@ -87,6 +88,35 @@ refactor and how to close each item.
|
|
|
87
88
|
- Apply DRY
|
|
88
89
|
- Better naming
|
|
89
90
|
- Smaller functions (single responsibility)
|
|
91
|
+
- Remove needless work — the performance pass below
|
|
92
|
+
|
|
93
|
+
## Performance — part of every targeted refactor
|
|
94
|
+
When `$ARGUMENTS` names a target, look for wasted work as well as messy
|
|
95
|
+
work: time and space complexity, N+1 queries, I/O inside a loop, needless
|
|
96
|
+
allocations, the same value recomputed repeatedly.
|
|
97
|
+
|
|
98
|
+
**Ground every finding before you touch it.** Performance claims are easy
|
|
99
|
+
to invent. A finding counts as **confirmed** only with at least one of:
|
|
100
|
+
- a profile, benchmark or log line showing call frequency or duration,
|
|
101
|
+
- the path sits on an obvious hot loop or per-request handler with real
|
|
102
|
+
volume,
|
|
103
|
+
- the user supplied evidence in the request.
|
|
104
|
+
|
|
105
|
+
Without one of those it is **uncertain — report it, do not optimise it.**
|
|
106
|
+
Speculative optimisation is scope creep with a stopwatch.
|
|
107
|
+
|
|
108
|
+
Fix confirmed findings under the same constraints as any other refactor:
|
|
109
|
+
minimal change, one obvious shape, no behaviour change, no API change.
|
|
110
|
+
After each such edit, re-read the changed region and confirm it still
|
|
111
|
+
computes the same answer — a perf change that quietly alters semantics is
|
|
112
|
+
the worst kind. Report per finding: **location** (`file:line`), **cost**
|
|
113
|
+
(concrete — "N+1 over ~1k rows on every page load", not "could be
|
|
114
|
+
faster"), **change**, **expected improvement**, **trade-off**
|
|
115
|
+
(readability / memory / consistency).
|
|
116
|
+
|
|
117
|
+
In ledger mode the surviving bullets are the whole scope — do not add
|
|
118
|
+
perf findings of your own. One you notice goes back to the orchestrator
|
|
119
|
+
as a new bullet, like any other side finding.
|
|
90
120
|
|
|
91
121
|
## Constraints
|
|
92
122
|
- **NO behavior changes**
|
|
@@ -120,8 +150,20 @@ honest way to know is to run them.
|
|
|
120
150
|
- the change is **bigger than the user asked for** (scope creep —
|
|
121
151
|
unrelated cleanups, formatting, comment edits). Confirm before
|
|
122
152
|
applying.
|
|
153
|
+
- a perf fix has **multiple reasonable shapes** (cache vs precompute vs
|
|
154
|
+
batch vs paginate vs index) — present the options with trade-offs, not
|
|
155
|
+
a chosen path.
|
|
156
|
+
- a perf fix trades **correctness for speed** (lossy approximation,
|
|
157
|
+
weaker or eventual consistency) — even when it is "obviously" faster.
|
|
158
|
+
- a perf fix touches **concurrency primitives** (locks, atomics,
|
|
159
|
+
ordering) — easy to introduce a race.
|
|
160
|
+
- a perf fix changes a **DB schema, response shape or caller contract**.
|
|
123
161
|
|
|
124
162
|
Final report:
|
|
125
163
|
- **refactor done, tests N pass / 0 fail** — ready, OR
|
|
126
164
|
- **refactor done, but K tests fail** — awaiting direction (revert /
|
|
127
165
|
patch / update test).
|
|
166
|
+
|
|
167
|
+
Plus the performance pass: **confirmed-and-fixed** · **confirmed-but-asking**
|
|
168
|
+
(why + options) · **uncertain** (what profiling or data would settle it) ·
|
|
169
|
+
**none found**.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: release
|
|
3
3
|
description: Verify, sweep docs, cut a version — then hand the release sequence back
|
|
4
|
-
usage: /release
|
|
5
4
|
allowed-tools: Read, Grep, Glob, Edit, Write, Agent, Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git show:*), Bash(git fetch:*), Bash(git add:*), Bash(git commit:*), Bash(git rev-parse:*), Bash(git merge-base:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(pytest:*), Bash(python:*), Bash(go:*), Bash(cargo:*), Bash(make:*)
|
|
5
|
+
disable-model-invocation: true
|
|
6
6
|
---
|
|
7
7
|
Release **preparation** orchestrator for the **current branch**. It runs your
|
|
8
8
|
existing pre-deploy gate, sweeps the docs, bumps the version and commits —
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
6. [Environment](#environment)
|
|
10
10
|
7. [Development Workflow](#development-workflow)
|
|
11
11
|
8. [Twelve-Factor Checklist](#twelve-factor-checklist)
|
|
12
|
-
9. [
|
|
12
|
+
9. [CLAUDE.md Stub](#claudemd-stub)
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -59,7 +59,7 @@ Every task runs through three layers. Do not skip ahead to code.
|
|
|
59
59
|
Not courtesies. These bind you as written, whether or not your tool enforces them.
|
|
60
60
|
|
|
61
61
|
- **Always** identify affected files before making changes, and explain what will change and why
|
|
62
|
-
- **Ask first** — stop and get explicit sign-off — before modifying authentication systems, database schema or migrations, CI workflows, or `.
|
|
62
|
+
- **Ask first** — stop and get explicit sign-off — before modifying authentication systems, database schema or migrations, CI workflows, or `.claude/settings.json`
|
|
63
63
|
- **Never** write secrets into the tree (`.env`/`*.env`, keys, credentials). They load from the environment at runtime; only a value-less `.env.example` is committed
|
|
64
64
|
- **Never** commit to `main`. Commit to a new branch (name doesn't matter), then propose `/branch-review` followed by `/release`; merging and releasing are my call, made by name — "approve", "good", or "go" on a draft is not that call
|
|
65
65
|
|
|
@@ -130,90 +130,50 @@ A problem you see and don't fix goes in the report, never in a comment. Comments
|
|
|
130
130
|
|
|
131
131
|
## Testing Standards
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
Principles, not a framework. Whatever the language, follow its ecosystem's conventions for
|
|
134
|
+
runner, layout and fixtures — these rules govern what a test must *do*, never how a
|
|
135
|
+
particular toolchain spells it.
|
|
134
136
|
|
|
135
|
-
|
|
137
|
+
### What a test is for
|
|
136
138
|
|
|
137
|
-
**
|
|
138
|
-
- Few unit tests — only for pure logic, algorithms, and complex calculations
|
|
139
|
-
- Many integration tests — the sweet spot; test real components working together
|
|
140
|
-
- Some E2E tests — cover critical user journeys end-to-end
|
|
141
|
-
- Static analysis — types and linters catch bugs cheaper than tests
|
|
139
|
+
**Test behavior, not implementation.** A suite must give you confidence to refactor freely. If changing internal code without changing behavior breaks tests, those tests are liabilities, not assets.
|
|
142
140
|
|
|
143
|
-
|
|
141
|
+
**Shape — the Testing Trophy, not the Pyramid:** static analysis catches the cheapest bugs; few unit tests, for pure logic and algorithms; many integration tests, the sweet spot, real components working together; some end-to-end tests over the critical journeys. Target roughly 20% unit, 60% integration, 15% E2E, 5% manual.
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
- **Write tests when the code has users.** If a function is called by other modules or exposed to users, it needs tests. Internal helpers that only serve one caller don't need their own test file
|
|
147
|
-
- **Write tests for bugs.** Every bug fix must include a regression test that fails before the fix and passes after. This is the highest-value test you can write
|
|
148
|
-
- **Write tests before refactoring.** Before changing working code, write characterization tests first to lock in current behavior, then refactor with confidence
|
|
149
|
-
- **Do not write tests for glue code.** Code that just wires components together (calls A then B then C) is tested at the integration level, not unit level
|
|
143
|
+
### When to write them
|
|
150
144
|
|
|
151
|
-
|
|
145
|
+
- **After the design stabilizes, not during exploration.** Do not test a prototype — you will write tests for code you delete tomorrow. First make it work (POC), then make it right (tests), then make it fast
|
|
146
|
+
- **Tests first when you already know the contract.** Pure functions, algorithms, parsers, validators, data transformations — write the test, watch it fail, then implement. When you are still discovering the interface, that same discipline produces churn and false confidence
|
|
147
|
+
- **Write tests for bugs.** Every fix ships a regression test that fails before the fix and passes after — the highest-value test there is
|
|
148
|
+
- **Write tests before refactoring.** Characterization tests lock in current behavior first, then change the code
|
|
149
|
+
- **Write tests when the code has users.** Called by other modules or exposed externally means it needs tests; a helper serving one caller does not need its own file
|
|
150
|
+
- **Do not test glue code.** Something that only wires A to B to C is covered at the integration level
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
- **TDD does not work for:** Exploring a design, building a POC, or unstable interfaces. Writing tests for unstable APIs creates churn and false confidence
|
|
155
|
-
- **The rule:** You must understand what you're building before you TDD it. TDD is a design tool for known problems, not a discovery tool for unknown ones
|
|
156
|
-
- **Red-green-refactor discipline:** If you do TDD, follow the cycle strictly. Write a failing test, write minimal code to pass, refactor. Do not write 20 tests then implement — that's front-loading waste
|
|
152
|
+
### What makes a good test
|
|
157
153
|
|
|
158
|
-
|
|
154
|
+
- **Tests real behavior.** Call the public interface, assert on observable output. Never reach into internals
|
|
155
|
+
- **Fails for the right reason.** It breaks when the feature breaks, not when the implementation moves
|
|
156
|
+
- **Reads like a spec.** Someone new to the code should learn what the feature does by reading it
|
|
157
|
+
- **Self-contained.** Sets up its own state, runs, cleans up. No ordering dependencies, and no reliance on project directories, user config, or ambient environment
|
|
158
|
+
- **Deterministic.** Flaky tests erode trust. A dependency on timing, network, or global state is a defect in the test
|
|
159
|
+
- **Never sleep for a condition — poll for it.** Sleeping then asserting is wrong at every value: too short and it flakes under load, too long and the suite drags, and a real async bug looks identical to a guess that was too short. Wait on the condition itself, re-reading the state *inside* the loop, with a timeout that names what it was waiting for. A fixed delay is only correct once you have waited for the triggering condition, the delay comes from a documented interval rather than a guess, and a comment says why
|
|
159
160
|
|
|
160
|
-
-
|
|
161
|
-
- **Fails for the right reason.** A good test fails when the feature is broken, not when the implementation changes
|
|
162
|
-
- **Reads like a spec.** Someone unfamiliar with the code must understand what the feature does by reading the test
|
|
163
|
-
- **Self-contained.** Each test sets up its own state, runs, and cleans up. No ordering dependencies between tests
|
|
164
|
-
- **Fast and deterministic.** Flaky tests erode trust. If a test depends on timing, network, or global state, fix that dependency
|
|
161
|
+
### Anti-patterns
|
|
165
162
|
|
|
166
|
-
|
|
163
|
+
- **Mocking most of the test.** If mock setup outweighs the logic, you are testing mocks. Prefer the real thing against a temporary directory, an in-memory store, or a disposable container
|
|
164
|
+
- **Partial mocks.** Mirror the complete structure the real thing returns, not only the fields this test reads. A mock missing a field downstream code consumes passes here and fails in production
|
|
165
|
+
- **Smoke tests.** Asserting a result merely exists proves nothing. Assert on specific values, structure, or side effects
|
|
166
|
+
- **Testing private internals.** If it needs its own test, it should be part of the public interface; otherwise the public tests should reach it
|
|
167
|
+
- **Mirroring implementation.** A test that restates the source line by line breaks on every refactor and catches nothing
|
|
168
|
+
- **Test-only production code.** Never add a method, flag, or branch to production solely for tests. Inject the dependency instead
|
|
169
|
+
- **Chasing a coverage number.** 80% of meaningless tests is worse than 40% of behavioural ones. Coverage tells you what is *not* tested, never that what is covered is correct. Cover the critical path first — data, auth, money, core logic — before helpers
|
|
167
170
|
|
|
168
|
-
|
|
169
|
-
- **Smoke tests.** `assert result is not None` proves nothing. Assert on specific values, structure, or side effects
|
|
170
|
-
- **Testing private methods.** If you need to test a private method, either it should be public or the public method's tests should cover it
|
|
171
|
-
- **Mirroring implementation.** Tests that replicate the source code line-by-line break on every refactor and catch zero bugs
|
|
172
|
-
- **Test-only production code.** Never add methods, flags, or branches to production code solely for testing. Use dependency injection instead
|
|
171
|
+
### Organization
|
|
173
172
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- **
|
|
177
|
-
- **
|
|
178
|
-
```
|
|
179
|
-
packages/<pkg>/tests/
|
|
180
|
-
unit/ # Fast, isolated, mocked deps, <1s each
|
|
181
|
-
integration/ # Real DB, filesystem, multi-component, <10s each
|
|
182
|
-
e2e/ # Full workflows, subprocess calls, <60s each
|
|
183
|
-
conftest.py # Shared fixtures for this package
|
|
184
|
-
```
|
|
185
|
-
- **One test file per module** (not per function). `test_auth.py` tests the auth module, not `test_login.py` + `test_logout.py` + `test_session.py`
|
|
186
|
-
- **No duplicate test files.** Before creating a new test file, check if one already exists for that module
|
|
187
|
-
|
|
188
|
-
### Markers and Signals
|
|
189
|
-
|
|
190
|
-
| Marker | Purpose | CI Behavior |
|
|
191
|
-
|--------|---------|-------------|
|
|
192
|
-
| `@pytest.mark.slow` | Runtime > 5s | Run in full suite, skip in quick checks |
|
|
193
|
-
| `@pytest.mark.ml` | Requires ML deps (torch, etc.) | Skip if deps not installed |
|
|
194
|
-
| `@pytest.mark.real_api` | Calls external APIs | Skip in CI — run manually before release |
|
|
195
|
-
|
|
196
|
-
**CI runs for fast signals:**
|
|
197
|
-
- `pytest -m "not slow and not ml and not real_api"` — fast gate on every push (~30s)
|
|
198
|
-
- `pytest` — full suite on PR merge or nightly
|
|
199
|
-
- Package-level runs for targeted debugging: `pytest packages/core/tests/`
|
|
200
|
-
|
|
201
|
-
### Coverage and Ratios
|
|
202
|
-
|
|
203
|
-
- **Do not chase a coverage number.** 80% coverage with meaningless tests is worse than 40% with behavior-testing integration tests
|
|
204
|
-
- **Cover the critical path first.** Data layer, auth, payment, core business logic — before helper utilities
|
|
205
|
-
- **Coverage tells you what's NOT tested, not what IS tested.** High coverage with bad assertions is false confidence
|
|
206
|
-
- **Delete tests that don't catch bugs.** If a test has never failed (or only fails on refactors), it's not providing value
|
|
207
|
-
|
|
208
|
-
**Target ratio:** ~20% unit, ~60% integration, ~15% E2E, ~5% manual/exploratory
|
|
209
|
-
|
|
210
|
-
### Test Tooling Standards
|
|
211
|
-
|
|
212
|
-
- Use `tmp_path` for filesystem tests, `:memory:` or `tmp_path` SQLite for DB tests
|
|
213
|
-
- Use dependency injection over `@patch` — it's more readable and survives refactors
|
|
214
|
-
- Tests must be self-sufficient — no dependency on project directories, user config, or environment state
|
|
215
|
-
- Use factories or builders for test data, not raw constructors with 15 arguments
|
|
216
|
-
- Keep test fixtures close to where they're used. Shared fixtures in `conftest.py`, not a global test utilities package
|
|
173
|
+
- **Mirror the source structure**, at whatever level the ecosystem puts tests. One test file per module, not per function, and never a second file covering a module that already has one
|
|
174
|
+
- **Separate by cost so CI gets a fast signal.** Keep quick isolated tests apart from ones needing real IO or a full workflow, and let the slow ones — long runtimes, heavy optional dependencies, live external APIs — be excluded from the gate that runs on every push and included in the full run
|
|
175
|
+
- **Fixtures live near what uses them**, shared upward only when genuinely shared. Build test data with factories or builders, never a constructor taking fifteen positional arguments
|
|
176
|
+
- **Delete tests that never catch anything.** A test that has only ever failed during refactors is a maintenance cost, not a safety net
|
|
217
177
|
|
|
218
178
|
---
|
|
219
179
|
|
|
@@ -281,9 +241,9 @@ The [Twelve-Factor App](https://12factor.net) methodology for modern, scalable a
|
|
|
281
241
|
|
|
282
242
|
---
|
|
283
243
|
|
|
284
|
-
##
|
|
244
|
+
## CLAUDE.md Stub
|
|
285
245
|
|
|
286
|
-
Copy this to any project's
|
|
246
|
+
Copy this to any project's CLAUDE.md. These are mandatory rules, not suggestions.
|
|
287
247
|
|
|
288
248
|
```markdown
|
|
289
249
|
## Dev Rules
|
|
@@ -304,5 +264,5 @@ Copy this to any project's AGENT.md. These are mandatory rules, not suggestions.
|
|
|
304
264
|
|
|
305
265
|
**Responsive web UI is mandatory.** Any web UI must work on mobile by default — fluid layouts, viewport meta, breakpoints, no horizontal scroll. Verify in DevTools device emulation before claiming a UI task is done. POCs exempt; real projects are not.
|
|
306
266
|
|
|
307
|
-
For full development and testing standards, see `.
|
|
267
|
+
For full development and testing standards, see `.claude/remember/AGENT_RULES.md`.
|
|
308
268
|
```
|