cc-codeconductor 0.4.2 → 0.5.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 (172) hide show
  1. package/README.md +75 -4
  2. package/dist/index.js +2698 -230
  3. package/package.json +1 -1
  4. package/presets/agy/skills/evaluation/SKILL.md +6 -0
  5. package/presets/agy/skills/openspec/SKILL.md +32 -0
  6. package/presets/agy/workflows/cc-openspec.md +62 -0
  7. package/presets/agy/workflows/cc-pipeline.md +69 -0
  8. package/presets/agy/workflows/cc-scorecard.md +17 -0
  9. package/presets/claude/commands/cc/openspec.md +144 -0
  10. package/presets/claude/commands/cc/review.md +13 -2
  11. package/presets/claude/commands/cc/scorecard.md +65 -0
  12. package/presets/claude/skills/evaluation/SKILL.md +42 -0
  13. package/presets/claude/skills/openspec/SKILL.md +54 -0
  14. package/presets/codex/AGENTS.md +57 -0
  15. package/presets/cursor/.cursorignore +15 -0
  16. package/presets/cursor/AGENTS.md +504 -0
  17. package/presets/cursor/agents/architect.md +211 -0
  18. package/presets/cursor/agents/complexity-auditor.md +76 -0
  19. package/presets/cursor/agents/contract-builder.md +75 -0
  20. package/presets/cursor/agents/docs.md +180 -0
  21. package/presets/cursor/agents/goal-planner.md +71 -0
  22. package/presets/cursor/agents/implementer.md +161 -0
  23. package/presets/cursor/agents/orchestrator.md +377 -0
  24. package/presets/cursor/agents/repo-explorer.md +100 -0
  25. package/presets/cursor/agents/reviewer.md +237 -0
  26. package/presets/cursor/agents/security-reviewer.md +113 -0
  27. package/presets/cursor/agents/task-coach.md +145 -0
  28. package/presets/cursor/agents/tester.md +241 -0
  29. package/presets/cursor/commands/cc/api-contract.md +58 -0
  30. package/presets/cursor/commands/cc/db-migration.md +58 -0
  31. package/presets/cursor/commands/cc/feature.md +115 -0
  32. package/presets/cursor/commands/cc/fix.md +121 -0
  33. package/presets/cursor/commands/cc/openspec.md +144 -0
  34. package/presets/cursor/commands/cc/pagespeed.md +103 -0
  35. package/presets/cursor/commands/cc/refactor.md +148 -0
  36. package/presets/cursor/commands/cc/review.md +137 -0
  37. package/presets/cursor/commands/cc/scorecard.md +65 -0
  38. package/presets/cursor/commands/cc/tdd-cycle.md +226 -0
  39. package/presets/cursor/commands/cc/test-plan.md +138 -0
  40. package/presets/cursor/rules/behavioral-discipline.mdc +14 -0
  41. package/presets/cursor/rules/context-budget.mdc +12 -0
  42. package/presets/cursor/rules/orchestration.mdc +12 -0
  43. package/presets/cursor/rules/yagni-stdlib.mdc +11 -0
  44. package/presets/cursor/skills/android/SKILL.md +122 -0
  45. package/presets/cursor/skills/api-versioning/SKILL.md +394 -0
  46. package/presets/cursor/skills/astro/SKILL.md +322 -0
  47. package/presets/cursor/skills/auth-token-inspector/SKILL.md +33 -0
  48. package/presets/cursor/skills/code-review/SKILL.md +208 -0
  49. package/presets/cursor/skills/conductor-setup/SKILL.md +127 -0
  50. package/presets/cursor/skills/django-orm/SKILL.md +463 -0
  51. package/presets/cursor/skills/django-testing/SKILL.md +417 -0
  52. package/presets/cursor/skills/django-uv/SKILL.md +409 -0
  53. package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +54 -0
  54. package/presets/cursor/skills/evaluation/SKILL.md +8 -0
  55. package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +46 -0
  56. package/presets/cursor/skills/find-skills/SKILL.md +144 -0
  57. package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +49 -0
  58. package/presets/cursor/skills/jpa-postgres/SKILL.md +626 -0
  59. package/presets/cursor/skills/laravel-specialist/SKILL.md +267 -0
  60. package/presets/cursor/skills/laravel-specialist/references/eloquent.md +351 -0
  61. package/presets/cursor/skills/laravel-specialist/references/livewire.md +512 -0
  62. package/presets/cursor/skills/laravel-specialist/references/queues.md +423 -0
  63. package/presets/cursor/skills/laravel-specialist/references/routing.md +362 -0
  64. package/presets/cursor/skills/laravel-specialist/references/testing.md +522 -0
  65. package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +39 -0
  66. package/presets/cursor/skills/multi-agent-orchestration/README.md +144 -0
  67. package/presets/cursor/skills/multi-agent-orchestration/SKILL.md +579 -0
  68. package/presets/cursor/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  69. package/presets/cursor/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  70. package/presets/cursor/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  71. package/presets/cursor/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  72. package/presets/cursor/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  73. package/presets/cursor/skills/nextjs-typescript/SKILL.md +394 -0
  74. package/presets/cursor/skills/openspec/SKILL.md +52 -0
  75. package/presets/cursor/skills/pagespeed-insights/SKILL.md +445 -0
  76. package/presets/cursor/skills/pagespeed-insights/reference.md +50 -0
  77. package/presets/cursor/skills/pagespeed-perf/SKILL.md +281 -0
  78. package/presets/cursor/skills/php-pro/SKILL.md +210 -0
  79. package/presets/cursor/skills/php-pro/references/async-patterns.md +412 -0
  80. package/presets/cursor/skills/php-pro/references/laravel-patterns.md +377 -0
  81. package/presets/cursor/skills/php-pro/references/modern-php-features.md +323 -0
  82. package/presets/cursor/skills/php-pro/references/symfony-patterns.md +466 -0
  83. package/presets/cursor/skills/php-pro/references/testing-quality.md +466 -0
  84. package/presets/cursor/skills/python/SKILL.md +613 -0
  85. package/presets/cursor/skills/python-django-stack/SKILL.md +500 -0
  86. package/presets/cursor/skills/python-fastapi-stack/SKILL.md +464 -0
  87. package/presets/cursor/skills/security/SKILL.md +384 -0
  88. package/presets/cursor/skills/seo-analytics-injector/SKILL.md +44 -0
  89. package/presets/cursor/skills/spring-auth-auditor/SKILL.md +33 -0
  90. package/presets/cursor/skills/spring-boot-feature/SKILL.md +566 -0
  91. package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +408 -0
  92. package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +479 -0
  93. package/presets/cursor/skills/sqlalchemy/SKILL.md +473 -0
  94. package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +32 -0
  95. package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +28 -0
  96. package/presets/cursor/skills/testing-tdd/SKILL.md +592 -0
  97. package/presets/cursor/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  98. package/presets/cursor/skills/workflow-orchestration-patterns/references/details.md +223 -0
  99. package/presets/laravel-tall/agents/architect.md +8 -0
  100. package/presets/laravel-tall/agents/implementer.md +12 -0
  101. package/presets/laravel-tall/laravel-tall.yml +38 -0
  102. package/presets/opencode/agents/architect.md +153 -61
  103. package/presets/opencode/agents/complexity-auditor.md +1 -0
  104. package/presets/opencode/agents/contract-builder.md +93 -0
  105. package/presets/opencode/agents/docs.md +125 -40
  106. package/presets/opencode/agents/goal-planner.md +82 -0
  107. package/presets/opencode/agents/implementer.md +107 -38
  108. package/presets/opencode/agents/orchestrator.md +90 -71
  109. package/presets/opencode/agents/repo-explorer.md +1 -2
  110. package/presets/opencode/agents/reviewer.md +164 -75
  111. package/presets/opencode/agents/security-reviewer.md +129 -0
  112. package/presets/opencode/agents/task-coach.md +110 -59
  113. package/presets/opencode/agents/tester.md +1 -2
  114. package/presets/opencode/commands/cc-openspec.md +61 -0
  115. package/presets/opencode/commands/cc-scorecard.md +16 -0
  116. package/presets/opencode/prompts/v0.4.0/architect.md +221 -0
  117. package/presets/opencode/prompts/v0.4.0/complexity-auditor.md +89 -0
  118. package/presets/opencode/prompts/v0.4.0/docs.md +189 -0
  119. package/presets/opencode/prompts/v0.4.0/implementer.md +162 -0
  120. package/presets/opencode/prompts/v0.4.0/orchestrator.md +348 -0
  121. package/presets/opencode/prompts/v0.4.0/repo-explorer.md +110 -0
  122. package/presets/opencode/prompts/v0.4.0/reviewer.md +225 -0
  123. package/presets/opencode/prompts/v0.4.0/task-coach.md +155 -0
  124. package/presets/opencode/prompts/v0.4.0/tester.md +251 -0
  125. package/presets/opencode/prompts/v0.5.0/architect.md +222 -0
  126. package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +91 -0
  127. package/presets/opencode/prompts/v0.5.0/contract-builder.md +84 -0
  128. package/presets/opencode/prompts/v0.5.0/docs.md +190 -0
  129. package/presets/opencode/prompts/v0.5.0/goal-planner.md +80 -0
  130. package/presets/opencode/prompts/v0.5.0/implementer.md +171 -0
  131. package/presets/opencode/prompts/v0.5.0/orchestrator.md +388 -0
  132. package/presets/opencode/prompts/v0.5.0/repo-explorer.md +111 -0
  133. package/presets/opencode/prompts/v0.5.0/reviewer.md +248 -0
  134. package/presets/opencode/prompts/v0.5.0/security-reviewer.md +123 -0
  135. package/presets/opencode/prompts/v0.5.0/task-coach.md +156 -0
  136. package/presets/opencode/prompts/v0.5.0/tester.md +252 -0
  137. package/presets/opencode/skills/auth-token-inspector/SKILL.md +31 -0
  138. package/presets/opencode/skills/drizzle-schema-architect/SKILL.md +51 -0
  139. package/presets/opencode/skills/evaluation/SKILL.md +6 -0
  140. package/presets/opencode/skills/fastapi-pydantic-strict/SKILL.md +44 -0
  141. package/presets/opencode/skills/jpa-nplusone-detector/SKILL.md +46 -0
  142. package/presets/opencode/skills/livewire-alpine-bridge/SKILL.md +36 -0
  143. package/presets/opencode/skills/openspec/SKILL.md +50 -0
  144. package/presets/opencode/skills/seo-analytics-injector/SKILL.md +44 -0
  145. package/presets/opencode/skills/spring-auth-auditor/SKILL.md +30 -0
  146. package/presets/opencode/skills/tailwind-responsive-auditor/SKILL.md +30 -0
  147. package/presets/opencode/skills/tdd-mutation-tester/SKILL.md +28 -0
  148. package/presets/python-data-api/agents/architect.md +8 -0
  149. package/presets/python-data-api/agents/implementer.md +9 -0
  150. package/presets/python-data-api/python-data-api.yml +37 -0
  151. package/presets/spring-kotlin-jpa/agents/architect.md +8 -0
  152. package/presets/spring-kotlin-jpa/agents/implementer.md +9 -0
  153. package/presets/spring-kotlin-jpa/spring-kotlin-jpa.yml +38 -0
  154. package/presets/templates/BACKLOG.md +33 -0
  155. package/presets/templates/execution-profile.yml +6 -0
  156. package/presets/templates/model-comparison.md +11 -0
  157. package/presets/templates/regression-checklist.yml +10 -0
  158. package/presets/ts-next-drizzle/agents/architect.md +8 -0
  159. package/presets/ts-next-drizzle/agents/implementer.md +10 -0
  160. package/presets/ts-next-drizzle/ts-next-drizzle.yml +41 -0
  161. package/src/presets/manifests/agy.yml +2 -2
  162. package/src/presets/manifests/claude.yml +2 -2
  163. package/src/presets/manifests/codex.yml +2 -2
  164. package/src/presets/manifests/cursor.yml +19 -3
  165. package/src/presets/manifests/gemini.yml +2 -2
  166. package/src/presets/manifests/opencode.yml +2 -2
  167. package/src/presets/models/agy.yml +21 -0
  168. package/src/presets/models/claude.yml +18 -0
  169. package/src/presets/models/codex.yml +18 -0
  170. package/src/presets/models/cursor.yml +39 -9
  171. package/src/presets/models/gemini.yml +18 -0
  172. package/src/presets/models/opencode.yml +18 -0
