nurosys-agents 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.agent/INSTRUCTIONS.md +31 -1
  2. package/.agent/frontend/skills/architect/SKILL.md +309 -467
  3. package/.agent/frontend/skills/auth-and-permissions/SKILL.md +185 -41
  4. package/.agent/frontend/skills/brainstorm/SKILL.md +127 -0
  5. package/.agent/frontend/skills/code-reviewer/SKILL.md +307 -0
  6. package/.agent/frontend/skills/{react-quality-review → code-reviewer}/examples.md +2 -2
  7. package/.agent/frontend/skills/create-blueprint/SKILL.md +280 -130
  8. package/.agent/frontend/skills/debug-issue/SKILL.md +76 -18
  9. package/.agent/frontend/skills/explore-codebase/SKILL.md +38 -19
  10. package/.agent/frontend/skills/quick-execute/SKILL.md +105 -0
  11. package/.agent/frontend/skills/refactor-safely/SKILL.md +47 -19
  12. package/.agent/frontend/skills/security-assessment/SKILL.md +182 -0
  13. package/.agent/frontend/skills/ux-architect/SKILL.md +198 -0
  14. package/.agent/frontend/skills/vuexy-component-guide/SKILL.md +51 -0
  15. package/.agent/frontend/workflows/module-runner.claude.md +233 -0
  16. package/.agent/frontend/workflows/module-runner.codex.md +159 -0
  17. package/.agent/frontend/workflows/module-runner.cursor.md +218 -0
  18. package/.agent/templates/UX_PLAN.md +228 -0
  19. package/README.md +28 -3
  20. package/package.json +2 -2
  21. package/scripts/setup-rules.js +13 -4
  22. package/.agent/frontend/skills/feature-workflow/SKILL.md +0 -61
  23. package/.agent/frontend/skills/react-quality-review/SKILL.md +0 -126
  24. package/.agent/frontend/workflows/build-feature-react.workflow.md +0 -82
  25. package/.agent/frontend/workflows/feature-module-runner.md +0 -101
  26. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/_sections.md +0 -0
  27. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/_template.md +0 -0
  28. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/advanced-event-handler-refs.md +0 -0
  29. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/advanced-init-once.md +0 -0
  30. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/react-rules-calling.md +0 -0
  31. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/react-rules-hooks.md +0 -0
  32. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/react-rules-purity.md +0 -0
  33. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-activity.md +0 -0
  34. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-conditional-render.md +0 -0
  35. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-content-visibility.md +0 -0
  36. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-hoist-jsx.md +0 -0
  37. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-usetransition-loading.md +0 -0
  38. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-defer-reads.md +0 -0
  39. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-dependencies.md +0 -0
  40. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-derived-state-no-effect.md +0 -0
  41. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-derived-state.md +0 -0
  42. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-functional-setstate.md +0 -0
  43. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-lazy-state-init.md +0 -0
  44. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-memo-with-default-value.md +0 -0
  45. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-memo.md +0 -0
  46. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-move-effect-to-event.md +0 -0
  47. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-no-inline-components.md +0 -0
  48. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-simple-expression-in-memo.md +0 -0
  49. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-transitions.md +0 -0
  50. /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-use-ref-transient-values.md +0 -0
@@ -1,644 +1,486 @@
1
1
  ---
2
2
  name: architect
3
- description: Research the current React/Next.js codebase, decompose a feature or enhancement into logical modules with dependency ordering, and produce a gated architecture plan plus per-module implementation prompts. Use when the user asks to architect, break down, design, or phase a multi-file feature, module, refactor, or enhancement.
3
+ description: Frontend technical planner. Reads `<feature>_UX_PLAN.md` (produced by `/ux-architect`), decomposes the UX into ordered technical modules (page-layer, view-layer, hooks, services), consults read-only sub-agents for cross-cutting concerns (auth, security), and writes ONLY planning documents under `documentation/features/<feature>/`. NEVER WRITES CODE. Hands off to `/module-runner` for execution. Trigger with `/architect documentation/features/<feature_name>/` or `/architect <feature description>`.
4
+ disable-model-invocation: false
4
5
  ---
5
6
 
6
- # Skill: architect
7
+ # Skill: architect (frontend)
7
8
 
8
- Use this skill when the work is larger than a small single-file change and you need a reusable implementation blueprint before coding.
9
+ The technical planner. Translates a UX plan into ordered, autonomously-executable technical modules. Produces documents the user reviews before any code is written.
9
10
 
10
- The goal is to:
11
+ ## Hard guarantee — architect NEVER writes code
11
12
 
12
- 1. Study the existing this architecture first.
13
- 2. Break the requested work into small, independently implementable modules.
14
- 3. Produce one master architecture plan.
15
- 4. Stop for approval.
16
- 5. After approval, generate per-module prompt files that can be handed to an AI implementer and that align with this repo's existing feature workflow.
17
- 6. Maintain persistent implementation memory in `project-memory/core-memory.md` as each module is completed.
13
+ **What architect produces (and ONLY this):**
18
14
 
19
- ## When to trigger
15
+ - `documentation/features/<feature_name>/<feature>_MODULE_WISE_PLAN.md` master technical plan
16
+ - `documentation/features/<feature_name>/<feature>_MODULE_<N>_<MODULE_NAME>.md` — one prompt per module (input for `/module-runner`)
20
17
 
21
- - User asks to "architect", "break down", "plan", "design", or "phase" a feature.
22
- - The work spans multiple areas such as `src/app`, `src/views`, `src/components`, `src/services`, `src/hooks`, `src/utils`, or `src/app/api`.
23
- - You need to understand existing repo patterns before proposing changes.
24
- - The user wants a module-by-module implementation plan for a new feature, enhancement, or significant refactor.
18
+ **What architect MUST NOT touch:**
25
19
 
26
- ## Output locations
20
+ - Anything under `src/` (pages, components, hooks, services, styles)
21
+ - Tests
22
+ - Git (no commits, no branches, no pushes)
23
+ - Dependencies (`package.json`)
24
+ - `project-memory/` except optionally noting "feature X planned on <date>" in `core-memory.md` — and even that is deferred to `/module-runner`'s wrap-up
27
25
 
28
- All outputs go under **`Documentation/features/<feature_name>/`**. Create that folder when generating the first artifact for a feature.
26
+ If you feel the urge to write code "just to validate the plan", stop. The plan is a document; execution is `/module-runner`'s job.
29
27
 
