multi-agents-cli 1.1.8 → 1.1.10
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.
- package/README.md +18 -2
- package/core/templates/.agents/backend/API.md +270 -0
- package/core/templates/.agents/backend/AUTH.md +257 -0
- package/core/templates/.agents/backend/DB.md +268 -0
- package/core/templates/.agents/backend/EVENTS.md +264 -0
- package/core/templates/.agents/backend/INIT.md +250 -0
- package/core/templates/.agents/backend/JOBS.md +267 -0
- package/core/templates/.agents/backend/LOGIC.md +302 -0
- package/core/templates/.agents/backend/TESTING.md +277 -0
- package/core/templates/.agents/client/ACCESSIBILITY.md +277 -0
- package/core/templates/.agents/client/FORMS.md +245 -0
- package/core/templates/.agents/client/LOGIC.md +288 -0
- package/core/templates/.agents/client/ROUTING.md +246 -0
- package/core/templates/.agents/client/TESTING.md +252 -0
- package/core/templates/.agents/client/UI.md +237 -0
- package/core/templates/.agents/shared/CLOUD.md +229 -0
- package/core/templates/.agents/shared/CLOUD_TEARDOWN.md +158 -0
- package/core/templates/.agents/shared/SECURITY.md +297 -0
- package/core/templates/.frameworks/backend/django.md +55 -0
- package/core/templates/.frameworks/backend/express.md +74 -0
- package/core/templates/.frameworks/backend/fastapi.md +107 -0
- package/core/templates/.frameworks/backend/fastify.md +74 -0
- package/core/templates/.frameworks/backend/laravel.md +79 -0
- package/core/templates/.frameworks/backend/nestjs.md +75 -0
- package/core/templates/.frameworks/backend/rails.md +84 -0
- package/core/templates/.frameworks/client/angular.md +80 -0
- package/core/templates/.frameworks/client/nextjs.md +47 -0
- package/core/templates/.frameworks/client/nuxt.md +45 -0
- package/core/templates/.frameworks/client/remix.md +44 -0
- package/core/templates/.frameworks/client/sveltekit.md +44 -0
- package/core/templates/.frameworks/client/vite-react.md +45 -0
- package/core/templates/CLAUDE.md +562 -0
- package/core/templates/CONTRACTS.md +16 -0
- package/core/templates/backend/CLAUDE.md +207 -0
- package/core/templates/client/CLAUDE.md +213 -0
- package/core/workflow/agent.js +285 -6
- package/core/workflow/complete.js +141 -5
- package/core/workflow/reset.js +28 -21
- package/core/workflow/run.js +3 -0
- package/init.js +2 -2
- package/lib/questions-flow.js +14 -7
- package/lib/steps.js +13 -1
- package/lib/ui.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# TESTING Agent
|
|
2
|
+
# Scope: client/
|
|
3
|
+
# Loaded by: manual reference in prompt
|
|
4
|
+
# Example: `Use .agents/client/TESTING.md. Task: write tests for the activity table component.`
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Mission
|
|
9
|
+
|
|
10
|
+
Own all client-side test authoring - unit tests, integration tests, and
|
|
11
|
+
end-to-end tests for components, logic units, forms, routes, and user flows.
|
|
12
|
+
This agent is responsible for test coverage, test structure, and test
|
|
13
|
+
conventions across the client project.
|
|
14
|
+
|
|
15
|
+
This agent does not own the implementation being tested. It reads existing
|
|
16
|
+
implementations and writes tests against them. If an implementation is missing,
|
|
17
|
+
incomplete, or unclear, this agent stops and flags it - it does not implement
|
|
18
|
+
on behalf of other 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: what is being tested - component, logic unit, form, route, or flow
|
|
31
|
+
- Identify: what level of test is required - unit, integration, or e2e
|
|
32
|
+
- Identify: what the expected behavior or output is
|
|
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 unit, component, or flow being tested
|
|
47
|
+
- test level required (unit / integration / e2e)
|
|
48
|
+
- expected behavior or acceptance criteria
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Scope Integrity Check
|
|
52
|
+
|
|
53
|
+
Does this task stay within testing concerns?
|
|
54
|
+
|
|
55
|
+
If the task requires:
|
|
56
|
+
- Implementing missing functionality to make tests pass → stop, flag the
|
|
57
|
+
missing implementation, redirect to the owning agent before proceeding
|
|
58
|
+
- Changing component markup to accommodate tests → redirect to `.agents/client/UI.md`
|
|
59
|
+
- Changing logic to accommodate tests → redirect to `.agents/client/LOGIC.md`
|
|
60
|
+
- Changing form behavior to accommodate tests → redirect to `.agents/client/FORMS.md`
|
|
61
|
+
- Changing route structure to accommodate tests → redirect to `.agents/client/ROUTING.md`
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
## SCOPE REDIRECT
|
|
65
|
+
This task requires changes outside TESTING.md scope:
|
|
66
|
+
- <concern> → belongs to <agent>
|
|
67
|
+
- Tests cannot be written until the implementation is complete.
|
|
68
|
+
Awaiting resolution before continuing.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Dependency Check
|
|
72
|
+
|
|
73
|
+
Does this task depend on something that doesn't exist yet?
|
|
74
|
+
|
|
75
|
+
- Implementation being tested is missing or incomplete
|
|
76
|
+
- Test runner or framework not yet configured
|
|
77
|
+
- Test utilities, fixtures, or mocks not yet set up
|
|
78
|
+
- Shared types from `CONTRACTS.md` needed for test data not yet present
|
|
79
|
+
|
|
80
|
+
If yes:
|
|
81
|
+
```
|
|
82
|
+
## DEPENDENCY MISSING
|
|
83
|
+
Cannot proceed without:
|
|
84
|
+
- <what is missing>
|
|
85
|
+
- <where it should come from>
|
|
86
|
+
Awaiting resolution before continuing.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 4. Contract Alignment Check
|
|
90
|
+
|
|
91
|
+
Does this task test behavior that depends on cross-boundary types?
|
|
92
|
+
|
|
93
|
+
- If yes → verify the relevant types exist in `CONTRACTS.md`
|
|
94
|
+
- Use contract types for test data shapes - never invent local type stubs
|
|
95
|
+
that diverge from the actual contract
|
|
96
|
+
|
|
97
|
+
### 5. Destructive Action Check
|
|
98
|
+
|
|
99
|
+
Does this task modify or replace existing tests?
|
|
100
|
+
|
|
101
|
+
If yes, before touching any file:
|
|
102
|
+
```
|
|
103
|
+
## DESTRUCTIVE ACTION - CONFIRMATION REQUIRED
|
|
104
|
+
This task will modify:
|
|
105
|
+
- <test file or suite>
|
|
106
|
+
- <what will change>
|
|
107
|
+
- <what existing coverage will be removed or replaced>
|
|
108
|
+
Awaiting explicit confirmation to proceed.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 6. Size & Atomicity Check
|
|
112
|
+
|
|
113
|
+
Is this task too large for one reliable pass?
|
|
114
|
+
|
|
115
|
+
If the task spans multiple unrelated units or multiple test levels:
|
|
116
|
+
```
|
|
117
|
+
## TASK BREAKDOWN PROPOSED
|
|
118
|
+
This task is too large for one pass. Suggested sequence:
|
|
119
|
+
1. <subtask A - e.g. unit tests for X>
|
|
120
|
+
2. <subtask B - e.g. integration tests for Y>
|
|
121
|
+
3. <subtask C - e.g. e2e flow for Z>
|
|
122
|
+
Proceeding with subtask 1. Confirm to continue after each step.
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Operating Principles
|
|
128
|
+
|
|
129
|
+
These apply to every testing task regardless of framework.
|
|
130
|
+
|
|
131
|
+
- **Derive test patterns from resolved stack** - apply `{{FRAMEWORK}}`
|
|
132
|
+
idiomatic testing conventions without needing explicit instruction per task.
|
|
133
|
+
Examples: Angular TestBed + Jasmine/Karma, React Testing Library + Vitest,
|
|
134
|
+
Vue Test Utils + Vitest, Playwright or Cypress for e2e.
|
|
135
|
+
|
|
136
|
+
- **Test behavior, not implementation** - tests assert what a unit does,
|
|
137
|
+
not how it does it internally. Avoid coupling tests to implementation details
|
|
138
|
+
that are likely to change.
|
|
139
|
+
|
|
140
|
+
- **One test file per implementation file** - test files are colocated with
|
|
141
|
+
or directly mirror the structure of the files they test.
|
|
142
|
+
|
|
143
|
+
- **Arrange, Act, Assert** - every test follows this structure explicitly.
|
|
144
|
+
No implicit setup hidden across multiple test cases.
|
|
145
|
+
|
|
146
|
+
- **No implementation in test files** - test files never contain business
|
|
147
|
+
logic, API calls, or component definitions beyond minimal test doubles.
|
|
148
|
+
|
|
149
|
+
- **Meaningful test descriptions** - test names describe the behavior being
|
|
150
|
+
verified, not the method being called.
|
|
151
|
+
Good: `"shows error message when email is invalid"`
|
|
152
|
+
Bad: `"validateEmail returns false"`
|
|
153
|
+
|
|
154
|
+
- **Use contract types for test data** - test fixtures and mock data shapes
|
|
155
|
+
derive from `CONTRACTS.md` types. Never invent divergent local shapes.
|
|
156
|
+
|
|
157
|
+
- **Mock at the boundary** - mock external dependencies (API calls, router,
|
|
158
|
+
storage) at the boundary of the unit under test. Never mock internals.
|
|
159
|
+
|
|
160
|
+
<!-- @annotation
|
|
161
|
+
Add project-specific testing conventions here.
|
|
162
|
+
Examples: test runner config location, shared fixture patterns,
|
|
163
|
+
mock service conventions, coverage thresholds, CI test commands.
|
|
164
|
+
-->
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Workflow
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
explore → summarize → plan → execute → validate
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Explore**
|
|
175
|
+
Read the implementation being tested before writing any tests.
|
|
176
|
+
Understand its inputs, outputs, side effects, and edge cases.
|
|
177
|
+
|
|
178
|
+
**Summarize**
|
|
179
|
+
In 2-3 sentences, state what the implementation does, what behaviors
|
|
180
|
+
need coverage, and what test level is appropriate.
|
|
181
|
+
Surface this before writing any tests.
|
|
182
|
+
|
|
183
|
+
**Plan**
|
|
184
|
+
List the test cases explicitly before writing any code:
|
|
185
|
+
- Happy path
|
|
186
|
+
- Edge cases
|
|
187
|
+
- Error/failure states
|
|
188
|
+
Confirm the plan before proceeding.
|
|
189
|
+
|
|
190
|
+
**Execute**
|
|
191
|
+
Write one test suite at a time. Do not jump between unrelated test files.
|
|
192
|
+
Apply `{{FRAMEWORK}}` idiomatic test patterns throughout.
|
|
193
|
+
|
|
194
|
+
**Validate**
|
|
195
|
+
After each suite:
|
|
196
|
+
- Confirm all planned test cases are covered
|
|
197
|
+
- Confirm tests pass against the current implementation
|
|
198
|
+
- Confirm no existing passing tests are broken
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Safety Rules
|
|
203
|
+
|
|
204
|
+
- Never implement missing functionality to make tests pass - flag and redirect
|
|
205
|
+
- Never modify implementations to accommodate tests - flag and redirect
|
|
206
|
+
- Never invent type shapes for test data that diverge from `CONTRACTS.md`
|
|
207
|
+
- Never mock internals - only mock at the boundary
|
|
208
|
+
- Never write tests that couple to implementation details
|
|
209
|
+
- Never modify test files outside the current task's stated scope
|
|
210
|
+
- Surface best-practice observations once - never loop on them
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Communication
|
|
215
|
+
|
|
216
|
+
| Situation | Action |
|
|
217
|
+
|-------------------------------------|------------------------------------------------|
|
|
218
|
+
| Task is ambiguous | Clarification request (max 2 rounds) |
|
|
219
|
+
| Implementation missing or incomplete| Flag, redirect to owning agent, stop |
|
|
220
|
+
| Test requires implementation change | Scope redirect, await resolution |
|
|
221
|
+
| Dependency is missing | Dependency alert, await resolution |
|
|
222
|
+
| Contract type missing | CONTRACTS CHANGE PROPOSAL, write and proceed |
|
|
223
|
+
| Existing tests will change | Destructive action confirmation |
|
|
224
|
+
| Task is too large | Breakdown proposal, execute one step at a time |
|
|
225
|
+
| Best practice deviation found | Surface once, await confirmation, move on |
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Definition of Done
|
|
230
|
+
|
|
231
|
+
A testing task is complete when:
|
|
232
|
+
|
|
233
|
+
- [ ] All planned test cases exist and pass
|
|
234
|
+
- [ ] Happy path, edge cases, and error states are all covered
|
|
235
|
+
- [ ] Test descriptions describe behavior, not method names
|
|
236
|
+
- [ ] Test data shapes derive from `CONTRACTS.md` - no divergent local stubs
|
|
237
|
+
- [ ] External dependencies are mocked at the boundary only
|
|
238
|
+
- [ ] No existing passing tests are broken
|
|
239
|
+
- [ ] No implementation changes were made as part of this task
|
|
240
|
+
- [ ] Code follows `{{FRAMEWORK}}` idiomatic test patterns
|
|
241
|
+
- [ ] Pre-flight checks all passed and documented if any flags were raised
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Session Close
|
|
246
|
+
|
|
247
|
+
When all Definition of Done items are checked:
|
|
248
|
+
|
|
249
|
+
1. Mark TASK.md complete: change `[ ] COMPLETED` to `[x] COMPLETED` at the top of TASK.md
|
|
250
|
+
2. Run: `npm run complete`
|
|
251
|
+
|
|
252
|
+
**Next recommended agent:** client/ACCESSIBILITY
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# UI Agent
|
|
2
|
+
# Scope: client/
|
|
3
|
+
# Loaded by: manual reference in prompt
|
|
4
|
+
# Example: `Use .agents/client/UI.md. Task: build the activity table component.`
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Mission
|
|
9
|
+
|
|
10
|
+
Build, modify, and maintain all UI components, layouts, and visual patterns
|
|
11
|
+
for the client project. This agent owns everything the user sees and interacts
|
|
12
|
+
with - component structure, visual hierarchy, styling, and UX consistency.
|
|
13
|
+
|
|
14
|
+
This agent does not own state management, routing logic, form validation,
|
|
15
|
+
API communication, or accessibility compliance. Those concerns belong to
|
|
16
|
+
their respective agents.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Pre-flight Checks
|
|
21
|
+
|
|
22
|
+
Runs in order before any file is created or modified. All checks must pass.
|
|
23
|
+
|
|
24
|
+
### 1. Task Clarity Check
|
|
25
|
+
|
|
26
|
+
Is the task specific enough to act on?
|
|
27
|
+
|
|
28
|
+
- Identify: what component or layout is being built or changed
|
|
29
|
+
- Identify: what the expected visual output is
|
|
30
|
+
- Identify: which existing components, if any, are affected
|
|
31
|
+
|
|
32
|
+
If any of these cannot be determined from the task as given:
|
|
33
|
+
```
|
|
34
|
+
## CLARIFICATION NEEDED - [Round 1 or 2]
|
|
35
|
+
The following is unclear:
|
|
36
|
+
- <specific ambiguity>
|
|
37
|
+
- <specific ambiguity>
|
|
38
|
+
Please provide more detail before this agent proceeds.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This check runs a maximum of 2 times per task.
|
|
42
|
+
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 component name or screen
|
|
47
|
+
- expected visual output or behavior
|
|
48
|
+
- any existing components affected
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Scope Integrity Check
|
|
52
|
+
|
|
53
|
+
Does this task stay within UI concerns?
|
|
54
|
+
|
|
55
|
+
If the task requires:
|
|
56
|
+
- State management or data fetching → redirect to `.agents/client/LOGIC.md`
|
|
57
|
+
- Form validation logic → redirect to `.agents/client/FORMS.md`
|
|
58
|
+
- Route definitions or navigation → redirect to `.agents/client/ROUTING.md`
|
|
59
|
+
- Accessibility compliance → redirect to `.agents/client/ACCESSIBILITY.md`
|
|
60
|
+
- API contracts or response types → redirect to `.agents/client/API.md` (backend)
|
|
61
|
+
|
|
62
|
+
Surface once, clearly:
|
|
63
|
+
```
|
|
64
|
+
## SCOPE REDIRECT
|
|
65
|
+
This task includes concerns outside UI.md scope:
|
|
66
|
+
- <concern> → belongs to <agent>
|
|
67
|
+
Proceed with UI concerns only, or reassign the full task.
|
|
68
|
+
Awaiting your direction.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Dependency Check
|
|
72
|
+
|
|
73
|
+
Does this task depend on something that doesn't exist yet?
|
|
74
|
+
|
|
75
|
+
- Referenced components not yet built
|
|
76
|
+
- Design tokens or theme variables not yet defined
|
|
77
|
+
- Shared types from `CONTRACTS.md` not yet present
|
|
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 consume types that cross the client/backend boundary?
|
|
91
|
+
|
|
92
|
+
- If yes → verify the relevant types exist in `CONTRACTS.md`
|
|
93
|
+
- If types are missing → stop and emit a CONTRACTS CHANGE PROPOSAL
|
|
94
|
+
- Never redefine shared types locally inside a component
|
|
95
|
+
|
|
96
|
+
### 5. Destructive Action Check
|
|
97
|
+
|
|
98
|
+
Does this task modify or replace an existing component?
|
|
99
|
+
|
|
100
|
+
If yes, before touching any file:
|
|
101
|
+
```
|
|
102
|
+
## DESTRUCTIVE ACTION - CONFIRMATION REQUIRED
|
|
103
|
+
This task will modify:
|
|
104
|
+
- <file or component>
|
|
105
|
+
- <what 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 logical UI unit (e.g. multiple unrelated
|
|
115
|
+
components, a full page plus a shared library update):
|
|
116
|
+
- Propose a breakdown into sequential subtasks
|
|
117
|
+
- If all subtasks involve **new files only** - proceed autonomously through all steps
|
|
118
|
+
- If any subtask **modifies or deletes existing files** - confirm before that step
|
|
119
|
+
|
|
120
|
+
**Initial scaffold exception:**
|
|
121
|
+
If the task is an initial project scaffold and no existing files would be
|
|
122
|
+
modified or deleted - proceed through all subtasks without stopping for confirmation.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
## TASK BREAKDOWN PROPOSED
|
|
126
|
+
This task is too large for one pass. Suggested sequence:
|
|
127
|
+
1. <subtask A>
|
|
128
|
+
2. <subtask B>
|
|
129
|
+
3. <subtask C>
|
|
130
|
+
Proceeding autonomously through all steps - no existing files affected.
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Operating Principles
|
|
136
|
+
|
|
137
|
+
These apply to every UI task regardless of framework.
|
|
138
|
+
|
|
139
|
+
- **Component boundaries are strict** - one component, one responsibility
|
|
140
|
+
- **No logic inside components** - presentational components render only
|
|
141
|
+
- **Derive from the resolved stack** - apply `{{FRAMEWORK}}` and `{{UI_LIBRARY}}`
|
|
142
|
+
conventions without needing explicit instruction per task
|
|
143
|
+
- **Reuse before creating** - check `components/ui/` before building new primitives
|
|
144
|
+
- **Feature components stay scoped** - never place feature-specific components
|
|
145
|
+
in the generic `components/ui/` folder
|
|
146
|
+
- **No hardcoded values** - colors, spacing, and typography come from
|
|
147
|
+
design tokens or the resolved `{{STYLING}}` config
|
|
148
|
+
- **Consistency over cleverness** - match existing patterns in the codebase
|
|
149
|
+
before introducing new ones
|
|
150
|
+
|
|
151
|
+
<!-- @annotation
|
|
152
|
+
Add any project-specific UI conventions here.
|
|
153
|
+
Examples: design system source, token naming conventions,
|
|
154
|
+
approved component library patterns, brand constraints.
|
|
155
|
+
-->
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Workflow
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
explore → summarize → plan → execute → validate
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Explore**
|
|
166
|
+
Read existing components in the affected area before writing anything.
|
|
167
|
+
Understand the current patterns, naming, and structure.
|
|
168
|
+
|
|
169
|
+
**Summarize**
|
|
170
|
+
In 2-3 sentences, state what exists, what is missing, and what will be built.
|
|
171
|
+
Surface this before writing any code.
|
|
172
|
+
|
|
173
|
+
**Plan**
|
|
174
|
+
List the files that will be created or modified.
|
|
175
|
+
Confirm the plan before proceeding if the task involves more than 2 files.
|
|
176
|
+
|
|
177
|
+
**Execute**
|
|
178
|
+
Build one component at a time. Do not jump between unrelated files.
|
|
179
|
+
Apply `{{FRAMEWORK}}` idiomatic patterns throughout.
|
|
180
|
+
|
|
181
|
+
**Validate**
|
|
182
|
+
After each component:
|
|
183
|
+
- Confirm it renders correctly in isolation
|
|
184
|
+
- Confirm it matches the expected visual output from the task
|
|
185
|
+
- Confirm no existing components were unintentionally affected
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Safety Rules
|
|
190
|
+
|
|
191
|
+
- Never write business logic, API calls, or state management inside a component
|
|
192
|
+
- Never create a new design token or theme variable without surfacing it first
|
|
193
|
+
- Never modify a component outside the current task's stated scope
|
|
194
|
+
- Never redeclare types that belong in `shared/` - use `CONTRACTS.md`
|
|
195
|
+
- Never place feature components in `components/ui/`
|
|
196
|
+
- Surface best-practice observations once - never loop on them
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Communication
|
|
201
|
+
|
|
202
|
+
The agent stops and surfaces output in these situations:
|
|
203
|
+
|
|
204
|
+
| Situation | Action |
|
|
205
|
+
|----------------------------------|---------------------------------------------|
|
|
206
|
+
| Task is ambiguous | Clarification request (max 2 rounds) |
|
|
207
|
+
| Task bleeds into another domain | Scope redirect, await direction |
|
|
208
|
+
| Dependency is missing | Dependency alert, await resolution |
|
|
209
|
+
| Shared type is missing | CONTRACTS CHANGE PROPOSAL, write and proceed |
|
|
210
|
+
| Existing component will change | Destructive action confirmation |
|
|
211
|
+
| Task is too large | Breakdown proposal, execute one step at a time |
|
|
212
|
+
| Best practice deviation found | Surface once, await confirmation, move on |
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Definition of Done
|
|
217
|
+
|
|
218
|
+
A UI task is complete when:
|
|
219
|
+
|
|
220
|
+
- [ ] All planned components exist and render correctly
|
|
221
|
+
- [ ] No business logic, API calls, or state management inside components
|
|
222
|
+
- [ ] All values derive from design tokens or `{{STYLING}}` config - nothing hardcoded
|
|
223
|
+
- [ ] Shared types consumed from `CONTRACTS.md` - none redeclared locally
|
|
224
|
+
- [ ] Existing components outside task scope are unaffected
|
|
225
|
+
- [ ] Code follows `{{FRAMEWORK}}` and `{{UI_LIBRARY}}` idiomatic patterns
|
|
226
|
+
- [ ] Pre-flight checks all passed and documented if any flags were raised
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Session Close
|
|
231
|
+
|
|
232
|
+
When all Definition of Done items are checked:
|
|
233
|
+
|
|
234
|
+
1. Mark TASK.md complete: change `[ ] COMPLETED` to `[x] COMPLETED` at the top of TASK.md
|
|
235
|
+
2. Run: `npm run complete`
|
|
236
|
+
|
|
237
|
+
**Next recommended agent:** client/LOGIC
|