multi-agents-cli 1.0.51 → 1.0.53

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/core/templates/.agents/backend/API.md +259 -0
  2. package/core/templates/.agents/backend/AUTH.md +246 -0
  3. package/core/templates/.agents/backend/DB.md +257 -0
  4. package/core/templates/.agents/backend/EVENTS.md +253 -0
  5. package/core/templates/.agents/backend/INIT.md +239 -0
  6. package/core/templates/.agents/backend/JOBS.md +256 -0
  7. package/core/templates/.agents/backend/LOGIC.md +291 -0
  8. package/core/templates/.agents/backend/TESTING.md +266 -0
  9. package/core/templates/.agents/client/ACCESSIBILITY.md +266 -0
  10. package/core/templates/.agents/client/FORMS.md +234 -0
  11. package/core/templates/.agents/client/LOGIC.md +277 -0
  12. package/core/templates/.agents/client/ROUTING.md +235 -0
  13. package/core/templates/.agents/client/TESTING.md +241 -0
  14. package/core/templates/.agents/client/UI.md +226 -0
  15. package/core/templates/.agents/shared/CLOUD.md +229 -0
  16. package/core/templates/.agents/shared/CLOUD_TEARDOWN.md +158 -0
  17. package/core/templates/.agents/shared/SECURITY.md +286 -0
  18. package/core/templates/.frameworks/backend/django.md +55 -0
  19. package/core/templates/.frameworks/backend/express.md +74 -0
  20. package/core/templates/.frameworks/backend/fastapi.md +107 -0
  21. package/core/templates/.frameworks/backend/fastify.md +74 -0
  22. package/core/templates/.frameworks/backend/nestjs.md +75 -0
  23. package/core/templates/.frameworks/client/angular.md +80 -0
  24. package/core/templates/.frameworks/client/nextjs.md +47 -0
  25. package/core/templates/.frameworks/client/nuxt.md +45 -0
  26. package/core/templates/.frameworks/client/remix.md +44 -0
  27. package/core/templates/.frameworks/client/sveltekit.md +44 -0
  28. package/core/templates/.frameworks/client/vite-react.md +45 -0
  29. package/core/templates/CLAUDE.md +531 -0
  30. package/core/templates/CLOUD_STATE.md +55 -0
  31. package/core/templates/CONTRACTS.md +16 -0
  32. package/core/templates/TASKS_HISTORY.md +6 -0
  33. package/core/templates/backend/CLAUDE.md +207 -0
  34. package/core/templates/client/CLAUDE.md +213 -0
  35. package/core/templates/shared/.gitkeep +0 -0
  36. package/core/templates/shared/wiring.config.json +14 -0
  37. package/core/workflow/agent.js +1404 -0
  38. package/core/workflow/complete.js +354 -0
  39. package/core/workflow/guards.js +643 -0
  40. package/core/workflow/reset.js +246 -0
  41. package/core/workflow/restart.js +243 -0
  42. package/core/workflow/tasks_history.js +120 -0
  43. package/init.js +35 -32
  44. package/package.json +2 -1
