@relipa/ai-flow-kit 0.0.1

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.
Files changed (204) hide show
  1. package/AIFLOW.md +432 -0
  2. package/CHANGELOG.md +78 -0
  3. package/CONTRIBUTING.md +351 -0
  4. package/IMPLEMENTATION_SUMMARY.md +348 -0
  5. package/QUICK_START.md +392 -0
  6. package/README.md +323 -0
  7. package/bin/aiflow.js +178 -0
  8. package/custom/mcp-presets/README.md +138 -0
  9. package/custom/mcp-presets/backlog.json +15 -0
  10. package/custom/mcp-presets/figma.json +15 -0
  11. package/custom/mcp-presets/google-sheets.json +14 -0
  12. package/custom/mcp-presets/jira.json +16 -0
  13. package/custom/prompts/bug-fix.md +149 -0
  14. package/custom/prompts/feature.md +190 -0
  15. package/custom/prompts/investigation.md +164 -0
  16. package/custom/rules/code-style.md +7 -0
  17. package/custom/rules/java/code-style.md +11 -0
  18. package/custom/rules/java/naming.md +17 -0
  19. package/custom/rules/java/review-checklist.md +36 -0
  20. package/custom/rules/javascript/code-style.md +12 -0
  21. package/custom/rules/javascript/naming.md +14 -0
  22. package/custom/rules/naming.md +9 -0
  23. package/custom/rules/php/code-style.md +10 -0
  24. package/custom/rules/php/naming.md +15 -0
  25. package/custom/rules/review-checklist.md +9 -0
  26. package/custom/skills/figma-to-component/SKILL.md +207 -0
  27. package/custom/skills/generate-spec/SKILL.md +97 -0
  28. package/custom/skills/impact-analysis/SKILL.md +94 -0
  29. package/custom/skills/investigate-bug/SKILL.md +93 -0
  30. package/custom/skills/report-customer/SKILL.md +95 -0
  31. package/custom/skills/review-plan/SKILL.md +158 -0
  32. package/custom/skills/validate-ticket/SKILL.md +240 -0
  33. package/custom/templates/laravel.md +90 -0
  34. package/custom/templates/nextjs.md +89 -0
  35. package/custom/templates/reactjs.md +567 -0
  36. package/custom/templates/spring-boot.md +598 -0
  37. package/custom/templates/vue-nuxt.md +89 -0
  38. package/docs/architecture.md +395 -0
  39. package/docs/cli-reference.md +438 -0
  40. package/docs/configuration.md +412 -0
  41. package/docs/getting-started.md +248 -0
  42. package/docs/troubleshooting.md +587 -0
  43. package/docs/workflows/bug-fix.md +126 -0
  44. package/docs/workflows/feature.md +123 -0
  45. package/docs/workflows/impact-analysis.md +13 -0
  46. package/docs/workflows/investigation.md +13 -0
  47. package/docs/workflows/refactor.md +13 -0
  48. package/index.js +27 -0
  49. package/package.json +70 -0
  50. package/scripts/config.js +317 -0
  51. package/scripts/context.js +117 -0
  52. package/scripts/detect.js +239 -0
  53. package/scripts/doctor.js +48 -0
  54. package/scripts/guide.js +282 -0
  55. package/scripts/hooks/session-start.js +140 -0
  56. package/scripts/init.js +453 -0
  57. package/scripts/memory.js +247 -0
  58. package/scripts/prompt.js +392 -0
  59. package/scripts/remove.js +170 -0
  60. package/scripts/update.js +111 -0
  61. package/scripts/use.js +570 -0
  62. package/scripts/validate.js +303 -0
  63. package/upstream/.claude-plugin/marketplace.json +20 -0
  64. package/upstream/.claude-plugin/plugin.json +20 -0
  65. package/upstream/.codex/INSTALL.md +67 -0
  66. package/upstream/.cursor-plugin/plugin.json +25 -0
  67. package/upstream/.gitattributes +18 -0
  68. package/upstream/.github/FUNDING.yml +3 -0
  69. package/upstream/.github/ISSUE_TEMPLATE/bug_report.md +52 -0
  70. package/upstream/.github/ISSUE_TEMPLATE/config.yml +5 -0
  71. package/upstream/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
  72. package/upstream/.github/ISSUE_TEMPLATE/platform_support.md +23 -0
  73. package/upstream/.github/PULL_REQUEST_TEMPLATE.md +87 -0
  74. package/upstream/.opencode/INSTALL.md +83 -0
  75. package/upstream/.opencode/plugins/superpowers.js +112 -0
  76. package/upstream/.version-bump.json +19 -0
  77. package/upstream/AGENTS.md +1 -0
  78. package/upstream/CHANGELOG.md +13 -0
  79. package/upstream/CLAUDE.md +85 -0
  80. package/upstream/CODE_OF_CONDUCT.md +128 -0
  81. package/upstream/GEMINI.md +2 -0
  82. package/upstream/LICENSE +21 -0
  83. package/upstream/README.md +190 -0
  84. package/upstream/RELEASE-NOTES.md +1096 -0
  85. package/upstream/agents/code-reviewer.md +48 -0
  86. package/upstream/commands/brainstorm.md +5 -0
  87. package/upstream/commands/execute-plan.md +5 -0
  88. package/upstream/commands/write-plan.md +5 -0
  89. package/upstream/docs/README.codex.md +126 -0
  90. package/upstream/docs/README.opencode.md +130 -0
  91. package/upstream/docs/plans/2025-11-22-opencode-support-design.md +294 -0
  92. package/upstream/docs/plans/2025-11-22-opencode-support-implementation.md +1095 -0
  93. package/upstream/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +711 -0
  94. package/upstream/docs/plans/2026-01-17-visual-brainstorming.md +571 -0
  95. package/upstream/docs/superpowers/plans/2026-01-22-document-review-system.md +301 -0
  96. package/upstream/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +523 -0
  97. package/upstream/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +479 -0
  98. package/upstream/docs/superpowers/plans/2026-03-23-codex-app-compatibility.md +564 -0
  99. package/upstream/docs/superpowers/specs/2026-01-22-document-review-system-design.md +136 -0
  100. package/upstream/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +162 -0
  101. package/upstream/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +118 -0
  102. package/upstream/docs/superpowers/specs/2026-03-23-codex-app-compatibility-design.md +244 -0
  103. package/upstream/docs/testing.md +303 -0
  104. package/upstream/docs/windows/polyglot-hooks.md +212 -0
  105. package/upstream/gemini-extension.json +6 -0
  106. package/upstream/hooks/hooks-cursor.json +10 -0
  107. package/upstream/hooks/hooks.json +16 -0
  108. package/upstream/hooks/run-hook.cmd +46 -0
  109. package/upstream/hooks/session-start +57 -0
  110. package/upstream/package.json +6 -0
  111. package/upstream/scripts/bump-version.sh +220 -0
  112. package/upstream/skills/brainstorming/SKILL.md +164 -0
  113. package/upstream/skills/brainstorming/scripts/frame-template.html +214 -0
  114. package/upstream/skills/brainstorming/scripts/helper.js +88 -0
  115. package/upstream/skills/brainstorming/scripts/server.cjs +354 -0
  116. package/upstream/skills/brainstorming/scripts/start-server.sh +148 -0
  117. package/upstream/skills/brainstorming/scripts/stop-server.sh +56 -0
  118. package/upstream/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  119. package/upstream/skills/brainstorming/visual-companion.md +287 -0
  120. package/upstream/skills/dispatching-parallel-agents/SKILL.md +182 -0
  121. package/upstream/skills/executing-plans/SKILL.md +70 -0
  122. package/upstream/skills/finishing-a-development-branch/SKILL.md +200 -0
  123. package/upstream/skills/receiving-code-review/SKILL.md +213 -0
  124. package/upstream/skills/requesting-code-review/SKILL.md +105 -0
  125. package/upstream/skills/requesting-code-review/code-reviewer.md +146 -0
  126. package/upstream/skills/subagent-driven-development/SKILL.md +277 -0
  127. package/upstream/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  128. package/upstream/skills/subagent-driven-development/implementer-prompt.md +113 -0
  129. package/upstream/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  130. package/upstream/skills/systematic-debugging/CREATION-LOG.md +119 -0
  131. package/upstream/skills/systematic-debugging/SKILL.md +296 -0
  132. package/upstream/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  133. package/upstream/skills/systematic-debugging/condition-based-waiting.md +115 -0
  134. package/upstream/skills/systematic-debugging/defense-in-depth.md +122 -0
  135. package/upstream/skills/systematic-debugging/find-polluter.sh +63 -0
  136. package/upstream/skills/systematic-debugging/root-cause-tracing.md +169 -0
  137. package/upstream/skills/systematic-debugging/test-academic.md +14 -0
  138. package/upstream/skills/systematic-debugging/test-pressure-1.md +58 -0
  139. package/upstream/skills/systematic-debugging/test-pressure-2.md +68 -0
  140. package/upstream/skills/systematic-debugging/test-pressure-3.md +69 -0
  141. package/upstream/skills/test-driven-development/SKILL.md +371 -0
  142. package/upstream/skills/test-driven-development/testing-anti-patterns.md +299 -0
  143. package/upstream/skills/using-git-worktrees/SKILL.md +218 -0
  144. package/upstream/skills/using-superpowers/SKILL.md +117 -0
  145. package/upstream/skills/using-superpowers/references/codex-tools.md +100 -0
  146. package/upstream/skills/using-superpowers/references/copilot-tools.md +52 -0
  147. package/upstream/skills/using-superpowers/references/gemini-tools.md +33 -0
  148. package/upstream/skills/verification-before-completion/SKILL.md +139 -0
  149. package/upstream/skills/writing-plans/SKILL.md +152 -0
  150. package/upstream/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  151. package/upstream/skills/writing-skills/SKILL.md +655 -0
  152. package/upstream/skills/writing-skills/anthropic-best-practices.md +1150 -0
  153. package/upstream/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  154. package/upstream/skills/writing-skills/graphviz-conventions.dot +172 -0
  155. package/upstream/skills/writing-skills/persuasion-principles.md +187 -0
  156. package/upstream/skills/writing-skills/render-graphs.js +168 -0
  157. package/upstream/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  158. package/upstream/tests/brainstorm-server/package-lock.json +36 -0
  159. package/upstream/tests/brainstorm-server/package.json +10 -0
  160. package/upstream/tests/brainstorm-server/server.test.js +427 -0
  161. package/upstream/tests/brainstorm-server/windows-lifecycle.test.sh +351 -0
  162. package/upstream/tests/brainstorm-server/ws-protocol.test.js +392 -0
  163. package/upstream/tests/claude-code/README.md +158 -0
  164. package/upstream/tests/claude-code/analyze-token-usage.py +168 -0
  165. package/upstream/tests/claude-code/run-skill-tests.sh +187 -0
  166. package/upstream/tests/claude-code/test-document-review-system.sh +177 -0
  167. package/upstream/tests/claude-code/test-helpers.sh +202 -0
  168. package/upstream/tests/claude-code/test-subagent-driven-development-integration.sh +314 -0
  169. package/upstream/tests/claude-code/test-subagent-driven-development.sh +165 -0
  170. package/upstream/tests/explicit-skill-requests/prompts/action-oriented.txt +3 -0
  171. package/upstream/tests/explicit-skill-requests/prompts/after-planning-flow.txt +17 -0
  172. package/upstream/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +11 -0
  173. package/upstream/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +8 -0
  174. package/upstream/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +3 -0
  175. package/upstream/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +1 -0
  176. package/upstream/tests/explicit-skill-requests/prompts/skip-formalities.txt +3 -0
  177. package/upstream/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +1 -0
  178. package/upstream/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +1 -0
  179. package/upstream/tests/explicit-skill-requests/run-all.sh +70 -0
  180. package/upstream/tests/explicit-skill-requests/run-claude-describes-sdd.sh +100 -0
  181. package/upstream/tests/explicit-skill-requests/run-extended-multiturn-test.sh +113 -0
  182. package/upstream/tests/explicit-skill-requests/run-haiku-test.sh +144 -0
  183. package/upstream/tests/explicit-skill-requests/run-multiturn-test.sh +143 -0
  184. package/upstream/tests/explicit-skill-requests/run-test.sh +136 -0
  185. package/upstream/tests/opencode/run-tests.sh +163 -0
  186. package/upstream/tests/opencode/setup.sh +88 -0
  187. package/upstream/tests/opencode/test-plugin-loading.sh +82 -0
  188. package/upstream/tests/opencode/test-priority.sh +198 -0
  189. package/upstream/tests/opencode/test-tools.sh +104 -0
  190. package/upstream/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +8 -0
  191. package/upstream/tests/skill-triggering/prompts/executing-plans.txt +1 -0
  192. package/upstream/tests/skill-triggering/prompts/requesting-code-review.txt +3 -0
  193. package/upstream/tests/skill-triggering/prompts/systematic-debugging.txt +11 -0
  194. package/upstream/tests/skill-triggering/prompts/test-driven-development.txt +7 -0
  195. package/upstream/tests/skill-triggering/prompts/writing-plans.txt +10 -0
  196. package/upstream/tests/skill-triggering/run-all.sh +60 -0
  197. package/upstream/tests/skill-triggering/run-test.sh +88 -0
  198. package/upstream/tests/subagent-driven-dev/go-fractals/design.md +81 -0
  199. package/upstream/tests/subagent-driven-dev/go-fractals/plan.md +172 -0
  200. package/upstream/tests/subagent-driven-dev/go-fractals/scaffold.sh +45 -0
  201. package/upstream/tests/subagent-driven-dev/run-test.sh +106 -0
  202. package/upstream/tests/subagent-driven-dev/svelte-todo/design.md +70 -0
  203. package/upstream/tests/subagent-driven-dev/svelte-todo/plan.md +222 -0
  204. package/upstream/tests/subagent-driven-dev/svelte-todo/scaffold.sh +46 -0
