safeword 0.2.4 → 0.2.6
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/dist/check-3NGQ4NR5.js +129 -0
- package/dist/check-3NGQ4NR5.js.map +1 -0
- package/dist/chunk-2XWIUEQK.js +190 -0
- package/dist/chunk-2XWIUEQK.js.map +1 -0
- package/dist/chunk-GZRQL3SX.js +146 -0
- package/dist/chunk-GZRQL3SX.js.map +1 -0
- package/dist/chunk-ORQHKDT2.js +10 -0
- package/dist/chunk-ORQHKDT2.js.map +1 -0
- package/dist/chunk-W66Z3C5H.js +21 -0
- package/dist/chunk-W66Z3C5H.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +34 -0
- package/dist/cli.js.map +1 -0
- package/dist/diff-Y6QTAW4O.js +166 -0
- package/dist/diff-Y6QTAW4O.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/reset-3ACTIYYE.js +143 -0
- package/dist/reset-3ACTIYYE.js.map +1 -0
- package/dist/setup-AIL5RL45.js +276 -0
- package/dist/setup-AIL5RL45.js.map +1 -0
- package/dist/upgrade-6AR3DHUV.js +134 -0
- package/dist/upgrade-6AR3DHUV.js.map +1 -0
- package/package.json +44 -19
- package/{.safeword → templates}/hooks/agents-md-check.sh +0 -0
- package/{.safeword → templates}/hooks/post-tool.sh +0 -0
- package/{.safeword → templates}/hooks/pre-commit.sh +0 -0
- package/.claude/commands/arch-review.md +0 -32
- package/.claude/commands/lint.md +0 -6
- package/.claude/commands/quality-review.md +0 -13
- package/.claude/commands/setup-linting.md +0 -6
- package/.claude/hooks/auto-lint.sh +0 -6
- package/.claude/hooks/auto-quality-review.sh +0 -170
- package/.claude/hooks/check-linting-sync.sh +0 -17
- package/.claude/hooks/inject-timestamp.sh +0 -6
- package/.claude/hooks/question-protocol.sh +0 -12
- package/.claude/hooks/run-linters.sh +0 -8
- package/.claude/hooks/run-quality-review.sh +0 -76
- package/.claude/hooks/version-check.sh +0 -10
- package/.claude/mcp/README.md +0 -96
- package/.claude/mcp/arcade.sample.json +0 -9
- package/.claude/mcp/context7.sample.json +0 -7
- package/.claude/mcp/playwright.sample.json +0 -7
- package/.claude/settings.json +0 -62
- package/.claude/skills/quality-reviewer/SKILL.md +0 -190
- package/.claude/skills/safeword-quality-reviewer/SKILL.md +0 -13
- package/.env.arcade.example +0 -4
- package/.env.example +0 -11
- package/.gitmodules +0 -4
- package/.safeword/SAFEWORD.md +0 -33
- package/.safeword/eslint/eslint-base.mjs +0 -101
- package/.safeword/guides/architecture-guide.md +0 -404
- package/.safeword/guides/code-philosophy.md +0 -174
- package/.safeword/guides/context-files-guide.md +0 -405
- package/.safeword/guides/data-architecture-guide.md +0 -183
- package/.safeword/guides/design-doc-guide.md +0 -165
- package/.safeword/guides/learning-extraction.md +0 -515
- package/.safeword/guides/llm-instruction-design.md +0 -239
- package/.safeword/guides/llm-prompting.md +0 -95
- package/.safeword/guides/tdd-best-practices.md +0 -570
- package/.safeword/guides/test-definitions-guide.md +0 -243
- package/.safeword/guides/testing-methodology.md +0 -573
- package/.safeword/guides/user-story-guide.md +0 -237
- package/.safeword/guides/zombie-process-cleanup.md +0 -214
- package/.safeword/planning/002-user-story-quality-evaluation.md +0 -1840
- package/.safeword/planning/003-langsmith-eval-setup-prompt.md +0 -363
- package/.safeword/planning/004-llm-eval-test-cases.md +0 -3226
- package/.safeword/planning/005-architecture-enforcement-system.md +0 -169
- package/.safeword/planning/006-reactive-fix-prevention-research.md +0 -135
- package/.safeword/planning/011-cli-ux-vision.md +0 -330
- package/.safeword/planning/012-project-structure-cleanup.md +0 -154
- package/.safeword/planning/README.md +0 -39
- package/.safeword/planning/automation-plan-v2.md +0 -1225
- package/.safeword/planning/automation-plan-v3.md +0 -1291
- package/.safeword/planning/automation-plan.md +0 -3058
- package/.safeword/planning/design/005-cli-implementation.md +0 -343
- package/.safeword/planning/design/013-cli-self-contained-templates.md +0 -596
- package/.safeword/planning/design/013a-eslint-plugin-suite.md +0 -256
- package/.safeword/planning/design/013b-implementation-snippets.md +0 -385
- package/.safeword/planning/design/013c-config-isolation-strategy.md +0 -242
- package/.safeword/planning/design/code-philosophy-improvements.md +0 -60
- package/.safeword/planning/mcp-analysis.md +0 -545
- package/.safeword/planning/phase2-subagents-vs-skills-analysis.md +0 -451
- package/.safeword/planning/settings-improvements.md +0 -970
- package/.safeword/planning/test-definitions/005-cli-implementation.md +0 -1301
- package/.safeword/planning/test-definitions/cli-self-contained-templates.md +0 -205
- package/.safeword/planning/user-stories/001-guides-review-user-stories.md +0 -1381
- package/.safeword/planning/user-stories/003-reactive-fix-prevention.md +0 -132
- package/.safeword/planning/user-stories/004-technical-constraints.md +0 -86
- package/.safeword/planning/user-stories/005-cli-implementation.md +0 -311
- package/.safeword/planning/user-stories/cli-self-contained-templates.md +0 -172
- package/.safeword/planning/versioned-distribution.md +0 -740
- package/.safeword/prompts/arch-review.md +0 -43
- package/.safeword/prompts/quality-review.md +0 -11
- package/.safeword/scripts/arch-review.sh +0 -235
- package/.safeword/scripts/check-linting-sync.sh +0 -58
- package/.safeword/scripts/setup-linting.sh +0 -559
- package/.safeword/templates/architecture-template.md +0 -136
- package/.safeword/templates/ci/architecture-check.yml +0 -79
- package/.safeword/templates/design-doc-template.md +0 -127
- package/.safeword/templates/test-definitions-feature.md +0 -100
- package/.safeword/templates/ticket-template.md +0 -74
- package/.safeword/templates/user-stories-template.md +0 -82
- package/.safeword/tickets/001-guides-review-user-stories.md +0 -83
- package/.safeword/tickets/002-architecture-enforcement.md +0 -211
- package/.safeword/tickets/003-reactive-fix-prevention.md +0 -57
- package/.safeword/tickets/004-technical-constraints-in-user-stories.md +0 -39
- package/.safeword/tickets/005-cli-implementation.md +0 -248
- package/.safeword/tickets/006-flesh-out-skills.md +0 -43
- package/.safeword/tickets/007-flesh-out-questioning.md +0 -44
- package/.safeword/tickets/008-upgrade-questioning.md +0 -58
- package/.safeword/tickets/009-naming-conventions.md +0 -41
- package/.safeword/tickets/010-safeword-md-cleanup.md +0 -34
- package/.safeword/tickets/011-cursor-setup.md +0 -86
- package/.safeword/tickets/README.md +0 -73
- package/.safeword/version +0 -1
- package/AGENTS.md +0 -59
- package/CLAUDE.md +0 -12
- package/README.md +0 -347
- package/docs/001-cli-implementation-plan.md +0 -856
- package/docs/elite-dx-implementation-plan.md +0 -1034
- package/framework/README.md +0 -131
- package/framework/mcp/README.md +0 -96
- package/framework/mcp/arcade.sample.json +0 -8
- package/framework/mcp/context7.sample.json +0 -6
- package/framework/mcp/playwright.sample.json +0 -6
- package/framework/scripts/arch-review.sh +0 -235
- package/framework/scripts/check-linting-sync.sh +0 -58
- package/framework/scripts/load-env.sh +0 -49
- package/framework/scripts/setup-claude.sh +0 -223
- package/framework/scripts/setup-linting.sh +0 -559
- package/framework/scripts/setup-quality.sh +0 -477
- package/framework/scripts/setup-safeword.sh +0 -550
- package/framework/templates/ci/architecture-check.yml +0 -78
- package/learnings/ai-sdk-v5-breaking-changes.md +0 -178
- package/learnings/e2e-test-zombie-processes.md +0 -231
- package/learnings/milkdown-crepe-editor-property.md +0 -96
- package/learnings/prosemirror-fragment-traversal.md +0 -119
- package/packages/cli/AGENTS.md +0 -1
- package/packages/cli/ARCHITECTURE.md +0 -279
- package/packages/cli/package.json +0 -51
- package/packages/cli/src/cli.ts +0 -63
- package/packages/cli/src/commands/check.ts +0 -166
- package/packages/cli/src/commands/diff.ts +0 -209
- package/packages/cli/src/commands/reset.ts +0 -190
- package/packages/cli/src/commands/setup.ts +0 -325
- package/packages/cli/src/commands/upgrade.ts +0 -163
- package/packages/cli/src/index.ts +0 -3
- package/packages/cli/src/templates/config.ts +0 -58
- package/packages/cli/src/templates/content.ts +0 -18
- package/packages/cli/src/templates/index.ts +0 -12
- package/packages/cli/src/utils/agents-md.ts +0 -66
- package/packages/cli/src/utils/fs.ts +0 -179
- package/packages/cli/src/utils/git.ts +0 -124
- package/packages/cli/src/utils/hooks.ts +0 -29
- package/packages/cli/src/utils/output.ts +0 -60
- package/packages/cli/src/utils/project-detector.test.ts +0 -185
- package/packages/cli/src/utils/project-detector.ts +0 -44
- package/packages/cli/src/utils/version.ts +0 -28
- package/packages/cli/src/version.ts +0 -6
- package/packages/cli/templates/SAFEWORD.md +0 -776
- package/packages/cli/templates/doc-templates/architecture-template.md +0 -136
- package/packages/cli/templates/doc-templates/design-doc-template.md +0 -134
- package/packages/cli/templates/doc-templates/test-definitions-feature.md +0 -131
- package/packages/cli/templates/doc-templates/ticket-template.md +0 -82
- package/packages/cli/templates/doc-templates/user-stories-template.md +0 -92
- package/packages/cli/templates/guides/architecture-guide.md +0 -423
- package/packages/cli/templates/guides/code-philosophy.md +0 -195
- package/packages/cli/templates/guides/context-files-guide.md +0 -457
- package/packages/cli/templates/guides/data-architecture-guide.md +0 -200
- package/packages/cli/templates/guides/design-doc-guide.md +0 -171
- package/packages/cli/templates/guides/learning-extraction.md +0 -552
- package/packages/cli/templates/guides/llm-instruction-design.md +0 -248
- package/packages/cli/templates/guides/llm-prompting.md +0 -102
- package/packages/cli/templates/guides/tdd-best-practices.md +0 -615
- package/packages/cli/templates/guides/test-definitions-guide.md +0 -334
- package/packages/cli/templates/guides/testing-methodology.md +0 -618
- package/packages/cli/templates/guides/user-story-guide.md +0 -256
- package/packages/cli/templates/guides/zombie-process-cleanup.md +0 -219
- package/packages/cli/templates/hooks/agents-md-check.sh +0 -27
- package/packages/cli/templates/hooks/post-tool.sh +0 -4
- package/packages/cli/templates/hooks/pre-commit.sh +0 -10
- package/packages/cli/templates/prompts/arch-review.md +0 -43
- package/packages/cli/templates/prompts/quality-review.md +0 -10
- package/packages/cli/templates/skills/safeword-quality-reviewer/SKILL.md +0 -207
- package/packages/cli/tests/commands/check.test.ts +0 -129
- package/packages/cli/tests/commands/cli.test.ts +0 -89
- package/packages/cli/tests/commands/diff.test.ts +0 -115
- package/packages/cli/tests/commands/reset.test.ts +0 -310
- package/packages/cli/tests/commands/self-healing.test.ts +0 -170
- package/packages/cli/tests/commands/setup-blocking.test.ts +0 -71
- package/packages/cli/tests/commands/setup-core.test.ts +0 -135
- package/packages/cli/tests/commands/setup-git.test.ts +0 -139
- package/packages/cli/tests/commands/setup-hooks.test.ts +0 -334
- package/packages/cli/tests/commands/setup-linting.test.ts +0 -189
- package/packages/cli/tests/commands/setup-noninteractive.test.ts +0 -80
- package/packages/cli/tests/commands/setup-templates.test.ts +0 -181
- package/packages/cli/tests/commands/upgrade.test.ts +0 -215
- package/packages/cli/tests/helpers.ts +0 -243
- package/packages/cli/tests/npm-package.test.ts +0 -83
- package/packages/cli/tests/technical-constraints.test.ts +0 -96
- package/packages/cli/tsconfig.json +0 -25
- package/packages/cli/tsup.config.ts +0 -11
- package/packages/cli/vitest.config.ts +0 -23
- package/promptfoo.yaml +0 -3270
- /package/{framework → templates}/SAFEWORD.md +0 -0
- /package/{packages/cli/templates → templates}/commands/arch-review.md +0 -0
- /package/{packages/cli/templates → templates}/commands/lint.md +0 -0
- /package/{packages/cli/templates → templates}/commands/quality-review.md +0 -0
- /package/{framework/templates → templates/doc-templates}/architecture-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/design-doc-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/test-definitions-feature.md +0 -0
- /package/{framework/templates → templates/doc-templates}/ticket-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/user-stories-template.md +0 -0
- /package/{framework → templates}/guides/architecture-guide.md +0 -0
- /package/{framework → templates}/guides/code-philosophy.md +0 -0
- /package/{framework → templates}/guides/context-files-guide.md +0 -0
- /package/{framework → templates}/guides/data-architecture-guide.md +0 -0
- /package/{framework → templates}/guides/design-doc-guide.md +0 -0
- /package/{framework → templates}/guides/learning-extraction.md +0 -0
- /package/{framework → templates}/guides/llm-instruction-design.md +0 -0
- /package/{framework → templates}/guides/llm-prompting.md +0 -0
- /package/{framework → templates}/guides/tdd-best-practices.md +0 -0
- /package/{framework → templates}/guides/test-definitions-guide.md +0 -0
- /package/{framework → templates}/guides/testing-methodology.md +0 -0
- /package/{framework → templates}/guides/user-story-guide.md +0 -0
- /package/{framework → templates}/guides/zombie-process-cleanup.md +0 -0
- /package/{packages/cli/templates → templates}/hooks/inject-timestamp.sh +0 -0
- /package/{packages/cli/templates → templates}/lib/common.sh +0 -0
- /package/{packages/cli/templates → templates}/lib/jq-fallback.sh +0 -0
- /package/{packages/cli/templates → templates}/markdownlint.jsonc +0 -0
- /package/{framework → templates}/prompts/arch-review.md +0 -0
- /package/{framework → templates}/prompts/quality-review.md +0 -0
- /package/{framework/skills/quality-reviewer → templates/skills/safeword-quality-reviewer}/SKILL.md +0 -0
|
@@ -1,451 +0,0 @@
|
|
|
1
|
-
# Phase 2 Analysis: Subagents vs Skills vs Hooks for Quality Automation
|
|
2
|
-
|
|
3
|
-
**Context**: Automate the "double check and critique" workflow based on conversation pattern analysis
|
|
4
|
-
|
|
5
|
-
**User's pattern**: 347+ quality check prompts in bitd project (4% of all messages)
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Three Automation Mechanisms Available
|
|
10
|
-
|
|
11
|
-
### 1. Subagents (via Task Tool)
|
|
12
|
-
|
|
13
|
-
**How they work**:
|
|
14
|
-
|
|
15
|
-
- Invoked via `Task` tool with `subagent_type` parameter
|
|
16
|
-
- Run in **separate context window** from main conversation
|
|
17
|
-
- Can be automatic (Claude decides) or explicit (user requests)
|
|
18
|
-
- Configured as `.claude/agents/*.md` or `~/.claude/agents/*.md`
|
|
19
|
-
|
|
20
|
-
**Example from your history** (bitd project):
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"name": "Task",
|
|
25
|
-
"input": {
|
|
26
|
-
"description": "Search for remaining NPC mechanics",
|
|
27
|
-
"prompt": "Search through the Blades in the Dark game data files...",
|
|
28
|
-
"subagent_type": "Explore"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**Built-in subagent types** (from system instructions):
|
|
34
|
-
|
|
35
|
-
- `general-purpose` - Multi-step tasks, complex questions
|
|
36
|
-
- `Explore` - Fast codebase exploration (glob/grep/read patterns)
|
|
37
|
-
- `statusline-setup` - Configure status line (specialized)
|
|
38
|
-
- `output-style-setup` - Create output styles (specialized)
|
|
39
|
-
|
|
40
|
-
**Custom subagents possible**: Yes (via `/agents` command or manual creation)
|
|
41
|
-
|
|
42
|
-
**Strengths**:
|
|
43
|
-
|
|
44
|
-
- ✅ Separate context = doesn't pollute main conversation
|
|
45
|
-
- ✅ Can be very detailed (own token budget)
|
|
46
|
-
- ✅ Returns final report to main conversation
|
|
47
|
-
- ✅ Good for complex analysis tasks
|
|
48
|
-
|
|
49
|
-
**Weaknesses**:
|
|
50
|
-
|
|
51
|
-
- ❌ Context switch overhead (spins up new agent)
|
|
52
|
-
- ❌ Can't access main conversation history
|
|
53
|
-
- ❌ Slower than in-context operations
|
|
54
|
-
- ❌ Overkill for simple quality checks
|
|
55
|
-
|
|
56
|
-
**Best for**:
|
|
57
|
-
|
|
58
|
-
- Long analysis tasks (searching codebase, deep investigations)
|
|
59
|
-
- Tasks requiring focused context (data model reviews, architecture analysis)
|
|
60
|
-
- When you DON'T need conversation history
|
|
61
|
-
|
|
62
|
-
**For quality automation**:
|
|
63
|
-
|
|
64
|
-
- ⚠️ **Moderate fit** - Could work for comprehensive reviews, but heavyweight for simple critiques
|
|
65
|
-
- Use case: "Review entire PR before merging" ✓
|
|
66
|
-
- Use case: "Quick check before implementing" ✗ (too slow)
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
### 2. Skills
|
|
71
|
-
|
|
72
|
-
**How they work**:
|
|
73
|
-
|
|
74
|
-
- Configured as `.claude/skills/SKILL.md` or `~/.claude/skills/SKILL.md`
|
|
75
|
-
- **Model-invoked** - Claude autonomously decides when to use
|
|
76
|
-
- Run in **same context** as main conversation
|
|
77
|
-
- YAML frontmatter with `name`, `description`, `allowed-tools`
|
|
78
|
-
|
|
79
|
-
**Example configuration**:
|
|
80
|
-
|
|
81
|
-
```yaml
|
|
82
|
-
---
|
|
83
|
-
name: quality-reviewer
|
|
84
|
-
description: |
|
|
85
|
-
Automatically review code changes for correctness, elegance, and standards adherence.
|
|
86
|
-
|
|
87
|
-
Use PROACTIVELY when:
|
|
88
|
-
- About to Write or Edit code files
|
|
89
|
-
- Proposing architectural changes
|
|
90
|
-
- User says "yes"/"proceed"/"implement"
|
|
91
|
-
|
|
92
|
-
Must evaluate: correctness, elegance, standards, testability
|
|
93
|
-
allowed-tools:
|
|
94
|
-
- Read
|
|
95
|
-
- Grep
|
|
96
|
-
- Glob
|
|
97
|
-
- WebFetch
|
|
98
|
-
---
|
|
99
|
-
# Quality Review Protocol
|
|
100
|
-
[Detailed instructions...]
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Strengths**:
|
|
104
|
-
|
|
105
|
-
- ✅ Automatic activation (no manual invocation)
|
|
106
|
-
- ✅ Same context = has conversation history
|
|
107
|
-
- ✅ Fast (no context switching)
|
|
108
|
-
- ✅ Reusable across projects
|
|
109
|
-
- ✅ Can be VERY specific about when to trigger
|
|
110
|
-
|
|
111
|
-
**Weaknesses**:
|
|
112
|
-
|
|
113
|
-
- ❌ Competes for main context window tokens
|
|
114
|
-
- ❌ Activation not guaranteed (Claude decides)
|
|
115
|
-
- ❌ Harder to debug (why didn't it fire?)
|
|
116
|
-
- ❌ May fire at wrong times if description ambiguous
|
|
117
|
-
|
|
118
|
-
**Best for**:
|
|
119
|
-
|
|
120
|
-
- Frequent, automatic quality checks
|
|
121
|
-
- When conversation context is needed
|
|
122
|
-
- Workflow steps that should "just happen"
|
|
123
|
-
|
|
124
|
-
**For quality automation**:
|
|
125
|
-
|
|
126
|
-
- ✅ **EXCELLENT fit** - Exactly what skills are designed for
|
|
127
|
-
- Use case: "Check quality before every implementation" ✓✓✓
|
|
128
|
-
- Use case: "Review code after every edit" ✓✓✓
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
### 3. Hooks
|
|
133
|
-
|
|
134
|
-
**How they work**:
|
|
135
|
-
|
|
136
|
-
- Configured as `.claude/hooks/*.yaml`
|
|
137
|
-
- **Event-driven** - triggered by tool use or prompt submission
|
|
138
|
-
- Run **behind the scenes** (user doesn't see them)
|
|
139
|
-
- Can modify prompts, block operations, or provide feedback
|
|
140
|
-
|
|
141
|
-
**Three hook types**:
|
|
142
|
-
|
|
143
|
-
#### 3a. UserPromptSubmit Hook
|
|
144
|
-
|
|
145
|
-
```yaml
|
|
146
|
-
name: auto-quality-check
|
|
147
|
-
on:
|
|
148
|
-
event: user-prompt-submit
|
|
149
|
-
conditions:
|
|
150
|
-
- type: regex
|
|
151
|
-
pattern: '(?i)^(yes|proceed|implement)$'
|
|
152
|
-
script: |
|
|
153
|
-
#!/bin/bash
|
|
154
|
-
echo "$PROMPT
|
|
155
|
-
|
|
156
|
-
Before implementing, run quality checks:
|
|
157
|
-
- Correct? Elegant? Standards-compliant?"
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
**Strengths**:
|
|
161
|
-
|
|
162
|
-
- ✅ Deterministic (ALWAYS runs)
|
|
163
|
-
- ✅ Invisible to user (seamless)
|
|
164
|
-
- ✅ Can modify prompts before Claude sees them
|
|
165
|
-
- ✅ Fast (just text manipulation)
|
|
166
|
-
|
|
167
|
-
**Weaknesses**:
|
|
168
|
-
|
|
169
|
-
- ❌ Dumb (no intelligence, just pattern matching)
|
|
170
|
-
- ❌ Can be too aggressive (false positives)
|
|
171
|
-
- ❌ Harder to make context-aware
|
|
172
|
-
|
|
173
|
-
#### 3b. PostToolUse Hook
|
|
174
|
-
|
|
175
|
-
```yaml
|
|
176
|
-
name: auto-code-validation
|
|
177
|
-
on:
|
|
178
|
-
event: post-tool-use
|
|
179
|
-
tools:
|
|
180
|
-
- Write
|
|
181
|
-
- Edit
|
|
182
|
-
script: |
|
|
183
|
-
#!/bin/bash
|
|
184
|
-
# Run linters, formatters, tests
|
|
185
|
-
npm run lint 2>&1 || true
|
|
186
|
-
npm run test 2>&1 || true
|
|
187
|
-
|
|
188
|
-
echo "Automated quality checks complete. Review output above."
|
|
189
|
-
decision: block-with-feedback
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
**Strengths**:
|
|
193
|
-
|
|
194
|
-
- ✅ Runs AFTER code changes (perfect timing)
|
|
195
|
-
- ✅ Can run external tools (linters, tests)
|
|
196
|
-
- ✅ Forces Claude to see results
|
|
197
|
-
- ✅ Deterministic validation
|
|
198
|
-
|
|
199
|
-
**Weaknesses**:
|
|
200
|
-
|
|
201
|
-
- ❌ Requires external tools (npm scripts)
|
|
202
|
-
- ❌ Synchronous (blocks until complete)
|
|
203
|
-
- ❌ Can be slow if tools are slow
|
|
204
|
-
|
|
205
|
-
**Best for**:
|
|
206
|
-
|
|
207
|
-
- Automated validation after code changes
|
|
208
|
-
- Running external quality tools
|
|
209
|
-
- Enforcing quality gates
|
|
210
|
-
|
|
211
|
-
**For quality automation**:
|
|
212
|
-
|
|
213
|
-
- ✅ **EXCELLENT fit** - Deterministic post-implementation checks
|
|
214
|
-
- Use case: "Run tests after every code change" ✓✓✓
|
|
215
|
-
- Use case: "Lint after every edit" ✓✓✓
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## Comparison Matrix
|
|
220
|
-
|
|
221
|
-
| Feature | Subagents | Skills | Hooks |
|
|
222
|
-
| --------------------- | --------------------- | ----------------------- | ------------------ |
|
|
223
|
-
| **Invocation** | Explicit or auto | Auto (model-invoked) | Event-driven |
|
|
224
|
-
| **Context** | Separate window | Same as main | N/A (pre/post) |
|
|
225
|
-
| **Intelligence** | Full AI | Full AI | Scripted |
|
|
226
|
-
| **Speed** | Slow (context switch) | Fast | Very fast |
|
|
227
|
-
| **Determinism** | Low (Claude decides) | Medium (Claude decides) | High (always runs) |
|
|
228
|
-
| **Access to history** | No | Yes | No (prompts only) |
|
|
229
|
-
| **External tools** | Via allowed-tools | Via allowed-tools | Direct (bash) |
|
|
230
|
-
| **Best for** | Complex analysis | Auto quality checks | Validation gates |
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## Recommendation for "Double Check and Critique" Automation
|
|
235
|
-
|
|
236
|
-
### Phase 2A: Skills (RECOMMENDED)
|
|
237
|
-
|
|
238
|
-
**Create**: `~/.claude/skills/quality-reviewer/SKILL.md`
|
|
239
|
-
|
|
240
|
-
**Why**:
|
|
241
|
-
|
|
242
|
-
1. ✅ **Automatic** - Fires when Claude proposes code changes (matches your workflow)
|
|
243
|
-
2. ✅ **Conversation context** - Sees your requirements, templates, guides
|
|
244
|
-
3. ✅ **Fast** - No context switching overhead
|
|
245
|
-
4. ✅ **Flexible** - Can check docs, read files, search codebase
|
|
246
|
-
5. ✅ **Reusable** - Works across all projects
|
|
247
|
-
|
|
248
|
-
**When it activates**:
|
|
249
|
-
|
|
250
|
-
- User says "yes" / "proceed" / "implement" after Claude's proposal
|
|
251
|
-
- Claude is about to write/edit code
|
|
252
|
-
- Proposing architectural changes
|
|
253
|
-
|
|
254
|
-
**What it does**:
|
|
255
|
-
|
|
256
|
-
1. Look up latest documentation for libraries used
|
|
257
|
-
2. Evaluate against quality criteria (correct, elegant, standards-compliant)
|
|
258
|
-
3. Check for bloat, edge cases, error handling
|
|
259
|
-
4. Provide structured critique with recommendation (PROCEED / REVISE / USER INPUT)
|
|
260
|
-
5. Wait for approval if issues found
|
|
261
|
-
|
|
262
|
-
**Result**: 347 quality check prompts → 0 (skill handles automatically)
|
|
263
|
-
|
|
264
|
-
---
|
|
265
|
-
|
|
266
|
-
### Phase 2B: PostToolUse Hook (COMPLEMENTARY)
|
|
267
|
-
|
|
268
|
-
**Create**: `~/.claude/hooks/post-code-validation.yaml`
|
|
269
|
-
|
|
270
|
-
**Why**:
|
|
271
|
-
|
|
272
|
-
1. ✅ **Deterministic** - ALWAYS runs after code changes
|
|
273
|
-
2. ✅ **External validation** - Runs linters, formatters, tests
|
|
274
|
-
3. ✅ **Catch issues immediately** - Before moving to next task
|
|
275
|
-
4. ✅ **No human intervention** - Automatic quality gates
|
|
276
|
-
|
|
277
|
-
**When it activates**:
|
|
278
|
-
|
|
279
|
-
- After every Write or Edit tool use
|
|
280
|
-
|
|
281
|
-
**What it does**:
|
|
282
|
-
|
|
283
|
-
1. Run `npm run lint` (if available)
|
|
284
|
-
2. Run `npm run format --check` (if available)
|
|
285
|
-
3. Run `npm run test` (if applicable)
|
|
286
|
-
4. Run `tsc --noEmit` (type checking)
|
|
287
|
-
5. Show results to Claude, who fixes issues before continuing
|
|
288
|
-
|
|
289
|
-
**Result**: Catches issues Claude might miss (syntax errors, test failures, type errors)
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
### Why NOT Subagents for Phase 2?
|
|
294
|
-
|
|
295
|
-
**Subagents are OVERKILL for quality checks**:
|
|
296
|
-
|
|
297
|
-
- ❌ Too slow (context switching overhead)
|
|
298
|
-
- ❌ Don't need separate context (quality checks benefit from conversation history)
|
|
299
|
-
- ❌ Better suited for long analysis tasks (your history shows: searching game data, exhaustive file searches)
|
|
300
|
-
- ❌ Can't replace the "double check ritual" as seamlessly as skills
|
|
301
|
-
|
|
302
|
-
**When to use subagents instead**:
|
|
303
|
-
|
|
304
|
-
- ✅ "Review the entire architecture document for inconsistencies" (long, focused analysis)
|
|
305
|
-
- ✅ "Search the entire codebase for deprecated patterns" (Explore subagent)
|
|
306
|
-
- ✅ "Analyze the data model for missing mechanics" (deep investigation)
|
|
307
|
-
|
|
308
|
-
**Your actual subagent usage** (from bitd history):
|
|
309
|
-
|
|
310
|
-
- "Search for remaining NPC mechanics" - Explore subagent ✓ (correct use)
|
|
311
|
-
- "Search exhaustively for character mechanics" - Explore subagent ✓ (correct use)
|
|
312
|
-
- "Deep search for missing mechanics" - Explore subagent ✓ (correct use)
|
|
313
|
-
|
|
314
|
-
**All 3 uses**: Long, exhaustive searches. NOT quality checks.
|
|
315
|
-
|
|
316
|
-
---
|
|
317
|
-
|
|
318
|
-
### Why NOT UserPromptSubmit Hook for Phase 2?
|
|
319
|
-
|
|
320
|
-
**UserPromptSubmit hooks are TOO DUMB**:
|
|
321
|
-
|
|
322
|
-
- ❌ Pattern matching only (no intelligence)
|
|
323
|
-
- ❌ Can't evaluate context (is this the right time to critique?)
|
|
324
|
-
- ❌ False positives ("yes, I understand" triggers quality checklist)
|
|
325
|
-
- ❌ False negatives (miss cases where quality check needed)
|
|
326
|
-
|
|
327
|
-
**Better for**: Simple prompt modifications
|
|
328
|
-
|
|
329
|
-
- ✅ Auto-append project context
|
|
330
|
-
- ✅ Add timestamps
|
|
331
|
-
- ✅ Block prompts with credentials
|
|
332
|
-
|
|
333
|
-
**Not suitable for**: Intelligent quality decisions
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
## Revised Phase 2 Implementation Plan
|
|
338
|
-
|
|
339
|
-
### Step 1: Create Quality Reviewer Skill (1 hour)
|
|
340
|
-
|
|
341
|
-
**File**: `~/.claude/skills/quality-reviewer/SKILL.md`
|
|
342
|
-
|
|
343
|
-
**Key sections**:
|
|
344
|
-
|
|
345
|
-
1. **Description** - When to invoke (CRITICAL for auto-activation)
|
|
346
|
-
2. **Latest docs verification** - WebFetch/WebSearch for library docs
|
|
347
|
-
3. **Quality criteria** - Correct, elegant, standards, testable
|
|
348
|
-
4. **Structured output** - PROCEED / REVISE / USER INPUT
|
|
349
|
-
5. **Escalation rules** - When to ask user vs figure it out
|
|
350
|
-
|
|
351
|
-
**Testing**:
|
|
352
|
-
|
|
353
|
-
- Propose code change → Skill should activate
|
|
354
|
-
- Say "yes" → Skill should run final check
|
|
355
|
-
- Ask question → Skill should NOT activate
|
|
356
|
-
|
|
357
|
-
---
|
|
358
|
-
|
|
359
|
-
### Step 2: Create PostToolUse Hook (30 min)
|
|
360
|
-
|
|
361
|
-
**File**: `~/.claude/hooks/post-code-validation.yaml`
|
|
362
|
-
|
|
363
|
-
**What it runs**:
|
|
364
|
-
|
|
365
|
-
- `npm run lint` (if package.json has "lint" script)
|
|
366
|
-
- `npm run format -- --check` (read-only format check)
|
|
367
|
-
- `pnpm tsc --noEmit` (type checking)
|
|
368
|
-
- Show results, Claude fixes issues
|
|
369
|
-
|
|
370
|
-
**Testing**:
|
|
371
|
-
|
|
372
|
-
- Write code with lint error → Hook catches it
|
|
373
|
-
- Write code with type error → Hook catches it
|
|
374
|
-
- Write valid code → Hook passes, Claude continues
|
|
375
|
-
|
|
376
|
-
---
|
|
377
|
-
|
|
378
|
-
### Step 3: Monitor and Refine (1 week)
|
|
379
|
-
|
|
380
|
-
**Track**:
|
|
381
|
-
|
|
382
|
-
- How often does skill activate?
|
|
383
|
-
- Are there false positives (activates when shouldn't)?
|
|
384
|
-
- Are there false negatives (misses when should activate)?
|
|
385
|
-
- Does post-hook slow down workflow?
|
|
386
|
-
|
|
387
|
-
**Refine**:
|
|
388
|
-
|
|
389
|
-
- Adjust skill description if activation inconsistent
|
|
390
|
-
- Add/remove hook validations based on project needs
|
|
391
|
-
- Consider project-specific skills for domain-heavy projects (bitd)
|
|
392
|
-
|
|
393
|
-
---
|
|
394
|
-
|
|
395
|
-
## Subagents: When to Create Custom Ones
|
|
396
|
-
|
|
397
|
-
**Create custom subagents for**:
|
|
398
|
-
|
|
399
|
-
1. **Code Reviewer** (for PR reviews)
|
|
400
|
-
- Use: "Review all changes in this PR"
|
|
401
|
-
- Separate context = focuses only on the diff
|
|
402
|
-
- Returns comprehensive report
|
|
403
|
-
|
|
404
|
-
2. **Architecture Analyst** (for design reviews)
|
|
405
|
-
- Use: "Analyze this design doc against architecture.md"
|
|
406
|
-
- Separate context = focuses on consistency
|
|
407
|
-
- Returns list of violations
|
|
408
|
-
|
|
409
|
-
3. **Test Generator** (for test creation)
|
|
410
|
-
- Use: "Generate tests for this feature"
|
|
411
|
-
- Separate context = focuses on test coverage
|
|
412
|
-
- Returns test scaffolding
|
|
413
|
-
|
|
414
|
-
**Don't create subagents for**:
|
|
415
|
-
|
|
416
|
-
- ❌ Quality checks before implementation (use Skills)
|
|
417
|
-
- ❌ Post-implementation validation (use Hooks)
|
|
418
|
-
- ❌ Quick lookups (use main conversation)
|
|
419
|
-
|
|
420
|
-
---
|
|
421
|
-
|
|
422
|
-
## Summary
|
|
423
|
-
|
|
424
|
-
**For your "double check and critique" automation**:
|
|
425
|
-
|
|
426
|
-
| Approach | Use It? | Why |
|
|
427
|
-
| --------------------- | -------- | -------------------------------------------- |
|
|
428
|
-
| Skills | ✅ YES | Perfect for auto quality checks with context |
|
|
429
|
-
| PostToolUse Hook | ✅ YES | Perfect for deterministic validation |
|
|
430
|
-
| UserPromptSubmit Hook | ⚠️ MAYBE | Phase 3 if Phases 1-2 insufficient |
|
|
431
|
-
| Subagents | ❌ NO | Overkill for quick quality checks |
|
|
432
|
-
|
|
433
|
-
**Best combo**: Skills (intelligent quality checks) + PostToolUse Hook (deterministic validation)
|
|
434
|
-
|
|
435
|
-
**Expected result**:
|
|
436
|
-
|
|
437
|
-
- Before: 347 "double check and critique" prompts
|
|
438
|
-
- After: 0 (skill + hook handle automatically)
|
|
439
|
-
- Quality maintained: Yes (automated checks more consistent than manual)
|
|
440
|
-
- Speed improved: Yes (no waiting for user to type critique prompt)
|
|
441
|
-
|
|
442
|
-
---
|
|
443
|
-
|
|
444
|
-
## Next Steps
|
|
445
|
-
|
|
446
|
-
1. **Review this analysis** - Does it match your workflow?
|
|
447
|
-
2. **Approve approach** - Skills + Hooks or suggest modifications?
|
|
448
|
-
3. **Create configurations** - I'll generate the actual SKILL.md and hook YAML files
|
|
449
|
-
4. **Test in real usage** - Run in both soulless-monorepo and bitd projects
|
|
450
|
-
5. **Monitor for 1 week** - Track activation patterns and refine
|
|
451
|
-
6. **Consider subagents** - Only if you need long-form analysis features (PR reviews, architecture audits)
|