opencastle 0.32.5 → 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 (69) hide show
  1. package/README.md +13 -3
  2. package/bin/cli.mjs +2 -0
  3. package/package.json +1 -1
  4. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  5. package/src/orchestrator/agents/api-designer.agent.md +25 -34
  6. package/src/orchestrator/agents/architect.agent.md +40 -84
  7. package/src/orchestrator/agents/content-engineer.agent.md +29 -31
  8. package/src/orchestrator/agents/copywriter.agent.md +35 -60
  9. package/src/orchestrator/agents/data-expert.agent.md +24 -30
  10. package/src/orchestrator/agents/database-engineer.agent.md +26 -31
  11. package/src/orchestrator/agents/developer.agent.md +32 -34
  12. package/src/orchestrator/agents/devops-expert.agent.md +31 -26
  13. package/src/orchestrator/agents/documentation-writer.agent.md +29 -29
  14. package/src/orchestrator/agents/performance-expert.agent.md +36 -33
  15. package/src/orchestrator/agents/release-manager.agent.md +25 -34
  16. package/src/orchestrator/agents/researcher.agent.md +41 -95
  17. package/src/orchestrator/agents/reviewer.agent.md +24 -34
  18. package/src/orchestrator/agents/security-expert.agent.md +35 -39
  19. package/src/orchestrator/agents/seo-specialist.agent.md +25 -32
  20. package/src/orchestrator/agents/session-guard.agent.md +20 -79
  21. package/src/orchestrator/agents/team-lead.agent.md +50 -254
  22. package/src/orchestrator/agents/testing-expert.agent.md +37 -49
  23. package/src/orchestrator/agents/ui-ux-expert.agent.md +33 -39
  24. package/src/orchestrator/customizations/KNOWN-ISSUES.md +0 -1
  25. package/src/orchestrator/customizations/agents/skill-matrix.json +12 -0
  26. package/src/orchestrator/instructions/general.instructions.md +24 -84
  27. package/src/orchestrator/plugins/astro/SKILL.md +23 -179
  28. package/src/orchestrator/plugins/convex/SKILL.md +38 -12
  29. package/src/orchestrator/plugins/netlify/SKILL.md +17 -13
  30. package/src/orchestrator/plugins/nextjs/SKILL.md +55 -261
  31. package/src/orchestrator/plugins/nx/SKILL.md +20 -72
  32. package/src/orchestrator/plugins/playwright/SKILL.md +5 -17
  33. package/src/orchestrator/plugins/slack/SKILL.md +28 -190
  34. package/src/orchestrator/plugins/teams/SKILL.md +10 -140
  35. package/src/orchestrator/plugins/vitest/SKILL.md +2 -2
  36. package/src/orchestrator/prompts/bug-fix.prompt.md +25 -63
  37. package/src/orchestrator/prompts/implement-feature.prompt.md +29 -66
  38. package/src/orchestrator/prompts/quick-refinement.prompt.md +31 -66
  39. package/src/orchestrator/skills/accessibility-standards/SKILL.md +50 -105
  40. package/src/orchestrator/skills/agent-hooks/SKILL.md +60 -110
  41. package/src/orchestrator/skills/agent-memory/SKILL.md +44 -93
  42. package/src/orchestrator/skills/api-patterns/SKILL.md +20 -68
  43. package/src/orchestrator/skills/code-commenting/SKILL.md +49 -101
  44. package/src/orchestrator/skills/context-map/SKILL.md +47 -88
  45. package/src/orchestrator/skills/data-engineering/SKILL.md +27 -74
  46. package/src/orchestrator/skills/decomposition/SKILL.md +50 -98
  47. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +44 -107
  48. package/src/orchestrator/skills/documentation-standards/SKILL.md +28 -89
  49. package/src/orchestrator/skills/fast-review/SKILL.md +51 -276
  50. package/src/orchestrator/skills/frontend-design/SKILL.md +53 -163
  51. package/src/orchestrator/skills/git-workflow/SKILL.md +18 -54
  52. package/src/orchestrator/skills/memory-merger/SKILL.md +51 -88
  53. package/src/orchestrator/skills/observability-logging/SKILL.md +29 -75
  54. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +58 -117
  55. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +65 -140
  56. package/src/orchestrator/skills/performance-optimization/SKILL.md +21 -85
  57. package/src/orchestrator/skills/project-consistency/SKILL.md +62 -281
  58. package/src/orchestrator/skills/react-development/SKILL.md +38 -86
  59. package/src/orchestrator/skills/security-hardening/SKILL.md +40 -84
  60. package/src/orchestrator/skills/self-improvement/SKILL.md +26 -60
  61. package/src/orchestrator/skills/seo-patterns/SKILL.md +40 -105
  62. package/src/orchestrator/skills/session-checkpoints/SKILL.md +26 -68
  63. package/src/orchestrator/skills/team-lead-reference/SKILL.md +66 -206
  64. package/src/orchestrator/skills/testing-workflow/SKILL.md +42 -112
  65. package/src/orchestrator/skills/validation-gates/SKILL.md +39 -170
  66. package/src/orchestrator/snippets/base-output-contract.md +14 -0
  67. package/src/orchestrator/snippets/discovered-issues-policy.md +15 -0
  68. package/src/orchestrator/snippets/logging-mandatory.md +11 -0
  69. package/src/orchestrator/snippets/never-expose-secrets.md +22 -0
