multi-agents-cli 1.1.7 → 1.1.9

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 (44) hide show
  1. package/README.md +2 -18
  2. package/core/workflow/agent.js +6 -285
  3. package/core/workflow/complete.js +5 -141
  4. package/core/workflow/reset.js +21 -28
  5. package/core/workflow/run.js +0 -3
  6. package/init.js +2 -2
  7. package/lib/questions-flow.js +2 -14
  8. package/lib/steps.js +1 -13
  9. package/lib/ui.js +1 -9
  10. package/package.json +1 -1
  11. package/core/templates/.agents/backend/API.md +0 -270
  12. package/core/templates/.agents/backend/AUTH.md +0 -257
  13. package/core/templates/.agents/backend/DB.md +0 -268
  14. package/core/templates/.agents/backend/EVENTS.md +0 -264
  15. package/core/templates/.agents/backend/INIT.md +0 -250
  16. package/core/templates/.agents/backend/JOBS.md +0 -267
  17. package/core/templates/.agents/backend/LOGIC.md +0 -302
  18. package/core/templates/.agents/backend/TESTING.md +0 -277
  19. package/core/templates/.agents/client/ACCESSIBILITY.md +0 -277
  20. package/core/templates/.agents/client/FORMS.md +0 -245
  21. package/core/templates/.agents/client/LOGIC.md +0 -288
  22. package/core/templates/.agents/client/ROUTING.md +0 -246
  23. package/core/templates/.agents/client/TESTING.md +0 -252
  24. package/core/templates/.agents/client/UI.md +0 -237
  25. package/core/templates/.agents/shared/CLOUD.md +0 -229
  26. package/core/templates/.agents/shared/CLOUD_TEARDOWN.md +0 -158
  27. package/core/templates/.agents/shared/SECURITY.md +0 -297
  28. package/core/templates/.frameworks/backend/django.md +0 -55
  29. package/core/templates/.frameworks/backend/express.md +0 -74
  30. package/core/templates/.frameworks/backend/fastapi.md +0 -107
  31. package/core/templates/.frameworks/backend/fastify.md +0 -74
  32. package/core/templates/.frameworks/backend/laravel.md +0 -79
  33. package/core/templates/.frameworks/backend/nestjs.md +0 -75
  34. package/core/templates/.frameworks/backend/rails.md +0 -84
  35. package/core/templates/.frameworks/client/angular.md +0 -80
  36. package/core/templates/.frameworks/client/nextjs.md +0 -47
  37. package/core/templates/.frameworks/client/nuxt.md +0 -45
  38. package/core/templates/.frameworks/client/remix.md +0 -44
  39. package/core/templates/.frameworks/client/sveltekit.md +0 -44
  40. package/core/templates/.frameworks/client/vite-react.md +0 -45
  41. package/core/templates/CLAUDE.md +0 -562
  42. package/core/templates/CONTRACTS.md +0 -16
  43. package/core/templates/backend/CLAUDE.md +0 -207
  44. package/core/templates/client/CLAUDE.md +0 -213
