@hanzlaa/rcode 4.10.5 → 4.11.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 (55) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/CONTRIBUTING.md +3 -0
  4. package/cli/install.js +272 -1
  5. package/dist/rcode.js +259 -236
  6. package/package.json +1 -1
  7. package/rcode/agents/rcode-project-researcher.md +1 -1
  8. package/rcode/agents/rcode-ux-designer.md +1 -0
  9. package/rcode/agents/rcode-verifier.md +2 -2
  10. package/rcode/agents/rules/planner/common-patterns.md +2 -1
  11. package/rcode/agents/rules/planner/goal-backward-thinking.md +33 -0
  12. package/rcode/agents/rules/planner/sprint-verification.md +1 -0
  13. package/rcode/agents/rules/planner/task-templates.md +20 -1
  14. package/rcode/agents/rules/project-researcher/detailed-guide.md +10 -0
  15. package/rcode/agents/rules/sprint-checker/dimensions.md +74 -0
  16. package/rcode/agents/rules/sprint-checker/process.md +12 -0
  17. package/rcode/agents/rules/verifier/behavioral-spot-checks.md +5 -1
  18. package/rcode/agents/rules/verifier/gap-output.md +5 -0
  19. package/rcode/agents/rules/verifier/reachability-check.md +69 -0
  20. package/rcode/bin/rcode-tools.cjs +39 -3
  21. package/rcode/commands/ui-phase.md +1 -1
  22. package/rcode/references/design-library/LICENSE +21 -0
  23. package/rcode/references/design-library/README.md +37 -0
  24. package/rcode/references/design-library/charts.csv +26 -0
  25. package/rcode/references/design-library/colors.csv +97 -0
  26. package/rcode/references/design-library/icons.csv +101 -0
  27. package/rcode/references/design-library/styles.csv +68 -0
  28. package/rcode/references/design-library/typography.csv +58 -0
  29. package/rcode/references/design-library/ui-reasoning.csv +101 -0
  30. package/rcode/references/design-library/ux-guidelines.csv +100 -0
  31. package/rcode/references/design-library/web-interface.csv +31 -0
  32. package/rcode/references/domain-probes.md +8 -0
  33. package/rcode/references/project-types.yaml +29 -0
  34. package/rcode/references/questioning.md +3 -0
  35. package/rcode/references/roadmapper-playbook.md +90 -0
  36. package/rcode/references/sprint-checker-playbook.md +14 -0
  37. package/rcode/references/verifier-playbook.md +20 -7
  38. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/SKILL.md +10 -1
  39. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/templates/wave-prompt.md +2 -0
  40. package/rcode/workflows/autonomous.md +26 -3
  41. package/rcode/workflows/complete-milestone.md +1 -1
  42. package/rcode/workflows/council.md +51 -6
  43. package/rcode/workflows/discuss-phase.md +9 -2
  44. package/rcode/workflows/execute-sprint.md +35 -7
  45. package/rcode/workflows/execute-waves.md +2 -2
  46. package/rcode/workflows/execute.md +21 -6
  47. package/rcode/workflows/help.md +1 -1
  48. package/rcode/workflows/plan-research-validation.md +1 -1
  49. package/rcode/workflows/plan.md +31 -0
  50. package/rcode/workflows/ship.md +22 -0
  51. package/rcode/workflows/ui-phase.md +104 -22
  52. package/rcode/workflows/ui-review.md +9 -1
  53. package/rcode/workflows/verify-work.md +1 -1
  54. package/server/dashboard.js +18 -1
  55. package/server/lib/scanner.js +25 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzlaa/rcode",
3
- "version": "4.10.5",
3
+ "version": "4.11.0",
4
4
  "description": "rcode — the AI team that never forgets. Persistent memory, specialist agents, and slash commands for AI IDEs. Works in Claude Code, Cursor, Gemini, VS Code, and Antigravity.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
@@ -89,7 +89,7 @@ Named rules. Cite by name when applying.
89
89
  ## Workflow
90
90
 
91
91
  1. **Read `<files_to_read>` block** — mandatory before any other action.
92
- 2. **Understand the domain** — what ecosystem is this? What are the key libraries, frameworks, competitors?
92
+ 2. **Understand the domain** — what ecosystem is this? What are the key libraries, frameworks, competitors? Also verify: what roles/permission model does this project need (single-user, multi-role, multi-tenant)? What auth mechanism/provider fits (e.g. Clerk, Auth0, NextAuth, custom JWT)? What languages/locales must the project support (single-locale, i18n from day one, RTL)? Record findings in STACK.md's Auth & Identity and Localization rows — don't let this surface only implicitly in FEATURES.md or ARCHITECTURE.md.
93
93
  3. **Verify current state** — Context7 or official docs for critical technology claims. Flag LOW confidence for training-only findings.
94
94
  4. **Select research mode** — Ecosystem (default) / Feasibility / Comparison.
95
95
  5. **Write 5 output files** in `.rcode/research/`:
@@ -29,6 +29,7 @@ Named rules. Cite by name when applying.
29
29
  - **10th-time-user** — delight happens through invisible efficiency. Design for the person who has done this 10 times, not just the first-timer.
30
30
  - **Ship-then-layer** — recommend the simplest version that ships, then layer complexity. Perfect designs that never launch are zero value.
31
31
  - **Name-one-misconception** — for every confusing design element, name the specific misconception and design around it.
32
+ - **Library-not-invention** — when producing UI-SPEC.md or WIREFRAMES.md, ground tokens and palette choices in `rcode/references/design-library/`, not invented values. WIREFRAMES.md's loading/empty/error/populated coverage per screen is Silence-kills-trust made concrete, per-screen.
32
33
 
33
34
  ## Anti-Patterns / Refuse List
34
35
 
@@ -26,8 +26,8 @@ Goal-backward verification. Start from what the phase SHOULD deliver, verify it
26
26
  - **DO NOT assume existence = implementation** — need level 2 (substantive), 3 (wired), and 4 (data flowing) for dynamic-data artifacts.