30
- | File | Purpose |
31
- |------|---------|
32
- | `Documentation/features/<feature_name>/<FEATURE_NAME>_ARCHITECTURE.md` | Master architecture plan with scope, modules, dependencies, implementation order, and file inventory |
33
- | `Documentation/features/<feature_name>/MODULE_<N>_<MODULE_NAME>.md` | Per-module implementation prompt file, generated only after plan approval |
28
+ ---
34
29
 
35
- Naming rules:
30
+ ## When to trigger
31
+
32
+ - A `/ux-architect` session completed and the UX plan was approved
33
+ - User asks to "architect", "plan modules for", "decompose", or "design the technical plan for" a feature
34
+ - Work spans more than one module or layer
36
35
 
37
- - `<FEATURE_NAME>`: `UPPER_SNAKE_CASE` such as `PDF_EXPORT_QUEUE` or `BRAND_AUDIT_FILTERS`
38
- - `<feature_name>`: `snake_case` such as `pdf_export_queue` or `brand_audit_filters`
39
- - `<MODULE_NAME>`: short `UPPER_SNAKE_CASE` label such as `API_ROUTE`, `VIEW_STATE`, `PDF_WIDGET`
36
+ For UI-heavy features, `/ux-architect` runs first. For purely technical refactors with no UX change (renaming a hook, restructuring services), `/architect` can run standalone.
40
37
 
41
- ## Expected behavior
38
+ ---
42
39
 
43
- This skill is intentionally two-stage:
40
+ ## Output locations
44
41
 
45
- 1. First run: create only the master architecture plan in `Documentation/features/<feature_name>/<FEATURE_NAME>_ARCHITECTURE.md`
46
- 2. Wait for explicit approval
47
- 3. Second run after approval: generate multiple prompt files, one per module, under `Documentation/features/<feature_name>/`
42
+ | File | Purpose |
43
+ |------|---------|
44
+ | `<feature>_MODULE_WISE_PLAN.md` | Master plan: modules, dependencies, contracts, rollout |
45
+ | `<feature>_MODULE_<N>_<MODULE_NAME>.md` | Per-module prompt consumed by `/module-runner` |
48
46
 
49
- If you only see a single architecture document after the first run, that is correct behavior, not a failure.
47
+ Naming:
48
+ - `<feature_name>` is `snake_case` (e.g. `user_profile_drawer`)
49
+ - `<N>` is module number (e.g. `1`, `2`, `3`)
50
+ - `<MODULE_NAME>` is abbreviated `UPPER_SNAKE_CASE` (e.g. `PAGE_LAYER`, `EDIT_DIALOG`)
50
51
 
51
52
  ---
52
53
 
53
- ## Phase 0 - Prerequisites (HARD STOP)
54
-
55
- > Goal: confirm project-memory artifacts exist before doing any work. This skill is grounded in those documents and cannot produce a useful plan without them.
54
+ ## Phase 0 Prerequisites (HARD STOP)
56
55
 
57
- Check that **all** of these files exist:
56
+ Required project-memory files:
58
57
 
59
58
  - `project-memory/constitution.md`
59
+ - `project-memory/architecture.md`
60
60
  - `project-memory/repo-map.md`
61
61
  - `project-memory/auth-model.md`
62
- - `project-memory/quality-playbook.md`
62
+ - `project-memory/design-system.md`
63
63
  - `project-memory/core-memory.md`
64
64
 
65
- If **any** are missing, STOP immediately. Do not proceed to Phase 1. Do not write a partial plan. Respond to the user exactly with:
65
+ If any missing, **STOP** and respond:
66
66
 
67
- > ⚠️ `/architect` requires the `project-memory/` artifacts to ground the plan in this project's actual rules, architecture, and history. The following files are missing:
68
- >
67
+ > ⚠️ `/architect` requires `project-memory/` artifacts to ground the plan. Missing:
69
68
  > - [list each missing file]
70
69
  >
71
- > Please run `/create-blueprint all` first (or `/create-blueprint <artifact>` for individual ones), then re-invoke `/architect <your feature>`.
72
-
73
- Only continue to Phase 1 once every file above is present.
74
-
75
- ---
76
-
77
- ## Phase 1 - Research and discovery
78
-
79
- > Goal: understand the current codebase structure and constraints before designing modules.
70
+ > Run `/create-blueprint all` (or `/create-blueprint <artifact>` for individual ones), then re-invoke `/architect`.
80
71
 
81
- ### 1.1 Read foundation docs first
72
+ Required UX plan (for UI features):
82
73
 
83
- Read these in order:
74
+ If the user invocation references a feature folder OR the feature has any UI surface:
84
75
 
85
- 1. `project-memory/constitution.md`
86
- 2. `project-memory/repo-map.md`
87
- 3. `project-memory/auth-model.md`
88
- 4. `project-memory/quality-playbook.md`
89
- 5. `project-memory/core-memory.md`
90
- 6. `.agent/workflows/build-feature-react.workflow.md`
91
- 7. `.agent/skills/feature-workflow/SKILL.md`
92
- 8. `.agent/templates/FEATURE_PLAN.md`
93
- 9. `.agent/templates/REVIEW_REPORT.md`
94
- 10. `.agent/templates/TEST_PLAN.md`
76
+ - `documentation/features/<feature_name>/<feature>_UX_PLAN.md` MUST exist.
95
77
 
96
- These files define the repo's non-negotiable process and where code belongs.
78
+ If absent and the feature has UI, **STOP** and respond:
97
79
 
98
- If `project-memory/core-memory.md` does not exist yet, create it before finalizing the first architecture plan that will use this skill.
80
+ > ⚠️ This feature has UI but no UX plan exists. Run `/ux-architect <feature>` first it'll design the layout, component reuse, forms, and states. Then re-invoke `/architect documentation/features/<feature_name>/`.
99
81
 
100
- ### 1.2 Map the existing architecture
82
+ For purely technical refactors with no UX change, the UX plan is optional. Confirm with the user before skipping.
101
83
 
102
- Before proposing modules, inspect the actual code paths involved in the feature and note existing patterns.
103
-
104
- Always identify:
105
-
106
- - Route entry points in `src/app/**`
107
- - Feature views in `src/views/**`
108
- - Shared UI in `src/components/**`
109
- - Hooks in `src/hooks/**`
110
- - Service/data logic in `src/services/**`
111
- - Shared helpers in `src/utils/**`
112
- - Config and contracts in `src/configs/**` and `src/types/**`
113
- - Any API/BFF handlers in `src/app/api/**`
114
- - Auth-sensitive touchpoints in:
115
- - `src/contexts/authContext.tsx`
116
- - `src/utils/auth.ts`
117
- - `src/configs/authConfig.ts`
118
- - `src/types/auth.ts`
119
-
120
- Trace the real flow for the feature area. Typical shapes in this repo are:
121
-
122
- ```text
123
- page.tsx -> view component -> hooks/selectors -> service -> API route -> external API
124
- ```
84
+ ---
125
85
 
