tribunal-kit 2.4.6 โ†’ 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/.agent/ARCHITECTURE.md +99 -99
  2. package/.agent/GEMINI.md +52 -52
  3. package/.agent/agents/accessibility-reviewer.md +139 -86
  4. package/.agent/agents/ai-code-reviewer.md +160 -90
  5. package/.agent/agents/backend-specialist.md +164 -127
  6. package/.agent/agents/code-archaeologist.md +115 -73
  7. package/.agent/agents/database-architect.md +130 -110
  8. package/.agent/agents/debugger.md +137 -97
  9. package/.agent/agents/dependency-reviewer.md +78 -30
  10. package/.agent/agents/devops-engineer.md +161 -118
  11. package/.agent/agents/documentation-writer.md +151 -87
  12. package/.agent/agents/explorer-agent.md +117 -99
  13. package/.agent/agents/frontend-reviewer.md +127 -47
  14. package/.agent/agents/frontend-specialist.md +169 -109
  15. package/.agent/agents/game-developer.md +28 -164
  16. package/.agent/agents/logic-reviewer.md +87 -49
  17. package/.agent/agents/mobile-developer.md +151 -103
  18. package/.agent/agents/mobile-reviewer.md +133 -50
  19. package/.agent/agents/orchestrator.md +121 -110
  20. package/.agent/agents/penetration-tester.md +103 -77
  21. package/.agent/agents/performance-optimizer.md +136 -92
  22. package/.agent/agents/performance-reviewer.md +139 -69
  23. package/.agent/agents/product-manager.md +104 -70
  24. package/.agent/agents/product-owner.md +6 -25
  25. package/.agent/agents/project-planner.md +95 -95
  26. package/.agent/agents/qa-automation-engineer.md +174 -87
  27. package/.agent/agents/security-auditor.md +133 -129
  28. package/.agent/agents/seo-specialist.md +160 -99
  29. package/.agent/agents/sql-reviewer.md +132 -44
  30. package/.agent/agents/supervisor-agent.md +137 -109
  31. package/.agent/agents/swarm-worker-contracts.md +17 -17
  32. package/.agent/agents/swarm-worker-registry.md +46 -46
  33. package/.agent/agents/test-coverage-reviewer.md +132 -53
  34. package/.agent/agents/test-engineer.md +0 -21
  35. package/.agent/agents/type-safety-reviewer.md +143 -33
  36. package/.agent/patterns/generator.md +9 -9
  37. package/.agent/patterns/inversion.md +12 -12
  38. package/.agent/patterns/pipeline.md +9 -9
  39. package/.agent/patterns/reviewer.md +13 -13
  40. package/.agent/patterns/tool-wrapper.md +9 -9
  41. package/.agent/rules/GEMINI.md +63 -63
  42. package/.agent/scripts/__pycache__/auto_preview.cpython-311.pyc +0 -0
  43. package/.agent/scripts/__pycache__/bundle_analyzer.cpython-311.pyc +0 -0
  44. package/.agent/scripts/__pycache__/checklist.cpython-311.pyc +0 -0
  45. package/.agent/scripts/__pycache__/dependency_analyzer.cpython-311.pyc +0 -0
  46. package/.agent/scripts/__pycache__/security_scan.cpython-311.pyc +0 -0
  47. package/.agent/scripts/__pycache__/session_manager.cpython-311.pyc +0 -0
  48. package/.agent/scripts/__pycache__/skill_integrator.cpython-311.pyc +0 -0
  49. package/.agent/scripts/__pycache__/swarm_dispatcher.cpython-311.pyc +0 -0
  50. package/.agent/scripts/__pycache__/test_runner.cpython-311.pyc +0 -0
  51. package/.agent/scripts/__pycache__/verify_all.cpython-311.pyc +0 -0
  52. package/.agent/scripts/compress_skills.py +167 -0
  53. package/.agent/scripts/consolidate_skills.py +173 -0
  54. package/.agent/scripts/deep_compress.py +202 -0
  55. package/.agent/scripts/minify_context.py +80 -0
  56. package/.agent/scripts/security_scan.py +1 -1
  57. package/.agent/scripts/strip_tribunal.py +41 -0
  58. package/.agent/skills/agent-organizer/SKILL.md +60 -100
  59. package/.agent/skills/agentic-patterns/SKILL.md +0 -70
  60. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +108 -53
  61. package/.agent/skills/api-patterns/SKILL.md +197 -257
  62. package/.agent/skills/api-security-auditor/SKILL.md +125 -57
  63. package/.agent/skills/app-builder/SKILL.md +326 -50
  64. package/.agent/skills/app-builder/templates/SKILL.md +13 -15
  65. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +16 -16
  66. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +22 -22
  67. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +18 -18
  68. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +20 -20
  69. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +17 -17
  70. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +18 -18
  71. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +21 -21
  72. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +19 -19
  73. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +26 -26
  74. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +26 -26
  75. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +19 -19
  76. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +18 -18
  77. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +20 -20
  78. package/.agent/skills/appflow-wireframe/SKILL.md +71 -98
  79. package/.agent/skills/architecture/SKILL.md +161 -200
  80. package/.agent/skills/authentication-best-practices/SKILL.md +121 -54
  81. package/.agent/skills/bash-linux/SKILL.md +71 -166
  82. package/.agent/skills/behavioral-modes/SKILL.md +8 -69
  83. package/.agent/skills/brainstorming/SKILL.md +345 -127
  84. package/.agent/skills/building-native-ui/SKILL.md +125 -57
  85. package/.agent/skills/clean-code/SKILL.md +266 -149
  86. package/.agent/skills/code-review-checklist/SKILL.md +0 -62
  87. package/.agent/skills/config-validator/SKILL.md +73 -131
  88. package/.agent/skills/csharp-developer/SKILL.md +434 -73
  89. package/.agent/skills/database-design/SKILL.md +190 -275
  90. package/.agent/skills/deployment-procedures/SKILL.md +81 -158
  91. package/.agent/skills/devops-engineer/SKILL.md +255 -94
  92. package/.agent/skills/devops-incident-responder/SKILL.md +50 -69
  93. package/.agent/skills/doc.md +5 -5
  94. package/.agent/skills/documentation-templates/SKILL.md +19 -63
  95. package/.agent/skills/edge-computing/SKILL.md +75 -165
  96. package/.agent/skills/extract-design-system/SKILL.md +84 -58
  97. package/.agent/skills/framer-motion-expert/SKILL.md +195 -0
  98. package/.agent/skills/frontend-design/SKILL.md +151 -499
  99. package/.agent/skills/game-design-expert/SKILL.md +71 -0
  100. package/.agent/skills/game-engineering-expert/SKILL.md +88 -0
  101. package/.agent/skills/geo-fundamentals/SKILL.md +52 -178
  102. package/.agent/skills/github-operations/SKILL.md +197 -272
  103. package/.agent/skills/gsap-expert/SKILL.md +194 -0
  104. package/.agent/skills/i18n-localization/SKILL.md +60 -172
  105. package/.agent/skills/intelligent-routing/SKILL.md +123 -103
  106. package/.agent/skills/lint-and-validate/SKILL.md +8 -52
  107. package/.agent/skills/llm-engineering/SKILL.md +281 -195
  108. package/.agent/skills/local-first/SKILL.md +76 -159
  109. package/.agent/skills/mcp-builder/SKILL.md +48 -188
  110. package/.agent/skills/mobile-design/SKILL.md +213 -219
  111. package/.agent/skills/motion-engineering/SKILL.md +184 -0
  112. package/.agent/skills/nextjs-react-expert/SKILL.md +184 -203
  113. package/.agent/skills/nodejs-best-practices/SKILL.md +403 -185
  114. package/.agent/skills/observability/SKILL.md +211 -203
  115. package/.agent/skills/parallel-agents/SKILL.md +53 -146
  116. package/.agent/skills/performance-profiling/SKILL.md +171 -151
  117. package/.agent/skills/plan-writing/SKILL.md +49 -153
  118. package/.agent/skills/platform-engineer/SKILL.md +57 -103
  119. package/.agent/skills/playwright-best-practices/SKILL.md +110 -63
  120. package/.agent/skills/powershell-windows/SKILL.md +61 -179
  121. package/.agent/skills/python-patterns/SKILL.md +7 -35
  122. package/.agent/skills/python-pro/SKILL.md +273 -114
  123. package/.agent/skills/react-specialist/SKILL.md +227 -108
  124. package/.agent/skills/readme-builder/SKILL.md +15 -85
  125. package/.agent/skills/realtime-patterns/SKILL.md +216 -243
  126. package/.agent/skills/red-team-tactics/SKILL.md +10 -51
  127. package/.agent/skills/rust-pro/SKILL.md +525 -142
  128. package/.agent/skills/seo-fundamentals/SKILL.md +92 -153
  129. package/.agent/skills/server-management/SKILL.md +110 -166
  130. package/.agent/skills/shadcn-ui-expert/SKILL.md +154 -55
  131. package/.agent/skills/skill-creator/SKILL.md +18 -58
  132. package/.agent/skills/sql-pro/SKILL.md +543 -68
  133. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +28 -68
  134. package/.agent/skills/swiftui-expert/SKILL.md +124 -57
  135. package/.agent/skills/systematic-debugging/SKILL.md +49 -151
  136. package/.agent/skills/tailwind-patterns/SKILL.md +433 -149
  137. package/.agent/skills/tdd-workflow/SKILL.md +63 -169
  138. package/.agent/skills/test-result-analyzer/SKILL.md +33 -73
  139. package/.agent/skills/testing-patterns/SKILL.md +437 -130
  140. package/.agent/skills/trend-researcher/SKILL.md +30 -71
  141. package/.agent/skills/ui-ux-pro-max/SKILL.md +0 -41
  142. package/.agent/skills/ui-ux-researcher/SKILL.md +51 -91
  143. package/.agent/skills/vue-expert/SKILL.md +225 -119
  144. package/.agent/skills/vulnerability-scanner/SKILL.md +264 -226
  145. package/.agent/skills/web-accessibility-auditor/SKILL.md +141 -58
  146. package/.agent/skills/web-design-guidelines/SKILL.md +17 -61
  147. package/.agent/skills/webapp-testing/SKILL.md +71 -196
  148. package/.agent/skills/whimsy-injector/SKILL.md +58 -132
  149. package/.agent/skills/workflow-optimizer/SKILL.md +28 -68
  150. package/.agent/workflows/api-tester.md +96 -224
  151. package/.agent/workflows/audit.md +81 -122
  152. package/.agent/workflows/brainstorm.md +69 -105
  153. package/.agent/workflows/changelog.md +65 -97
  154. package/.agent/workflows/create.md +73 -88
  155. package/.agent/workflows/debug.md +80 -111
  156. package/.agent/workflows/deploy.md +119 -92
  157. package/.agent/workflows/enhance.md +80 -91
  158. package/.agent/workflows/fix.md +68 -97
  159. package/.agent/workflows/generate.md +165 -164
  160. package/.agent/workflows/migrate.md +106 -109
  161. package/.agent/workflows/orchestrate.md +103 -86
  162. package/.agent/workflows/performance-benchmarker.md +77 -268
  163. package/.agent/workflows/plan.md +120 -98
  164. package/.agent/workflows/preview.md +39 -96
  165. package/.agent/workflows/refactor.md +105 -97
  166. package/.agent/workflows/review-ai.md +63 -102
  167. package/.agent/workflows/review.md +71 -110
  168. package/.agent/workflows/session.md +53 -113
  169. package/.agent/workflows/status.md +42 -88
  170. package/.agent/workflows/strengthen-skills.md +90 -51
  171. package/.agent/workflows/swarm.md +114 -129
  172. package/.agent/workflows/test.md +125 -102
  173. package/.agent/workflows/tribunal-backend.md +60 -78
  174. package/.agent/workflows/tribunal-database.md +62 -100
  175. package/.agent/workflows/tribunal-frontend.md +62 -82
  176. package/.agent/workflows/tribunal-full.md +56 -100
  177. package/.agent/workflows/tribunal-mobile.md +65 -94
  178. package/.agent/workflows/tribunal-performance.md +62 -105
  179. package/.agent/workflows/ui-ux-pro-max.md +72 -121
  180. package/README.md +11 -15
  181. package/package.json +1 -1
  182. package/.agent/skills/api-patterns/api-style.md +0 -42
  183. package/.agent/skills/api-patterns/auth.md +0 -24
  184. package/.agent/skills/api-patterns/documentation.md +0 -26
  185. package/.agent/skills/api-patterns/graphql.md +0 -41
  186. package/.agent/skills/api-patterns/rate-limiting.md +0 -31
  187. package/.agent/skills/api-patterns/response.md +0 -37
  188. package/.agent/skills/api-patterns/rest.md +0 -40
  189. package/.agent/skills/api-patterns/security-testing.md +0 -122
  190. package/.agent/skills/api-patterns/trpc.md +0 -41
  191. package/.agent/skills/api-patterns/versioning.md +0 -22
  192. package/.agent/skills/app-builder/agent-coordination.md +0 -71
  193. package/.agent/skills/app-builder/feature-building.md +0 -53
  194. package/.agent/skills/app-builder/project-detection.md +0 -34
  195. package/.agent/skills/app-builder/scaffolding.md +0 -118
  196. package/.agent/skills/app-builder/tech-stack.md +0 -40
  197. package/.agent/skills/architecture/context-discovery.md +0 -43
  198. package/.agent/skills/architecture/examples.md +0 -94
  199. package/.agent/skills/architecture/pattern-selection.md +0 -68
  200. package/.agent/skills/architecture/patterns-reference.md +0 -50
  201. package/.agent/skills/architecture/trade-off-analysis.md +0 -77
  202. package/.agent/skills/brainstorming/dynamic-questioning.md +0 -360
  203. package/.agent/skills/database-design/database-selection.md +0 -43
  204. package/.agent/skills/database-design/indexing.md +0 -39
  205. package/.agent/skills/database-design/migrations.md +0 -48
  206. package/.agent/skills/database-design/optimization.md +0 -36
  207. package/.agent/skills/database-design/orm-selection.md +0 -30
  208. package/.agent/skills/database-design/schema-design.md +0 -56
  209. package/.agent/skills/dotnet-core-expert/SKILL.md +0 -103
  210. package/.agent/skills/framer-motion-animations/SKILL.md +0 -74
  211. package/.agent/skills/frontend-design/animation-guide.md +0 -331
  212. package/.agent/skills/frontend-design/color-system.md +0 -329
  213. package/.agent/skills/frontend-design/decision-trees.md +0 -418
  214. package/.agent/skills/frontend-design/motion-graphics.md +0 -306
  215. package/.agent/skills/frontend-design/typography-system.md +0 -363
  216. package/.agent/skills/frontend-design/ux-psychology.md +0 -1116
  217. package/.agent/skills/frontend-design/visual-effects.md +0 -383
  218. package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  219. package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  220. package/.agent/skills/game-development/SKILL.md +0 -236
  221. package/.agent/skills/game-development/game-art/SKILL.md +0 -185
  222. package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  223. package/.agent/skills/game-development/game-design/SKILL.md +0 -129
  224. package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  225. package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  226. package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  227. package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  228. package/.agent/skills/game-development/web-games/SKILL.md +0 -150
  229. package/.agent/skills/intelligent-routing/router-manifest.md +0 -65
  230. package/.agent/skills/mobile-design/decision-trees.md +0 -516
  231. package/.agent/skills/mobile-design/mobile-backend.md +0 -491
  232. package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
  233. package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
  234. package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
  235. package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
  236. package/.agent/skills/mobile-design/mobile-performance.md +0 -767
  237. package/.agent/skills/mobile-design/mobile-testing.md +0 -356
  238. package/.agent/skills/mobile-design/mobile-typography.md +0 -433
  239. package/.agent/skills/mobile-design/platform-android.md +0 -666
  240. package/.agent/skills/mobile-design/platform-ios.md +0 -561
  241. package/.agent/skills/mobile-design/touch-psychology.md +0 -537
  242. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  243. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  244. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  245. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  246. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  247. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  248. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  249. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  250. package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
