cc-codeconductor 0.2.9 → 0.2.10

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 (90) hide show
  1. package/README.md +105 -25
  2. package/dist/index.js +165 -27
  3. package/package.json +1 -1
  4. package/presets/agy/AGENTS.md +354 -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 +13 -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/conductor-setup/SKILL.md +125 -0
  38. package/presets/claude/skills/find-skills/SKILL.md +142 -0
  39. package/presets/claude/skills/multi-agent-orchestration/README.md +144 -0
  40. package/presets/claude/skills/multi-agent-orchestration/SKILL.md +579 -0
  41. package/presets/claude/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  42. package/presets/claude/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  43. package/presets/claude/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  44. package/presets/claude/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  45. package/presets/claude/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  46. package/presets/claude/skills/pagespeed-insights/SKILL.md +443 -0
  47. package/presets/claude/skills/pagespeed-insights/reference.md +50 -0
  48. package/presets/claude/skills/pagespeed-perf/SKILL.md +279 -0
  49. package/presets/claude/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  50. package/presets/claude/skills/workflow-orchestration-patterns/references/details.md +223 -0
  51. package/presets/codex/AGENTS.md +19 -14
  52. package/presets/codex/skills/conductor-setup/SKILL.md +125 -0
  53. package/presets/codex/skills/find-skills/SKILL.md +142 -0
  54. package/presets/codex/skills/multi-agent-orchestration/README.md +144 -0
  55. package/presets/codex/skills/multi-agent-orchestration/SKILL.md +579 -0
  56. package/presets/codex/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  57. package/presets/codex/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  58. package/presets/codex/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  59. package/presets/codex/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  60. package/presets/codex/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  61. package/presets/codex/skills/pagespeed-insights/SKILL.md +443 -0
  62. package/presets/codex/skills/pagespeed-insights/reference.md +50 -0
  63. package/presets/codex/skills/pagespeed-perf/SKILL.md +279 -0
  64. package/presets/codex/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  65. package/presets/codex/skills/workflow-orchestration-patterns/references/details.md +223 -0
  66. package/presets/opencode/README.md +11 -10
  67. package/presets/opencode/commands/cc-pagespeed.md +100 -0
  68. package/presets/opencode/skills/conductor-setup/SKILL.md +125 -0
  69. package/presets/opencode/skills/find-skills/SKILL.md +142 -0
  70. package/presets/opencode/skills/multi-agent-orchestration/README.md +144 -0
  71. package/presets/opencode/skills/multi-agent-orchestration/SKILL.md +579 -0
  72. package/presets/opencode/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  73. package/presets/opencode/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  74. package/presets/opencode/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  75. package/presets/opencode/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  76. package/presets/opencode/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  77. package/presets/opencode/skills/pagespeed-insights/SKILL.md +443 -0
  78. package/presets/opencode/skills/pagespeed-insights/reference.md +50 -0
  79. package/presets/opencode/skills/pagespeed-perf/SKILL.md +279 -0
  80. package/presets/opencode/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  81. package/presets/opencode/skills/workflow-orchestration-patterns/references/details.md +223 -0
  82. package/presets/seo-hotel/commands/cc-seo-audit.md +17 -9
  83. package/presets/seo-hotel/settings.json +225 -0
  84. package/presets/seo-hotel/skills/find-skills/SKILL.md +142 -0
  85. package/presets/seo-hotel/skills/pagespeed-insights/SKILL.md +443 -0
  86. package/presets/seo-hotel/skills/pagespeed-insights/reference.md +50 -0
  87. package/src/presets/manifests/agy.yml +36 -2
  88. package/src/presets/manifests/claude.yml +5 -0
  89. package/src/presets/manifests/opencode.yml +4 -0
  90. package/src/presets/models/agy.yml +16 -0