@@ -3,134 +3,64 @@ name: testing-workflow
3
3
  description: "Comprehensive testing workflow including test planning, unit/integration/E2E testing patterns, coverage requirements, and common testing mistakes. Use when writing tests, planning test strategies, or validating feature completeness."
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
  # Testing Workflow
9
7
 
10
- ## Core Principles
11
-
12
- - Test implementations thoroughly before claiming completion.
13
- - Every feature must be validated through comprehensive testing covering happy paths, edge cases, error conditions, and user interactions.
14
- - **Mandatory**: Every feature implementation must be tested in the browser using the project's E2E testing tool (resolved via the **e2e-testing** capability slot) before marking as complete.
8
+ ## Core Rules
15
9
 
16
- ## E2E Testing Context Management
10
+ - Validate every feature: happy paths, edge cases, error conditions, interactions.
11
+ - **Mandatory**: Test in browser via the **e2e-testing** capability slot before marking complete.
17
12
 
18
- **Problem:** Comprehensive E2E tests with Chrome MCP accumulate context that can exceed AI context limits (413 errors).
13
+ ## E2E Context Limits
19
14
 
20
- **Rules:**
21
- 1. **ONE suite per session** — never run all suites in one conversation.
22
- 2. **MAX 3 screenshots** per session.
23
- 3. **Use `evaluate_script()` over `take_snapshot()`** returns less data.
24
- 4. **Reload between major test flows** to clear state.
25
- 5. **Log results separately** append to `.opencastle/logs/e2e-results.md`.
15
+ | Rule | Detail |
16
+ |------|--------|
17
+ | One suite per session | Never run all suites in one conversation |
18
+ | Max 3 screenshots | Per session |
19
+ | `evaluate_script()` over `take_snapshot()` | Returns less data |
20
+ | Reload between flows | Clears state |
21
+ | Log results | Append to `.opencastle/logs/e2e-results.md` |
26
22
 
27
- ### Suite Files
28
-
29
- See `.opencastle/project.instructions.md` for the full list of E2E test suite files.
23
+ Suite files: see `.opencastle/project.instructions.md`.
30
24
 
31
25
  ## Pre-Implementation Test Plan
32
26
 
33
- Before implementing any feature, create a plan covering:
34
-
35
- ### 1. Initial State Tests
36
- - Page loads with default values.
37
- - Components render in expected initial state.
38
-
39
- ### 2. User Interaction Tests
40
- - Buttons trigger expected actions.
41
- - Dropdowns respond to selection.
42
- - Filters update URL params and trigger data refetch.
43
- - Forms accept and validate input.
44
-
45
- ### 3. State Transition Tests
46
- - Changing filter values produces different results.
47
- - Data updates on user interaction.
48
- - UI reflects backend state changes.
49
- - Loading states appear during async operations.
50
-
51
- ### 4. Edge Case Tests
52
- - Empty results.
53
- - Maximum/minimum boundaries.
54
- - Invalid input handling.
55
- - Network errors and timeouts.
56
-
57
- ### 5. Integration Tests
58
- - Component interactions work correctly.
59
- - Data flows from server to UI properly.
60
- - URL parameters sync with component state.
61
- - Server-side vs client-side filtering works.
62
-
63
- ### 6. Responsive Breakpoint Tests (MANDATORY for UI changes)
64
-
65
- **Every UI feature must be tested at all responsive breakpoints** defined in your project's testing config. Most layout bugs only surface at smaller viewports.
66
-
67
- > **Detailed breakpoint definitions, resize commands, and per-breakpoint checklists:** See the **browser-testing** skill. The **validation-gates** skill (Gate 3) defines the mandatory testing protocol.
68
-
69
- **Anti-pattern:** Testing only at desktop (or only at the default browser width) and assuming responsive classes work. CSS utility classes can be incorrect — always verify visually at every breakpoint.
27
+ | Category | What to cover |
28
+ |----------|---------------|
29
+ | Initial state | Page loads with defaults; components in expected state |
30
+ | User interactions | Buttons, dropdowns, filters (URL params + refetch), form validation |
31
+ | State transitions | Filter changes produce different results; loading states; backend sync |
32
+ | Edge cases | Empty results, min/max boundaries, invalid input, network errors |
33
+ | Integration | Data flow server→UI, URL params↔state, server vs client filtering |
34
+ | Responsive (MANDATORY for UI) | All breakpoints per **browser-testing** skill / **validation-gates** Gate 3 |
70
35
 