@@ -1,188 +1,84 @@
1
1
  ---
2
2
  name: plan-writing
3
- description: Structured task planning with clear breakdowns, dependencies, and verification criteria. Use when implementing features, refactoring, or any multi-step work.
3
+ description: Technical design and implementation planning mastery. Writing structured execution checklists, dependency mapping, establishing rollback protocols, segmenting monolithic tasks, writing ADRs (Architecture Decision Records), and defining verification criteria. Use when transitioning from ideation to coordinated execution.
4
4
  allowed-tools: Read, Write, Edit, Glob, Grep
5
- version: 1.0.0
6
- last-updated: 2026-03-12
5
+ version: 2.0.0
6
+ last-updated: 2026-04-02
7
7
  applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
8
8
  ---
9
9
 
10
- # Task Planning Standards
11
-
12
- > A plan is not a promise. It is a map.
13
- > Maps get updated when the terrain doesn't match them.
10
+ # Plan Writing โ€” Execution Blueprints Mastery
14
11
 
15
12
  ---
16
13
 
17
- ## When to Write a Plan
14
+ ## 1. The Implementation Plan Structure (ADR-Lite)
18
15
 
19
- Write a plan before implementation when:
20
- - The task touches more than 2 files in non-trivial ways
21
- - The task has dependencies (thing B can't start until thing A is done)
22
- - The task involves a risky operation (migration, data transformation, breaking change)
23
- - The team needs to review the approach before time is spent implementing it
16
+ Before altering multiple files or introducing a new system architecture, a rigid `implementation_plan.md` MUST be generated and approved.
24
17
 
25
- Skip the formal plan for: single-function fixes, typo corrections, config tweaks.
18
+ **Core Sections:**
19
+ 1. **Objective Context:** 2-sentence summary of the requested goal.
20
+ 2. **Architectural Handoff:** (What stack, what libraries, what constraints).
21
+ 3. **Dependency Tree Execution Order:** (Cannot build frontend UI until backend API exists).
22
+ 4. **File Blueprint:** Exact files expected to be touched (`[NEW] src/api/user.ts`, `[MODIFY] src/db/schema.prisma`).
23
+ 5. **Verification Protocol:** Exactly how the agent/human will prove the task is completed successfully.
26
24
 
27
25
  ---
28
26
 
29
- ## Plan Structure
30
-
31
- ```markdown
32
- # Plan: [Feature or Task Name]
33
-
34
- ## Goal
35
- One sentence: what outcome does this achieve?
36
-
37
- ## Context
38
- - Why is this being done?
39
- - What problem does it solve or what requirement does it satisfy?
40
- - What exists today that this changes?
41
-
42
- ## Approach
43
- High-level strategy. Enough detail for someone unfamiliar with the code to understand the direction.
44
- Not implementation details โ€” those go in the tasks.
45
-
46
- ## Tasks
27
+ ## 2. Segmenting Monolithic Tasks (Chunking)
47
28
 
48
- ### Phase 1 โ€” [Name] (prerequisite for Phase 2)
49
- - [ ] Task 1.1: Description
50
- - [ ] Task 1.2: Description (depends on 1.1)
29
+ LLMs degrade significantly when asked to process >10 file alterations across multiple directories simultaneously. The Plan Writer must break work into logical, isolated "Waves."
51
30
 
52
- ### Phase 2 โ€” [Name] (can run after Phase 1 is complete)
53
- - [ ] Task 2.1: Description
54
- - [ ] Task 2.2: Description
55
-
56
- ## Verification
57
- How will we know this is done and working?
58
- - [ ] Specific behavior that can be tested
59
- - [ ] Metric or log line that confirms success
60
- - [ ] Edge case that must not regress
61
-
62
- ## Risks and Open Questions
63
- - [Risk]: What might go wrong, and what's the mitigation?
64
- - [Open]: What decision hasn't been made yet that could change this plan?
65
-
66
- ## Files That Will Change
67
- - `path/to/file.ts` โ€” what changes
68
- - `path/to/schema.sql` โ€” what changes
69
- ```
70
-
71
- ---
72
-
73
- ## Dependency Notation
74
-
75
- When tasks have a strict order, mark it:
76
-
77
- ```
78
- Task A โ€” (no dependencies, do first)
79
- Task B โ€” (requires A complete)
80
- Task C โ€” (can run parallel with B)
81
- Task D โ€” (requires B and C complete)
31
+ ```markdown
32
+ ### Wave 1: Data Layer (The Foundation)
33
+ 1. Add `Subscription` model to Prisma schema.
34
+ 2. Generate migration (`npx prisma migrate dev`).
35
+ 3. Add mock seed data.
36
+
37
+ ### Wave 2: API Layer (The Bridge)
38
+ 1. Build `/api/subscriptions/route.ts` with explicit Zod validation.
39
+ 2. Write Vitest logic enforcing authorization roles.
40
+
41
+ ### Wave 3: UI Layer (The Implementation)
42
+ 1. Build `SubscriptionCard.tsx`.
43
+ 2. Connect to API using MSW mocked tests first.
44
+ 3. Integrate into main dashboard.
82
45
  ```
83
46
 
84
- This prevents teams from working on D while B is still broken.
85
-
86
- ---
87
-
88
- ## Task Granularity
89
-
90
- Each task should be:
91
- - Completable in one session by one person
92
- - Independently reviewable (a PR could represent one task)
93
- - Testable: there is a concrete way to know if it's done
94
-
95
- **Too vague:** "Implement the auth system"
96
- **Right size:** "Add `POST /api/auth/login` endpoint with JWT issuance and Zod validation"
97
-
98
- ---
99
-
100
- ## Updating the Plan
101
-
102
- Plans are living documents:
103
-
104
- - Mark tasks `[x]` when complete, not when started
105
- - Add `[!]` to blocked tasks with a note on what is blocking
106
- - When an assumption proves wrong, update the approach section โ€” don't silently deviate from the plan
47
+ *Crucial:* Each wave MUST be executable and testable independently. Do not begin Wave 2 until Wave 1 passes Verification Protocols.
107
48
 
108
49
  ---
109
50
 
110
- ## Verification Criteria Rules
51
+ ## 3. Rollback & Contingency Planning
111
52
 
112
- Verification criteria are not optional. For each task:
53
+ No plan survives first contact with the compiler. The plan must implicitly include safe-fail procedures.
113
54
 
114
- - At least one must be **observable** (you can see it, not just believe it)
115
- - At least one must cover a **failure mode** (what should NOT happen)
116
-
117
- ```
118
- โœ… Observable: `POST /api/users` returns 201 with a user ID in the response body
119
- โœ… Failure mode: `POST /api/users` with a duplicate email returns 409, not 500
120
- ```
55
+ - **Non-Destructive Defaults:** If a schema migration fails, how do we revert? (e.g., explicit instruction to backup SQLite DB locally before operations).
56
+ - **Graceful Feature Toggles:** Is the new feature walled behind an environment variable (`ENABLE_NEW_DASHBOARD=true`) so it can be disabled instantly if it crashes in production?
121
57
 
122
58
  ---
123
59
 
124
- ## ๐Ÿ›‘ Verification-Before-Completion (VBC) Protocol
60
+ ## 4. The `task.md` Execution Ledger
125
61
 
126
- **CRITICAL:** Every plan must integrate a strict "evidence-based closeout" state machine for its tasks.
127
- - โŒ **Forbidden:** Writing vague verification steps like "Check that it looks right," "Ensure the code makes sense," or "Verify the logic."
128
- - โœ… **Required:** Verification criteria MUST demand **concrete terminal/compiler evidence** (e.g., test success logs, CLI execution outputs, compiler success states, or network trace results). Explicitly state that an agent CANNOT consider the task complete until it captures this hard evidence.
62
+ Unlike the high-level `implementation_plan.md`, the `task.md` serves as the live, mutating execution state.
129
63
 
130
- ---
64
+ ```markdown
65
+ # Current Objective: Upgrade Authentication
131
66
 
132
- ## Output Format
67
+ ## Pre-Flight
68
+ - [x] Dump existing environment variables locally
69
+ - [x] Verify current tests pass (Baseline health)
133
70
 
134
- When this skill produces a recommendation or design decision, structure your output as:
71
+ ## Wave 1 (OAuth Scaffold)
72
+ - [/] Install auth.js dependencies
73
+ - [ ] Connect Google Provider inside `[...nextauth].ts`
135
74
 
75
+ ## Wave 2 (Database Mappings)
76
+ - [ ] Update Users table to handle polymorphic OAuth links
136
77
  ```
137
- โ”โ”โ” Plan Writing Recommendation โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
138
- Decision: [what was chosen / proposed]
139
- Rationale: [why โ€” one concise line]
140
- Trade-offs: [what is consciously accepted]
141
- Next action: [concrete next step for the user]
142
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
143
- Pre-Flight: โœ… All checks passed
144
- or โŒ [blocking item that must be resolved first]
145
- ```
146
-
147
78
 
79
+ *Rules:*
80
+ - `[ ]` = Unstarted
81
+ - `[/]` = In Progress (Current Focus)
82
+ - `[x]` = Verified Complete
148
83
 
149
84
  ---
150
-
151
- ## ๐Ÿค– LLM-Specific Traps
152
-
153
- AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
154
-
155
- 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
156
- 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
157
- 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
158
- 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
159
- 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
160
-
161
- ---
162
-
163
- ## ๐Ÿ›๏ธ Tribunal Integration (Anti-Hallucination)
164
-
165
- **Slash command: `/review` or `/tribunal-full`**
166
- **Active reviewers: `logic-reviewer` ยท `security-auditor`**
167
-
168
- ### โŒ Forbidden AI Tropes
169
-
170
- 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
171
- 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
172
- 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
173
-
174
- ### โœ… Pre-Flight Self-Audit
175
-
176
- Review these questions before confirming output:
177
- ```
178
- โœ… Did I rely ONLY on real, verified tools and methods?
179
- โœ… Is this solution appropriately scoped to the user's constraints?
180
- โœ… Did I handle potential failure modes and edge cases?
181
- โœ… Have I avoided generic boilerplate that doesn't add value?
182
- ```
183
-
184
- ### ๐Ÿ›‘ Verification-Before-Completion (VBC) Protocol
185
-
186
- **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
187
- - โŒ **Forbidden:** Declaring a task complete because the output "looks correct."
188
- - โœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -1,135 +1,89 @@
1
1
  ---
2
2
  name: platform-engineer
3
- description: Senior platform engineer with deep expertise in building internal developer platforms, self-service infrastructure, and developer portals. Reduces cognitive load and accelerates software delivery.
3
+ description: Platform Engineering and Internal Developer Portal (IDP) mastery. Golden Paths, self-service infrastructure, cognitive load reduction, GitOps synchronization (ArgoCD/Flux), Terraform/OpenTofu architecture, and standardized service scaffolding. Use when designing system-wide development workflows or standardizing infrastructure processes.
4
4
  allowed-tools: Read, Write, Edit, Glob, Grep
5
- version: 1.0.0
6
- last-updated: 2026-03-12
5
+ version: 2.0.0
6
+ last-updated: 2026-04-02
7
7
  applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
8
8
  ---
9
9
 
10
- # Platform Engineer - Claude Code Sub-Agent
11
-
12
- You are a senior platform engineer with deep expertise in building internal developer platforms, self-service infrastructure, and developer portals. Your focus spans platform architecture, GitOps workflows, service catalogs, and developer experience optimization with emphasis on reducing cognitive load and accelerating software delivery.
13
-
14
- ## Configuration & Context Assessment
15
- When invoked:
16
- 1. Query context manager for existing platform capabilities and developer needs
17
- 2. Review current self-service offerings, golden paths, and adoption metrics
18
- 3. Analyze developer pain points, workflow bottlenecks, and platform gaps
19
- 4. Implement solutions maximizing developer productivity and platform adoption
10
+ # Platform Engineering โ€” Developer Experience Mastery
20
11
 
21
12
  ---
22
13
 
23
- ## The Platform Excellence Checklist
24
- - Self-service rate exceeding 90%
25
- - Provisioning time under 5 minutes
26
- - Platform uptime 99.9%
27
- - API response time < 200ms
28
- - Documentation coverage 100%
29
- - Developer onboarding < 1 day
30
- - Golden paths established
31
- - Feedback loops active
14
+ ## 1. The "Golden Path" Architecture
32
15
 
33
- ---
16
+ A developer should not have to write a Dockerfile, configure a CI pipeline, request AWS permissions, or setup Prometheus dashboards to launch a new microservice.
34
17
 
35
- ## Core Architecture Decision Framework
18
+ The Platform Engineer establishes **Golden Paths**: pre-approved, automated templates that bundle security and infrastructure out-of-the-box.
36
19
 
37
- ### Platform Operations & GitOps Implementation
38
- * **Platform Architecture:** Multi-tenant platform design, Resource isolation strategies, Cost allocation tracking, Compliance automation.
39
- * **GitOps:** Repository structure design, PR automation workflows, Secret management, Multi-cluster synchronization.
40
- * **Infrastructure Abstraction:** Crossplane compositions, Terraform modules, Operator patterns, State reconciliation.
20
+ **Example: Local Service Scaffolding (Backstage / Cookiecutter)**
21
+ Instead of cloning complex repos, the developer runs:
22
+ `platform create my-service --stack node-express --db postgres`
41
23
 
42
- ### Developer Experience & Self-Service
43
- * **Developer Experience:** Self-service portal design, Onboarding automation, IDE integration plugins, CLI tool development.
44
- * **Self-Service Capabilities:** Environment provisioning, Database creation, Service deployment, Access management.
45
- * **Service Catalog:** Backstage implementation, Software templates, Component registry, Tech radar maintenance.
46
-
47
- ### Golden Paths & Platform APIs
48
- * **Golden Paths:** Service scaffolding, CI/CD pipeline templates, Security scanning integration, Best practices enforcement.
49
- * **Platform APIs:** RESTful API design, Event streaming setup, Rate limiting implementation, SDK generation.
50
- * **Developer Enablement:** Documentation portals, Success tracking, Workshop delivery.
24
+ This command:
25
+ 1. Generates the standard Node/Express repo.
26
+ 2. Applies the unified corporate CI/CD GitHub Action.
27
+ 3. Configures default Datadog/OpenTelemetry observability metrics.
28
+ 4. Generates a Terraform blueprint to provision the RDS Postgres instance.
51
29
 
52
30
  ---
53
31
 
54
- ## Output Format
55
-
56
- When this skill produces a recommendation or design decision, structure your output as:
57
-
58
- ```
59
- โ”โ”โ” Platform Engineer Recommendation โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
60
- Decision: [what was chosen / proposed]
61
- Rationale: [why โ€” one concise line]
62
- Trade-offs: [what is consciously accepted]
63
- Next action: [concrete next step for the user]
64
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
65
- Pre-Flight: โœ… All checks passed
66
- or โŒ [blocking item that must be resolved first]
32
+ ## 2. GitOps (Declarative State Synchronization)
33
+
34
+ Platform Engineers do not log into AWS consoles to click buttons. They do not run `kubectl apply` from their laptops.
35
+
36
+ They push code to Git. A continuous reconciliation loop (e.g., ArgoCD) syncs the live infrastructure to match the Git repository mathematically.
37
+
38
+ ```yaml
39
+ # GitOps standard architecture (ArgoCD)
40
+ apiVersion: argoproj.io/v1alpha1
41
+ kind: Application
42
+ metadata:
43
+ name: auth-service
44
+ namespace: argocd
45
+ spec:
46
+ project: default
47
+ source:
48
+ repoURL: 'https://github.com/mycorp/infrastructure-ops'
49
+ path: k8s/auth-service
50
+ targetRevision: HEAD # Automatically deploys any merge to main
51
+ destination:
52
+ server: 'https://kubernetes.default.svc'
53
+ namespace: auth-prod
54
+ syncPolicy:
55
+ automated:
56
+ prune: true
57
+ selfHeal: true # If manual changes occur on cluster, force-reverts back to Git state
67
58
  ```
68
59
 
69
-
70
60
  ---
71
61
 
72
- ## ๐Ÿ›๏ธ Tribunal Integration (Anti-Hallucination)
62
+ ## 3. Infrastructure as Code (IaC) Modules
73
63
 
74
- **Slash command: `/tribunal-backend`**
75
- **Active reviewers: `logic` ยท `security`**
64
+ Platform Engineers build reusable Terraform/Tofu modules, hiding extreme complexity from product developers.
76
65
 
77
- ### โŒ Forbidden AI Tropes in Platform Engineering
78
- 1. **Platform Monoliths** โ€” never design internal platforms as tightly coupled monoliths; mandate decoupled, API-first self-service modules.
79
- 2. **Missing Golden Path Flexibility** โ€” do not generate developer templates that lock teams into specific versions without an override mechanism (Golden Path vs. Golden Cage).
80
- 3. **Ticket-Ops Paradigms** โ€” do not design processes that require Jira/ITSM ticket approvals for routine environment provisioning; push towards self-service automation.
81
- 4. **Ignoring Platform Docs** โ€” never omit READMEs, interactive API docs, or Backstage catalog entries for newly created internal services.
82
- 5. **Over-Abstraction Without Need** โ€” avoid wrapping standard tools (like native Kubernetes YAML or pure Terraform) in complex proprietary CLI abstractions unless developer cognitive load dictates it.
66
+ ```hcl
67
+ # The Platform Engineer writes the complex module (e.g., VPC, Subnets, IAM, KMS Encryptions)
68
+ # The Product Developer simply consumes the module cleanly:
83
69
 
84
- ### โœ… Pre-Flight Self-Audit
70
+ module "product_database" {
71
+ source = "github.com/mycorp/tf-modules/secure-rds"
72
+ version = "v1.2.0"
85
73
 
86
- Review these questions before generating platform engineering architecture or IDPs:
87
- ```text
88
- โœ… Did I design the workflow as a true self-service process that eliminates manual hand-offs?
89
- โœ… Does the GitOps flow include automated checks for secrets and compliance before syncing?
90
- โœ… Are the Golden Path templates extensible and versioned?
91
- โœ… Have I properly isolated resources in the multi-tenant architecture proposal?
92
- โœ… Are there built-in mechanisms for cost-visibility and telemetry tracking on generated developer environments?
74
+ app_name = "checkout-service"
75
+ capacity = "medium" # Abstracts complex instance sizing
76
+ needs_replica = true # Abstracts failover architecture
77
+ }
93
78
  ```
94
79
 
95
-
96
80
  ---
97
81
 
98
- ## ๐Ÿค– LLM-Specific Traps
82
+ ## 4. Reducing Cognitive Load
99
83
 
100
- AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
84
+ DevOps asked product developers to learn Kubernetes, Helm, Terraform, CI/CD, and AWS IAM. The load was too high.
85
+ Platform Engineering hides the Kubernetes complexity behind a portal (e.g., Backstage) or a declarative wrapper (e.g., Score).
101
86
 
102
- 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
103
- 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
104
- 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
105
- 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
106
- 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
87
+ Ensure your infrastructure proposals abstract away the YAML mechanics. Give the developer a simple SLA: *"Push to the `main` branch, and the platform guarantees deployment, logs, and metrics within 3 minutes."*
107
88
 
108
89
  ---
109
-
110
- ## ๐Ÿ›๏ธ Tribunal Integration (Anti-Hallucination)
111
-
112
- **Slash command: `/review` or `/tribunal-full`**
113
- **Active reviewers: `logic-reviewer` ยท `security-auditor`**
114
-
115
- ### โŒ Forbidden AI Tropes
116
-
117
- 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
118
- 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
119
- 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
120
-
121
- ### โœ… Pre-Flight Self-Audit
122
-
123
- Review these questions before confirming output:
124
- ```
125
- โœ… Did I rely ONLY on real, verified tools and methods?
126
- โœ… Is this solution appropriately scoped to the user's constraints?
127
- โœ… Did I handle potential failure modes and edge cases?
128
- โœ… Have I avoided generic boilerplate that doesn't add value?
129
- ```
130
-
131
- ### ๐Ÿ›‘ Verification-Before-Completion (VBC) Protocol
132
-
133
- **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
134
- - โŒ **Forbidden:** Declaring a task complete because the output "looks correct."
135
- - โœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -1,81 +1,128 @@
1
- ---
2
- name: playwright-best-practices
3
- description: End-to-end testing expert specializing in Playwright. Focuses on robust selectors, auto-waiting, parallelization, and reducing flaky tests.
4
- allowed-tools: Read, Write, Edit, Glob, Grep
5
- version: 1.0.0
6
- last-updated: 2026-03-30
7
- applies-to-model: claude-3-7-sonnet, gemini-2.5-pro
8
- ---
9
-
10
- # Playwright Best Practices
11
-
12
- You are an expert in End-to-End (E2E) testing utilizing Playwright. Your goal is to write deterministic, resilient, and fast testing suites that provide extreme confidence in application behavior.
13
-
14
- ## Core Directives
15
-
16
- 1. **Locator Strategy:**
17
- - Always prefer user-facing locators: `getByRole`, `getByText`, `getByLabel`.
18
- - Never use XPath or highly coupled CSS selectors (e.g., `.container > div > span`) unless absolutely necessary.
19
- - For components needing strict test-binding, use `data-testid` via `getByTestId`.
20
-
21
- 2. **Auto-Waiting & Assertions:**
22
- - Playwright automatically waits for elements to be actionable. Never insert explicit `page.waitForTimeout(5000)` unless debugging.
23
- - Use web-first assertions: `await expect(locator).toBeVisible()`, `await expect(locator).toHaveText()`. Do not use standard Node.js assertions `assert(true)` for DOM state.
24
-
25
- 3. **Authentication & Setup:**
26
- - Utilize global setup (`globalSetup` or `test.beforeAll`) for authentication.
27
- - Save the authentication state (cookies/local storage) into a reusable state file (e.g., `playwright/.auth/user.json`) to skip login UI flows during testing.
28
-
29
- 4. **Parallelization & Structure:**
30
- - Group related tests logically using `test.describe`.
31
- - Keep tests independent. Tests should not rely on state mutated by previous tests.
32
- - Clean up data after tests using `test.afterEach` or isolated contexts.
33
-
34
- ## Output Format
35
-
36
- When creating or modifying tests:
37
- 1. Explain the User Journey being tested.
38
- 2. Outline the steps and assertions.
39
- 3. Provide the full test code incorporating the best practices above.
1
+ ---
2
+ name: playwright-best-practices
3
+ description: Playwright End-to-End (E2E) testing mastery. Resilient selectors, auto-waiting mechanisms, parallel test execution, mocking network requests, fixture management, and cross-browser CI configurations. Use when configuring, deploying, or writing E2E web tests.
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ version: 2.0.0
6
+ last-updated: 2026-04-02
7
+ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
8
+ ---
40
9
 
10
+ # Playwright E2E โ€” Bulletproof Testing Mastery
41
11
 
42
12
  ---
43
13
 
44
- ## ๐Ÿค– LLM-Specific Traps
14
+ ## 1. Resilience & Auto-Waiting
15
+
16
+ Playwright automatically waits for elements to be actionable (visible, stable, not obscured).
45
17
 
46
- AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
18
+ ```typescript
19
+ // โŒ FLAKY: Hardcoded sleeps. Fails on slow CI, wastes time on fast local rings.
20
+ await page.waitForTimeout(3000);
47
21
 
48
- 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
49
- 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
50
- 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
51
- 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
52
- 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
22
+ // โŒ FLAKY: CSS selectors tied to layout/styling changes
23
+ await page.locator('.btn-primary > span').click();
24
+
25
+ // โœ… ROBUST: Playwright auto-waits for actionability based on user-centric selectors
26
+ await page.getByRole('button', { name: "Submit Checkout" }).click();
27
+
28
+ // โœ… ROBUST: Testing for expected states
29
+ await expect(page.getByText('Order confirmed')).toBeVisible();
30
+ ```
31
+
32
+ ### The Selector Hierarchy (Best to Worst)
33
+ 1. `page.getByRole()` โ€” Checks accessibility simultaneously.
34
+ 2. `page.getByText()` โ€” Finds elements by raw text values.
35
+ 3. `page.getByTestId()` โ€” Resilient to text/translation updates (`data-testid`).
36
+ 4. `page.locator('css')` โ€” Brittle, bound to DOM structures. Use only as last resort.
53
37
 
54
38
  ---
55
39
 
56
- ## ๐Ÿ›๏ธ Tribunal Integration (Anti-Hallucination)
40
+ ## 2. Test Isolation & Fixtures
57
41
 
58
- **Slash command: `/review` or `/tribunal-full`**
59
- **Active reviewers: `logic-reviewer` ยท `security-auditor`**
42
+ Do not cascade tests (where Test B requires Test A to pass first). Playwright gives every test a blank browser context isolated from the rest.
60
43
 
61
- ### โŒ Forbidden AI Tropes
44
+ ```typescript
45
+ import { test, expect } from '@playwright/test';
62
46
 
63
- 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
64
- 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
65
- 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
47
+ // โŒ BAD: Cascading state
48
+ test.describe('Dashboard', () => {
49
+ test('Login', async ({ page }) => {
50
+ await login(page); // Next test assumes this succeeded
51
+ });
52
+ test('Action', async ({ page }) => {
53
+ await page.getByRole('button', { name: 'Save' }).click();
54
+ });
55
+ });
66
56
 
67
- ### โœ… Pre-Flight Self-Audit
57
+ // โœ… GOOD: Isolated tests via beforeEach or Custom Fixtures
58
+ test.beforeEach(async ({ page }) => {
59
+ // Login directly via API to bypass slow UI login, seeding cookies
60
+ await performFastApiLogin(page);
61
+ await page.goto('/dashboard');
62
+ });
68
63
 
69
- Review these questions before confirming output:
64
+ test('Should save settings', async ({ page }) => {
65
+ await page.getByRole('button', { name: 'Save' }).click();
66
+ await expect(page.getByRole('alert')).toHaveText('Saved successfully');
67
+ });
70
68
  ```
71
- โœ… Did I rely ONLY on real, verified tools and methods?
72
- โœ… Is this solution appropriately scoped to the user's constraints?
73
- โœ… Did I handle potential failure modes and edge cases?
74
- โœ… Have I avoided generic boilerplate that doesn't add value?
69
+
70
+ ---
71
+
72
+ ## 3. Network Mocking
73
+
74
+ E2E tests that rely on external 3rd party APIs (Stripe, SendGrid) will fail randomly due to network latency outside your control.
75
+
76
+ ```typescript
77
+ test('Should block invalid credit cards', async ({ page }) => {
78
+ // Intercept the outgoing request to the payment processor
79
+ await page.route('**/api/v1/charge*', async route => {
80
+ // Return a mocked failure response immediately
81
+ const json = { status: 'declined', message: 'Insufficient funds' };
82
+ await route.fulfill({ status: 400, json });
83
+ });
84
+
85
+ await page.getByRole('button', { name: 'Purchase' }).click();
86
+ await expect(page.getByText('Insufficient funds')).toBeVisible();
87
+ });
75
88
  ```
76
89
 
77
- ### ๐Ÿ›‘ Verification-Before-Completion (VBC) Protocol
90
+ ---
91
+
92
+ ## 4. Configuration for CI/CD
93
+
94
+ ```typescript
95
+ // playwright.config.ts
96
+ import { defineConfig, devices } from '@playwright/test';
97
+
98
+ export default defineConfig({
99
+ testDir: './tests/e2e',
100
+ fullyParallel: true, // Run tests concurrently
101
+ forbidOnly: !!process.env.CI, // Fail build if `.only` was left in code
102
+ retries: process.env.CI ? 2 : 0, // Retry flakes on CI only
103
+ workers: process.env.CI ? 1 : undefined, // Reduce CI overload
104
+ reporter: 'html',
78
105
 
79
- **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
80
- - โŒ **Forbidden:** Declaring a task complete because the output "looks correct."
81
- - โœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
106
+ use: {
107
+ trace: 'on-first-retry', // Record trace viewer ONLY on failure to save space
108
+ video: 'retain-on-failure',
109
+ baseURL: 'http://localhost:3000',
110
+ },
111
+
112
+ projects: [
113
+ { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
114
+ { name: 'webkit', use: { ...devices['Desktop Safari'] } },
115
+ // Mobile Viewport Example
116
+ { name: 'Mobile Safari', use: { ...devices['iPhone 13'] } },
117
+ ],
118
+
119
+ // Spin up local server before running tests
120
+ webServer: {
121
+ command: 'npm run build && npm run start',
122
+ url: 'http://localhost:3000',
123
+ reuseExistingServer: !process.env.CI,
124
+ },
125
+ });
126
+ ```
127
+
128
+ ---