27
27
  - **DO NOT skip key link verification** — 80% of stubs hide in wiring.
28
28
  - **Structure gaps in YAML frontmatter** for `/rcode-plan --gaps`.
29
- - **DO flag for human verification when uncertain** (visual, real-time, external service).
30
- - **Keep verification fast**use grep/file checks, not running the app.
29
+ - **DO flag for human verification when uncertain** (visual, real-time, external service) — but flagging is NOT a pass. A phase with unresolved human-verification items on its user-facing surface is NOT "complete" or "shippable"; say so explicitly in the summary you return to the orchestrator.
30
+ - **Static checks (grep/file-existence) stay fast for levels 1-3 but a UI-facing phase is not verified until Level 5 (Reachability, see `reachability-check.md`) runs.** A page component existing, importing cleanly, and rendering real data is not the goal — a real user finding and using it from the app's actual navigation is. Don't let "keep it fast" become "never open the app."
31
31
  - **DO NOT commit** — leave committing to the orchestrator.
32
32
  - **Use Write tool for VERIFICATION.md** — never `Bash(cat << 'EOF')`.
33
33
 
@@ -23,11 +23,12 @@ Plan X.2 (Wave 1): API Endpoint
23
23
  Plan X.3 (Wave 2): UI Form/Component
24
24
  - Build React component
25
25
  - Wire to API endpoint
26
+ - Wire route into nav/menu (sidebar, header, or route table) so the feature is reachable without a direct URL
26
27
  - Integration test: form → API → database
27
28
 
28
29
  Plan X.4 (Wave 3): End-to-End Verification
29
30
  - Test full user flow (UI → API → DB → UI)
30
- - Checkpoint: Visual/functional review
31
+ - Checkpoint: Visual/functional review — can you reach this feature from the main nav without a direct URL?
31
32
  ```
32
33
 
33
34
  **Dependencies:** 1.3 → {1.1, 1.2}, 1.4 → 1.3
@@ -38,6 +38,37 @@ Must be TRUE:
38
38
 
39
39
  **Test:** Each truth verifiable by a human using the application without reading code.
40
40
 
41
+ **UI goals — add a reachability truth.** If any artifact for this goal is a page, route, or screen a user navigates to, one of the truths must be that the user can reach it through existing navigation, not just that it works once they're on it:
42
+ - "User can reach {feature} from existing navigation without typing the URL directly"
43
+
44
+ This must carry through to Step 3 (a nav component — header, sidebar, menu — is a required artifact alongside the new page) and Step 5 (a key link from that nav component to the new route). A feature that functions perfectly at an orphan route with no menu entry or link pointing to it does not satisfy the goal.
45
+
46
+ **Nav artifact precondition.** "Nav/menu component updated with a link" is not itself a valid artifact — it is single-role and structure-agnostic, and satisfying it by bolting one more top-level `<a>` onto whatever markup exists guarantees IA drift across phases. Before writing that artifact line:
47
+ - Reference the existing IA decision (the ROADMAP-level nav/IA plan) that this route slots into. If no IA doc exists yet — this is genuinely the first UI phase — this phase must produce one (containers, nesting levels, role visibility) before the nav artifact can be written; do not defer it to a later phase.
48
+ - State which nav container the link belongs in (e.g. sidebar primary, topbar, settings submenu), not just "the nav."
49
+ - State the nesting depth (top-level vs. nested under an existing section).
50
+ - State which roles see it, if the app has more than one role.
51
+
52
+ **Multi-role goals — add a role-visibility truth.** If the project has more than one user role/permission level (per REQUIREMENTS.md/PROJECT.md), one of the truths must state what that role sees or cannot see on screen — nav items, dashboard content, visible/hidden fields, enabled/disabled actions — not only what API calls it can or cannot make:
53
+ - "Employee sees only their own timesheet in nav; Manager additionally sees a Team Approvals nav item; Admin additionally sees a Users/Roles admin screen."
54
+
55
+ A truth like "User can't access protected pages without logging in" covers the route gate but not RBAC — it says nothing about what an authenticated Employee vs Manager vs Admin actually sees. RBAC = each role has a different UI, not just a blocked route.
56
+
57
+ **Example: Settings Page Goal**
58
+
59
+ Must be TRUE:
60
+ - User can view and edit their profile settings
61
+ - Changes save and persist
62
+ - User can reach the settings page from existing navigation without typing the URL directly
63
+
64
+ Artifacts:
65
+ - Settings page component
66
+ - Settings API route
67
+ - Nav/menu component updated with a link to the settings route, per existing IA plan: sidebar primary nav, top-level, visible to all authenticated roles
68
+
69
+ Key link:
70
+ - Nav component → `/settings` route link → if broken: page works but is undiscoverable
71
+
41
72
  ---
42
73
 
43
74
  ## Step 3: Derive Required Artifacts
@@ -161,6 +192,7 @@ must_haves:
161
192
  5. User stays logged in after page refresh
162
193
  6. User can log out
163
194
  7. User can't access protected pages without logging in
195
+ 8. Each role sees a different UI: Employee's nav shows only their own timesheet; Manager's nav additionally shows Team Approvals; Admin's nav additionally shows a Users/Roles admin screen
164
196
 
165
197
  ### Artifacts Needed
166
198
  - Login form component
@@ -169,6 +201,7 @@ must_haves:
169
201
  - User database model
170
202
  - Session/JWT infrastructure
171
203
  - Protected route wrapper
204
+ - Role-aware nav component (renders nav items conditionally per role)
172
205
 
173
206
  ### Wiring
174
207
  - Form → API endpoint
@@ -41,6 +41,7 @@ Before outputting a SPRINT.md file, run this self-check to catch common planning
41
41
  - [ ] No references to files that don't exist
42
42
  - [ ] Every task references concrete, existing file paths
43
43
  - [ ] Context bloat < 50% (if context section > 300 lines, trim it)
44
+ - [ ] If any artifact is a new page/route/screen, at least one truth/key_link covers reachability from existing navigation (or explicitly notes it is intentionally direct-link-only)
44
45
 
45
46
  ### Objective & Output
46
47
 
@@ -181,17 +181,36 @@ Use for unavoidable manual steps (1% of checkpoints).
181
181
  5. Success behavior: call onSubmit({ email, password })
182
182
  6. Use Sonner toast on error (not alert())
183
183
  7. Disabled state during submission (no double-click)
184
+ 8. Navigation wiring: add entry to nav/menu component so page is reachable
185
+ without direct URL (skip only if this task does not introduce a new
186
+ route/page)
184
187
  </action>
185
188
  <verify>
186
189
  <automated>npm test -- --filter=LoginForm</automated>
190
+ <automated>grep -r "login" src/components/nav/ src/config/routes*</automated>
187
191
  </verify>
188
192
  <done>
189
193
  Component renders, accepts input, calls onSubmit, disables during submission,
190
- shows errors with toast notification
194
+ shows errors with toast notification, page is reachable from nav/menu
195
+ (not just direct URL)
191
196
  </done>
192
197
  </task>
193
198
  ```
