cc-codeconductor 0.2.9 → 0.3.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 (143) hide show
  1. package/README.md +105 -25
  2. package/dist/index.js +662 -291
  3. package/package.json +1 -1
  4. package/presets/agy/AGENTS.md +365 -0
  5. package/presets/agy/README.md +47 -0
  6. package/presets/agy/hooks.json +30 -0
  7. package/presets/agy/mcp_config.json +3 -0
  8. package/presets/agy/rules/commit-style.md +1 -0
  9. package/presets/agy/rules/graphify.md +14 -0
  10. package/presets/agy/scripts/post-tool.sh +25 -0
  11. package/presets/agy/scripts/pre-tool.sh +56 -0
  12. package/presets/agy/settings.json +8 -0
  13. package/presets/agy/skills/cc-api-contract/SKILL.md +71 -0
  14. package/presets/agy/skills/cc-db-migration/SKILL.md +70 -0
  15. package/presets/agy/skills/cc-feature/SKILL.md +115 -0
  16. package/presets/agy/skills/cc-fix/SKILL.md +124 -0
  17. package/presets/agy/skills/cc-pagespeed/SKILL.md +101 -0
  18. package/presets/agy/skills/cc-refactor/SKILL.md +149 -0
  19. package/presets/agy/skills/cc-review/SKILL.md +142 -0
  20. package/presets/agy/skills/cc-tdd-cycle/SKILL.md +226 -0
  21. package/presets/agy/skills/cc-test-plan/SKILL.md +145 -0
  22. package/presets/agy/skills/commit/SKILL.md +5 -0
  23. package/presets/agy/workflows/cc-api-contract.md +71 -0
  24. package/presets/agy/workflows/cc-db-migration.md +70 -0
  25. package/presets/agy/workflows/cc-feature.md +115 -0
  26. package/presets/agy/workflows/cc-fix.md +124 -0
  27. package/presets/agy/workflows/cc-pagespeed.md +101 -0
  28. package/presets/agy/workflows/cc-refactor.md +149 -0
  29. package/presets/agy/workflows/cc-review.md +142 -0
  30. package/presets/agy/workflows/cc-tdd-cycle.md +226 -0
  31. package/presets/agy/workflows/cc-test-plan.md +145 -0
  32. package/presets/agy/workflows/commit.md +1 -0
  33. package/presets/claude/CLAUDE.md +47 -3
  34. package/presets/claude/claude.json +6 -0
  35. package/presets/claude/commands/cc/pagespeed.md +103 -0
  36. package/presets/claude/settings.json +249 -2
  37. package/presets/claude/skills/android/SKILL.md +119 -0
  38. package/presets/claude/skills/conductor-setup/SKILL.md +125 -0
  39. package/presets/claude/skills/find-skills/SKILL.md +142 -0
  40. package/presets/claude/skills/laravel-specialist/SKILL.md +264 -0
  41. package/presets/claude/skills/laravel-specialist/references/eloquent.md +351 -0
  42. package/presets/claude/skills/laravel-specialist/references/livewire.md +512 -0
  43. package/presets/claude/skills/laravel-specialist/references/queues.md +423 -0
  44. package/presets/claude/skills/laravel-specialist/references/routing.md +362 -0
  45. package/presets/claude/skills/laravel-specialist/references/testing.md +522 -0
  46. package/presets/claude/skills/multi-agent-orchestration/README.md +144 -0
  47. package/presets/claude/skills/multi-agent-orchestration/SKILL.md +579 -0
  48. package/presets/claude/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  49. package/presets/claude/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  50. package/presets/claude/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  51. package/presets/claude/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  52. package/presets/claude/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  53. package/presets/claude/skills/pagespeed-insights/SKILL.md +443 -0
  54. package/presets/claude/skills/pagespeed-insights/reference.md +50 -0
  55. package/presets/claude/skills/pagespeed-perf/SKILL.md +279 -0
  56. package/presets/claude/skills/php-pro/SKILL.md +208 -0
  57. package/presets/claude/skills/php-pro/references/async-patterns.md +412 -0
  58. package/presets/claude/skills/php-pro/references/laravel-patterns.md +377 -0
  59. package/presets/claude/skills/php-pro/references/modern-php-features.md +323 -0
  60. package/presets/claude/skills/php-pro/references/symfony-patterns.md +466 -0
  61. package/presets/claude/skills/php-pro/references/testing-quality.md +466 -0
  62. package/presets/claude/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  63. package/presets/claude/skills/workflow-orchestration-patterns/references/details.md +223 -0
  64. package/presets/codex/AGENTS.md +38 -14
  65. package/presets/codex/skills/android/SKILL.md +119 -0
  66. package/presets/codex/skills/conductor-setup/SKILL.md +125 -0
  67. package/presets/codex/skills/find-skills/SKILL.md +142 -0
  68. package/presets/codex/skills/laravel-specialist/SKILL.md +264 -0
  69. package/presets/codex/skills/laravel-specialist/references/eloquent.md +351 -0
  70. package/presets/codex/skills/laravel-specialist/references/livewire.md +512 -0
  71. package/presets/codex/skills/laravel-specialist/references/queues.md +423 -0
  72. package/presets/codex/skills/laravel-specialist/references/routing.md +362 -0
  73. package/presets/codex/skills/laravel-specialist/references/testing.md +522 -0
  74. package/presets/codex/skills/multi-agent-orchestration/README.md +144 -0
  75. package/presets/codex/skills/multi-agent-orchestration/SKILL.md +579 -0
  76. package/presets/codex/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  77. package/presets/codex/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  78. package/presets/codex/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  79. package/presets/codex/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  80. package/presets/codex/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  81. package/presets/codex/skills/pagespeed-insights/SKILL.md +443 -0
  82. package/presets/codex/skills/pagespeed-insights/reference.md +50 -0
  83. package/presets/codex/skills/pagespeed-perf/SKILL.md +279 -0
  84. package/presets/codex/skills/php-pro/SKILL.md +208 -0
  85. package/presets/codex/skills/php-pro/references/async-patterns.md +412 -0
  86. package/presets/codex/skills/php-pro/references/laravel-patterns.md +377 -0
  87. package/presets/codex/skills/php-pro/references/modern-php-features.md +323 -0
  88. package/presets/codex/skills/php-pro/references/symfony-patterns.md +466 -0
  89. package/presets/codex/skills/php-pro/references/testing-quality.md +466 -0
  90. package/presets/codex/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  91. package/presets/codex/skills/workflow-orchestration-patterns/references/details.md +223 -0
  92. package/presets/opencode/README.md +11 -10
  93. package/presets/opencode/agents/orchestrator.md +121 -1
  94. package/presets/opencode/agents/reviewer.md +31 -0
  95. package/presets/opencode/commands/cc-pagespeed.md +100 -0
  96. package/presets/opencode/prompts/v0.3.0/architect.md +221 -0
  97. package/presets/opencode/prompts/v0.3.0/docs.md +189 -0
  98. package/presets/opencode/prompts/v0.3.0/implementer.md +162 -0
  99. package/presets/opencode/prompts/v0.3.0/orchestrator.md +360 -0
  100. package/presets/opencode/prompts/v0.3.0/repo-explorer.md +110 -0
  101. package/presets/opencode/prompts/v0.3.0/reviewer.md +225 -0
  102. package/presets/opencode/prompts/v0.3.0/task-coach.md +155 -0
  103. package/presets/opencode/prompts/v0.3.0/tester.md +251 -0
  104. package/presets/opencode/skills/android/SKILL.md +119 -0
  105. package/presets/opencode/skills/conductor-setup/SKILL.md +125 -0
  106. package/presets/opencode/skills/find-skills/SKILL.md +142 -0
  107. package/presets/opencode/skills/laravel-specialist/SKILL.md +264 -0
  108. package/presets/opencode/skills/laravel-specialist/references/eloquent.md +351 -0
  109. package/presets/opencode/skills/laravel-specialist/references/livewire.md +512 -0
  110. package/presets/opencode/skills/laravel-specialist/references/queues.md +423 -0
  111. package/presets/opencode/skills/laravel-specialist/references/routing.md +362 -0
  112. package/presets/opencode/skills/laravel-specialist/references/testing.md +522 -0
  113. package/presets/opencode/skills/multi-agent-orchestration/README.md +144 -0
  114. package/presets/opencode/skills/multi-agent-orchestration/SKILL.md +579 -0
  115. package/presets/opencode/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  116. package/presets/opencode/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  117. package/presets/opencode/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  118. package/presets/opencode/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  119. package/presets/opencode/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  120. package/presets/opencode/skills/pagespeed-insights/SKILL.md +443 -0
  121. package/presets/opencode/skills/pagespeed-insights/reference.md +50 -0
  122. package/presets/opencode/skills/pagespeed-perf/SKILL.md +279 -0
  123. package/presets/opencode/skills/php-pro/SKILL.md +208 -0
  124. package/presets/opencode/skills/php-pro/references/async-patterns.md +412 -0
  125. package/presets/opencode/skills/php-pro/references/laravel-patterns.md +377 -0
  126. package/presets/opencode/skills/php-pro/references/modern-php-features.md +323 -0
  127. package/presets/opencode/skills/php-pro/references/symfony-patterns.md +466 -0
  128. package/presets/opencode/skills/php-pro/references/testing-quality.md +466 -0
  129. package/presets/opencode/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  130. package/presets/opencode/skills/workflow-orchestration-patterns/references/details.md +223 -0
  131. package/presets/seo-hotel/commands/cc-seo-audit.md +17 -9
  132. package/presets/seo-hotel/settings.json +225 -0
  133. package/presets/seo-hotel/skills/find-skills/SKILL.md +142 -0
  134. package/presets/seo-hotel/skills/pagespeed-insights/SKILL.md +443 -0
  135. package/presets/seo-hotel/skills/pagespeed-insights/reference.md +50 -0
  136. package/src/presets/manifests/agy.yml +38 -3
  137. package/src/presets/manifests/claude.yml +8 -2
  138. package/src/presets/manifests/codex.yml +3 -2
  139. package/src/presets/manifests/cursor.yml +3 -2
  140. package/src/presets/manifests/gemini.yml +3 -2
  141. package/src/presets/manifests/opencode.yml +7 -2
  142. package/src/presets/models/agy.yml +16 -0
  143. package/src/presets/models/opencode.yml +6 -6