71
36
  ## Coverage Requirements
72
37
 
73
- ### Unit Tests
74
- - **Minimum 95% coverage** for all new code.
75
- - All exported functions, React components, custom hooks.
76
- - Edge cases and error conditions. Input validation.
38
+ | Layer | Minimum |
39
+ |-------|---------|
40
+ | Unit (functions, components, hooks) | 95% |
41
+ | Integration (boundaries, URL sync) | All boundaries |
42
+ | E2E (journeys, interactions, errors) | All critical paths |
77
43
 
78
- ### Integration Tests
79
- - Component integration, data flow, state updates across boundaries.
80
- - URL synchronization.
81
-
82
- ### E2E Tests (Browser Automation)
83
- - Complete user journeys. All interactive elements.
84
- - State transitions. Error handling. Performance.
85
-
86
- ## Testing Anti-Patterns
44
+ ## Anti-Patterns
87
45
 
88
46
  | Anti-Pattern | Correct Approach |
89
47
  |---|---|
90
- | Testing only initial page load | Test filter changes, interactions, different results |
91
- | Assuming filters work because they render | Verify each filter option changes results |
92
- | Client-side only testing | Verify server requests triggered correctly |
93
- | Single scenario testing | Test urban, rural, edge of coverage, out of range |
94
- | Visual inspection only | Verify data values, counts, distances programmatically |
95
-
96
- ## Comprehensive Testing Example
97
-
98
- ```markdown
99
- ### Correct Approach
100
- 1. Load page with Prague coords (50.0755, 14.4378) → 3 places at 10km
101
- 2. Change distance 10km 100km 5 places (added 2 at 44km, 83km)
102
- 3. Change distance 100km 25km 3 places (removed beyond 25km)
103
- 4. Rural coordinates (49.2, 15.5) → 0 places, auto-expanded to 100km
104
- 5. Verified filter changes trigger new server requests
105
- ```
106
-
107
- ## Post-Implementation Browser Testing
108
-
109
- After completing any feature:
110
-
111
- 1. Start dev server (see `project.instructions.md` for app/port details).
112
- 2. Open browser to the dev URL.
113
- 3. Test all critical user flows with the project's E2E testing tool (see the **e2e-testing** skill).
114
- 4. Test edge cases (empty results, max/min values, errors).
115
- 5. Document results with screenshots.
116
-
117
- ### Verify Before Completion
118
-
119
- - [ ] Opened app in browser
120
- - [ ] Tested all interactive elements
121
- - [ ] Verified data changes match expectations
122
- - [ ] Checked edge cases
123
- - [ ] Confirmed empty states display correctly
124
- - [ ] **Tested at all project-defined responsive breakpoints**
125
- - [ ] **No horizontal overflow or layout breakage at any breakpoint**
126
- - [ ] Taken screenshots of key scenarios
127
- - [ ] Verified URL parameters are correct
48
+ | Testing only initial page load | Test filter changes and different results |
49
+ | Assuming filters work because they render | Verify each option changes results |
50
+ | Client-side only | Verify server requests are triggered |
51
+ | Single scenario | Test urban, rural, edge, out-of-range |
52
+ | Visual inspection only | Verify data values programmatically |
53
+
54
+ ## Post-Implementation Checklist
55
+
56
+ - [ ] Dev server running; app opened in browser
57
+ - [ ] All interactive elements tested
58
+ - [ ] Data changes verified (not just visual)
59
+ - [ ] Edge cases: empty states, max/min values, errors
60
+ - [ ] All project-defined responsive breakpoints checked (no overflow/breakage)
61
+ - [ ] URL parameters correct
62
+ - [ ] Screenshots taken of key scenarios
128
63
 
