cc-dev-template 0.1.8 → 0.1.10
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/bin/install.js +82 -6
- package/package.json +1 -1
- package/src/agents/claude-md-agent.md +1 -1
- package/src/agents/execution-agent.md +2 -2
- package/src/agents/tdd-agent.md +1 -1
- package/src/mcp-servers/qa-server/README.md +120 -0
- package/src/mcp-servers/qa-server/package-lock.json +2015 -0
- package/src/mcp-servers/qa-server/package.json +28 -0
- package/src/mcp-servers/qa-server/src/index.ts +227 -0
- package/src/mcp-servers/qa-server/tsconfig.json +17 -0
- package/src/scripts/statusline.js +15 -85
- package/src/skills/create-agent-skills/references/principles.md +21 -0
- package/src/skills/orchestration/scripts/plan-status.js +5 -0
package/bin/install.js
CHANGED
|
@@ -20,7 +20,7 @@ console.log('='.repeat(50));
|
|
|
20
20
|
console.log(`Installing to ${CLAUDE_DIR}...`);
|
|
21
21
|
|
|
22
22
|
// Create directories
|
|
23
|
-
const dirs = ['agents', 'commands', 'scripts', 'skills'];
|
|
23
|
+
const dirs = ['agents', 'commands', 'scripts', 'skills', 'mcp-servers'];
|
|
24
24
|
dirs.forEach(dir => {
|
|
25
25
|
fs.mkdirSync(path.join(CLAUDE_DIR, dir), { recursive: true });
|
|
26
26
|
});
|
|
@@ -92,6 +92,75 @@ if (fs.existsSync(skillsDir)) {
|
|
|
92
92
|
console.log(' No skills to install');
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
// Install MCP servers
|
|
96
|
+
console.log('\nMCP Servers:');
|
|
97
|
+
const mcpServersDir = path.join(SRC_DIR, 'mcp-servers');
|
|
98
|
+
if (fs.existsSync(mcpServersDir)) {
|
|
99
|
+
const mcpServers = fs.readdirSync(mcpServersDir, { withFileTypes: true })
|
|
100
|
+
.filter(d => d.isDirectory());
|
|
101
|
+
|
|
102
|
+
mcpServers.forEach(server => {
|
|
103
|
+
const srcPath = path.join(mcpServersDir, server.name);
|
|
104
|
+
const destPath = path.join(CLAUDE_DIR, 'mcp-servers', server.name);
|
|
105
|
+
|
|
106
|
+
// Copy server files (excluding node_modules and dist)
|
|
107
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
108
|
+
const entries = fs.readdirSync(srcPath, { withFileTypes: true });
|
|
109
|
+
|
|
110
|
+
for (const entry of entries) {
|
|
111
|
+
if (entry.name === 'node_modules' || entry.name === 'dist') continue;
|
|
112
|
+
|
|
113
|
+
const entrySrc = path.join(srcPath, entry.name);
|
|
114
|
+
const entryDest = path.join(destPath, entry.name);
|
|
115
|
+
|
|
116
|
+
if (entry.isDirectory()) {
|
|
117
|
+
copyDir(entrySrc, entryDest);
|
|
118
|
+
} else {
|
|
119
|
+
fs.copyFileSync(entrySrc, entryDest);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
console.log(` ${server.name}/ copied`);
|
|
123
|
+
|
|
124
|
+
// Install dependencies and build
|
|
125
|
+
try {
|
|
126
|
+
console.log(` Installing dependencies...`);
|
|
127
|
+
execSync('npm install --silent', {
|
|
128
|
+
cwd: destPath,
|
|
129
|
+
stdio: 'pipe'
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
console.log(` Building...`);
|
|
133
|
+
execSync('npm run build', {
|
|
134
|
+
cwd: destPath,
|
|
135
|
+
stdio: 'pipe'
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Register with Claude Code (user-level only)
|
|
139
|
+
if (!isProjectLevel) {
|
|
140
|
+
const distPath = path.join(destPath, 'dist', 'index.js');
|
|
141
|
+
if (fs.existsSync(distPath)) {
|
|
142
|
+
try {
|
|
143
|
+
// Check if already registered
|
|
144
|
+
execSync(`claude mcp remove ${server.name} 2>/dev/null || true`, { stdio: 'pipe' });
|
|
145
|
+
execSync(`claude mcp add ${server.name} node "${distPath}"`, { stdio: 'pipe' });
|
|
146
|
+
console.log(` Registered with Claude Code`);
|
|
147
|
+
} catch (e) {
|
|
148
|
+
console.log(` ⚠ Could not register with Claude Code (run manually: claude mcp add ${server.name} node "${distPath}")`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
console.log(` ✓ ${server.name} installed`);
|
|
154
|
+
} catch (e) {
|
|
155
|
+
console.log(` ⚠ Failed to build ${server.name}: ${e.message}`);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
console.log(`✓ ${mcpServers.length} MCP server(s) processed`);
|
|
160
|
+
} else {
|
|
161
|
+
console.log(' No MCP servers to install');
|
|
162
|
+
}
|
|
163
|
+
|
|
95
164
|
// Create package.json for dependencies
|
|
96
165
|
console.log('\nDependencies:');
|
|
97
166
|
const pkgJson = {
|
|
@@ -151,11 +220,12 @@ console.log('Installation complete!');
|
|
|
151
220
|
console.log('='.repeat(50));
|
|
152
221
|
console.log(`
|
|
153
222
|
Installed to:
|
|
154
|
-
Agents:
|
|
155
|
-
Commands:
|
|
156
|
-
Scripts:
|
|
157
|
-
Skills:
|
|
158
|
-
|
|
223
|
+
Agents: ${CLAUDE_DIR}/agents/
|
|
224
|
+
Commands: ${CLAUDE_DIR}/commands/
|
|
225
|
+
Scripts: ${CLAUDE_DIR}/scripts/
|
|
226
|
+
Skills: ${CLAUDE_DIR}/skills/
|
|
227
|
+
MCP Servers: ${CLAUDE_DIR}/mcp-servers/
|
|
228
|
+
Settings: ${CLAUDE_DIR}/settings.json
|
|
159
229
|
`);
|
|
160
230
|
|
|
161
231
|
if (isProjectLevel) {
|
|
@@ -166,6 +236,12 @@ Claude Code will use project-level settings with user-level as fallback.
|
|
|
166
236
|
} else {
|
|
167
237
|
console.log(`User-level installation complete.
|
|
168
238
|
These settings are available globally across all your projects.
|
|
239
|
+
|
|
240
|
+
MCP Server Notes:
|
|
241
|
+
- qa-server: Spawns a sub-agent for frontend visual inspection
|
|
242
|
+
Saves ~20k tokens by offloading browser tools to sub-agent
|
|
243
|
+
If you have chrome-devtools MCP installed, consider removing it:
|
|
244
|
+
claude mcp remove chrome-devtools
|
|
169
245
|
`);
|
|
170
246
|
}
|
|
171
247
|
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ When given insights to document:
|
|
|
28
28
|
|
|
29
29
|
## ADR vs CLAUDE.md
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Route ADR-worthy content to adr-agent instead.
|
|
32
32
|
|
|
33
33
|
| CLAUDE.md (Operational How-To) | ADR (Architectural Decision) |
|
|
34
34
|
|-------------------------------|------------------------------|
|
|
@@ -130,7 +130,7 @@ The prompting skill ensures your prompts follow established patterns: explaining
|
|
|
130
130
|
- **Missing Dependency** - Need something from an upstream task that wasn't done
|
|
131
131
|
- **Blocked** - External factor prevents completion (missing API key, service down, etc.)
|
|
132
132
|
|
|
133
|
-
**
|
|
133
|
+
**Stop and escalate when unexpected issues arise.** The plan should have removed all ambiguity. If something is unexpected, escalate.
|
|
134
134
|
|
|
135
135
|
When escalating, report:
|
|
136
136
|
- What you encountered
|
|
@@ -145,4 +145,4 @@ When escalating, report:
|
|
|
145
145
|
|
|
146
146
|
**Outcome is context** - Write outcomes for the next person (or agent). What did you do? Where are things? What decisions did you make?
|
|
147
147
|
|
|
148
|
-
**
|
|
148
|
+
**Escalate when unclear** - If the task or plan is unclear, escalate rather than guessing.
|
package/src/agents/tdd-agent.md
CHANGED
|
@@ -156,7 +156,7 @@ Report:
|
|
|
156
156
|
|
|
157
157
|
**Tests are specifications.** In fix mode, the test defines correct behavior. Don't question it—make the code conform.
|
|
158
158
|
|
|
159
|
-
**Fix mode: code only.**
|
|
159
|
+
**Fix mode: code only.** Modify only non-test files in fix mode. If the test is wrong, escalate.
|
|
160
160
|
|
|
161
161
|
**Test mode: fail is success.** A test that fails (because the bug exists) is exactly what we want. A passing test means the hypothesis is wrong.
|
|
162
162
|
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# QA Server
|
|
2
|
+
|
|
3
|
+
MCP server that spawns a Claude sub-agent for frontend visual inspection.
|
|
4
|
+
|
|
5
|
+
## Problem
|
|
6
|
+
|
|
7
|
+
Chrome DevTools MCP adds ~20k tokens to context just from tool definitions, even when browser inspection isn't needed. This wastes context in long sessions.
|
|
8
|
+
|
|
9
|
+
## Solution
|
|
10
|
+
|
|
11
|
+
This server exposes a single `inspect_frontend` tool (~500 tokens) that spawns a sub-agent with full browser capabilities on-demand.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Main Conversation (~500 tokens)
|
|
15
|
+
│
|
|
16
|
+
└── mcp__qa__inspect_frontend
|
|
17
|
+
│
|
|
18
|
+
└── Sub-agent with chrome-devtools MCP (full control)
|
|
19
|
+
│
|
|
20
|
+
└── Returns QA report
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cd src/mcp-servers/qa-server
|
|
27
|
+
npm install
|
|
28
|
+
npm run build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then add to Claude Code:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
claude mcp add qa node /path/to/qa-server/dist/index.js
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or in `~/.claude.json`:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"qa": {
|
|
43
|
+
"type": "stdio",
|
|
44
|
+
"command": "node",
|
|
45
|
+
"args": ["/path/to/qa-server/dist/index.js"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## After Setup
|
|
52
|
+
|
|
53
|
+
Remove chrome-devtools from your main config to save tokens:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
claude mcp remove chrome-devtools
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
From Claude Code conversation:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
Inspect http://localhost:3000 and verify the login form works
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Claude will call `mcp__qa__inspect_frontend` with:
|
|
68
|
+
- url: "http://localhost:3000"
|
|
69
|
+
- task: "verify the login form works"
|
|
70
|
+
|
|
71
|
+
The sub-agent will:
|
|
72
|
+
1. Navigate to the URL
|
|
73
|
+
2. Take screenshots
|
|
74
|
+
3. Check console errors
|
|
75
|
+
4. Perform the task (click, fill forms, etc.)
|
|
76
|
+
5. Return a structured QA report
|
|
77
|
+
|
|
78
|
+
## Tool Definition
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
{
|
|
82
|
+
name: "inspect_frontend",
|
|
83
|
+
description: "Spawn a QA sub-agent to visually inspect a frontend...",
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: "object",
|
|
86
|
+
properties: {
|
|
87
|
+
url: { type: "string", description: "URL to inspect" },
|
|
88
|
+
task: { type: "string", description: "What to inspect or test" }
|
|
89
|
+
},
|
|
90
|
+
required: ["url", "task"]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Sub-agent Capabilities
|
|
96
|
+
|
|
97
|
+
The spawned sub-agent uses Opus (best visual understanding) and has access to:
|
|
98
|
+
|
|
99
|
+
- **Navigation**: navigate_page, new_page, list_pages, select_page, wait_for
|
|
100
|
+
- **Inspection**: take_screenshot, take_snapshot, list_console_messages
|
|
101
|
+
- **Interaction**: click, fill, fill_form, hover, press_key, handle_dialog
|
|
102
|
+
|
|
103
|
+
## Token Savings
|
|
104
|
+
|
|
105
|
+
| Before | After |
|
|
106
|
+
|--------|-------|
|
|
107
|
+
| ~20k tokens (26 browser tools always loaded) | ~500 tokens (1 tool) |
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Run in development mode
|
|
113
|
+
npm run dev
|
|
114
|
+
|
|
115
|
+
# Build for production
|
|
116
|
+
npm run build
|
|
117
|
+
|
|
118
|
+
# Run production build
|
|
119
|
+
npm start
|
|
120
|
+
```
|