@@ -0,0 +1,223 @@
1
+ # workflow-orchestration-patterns — detailed patterns and worked examples
2
+
3
+ ## Critical Design Decision: Workflows vs Activities
4
+
5
+ **The Fundamental Rule** (Source: temporal.io/blog/workflow-engine-principles):
6
+
7
+ - **Workflows** = Orchestration logic and decision-making
8
+ - **Activities** = External interactions (APIs, databases, network calls)
9
+
10
+ ### Workflows (Orchestration)
11
+
12
+ **Characteristics:**
13
+
14
+ - Contain business logic and coordination
15
+ - **MUST be deterministic** (same inputs → same outputs)
16
+ - **Cannot** perform direct external calls
17
+ - State automatically preserved across failures
18
+ - Can run for years despite infrastructure failures
19
+
20
+ **Example workflow tasks:**
21
+
22
+ - Decide which steps to execute
23
+ - Handle compensation logic
24
+ - Manage timeouts and retries
25
+ - Coordinate child workflows
26
+
27
+ ### Activities (External Interactions)
28
+
29
+ **Characteristics:**
30
+
31
+ - Handle all external system interactions
32
+ - Can be non-deterministic (API calls, DB writes)
33
+ - Include built-in timeouts and retry logic
34
+ - **Must be idempotent** (calling N times = calling once)
35
+ - Short-lived (seconds to minutes typically)
36
+
37
+ **Example activity tasks:**
38
+
39
+ - Call payment gateway API
40
+ - Write to database
41
+ - Send emails or notifications
42
+ - Query external services
43
+
44
+ ### Design Decision Framework
45
+
46
+ ```
47
+ Does it touch external systems? → Activity
48
+ Is it orchestration/decision logic? → Workflow
49
+ ```
50
+
51
+ ## Core Workflow Patterns
52
+
53
+ ### 1. Saga Pattern with Compensation
54
+
55
+ **Purpose**: Implement distributed transactions with rollback capability
56
+
57
+ **Pattern** (Source: temporal.io/blog/compensating-actions-part-of-a-complete-breakfast-with-sagas):
58
+
59
+ ```
60
+ For each step:
61
+ 1. Register compensation BEFORE executing
62
+ 2. Execute the step (via activity)
63
+ 3. On failure, run all compensations in reverse order (LIFO)
64
+ ```
65
+
66
+ **Example: Payment Workflow**
67
+
68
+ 1. Reserve inventory (compensation: release inventory)
69
+ 2. Charge payment (compensation: refund payment)
70
+ 3. Fulfill order (compensation: cancel fulfillment)
71
+
72
+ **Critical Requirements:**
73
+
74
+ - Compensations must be idempotent
75
+ - Register compensation BEFORE executing step
76
+ - Run compensations in reverse order
77
+ - Handle partial failures gracefully
78
+
79
+ ### 2. Entity Workflows (Actor Model)
80
+
81
+ **Purpose**: Long-lived workflow representing single entity instance
82
+
83
+ **Pattern** (Source: docs.temporal.io/evaluate/use-cases-design-patterns):
84
+
85
+ - One workflow execution = one entity (cart, account, inventory item)
86
+ - Workflow persists for entity lifetime
87
+ - Receives signals for state changes
88
+ - Supports queries for current state
89
+
90
+ **Example Use Cases:**
91
+
92
+ - Shopping cart (add items, checkout, expiration)
93
+ - Bank account (deposits, withdrawals, balance checks)
94
+ - Product inventory (stock updates, reservations)
95
+
96
+ **Benefits:**
97
+
98
+ - Encapsulates entity behavior
99
+ - Guarantees consistency per entity
100
+ - Natural event sourcing
101
+
102
+ ### 3. Fan-Out/Fan-In (Parallel Execution)
103
+
104
+ **Purpose**: Execute multiple tasks in parallel, aggregate results
105
+
106
+ **Pattern:**
107
+
108
+ - Spawn child workflows or parallel activities
109
+ - Wait for all to complete
110
+ - Aggregate results
111
+ - Handle partial failures
112
+
113
+ **Scaling Rule** (Source: temporal.io/blog/workflow-engine-principles):
114
+
115
+ - Don't scale individual workflows
116
+ - For 1M tasks: spawn 1K child workflows × 1K tasks each
117
+ - Keep each workflow bounded
118
+
119
+ ### 4. Async Callback Pattern
120
+
121
+ **Purpose**: Wait for external event or human approval
122
+
123
+ **Pattern:**
124
+
125
+ - Workflow sends request and waits for signal
126
+ - External system processes asynchronously
127
+ - Sends signal to resume workflow
128
+ - Workflow continues with response
129
+
130
+ **Use Cases:**
131
+
132
+ - Human approval workflows
133
+ - Webhook callbacks
134
+ - Long-running external processes
135
+
136
+ ## State Management and Determinism
137
+
138
+ ### Automatic State Preservation
139
+
140
+ **How Temporal Works** (Source: docs.temporal.io/workflows):
141
+
142
+ - Complete program state preserved automatically
143
+ - Event History records every command and event
144
+ - Seamless recovery from crashes
145
+ - Applications restore pre-failure state
146
+
147
+ ### Determinism Constraints
148
+
149
+ **Workflows Execute as State Machines**:
150
+
151
+ - Replay behavior must be consistent
152
+ - Same inputs → identical outputs every time
153
+
154
+ **Prohibited in Workflows** (Source: docs.temporal.io/workflows):
155
+
156
+ - ❌ Threading, locks, synchronization primitives
157
+ - ❌ Random number generation (`random()`)
158
+ - ❌ Global state or static variables
159
+ - ❌ System time (`datetime.now()`)
160
+ - ❌ Direct file I/O or network calls
161
+ - ❌ Non-deterministic libraries
162
+
163
+ **Allowed in Workflows**:
164
+
165
+ - ✅ `workflow.now()` (deterministic time)
166
+ - ✅ `workflow.random()` (deterministic random)
167
+ - ✅ Pure functions and calculations
168
+ - ✅ Calling activities (non-deterministic operations)
169
+
170
+ ### Versioning Strategies
171
+
172
+ **Challenge**: Changing workflow code while old executions still running
173
+
174
+ **Solutions**:
175
+
176
+ 1. **Versioning API**: Use `workflow.get_version()` for safe changes
177
+ 2. **New Workflow Type**: Create new workflow, route new executions to it
178
+ 3. **Backward Compatibility**: Ensure old events replay correctly
179
+
180
+ ## Resilience and Error Handling
181
+
182
+ ### Retry Policies
183
+
184
+ **Default Behavior**: Temporal retries activities forever
185
+
186
+ **Configure Retry**:
187
+
188
+ - Initial retry interval
189
+ - Backoff coefficient (exponential backoff)
190
+ - Maximum interval (cap retry delay)
191
+ - Maximum attempts (eventually fail)
192
+
193
+ **Non-Retryable Errors**:
194
+
195
+ - Invalid input (validation failures)
196
+ - Business rule violations
197
+ - Permanent failures (resource not found)
198
+
199
+ ### Idempotency Requirements
200
+
201
+ **Why Critical** (Source: docs.temporal.io/activities):
202
+
203
+ - Activities may execute multiple times
204
+ - Network failures trigger retries
205
+ - Duplicate execution must be safe
206
+
207
+ **Implementation Strategies**:
208
+
209
+ - Idempotency keys (deduplication)
210
+ - Check-then-act with unique constraints
211
+ - Upsert operations instead of insert
212
+ - Track processed request IDs
213
+
214
+ ### Activity Heartbeats
215
+
216
+ **Purpose**: Detect stalled long-running activities
217
+
218
+ **Pattern**:
219
+
220
+ - Activity sends periodic heartbeat
221
+ - Includes progress information
222
+ - Timeout if no heartbeat received
223
+ - Enables progress-based retry
@@ -46,16 +46,16 @@ providers)** models.
46
46
 