129
64
  ## Commands
130
65
 
131
- Resolve exact test commands via the **codebase-tool** skill. Common tasks:
132
-
133
- - Run project tests
134
- - Run with coverage
135
- - Update snapshots
136
- - Run affected tests only
66
+ Resolve exact commands via the **codebase-tool** skill (run tests, run with coverage, update snapshots, run affected only).
@@ -3,14 +3,8 @@ name: validation-gates
3
3
  description: "Shared validation gates for all orchestration workflows — secret scanning, deterministic checks, blast radius analysis, dependency auditing, browser testing, cache management, regression checks, and final smoke tests. Referenced by prompt templates to maintain single source of truth."
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
  # Validation Gates
9
7
 
10
- Canonical reference for validation gates shared across all orchestration workflows. Prompt templates reference this skill to avoid duplication.
11
-
12
- **Gate summary:**
13
-
14
8
  | Gate | Name | Runs When |
15
9
  |------|------|-----------|
16
10
  | 1 | Secret Scanning | Every delegation |
@@ -24,209 +18,84 @@ Canonical reference for validation gates shared across all orchestration workflo
24
18
  | 9 | Panel Review | High-stakes changes only |
25
19
  | 10 | Final Smoke Test | Feature completion (after all tasks Done) |
26
20
 
27
- ---
28
-
29
21
  ## Gate 1: Secret Scanning
30
22
 
31
- > **HARD GATE — Constitution rule #1.** No tokens, keys, passwords, or connection strings in code, logs, commits, or terminal output.
32
-
33
- Scan every diff **before** any other gate. A secret leak caught after merge is exponentially more expensive than one caught at review time.
34
-
35
- ### What to scan
36
-
37
- Run a regex scan of all changed files for patterns that match common secret formats:
38
-
39
- ```bash
40
- # Scan staged/changed files for common secret patterns
41
- grep -rn -E '(AKIA[0-9A-Z]{16}|sk-[a-zA-Z0-9]{20,}|ghp_[a-zA-Z0-9]{36}|glpat-[a-zA-Z0-9\-]{20}|xox[bpors]-[a-zA-Z0-9\-]+|eyJ[a-zA-Z0-9]{10,}\.[a-zA-Z0-9]{10,}|-----BEGIN (RSA |EC |DSA )?PRIVATE KEY-----|mongodb(\+srv)?://[^\s]+|postgres(ql)?://[^\s]+|mysql://[^\s]+|redis://[^\s]+)' <changed-files>
42
- ```
43
-
44
- Also check for:
45
- - Hardcoded `password`, `secret`, `api_key`, `apiKey`, `token` assignments (not just references)
46
- - `.env` file contents copied into source files
47
- - Base64-encoded secrets (common obfuscation attempt)
23
+ > Inherits: [never-expose-secrets](../../snippets/never-expose-secrets.md)
48
24
 
49
- ### On detection
50
-
51
- - **BLOCK immediately** — do not proceed to Gate 2
52
- - Flag the specific file and line number
53
- - Re-delegate to the agent with explicit instruction to use environment variables instead
54
- - If a secret was already committed, **rotate it immediately** — git history is permanent
55
-
56
- ### Exceptions
57
-
58
- - Test fixtures with obviously fake values (e.g., `sk-test-1234567890`)
59
- - Documentation examples with placeholder values (e.g., `YOUR_API_KEY_HERE`)
60
- - Pattern matches inside comments that are clearly explanatory
25
+ Scan every diff **before** any other gate.
61
26
 
62
27
  ## Gate 2: Deterministic Checks
63
28
 
64
- Run for every affected project (resolve exact commands via the **codebase-tool** skill):
65
-
66
- - **Lint** (with auto-fix)
67
- - **Test**
68
- - **Build**
69
-
70
- All must pass with zero errors. Run for **every** project that consumed modified files, not just the primary project.
29
+ Run for every affected project (resolve exact commands via the **codebase-tool** skill): lint (with auto-fix), test, build. All must pass with zero errors.
71
30
 
