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.
- package/.agent/INSTRUCTIONS.md +31 -1
- package/.agent/frontend/skills/architect/SKILL.md +309 -467
- package/.agent/frontend/skills/auth-and-permissions/SKILL.md +185 -41
- package/.agent/frontend/skills/brainstorm/SKILL.md +127 -0
- package/.agent/frontend/skills/code-reviewer/SKILL.md +307 -0
- package/.agent/frontend/skills/{react-quality-review → code-reviewer}/examples.md +2 -2
- package/.agent/frontend/skills/create-blueprint/SKILL.md +280 -130
- package/.agent/frontend/skills/debug-issue/SKILL.md +76 -18
- package/.agent/frontend/skills/explore-codebase/SKILL.md +38 -19
- package/.agent/frontend/skills/quick-execute/SKILL.md +105 -0
- package/.agent/frontend/skills/refactor-safely/SKILL.md +47 -19
- package/.agent/frontend/skills/security-assessment/SKILL.md +182 -0
- package/.agent/frontend/skills/ux-architect/SKILL.md +198 -0
- package/.agent/frontend/skills/vuexy-component-guide/SKILL.md +51 -0
- package/.agent/frontend/workflows/module-runner.claude.md +233 -0
- package/.agent/frontend/workflows/module-runner.codex.md +159 -0
- package/.agent/frontend/workflows/module-runner.cursor.md +218 -0
- package/.agent/templates/UX_PLAN.md +228 -0
- package/README.md +28 -3
- package/package.json +2 -2
- package/scripts/setup-rules.js +13 -4
- package/.agent/frontend/skills/feature-workflow/SKILL.md +0 -61
- package/.agent/frontend/skills/react-quality-review/SKILL.md +0 -126
- package/.agent/frontend/workflows/build-feature-react.workflow.md +0 -82
- package/.agent/frontend/workflows/feature-module-runner.md +0 -101
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/_sections.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/_template.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/advanced-event-handler-refs.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/advanced-init-once.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/react-rules-calling.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/react-rules-hooks.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/react-rules-purity.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-activity.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-conditional-render.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-content-visibility.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-hoist-jsx.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rendering-usetransition-loading.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-defer-reads.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-dependencies.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-derived-state-no-effect.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-derived-state.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-functional-setstate.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-lazy-state-init.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-memo-with-default-value.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-memo.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-move-effect-to-event.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-no-inline-components.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-simple-expression-in-memo.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-transitions.md +0 -0
- /package/.agent/frontend/skills/{react-quality-review → code-reviewer}/rules/rerender-use-ref-transient-values.md +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# UX_PLAN — `<feature_name>`
|
|
2
|
+
|
|
3
|
+
_Written by `/ux-architect`. Consumed by `/architect` for technical module decomposition. Approved by user before `/architect` runs._
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Feature summary
|
|
8
|
+
|
|
9
|
+
<One paragraph: who the user is, what they see, what success looks like, accessibility/responsive scope.>
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 2. Scope decisions (confirmed with user)
|
|
14
|
+
|
|
15
|
+
**In scope:**
|
|
16
|
+
- ...
|
|
17
|
+
|
|
18
|
+
**Out of scope:**
|
|
19
|
+
- ...
|
|
20
|
+
|
|
21
|
+
**Assumptions:**
|
|
22
|
+
- ...
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 3. Reuse from existing app
|
|
27
|
+
|
|
28
|
+
Existing pages, views, hooks, or components this feature should extend or compose with rather than duplicate. Surface every relevant match — do not silently re-implement.
|
|
29
|
+
|
|
30
|
+
| Type | Name / path | How this feature uses it |
|
|
31
|
+
|------|------------|---------------------------|
|
|
32
|
+
| Page | `src/.../page.tsx` | Extends the existing list page with a new column / filter / action |
|
|
33
|
+
| View | `<ViewName>` | Composes within the new page's content area |
|
|
34
|
+
| Hook | `useX` | Re-used for data-fetching; no new hook needed |
|
|
35
|
+
| Component | `<ComponentName>` | Re-used in dialog body |
|
|
36
|
+
|
|
37
|
+
*(none)* — if the feature is genuinely greenfield in this codebase.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 4. Component reuse from design system
|
|
42
|
+
|
|
43
|
+
From `/vuexy-component-guide` sub-agent's `reuse_candidates`. Every UI element in this plan should appear here unless it has a corresponding entry in §5 "Gaps".
|
|
44
|
+
|
|
45
|
+
| UI element | Use component(s) | Pattern | Ref | Notes |
|
|
46
|
+
|-----------|------------------|---------|-----|-------|
|
|
47
|
+
| Edit-user dialog | `CustomDialog` + `CustomTextField` + react-hook-form template | Standard form-dialog | `examples.md#form-dialogs` | Validate with valibot; show field-level errors |
|
|
48
|
+
| User list table | `MUI DataGrid` (Vuexy wrapper) | Server-side pagination | `examples.md#data-grid` | Use the project's `useServerPaginatedQuery` hook |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 5. Gaps & new patterns
|
|
53
|
+
|
|
54
|
+
From `/vuexy-component-guide` sub-agent's `gaps`. Each gap must have a decision attached — do not leave a gap unresolved.
|
|
55
|
+
|
|
56
|
+
| UI element | Why no reuse | Decision |
|
|
57
|
+
|-----------|--------------|----------|
|
|
58
|
+
| Inline editable cells | No matching wrapper in design system today | **Defer** — show a row-level edit dialog instead (added to §4) |
|
|
59
|
+
| Custom split-pane layout | Not in design system | **Extend design system** — surface to user; if approved, must run `/create-blueprint design-system` before implementation |
|
|
60
|
+
|
|
61
|
+
*(none)* — if the design system fully covers this feature's UI.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 6. Pages & routes
|
|
66
|
+
|
|
67
|
+
Every new or modified route in `src/app/` (or the project's pages directory per `repo-map.md`).
|
|
68
|
+
|
|
69
|
+
| Route | Action | `'use client'`? | Auth | Notes |
|
|
70
|
+
|-------|--------|-----------------|------|-------|
|
|
71
|
+
| `/dashboard/users` | Modify (add filter UI) | server (page) + client (filter component) | private + `users:read` | — |
|
|
72
|
+
| `/dashboard/users/[id]` | New | server (page) + client (edit form) | private + `users:update` | — |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 7. Page-by-page layout
|
|
77
|
+
|
|
78
|
+
For each page added or significantly modified, an ASCII wireframe + region-by-region composition.
|
|
79
|
+
|
|
80
|
+
### `/dashboard/users` (modified)
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
84
|
+
│ Breadcrumb: Dashboard > Users │
|
|
85
|
+
├──────────────────────────────────────────────────────────────┤
|
|
86
|
+
│ Header: "Users" [Add user button] [Bulk actions menu] │
|
|
87
|
+
├──────────────────────────────────────────────────────────────┤
|
|
88
|
+
│ Filter bar: [Search input] [Role select] [Status toggle] │ ← NEW
|
|
89
|
+
├──────────────────────────────────────────────────────────────┤
|
|
90
|
+
│ │
|
|
91
|
+
│ Data grid (existing UserListGrid) │
|
|
92
|
+
│ Adds column: "Last active" │ ← NEW
|
|
93
|
+
│ │
|
|
94
|
+
└──────────────────────────────────────────────────────────────┘
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Composition:**
|
|
98
|
+
- Header: existing `<PageHeader>` (no change)
|
|
99
|
+
- Filter bar (NEW): composed of `CustomTextField` (search) + `CustomAutocomplete` (role) + `CustomSwitch` (status)
|
|
100
|
+
- Data grid: existing `<UserListGrid>`, extended with a "lastActive" column via the existing `columns` prop API
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 8. Dialogs / drawers / modals
|
|
105
|
+
|
|
106
|
+
| Name | Trigger | Composition | Dismissal |
|
|
107
|
+
|------|---------|-------------|-----------|
|
|
108
|
+
| Edit user dialog | Row → kebab menu → "Edit" | `CustomDialog` (md size) → header + react-hook-form body + footer with Cancel/Save | Cancel → close; Save → validate → submit → toast → close |
|
|
109
|
+
| Bulk-action confirm modal | "Bulk actions" → action → "Apply" | `CustomDialog` (sm size) → confirmation text + Cancel/Confirm | Standard |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 9. Forms
|
|
114
|
+
|
|
115
|
+
For each form, list fields + validation + submit behavior.
|
|
116
|
+
|
|
117
|
+
### Edit user form
|
|
118
|
+
|
|
119
|
+
| Field | Type | Validation | Notes |
|
|
120
|
+
|-------|------|------------|-------|
|
|
121
|
+
| `email` | text | required, email | disabled in edit mode (immutable) |
|
|
122
|
+
| `displayName` | text | required, max 100 | — |
|
|
123
|
+
| `role` | select | required, must be in role enum from `auth-model.md` | — |
|
|
124
|
+
| `isActive` | switch | — | — |
|
|
125
|
+
|
|
126
|
+
- **Library**: react-hook-form + valibot (per `design-system.md`)
|
|
127
|
+
- **Submit behavior**: optimistic UI + server reconcile; on error → roll back UI and show field-level errors from server response
|
|
128
|
+
- **Error rendering**: inline under field via `helperText`; toast for unexpected server errors
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 10. State surface
|
|
133
|
+
|
|
134
|
+
| State | Where it lives | Shape | Why there |
|
|
135
|
+
|-------|---------------|-------|-----------|
|
|
136
|
+
| Filter values (search, role, status) | Local component state (`useState`) in the filter bar | `{ search: string; role: string \| null; isActive: boolean \| null }` | Page-scoped, no cross-component sync needed |
|
|
137
|
+
| User list data | Server state via existing `useUsersList(filters)` hook | per existing API | — |
|
|
138
|
+
| Edit-dialog open + selected user id | Lifted to page-level state | `{ open: boolean; userId: string \| null }` | Dialog controlled by parent; row triggers via callback |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 11. Empty / loading / error states
|
|
143
|
+
|
|
144
|
+
**Required for every list and fetch surface — no exceptions.**
|
|
145
|
+
|
|
146
|
+
| Surface | Empty | Loading | Error |
|
|
147
|
+
|---------|-------|---------|-------|
|
|
148
|
+
| User list | "No users match these filters." + clear-filters button | Existing `<GridSkeleton>` | "Couldn't load users. Retry." button — uses `<ErrorState>` |
|
|
149
|
+
| Edit-user form | n/a | Disable form + show spinner overlay during submit | Field-level errors inline; toast for network errors |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 12. Accessibility
|
|
154
|
+
|
|
155
|
+
- **Keyboard nav**: filter bar fully tab-navigable; Esc closes dialog and restores focus to the row's kebab menu
|
|
156
|
+
- **ARIA**: filter bar is `role="search"`; dialog gets `aria-labelledby` pointing to its title
|
|
157
|
+
- **Focus management**: on dialog open, focus moves to first invalid (or first non-disabled) field; on close, focus returns to the trigger
|
|
158
|
+
- **Color contrast**: rely on theme defaults (per `design-system.md`); no inline colors
|
|
159
|
+
- **Screen reader**: each filter has a visible label, not just placeholder text
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 13. Responsive
|
|
164
|
+
|
|
165
|
+
| Breakpoint | Behavior |
|
|
166
|
+
|-----------|----------|
|
|
167
|
+
| Mobile (< sm) | Filter bar collapses into a single "Filters" button → opens a drawer; grid switches to card view |
|
|
168
|
+
| Tablet (sm–md) | Filter bar wraps to two rows; grid keeps table view with horizontal scroll |
|
|
169
|
+
| Desktop (≥ md) | Layout as shown in wireframe |
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 14. Auth gating
|
|
174
|
+
|
|
175
|
+
| Surface | Gate (from `auth-model.md`) | Behavior if unauthorized |
|
|
176
|
+
|---------|-----------------------------|--------------------------|
|
|
177
|
+
| Route `/dashboard/users` | Private + permission `users:read` | Existing private-route HOC redirects to `/login` |
|
|
178
|
+
| "Edit" action | Permission `users:update` | Action menu item disabled with tooltip "You don't have permission to edit users" |
|
|
179
|
+
| "Delete" action | Permission `users:delete` | Same as above |
|
|
180
|
+
|
|
181
|
+
`useAuth()` (or documented equivalent) drives every gate. No duplicate cookie reads.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 15. Design-system fit
|
|
186
|
+
|
|
187
|
+
Does this feature require any additions to the design system?
|
|
188
|
+
|
|
189
|
+
- **New tokens?** No / Yes — [list]
|
|
190
|
+
- **New custom wrappers?** No / Yes — [list with proposed names]
|
|
191
|
+
- **Pattern additions to `vuexy-component-guide`?** No / Yes — [describe]
|
|
192
|
+
|
|
193
|
+
Default expectation: **No**. If any answer is "Yes", surface it as a finding in §17 and recommend running `/create-blueprint design-system` to formalize before implementation.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 16. Open questions for user
|
|
198
|
+
|
|
199
|
+
Real questions only — decisions you can't make without input.
|
|
200
|
+
|
|
201
|
+
- [ ] Should the bulk-action confirm modal show the affected user count? (Affects API contract)
|
|
202
|
+
- [ ] Is "Last active" defined as last login or last API request? (Affects backend contract and `/architect`'s technical plan)
|
|
203
|
+
|
|
204
|
+
*(none)* — if nothing is open.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 17. Findings (design-system / auth-model / architecture)
|
|
209
|
+
|
|
210
|
+
Anything that requires a decision **before** `/architect` should plan technical modules.
|
|
211
|
+
|
|
212
|
+
| Finding | Type | Resolution required |
|
|
213
|
+
|---------|------|---------------------|
|
|
214
|
+
| New "filter drawer" pattern for mobile | Design-system gap | Extend design system OR fall back to existing dialog pattern |
|
|
215
|
+
|
|
216
|
+
*(none)* — if no extensions or deviations needed.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Hand-off
|
|
221
|
+
|
|
222
|
+
This UX plan is the input to `/architect`. After user approval:
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
/architect documentation/features/<feature_name>/
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`/architect` will read this plan and produce `<feature>_MODULE_WISE_PLAN.md` + per-module prompts that `/module-runner` consumes.
|
package/README.md
CHANGED
|
@@ -23,6 +23,8 @@ Serena runs via `uvx`. If you don't have it: https://docs.astral.sh/uv/getting-s
|
|
|
23
23
|
|
|
24
24
|
## The end-to-end journey
|
|
25
25
|
|
|
26
|
+
### Backend (NestJS / Express / Fastify / Koa)
|
|
27
|
+
|
|
26
28
|
```
|
|
27
29
|
1. /create-blueprint all → bootstrap project-memory/
|
|
28
30
|
2. /brainstorm <problem> → explore 3-5 approaches
|
|
@@ -30,7 +32,17 @@ Serena runs via `uvx`. If you don't have it: https://docs.astral.sh/uv/getting-s
|
|
|
30
32
|
4. /module-runner <feature-dir> → autonomous build, review, security, commit per module
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
### Frontend (React / Next.js — adds a UX-planning step)
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
1. /create-blueprint all → bootstrap project-memory/ (incl. design-system.md)
|
|
39
|
+
2. /brainstorm <problem> → explore 3-5 approaches
|
|
40
|
+
3. /ux-architect <feature> → UX/layout plan with component reuse from /vuexy-component-guide
|
|
41
|
+
4. /architect <feature> → technical module plan referencing the UX plan (NEVER writes code)
|
|
42
|
+
5. /module-runner <feature-dir> → autonomous build, lint, test, review, security, commit per module
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Plus on-demand utilities (both stacks):
|
|
34
46
|
|
|
35
47
|
- `/quick-execute <small task>` — fast execution, no plan gate
|
|
36
48
|
- `/code-reviewer` — review the current branch
|
|
@@ -55,6 +67,19 @@ Plus on-demand utilities:
|
|
|
55
67
|
| `/refactor-safely` | Bounded-blast-radius refactors via Serena's symbolic edit tools (`rename_symbol`, `replace_symbol_body`, `safe_delete_symbol`). |
|
|
56
68
|
| `/debug-issue` | Stack-trace-driven debugging with Serena. |
|
|
57
69
|
|
|
70
|
+
### Frontend-only additions
|
|
71
|
+
|
|
72
|
+
| Skill | Purpose |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `/ux-architect` | **Pure UX planner.** Reads `project-memory/design-system.md` + `repo-map.md` + `auth-model.md`, consults `/vuexy-component-guide` as a sub-agent to maximize component reuse, surveys existing pages via Serena, writes `<feature>_UX_PLAN.md`. **Never writes code.** Hands off to `/architect` for technical decomposition. |
|
|
75
|
+
| `/vuexy-component-guide` | MUI v7 + Vuexy component reference. Standalone mode = conversational guidance. Sub-agent mode (used by `/ux-architect`) = JSON reuse-candidates + gaps. |
|
|
76
|
+
|
|
77
|
+
Frontend `/code-reviewer` additionally enforces 23 React-specific rules (Rules of React, rerender optimization, rendering performance, advanced patterns).
|
|
78
|
+
|
|
79
|
+
Frontend `/security-assessment` covers client-side concerns: XSS, CSP, `NEXT_PUBLIC_` leakage, third-party scripts, cookies/storage.
|
|
80
|
+
|
|
81
|
+
Frontend `/auth-and-permissions` audits client-side gating (private routes, useAuth, permission keys) — UI correctness, not the security boundary itself (server enforces).
|
|
82
|
+
|
|
58
83
|
---
|
|
59
84
|
|
|
60
85
|
## What gets created in your project
|
|
@@ -119,8 +144,8 @@ The major changes in v2:
|
|
|
119
144
|
| Stack | Status |
|
|
120
145
|
|---|---|
|
|
121
146
|
| Backend (NestJS / Express / Fastify / Koa) | ✅ First-class (v2.0) |
|
|
122
|
-
| Frontend (React / Next
|
|
123
|
-
| Monolith | ⏳
|
|
147
|
+
| Frontend (React / Next.js) | ✅ First-class (v2.1) — same architecture as backend plus `/ux-architect` + `/vuexy-component-guide` |
|
|
148
|
+
| Monolith | ⏳ Carried over from v1; not yet refreshed for v2 architecture |
|
|
124
149
|
|
|
125
150
|
Backend is the focus of v2.0. Frontend and monolith updates will follow.
|
|
126
151
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nurosys-agents",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Portable
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Portable agent skills for backend (NestJS/Express/Fastify/Koa) and frontend (React/Next.js). Skills: architect, code-reviewer, security-assessment, auth-and-permissions, brainstorm, quick-execute, create-blueprint — plus frontend-only ux-architect + vuexy-component-guide — plus a multi-IDE module-runner. Built on Serena for symbolic code analysis. Works with Claude Code, Cursor, and Codex.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://gitlab.com/nurosys/nurosys-agents.git"
|
package/scripts/setup-rules.js
CHANGED
|
@@ -48,16 +48,25 @@ const RULE_MAP = [
|
|
|
48
48
|
source: 'auth-model.md',
|
|
49
49
|
cursorTarget: 'auth-model.mdc',
|
|
50
50
|
antigravityTarget: 'auth-model.md',
|
|
51
|
-
description: 'Auth model
|
|
52
|
-
|
|
51
|
+
description: 'Auth model — backend guards/RBAC/tenant scoping OR client-side context/useAuth/route gating, depending on stack',
|
|
52
|
+
// Globs match both backend and frontend auth surfaces — only the present paths actually trigger
|
|
53
|
+
globs: ['src/auth/**', 'src/core/auth/**', 'src/contexts/**Auth**', 'src/utils/auth*', 'src/configs/auth*', 'src/app/**/(private)/**'],
|
|
53
54
|
alwaysApply: false,
|
|
54
55
|
},
|
|
55
56
|
{
|
|
56
57
|
source: 'models.md',
|
|
57
58
|
cursorTarget: 'models.mdc',
|
|
58
59
|
antigravityTarget: 'models.md',
|
|
59
|
-
description: 'Domain model inventory
|
|
60
|
-
globs: ['src/**/*.model.ts', 'src/**/*.entity.ts'],
|
|
60
|
+
description: 'Domain model inventory — backend entities OR frontend shared TypeScript types/schemas',
|
|
61
|
+
globs: ['src/**/*.model.ts', 'src/**/*.entity.ts', 'src/types/**', 'src/schemas/**'],
|
|
62
|
+
alwaysApply: false,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
source: 'design-system.md',
|
|
66
|
+
cursorTarget: 'design-system.mdc',
|
|
67
|
+
antigravityTarget: 'design-system.md',
|
|
68
|
+
description: 'Design system — design tokens, custom-wrapper inventory, form patterns, theming (frontend-only artifact)',
|
|
69
|
+
globs: ['src/components/**', 'src/views/**', 'src/@core/**', 'src/themes/**'],
|
|
61
70
|
alwaysApply: false,
|
|
62
71
|
},
|
|
63
72
|
{
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: feature-workflow
|
|
3
|
-
description: Enforce requirement clarification, study, detailed planning, implementation, quality review, and testing for every feature/refactor.
|
|
4
|
-
when_to_use:
|
|
5
|
-
- Any new feature in `src/app`, `src/components`, `src/services`, or `src/views`
|
|
6
|
-
- Any refactor that changes behavior
|
|
7
|
-
references:
|
|
8
|
-
- project-memory/constitution.md
|
|
9
|
-
- project-memory/repo-map.md
|
|
10
|
-
- project-memory/quality-playbook.md
|
|
11
|
-
- project-memory/core-memory.md
|
|
12
|
-
- .agent/skills/react-quality-review/SKILL.md
|
|
13
|
-
- .agent/templates/FEATURE_PLAN.md
|
|
14
|
-
- .agent/templates/REVIEW_REPORT.md
|
|
15
|
-
- .agent/templates/TEST_PLAN.md
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# Feature Workflow Skill
|
|
19
|
-
|
|
20
|
-
## Required sequence (no skipping)
|
|
21
|
-
|
|
22
|
-
0. **Foundation read (mandatory)**
|
|
23
|
-
- Read `project-memory/constitution.md`, `project-memory/repo-map.md`, `project-memory/auth-model.md`, and `project-memory/core-memory.md`.
|
|
24
|
-
1. **Requirement clarification**
|
|
25
|
-
- Ask clarifying questions where needed.
|
|
26
|
-
- Capture hard constraints (auth, permissions, performance, data contracts, deadlines).
|
|
27
|
-
2. **Codebase study**
|
|
28
|
-
- List relevant existing files/modules found before planning implementation.
|
|
29
|
-
3. **Detailed plan**
|
|
30
|
-
- Define new/changed functions and hooks.
|
|
31
|
-
- Define shared derivations/selectors and where computed values should live.
|
|
32
|
-
- List all files to be touched.
|
|
33
|
-
4. **Implementation**
|
|
34
|
-
- Execute the plan in dependency order.
|
|
35
|
-
5. **Quality review + refactor**
|
|
36
|
-
- Run `.agent/skills/react-quality-review/SKILL.md`.
|
|
37
|
-
- Produce `Documentation/reports/REVIEW_REPORT.md`.
|
|
38
|
-
- Apply required refactors from findings.
|
|
39
|
-
6. **Testing**
|
|
40
|
-
- Add/run unit tests for pure transforms/selectors.
|
|
41
|
-
- Add/run integration tests for pages/components where applicable.
|
|
42
|
-
7. **Update memory**
|
|
43
|
-
- Append the completed module/feature summary to `project-memory/core-memory.md`.
|
|
44
|
-
- Record key decisions, files changed, tests run, and any carry-forward notes.
|
|
45
|
-
|
|
46
|
-
## Mandatory artifacts
|
|
47
|
-
|
|
48
|
-
- Feature plan: `Documentation/features/<feature_name>/FEATURE_PLAN.md` or `Documentation/plans/FEATURE_PLAN.md` (from `.agent/templates/FEATURE_PLAN.md`)
|
|
49
|
-
- Review report: `Documentation/reports/REVIEW_REPORT.md` (from `.agent/templates/REVIEW_REPORT.md`, filled after implementation)
|
|
50
|
-
- Test plan: `Documentation/features/<feature_name>/TEST_PLAN.md` or `Documentation/plans/TEST_PLAN.md` (from `.agent/templates/TEST_PLAN.md`, filled and executed)
|
|
51
|
-
- `project-memory/core-memory.md` (updated after implementation)
|
|
52
|
-
|
|
53
|
-
## PR gate checklist
|
|
54
|
-
|
|
55
|
-
- [ ] Clarification questions + constraints documented.
|
|
56
|
-
- [ ] Codebase study lists relevant files reviewed.
|
|
57
|
-
- [ ] Detailed plan lists functions/hooks, shared derivations, computed-value ownership, file touch list.
|
|
58
|
-
- [ ] React quality review executed, `Documentation/reports/REVIEW_REPORT.md` produced, and refactors applied.
|
|
59
|
-
- [ ] Unit tests added for pure transforms/selectors.
|
|
60
|
-
- [ ] Integration tests added/updated for pages/components where applicable.
|
|
61
|
-
- [ ] `project-memory/core-memory.md` updated with implementation outcomes and next-step notes.
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: react-quality-review
|
|
3
|
-
description: >
|
|
4
|
-
Post-implementation quality gate for React/Next.js. Covers Rules of React,
|
|
5
|
-
re-render optimization, rendering performance, and advanced patterns (23 rules in 4
|
|
6
|
-
categories). Use after features/refactors and when reviewing React PRs.
|
|
7
|
-
when_to_use:
|
|
8
|
-
- After any feature implementation
|
|
9
|
-
- After any refactor (UI, hooks, services, routes)
|
|
10
|
-
- When writing or reviewing React components, hooks, or state management
|
|
11
|
-
- When optimizing re-render or rendering performance
|
|
12
|
-
references:
|
|
13
|
-
- project-memory/quality-playbook.md
|
|
14
|
-
- project-memory/repo-map.md
|
|
15
|
-
- project-memory/auth-model.md
|
|
16
|
-
- src/contexts/authContext.tsx
|
|
17
|
-
- src/utils/auth.ts
|
|
18
|
-
- src/services/
|
|
19
|
-
- .agent/skills/react-quality-review/rules/
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
# React Quality Review Skill
|
|
23
|
-
|
|
24
|
-
Run this skill immediately after coding, before merge. It combines the project's playbook checks with detailed React review rules (same taxonomy as the legacy `review-react` skill).
|
|
25
|
-
|
|
26
|
-
## References
|
|
27
|
-
|
|
28
|
-
- `project-memory/quality-playbook.md` — definitions and repo anchors
|
|
29
|
-
- `.agent/templates/REVIEW_REPORT.md` — report structure
|
|
30
|
-
- `.agent/skills/react-quality-review/rules/` — one file per rule (explanation, bad/good examples, links)
|
|
31
|
-
- `.agent/skills/react-quality-review/examples.md` — concrete examples
|
|
32
|
-
|
|
33
|
-
## Rule categories by priority
|
|
34
|
-
|
|
35
|
-
Performance and correctness are grouped into four categories (23 rules), ordered by typical impact:
|
|
36
|
-
|
|
37
|
-
| Priority | Category | Impact | Prefix | Rules |
|
|
38
|
-
|----------|----------|--------|--------|-------|
|
|
39
|
-
| 1 | Rules of React | CRITICAL | `react-rules-` | 3 |
|
|
40
|
-
| 2 | Re-render optimization | MEDIUM | `rerender-` | 13 |
|
|
41
|
-
| 3 | Rendering performance | MEDIUM | `rendering-` | 5 |
|
|
42
|
-
| 4 | Advanced patterns | LOW | `advanced-` | 2 |
|
|
43
|
-
|
|
44
|
-
### 1. Rules of React (CRITICAL)
|
|
45
|
-
|
|
46
|
-
- `react-rules-purity` — Components and hooks must be pure; no side effects during render
|
|
47
|
-
- `react-rules-hooks` — Only call hooks at the top level and from React functions
|
|
48
|
-
- `react-rules-calling` — Never call components as functions or pass hooks as values
|
|
49
|
-
|
|
50
|
-
### 2. Re-render optimization (MEDIUM)
|
|
51
|
-
|
|
52
|
-
- `rerender-no-inline-components` — Never define components inside other components
|
|
53
|
-
- `rerender-derived-state-no-effect` — Derive state during render, not in effects
|
|
54
|
-
- `rerender-memo` — Extract memoized child components to avoid re-renders
|
|
55
|
-
- `rerender-memo-with-default-value` — Hoist default non-primitive props outside memo
|
|
56
|
-
- `rerender-simple-expression-in-memo` — Don’t useMemo for simple primitive expressions
|
|
57
|
-
- `rerender-defer-reads` — Don’t subscribe to state only used in callbacks
|
|
58
|
-
- `rerender-dependencies` — Use primitive values in effect dependencies
|
|
59
|
-
- `rerender-derived-state` — Subscribe to derived booleans, not raw objects
|
|
60
|
-
- `rerender-functional-setstate` — Use functional setState for stable callbacks
|
|
61
|
-
- `rerender-lazy-state-init` — Pass an initializer to useState for expensive values
|
|
62
|
-
- `rerender-move-effect-to-event` — Move interaction logic from effects to event handlers
|
|
63
|
-
- `rerender-transitions` — Use startTransition for non-urgent state updates
|
|
64
|
-
- `rerender-use-ref-transient-values` — Use refs for frequently changing transient values
|
|
65
|
-
|
|
66
|
-
### 3. Rendering performance (MEDIUM)
|
|
67
|
-
|
|
68
|
-
- `rendering-hoist-jsx` — Hoist static JSX outside component functions
|
|
69
|
-
- `rendering-conditional-render` — Prefer ternary over `&&` for conditional rendering
|
|
70
|
-
- `rendering-usetransition-loading` — Prefer useTransition over manual loading state
|
|
71
|
-
- `rendering-content-visibility` — Use CSS `content-visibility: auto` for long lists
|
|
72
|
-
- `rendering-activity` — Use Activity for preserving hidden UI state
|
|
73
|
-
|
|
74
|
-
### 4. Advanced patterns (LOW)
|
|
75
|
-
|
|
76
|
-
- `advanced-event-handler-refs` — Store latest event handlers in refs for stable callbacks
|
|
77
|
-
- `advanced-init-once` — Initialize app-level singletons once, not per mount
|
|
78
|
-
|
|
79
|
-
## How to use the rule files
|
|
80
|
-
|
|
81
|
-
For any finding, open the matching file under `.agent/skills/react-quality-review/rules/`. Each file includes why it matters, incorrect vs correct examples, and reference links.
|
|
82
|
-
|
|
83
|
-
Examples:
|
|
84
|
-
|
|
85
|
-
- `.agent/skills/react-quality-review/rules/react-rules-purity.md`
|
|
86
|
-
- `.agent/skills/react-quality-review/rules/rerender-no-inline-components.md`
|
|
87
|
-
|
|
88
|
-
See `rules/_template.md` and `rules/_sections.md` for structure across rules.
|
|
89
|
-
|
|
90
|
-
## Required checks (cross-check with playbook)
|
|
91
|
-
|
|
92
|
-
Use `project-memory/quality-playbook.md` for definitions and repo anchors. Verify at least:
|
|
93
|
-
|
|
94
|
-
- Derived state and effects (`rerender-derived-state-no-effect`, `rerender-derived-state`, playbook)
|
|
95
|
-
- Effect misuse / event vs effect boundaries (`rerender-move-effect-to-event`, playbook)
|
|
96
|
-
- Memoization boundaries (`rerender-memo`, `rerender-simple-expression-in-memo`, playbook)
|
|
97
|
-
- Duplicate computations and repeated transforms (playbook + relevant `rerender-*` rules)
|
|
98
|
-
- Next.js App Router server/client boundaries (playbook)
|
|
99
|
-
- Dead code or duplicate logic residue (playbook)
|
|
100
|
-
|
|
101
|
-
## Steps
|
|
102
|
-
|
|
103
|
-
1. Read `project-memory/quality-playbook.md` and scan changed files against it and the rule list above; drill into specific `rules/*.md` files when something is unclear.
|
|
104
|
-
2. Write `Documentation/reports/REVIEW_REPORT.md` using `.agent/templates/REVIEW_REPORT.md`; include findings and exact file/line pointers. Map severe issues to `react-rules-*` where applicable.
|
|
105
|
-
3. For each finding, propose the smallest refactor that moves code toward playbook anchors and the relevant rule file.
|
|
106
|
-
4. Confirm auth boundaries stay centralized (`src/contexts/authContext.tsx`, `src/utils/auth.ts`, `src/configs/authConfig.ts`).
|
|
107
|
-
5. Attach the completed review report to PR notes.
|
|
108
|
-
|
|
109
|
-
## Review report template (fill this)
|
|
110
|
-
|
|
111
|
-
```md
|
|
112
|
-
## Findings
|
|
113
|
-
- [severity] <issue> — <file/path> — <playbook check and/or rule id, e.g. rerender-memo>
|
|
114
|
-
|
|
115
|
-
## Proposed refactors
|
|
116
|
-
- <refactor action> -> <target file(s)> -> <playbook anchor and/or rule file>
|
|
117
|
-
|
|
118
|
-
## Files to change
|
|
119
|
-
- <path>
|
|
120
|
-
- <path>
|
|
121
|
-
|
|
122
|
-
## Tests to add
|
|
123
|
-
- <test name> — <what regression it prevents> — <unit/integration/manual>
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
For concrete examples, see `.agent/skills/react-quality-review/examples.md`.
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: build-feature
|
|
3
|
-
description: Strict end-to-end feature workflow with mandatory plan approval, implementation, quality review, and testing.
|
|
4
|
-
strict_mode: true
|
|
5
|
-
owner: agent
|
|
6
|
-
references:
|
|
7
|
-
- project-memory/constitution.md
|
|
8
|
-
- project-memory/repo-map.md
|
|
9
|
-
- project-memory/auth-model.md
|
|
10
|
-
- project-memory/quality-playbook.md
|
|
11
|
-
- project-memory/core-memory.md
|
|
12
|
-
- .agent/skills/feature-workflow/SKILL.md
|
|
13
|
-
- .agent/skills/auth-and-permissions/SKILL.md
|
|
14
|
-
- .agent/skills/react-quality-review/SKILL.md
|
|
15
|
-
- .agent/templates/FEATURE_PLAN.md
|
|
16
|
-
- .agent/templates/REVIEW_REPORT.md
|
|
17
|
-
- .agent/templates/TEST_PLAN.md
|
|
18
|
-
outputs:
|
|
19
|
-
- Documentation/plans/FEATURE_PLAN.md (or Documentation/features/<feature_name>/ when running a named feature)
|
|
20
|
-
- Documentation/reports/REVIEW_REPORT.md
|
|
21
|
-
- Documentation/plans/TEST_PLAN.md (or Documentation/features/<feature_name>/ when running a named feature)
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
# Build Feature Workflow (Strict)
|
|
25
|
-
|
|
26
|
-
## Non-negotiable gate
|
|
27
|
-
|
|
28
|
-
- Always load and follow `project-memory/constitution.md`.
|
|
29
|
-
- Always read `project-memory/quality-playbook.md`.
|
|
30
|
-
- Always read and maintain `project-memory/core-memory.md`.
|
|
31
|
-
- **No coding before plan approval.**
|
|
32
|
-
- Required artifacts:
|
|
33
|
-
- Feature plan: `Documentation/features/<feature_name>/FEATURE_PLAN.md` or `Documentation/plans/FEATURE_PLAN.md`
|
|
34
|
-
- Review report: `Documentation/reports/REVIEW_REPORT.md`
|
|
35
|
-
- Test plan: `Documentation/features/<feature_name>/TEST_PLAN.md` or `Documentation/plans/TEST_PLAN.md`
|
|
36
|
-
|
|
37
|
-
## Steps
|
|
38
|
-
|
|
39
|
-
1. **Load foundation docs**
|
|
40
|
-
- Read `project-memory/constitution.md`, `project-memory/repo-map.md`, and `project-memory/auth-model.md`.
|
|
41
|
-
- Confirm constraints relevant to the request.
|
|
42
|
-
|
|
43
|
-
2. **Run feature workflow skill and create plan**
|
|
44
|
-
- Use `.agent/skills/feature-workflow/SKILL.md`.
|
|
45
|
-
- Generate the feature plan in `Documentation/features/<feature_name>/FEATURE_PLAN.md` or `Documentation/plans/FEATURE_PLAN.md` from `.agent/templates/FEATURE_PLAN.md`.
|
|
46
|
-
|
|
47
|
-
3. **Approval checkpoint (hard stop)**
|
|
48
|
-
- Present plan and stop for explicit approval.
|
|
49
|
-
- Do not modify implementation files before approval.
|
|
50
|
-
|
|
51
|
-
4. **Implement after approval**
|
|
52
|
-
- Execute the approved file touch list in order.
|
|
53
|
-
- Keep pages thin and move logic into `src/views/**`, hooks, and services.
|
|
54
|
-
|
|
55
|
-
5. **Conditional auth-and-permissions pass**
|
|
56
|
-
- Run `.agent/skills/auth-and-permissions/SKILL.md` when touching:
|
|
57
|
-
- `src/contexts/authContext.tsx`
|
|
58
|
-
- `src/utils/auth.ts`
|
|
59
|
-
- `src/configs/authConfig.ts`
|
|
60
|
-
- `src/types/auth.ts`
|
|
61
|
-
- protected pages under `src/app/[lang]/(dashboard)/(private)/**`
|
|
62
|
-
- auth-sensitive API routes under `src/app/api/**`
|
|
63
|
-
|
|
64
|
-
6. **Run quality review and produce report**
|
|
65
|
-
- Run `.agent/skills/react-quality-review/SKILL.md`.
|
|
66
|
-
- Create `Documentation/reports/REVIEW_REPORT.md` from `.agent/templates/REVIEW_REPORT.md`.
|
|
67
|
-
- Apply required refactors from findings.
|
|
68
|
-
|
|
69
|
-
7. **Generate and execute test plan**
|
|
70
|
-
- Create the test plan in `Documentation/features/<feature_name>/TEST_PLAN.md` or `Documentation/plans/TEST_PLAN.md` from `.agent/templates/TEST_PLAN.md`.
|
|
71
|
-
- Add/update relevant tests (unit/integration/manual).
|
|
72
|
-
|
|
73
|
-
8. **Run test commands**
|
|
74
|
-
- Run available scripts (`npm run test`, `npm run lint`, feature-specific tests).
|
|
75
|
-
- Record command outcomes in the test plan file (Documentation/plans or Documentation/features/<feature_name>/).
|
|
76
|
-
|
|
77
|
-
9. **Update core memory**
|
|
78
|
-
- Append the completed module or feature summary to `project-memory/core-memory.md`.
|
|
79
|
-
- Include files changed, decisions made, tests run, and follow-up notes for future work.
|
|
80
|
-
|
|
81
|
-
10. **Final output**
|
|
82
|
-
- Return summary of files changed, verification steps, and test results.
|