@@ -0,0 +1,207 @@
1
+ # {{PROJECT_NAME}} - Backend Agent Instructions
2
+ #
3
+ # ╔══════════════════════════════════════════════════════════════════╗
4
+ # ║ @config BLOCK ║
5
+ # ║ Audited before every task. Missing required values = hard stop. ║
6
+ # ║ Confirmed values are written back here immediately. ║
7
+ # ╚══════════════════════════════════════════════════════════════════╝
8
+ #
9
+ # @config PROJECT_NAME : ← [required]
10
+ # @config FRAMEWORK : ← [required if LANGUAGE blank] e.g. NestJS, Django, Laravel
11
+ # @config FRAMEWORK_VERSION : ← [optional] e.g. 11, 10 — set at init time
12
+ # @config FRAMEWORK_VERSION : ← [optional] e.g. 11, 10 — set at init time
13
+ # @config LANGUAGE : ← [required if FRAMEWORK blank] e.g. TypeScript, Python, C#
14
+ # @config ORM : ← [optional] derived from FRAMEWORK if blank
15
+ # @config AUTH : ← [optional] derived from FRAMEWORK if blank
16
+ #
17
+ # ── Write-back rule ─────────────────────────────────────────────────
18
+ # Every confirmed config value must be written into its @config line
19
+ # above before the agent proceeds. No exceptions.
20
+ # ────────────────────────────────────────────────────────────────────
21
+ #
22
+ # Inherits from root CLAUDE.md. Do not duplicate global rules here.
23
+
24
+ ---
25
+
26
+ ## Config Audit
27
+
28
+ Runs before any task, exploration, or code. No exceptions.
29
+
30
+ ### Resolution priority
31
+
32
+ ```
33
+ FRAMEWORK set → language derived from it. Proceed.
34
+ FRAMEWORK blank, LANGUAGE set → trigger Level 2 framework proposal.
35
+ FRAMEWORK blank, LANGUAGE blank → hard stop.
36
+ PROJECT_NAME blank → hard stop.
37
+ ```
38
+
39
+ ### Required configs
40
+
41
+ | @config | Rule | If missing |
42
+ |--------------|----------------------------------------------------|--------------------------- |
43
+ | PROJECT_NAME | Must always be set | Hard stop |
44
+ | FRAMEWORK | Must be set, OR LANGUAGE must be set to resolve it | See resolution priority |
45
+ | LANGUAGE | Required only if FRAMEWORK is blank | Hard stop if both are blank |
46
+
47
+ ### Optional configs
48
+
49
+ | @config | Derives from | Triggers when |
50
+ |---------|---------------------------------------|--------------------------------|
51
+ | ORM | FRAMEWORK first, LANGUAGE as fallback | Any database or migration task |
52
+ | AUTH | FRAMEWORK first, LANGUAGE as fallback | Any auth, guard, or token task |
53
+
54
+ When FRAMEWORK strongly implies a default (e.g. Django → Django ORM),
55
+ the agent surfaces that default for confirmation rather than proposing a full list.
56
+ If FRAMEWORK is agnostic, agent proposes up to 3 options derived from LANGUAGE.
57
+
58
+ ### Hard stop alert
59
+
60
+ ```
61
+ ## CONFIG AUDIT FAILED - CANNOT PROCEED
62
+
63
+ Missing:
64
+ [ ] @config PROJECT_NAME - agent cannot scope output without it.
65
+ [ ] @config FRAMEWORK / LANGUAGE - at least one required.
66
+ No code can be written without either.
67
+
68
+ Open this file, fill in the missing values, and restart the task.
69
+ ```
70
+
71
+ Only list what is actually missing.
72
+
73
+ ### Optional config alert
74
+
75
+ ```
76
+ ## CONFIG INCOMPLETE - LIMITED PROCEED
77
+
78
+ @config {{TOKEN}} is not set. This affects:
79
+ - <specific consequence for this task>
80
+
81
+ Derived recommendation (from @config FRAMEWORK / LANGUAGE):
82
+ → <recommended value and one-line reason>
83
+
84
+ Options:
85
+ 1. Accept - agent writes to @config and proceeds
86
+ 2. Override - agent offers up to 3 alternatives, waits for selection
87
+ 3. Skip - agent marks affected decisions as <!-- @unresolved --> and continues
88
+
89
+ Awaiting your choice.
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Stack Resolution
95
+
96
+ Runs after Config Audit passes.
97
+
98
+ ### Level 1 - Framework set
99
+ Use it directly. Language is derived. Proceed.
100
+
101
+ ### Level 2 - Language set, framework blank
102
+
103
+ ```
104
+ ## FRAMEWORK SELECTION REQUIRED
105
+ Language : {{LANGUAGE}}
106
+ Options :
107
+ 1. <Framework A> - <one-line reason>
108
+ 2. <Framework B> - <one-line reason>
109
+ 3. <Framework C> - <one-line reason>
110
+ Awaiting : selection - agent writes confirmed value to @config FRAMEWORK
111
+ ```
112
+
113
+ ### Level 3 - Both blank
114
+ Hard stop. Config Audit already surfaced the alert.
115
+
116
+ **Rules:**
117
+ - Surface each proposal once. Never repeat.
118
+ - Do not infer stack from existing code - confirm if config is missing.
119
+ - Write every confirmed value back to its `@config` line before proceeding.
120
+
121
+ ---
122
+
123
+ ## Framework Scaffold Instructions
124
+
125
+ Before scaffolding ANY project structure, read the framework-specific instruction file:
126
+
127
+ ```
128
+ .frameworks/backend/{{FRAMEWORK_FILE}}
129
+ ```
130
+
131
+ Where `{{FRAMEWORK_FILE}}` maps to:
132
+ - Express → `express.md`
133
+ - NestJS → `nestjs.md`
134
+ - Fastify → `fastify.md`
135
+ - FastAPI → `fastapi.md`
136
+ - Django → `django.md`
137
+
138
+ The file contains:
139
+ - Exact scaffold command and flags
140
+ - Where to run it (always from repo root)
141
+ - Expected directory structure after scaffold
142
+ - How to recover if files land in the wrong location
143
+ - How to update `.scaffold/.paths.json` after scaffold
144
+
145
+ **This is mandatory before writing any files.** Scaffolding without reading this file
146
+ will result in files being created in the wrong location.
147
+
148
+ ## Environment Variables
149
+
150
+ ```
151
+ ## ENV VAR REQUIRED
152
+ Name : <VAR_NAME>
153
+ Purpose : <what it's used for>
154
+ Awaiting : confirmation it exists in the environment
155
+ ```
156
+
157
+ <!-- @annotation: List known env vars here for agent reference. -->
158
+
159
+ ---
160
+
161
+ ## Safety Rules
162
+
163
+ - Never proceed if Config Audit has not passed
164
+ - Always write back confirmed config values before proceeding
165
+ - Never write to `client/`, `shared/`, or `CONTRACTS.md` unilaterally
166
+ - Surface best-practice observations once - never loop on them
167
+
168
+ ---
169
+
170
+ ## Scope Boundaries
171
+
172
+ **In scope (backend agents own these):**
173
+ - Database schemas, migrations, entities, queries
174
+ - Backend architecture, folder structure, DB setup, wiring config - belongs to backend/INIT
175
+ - API endpoint definitions, request/response handling
176
+ - Server-side authentication, authorization, sessions
177
+ - Business logic, services, data processing
178
+ - Event queues, pub/sub, webhooks
179
+ - Background jobs, scheduled tasks
180
+ - Backend unit and integration tests
181
+
182
+ **Out of scope (redirect to correct agent or scope):**
183
+ - UI components, layouts, styling - belongs to client/UI
184
+ - Client-side state management - belongs to client/LOGIC
185
+ - Form components and validation - belongs to client/FORMS
186
+ - Route definitions and navigation - belongs to client/ROUTING
187
+ - Client-side auth token handling - belongs to client/LOGIC
188
+ - Shared types crossing client/backend boundary - propose CONTRACTS change
189
+ - Infrastructure, deployment, environment config - belongs to CLOUD agent
190
+
191
+ If a task crosses into out-of-scope territory, apply the Scope Mismatch Protocol from root CLAUDE.md.
192
+
193
+ ---
194
+
195
+ ## Scaffolding Into Existing Directories
196
+
197
+ When any agent initializes a framework or installs dependencies into `backend/`,
198
+ the directory already contains coordination files (`CLAUDE.md`, `agents/`).
199
+
200
+ Rules:
201
+ - Never overwrite or delete `CLAUDE.md`, `.agents/backend/` or `.frameworks/backend/`
202
+ - When using framework CLI tools (e.g. nest new, django-admin startproject),
203
+ use the appropriate flags or scaffold into a temp directory first,
204
+ then move generated files into `backend/` preserving existing files
205
+ - If a conflict is detected - resolve by moving generated files manually,
206
+ never by deleting coordination files
207
+ - Verify `CLAUDE.md` and `agents/` still exist after any scaffold operation
@@ -0,0 +1,213 @@
1
+ # {{PROJECT_NAME}} - Client Agent Instructions
2
+ #
3
+ # ╔══════════════════════════════════════════════════════════════════╗
4
+ # ║ @config BLOCK ║
5
+ # ║ Audited before every task. Missing required values = hard stop. ║
6
+ # ║ Confirmed values are written back here immediately. ║
7
+ # ╚══════════════════════════════════════════════════════════════════╝
8
+ #
9
+ # @config PROJECT_NAME : ← [required]
10
+ # @config FRAMEWORK : ← [required if LANGUAGE blank] e.g. Next.js, Angular, SvelteKit
11
+ # @config FRAMEWORK_VERSION : ← [optional] e.g. 22, 21, 20 — set at init time
12
+ # @config FRAMEWORK_VERSION : ← [optional] e.g. 22, 21, 20 — set at init time
13
+ # @config LANGUAGE : ← [required if FRAMEWORK blank] e.g. TypeScript, JavaScript
14
+ # @config UI_LIBRARY : ← [optional] derived from FRAMEWORK if blank
15
+ # @config STATE : ← [optional] derived from FRAMEWORK if blank
16
+ # @config STYLING : ← [optional] derived from FRAMEWORK if blank
17
+ #
18
+ # ── Write-back rule ─────────────────────────────────────────────────
19
+ # Every confirmed config value must be written into its @config line
20
+ # above before the agent proceeds. No exceptions.
21
+ # ────────────────────────────────────────────────────────────────────
22
+ #
23
+ # Inherits from root CLAUDE.md. Do not duplicate global rules here.
24
+
25
+ ---
26
+
27
+ ## Config Audit
28
+
29
+ Runs before any task, exploration, or code. No exceptions.
30
+
31
+ ### Resolution priority
32
+
33
+ ```
34
+ FRAMEWORK set → language derived from it. Proceed.
35
+ FRAMEWORK blank, LANGUAGE set → trigger Level 2 framework proposal.
36
+ FRAMEWORK blank, LANGUAGE blank → hard stop.
37
+ PROJECT_NAME blank → hard stop.
38
+ ```
39
+
40
+ ### Required configs
41
+
42
+ | @config | Rule | If missing |
43
+ |--------------|----------------------------------------------------|--------------------------- |
44
+ | PROJECT_NAME | Must always be set | Hard stop |
45
+ | FRAMEWORK | Must be set, OR LANGUAGE must be set to resolve it | See resolution priority |
46
+ | LANGUAGE | Required only if FRAMEWORK is blank | Hard stop if both are blank |
47
+
48
+ ### Optional configs
49
+
50
+ | @config | Derives from | Triggers when |
51
+ |------------|---------------------------------------|------------------------------|
52
+ | UI_LIBRARY | FRAMEWORK first, LANGUAGE as fallback | Any component or layout task |
53
+ | STATE | FRAMEWORK first, LANGUAGE as fallback | Any state management task |
54
+ | STYLING | FRAMEWORK first, LANGUAGE as fallback | Any styling or theming task |
55
+
56
+ When FRAMEWORK strongly implies a default (e.g. Angular → Angular CDK / Material),
57
+ the agent surfaces that default for confirmation rather than proposing a full list.
58
+ If FRAMEWORK is agnostic, agent proposes up to 3 options derived from LANGUAGE.
59
+
60
+ ### Hard stop alert
61
+
62
+ ```
63
+ ## CONFIG AUDIT FAILED - CANNOT PROCEED
64
+
65
+ Missing:
66
+ [ ] @config PROJECT_NAME - agent cannot scope output without it.
67
+ [ ] @config FRAMEWORK / LANGUAGE - at least one required.
68
+ No code can be written without either.
69
+
70
+ Open this file, fill in the missing values, and restart the task.
71
+ ```
72
+
73
+ Only list what is actually missing.
74
+
75
+ ### Optional config alert
76
+
77
+ ```
78
+ ## CONFIG INCOMPLETE - LIMITED PROCEED
79
+
80
+ @config {{TOKEN}} is not set. This affects:
81
+ - <specific consequence for this task>
82
+
83
+ Derived recommendation (from @config FRAMEWORK / LANGUAGE):
84
+ → <recommended value and one-line reason>
85
+
86
+ Options:
87
+ 1. Accept - agent writes to @config and proceeds
88
+ 2. Override - agent offers up to 3 alternatives, waits for selection
89
+ 3. Skip - agent marks affected decisions as <!-- @unresolved --> and continues
90
+
91
+ Awaiting your choice.
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Stack Resolution
97
+
98
+ Runs after Config Audit passes.
99
+
100
+ ### Level 1 - Framework set
101
+ Use it directly. Language is derived. Proceed.
102
+
103
+ ### Level 2 - Language set, framework blank
104
+
105
+ ```
106
+ ## FRAMEWORK SELECTION REQUIRED
107
+ Language : {{LANGUAGE}}
108
+ Options :
109
+ 1. <Framework A> - <one-line reason>
110
+ 2. <Framework B> - <one-line reason>
111
+ 3. <Framework C> - <one-line reason>
112
+ Awaiting : selection - agent writes confirmed value to @config FRAMEWORK
113
+ ```
114
+
115
+ ### Level 3 - Both blank
116
+ Hard stop. Config Audit already surfaced the alert.
117
+
118
+ ---
119
+
120
+ ## Framework Scaffold Instructions
121
+
122
+ Before scaffolding ANY project structure, read the framework-specific instruction file:
123
+
124
+ ```
125
+ .frameworks/client/{{FRAMEWORK_FILE}}
126
+ ```
127
+
128
+ Where `{{FRAMEWORK_FILE}}` maps to:
129
+ - Next.js → `nextjs.md`
130
+ - Angular → `angular.md`
131
+ - Vue / Nuxt → `nuxt.md`
132
+ - SvelteKit → `sveltekit.md`
133
+ - Vite + React → `vite-react.md`
134
+ - Remix → `remix.md`
135
+
136
+ The file contains:
137
+ - Exact scaffold command and flags
138
+ - Where to run it (always from repo root)
139
+ - Expected directory structure after scaffold
140
+ - How to recover if files land in the wrong location
141
+ - How to update `.scaffold/.paths.json` after scaffold
142
+
143
+ **This is mandatory before writing any files.** Scaffolding without reading this file
144
+ will result in files being created in the wrong location.
145
+
146
+ **Rules:**
147
+ - Surface each proposal once. Never repeat.
148
+ - Do not infer stack from existing code - confirm if config is missing.
149
+ - Write every confirmed value back to its `@config` line before proceeding.
150
+
151
+ ---
152
+
153
+ ## Environment Variables
154
+
155
+ Public env var prefixes derive from `{{FRAMEWORK}}` - agent applies correct
156
+ prefix convention once FRAMEWORK is resolved. No hardcoded prefixes here.
157
+
158
+ ```
159
+ ## ENV VAR REQUIRED
160
+ Name : <VAR_NAME>
161
+ Purpose : <what it's used for>
162
+ Public : yes / no
163
+ Awaiting : confirmation it exists in the environment
164
+ ```
165
+
166
+ <!-- @annotation: List known env vars here for agent reference. -->
167
+
168
+ ---
169
+
170
+ ## Safety Rules
171
+
172
+ - Never proceed if Config Audit has not passed
173
+ - Always write back confirmed config values before proceeding
174
+ - Never write to `backend/`, `shared/`, or `CONTRACTS.md` unilaterally
175
+ - Never redeclare types that belong in `shared/` - propose a CONTRACTS change instead
176
+ - Surface best-practice observations once - never loop on them
177
+
178
+ ---
179
+
180
+ ## Scope Boundaries
181
+
182
+ **In scope (client agents own these):**
183
+ - UI components, layouts, pages, styling
184
+ - State management, custom hooks, API client calls
185
+ - Form components, validation, submission handling
186
+ - Route definitions, navigation, URL structure
187
+ - Client-side authentication (tokens, session storage)
188
+ - Accessibility compliance, keyboard navigation
189
+ - Unit and integration tests for client code
190
+
191
+ **Out of scope (redirect to correct agent or scope):**
192
+ - Database schemas, migrations, queries - belongs to backend/DB
193
+ - API endpoint definitions - belongs to backend/API
194
+ - Server-side authentication logic - belongs to backend/AUTH
195
+ - Business rules and server-side processing - belongs to backend/LOGIC
196
+ - Shared types crossing client/backend boundary - propose CONTRACTS change
197
+ - Infrastructure, deployment, environment config - belongs to CLOUD agent
198
+
199
+ If a task crosses into out-of-scope territory, apply the Scope Mismatch Protocol from root CLAUDE.md.
200
+
201
+ ---
202
+
203
+ ## Scaffolding Into Existing Directories
204
+
205
+ When initializing a framework into `client/`, the directory already contains
206
+ `CLAUDE.md` and `agents/`. These must always be preserved.
207
+
208
+ **Rules:**
209
+ - Never use CLI scaffold tools (create-next-app, nuxi, etc.) — they refuse non-empty directories
210
+ - Always create the project structure manually: package.json, tsconfig.json, config files, src/ folders
211
+ - Never create temp directories of any kind
212
+ - Never overwrite or delete `CLAUDE.md`, `.agents/client/` or `.frameworks/client/`
213
+ - Delete any leftover temp folders from previous runs before starting
File without changes
@@ -0,0 +1,14 @@
1
+ {
2
+ "client": {
3
+ "apiBaseUrlVar": "API_BASE_URL"
4
+ },
5
+ "backend": {
6
+ "portVar": "PORT",
7
+ "corsOriginVar": "CORS_ORIGIN"
8
+ },
9
+ "environments": {
10
+ "development": {},
11
+ "staging": {},
12
+ "production": {}
13
+ }
14
+ }