72
31
  ## Gate 3: Blast Radius Check
73
32
 
74
- Assess the scope of changes to catch scope creep and ensure reviewers can evaluate the diff effectively.
75
-
76
- ### Thresholds
77
-
78
33
  | Metric | Normal | Warning | Escalate |
79
34
  |--------|--------|---------|----------|
80
35
  | Lines changed | ≤200 | 201–500 | >500 |
81
36
  | Files changed | ≤5 | 6–10 | >10 |
82
37
  | Projects affected | ≤1 | 2 | >2 |
83
38
 
84
- ### Actions
85
-
86
39
  - **Normal** — proceed to Gate 4
87
- - **Warning** — log a note in the delegation record. Ask: *"Was this scope expected?"* If yes, proceed. If unexpected, investigate whether the agent drifted from the partition
88
- - **Escalate** — **STOP.** The Team Lead must review the diff before proceeding:
89
- 1. Verify all changed files are within the agent's assigned partition
90
- 2. Check whether the task should have been split into smaller subtasks
91
- 3. If scope creep: revert extra changes, re-delegate with tighter scope
92
- 4. If legitimately large: proceed, but **always run fast review** (no auto-PASS) and consider panel review
93
-
94
- ### Sensitive files
40
+ - **Warning** — log in delegation record; investigate partition drift if unexpected
41
+ - **Escalate** — STOP. Verify partition; split or revert; mandatory fast review (no auto-PASS)
95
42
 
96
- Changes to these file categories always trigger Warning regardless of line count:
97
-
98
- - Auth/middleware files (e.g., `middleware.ts`, `auth.ts`, `**/auth/**`)
99
- - Database migrations, RLS policies
100
- - Security headers, CSP configuration (`next.config.*`, `vercel.json`)
101
- - Environment variable schemas (`.env.example`, `env.ts`)
102
- - CI/CD configuration (`.github/workflows/**`)
103
- - Package manager configs (`package.json`, lockfiles) — also triggers Gate 4
43
+ **Sensitive files** (always Warning regardless of line count): auth/middleware (`middleware.ts`, `auth.ts`, `**/auth/**`), DB migrations/RLS, security headers/CSP (`next.config.*`, `vercel.json`), env schemas (`.env.example`, `env.ts`), CI/CD (`.github/workflows/**`), package configs (`package.json`, lockfiles) — also triggers Gate 4.
104
44
 
105
45
  ## Gate 4: Dependency Audit
106
46
 
107
47
  > Runs only when `package.json`, `yarn.lock`, `package-lock.json`, `pnpm-lock.yaml`, or similar lockfiles are modified.
108
48
 