126
- or
86
+ ## Phase 1 — Read foundation + UX plan
127
87
 
128
- ```text
129
- page.tsx -> view component -> shared components/dialogs -> service/utils -> local state/auth context
130
- ```
88
+ Read in order:
131
89
 
132
- ### 1.3 Reuse hunting via repo-map
90
+ | File | What you extract |
91
+ |------|------------------|
92
+ | `<feature>_UX_PLAN.md` (if present) | Pages, layouts, dialogs, forms, state surface, auth gates, design-system reuse plan |
93
+ | `project-memory/constitution.md` | Non-negotiable rules the plan must honor |
94
+ | `project-memory/architecture.md` | Server/client boundary rules, state-management approach, data-fetching patterns |
95
+ | `project-memory/repo-map.md` | Where pages/views/hooks/services/components live, naming, reusable components |
96
+ | `project-memory/auth-model.md` | Auth context, useAuth, route gating |
97
+ | `project-memory/design-system.md` | Wrappers, form patterns, theme tokens |
98
+ | `project-memory/core-memory.md` | Prior decisions, completed modules |
133
99
 
134
- Before proposing any new file, actively cross-reference `project-memory/repo-map.md` against the feature domain to find reuse candidates. This is the primary reuse check the repo-map is curated and faster than a broad graph search.
100
+ The UX plan is the **source of truth** for what the feature looks like. Architect's job is to translate it into technical modules that respect the architecture and constitution.
135
101
 
136
- Steps:
102
+ ---
137
103
 
138
- 1. Re-read the relevant sections of `project-memory/repo-map.md` with the feature in mind (components, hooks, services, utils, types).
139
- 2. List every existing entry that overlaps with what the feature needs.
140
- 3. For each candidate, use `query_graph` (callers_of / callees_of / imports_of) or `get_impact_radius` to understand what it already does and who uses it — confirm it is safe to extend or reuse.
141
- 4. For any proposed new file, write an explicit justification: "checked repo-map sections X and Y; nothing covers this because…". If you cannot write that justification, do not propose the new file.
104
+ ## Phase 2 Map existing code with Serena (≤8 calls)
142
105
 
143
- The goal is that every module in the plan preferentially extends or reuses existing code. New files are the last resort, not the default.
106
+ | Need | Tool |
107
+ |---|---|
108
+ | List symbols in a relevant file | `get_symbols_overview(relative_path="...")` |
109
+ | Find a page / view / hook / service by name | `find_symbol(name_path="...", include_body=false)` |
110
+ | Read a specific symbol body | `find_symbol(name_path="...", include_body=true)` |
111
+ | Trace consumers of a hook/component | `find_referencing_symbols(...)` |
112
+ | Project memories | `list_memories` then `read_memory` if relevant |
144
113
 
145
- ### 1.4 Capture existing repo patterns
114
+ Target ≤8 calls. Identify existing pages/views/hooks/services this feature should extend rather than duplicate — feed into the per-module spec.
146
115
 
147
- Document the patterns that the new design must follow:
116
+ ---
148
117
 
149
- - Keep `page.tsx` files thin and compositional.
150
- - Move heavy logic into `src/views/**`, `src/services/**`, `src/hooks/**`, or focused helpers.
151
- - Prefer shared derivations/selectors over repeated `filter/map/sort` chains.
152
- - Do not duplicate auth logic or cookie contracts.
153
- - Respect server/client boundaries between client components, server routes, and secret-bearing code.
154
- - Tighten service and transform types instead of introducing `any`.
118
+ ## Phase 3 Cross-cutting sub-agent consultations (read-only)
155
119
 
156
- ### 1.5 Identify integration points
120
+ For any module touching a cross-cutting concern, consult the sub-agent **as a planning input**. Sub-agents return advice, not code.
157
121
 
158
- For the requested feature, explicitly note:
122
+ Run consultations in parallel where supported (Claude Code Task tool / Cursor subagent background mode).
159
123
 
160
- - Existing files and modules that are closest to the requested behavior
161
- - Shared services or utilities to reuse
162
- - Data contracts and types that must be reused or extended
163
- - API routes or external services that are affected
164
- - Auth or permission implications
165
- - Performance-sensitive transforms or rendering paths
166
- - Whether tests should be unit, integration, manual, or mixed
167
- - What must be persisted into `project-memory/core-memory.md` after each module lands
124
+ | Concern | Sub-agent to invoke | What you ask for |
125
+ |---|---|---|
126
+ | Private routes, permission-gated UI, useAuth consumers | `/auth-and-permissions` (planning_input mode) | Recommended gate per route, permission key per UI element, useAuth consumers list |
127
+ | Sensitive client-side data (tokens, PII), new third-party scripts, new env-vars | `/security-assessment` (pre-design review) | Risks specific to the proposed surface; constraints the design should respect |
168
128
 
169
- ### 1.6 Capture scope decisions
129
+ Parent prompt for sub-agents:
170
130
 
171
- Before designing modules, write down:
131
+ > Sub-agent mode. Proposed module surface from approved UX plan: [excerpt the relevant routes/components/data flows]. Return planning_input JSON per your SKILL.md.
172
132
 
173
- - In scope
174
- - Out of scope
175
- - Assumptions
176
- - Open questions
133
+ Capture each sub-agent's returned JSON. Use it directly in the module specs (Phase 4) — don't paraphrase the specifics away.
177
134
 
178
- If the request is ambiguous, ask clarifying questions before writing the plan.
135
+ If a sub-agent flags a BLOCKER (e.g. fundamental security flaw, no documented auth pattern fits), **stop and surface to the user**. Do not silently adjust the plan around it.
179
136
 
180
137
  ---
181
138
 
