moai-adk 0.3.12__py3-none-any.whl → 0.4.0__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.
- moai_adk/__init__.py +8 -1
- moai_adk/__main__.py +1 -1
- moai_adk/cli/commands/__init__.py +1 -1
- moai_adk/cli/commands/doctor.py +2 -2
- moai_adk/cli/commands/status.py +1 -1
- moai_adk/cli/commands/update.py +136 -90
- moai_adk/cli/prompts/init_prompts.py +1 -1
- moai_adk/core/__init__.py +1 -1
- moai_adk/core/git/branch.py +1 -1
- moai_adk/core/git/manager.py +1 -1
- moai_adk/core/project/detector.py +14 -2
- moai_adk/core/quality/__init__.py +1 -1
- moai_adk/core/quality/trust_checker.py +1 -1
- moai_adk/core/quality/validators/__init__.py +1 -1
- moai_adk/core/quality/validators/base_validator.py +1 -1
- moai_adk/core/template/__init__.py +1 -1
- moai_adk/core/template/backup.py +2 -1
- moai_adk/core/template/config.py +24 -0
- moai_adk/core/template/languages.py +1 -1
- moai_adk/core/template/merger.py +58 -1
- moai_adk/core/template/processor.py +41 -12
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +558 -3
- moai_adk/templates/.claude/commands/alfred/0-project.md +480 -12
- moai_adk/templates/.claude/commands/alfred/1-plan.md +563 -0
- moai_adk/templates/.claude/commands/alfred/1-spec.md +15 -516
- moai_adk/templates/.claude/commands/alfred/2-build.md +15 -417
- moai_adk/templates/.claude/commands/alfred/2-run.md +460 -0
- moai_adk/templates/.claude/hooks/alfred/handlers/session.py +12 -0
- moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-claude-code/examples.md +513 -0
- moai_adk/templates/.claude/skills/moai-claude-code/reference.md +419 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +332 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +384 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +349 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +552 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +499 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +68 -0
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +64 -0
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +69 -0
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +69 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +68 -0
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +62 -0
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +74 -0
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +66 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +66 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +68 -0
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +59 -0
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +76 -0
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +61 -0
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +63 -0
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +64 -0
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +61 -0
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +54 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +46 -0
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +68 -0
- moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +68 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +69 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +66 -0
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +66 -0
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +66 -0
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +64 -0
- moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +66 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +65 -0
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +65 -0
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +64 -0
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +66 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +66 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +68 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +68 -0
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +68 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +67 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +64 -0
- moai_adk/templates/.claude/skills/scripts/standardize_skills.py +166 -0
- moai_adk/templates/.claude/skills/scripts/verify_standardization.sh +43 -0
- moai_adk/templates/CLAUDE.md +153 -0
- moai_adk/templates/__init__.py +1 -1
- moai_adk/utils/__init__.py +1 -1
- moai_adk/utils/banner.py +1 -1
- moai_adk/utils/logger.py +1 -1
- {moai_adk-0.3.12.dist-info → moai_adk-0.4.0.dist-info}/METADATA +244 -3
- moai_adk-0.4.0.dist-info/RECORD +145 -0
- moai_adk-0.3.12.dist-info/RECORD +0 -90
- {moai_adk-0.3.12.dist-info → moai_adk-0.4.0.dist-info}/WHEEL +0 -0
- {moai_adk-0.3.12.dist-info → moai_adk-0.4.0.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.3.12.dist-info → moai_adk-0.4.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "MoAI-ADK Full Settings Template - Complete Production Configuration",
|
|
3
|
+
"_usage": "Complete Claude Code settings for MoAI-ADK workflows with hooks and Python-specific permissions",
|
|
4
|
+
"_docs": "https://docs.claude.com/en/docs/claude-code/settings",
|
|
5
|
+
"_moai_workflow": "/alfred:0-project → /alfred:1-spec → /alfred:2-build → /alfred:3-sync",
|
|
6
|
+
|
|
7
|
+
"permissions": {
|
|
8
|
+
"allow": [
|
|
9
|
+
"Read(**)",
|
|
10
|
+
"Grep(**)",
|
|
11
|
+
"Glob(**)",
|
|
12
|
+
"Bash(ls:**)",
|
|
13
|
+
"Bash(cat:**)",
|
|
14
|
+
"Bash(echo:**)",
|
|
15
|
+
"Bash(which:**)",
|
|
16
|
+
"Bash(find:**)",
|
|
17
|
+
"Bash(tree:**)",
|
|
18
|
+
"Bash(git:status)",
|
|
19
|
+
"Bash(git:log:**)",
|
|
20
|
+
"Bash(git:diff:**)",
|
|
21
|
+
"Bash(git:branch:**)",
|
|
22
|
+
"Bash(git:show:**)",
|
|
23
|
+
"Bash(python:**)",
|
|
24
|
+
"Bash(python3:**)",
|
|
25
|
+
"Bash(uv:**)",
|
|
26
|
+
"Bash(pytest:**)",
|
|
27
|
+
"Bash(mypy:**)",
|
|
28
|
+
"Bash(ruff:**)",
|
|
29
|
+
"Bash(black:**)",
|
|
30
|
+
"Bash(coverage:**)",
|
|
31
|
+
"Bash(moai-adk:**)",
|
|
32
|
+
"Bash(alfred:**)",
|
|
33
|
+
"Bash(gh:pr:view:**)",
|
|
34
|
+
"Bash(gh:pr:list:**)",
|
|
35
|
+
"Bash(gh:issue:**)",
|
|
36
|
+
"Bash(gh:repo:view:**)"
|
|
37
|
+
],
|
|
38
|
+
"ask": [
|
|
39
|
+
"Write(**)",
|
|
40
|
+
"Edit(**)",
|
|
41
|
+
"MultiEdit(**)",
|
|
42
|
+
"Bash(rm:**)",
|
|
43
|
+
"Bash(mv:**)",
|
|
44
|
+
"Bash(cp:**)",
|
|
45
|
+
"Bash(mkdir:**)",
|
|
46
|
+
"Bash(touch:**)",
|
|
47
|
+
"Bash(git:add:**)",
|
|
48
|
+
"Bash(git:commit:**)",
|
|
49
|
+
"Bash(git:push:**)",
|
|
50
|
+
"Bash(git:merge:**)",
|
|
51
|
+
"Bash(git:checkout:**)",
|
|
52
|
+
"Bash(git:rebase:**)",
|
|
53
|
+
"Bash(gh:pr:create:**)",
|
|
54
|
+
"Bash(gh:pr:merge:**)",
|
|
55
|
+
"Bash(uv:add:**)",
|
|
56
|
+
"Bash(uv:remove:**)"
|
|
57
|
+
],
|
|
58
|
+
"deny": [
|
|
59
|
+
"Bash(rm:-rf:**)",
|
|
60
|
+
"Bash(git:push:--force)**",
|
|
61
|
+
"Bash(git:reset:--hard)**",
|
|
62
|
+
"Bash(git:clean:-fd)**",
|
|
63
|
+
"Bash(sudo:**)",
|
|
64
|
+
"Bash(chmod:**)",
|
|
65
|
+
"Bash(chown:**)",
|
|
66
|
+
"Bash(dd:**)",
|
|
67
|
+
"Bash(mkfs:**)",
|
|
68
|
+
"Write(.env)",
|
|
69
|
+
"Write(**/*.secret)",
|
|
70
|
+
"Write(**/id_rsa)**",
|
|
71
|
+
"Edit(.env)",
|
|
72
|
+
"Edit(**/*.secret)"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
"hooks": {
|
|
77
|
+
"SessionStart": {
|
|
78
|
+
"command": "bash",
|
|
79
|
+
"args": [
|
|
80
|
+
"-c",
|
|
81
|
+
"echo '▶◀ MoAI-ADK Session Started' && echo '' && echo '📊 Git Status:' && git status --short && echo '' && echo '🌿 Branch: '$(git branch --show-current) && echo '' && echo '📋 Recent SPECs:' && ls -1 .moai/specs/ 2>/dev/null | head -3 || echo 'No SPECs yet' && echo '' && echo '💡 Quick Commands:' && echo ' /alfred:1-spec \"기능명\" - SPEC 작성' && echo ' /alfred:2-build SPEC-ID - TDD 구현' && echo ' /alfred:3-sync - 문서 동기화'"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"PreToolUse": {
|
|
85
|
+
"command": "python3",
|
|
86
|
+
"args": [
|
|
87
|
+
"-c",
|
|
88
|
+
"import json, sys, os; data = json.load(sys.stdin); tool = data.get('tool', ''); params = data.get('parameters', {}); blocked = False; message = ''; \nif tool == 'Bash':\n cmd = params.get('command', '')\n if 'rm -rf' in cmd or 'rm-rf' in cmd:\n blocked = True; message = '❌ CRITICAL: rm -rf blocked (data loss risk)'\n elif 'git push --force' in cmd or 'git push -f' in cmd:\n blocked = True; message = '❌ CRITICAL: Force push blocked (history corruption risk)'\n elif 'sudo' in cmd:\n blocked = True; message = '❌ CRITICAL: sudo blocked (security risk)'\n elif '.env' in cmd and ('rm' in cmd or 'cat' in cmd):\n blocked = True; message = '⚠️ WARNING: .env file access blocked (secrets protection)'\nelif tool == 'Write' or tool == 'Edit':\n path = params.get('file_path', '')\n if '.env' in path or '.secret' in path or 'id_rsa' in path:\n blocked = True; message = '❌ CRITICAL: Writing secrets file blocked'\nprint(json.dumps({'blocked': blocked, 'message': message}))"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
"_moai_adk_integration": {
|
|
94
|
+
"workflow_permissions": {
|
|
95
|
+
"alfred_0_project": {
|
|
96
|
+
"needs": ["Write(.moai/project/**)", "Bash(mkdir:.moai/**)", "Read(**)", "Grep(**)", "Glob(**)"],
|
|
97
|
+
"rationale": "Project initialization requires writing metadata files"
|
|
98
|
+
},
|
|
99
|
+
"alfred_1_spec": {
|
|
100
|
+
"needs": ["Write(.moai/specs/**)", "Bash(git:branch:**)", "Bash(gh:pr:create:**)", "Read(.moai/project/**)"],
|
|
101
|
+
"rationale": "SPEC creation, feature branch, Draft PR"
|
|
102
|
+
},
|
|
103
|
+
"alfred_2_build": {
|
|
104
|
+
"needs": ["Write(tests/**)", "Write(src/**)", "Edit(**)", "Bash(pytest:**)", "Bash(mypy:**)", "Bash(git:commit:**)"],
|
|
105
|
+
"rationale": "TDD implementation with RED → GREEN → REFACTOR commits"
|
|
106
|
+
},
|
|
107
|
+
"alfred_3_sync": {
|
|
108
|
+
"needs": ["Write(docs/**)", "Edit(**)", "Bash(rg:**)", "Bash(gh:pr:**)", "Grep(**)", "Glob(**)"],
|
|
109
|
+
"rationale": "Living Document sync, TAG validation, PR Ready transition"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"tag_system_permissions": {
|
|
113
|
+
"tag_scanning": ["Grep(**)", "Bash(rg:@(SPEC|TEST|CODE|DOC):**)"],
|
|
114
|
+
"tag_validation": ["Read(.moai/specs/**)", "Read(tests/**)", "Read(src/**)", "Read(docs/**)"],
|
|
115
|
+
"tag_reporting": ["Write(.moai/reports/**)", "Write(docs/**)"]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
"_python_moai_adk_patterns": {
|
|
120
|
+
"testing": {
|
|
121
|
+
"allow": [
|
|
122
|
+
"Bash(pytest:**)",
|
|
123
|
+
"Bash(pytest:--cov:**)",
|
|
124
|
+
"Bash(pytest:-v:**)",
|
|
125
|
+
"Bash(coverage:report)**",
|
|
126
|
+
"Bash(coverage:html)**"
|
|
127
|
+
],
|
|
128
|
+
"rationale": "TRUST 원칙 - Test First (85% 커버리지 목표)"
|
|
129
|
+
},
|
|
130
|
+
"type_checking": {
|
|
131
|
+
"allow": [
|
|
132
|
+
"Bash(mypy:**)",
|
|
133
|
+
"Bash(mypy:--strict:**)"
|
|
134
|
+
],
|
|
135
|
+
"rationale": "TRUST 원칙 - Unified (타입 안전성)"
|
|
136
|
+
},
|
|
137
|
+
"linting": {
|
|
138
|
+
"allow": [
|
|
139
|
+
"Bash(ruff:check:**)",
|
|
140
|
+
"Bash(ruff:format:**)",
|
|
141
|
+
"Bash(black:**)"
|
|
142
|
+
],
|
|
143
|
+
"rationale": "TRUST 원칙 - Readable (코드 품질)"
|
|
144
|
+
},
|
|
145
|
+
"package_management": {
|
|
146
|
+
"allow": [
|
|
147
|
+
"Bash(uv:sync)",
|
|
148
|
+
"Bash(uv:lock)",
|
|
149
|
+
"Bash(uv:tree)"
|
|
150
|
+
],
|
|
151
|
+
"ask": [
|
|
152
|
+
"Bash(uv:add:**)",
|
|
153
|
+
"Bash(uv:remove:**)",
|
|
154
|
+
"Bash(uv:build)**",
|
|
155
|
+
"Bash(uv:publish)**"
|
|
156
|
+
],
|
|
157
|
+
"rationale": "읽기 작업은 허용, 의존성 변경은 확인 필요"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
"_git_workflow_moai": {
|
|
162
|
+
"safe_read_operations": {
|
|
163
|
+
"allow": [
|
|
164
|
+
"Bash(git:status)",
|
|
165
|
+
"Bash(git:log:**)",
|
|
166
|
+
"Bash(git:diff:**)",
|
|
167
|
+
"Bash(git:show:**)",
|
|
168
|
+
"Bash(git:branch:**)"
|
|
169
|
+
],
|
|
170
|
+
"description": "Repository 읽기 전용 - 항상 허용"
|
|
171
|
+
},
|
|
172
|
+
"tdd_commit_pattern": {
|
|
173
|
+
"ask": [
|
|
174
|
+
"Bash(git:add:**)",
|
|
175
|
+
"Bash(git:commit:**)"
|
|
176
|
+
],
|
|
177
|
+
"example_messages": [
|
|
178
|
+
"🔴 RED: SPEC-AUTH-001 JWT 인증 테스트 작성",
|
|
179
|
+
"🟢 GREEN: SPEC-AUTH-001 JWT 인증 구현",
|
|
180
|
+
"♻️ REFACTOR: SPEC-AUTH-001 코드 품질 개선",
|
|
181
|
+
"📝 DOCS: SPEC-AUTH-001 문서 동기화"
|
|
182
|
+
],
|
|
183
|
+
"description": "TDD 단계별 커밋 - 사용자 확인 필요"
|
|
184
|
+
},
|
|
185
|
+
"branch_and_pr": {
|
|
186
|
+
"ask": [
|
|
187
|
+
"Bash(git:checkout:-b:**)",
|
|
188
|
+
"Bash(git:push:**)",
|
|
189
|
+
"Bash(gh:pr:create:**)",
|
|
190
|
+
"Bash(gh:pr:merge:**)"
|
|
191
|
+
],
|
|
192
|
+
"workflow": [
|
|
193
|
+
"1. feature/SPEC-{ID} 브랜치 생성 (git checkout -b)",
|
|
194
|
+
"2. Draft PR 생성 (gh pr create --draft)",
|
|
195
|
+
"3. TDD 구현 및 커밋",
|
|
196
|
+
"4. PR Ready 전환 (gh pr ready)",
|
|
197
|
+
"5. PR 머지 (gh pr merge --squash)"
|
|
198
|
+
],
|
|
199
|
+
"description": "Git 브랜치/PR 작업 - 항상 확인"
|
|
200
|
+
},
|
|
201
|
+
"dangerous_operations": {
|
|
202
|
+
"deny": [
|
|
203
|
+
"Bash(git:push:--force)**",
|
|
204
|
+
"Bash(git:reset:--hard)**",
|
|
205
|
+
"Bash(git:clean:-fd)**"
|
|
206
|
+
],
|
|
207
|
+
"description": "데이터 손실 위험 - 절대 차단"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
"_security_hardening": {
|
|
212
|
+
"secrets_protection": {
|
|
213
|
+
"deny": [
|
|
214
|
+
"Write(.env)",
|
|
215
|
+
"Write(**/*.secret)",
|
|
216
|
+
"Write(**/id_rsa)**",
|
|
217
|
+
"Write(**/credentials.json)",
|
|
218
|
+
"Edit(.env)",
|
|
219
|
+
"Edit(**/*.secret)",
|
|
220
|
+
"Bash(cat:.env)",
|
|
221
|
+
"Bash(cat:**/*.secret)"
|
|
222
|
+
],
|
|
223
|
+
"description": "비밀 정보 파일 접근 차단"
|
|
224
|
+
},
|
|
225
|
+
"system_protection": {
|
|
226
|
+
"deny": [
|
|
227
|
+
"Bash(sudo:**)",
|
|
228
|
+
"Bash(chmod:**)",
|
|
229
|
+
"Bash(chown:**)",
|
|
230
|
+
"Bash(dd:**)",
|
|
231
|
+
"Bash(mkfs:**)"
|
|
232
|
+
],
|
|
233
|
+
"description": "시스템 레벨 명령 차단"
|
|
234
|
+
},
|
|
235
|
+
"data_loss_prevention": {
|
|
236
|
+
"deny": [
|
|
237
|
+
"Bash(rm:-rf:**)",
|
|
238
|
+
"Bash(git:reset:--hard)**",
|
|
239
|
+
"Bash(git:clean:-fd)**"
|
|
240
|
+
],
|
|
241
|
+
"description": "데이터 손실 위험 명령 차단"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
"_hook_implementation_details": {
|
|
246
|
+
"SessionStart": {
|
|
247
|
+
"purpose": "MoAI-ADK 세션 시작 시 프로젝트 컨텍스트 제공",
|
|
248
|
+
"output_sections": [
|
|
249
|
+
"▶◀ MoAI-ADK Session Started - 세션 시작 표시",
|
|
250
|
+
"📊 Git Status - 변경된 파일 목록 (git status --short)",
|
|
251
|
+
"🌿 Branch - 현재 작업 브랜치",
|
|
252
|
+
"📋 Recent SPECs - 최근 생성된 SPEC 3개",
|
|
253
|
+
"💡 Quick Commands - 자주 사용하는 Alfred 커맨드"
|
|
254
|
+
],
|
|
255
|
+
"execution_time": "~200ms (빠른 실행)",
|
|
256
|
+
"error_handling": "SPEC 디렉토리 없으면 'No SPECs yet' 표시",
|
|
257
|
+
"customization": "프로젝트별 정보 추가 가능 (product.md 요약 등)"
|
|
258
|
+
},
|
|
259
|
+
"PreToolUse": {
|
|
260
|
+
"purpose": "위험한 작업 사전 차단 (데이터 손실, 보안 위험)",
|
|
261
|
+
"stdin_format": "JSON: {tool: string, parameters: object}",
|
|
262
|
+
"stdout_format": "JSON: {blocked: boolean, message: string}",
|
|
263
|
+
"blocked_patterns": [
|
|
264
|
+
"rm -rf - 데이터 손실 위험",
|
|
265
|
+
"git push --force - 히스토리 손상 위험",
|
|
266
|
+
"sudo - 보안 위험",
|
|
267
|
+
".env 파일 접근 - 비밀 정보 노출"
|
|
268
|
+
],
|
|
269
|
+
"implementation": "Python3 inline script (외부 의존성 없음)",
|
|
270
|
+
"performance": "~50ms (JSON 파싱 + 패턴 매칭)",
|
|
271
|
+
"extensibility": "새로운 차단 패턴 추가 용이"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
"_testing_and_validation": {
|
|
276
|
+
"permission_tests": {
|
|
277
|
+
"test_allow": [
|
|
278
|
+
"Read(.moai/project/product.md) - Should execute without prompt",
|
|
279
|
+
"Bash(git:status) - Should execute without prompt",
|
|
280
|
+
"Bash(pytest:tests/) - Should execute without prompt"
|
|
281
|
+
],
|
|
282
|
+
"test_ask": [
|
|
283
|
+
"Write(.moai/specs/SPEC-NEW-001/spec.md) - Should prompt for confirmation",
|
|
284
|
+
"Bash(git:commit:-m:\"test\") - Should prompt for confirmation",
|
|
285
|
+
"Bash(uv:add:requests) - Should prompt for confirmation"
|
|
286
|
+
],
|
|
287
|
+
"test_deny": [
|
|
288
|
+
"Bash(rm:-rf:/tmp/test) - Should be blocked immediately",
|
|
289
|
+
"Write(.env) - Should be blocked immediately",
|
|
290
|
+
"Bash(sudo:ls) - Should be blocked immediately"
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
"hook_tests": {
|
|
294
|
+
"test_session_start": {
|
|
295
|
+
"trigger": "Start new Claude Code session",
|
|
296
|
+
"expected_output": "Git status, branch name, recent SPECs, quick commands",
|
|
297
|
+
"verify": "Output contains '▶◀ MoAI-ADK Session Started'"
|
|
298
|
+
},
|
|
299
|
+
"test_pre_tool_use": {
|
|
300
|
+
"trigger": "Try dangerous command (rm -rf)",
|
|
301
|
+
"expected_output": "{\"blocked\": true, \"message\": \"❌ CRITICAL: rm -rf blocked\"}",
|
|
302
|
+
"verify": "Command is blocked before execution"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"validation_commands": {
|
|
306
|
+
"json_syntax": "python -m json.tool .claude/settings.json",
|
|
307
|
+
"hook_test": "echo '{\"tool\": \"Bash\", \"parameters\": {\"command\": \"rm -rf /tmp/test\"}}' | python3 -c '<PreToolUse script>'",
|
|
308
|
+
"permission_check": "grep -E '^\\s*(allow|ask|deny):' .claude/settings.json"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
"_troubleshooting": {
|
|
313
|
+
"hooks_not_running": {
|
|
314
|
+
"symptom": "SessionStart output not visible, PreToolUse not blocking",
|
|
315
|
+
"checks": [
|
|
316
|
+
"Is Python3 installed? (python3 --version)",
|
|
317
|
+
"Is Bash available? (which bash)",
|
|
318
|
+
"Is settings.json valid? (python -m json.tool)",
|
|
319
|
+
"Are hooks properly formatted? (check args array)",
|
|
320
|
+
"Did you restart Claude Code?"
|
|
321
|
+
],
|
|
322
|
+
"debug": [
|
|
323
|
+
"Run SessionStart command manually: bash -c '<command>'",
|
|
324
|
+
"Test PreToolUse: echo '{...}' | python3 -c '<script>'",
|
|
325
|
+
"Check Claude Code logs: ~/.claude/logs/"
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
"permission_denied_unexpectedly": {
|
|
329
|
+
"symptom": "Operation blocked when it should be allowed",
|
|
330
|
+
"checks": [
|
|
331
|
+
"Is pattern in 'deny' list? (grep <pattern> .claude/settings.json)",
|
|
332
|
+
"Is pattern syntax correct? (wildcards ** vs *)",
|
|
333
|
+
"Does 'deny' override 'allow'? (deny has higher priority)",
|
|
334
|
+
"Is there a typo in permission pattern?"
|
|
335
|
+
],
|
|
336
|
+
"solution": [
|
|
337
|
+
"Remove from 'deny' list if safe",
|
|
338
|
+
"Adjust pattern to be more specific",
|
|
339
|
+
"Restart Claude Code after changes"
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
"too_many_prompts": {
|
|
343
|
+
"symptom": "Getting prompted for every operation",
|
|
344
|
+
"checks": [
|
|
345
|
+
"Are read operations in 'allow'? (Read, Grep, Glob)",
|
|
346
|
+
"Are test commands in 'allow'? (pytest, mypy)",
|
|
347
|
+
"Are git read commands in 'allow'? (git status, git log)"
|
|
348
|
+
],
|
|
349
|
+
"solution": [
|
|
350
|
+
"Move common read operations to 'allow'",
|
|
351
|
+
"Keep only write operations in 'ask'",
|
|
352
|
+
"Balance security vs usability"
|
|
353
|
+
]
|
|
354
|
+
},
|
|
355
|
+
"hook_json_parse_error": {
|
|
356
|
+
"symptom": "PreToolUse hook fails with JSON error",
|
|
357
|
+
"checks": [
|
|
358
|
+
"Is Python script valid? (test manually)",
|
|
359
|
+
"Does script always output valid JSON? (test edge cases)",
|
|
360
|
+
"Are single/double quotes escaped properly?"
|
|
361
|
+
],
|
|
362
|
+
"solution": [
|
|
363
|
+
"Test script with various inputs",
|
|
364
|
+
"Ensure json.dumps() always returns valid JSON",
|
|
365
|
+
"Add error handling in Python script"
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
|
|
370
|
+
"_best_practices": {
|
|
371
|
+
"permission_design": {
|
|
372
|
+
"principles": [
|
|
373
|
+
"Start restrictive, relax based on workflow (fail-safe approach)",
|
|
374
|
+
"Group related commands (all git:read, all python:test)",
|
|
375
|
+
"Use wildcards thoughtfully (** for recursive, * for single level)",
|
|
376
|
+
"Document rationale in _comment fields"
|
|
377
|
+
],
|
|
378
|
+
"patterns": [
|
|
379
|
+
"Read operations → allow (safe, no side effects)",
|
|
380
|
+
"Write operations → ask (user review needed)",
|
|
381
|
+
"Dangerous operations → deny (prevent data loss)",
|
|
382
|
+
"Language tools (pytest, mypy) → allow (development workflow)",
|
|
383
|
+
"Package management (uv add) → ask (dependency changes)"
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
"hook_design": {
|
|
387
|
+
"principles": [
|
|
388
|
+
"Keep SessionStart fast (<500ms)",
|
|
389
|
+
"PreToolUse must return valid JSON always",
|
|
390
|
+
"Test hooks independently before integration",
|
|
391
|
+
"Use absolute paths or environment variables"
|
|
392
|
+
],
|
|
393
|
+
"session_start_tips": [
|
|
394
|
+
"Show only essential context (git status, branch)",
|
|
395
|
+
"Limit output to ~10 lines (avoid clutter)",
|
|
396
|
+
"Include quick command reminders for new users",
|
|
397
|
+
"Handle missing directories gracefully (|| echo 'N/A')"
|
|
398
|
+
],
|
|
399
|
+
"pre_tool_use_tips": [
|
|
400
|
+
"Use Python for complex logic (better than bash if/else)",
|
|
401
|
+
"Always output JSON even on errors",
|
|
402
|
+
"Provide clear block messages (why operation is dangerous)",
|
|
403
|
+
"Test with edge cases (empty input, malformed JSON)"
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
"maintenance": {
|
|
407
|
+
"quarterly_review": [
|
|
408
|
+
"Review 'allow' list - remove unused permissions",
|
|
409
|
+
"Review 'deny' list - add new dangerous patterns",
|
|
410
|
+
"Update hooks - improve context or add new checks",
|
|
411
|
+
"Test with latest Claude Code version"
|
|
412
|
+
],
|
|
413
|
+
"version_control": [
|
|
414
|
+
"Commit settings.json to repository (team shared config)",
|
|
415
|
+
"Use settings.local.json for personal overrides (.gitignore)",
|
|
416
|
+
"Document changes in commit messages",
|
|
417
|
+
"Review PRs that modify permissions carefully"
|
|
418
|
+
],
|
|
419
|
+
"security_audits": [
|
|
420
|
+
"Monthly: Review denied operations log",
|
|
421
|
+
"Quarterly: Test all dangerous operation blocks",
|
|
422
|
+
"Annually: Full permission audit with security team",
|
|
423
|
+
"After incidents: Add new deny patterns"
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
|
|
428
|
+
"_moai_adk_specific": {
|
|
429
|
+
"spec_protection": {
|
|
430
|
+
"description": "SPEC 파일은 중요한 요구사항 문서 - 실수 삭제 방지",
|
|
431
|
+
"permissions": {
|
|
432
|
+
"allow": ["Read(.moai/specs/**)"],
|
|
433
|
+
"ask": ["Write(.moai/specs/**)", "Edit(.moai/specs/**)"],
|
|
434
|
+
"deny": ["Bash(rm:.moai/specs/**)"]
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
"tag_system": {
|
|
438
|
+
"description": "@TAG 추적성 유지 - 코드 스캔 허용",
|
|
439
|
+
"permissions": {
|
|
440
|
+
"allow": [
|
|
441
|
+
"Bash(rg:@(SPEC|TEST|CODE|DOC):**)",
|
|
442
|
+
"Grep(@SPEC:**)",
|
|
443
|
+
"Grep(@TEST:**)",
|
|
444
|
+
"Grep(@CODE:**)",
|
|
445
|
+
"Grep(@DOC:**)"
|
|
446
|
+
]
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
"trust_principles": {
|
|
450
|
+
"Test_First": {
|
|
451
|
+
"allow": ["Bash(pytest:**)", "Bash(coverage:**)"],
|
|
452
|
+
"goal": "85% test coverage"
|
|
453
|
+
},
|
|
454
|
+
"Readable": {
|
|
455
|
+
"allow": ["Bash(ruff:**)", "Bash(black:**)", "Bash(mypy:**)"],
|
|
456
|
+
"goal": "Clean, typed code"
|
|
457
|
+
},
|
|
458
|
+
"Unified": {
|
|
459
|
+
"allow": ["Bash(mypy:--strict:**)"],
|
|
460
|
+
"goal": "Type safety"
|
|
461
|
+
},
|
|
462
|
+
"Secured": {
|
|
463
|
+
"deny": ["Write(.env)", "Bash(cat:.env)"],
|
|
464
|
+
"goal": "Secrets protection"
|
|
465
|
+
},
|
|
466
|
+
"Trackable": {
|
|
467
|
+
"allow": ["Bash(rg:@TAG:**)", "Grep(@TAG:**)"],
|
|
468
|
+
"goal": "Complete traceability"
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
|
|
473
|
+
"_performance_considerations": {
|
|
474
|
+
"startup_time": {
|
|
475
|
+
"baseline": "Hooks add ~200-500ms to startup",
|
|
476
|
+
"optimization": [
|
|
477
|
+
"Keep SessionStart command simple",
|
|
478
|
+
"Avoid expensive operations (large file scans)",
|
|
479
|
+
"Cache results if possible (not implemented yet)"
|
|
480
|
+
]
|
|
481
|
+
},
|
|
482
|
+
"runtime_overhead": {
|
|
483
|
+
"PreToolUse": "~50ms per tool invocation",
|
|
484
|
+
"impact": "Negligible for interactive use",
|
|
485
|
+
"optimization": "Use Python (faster than Bash for complex logic)"
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
|
|
489
|
+
"_validation_checklist": [
|
|
490
|
+
"✅ Valid JSON syntax (python -m json.tool)",
|
|
491
|
+
"✅ All dangerous operations in 'deny'",
|
|
492
|
+
"✅ Read operations in 'allow'",
|
|
493
|
+
"✅ Write operations in 'ask'",
|
|
494
|
+
"✅ SessionStart executes in <500ms",
|
|
495
|
+
"✅ PreToolUse returns valid JSON",
|
|
496
|
+
"✅ PreToolUse blocks rm -rf",
|
|
497
|
+
"✅ PreToolUse blocks force push",
|
|
498
|
+
"✅ PreToolUse blocks .env access",
|
|
499
|
+
"✅ Python/uv commands properly configured",
|
|
500
|
+
"✅ Git workflow matches MoAI-ADK",
|
|
501
|
+
"✅ SPEC files protected from deletion",
|
|
502
|
+
"✅ TAG system commands allowed",
|
|
503
|
+
"✅ TRUST principles enforced",
|
|
504
|
+
"✅ Team collaboration considered"
|
|
505
|
+
],
|
|
506
|
+
|
|
507
|
+
"_real_world_usage": {
|
|
508
|
+
"team_setup": [
|
|
509
|
+
"1. Commit this settings.json to repository",
|
|
510
|
+
"2. Each developer copies to .claude/settings.json",
|
|
511
|
+
"3. Create .claude/settings.local.json for personal overrides",
|
|
512
|
+
"4. Add .claude/settings.local.json to .gitignore",
|
|
513
|
+
"5. Team lead reviews permission changes in PRs"
|
|
514
|
+
],
|
|
515
|
+
"personal_project": [
|
|
516
|
+
"1. Copy to .claude/settings.json",
|
|
517
|
+
"2. Adjust 'ask' list based on workflow",
|
|
518
|
+
"3. Test with real operations",
|
|
519
|
+
"4. Iterate based on experience"
|
|
520
|
+
],
|
|
521
|
+
"ci_cd_integration": [
|
|
522
|
+
"1. CI環境では hooks を無効化 (hooks: null)",
|
|
523
|
+
"2. Permissions는 more restrictive (deny more operations)",
|
|
524
|
+
"3. Environment variables로 secrets 관리",
|
|
525
|
+
"4. Test before deploy"
|
|
526
|
+
]
|
|
527
|
+
},
|
|
528
|
+
|
|
529
|
+
"_template_metadata": {
|
|
530
|
+
"template_level": "full",
|
|
531
|
+
"best_for": "MoAI-ADK production workflows, Python projects, team collaboration",
|
|
532
|
+
"features": [
|
|
533
|
+
"Complete MoAI-ADK workflow integration (/alfred:0-1-2-3)",
|
|
534
|
+
"Python/uv package management",
|
|
535
|
+
"TRUST 5-principles enforcement",
|
|
536
|
+
"TDD workflow permissions (RED-GREEN-REFACTOR)",
|
|
537
|
+
"Git workflow automation (feature branch, Draft PR, auto-merge)",
|
|
538
|
+
"@TAG system support",
|
|
539
|
+
"SPEC protection",
|
|
540
|
+
"Security hardening (secrets, sudo, force push)",
|
|
541
|
+
"SessionStart hook (project context)",
|
|
542
|
+
"PreToolUse hook (danger prevention)",
|
|
543
|
+
"Comprehensive troubleshooting",
|
|
544
|
+
"Performance optimized",
|
|
545
|
+
"Team collaboration ready"
|
|
546
|
+
],
|
|
547
|
+
"estimated_setup_time": "45-60 minutes (full configuration + testing)",
|
|
548
|
+
"maintenance_effort": "Quarterly review (15 minutes), continuous monitoring",
|
|
549
|
+
"support_level": "Full MoAI-ADK integration support",
|
|
550
|
+
"documentation": "Complete with examples, tests, troubleshooting"
|
|
551
|
+
}
|
|
552
|
+
}
|