sinapse-ai 7.1.0 → 7.2.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/.sinapse-ai/data/entity-registry.yaml +749 -757
- package/.sinapse-ai/install-manifest.yaml +4 -4
- package/bin/cli.js +116 -75
- package/package.json +2 -1
- package/squads/claude-code-mastery/CHANGELOG.md +22 -0
- package/squads/claude-code-mastery/README.md +146 -0
- package/squads/claude-code-mastery/agents/claude-mastery-chief.md +554 -0
- package/squads/claude-code-mastery/agents/config-engineer.md +865 -0
- package/squads/claude-code-mastery/agents/hooks-architect.md +1013 -0
- package/squads/claude-code-mastery/agents/mcp-integrator.md +791 -0
- package/squads/claude-code-mastery/agents/project-integrator.md +1196 -0
- package/squads/claude-code-mastery/agents/roadmap-sentinel.md +931 -0
- package/squads/claude-code-mastery/agents/skill-craftsman.md +1250 -0
- package/squads/claude-code-mastery/agents/swarm-orqx.md +1008 -0
- package/squads/claude-code-mastery/checklists/agent-team-readiness-checklist.md +88 -0
- package/squads/claude-code-mastery/checklists/brownfield-readiness-checklist.md +91 -0
- package/squads/claude-code-mastery/checklists/change-checklist.md +75 -0
- package/squads/claude-code-mastery/checklists/context-rot-checklist.md +114 -0
- package/squads/claude-code-mastery/checklists/integration-audit-checklist.md +104 -0
- package/squads/claude-code-mastery/checklists/multi-agent-review-checklist.md +77 -0
- package/squads/claude-code-mastery/checklists/pre-push-checklist.md +79 -0
- package/squads/claude-code-mastery/data/ci-cd-patterns.yaml +412 -0
- package/squads/claude-code-mastery/data/claude-code-quick-ref.yaml +314 -0
- package/squads/claude-code-mastery/data/hook-patterns.yaml +512 -0
- package/squads/claude-code-mastery/data/mcp-integration-catalog.yaml +323 -0
- package/squads/claude-code-mastery/data/project-type-signatures.yaml +335 -0
- package/squads/claude-code-mastery/scripts/validate-setup.js +163 -0
- package/squads/claude-code-mastery/squad.yaml +205 -0
- package/squads/claude-code-mastery/tasks/audit-integration.md +219 -0
- package/squads/claude-code-mastery/tasks/audit-settings.md +206 -0
- package/squads/claude-code-mastery/tasks/audit-setup.md +225 -0
- package/squads/claude-code-mastery/tasks/brownfield-setup.md +322 -0
- package/squads/claude-code-mastery/tasks/ci-cd-setup.md +335 -0
- package/squads/claude-code-mastery/tasks/claude-md-engineer.md +334 -0
- package/squads/claude-code-mastery/tasks/configure-claude-code.md +215 -0
- package/squads/claude-code-mastery/tasks/context-rot-audit.md +329 -0
- package/squads/claude-code-mastery/tasks/create-agent-definition.md +278 -0
- package/squads/claude-code-mastery/tasks/create-rules.md +206 -0
- package/squads/claude-code-mastery/tasks/create-team-topology.md +258 -0
- package/squads/claude-code-mastery/tasks/diagnose.md +166 -0
- package/squads/claude-code-mastery/tasks/enterprise-config.md +346 -0
- package/squads/claude-code-mastery/tasks/hook-designer.md +272 -0
- package/squads/claude-code-mastery/tasks/integrate-project.md +304 -0
- package/squads/claude-code-mastery/tasks/mcp-integration-plan.md +229 -0
- package/squads/claude-code-mastery/tasks/mcp-workflow.md +285 -0
- package/squads/claude-code-mastery/tasks/multi-project-setup.md +228 -0
- package/squads/claude-code-mastery/tasks/optimize-context.md +217 -0
- package/squads/claude-code-mastery/tasks/optimize-workflow.md +226 -0
- package/squads/claude-code-mastery/tasks/parallel-decomposition.md +293 -0
- package/squads/claude-code-mastery/tasks/permission-strategy.md +266 -0
- package/squads/claude-code-mastery/tasks/sandbox-setup.md +279 -0
- package/squads/claude-code-mastery/tasks/setup-repository.md +230 -0
- package/squads/claude-code-mastery/tasks/setup-wizard.md +236 -0
- package/squads/claude-code-mastery/tasks/worktree-strategy.md +320 -0
- package/squads/claude-code-mastery/templates/claude-md-fullstack.md +147 -0
- package/squads/claude-code-mastery/templates/claude-md-library.md +175 -0
- package/squads/claude-code-mastery/templates/claude-md-microservices.md +186 -0
- package/squads/claude-code-mastery/templates/claude-md-mobile.md +198 -0
- package/squads/claude-code-mastery/templates/claude-md-monorepo.md +139 -0
- package/squads/claude-code-mastery/templates/github-actions-claude-ci.yml +348 -0
- package/squads/claude-code-mastery/templates/github-actions-claude-review.yml +179 -0
- package/squads/claude-code-mastery/workflows/wf-audit-complete.yaml +140 -0
- package/squads/claude-code-mastery/workflows/wf-knowledge-update.yaml +165 -0
- package/squads/claude-code-mastery/workflows/wf-project-setup.yaml +192 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# Task: Engineer Optimal CLAUDE.md
|
|
2
|
+
|
|
3
|
+
**Task ID:** claude-md-engineer
|
|
4
|
+
**Version:** 1.0
|
|
5
|
+
**Purpose:** Engineer a high-quality, concise CLAUDE.md file optimized for Claude Code's context loading and auto-memory
|
|
6
|
+
**Orchestrator:** @project-integrator (Conduit)
|
|
7
|
+
**Mode:** Interactive (elicit: true)
|
|
8
|
+
**Quality Standard:** Under 200 lines, all sections actionable, no filler content, passes self-review
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
CLAUDE.md is the most important file for Claude Code productivity. A well-engineered CLAUDE.md teaches Claude how to work in the project with minimal tokens. This task creates one from scratch or rewrites an existing one using context engineering principles.
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
INPUT (project_root + [existing_claude_md])
|
|
18
|
+
|
|
|
19
|
+
[PHASE 1: PROJECT ANALYSIS]
|
|
20
|
+
-> Analyze tech stack and project structure
|
|
21
|
+
-> Identify critical patterns and conventions
|
|
22
|
+
-> Determine what Claude needs to know
|
|
23
|
+
|
|
|
24
|
+
[PHASE 2: CODE STANDARDS SECTION]
|
|
25
|
+
-> Extract coding style from existing code
|
|
26
|
+
-> Define naming conventions
|
|
27
|
+
-> Set import and export patterns
|
|
28
|
+
|
|
|
29
|
+
[PHASE 3: TESTING REQUIREMENTS]
|
|
30
|
+
-> Identify test framework and patterns
|
|
31
|
+
-> Define testing commands
|
|
32
|
+
-> Set coverage expectations
|
|
33
|
+
|
|
|
34
|
+
[PHASE 4: GIT AND PR CONVENTIONS]
|
|
35
|
+
-> Extract commit message format from history
|
|
36
|
+
-> Document branch naming conventions
|
|
37
|
+
-> Note PR requirements
|
|
38
|
+
|
|
|
39
|
+
[PHASE 5: PROJECT-SPECIFIC GUIDANCE]
|
|
40
|
+
-> Document key architecture decisions
|
|
41
|
+
-> List critical files and their purposes
|
|
42
|
+
-> Add tool-specific guidance
|
|
43
|
+
|
|
|
44
|
+
[PHASE 6: OPTIMIZATION]
|
|
45
|
+
-> Trim to under 200 lines
|
|
46
|
+
-> Remove redundant content
|
|
47
|
+
-> Verify every line is actionable
|
|
48
|
+
|
|
|
49
|
+
[PHASE 7: MANAGED SECTIONS]
|
|
50
|
+
-> Add managed section markers for auto-updates
|
|
51
|
+
-> Separate stable content from dynamic content
|
|
52
|
+
-> Document update strategy
|
|
53
|
+
|
|
|
54
|
+
[PHASE 8: VALIDATION]
|
|
55
|
+
-> Line count check
|
|
56
|
+
-> Content review for actionability
|
|
57
|
+
-> Test with sample Claude interaction
|
|
58
|
+
|
|
|
59
|
+
OUTPUT: Optimized CLAUDE.md file
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Inputs
|
|
65
|
+
|
|
66
|
+
| Field | Type | Source | Required | Validation |
|
|
67
|
+
|-------|------|--------|----------|------------|
|
|
68
|
+
| project_root | string | Auto-detect | yes | Valid project directory |
|
|
69
|
+
| existing_claude_md | string | Auto-detect | no | Path to existing CLAUDE.md if present |
|
|
70
|
+
| project_name | string | User or auto | no | Human-readable project name |
|
|
71
|
+
| team_notes | string | User | no | Any team conventions not captured in code |
|
|
72
|
+
| style | enum | User | no | minimal / standard / comprehensive (default: standard) |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Preconditions
|
|
77
|
+
|
|
78
|
+
1. Project directory exists with source code
|
|
79
|
+
2. Understanding of what Claude Code needs from CLAUDE.md
|
|
80
|
+
3. Access to project's existing code for pattern extraction
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Phase 1: Project Analysis
|
|
85
|
+
|
|
86
|
+
**Goal:** Determine what Claude must know to be productive in this project.
|
|
87
|
+
|
|
88
|
+
### Information Hierarchy (most important first)
|
|
89
|
+
|
|
90
|
+
1. **What to run** -- Build, test, lint commands
|
|
91
|
+
2. **How to write code** -- Patterns, conventions, style
|
|
92
|
+
3. **Where things are** -- Key directories, entry points
|
|
93
|
+
4. **What not to do** -- Anti-patterns, forbidden operations
|
|
94
|
+
5. **How to integrate** -- Git workflow, PR process
|
|
95
|
+
|
|
96
|
+
### Steps
|
|
97
|
+
|
|
98
|
+
1.1. Detect tech stack (package.json, tsconfig.json, etc.).
|
|
99
|
+
1.2. Identify the 5-10 most important patterns by analyzing:
|
|
100
|
+
- Most frequently used patterns across files
|
|
101
|
+
- Patterns that are project-specific (not framework defaults)
|
|
102
|
+
- Patterns that Claude commonly gets wrong
|
|
103
|
+
1.3. List what Claude needs to know vs what it already knows:
|
|
104
|
+
- Claude already knows React, TypeScript, common frameworks
|
|
105
|
+
- Claude does NOT know your project's custom patterns, aliases, conventions
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Phase 2: Code Standards Section
|
|
110
|
+
|
|
111
|
+
**Goal:** Define how code should be written in this project.
|
|
112
|
+
|
|
113
|
+
### Steps
|
|
114
|
+
|
|
115
|
+
2.1. Analyze 5-10 representative source files for patterns.
|
|
116
|
+
2.2. Document only patterns that deviate from defaults:
|
|
117
|
+
|
|
118
|
+
```markdown
|
|
119
|
+
## Code Standards
|
|
120
|
+
- Use named exports (not default exports)
|
|
121
|
+
- Import with @ alias: `import { Button } from '@/components/Button'`
|
|
122
|
+
- Error handling: always use custom AppError class
|
|
123
|
+
- State: Zustand stores in src/stores/, one file per domain
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
2.3. Keep this section under 20 lines.
|
|
127
|
+
2.4. If standards are complex, create `.claude/rules/code-standards.md` and reference it.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Phase 3: Testing Requirements
|
|
132
|
+
|
|
133
|
+
**Goal:** Tell Claude exactly how to test in this project.
|
|
134
|
+
|
|
135
|
+
### Steps
|
|
136
|
+
|
|
137
|
+
3.1. Extract test configuration from project files.
|
|
138
|
+
3.2. Document the essential testing commands:
|
|
139
|
+
|
|
140
|
+
```markdown
|
|
141
|
+
## Testing
|
|
142
|
+
- Run all tests: `npm test`
|
|
143
|
+
- Run specific: `npm test -- --testPathPattern=auth`
|
|
144
|
+
- Coverage: `npm test -- --coverage`
|
|
145
|
+
- Watch mode: `npm test -- --watch`
|
|
146
|
+
- E2E: `npx playwright test`
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
3.3. Document testing patterns:
|
|
150
|
+
- Where test files live (co-located vs separate directory)
|
|
151
|
+
- Naming convention (*.test.ts vs *.spec.ts)
|
|
152
|
+
- Mock patterns specific to this project
|
|
153
|
+
|
|
154
|
+
3.4. Keep this section under 15 lines.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Phase 4: Git and PR Conventions
|
|
159
|
+
|
|
160
|
+
**Goal:** Teach Claude the project's git workflow.
|
|
161
|
+
|
|
162
|
+
### Steps
|
|
163
|
+
|
|
164
|
+
4.1. Analyze recent commit messages for format:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
git log --oneline -20
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
4.2. Document the conventions:
|
|
171
|
+
|
|
172
|
+
```markdown
|
|
173
|
+
## Git Conventions
|
|
174
|
+
- Commits: `type(scope): description` (conventional commits)
|
|
175
|
+
- Branch naming: `feature/`, `fix/`, `chore/`
|
|
176
|
+
- PR: squash merge, reference issue number
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
4.3. Keep this section under 10 lines.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Phase 5: Project-Specific Guidance
|
|
184
|
+
|
|
185
|
+
**Goal:** Document what makes this project unique.
|
|
186
|
+
|
|
187
|
+
### Steps
|
|
188
|
+
|
|
189
|
+
5.1. Identify key architecture decisions:
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
## Architecture
|
|
193
|
+
- Monorepo with packages/ directory
|
|
194
|
+
- API routes in src/app/api/ (Next.js App Router)
|
|
195
|
+
- Database: Supabase with RLS policies
|
|
196
|
+
- Auth: Supabase Auth with JWT
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
5.2. List critical files that Claude should know about:
|
|
200
|
+
|
|
201
|
+
```markdown
|
|
202
|
+
## Key Files
|
|
203
|
+
- `src/lib/supabase.ts` -- Supabase client singleton
|
|
204
|
+
- `src/middleware.ts` -- Auth middleware for all routes
|
|
205
|
+
- `src/types/database.ts` -- Auto-generated DB types
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
5.3. Add tool-specific guidance if using non-standard tools.
|
|
209
|
+
5.4. Keep combined section under 30 lines.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Phase 6: Optimization
|
|
214
|
+
|
|
215
|
+
**Goal:** Trim to maximum impact per token.
|
|
216
|
+
|
|
217
|
+
### Optimization Rules
|
|
218
|
+
|
|
219
|
+
1. **Every line must be actionable** -- remove "this project uses..." in favor of "use..."
|
|
220
|
+
2. **No tutorials** -- Claude knows how React works, don't explain it
|
|
221
|
+
3. **No filler** -- remove "please ensure", "make sure to", just state the rule
|
|
222
|
+
4. **Commands over descriptions** -- `npm test` over "run the test suite using npm"
|
|
223
|
+
5. **Tables over paragraphs** -- structured data is faster to parse
|
|
224
|
+
6. **Defer to rules** -- move detailed patterns to `.claude/rules/` files
|
|
225
|
+
|
|
226
|
+
### Steps
|
|
227
|
+
|
|
228
|
+
6.1. Review every line and ask: "Would removing this cause Claude to make a mistake?"
|
|
229
|
+
- If no, remove it
|
|
230
|
+
- If yes, keep it
|
|
231
|
+
6.2. Convert paragraphs to bullet points or tables.
|
|
232
|
+
6.3. Move any section over 30 lines to a rules file.
|
|
233
|
+
6.4. Target final length:
|
|
234
|
+
- Minimal style: 50-80 lines
|
|
235
|
+
- Standard style: 100-150 lines
|
|
236
|
+
- Comprehensive style: 150-200 lines
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Phase 7: Managed Sections
|
|
241
|
+
|
|
242
|
+
**Goal:** Enable auto-updating of dynamic content.
|
|
243
|
+
|
|
244
|
+
### Managed Section Pattern
|
|
245
|
+
|
|
246
|
+
```markdown
|
|
247
|
+
<!-- MANAGED-START: tech-stack -->
|
|
248
|
+
## Tech Stack
|
|
249
|
+
- Next.js 14, React 18, TypeScript 5
|
|
250
|
+
- Tailwind CSS, shadcn/ui
|
|
251
|
+
- Supabase (auth + database)
|
|
252
|
+
<!-- MANAGED-END: tech-stack -->
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Steps
|
|
256
|
+
|
|
257
|
+
7.1. Identify sections that change frequently (tech stack versions, commands).
|
|
258
|
+
7.2. Wrap them in managed section markers.
|
|
259
|
+
7.3. Identify sections that are stable (architecture, conventions).
|
|
260
|
+
7.4. Leave stable sections as plain markdown.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Phase 8: Validation
|
|
265
|
+
|
|
266
|
+
**Goal:** Verify the CLAUDE.md is effective.
|
|
267
|
+
|
|
268
|
+
### Validation Checklist
|
|
269
|
+
|
|
270
|
+
- [ ] Total line count under 200
|
|
271
|
+
- [ ] Every section has at least one actionable instruction
|
|
272
|
+
- [ ] No section exceeds 30 lines
|
|
273
|
+
- [ ] All referenced file paths exist
|
|
274
|
+
- [ ] All referenced commands exist in package.json
|
|
275
|
+
- [ ] No duplicate information across sections
|
|
276
|
+
- [ ] No tutorial-style explanations
|
|
277
|
+
- [ ] Managed sections properly formatted
|
|
278
|
+
|
|
279
|
+
### Steps
|
|
280
|
+
|
|
281
|
+
8.1. Run the validation checklist.
|
|
282
|
+
8.2. Test with a sample Claude interaction:
|
|
283
|
+
- Ask Claude to create a new component -- does it follow the patterns?
|
|
284
|
+
- Ask Claude to add a test -- does it use the right framework?
|
|
285
|
+
- Ask Claude to commit -- does it use the right format?
|
|
286
|
+
8.3. If any test fails, identify the missing instruction and add it.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Output Format
|
|
291
|
+
|
|
292
|
+
```yaml
|
|
293
|
+
claude_md_engineer_result:
|
|
294
|
+
file: "CLAUDE.md"
|
|
295
|
+
total_lines: 142
|
|
296
|
+
style: "standard"
|
|
297
|
+
sections:
|
|
298
|
+
- name: "Project Overview"
|
|
299
|
+
lines: 5
|
|
300
|
+
- name: "Code Standards"
|
|
301
|
+
lines: 18
|
|
302
|
+
- name: "Testing"
|
|
303
|
+
lines: 12
|
|
304
|
+
- name: "Git Conventions"
|
|
305
|
+
lines: 8
|
|
306
|
+
- name: "Architecture"
|
|
307
|
+
lines: 15
|
|
308
|
+
- name: "Key Files"
|
|
309
|
+
lines: 10
|
|
310
|
+
- name: "Commands"
|
|
311
|
+
lines: 8
|
|
312
|
+
managed_sections: 2
|
|
313
|
+
rules_extracted_to:
|
|
314
|
+
- ".claude/rules/code-standards.md"
|
|
315
|
+
- ".claude/rules/architecture.md"
|
|
316
|
+
validation:
|
|
317
|
+
line_count: "pass"
|
|
318
|
+
actionability: "pass"
|
|
319
|
+
references: "pass"
|
|
320
|
+
sample_test: "pass"
|
|
321
|
+
overall_status: "PASS"
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Veto Conditions
|
|
327
|
+
|
|
328
|
+
| Condition | Action |
|
|
329
|
+
|-----------|--------|
|
|
330
|
+
| CLAUDE.md exceeds 200 lines after optimization | HALT -- continue trimming or extract to rules |
|
|
331
|
+
| No source code in project (nothing to analyze) | HALT -- no patterns to document |
|
|
332
|
+
| Existing CLAUDE.md has custom managed sections from another tool | WARN -- preserve existing markers |
|
|
333
|
+
| Project uses language/framework with no detected conventions | WARN -- generate minimal CLAUDE.md |
|
|
334
|
+
| Every line removed in optimization was marked as necessary | WARN -- project may genuinely need 200+ lines, use rules files |
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Task: Configure Claude Code Settings
|
|
2
|
+
|
|
3
|
+
**Task ID:** CCM-CONFIG-001
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Command:** `*configure`
|
|
6
|
+
**Orchestrator:** Sigil (config-engineer)
|
|
7
|
+
**Purpose:** Configure Claude Code settings for a project by analyzing project needs and generating a tailored `.claude/settings.json` with appropriate permissions, deny rules, and MCP server configuration.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
+------------------+ +------------------+ +------------------+
|
|
15
|
+
| 1. Analyze | --> | 2. Generate | --> | 3. Set Permission|
|
|
16
|
+
| Project Needs | | settings.json | | Mode |
|
|
17
|
+
+------------------+ +------------------+ +------------------+
|
|
18
|
+
| |
|
|
19
|
+
v v
|
|
20
|
+
+------------------+ +------------------+ +------------------+
|
|
21
|
+
| 4. Configure | --> | 5. Set Up | --> | VALIDATE |
|
|
22
|
+
| MCP Servers | | Env Variables | | & OUTPUT |
|
|
23
|
+
+------------------+ +------------------+ +------------------+
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Inputs
|
|
29
|
+
|
|
30
|
+
| Field | Type | Source | Required | Validation |
|
|
31
|
+
|-------|------|--------|----------|------------|
|
|
32
|
+
| project_root | string | Working directory | Yes | Valid directory with project files |
|
|
33
|
+
| security_level | string | User parameter | No | `standard` (default), `strict`, `enterprise` |
|
|
34
|
+
| existing_settings | object | .claude/settings.json | No | Existing config to merge with |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Preconditions
|
|
39
|
+
|
|
40
|
+
- Write access to the .claude/ directory
|
|
41
|
+
- Understanding of the project's technology stack (detected or user-provided)
|
|
42
|
+
- If existing settings.json: user confirms merge or overwrite strategy
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Execution Phases
|
|
47
|
+
|
|
48
|
+
### Phase 1: Analyze Project Needs
|
|
49
|
+
|
|
50
|
+
1. Scan the project for technology markers:
|
|
51
|
+
- Package manager: npm, yarn, pnpm, bun (check lock files)
|
|
52
|
+
- Framework: Next.js, Vite, Express, Fastify, Django, etc.
|
|
53
|
+
- Testing: Jest, Vitest, Playwright, Cypress
|
|
54
|
+
- Database: Supabase, Prisma, Drizzle migrations
|
|
55
|
+
- SINAPSE: Check for .sinapse-ai/ directory
|
|
56
|
+
2. Identify sensitive file patterns:
|
|
57
|
+
- `.env`, `.env.*`, `.env.local`
|
|
58
|
+
- `secrets/`, `credentials/`, `private/`
|
|
59
|
+
- `*.pem`, `*.key`, `*.p12`
|
|
60
|
+
3. Identify safe development operations:
|
|
61
|
+
- Package scripts from package.json
|
|
62
|
+
- Git read-only operations
|
|
63
|
+
- Test runners, linters, formatters
|
|
64
|
+
4. Document findings for the user
|
|
65
|
+
|
|
66
|
+
### Phase 2: Generate settings.json
|
|
67
|
+
|
|
68
|
+
Build the settings file following deny-first methodology:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"permissions": {
|
|
73
|
+
"deny": [
|
|
74
|
+
"Read(./.env)",
|
|
75
|
+
"Read(./.env.*)",
|
|
76
|
+
"Read(./secrets/**)",
|
|
77
|
+
"Read(./**/*.pem)",
|
|
78
|
+
"Read(./**/*.key)",
|
|
79
|
+
"Bash(rm -rf *)",
|
|
80
|
+
"Bash(curl * | bash)",
|
|
81
|
+
"Bash(wget * | bash)"
|
|
82
|
+
],
|
|
83
|
+
"allow": [],
|
|
84
|
+
"defaultMode": "acceptEdits"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Populate `allow` based on detected project needs:
|
|
90
|
+
- **Always:** `Bash(git status)`, `Bash(git diff *)`, `Bash(git log *)`
|
|
91
|
+
- **Node.js:** `Bash(npm run *)`, `Bash(npx *)`, `Bash(node *)`
|
|
92
|
+
- **Python:** `Bash(python *)`, `Bash(pip *)`, `Bash(pytest *)`
|
|
93
|
+
- **Testing:** `Bash({test-runner} *)` based on detected framework
|
|
94
|
+
- **Build:** Allow detected build commands
|
|
95
|
+
- **Lint:** Allow detected lint/format commands
|
|
96
|
+
|
|
97
|
+
### Phase 3: Set Permission Mode
|
|
98
|
+
|
|
99
|
+
Select the appropriate permission mode:
|
|
100
|
+
|
|
101
|
+
| Security Level | Default Mode | Rationale |
|
|
102
|
+
|---------------|--------------|-----------|
|
|
103
|
+
| standard | acceptEdits | Auto-approves file edits, prompts for bash/network |
|
|
104
|
+
| strict | askAlways | Prompts for every operation including edits |
|
|
105
|
+
| enterprise | askAlways | Plus managed-settings.json restrictions |
|
|
106
|
+
|
|
107
|
+
Present the selected mode with explanation. Allow user override.
|
|
108
|
+
|
|
109
|
+
**Settings Hierarchy Reference (for user awareness):**
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
managed-settings.json (highest -- cannot be overridden)
|
|
113
|
+
> CLI arguments (session-only)
|
|
114
|
+
> settings.local.json (personal, gitignored)
|
|
115
|
+
> settings.json (shared, committed)
|
|
116
|
+
> ~/.claude/settings.json (user-level, lowest)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Phase 4: Configure MCP Servers
|
|
120
|
+
|
|
121
|
+
1. Ask which MCP servers the project needs
|
|
122
|
+
2. For each selected server, add to settings.json or .claude/mcp.json:
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"mcpServers": {
|
|
126
|
+
"context7": {
|
|
127
|
+
"command": "npx",
|
|
128
|
+
"args": ["-y", "@context7/mcp-server"]
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
3. Common server configurations:
|
|
134
|
+
- **context7**: Library documentation lookup (no API key needed)
|
|
135
|
+
- **playwright**: Browser automation (no API key needed)
|
|
136
|
+
- **exa**: Web search (requires EXA_API_KEY)
|
|
137
|
+
- **supabase**: Database (requires SUPABASE_ACCESS_TOKEN)
|
|
138
|
+
4. For servers requiring API keys: add placeholder with comment, never hardcode real keys
|
|
139
|
+
5. Add MCP-specific permission rules:
|
|
140
|
+
- `MCP({server-name})` to allow list for approved servers
|
|
141
|
+
- `MCP(filesystem)` to deny list if not needed
|
|
142
|
+
|
|
143
|
+
### Phase 5: Set Up Environment Variables
|
|
144
|
+
|
|
145
|
+
1. Document recommended environment variables for the settings:
|
|
146
|
+
- `ANTHROPIC_MODEL`: Model override if needed
|
|
147
|
+
- `CLAUDE_CODE_EFFORT_LEVEL`: high/medium/low
|
|
148
|
+
- `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`: Context management
|
|
149
|
+
- `BASH_DEFAULT_TIMEOUT_MS`: Command timeout
|
|
150
|
+
2. If enterprise: add organizational env vars to managed config
|
|
151
|
+
3. Create a reference comment block at the top of settings.json:
|
|
152
|
+
```json
|
|
153
|
+
// Environment variables can be set in .env or shell profile:
|
|
154
|
+
// CLAUDE_CODE_EFFORT_LEVEL=high
|
|
155
|
+
// CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50
|
|
156
|
+
```
|
|
157
|
+
(Note: JSON does not support comments -- provide as separate documentation)
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Output Format
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
## Configuration Complete
|
|
165
|
+
|
|
166
|
+
**Security Level:** {standard | strict | enterprise}
|
|
167
|
+
**Permission Mode:** {defaultMode}
|
|
168
|
+
|
|
169
|
+
### Generated: .claude/settings.json
|
|
170
|
+
|
|
171
|
+
| Section | Count | Details |
|
|
172
|
+
|---------|-------|---------|
|
|
173
|
+
| deny rules | {N} | Blocks: {summary} |
|
|
174
|
+
| allow rules | {N} | Permits: {summary} |
|
|
175
|
+
| MCP servers | {N} | {server names} |
|
|
176
|
+
|
|
177
|
+
### Permission Rules
|
|
178
|
+
|
|
179
|
+
**Deny (evaluated first):**
|
|
180
|
+
{numbered list of deny rules with explanations}
|
|
181
|
+
|
|
182
|
+
**Allow:**
|
|
183
|
+
{numbered list of allow rules with explanations}
|
|
184
|
+
|
|
185
|
+
### Environment Variables
|
|
186
|
+
|
|
187
|
+
| Variable | Recommended Value | Purpose |
|
|
188
|
+
|----------|-------------------|---------|
|
|
189
|
+
| {name} | {value} | {purpose} |
|
|
190
|
+
|
|
191
|
+
### Verification
|
|
192
|
+
|
|
193
|
+
Run `*audit-settings` to validate the configuration.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Veto Conditions
|
|
199
|
+
|
|
200
|
+
- **NEVER** generate a settings.json without deny rules. Every configuration must block sensitive files at minimum.
|
|
201
|
+
- **NEVER** hardcode API keys, tokens, or credentials in settings files. Use environment variables or placeholders.
|
|
202
|
+
- **NEVER** set `bypassPermissions` as the default mode unless the user explicitly requests it and acknowledges the security implications.
|
|
203
|
+
- **NEVER** allow `Bash(rm -rf *)` or other destructive operations in the allow list.
|
|
204
|
+
- **NEVER** merge settings without showing the user the diff between old and new configuration.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Completion Criteria
|
|
209
|
+
|
|
210
|
+
- [ ] Project needs analyzed (technology, sensitive files, safe operations)
|
|
211
|
+
- [ ] settings.json generated with deny-first permission rules
|
|
212
|
+
- [ ] Permission mode selected and justified
|
|
213
|
+
- [ ] MCP servers configured with placeholder credentials
|
|
214
|
+
- [ ] Environment variable recommendations documented
|
|
215
|
+
- [ ] Configuration summary displayed to user
|