moai-adk 0.4.7__py3-none-any.whl → 0.4.8__py3-none-any.whl

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.

Potentially problematic release.


This version of moai-adk might be problematic. Click here for more details.

Files changed (101) hide show
  1. moai_adk/templates/.claude/agents/alfred/cc-manager.md +188 -954
  2. moai_adk/templates/.claude/agents/alfred/debug-helper.md +4 -5
  3. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +2 -2
  4. moai_adk/templates/.claude/agents/alfred/git-manager.md +2 -2
  5. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +3 -3
  6. moai_adk/templates/.claude/agents/alfred/project-manager.md +6 -6
  7. moai_adk/templates/.claude/agents/alfred/quality-gate.md +4 -6
  8. moai_adk/templates/.claude/agents/alfred/skill-factory.md +36 -36
  9. moai_adk/templates/.claude/agents/alfred/spec-builder.md +2 -2
  10. moai_adk/templates/.claude/agents/alfred/tag-agent.md +2 -2
  11. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +3 -3
  12. moai_adk/templates/.claude/agents/alfred/trust-checker.md +5 -5
  13. moai_adk/templates/.claude/commands/alfred/0-project.md +98 -42
  14. moai_adk/templates/.claude/commands/alfred/1-plan.md +7 -7
  15. moai_adk/templates/.claude/commands/alfred/2-run.md +36 -36
  16. moai_adk/templates/.claude/commands/alfred/3-sync.md +10 -10
  17. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +14 -1
  18. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +115 -33
  19. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +8 -9
  20. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +6 -6
  21. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +5 -4
  22. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +1 -1
  23. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +1 -1
  24. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +1 -1
  25. moai_adk/templates/.claude/settings.json +42 -2
  26. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +480 -0
  27. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +257 -0
  28. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +120 -0
  29. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +249 -0
  30. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
  31. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +278 -0
  32. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
  33. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +287 -0
  34. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
  35. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +232 -0
  36. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
  37. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
  38. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
  39. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +179 -0
  40. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
  41. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +296 -0
  42. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
  43. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +243 -0
  44. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
  45. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +271 -0
  46. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
  47. moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +261 -35
  48. moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +15 -15
  49. moai_adk/templates/.claude/skills/moai-skill-factory/PARALLEL-ANALYSIS-REPORT.md +429 -0
  50. moai_adk/templates/.claude/skills/moai-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
  51. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -0
  52. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +33 -33
  53. moai_adk/templates/.claude/skills/moai-skill-factory/STEP-BY-STEP-GUIDE.md +466 -0
  54. moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +438 -42
  55. moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +129 -0
  56. moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +1300 -0
  57. moai_adk/templates/.claude/skills/moai-spec-authoring/examples/validate-spec.sh +161 -0
  58. moai_adk/templates/CLAUDE.md +101 -93
  59. {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/METADATA +537 -146
  60. {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/RECORD +63 -73
  61. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +0 -113
  62. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +0 -29
  63. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/reference.md +0 -28
  64. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +0 -113
  65. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/examples.md +0 -29
  66. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/reference.md +0 -28
  67. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +0 -113
  68. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/examples.md +0 -29
  69. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/reference.md +0 -28
  70. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +0 -113
  71. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/examples.md +0 -29
  72. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/reference.md +0 -28
  73. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +0 -635
  74. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +0 -992
  75. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/reference.md +0 -801
  76. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +0 -121
  77. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +0 -29
  78. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +0 -28
  79. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +0 -332
  80. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +0 -384
  81. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +0 -363
  82. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +0 -595
  83. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +0 -496
  84. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +0 -123
  85. moai_adk/templates/.claude/skills/moai-lang-clojure/examples.md +0 -29
  86. moai_adk/templates/.claude/skills/moai-lang-clojure/reference.md +0 -30
  87. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +0 -124
  88. moai_adk/templates/.claude/skills/moai-lang-elixir/examples.md +0 -29
  89. moai_adk/templates/.claude/skills/moai-lang-elixir/reference.md +0 -31
  90. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +0 -124
  91. moai_adk/templates/.claude/skills/moai-lang-haskell/examples.md +0 -29
  92. moai_adk/templates/.claude/skills/moai-lang-haskell/reference.md +0 -31
  93. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +0 -123
  94. moai_adk/templates/.claude/skills/moai-lang-julia/examples.md +0 -29
  95. moai_adk/templates/.claude/skills/moai-lang-julia/reference.md +0 -30
  96. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +0 -123
  97. moai_adk/templates/.claude/skills/moai-lang-lua/examples.md +0 -29
  98. moai_adk/templates/.claude/skills/moai-lang-lua/reference.md +0 -30
  99. {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/WHEEL +0 -0
  100. {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/entry_points.txt +0 -0
  101. {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,296 @@
1
+ ---
2
+ name: "Managing Claude Code Session Memory & Context"
3
+ description: "Understand session context limits, use just-in-time retrieval, cache insights, manage memory files. Use when optimizing context usage, handling large projects, or implementing efficient workflows."
4
+ allowed-tools: "Read, Write, Glob, Bash"
5
+ ---
6
+
7
+ # Managing Claude Code Session Memory & Context
8
+
9
+ Claude Code operates within context windows (~100K-200K tokens). Effective memory management ensures productive sessions without hitting limits.
10
+
11
+ ## Context Budget Overview
12
+
13
+ ```
14
+ Total Context Budget
15
+ ├── System Prompt (~2K)
16
+ ├── Tools & Instructions (~5K)
17
+ ├── Session History (~30K)
18
+ ├── Project Context (~40K)
19
+ └── Available for Response (~23K)
20
+ ```
21
+
22
+ ## Just-in-Time (JIT) Retrieval Strategy
23
+
24
+ ### High-Freedom: Core Principles
25
+
26
+ **Principle 1: Pull Only What You Need**
27
+ - Don't load entire codebase upfront
28
+ - Load files relevant to immediate task
29
+ - Use Glob/Grep for targeted searches
30
+ - Cache results for reuse
31
+
32
+ **Principle 2: Prefer Explore Over Manual Hunting**
33
+ ```bash
34
+ # ❌ Manual approach: Search many files, load all
35
+ rg "authenticate" src/ | head -20
36
+
37
+ # ✅ JIT approach: Use Explore agent
38
+ @agent-Explore "Find authentication implementation, analyze"
39
+ ```
40
+
41
+ **Principle 3: Layered Context Summaries**
42
+ ```
43
+ 1. High-level brief (purpose, success criteria)
44
+
45
+ 2. Technical core (entry points, domain models)
46
+
47
+ 3. Edge cases (known bugs, constraints)
48
+ ```
49
+
50
+ ### Example: Feature Implementation
51
+
52
+ ```
53
+ Task: "Add email verification to signup"
54
+
55
+ JIT Retrieval:
56
+ ├── Read: User model (src/domain/user.ts)
57
+ ├── Read: Signup endpoint (src/api/auth.ts)
58
+ ├── Grep: "email" in tests (understand patterns)
59
+ ├── Glob: Find email service (src/infra/email.*)
60
+ └── Cache: Signup flow diagram in memory
61
+ ```
62
+
63
+ ## Medium-Freedom: Memory File Patterns
64
+
65
+ ### Pattern 1: Session Summary Cache
66
+
67
+ **File**: `.moai/memory/session-summary.md`
68
+
69
+ ```markdown
70
+ # Session Summary
71
+
72
+ ## Current Task
73
+ - Feature: User email verification
74
+ - SPEC: AUTH-015
75
+ - Status: In RED phase (writing tests)
76
+
77
+ ## Key Files
78
+ - Test: tests/auth/email_verify.test.ts
79
+ - Impl: src/domain/email_service.ts
80
+ - Config: src/config/email.ts
81
+
82
+ ## Important Context
83
+ - Email service uses SendGrid API
84
+ - Verification tokens expire in 24h
85
+ - Already have similar flow for password reset (AUTH-012)
86
+
87
+ ## Assumptions Made
88
+ - Assuming transactional emails only
89
+ - Async email sending OK
90
+ - No SMS verification needed
91
+ ```
92
+
93
+ ### Pattern 2: Architecture Reference
94
+
95
+ **File**: `.moai/memory/architecture.md`
96
+
97
+ ```markdown
98
+ # Architecture Reference
99
+
100
+ ## Data Flow for Email Verification
101
+
102
+ ```
103
+ User(Browser)
104
+ ↓ [POST /auth/signup]
105
+ Server
106
+ ↓ [Create user + token]
107
+ DB
108
+ ↓ [sendEmail async]
109
+ Queue
110
+ ↓ [Process job]
111
+ Email Service (SendGrid)
112
+
113
+ User receives email with link
114
+ User clicks link
115
+ ↓ [GET /auth/verify?token=...]
116
+ Server validates token
117
+ ↓ [Mark user verified]
118
+ DB
119
+
120
+ User logged in
121
+ ```
122
+
123
+ ## Module Boundaries
124
+ - `domain/`: Business logic (no framework)
125
+ - `api/`: HTTP endpoints only
126
+ - `infra/`: External services (SendGrid, DB)
127
+ ```
128
+
129
+ ### Pattern 3: Known Gotchas Cache
130
+
131
+ **File**: `.moai/memory/gotchas.md`
132
+
133
+ ```markdown
134
+ # Common Pitfalls in This Project
135
+
136
+ ## Email Service
137
+ - SendGrid has rate limit: 100 emails/sec per account
138
+ - Test mode uses fake email (won't actually send)
139
+ - Async job failures don't alert (check logs)
140
+
141
+ ## Database
142
+ - Migrations must be reviewed before prod deploy
143
+ - Test DB is reset after each suite
144
+ - Foreign key constraints enforced (plan deletions)
145
+
146
+ ## Authentication
147
+ - JWT tokens stored in httpOnly cookies (XSRF protected)
148
+ - Refresh token rotation required (not automatic)
149
+ - Session timeout: 7 days (hardcoded, not configurable yet)
150
+ ```
151
+
152
+ ## Low-Freedom: Memory Management Practices
153
+
154
+ ### Practice 1: Caching Key Insights
155
+
156
+ ```
157
+ After reading code:
158
+ 1. Note file locations (~5 min read)
159
+ 2. Summarize key logic (~2 min)
160
+ 3. Write to memory file (~1 min)
161
+ 4. Reference in next session
162
+ ```
163
+
164
+ **Example memory entry**:
165
+ ```
166
+ # USER-002: Email verification flow
167
+
168
+ ## Key Code Locations
169
+ - Token generation: src/domain/user.ts:generateVerificationToken()
170
+ - Email sending: src/infra/email_service.ts:sendVerificationEmail()
171
+ - Token validation: src/api/auth.ts:POST /verify
172
+
173
+ ## Logic Summary
174
+ 1. User submits email → server generates token (16 chars, base64)
175
+ 2. Token stored in DB with 24h expiry
176
+ 3. Email sent async via SendGrid
177
+ 4. User clicks link → token validated → user marked verified
178
+ 5. Token deleted after use (can't reuse)
179
+
180
+ ## Related TESTs
181
+ - tests/auth/email_verify.test.ts (GREEN phase - needs implementation)
182
+ - Similar flow: password reset (PASSWORD-001)
183
+ ```
184
+
185
+ ### Practice 2: Session Boundary Management
186
+
187
+ **Before switching between tasks**:
188
+ ```markdown
189
+ # Session Handoff Note
190
+
191
+ ## Completed
192
+ ✓ RED phase: 3 test cases for email verification
193
+ ✓ GREEN phase: Minimal implementation passing tests
194
+ ✓ REFACTOR: Added input validation
195
+
196
+ ## Status
197
+ - Current: Ready for /alfred:3-sync
198
+ - Next action: Run full test suite, then sync docs
199
+
200
+ ## Context for Next Session
201
+ - SPEC: .moai/specs/SPEC-AUTH-015/spec.md
202
+ - Tests: tests/auth/email_verify.test.ts (all passing)
203
+ - Code: src/domain/email_service.py
204
+ - Database migration: pending (see migrations/ directory)
205
+
206
+ ## Assumptions
207
+ - SendGrid API key set in .env
208
+ - Test mode uses mock email service
209
+ - Database schema includes email_verified_at column
210
+ ```
211
+
212
+ ### Practice 3: Cleanup Before Session End
213
+
214
+ ```bash
215
+ # Remove unnecessary cached files
216
+ rm .moai/memory/temp-*.md
217
+
218
+ # Archive completed memory files
219
+ mv .moai/memory/feature-x-* .moai/memory/archive/
220
+
221
+ # Keep only active session memory
222
+ ls -la .moai/memory/
223
+ # session-summary.md (current)
224
+ # architecture.md (reference)
225
+ # gotchas.md (patterns)
226
+ ```
227
+
228
+ ## Memory File Organization
229
+
230
+ ```
231
+ .moai/
232
+ ├── memory/
233
+ │ ├── session-summary.md # Current session state
234
+ │ ├── architecture.md # System design reference
235
+ │ ├── gotchas.md # Common pitfalls
236
+ │ ├── spec-index.md # List of all SPECs + status
237
+ │ ├── api-reference.md # API endpoints quick lookup
238
+ │ └── archive/ # Completed session notes
239
+ │ ├── feature-auth-*
240
+ │ └── feature-api-*
241
+ └── specs/ # Requirement specifications
242
+ ├── SPEC-AUTH-001/
243
+ ├── SPEC-USER-002/
244
+ └── SPEC-API-003/
245
+ ```
246
+
247
+ ## Context Optimization Checklist
248
+
249
+ - [ ] Memory files describe architecture (not code)
250
+ - [ ] Session summary updated before handoff
251
+ - [ ] Key file locations cached (don't re-search)
252
+ - [ ] Assumptions explicitly documented
253
+ - [ ] No duplicate information between memory files
254
+ - [ ] Archive files moved after session completion
255
+ - [ ] All cached insights reference file paths
256
+ - [ ] Memory files are Markdown (human-readable)
257
+
258
+ ## Best Practices
259
+
260
+ ✅ **DO**:
261
+ - Use Explore for large searches
262
+ - Cache results in memory files
263
+ - Keep memory files < 500 lines each
264
+ - Update session-summary.md before switching tasks
265
+ - Reference memory files in handoff notes
266
+
267
+ ❌ **DON'T**:
268
+ - Load entire src/ or docs/ directory upfront
269
+ - Duplicate context between memory files
270
+ - Store memory files outside `.moai/memory/`
271
+ - Leave stale session notes (archive or delete)
272
+ - Cache raw code (summarize logic instead)
273
+
274
+ ## Commands for Memory Management
275
+
276
+ ```bash
277
+ # View current session memory
278
+ cat .moai/memory/session-summary.md
279
+
280
+ # List all memory files
281
+ ls -la .moai/memory/
282
+
283
+ # Archive completed work
284
+ mv .moai/memory/feature-old-* .moai/memory/archive/
285
+
286
+ # Search memory files
287
+ grep -r "email verification" .moai/memory/
288
+
289
+ # Count context usage estimate
290
+ wc -w .moai/memory/*.md # Total words
291
+ ```
292
+
293
+ ---
294
+
295
+ **Reference**: Claude Code Context Management
296
+ **Version**: 1.0.0
@@ -0,0 +1,18 @@
1
+ # Session Summary
2
+
3
+ ## Current Task
4
+ - Feature: [description]
5
+ - SPEC: [ID]
6
+ - Status: [phase]
7
+
8
+ ## Key Files
9
+ - Test: [path]
10
+ - Impl: [path]
11
+ - Config: [path]
12
+
13
+ ## Important Context
14
+ - [Key insights]
15
+ - [Related features]
16
+
17
+ ## Assumptions Made
18
+ - [List assumptions]
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: "Configuring Claude Code settings.json & Security"
3
+ description: "Set up permissions (allow/deny), permission modes, environment variables, tool restrictions. Use when securing Claude Code, restricting tool access, or optimizing session settings."
4
+ allowed-tools: "Read, Write, Edit, Bash"
5
+ ---
6
+
7
+ # Configuring Claude Code settings.json
8
+
9
+ `settings.json` centralizes all Claude Code configuration: permissions, tool access, environment variables, and session behavior.
10
+
11
+ **Location**: `.claude/settings.json`
12
+
13
+ ## Complete Configuration Template
14
+
15
+ ```json
16
+ {
17
+ "permissions": {
18
+ "allowedTools": [
19
+ "Read(**/*.{js,ts,json,md})",
20
+ "Edit(**/*.{js,ts})",
21
+ "Glob(**/*)",
22
+ "Grep(**/*)",
23
+ "Bash(git:*)",
24
+ "Bash(npm:*)",
25
+ "Bash(npm run:*)",
26
+ "Bash(pytest:*)",
27
+ "Bash(python:*)"
28
+ ],
29
+ "deniedTools": [
30
+ "Read(./.env)",
31
+ "Read(./.env.*)",
32
+ "Read(./secrets/**)",
33
+ "Bash(rm -rf:*)",
34
+ "Bash(sudo:*)",
35
+ "Bash(curl:*)"
36
+ ]
37
+ },
38
+ "permissionMode": "ask",
39
+ "spinnerTipsEnabled": true,
40
+ "disableAllHooks": false,
41
+ "env": {
42
+ "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}",
43
+ "GITHUB_TOKEN": "${GITHUB_TOKEN}",
44
+ "CLAUDE_CODE_ENABLE_TELEMETRY": "1"
45
+ },
46
+ "hooks": {
47
+ "PreToolUse": [
48
+ {
49
+ "matcher": "Bash",
50
+ "hooks": [
51
+ {
52
+ "type": "command",
53
+ "command": "bash ~/.claude/hooks/pre-bash-check.sh"
54
+ }
55
+ ]
56
+ }
57
+ ],
58
+ "PostToolUse": [
59
+ {
60
+ "matcher": "Edit",
61
+ "hooks": [
62
+ {
63
+ "type": "command",
64
+ "command": "bash ~/.claude/hooks/post-edit-format.sh"
65
+ }
66
+ ]
67
+ }
68
+ ],
69
+ "SessionStart": [
70
+ {
71
+ "matcher": "*",
72
+ "hooks": [
73
+ {
74
+ "type": "command",
75
+ "command": "bash ~/.claude/hooks/session-init.sh"
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ },
81
+ "statusLine": {
82
+ "enabled": true,
83
+ "type": "command",
84
+ "command": "~/.claude/statusline.sh"
85
+ },
86
+ "mcpServers": {
87
+ "github": {
88
+ "command": "npx",
89
+ "args": ["-y", "@anthropic-ai/mcp-server-github"],
90
+ "oauth": {
91
+ "clientId": "${GITHUB_CLIENT_ID}",
92
+ "clientSecret": "${GITHUB_CLIENT_SECRET}",
93
+ "scopes": ["repo", "issues"]
94
+ }
95
+ },
96
+ "filesystem": {
97
+ "command": "npx",
98
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "${CLAUDE_PROJECT_DIR}/.moai", "${CLAUDE_PROJECT_DIR}/src"]
99
+ }
100
+ },
101
+ "extraKnownMarketplaces": [
102
+ {
103
+ "name": "company-plugins",
104
+ "url": "https://github.com/your-org/claude-plugins"
105
+ }
106
+ ]
107
+ }
108
+ ```
109
+
110
+ ## Permission Modes
111
+
112
+ | Mode | Behavior | Use Case |
113
+ |------|----------|----------|
114
+ | **allow** | Execute all allowed tools without asking | Trusted environments |
115
+ | **ask** | Ask before executing each tool | Development (safer) |
116
+ | **deny** | Deny all tools except whitelisted | Restrictive (default) |
117
+
118
+ ```json
119
+ {
120
+ "permissionMode": "ask"
121
+ }
122
+ ```
123
+
124
+ ## Tool Permission Patterns
125
+
126
+ ### Restrictive (Recommended for teams)
127
+ ```json
128
+ {
129
+ "allowedTools": [
130
+ "Read(src/**)",
131
+ "Edit(src/**/*.ts)",
132
+ "Bash(npm run test:*)",
133
+ "Glob(src/**)"
134
+ ],
135
+ "deniedTools": [
136
+ "Bash(rm:*)",
137
+ "Bash(sudo:*)",
138
+ "Read(.env)"
139
+ ]
140
+ }
141
+ ```
142
+
143
+ ### Permissive (Local development only)
144
+ ```json
145
+ {
146
+ "allowedTools": [
147
+ "Read",
148
+ "Write",
149
+ "Edit",
150
+ "Bash(git:*)",
151
+ "Bash(npm:*)",
152
+ "Bash(python:*)",
153
+ "Glob",
154
+ "Grep"
155
+ ]
156
+ }
157
+ ```
158
+
159
+ ## Environment Variables Pattern
160
+
161
+ ```json
162
+ {
163
+ "env": {
164
+ "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}",
165
+ "GITHUB_TOKEN": "${GITHUB_TOKEN}",
166
+ "BRAVE_SEARCH_API_KEY": "${BRAVE_SEARCH_API_KEY}",
167
+ "NODE_ENV": "development"
168
+ }
169
+ }
170
+ ```
171
+
172
+ **Security rule**: Never hardcode secrets; always use `${VAR_NAME}` syntax.
173
+
174
+ ## Dangerous Tools to Deny
175
+
176
+ ```json
177
+ {
178
+ "deniedTools": [
179
+ "Bash(rm -rf:*)", // Recursive delete
180
+ "Bash(sudo:*)", // Privilege escalation
181
+ "Bash(curl.*|.*bash)", // Code injection
182
+ "Read(.env)", // Secrets
183
+ "Read(.ssh/**)", // SSH keys
184
+ "Read(/etc/shadow)", // System secrets
185
+ "Edit(/etc/**)", // System files
186
+ ]
187
+ }
188
+ ```
189
+
190
+ ## Permission Validation
191
+
192
+ ```bash
193
+ # Check current permissions
194
+ cat .claude/settings.json | jq '.permissions'
195
+
196
+ # Validate JSON syntax
197
+ jq . .claude/settings.json
198
+
199
+ # List allowed tools
200
+ jq '.permissions.allowedTools[]' .claude/settings.json
201
+ ```
202
+
203
+ ## Spinner Tips Configuration
204
+
205
+ ```json
206
+ {
207
+ "spinnerTipsEnabled": true
208
+ }
209
+ ```
210
+
211
+ Custom tips can be added for better UX during long operations.
212
+
213
+ ## Best Practices
214
+
215
+ ✅ **DO**:
216
+ - Use `ask` mode for teams
217
+ - Explicitly whitelist paths
218
+ - Environment variables for all secrets
219
+ - Review permissions regularly
220
+ - Document why each denial exists
221
+
222
+ ❌ **DON'T**:
223
+ - Hardcode credentials in settings.json
224
+ - Use `allow` mode for untrusted contexts
225
+ - Grant `Bash(*)` without restrictions
226
+ - Include secrets in version control
227
+ - Mix personal and project settings
228
+
229
+ ## Permission Checklist
230
+
231
+ - [ ] All secrets use `${VAR_NAME}` syntax
232
+ - [ ] Dangerous patterns are denied
233
+ - [ ] File paths are explicit (not wildcards)
234
+ - [ ] Permission mode matches use case (ask/allow/deny)
235
+ - [ ] Hooks are not left in commented state
236
+ - [ ] MCP servers have proper OAuth configuration
237
+ - [ ] No `.env` file is readable
238
+ - [ ] Sudo commands are denied
239
+
240
+ ---
241
+
242
+ **Reference**: Claude Code settings.json documentation
243
+ **Version**: 1.0.0
@@ -0,0 +1,30 @@
1
+ {
2
+ "permissions": {
3
+ "allowedTools": [
4
+ "Read(**/*.{js,ts,json,md})",
5
+ "Edit(**/*.{js,ts})",
6
+ "Glob(**/*)",
7
+ "Grep(**/*)",
8
+ "Bash(git:*)",
9
+ "Bash(npm:*)",
10
+ "Bash(npm run:*)",
11
+ "Bash(pytest:*)",
12
+ "Bash(python:*)"
13
+ ],
14
+ "deniedTools": [
15
+ "Read(./.env)",
16
+ "Read(./.env.*)",
17
+ "Read(./secrets/**)",
18
+ "Bash(rm -rf:*)",
19
+ "Bash(sudo:*)",
20
+ "Bash(curl:*)"
21
+ ]
22
+ },
23
+ "permissionMode": "ask",
24
+ "spinnerTipsEnabled": true,
25
+ "disableAllHooks": false,
26
+ "env": {
27
+ "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}",
28
+ "GITHUB_TOKEN": "${GITHUB_TOKEN}"
29
+ }
30
+ }