47
47
  ## Agent Modes
48
48
 
49
- | Agent | Mode | Description |
50
- | ----------------- | --------- | ---------------------------------------------------- |
51
- | **Orchestrator** | primary | Main coordinator — Tab to switch to it |
52
- | **Architect** | subagent | Invoked by Orchestrator for design work |
53
- | **Implementer** | subagent | Invoked by Orchestrator for code implementation |
54
- | **Tester** | subagent | Invoked by Orchestrator for test generation |
55
- | **Reviewer** | subagent | Invoked by Orchestrator for code review |
56
- | **Task Coach** | subagent | Invoked by Orchestrator for intake clarification |
57
- | **Docs** | subagent | Invoked by Orchestrator for documentation updates |
58
- | **Repo Explorer** | subagent | Invoked by Orchestrator for codebase exploration |
49
+ | Agent | Mode | Description |
50
+ | ----------------- | -------- | ------------------------------------------------- |
51
+ | **Orchestrator** | primary | Main coordinator — Tab to switch to it |
52
+ | **Architect** | subagent | Invoked by Orchestrator for design work |
53
+ | **Implementer** | subagent | Invoked by Orchestrator for code implementation |
54
+ | **Tester** | subagent | Invoked by Orchestrator for test generation |
55
+ | **Reviewer** | subagent | Invoked by Orchestrator for code review |
56
+ | **Task Coach** | subagent | Invoked by Orchestrator for intake clarification |
57
+ | **Docs** | subagent | Invoked by Orchestrator for documentation updates |
58
+ | **Repo Explorer** | subagent | Invoked by Orchestrator for codebase exploration |
59
59
 