182
- ## Phase 2 - Module decomposition
183
-
184
- > Goal: split the feature into small modules with clear ownership and dependencies.
185
-
186
- ### 2.1 Decomposition principles
187
-
188
- Apply these rules:
189
-
190
- 1. Single responsibility per module.
191
- 2. Each module should be mergeable with minimal risk.
192
- 3. Dependencies must be explicit.
193
- 4. Each module should provide testable value.
194
- 5. Prefer smaller modules if a module feels too broad.
195
- 6. Follow existing repo boundaries instead of inventing new layers.
196
- 7. Keep pages thin; avoid modules that push business logic into route/page files.
197
- 8. **Reuse over create**: before proposing a new file, confirm via repo-map.md that nothing equivalent exists. Prefer extending an existing hook, service, or component. A new file must be justified explicitly.
198
- 9. **Deletion safety**: before proposing to delete any file, run `get_impact_radius` on it. List every active caller and dependent. If callers exist, the module must include a migration path for each one before the deletion is permitted. Never propose a deletion without this check.
199
-
200
- ### 2.2 Valid module shapes in this repo
201
-
202
- Common module types for this include:
203
-
204
- - Route composition module
205
- - Feature view/container module
206
- - Shared component or dialog module
207
- - Hook/state orchestration module
208
- - Service/API integration module
209
- - Shared transform/helper module
210
- - Auth/permission adjustment module
211
- - Testing/verification module
212
-
213
- Use the smallest combination that fits the actual request.
214
-
215
- ### 2.3 For each module, define
216
-
217
- Every module section in the architecture plan must include these fields. Write them precisely — this content is extracted verbatim into the per-module implementation prompts, so prose rationale and justification notes belong in the architecture plan preamble, not inside the module sections.
218
-
219
- | Section | Content |
220
- |---------|---------|
221
- | Goal | One-sentence outcome — what the module produces, not why |
222
- | Depends on | Prior module numbers or `-` |
223
- | Estimated effort | Rough time range |
224
- | Key deliverables | Main outcomes as a short bullet list |
225
- | New files | Table: `File \| Purpose` — one-line purpose per file; repo-map justification as a footnote in the plan, not in the table cell |
226
- | Changed files | Table: `File \| Anchor symbol \| Exact change` — anchor is the existing function/type/component to locate; exact change is the specific mutation ("add X param", "extend return type with Y", "insert case Z") |
227
- | Deleted files | Table: `File \| Active callers (get_impact_radius) \| Pre-condition for deletion` |
228
- | Architecture | Short ASCII diagram for non-trivial call chains only; omit if the file changes are self-explanatory |
229
- | Contracts | Actual TypeScript — interfaces, function signatures, prop types, route payload shapes. No prose descriptions. |
230
- | Implementation notes | Module-specific edge cases or constraints only — nothing that restates constitution.md or quality-playbook.md |
231
- | Auth / permissions | Specific auth implications for this module, or omit if none |
232
- | Verification | Exact test commands with flags and paths; specific manual steps |
233
- | Memory update | Exact sentences for core-memory; exact repo-map edits (table rows, section) if this module adds routes/services/patterns |
234
-
235
- ### 2.4 Use simple architecture diagrams when helpful
236
-
237
- Prefer short ASCII diagrams for non-trivial modules.
238
-
239
- Examples:
240
-
241
- ```text
242
- App Route
243
- -> Feature View
244
- -> Shared Components
245
- -> Hook / selector
246
- -> Service
247
- -> API route
248
- -> External API
249
- ```
139
+ ## Phase 4 Module decomposition
250
140
 
251
- ```text
252
- Dialog UI
253
- -> local form state
254
- -> submit handler
255
- -> service transform
256
- -> API request
257
- -> response typing
258
- -> view refresh
259
- ```
141
+ ### 4.1 Decomposition principles
260
142
 
261
- ---
143
+ 1. **Single responsibility** — one module does one thing
144
+ 2. **Independent deployability** — a module can ship without breaking what's there
145
+ 3. **Explicit dependencies** — if Module B needs Module A, state it
146
+ 4. **Incremental value** — each module delivers testable value on its own
147
+ 5. **Smallest viable unit** — prefer more smaller modules; >8 hours estimated effort → split it
262
148
 
263
- ## Phase 3 - Dependency ordering and implementation sequence
149
+ ### 4.2 Typical frontend module shapes
264
150
 
265
- > Goal: produce a safe serial order for implementation.
151
+ For a UI feature, modules often align with layers:
266
152
 
267
- ### 3.1 Build the dependency graph
153
+ - **DATA_LAYER / TYPES** shared types, valibot schemas, API client adapters (if needed)
154
+ - **HOOK_LAYER** — data-fetching hooks, mutation hooks, state hooks
155
+ - **VIEW_LAYER** — composed components (forms, dialogs, drawers) — the bulk of UI code
156
+ - **PAGE_LAYER** — page.tsx files, layout.tsx, route wiring; consumes the views
157
+ - **INTEGRATION** — wiring into nav, breadcrumbs, permission registration
268
158
 
269
- Identify:
159
+ Not every feature needs all five. Use the UX plan to identify the actual layers in play.
270
160
 
271
- - standalone modules that can ship first
272
- - modules that unblock others
273
- - modules that should remain behind a flag or guarded rollout
274
- - modules that should be grouped in one merge because of tight contract coupling
161
+ ### 4.3 Per-module fields
275
162
 
276
- ### 3.2 Define the implementation order
163
+ For every module, define:
277
164
 
278
- Present the order as a numbered chain, for example:
279
-
280
- ```text
281
- 1. Shared contracts/helpers
282
- |
283
- 2. Service/API integration
284
- |
285
- 3. Feature hook/state orchestration
286
- |
287
- 4. View/component wiring
288
- |
289
- 5. Tests and final verification
290
- ```
165
+ | Field | Content |
166
+ |---|---|
167
+ | **Goal** | One-sentence purpose |
168
+ | **Depends on** | Prerequisite modules (omit if standalone) |
169
+ | **Estimated effort** | Time range (e.g. "4–6 hours") |
170
+ | **Key deliverables** | Files / components / hooks / routes created or modified |
171
+ | **New files** | Table of new files + purpose (omit if none) |
172
+ | **Modified files** | Files this module changes (omit if none) |
173
+ | **Server / client boundary** | Explicit `'use client'` decisions for any new component |
174
+ | **State scope** | For each piece of state: local / hook / context / server |
175
+ | **Data flow** | Server actions vs client fetching vs SWR/React Query — per `architecture.md` |
176
+ | **Core interfaces** | TypeScript types, hook signatures, component prop shapes (text only — no implementation) |
177
+ | **UX plan refs** | Section numbers of `_UX_PLAN.md` this module realizes (so module-runner can read both) |
178
+ | **Auth approach** | From `/auth-and-permissions` sub-agent JSON for this module (if applicable) |
179
+ | **Security considerations** | From `/security-assessment` sub-agent JSON (if applicable) |
180
+ | **Implementation notes** | Patterns, edge cases, things to watch for (re-render, hook deps, focus management) |
181
+ | **Error handling** | Empty/loading/error states per UX plan; error boundary placement |
182
+ | **How to test** | Concrete verification: render test, hook test, integration test, manual UI flow |
291
183
 
292
- ### 3.3 Note merge guidance
184
+ ### 4.4 Architecture diagrams
293
185
 
