opencastle 0.32.4 → 0.32.6

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 (108) hide show
  1. package/README.md +13 -3
  2. package/bin/cli.mjs +2 -0
  3. package/dist/cli/bootstrap.js +1 -1
  4. package/dist/cli/bootstrap.js.map +1 -1
  5. package/dist/cli/bootstrap.test.js +16 -0
  6. package/dist/cli/bootstrap.test.js.map +1 -1
  7. package/dist/cli/init.test.js +38 -0
  8. package/dist/cli/init.test.js.map +1 -1
  9. package/dist/cli/stack-config-update.test.js +18 -0
  10. package/dist/cli/stack-config-update.test.js.map +1 -1
  11. package/dist/cli/stack-config.d.ts.map +1 -1
  12. package/dist/cli/stack-config.js +1 -0
  13. package/dist/cli/stack-config.js.map +1 -1
  14. package/dist/cli/types.d.ts +1 -1
  15. package/dist/cli/types.d.ts.map +1 -1
  16. package/dist/orchestrator/plugins/index.d.ts.map +1 -1
  17. package/dist/orchestrator/plugins/index.js +4 -0
  18. package/dist/orchestrator/plugins/index.js.map +1 -1
  19. package/dist/orchestrator/plugins/notion/config.d.ts +3 -0
  20. package/dist/orchestrator/plugins/notion/config.d.ts.map +1 -0
  21. package/dist/orchestrator/plugins/notion/config.js +46 -0
  22. package/dist/orchestrator/plugins/notion/config.js.map +1 -0
  23. package/dist/orchestrator/plugins/trello/config.d.ts +3 -0
  24. package/dist/orchestrator/plugins/trello/config.d.ts.map +1 -0
  25. package/dist/orchestrator/plugins/trello/config.js +43 -0
  26. package/dist/orchestrator/plugins/trello/config.js.map +1 -0
  27. package/dist/orchestrator/plugins/types.d.ts +1 -1
  28. package/dist/orchestrator/plugins/types.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/cli/bootstrap.test.ts +21 -0
  31. package/src/cli/bootstrap.ts +1 -1
  32. package/src/cli/init.test.ts +46 -0
  33. package/src/cli/stack-config-update.test.ts +20 -0
  34. package/src/cli/stack-config.ts +1 -0
  35. package/src/cli/types.ts +1 -1
  36. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  37. package/src/orchestrator/agents/api-designer.agent.md +25 -34
  38. package/src/orchestrator/agents/architect.agent.md +40 -84
  39. package/src/orchestrator/agents/content-engineer.agent.md +29 -31
  40. package/src/orchestrator/agents/copywriter.agent.md +35 -60
  41. package/src/orchestrator/agents/data-expert.agent.md +24 -30
  42. package/src/orchestrator/agents/database-engineer.agent.md +26 -31
  43. package/src/orchestrator/agents/developer.agent.md +32 -34
  44. package/src/orchestrator/agents/devops-expert.agent.md +31 -26
  45. package/src/orchestrator/agents/documentation-writer.agent.md +29 -29
  46. package/src/orchestrator/agents/performance-expert.agent.md +36 -33
  47. package/src/orchestrator/agents/release-manager.agent.md +25 -34
  48. package/src/orchestrator/agents/researcher.agent.md +41 -95
  49. package/src/orchestrator/agents/reviewer.agent.md +24 -34
  50. package/src/orchestrator/agents/security-expert.agent.md +35 -39
  51. package/src/orchestrator/agents/seo-specialist.agent.md +25 -32
  52. package/src/orchestrator/agents/session-guard.agent.md +20 -79
  53. package/src/orchestrator/agents/team-lead.agent.md +50 -254
  54. package/src/orchestrator/agents/testing-expert.agent.md +37 -49
  55. package/src/orchestrator/agents/ui-ux-expert.agent.md +33 -39
  56. package/src/orchestrator/customizations/KNOWN-ISSUES.md +0 -1
  57. package/src/orchestrator/customizations/agents/skill-matrix.json +20 -4
  58. package/src/orchestrator/customizations/agents/skill-matrix.md +20 -0
  59. package/src/orchestrator/instructions/general.instructions.md +24 -84
  60. package/src/orchestrator/plugins/astro/SKILL.md +23 -179
  61. package/src/orchestrator/plugins/convex/SKILL.md +38 -12
  62. package/src/orchestrator/plugins/index.ts +4 -0
  63. package/src/orchestrator/plugins/netlify/SKILL.md +17 -13
  64. package/src/orchestrator/plugins/nextjs/SKILL.md +55 -261
  65. package/src/orchestrator/plugins/notion/SKILL.md +205 -0
  66. package/src/orchestrator/plugins/notion/config.ts +47 -0
  67. package/src/orchestrator/plugins/nx/SKILL.md +20 -72
  68. package/src/orchestrator/plugins/playwright/SKILL.md +5 -17
  69. package/src/orchestrator/plugins/slack/SKILL.md +28 -190
  70. package/src/orchestrator/plugins/teams/SKILL.md +10 -140
  71. package/src/orchestrator/plugins/trello/SKILL.md +151 -0
  72. package/src/orchestrator/plugins/trello/config.ts +44 -0
  73. package/src/orchestrator/plugins/types.ts +1 -1
  74. package/src/orchestrator/plugins/vitest/SKILL.md +2 -2
  75. package/src/orchestrator/prompts/bug-fix.prompt.md +25 -63
  76. package/src/orchestrator/prompts/implement-feature.prompt.md +29 -66
  77. package/src/orchestrator/prompts/quick-refinement.prompt.md +31 -66
  78. package/src/orchestrator/skills/accessibility-standards/SKILL.md +50 -105
  79. package/src/orchestrator/skills/agent-hooks/SKILL.md +60 -110
  80. package/src/orchestrator/skills/agent-memory/SKILL.md +44 -93
  81. package/src/orchestrator/skills/api-patterns/SKILL.md +20 -68
  82. package/src/orchestrator/skills/code-commenting/SKILL.md +49 -101
  83. package/src/orchestrator/skills/context-map/SKILL.md +47 -88
  84. package/src/orchestrator/skills/data-engineering/SKILL.md +27 -74
  85. package/src/orchestrator/skills/decomposition/SKILL.md +50 -98
  86. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +44 -107
  87. package/src/orchestrator/skills/documentation-standards/SKILL.md +28 -89
  88. package/src/orchestrator/skills/fast-review/SKILL.md +51 -276
  89. package/src/orchestrator/skills/frontend-design/SKILL.md +53 -163
  90. package/src/orchestrator/skills/git-workflow/SKILL.md +18 -54
  91. package/src/orchestrator/skills/memory-merger/SKILL.md +51 -88
  92. package/src/orchestrator/skills/observability-logging/SKILL.md +29 -75
  93. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +58 -117
  94. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +65 -140
  95. package/src/orchestrator/skills/performance-optimization/SKILL.md +21 -85
  96. package/src/orchestrator/skills/project-consistency/SKILL.md +62 -281
  97. package/src/orchestrator/skills/react-development/SKILL.md +38 -86
  98. package/src/orchestrator/skills/security-hardening/SKILL.md +40 -84
  99. package/src/orchestrator/skills/self-improvement/SKILL.md +26 -60
  100. package/src/orchestrator/skills/seo-patterns/SKILL.md +40 -105
  101. package/src/orchestrator/skills/session-checkpoints/SKILL.md +26 -68
  102. package/src/orchestrator/skills/team-lead-reference/SKILL.md +66 -206
  103. package/src/orchestrator/skills/testing-workflow/SKILL.md +42 -112
  104. package/src/orchestrator/skills/validation-gates/SKILL.md +39 -170
  105. package/src/orchestrator/snippets/base-output-contract.md +14 -0
  106. package/src/orchestrator/snippets/discovered-issues-policy.md +15 -0
  107. package/src/orchestrator/snippets/logging-mandatory.md +11 -0
  108. package/src/orchestrator/snippets/never-expose-secrets.md +22 -0
