sinapse-ai 7.0.5 → 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/core-config.yaml +2 -26
- package/.sinapse-ai/data/entity-registry.yaml +742 -917
- package/.sinapse-ai/data/registry-update-log.jsonl +22 -0
- package/.sinapse-ai/infrastructure/scripts/ide-sync/index.js +1 -49
- package/.sinapse-ai/infrastructure/scripts/validate-parity.js +0 -7
- package/.sinapse-ai/install-manifest.yaml +11 -43
- package/README.en.md +6 -11
- package/README.md +6 -11
- package/bin/cli.js +116 -75
- package/bin/modules/env-config.js +1 -2
- package/bin/sinapse-init.js +23 -188
- package/docs/ide-integration.md +22 -263
- package/docs/installation/README.md +4 -6
- package/docs/installation/faq.md +10 -33
- package/docs/installation/linux.md +0 -23
- package/docs/installation/macos.md +0 -10
- package/docs/installation/troubleshooting.md +5 -9
- package/docs/installation/v4-quick-start.md +1 -1
- package/docs/installation/windows.md +0 -18
- package/package.json +2 -9
- package/packages/installer/src/config/ide-configs.js +3 -49
- 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
- package/.sinapse-ai/infrastructure/scripts/ide-sync/transformers/antigravity.js +0 -105
- package/.sinapse-ai/infrastructure/scripts/ide-sync/transformers/cursor.js +0 -94
- package/.sinapse-ai/infrastructure/scripts/ide-sync/transformers/github-copilot.js +0 -184
- package/.sinapse-ai/infrastructure/scripts/validate-gemini-integration.js +0 -151
- package/.sinapse-ai/product/templates/ide-rules/antigravity-rules.md +0 -115
- package/.sinapse-ai/product/templates/ide-rules/copilot-rules.md +0 -92
- package/.sinapse-ai/product/templates/ide-rules/cursor-rules.md +0 -115
- package/.sinapse-ai/product/templates/ide-rules/gemini-rules.md +0 -87
- package/docs/pt/platforms/antigravity.md +0 -508
- package/docs/pt/platforms/cursor.md +0 -633
- package/docs/pt/platforms/gemini-cli.md +0 -481
- package/docs/pt/platforms/github-copilot.md +0 -478
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Task: Audit Claude Code Settings
|
|
2
|
+
|
|
3
|
+
**Task ID:** CCM-CONFIG-002
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Command:** `*audit-settings`
|
|
6
|
+
**Orchestrator:** Sigil (config-engineer)
|
|
7
|
+
**Purpose:** Audit all active Claude Code settings layers for conflicts, redundancies, security gaps, and optimization opportunities by reading managed, project, local, and user configuration files.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
+------------------+ +------------------+ +------------------+
|
|
15
|
+
| 1. Read All | --> | 2. Check for | --> | 3. Validate |
|
|
16
|
+
| Settings Files| | Conflicts | | Deny Rules |
|
|
17
|
+
+------------------+ +------------------+ +------------------+
|
|
18
|
+
| |
|
|
19
|
+
v v
|
|
20
|
+
+------------------+ +------------------+ +------------------+
|
|
21
|
+
| 4. Check | --> | 5. Verify MCP | --> | 6. Generate |
|
|
22
|
+
| Permission | | Configs | | Audit Report |
|
|
23
|
+
| Mode | | | | |
|
|
24
|
+
+------------------+ +------------------+ +------------------+
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Inputs
|
|
30
|
+
|
|
31
|
+
| Field | Type | Source | Required | Validation |
|
|
32
|
+
|-------|------|--------|----------|------------|
|
|
33
|
+
| project_root | string | Working directory | Yes | Must contain .claude/ or be a project root |
|
|
34
|
+
| check_managed | boolean | User parameter | No | Whether to check managed-settings.json (default: true) |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Preconditions
|
|
39
|
+
|
|
40
|
+
- Read access to all settings file locations
|
|
41
|
+
- Claude Code installed on the system
|
|
42
|
+
- At least one settings file must exist (.claude/settings.json minimum)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Execution Phases
|
|
47
|
+
|
|
48
|
+
### Phase 1: Read All Settings Files
|
|
49
|
+
|
|
50
|
+
Locate and read each settings layer in precedence order:
|
|
51
|
+
|
|
52
|
+
| Layer | Priority | Path | Scope |
|
|
53
|
+
|-------|----------|------|-------|
|
|
54
|
+
| 1 (Highest) | Managed | Platform-specific managed-settings.json | Organization |
|
|
55
|
+
| 2 | CLI args | (Runtime only -- cannot be audited from files) | Session |
|
|
56
|
+
| 3 | Local | .claude/settings.local.json | Personal/project |
|
|
57
|
+
| 4 | Shared | .claude/settings.json | Team/project |
|
|
58
|
+
| 5 (Lowest) | User | ~/.claude/settings.json | Personal/global |
|
|
59
|
+
|
|
60
|
+
**Managed settings locations:**
|
|
61
|
+
- macOS: `/Library/Application Support/ClaudeCode/managed-settings.json`
|
|
62
|
+
- Linux/WSL: `/etc/claude-code/managed-settings.json`
|
|
63
|
+
- Windows: `C:\Program Files\ClaudeCode\managed-settings.json`
|
|
64
|
+
|
|
65
|
+
For each file found:
|
|
66
|
+
1. Parse JSON and validate structure
|
|
67
|
+
2. Extract permission rules (deny, ask, allow arrays)
|
|
68
|
+
3. Extract MCP server configurations
|
|
69
|
+
4. Extract hook configurations
|
|
70
|
+
5. Extract sandbox settings
|
|
71
|
+
6. Record file modification timestamp
|
|
72
|
+
|
|
73
|
+
### Phase 2: Check for Conflicts Between Scopes
|
|
74
|
+
|
|
75
|
+
1. **Rule conflicts**: Same Tool(specifier) pattern appearing in different rule types across layers
|
|
76
|
+
- Example: `Bash(npm run *)` in local allow but shared deny
|
|
77
|
+
- Resolution: Deny always wins (merge + dedup behavior)
|
|
78
|
+
- Flag as WARNING if user likely intended allow
|
|
79
|
+
2. **Mode conflicts**: Different defaultMode across layers
|
|
80
|
+
- Higher precedence layer wins
|
|
81
|
+
- Flag if local overrides shared (may confuse team)
|
|
82
|
+
3. **Array merging analysis**: Permission arrays merge across scopes
|
|
83
|
+
- Identify duplicate rules (same pattern in multiple layers)
|
|
84
|
+
- Identify contradictions (pattern in both allow and deny)
|
|
85
|
+
4. **Hook conflicts**: Same event with different configurations across layers
|
|
86
|
+
- Managed hooks cannot be overridden
|
|
87
|
+
|
|
88
|
+
### Phase 3: Validate Deny Rules Cover Sensitive Paths
|
|
89
|
+
|
|
90
|
+
Check that critical sensitive files are protected:
|
|
91
|
+
|
|
92
|
+
**Required deny rules (flag if missing):**
|
|
93
|
+
|
|
94
|
+
| Pattern | Protects | Severity if Missing |
|
|
95
|
+
|---------|----------|---------------------|
|
|
96
|
+
| `Read(./.env)` | Environment variables | CRITICAL |
|
|
97
|
+
| `Read(./.env.*)` | Environment variants | CRITICAL |
|
|
98
|
+
| `Read(./secrets/**)` | Secrets directory | HIGH |
|
|
99
|
+
| `Read(./**/*.pem)` | SSL/TLS certificates | HIGH |
|
|
100
|
+
| `Read(./**/*.key)` | Private keys | HIGH |
|
|
101
|
+
| `Bash(rm -rf *)` | Destructive deletion | CRITICAL |
|
|
102
|
+
| `Bash(curl * \| bash)` | Pipe-to-shell attacks | HIGH |
|
|
103
|
+
|
|
104
|
+
**SINAPSE-specific deny rules (if .sinapse-ai/ exists):**
|
|
105
|
+
|
|
106
|
+
| Pattern | Protects | Severity if Missing |
|
|
107
|
+
|---------|----------|---------------------|
|
|
108
|
+
| `Edit(.sinapse-ai/core/**)` | L1 Framework Core | HIGH |
|
|
109
|
+
| `Edit(.sinapse-ai/constitution.md)` | Constitution | HIGH |
|
|
110
|
+
| `Edit(bin/sinapse.js)` | CLI entry point | MEDIUM |
|
|
111
|
+
|
|
112
|
+
### Phase 4: Check Permission Mode Appropriateness
|
|
113
|
+
|
|
114
|
+
1. Determine effective permission mode (highest precedence layer wins)
|
|
115
|
+
2. Assess appropriateness for the project:
|
|
116
|
+
- `bypassPermissions` on a team project -> CRITICAL warning
|
|
117
|
+
- `autoApprove` without deny rules -> HIGH warning
|
|
118
|
+
- `askAlways` with extensive allow rules -> INFO (could upgrade to acceptEdits)
|
|
119
|
+
- `acceptEdits` with proper deny rules -> GOOD (recommended setup)
|
|
120
|
+
3. Check for enterprise lockdown:
|
|
121
|
+
- `disableBypassPermissionsMode` in managed settings
|
|
122
|
+
- `allowManagedPermissionRulesOnly` flag
|
|
123
|
+
|
|
124
|
+
### Phase 5: Verify MCP Server Configurations
|
|
125
|
+
|
|
126
|
+
1. Collect MCP configurations from all layers
|
|
127
|
+
2. For each server:
|
|
128
|
+
- Verify command/URL is specified
|
|
129
|
+
- Check that environment variables reference env vars (not hardcoded values)
|
|
130
|
+
- Verify the server has a matching MCP permission rule (allow or ask)
|
|
131
|
+
3. Check for enterprise restrictions:
|
|
132
|
+
- `allowManagedMcpServersOnly` flag
|
|
133
|
+
- `allowedMcpServers` / `deniedMcpServers` lists
|
|
134
|
+
4. Flag any MCP servers not in the allow list
|
|
135
|
+
|
|
136
|
+
### Phase 6: Generate Audit Report
|
|
137
|
+
|
|
138
|
+
Compile all findings into a structured report.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Output Format
|
|
143
|
+
|
|
144
|
+
```markdown
|
|
145
|
+
## Settings Audit Report
|
|
146
|
+
|
|
147
|
+
**Project:** {project-name}
|
|
148
|
+
**Date:** {YYYY-MM-DD}
|
|
149
|
+
**Layers Found:** {count}/5
|
|
150
|
+
|
|
151
|
+
### Layer Summary
|
|
152
|
+
|
|
153
|
+
| Layer | File | Exists | Rules | Mode |
|
|
154
|
+
|-------|------|--------|-------|------|
|
|
155
|
+
| Managed | {path} | {Yes/No} | {N deny, N allow} | {mode or --} |
|
|
156
|
+
| Local | .claude/settings.local.json | {Yes/No} | {N deny, N allow} | {mode or --} |
|
|
157
|
+
| Shared | .claude/settings.json | {Yes/No} | {N deny, N allow} | {mode or --} |
|
|
158
|
+
| User | ~/.claude/settings.json | {Yes/No} | {N deny, N allow} | {mode or --} |
|
|
159
|
+
|
|
160
|
+
### Effective Configuration
|
|
161
|
+
|
|
162
|
+
- **Permission mode:** {effective mode} (from {layer})
|
|
163
|
+
- **Total deny rules:** {N} (after merge + dedup)
|
|
164
|
+
- **Total allow rules:** {N} (after merge + dedup)
|
|
165
|
+
- **MCP servers:** {N}
|
|
166
|
+
- **Hooks:** {N} events configured
|
|
167
|
+
|
|
168
|
+
### Findings
|
|
169
|
+
|
|
170
|
+
| # | Severity | Finding | Layer(s) | Recommendation |
|
|
171
|
+
|---|----------|---------|----------|----------------|
|
|
172
|
+
| 1 | {CRITICAL/HIGH/MEDIUM/LOW/INFO} | {description} | {layer} | {fix} |
|
|
173
|
+
|
|
174
|
+
### Security Gaps
|
|
175
|
+
|
|
176
|
+
{List of missing deny rules that should be present}
|
|
177
|
+
|
|
178
|
+
### Conflicts
|
|
179
|
+
|
|
180
|
+
{List of rule conflicts between layers}
|
|
181
|
+
|
|
182
|
+
### Optimization Opportunities
|
|
183
|
+
|
|
184
|
+
{List of redundancies and improvements}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Veto Conditions
|
|
190
|
+
|
|
191
|
+
- **NEVER** modify any settings files during the audit. This is a read-only diagnostic.
|
|
192
|
+
- **NEVER** display the actual values of API keys, tokens, or secrets found in settings. Report presence only.
|
|
193
|
+
- **NEVER** report a clean audit if critical deny rules (for .env, secrets) are missing. Always flag these.
|
|
194
|
+
- **NEVER** recommend `bypassPermissions` mode as a fix for any issue.
|
|
195
|
+
- **NEVER** skip the managed-settings.json check in enterprise environments -- it is the highest authority layer.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Completion Criteria
|
|
200
|
+
|
|
201
|
+
- [ ] All accessible settings layers read and parsed
|
|
202
|
+
- [ ] Conflicts between layers identified and documented
|
|
203
|
+
- [ ] Sensitive path deny rules validated (missing rules flagged)
|
|
204
|
+
- [ ] Permission mode assessed for appropriateness
|
|
205
|
+
- [ ] MCP server configurations verified
|
|
206
|
+
- [ ] Audit report generated with severity-ranked findings
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Task: Audit Claude Code Setup
|
|
2
|
+
|
|
3
|
+
**Task ID:** CCM-CHIEF-002
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Command:** `*audit`
|
|
6
|
+
**Orchestrator:** Orion (claude-mastery-chief)
|
|
7
|
+
**Purpose:** Perform a comprehensive audit of the Claude Code setup in the current project, generating a scored report with actionable recommendations.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
+-------------------+ +-------------------+ +-------------------+
|
|
15
|
+
| 1. Directory | --> | 2. Settings | --> | 3. CLAUDE.md |
|
|
16
|
+
| Structure | | Validation | | Analysis |
|
|
17
|
+
+-------------------+ +-------------------+ +-------------------+
|
|
18
|
+
| | |
|
|
19
|
+
v v v
|
|
20
|
+
+-------------------+ +-------------------+ +-------------------+
|
|
21
|
+
| 4. Hooks | --> | 5. MCP Servers | --> | 6. Rules |
|
|
22
|
+
| Inventory | | Inventory | | Coverage |
|
|
23
|
+
+-------------------+ +-------------------+ +-------------------+
|
|
24
|
+
| | |
|
|
25
|
+
v v v
|
|
26
|
+
+-------------------+ +-------------------+ +-------------------+
|
|
27
|
+
| 7. Agents | --> | 8. Score & | --> | REPORT |
|
|
28
|
+
| Definitions | | Recommendations| | |
|
|
29
|
+
+-------------------+ +-------------------+ +-------------------+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Inputs
|
|
35
|
+
|
|
36
|
+
| Field | Type | Source | Required | Validation |
|
|
37
|
+
|-------|------|--------|----------|------------|
|
|
38
|
+
| project_root | string | Working directory | Yes | Must contain a .claude/ directory or be a valid project root |
|
|
39
|
+
| depth | string | User parameter | No | `quick` (checks 1-3 only) or `full` (default, all 8 checks) |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Preconditions
|
|
44
|
+
|
|
45
|
+
- Working directory is a project root (has package.json, .git/, or similar project markers)
|
|
46
|
+
- Read access to .claude/ directory and its subdirectories
|
|
47
|
+
- Read access to project configuration files
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Execution Phases
|
|
52
|
+
|
|
53
|
+
### Phase 1: Check .claude/ Directory Structure
|
|
54
|
+
|
|
55
|
+
Verify the presence and structure of the .claude/ directory:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
.claude/
|
|
59
|
+
settings.json # [REQUIRED] Project-shared settings
|
|
60
|
+
settings.local.json # [OPTIONAL] Personal local settings (gitignored)
|
|
61
|
+
CLAUDE.md # [OPTIONAL] Project instructions (alt: ./CLAUDE.md)
|
|
62
|
+
rules/ # [RECOMMENDED] Conditional rules directory
|
|
63
|
+
agents/ # [OPTIONAL] Custom subagent definitions
|
|
64
|
+
commands/ # [OPTIONAL] Custom slash commands
|
|
65
|
+
skills/ # [OPTIONAL] Skill definitions with SKILL.md
|
|
66
|
+
mcp.json # [OPTIONAL] MCP server configuration
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Score each item:
|
|
70
|
+
- REQUIRED missing = -20 points
|
|
71
|
+
- RECOMMENDED missing = -10 points
|
|
72
|
+
- OPTIONAL missing = informational only
|
|
73
|
+
|
|
74
|
+
### Phase 2: Validate settings.json Schema
|
|
75
|
+
|
|
76
|
+
1. Read `.claude/settings.json` and parse as JSON
|
|
77
|
+
2. Validate the schema structure:
|
|
78
|
+
- `permissions` object exists with `allow`, `deny`, and/or `ask` arrays
|
|
79
|
+
- `permissions.defaultMode` is a valid mode (askAlways, acceptEdits, autoApprove)
|
|
80
|
+
- Permission rules use valid Tool(specifier) syntax
|
|
81
|
+
- No contradicting rules (same pattern in both allow and deny)
|
|
82
|
+
3. Check `.claude/settings.local.json` if present (same validation)
|
|
83
|
+
4. Check `~/.claude/settings.json` for user-level settings
|
|
84
|
+
5. Flag any conflicts between settings layers
|
|
85
|
+
|
|
86
|
+
### Phase 3: Check CLAUDE.md Quality
|
|
87
|
+
|
|
88
|
+
1. Locate CLAUDE.md (check: `./CLAUDE.md`, `./.claude/CLAUDE.md`)
|
|
89
|
+
2. Measure line count (target: under 200 lines)
|
|
90
|
+
3. Check structure:
|
|
91
|
+
- Has markdown headers for organization
|
|
92
|
+
- Uses bullet points for instructions
|
|
93
|
+
- Contains concrete, verifiable instructions (not vague)
|
|
94
|
+
4. Check for @imports usage
|
|
95
|
+
5. Check for SINAPSE-managed sections (if SINAPSE project)
|
|
96
|
+
6. Flag if over 200 lines without @imports or .claude/rules/ usage
|
|
97
|
+
|
|
98
|
+
### Phase 4: List Configured Hooks
|
|
99
|
+
|
|
100
|
+
1. Read hooks configuration from settings.json (`hooks` key)
|
|
101
|
+
2. For each hook event, document:
|
|
102
|
+
- Event name (PreToolUse, PostToolUse, etc.)
|
|
103
|
+
- Hook type (command, http, prompt, agent)
|
|
104
|
+
- Matcher pattern (if applicable)
|
|
105
|
+
- Timeout value
|
|
106
|
+
3. Check for common recommended hooks:
|
|
107
|
+
- PreToolUse for Bash command validation
|
|
108
|
+
- PreCompact for context preservation
|
|
109
|
+
- Stop for session cleanup
|
|
110
|
+
4. If SINAPSE project: check for Python hooks in `.sinapse-ai/monitor/hooks/`
|
|
111
|
+
|
|
112
|
+
### Phase 5: List MCP Servers
|
|
113
|
+
|
|
114
|
+
1. Read MCP configuration from `.claude/mcp.json` or settings.json `mcpServers`
|
|
115
|
+
2. For each server, document:
|
|
116
|
+
- Server name
|
|
117
|
+
- Transport type (stdio, http, sse)
|
|
118
|
+
- Command or URL
|
|
119
|
+
- Environment variables (names only, not values)
|
|
120
|
+
3. Check for common recommended servers (context7, exa, browser)
|
|
121
|
+
4. Verify no secrets are hardcoded in committed configuration files
|
|
122
|
+
|
|
123
|
+
### Phase 6: Check .claude/rules/ Coverage
|
|
124
|
+
|
|
125
|
+
1. List all files in `.claude/rules/`
|
|
126
|
+
2. For each rule file:
|
|
127
|
+
- Check for `paths:` frontmatter (conditional loading)
|
|
128
|
+
- Document the glob patterns if present
|
|
129
|
+
- Measure line count
|
|
130
|
+
3. Assess coverage:
|
|
131
|
+
- Are there rules for major directories (src/, tests/, docs/)?
|
|
132
|
+
- Are rules using conditional loading where appropriate?
|
|
133
|
+
- Are there any unconditional rules that should be conditional?
|
|
134
|
+
|
|
135
|
+
### Phase 7: Check .claude/agents/ Definitions
|
|
136
|
+
|
|
137
|
+
1. List all files in `.claude/agents/`
|
|
138
|
+
2. For each agent file:
|
|
139
|
+
- Verify YAML frontmatter is present and valid
|
|
140
|
+
- Check for required fields (name, description, tools)
|
|
141
|
+
- Measure definition size
|
|
142
|
+
3. Check for potential issues:
|
|
143
|
+
- Agents without tool restrictions (too permissive)
|
|
144
|
+
- Agents with overlapping responsibilities
|
|
145
|
+
- Missing agent definitions referenced elsewhere
|
|
146
|
+
|
|
147
|
+
### Phase 8: Generate Audit Report
|
|
148
|
+
|
|
149
|
+
Calculate the final score and generate recommendations.
|
|
150
|
+
|
|
151
|
+
**Scoring System (100 points max):**
|
|
152
|
+
|
|
153
|
+
| Check | Max Points | Criteria |
|
|
154
|
+
|-------|-----------|----------|
|
|
155
|
+
| Directory structure | 15 | Required files present, recommended dirs exist |
|
|
156
|
+
| Settings validation | 20 | Valid schema, deny-first rules, no conflicts |
|
|
157
|
+
| CLAUDE.md quality | 20 | Under 200 lines, well-structured, uses imports |
|
|
158
|
+
| Hooks coverage | 15 | At least PreToolUse configured, proper timeouts |
|
|
159
|
+
| MCP servers | 10 | Configured and no hardcoded secrets |
|
|
160
|
+
| Rules coverage | 10 | Conditional loading used, major dirs covered |
|
|
161
|
+
| Agent definitions | 10 | Valid frontmatter, scoped tools |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Output Format
|
|
166
|
+
|
|
167
|
+
```markdown
|
|
168
|
+
## Claude Code Setup Audit Report
|
|
169
|
+
|
|
170
|
+
**Project:** {project-name}
|
|
171
|
+
**Date:** {YYYY-MM-DD}
|
|
172
|
+
**Depth:** {quick | full}
|
|
173
|
+
|
|
174
|
+
### Score: {N}/100 ({GRADE})
|
|
175
|
+
|
|
176
|
+
| Grade | Range | Meaning |
|
|
177
|
+
|-------|-------|---------|
|
|
178
|
+
| A | 90-100 | Excellent -- production-ready configuration |
|
|
179
|
+
| B | 75-89 | Good -- minor improvements recommended |
|
|
180
|
+
| C | 60-74 | Fair -- several gaps to address |
|
|
181
|
+
| D | 40-59 | Poor -- significant configuration work needed |
|
|
182
|
+
| F | 0-39 | Critical -- minimal or broken setup |
|
|
183
|
+
|
|
184
|
+
### Check Results
|
|
185
|
+
|
|
186
|
+
| # | Check | Status | Score | Notes |
|
|
187
|
+
|---|-------|--------|-------|-------|
|
|
188
|
+
| 1 | Directory Structure | {PASS/WARN/FAIL} | {N}/15 | {notes} |
|
|
189
|
+
| 2 | Settings Validation | {PASS/WARN/FAIL} | {N}/20 | {notes} |
|
|
190
|
+
| 3 | CLAUDE.md Quality | {PASS/WARN/FAIL} | {N}/20 | {notes} |
|
|
191
|
+
| 4 | Hooks Coverage | {PASS/WARN/FAIL} | {N}/15 | {notes} |
|
|
192
|
+
| 5 | MCP Servers | {PASS/WARN/FAIL} | {N}/10 | {notes} |
|
|
193
|
+
| 6 | Rules Coverage | {PASS/WARN/FAIL} | {N}/10 | {notes} |
|
|
194
|
+
| 7 | Agent Definitions | {PASS/WARN/FAIL} | {N}/10 | {notes} |
|
|
195
|
+
|
|
196
|
+
### Recommendations (Priority Order)
|
|
197
|
+
|
|
198
|
+
1. **[{severity}]** {recommendation} -- {specialist to consult}
|
|
199
|
+
2. ...
|
|
200
|
+
|
|
201
|
+
### Quick Wins
|
|
202
|
+
|
|
203
|
+
- {Easy improvement that can be done immediately}
|
|
204
|
+
- ...
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Veto Conditions
|
|
210
|
+
|
|
211
|
+
- **NEVER** modify any files during the audit. This is a read-only diagnostic task.
|
|
212
|
+
- **NEVER** expose secret values (API keys, tokens) found in configuration files. Report their presence but mask values.
|
|
213
|
+
- **NEVER** score above 50 if settings.json is missing or invalid -- it is the foundation of Claude Code configuration.
|
|
214
|
+
- **NEVER** skip Phase 2 (settings validation) even in quick mode -- it is the most critical check.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Completion Criteria
|
|
219
|
+
|
|
220
|
+
- [ ] All applicable phases executed (quick: 1-3, full: 1-8)
|
|
221
|
+
- [ ] Numeric score calculated with breakdown
|
|
222
|
+
- [ ] Grade letter assigned
|
|
223
|
+
- [ ] Recommendations listed in priority order
|
|
224
|
+
- [ ] No configuration files modified during audit
|
|
225
|
+
- [ ] Report generated in specified markdown format
|