294
- Call out:
186
+ For non-trivial modules, ASCII diagrams showing component composition or data flow:
295
187
 
296
- - safe standalone modules
297
- - coupled modules that should land together
298
- - risky modules that need extra verification
299
- - auth-sensitive modules that require `auth-and-permissions`
188
+ ```
189
+ ┌─────────────────┐ ┌──────────────────┐ ┌───────────────┐
190
+ UserListPage │───▶│ UserListView │───▶│ useUsersList │
191
+ (server comp) │ │ (client comp) │ │ (hook) │
192
+ └─────────────────┘ └──────────────────┘ └───────────────┘
193
+
194
+
195
+ ┌──────────────────┐
196
+ │ EditUserDialog │
197
+ │ (client comp) │
198
+ └──────────────────┘
199
+ ```
300
200
 
301
201
  ---
302
202
 
303
- ## Phase 4 - Produce the architecture plan and stop for approval
203
+ ## Phase 5 Dependency ordering
304
204
 
305
- > Goal: create one approved master plan before generating prompts or code.
205
+ ### 5.1 Build the dependency graph
306
206
 
307
- ### 4.1 Save location
207
+ - Map dependencies between modules
208
+ - Identify standalone modules (ship first)
209
+ - Identify the critical path
308
210
 
309
- Save the master plan to:
211
+ ### 5.2 Implementation order
310
212
 
311
- `Documentation/features/<feature_name>/<FEATURE_NAME>_ARCHITECTURE.md`
213
+ Numbered vertical chain:
312
214
 
313
- ### 4.2 Required document structure
215
+ ```
216
+ Module 1 — DATA_LAYER (standalone)
217
+
218
+ Module 2 — HOOK_LAYER (depends on M1)
219
+
220
+ Module 3 — VIEW_LAYER (depends on M2)
221
+
222
+ Module 4 — PAGE_LAYER (depends on M3)
223
+
224
+ Module 5 — INTEGRATION (depends on M4)
225
+ ```
314
226
 
315
- Use this structure:
227
+ ### 5.3 Merge points
316
228
 
317
- ```markdown
318
- # [Feature Name] Architecture Plan
229
+ - Which modules can merge individually (purely additive)?
230
+ - Which must merge together (tightly coupled contract — e.g. types + hook)?
231
+ - Which need a feature flag (visible UI changes)?
319
232
 
320
- [Brief description of the requested enhancement and intended outcome.]
233
+ ---
321
234
 
322
- ## Scope decisions
235
+ ## Phase 6 — Write `_MODULE_WISE_PLAN.md`
323
236
 
324
- ### In scope
325
- - ...
237
+ Save to `documentation/features/<feature_name>/<feature>_MODULE_WISE_PLAN.md`.
326
238
 
327
- ### Out of scope
328
- - ...
239
+ Structure:
329
240
 
330
- ### Assumptions
331
- - ...
241
+ ```markdown
242
+ # [Feature Name] — Module-Wise Plan
332
243
 
333
- ### Open questions
334
- - ...
244
+ [One-paragraph description.]
335
245
 
336
- ## Memory strategy
246
+ > **Scope decisions (from UX plan §2, confirmed):**
247
+ > - In scope: ...
248
+ > - Out of scope: ...
249
+ > - Assumptions: ...
337
250
 
338
- - Memory document: `project-memory/core-memory.md`
339
- - What to append after each module:
340
- - completed status
341
- - files added/changed
342
- - key architectural decisions
343
- - auth implications
344
- - tests run and gaps
345
- - notes for the next module
346
- - Repo map: when the feature adds new API routes, services, hooks, or reusable patterns, update `project-memory/repo-map.md` (tables or placement notes) so the map stays the single source of truth.
251
+ > **UX plan**: documentation/features/<feature_name>/<feature>_UX_PLAN.md
347
252
 
348
- ## Relevant codebase study
253
+ ---
349
254
 
350
- - `path/to/file` - why it matters
351
- - `path/to/file` - why it matters
255
+ ## Module Overview
352
256
 
353
- ## Module overview
257
+ | # | Module | Depends On | Effort | UX plan refs | Key Deliverables |
258
+ |---|--------|-----------|--------|--------------|------------------|
259
+ | 1 | DATA_LAYER | — | X–Y hr | §9 (forms) | types, valibot schemas |
260
+ | 2 | HOOK_LAYER | M1 | X–Y hr | §10 (state) | useUsersList, useUpdateUser |
261
+ | ... | ... | ... | ... | ... | ... |
354
262
 
355
- | # | Module | Depends On | Estimated Effort | Key Deliverables |
356
- |---|--------|------------|------------------|------------------|
357
- | 1 | ... | - | ... | ... |
263
+ ---
358
264
 
359
- ## Module 1 - [Name]
265
+ ## Module 1 DATA_LAYER
360
266
 
361
- **Goal**: [one sentence — what this module produces]
267
+ **Goal**: ...
362
268
 
363
- **Depends on**: [module numbers or `-`]
269
+ ### UX plan references
270
+ - §9 (Forms): Edit user form schema
271
+ - §10 (State): server data shape
364
272
 
365
- **Estimated effort**: ...
273
+ ### Auth approach (from /auth-and-permissions consultation)
274
+ [Inline relevant snippet from sub-agent JSON, if applicable]
366
275
 
367
- **Key deliverables**: ...
276
+ ### Security considerations (from /security-assessment consultation)
277
+ [Inline relevant snippet, if applicable]
368
278
 
369
- ### New files
279
+ ### New Files
370
280
  | File | Purpose |
371
281
  |------|---------|
372
- | ... | [one-line purpose repo-map justification as a footnote below this table if needed] |
282
+ | `src/types/user.ts` | shared User type |
283
+ | `src/schemas/user.ts` | valibot schema for EditUserForm |
373
284
 
374
- ### Changed files
375
- | File | Anchor symbol | Exact change |
376
- |------|---------------|--------------|
377
- | ... | `existingSymbol` | [specific mutation: "add X param", "extend return type with Y", "insert case Z"] |
285
+ ### Server / client boundary
286
+ N/A (pure types/schemas)
378
287
 