@@ -0,0 +1,445 @@
1
+ ---
2
+ name: pagespeed-insights
3
+ description: Audit web pages for performance optimization following PageSpeed Insights guidelines. Use when analyzing page performance, optimizing web applications, reviewing performance metrics, implementing Core Web Vitals improvements, or when the user mentions page speed, performance optimization, Lighthouse scores, or Core Web Vitals.
4
+ paths:
5
+ - "**/*.{html,tsx,jsx,vue}"
6
+ ---
7
+
8
+ # PageSpeed Insights Auditor
9
+
10
+ ## Overview
11
+
12
+ You are a **PageSpeed Insights Auditor** - an expert in web performance optimization who helps developers achieve excellent PageSpeed scores by identifying performance issues, avoiding bad practices, and implementing best practices based on Google's PageSpeed Insights guidelines.
13
+
14
+ **Core Principle**: Guide developers to achieve scores of 90+ (Good) in Performance, Accessibility, Best Practices, and SEO categories, while ensuring Core Web Vitals metrics meet the "Good" thresholds.
15
+
16
+ ## Understanding PageSpeed Insights
17
+
18
+ PageSpeed Insights (PSI) analyzes page performance on mobile and desktop devices, providing both **lab data** (simulated) and **field data** (real user experiences). PSI reports on user experience metrics and provides diagnostic suggestions to improve page performance.
19
+
20
+ ### Two Types of Data
21
+
22
+ 1. **Lab Data**: Collected in a controlled environment using Lighthouse. Useful for debugging but may not capture real-world bottlenecks.
23
+ 2. **Field Data**: Real user experience data from Chrome User Experience Report (CrUX). Useful for capturing actual user experiences but has a more limited set of metrics.
24
+
25
+ ## Performance Score Thresholds
26
+
27
+ ### Lab Scores (Lighthouse)
28
+
29
+ | Score Range | Rating | Icon |
30
+ | ----------- | ----------------- | --------------- |
31
+ | 90-100 | Good | 🟢 Green circle |
32
+ | 50-89 | Needs Improvement | 🟡 Amber square |
33
+ | 0-49 | Poor | 🔴 Red triangle |
34
+
35
+ **Target**: Always aim for scores of **90 or higher** in all categories.
36
+
37
+ ### Core Web Vitals Thresholds
38
+
39
+ Core Web Vitals are the three most important metrics for web performance:
40
+
41
+ | Metric | Good | Needs Improvement | Poor |
42
+ | ----------------------------------- | ------------ | ------------------ | --------- |
43
+ | **FCP** (First Contentful Paint) | [0, 1800 ms] | [1800 ms, 3000 ms] | > 3000 ms |
44
+ | **LCP** (Largest Contentful Paint) | [0, 2500 ms] | [2500 ms, 4000 ms] | > 4000 ms |
45
+ | **CLS** (Cumulative Layout Shift) | [0, 0.1] | [0.1, 0.25] | > 0.25 |
46
+ | **INP** (Interaction to Next Paint) | [0, 200 ms] | [200 ms, 500 ms] | > 500 ms |
47
+ | **TTFB** (Time to First Byte) | [0, 800 ms] | [800 ms, 1800 ms] | > 1800 ms |
48
+
49
+ **Target**: Ensure the 75th percentile of all Core Web Vitals metrics are in the "Good" range.
50
+
51
+ ## Key Performance Metrics
52
+
53
+ ### Lab Metrics (Lighthouse)
54
+
55
+ 1. **First Contentful Paint (FCP)**: Time until first content is rendered
56
+ 2. **Largest Contentful Paint (LCP)**: Time until largest content element is rendered
57
+ 3. **Speed Index**: How quickly content is visually displayed
58
+ 4. **Cumulative Layout Shift (CLS)**: Visual stability measure
59
+ 5. **Total Blocking Time (TBT)**: Sum of blocking time between FCP and TTI
60
+ 6. **Time to Interactive (TTI)**: Time until page is fully interactive
61
+
62
+ ### Field Metrics (CrUX)
63
+
64
+ - **FCP**: First Contentful Paint from real users
65
+ - **LCP**: Largest Contentful Paint from real users
66
+ - **CLS**: Cumulative Layout Shift from real users
67
+ - **INP**: Interaction to Next Paint (replaces FID)
68
+ - **TTFB**: Time to First Byte (experimental)
69
+
70
+ ## Common Performance Issues & Solutions
71
+
72
+ ### ❌ Bad Practice: Unoptimized Images
73
+
74
+ **Problem**: Large images without compression, modern formats, or proper sizing.
75
+
76
+ **Impact**: Poor LCP scores, slow page loads.
77
+
78
+ **✅ Solutions**:
79
+
80
+ - Use modern image formats (WebP, AVIF)
81
+ - Implement responsive images with `srcset`
82
+ - Compress images before uploading
83
+ - Set explicit width/height to prevent CLS
84
+ - Use lazy loading for below-the-fold images
85
+
86
+ ```html
87
+ <!-- Bad -->
88
+ <img src="large-image.jpg" alt="Description" />
89
+
90
+ <!-- Good -->
91
+ <img
92
+ src="image.webp"
93
+ srcset="image-small.webp 400w, image-medium.webp 800w, image-large.webp 1200w"
94
+ sizes="(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px"
95
+ width="1200"
96
+ height="800"
97
+ alt="Description"
98
+ loading="lazy"
99
+ />
100
+ ```
101
+
102
+ ### ❌ Bad Practice: Render-Blocking Resources
103
+
104
+ **Problem**: CSS and JavaScript blocking initial render.
105
+
106
+ **Impact**: Poor FCP and LCP scores.
107
+
108
+ **✅ Solutions**:
109
+
110
+ - Defer non-critical CSS
111
+ - Inline critical CSS
112
+ - Use `async` or `defer` for JavaScript
113
+ - Remove unused CSS/JS
114
+ - Split code and lazy load routes
115
+
116
+ ```html
117
+ <!-- Bad -->
118
+ <link rel="stylesheet" href="styles.css" />
119
+ <script src="app.js"></script>
120
+
121
+ <!-- Good -->
122
+ <link
123
+ rel="stylesheet"
124
+ href="styles.css"
125
+ media="print"
126
+ onload="this.media='all'"
127
+ />
128
+ <link rel="preload" href="critical.css" as="style" />
129
+ <script src="app.js" defer></script>
130
+ ```
131
+
132
+ ### ❌ Bad Practice: Missing Resource Hints
133
+
134
+ **Problem**: Not preconnecting to important origins or prefetching critical resources.
135
+
136
+ **Impact**: Slow TTFB and LCP.
137
+
138
+ **✅ Solutions**:
139
+
140
+ - Use `rel="preconnect"` for third-party origins
141
+ - Use `rel="dns-prefetch"` for DNS resolution
142
+ - Use `rel="preload"` for critical resources
143
+ - Use `rel="prefetch"` for likely next-page resources
144
+
145
+ ```html
146
+ <!-- Good -->
147
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
148
+ <link rel="dns-prefetch" href="https://api.example.com" />
149
+ <link rel="preload" href="hero-image.webp" as="image" />
150
+ ```
151
+
152
+ ### ❌ Bad Practice: Layout Shift (CLS)
153
+
154
+ **Problem**: Content shifting during page load.
155
+
156
+ **Impact**: Poor CLS scores, bad user experience.
157
+
158
+ **✅ Solutions**:
159
+
160
+ - Set explicit dimensions for images and videos
161
+ - Reserve space for ads and embeds
162
+ - Avoid inserting content above existing content
163
+ - Use CSS aspect-ratio for responsive containers
164
+ - Prefer transform animations over layout-triggering properties
165
+
166
+ ```css
167
+ /* Bad */
168
+ .image-container {
169
+ width: 100%;
170
+ /* height not set - causes CLS */
171
+ }
172
+
173
+ /* Good */
174
+ .image-container {
175
+ width: 100%;
176
+ aspect-ratio: 16 / 9;
177
+ /* or */
178
+ height: 0;
179
+ padding-bottom: 56.25%; /* 16:9 ratio */
180
+ }
181
+ ```
182
+
183
+ ### ❌ Bad Practice: Large JavaScript Bundles
184
+
185
+ **Problem**: Loading unnecessary JavaScript code.
186
+
187
+ **Impact**: Poor TTI, high TBT.
188
+
189
+ **✅ Solutions**:
190
+
191
+ - Code splitting and lazy loading
192
+ - Remove unused code (tree shaking)
193
+ - Minimize and compress JavaScript
194
+ - Use dynamic imports for routes
195
+ - Avoid large third-party libraries when possible
196
+
197
+ ```javascript
198
+ // Bad - loading everything upfront
199
+ import { heavyLibrary } from "./heavy-library";
200
+
201
+ // Good - lazy load when needed
202
+ const loadHeavyLibrary = () => import("./heavy-library");
203
+ ```
204
+
205
+ ### ❌ Bad Practice: Inefficient Font Loading
206
+
207
+ **Problem**: Fonts causing FOIT (Flash of Invisible Text) or FOUT (Flash of Unstyled Text).
208
+
209
+ **Impact**: Poor FCP, layout shifts.
210
+
211
+ **✅ Solutions**:
212
+
213
+ - Use `font-display: swap` or `optional`
214
+ - Preload critical fonts
215
+ - Subset fonts to include only needed characters
216
+ - Use system fonts when possible
217
+
218
+ ```css
219
+ /* Good */
220
+ @font-face {
221
+ font-family: "CustomFont";
222
+ src: url("font.woff2") format("woff2");
223
+ font-display: swap; /* or optional */
224
+ }
225
+ ```
226
+
227
+ ### ❌ Bad Practice: No Caching Strategy
228
+
229
+ **Problem**: Resources not cached, causing repeated downloads.
230
+
231
+ **Impact**: Slow repeat visits, poor performance.
232
+
233
+ **✅ Solutions**:
234
+
235
+ - Set appropriate Cache-Control headers
236
+ - Use service workers for offline caching
237
+ - Implement HTTP/2 server push for critical resources
238
+ - Use CDN for static assets
239
+
240
+ ```
241
+ Cache-Control: public, max-age=31536000, immutable
242
+ ```
243
+
244
+ ### ❌ Bad Practice: Third-Party Scripts Blocking Render
245
+
246
+ **Problem**: Analytics, ads, or widgets blocking page load.
247
+
248
+ **Impact**: Poor TTI, high TBT.
249
+
250
+ **✅ Solutions**:
251
+
252
+ - Load third-party scripts asynchronously
253
+ - Defer non-critical third-party code
254
+ - Use `rel="noopener"` for external links
255
+ - Consider self-hosting analytics when possible
256
+
257
+ ```html
258
+ <!-- Good -->
259
+ <script async src="https://www.google-analytics.com/analytics.js"></script>
260
+ ```
261
+
262
+ ## Accessibility Best Practices
263
+
264
+ ### ❌ Bad Practice: Missing Alt Text
265
+
266
+ **Problem**: Images without descriptive alt attributes.
267
+
268
+ **Impact**: Poor accessibility score.
269
+
270
+ **✅ Solution**: Always provide meaningful alt text.
271
+
272
+ ```html
273
+ <!-- Bad -->
274
+ <img src="chart.png" />
275
+
276
+ <!-- Good -->
277
+ <img src="chart.png" alt="Sales increased 25% from Q1 to Q2" />
278
+ ```
279
+
280
+ ### ❌ Bad Practice: Poor Color Contrast
281
+
282
+ **Problem**: Text not readable due to low contrast.
283
+
284
+ **Impact**: Poor accessibility score.
285
+
286
+ **✅ Solution**: Ensure contrast ratio of at least 4.5:1 for normal text, 3:1 for large text.
287
+
288
+ ### ❌ Bad Practice: Missing ARIA Labels
289
+
290
+ **Problem**: Interactive elements without proper labels.
291
+
292
+ **Impact**: Poor accessibility score.
293
+
294
+ **✅ Solution**: Use ARIA labels for screen readers.
295
+
296
+ ```html
297
+ <!-- Good -->
298
+ <button aria-label="Close dialog">×</button>
299
+ ```
300
+
301
+ ## SEO Best Practices
302
+
303
+ ### ❌ Bad Practice: Missing Meta Tags
304
+
305
+ **Problem**: No title, description, or viewport meta tags.
306
+
307
+ **Impact**: Poor SEO score.
308
+
309
+ **✅ Solution**: Include essential meta tags.
310
+
311
+ ```html
312
+ <!-- Good -->
313
+ <meta charset="UTF-8" />
314
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
315
+ <meta name="description" content="Page description" />
316
+ <title>Page Title</title>
317
+ ```
318
+
319
+ ### ❌ Bad Practice: Non-Descriptive Links
320
+
321
+ **Problem**: Links with generic text like "click here".
322
+
323
+ **Impact**: Poor SEO score.
324
+
325
+ **✅ Solution**: Use descriptive link text.
326
+
327
+ ```html
328
+ <!-- Bad -->
329
+ <a href="/about">Click here</a>
330
+
331
+ <!-- Good -->
332
+ <a href="/about">Learn more about our company</a>
333
+ ```
334
+
335
+ ## Best Practices Checklist
336
+
337
+ ### Performance
338
+
339
+ - [ ] Images optimized (WebP/AVIF, compressed, responsive)
340
+ - [ ] Critical CSS inlined
341
+ - [ ] Non-critical CSS deferred
342
+ - [ ] JavaScript code-split and lazy-loaded
343
+ - [ ] Render-blocking resources minimized
344
+ - [ ] Resource hints implemented (preconnect, preload, dns-prefetch)
345
+ - [ ] Fonts optimized with font-display
346
+ - [ ] Caching strategy implemented
347
+ - [ ] Third-party scripts loaded asynchronously
348
+ - [ ] Layout shifts prevented (explicit dimensions, aspect-ratio)
349
+
350
+ ### Core Web Vitals
351
+
352
+ - [ ] LCP < 2.5 seconds (75th percentile)
353
+ - [ ] FCP < 1.8 seconds (75th percentile)
354
+ - [ ] CLS < 0.1 (75th percentile)
355
+ - [ ] INP < 200ms (75th percentile)
356
+ - [ ] TTFB < 800ms (75th percentile)
357
+
358
+ ### Accessibility
359
+
360
+ - [ ] All images have alt text
361
+ - [ ] Color contrast meets WCAG standards
362
+ - [ ] ARIA labels on interactive elements
363
+ - [ ] Semantic HTML used
364
+ - [ ] Keyboard navigation supported
365
+
366
+ ### SEO
367
+
368
+ - [ ] Meta tags present (title, description, viewport)
369
+ - [ ] Descriptive link text
370
+ - [ ] Proper heading hierarchy (h1-h6)
371
+ - [ ] Structured data implemented
372
+ - [ ] Mobile-friendly design
373
+
374
+ ## Audit Workflow
375
+
376
+ When auditing a page for PageSpeed optimization:
377
+
378
+ 1. **Analyze Current State**
379
+ - Check current PageSpeed scores
380
+ - Identify Core Web Vitals metrics
381
+ - Review lab and field data differences
382
+
383
+ 2. **Identify Issues**
384
+ - List all performance problems
385
+ - Prioritize by impact (Core Web Vitals first)
386
+ - Categorize by type (images, JS, CSS, etc.)
387
+
388
+ 3. **Provide Solutions**
389
+ - Suggest specific optimizations
390
+ - Provide code examples
391
+ - Explain expected improvements
392
+
393
+ 4. **Verify Improvements**
394
+ - Re-test after changes
395
+ - Ensure scores reach 90+
396
+ - Confirm Core Web Vitals are "Good"
397
+
398
+ ## Common Mistakes to Avoid
399
+
400
+ ### ❌ Focusing Only on Lab Data
401
+
402
+ **Problem**: Optimizing only for Lighthouse scores without considering real user data.
403
+
404
+ **✅ Solution**: Balance both lab and field data. Field data shows real-world performance.
405
+
406
+ ### ❌ Over-Optimizing
407
+
408
+ **Problem**: Implementing too many optimizations at once, making debugging difficult.
409
+
410
+ **✅ Solution**: Make incremental changes and test after each optimization.
411
+
412
+ ### ❌ Ignoring Mobile Performance
413
+
414
+ **Problem**: Optimizing only for desktop.
415
+
416
+ **✅ Solution**: Mobile-first approach. Most users are on mobile devices.
417
+
418
+ ### ❌ Not Testing After Changes
419
+
420
+ **Problem**: Assuming optimizations worked without verification.
421
+
422
+ **✅ Solution**: Always re-run PageSpeed Insights after implementing changes.
423
+
424
+ ## Performance Optimization Priority
425
+
426
+ 1. **Critical Path**: Optimize resources needed for initial render
427
+ 2. **Core Web Vitals**: Focus on LCP, CLS, and INP first
428
+ 3. **Render-Blocking**: Eliminate blocking CSS and JS
429
+ 4. **Images**: Optimize largest contentful paint element
430
+ 5. **Third-Party**: Minimize impact of external scripts
431
+ 6. **Caching**: Implement proper caching strategies
432
+
433
+ ## Additional Resources
434
+
435
+ - [reference.md](reference.md) — Official PageSpeed, Lighthouse, Core Web Vitals, optimization guides — indexable
436
+ - **Official**: https://developers.google.com/speed/docs/insights/v5/about?hl=es-419
437
+ - **PageSpeed Insights**: https://pagespeed.web.dev/
438
+ - **Lighthouse**: Built into Chrome DevTools
439
+ - **Web Vitals**: https://web.dev/vitals/
440
+
441
+ ## Specification Reference
442
+
443
+ This skill is based on the official [PageSpeed Insights documentation](https://developers.google.com/speed/docs/insights/v5/about?hl=es-419) from Google Developers.
444
+
445
+ All thresholds, metrics, and best practices in this skill follow the official PageSpeed Insights guidelines and Core Web Vitals specifications. For complete documentation, refer to the [official PageSpeed Insights documentation](https://developers.google.com/speed/docs/insights/v5/about?hl=es-419).
@@ -0,0 +1,50 @@
1
+ # PageSpeed Insights — Reference & Official Documentation
2
+
3
+ This file complements the pagespeed-insights skill with official documentation links for indexing.
4
+
5
+ ## Official documentation (indexable)
6
+
7
+ - **PageSpeed Insights about**: https://developers.google.com/speed/docs/insights/v5/about?hl=es-419
8
+ - **PageSpeed Insights (tool)**: https://pagespeed.web.dev/
9
+ - **Lighthouse**: https://developer.chrome.com/docs/lighthouse/
10
+ - **Core Web Vitals**: https://web.dev/vitals/
11
+ - **Chrome User Experience Report (CrUX)**: https://developer.chrome.com/docs/crux/
12
+
13
+ ## Core Web Vitals (metrics)
14
+
15
+ - **LCP (Largest Contentful Paint)**: https://web.dev/lcp/
16
+ - **FCP (First Contentful Paint)**: https://web.dev/fcp/
17
+ - **CLS (Cumulative Layout Shift)**: https://web.dev/cls/
18
+ - **INP (Interaction to Next Paint)**: https://web.dev/inp/
19
+ - **TTFB (Time to First Byte)**: https://web.dev/ttfb/
20
+
21
+ ## Lab vs field data
22
+
23
+ - **Lab data**: Lighthouse, controlled environment, debugging
24
+ - **Field data**: CrUX, real user metrics, 28-day aggregation
25
+ - **Understanding metrics**: https://web.dev/metrics/
26
+
27
+ ## Performance optimization guides
28
+
29
+ - **Optimize LCP**: https://web.dev/optimize-lcp/
30
+ - **Optimize CLS**: https://web.dev/optimize-cls/
31
+ - **Optimize INP**: https://web.dev/optimize-inp/
32
+ - **Optimize FCP**: https://web.dev/optimize-fcp/
33
+ - **Resource hints**: https://web.dev/preconnect-and-dns-prefetch/
34
+ - **Image optimization**: https://web.dev/fast/#optimize-your-images
35
+
36
+ ## Tools
37
+
38
+ - **PageSpeed Insights**: https://pagespeed.web.dev/
39
+ - **Lighthouse (Chrome DevTools)**: Built-in, Audits tab
40
+ - **Web Vitals extension**: Real-time monitoring
41
+ - **Chromatic (Lighthouse CI)**: https://github.com/GoogleChrome/lighthouse-ci
42
+
43
+ ## Score thresholds (reminder)
44
+
45
+ | Category | Good | Needs Improvement | Poor |
46
+ |----------|------|-------------------|------|
47
+ | Performance | 90-100 | 50-89 | 0-49 |
48
+ | Accessibility | 90-100 | 50-89 | 0-49 |
49
+ | Best Practices | 90-100 | 50-89 | 0-49 |
50
+ | SEO | 90-100 | 50-89 | 0-49 |