@@ -0,0 +1,226 @@
1
+ ---
2
+ name: cc-tdd-cycle
3
+ description: >-
4
+ Run a structured Red-Green-Refactor TDD cycle — write a failing test first,
5
+ implement the minimum code to pass it, then refactor with the suite green.
6
+ ---
7
+
8
+ # TDD Cycle — Red → Green → Refactor
9
+
10
+ Scope: $ARGUMENTS
11
+
12
+ Describe what behavior you want to implement. Include:
13
+
14
+ - The function, method, or feature to implement
15
+ - The expected behavior (inputs and outputs, or acceptance criteria)
16
+ - Any known constraints or edge cases
17
+ - Relevant files or modules (if known)
18
+
19
+ ---
20
+
21
+ ## Before you begin — mandatory pre-check
22
+
23
+ This command enforces strict TDD discipline. The three phases are sequential and
24
+ non-negotiable:
25
+
26
+ 1. **RED** — a failing test exists before any implementation code is written
27
+ 2. **GREEN** — the minimum implementation to make the test pass (no more)
28
+ 3. **REFACTOR** — clean up the code while keeping all tests green
29
+
30
+ Do not write implementation code during RED. Do not refactor during GREEN.
31
+ Mixing phases invalidates the cycle.
32
+
33
+ ---
34
+
35
+ ## Phase 1 — RED (Tester role)
36
+
37
+ Adopt the **Tester** role as defined in `CLAUDE.md`.
38
+
39
+ ### 1a — Scope clarification
40
+
41
+ Before writing any test, confirm:
42
+
43
+ - What is the unit of behavior being tested? (function, method, endpoint, domain
44
+ rule)
45
+ - What are the inputs and expected outputs?
46
+ - What are the failure cases?
47
+
48
+ If the scope is ambiguous, ask one clarifying question and wait for the answer.
49
+
50
+ ### 1b — Write the failing test
51
+
52
+ Write a test that:
53
+
54
+ - Targets exactly the behavior described in the scope
55
+ - Fails for the right reason (not a compile error, not a missing dependency —
56
+ the logic does not exist yet)
57
+ - Has a name that describes the behavior: `given_X_when_Y_then_Z` or equivalent
58
+ in the project's test naming convention
59
+ - Covers at minimum: one happy path, one edge case, one failure case
60
+
61
+ Do not write the implementation. Do not make the test pass by any means other
62
+ than the implementation that will follow in Phase 2.
63
+
64
+ ### 1c — Run the test suite and confirm RED
65
+
66
+ Run the test suite. The new test must fail. Existing tests must pass.
67
+
68
+ If the new test passes without implementation, the test is wrong. Fix the test
69
+ before continuing.
70
+
71
+ **RED Phase Report:**
72
+
73
+ ```
74
+ ## RED Phase Report
75
+
76
+ **Test file**: [path/to/test/file]
77
+ **Tests written**:
78
+ - [test name] — [what it verifies]
79
+
80
+ **Suite result**: [X passing, Y failing]
81
+ **New test status**: FAIL ✓
82
+ **Failure reason**: [quoted error or assertion message]
83
+ **Existing tests**: [all passing | N failing — list]
84
+ ```
85
+
86
+ **STOP. Show the RED Phase Report. Do not proceed to GREEN without
87
+ confirmation.**
88
+
89
+ ---
90
+
91
+ ## Phase 2 — GREEN (Implementer role)
92
+
93
+ Adopt the **Implementer** role as defined in `CLAUDE.md`.
94
+
95
+ ### 2a — Read the failing test before writing any code
96
+
97
+ Understand exactly what the test asserts. Write only the code that satisfies
98
+ that assertion. Nothing more.
99
+
100
+ ### 2b — Implement the minimum
101
+
102
+ Rules for GREEN phase:
103
+
104
+ - Write the smallest amount of code that makes the failing test pass
105
+ - Do not add features not tested
106
+ - Do not clean up or restructure existing code — that is Refactor's job
107
+ - Do not add new tests — that is another RED cycle
108
+ - Hardcoding a return value is acceptable if it makes the test pass (the
109
+ Refactor phase will generalize it)
110
+
111
+ ### 2c — Run the test suite and confirm GREEN
112
+
113
+ Run the test suite. The new test must pass. All previously passing tests must
114
+ still pass.
115
+
116
+ If any previously passing test now fails, you introduced a regression. Fix it
117
+ before continuing.
118
+
119
+ **GREEN Phase Report:**
120
+
121
+ ```
122
+ ## GREEN Phase Report
123
+
124
+ **Files changed**:
125
+ - [path/to/file] — [what was added, one sentence]
126
+
127
+ **Implementation approach**: [one sentence — what the code does]
128
+ **Suite result**: [X passing, Y failing]
129
+ **New test status**: PASS ✓
130
+ **Regressions**: [none | list failing tests]
131
+ ```
132
+
133
+ **STOP. Show the GREEN Phase Report. Do not proceed to REFACTOR without
134
+ confirmation.**
135
+
136
+ ---
137
+
138
+ ## Phase 3 — REFACTOR (Implementer role, then Reviewer role)
139
+
140
+ Adopt the **Implementer** role as defined in `CLAUDE.md`.
141
+
142
+ ### 3a — Assess what needs cleaning
143
+
144
+ Before touching any code, identify:
145
+
146
+ - Duplication introduced during GREEN
147
+ - Names that do not clearly express intent
148
+ - Abstractions that belong in a separate function or module
149
+ - Logic that is hardcoded and should be generalized
150
+
151
+ Do not invent improvements. Only address what is directly in the implementation
152
+ written in Phase 2.
153
+
154
+ ### 3b — Refactor
155
+
156
+ Rules for REFACTOR phase:
157
+
158
+ - All tests must remain GREEN throughout — run the suite after each change
159
+ - Do not add new behavior
160
+ - Do not add new tests (if you discover untested behavior, note it for a new RED
161
+ cycle)
162
+ - Do not change function signatures unless the original was clearly wrong
163
+
164
+ ### 3c — Run the test suite and confirm GREEN after refactor
165
+
166
+ The full suite must pass. If any test fails during refactor, undo the last
167
+ change and investigate.
168
+
169
+ ### 3d — Review (Reviewer role)
170
+
171
+ Adopt the **Reviewer** role as defined in `CLAUDE.md`.
172
+
173
+ Review only the refactored code against these axes:
174
+
175
+ | Axis | What to check |
176
+ | ------------- | --------------------------------------------------------------- |
177
+ | Scope | Did the refactor change any behavior? |
178
+ | Correctness | Does the logic still satisfy the original test intent? |
179
+ | Architecture | Does the code follow existing project patterns? |
180
+ | Test coverage | Are all written tests still meaningful (not trivially passing)? |
181
+
182
+ Produce a Review Report. CRITICAL findings block completion.
183
+
184
+ **REFACTOR Phase Report:**
185
+
186
+ ```
187
+ ## REFACTOR Phase Report
188
+
189
+ **Changes made**:
190
+ - [path/to/file] — [what was cleaned up]
191
+
192
+ **Suite result**: [X passing, Y failing]
193
+ **Behavioral changes**: none (refactor only)
194
+
195
+ ### Review findings
196
+ **CRITICAL**: (none) | [list]
197
+ **WARNING**: (none) | [list]
198
+ **SUGGESTION**: (none) | [list]
199
+
200
+ **Verdict**: approved | approved with warnings | blocked
201
+ ```
202
+
203
+ ---
204
+
205
+ ## Completion
206
+
207
+ The TDD cycle is complete when:
208
+
209
+ - RED: at least one failing test was written and confirmed failing
210
+ - GREEN: the minimum implementation makes the test pass
211
+ - REFACTOR: the code is clean, all tests pass, no CRITICAL review findings
212
+
213
+ **Final Summary:**
214
+
215
+ ```
216
+ ## TDD Cycle Summary
217
+
218
+ **Behavior implemented**: [one sentence]
219
+ **Tests written**: [count] — [list test names]
220
+ **Files changed**: [list]
221
+ **Suite result**: [X passing, Y failing]
222
+ **Cycle status**: complete | blocked (reason)
223
+ ```
224
+
225
+ If the behavior requires additional test cases, start a new `/cc:tdd-cycle` with
226
+ the next scenario. One cycle = one behavior.
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: cc-test-plan
3
+ description:
4
+ Generate a structured test plan for a feature or module — covers unit,
5
+ integration, contract, and edge cases without writing any implementation code.
6
+ ---
7
+
8
+ # Test Plan Workflow
9
+
10
+ Scope: $ARGUMENTS
11
+
12
+ Specify what to plan tests for. Examples:
13
+
14
+ - A feature name: `user authentication`
15
+ - A module or file path: `src/orders/OrderService.kt`
16
+ - A Task Card title: `Add paginated product listing endpoint`
17
+ - A PR or branch: `feature/payment-retry`
18
+
19
+ If $ARGUMENTS is empty, describe the scope in your next message before invoking
20
+ `tester`.
21
+
22
+ ---
23
+
24
+ ## Step 1 — Scope confirmation
25
+
26
+ Before invoking `tester`, confirm the scope is well-defined.
27
+
28
+ A valid scope includes:
29
+
30
+ - The behavior or module under test
31
+ - The acceptance criteria or expected behavior (from the Task Card if available)
32
+ - Known edge cases or failure modes
33
+
34
+ If the scope is vague (e.g., "test the whole service"), ask one clarifying
35
+ question and wait for the answer.
36
+
37
+ ---
38
+
39
+ ## Step 2 — Test plan generation (tester)
40
+
41
+ Invoke `tester` in planning mode — produce a test plan document, not test code.
42
+ The plan will be used as input when tests are actually written.
43
+
44
+ tester must produce a Test Plan covering the following layers:
45
+
46
+ **Unit tests**
47
+
48
+ - Individual functions or methods in isolation
49
+ - One test per behavior, not per method
50
+ - Input/output contracts, null handling, type coercion
51
+
52
+ **Integration tests**
53
+
54
+ - Interactions between two or more components
55
+ - Database read/write cycles (if applicable)
56
+ - External service boundaries (mocked or stubbed)
57
+
58
+ **Contract tests**
59
+
60
+ - API endpoint contracts: request shape, response shape, status codes
61
+ - Event schema contracts (if event-driven components are in scope)
62
+
63
+ **Edge cases**
64
+
65
+ - Empty inputs, boundary values, max/min limits
66
+ - Concurrent access (if shared state is involved)
67
+ - Failure paths: what happens when a dependency is unavailable
68
+
69
+ **Regression cases**
70
+
71
+ - Known past bugs that must not recur (include reference if available)
72
+
73
+ ---
74
+
75
+ ## Step 3 — Test Plan format
76
+
77
+ tester produces the plan in this format:
78
+
79
+ ```markdown
80
+ ## Test Plan — [Scope Name]
81
+
82
+ ### Scope
83
+
84
+ [What is being tested and why]
85
+
86
+ ### Unit Tests
87
+
88
+ | Test ID | Target | Scenario | Expected Result |
89
+ | ------- | ------ | -------- | --------------- |
90
+ | U-001 | ... | ... | ... |
91
+
92
+ ### Integration Tests
93
+
94
+ | Test ID | Components | Scenario | Expected Result |
95
+ | ------- | ---------- | -------- | --------------- |
96
+ | I-001 | ... | ... | ... |
97
+
98
+ ### Contract Tests
99
+
100
+ | Test ID | Endpoint/Event | Property | Expected Value |
101
+ | ------- | -------------- | -------- | -------------- |
102
+ | C-001 | ... | ... | ... |
103
+
104
+ ### Edge Cases
105
+
106
+ | Test ID | Input/Condition | Expected Behavior |
107
+ | ------- | --------------- | ----------------- |
108
+ | E-001 | ... | ... |
109
+
110
+ ### Regression Cases
111
+
112
+ | Test ID | Reference | Scenario | Must Not Happen |
113
+ | ------- | --------- | -------- | --------------- |
114
+ | R-001 | ... | ... | ... |
115
+
116
+ ### Coverage Targets
117
+
118
+ - Minimum unit coverage: [%] (or "all acceptance criteria covered")
119
+ - Integration scenarios: [count]
120
+ - Contract validations: [count]
121
+
122
+ ### Out of Scope
123
+
124
+ [What this test plan explicitly does not cover and why]
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Step 4 — Human review
130
+
131
+ Show the Test Plan to the human before any tests are written.
132
+
133
+ The Test Plan is an artifact for review and approval. Writing test code is a
134
+ separate action — invoke `/cc:feature` or add a test task to the board to
135
+ implement from this plan.
136
+
137
+ ---
138
+
139
+ ## Completion
140
+
141
+ Deliver the complete Test Plan document. Save it as
142
+ `docs/test-plans/[scope-slug].md` if the human requests persistence.
143
+
144
+ This command produces a plan, not test files. No production code and no test
145
+ code is written during this command.
@@ -0,0 +1 @@
1
+ {{COMMIT_WORKFLOW}}
@@ -283,8 +283,8 @@ branch, declare done before running tests.
283
283
  **Pre-implementation checklist:**
284
284
 
285
285
  0. Create a Git Worktree for this session before opening any file for editing:
286
- `git worktree add ../<branch>-session <branch>`
287
- All changes happen inside this worktree. Never modify the main working tree directly.
286
+ `git worktree add ../<branch>-session <branch>` All changes happen inside
287
+ this worktree. Never modify the main working tree directly.
288
288
  1. Read the Technical Plan completely.
289
289
  2. Read each file listed under "Files Affected."
290
290
  3. Understand existing patterns in those files.
@@ -294,7 +294,8 @@ branch, declare done before running tests.
294
294
  **Implementation rules:**
295
295
 
296
296
  - **Work in a worktree.** Create a session worktree before touching any file.
297
- All edits happen inside it. Include the worktree path in the Implementation Summary.
297
+ All edits happen inside it. Include the worktree path in the Implementation
298
+ Summary.
298
299
  - **Minimal diff.** Change only what the plan specifies.
299
300
  - **Follow existing patterns.** Match naming conventions, error handling, and
300
301
  module structure already present in the codebase.
@@ -566,6 +567,14 @@ operations, or Alembic migrations, apply `.claude/skills/sqlalchemy/SKILL.md`.
566
567
  When the user asks to create a Spring Boot feature (entity, service, controller,
567
568
  or tests), apply `.claude/skills/spring-boot-feature/SKILL.md`.
568
569
 
570
+ When the active task requires web performance analysis, Core Web Vitals
571
+ auditing, PageSpeed Insights data, or optimization of LCP, TBT, CLS, FCP, or
572
+ TTFB, apply `.claude/skills/pagespeed-perf/SKILL.md` and
573
+ `.claude/skills/pagespeed-insights/SKILL.md`.
574
+
575
+ When the user asks about discovering, searching, or installing agent skills or
576
+ extending capabilities, apply `.claude/skills/find-skills/SKILL.md`.
577
+
569
578
  ---
570
579
 
571
580
  ## What Never Changes
@@ -590,6 +599,7 @@ or tests), apply `.claude/skills/spring-boot-feature/SKILL.md`.
590
599
  - Keep solutions simple and direct.
591
600
  - User instructions always override this file.
592
601
  - When using tools, be precise and minimal with context.
602
+ {{LANGUAGE_INSTRUCTIONS}}
593
603
 
594
604
  ## Context Budget
595
605
 
@@ -0,0 +1,6 @@
1
+ {
2
+ "autoConnectIde": true,
3
+ "autoInstallIdeExtension": false,
4
+ "externalEditorContext": true,
5
+ "teammateDefaultModel": "sonnet"
6
+ }
@@ -0,0 +1,103 @@
1
+ # PageSpeed Performance Audit
2
+
3
+ Audit web performance using the PageSpeed Insights API. Applies the 80/20
4
+ principle: identify the 20% of changes that produce 80% of the performance gain.
5
+ Produces a prioritized report in the current working directory.
6
+
7
+ ## Usage
8
+
9
+ ```
10
+ /cc-pagespeed --url <url> [--strategy mobile|desktop|both]
11
+ ```
12
+
13
+ ## Parameters
14
+
15
+ | Parameter | Required | Description |
16
+ | ------------- | -------- | -------------------------------------------------------------- |
17
+ | `--url` | Yes | Full URL to audit (must include scheme: https://...) |
18
+ | `--strategy` | No | Analysis strategy: `mobile`, `desktop`, or `both` (default: `both`) |
19
+
20
+ ## Requirements
21
+
22
+ ### `PAGESPEED_API_KEY` — Optional but strongly recommended
23
+
24
+ | Mode | Lab data | CrUX field data | Rate limits |
25
+ | ------------ | -------- | --------------- | ---------------- |
26
+ | **With key** | ✅ | ✅ (real users) | 25,000 req/day |
27
+ | **Without** | ✅ | ❌ | ~2 req/s shared |
28
+
29
+ Without the key, Core Web Vitals field data (real user experience via CrUX) is
30
+ unavailable. Lab data from Lighthouse still runs.
31
+
32
+ Set the key before invoking the command:
33
+
34
+ ```powershell
35
+ # Windows PowerShell
36
+ $env:PAGESPEED_API_KEY = "your-api-key"
37
+
38
+ # macOS / Linux
39
+ export PAGESPEED_API_KEY="your-api-key"
40
+ ```
41
+
42
+ Get a free key (Google account required):
43
+ <https://developers.google.com/speed/docs/insights/v5/get-started>
44
+
45
+ ## Workflow
46
+
47
+ When `/cc-pagespeed` is invoked, load the `pagespeed-perf` skill and execute
48
+ the following steps in order:
49
+
50
+ 1. **Pre-flight** — Read `$env:PAGESPEED_API_KEY` from the environment. Compute
51
+ the output filename: `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md`.
52
+
53
+ 2. **Collect** — Call the PageSpeed Insights API for the requested strategy
54
+ (`mobile`, `desktop`, or `both`). Prefer the Bun scripts in
55
+ `~/.claude/skills/pagespeed-perf/scripts/run.ts` if Bun is available.
56
+ Otherwise, use `WebFetch` to call the PSI endpoint directly.
57
+
58
+ 3. **Analyze** — Extract Core Web Vitals (LCP, INP, CLS, FCP, TTFB, TBT),
59
+ identify the LCP element, enumerate third-party scripts by blocking time,
60
+ and inspect resource hints in the HTML `<head>`.
61
+
62
+ 4. **Prioritize** — Score each identified optimization using the 80/20 matrix:
63
+ `Impact × Ease` (each 1–5). Order findings by descending score. Highlight
64
+ the top actions with Score ≥ 20 as the critical 20%.
65
+
66
+ 5. **Report** — Write the structured markdown report to
67
+ `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md` in the current directory.
68
+
69
+ ## Output File
70
+
71
+ The report is saved as `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md`.
72
+
73
+ - Hostname characters outside `[a-zA-Z0-9]` are replaced with `-`.
74
+ - Example: `https://www.example.com` → `2026-06-07_pagespeed-www-example-com-claude.md`
75
+
76
+ ## Skills Loaded
77
+
78
+ - `pagespeed-perf` — Web Performance Engineering: PSI API, Core Web Vitals
79
+ thresholds, 80/20 optimization matrix, resource-hint analysis, third-party
80
+ script auditing, framework-specific implementation templates.
81
+
82
+ ## Examples
83
+
84
+ ```bash
85
+ # Full audit — mobile + desktop
86
+ /cc-pagespeed --url https://www.example.com
87
+
88
+ # Mobile only
89
+ /cc-pagespeed --url https://www.example.com --strategy mobile
90
+
91
+ # Desktop only
92
+ /cc-pagespeed --url https://www.example.com --strategy desktop
93
+ ```
94
+
95
+ ## Hard Rules
96
+
97
+ - **GET only.** Never send POST, PUT, or DELETE to the target URL.
98
+ - **No auth.** Never include cookies, tokens, or auth headers.
99
+ - **No external crawling.** Audit only the provided URL.
100
+ - **Quantify every finding.** Never write "it would improve LCP". Always cite
101
+ the observed value and estimated gain (e.g., "reduces LCP from 4.2 s to ~3.0 s").
102
+ - **No generic recommendations.** Every finding must be backed by data from
103
+ the audit of this specific URL.