379
- ### Deleted files
380
- | File | Active callers (from get_impact_radius) | Pre-condition for deletion |
381
- |------|-----------------------------------------|---------------------------|
382
- | ... | none | ... |
383
-
384
- ### Architecture
385
- [Short ASCII diagram only if the call chain is non-obvious. Omit if the file changes are self-explanatory.]
386
-
387
- ### Contracts
388
- [Actual TypeScript — interfaces, function signatures, prop types, route payloads. No prose.]
389
-
390
- ```typescript
391
- // replace with real types for this module
288
+ ### Core interfaces
289
+ ```ts
290
+ export type User = { id: string; email: string; displayName: string; role: Role; isActive: boolean }
291
+ export const editUserSchema = v.object({...})
392
292
  ```
393
293
 
394
294
  ### Implementation notes
395
- [Module-specific edge cases or constraints only. Omit anything already covered by constitution.md or quality-playbook.md.]
295
+ ...
396
296
 
397
- ### Auth / permissions
398
- [Specific auth implications, or omit if none.]
297
+ ### How to test
298
+ - Type check passes (`tsc --noEmit`)
299
+ - Valibot schema accepts/rejects expected inputs (unit test)
399
300
 
400
- ### Verification
401
- - `[exact test command with flags and paths]`
402
- - Manual: [specific UI action or API call]
301
+ ---
403
302
 
404
- ### Memory update
405
- - **core-memory**: [exact sentences to append]
406
- - **repo-map**: [exact table rows or section edits, or omit if no new routes/services/patterns]
303
+ ## Module 2 — HOOK_LAYER
304
+ ...
407
305
 
408
- ## Implementation order
306
+ ---
409
307
 
410
- [dependency chain]
308
+ ## Implementation Order
411
309
 
412
- ## Merge guidance
310
+ [Dependency chain diagram]
413
311
 
312
+ **Recommended merge points:**
414
313
  - ...
415
314
 
416
- ## Test strategy
417
-
418
- - Unit:
419
- - Integration:
420
- - Manual:
421
-
422
- ## Files inventory
315
+ ---
423
316
 
424
- | File | Action | Module | Notes |
425
- |------|--------|--------|-------|
426
- | ... | Create | M1 | repo-map justification |
427
- | ... | Update | M2 | |
428
- | ... | Delete | M3 | callers verified zero via get_impact_radius |
429
- ```
317
+ ## Environment / Config Additions
430
318
 
431
- ### 4.3 Hard stop
319
+ | Variable | Default | Purpose |
320
+ |----------|---------|---------|
321
+ | ... | ... | ... |
432
322
 
433
- After creating `Documentation/features/<feature_name>/<FEATURE_NAME>_ARCHITECTURE.md`:
323
+ ---
434
324
 
435
- - Present the plan to the user.
436
- - Stop and wait for explicit approval.
437
- - Do not generate module prompt files yet.
438
- - Do not write application code yet.
325
+ ## Files Inventory
439
326
 
440
- If the user wants changes, update the architecture plan and re-present it.
327
+ | File | Action | Module |
328
+ |------|--------|--------|
329
+ | ... | Create/Modify | M1 |
330
+ ```
441
331
 
442
332
  ---
443
333
 
444
- ## Phase 5 - Generate per-module implementation prompts
334
+ ## Phase 7 Approval gate (HARD STOP)
445
335
 
446
- > Goal: after approval, generate one prompt file per module that a downstream AI can execute safely.
336
+ After writing `_MODULE_WISE_PLAN.md`, **STOP**. Do not generate per-module prompts yet.
447
337
 
448
- ### 5.1 Trigger
338
+ Present to user:
339
+ - Path to the plan file
340
+ - One-paragraph summary of the modules
341
+ - Implementation order
342
+ - Any sub-agent findings that materially shaped the plan
343
+ - Pointer back to the UX plan it realizes
449
344
 
450
- Only do this after the user explicitly approves the architecture plan from Phase 4.
345
+ Wait for explicit approval. If user requests changes, update and re-present.
451
346
 
452
- ### 5.2 Output files
347
+ ---
453
348
 
454
- For each approved module `N`, create:
349
+ ## Phase 8 — Generate per-module prompts
455
350
 
456
- `Documentation/features/<feature_name>/MODULE_<N>_<MODULE_NAME>.md`
351
+ Only after explicit user approval.
457
352
 
458
- Example:
353
+ ### 8.1 Output files
459
354
 
460
- ```text
461
- Documentation/features/pdf_export_queue/MODULE_1_SHARED_TYPES.md
462
- Documentation/features/pdf_export_queue/MODULE_2_API_ROUTE.md
463
- Documentation/features/pdf_export_queue/MODULE_3_QUEUE_WIDGET.md
464
- Documentation/features/pdf_export_queue/MODULE_4_TESTS.md
355
+ For each module `N`:
356
+ ```
357
+ documentation/features/<feature_name>/<feature>_MODULE_<N>_<MODULE_NAME>.md
465
358
  ```
466
359
 
467
- ### 5.3 Prompt file format
360
+ ### 8.2 Per-module prompt template
468
361
 
469
- Each file should follow this format:
362
+ ````markdown
363
+ You are implementing **Module <N> — <Module Name>** of the `<feature_name>` feature.
364
+ The master plan was reviewed and approved. Proceed autonomously through all phases.
470
365
 
