moai-adk 0.4.5__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 (229) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/core/project/initializer.py +12 -5
  3. moai_adk/templates/.claude/agents/alfred/cc-manager.md +188 -954
  4. moai_adk/templates/.claude/agents/alfred/debug-helper.md +4 -5
  5. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +2 -2
  6. moai_adk/templates/.claude/agents/alfred/git-manager.md +2 -2
  7. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +3 -3
  8. moai_adk/templates/.claude/agents/alfred/project-manager.md +6 -6
  9. moai_adk/templates/.claude/agents/alfred/quality-gate.md +4 -6
  10. moai_adk/templates/.claude/agents/alfred/skill-factory.md +829 -0
  11. moai_adk/templates/.claude/agents/alfred/spec-builder.md +2 -2
  12. moai_adk/templates/.claude/agents/alfred/tag-agent.md +2 -2
  13. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +3 -3
  14. moai_adk/templates/.claude/agents/alfred/trust-checker.md +5 -5
  15. moai_adk/templates/.claude/commands/alfred/0-project.md +98 -42
  16. moai_adk/templates/.claude/commands/alfred/1-plan.md +7 -7
  17. moai_adk/templates/.claude/commands/alfred/2-run.md +36 -36
  18. moai_adk/templates/.claude/commands/alfred/3-sync.md +10 -10
  19. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +14 -1
  20. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +115 -33
  21. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +8 -9
  22. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +6 -6
  23. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +5 -4
  24. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +1 -1
  25. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +1 -1
  26. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +1 -1
  27. moai_adk/templates/.claude/settings.json +42 -2
  28. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +76 -66
  29. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +29 -0
  30. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +28 -0
  31. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +86 -59
  32. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +29 -0
  33. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +29 -0
  34. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +480 -0
  35. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +257 -0
  36. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +120 -0
  37. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +87 -73
  38. moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +29 -0
  39. moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +28 -0
  40. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +78 -62
  41. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +29 -0
  42. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +28 -0
  43. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +78 -55
  44. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +29 -0
  45. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +28 -0
  46. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +78 -64
  47. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +29 -0
  48. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +28 -0
  49. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +249 -0
  50. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
  51. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +278 -0
  52. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
  53. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +287 -0
  54. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
  55. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +232 -0
  56. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
  57. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
  58. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
  59. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +179 -0
  60. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
  61. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +296 -0
  62. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
  63. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +243 -0
  64. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
  65. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +271 -0
  66. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
  67. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +234 -43
  68. moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +1633 -0
  69. moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +660 -0
  70. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +97 -69
  71. moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +29 -0
  72. moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +30 -0
  73. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +97 -72
  74. moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +29 -0
  75. moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +30 -0
  76. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +97 -74
  77. moai_adk/templates/.claude/skills/moai-domain-database/examples.md +29 -0
  78. moai_adk/templates/.claude/skills/moai-domain-database/reference.md +30 -0
  79. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +98 -74
  80. moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +29 -0
  81. moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +31 -0
  82. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +98 -73
  83. moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +29 -0
  84. moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +31 -0
  85. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +97 -73
  86. moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +29 -0
  87. moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +30 -0
  88. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +97 -67
  89. moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +29 -0
  90. moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +30 -0
  91. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +97 -79
  92. moai_adk/templates/.claude/skills/moai-domain-security/examples.md +29 -0
  93. moai_adk/templates/.claude/skills/moai-domain-security/reference.md +30 -0
  94. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -71
  95. moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +29 -0
  96. moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +30 -0
  97. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +656 -60
  98. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1107 -0
  99. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1533 -0
  100. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +87 -78
  101. moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +29 -0
  102. moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +28 -0
  103. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +87 -70
  104. moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +29 -0
  105. moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +28 -0
  106. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +87 -86
  107. moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +29 -0
  108. moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +28 -0
  109. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +77 -62
  110. moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +29 -0
  111. moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +28 -0
  112. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +88 -56
  113. moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +29 -0
  114. moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +29 -0
  115. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +90 -71
  116. moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +29 -0
  117. moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +28 -0
  118. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +78 -58
  119. moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +29 -0
  120. moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +28 -0
  121. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +78 -51
  122. moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +29 -0
  123. moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +28 -0
  124. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +253 -32
  125. moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
  126. moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +1099 -0
  127. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +98 -74
  128. moai_adk/templates/.claude/skills/moai-lang-c/examples.md +29 -0
  129. moai_adk/templates/.claude/skills/moai-lang-c/reference.md +31 -0
  130. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +98 -76
  131. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +29 -0
  132. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +31 -0
  133. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +97 -74
  134. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +29 -0
  135. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +30 -0
  136. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +86 -61
  137. moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +29 -0
  138. moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +30 -0
  139. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +98 -74
  140. moai_adk/templates/.claude/skills/moai-lang-go/examples.md +29 -0
  141. moai_adk/templates/.claude/skills/moai-lang-go/reference.md +31 -0
  142. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +87 -61
  143. moai_adk/templates/.claude/skills/moai-lang-java/examples.md +29 -0
  144. moai_adk/templates/.claude/skills/moai-lang-java/reference.md +31 -0
  145. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +88 -59
  146. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +29 -0
  147. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +32 -0
  148. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +98 -73
  149. moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +29 -0
  150. moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +31 -0
  151. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +86 -61
  152. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +29 -0
  153. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +30 -0
  154. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +388 -53
  155. moai_adk/templates/.claude/skills/moai-lang-python/examples.md +624 -0
  156. moai_adk/templates/.claude/skills/moai-lang-python/reference.md +316 -0
  157. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +97 -73
  158. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +29 -0
  159. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +30 -0
  160. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +98 -73
  161. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +29 -0
  162. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +31 -0
  163. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +98 -74
  164. moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +29 -0
  165. moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +31 -0
  166. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +97 -74
  167. moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +29 -0
  168. moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +30 -0
  169. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +97 -74
  170. moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +29 -0
  171. moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +30 -0
  172. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +98 -74
  173. moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +29 -0
  174. moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +31 -0
  175. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +97 -73
  176. moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +29 -0
  177. moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +30 -0
  178. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +90 -59
  179. moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +29 -0
  180. moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +34 -0
  181. moai_adk/templates/.claude/skills/moai-skill-factory/CHECKLIST.md +482 -0
  182. moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +278 -0
  183. moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +524 -0
  184. moai_adk/templates/.claude/skills/moai-skill-factory/METADATA.md +477 -0
  185. moai_adk/templates/.claude/skills/moai-skill-factory/PARALLEL-ANALYSIS-REPORT.md +429 -0
  186. moai_adk/templates/.claude/skills/moai-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
  187. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -0
  188. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-UPDATE-ADVISOR.md +577 -0
  189. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +560 -0
  190. moai_adk/templates/.claude/skills/moai-skill-factory/STEP-BY-STEP-GUIDE.md +466 -0
  191. moai_adk/templates/.claude/skills/moai-skill-factory/STRUCTURE.md +583 -0
  192. moai_adk/templates/.claude/skills/moai-skill-factory/WEB-RESEARCH.md +526 -0
  193. moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +465 -0
  194. moai_adk/templates/.claude/skills/moai-skill-factory/scripts/generate-structure.sh +328 -0
  195. moai_adk/templates/.claude/skills/moai-skill-factory/scripts/validate-skill.sh +312 -0
  196. moai_adk/templates/.claude/skills/moai-skill-factory/templates/SKILL_TEMPLATE.md +245 -0
  197. moai_adk/templates/.claude/skills/moai-skill-factory/templates/examples-template.md +285 -0
  198. moai_adk/templates/.claude/skills/moai-skill-factory/templates/reference-template.md +278 -0
  199. moai_adk/templates/.claude/skills/moai-skill-factory/templates/scripts-template.sh +303 -0
  200. moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +129 -0
  201. moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +1300 -0
  202. moai_adk/templates/.claude/skills/moai-spec-authoring/examples/validate-spec.sh +161 -0
  203. moai_adk/templates/CLAUDE.md +121 -81
  204. moai_adk-0.4.8.dist-info/METADATA +1553 -0
  205. moai_adk-0.4.8.dist-info/RECORD +265 -0
  206. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +0 -112
  207. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +0 -103
  208. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +0 -105
  209. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +0 -97
  210. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +0 -87
  211. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +0 -62
  212. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +0 -94
  213. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +0 -513
  214. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +0 -433
  215. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +0 -332
  216. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +0 -384
  217. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +0 -363
  218. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +0 -595
  219. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +0 -496
  220. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +0 -100
  221. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +0 -99
  222. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +0 -100
  223. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +0 -98
  224. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +0 -98
  225. moai_adk-0.4.5.dist-info/METADATA +0 -369
  226. moai_adk-0.4.5.dist-info/RECORD +0 -152
  227. {moai_adk-0.4.5.dist-info → moai_adk-0.4.8.dist-info}/WHEEL +0 -0
  228. {moai_adk-0.4.5.dist-info → moai_adk-0.4.8.dist-info}/entry_points.txt +0 -0
  229. {moai_adk-0.4.5.dist-info → moai_adk-0.4.8.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: "Configuring MCP Servers & Plugins for Claude Code"
3
+ description: "Set up Model Context Protocol servers (GitHub, Filesystem, Brave Search, SQLite). Configure OAuth, manage permissions, validate MCP structure. Use when integrating external tools, APIs, or expanding Claude Code capabilities."
4
+ allowed-tools: "Read, Write, Edit, Bash, Glob"
5
+ ---
6
+
7
+ # Configuring MCP Servers & Plugins
8
+
9
+ MCP servers extend Claude Code with external tool integrations. Each server provides tools that Claude can invoke directly.
10
+
11
+ ## MCP Server Setup in settings.json
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "github": {
17
+ "command": "npx",
18
+ "args": ["-y", "@anthropic-ai/mcp-server-github"],
19
+ "oauth": {
20
+ "clientId": "your-client-id",
21
+ "clientSecret": "your-client-secret",
22
+ "scopes": ["repo", "issues", "pull_requests"]
23
+ }
24
+ },
25
+ "filesystem": {
26
+ "command": "npx",
27
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/files"]
28
+ },
29
+ "sqlite": {
30
+ "command": "npx",
31
+ "args": ["-y", "@modelcontextprotocol/server-sqlite", "/path/to/database.db"]
32
+ },
33
+ "brave-search": {
34
+ "command": "npx",
35
+ "args": ["-y", "@modelcontextprotocol/server-brave-search"],
36
+ "env": {
37
+ "BRAVE_SEARCH_API_KEY": "${BRAVE_SEARCH_API_KEY}"
38
+ }
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ ## Common MCP Servers
45
+
46
+ | Server | Purpose | Installation | Config |
47
+ |--------|---------|--------------|--------|
48
+ | **GitHub** | PR/issue management, code search | `@anthropic-ai/mcp-server-github` | OAuth required |
49
+ | **Filesystem** | Safe file access with path restrictions | `@modelcontextprotocol/server-filesystem` | Path whitelist required |
50
+ | **SQLite** | Database queries & migrations | `@modelcontextprotocol/server-sqlite` | DB file path |
51
+ | **Brave Search** | Web search integration | `@modelcontextprotocol/server-brave-search` | API key required |
52
+
53
+ ## OAuth Configuration Pattern
54
+
55
+ ```json
56
+ {
57
+ "oauth": {
58
+ "clientId": "your-client-id",
59
+ "clientSecret": "your-client-secret",
60
+ "scopes": ["repo", "issues"]
61
+ }
62
+ }
63
+ ```
64
+
65
+ **Scope Minimization** (principle of least privilege):
66
+ - GitHub: `repo` (code access), `issues` (PR/issue access)
67
+ - NOT `admin`, NOT `delete_repo`
68
+
69
+ ## Filesystem MCP: Path Whitelisting
70
+
71
+ ```json
72
+ {
73
+ "filesystem": {
74
+ "command": "npx",
75
+ "args": [
76
+ "-y",
77
+ "@modelcontextprotocol/server-filesystem",
78
+ "${CLAUDE_PROJECT_DIR}/.moai",
79
+ "${CLAUDE_PROJECT_DIR}/src",
80
+ "${CLAUDE_PROJECT_DIR}/tests"
81
+ ]
82
+ }
83
+ }
84
+ ```
85
+
86
+ **Security Principle**: Explicitly list allowed directories, no wildcards.
87
+
88
+ ## Plugin Marketplace Integration
89
+
90
+ ```json
91
+ {
92
+ "extraKnownMarketplaces": [
93
+ {
94
+ "name": "company-plugins",
95
+ "url": "https://github.com/your-org/claude-plugins"
96
+ },
97
+ {
98
+ "name": "community-plugins",
99
+ "url": "https://glama.ai/mcp/servers"
100
+ }
101
+ ]
102
+ }
103
+ ```
104
+
105
+ ## MCP Health Check
106
+
107
+ ```bash
108
+ # Inside Claude Code terminal
109
+ /mcp # List active MCP servers
110
+ /plugin validate # Validate plugin structure
111
+ /plugin install # Install from marketplace
112
+ /plugin enable github # Enable specific server
113
+ /plugin disable github # Disable specific server
114
+ ```
115
+
116
+ ## Environment Variables for MCP
117
+
118
+ ```bash
119
+ # Set in ~/.bash_profile or .claude/config.json
120
+ export GITHUB_TOKEN="gh_xxxx..."
121
+ export BRAVE_SEARCH_API_KEY="xxxx..."
122
+ export ANTHROPIC_API_KEY="sk-ant-..."
123
+
124
+ # Launch Claude Code with env
125
+ GITHUB_TOKEN=gh_xxxx claude
126
+ ```
127
+
128
+ ## MCP Troubleshooting
129
+
130
+ | Issue | Cause | Fix |
131
+ |-------|-------|-----|
132
+ | Server not connecting | Invalid JSON in mcpServers | Validate with `jq .mcpServers settings.json` |
133
+ | OAuth error | Token expired or invalid scopes | Check `claude /usage`, regenerate token |
134
+ | Permission denied | Path not whitelisted | Add to Filesystem MCP args |
135
+ | Slow response | Network latency or server overload | Check server logs, reduce scope |
136
+
137
+ ## Best Practices
138
+
139
+ ✅ **DO**:
140
+ - Use environment variables for secrets
141
+ - Whitelist Filesystem paths explicitly
142
+ - Start with minimal scopes, expand only if needed
143
+ - Test MCP connection: `/mcp` command
144
+
145
+ ❌ **DON'T**:
146
+ - Hardcode credentials in settings.json
147
+ - Use wildcard paths (`/` in Filesystem MCP)
148
+ - Install untrusted plugins
149
+ - Give admin scopes unnecessarily
150
+
151
+ ## Plugin Custom Directory Structure
152
+
153
+ ```
154
+ my-plugin/
155
+ ├── .claude-plugin/
156
+ │ └── plugin.json
157
+ ├── commands/
158
+ │ ├── deploy.md
159
+ │ └── rollback.md
160
+ ├── agents/
161
+ │ └── reviewer.md
162
+ └── hooks/
163
+ └── pre-deploy-check.sh
164
+ ```
165
+
166
+ ## Validation Checklist
167
+
168
+ - [ ] All server paths are absolute
169
+ - [ ] OAuth secrets stored in env vars
170
+ - [ ] Filesystem paths are whitelisted
171
+ - [ ] No hardcoded tokens or credentials
172
+ - [ ] MCP server installed: `which npx`
173
+ - [ ] Health check passes: `/mcp`
174
+ - [ ] Scopes follow least-privilege principle
175
+
176
+ ---
177
+
178
+ **Reference**: Claude Code MCP documentation
179
+ **Version**: 1.0.0
@@ -0,0 +1,39 @@
1
+ {
2
+ "mcpServers": {
3
+ "github": {
4
+ "command": "npx",
5
+ "args": ["-y", "@anthropic-ai/mcp-server-github"],
6
+ "oauth": {
7
+ "clientId": "${GITHUB_CLIENT_ID}",
8
+ "clientSecret": "${GITHUB_CLIENT_SECRET}",
9
+ "scopes": ["repo", "issues"]
10
+ }
11
+ },
12
+ "filesystem": {
13
+ "command": "npx",
14
+ "args": [
15
+ "-y",
16
+ "@modelcontextprotocol/server-filesystem",
17
+ "${CLAUDE_PROJECT_DIR}/.moai",
18
+ "${CLAUDE_PROJECT_DIR}/src"
19
+ ]
20
+ },
21
+ "sqlite": {
22
+ "command": "npx",
23
+ "args": ["-y", "@modelcontextprotocol/server-sqlite", "/path/to/db.sqlite"]
24
+ },
25
+ "brave-search": {
26
+ "command": "npx",
27
+ "args": ["-y", "@modelcontextprotocol/server-brave-search"],
28
+ "env": {
29
+ "BRAVE_SEARCH_API_KEY": "${BRAVE_SEARCH_API_KEY}"
30
+ }
31
+ }
32
+ },
33
+ "extraKnownMarketplaces": [
34
+ {
35
+ "name": "company-plugins",
36
+ "url": "https://github.com/your-org/claude-plugins"
37
+ }
38
+ ]
39
+ }
@@ -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]