@@ -0,0 +1,395 @@
1
+ # AI Flow Kit Architecture
2
+
3
+ This document explains how AI Flow Kit works and how to customize it for your team.
4
+
5
+ ## System Overview
6
+
7
+ ```
8
+ ┌─────────────────────────────────────────────────────────┐
9
+ │ Developer │
10
+ │ (runs aiflow commands) │
11
+ └────────────────────┬────────────────────────────────────┘
12
+
13
+ ┌────────────▼──────────────┐
14
+ │ CLI (bin/aiflow.js) │
15
+ │ ├─ init │
16
+ │ ├─ use (load context) │
17
+ │ ├─ prompt (generate) │
18
+ │ ├─ detect (task type) │
19
+ │ ├─ update │
20
+ │ ├─ doctor │
21
+ │ └─ validate │
22
+ └────────────────┬──────────┘
23
+
24
+ ┌────────────────┼──────────────────┐
25
+ │ │ │
26
+ ┌────▼────┐ ┌──────▼──────┐ ┌───────▼──────┐
27
+ │ Scripts │ │ Adapters │ │ Config │
28
+ │ ├─ init │ │ ├─ jira │ │ (.aiflowrc) │
29
+ │ ├─ use │ │ ├─ backlog │ └──────────────┘
30
+ │ ├─ detect
31
+ │ ├─ context
32
+ │ └─ validate
33
+ └────┬────┘ │ └─ sheets │
34
+ │ └─────┬──────┘
35
+ │ │
36
+ ┌────┴──────┬──────┴───┐
37
+ │ │ │
38
+ ┌──▼──┐ ┌──────▼──┐ ┌───▼────┐
39
+ │.claude │.rules │ │.aiflow │
40
+ │ │ │ │(state) │
41
+ │├─skills │├─code │ └─────────┘
42
+ │├─context ││ style│
43
+ │└─prompts │├─naming│
44
+ │ │└─review│
45
+ └──────────└────────┘
46
+
47
+
48
+ ┌─────┴──────┐
49
+ │ Upstream │
50
+ │ (obra.dev) │
51
+ │ Skills │
52
+ │ & Prompts │
53
+ └────────────┘
54
+ ```
55
+
56
+ ## Key Components
57
+
58
+ ### 1. CLI (bin/aiflow.js)
59
+
60
+ Entry point for all user commands. Routes to appropriate script.
61
+
62
+ **Commands:**
63
+ - `init` — Initialize project with skills and templates
64
+ - `use` — Load context from ticket or file
65
+ - `prompt` — Generate AI prompt with context
66
+ - `detect` — Auto-detect task type from description
67
+ - `update` — Update to latest version
68
+ - `doctor` — Health check
69
+ - `validate` — Validate AI output quality
70
+
71
+ ### 2. Configuration System
72
+
73
+ Three levels of configuration:
74
+
75
+ **Global** (`~/.claude/ai-flow-kit.json`)
76
+ ```json
77
+ {
78
+ "defaultModel": "claude-opus-4-6",
79
+ "globalSkills": ["investigate-bug"]
80
+ }
81
+ ```
82
+
83
+ **Project** (`.aiflowrc.json`)
84
+ ```json
85
+ {
86
+ "team": "engineering",
87
+ "adapters": ["jira"],
88
+ "frameworks": ["laravel"],
89
+ "autoDetectTasks": true
90
+ }
91
+ ```
92
+
93
+ **Local** (`.aiflow/state.json`)
94
+ ```json
95
+ {
96
+ "current_version": "1.0.0",
97
+ "current_context": "JIRA-123"
98
+ }
99
+ ```
100
+
101
+ ### 3. Skill System
102
+
103
+ Skills are step-by-step instructions for AI workflows.
104
+
105
+ **Upstream skills** (from obra/superpowers):
106
+ - `brainstorming` — Explore ideas
107
+ - `writing-plans` — Create implementation plans
108
+ - `executing-plans` — Execute plans with checkpoints
109
+ - `systematic-debugging` — Debug issues methodically
110
+ - `test-driven-development` — TDD workflow
111
+ - etc.
112
+
113
+ **Custom skills** (in `custom/skills/`):
114
+ - `investigate-bug` — Trace bugs through data flow
115
+ - `impact-analysis` — Assess change scope
116
+ - `generate-spec` — Create feature specifications
117
+ - etc.
118
+
119
+ Skills are merged during `aiflow init` and `aiflow update`.
120
+
121
+ ### 4. Task Detection
122
+
123
+ Auto-classifies what the developer is doing:
124
+
125
+ ```
126
+ Input: "Payment integration broken in checkout"
127
+
128
+ Analysis:
129
+ - Contains: "broken" (bug indicator)
130
+ - Location: "checkout" (specific area)
131
+ - Type: Bug fix
132
+
133
+ Output: "investigate-bug" skill
134
+ ```
135
+
136
+ **Detection rules** (in `scripts/detect.js`):
137
+ - Keywords: "bug", "error", "broken", "crash" → bug fix
138
+ - Keywords: "add", "create", "build", "new" → feature
139
+ - Keywords: "improve", "optimize", "refactor" → refactor
140
+ - Keywords: "analyze", "investigate", "understand" → investigation
141
+
142
+ ### 5. Context System
143
+
144
+ Stores task information for AI reference.
145
+
146
+ **Structure:**
147
+ ```
148
+ .claude/context/
149
+ ├── current.json # Current task
150
+ ├── history/
151
+ │ ├── JIRA-123.json
152
+ │ ├── JIRA-124.json
153
+ │ └── ...
154
+ └── templates/
155
+ ├── bug-fix.json
156
+ ├── feature.json
157
+ └── ...
158
+ ```
159
+
160
+ **Content:**
161
+ ```json
162
+ {
163
+ "taskId": "JIRA-123",
164
+ "taskType": "bug-fix",
165
+ "title": "Payment processing fails",
166
+ "description": "Users see error...",
167
+ "acceptanceCriteria": ["...", "..."],
168
+ "context": {
169
+ "files": ["src/Payment.php"],
170
+ "services": ["PaymentService"],
171
+ "models": ["Transaction"],
172
+ "relatedTickets": ["JIRA-120", "JIRA-121"]
173
+ },
174
+ "metadata": {
175
+ "created": "2024-04-03T10:00:00Z",
176
+ "loadedFrom": "jira",
177
+ "adapter": "jira"
178
+ }
179
+ }
180
+ ```
181
+
182
+ ### 6. MCP Adapter System
183
+
184
+ Integrates with external tools (Jira, Backlog, etc).
185
+
186
+ **How it works:**
187
+ 1. User runs: `aiflow use JIRA-123`
188
+ 2. CLI checks MCP config for `jira` server
189
+ 3. Calls Jira API via MCP to fetch issue
190
+ 4. Parses and stores in `context/current.json`
191
+ 5. Generates prompt with context
192
+
193
+ **Adapters:**
194
+ ```json
195
+ custom/mcp-presets/jira.json
196
+ {
197
+ "mcpServers": {
198
+ "jira": {
199
+ "command": "npx",
200
+ "args": ["@modelcontextprotocol/server-jira"],
201
+ "env": {
202
+ "JIRA_API_TOKEN": "{{API_TOKEN}}",
203
+ "JIRA_EMAIL": "{{EMAIL}}",
204
+ "JIRA_DOMAIN": "{{DOMAIN}}"
205
+ }
206
+ }
207
+ }
208
+ }
209
+ ```
210
+
211
+ ### 7. Template System
212
+
213
+ Pre-made structures for different task types and frameworks.
214
+
215
+ **Prompt Templates** (`custom/prompts/`):
216
+ - `bug-fix.md` — Template for bug fixing workflow
217
+ - `feature.md` — Template for feature building
218
+ - `investigation.md` — Template for code investigation
219
+ - etc.
220
+
221
+ **Framework Templates** (`custom/templates/`):
222
+ - `laravel.md` — Laravel-specific rules and patterns
223
+ - `nextjs.md` — Next.js specific rules
224
+ - etc.
225
+
226
+ ## Data Flow Examples
227
+
228
+ ### Example 1: Load and Prompt
229
+
230
+ ```
231
+ aiflow use JIRA-123
232
+
233
+ [Load from MCP Adapter]
234
+ - Fetch issue from Jira
235
+ - Parse description, criteria
236
+ - Save to .claude/context/current.json
237
+
238
+ aiflow prompt bug-fix
239
+
240
+ [Generate Prompt]
241
+ - Read context from current.json
242
+ - Load bug-fix template
243
+ - Load laravel rules
244
+ - Merge all content
245
+ - Print to console (copy to Claude)
246
+
247
+ Developer copies → Claude Code
248
+
249
+ Claude runs appropriate skill (auto-detected)
250
+ ```
251
+
252
+ ### Example 2: Auto-Detection
253
+
254
+ ```
255
+ Prompt: "We have users reporting that orders aren't saved"
256
+
257
+ aiflow detect "We have users reporting that orders aren't saved"
258
+
259
+ [Analysis]
260
+ Keywords: "orders aren't saved" (bug pattern)
261
+ Type: Bug fix
262
+ Confidence: 95%
263
+
264
+ Output: Use "investigate-bug" skill
265
+
266
+ Claude will follow:
267
+ 1. Understand context
268
+ 2. Trace data flow
269
+ 3. Check git history
270
+ 4. Propose solution
271
+ ```
272
+
273
+ ## Folder Structure
274
+
275
+ ```
276
+ ai-flow-kit/
277
+ ├── bin/
278
+ │ └── aiflow.js # CLI entry point
279
+
280
+ ├── scripts/ # Core functionality
281
+ │ ├── init.js # Initialize project
282
+ │ ├── update.js # Update version
283
+ │ ├── use.js # Load context
284
+ │ ├── detect.js # Detect task type
285
+ │ ├── doctor.js # Health check
286
+ │ ├── validate.js # Validate output
287
+ │ ├── context.js # Context management
288
+ │ ├── config.js # Config loader
289
+ │ └── memory.js # Memory system
290
+
291
+ ├── custom/ # Team customizations
292
+ │ ├── skills/ # Custom skills
293
+ │ │ ├── investigate-bug/
294
+ │ │ ├── impact-analysis/
295
+ │ │ ├── report-customer/
296
+ │ │ └── generate-spec/
297
+ │ ├── rules/ # Team standards
298
+ │ │ ├── code-style.md
299
+ │ │ ├── naming.md
300
+ │ │ └── review-checklist.md
301
+ │ ├── templates/ # Framework rules
302
+ │ │ ├── laravel.md
303
+ │ │ ├── nextjs.md
304
+ │ │ └── vue-nuxt.md
305
+ │ ├── prompts/ # Task templates
306
+ │ │ ├── bug-fix.md
307
+ │ │ ├── feature.md
308
+ │ │ ├── investigation.md
309
+ │ │ └── refactor.md
310
+ │ └── mcp-presets/ # MCP configs
311
+ │ ├── jira.json
312
+ │ ├── backlog.json
313
+ │ └── google-sheets.json
314
+
315
+ ├── upstream/ # Original obra/superpowers
316
+ │ ├── skills/
317
+ │ ├── agents/
318
+ │ └── commands/
319
+
320
+ ├── docs/ # Documentation
321
+ │ ├── architecture.md # This file
322
+ │ ├── getting-started.md
323
+ │ ├── configuration.md
324
+ │ ├── cli-reference.md
325
+ │ ├── workflows/
326
+ │ │ ├── bug-fix.md
327
+ │ │ ├── feature.md
328
+ │ │ ├── investigation.md
329
+ │ │ └── refactor.md
330
+ │ └── troubleshooting.md
331
+
332
+ ├── package.json
333
+ ├── README.md
334
+ ├── CONTRIBUTING.md
335
+ └── .gitignore
336
+ ```
337
+
338
+ ## Customization Points
339
+
340
+ ### Add a Custom Skill
341
+
342
+ 1. Create `custom/skills/my-skill/SKILL.md`
343
+ 2. Follow [skill format](../CONTRIBUTING.md#1-add-a-custom-skill)
344
+ 3. Run `aiflow update` to activate
345
+ 4. Skill appears in `.claude/skills/`
346
+
347
+ ### Add a Rule
348
+
349
+ 1. Create `custom/rules/my-rule.md`
350
+ 2. Describe the rule with examples
351
+ 3. Run `aiflow update`
352
+ 4. Rule appears in prompts via `aiflow prompt`
353
+
354
+ ### Add a Task Type
355
+
356
+ 1. Create `custom/prompts/my-task.md`
357
+ 2. Design template structure
358
+ 3. Run `aiflow update`
359
+ 4. Use with `aiflow prompt my-task`
360
+
361
+ ### Add Framework Support
362
+
363
+ 1. Create `custom/templates/my-framework.md`
364
+ 2. Define framework-specific rules
365
+ 3. Users can: `aiflow init --framework my-framework`
366
+
367
+ ## Extension Points
368
+
369
+ The system is designed to extend:
370
+
371
+ - **Custom skills:** Add domain-specific workflows
372
+ - **Rules:** Add team standards and best practices
373
+ - **Adapters:** Connect to more tools (Linear, GitHub, etc)
374
+ - **Validators:** Check output quality
375
+ - **Plugins:** Custom commands and functionality
376
+
377
+ See [Contributing Guide](../CONTRIBUTING.md) for details.
378
+
379
+ ## Best Practices
380
+
381
+ 1. **Keep upstream separate** — Don't modify `upstream/`. Copy to `custom/` if needed.
382
+
383
+ 2. **Version your customizations** — Track `custom/` in git, not `upstream/`.
384
+
385
+ 3. **Document team rules** — Add to `custom/rules/`. Make them explicit.
386
+
387
+ 4. **Use configuration** — Store team settings in `.aiflowrc.json`.
388
+
389
+ 5. **Test before sharing** — Use `aiflow doctor` and test each contribution.
390
+
391
+ 6. **Share with team** — Version control makes updates easy: `git pull && aiflow update`.
392
+
393
+ ---
394
+
395
+ **Understanding the architecture helps you customize AI Flow Kit for your team's needs!**