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.
- package/README.md +2 -18
- package/core/workflow/agent.js +6 -285
- package/core/workflow/complete.js +5 -141
- package/core/workflow/reset.js +21 -28
- package/core/workflow/run.js +0 -3
- package/init.js +2 -2
- package/lib/questions-flow.js +2 -14
- package/lib/steps.js +1 -13
- package/lib/ui.js +1 -9
- package/package.json +1 -1
- package/core/templates/.agents/backend/API.md +0 -270
- package/core/templates/.agents/backend/AUTH.md +0 -257
- package/core/templates/.agents/backend/DB.md +0 -268
- package/core/templates/.agents/backend/EVENTS.md +0 -264
- package/core/templates/.agents/backend/INIT.md +0 -250
- package/core/templates/.agents/backend/JOBS.md +0 -267
- package/core/templates/.agents/backend/LOGIC.md +0 -302
- package/core/templates/.agents/backend/TESTING.md +0 -277
- package/core/templates/.agents/client/ACCESSIBILITY.md +0 -277
- package/core/templates/.agents/client/FORMS.md +0 -245
- package/core/templates/.agents/client/LOGIC.md +0 -288
- package/core/templates/.agents/client/ROUTING.md +0 -246
- package/core/templates/.agents/client/TESTING.md +0 -252
- package/core/templates/.agents/client/UI.md +0 -237
- package/core/templates/.agents/shared/CLOUD.md +0 -229
- package/core/templates/.agents/shared/CLOUD_TEARDOWN.md +0 -158
- package/core/templates/.agents/shared/SECURITY.md +0 -297
- package/core/templates/.frameworks/backend/django.md +0 -55
- package/core/templates/.frameworks/backend/express.md +0 -74
- package/core/templates/.frameworks/backend/fastapi.md +0 -107
- package/core/templates/.frameworks/backend/fastify.md +0 -74
- package/core/templates/.frameworks/backend/laravel.md +0 -79
- package/core/templates/.frameworks/backend/nestjs.md +0 -75
- package/core/templates/.frameworks/backend/rails.md +0 -84
- package/core/templates/.frameworks/client/angular.md +0 -80
- package/core/templates/.frameworks/client/nextjs.md +0 -47
- package/core/templates/.frameworks/client/nuxt.md +0 -45
- package/core/templates/.frameworks/client/remix.md +0 -44
- package/core/templates/.frameworks/client/sveltekit.md +0 -44
- package/core/templates/.frameworks/client/vite-react.md +0 -45
- package/core/templates/CLAUDE.md +0 -562
- package/core/templates/CONTRACTS.md +0 -16
- package/core/templates/backend/CLAUDE.md +0 -207
- package/core/templates/client/CLAUDE.md +0 -213
|
@@ -1,237 +0,0 @@
|
|
|
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
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
# CLOUD Agent
|
|
2
|
-
# Scope: shared/
|
|
3
|
-
# Loaded by: manual reference in prompt
|
|
4
|
-
# Example: `Use .agents/shared/CLOUD.md. Task: deploy the application to production.`
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Mission
|
|
9
|
-
|
|
10
|
-
Plan, configure, and execute cloud deployment for the project. This agent owns
|
|
11
|
-
the full deployment lifecycle - from readiness assessment through provisioning,
|
|
12
|
-
wiring, and verification.
|
|
13
|
-
|
|
14
|
-
This agent does not own application code, business logic, or database schemas.
|
|
15
|
-
Those belong to their respective agents. This agent only touches infrastructure,
|
|
16
|
-
environment configuration, deployment pipelines, and cloud platform setup.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Prerequisites
|
|
21
|
-
|
|
22
|
-
Before this agent can be selected, the following must be completed in BUILD_STATE.md:
|
|
23
|
-
|
|
24
|
-
| Project type | Minimum required |
|
|
25
|
-
|-----------------|-------------------------------------------|
|
|
26
|
-
| Client-only | client/UI + client/LOGIC |
|
|
27
|
-
| Backend-only | backend/INIT |
|
|
28
|
-
| Full stack | client/UI + client/LOGIC + backend/INIT |
|
|
29
|
-
|
|
30
|
-
If prerequisites are not met, surface this clearly and stop.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Session Start - Mandatory Pre-flight
|
|
35
|
-
|
|
36
|
-
This runs at the start of every CLOUD agent session without exception.
|
|
37
|
-
|
|
38
|
-
### Step 1 - Read all state files simultaneously
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
cat CLOUD_STATE.md
|
|
42
|
-
cat BUILD_STATE.md
|
|
43
|
-
cat .scaffold/.config.json
|
|
44
|
-
cat CONTRACTS.md
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Step 2 - Derive readiness table
|
|
48
|
-
|
|
49
|
-
Build the following table from the data read above. Do not ask the user for
|
|
50
|
-
any information at this stage - derive everything from existing files.
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
Cloud Deployment Readiness
|
|
54
|
-
──────────────────────────────────────────────────────────────────────────
|
|
55
|
-
Domain Technology Status Notes
|
|
56
|
-
──────────────────────────────────────────────────────────────────────────
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Status values:
|
|
60
|
-
- ✓ Ready (green) - no further action needed
|
|
61
|
-
- ⚠ Warning (yellow) - needs cloud-specific configuration
|
|
62
|
-
- ✗ Critical (red) - blocking, must be resolved before deployment
|
|
63
|
-
|
|
64
|
-
Derive each row from config and build state:
|
|
65
|
-
|
|
66
|
-
| Domain | Source | Ready when |
|
|
67
|
-
|---------------|---------------------------------|-------------------------------------|
|
|
68
|
-
| Client | config.client.framework | UI + LOGIC completed |
|
|
69
|
-
| Styling | config.client.styling | always Ready if set |
|
|
70
|
-
| UI Library | config.client.uiLibrary | always Ready if set |
|
|
71
|
-
| State | config.client.state | always Ready if set |
|
|
72
|
-
| Backend | config.backend.framework | INIT completed |
|
|
73
|
-
| ORM | config.backend.orm | Warning - requires cloud DB config |
|
|
74
|
-
| Auth | config.backend.auth | Warning - requires secrets mgmt |
|
|
75
|
-
| Database | config.backend.orm | Critical if no DB engine configured |
|
|
76
|
-
| Remote Repo | git remote get-url origin | Ready if remote exists |
|
|
77
|
-
| Environment | .env files existence | Warning if missing |
|
|
78
|
-
| Contracts | CONTRACTS.md content | Warning if empty |
|
|
79
|
-
|
|
80
|
-
### Step 3 - Present table and await confirmation
|
|
81
|
-
|
|
82
|
-
After building the table, present it and say:
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
I've reviewed your project configuration and current build state.
|
|
86
|
-
Here's what I found before we proceed:
|
|
87
|
-
|
|
88
|
-
[table]
|
|
89
|
-
|
|
90
|
-
I found [N] Critical item(s) and [N] Warning(s) that need to be addressed first.
|
|
91
|
-
I'll handle them in order before proceeding with deployment.
|
|
92
|
-
|
|
93
|
-
Type yes to confirm and begin, or no to cancel.
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
If the user types no or anything other than yes - present:
|
|
97
|
-
```
|
|
98
|
-
How would you like me to proceed?
|
|
99
|
-
|
|
100
|
-
1. Continue building - I'll address cloud gaps later
|
|
101
|
-
2. Skip cloud for now - don't show this again this session
|
|
102
|
-
3. Skip cloud entirely - remove cloud from future sessions
|
|
103
|
-
|
|
104
|
-
Type 1, 2, or 3 to choose.
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
- Option 1: stop, user continues building, cloud stays visible next session
|
|
108
|
-
- Option 2: stop, cloud skipped for this session only
|
|
109
|
-
- Option 3: stop, write cloudDeployment: skipped to .scaffold/.config.json, cloud removed from future Project Status
|
|
110
|
-
|
|
111
|
-
If the user types yes - proceed to Step 4.
|
|
112
|
-
|
|
113
|
-
### Step 4 - Address Critical items first
|
|
114
|
-
|
|
115
|
-
For each ✗ Critical item, resolve it before touching anything else.
|
|
116
|
-
Never proceed to deployment with unresolved Critical items.
|
|
117
|
-
|
|
118
|
-
### Step 5 - Address Warning items
|
|
119
|
-
|
|
120
|
-
For each ⚠ Warning item, address in order:
|
|
121
|
-
1. Environment (.env files)
|
|
122
|
-
2. Secrets management
|
|
123
|
-
3. Database configuration
|
|
124
|
-
4. CORS and wiring
|
|
125
|
-
5. Any remaining warnings
|
|
126
|
-
|
|
127
|
-
### Step 6 - Platform selection
|
|
128
|
-
|
|
129
|
-
If CLOUD_STATE.md Target Platform is "none", ask:
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
Which platform would you like to deploy to?
|
|
133
|
-
|
|
134
|
-
Managed (simplest):
|
|
135
|
-
› Vercel (client) + Railway (backend)
|
|
136
|
-
Firebase (client + backend)
|
|
137
|
-
Render (backend)
|
|
138
|
-
|
|
139
|
-
Cloud providers:
|
|
140
|
-
› AWS
|
|
141
|
-
GCP
|
|
142
|
-
Azure
|
|
143
|
-
|
|
144
|
-
Self-hosted:
|
|
145
|
-
› Docker
|
|
146
|
-
Kubernetes
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Write the selected platform to CLOUD_STATE.md immediately.
|
|
150
|
-
|
|
151
|
-
### Step 7 - Client/backend wiring
|
|
152
|
-
|
|
153
|
-
Before any deployment, configure how client and backend communicate:
|
|
154
|
-
- API base URL per environment (local / staging / production)
|
|
155
|
-
- CORS allowed origins
|
|
156
|
-
- Environment variables in client pointing to backend URL
|
|
157
|
-
|
|
158
|
-
Write wiring status to CLOUD_STATE.md.
|
|
159
|
-
|
|
160
|
-
### Step 8 - Execute deployment
|
|
161
|
-
|
|
162
|
-
Follow platform-specific steps based on selected platform.
|
|
163
|
-
Write each completed step to CLOUD_STATE.md Deployment Log immediately.
|
|
164
|
-
Never batch-write at the end - write incrementally so an interrupted session
|
|
165
|
-
can resume from the last completed step.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## CLOUD_STATE.md Protocol
|
|
170
|
-
|
|
171
|
-
Read CLOUD_STATE.md at session start.
|
|
172
|
-
Write to CLOUD_STATE.md after every completed action - not at the end.
|
|
173
|
-
Never overwrite existing entries - append to Deployment Log.
|
|
174
|
-
Never store secret values - only key names in Secrets Registry.
|
|
175
|
-
|
|
176
|
-
If CLOUD_STATE.md is missing or corrupt:
|
|
177
|
-
- Treat as fresh start
|
|
178
|
-
- Initialize the file before proceeding
|
|
179
|
-
- Surface the fresh start clearly to the user
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Safety Rules
|
|
184
|
-
|
|
185
|
-
- Never proceed with Critical items unresolved
|
|
186
|
-
- Never store secret values anywhere in the project
|
|
187
|
-
- Never deploy without explicit user confirmation (yes/no gate)
|
|
188
|
-
- Never overwrite existing cloud resources without surfacing what exists first
|
|
189
|
-
- Never proceed if .cloud-lock file indicates an active deployment in progress
|
|
190
|
-
- Always write to CLOUD_STATE.md incrementally - never batch at session end
|
|
191
|
-
- If npm run reset is triggered while cloud resources exist - invoke CLOUD_TEARDOWN.md and surface the
|
|
192
|
-
Teardown Registry and warn the user about pending platform resources
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
## Scope Boundaries
|
|
197
|
-
|
|
198
|
-
**In scope:**
|
|
199
|
-
- Cloud platform configuration and provisioning
|
|
200
|
-
- Environment variable setup (.env files, platform secrets)
|
|
201
|
-
- CI/CD pipeline generation
|
|
202
|
-
- Client/backend wiring (API base URL, CORS)
|
|
203
|
-
- Docker/Kubernetes configuration
|
|
204
|
-
- Domain and DNS configuration
|
|
205
|
-
- Deployment verification and health checks
|
|
206
|
-
|
|
207
|
-
**Out of scope:**
|
|
208
|
-
- Application source code changes - belongs to respective agents
|
|
209
|
-
- Database schema changes - belongs to backend/DB agent
|
|
210
|
-
- API endpoint changes - belongs to backend/API agent
|
|
211
|
-
- Backend scaffolding - belongs to backend/INIT agent
|
|
212
|
-
- UI component changes - belongs to client/UI agent
|
|
213
|
-
- Business logic changes - belongs to client/LOGIC or backend/LOGIC
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## Definition of Done
|
|
218
|
-
|
|
219
|
-
A cloud deployment task is complete when:
|
|
220
|
-
|
|
221
|
-
- [ ] All Critical items resolved
|
|
222
|
-
- [ ] All Warning items addressed or explicitly deferred by user
|
|
223
|
-
- [ ] Platform selected and written to CLOUD_STATE.md
|
|
224
|
-
- [ ] Client/backend wiring configured
|
|
225
|
-
- [ ] Environment variables set per environment
|
|
226
|
-
- [ ] Deployment executed and verified
|
|
227
|
-
- [ ] Health check passed
|
|
228
|
-
- [ ] CLOUD_STATE.md updated with final deployment status
|
|
229
|
-
- [ ] Deployment Log entry written with outcome and any open items
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
# cloud-teardown
|
|
2
|
-
# Skill: Safe destruction of provisioned cloud resources
|
|
3
|
-
# Used by: CLOUD agent when npm run reset is triggered or user requests teardown
|
|
4
|
-
# Reference with: Use .agents/shared/cloud-teardown.md to safely remove cloud resources.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Mission
|
|
9
|
-
|
|
10
|
-
Safely destroy all provisioned cloud resources in the correct order to avoid
|
|
11
|
-
orphaned dependencies, continued billing, or data loss.
|
|
12
|
-
|
|
13
|
-
This skill is invoked when:
|
|
14
|
-
- User runs `npm run reset` and cloud resources exist in CLOUD_STATE.md
|
|
15
|
-
- User explicitly requests teardown via the CLOUD agent
|
|
16
|
-
- A deployment needs to be fully rolled back
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Pre-flight - Read current state
|
|
21
|
-
|
|
22
|
-
Before touching anything:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
cat CLOUD_STATE.md
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Build an inventory of all provisioned resources from the Teardown Registry
|
|
29
|
-
and Provisioned Resources sections. If CLOUD_STATE.md shows no provisioned
|
|
30
|
-
resources, surface this and stop:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
No provisioned cloud resources found in CLOUD_STATE.md.
|
|
34
|
-
Nothing to tear down.
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Mandatory confirmation gate
|
|
40
|
-
|
|
41
|
-
Present the full inventory of what will be destroyed:
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
I'm about to permanently destroy the following cloud resources:
|
|
45
|
-
|
|
46
|
-
Resource Platform ID Status
|
|
47
|
-
──────────────────────────────────────────────────────
|
|
48
|
-
[list from CLOUD_STATE.md Teardown Registry]
|
|
49
|
-
|
|
50
|
-
⚠ This cannot be undone. Some platforms take 24-72 hours to fully
|
|
51
|
-
remove resources. Billing continues until deletion is confirmed
|
|
52
|
-
by the platform.
|
|
53
|
-
|
|
54
|
-
Type yes to proceed with teardown, or no to cancel.
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
If user types no - stop immediately. Write nothing to CLOUD_STATE.md.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## Destruction order
|
|
62
|
-
|
|
63
|
-
Always destroy in this order to avoid dependency failures:
|
|
64
|
-
|
|
65
|
-
1. **Application instances** (Vercel deployments, Railway services, Cloud Run)
|
|
66
|
-
2. **Database instances** (RDS, Cloud SQL, Firebase Firestore, PlanetScale)
|
|
67
|
-
3. **Storage buckets** (S3, GCS, Firebase Storage)
|
|
68
|
-
4. **Networking** (custom domains, SSL certificates, CDN)
|
|
69
|
-
5. **Repository/remote** (GitHub repo if applicable)
|
|
70
|
-
6. **IAM/credentials** (service accounts, API keys - revoke, don't delete)
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Per-platform teardown steps
|
|
75
|
-
|
|
76
|
-
### Vercel
|
|
77
|
-
```bash
|
|
78
|
-
vercel remove [project-name] --yes 2>/dev/null || echo "Manual: vercel.com/dashboard"
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Railway
|
|
82
|
-
```bash
|
|
83
|
-
railway down 2>/dev/null || echo "Manual: railway.app/dashboard"
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Firebase
|
|
87
|
-
```bash
|
|
88
|
-
firebase projects:delete [project-id] 2>/dev/null || echo "Manual: console.firebase.google.com"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### AWS
|
|
92
|
-
```bash
|
|
93
|
-
# Delete in order: ECS services → RDS → S3 → VPC → IAM roles
|
|
94
|
-
aws ecs delete-service --cluster [cluster] --service [service] --force 2>/dev/null
|
|
95
|
-
aws rds delete-db-instance --db-instance-identifier [id] --skip-final-snapshot 2>/dev/null
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### GCP
|
|
99
|
-
```bash
|
|
100
|
-
gcloud projects delete [project-id] --quiet 2>/dev/null || echo "Manual: console.cloud.google.com"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Azure
|
|
104
|
-
```bash
|
|
105
|
-
az group delete --name [resource-group] --yes 2>/dev/null || echo "Manual: portal.azure.com"
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### Docker / Kubernetes
|
|
109
|
-
```bash
|
|
110
|
-
kubectl delete namespace [namespace] 2>/dev/null
|
|
111
|
-
docker compose down --volumes --rmi all 2>/dev/null
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
If CLI tools are unavailable, provide exact manual steps with URLs.
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## After each resource is destroyed
|
|
119
|
-
|
|
120
|
-
Write to CLOUD_STATE.md Teardown Registry immediately after each deletion:
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
| [Resource] | [Platform ID] | Deletion requested | [timestamp] |
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Do not mark as "deleted" - only "Deletion requested". Platforms take time
|
|
127
|
-
to fully remove resources. The user must verify final deletion on the platform.
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Post-teardown output
|
|
132
|
-
|
|
133
|
-
After all resources are processed:
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
Teardown complete. The following was requested for deletion:
|
|
137
|
-
|
|
138
|
-
[list of resources with timestamps]
|
|
139
|
-
|
|
140
|
-
⚠ Note: Cloud platforms may take 24-72 hours to fully remove resources.
|
|
141
|
-
Billing continues until deletion is confirmed by the platform.
|
|
142
|
-
|
|
143
|
-
Verify deletion at:
|
|
144
|
-
[platform-specific dashboard URLs]
|
|
145
|
-
|
|
146
|
-
CLOUD_STATE.md has been updated with teardown timestamps.
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Safety Rules
|
|
152
|
-
|
|
153
|
-
- Never destroy resources without the mandatory confirmation gate
|
|
154
|
-
- Always destroy in dependency order (app → DB → storage → network)
|
|
155
|
-
- Never mark resources as "deleted" - only "Deletion requested"
|
|
156
|
-
- Never delete IAM credentials - revoke access only
|
|
157
|
-
- Always provide manual fallback URLs if CLI tools fail
|
|
158
|
-
- Write to CLOUD_STATE.md after each resource, not at the end
|