@@ -15,22 +15,16 @@ You are the Team Lead. Implement the roadmap task described below following this
15
15
 
16
16
  ---
17
17
 
18
- > **Canonical workflow:** `.github/agent-workflows/feature-implementation.md` defines the phase structure. This prompt adds tracker traceability, validation gate references, and completion criteria.
19
-
20
18
  ## Workflow
21
19
 
22
20
  > **HARD GATE:** Steps 1→2 are **blocking prerequisites**. Do NOT write, edit, or delegate any code until tracker issues exist for every subtask. If you catch yourself writing code before issues are created, STOP immediately, create the issues, then resume.
23
21
 
24
22
  ### 1. Research & Context Gathering
25
23
 
26
- Before writing any code, gather all relevant context:
27
-
28
- 1. **Read the roadmap** — Open `.opencastle/project/roadmap.md` and find the full scope, status, and acceptance criteria for this task
29
- 2. **Read known issues** — Check `.opencastle/KNOWN-ISSUES.md` for blockers or workarounds that affect this task
30
- 3. **Read architecture docs** — Check `.opencastle/project.instructions.md` and `.opencastle/project/decisions.md` for constraints and prior decisions
31
- 4. **Read lessons learned** — Check `.opencastle/LESSONS-LEARNED.md` for pitfalls relevant to this feature area
32
- 5. **Search existing code** — Find all files, components, queries, and tests related to this feature area
33
- 6. **Identify reusable code** — Before creating anything new, check if similar logic, components, or utilities already exist in the codebase that can be reused or extended
24
+ 1. **Read the roadmap** — Confirm scope, status, and acceptance criteria in `.opencastle/project/roadmap.md`
25
+ 2. **Check blockers** — Read `.opencastle/KNOWN-ISSUES.md` and `.opencastle/LESSONS-LEARNED.md` for pitfalls and workarounds
26
+ 3. **Read architecture docs** — Check `.opencastle/project.instructions.md` and `.opencastle/project/decisions.md` for constraints
27
+ 4. **Search existing code** — Find related files, components, queries, and tests; check for reusable implementations before creating anything new
34
28
 
35
29
  ### 2. Task Board Setup (BLOCKING — must complete before Step 3)
36
30
 
@@ -39,52 +33,37 @@ Every subtask must be tracked. **No issue = no implementation.** This step produ
39
33
  1. **Check existing issues** — Search the board for any in-progress or completed work related to this task
40
34
  2. **Decompose into issues** — Create one tracker issue per subtask using `[Area] Short description` naming