471
- ```markdown
472
- You are implementing a feature module in the this repo (Next.js App Router, React, TypeScript). Follow this process exactly.
473
-
474
- First, read these files in order:
475
- 1. `project-memory/constitution.md`
476
- 2. `project-memory/repo-map.md`
477
- 3. `project-memory/auth-model.md`
478
- 4. `project-memory/quality-playbook.md`
479
- 5. `project-memory/core-memory.md`
480
- 6. `.agent/workflows/build-feature-react.workflow.md`
481
- 7. `.agent/skills/feature-workflow/SKILL.md`
482
- 8. `.agent/templates/FEATURE_PLAN.md`
483
- 9. `.agent/templates/REVIEW_REPORT.md`
484
- 10. `.agent/templates/TEST_PLAN.md`
485
- 11. `Documentation/features/<feature_name>/<FEATURE_NAME>_ARCHITECTURE.md`
486
-
487
- Artifact paths for this feature (use these; do not use .agent/plans or .agent/docs):
488
- - Feature plan: `Documentation/features/<feature_name>/FEATURE_PLAN.md`
489
- - Test plan: `Documentation/features/<feature_name>/TEST_PLAN.md`
490
- - Review report: `Documentation/reports/REVIEW_REPORT.md`
491
-
492
- Hard rules:
493
- - No coding before plan approval.
494
- - Implement only the approved scope for this module.
495
- - Keep `page.tsx` files thin.
496
- - Reuse existing auth surfaces; do not create parallel auth logic.
497
- - Respect server/client boundaries.
498
- - Reuse shared derivations/helpers instead of duplicating transforms.
499
- - Before creating any new file, cross-reference `project-memory/repo-map.md` for existing alternatives; only create if none exists and document why.
500
- - Before deleting any file, run `get_impact_radius` to confirm zero active callers, or execute the migration path specified in the architecture plan before removing the file.
501
- - After implementation, run `.agent/skills/react-quality-review/SKILL.md` and fix all findings.
502
- - If the module touches auth-sensitive code or protected routes, also run `.agent/skills/auth-and-permissions/SKILL.md`.
503
- - Run tests and verification before finalizing: run the test suite (e.g. `npm run test`) for affected areas; fix all failures before updating memory or moving on.
504
- - Update `project-memory/core-memory.md` after implementing the module and after tests/review are complete.
505
- - If this module adds new API routes, services, hooks, or reusable patterns, update `project-memory/repo-map.md` (relevant tables or placement notes).
506
- - Do not finalize development until required tests and verification commands have been run and recorded.
366
+ Execute under the `/module-runner` skill — it owns the per-module lifecycle (implement → build/test/lint → review → fix → security audit → fix → commit → push).
507
367
 
508
368
  ---
509
369
 
510
- ## Module <N> - <Module Name>
370
+ ## 1. Relevant context (curated for this module only)
511
371
 
512
- **Goal**: [one sentence — what this module produces]
372
+ ### UX plan references
373
+ <Inline the specific UX plan sections this module realizes. Use blockquotes or excerpts. Sections to consider: pages/routes (§6), page layouts (§7), dialogs (§8), forms (§9), state surface (§10), empty/loading/error (§11), a11y (§12), responsive (§13), auth gating (§14).>
513
374
 
514
- **Depends on**: [module numbers or `-`]
515
-
516
- ### Files to create
517
-
518
- | File | Purpose |
519
- |------|---------|
520
- | `path/to/new/file.ts` | [what it exports and why no equivalent exists in repo-map] |
375
+ ### Repo context (curated from repo-map)
376
+ <Curated repo-map excerpt — see §8.3 curation rules>
521
377
 
522
- ### Files to modify
378
+ ### Architecture rules (relevant subset)
379
+ <Inline relevant `architecture.md` sections — server/client boundary, state mgmt, data fetching>
523
380
 
524
- | File | Anchor symbol | Exact change |
525
- |------|---------------|--------------|
526
- | `path/to/file.ts` | `existingFunctionOrType` | [add / extend / replace — be specific: "add `newParam: Type` to signature", "extend return type with `NewField`", "insert case for `X` in switch"] |
381
+ ### Constitution rules (those this module can violate)
382
+ <Inline only the constitution sections relevant to this module>
527
383
 
528
- ### Files to delete
384
+ ### Design-system patterns to follow
385
+ <Inline the relevant patterns from design-system.md — custom wrappers to use, form pattern, etc.>
529
386
 
530
- | File | Pre-condition |
531
- |------|--------------|
532
- | `path/to/file.ts` | [only after callers in `other/file.ts` are migrated to `replacementSymbol`] |
387
+ ### Auth approach (from architect's /auth-and-permissions consultation)
388
+ <Inline the endpoint-level auth plan, if applicable>
533
389
 
534
- ### Contracts
390
+ ### Prior decisions (from core-memory)
391
+ <Inline only entries this module builds on or must not contradict>
535
392
 
536
- [Actual TypeScript — interfaces, function signatures, prop types, route payloads. No prose descriptions — write the real types.]
393
+ ---
537
394
 
538
- ```typescript
539
- // example — replace with actual contracts for this module
540
- export interface ExampleType {
541
- id: string;
542
- name: string;
543
- }
395
+ ## 2. Module specification
544
396
 
545
- export function exampleFn(id: string): Promise<ExampleType>
546
- ```
397
+ <Full module section copied verbatim from the approved _MODULE_WISE_PLAN.md.
398
+ Omit empty subsections.>
547
399
 
548
- ### Data flow
400
+ ---
549
401
 
550
- [Short ASCII diagram only if the call chain is non-obvious for this module. Omit if the file changes above make the flow self-evident.]
402
+ ## 3. Execution rules
551
403
 
552
- ### Auth / permissions
404
+ - No placeholder code. Implement every file in the New Files / Modified Files tables.
405
+ - Honor constitution + design-system rules inlined in §1.
406
+ - Use the documented custom wrappers and form pattern — no raw MUI when a wrapper exists.
407
+ - Use Serena for symbol-level edits where appropriate; raw write for new files.
408
+ - Honor the `'use client'` decisions in §1 — don't add `'use client'` to a server component unintentionally.
409
+ - After implementation, `/module-runner` runs: build + test + lint + `/code-reviewer` + `/security-assessment`. Do not bypass any.
410
+ - After all phases complete, `/module-runner` updates `project-memory/core-memory.md` — you do not.
411
+ ````
553
412
 
554
- [Only include if this module touches auth-sensitive code or protected routes. Omit otherwise.]
413
+ ### 8.3 Curation rules
555
414
 
556
- ### Verification
415
+ 1. **Module specification** — copy the module section from `_MODULE_WISE_PLAN.md` verbatim. Omit empty subsections.
557
416
 
558
- - `[exact test command]`[what it covers]
559
- - Manual: [specific UI action or API call to confirm the module works end-to-end]
417
+ 2. **UX plan references**quote/excerpt the specific sections (by number) this module realizes. The implementer should not need to read the entire UX plan.
560
418
 
561
- ### Memory update
419
+ 3. **Curated repo-map context** — only sections this module needs:
562
420
 
563
- - **core-memory**: [exact facts to append — completed status, files added/changed, key decisions, test gaps]
564
- - **repo-map**: [exact table rows or section edits to add — only if this module introduces new routes, services, hooks, or reusable patterns; omit otherwise]
421
+ | Always | Conditional |
422
+ |---|---|
423
+ | Naming conventions | Pages this module touches |
424
+ | | Reusable components this module composes with |
425
+ | | Existing hooks this module uses or extends |
565
426
 
566
- ---
427
+ Target: ~30–50 lines of focused context.
567
428
 
568
- ## Required planning output
429
+ 4. **Curated constitution rules** — only sections this module can actually violate:
569
430
 
570
- Fill `Documentation/features/<feature_name>/FEATURE_PLAN.md` with:
571
- 1. Requirement clarification
572
- 2. Codebase study
573
- 3. Detailed plan
574
- 4. Implementation order
431
+ | Module touches | Include |
432
+ |---|---|
433
+ | New pages/routes | Auth/gate rules, validation, error envelope, server/client boundary |
434
+ | New hooks | Hook rules of React (`react-rules-hooks`), state-derivation rules |
435
+ | New components | Component-purity rules, rerender-optimization defaults, a11y minimums |
436
+ | Forms | Form-pattern (react-hook-form + valibot) rules from design-system |
437
+ | Data fetching | Data-fetching rules from `architecture.md` |
575
438
 
576
- ## Quality and testing output
439
+ Never paste the full constitution.
577
440
 
578
- - Fill `Documentation/reports/REVIEW_REPORT.md`
579
- - Fill `Documentation/features/<feature_name>/TEST_PLAN.md`
580
- - Add or update the tests required by this module
581
- - Run the test suite (e.g. `npm run test`) for affected areas; record commands and results in TEST_PLAN; fix failures before finalizing
582
- - Append a completed module entry to `project-memory/core-memory.md`
583
- - If the module added new routes, services, or patterns, update `project-memory/repo-map.md` accordingly
584
- ```
441
+ 5. **Design-system inline** — name the specific wrappers and patterns to use; don't make the implementer search the whole guide.
585
442
 
