claudecto 0.1.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/LICENSE +21 -0
- package/README.md +275 -0
- package/dist/__tests__/package.test.d.ts +2 -0
- package/dist/__tests__/package.test.d.ts.map +1 -0
- package/dist/__tests__/package.test.js +53 -0
- package/dist/__tests__/package.test.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +200 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/server/index.d.ts +11 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +1207 -0
- package/dist/server/index.js.map +1 -0
- package/dist/services/advisor.d.ts +117 -0
- package/dist/services/advisor.d.ts.map +1 -0
- package/dist/services/advisor.js +2636 -0
- package/dist/services/advisor.js.map +1 -0
- package/dist/services/agent-generator.d.ts +71 -0
- package/dist/services/agent-generator.d.ts.map +1 -0
- package/dist/services/agent-generator.js +295 -0
- package/dist/services/agent-generator.js.map +1 -0
- package/dist/services/agents.d.ts +67 -0
- package/dist/services/agents.d.ts.map +1 -0
- package/dist/services/agents.js +405 -0
- package/dist/services/agents.js.map +1 -0
- package/dist/services/analytics.d.ts +145 -0
- package/dist/services/analytics.d.ts.map +1 -0
- package/dist/services/analytics.js +609 -0
- package/dist/services/analytics.js.map +1 -0
- package/dist/services/blueprints.d.ts +31 -0
- package/dist/services/blueprints.d.ts.map +1 -0
- package/dist/services/blueprints.js +317 -0
- package/dist/services/blueprints.js.map +1 -0
- package/dist/services/claude-dir.d.ts +50 -0
- package/dist/services/claude-dir.d.ts.map +1 -0
- package/dist/services/claude-dir.js +193 -0
- package/dist/services/claude-dir.js.map +1 -0
- package/dist/services/hooks.d.ts +38 -0
- package/dist/services/hooks.d.ts.map +1 -0
- package/dist/services/hooks.js +165 -0
- package/dist/services/hooks.js.map +1 -0
- package/dist/services/insights.d.ts +52 -0
- package/dist/services/insights.d.ts.map +1 -0
- package/dist/services/insights.js +1035 -0
- package/dist/services/insights.js.map +1 -0
- package/dist/services/memory.d.ts +14 -0
- package/dist/services/memory.d.ts.map +1 -0
- package/dist/services/memory.js +25 -0
- package/dist/services/memory.js.map +1 -0
- package/dist/services/plans.d.ts +20 -0
- package/dist/services/plans.d.ts.map +1 -0
- package/dist/services/plans.js +149 -0
- package/dist/services/plans.js.map +1 -0
- package/dist/services/project-intelligence.d.ts +75 -0
- package/dist/services/project-intelligence.d.ts.map +1 -0
- package/dist/services/project-intelligence.js +731 -0
- package/dist/services/project-intelligence.js.map +1 -0
- package/dist/services/search.d.ts +32 -0
- package/dist/services/search.d.ts.map +1 -0
- package/dist/services/search.js +203 -0
- package/dist/services/search.js.map +1 -0
- package/dist/services/sessions.d.ts +25 -0
- package/dist/services/sessions.d.ts.map +1 -0
- package/dist/services/sessions.js +248 -0
- package/dist/services/sessions.js.map +1 -0
- package/dist/services/skills.d.ts +30 -0
- package/dist/services/skills.d.ts.map +1 -0
- package/dist/services/skills.js +197 -0
- package/dist/services/skills.js.map +1 -0
- package/dist/services/stats.d.ts +23 -0
- package/dist/services/stats.d.ts.map +1 -0
- package/dist/services/stats.js +88 -0
- package/dist/services/stats.js.map +1 -0
- package/dist/services/teams.d.ts +115 -0
- package/dist/services/teams.d.ts.map +1 -0
- package/dist/services/teams.js +421 -0
- package/dist/services/teams.js.map +1 -0
- package/dist/services/tech-stack.d.ts +98 -0
- package/dist/services/tech-stack.d.ts.map +1 -0
- package/dist/services/tech-stack.js +1088 -0
- package/dist/services/tech-stack.js.map +1 -0
- package/dist/services/terminal.d.ts +75 -0
- package/dist/services/terminal.d.ts.map +1 -0
- package/dist/services/terminal.js +224 -0
- package/dist/services/terminal.js.map +1 -0
- package/dist/types.d.ts +1095 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/assets/index-BiH4Nhdk.css +1 -0
- package/dist/ui/assets/index-Brv-K8bd.css +1 -0
- package/dist/ui/assets/index-BwMBEdQz.js +3108 -0
- package/dist/ui/assets/index-BwMBEdQz.js.map +1 -0
- package/dist/ui/assets/index-CEWz7ABD.js +3108 -0
- package/dist/ui/assets/index-CEWz7ABD.js.map +1 -0
- package/dist/ui/assets/index-CIZ3vvc-.css +1 -0
- package/dist/ui/assets/index-CsU3cI0n.js +3108 -0
- package/dist/ui/assets/index-CsU3cI0n.js.map +1 -0
- package/dist/ui/assets/index-D3AY6iCS.js +3133 -0
- package/dist/ui/assets/index-D3AY6iCS.js.map +1 -0
- package/dist/ui/assets/index-D8lNZ0Ye.css +1 -0
- package/dist/ui/assets/index-DmgeppSA.js +3108 -0
- package/dist/ui/assets/index-DmgeppSA.js.map +1 -0
- package/dist/ui/favicon.svg +43 -0
- package/dist/ui/index.html +23 -0
- package/dist/utils/jsonl.d.ts +16 -0
- package/dist/utils/jsonl.d.ts.map +1 -0
- package/dist/utils/jsonl.js +51 -0
- package/dist/utils/jsonl.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blueprints service - Pre-built templates for agents and teams
|
|
3
|
+
* Provides built-in templates and import/export functionality
|
|
4
|
+
*/
|
|
5
|
+
import type { Blueprint, BlueprintCategory } from '../types.js';
|
|
6
|
+
import { ClaudeDir } from './claude-dir.js';
|
|
7
|
+
export declare class BlueprintsService {
|
|
8
|
+
private claudeDir;
|
|
9
|
+
constructor(claudeDir: ClaudeDir);
|
|
10
|
+
/**
|
|
11
|
+
* List all available blueprints (built-in)
|
|
12
|
+
*/
|
|
13
|
+
listBlueprints(): Promise<Blueprint[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Get a specific blueprint by ID
|
|
16
|
+
*/
|
|
17
|
+
getBlueprint(id: string): Promise<Blueprint | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Get blueprints by category
|
|
20
|
+
*/
|
|
21
|
+
getBlueprintsByCategory(category: BlueprintCategory): Promise<Blueprint[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Get blueprints by type (agent or team)
|
|
24
|
+
*/
|
|
25
|
+
getBlueprintsByType(type: 'agent' | 'team'): Promise<Blueprint[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Built-in blueprints
|
|
28
|
+
*/
|
|
29
|
+
private getBuiltInBlueprints;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=blueprints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprints.d.ts","sourceRoot":"","sources":["../../src/services/blueprints.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,SAAS,CAAY;gBAEjB,SAAS,EAAE,SAAS;IAIhC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAI5C;;OAEG;IACG,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAKzD;;OAEG;IACG,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAKhF;;OAEG;IACG,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAKvE;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAgS7B"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blueprints service - Pre-built templates for agents and teams
|
|
3
|
+
* Provides built-in templates and import/export functionality
|
|
4
|
+
*/
|
|
5
|
+
export class BlueprintsService {
|
|
6
|
+
claudeDir;
|
|
7
|
+
constructor(claudeDir) {
|
|
8
|
+
this.claudeDir = claudeDir;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List all available blueprints (built-in)
|
|
12
|
+
*/
|
|
13
|
+
async listBlueprints() {
|
|
14
|
+
return this.getBuiltInBlueprints();
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get a specific blueprint by ID
|
|
18
|
+
*/
|
|
19
|
+
async getBlueprint(id) {
|
|
20
|
+
const blueprints = this.getBuiltInBlueprints();
|
|
21
|
+
return blueprints.find((b) => b.id === id) || null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get blueprints by category
|
|
25
|
+
*/
|
|
26
|
+
async getBlueprintsByCategory(category) {
|
|
27
|
+
const blueprints = this.getBuiltInBlueprints();
|
|
28
|
+
return blueprints.filter((b) => b.category === category);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get blueprints by type (agent or team)
|
|
32
|
+
*/
|
|
33
|
+
async getBlueprintsByType(type) {
|
|
34
|
+
const blueprints = this.getBuiltInBlueprints();
|
|
35
|
+
return blueprints.filter((b) => b.type === type);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Built-in blueprints
|
|
39
|
+
*/
|
|
40
|
+
getBuiltInBlueprints() {
|
|
41
|
+
return [
|
|
42
|
+
// Agent Blueprints
|
|
43
|
+
{
|
|
44
|
+
id: 'agent-code-reviewer',
|
|
45
|
+
name: 'Code Reviewer',
|
|
46
|
+
type: 'agent',
|
|
47
|
+
description: 'Reviews code for bugs, security issues, and best practices',
|
|
48
|
+
category: 'review',
|
|
49
|
+
icon: 'search',
|
|
50
|
+
isBuiltIn: true,
|
|
51
|
+
content: `---
|
|
52
|
+
name: code-reviewer
|
|
53
|
+
description: Reviews code for bugs, security issues, and best practices
|
|
54
|
+
allowed-tools: Read, Grep, Glob
|
|
55
|
+
context: fork
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
# Code Reviewer Agent
|
|
59
|
+
|
|
60
|
+
You are an expert code reviewer. Analyze code for:
|
|
61
|
+
|
|
62
|
+
## Review Criteria
|
|
63
|
+
|
|
64
|
+
1. **Bugs & Errors**: Look for logic errors, edge cases, null checks
|
|
65
|
+
2. **Security**: Check for vulnerabilities, injection risks, auth issues
|
|
66
|
+
3. **Performance**: Identify inefficient code, memory leaks, N+1 queries
|
|
67
|
+
4. **Best Practices**: Verify coding standards, naming conventions
|
|
68
|
+
5. **Maintainability**: Assess readability, modularity, documentation
|
|
69
|
+
|
|
70
|
+
## Output Format
|
|
71
|
+
|
|
72
|
+
Provide a structured review with:
|
|
73
|
+
- 🔴 Critical issues (must fix)
|
|
74
|
+
- 🟡 Warnings (should fix)
|
|
75
|
+
- 🟢 Suggestions (nice to have)
|
|
76
|
+
`,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'agent-test-writer',
|
|
80
|
+
name: 'Test Writer',
|
|
81
|
+
type: 'agent',
|
|
82
|
+
description: 'Generates comprehensive unit and integration tests',
|
|
83
|
+
category: 'testing',
|
|
84
|
+
icon: 'beaker',
|
|
85
|
+
isBuiltIn: true,
|
|
86
|
+
content: `---
|
|
87
|
+
name: test-writer
|
|
88
|
+
description: Generates comprehensive unit and integration tests
|
|
89
|
+
allowed-tools: Read, Grep, Glob, Write, Edit
|
|
90
|
+
context: fork
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
# Test Writer Agent
|
|
94
|
+
|
|
95
|
+
You are an expert test engineer. Generate comprehensive tests for code.
|
|
96
|
+
|
|
97
|
+
## Testing Strategy
|
|
98
|
+
|
|
99
|
+
1. **Unit Tests**: Test individual functions/methods in isolation
|
|
100
|
+
2. **Edge Cases**: Cover boundary conditions and error paths
|
|
101
|
+
3. **Integration Tests**: Test component interactions
|
|
102
|
+
4. **Mocking**: Use appropriate mocks for external dependencies
|
|
103
|
+
|
|
104
|
+
## Guidelines
|
|
105
|
+
|
|
106
|
+
- Follow the existing test patterns in the codebase
|
|
107
|
+
- Aim for high coverage of critical paths
|
|
108
|
+
- Write clear test descriptions
|
|
109
|
+
- Include setup and teardown as needed
|
|
110
|
+
`,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 'agent-docs-generator',
|
|
114
|
+
name: 'Documentation Generator',
|
|
115
|
+
type: 'agent',
|
|
116
|
+
description: 'Creates documentation, comments, and README files',
|
|
117
|
+
category: 'documentation',
|
|
118
|
+
icon: 'book',
|
|
119
|
+
isBuiltIn: true,
|
|
120
|
+
content: `---
|
|
121
|
+
name: docs-generator
|
|
122
|
+
description: Creates documentation, comments, and README files
|
|
123
|
+
allowed-tools: Read, Grep, Glob, Write, Edit
|
|
124
|
+
context: fork
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
# Documentation Generator Agent
|
|
128
|
+
|
|
129
|
+
You are a technical writer. Generate clear, comprehensive documentation.
|
|
130
|
+
|
|
131
|
+
## Documentation Types
|
|
132
|
+
|
|
133
|
+
1. **Code Comments**: Add JSDoc/docstrings to functions
|
|
134
|
+
2. **README Files**: Create project/feature READMEs
|
|
135
|
+
3. **API Documentation**: Document endpoints and parameters
|
|
136
|
+
4. **Architecture Docs**: Explain system design decisions
|
|
137
|
+
|
|
138
|
+
## Style Guidelines
|
|
139
|
+
|
|
140
|
+
- Write for developers of varying experience levels
|
|
141
|
+
- Include code examples where helpful
|
|
142
|
+
- Keep explanations concise but complete
|
|
143
|
+
- Use consistent formatting
|
|
144
|
+
`,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: 'agent-security-auditor',
|
|
148
|
+
name: 'Security Auditor',
|
|
149
|
+
type: 'agent',
|
|
150
|
+
description: 'Scans code for security vulnerabilities',
|
|
151
|
+
category: 'security',
|
|
152
|
+
icon: 'shield',
|
|
153
|
+
isBuiltIn: true,
|
|
154
|
+
content: `---
|
|
155
|
+
name: security-auditor
|
|
156
|
+
description: Scans code for security vulnerabilities
|
|
157
|
+
allowed-tools: Read, Grep, Glob
|
|
158
|
+
context: fork
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
# Security Auditor Agent
|
|
162
|
+
|
|
163
|
+
You are a security expert. Audit code for vulnerabilities.
|
|
164
|
+
|
|
165
|
+
## Security Checks
|
|
166
|
+
|
|
167
|
+
1. **Injection**: SQL, XSS, command injection
|
|
168
|
+
2. **Authentication**: Weak auth, session issues
|
|
169
|
+
3. **Authorization**: Access control, privilege escalation
|
|
170
|
+
4. **Data Exposure**: Sensitive data leaks, logging issues
|
|
171
|
+
5. **Dependencies**: Known vulnerable packages
|
|
172
|
+
6. **Configuration**: Hardcoded secrets, insecure defaults
|
|
173
|
+
|
|
174
|
+
## Severity Levels
|
|
175
|
+
|
|
176
|
+
- 🔴 CRITICAL: Immediate exploitation risk
|
|
177
|
+
- 🟠 HIGH: Significant security risk
|
|
178
|
+
- 🟡 MEDIUM: Moderate risk, should address
|
|
179
|
+
- 🔵 LOW: Minor issues, best practice
|
|
180
|
+
`,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: 'agent-refactorer',
|
|
184
|
+
name: 'Refactorer',
|
|
185
|
+
type: 'agent',
|
|
186
|
+
description: 'Suggests and applies code refactoring improvements',
|
|
187
|
+
category: 'development',
|
|
188
|
+
icon: 'code',
|
|
189
|
+
isBuiltIn: true,
|
|
190
|
+
content: `---
|
|
191
|
+
name: refactorer
|
|
192
|
+
description: Suggests and applies code refactoring improvements
|
|
193
|
+
allowed-tools: Read, Grep, Glob, Edit
|
|
194
|
+
context: fork
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
# Refactoring Agent
|
|
198
|
+
|
|
199
|
+
You are a refactoring expert. Improve code quality without changing behavior.
|
|
200
|
+
|
|
201
|
+
## Refactoring Focus
|
|
202
|
+
|
|
203
|
+
1. **DRY**: Eliminate code duplication
|
|
204
|
+
2. **SOLID**: Apply SOLID principles
|
|
205
|
+
3. **Naming**: Improve variable/function names
|
|
206
|
+
4. **Structure**: Simplify complex functions
|
|
207
|
+
5. **Patterns**: Apply appropriate design patterns
|
|
208
|
+
|
|
209
|
+
## Guidelines
|
|
210
|
+
|
|
211
|
+
- Make incremental, testable changes
|
|
212
|
+
- Preserve existing behavior
|
|
213
|
+
- Document the reasoning for changes
|
|
214
|
+
- Consider backwards compatibility
|
|
215
|
+
`,
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: 'agent-architect',
|
|
219
|
+
name: 'Architect',
|
|
220
|
+
type: 'agent',
|
|
221
|
+
description: 'Provides architecture guidance and system design advice',
|
|
222
|
+
category: 'development',
|
|
223
|
+
icon: 'layers',
|
|
224
|
+
isBuiltIn: true,
|
|
225
|
+
content: `---
|
|
226
|
+
name: architect
|
|
227
|
+
description: Provides architecture guidance and system design advice
|
|
228
|
+
allowed-tools: Read, Grep, Glob
|
|
229
|
+
context: fork
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
# Architect Agent
|
|
233
|
+
|
|
234
|
+
You are a software architect. Provide guidance on system design and architecture.
|
|
235
|
+
|
|
236
|
+
## Areas of Focus
|
|
237
|
+
|
|
238
|
+
1. **System Design**: Microservices, monoliths, modular architecture
|
|
239
|
+
2. **Data Flow**: API design, data models, state management
|
|
240
|
+
3. **Scalability**: Performance patterns, caching strategies
|
|
241
|
+
4. **Maintainability**: Code organization, dependency management
|
|
242
|
+
5. **Technology Choices**: Framework selection, trade-offs
|
|
243
|
+
|
|
244
|
+
## Output Format
|
|
245
|
+
|
|
246
|
+
Provide recommendations with:
|
|
247
|
+
- Current state analysis
|
|
248
|
+
- Proposed improvements
|
|
249
|
+
- Trade-offs and considerations
|
|
250
|
+
- Implementation roadmap
|
|
251
|
+
`,
|
|
252
|
+
},
|
|
253
|
+
// Team Blueprints
|
|
254
|
+
{
|
|
255
|
+
id: 'team-fullstack',
|
|
256
|
+
name: 'Full-Stack Development Team',
|
|
257
|
+
type: 'team',
|
|
258
|
+
description: 'A balanced team for full-stack development with frontend, backend, and review roles',
|
|
259
|
+
category: 'development',
|
|
260
|
+
icon: 'users',
|
|
261
|
+
isBuiltIn: true,
|
|
262
|
+
content: JSON.stringify({
|
|
263
|
+
name: 'dev-team',
|
|
264
|
+
description: 'Full-stack development team',
|
|
265
|
+
leader: { name: 'orchestrator', role: 'Coordinates tasks and reviews output', color: '#3B82F6' },
|
|
266
|
+
teammates: [
|
|
267
|
+
{ name: 'frontend-dev', role: 'React/TypeScript UI development', color: '#10B981' },
|
|
268
|
+
{ name: 'backend-dev', role: 'API and database work', color: '#F59E0B' },
|
|
269
|
+
{ name: 'reviewer', role: 'Code review and testing', color: '#8B5CF6' },
|
|
270
|
+
],
|
|
271
|
+
planFile: 'MULTI_AGENT_PLAN.md',
|
|
272
|
+
}, null, 2),
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
id: 'team-review',
|
|
276
|
+
name: 'Code Review Team',
|
|
277
|
+
type: 'team',
|
|
278
|
+
description: 'Multiple reviewers for thorough, multi-perspective code review',
|
|
279
|
+
category: 'review',
|
|
280
|
+
icon: 'eye',
|
|
281
|
+
isBuiltIn: true,
|
|
282
|
+
content: JSON.stringify({
|
|
283
|
+
name: 'review-team',
|
|
284
|
+
description: 'Multi-perspective code review team',
|
|
285
|
+
leader: { name: 'lead-reviewer', role: 'Coordinates review and consolidates feedback', color: '#3B82F6' },
|
|
286
|
+
teammates: [
|
|
287
|
+
{ name: 'security-reviewer', role: 'Security vulnerability analysis', color: '#EF4444' },
|
|
288
|
+
{ name: 'performance-reviewer', role: 'Performance and optimization review', color: '#F59E0B' },
|
|
289
|
+
{ name: 'style-reviewer', role: 'Code style and maintainability', color: '#10B981' },
|
|
290
|
+
],
|
|
291
|
+
planFile: 'REVIEW_PLAN.md',
|
|
292
|
+
}, null, 2),
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: 'team-testing',
|
|
296
|
+
name: 'Testing Team',
|
|
297
|
+
type: 'team',
|
|
298
|
+
description: 'Comprehensive testing with unit, integration, and E2E coverage',
|
|
299
|
+
category: 'testing',
|
|
300
|
+
icon: 'check-circle',
|
|
301
|
+
isBuiltIn: true,
|
|
302
|
+
content: JSON.stringify({
|
|
303
|
+
name: 'testing-team',
|
|
304
|
+
description: 'Comprehensive testing team',
|
|
305
|
+
leader: { name: 'test-lead', role: 'Test strategy and coordination', color: '#3B82F6' },
|
|
306
|
+
teammates: [
|
|
307
|
+
{ name: 'unit-tester', role: 'Unit test generation', color: '#10B981' },
|
|
308
|
+
{ name: 'integration-tester', role: 'Integration test creation', color: '#F59E0B' },
|
|
309
|
+
{ name: 'e2e-tester', role: 'End-to-end test scenarios', color: '#8B5CF6' },
|
|
310
|
+
],
|
|
311
|
+
planFile: 'TEST_PLAN.md',
|
|
312
|
+
}, null, 2),
|
|
313
|
+
},
|
|
314
|
+
];
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=blueprints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprints.js","sourceRoot":"","sources":["../../src/services/blueprints.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,OAAO,iBAAiB;IACpB,SAAS,CAAY;IAE7B,YAAY,SAAoB;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAClB,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,EAAU;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC/C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,uBAAuB,CAAC,QAA2B;QACvD,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC/C,OAAO,UA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,EAAE,IAAI,EAAE,gCAAgC,EAAE,KAAK,EAAE,SAAS,EAAE;oBACvF,SAAS,EAAE;wBACT,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,SAAS,EAAE;wBACvE,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,2BAA2B,EAAE,KAAK,EAAE,SAAS,EAAE;wBACnF,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,2BAA2B,EAAE,KAAK,EAAE,SAAS,EAAE;qBAC5E;oBACD,QAAQ,EAAE,cAAc;iBACzB,EACD,IAAI,EACJ,CAAC,CACF;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude directory service - resolves paths within ~/.claude
|
|
3
|
+
*/
|
|
4
|
+
export declare class ClaudeDir {
|
|
5
|
+
private readonly baseDir;
|
|
6
|
+
constructor(customDir?: string);
|
|
7
|
+
get root(): string;
|
|
8
|
+
get projectsDir(): string;
|
|
9
|
+
get plansDir(): string;
|
|
10
|
+
get skillsDir(): string;
|
|
11
|
+
get todosDir(): string;
|
|
12
|
+
get pluginsDir(): string;
|
|
13
|
+
get insightsDir(): string;
|
|
14
|
+
ensureInsightsDir(): Promise<void>;
|
|
15
|
+
get historyFile(): string;
|
|
16
|
+
get statsFile(): string;
|
|
17
|
+
get settingsFile(): string;
|
|
18
|
+
get memoryFile(): string;
|
|
19
|
+
exists(): Promise<boolean>;
|
|
20
|
+
fileExists(filePath: string): Promise<boolean>;
|
|
21
|
+
listProjects(): Promise<string[]>;
|
|
22
|
+
listSessionFiles(projectDir: string): Promise<string[]>;
|
|
23
|
+
listPlans(): Promise<string[]>;
|
|
24
|
+
listSkills(): Promise<string[]>;
|
|
25
|
+
listTodos(): Promise<string[]>;
|
|
26
|
+
readFile(filePath: string): Promise<string>;
|
|
27
|
+
readJSON<T>(filePath: string): Promise<T | null>;
|
|
28
|
+
writeFile(filePath: string, content: string): Promise<void>;
|
|
29
|
+
writeJSON(filePath: string, data: unknown): Promise<void>;
|
|
30
|
+
getFileStat(filePath: string): Promise<{
|
|
31
|
+
size: number;
|
|
32
|
+
mtime: Date;
|
|
33
|
+
} | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Convert project directory name back to original path
|
|
36
|
+
* e.g., "-Users-josharsh-Development-myproject" -> "/Users/josharsh/Development/myproject"
|
|
37
|
+
*/
|
|
38
|
+
projectDirToPath(projectDir: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Get a friendly project name from the directory
|
|
41
|
+
*/
|
|
42
|
+
projectDirToName(projectDir: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Convert a file path to a project directory name
|
|
45
|
+
* e.g., "/Users/josharsh/Development/myproject" -> "-Users-josharsh-Development-myproject"
|
|
46
|
+
*/
|
|
47
|
+
pathToProjectDir(filePath: string): string;
|
|
48
|
+
}
|
|
49
|
+
export declare const claudeDir: ClaudeDir;
|
|
50
|
+
//# sourceMappingURL=claude-dir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-dir.d.ts","sourceRoot":"","sources":["../../src/services/claude-dir.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,SAAS,CAAC,EAAE,MAAM;IAI9B,IAAI,IAAI,IAAI,MAAM,CAEjB;IAMD,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxC,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,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@@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude directory service - resolves paths within ~/.claude
|
|
3
|
+
*/
|
|
4
|
+
import fs from 'node:fs/promises';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import os from 'node:os';
|
|
7
|
+
export class ClaudeDir {
|
|
8
|
+
baseDir;
|
|
9
|
+
constructor(customDir) {
|
|
10
|
+
this.baseDir = customDir ?? path.join(os.homedir(), '.claude');
|
|
11
|
+
}
|
|
12
|
+
get root() {
|
|
13
|
+
return this.baseDir;
|
|
14
|
+
}
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Path Helpers
|
|
17
|
+
// ============================================================================
|
|
18
|
+
get projectsDir() {
|
|
19
|
+
return path.join(this.baseDir, 'projects');
|
|
20
|
+
}
|
|
21
|
+
get plansDir() {
|
|
22
|
+
return path.join(this.baseDir, 'plans');
|
|
23
|
+
}
|
|
24
|
+
get skillsDir() {
|
|
25
|
+
return path.join(this.baseDir, 'skills');
|
|
26
|
+
}
|
|
27
|
+
get todosDir() {
|
|
28
|
+
return path.join(this.baseDir, 'todos');
|
|
29
|
+
}
|
|
30
|
+
get pluginsDir() {
|
|
31
|
+
return path.join(this.baseDir, 'plugins');
|
|
32
|
+
}
|
|
33
|
+
get insightsDir() {
|
|
34
|
+
return path.join(this.baseDir, 'insights');
|
|
35
|
+
}
|
|
36
|
+
async ensureInsightsDir() {
|
|
37
|
+
await fs.mkdir(this.insightsDir, { recursive: true });
|
|
38
|
+
}
|
|
39
|
+
get historyFile() {
|
|
40
|
+
return path.join(this.baseDir, 'history.jsonl');
|
|
41
|
+
}
|
|
42
|
+
get statsFile() {
|
|
43
|
+
return path.join(this.baseDir, 'stats-cache.json');
|
|
44
|
+
}
|
|
45
|
+
get settingsFile() {
|
|
46
|
+
return path.join(this.baseDir, 'settings.json');
|
|
47
|
+
}
|
|
48
|
+
get memoryFile() {
|
|
49
|
+
return path.join(this.baseDir, 'memory.md');
|
|
50
|
+
}
|
|
51
|
+
// ============================================================================
|
|
52
|
+
// Directory Operations
|
|
53
|
+
// ============================================================================
|
|
54
|
+
async exists() {
|
|
55
|
+
try {
|
|
56
|
+
await fs.access(this.baseDir);
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async fileExists(filePath) {
|
|
64
|
+
try {
|
|
65
|
+
await fs.access(filePath);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async listProjects() {
|
|
73
|
+
try {
|
|
74
|
+
const entries = await fs.readdir(this.projectsDir, { withFileTypes: true });
|
|
75
|
+
return entries
|
|
76
|
+
.filter((e) => e.isDirectory())
|
|
77
|
+
.map((e) => e.name);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async listSessionFiles(projectDir) {
|
|
84
|
+
const fullPath = path.join(this.projectsDir, projectDir);
|
|
85
|
+
try {
|
|
86
|
+
const entries = await fs.readdir(fullPath, { withFileTypes: true });
|
|
87
|
+
return entries
|
|
88
|
+
.filter((e) => e.isFile() && e.name.endsWith('.jsonl'))
|
|
89
|
+
.map((e) => path.join(fullPath, e.name));
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async listPlans() {
|
|
96
|
+
try {
|
|
97
|
+
const entries = await fs.readdir(this.plansDir, { withFileTypes: true });
|
|
98
|
+
return entries
|
|
99
|
+
.filter((e) => e.isFile() && e.name.endsWith('.md'))
|
|
100
|
+
.map((e) => path.join(this.plansDir, e.name));
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async listSkills() {
|
|
107
|
+
const skills = [];
|
|
108
|
+
try {
|
|
109
|
+
const entries = await fs.readdir(this.skillsDir, { withFileTypes: true });
|
|
110
|
+
for (const entry of entries) {
|
|
111
|
+
if (entry.isDirectory()) {
|
|
112
|
+
const skillFile = path.join(this.skillsDir, entry.name, 'SKILL.md');
|
|
113
|
+
if (await this.fileExists(skillFile)) {
|
|
114
|
+
skills.push(skillFile);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// Skills dir doesn't exist
|
|
121
|
+
}
|
|
122
|
+
return skills;
|
|
123
|
+
}
|
|
124
|
+
async listTodos() {
|
|
125
|
+
try {
|
|
126
|
+
const entries = await fs.readdir(this.todosDir, { withFileTypes: true });
|
|
127
|
+
return entries
|
|
128
|
+
.filter((e) => e.isFile() && e.name.endsWith('.json'))
|
|
129
|
+
.map((e) => path.join(this.todosDir, e.name));
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// ============================================================================
|
|
136
|
+
// File Operations
|
|
137
|
+
// ============================================================================
|
|
138
|
+
async readFile(filePath) {
|
|
139
|
+
return fs.readFile(filePath, 'utf-8');
|
|
140
|
+
}
|
|
141
|
+
async readJSON(filePath) {
|
|
142
|
+
try {
|
|
143
|
+
const content = await this.readFile(filePath);
|
|
144
|
+
return JSON.parse(content);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async writeFile(filePath, content) {
|
|
151
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
152
|
+
await fs.writeFile(filePath, content, 'utf-8');
|
|
153
|
+
}
|
|
154
|
+
async writeJSON(filePath, data) {
|
|
155
|
+
await this.writeFile(filePath, JSON.stringify(data, null, 2));
|
|
156
|
+
}
|
|
157
|
+
async getFileStat(filePath) {
|
|
158
|
+
try {
|
|
159
|
+
const stat = await fs.stat(filePath);
|
|
160
|
+
return { size: stat.size, mtime: stat.mtime };
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// ============================================================================
|
|
167
|
+
// Project Path Utilities
|
|
168
|
+
// ============================================================================
|
|
169
|
+
/**
|
|
170
|
+
* Convert project directory name back to original path
|
|
171
|
+
* e.g., "-Users-josharsh-Development-myproject" -> "/Users/josharsh/Development/myproject"
|
|
172
|
+
*/
|
|
173
|
+
projectDirToPath(projectDir) {
|
|
174
|
+
return projectDir.replace(/^-/, '/').replace(/-/g, '/');
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Get a friendly project name from the directory
|
|
178
|
+
*/
|
|
179
|
+
projectDirToName(projectDir) {
|
|
180
|
+
const fullPath = this.projectDirToPath(projectDir);
|
|
181
|
+
return path.basename(fullPath);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Convert a file path to a project directory name
|
|
185
|
+
* e.g., "/Users/josharsh/Development/myproject" -> "-Users-josharsh-Development-myproject"
|
|
186
|
+
*/
|
|
187
|
+
pathToProjectDir(filePath) {
|
|
188
|
+
return filePath.replace(/\//g, '-');
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// Default instance
|
|
192
|
+
export const claudeDir = new ClaudeDir();
|
|
193
|
+
//# sourceMappingURL=claude-dir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-dir.js","sourceRoot":"","sources":["../../src/services/claude-dir.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,OAAO,SAAS;IACH,OAAO,CAAS;IAEjC,YAAY,SAAkB;QAC5B,IAAI,CAAC,OAAO,GAAG,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,E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O,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;CACF;AAED,mBAAmB;AACnB,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks service - manages Claude Code hooks from settings.json
|
|
3
|
+
*/
|
|
4
|
+
import type { ClaudeDir } from './claude-dir.js';
|
|
5
|
+
export interface Hook {
|
|
6
|
+
id: string;
|
|
7
|
+
event: string;
|
|
8
|
+
matcher?: string;
|
|
9
|
+
command: string;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class HooksService {
|
|
14
|
+
private claudeDir;
|
|
15
|
+
constructor(claudeDir: ClaudeDir);
|
|
16
|
+
private readSettings;
|
|
17
|
+
private writeSettings;
|
|
18
|
+
listHooks(): Promise<Hook[]>;
|
|
19
|
+
getHook(id: string): Promise<Hook | null>;
|
|
20
|
+
createHook(hook: Omit<Hook, 'id'>): Promise<{
|
|
21
|
+
success: boolean;
|
|
22
|
+
id?: string;
|
|
23
|
+
error?: string;
|
|
24
|
+
}>;
|
|
25
|
+
updateHook(id: string, updates: Partial<Hook>): Promise<{
|
|
26
|
+
success: boolean;
|
|
27
|
+
error?: string;
|
|
28
|
+
}>;
|
|
29
|
+
deleteHook(id: string): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
error?: string;
|
|
32
|
+
}>;
|
|
33
|
+
testHook(id: string): Promise<{
|
|
34
|
+
success: boolean;
|
|
35
|
+
output: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/services/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,SAAS,EA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