41
35
  3. **Set metadata** — Assign labels (agent name), priority, dependencies, and file partitions
42
- 4. **Write descriptions** — Each issue must include:
43
- - **Objective:** One sentence
44
- - **Files (partition):** Exact paths this agent may modify
45
- - **Acceptance criteria:** Verifiable checklist
46
- - **Dependencies:** Links to prerequisite issues
36
+ 4. **Write descriptions** — Objective (1 sentence), files (partition paths), acceptance criteria (checklist), dependencies (links)
47
37
  5. **Link to roadmap** — Reference the roadmap section in the issue description so context is never lost
48
38
  6. **Verify issues exist** — List all created issue IDs. If count is 0, do NOT proceed to Step 2.5
49
39
 
50
40
  ### 2.5 Generate Convoy Spec (BLOCKING — decides how Step 3 proceeds)
51
41
 
52
- All project-related work is executed via the convoy engine — regardless of subtask count. This ensures consistent observability, crash recovery, and live progress.
42
+ All project-related work is executed via the convoy engine — regardless of subtask count.
53
43
 
54
- 1. **Generate the spec** — use the `generate-convoy` prompt with the decomposed task list as context. The spec IS the implementation plan no manual per-task delegation is needed. Even single-task fixes go through convoy for observability.
44
+ 1. **Generate the spec** — use the `generate-convoy` prompt with the decomposed task list. The spec IS the implementation plan; even single-task fixes go through convoy for observability.
55
45
  2. **Hand the spec to the user** — tell them to run: `npx opencastle run -f .opencastle/convoys/<name>.convoy.yml`
56
46
  3. **The convoy engine handles** isolated git worktrees, parallel execution, merge queue ordering, crash recovery, and structured logging automatically.
57
- 4. **After convoy completes** — proceed to Step 4 (validation) and Step 5 (delivery/PR). The convoy engine will have created its own commits on the configured branch.
58
-
59
- > **Why always convoy?** Convoy execution is the only path that guarantees observability logging, crash recovery, gate validation, and live progress. Direct sub-agent delegation produces no structured logs and cannot be resumed if interrupted.
47
+ 4. **After convoy completes** — proceed to Step 4 (validation) and Step 5 (delivery/PR).
60
48
 
61
49
  ### 3. Implementation Rules
62
50
 
63
- > **Convoy execution:** The convoy spec file IS the implementation plan — skip the manual delegation workflow below and jump to Step 4 after the user runs the convoy. The convoy engine delegates tasks internally using the agents and prompts defined in the spec.
51
+ > **Convoy execution:** The convoy spec IS the implementation plan — skip manual delegation and jump to Step 4 after the user runs the convoy.
64
52
 
65
53
  #### Issue Traceability
66
54
 
67
- - **Pass issue ID to every agent** — When delegating a subtask (sub-agent or background), include the tracker issue ID and title in the prompt so the agent knows which tracked task it is completing
68
- - **Reference in commits** — Include the issue ID (e.g., `TAS-42`) in commit messages when possible
69
- - **Update issue status** — Move issues to In Progress before starting, Done after verification passes
55
+ - Include the tracker issue ID and title in every delegation prompt
56
+ - Reference issue IDs (e.g., `TAS-42`) in commit messages; move issues In Progress → Done as work progresses
70
57
 
71
58
  #### DRY Code
72
59
 
73
- - **Search before creating**Before writing any new component, hook, utility, query, or type, search the codebase for existing implementations
74
- - **Extract shared logic** If two agents need similar functionality, extract it to a shared library (`libs/`) first
75
- - **No copy-paste across apps** — Shared code belongs in shared libraries, not duplicated between apps
76
- - **Refactor on discovery** — If you find duplicated code during implementation, create a subtask to consolidate it
77
-
78
- #### Self-Improvement
79
-
80
- Include the self-improvement reminder in every delegation prompt (see the **self-improvement** skill).
60
+ - Search before creating — check for existing components, hooks, utilities, and queries first
61
+ - Extract shared logic to `libs/`; no copy-paste across apps. Refactor duplicates when discovered
81
62
 
82
63
  #### Visual Consistency
83
64
 
84
- - **Reuse existing components** — Use the shared component library; never re-implement a component that already exists
85
- - **Follow the design system** — Match spacing, typography, colors, and interaction patterns from existing pages
86
- - **Cross-app consistency** — Changes must look correct in all apps that share the codebase
87
- - **Browser verification required** — Every UI change must be visually confirmed in Chrome (see Testing below)
65
+ - Use the shared component library; never re-implement existing components
66
+ - Match spacing, typography, and colors from existing pages; verify in all affected apps
88
67
 
89
68
  ### 4. Validation & Testing
90
69
 