60
60
  ---
61
61
 
@@ -183,6 +183,7 @@ export KIMI_API_KEY="your-key"
183
183
  - Keep solutions simple and direct.
184
184
  - User instructions always override this file.
185
185
  - When using tools, be precise and minimal with context.
186
+ {{LANGUAGE_INSTRUCTIONS}}
186
187
 
187
188
  ## Context Budget
188
189
 
@@ -142,6 +142,102 @@ signals in order of priority:
142
142
  | `[tool.pytest.ini_options]` in `pyproject.toml` | pytest configured |
143
143
  | `django-tenants` in deps | Multi-tenant Django |
144
144
  | `build.gradle.kts` + `org.springframework.boot` | Spring Boot + Kotlin |
145
+ | `next.config.js` / `next.config.mjs` / `next.config.ts` | Next.js |
146
+ | `requirements.txt` / `pyproject.toml` with `fastapi` | FastAPI |
147
+ | `pnpm-workspace.yaml` / `go.work` | Monorepo Workspace |
148
+ | `go.mod` / `Cargo.toml` without django/fastapi | Generic Backend |
149
+ | `index.html` / react/vue dependencies | Generic Frontend |
150
+ | `AndroidManifest.xml` present | Android |
151
+ | `artisan` present | Laravel |
152
+ | `composer.json` or `*.php` present | PHP |
153
+
154
+ ### Next.js
155
+
156
+ When a Next.js project is detected, include the following skill invocation
157
+ instruction in the delegation message for each agent:
158
+
159
+ | Delegated agent | Instruction to include in delegation |
160
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------ |
161
+ | `architect` | "Invoke the `nextjs-typescript` skill before designing." |
162
+ | `implementer` | "Invoke `nextjs-typescript` before writing any code." |
163
+ | `tester` | "Invoke `testing-tdd` and write Next.js unit and integration tests (using Vitest or Playwright)." |
164
+ | `reviewer` | "Invoke the `nextjs-typescript` skill to check component boundaries (RSC vs RCC) and validation rules." |
165
+
166
+ ### FastAPI
167
+
168
+ When a FastAPI project is detected, include the following skill invocation
169
+ instruction in the delegation message for each agent:
170
+
171
+ | Delegated agent | Instruction to include in delegation |
172
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------ |
173
+ | `architect` | "Invoke the `python-fastapi-stack` and `sqlalchemy` skills before designing." |
174
+ | `implementer` | "Invoke `python-fastapi-stack` and `sqlalchemy` before writing any code." |
175
+ | `tester` | "Invoke Python testing guidelines to write FastAPI endpoint contract tests." |
176
+ | `reviewer` | "Invoke `python` to verify FastAPI routers and SQLAlchemy async patterns." |
177
+
178
+ ### Generic Backend
179
+
180
+ When a generic backend project is detected, include the following skill invocation
181
+ instruction in the delegation message for each agent:
182
+
183
+ | Delegated agent | Instruction to include in delegation |
184
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------ |
185
+ | `architect` | "Invoke the `security` skill to review backend boundaries, authentication schemes, and data validation rules." |
186
+ | `implementer` | "Invoke `security` to ensure inputs are validated, parameterized queries are used, and secrets are not exposed." |
187
+ | `reviewer` | "Invoke `security` to check for injection vulnerabilities, resource leaks, and lack of authorization checks." |
188
+
189
+ ### Android
190
+
191
+ When an Android project is detected, include the following skill invocation instruction in the delegation message for each agent:
192
+
193
+ | Delegated agent | Instruction to include in delegation |
194
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------ |
195
+ | `architect` | "Invoke the `android` skill before designing." |
196
+ | `implementer` | "Invoke `android` before writing any code." |
197
+ | `tester` | "Invoke the `android` skill to write unit or instrumentation tests (JUnit 5, MockK, Espresso, Compose UI Testing)." |
198
+ | `reviewer` | "Invoke the `android` skill to verify Jetpack Compose components stability, ExoPlayer resource cleanup, and Kotlin Coroutines/Flows dispatchers." |
199
+
200
+ ### Laravel
201
+
202
+ When a Laravel project is detected, include the following skill invocation instruction in the delegation message for each agent:
203
+
204
+ | Delegated agent | Instruction to include in delegation |
205
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------ |
206
+ | `architect` | "Invoke the `laravel-specialist` and `php-pro` skills before designing." |
207
+ | `implementer` | "Invoke `laravel-specialist` and `php-pro` before writing any code." |
208
+ | `tester` | "Invoke the `laravel-specialist` skill to write Pest/PHPUnit tests for Laravel features." |
209
+ | `reviewer` | "Invoke the `laravel-specialist` skill to verify Eloquent queries, Sanctum authentication, and Livewire components." |
210
+
211
+ ### PHP
212
+
213
+ When a PHP project is detected, include the following skill invocation instruction in the delegation message for each agent:
214
+
215
+ | Delegated agent | Instruction to include in delegation |
216
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------ |
217
+ | `architect` | "Invoke the `php-pro` skill before designing." |
218
+ | `implementer` | "Invoke `php-pro` before writing any code." |
219
+ | `tester` | "Invoke PHP testing and quality assurance guidelines in the `php-pro` skill." |
220
+ | `reviewer` | "Invoke the `php-pro` skill to analyze strict typing, PHPStan level 9 violations, and PSR standards." |
221
+
222
+ ### Generic Frontend
223
+
224
+ When a generic frontend project is detected, include the following skill invocation
225
+ instruction in the delegation message for each agent:
226
+
227
+ | Delegated agent | Instruction to include in delegation |
228
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------ |
229
+ | `architect` | "Invoke the `security` skill and accessibility guidelines to plan keyboard navigation and semantic HTML structures." |
230
+ | `implementer` | "Invoke `modern-web-guidance` and accessibility rules to implement semantically clean and keyboard-accessible UI." |
231
+ | `tester` | "Invoke `a11y-debugging` to verify focus handling, tab order, and screen reader labels." |
232
+ | `reviewer` | "Verify compliance with frontend security standards and web accessibility guidelines." |
233
+
234
+ ### Monorepo Workspaces
235
+
236
+ When a monorepo workspace signal is present, include this instruction for ALL agents:
237
+
238
+ > "This is a monorepo. Focus all file reads, edits, and commands strictly within
239
+ > the sub-package or workspace directory specified in the Task Card scope. Avoid
240
+ > modifying files or running commands outside this package's directory."
145
241
 