586
- ### 5.4 Content rules for module prompt files
443
+ 6. **Auth inline** — if `/auth-and-permissions` consultation produced planning JSON for this module, inline it directly. Don't summarize specifics away.
587
444
 
588
- When generating module prompt files, extract only what the implementing agent needs to act not to understand the architecture decision. Concretely:
445
+ 7. **Core-memory inline** only entries this module depends on or must not contradict.
589
446
 
590
- 1. **Goal**: one sentence, outcome-focused. Drop all rationale.
591
- 2. **Files to create**: exact paths only. Drop repo-map justification prose (that was for the architecture review). A one-line purpose is enough.
592
- 3. **Files to modify**: must include the anchor symbol (the existing function, type, or component to locate) and the exact change — "add X", "extend Y to include Z", "replace W with V". Never just "update this file to support the feature."
593
- 4. **Files to delete**: keep only pre-conditions for safe deletion. Drop the impact-radius analysis (already done in the architecture plan).
594
- 5. **Contracts**: write actual TypeScript — interfaces, function signatures, prop types, route payload shapes. Never describe them in prose. These are the authoritative types the agent must implement.
595
- 6. **Data flow**: include only if the call chain across files is non-obvious. A single-file module rarely needs this. Keep it to the specific path for this module, not the whole feature.
596
- 7. **Implementation notes**: omit entirely unless there is a module-specific edge case or constraint that is NOT already covered by `constitution.md` or `quality-playbook.md`. Generic reminders ("keep pages thin", "respect server/client boundary") belong in Hard rules, not here.
597
- 8. **Auth / permissions**: include only if this specific module touches auth-sensitive code. Not a boilerplate flag.
598
- 9. **Verification**: exact commands with flags, not generic `npm run test`. Specify which paths/suites to run.
599
- 10. **Memory update**: exact sentences to append to core-memory and exact repo-map edits (table rows, section placement). No vague "document what changed."
447
+ 8. **Replace placeholders** `<feature_name>`, `<N>`, `<MODULE_NAME>` with actual values.
600
448
 
601
- ### 5.5 Confirmation to user
449
+ 9. **No code** — the prompt describes what to build, not how to write it.
602
450
 
603
- After generating prompt files, report:
451
+ ### 8.4 Confirmation
604
452
 
605
- - all created file paths
606
- - which module each file covers
607
- - recommended implementation order
453
+ After generating all prompts, present:
454
+ - List of generated file paths
455
+ - Implementation order
456
+ - Hand-off command: `/module-runner documentation/features/<feature_name>/`
608
457
 
609
458
  ---
610
459
 
611
460
  ## Quality gates
612
461
 
613
- Before finalizing the architecture plan, verify:
614
-
615
- - [ ] The relevant foundation docs were read first.
616
- - [ ] Scope, assumptions, and open questions are explicit.
617
- - [ ] Existing repo patterns were studied before proposing changes.
618
- - [ ] `project-memory/repo-map.md` was cross-referenced against the feature domain to identify reuse candidates before proposing new files.
619
- - [ ] Every proposed new file includes an explicit repo-map justification confirming no equivalent exists.
620
- - [ ] Every proposed deletion has had `get_impact_radius` run; active callers are listed and either zeroed out or a migration path is specified.
621
- - [ ] Each module has explicit dependencies.
622
- - [ ] Each module includes verification steps.
623
- - [ ] Server/client boundaries are respected.
624
- - [ ] Auth-sensitive work is identified.
625
- - [ ] Page files remain thin in the proposed design.
626
- - [ ] Shared derivations/helpers are preferred over duplicate transforms.
627
- - [ ] The files inventory covers every proposed file change (create, update, delete) with notes.
628
- - [ ] The implementation order matches the dependency graph.
629
- - [ ] Each module defines what must be written to `project-memory/core-memory.md`.
630
- - [ ] When the feature adds new routes, services, or patterns, the plan (or Memory update) states that `project-memory/repo-map.md` must be updated.
462
+ Before finalizing the plan, verify:
631
463
 
632
- ---
464
+ - [ ] All modules have a clear Goal
465
+ - [ ] Dependencies are explicit and acyclic
466
+ - [ ] Each module has a concrete How-to-test section
467
+ - [ ] No module violates `constitution.md`
468
+ - [ ] Every module references the UX plan sections it realizes (if a UI module)
469
+ - [ ] Modules with auth surfaces have inlined auth approach from sub-agent
470
+ - [ ] Modules with sensitive data have inlined security considerations
471
+ - [ ] Server/client boundaries are explicit per module
472
+ - [ ] State scope decisions match `architecture.md` patterns
473
+ - [ ] Files Inventory covers every change
633
474
 
634
- ## Chaining with other skills
475
+ ---
635
476
 
636
- This skill designs the implementation. It does not replace the existing execution workflow.
477
+ ## Hand-off to `/module-runner`
637
478
 
638
- After planning:
479
+ Plan is ready. Architect's work is done.
639
480
 
640
- 1. Use `.agent/skills/feature-workflow/SKILL.md` to implement each approved module.
641
- 2. Use `.agent/skills/auth-and-permissions/SKILL.md` for auth-sensitive modules.
642
- 3. Use `.agent/skills/react-quality-review/SKILL.md` after implementation.
481
+ User runs:
482
+ ```
483
+ /module-runner documentation/features/<feature_name>/
484
+ ```
643
485
 
644
- The generated module prompts should make downstream implementation safer, smaller in scope, and consistent with the repo's required plan -> approval -> implementation -> review -> test sequence, with `project-memory/core-memory.md` updated after every implemented module.
486
+ `/module-runner` reads each module prompt in order, spawns sub-agents for build/review/security/fix, and commits each module before the next. Architect does not participate in execution.