109
- When agents add, remove, or update npm packages, verify:
110
-
111
- 1. **Vulnerability scan** — Run `npm audit` (or the project's equivalent). No new `high` or `critical` vulnerabilities
112
- 2. **License compatibility**New packages must use MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, or ISC licenses. Flag any copyleft (GPL, LGPL, AGPL) or proprietary licenses for human review
113
- 3. **Bundle size impact**For frontend packages, note the minified + gzipped size. Flag packages >50KB gzipped that have lighter alternatives
114
- 4. **Duplicate functionality**Check whether the new dependency overlaps with an existing one (e.g., adding `moment` when `date-fns` is already installed)
115
- 5. **Maintenance health**Flag packages with no updates in >2 years or <100 weekly downloads
116
-
117
- ### On failure
118
-
119
- - **Vulnerability:** BLOCK. Re-delegate with instruction to use a patched version or alternative package
120
- - **License concern:** Flag for human review. Do not block, but document in the PR description
121
- - **Size/duplicate:** Flag as SHOULD-FIX in the fast review. Not blocking unless egregious (>200KB)
122
-
123
- ## Gate 5: Fast Review (MANDATORY)
49
+ | Check | Tool | Pass Criteria | On Failure |
50
+ |-------|------|---------------|------------|
51
+ | Vulnerability | `npm audit` | No new high/critical | BLOCK — use patched version or alternative |
52
+ | License || MIT, Apache-2.0, BSD-*, ISC | Flag for human review (non-blocking) |
53
+ | Bundle size || Frontend pkgs ≤50KB gzipped | SHOULD-FIX; blocking if >200KB |
54
+ | Duplicates || No overlap with existing deps | SHOULD-FIX |
55
+ | Maintenance || Updated <2yr, ≥100 weekly DLs | Flag |
124
56
 
125
- > **HARD GATE:** Every agent delegation output must pass fast review before acceptance. This is non-negotiable — even for overnight/unattended runs. Load the **fast-review** skill for the full procedure.
57
+ ## Gate 5: Fast Review
126
58
 
127
- After gates 1–4 pass:
59
+ > **HARD GATE.** Every delegation must pass. Spawn a reviewer sub-agent; PASS → proceed; FAIL → re-delegate (up to 2 retries); 3× FAIL → Gate 9 panel. Load **fast-review** skill.
128
60
 
129
- 1. **Spawn a single reviewer sub-agent** with the review prompt from the fast-review skill
130
- 2. **On PASS** — proceed to remaining gates
131
- 3. **On FAIL** — re-delegate to the same agent with reviewer feedback (up to 2 retries)
132
- 4. **On 3x FAIL** — escalate to panel review (Gate 9)
61
+ **Auto-PASS** (skip reviewer): pure research with no code changes; only `.md` files modified; all deterministic gates passed AND ≤10 lines across ≤2 files AND no sensitive files touched.
133
62
 
134
- The reviewer validates: acceptance criteria met, file partition respected, no regressions, type safety, error handling, security basics, and edge cases.
63
+ > **Sensitive file override:** Sensitive files (Gate 3 list) never get auto-PASS, even for 1-line changes.
135
64
 
136
- **Auto-PASS conditions** (skip the reviewer sub-agent):
137
- - Pure research/exploration with no code changes
138
- - Only `.md` files were modified
139
- - All deterministic gates passed AND the change is ≤10 lines across ≤2 files AND **no sensitive files were touched** (see Gate 3 sensitive file list)
65
+ ## Gate 6: Cache Clearing
140
66
 
141
- > **Sensitive file override:** If any changed file falls into the sensitive file categories listed in Gate 3 (auth, migrations, security headers, env schemas, CI/CD), auto-PASS is **never** applied — even for 1-line changes. These files always get a human-quality review.
67
+ Clear framework and task runner caches before starting the dev server. See **codebase-tool** skill.
142
68
 
143
- ## Gate 6: Cache Clearing (BEFORE Browser Testing)
69
+ ## Gate 7: Browser Testing
144
70
 
145
- **Always clear before testing.** Testing stale code wastes time and produces false results.
71
+ > **HARD GATE:** UI changes are NOT done without screenshots in Chrome proving the feature works.
146
72
 
147
- Clear framework caches and task runner caches before starting the dev server for browser testing. See the **codebase-tool** skill for cache-clearing commands.
73
+ 1. Start dev server (see **codebase-tool** skill)
74
+ 2. Verify all acceptance-criteria items render and behave correctly
75
+ 3. Test responsive breakpoints; verify empty, error, and loading states
76
+ 4. Capture screenshots of key states (REQUIRED)
148
77
 
149
- ## Gate 7: Browser Testing (MANDATORY for UI Changes)
150
-
151
- > **HARD GATE:** A task with UI changes is NOT done until you have screenshots in Chrome proving the feature works. "The code looks correct" is not proof. "Tests pass" is not proof. Only a screenshot of the working UI in Chrome is proof.
152
-
153
- 1. **Start the dev server** — use the project's serve command (see the **codebase-tool** skill) — wait for it to be ready
154
- 2. **Navigate to affected pages** — Verify the new feature renders correctly
155
- 3. **Verify SPECIFIC features** — Check every feature listed in the acceptance criteria. If the criteria say "icons, groups, and AND/OR toggle", you must see all three in the browser
156
- 4. **Test interactions** — Click buttons, fill forms, toggle filters, submit data
157
- 5. **Test responsive** — Resize to each breakpoint defined in your project's testing config
158
- 6. **Test edge cases** — Empty states, error states, loading states, long content
159
- 7. **Screenshot evidence (REQUIRED)** — Take screenshots of key states. These are mandatory proof
160
-
161
- > **Anti-pattern:** Testing only at desktop width and assuming responsive classes work. They can be wrong — always verify at all defined breakpoints.
162
-
163
- Load the **browser-testing** skill for Chrome MCP commands, breakpoint details, and reporting format.
78
+ Load the **browser-testing** skill for Chrome MCP commands, breakpoints, and reporting format.
164
79
 
165
80
  ## Gate 8: Regression Testing
166
81
 
167
- New features must not break existing functionality:
168
-
169
- 1. **Run full test suite** for affected projects not just the new tests
170
- 2. **Browser-test adjacent pages** — If you changed a shared component, test pages that use it
171
- 3. **Verify navigation** — Ensure routing, links, and back-button behavior still work
172
- 4. **Check shared components** — If a component from a shared library was modified, test it in all apps that consume it
82
+ 1. Run full test suite for all affected projects
83
+ 2. Browser-test adjacent pages; verify navigation, routing, and back-button
84
+ 3. Check shared components in all consuming apps if a shared library changed
173
85
 
174
- ## Gate 9: Panel Review (High-Stakes Only)
86
+ ## Gate 9: Panel Review
175
87
 
176
- Use the **panel-majority-vote** skill for:
88
+ Use the **panel-majority-vote** skill for: security-sensitive changes, DB migrations, architecture decisions/large refactors, complex business logic without comprehensive tests.
177
89
 
178
- - Security-sensitive changes (auth flows, RLS policies, API endpoints)
179
- - Database migrations that alter production data or schema
180
- - Architecture decisions or large refactors affecting multiple libraries
181
- - Complex business logic without comprehensive test coverage
90
+ On BLOCK: extract MUST-FIX items, re-delegate, re-run panel. Max 3 attempts, then escalate to Architect.
182
91
 
183
- If the panel returns BLOCK, extract MUST-FIX items, re-delegate to the same agent, and re-run the panel. Never skip, never halt. Max 3 attempts, then escalate to Architect.
92
+ ## Gate 10: Final Smoke Test
184
93
 
185
- ## Gate 10: Final Smoke Test (Feature-Level)
94
+ > Runs once after ALL tasks are Done.
186
95
 
187
- > Runs once after ALL tasks in a feature are Done — not per-task.
188
-
189
- Individual tasks pass gates 1–9 independently. But the combined result may have integration issues that per-task testing misses. This gate verifies the feature as a cohesive unit.
190
-
191
- ### Steps
192
-
193
- 1. **Full build** — Build all affected projects from clean state (not incremental)
194
- 2. **Full test suite** — Run tests across all projects that consumed any changed files
195
- 3. **End-to-end browser walkthrough** — Navigate the complete user flow from start to finish:
196
- - Verify all states: loading, empty, populated, error, partial
197
- - Test every state transition end-to-end (not just individual screens)
198
- - Confirm data flows correctly between pages/components
199
- - Test the happy path AND at least one error path
200
- 4. **Cross-task integration check** — Verify that outputs from different tasks (e.g., DB migration + component + page) compose correctly
201
- 5. **Smoke test at all breakpoints** — If the feature has UI, one final responsive sweep
202
-
203
- ### When to skip
204
-
205
- - Non-UI features with comprehensive test coverage (e.g., pure backend/data pipeline work where tests verify integration)
206
- - Single-task features (Gate 8 already covers regression)
207
-
208
- ### On failure
209
-
210
- Re-delegate the specific failing integration point to the agent responsible for that layer. Do NOT re-run the entire feature implementation.
211
-
212
- ---
96
+ 1. Full build + full test suite from clean state
97
+ 2. End-to-end browser walkthrough (loading, empty, populated, error states, transitions)
98
+ 3. Cross-task integration check
99
+ 4. Final responsive sweep (if UI)
213
100
 
214
- ## Universal Completion Checklist
215
-
216
- Use this checklist for any orchestration workflow:
217
-
218
- - [ ] **No secrets in diff** (Gate 1)
219
- - [ ] Lint, test, and build pass for all affected projects (Gate 2)
220
- - [ ] Blast radius assessed — scope is expected (Gate 3)
221
- - [ ] Dependency audit passed if packages changed (Gate 4)
222
- - [ ] **Fast review passed** (mandatory — load **fast-review** skill) (Gate 5)
223
- - [ ] Dev server started with **clean cache** (Gate 6)
224
- - [ ] UI changes verified in Chrome with screenshots at all breakpoints (Gate 7)
225
- - [ ] Every acceptance criteria item visually confirmed — not just "page loads"
226
- - [ ] No regressions in adjacent functionality (Gate 8)
227
- - [ ] Panel review passed for high-stakes changes (Gate 9)
228
- - [ ] **Final smoke test passed** for multi-task features (Gate 10)
229
- - [ ] Shared code changes tested across all consuming apps
230
- - [ ] No duplicated code — shared logic extracted to libraries
231
- - [ ] Lessons learned captured if any retries occurred
232
- - [ ] Known issues updated if new limitations were discovered
101
+ **Skip for:** non-UI with comprehensive tests, or single-task features (Gate 8 covers those). On failure: re-delegate the specific failing integration only.
@@ -0,0 +1,14 @@
1
+ # Base Output Contract
2
+
3
+ Every specialist agent Output Contract MUST end with these standard items (in addition to domain-specific items above them):
4
+
5
+ - **Observability Logged** — Confirm ALL applicable log records were appended to `events.ndjson` (Constitution rule #6):
6
+ - `--type session` — ALWAYS (every agent, every session)
7
+ - `--type delegation` — if delegations occurred (Team Lead only)
8
+ - `--type review` — if fast reviews occurred
9
+ - `--type panel` — if panel reviews occurred
10
+ - `--type dispute` — if disputes were created
11
+ - **Discovered Issues** — Pre-existing bugs or anomalies found during work, with tracking action taken per the [Discovered Issues Policy](discovered-issues-policy.md)
12
+ - **Lessons Applied** — Lessons from `.opencastle/LESSONS-LEARNED.md` that influenced this work, and any new lessons added
13
+
14
+ Agents reference this contract with: `See [Base Output Contract](../snippets/base-output-contract.md) for the standard closing items.`
@@ -0,0 +1,15 @@
1
+ # Discovered Issues Policy
2
+
3
+ > **⛔ No issue gets ignored.** Untracked bugs discovered during work are a quality gate failure.
4
+
5
+ When you encounter a bug, error, or unexpected behavior unrelated to the current task:
6
+
7
+ 1. **Check if already tracked:**
8
+ - Search `.opencastle/KNOWN-ISSUES.md` for a matching entry
9
+ - If task tracker tools are available, search for open bugs
10
+ 2. **If found tracked** — skip it, continue with your current work
11
+ 3. **If NOT tracked** — you must act:
12
+ - **Unfixable limitation** (third-party, platform, upstream) → add to `.opencastle/KNOWN-ISSUES.md` with: Issue ID, Status, Severity, Evidence, Root Cause, Solution Options
13
+ - **Fixable bug** → create a tracker ticket with label `bug`, priority, symptoms, reproduction steps, and affected files. If no tracker tools available, add a `**Discovered Issues**` section to your output.
14
+
15
+ Never assume a pre-existing issue is somebody else problem. If it is not tracked, track it.
@@ -0,0 +1,11 @@
1
+ # Logging Is Mandatory
2
+
3
+ > **⛔ HARD GATE — Constitution rule #6.** Every agent MUST log every session to `.opencastle/logs/events.ndjson`. No exceptions. No threshold. No "too small to log."
4
+
5
+ - Log **before yielding** to the user — logging is the LAST action before responding.
6
+ - Log **per task**, not per conversation. Multiple tasks = multiple records.
7
+ - Never batch-log retrospectively across sessions.
8
+ - Use `opencastle log --type session ...` for session records.
9
+ - Verify the append succeeded: `tail -1 .opencastle/logs/events.ndjson`.
10
+
11
+ See the **observability-logging** skill for full CLI commands, record schemas, and the pre-response checklist.
@@ -0,0 +1,22 @@
1
+ # Never Expose Secrets
2
+
3
+ > **HARD GATE — Constitution rule 1.** No tokens, keys, passwords, or connection strings in code, logs, commits, or terminal output. Use environment variables.
4
+
5
+ ## What to scan
6
+
7
+ - AWS keys (AKIA...), API tokens (sk-..., ghp_...), private keys, database URIs
8
+ - Hardcoded password, secret, api_key, apiKey, token assignments (not just references)
9
+ - .env file contents copied into source files
10
+ - Base64-encoded secrets
11
+
12
+ ## On detection
13
+
14
+ - **BLOCK immediately** — flag the specific file and line number.
15
+ - Re-delegate with explicit instruction to use environment variables.
16
+ - If already committed, **rotate immediately** — git history is permanent.
17
+
18
+ ## Exceptions
19
+
20
+ - Test fixtures with obviously fake values (e.g., sk-test-1234567890)
21
+ - Documentation examples with placeholder values (e.g., YOUR_API_KEY_HERE)
22
+ - Pattern matches inside comments that are clearly explanatory