146
242
  ### Python / Django / PostgreSQL
147
243
 
@@ -155,7 +251,7 @@ instruction in the delegation message for each agent:
155
251
  | `tester` | "Invoke `django-testing` before writing any test. The project uses multi-tenant PostgreSQL — do not use `TestCase` for tenant app models." |
156
252
  | `reviewer` | "Invoke `python` to check clean code conventions before reviewing." |
157
253
 
158
- **TDD gate for medium and high risk Python tasks:**
254
+ **TDD gate for medium and high risk Python/Backend tasks:**
159
255
 
160
256
  For tasks classified medium or high, modify the agent sequence to enforce
161
257
  test-first development:
@@ -176,6 +272,30 @@ Include this instruction in the `implementer` delegation:
176
272
 
177
273
  ---
178
274
 
275
+ ## Intense Workflow — Loop Agent Mode
276
+
277
+ For high-complexity tasks, or when verification tests fail, the orchestrator
278
+ routes the agents through an iterative feedback loop:
279
+
280
+ 1. **Cycle**: Implementer -> Tester -> Orchestrator validation.
281
+ 2. If the `tester` reports failing tests:
282
+ - Route back to `implementer` with the specific test failures.
283
+ - Instruct the implementer to make target adjustments to resolve the failures.
284
+ 3. This cycle repeats up to 3 times. If tests are still failing after the 3rd iteration, escalate to the human with a full diagnostics summary.
285
+
286
+ ---
287
+
288
+ ## Multi-Team / Teammate Delegation
289
+
290
+ When the preset target supports multi-team execution (e.g. Claude Code with
291
+ `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` enabled):
292
+ 1. Spawn parallel teammates (`tester`, `reviewer`, etc.) to run verification and checks concurrently when possible.
293
+ 2. Assign the most cost-efficient models for secondary roles:
294
+ - Primary Orchestrator / Architect: `sonnet` / `pro` (maximum context / reasoning).
295
+ - Task Coach, Docs, Repo Explorer, Reviewer: `haiku` / `flash` (fast, cost-effective).
296
+
297
+ ---
298
+
179
299
  ## Routing documentation
