@aiconstructions/claude-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,230 @@
1
+ # Workflow Orchestration
2
+
3
+ ## Project structure
4
+ ```
5
+ <%= projectName %>/
6
+ <% if (modules.mobile) { -%>
7
+ <%- modules.web || modules.backend ? '├──' : '└──' %> <%= projectName %>-Front/ ← <%-
8
+ mobileFramework === 'expo-rn-nativewind'
9
+ ? 'Expo + React Native + NativeWind (iOS + Android)'
10
+ : 'Flutter (iOS + Android)'
11
+ %>
12
+ <% } -%>
13
+ <% if (modules.web) { -%>
14
+ <%- modules.backend ? '├──' : '└──' %> <%= projectName %>-Web/ ← <%-
15
+ ({
16
+ 'react-vite-tailwind': 'React + Vite + Tailwind CSS',
17
+ 'nextjs': 'Next.js',
18
+ 'nuxtjs': 'Nuxt.js',
19
+ 'svelte': 'SvelteKit'
20
+ })[webFramework]
21
+ %>
22
+ <% } -%>
23
+ <% if (modules.backend) { -%>
24
+ └── <%= projectName %>-Back/ ← <%-
25
+ ({
26
+ 'fastapi-sqlalchemy': 'Python + FastAPI + SQLAlchemy + Alembic + PostgreSQL',
27
+ 'django': 'Python + Django + PostgreSQL',
28
+ 'express': 'Node.js + Express',
29
+ 'nestjs': 'Node.js + NestJS'
30
+ })[backendFramework]
31
+ %>
32
+ <% } -%>
33
+ ```
34
+
35
+ ## 1. Plan Mode Default
36
+ - Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
37
+ - If something goes sideways, STOP and re-plan immediately — don't keep pushing
38
+ - Use plan mode for verification steps, not just building
39
+ - Write detailed specs upfront to reduce ambiguity
40
+
41
+ ## 2. Subagent Strategy
42
+
43
+ You are the **Manager Agent** — orchestrate, never implement directly.
44
+ When a task arrives: identify domain → spawn relevant agents in parallel → synthesize.
45
+
46
+ ### Agent roster
47
+ <%
48
+ const agents = [
49
+ { name: 'manager', file: '.claude/agents/manager.md', scope: 'Orchestration, delegation, synthesis', modifies: 'No', always: true },
50
+ { name: 'planner', file: '.claude/agents/planner.md', scope: 'Architecture, contracts, implementation plans', modifies: 'No (plans only)', always: true },
51
+ ];
52
+ if (modules.backend) {
53
+ const backendScopes = {
54
+ 'fastapi-sqlalchemy': 'FastAPI, SQLAlchemy, Alembic, Auth (JWT), API contracts',
55
+ 'django': 'Django, Django ORM, Auth, API contracts',
56
+ 'express': 'Express, TypeORM/Prisma, Auth (JWT), API contracts',
57
+ 'nestjs': 'NestJS, TypeORM/Prisma, Auth (JWT), API contracts'
58
+ };
59
+ agents.push({ name: 'backend', file: '.claude/agents/backend.md', scope: backendScopes[backendFramework], modifies: 'Yes', always: false });
60
+ }
61
+ if (modules.mobile || modules.web) {
62
+ const parts = [];
63
+ if (modules.mobile) parts.push(mobileFramework === 'expo-rn-nativewind' ? 'Expo, React Native, NativeWind' : 'Flutter');
64
+ if (modules.web) parts.push(({
65
+ 'react-vite-tailwind': 'React, Vite, Tailwind CSS',
66
+ 'nextjs': 'Next.js',
67
+ 'nuxtjs': 'Nuxt.js',
68
+ 'svelte': 'SvelteKit'
69
+ })[webFramework]);
70
+ agents.push({ name: 'frontend', file: '.claude/agents/frontend.md', scope: parts.join(', ') + ', Design', modifies: 'Yes', always: false });
71
+ }
72
+ if (modules.mobile) {
73
+ agents.push({ name: 'offline', file: '.claude/agents/offline.md', scope: 'SQLite, sync, pending actions, cache, ID resolution', modifies: 'Yes', always: false });
74
+ }
75
+ agents.push(
76
+ { name: 'security', file: '.claude/agents/security.md', scope: 'OWASP audits, JWT review, infra audit, dependencies', modifies: 'No (read-only)', always: true },
77
+ { name: 'qa', file: '.claude/agents/qa.md', scope: 'Testing, contract validation, performance profiling', modifies: 'Yes (tests)', always: true },
78
+ { name: 'analyzer', file: '.claude/agents/analyzer.md', scope: 'Code review, codebase mapping, contract validation', modifies: 'No (read-only)', always: true }
79
+ );
80
+ if (integrations.cicd) {
81
+ const cicdScope = integrations.aws ? 'GitHub Actions, AWS infra (EC2/RDS/S3/CloudFront/SSM)' : 'GitHub Actions, CI/CD pipelines';
82
+ agents.push({ name: 'cicd', file: '.claude/agents/cicd.md', scope: cicdScope, modifies: 'Yes', always: false });
83
+ }
84
+ agents.push({ name: 'git', file: '.claude/agents/git.md', scope: 'Commits, branches, PRs, changelogs', modifies: 'Yes (git ops)', always: true });
85
+ if (integrations.asana) {
86
+ agents.push({ name: 'asana', file: '.claude/agents/asana.md', scope: 'Task creation, status sync, board management', modifies: 'Yes (Asana)', always: false });
87
+ }
88
+ if (integrations.n8n) {
89
+ agents.push({ name: 'n8n', file: '.claude/agents/n8n.md', scope: 'Workflows, webhooks, automation deploy, monitoring', modifies: 'Yes', always: false });
90
+ }
91
+ -%>
92
+
93
+ | Agent | File | Scope | Modifies code? |
94
+ |-------|------|-------|----------------|
95
+ <% for (const a of agents) { -%>
96
+ | **<%= a.name %>** | `<%= a.file %>` | <%= a.scope %> | <%= a.modifies %> |
97
+ <% } -%>
98
+
99
+ ### Domain routing
100
+
101
+ | Task type | Agents (in order) |
102
+ |-----------|-------------------|
103
+ <% if (modules.backend && (modules.mobile || modules.web)) { -%>
104
+ | New feature (full stack) | analyzer → planner → backend + frontend (parallel) → qa → security |
105
+ <% } -%>
106
+ <% if (modules.backend) { -%>
107
+ | Backend only | analyzer → planner → backend → qa → security |
108
+ <% } -%>
109
+ <% if (modules.mobile) { -%>
110
+ | Frontend / mobile only | analyzer → planner → frontend → qa |
111
+ <% } -%>
112
+ <% if (modules.web) { -%>
113
+ | Web only | analyzer → planner → frontend → qa |
114
+ <% } -%>
115
+ | Bug fix | analyzer → <%- modules.backend ? 'backend and/or ' : '' %><%- (modules.mobile || modules.web) ? 'frontend' : '' %> → qa |
116
+ <% if (modules.backend) { -%>
117
+ | Database / migration | analyzer → backend → qa |
118
+ | Auth / JWT change | security first → planner → backend → qa |
119
+ <% } -%>
120
+ <% if (integrations.cicd) { -%>
121
+ | Deploy / infra change | cicd → security |
122
+ <% } -%>
123
+ <% if (modules.mobile && integrations.cicd) { -%>
124
+ | Mobile release | cicd (app stores) → security |
125
+ <% } -%>
126
+ <% if (modules.mobile) { -%>
127
+ | Offline / sync change | analyzer → offline → qa |
128
+ <% } -%>
129
+ | Performance issue | qa (performance mode) → <%- modules.backend ? 'backend and/or ' : '' %><%- (modules.mobile || modules.web) ? 'frontend' : '' %> |
130
+ <% if (modules.backend && (modules.mobile || modules.web)) { -%>
131
+ | Contract mismatch | analyzer (contract mode) → backend and/or frontend |
132
+ <% } -%>
133
+ <% if (integrations.n8n) { -%>
134
+ | Automation / webhook | n8n → security (credential review) |
135
+ <% } -%>
136
+ | Git operation | git |
137
+ <% if (integrations.asana) { -%>
138
+ | Project management | asana |
139
+ <% } -%>
140
+
141
+ ### Invocation protocol
142
+ 1. Task received → identify domain(s)
143
+ 2. Spawn all agents from that domain as **parallel subagents**
144
+ 3. Each subagent reads: own `.md` + `AGENT_CONTEXT.md` + relevant context file
145
+ 4. Collect outputs → resolve conflicts → unified response to user
146
+ 5. Update `AGENT_CONTEXT.md` at end of session
147
+
148
+ ### Communication between agents (async via files)
149
+ <% if (modules.backend) { -%>
150
+ - Backend writes API contracts → `.claude/context/api-spec.md`
151
+ <% } -%>
152
+ <% if (modules.mobile || modules.web) { -%>
153
+ - Frontend reads contracts → builds against spec, never assumptions
154
+ <% } -%>
155
+ <% if (integrations.cicd) { -%>
156
+ - CICD writes resource state → `.claude/context/infra-state.md`
157
+ <% } -%>
158
+ - QA writes test results → `.claude/context/test-report.md`
159
+ - Analyzer writes findings → `.claude/context/analysis-report.md`
160
+ - Security reads everything flagged, writes findings inline with severity tags
161
+
162
+ ### When to invoke Security agent
163
+ Always spawn Security alongside other agents when task touches:
164
+ - Any auth endpoint or JWT handling
165
+ <% if (integrations.aws) { -%>
166
+ - New IAM role, SSM parameter, or secret
167
+ <% } -%>
168
+ - New third-party package/dependency
169
+ <% if (integrations.aws) { -%>
170
+ - S3 upload or user-generated content
171
+ - Any change to EC2 security groups or RDS access
172
+ <% } -%>
173
+ - User data changes affecting privacy/compliance
174
+
175
+ ### Skills to leverage
176
+ <% if (plugins.superpowers) { -%>
177
+ - `/superpowers:brainstorm` — before any architectural decision
178
+ - `/superpowers:write-plan` — multi-file or multi-agent tasks
179
+ - `/superpowers:execute-plan` — batch implementation with checkpoints
180
+ <% } -%>
181
+ <% if (plugins.gsd) { -%>
182
+ - `/gsd:new-feature` — spec-driven feature scoping end-to-end
183
+ - `/gsd:new-project` — only when bootstrapping a new sub-project from scratch
184
+ <% } -%>
185
+ <% if (plugins.uiUxProMax && (modules.mobile || modules.web)) { -%>
186
+ - `/ui-ux-pro-max` — design intelligence before any UI work
187
+ <% } -%>
188
+
189
+ ## 3. Self-Improvement Loop
190
+ - After ANY correction from the user: update `tasks/lessons.md` with the pattern
191
+ - Write rules for yourself that prevent the same mistake
192
+ - Ruthlessly iterate on these lessons until mistake rate drops
193
+ - Review lessons at session start for relevant project
194
+
195
+ ## 4. Verification Before Done
196
+ - Never mark a task complete without proving it works. Compiling isn't enough.
197
+ - Diff behavior between main and your changes when relevant
198
+ - Ask yourself: "Would a staff engineer approve this?"
199
+ - Create new tests to verify the fix. Run tests, check logs, demonstrate correctness
200
+
201
+ ## 5. Demand Elegance (Balanced)
202
+ - For non-trivial changes: pause and ask "is there a more elegant way?"
203
+ - If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
204
+ - Skip this for simple, obvious fixes — don't over-engineer
205
+ - Challenge your own work before presenting it
206
+
207
+ ## 6. Autonomous Bug Fixing
208
+ - When given a bug report: just fix it. Don't ask for hand-holding
209
+ - Point at logs, errors, failing tests — then resolve them
210
+ - Zero context switching required from the user
211
+ - Go fix failing CI tests without being told how
212
+
213
+ ---
214
+
215
+ # Task Management
216
+
217
+ 1. **Plan First**: Write plan to `tasks/todo.md` with checkable items
218
+ 2. **Verify Plan**: Check in before starting implementation
219
+ 3. **Track Progress**: Mark items complete as you go
220
+ 4. **Explain Changes**: High-level summary at each step
221
+ 5. **Document Results**: Add review section to `tasks/todo.md`
222
+ 6. **Capture Lessons**: Update `tasks/lessons.md` after corrections
223
+
224
+ ---
225
+
226
+ # Core Principles
227
+
228
+ - **Simplicity First**: Make every change as simple as possible. Impact minimal code.
229
+ - **No Laziness**: Find root causes. No temporary fixes. Senior developer standards.
230
+ - **Minimal Impact**: Changes should only touch what's necessary. Avoid introducing bugs.