@@ -92,39 +71,26 @@ Include the self-improvement reminder in every delegation prompt (see the **self
92
71
 
93
72
  Every subtask must pass ALL gates before being marked Done:
94
73
 
95
- 1. **Gate 1: Secret Scanning** — scan diff for API keys, tokens, passwords, connection strings — block immediately if found
96
- 2. **Gate 2: Deterministic Checks** — run lint, test, and build for all affected projects (see the **codebase-tool** skill for commands) — all zero errors
97
- 3. **Gate 3: Blast Radius Check** — verify scope is expected (≤200 lines, ≤5 files normal; escalate if >500 lines or >10 files)
98
- 4. **Gate 4: Dependency Audit** (when `package.json` changes) — vulnerability scan, license check, bundle size, duplicates
99
- 5. **Gate 5: Fast Review** (MANDATORY) — single reviewer sub-agent validates every delegation output. No auto-PASS for sensitive files
100
- 6. **Gate 6: Browser Testing** (MANDATORY for UI changes) — clear cache, start server, verify features + responsive + screenshots
101
- 7. **Gate 7: Regression Testing** — full test suite for affected projects, browser-test adjacent pages if shared components changed
102
- 8. **Gate 8: Panel Review** (for high-stakes changes) use **panel-majority-vote** skill for security, DB migrations, architecture
103
- 9. **Gate 9: Final Smoke Test** — after all tasks Done, verify the complete feature end-to-end as a cohesive unit
74
+ 1. **Secret Scanning** — block if API keys/tokens/passwords found in diff
75
+ 2. **Deterministic Checks** — lint, test, build zero errors (see **codebase-tool** skill)
76
+ 3. **Blast Radius** — ≤200 lines / ≤5 files normal; escalate if >500 lines or >10 files
77
+ 4. **Dependency Audit** when `package.json` changes
78
+ 5. **Fast Review** (MANDATORY) — single reviewer sub-agent
79
+ 6. **Browser Testing** (MANDATORY for UI) — clear cache, verify features + responsive + screenshots
80
+ 7. **Regression Testing** — full suite for affected projects
81
+ 8. **Panel Review** for security, DB migrations, architecture (use **panel-majority-vote** skill)
82
+ 9. **Final Smoke Test** — end-to-end verification of complete feature
104
83
 
105
84
  ### 5. Delivery
106
85
 
107
- Follow the **Delivery Outcome** defined in the **git-workflow** skill — commit, push, open PR (not merged), and link to the tracker.
108
-
109
- > The convoy engine creates commits on the configured `branch` directly. After validation passes, open the PR from that branch. No additional commits from the Team Lead are needed unless gates failed and required manual fixes.
86
+ Follow the **Delivery Outcome** defined in the **git-workflow** skill — commit, push, open PR (not merged), and link to the tracker. The convoy engine creates commits on the configured `branch` directly; open the PR from that branch after validation passes.
110
87
 
111
88
  ### 6. Documentation & Traceability
112
89
 
113
- Keep documentation current so future sessions have full context:
114
-
115
- 1. **Update roadmap** — Mark completed items in `.opencastle/project/roadmap.md` with ✅ and the completion date. **Include tracker issue IDs and links** next to each scope item so progress is traceable across sessions. Format:
116
- ```
117
- **Tracker Issues:**
118
- - [PREFIX-6](<tracker-url>/PREFIX-6) — [Search] Description ✅ Done
119
- - [PREFIX-7](<tracker-url>/PREFIX-7) — [UI] Description 📋 Todo
120
- ```
121
- > Replace `PREFIX` with the project's issue prefix (see `tracker-config.md`).
122
- 2. **Update known issues** — If new limitations are discovered, add them to `.opencastle/KNOWN-ISSUES.md`
123
- 3. **Update architecture docs** — If architectural decisions were made, add an ADR to `.opencastle/project/decisions.md`
124
- 4. **Link tracker issues** — Every issue description should reference:
125
- - Related roadmap section
126
- - Files modified (the partition)
127
- - Related issues (dependencies and follow-ups)
90
+ 1. **Update roadmap** Mark completed items with ✅ and date; include tracker issue IDs next to each scope item (e.g., `[PREFIX-6](<url>) — Description ✅ Done`)
91
+ 2. **Update known issues** — Add new limitations to `.opencastle/KNOWN-ISSUES.md`
92
+ 3. **Update architecture docs** — Add ADRs for architectural decisions to `.opencastle/project/decisions.md`
93
+ 4. **Link tracker issues** — Reference roadmap section, partition files, and related issues in each description
128
94
  5. **Close issues properly** — Move to Done only after independent verification passes all gates
129
95
 
130
96
  ### 7. Completion Criteria
@@ -132,11 +98,8 @@ Keep documentation current so future sessions have full context:
132
98
  The roadmap task is complete when:
133
99
 
134
100
  - [ ] All tracker subtask issues are Done
135
- - [ ] All deterministic checks pass (lint, test, build) for affected projects
136
- - [ ] **Dev server started with CLEAN cache** (clear framework + task runner caches before serving — see the **codebase-tool** skill)
137
101
  - [ ] **All UI changes verified in Chrome browser via MCP with screenshots taken as proof**
138
102
  - [ ] **Every feature in the acceptance criteria visually confirmed** — not just "page loads"
139
- - [ ] Regression tests confirm no existing functionality is broken
140
103
  - [ ] No duplicated code — shared logic extracted to libraries
141
104
  - [ ] Visual consistency maintained across all affected pages and apps
142
105
  - [ ] Documentation updated (roadmap, known issues, decisions)
@@ -31,68 +31,45 @@ You are the Team Lead. Handle the follow-up refinement described below. This is
31
31
 
32
32
  ### 1. Triage: Decide Tracking Level
33
33
 
34
- Before doing anything, decide whether this follow-up needs issue tracking:
35
-
36
34
  **Create a tracker issue if ANY of these are true:**
37
- - The change affects user-visible behavior (not just cosmetic)
38
- - It touches more than 2–3 files
39
- - It modifies shared library code (`libs/`)
40
- - It changes data queries, API routes, or Server Actions
41
- - It could introduce regressions in other features
42
- - You want a record for future reference (e.g., "why was this changed?")
35
+ - Affects user-visible behavior, touches >2–3 files, or modifies `libs/`, queries, API routes, or Server Actions
36
+ - Could introduce regressions in other features
37
+ - You want a record for future reference
43
38
 
44
39
  **Skip tracking if ALL of these are true:**
45
- - Pure cosmetic/spacing/copy tweak
40
+ - Pure cosmetic/spacing/copy change with no behavioral impact
46
41
  - Isolated to a single component or page
47
- - No behavioral change
48
42
  - Trivial to verify visually
49
43
 
50
- If creating a tracker issue, use:
51
- - **Title**: `[Follow-up] Short description`
52
- - **Label**: agent name + `follow-up`
53
- - **Priority**: Low or Medium
54
- - **Description**: What changed, why, and which files
44
+ If creating: title `[Follow-up] Short description`, label `follow-up`, priority Low/Medium, description: what changed, why, files
55
45
 
56
46
  ### 2. Understand the Request
57
47
 
58
- Before touching any code:
59
-
60
48
  1. **Clarify scope** — Identify exactly which pages, components, or behaviors need to change
61
49
  2. **Find affected files** — Search the codebase for the relevant components, styles, queries, and tests
62
50
  3. **Check known issues** — Scan `.opencastle/KNOWN-ISSUES.md` in case this is a documented limitation
63
51
  4. **Read lessons learned** — Check `.opencastle/LESSONS-LEARNED.md` for relevant pitfalls before starting
64
- 5. **Assess complexity** — If the request turns out to be larger than expected (touches >5 files, needs a migration, or affects auth/security), escalate it:
65
- - Inform the user that this should be a tracked task
66
- - Create a tracker issue (if not already created in triage) and switch to the `implement-feature` workflow
52
+ 5. **Assess complexity** — If larger than expected (>5 files, migration, or auth/security), inform the user, create a tracker issue, and switch to the `implement-feature` workflow
67
53
 
68
54
  ### 3. Plan the Fix
69
55
 
70
- Think before you act:
71
-
72
- 1. **Identify root cause** — For bugs, find why it happens, not just where. For UI tweaks, understand the current styling/layout chain
73
- 2. **Check for shared impact** — Will the fix affect other pages or apps? Check component usage across the codebase
74
- 3. **Determine the minimal change** — Follow the principle of least surprise. Change only what's necessary
75
- 4. **Reuse existing patterns** — Use components, utilities, and styles that already exist in the codebase. Never introduce a new pattern for a one-off fix
56
+ 1. **Identify root cause** — For bugs, find why; for UI tweaks, understand the styling/layout chain
57
+ 2. **Assess shared impact** — Will the fix affect other pages or apps? Check component usage across the codebase
58
+ 3. **Minimal change** — Reuse existing components, utilities, and styles. Never introduce a new pattern for a one-off fix
76
59
 
77
60
  ### 4. Implement
78
61
 
79
- Delegate to the appropriate specialist agent(s). Since follow-ups are scoped and focused, prefer **sub-agents** (inline) over background agents.
80
-
81
62
  #### Delegation Prompt Must Include
82
63
 
83
- - **What to fix** clear description of the problem and desired outcome
84
- - **Where** exact file paths to read and modify
85
- - **How to verify** — what the result should look like or how to test it
86
- - **Boundaries** — "Only modify files listed above. Do not refactor unrelated code."
87
- - **Self-improvement reminder** — include per the **self-improvement** skill
64
+ - What to fix, exact file paths, and how to verify the result
65
+ - Boundaries: "Only modify files listed above. Do not refactor unrelated code."
66
+ - Self-improvement reminder (see **self-improvement** skill)
88
67
 
89
68
  #### Implementation Rules
90
69
 
91
- - **No scope creep** — Fix what was asked. If you notice other issues, note them but don't fix them in this pass
92
- - **DRY** Search before creating. Reuse existing components and utilities
93
- - **Visual consistency** — Match the existing design system (spacing, colors, typography)
94
- - **Cross-app check** — If the change is in shared code (`libs/`), verify it works for both apps
95
- - **Accessibility** — Don't regress keyboard navigation, screen reader support, or contrast ratios
70
+ - **No scope creep** — Fix only what was asked; note but don't fix adjacent issues
71
+ - **DRY + Visual consistency** Reuse existing components, utilities, and design system patterns
72
+ - **Cross-app + Accessibility** — Verify `libs/` changes across apps; don't regress keyboard nav/contrast
96
73
 
97
74
  ### 5. Validate
98
75
 
@@ -100,46 +77,34 @@ Delegate to the appropriate specialist agent(s). Since follow-ups are scoped and
100
77
 
101
78
  Every follow-up, no matter how small, must pass these gates:
102
79
 
103
- 1. **Gate 1: Secret Scanning** — scan diff for API keys, tokens, passwords, connection strings — block immediately if found
104
- 2. **Gate 2: Deterministic Checks** — run lint, test, and build for all affected projects (see the **codebase-tool** skill for commands) — all zero errors
105
- 3. **Gate 3: Blast Radius Check** — verify scope matches the "small follow-up" expectation (≤100 lines, ≤3 files normal; if larger, escalate to `implement-feature` workflow)
106
- 4. **Gate 4: Dependency Audit** (when `package.json` or lockfiles change) — vulnerability scan, license check, bundle size, duplicates
107
- 5. **Gate 5: Fast Review** (MANDATORY) — single reviewer sub-agent validates the change. No auto-PASS for sensitive files
108
- 6. **Gate 6: Browser Testing** (MANDATORY for any visual change) — clear cache, start server, verify scenario + responsive + screenshot evidence
109
- 7. **Gate 7: Regression Testing** — if shared component/library modified, run tests for all consuming projects and browser-test at least one page per affected app
80
+ 1. **Secret Scanning** — block if API keys/tokens/passwords found in diff
81
+ 2. **Deterministic Checks** — lint, test, build zero errors (see **codebase-tool** skill)
82
+ 3. **Blast Radius** — ≤100 lines / ≤3 files for follow-ups; if larger, escalate to `implement-feature`
83
+ 4. **Dependency Audit** when `package.json` or lockfiles change
84
+ 5. **Fast Review** (MANDATORY) — single reviewer sub-agent
85
+ 6. **Browser Testing** (MANDATORY for visual changes) — clear cache, verify + responsive + screenshots
86
+ 7. **Regression Testing** — if shared component/library modified, test all consuming projects
110
87
 
111
88
  ### 6. Delivery
112
89
 
113
- If triage determined this follow-up needs tracker tracking, follow the **Delivery Outcome** defined in the **git-workflow** skill — commit, push, open PR (not merged), and link to the tracker.
90
+ If tracked: follow the **Delivery Outcome** in the **git-workflow** skill — commit, push, open PR (not merged), tracker linked.
114
91
 
115
- If triage determined no tracker tracking is needed (pure cosmetic/isolated/trivial), commit the changes to the current working branch. A dedicated branch and PR are not required because the Team Lead will include these changes in the parent task's existing PR — the "every change goes through a PR" rule is still satisfied via the parent PR.
92
+ If untracked: commit to the current branch; Team Lead includes in the parent task's existing PR.
116
93
 
117
94
  ### 7. Escalation Triggers
118
95
 
119
- Stop the follow-up workflow and switch to a full roadmap task if:
120
-
121
- - The fix requires a **database migration**
122
- - The fix involves **authentication or authorization** changes
123
- - The fix touches **more than 5 files** across multiple libraries
124
- - The fix introduces a **new dependency** or **new API endpoint**
125
- - The fix changes **data models** (CMS schemas, database tables)
126
- - You discover the "small fix" is actually a **systemic issue** requiring architectural changes
127
-
128
- When escalating, explain to the user what you found and why it needs proper tracking.
129
-
130
- - **Multi-task escalation** — If the refinement decomposes into 3+ subtasks, switch to `implement-feature` (which will use convoy execution for multi-task work)
96
+ - Requires a database migration or data model changes (CMS schemas, tables)
97
+ - Involves auth/authorization changes
98
+ - Touches >5 files across multiple libraries
99
+ - Introduces a new dependency or API endpoint
100
+ - Is a systemic issue requiring architectural changes
101
+ - Decomposes into 3+ subtasks switch to `implement-feature`
131
102
 
132
103
  ### 8. Completion
133
104
 
134
- The follow-up is complete when:
135
-
136
105
  - [ ] The specific request is resolved
137
106
  - [ ] Tracker issue created and moved to Done (if triage determined tracking was needed)
138
- - [ ] Lint, test, and build pass for all affected projects
139
- - [ ] **Dev server started with CLEAN cache** (clear framework + task runner caches before serving — see the **codebase-tool** skill)
140
107
  - [ ] **Visual changes verified in Chrome with screenshot taken as proof**
141
- - [ ] No regressions in adjacent functionality
142
108
  - [ ] Shared component changes tested across all consuming apps
143
109
  - [ ] Delivery Outcome completed if tracked (see the **git-workflow** skill) — branch pushed, PR opened (not merged), tracker linked
144
- - [ ] Lessons learned captured if any retries occurred
145
- - [ ] Known issues updated if a new limitation was discovered
110
+ - [ ] Lessons learned captured and known issues updated if applicable
@@ -3,164 +3,109 @@ name: accessibility-standards
3
3
  description: "WCAG 2.2 Level AA accessibility patterns for React/HTML/CSS. Use when creating or modifying UI components, forms, navigation, tables, images, or any user-facing elements. Covers keyboard navigation, screen reader semantics, low vision contrast, voice access, and inclusive language."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Accessibility Standards
9
7
 
10
- Code must conform to [WCAG 2.2 Level AA](https://www.w3.org/TR/WCAG22/). Go beyond minimal conformance wherever possible.
11
-
12
- ## Workflow
8
+ Code must conform to [WCAG 2.2 Level AA](https://www.w3.org/TR/WCAG22/).
13
9
 
14
- 1. Before generating code, plan how to implement it accessibly.
15
- 2. After generating code, review against WCAG 2.2 and these patterns. Iterate until compliant.
16
- 3. Inform the user the code was built with accessibility in mind but may still have issues. Suggest [Accessibility Insights](https://accessibilityinsights.io/) for testing.
10
+ **Workflow:** Plan accessible implementation generate review against WCAG 2.2 → iterate. Suggest [Accessibility Insights](https://accessibilityinsights.io/) for testing.
17
11
 
18
- ## Inclusive Language
19
-
20
- - Use people-first language ("person using a screen reader," not "blind user").
21
- - Avoid stereotypes or assumptions about ability.
22
- - Flag uncertain implementations — include reasoning or references to standards.
12
+ **Language:** People-first ("person using a screen reader," not "blind user"). No ability stereotypes. Flag uncertain implementations with reasoning.
23
13
 
24
14
  ## Cognitive
25
15
 
26
- - Prefer plain language.
27
- - Use consistent page structure (landmarks) across the application.
28
- - Keep navigation items in the same order across pages.
29
- - Keep the interface clean — reduce unnecessary distractions.
16
+ Plain language; consistent landmarks and nav order across pages; minimal distractions.
30
17
 
31
18
  ## Keyboard
32
19
 
33
- - All interactive elements must be keyboard navigable with predictable focus order (reading order).
34
- - Focus must be clearly visible at all times.
35
- - All interactive elements must be operable (buttons, links, dropdowns, etc.).
36
- - Static (non-interactive) elements should NOT have `tabindex`. Exception: elements receiving programmatic focus (e.g., headings) get `tabindex="-1"`.
37
- - Hidden elements must not be keyboard focusable.
20
+ - All interactive elements keyboard-navigable with visible focus in reading order.
21
+ - No `tabindex` on static elements; `tabindex="-1"` only for elements receiving programmatic focus.
22
+ - Hidden elements must not be focusable.
38
23
 
39
- ### Composite Components (grids, listboxes, menus, tabs, toolbars)
24
+ **Composite components** (grids, listboxes, menus, tabs, toolbars): tab stop on container; arrow keys navigate children via roving tabindex or `aria-activedescendant`; on focus restore last/first child.
40
25
 
41
- - Tab stop on the container with appropriate interactive role.
42
- - Arrow keys navigate children (roving tabindex or `aria-activedescendant`).
43
- - On focus: show selected child, or previously focused child, or first interactive child.
26
+ **Roving tabindex:** First child `tabindex="0"`, rest `-1`; on arrow key set prev to `-1`, new to `0`, call `.focus()`.
44
27
 
45
- ### Bypass Blocks
28
+ **`aria-activedescendant`:** Container `tabindex="0"` + `aria-activedescendant="IDREF"`; CSS draws outline on referenced element; arrow keys update attribute.
46
29
 
47
- Provide "Skip to main" link as first focusable element:
30
+ **Skip link** (first focusable element):
48
31
 
49
32
  ```html
50
- <header>
51
- <a href="#maincontent" class="sr-only">Skip to main</a>
52
- </header>
33
+ <a href="#maincontent" class="sr-only">Skip to main</a>
53
34
  <main id="maincontent"></main>
54
35
  ```
55
36
 
56
37
  ```css
57
- .sr-only:not(:focus):not(:active) {
58
- clip: rect(0 0 0 0);
59
- clip-path: inset(50%);
60
- height: 1px;
61
- overflow: hidden;
62
- position: absolute;
63
- white-space: nowrap;
64
- width: 1px;
65
- }
38
+ .sr-only:not(:focus):not(:active) { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
66
39
  ```
67
40
 
68
- ### Common Keys
69
-
70
41
  | Key | Action |
71
42
  |-----|--------|
72
43
  | `Tab` | Next interactive element |
73
44
  | `Arrow` | Navigate within composite component |
74
45
  | `Enter` | Activate focused control |
75
- | `Escape` | Close open surfaces (dialogs, menus) |
76
-
77
- ### Roving Tabindex Pattern
78
-
79
- 1. Initial: `tabindex="0"` on first focusable child, `tabindex="-1"` on rest.
80
- 2. On arrow key: set previous to `-1`, new target to `0`, call `element.focus()`.
81
-
82
- ### `aria-activedescendant` Pattern
83
-
84
- - Container has `tabindex="0"` and `aria-activedescendant="IDREF"`.
85
- - CSS draws focus outline on referenced element.
86
- - Arrow keys update `aria-activedescendant`.
46
+ | `Escape` | Close dialogs/menus |
87
47
 
88
48
  ## Low Vision
89
49
 
90
- - Dark text on light backgrounds (or vice versa).
91
- - Text contrast ≥4.5:1 (≥3:1 for large text: 18.5px bold or 24px).
92
- - Graphics/controls contrast ≥3:1 with adjacent colors.
93
- - Control state indicators (pressed, focus, checked) ≥3:1 contrast.
94
- - Color must NOT be the only way to convey information — use text/shapes in addition.
50
+ | Rule | Requirement |
51
+ |------|-------------|
52
+ | Text contrast | 4.5:1 (≥3:1 for large text: 18.5px bold / 24px) |
53
+ | Graphics/controls | ≥3:1 with adjacent colors |
54
+ | State indicators (pressed, focus, checked) | ≥3:1 |
55
+ | Color | Never the sole conveyor of information |
95
56
 
96
57
  ## Screen Reader
97
58
 
98
- - All elements must convey correct semantics (name, role, value, states/properties). Prefer native HTML; use ARIA when necessary.
99
- - Use landmarks: `<header>`, `<nav>`, `<main>`, `<footer>`.
100
- - Use headings (`<h1>`–`<h6>`) to introduce sections. One `<h1>` per page. Avoid skipping levels.
59
+ - Correct semantics (name, role, value, states). Prefer native HTML; ARIA only when necessary.
60
+ - Landmarks: `<header>`, `<nav>`, `<main>`, `<footer>`.
61
+ - One `<h1>` per page; `<h1>`–`<h6>` introduce sections; no skipping levels.
101
62
 
102
63
  ## Voice Access
103
64
 
104
- - Accessible name of interactive elements must contain the visual label (so voice users can say "Click [label]").
105
- - `aria-label` must contain the visual label text.
65
+ - Interactive element accessible name must contain its visible label text.
66
+ - `aria-label` must include the visible label.
106
67
 
107
68
  ## Forms
108
69
 
109
- - Labels must accurately describe control purpose.
70
+ - Labels accurately describe control purpose.
110
71
  - Required fields: asterisk in label + `aria-required="true"`.
111
- - Errors: `aria-invalid="true"` on invalid fields. Error messages via `aria-describedby`.
112
- - Inline errors next to fields (common) or form-level errors at top identifying specific fields.
113
- - Submit buttons should NOT be disabled — trigger error messages instead.
114
- - On submit with invalid input, focus the first invalid field.
72
+ - Errors: `aria-invalid="true"` + `aria-describedby` pointing to error message.
73
+ - Don't disable submit show errors instead; focus first invalid field on submit.
115
74
 
116
- ## Graphics and Images
75
+ ## Images
117
76
 
118
- - All graphics must have correct role (`<img>` implicit, `<svg>` needs `role="img"`, icon fonts/emojis need `role="img"` on `<span>`).
119
- - **Informative**: `alt` text conveying meaning/purpose (concise, meaningful). Avoid `title` attribute.
120
- - **Decorative**: `alt=""` for `<img>`, `aria-hidden="true"` for `role="img"`.
77
+ | Type | Pattern |
78
+ |------|---------|
79
+ | Informative | `alt="[meaning]"` on `<img>`; `role="img"` + `aria-label` on `<svg>` / icon fonts |
80
+ | Decorative | `alt=""` on `<img>`; `aria-hidden="true"` on `role="img"` |
121
81
 
122
82
  ## Input Labels
123
83
 
124
- - All interactive elements need visual labels.
125
- - `<label for="id">` for form inputs.
126
- - Multiple controls with same label (e.g., "Remove"): use `aria-label` for disambiguation.
127
- - Help text: associate via `aria-describedby`.
84
+ - `<label for="id">` for form inputs; all interactive elements need visible labels.
85
+ - Disambiguate repeated labels (e.g., "Remove") with `aria-label`.
86
+ - Help text via `aria-describedby`.
128
87
 
129
88
  ## Navigation
130
89
 
131
90
  ```html
132
- <nav>
133
- <ul>
134
- <li>
135
- <button aria-expanded="false" tabindex="0">Section 1</button>
136
- <ul hidden>
137
- <li><a href="..." tabindex="-1">Link 1</a></li>
138
- </ul>
139
- </li>
140
- <li>
141
- <button aria-expanded="false" tabindex="-1">Section 2</button>
142
- <ul hidden>
143
- <li><a href="..." tabindex="-1">Link 1</a></li>
144
- </ul>
145
- </li>
146
- </ul>
147
- </nav>
91
+ <nav><ul>
92
+ <li><button aria-expanded="false" tabindex="0">Section 1</button>
93
+ <ul hidden><li><a href="..." tabindex="-1">Link 1</a></li></ul>
94
+ </li>
95
+ </ul></nav>
148
96
  ```
149
97
 
150
- - Navigation menus use `<nav>` with `<ul>`, NOT `menu`/`menubar` roles.
151
- - Toggle `aria-expanded` on expand/collapse.
152
- - Roving tabindex for main items (arrow across), arrow down into sub-menus.
153
- - `Escape` closes expanded menus.
98
+ - Use `<nav>` + `<ul>`, NOT `menu`/`menubar` roles.
99
+ - Toggle `aria-expanded` on expand/collapse; `Escape` closes menus.
100
+ - Roving tabindex across main items; arrow down into sub-menus.
154
101
 
155
102
  ## Page Title
156
103
 
157
- - Defined in `<title>` in `<head>`.
158
- - Describes page purpose, unique per page.
159
- - Front-load unique information: `"[Page] - [Section] - [Site]"`.
104
+ - `<title>` describes page purpose, unique per page.
105
+ - Front-load unique info: `"[Page] - [Section] - [Site]"`.
160
106
 
161
- ## Tables and Grids
107
+ ## Tables & Grids
162
108
 
163
- - Column headers via `<th>` in first `<tr>`. Row headers via `<th>` in each row.
164
- - `role="gridcell"` must be nested within `role="row"`.
165
- - Prefer simple tables (one set of headers, no spanning cells).
166
- - Use `<table>` for static data, `role="grid"` for interactive data (date pickers, calendars).
109
+ - Column headers: `<th>` in first `<tr>`; row headers: `<th>` in each row.
110
+ - `role="gridcell"` nested within `role="row"`.
111
+ - `<table>` for static data; `role="grid"` for interactive (date pickers, calendars).