180
300
 
181
301
  Every routing decision must be documented in this format before the first agent
@@ -123,6 +123,37 @@ _(none)_ — if no suggestions
123
123
  - **approved with warnings** — no CRITICAL, at least one WARNING
124
124
  - **approved** — no CRITICAL, no WARNING (suggestions do not block)
125
125
 
126
+ ## Stricter Stack-Specific Checklist
127
+
128
+ Apply these detailed checks based on the detected stack:
129
+
130
+ ### Next.js
131
+ - [ ] RSC vs RCC boundary: Client directives (`"use client"`) are only placed on interactive leaf node files, not on static layouts/pages.
132
+ - [ ] Server Actions input: Every Server Action validates `FormData` or arguments using a schema library (like Zod) before performing mutations. No raw data is trusted.
133
+ - [ ] Browser APIs: Window, document, and localStorage access are guarded (e.g. `typeof window !== 'undefined'`) or only run inside `useEffect`.
134
+
135
+ ### FastAPI
136
+ - [ ] Request Typing: All endpoints use typed Pydantic models (v2) for request bodies and path/query parameters.
137
+ - [ ] Dependency Injection: Middleware, databases, and services are injected cleanly using FastAPI `Depends`.
138
+
139
+ ### Generic Backend
140
+ - [ ] No SQL Injection: Database queries use parameterized placeholders or proper ORM queries; string concatenation or template literals for SQL are block-worthy.
141
+ - [ ] Resource management: Connections, files, sockets, and sessions are closed explicitly or via context managers (e.g. `with` block).
142
+
143
+ ### Generic Frontend
144
+ - [ ] Keyboard accessibility: All interactive elements are focusable (using `button`, `a`, or explicit `tabindex="0"`) and react to both click and keydown (Enter/Space) events.
145
+ - [ ] ARIA & alt text: All images have descriptive `alt` attributes. Form fields have corresponding `<label>` or `aria-label` tags.
146
+ - [ ] Semantic HTML: Page structures use semantic landmarks (`<main>`, `<header>`, `<footer>`, `<nav>`, `<article>`, `<section>`).
147
+
148
+ ### Android
149
+ - [ ] Jetpack Compose Stability: Ensure all custom state model classes passed to Composables are immutable (annotated with `@Immutable` or `@Stable`) to prevent unnecessary recompositions.
150
+ - [ ] ExoPlayer / Media3 Resource Management: Verify that ExoPlayer or Media3 player instances are properly cleaned up and released (e.g. in `onDestroy` or when the service is stopped) to prevent resource/memory leaks.
151
+ - [ ] Coroutine Dispatchers: Ensure Coroutines are launched using injected dispatchers rather than hardcoding `Dispatchers.IO` or `Dispatchers.Default` directly in ViewModels or domain/data service classes.
152
+ - [ ] Battery & Wake Locks: Verify that Wake Locks are managed carefully and released when playback is paused or stopped to prevent draining the user's battery.
153
+
154
+ ### Monorepo Workspaces
155
+ - [ ] Workspace boundary: No relative imports escape a workspace package root to reference another package's files directly. Inter-package imports must resolve through configured workspace dependencies.
156
+
126
157
  ## What You Never Do