194
199
 
200
+ **Required states for any component that fetches or displays dynamic data**
201
+ (list views, dashboards, detail pages — not static content): the `<action>`
202
+ and `<done>` must each name all four, not just the happy path:
203
+ - **Loading** — what renders while data is in flight (skeleton, spinner — not a blank screen)
204
+ - **Empty** — what renders when the fetch succeeds but returns nothing (a message + next action, not a blank screen)
205
+ - **Error** — what renders when the fetch/action fails (specific, not a generic "something went wrong")
206
+ - **Populated** — the normal case
207
+
208
+ A task whose `<done>` only describes the populated case ("shows the list of
209
+ items") is incomplete for any component with a real data dependency — sprint-
210
+ checker's Dimension 2 now flags this (see `sprint-checker/dimensions.md`).
211
+ If WIREFRAMES.md exists for this screen (`/rcode-ui-phase` output), copy its
212
+ per-state description here rather than re-deriving it.
213
+
195
214
  ---
196
215
 
197
216
  ## Configuration Task Template
@@ -207,6 +207,16 @@ Based on research, suggested phase structure:
207
207
  |------------|---------|---------|-----|
208
208
  | [tech] | [ver] | [what] | [rationale] |
209
209
 
210
+ ### Auth & Identity
211
+ | Technology | Version | Purpose | Why |
212
+ |------------|---------|---------|-----|
213
+ | [tech] | [ver] | [roles/auth mechanism] | [rationale] |
214
+
215
+ ### Localization
216
+ | Technology | Version | Purpose | Why |
217
+ |------------|---------|---------|-----|
218
+ | [tech] | [ver] | [locales/i18n mechanism] | [rationale] |
219
+
210
220
  ### Supporting Libraries
211
221
  | Library | Version | Purpose | When to Use |
212
222
  |---------|---------|---------|-------------|
@@ -47,6 +47,24 @@ issue:
47
47
  - Missing `<done>` — no acceptance criteria
48
48
  - Vague `<action>` — "implement auth" instead of specific steps
49
49
  - Empty `<files>` — what gets created?
50
+ - `<verify>` present but not semantically capable of proving the task's claim — see check below
51
+
52
+ **Check — Verify Semantically Matches Claim (links to Dimension 6):**
53
+ Presence of `<verify>` is not enough. Cross-check it against the must_haves truth the task claims to satisfy (Dimension 6):
54
+ - If the task's `<action>` implements user-observable behavior (login, checkout, search, any flow a user drives), a `<verify>` consisting only of build/lint/typecheck commands (`npm run build`, `tsc --noEmit`, `eslint`, `echo done`) does **not** satisfy this dimension — it proves the code compiles, not that the behavior works.
55
+ - Require instead an assertion against actual output/behavior: a curl/HTTP call checking status/body, a test that exercises the route or flow, or an explicit manual-verification checkpoint (`checkpoint:*` task type).
56
+ - Flag as blocker: "Task N's <verify> only compiles/lints but action implements user-facing behavior X — no assertion on actual behavior."
57
+
58
+ **Check — Required States for Dynamic-Data Components:**
59
+ If a task's `<action>` creates or modifies a component that fetches or
60
+ displays dynamic data (a list, dashboard, detail page — check for
61
+ fetch/query/API-call language in the action), its `<action>` and `<done>`
62
+ must each name all four states: loading, empty, error, populated. A task
63
+ whose `<done>` only describes the populated case ("shows the list of items")
64
+ is incomplete — flag as blocker, not warning, since a missing empty/error
65
+ state is a real UX gap a user will hit, not a style nitpick.
66
+ - Flag as blocker: "Task N's component fetches/displays dynamic data but `<action>`/`<done>` only cover the populated case — no loading/empty/error state defined."
67
+ - Exception: if WIREFRAMES.md exists (`/rcode-ui-phase` output) and already defines the four states for this screen, a task that references WIREFRAMES.md instead of re-listing them inline is fine — check WIREFRAMES.md's entry for this screen before flagging.
50
68
 
51
69
  **Example issue:**
52
70
  ```yaml
@@ -59,6 +77,17 @@ issue:
59
77
  fix_hint: "Add verification command for build output"
60
78
  ```
61
79
 
80
+ **Example issue — verify doesn't prove the claim:**
81
+ ```yaml
82
+ issue:
83
+ dimension: task_completeness
84
+ severity: blocker
85
+ description: "Task 3 implements login flow but <verify> only runs `npm run build`"
86
+ plan: "16-01"
87
+ task: 3
88
+ fix_hint: "Replace with a curl against /api/login checking 200 + session cookie, or a test exercising the login route"
89
+ ```
90
+
62
91
  ## Dimension 3: Dependency Correctness
63
92
 
64
93
  **Question:** Are plan dependencies valid and acyclic?
@@ -103,6 +132,7 @@ issue:
103
132
  - API route created but component doesn't call it
104
133
  - Database model created but API doesn't query it
105
134
  - Form created but submit handler is missing or stub
135
+ - New page/component has no task adding it to the router, nav, or an existing page's imports — unreachable by any user
106
136
 
107
137
  **What to check:**
108
138
  ```
@@ -110,8 +140,27 @@ Component -> API: Does action mention fetch/axios call?
110
140
  API -> Database: Does action mention Prisma/query?
111
141
  Form -> Handler: Does action mention onSubmit implementation?
112
142
  State -> Render: Does action mention displaying state?
143
+ Nav -> Route: For any new page/route/component in must_haves.artifacts, does a task action mention adding it to the router config, nav/sidebar, or an existing page's import?
113
144
  ```
114
145
 
146
+ A top-level UI artifact (page/route/component) with no Nav -> Route reference anywhere in the sprint's tasks is a blocker — internal wiring can be perfect while the feature stays unreachable by any user.
147
+
148
+ **Check — Role Access Defined (multi-role/SSO/compliance projects only):**
149
+ `roadmapper-playbook.md`'s "Enterprise Projects Need Auth Strategy and Role
150
+ Mapping Decided Up Front" rule requires every later phase adding a
151
+ user-facing route to include "role access defined for this route" as a
152
+ success criterion — explicitly NOT covered by `rcode-verifier`'s Level-5
153
+ Reachability check (which only confirms a page is linked from nav, not that
154
+ it's linked/gated correctly per role). If PROJECT.md/REQUIREMENTS.md show
155
+ more than one user role, cross-reference each new route in
156
+ `must_haves.artifacts` against the roadmap's role-to-screen mapping (IA.md or
157
+ ROADMAP.md's IA section — see roadmapper-playbook.md step 3b): does a task
158
+ state which roles can/cannot reach this route, or is role access left
159
+ undefined? A new route with no role-access statement anywhere in the sprint's
160
+ tasks is a blocker for multi-role projects — the same orphan-feature failure
161
+ as unreachable nav, just for authorization instead of discoverability.
162
+ - Flag as blocker: "Route {path} added with no role-access statement — roadmap's role mapping shows N roles but no task defines who can/cannot reach this route."
163
+
115
164
  **Example issue:**
116
165
  ```yaml
117
166
  issue:
@@ -167,12 +216,26 @@ issue:
167
216
  2. Verify truths are user-observable (not implementation details)
168
217
  3. Verify artifacts support the truths
169
218
  4. Verify key_links connect artifacts to functionality
219
+ 5. Cross-reference each truth to a falsifiable `<verify>` command: for each `must_haves.truths` entry, search every task's `<verify>` block (across all plans in the sprint) for a command that could actually falsify that truth — a curl/HTTP assertion, a UI interaction test (playwright/cypress selector + assertion), or an explicit manual checkpoint script tied to the same feature. Wording alone (the truth "sounds" user-facing) does not count as a check.
220
+ 6. If no task's `<verify>` traces to a truth, flag it as unverifiable — do not accept the phrasing as proof the behavior is tested.
221
+
222
+ **Check — Truth-to-Verify Traceability (do not rely on wording alone):**
223
+ Judging "user-observable" from phrasing is not a check — a planner can trivially write `"The auth system is secure"` without any task exercising login. Treat this the same way Dimension 12 cross-references evidence claims to grep hit counts:
224
+ 1. For each `must_haves.truths` entry, extract the subject/action it claims (e.g., "user can log in", "search returns results").
225
+ 2. Scan every task's `<verify>` block across the sprint's plans for a command whose target matches that subject — a route/endpoint the truth implies (`/api/login`, `/search`), a selector the truth implies (login form, search box), or a checkpoint script named for the same feature.
226
+ 3. A match requires the `<verify>` command to actually exercise real input against the feature and assert on real output (status code, response body, rendered DOM state) — not just that the words in the truth and the `<verify>` block resemble each other.
227
+ 4. No match found → the truth is **unverifiable**, regardless of how user-facing its wording sounds. Flag it; do not accept the phrasing as proof.
170
228
 
171
229
  **Red flags:**
172
230
  - Missing `must_haves` entirely
173
231
  - Truths are implementation-focused ("bcrypt installed") not user-observable ("passwords are secure")
174
232
  - Artifacts don't map to truths
175
233
  - Key links missing for critical wiring
234
+ - Truth uses user-facing wording but no task's `<verify>` exercises the corresponding user path (e.g., "The auth system is secure" with no login/reject-bad-credentials check anywhere in the sprint) — unfalsifiable marketing language, not a verified outcome
235
+
236
+ **Severity rules:**
237
+ - **blocker:** a `must_haves.truths` entry has zero traceable `<verify>` command in any task across the sprint's plans
238
+ - **warning:** the traced `<verify>` command exists but only checks an implementation detail (e.g., process exits 0) rather than the user-observable behavior the truth claims
176
239
 
177
240
  **Example issue:**
178
241
  ```yaml
@@ -187,6 +250,17 @@ issue:
187
250
  fix_hint: "Reframe as user-observable: 'User can log in', 'Session persists'"
188
251
  ```
189
252
 
253
+ **Example issue — untraceable truth:**
254
+ ```yaml
255
+ issue:
256
+ dimension: verification_derivation
257
+ severity: blocker
258
+ description: "Truth 'The auth system is secure' has no task <verify> that exercises login or rejects bad credentials"
259
+ plan: "02"
260
+ truth: "The auth system is secure"
261
+ fix_hint: "Add a <verify> with a curl/HTTP assertion (e.g. POST /login with wrong password returns 401) or a UI test that logs in and confirms session state, then reference it from this truth"
262
+ ```
263
+
190
264
  ## Dimension 7: Context Compliance (if CONTEXT.md exists)
191
265
 
192
266
  **Question:** Do plans honor user decisions from /rcode-discuss-phase?
@@ -84,6 +84,18 @@ Session persists | 01 | 3 | COVERED
84
84
 
85
85
  For each requirement: find covering task(s), verify action is specific, flag gaps.
86
86
 
87
+ **Sub-behavior check (concrete, not eyeballed):** A task ID in the `Tasks` column is not proof of coverage by itself. For each requirement:
88
+ 1. Split the requirement's acceptance-criteria text (from ROADMAP.md/PRD, or the `must_haves.truths` derived from it) into discrete sub-behaviors — each verb phrase is one sub-behavior (e.g. "user can reset password" -> ["request reset email", "receive token", "verify token", "set new password"]).
89
+ 2. For each sub-behavior, check the covering task's `<action>` and `<verify>` text contains a concrete reference to it (a matching noun/verb, file, or endpoint) — not just the requirement's headline phrase.
90
+ 3. If one task covers a multi-sub-behavior requirement, list which sub-behaviors its action/verify actually address. Any sub-behavior with zero matching action/verify text is **unaddressed**.
91
+ 4. Status is `COVERED` only if every sub-behavior maps to at least one action/verify pair. If any sub-behavior is unaddressed, status is `PARTIAL` and is a **blocker**, not a note — list the specific missing sub-behavior(s), not a generic "may be incomplete" remark.
92
+
93
+ ```
94
+ Requirement | Plans | Tasks | Status | Missing sub-behaviors
95
+ ----------------------|-------|-------|---------|----------------------
96
+ User can reset password | 01 | 4 | PARTIAL | token verification, email send
97
+ ```
98
+
87
99
  **Exhaustive cross-check:** Also read PROJECT.md requirements (not just phase goal). Verify no PROJECT.md requirement relevant to this phase is silently dropped. A requirement is "relevant" if the ROADMAP.md explicitly maps it to this phase or if the phase goal directly implies it — do NOT flag requirements that belong to other phases or future work. Any unmapped relevant requirement is an automatic blocker — list it explicitly in issues.
88
100
 
89
101
  ## Step 5: Validate Task Structure
@@ -44,6 +44,10 @@ Record pass/fail:
44
44
  ## Constraints
45
45
 
46
46
  - Each check must complete in under 10 seconds
47
- - Do not start servers or services — only test what's already runnable
47
+ - Do not start servers or services for these checks specifically — only test
48
+ what's already runnable. (This does NOT apply to the Level-5 reachability
49
+ live smoke check in `reachability-check.md`, which exists precisely because
50
+ UI-facing phases need a running server to verify — see that file for when
51
+ and how to start one.)
48
52
  - Do not modify state (no writes, no mutations, no side effects)
49
53
  - If the project has no runnable entry points yet, skip with: "Step 7b: SKIPPED (no runnable entry points)"
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Step 8: Identify Human Verification Needs
4
4
 
5
+ A flagged item here is an open item, not a pass. Do not describe a phase with
6
+ unresolved human-verification items as "complete," "closed," "passed," or
7
+ "shippable" anywhere in the summary handed back to the orchestrator — say
8
+ what's still unconfirmed and by whom (the user, not another agent).
9
+
5
10
  **Always needs human:** Visual appearance, user flow completion, real-time behavior, external service integration, performance feel, error message clarity.
6
11
 
7
12
  **Needs human if uncertain:** Complex wiring grep can't trace, dynamic state behavior, edge cases.
@@ -0,0 +1,69 @@
1
+ # Verifier — Reachability + Live UI Smoke Check (Steps 6b, 10b)
2
+
3
+ Levels 1-4 (exists, substantive, wired, data-flows) verify an artifact works in
4
+ isolation. None of them verify that a real user, starting from the app's actual
5
+ entry point, can ever land on it. That gap is how a phase gets marked "passed"
6
+ while the delivered page has no nav link, no sidebar entry, and no way in
7
+ except typing its exact URL — code-complete, unusable.
8
+
9
+ **When to run:** Any phase whose must-haves include a user-facing route, page,
10
+ or screen (not API-only, not CLI-only, not backend/schema-only phases).
11
+
12
+ ## Step 6b — Reachability (static)
13
+
14
+ For each user-facing route delivered by this phase:
15
+
16
+ 1. Find the app's navigation surface — the layout/shell component(s) that
17
+ render on every page (e.g. `layout.tsx`, `Nav.tsx`, `Sidebar.tsx`,
18
+ `AppShell.tsx` — whatever this project actually uses).
19
+ 2. Grep it for a link to the route:
20
+ ```bash
21
+ grep -rn "$ROUTE_PATH" src/app/layout.tsx src/components/Nav* src/components/*Sidebar* 2>/dev/null
22
+ ```
23
+ 3. If found → Reachable ✓. If not found → Reachable ✗, classify as
24
+ **ORPHANED-FROM-UI**: the code works but no real user can find it without
25
+ the URL bar.
26
+
27
+ **If the project has no shell/nav component at all yet** — that is itself a
28
+ gap, not a reason to skip this check. A phase that ships pages with nowhere to
29
+ click from IS the gap. Report it as: "No app shell/navigation exists — every
30
+ delivered page is orphaned from UI by definition."
31
+
32
+ ## Step 10b — Live smoke check (dynamic)
33
+
34
+ Static reachability (6b) can be fooled by a nav link that renders but is
35
+ broken, hidden, or dead. Confirm it live:
36
+
37
+ 1. Start the dev server if one isn't already running (check first —
38
+ `curl -s -o /dev/null -w '%{http_code}' $BASE_URL` — don't start a
39
+ duplicate). Note the port and PID so it can be left running or killed
40
+ depending on project convention.
41
+ 2. Fetch the app's real entry point — the URL a user actually opens first
42
+ (usually `/`, or the post-login landing page), not the new route directly:
43
+ ```bash
44
+ curl -s $BASE_URL/ | grep -o "$ROUTE_PATH" | head -1
45
+ ```
46
+ A hit means the entry point's rendered HTML contains a link to the route.
47
+ No hit means either the link isn't there, it's client-rendered (acceptable
48
+ — note it and move to a browser check if available), or the entry point
49
+ itself is broken.
50
+ 3. If a browser automation tool is available in this session, prefer it over
51
+ curl: open the entry point, look for the nav element, click through to the
52
+ route, confirm the expected content renders. This catches what curl can't
53
+ (JS-rendered nav, auth redirects, broken client routing).
54
+ 4. If neither curl nor a browser tool can settle it, route to human
55
+ verification (Step 8) — but say explicitly what's unconfirmed ("nav link
56
+ renders in JS, could not click through without a browser tool") rather than
57
+ silently passing it.
58
+
59
+ ## Constraints
60
+
61
+ - Time-box this to the phase's own routes — don't crawl the whole app.
62
+ - If starting the dev server fails (missing DB, missing env vars, port
63
+ conflict) — that is itself a finding. Report it, don't silently skip
64
+ reachability and mark the phase passed.
65
+ - Kill any dev server this check started, unless the project's own workflow
66
+ expects it to stay up (check for an existing `pnpm dev` process first).
67
+ - This step existing does not replace a human actually looking at the app.
68
+ It catches the mechanical case (no link exists at all). Visual/UX quality
69
+ still routes to human verification per Step 8.
@@ -1366,8 +1366,16 @@ function cmdState(subArgs) {
1366
1366
  const state = readState() || defaultState();
1367
1367
  state.milestone = val;
1368
1368
  return writeState(state);
1369
+ } else if (key === '--ui-spec-path' && val) {
1370
+ const state = readState() || defaultState();
1371
+ state.ui_spec_path = val;
1372
+ return writeState(state);
1373
+ } else if (key === '--wireframes-path' && val) {
1374
+ const state = readState() || defaultState();
1375
+ state.wireframes_path = val;
1376
+ return writeState(state);
1369
1377
  } else {
1370
- throw new Error(`Unknown state set key: ${key}. Use: set-phase <N>, or state set project|milestone <value>`);
1378
+ throw new Error(`Unknown state set key: ${key}. Use: set-phase <N>, or state set project|milestone|--ui-spec-path|--wireframes-path <value>`);
1371
1379
  }
1372
1380
  }
1373
1381
 
@@ -3211,6 +3219,11 @@ function cmdState(subArgs) {
3211
3219
  return { updated: true, phase: phaseKey, status: 'executing', previous_status: previousStatus };
3212
3220
  }
3213
3221
 
3222
+ // DEPRECATED (#gap: state-sync audit): no workflow calls this — every
3223
+ // completion path uses the top-level `phase complete <N>` subcommand
3224
+ // instead. Its stale-executing-phase hygiene warning was ported there.
3225
+ // Kept only for backward compatibility with anyone scripting against it
3226
+ // directly; do not wire new callers to this — use `phase complete`.
3214
3227
  if (sub === 'complete-phase') {
3215
3228
  const flags = parseFlags(1);
3216
3229
  if (!flags.phase) throw new Error('complete-phase requires --phase <N>');
@@ -3946,6 +3959,29 @@ function cmdPhase(subArgs) {
3946
3959
  throw new Error(`Phase "${phaseRef}" not found in state.phases (looked up by number, id, and name)`);
3947
3960
  }
3948
3961
  const previous = state.phases[idx].status || null;
3962
+
3963
+ // State-hygiene gate (#955): if an earlier-numbered phase is still stuck
3964
+ // 'executing' while this later phase gets marked complete, that's exactly
3965
+ // the drift that misorients resolveActivePhase() / the SessionStart greeter.
3966
+ // Warn rather than block — completing out of order is sometimes correct
3967
+ // (parallel workstreams), but it must never happen silently. (Ported from
3968
+ // the unused `state complete-phase` twin — this is the code path every
3969
+ // workflow actually calls.)
3970
+ const thisNum = parseInt(String(state.phases[idx].number || phaseRef), 10);
3971
+ const stalePhases = Number.isNaN(thisNum) ? [] : state.phases.filter((p) => {
3972
+ if (!p || p.status !== 'executing') return false;
3973
+ const n = parseInt(String(p.number ?? p.id), 10);
3974
+ return !Number.isNaN(n) && n < thisNum;
3975
+ });
3976
+ const warnings = [];
3977
+ if (stalePhases.length > 0) {
3978
+ const staleList = stalePhases.map((p) => p.number ?? p.id).join(', ');
3979
+ warnings.push(
3980
+ `Phase ${phaseRef} marked complete while earlier phase(s) ${staleList} are still 'executing'. ` +
3981
+ `Close out the stale phase(s) or confirm this is an intentional parallel workstream.`
3982
+ );
3983
+ }
3984
+
3949
3985
  state.phases[idx].status = 'complete';
3950
3986
  state.phases[idx].status_updated = new Date().toISOString();
3951
3987
  state.phases[idx].completed_at = state.phases[idx].completed_at || new Date().toISOString().slice(0, 10);
@@ -3979,8 +4015,8 @@ function cmdPhase(subArgs) {
3979
4015
  is_last_phase: !next,
3980
4016
  open_phases_remaining: openRemaining,
3981
4017
  ...(nudge ? { nudge } : {}),
3982
- warnings: [],
3983
- has_warnings: false,
4018
+ warnings,
4019
+ has_warnings: warnings.length > 0,
3984
4020
  };
3985
4021
  }
3986
4022
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: rcode-ui-phase
3
- description: Produce UI-SPEC.md with color tokens, typography, component inventory, interaction states, and accessibility guidelines. Detects frontend keywords and suggests this command early in plan.md if UI-SPEC.md is absent.
3
+ description: Produce UI-SPEC.md (color tokens, typography, component inventory, interaction states, accessibility guidelines) and WIREFRAMES.md (per-role screen inventory with loading/empty/error states). Detects frontend keywords and suggests this command early in plan.md if UI-SPEC.md is absent.
4
4
  argument-hint: "[--existing-ui <path>] [--design-system <path>]"
5
5
  allowed-tools: Agent, Read, Glob, Grep, Write
6
6
  ---
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Next Level Builder
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # Design Library
2
+
3
+ Reference data consulted by `rcode-ux-designer` and `/rcode-ui-phase` when
4
+ producing UI-SPEC.md and WIREFRAMES.md — style/palette/typography options with
5
+ concrete values, UX do/don't rules per interface pattern, and category→pattern
6
+ decision rules for picking a design direction that fits the project, instead
7
+ of an agent inventing tokens from scratch.
8
+
9
+ ## Source and license
10
+
11
+ Vendored from [ui-ux-pro-max](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill)
12
+ by Next Level Builder, MIT licensed. Copyright (c) 2024 Next Level Builder.
13
+ Full license text: `LICENSE` in this directory. Data only — the upstream
14
+ project's Python CLI/scripts are not vendored; rcode agents read these CSVs
15
+ directly via Read/Grep, no Python dependency required.
16
+
17
+ ## Files
18
+
19
+ | File | Contents |
20
+ |---|---|
21
+ | `styles.csv` | 67 UI style categories (Minimalism, Neumorphism, Glassmorphism, Brutalism, etc.) — keywords, color palette, effects, best-for/avoid-for, accessibility rating, framework compatibility, implementation checklist |
22
+ | `colors.csv` | Palette options with hex values and mood/use-case |
23
+ | `typography.csv` | Font pairings with scale, weight, and use-case |
24
+ | `ux-guidelines.csv` | Do/don't rules by category (Navigation, Forms, etc.) with good/bad code examples and severity |
25
+ | `ui-reasoning.csv` | Project-category → recommended pattern/style/color-mood/typography-mood decision rules, with anti-patterns to avoid |
26
+ | `web-interface.csv` | Web-specific interface pattern guidance |
27
+ | `icons.csv` | Icon system/library options |
28
+ | `charts.csv` | Chart/data-viz pattern options |
29
+
30
+ ## How to use
31
+
32
+ Don't dump these into a prompt wholesale — they're too large. Grep for the
33
+ project's category/type in `ui-reasoning.csv` first to get a recommended
34
+ style + color mood + typography mood, then look up the specific style's row
35
+ in `styles.csv` for concrete values, then check `ux-guidelines.csv` for the
36
+ do/don't rules relevant to the screens being designed (Navigation, Forms,
37
+ etc.). See `rcode/workflows/ui-phase.md` for the concrete lookup sequence.
@@ -0,0 +1,26 @@
1
+ No,Data Type,Keywords,Best Chart Type,Secondary Options,Color Guidance,Performance Impact,Accessibility Notes,Library Recommendation,Interactive Level
2
+ 1,Trend Over Time,"trend, time-series, line, growth, timeline, progress",Line Chart,"Area Chart, Smooth Area",Primary: #0080FF. Multiple series: use distinct colors. Fill: 20% opacity,⚡ Excellent (optimized),✓ Clear line patterns for colorblind users. Add pattern overlays.,"Chart.js, Recharts, ApexCharts",Hover + Zoom
3
+ 2,Compare Categories,"compare, categories, bar, comparison, ranking",Bar Chart (Horizontal or Vertical),"Column Chart, Grouped Bar",Each bar: distinct color. Category: grouped same color. Sorted: descending order,⚡ Excellent,✓ Easy to compare. Add value labels on bars for clarity.,"Chart.js, Recharts, D3.js",Hover + Sort
4
+ 3,Part-to-Whole,"part-to-whole, pie, donut, percentage, proportion, share",Pie Chart or Donut,"Stacked Bar, Treemap",Colors: 5-6 max. Contrasting palette. Large slices first. Use labels.,⚡ Good (limit 6 slices),⚠ Hard for accessibility. Better: Stacked bar with legend. Avoid pie if >5 items.,"Chart.js, Recharts, D3.js",Hover + Drill
5
+ 4,Correlation/Distribution,"correlation, distribution, scatter, relationship, pattern",Scatter Plot or Bubble Chart,"Heat Map, Matrix",Color axis: gradient (blue-red). Size: relative. Opacity: 0.6-0.8 to show density,⚠ Moderate (many points),⚠ Provide data table alternative. Use pattern + color distinction.,"D3.js, Plotly, Recharts",Hover + Brush
6
+ 5,Heatmap/Intensity,"heatmap, heat-map, intensity, density, matrix",Heat Map or Choropleth,"Grid Heat Map, Bubble Heat",Gradient: Cool (blue) to Hot (red). Scale: clear legend. Divergent for ±data,⚡ Excellent (color CSS),⚠ Colorblind: Use pattern overlay. Provide numerical legend.,"D3.js, Plotly, ApexCharts",Hover + Zoom
7
+ 6,Geographic Data,"geographic, map, location, region, geo, spatial","Choropleth Map, Bubble Map",Geographic Heat Map,Regional: single color gradient or categorized colors. Legend: clear scale,⚠ Moderate (rendering),⚠ Include text labels for regions. Provide data table alternative.,"D3.js, Mapbox, Leaflet",Pan + Zoom + Drill
8
+ 7,Funnel/Flow,funnel/flow,"Funnel Chart, Sankey",Waterfall (for flows),Stages: gradient (starting color → ending color). Show conversion %,⚡ Good,✓ Clear stage labels + percentages. Good for accessibility if labeled.,"D3.js, Recharts, Custom SVG",Hover + Drill
9
+ 8,Performance vs Target,performance-vs-target,Gauge Chart or Bullet Chart,"Dial, Thermometer",Performance: Red→Yellow→Green gradient. Target: marker line. Threshold colors,⚡ Good,✓ Add numerical value + percentage label beside gauge.,"D3.js, ApexCharts, Custom SVG",Hover
10
+ 9,Time-Series Forecast,time-series-forecast,Line with Confidence Band,Ribbon Chart,Actual: solid line #0080FF. Forecast: dashed #FF9500. Band: light shading,⚡ Good,✓ Clearly distinguish actual vs forecast. Add legend.,"Chart.js, ApexCharts, Plotly",Hover + Toggle
11
+ 10,Anomaly Detection,anomaly-detection,Line Chart with Highlights,Scatter with Alert,Normal: blue #0080FF. Anomaly: red #FF0000 circle/square marker + alert,⚡ Good,✓ Circle/marker for anomalies. Add text alert annotation.,"D3.js, Plotly, ApexCharts",Hover + Alert
12
+ 11,Hierarchical/Nested Data,hierarchical/nested-data,Treemap,"Sunburst, Nested Donut, Icicle",Parent: distinct hues. Children: lighter shades. White borders 2-3px.,⚠ Moderate,⚠ Poor - provide table alternative. Label large areas.,"D3.js, Recharts, ApexCharts",Hover + Drilldown
13
+ 12,Flow/Process Data,flow/process-data,Sankey Diagram,"Alluvial, Chord Diagram",Gradient from source to target. Opacity 0.4-0.6 for flows.,⚠ Moderate,⚠ Poor - provide flow table alternative.,"D3.js (d3-sankey), Plotly",Hover + Drilldown
14
+ 13,Cumulative Changes,cumulative-changes,Waterfall Chart,"Stacked Bar, Cascade",Increases: #4CAF50. Decreases: #F44336. Start: #2196F3. End: #0D47A1.,⚡ Good,✓ Good - clear directional colors with labels.,"ApexCharts, Highcharts, Plotly",Hover
15
+ 14,Multi-Variable Comparison,multi-variable-comparison,Radar/Spider Chart,"Parallel Coordinates, Grouped Bar",Single: #0080FF 20% fill. Multiple: distinct colors per dataset.,⚡ Good,⚠ Moderate - limit 5-8 axes. Add data table.,"Chart.js, Recharts, ApexCharts",Hover + Toggle
16
+ 15,Stock/Trading OHLC,stock/trading-ohlc,Candlestick Chart,"OHLC Bar, Heikin-Ashi",Bullish: #26A69A. Bearish: #EF5350. Volume: 40% opacity below.,⚡ Good,⚠ Moderate - provide OHLC data table.,"Lightweight Charts (TradingView), ApexCharts",Real-time + Hover + Zoom
17
+ 16,Relationship/Connection Data,relationship/connection-data,Network Graph,"Hierarchical Tree, Adjacency Matrix",Node types: categorical colors. Edges: #90A4AE 60% opacity.,❌ Poor (500+ nodes struggles),❌ Very Poor - provide adjacency list alternative.,"D3.js (d3-force), Vis.js, Cytoscape.js",Drilldown + Hover + Drag
18
+ 17,Distribution/Statistical,distribution/statistical,Box Plot,"Violin Plot, Beeswarm",Box: #BBDEFB. Border: #1976D2. Median: #D32F2F. Outliers: #F44336.,⚡ Excellent,"✓ Good - include stats table (min, Q1, median, Q3, max).","Plotly, D3.js, Chart.js (plugin)",Hover
19
+ 18,Performance vs Target (Compact),performance-vs-target-(compact),Bullet Chart,"Gauge, Progress Bar","Ranges: #FFCDD2, #FFF9C4, #C8E6C9. Performance: #1976D2. Target: black 3px.",⚡ Excellent,✓ Excellent - compact with clear values.,"D3.js, Plotly, Custom SVG",Hover
20
+ 19,Proportional/Percentage,proportional/percentage,Waffle Chart,"Pictogram, Stacked Bar 100%",10x10 grid. 3-5 categories max. 2-3px spacing between squares.,⚡ Good,✓ Good - better than pie for accessibility.,"D3.js, React-Waffle, Custom CSS Grid",Hover
21
+ 20,Hierarchical Proportional,hierarchical-proportional,Sunburst Chart,"Treemap, Icicle, Circle Packing",Center to outer: darker to lighter. 15-20% lighter per level.,⚠ Moderate,⚠ Poor - provide hierarchy table alternative.,"D3.js (d3-hierarchy), Recharts, ApexCharts",Drilldown + Hover
22
+ 21,Root Cause Analysis,"root cause, decomposition, tree, hierarchy, drill-down, ai-split",Decomposition Tree,"Decision Tree, Flow Chart",Nodes: #2563EB (Primary) vs #EF4444 (Negative impact). Connectors: Neutral grey.,⚠ Moderate (calculation heavy),✓ clear hierarchy. Allow keyboard navigation for nodes.,"Power BI (native), React-Flow, Custom D3.js",Drill + Expand
23
+ 22,3D Spatial Data,"3d, spatial, immersive, terrain, molecular, volumetric",3D Scatter/Surface Plot,"Volumetric Rendering, Point Cloud",Depth cues: lighting/shading. Z-axis: color gradient (cool to warm).,❌ Heavy (WebGL required),❌ Poor - requires alternative 2D view or data table.,"Three.js, Deck.gl, Plotly 3D",Rotate + Zoom + VR
24
+ 23,Real-Time Streaming,"streaming, real-time, ticker, live, velocity, pulse",Streaming Area Chart,"Ticker Tape, Moving Gauge",Current: Bright Pulse (#00FF00). History: Fading opacity. Grid: Dark.,⚡ Optimized (canvas/webgl),⚠ Flashing elements - provide pause button. High contrast.,Smoothed D3.js, CanvasJS
25
+ 24,Sentiment/Emotion,"sentiment, emotion, nlp, opinion, feeling",Word Cloud with Sentiment,"Sentiment Arc, Radar Chart",Positive: #22C55E. Negative: #EF4444. Neutral: #94A3B8. Size = Frequency.,⚡ Good,⚠ Word clouds poor for screen readers. Use list view.,"D3-cloud, Highcharts, Nivo",Hover + Filter
26
+ 25,Process Mining,"process, mining, variants, path, bottleneck, log",Process Map / Graph,"Directed Acyclic Graph (DAG), Petri Net",Happy path: #10B981 (Thick). Deviations: #F59E0B (Thin). Bottlenecks: #EF4444.,⚠ Moderate to Heavy,⚠ Complex graphs hard to navigate. Provide path summary.,"React-Flow, Cytoscape.js, Recharts",Drag + Node-Click