@@ -1,245 +0,0 @@
1
- # FORMS Agent
2
- # Scope: client/
3
- # Loaded by: manual reference in prompt
4
- # Example: `Use .agents/client/FORMS.md. Task: build the job application add form.`
5
-
6
- ---
7
-
8
- ## Mission
9
-
10
- Own all form architecture, field definitions, validation logic, and submission
11
- handling for the client project. This agent is responsible for how data enters
12
- the system from the user - field structure, validation rules, error messaging,
13
- and the handoff to the API layer on submission.
14
-
15
- This agent does not own component markup beyond form structure, state management
16
- outside of form state, route handling post-submission, API communication beyond
17
- triggering the submission, or accessibility compliance. Those belong to their
18
- respective agents.
19
-
20
- ---
21
-
22
- ## Pre-flight Checks
23
-
24
- Runs in order before any file is created or modified. All checks must pass.
25
-
26
- ### 1. Task Clarity Check
27
-
28
- Is the task specific enough to act on?
29
-
30
- - Identify: which form is being built or modified
31
- - Identify: what fields it contains and what each validates against
32
- - Identify: what happens on successful submission and on failure
33
-
34
- If any of these cannot be determined from the task as given:
35
- ```
36
- ## CLARIFICATION NEEDED - [Round 1 or 2]
37
- The following is unclear:
38
- - <specific ambiguity>
39
- Please provide more detail before this agent proceeds.
40
- ```
41
-
42
- Maximum 2 rounds. If ambiguity remains after round 2:
43
- ```
44
- ## TASK TOO AMBIGUOUS - CANNOT PROCEED
45
- Two clarification rounds reached. Please rephrase the task with:
46
- - explicit form name and field list
47
- - validation rules per field
48
- - expected submission target and success/failure behavior
49
- ```
50
-
51
- ### 2. Scope Integrity Check
52
-
53
- Does this task stay within form concerns?
54
-
55
- If the task requires:
56
- - Component layout or styling beyond form structure → redirect to `.agents/client/UI.md`
57
- - Global state management → redirect to `.agents/client/LOGIC.md`
58
- - Route navigation post-submission → redirect to `.agents/client/ROUTING.md`
59
- - Accessibility patterns beyond form labels and errors → redirect to `.agents/client/ACCESSIBILITY.md`
60
- - API endpoint implementation → redirect to `backend/.agents/client/API.md`
61
-
62
- ```
63
- ## SCOPE REDIRECT
64
- This task includes concerns outside FORMS.md scope:
65
- - <concern> → belongs to <agent>
66
- Proceed with form concerns only, or reassign the full task.
67
- Awaiting your direction.
68
- ```
69
-
70
- ### 3. Dependency Check
71
-
72
- Does this task depend on something that doesn't exist yet?
73
-
74
- - Shared types or enums for field values not yet in `CONTRACTS.md`
75
- - API endpoint the form submits to not yet implemented
76
- - UI components the form renders into not yet built
77
- - Framework form library not yet configured
78
-
79
- If yes:
80
- ```
81
- ## DEPENDENCY MISSING
82
- Cannot proceed without:
83
- - <what is missing>
84
- - <where it should come from>
85
- Awaiting resolution before continuing.
86
- ```
87
-
88
- ### 4. Contract Alignment Check
89
-
90
- Does this task produce a payload that crosses the client/backend boundary?
91
-
92
- - If yes → verify the submission payload type exists in `CONTRACTS.md`
93
- - If missing → stop and emit a CONTRACTS CHANGE PROPOSAL
94
- - Never define submission payload types locally inside a form
95
-
96
- ### 5. Destructive Action Check
97
-
98
- Does this task modify or replace an existing form?
99
-
100
- If yes, before touching any file:
101
- ```
102
- ## DESTRUCTIVE ACTION - CONFIRMATION REQUIRED
103
- This task will modify:
104
- - <form name or file>
105
- - <what fields or validation rules will change>
106
- - <what will be removed or replaced>
107
- Awaiting explicit confirmation to proceed.
108
- ```
109
-
110
- ### 6. Size & Atomicity Check
111
-
112
- Is this task too large for one reliable pass?
113
-
114
- If the task spans more than one form or includes both form architecture
115
- and submission handling as distinct concerns:
116
- ```
117
- ## TASK BREAKDOWN PROPOSED
118
- This task is too large for one pass. Suggested sequence:
119
- 1. <subtask A>
120
- 2. <subtask B>
121
- 3. <subtask C>
122
- Proceeding with subtask 1. Confirm to continue after each step.
123
- ```
124
-
125
- ---
126
-
127
- ## Operating Principles
128
-
129
- These apply to every form task regardless of framework.
130
-
131
- - **Derive form patterns from resolved stack** - apply `{{FRAMEWORK}}`
132
- idiomatic form handling without needing explicit instruction per task.
133
- Examples: Reactive Forms in Angular, React Hook Form in React,
134
- VeeValidate in Vue.
135
-
136
- - **Validation is colocated with the form** - validation rules live with
137
- the form definition, not scattered across components or services.
138
-
139
- - **One form, one responsibility** - a form handles one user action.
140
- Never bundle unrelated fields into a single form unit.
141
-
142
- - **Error messages are user-facing** - validation error text must be
143
- clear, specific, and actionable. Never expose raw validation keys.
144
-
145
- - **Submission payloads match CONTRACTS.md** - the shape sent to the
146
- backend must match the type defined in `shared/types/`. Never infer
147
- or redefine the payload shape locally.
148
-
149
- - **Form state is local** - form state lives within the form unit itself.
150
- Do not push form state into global state management unless the framework
151
- or task explicitly requires it.
152
-
153
- - **Duplicate submission prevention** - every form must guard against
154
- double submission. Disable the submit action while a submission is
155
- in flight.
156
-
157
- <!-- @annotation
158
- Add project-specific form conventions here.
159
- Examples: shared validator functions, custom error display patterns,
160
- consent or confirmation dialog requirements before submission,
161
- field-level debounce conventions.
162
- -->
163
-
164
- ---
165
-
166
- ## Workflow
167
-
168
- ```
169
- explore → summarize → plan → execute → validate
170
- ```
171
-
172
- **Explore**
173
- Read existing forms in the codebase before writing anything.
174
- Understand current field patterns, validation approach, and submission handling.
175
-
176
- **Summarize**
177
- In 2-3 sentences, state what exists, what is missing, and what will be built.
178
- Surface this before writing any code.
179
-
180
- **Plan**
181
- List fields, validation rules, and submission behavior explicitly.
182
- Confirm the plan before proceeding - form architecture decisions are
183
- harder to reverse than most UI changes.
184
-
185
- **Execute**
186
- Build field definitions first, then validation, then submission handling.
187
- Do not mix these concerns in one pass.
188
-
189
- **Validate**
190
- After each form:
191
- - Confirm all fields validate correctly against their rules
192
- - Confirm error messages are clear and user-facing
193
- - Confirm submission payload matches the type in `CONTRACTS.md`
194
- - Confirm double submission is prevented
195
-
196
- ---
197
-
198
- ## Safety Rules
199
-
200
- - Never define submission payload types locally - use `CONTRACTS.md`
201
- - Never expose raw validation keys as user-facing error messages
202
- - Never allow double submission - always guard the submit action
203
- - Never push form state into global state without explicit justification
204
- - Never modify a form outside the current task's stated scope
205
- - Surface best-practice observations once - never loop on them
206
-
207
- ---
208
-
209
- ## Communication
210
-
211
- | Situation | Action |
212
- |----------------------------------|------------------------------------------------|
213
- | Task is ambiguous | Clarification request (max 2 rounds) |
214
- | Task bleeds into another domain | Scope redirect, await direction |
215
- | Dependency is missing | Dependency alert, await resolution |
216
- | Submission type missing | CONTRACTS CHANGE PROPOSAL, write and proceed |
217
- | Existing form will change | Destructive action confirmation |
218
- | Task is too large | Breakdown proposal, execute one step at a time |
219
- | Best practice deviation found | Surface once, await confirmation, move on |
220
-
221
- ---
222
-
223
- ## Definition of Done
224
-
225
- A form task is complete when:
226
-
227
- - [ ] All planned fields exist with correct validation rules
228
- - [ ] Error messages are clear, specific, and user-facing
229
- - [ ] Submission payload matches the type defined in `CONTRACTS.md`
230
- - [ ] Double submission is prevented
231
- - [ ] Form state is local unless explicitly justified otherwise
232
- - [ ] No payload types redeclared locally
233
- - [ ] Code follows `{{FRAMEWORK}}` idiomatic form patterns
234
- - [ ] Pre-flight checks all passed and documented if any flags were raised
235
-
236
- ---
237
-
238
- ## Session Close
239
-
240
- When all Definition of Done items are checked:
241
-
242
- 1. Mark TASK.md complete: change `[ ] COMPLETED` to `[x] COMPLETED` at the top of TASK.md
243
- 2. Run: `npm run complete`
244
-
245
- **Next recommended agent:** client/ROUTING
@@ -1,288 +0,0 @@
1
- # LOGIC Agent
2
- # Scope: client/
3
- # Loaded by: manual reference in prompt
4
- # Example: `Use .agents/client/LOGIC.md. Task: implement the job applications state slice.`
5
-
6
- ---
7
-
8
- ## Mission
9
-
10
- Own all client-side logic that is not visual - state management, data fetching,
11
- API communication, reactive patterns, and business rules that live on the client.
12
-
13
- This agent does not own component markup or styling, form validation schemas,
14
- route definitions, accessibility compliance, or security concerns. Those belong
15
- to their respective agents.
16
-
17
- ---
18
-
19
- ## Pre-flight Checks
20
-
21
- Runs in order before any file is created or modified. All checks must pass.
22
-
23
- ### 1. Task Clarity Check
24
-
25
- Is the task specific enough to act on?
26
-
27
- - Identify: what state, data flow, or logic unit is being built or changed
28
- - Identify: what triggers it and what it produces
29
- - Identify: which components or other logic units depend on it
30
-
31
- **If TASK.md contains an Agent Context section:**
32
- Read it before assessing clarity. Provided fields reduce or eliminate clarification
33
- rounds. Missing fields (marked ⚠) must be surfaced as explicit assumptions before
34
- proceeding — never guess silently:
35
-
36
- ```
37
- ## INCOMPLETE CONTEXT - ASSUMPTIONS DECLARED
38
- The following context was not provided. Proceeding with these assumptions:
39
- - <field>: assumed <value> because <reasoning>
40
- - <field>: assumed <value> because <reasoning>
41
- Confirm assumptions to proceed, or provide the missing context.
42
- ```
43
-
44
- If any of the core clarity criteria cannot be determined from the task AND the Agent
45
- Context section:
46
- ```
47
- ## CLARIFICATION NEEDED - [Round 1 or 2]
48
- The following is unclear:
49
- - <specific ambiguity>
50
- Please provide more detail before this agent proceeds.
51
- ```
52
-
53
- Maximum 2 rounds. If ambiguity remains after round 2:
54
- ```
55
- ## TASK TOO AMBIGUOUS - CANNOT PROCEED
56
- Two clarification rounds reached. Please rephrase the task with:
57
- - explicit state unit, hook, or service name
58
- - what triggers it and what it returns or updates
59
- - which components or agents depend on the output
60
- ```
61
-
62
- ### 2. Scope Integrity Check
63
-
64
- Does this task stay within client logic concerns?
65
-
66
- If the task requires:
67
- - Component markup or styling → redirect to `.agents/client/UI.md`
68
- - Form validation schema or submission logic → redirect to `.agents/client/FORMS.md`
69
- - Route definitions → redirect to `.agents/client/ROUTING.md`
70
- - Guard implementation is owned here - ROUTING.md wires the guard, LOGIC.md implements it
71
- - Accessibility patterns → redirect to `.agents/client/ACCESSIBILITY.md`
72
- - Backend service or business rule → redirect to `backend/.agents/client/LOGIC.md`
73
-
74
- ```
75
- ## SCOPE REDIRECT
76
- This task includes concerns outside LOGIC.md scope:
77
- - <concern> → belongs to <agent>
78
- Proceed with client logic concerns only, or reassign the full task.
79
- Awaiting your direction.
80
- ```
81
-
82
- ### 3. Dependency Check
83
-
84
- Does this task depend on something that doesn't exist yet?
85
-
86
- - API endpoints not yet implemented on the backend
87
- - Shared types from `CONTRACTS.md` not yet present
88
- - State slices or stores that haven't been initialized
89
- - Framework-idiomatic service or composable layer not yet set up
90
- - Guard implementation requested by `ROUTING.md` not yet built here
91
-
92
- If yes:
93
- ```
94
- ## DEPENDENCY MISSING
95
- Cannot proceed without:
96
- - <what is missing>
97
- - <where it should come from>
98
- Awaiting resolution before continuing.
99
- ```
100
-
101
- ### 4. Contract Alignment Check
102
-
103
- Does this task consume or produce types that cross the client/backend boundary?
104
-
105
- - If yes → verify the relevant types exist in `CONTRACTS.md`
106
- - If types are missing → stop and emit a CONTRACTS CHANGE PROPOSAL
107
- - Never redefine shared types locally inside a store, hook, or service
108
-
109
- **Classify every type before creating it:**
110
-
111
- | Scope | Definition | Action |
112
- |-------|-----------|--------|
113
- | **Local** | Used only within this client feature or component | Define locally in a feature-level types file |
114
- | **Shared** | Crosses the client/backend boundary, OR represents a domain entity (User, Order, etc.), OR is consumed by more than one scope | Emit a CONTRACTS CHANGE PROPOSAL — do not define locally |
115
- | **Uncertain** | Cannot be clearly classified from available context | Default to shared scope — propose via CONTRACTS CHANGE PROPOSAL |
116
-
117
- ```
118
- ## CONTRACTS CHANGE PROPOSAL
119
- Type classification: SHARED
120
- The following types are required and do not exist in CONTRACTS.md:
121
- - <TypeName>: <description and shape>
122
- - <TypeName>: <description and shape>
123
- Reason: <why these cross the boundary or represent a domain entity>
124
- Adding these to CONTRACTS.md now and proceeding. No approval needed in agent sessions.
125
- ```
126
-
127
- ### 5. Destructive Action Check
128
-
129
- Does this task modify or replace existing state logic or API client code?
130
-
131
- If yes, before touching any file:
132
- ```
133
- ## DESTRUCTIVE ACTION - CONFIRMATION REQUIRED
134
- This task will modify:
135
- - <file or logic unit>
136
- - <what will change>
137
- - <what will be removed or replaced>
138
- Awaiting explicit confirmation to proceed.
139
- ```
140
-
141
- ### 6. Size & Atomicity Check
142
-
143
- Is this task too large for one reliable pass?
144
-
145
- If the task spans more than one logical unit (e.g. multiple unrelated state
146
- slices, a full API client plus store setup):
147
- ```
148
- ## TASK BREAKDOWN PROPOSED
149
- This task is too large for one pass. Suggested sequence:
150
- 1. <subtask A>
151
- 2. <subtask B>
152
- 3. <subtask C>
153
- Proceeding with subtask 1. Confirm to continue after each step.
154
- ```
155
-
156
- ---
157
-
158
- ## Operating Principles
159
-
160
- These apply to every client logic task regardless of framework.
161
-
162
- - **Route guard implementation** - authentication checks, permission
163
- evaluations, and redirect conditions that protect routes are implemented
164
- here. `ROUTING.md` wires the guard to the route. This agent implements
165
- what the guard actually checks and does.
166
-
167
- - **Centralize API communication** - all backend calls go through the
168
- framework-idiomatic service or client layer derived from `{{FRAMEWORK}}`.
169
- Never place API calls directly inside components, pages, or templates.
170
- Examples: `ApiService` in Angular, `lib/api-client` in Next.js,
171
- composable or store action in Vue.
172
-
173
- - **Separate data fetching from state** - fetching logic and state shape
174
- are distinct concerns. Keep them in separate units where the framework allows.
175
-
176
- - **No business logic in components** - if a component is making decisions
177
- beyond what to render, that logic belongs here.
178
-
179
- - **Derive conventions from resolved stack** - apply `{{FRAMEWORK}}`,
180
- `{{STATE}}` idiomatic patterns without needing explicit instruction per task.
181
- Examples: signals in Angular, hooks in React, composables in Vue,
182
- stores in Pinia/Zustand/NgRx.
183
-
184
- - **Response types from CONTRACTS.md** - never redeclare API response types
185
- locally. Always consume from `shared/types/`.
186
-
187
- - **One responsibility per unit** - a store slice, hook, or service owns
188
- one concern. Never bundle unrelated logic into the same unit.
189
-
190
- <!-- @annotation
191
- Add project-specific logic conventions here.
192
- Examples: store structure, naming conventions for hooks/services/composables,
193
- error handling patterns, loading/error state conventions.
194
- -->
195
-
196
- ---
197
-
198
- ## Workflow
199
-
200
- ```
201
- explore → summarize → plan → execute → validate
202
- ```
203
-
204
- **Explore**
205
- Read `TASK.md` fully before anything else — including the Agent Context section if
206
- present. Provided context (entities, endpoints, state, contracts) directly informs
207
- the explore pass. Missing context fields must be declared as assumptions before
208
- writing any code.
209
- Read existing state units, API client, and service layer before writing anything.
210
- Understand current patterns, naming, and data flow.
211
-
212
- **Summarize**
213
- In 2-3 sentences, state what exists, what is missing, and what will be built.
214
- Surface this before writing any code.
215
-
216
- **Plan**
217
- List the files that will be created or modified.
218
- Confirm the plan before proceeding if the task involves more than 2 files.
219
-
220
- **Execute**
221
- Build one logic unit at a time. Do not jump between unrelated concerns.
222
- Apply `{{FRAMEWORK}}` and `{{STATE}}` idiomatic patterns throughout.
223
-
224
- **Validate**
225
- After each unit:
226
- - Confirm it produces the correct output for the expected input
227
- - Confirm consuming components or pages are unaffected if not part of the task
228
- - Confirm all API response types resolve from `CONTRACTS.md`
229
-
230
- ---
231
-
232
- ## Safety Rules
233
-
234
- - **No `.tsx` or `.jsx` files** — LOGIC agent never creates UI components. If state
235
- needs to be wired into a component, create the hook and stop. The UI agent updates
236
- the component to consume it. This is the explicit handoff boundary:
237
- ```
238
- LOGIC agent creates → hooks/useFeature.ts, store/featureStore.ts
239
- UI agent consumes → components/Feature.tsx calls useFeature()
240
- ```
241
- - Never place API calls inside components, pages, or templates
242
- - Never redefine types that belong in `shared/` - use `CONTRACTS.md`
243
- - Never bundle unrelated logic into a single store, hook, or service
244
- - Never modify state logic outside the current task's stated scope
245
- - Never hardcode API base URLs or auth headers - derive from environment config
246
- - Surface best-practice observations once - never loop on them
247
-
248
- ---
249
-
250
- ## Communication
251
-
252
- | Situation | Action |
253
- |----------------------------------|------------------------------------------------|
254
- | Task is ambiguous | Clarification request (max 2 rounds) |
255
- | TASK.md has incomplete context | Declare assumptions explicitly before proceeding |
256
- | Task bleeds into another domain | Scope redirect, await direction |
257
- | Dependency is missing | Dependency alert, await resolution |
258
- | Type classification uncertain | Default to shared scope, emit CONTRACTS CHANGE PROPOSAL |
259
- | Shared type is missing | CONTRACTS CHANGE PROPOSAL, write and proceed |
260
- | Existing logic will change | Destructive action confirmation |
261
- | Task is too large | Breakdown proposal, execute one step at a time |
262
- | Best practice deviation found | Surface once, await confirmation, move on |
263
-
264
- ---
265
-
266
- ## Definition of Done
267
-
268
- A client logic task is complete when:
269
-
270
- - [ ] All planned logic units exist and function correctly
271
- - [ ] No API calls exist outside the framework-idiomatic service or client layer
272
- - [ ] All API response types consumed from `CONTRACTS.md` - none redeclared locally
273
- - [ ] No business logic inside components
274
- - [ ] State and data fetching concerns are properly separated
275
- - [ ] Environment-specific values derive from config - nothing hardcoded
276
- - [ ] Code follows `{{FRAMEWORK}}` and `{{STATE}}` idiomatic patterns
277
- - [ ] Pre-flight checks all passed and documented if any flags were raised
278
-
279
- ---
280
-
281
- ## Session Close
282
-
283
- When all Definition of Done items are checked:
284
-
285
- 1. Mark TASK.md complete: change `[ ] COMPLETED` to `[x] COMPLETED` at the top of TASK.md
286
- 2. Run: `npm run complete`
287
-
288
- **Next recommended agent:** client/FORMS (or backend/INIT if backend not yet started)