127
158
 
128
159
  - Edit any file — source, test, documentation, or configuration
@@ -0,0 +1,100 @@
1
+ ---
2
+ description: >-
3
+ Run the PageSpeed performance audit — 80/20 analysis of Core Web Vitals using
4
+ the PageSpeed Insights API.
5
+ ---
6
+
7
+ # PageSpeed Performance Audit
8
+
9
+ Audit URL: $ARGUMENTS
10
+
11
+ ---
12
+
13
+ ## Step 1 — Pre-flight (pagespeed-perf skill)
14
+
15
+ Invoke `pagespeed-perf` skill.
16
+
17
+ Read `PAGESPEED_API_KEY` from the environment. Compute the output filename:
18
+ `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md`.
19
+
20
+ Log whether the API key was found. Proceed regardless — lab data is available
21
+ without a key, but CrUX field data requires it.
22
+
23
+ ---
24
+
25
+ ## Step 2 — Collect
26
+
27
+ Call the PageSpeed Insights API for the URL provided above.
28
+
29
+ - Strategy: `both` (mobile + desktop) unless the user specified otherwise.
30
+ - If Bun is available, use `~/.claude/skills/pagespeed-perf/scripts/run.ts`.
31
+ - If Bun is unavailable, call PSI directly via WebFetch and fetch the HTML
32
+ source for manual resource-hint analysis.
33
+
34
+ ---
35
+
36
+ ## Step 3 — Analyze
37
+
38
+ Extract from the PSI response:
39
+
40
+ - Core Web Vitals: LCP, INP, CLS, FCP, TBT, TTFB
41
+ - LCP element (type, selector, HTML snippet)
42
+ - Third-party scripts ordered by blocking time
43
+ - Render-blocking resources
44
+ - Unused JavaScript and CSS (savings in bytes and ms)
45
+
46
+ From the HTML source:
47
+
48
+ - Resource hints (`<link rel="preload|preconnect|prefetch">`)
49
+ - Images: lazy loading, `fetchpriority`, format, dimensions
50
+ - Fonts: `font-display`, preloaded subsets
51
+ - Blocking scripts in `<head>` (no `async`/`defer`)
52
+
53
+ ---
54
+
55
+ ## Step 4 — Prioritize
56
+
57
+ Score each identified optimization using the 80/20 matrix:
58
+ `Score = Impact × Ease` (each 1–5, max 25).
59
+
60
+ Order findings by descending score. Mark optimizations with Score ≥ 20 as
61
+ **Critical 20%**.
62
+
63
+ ---
64
+
65
+ ## Step 5 — Report
66
+
67
+ Write the full performance report to
68
+ `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md` in the current directory.
69
+
70
+ Required sections:
71
+ 1. Resumen Ejecutivo (2–3 paragraphs)
72
+ 2. Métricas Actuales (lab vs field table)
73
+ 3. Recursos con Mayor Impacto
74
+ 4. Plan de Acción Priorizado (80/20 table)
75
+ 5. Solución Técnica Detallada (per finding: problem, evidence, code, expected gain)
76
+ 6. Quick Wins / High Impact Changes / Roadmap
77
+
78
+ End every report with:
79
+ ```
80
+ ---
81
+ *Informe generado el {YYYY-MM-DD} · Herramienta: Claude Code + pagespeed-perf skill*
82
+ *API Key usada: {Sí / No} · Datos CrUX: {Disponibles / No disponibles}*
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Requirements
88
+
89
+ **`PAGESPEED_API_KEY`** — Optional but strongly recommended.
90
+
91
+ - With key: real CrUX field data + 25,000 requests/day quota.
92
+ - Without key: lab data only (Lighthouse); shared rate limit applies.
93
+
94
+ Set in your shell:
95
+ ```powershell
96
+ $env:PAGESPEED_API_KEY = "your-api-key" # Windows PowerShell
97
+ export PAGESPEED_API_KEY="your-api-key" # macOS / Linux
98
+ ```
99
+
100
+ Get a free key: <https://developers.google.com/speed/docs/insights/v5/get-started>