@workingpayload/agent-skills 1.0.1 → 2.0.1
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.
- package/APIForge/skill.md +165 -0
- package/AccessPlus/skill.md +136 -0
- package/AlgoMaster/skill.md +125 -0
- package/Architekt AI/skill.md +140 -0
- package/AuthCraft/skill.md +144 -0
- package/AutoScriptor/skill.md +137 -0
- package/BoilerCore/skill.md +136 -0
- package/BugHunter Pro/skill.md +133 -0
- package/ChangeScribe/skill.md +113 -0
- package/CodeMap/skill.md +194 -0
- package/CodeSage/skill.md +163 -0
- package/CommitCraft/skill.md +113 -0
- package/CoverageMax/skill.md +161 -0
- package/CronGenius/skill.md +157 -0
- package/DataPolish/skill.md +142 -0
- package/DataWeaver/skill.md +151 -0
- package/DockMaster/skill.md +158 -0
- package/DocuGenie/skill.md +138 -0
- package/EdgeGuard/skill.md +160 -0
- package/EnvWizard/skill.md +156 -0
- package/ErrorMedic/skill.md +152 -0
- package/FeatureSmith/skill.md +139 -0
- package/FlexiLayout/skill.md +144 -0
- package/FlowTester/skill.md +154 -0
- package/FunctionForge/skill.md +136 -0
- package/InputShield/skill.md +144 -0
- package/IssueForge/skill.md +148 -0
- package/KubeCrafter/skill.md +149 -0
- package/LogicLens/skill.md +132 -0
- package/MockSmith/skill.md +146 -0
- package/ModelSensei/skill.md +138 -0
- package/PRMentor/skill.md +103 -0
- package/PerfDetective/skill.md +90 -0
- package/PipelinePro/skill.md +146 -0
- package/PolyglotShift/skill.md +94 -0
- package/PromptForge/skill.md +118 -0
- package/QueryPulse/skill.md +123 -0
- package/README.md +327 -216
- package/ReadMeCraft/skill.md +127 -0
- package/RefactorX/skill.md +110 -0
- package/RenderBoost/skill.md +148 -0
- package/SEOMancer/skill.md +156 -0
- package/ScrapeMaster/skill.md +157 -0
- package/SecretSniffer/skill.md +123 -0
- package/SecureScan/skill.md +130 -0
- package/ServiceSplitter/skill.md +153 -0
- package/SpeedSmith/skill.md +155 -0
- package/StackWise/skill.md +155 -0
- package/TaskOrchestrator/skill.md +135 -0
- package/TestCrafter/skill.md +158 -0
- package/TraceMind/skill.md +143 -0
- package/UISmith/skill.md +131 -0
- package/bin/cli.js +436 -0
- package/extension-extender/SKILL.md +122 -0
- package/fastapi-furious/SKILL.md +148 -0
- package/package.json +42 -32
- package/python-master/SKILL.md +108 -0
- package/react-ranger/SKILL.md +93 -0
- package/scripts/build_index.py +282 -0
- package/scripts/doctor.py +542 -0
- package/scripts/install.py +436 -0
- package/scripts/route.py +348 -0
- package/scripts/score.py +355 -0
- package/scripts/test_skill.py +501 -0
- package/scripts/validate.py +254 -0
- package/skills-routing.json +1156 -0
- package/skills.json +3389 -0
- package/cli.js +0 -181
- package/skills/APIForge/skill.md +0 -32
- package/skills/AccessPlus/skill.md +0 -32
- package/skills/AlgoMaster/skill.md +0 -32
- package/skills/Architekt AI/skill.md +0 -32
- package/skills/AuthCraft/skill.md +0 -32
- package/skills/AutoScriptor/skill.md +0 -32
- package/skills/BoilerCore/skill.md +0 -32
- package/skills/BugHunter Pro/skill.md +0 -32
- package/skills/ChangeScribe/skill.md +0 -32
- package/skills/CodeSage/skill.md +0 -32
- package/skills/CommitCraft/skill.md +0 -32
- package/skills/CoverageMax/skill.md +0 -32
- package/skills/CronGenius/skill.md +0 -32
- package/skills/DataPolish/skill.md +0 -32
- package/skills/DataWeaver/skill.md +0 -32
- package/skills/DockMaster/skill.md +0 -32
- package/skills/DocuGenie/skill.md +0 -32
- package/skills/EdgeGuard/skill.md +0 -32
- package/skills/EnvWizard/skill.md +0 -32
- package/skills/ErrorMedic/skill.md +0 -32
- package/skills/Extension-Extender/SKILL.md +0 -41
- package/skills/Extension-Extender/references/ui-guidelines.md +0 -26
- package/skills/Fastapi-Furious/README.md +0 -16
- package/skills/Fastapi-Furious/SKILL.md +0 -37
- package/skills/FeatureSmith/skill.md +0 -32
- package/skills/FlexiLayout/skill.md +0 -32
- package/skills/FlowTester/skill.md +0 -32
- package/skills/FunctionForge/skill.md +0 -32
- package/skills/InputShield/skill.md +0 -32
- package/skills/IssueForge/skill.md +0 -32
- package/skills/KubeCrafter/skill.md +0 -32
- package/skills/LogicLens/skill.md +0 -32
- package/skills/MockSmith/skill.md +0 -32
- package/skills/ModelSensei/skill.md +0 -32
- package/skills/PRMentor/skill.md +0 -32
- package/skills/PerfDetective/skill.md +0 -32
- package/skills/PipelinePro/skill.md +0 -32
- package/skills/PolyglotShift/skill.md +0 -32
- package/skills/PromptForge/skill.md +0 -32
- package/skills/Python-Master/README.md +0 -11
- package/skills/Python-Master/SKILL.md +0 -37
- package/skills/QueryPulse/skill.md +0 -32
- package/skills/React-Ranger/README.md +0 -17
- package/skills/React-Ranger/SKILL.md +0 -37
- package/skills/ReadMeCraft/skill.md +0 -32
- package/skills/RefactorX/skill.md +0 -32
- package/skills/RenderBoost/skill.md +0 -32
- package/skills/SEOMancer/skill.md +0 -32
- package/skills/ScrapeMaster/skill.md +0 -32
- package/skills/SecretSniffer/skill.md +0 -32
- package/skills/SecureScan/skill.md +0 -32
- package/skills/ServiceSplitter/skill.md +0 -32
- package/skills/SpeedSmith/skill.md +0 -32
- package/skills/StackWise/skill.md +0 -32
- package/skills/TaskOrchestrator/skill.md +0 -32
- package/skills/TestCrafter/skill.md +0 -32
- package/skills/TraceMind/skill.md +0 -32
- package/skills/UISmith/skill.md +0 -32
- /package/{skills/Extension-Extender → extension-extender}/assets/manifest.json +0 -0
- /package/{skills/Extension-Extender → extension-extender}/assets/popup.css +0 -0
- /package/{skills/Extension-Extender → extension-extender}/assets/popup.html +0 -0
- /package/{skills/Extension-Extender → extension-extender}/assets/popup.js +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: readmecraft
|
|
3
|
+
description: Write or improve README files following the standard-readme spec, with mandatory sections, shields.io badges, clear installation/usage examples, and a contribution guide. Use when a user needs a README created, reviewed, or updated for a project.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ReadMeCraft
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
ReadMeCraft produces READMEs that follow the [standard-readme spec](https://github.com/RichardLitt/standard-readme) and pass the discovery checklist — making projects immediately understandable to new visitors.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
### 1. Gather Project Context
|
|
15
|
+
|
|
16
|
+
Before writing, collect:
|
|
17
|
+
- Project name, one-line description, and primary language/framework.
|
|
18
|
+
- Install method: npm/pip/cargo/go/brew/Docker?
|
|
19
|
+
- Minimum runtime requirements (Node ≥ 20, Python ≥ 3.11, etc.).
|
|
20
|
+
- License (MIT, Apache-2.0, GPL-3.0, etc.).
|
|
21
|
+
- CI/CD platform (for badge URLs).
|
|
22
|
+
- Link to hosted demo, docs site, or package registry if available.
|
|
23
|
+
|
|
24
|
+
### 2. Apply the Standard README Structure
|
|
25
|
+
|
|
26
|
+
Produce sections in this exact order (omit only if genuinely not applicable):
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
# Project Name
|
|
30
|
+
|
|
31
|
+
[](LICENSE)
|
|
32
|
+
[](...)
|
|
33
|
+
[](...)
|
|
34
|
+
[](...)
|
|
35
|
+
|
|
36
|
+
> One-sentence description of what this project does and for whom.
|
|
37
|
+
|
|
38
|
+
## Table of Contents
|
|
39
|
+
(auto-generated or manual links for READMEs > 100 lines)
|
|
40
|
+
|
|
41
|
+
## Background
|
|
42
|
+
Why this project exists. What problem does it solve? How is it different from alternatives?
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
\`\`\`bash
|
|
46
|
+
npm install package-name # Node
|
|
47
|
+
pip install package-name # Python
|
|
48
|
+
cargo add package-name # Rust
|
|
49
|
+
\`\`\`
|
|
50
|
+
Prerequisites: list runtime versions, system dependencies (e.g., libpq-dev), env vars required.
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
\`\`\`bash
|
|
54
|
+
# Minimal working example — copy-pasteable, no placeholders left unfilled
|
|
55
|
+
package-name --input data.json --output result.json
|
|
56
|
+
\`\`\`
|
|
57
|
+
Include a second example showing a common real-world use case. For libraries, show the import + core API call.
|
|
58
|
+
|
|
59
|
+
## API (if a library)
|
|
60
|
+
Document public exports: function signatures, parameters, return types, thrown errors.
|
|
61
|
+
Use a table for options objects.
|
|
62
|
+
|
|
63
|
+
## Configuration
|
|
64
|
+
List all environment variables and config file keys in a table:
|
|
65
|
+
| Variable | Required | Default | Description |
|
|
66
|
+
|---|---|---|---|
|
|
67
|
+
|
|
68
|
+
## Contributing
|
|
69
|
+
1. Fork → `git checkout -b feat/my-feature`
|
|
70
|
+
2. Make changes + add tests.
|
|
71
|
+
3. Run `npm test` / `pytest` / `cargo test`.
|
|
72
|
+
4. Open a PR against `main`.
|
|
73
|
+
|
|
74
|
+
Link to a `CONTRIBUTING.md` if it exists; otherwise include the essentials inline.
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
[MIT](LICENSE) © Year Author
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 3. Write Effective Badges
|
|
81
|
+
|
|
82
|
+
Use `shields.io` dynamic badges (they pull live data):
|
|
83
|
+
|
|
84
|
+
```markdown
|
|
85
|
+
[](LICENSE)
|
|
86
|
+
[](...)
|
|
87
|
+
[](...)
|
|
88
|
+
[](https://npmjs.com/package/pkg)
|
|
89
|
+
[](https://pypi.org/project/pkg/)
|
|
90
|
+
[](...)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Keep badges to 4–6 maximum. Avoid badges that are always green (e.g., "built with love").
|
|
94
|
+
|
|
95
|
+
### 4. Write the Usage Section for Scanners
|
|
96
|
+
|
|
97
|
+
Most visitors scan, not read. The Usage section must:
|
|
98
|
+
- Open with a copy-pasteable command that produces visible output.
|
|
99
|
+
- Use real values, not `<YOUR_VALUE_HERE>` placeholders.
|
|
100
|
+
- Include a second, slightly more complex example.
|
|
101
|
+
- For CLIs: show `--help` output or a table of flags.
|
|
102
|
+
- For libraries: show `import` + the single most common API call.
|
|
103
|
+
|
|
104
|
+
### 5. Discovery Checklist
|
|
105
|
+
|
|
106
|
+
Before finalizing, verify:
|
|
107
|
+
- [ ] Title and one-liner description present.
|
|
108
|
+
- [ ] At least one shield badge with live status.
|
|
109
|
+
- [ ] Install instructions that work on a clean machine.
|
|
110
|
+
- [ ] Usage example that produces observable output.
|
|
111
|
+
- [ ] All required env variables documented.
|
|
112
|
+
- [ ] License section with SPDX identifier.
|
|
113
|
+
- [ ] Contributing section (even if just one sentence linking to CONTRIBUTING.md).
|
|
114
|
+
- [ ] No broken links (test with `markdown-link-check`).
|
|
115
|
+
- [ ] No placeholder text left unfilled.
|
|
116
|
+
|
|
117
|
+
## Edge Cases
|
|
118
|
+
|
|
119
|
+
**4. Multilingual README convention.** For projects serving multiple language communities, create separate files per locale: `README.md` (English, canonical), `README.zh-CN.md`, `README.es.md`, etc. At the top of each file, add a language switcher link block: `[English](README.md) | [中文](README.zh-CN.md)`. Do not use machine-translated content without human review. Keep the English README as the source of truth; other languages may lag behind minor updates.
|
|
120
|
+
|
|
121
|
+
**5. Compiled-from-source installation.** When the project requires a build step (C/C++/Rust with make/cmake), the Install section must include: system dependencies (`sudo apt-get install cmake libssl-dev`), the full build sequence (`cmake -S . -B build && cmake --build build --parallel`), and the install step (`sudo cmake --install build`). List minimum compiler versions (GCC ≥ 11, Clang ≥ 14). For CMake projects, note any required `-DCMAKE_BUILD_TYPE=Release` flags and how to run the test suite (`ctest --test-dir build`).
|
|
122
|
+
|
|
123
|
+
**1. Monorepo with multiple packages.** The root README should describe the repository structure and link to each package's own README. Do not document all packages in a single file — it becomes unmaintainable. Include a directory tree showing package layout.
|
|
124
|
+
|
|
125
|
+
**2. Internal / private project (no public registry).** Omit registry badges. Replace the Install section with internal setup instructions (e.g., Artifactory, private npm registry, SSH clone URL). Include any VPN or authentication prerequisites prominently.
|
|
126
|
+
|
|
127
|
+
**3. README for a CLI tool vs. a library vs. a service.** Tailor the Usage section: CLIs need a full flags/options table; libraries need an API reference with type signatures; services (Docker/K8s apps) need a quickstart with `docker run` / `kubectl apply` commands and a link to the full ops runbook.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactorx
|
|
3
|
+
description: Refactor code safely using Fowler's catalog of patterns (Extract Method, Replace Conditional with Polymorphism, etc.), strangler fig for legacy systems, and cyclomatic complexity reduction. Use when a user wants to clean up code, reduce technical debt, modernize a legacy system, or improve maintainability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# RefactorX
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
RefactorX applies Martin Fowler's refactoring catalog in small, verifiable, atomic steps — never changing behavior, always improving structure.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
### 1. Verify Test Coverage First (Non-Negotiable)
|
|
15
|
+
|
|
16
|
+
Refactoring without tests is rewriting. Before touching any code:
|
|
17
|
+
- Check for existing tests: unit, integration, or E2E.
|
|
18
|
+
- Run them and confirm they pass: `pytest`, `npm test`, `go test ./...`, `mvn test`.
|
|
19
|
+
- If coverage is below ~60% on the target code, write characterization tests first (tests that document current behavior, not desired behavior).
|
|
20
|
+
- If the user insists on refactoring untested code, explicitly flag the risk and document every behavioral assumption made.
|
|
21
|
+
|
|
22
|
+
### 2. Measure Complexity Baselines
|
|
23
|
+
|
|
24
|
+
Quantify the problem before fixing it:
|
|
25
|
+
- **Cyclomatic complexity**: `radon cc -s` (Python), `eslint` with `complexity` rule (JS/TS), `lizard` (polyglot), or `gocyclo` (Go). Flag functions with complexity > 10 as priority targets.
|
|
26
|
+
- **Function length**: > 40 lines is a smell; > 80 lines is a strong refactor candidate.
|
|
27
|
+
- **Dependency depth**: deeply nested imports or circular dependencies signal poor module boundaries.
|
|
28
|
+
|
|
29
|
+
### 3. Choose the Right Refactoring Pattern
|
|
30
|
+
|
|
31
|
+
Reference Fowler's *Refactoring* (2nd ed.) catalog by symptom:
|
|
32
|
+
|
|
33
|
+
| Symptom | Pattern | Action |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| Long method | **Extract Method** | Pull cohesive block into a named private function |
|
|
36
|
+
| Long parameter list | **Introduce Parameter Object** | Group related params into a struct/dataclass/record |
|
|
37
|
+
| Duplicate code | **Extract Method** + **Pull Up Method** | Create shared abstraction |
|
|
38
|
+
| Complex conditional | **Replace Conditional with Polymorphism** or **Replace Nested Conditional with Guard Clauses** | Guard clauses for preconditions; polymorphism for type-based branching |
|
|
39
|
+
| Large class | **Extract Class** | Separate responsibilities into distinct classes |
|
|
40
|
+
| Feature envy | **Move Method** | Move method to the class whose data it uses most |
|
|
41
|
+
| Primitive obsession | **Replace Primitive with Object** | Wrap domain values (Money, Email, UserId) in value objects |
|
|
42
|
+
| Speculative generality | **Collapse Hierarchy** / **Remove Dead Code** | Delete unused abstractions |
|
|
43
|
+
|
|
44
|
+
### 4. Apply the Strangler Fig Pattern for Legacy Systems
|
|
45
|
+
|
|
46
|
+
For large legacy codebases that cannot be rewritten wholesale:
|
|
47
|
+
1. Identify a single vertical slice of functionality (one endpoint, one module, one use case).
|
|
48
|
+
2. Create a new implementation alongside the old one.
|
|
49
|
+
3. Route a small percentage of traffic/calls to the new implementation.
|
|
50
|
+
4. Verify correctness via comparison testing (run both, assert same output).
|
|
51
|
+
5. Gradually shift all traffic to the new implementation.
|
|
52
|
+
6. Delete the old code.
|
|
53
|
+
|
|
54
|
+
Never attempt a "big bang" rewrite. Each strangler step should be independently deployable.
|
|
55
|
+
|
|
56
|
+
### 5. Make Atomic Changes
|
|
57
|
+
|
|
58
|
+
Each refactoring step must be:
|
|
59
|
+
- **A single logical change** (rename, extract, move — not all three at once).
|
|
60
|
+
- **Behavior-preserving**: run the test suite after each step and commit only if green.
|
|
61
|
+
- **Independently committable**: each commit should have a descriptive message referencing the pattern used.
|
|
62
|
+
|
|
63
|
+
Example — Extract Method:
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
# Before: long method with inline validation
|
|
67
|
+
def create_order(user_id, items, coupon_code):
|
|
68
|
+
if not items or len(items) > 100:
|
|
69
|
+
raise ValueError("Invalid item count")
|
|
70
|
+
if coupon_code and not re.match(r'^[A-Z0-9]{6,10}$', coupon_code):
|
|
71
|
+
raise ValueError("Invalid coupon format")
|
|
72
|
+
# ... 40 more lines of order logic
|
|
73
|
+
|
|
74
|
+
# After: extracted validation into focused methods
|
|
75
|
+
def _validate_items(items):
|
|
76
|
+
if not items or len(items) > 100:
|
|
77
|
+
raise ValueError("Invalid item count")
|
|
78
|
+
|
|
79
|
+
def _validate_coupon(coupon_code):
|
|
80
|
+
if coupon_code and not re.match(r'^[A-Z0-9]{6,10}$', coupon_code):
|
|
81
|
+
raise ValueError("Invalid coupon format")
|
|
82
|
+
|
|
83
|
+
def create_order(user_id, items, coupon_code):
|
|
84
|
+
_validate_items(items)
|
|
85
|
+
_validate_coupon(coupon_code)
|
|
86
|
+
# ... order logic, now shorter and focused
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Avoid mixing refactoring commits with feature additions or bug fixes.
|
|
90
|
+
|
|
91
|
+
### 6. Deliver the Output
|
|
92
|
+
|
|
93
|
+
Provide:
|
|
94
|
+
1. Complexity baseline (before metrics: cyclomatic complexity, line counts).
|
|
95
|
+
2. Refactoring plan: ordered list of atomic steps with the pattern name for each.
|
|
96
|
+
3. Refactored code with inline comments explaining what changed and why.
|
|
97
|
+
4. Complexity after metrics showing the improvement.
|
|
98
|
+
5. Any test additions needed to make the refactoring safe.
|
|
99
|
+
|
|
100
|
+
## Edge Cases
|
|
101
|
+
|
|
102
|
+
**4. Thread-safety implications when refactoring concurrent code.** When extracting methods or introducing shared state in multi-threaded code, audit for new data races. Extracting a block that reads and writes shared mutable state into a separate method does not automatically make it thread-safe. Check whether the original code relied on holding a lock for the duration of the block — extracting it may break the lock scope. Use tools: `ThreadSanitizer` (Go, C/C++), `mypy --warn-unreachable` + `threading` annotations (Python), or Java's `@GuardedBy` annotations to surface lock disciplines.
|
|
103
|
+
|
|
104
|
+
**5. Public API renaming and backward compatibility.** Renaming a public symbol (function, class, module) is a breaking change. Apply the deprecation wrapper pattern: keep the old name, delegate to the new one, and emit a deprecation warning (`warnings.warn(..., DeprecationWarning, stacklevel=2)` in Python; `@Deprecated` in Java; `/** @deprecated */` JSDoc in TypeScript). Bump the semver minor version for deprecation, major version for removal. Document the removal timeline in the changelog and migration guide.
|
|
105
|
+
|
|
106
|
+
**1. Refactoring changes observable behavior due to subtle side effects.** Functions that appear pure may mutate shared state, depend on global variables, or have side effects through ORM/cache interactions. Before extracting, verify that the extracted code has no hidden dependencies. Use characterization tests to lock in the exact output including side effects.
|
|
107
|
+
|
|
108
|
+
**2. Legacy code with framework magic (e.g., Django signals, Rails callbacks, Spring AOP).** Lifecycle hooks and aspect-oriented code can make behavior non-obvious. Map all hooks attached to the classes being refactored before moving or renaming them. Missing a `before_save` callback or `@aspect` can silently break business logic.
|
|
109
|
+
|
|
110
|
+
**3. Cyclomatic complexity reduction leads to over-abstraction.** Splitting a 15-condition function into 15 tiny single-condition classes can make code harder to follow, not easier. Apply the Single Responsibility Principle at a meaningful granularity — group related conditions into 2–4 cohesive abstractions, not one class per condition. Prefer readability over metric compliance.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: renderboost
|
|
3
|
+
description: Optimize frontend rendering performance by improving Core Web Vitals (LCP, CLS, INP), reducing reflows/repaints, and applying lazy loading, IntersectionObserver, and requestAnimationFrame patterns. Use when a user needs to improve page speed, fix janky animations, or boost Lighthouse scores.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# RenderBoost
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
RenderBoost diagnoses and fixes frontend rendering bottlenecks using measurement-first methodology, Core Web Vitals targets, and browser-native performance APIs.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
### 1. Measure First — Always
|
|
15
|
+
|
|
16
|
+
Never optimize without a baseline. Collect real metrics before making any changes:
|
|
17
|
+
|
|
18
|
+
**Lab measurements (Lighthouse / WebPageTest):**
|
|
19
|
+
```bash
|
|
20
|
+
npx lighthouse https://example.com --output html --output-path report.html
|
|
21
|
+
# Or via Chrome DevTools: Lighthouse tab → Mobile preset → Analyze page load
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Field data (Chrome User Experience Report / web-vitals library):**
|
|
25
|
+
```js
|
|
26
|
+
import { onLCP, onCLS, onINP } from 'web-vitals';
|
|
27
|
+
onLCP(console.log);
|
|
28
|
+
onCLS(console.log);
|
|
29
|
+
onINP(console.log);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Target thresholds (Google "Good" tier):**
|
|
33
|
+
| Metric | Good | Needs Improvement | Poor |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| LCP (Largest Contentful Paint) | ≤ 2.5s | ≤ 4.0s | > 4.0s |
|
|
36
|
+
| CLS (Cumulative Layout Shift) | ≤ 0.1 | ≤ 0.25 | > 0.25 |
|
|
37
|
+
| INP (Interaction to Next Paint) | ≤ 200ms | ≤ 500ms | > 500ms |
|
|
38
|
+
|
|
39
|
+
### 2. Diagnose the Bottleneck
|
|
40
|
+
|
|
41
|
+
Open Chrome DevTools → Performance tab → Record a page load or interaction.
|
|
42
|
+
|
|
43
|
+
**LCP bottlenecks** (slow largest image/text paint):
|
|
44
|
+
- Network: large unoptimized hero image; missing `<link rel="preload">` for above-the-fold image.
|
|
45
|
+
- Render-blocking: CSS/JS in `<head>` without `defer`/`async`.
|
|
46
|
+
- TTFB: slow server response; missing CDN caching.
|
|
47
|
+
|
|
48
|
+
**CLS bottlenecks** (unexpected layout shifts):
|
|
49
|
+
- Images without explicit `width`/`height` attributes (or `aspect-ratio` CSS).
|
|
50
|
+
- Fonts causing FOUT/FOIT: missing `font-display: optional` or `swap`.
|
|
51
|
+
- Dynamically injected banners/ads above existing content.
|
|
52
|
+
- Late-loading iframes without reserved space.
|
|
53
|
+
|
|
54
|
+
**INP bottlenecks** (slow input response):
|
|
55
|
+
- Long tasks (> 50ms) on the main thread blocking input processing.
|
|
56
|
+
- Synchronous DOM reads that force reflow (`offsetHeight`, `getBoundingClientRect`) inside event handlers.
|
|
57
|
+
- Heavy React re-renders triggered by every keystroke.
|
|
58
|
+
|
|
59
|
+
### 3. Apply Targeted Fixes
|
|
60
|
+
|
|
61
|
+
**LCP — Image optimization:**
|
|
62
|
+
```html
|
|
63
|
+
<!-- Add width/height, use WebP/AVIF, preload the LCP image -->
|
|
64
|
+
<link rel="preload" as="image" href="hero.webp" fetchpriority="high">
|
|
65
|
+
<img src="hero.webp" width="1200" height="600" loading="eager" decoding="async">
|
|
66
|
+
|
|
67
|
+
<!-- Lazy load below-the-fold images -->
|
|
68
|
+
<img src="card.webp" loading="lazy" decoding="async" width="400" height="300">
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**LCP — Critical resource loading:**
|
|
72
|
+
```html
|
|
73
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
74
|
+
<link rel="preload" href="/fonts/Inter.woff2" as="font" crossorigin>
|
|
75
|
+
<script src="app.js" defer></script> <!-- non-critical JS -->
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**CLS — Reserve layout space:**
|
|
79
|
+
```css
|
|
80
|
+
/* Always set aspect-ratio on image containers */
|
|
81
|
+
.hero-image { aspect-ratio: 16 / 9; width: 100%; }
|
|
82
|
+
|
|
83
|
+
/* Fonts */
|
|
84
|
+
@font-face { font-display: optional; } /* for CLS=0 */
|
|
85
|
+
/* or font-display: swap; for visibility at cost of slight shift */
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**INP — Break up long tasks:**
|
|
89
|
+
```js
|
|
90
|
+
// Replace synchronous loops with yielding chunks
|
|
91
|
+
async function processLargeList(items) {
|
|
92
|
+
for (let i = 0; i < items.length; i++) {
|
|
93
|
+
processItem(items[i]);
|
|
94
|
+
if (i % 50 === 0) {
|
|
95
|
+
await new Promise(resolve => setTimeout(resolve, 0)); // yield to browser
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Or use scheduler.postTask() (Chrome 94+)
|
|
101
|
+
scheduler.postTask(() => heavyWork(), { priority: 'background' });
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Reflow/repaint reduction:** Batch all DOM reads before writes. Reading `offsetHeight` then immediately writing `style.height` in a loop causes layout thrash — collect all reads first, then do all writes.
|
|
105
|
+
|
|
106
|
+
**Lazy loading with IntersectionObserver:** Use `rootMargin: '200px'` to preload images 200px before they enter the viewport. Call `observer.unobserve(img)` after loading to free resources.
|
|
107
|
+
|
|
108
|
+
**Animation on the compositor thread (no reflow):**
|
|
109
|
+
```css
|
|
110
|
+
/* Use transform and opacity — these run on GPU compositor, not main thread */
|
|
111
|
+
.slide-in { transform: translateX(-100%); transition: transform 0.3s ease; }
|
|
112
|
+
.slide-in.active { transform: translateX(0); }
|
|
113
|
+
|
|
114
|
+
/* Add will-change for elements that animate frequently */
|
|
115
|
+
.animated { will-change: transform; }
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Use `requestAnimationFrame` for JS-driven animations:
|
|
119
|
+
```js
|
|
120
|
+
function animate(timestamp) {
|
|
121
|
+
element.style.transform = `translateX(${calcPosition(timestamp)}px)`;
|
|
122
|
+
requestAnimationFrame(animate);
|
|
123
|
+
}
|
|
124
|
+
requestAnimationFrame(animate);
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 4. Deliver the Output
|
|
128
|
+
|
|
129
|
+
Provide:
|
|
130
|
+
1. Baseline metrics (Lighthouse scores, specific CWV values with units).
|
|
131
|
+
2. Root cause for each metric that misses the "Good" threshold.
|
|
132
|
+
3. Code changes with before/after snippets.
|
|
133
|
+
4. Verification steps: which Lighthouse audit or DevTools panel to use to confirm the fix.
|
|
134
|
+
5. Expected metric improvement (estimate based on the type of fix).
|
|
135
|
+
|
|
136
|
+
## Edge Cases
|
|
137
|
+
|
|
138
|
+
**1. CLS caused by third-party embeds.** Wrap ads/chat widgets in a container with explicit `min-height` and `width`, and load them after the `load` event or via `IntersectionObserver`.
|
|
139
|
+
|
|
140
|
+
**2. INP is high only on low-end mobile devices.** Use Chrome DevTools CPU throttling (6× slowdown) to reproduce. Fix: code-split large JS bundles and defer non-critical analytics scripts.
|
|
141
|
+
|
|
142
|
+
**3. LCP element changes based on personalization.** Use a skeleton screen with a reserved container. Fetch the personalized image with `fetchpriority="high"` as soon as JS knows which variant to show.
|
|
143
|
+
|
|
144
|
+
**4. Service Worker cache invalidation.** Call `self.skipWaiting()` inside `install` to activate the new SW immediately, then `clients.claim()` in `activate`. Version your cache names (`cache-v2`) and delete old caches in `activate`. Without this, stale assets persist until the user closes all tabs.
|
|
145
|
+
|
|
146
|
+
**5. `<video>` as a CLS source.** Video elements without explicit `width` and `height` attributes (or `aspect-ratio` CSS) cause layout shifts when metadata loads. Always set both attributes or use `.video-container { aspect-ratio: 16/9; }` with `width: 100%`.
|
|
147
|
+
|
|
148
|
+
**6. React hydration INP.** Server-rendered HTML that hydrates synchronously blocks the main thread. Use `startTransition` to defer non-critical state updates during hydration. With React 18 selective hydration (`<Suspense>`), interactive components hydrate first on user interaction, reducing INP on content-heavy pages.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: seomancer
|
|
3
|
+
description: Optimizes technical SEO including structured data (JSON-LD/Schema.org), meta tags, Open Graph, canonical/hreflang tags, Core Web Vitals, and crawlability. Use when asked to audit SEO, fix meta tags, add structured data, improve Lighthouse scores, or configure robots.txt/sitemap.xml.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SEOMancer
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Diagnoses and fixes technical SEO issues across on-page metadata, structured data markup, crawl configuration, internationalization signals, and Core Web Vitals. Every recommendation is grounded in Google Search Central documentation, Schema.org specifications, and measurable Lighthouse/CrUX metrics.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
### 1. Audit Scope Assessment
|
|
15
|
+
|
|
16
|
+
Determine which SEO layers need attention:
|
|
17
|
+
- **Crawlability**: robots.txt, sitemap.xml, canonical tags, noindex/nofollow directives
|
|
18
|
+
- **On-page metadata**: `<title>`, `<meta name="description">`, hreflang, canonical
|
|
19
|
+
- **Social/Open Graph**: og:title, og:description, og:image, og:url, Twitter Card tags
|
|
20
|
+
- **Structured data**: JSON-LD Schema.org markup (Organization, Article, Product, BreadcrumbList, FAQPage, etc.)
|
|
21
|
+
- **Core Web Vitals**: LCP, INP, CLS — measure first with Lighthouse or PageSpeed Insights API
|
|
22
|
+
- **International SEO**: hreflang attributes, language/region targeting
|
|
23
|
+
|
|
24
|
+
Run Lighthouse CLI for baseline: `npx lighthouse https://example.com --output=json --output-path=report.json`
|
|
25
|
+
|
|
26
|
+
### 2. On-Page Metadata Standards
|
|
27
|
+
|
|
28
|
+
Every page must have:
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<!-- Primary SEO -->
|
|
32
|
+
<title>Primary Keyword – Brand Name</title> <!-- 50-60 chars -->
|
|
33
|
+
<meta name="description" content="..."> <!-- 120-158 chars, include CTA -->
|
|
34
|
+
<link rel="canonical" href="https://example.com/page/">
|
|
35
|
+
|
|
36
|
+
<!-- Open Graph (Facebook, LinkedIn) -->
|
|
37
|
+
<meta property="og:type" content="website">
|
|
38
|
+
<meta property="og:title" content="...">
|
|
39
|
+
<meta property="og:description" content="...">
|
|
40
|
+
<meta property="og:image" content="https://example.com/og-image.jpg"> <!-- 1200x630px -->
|
|
41
|
+
<meta property="og:url" content="https://example.com/page/">
|
|
42
|
+
|
|
43
|
+
<!-- Twitter Card -->
|
|
44
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
45
|
+
<meta name="twitter:title" content="...">
|
|
46
|
+
<meta name="twitter:description" content="...">
|
|
47
|
+
<meta name="twitter:image" content="https://example.com/twitter-image.jpg">
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Rules:
|
|
51
|
+
- Title: unique per page, primary keyword near the front, brand suffix separated by `–` or `|`.
|
|
52
|
+
- Description: not a ranking factor but affects CTR; include the target keyword naturally.
|
|
53
|
+
- Never use the same canonical URL on two different pages with different content.
|
|
54
|
+
|
|
55
|
+
### 3. Structured Data (JSON-LD)
|
|
56
|
+
|
|
57
|
+
Prefer JSON-LD over Microdata. Place in `<head>` or end of `<body>`. Validate with Google's Rich Results Test.
|
|
58
|
+
|
|
59
|
+
**Article example** (for blog posts):
|
|
60
|
+
```json
|
|
61
|
+
<script type="application/ld+json">
|
|
62
|
+
{
|
|
63
|
+
"@context": "https://schema.org",
|
|
64
|
+
"@type": "Article",
|
|
65
|
+
"headline": "Page Title Here",
|
|
66
|
+
"datePublished": "2024-01-15T08:00:00+00:00",
|
|
67
|
+
"dateModified": "2024-03-20T10:00:00+00:00",
|
|
68
|
+
"author": { "@type": "Person", "name": "Author Name" },
|
|
69
|
+
"publisher": {
|
|
70
|
+
"@type": "Organization",
|
|
71
|
+
"name": "Brand Name",
|
|
72
|
+
"logo": { "@type": "ImageObject", "url": "https://example.com/logo.png" }
|
|
73
|
+
},
|
|
74
|
+
"image": "https://example.com/featured.jpg"
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**BreadcrumbList** (for navigational context):
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"@type": "BreadcrumbList",
|
|
83
|
+
"itemListElement": [
|
|
84
|
+
{ "@type": "ListItem", "position": 1, "name": "Home", "item": "https://example.com/" },
|
|
85
|
+
{ "@type": "ListItem", "position": 2, "name": "Blog", "item": "https://example.com/blog/" },
|
|
86
|
+
{ "@type": "ListItem", "position": 3, "name": "Article Title" }
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Schema types by page intent: `Product` + `Review` + `AggregateRating` for e-commerce, `FAQPage` for FAQ sections, `HowTo` for tutorials, `LocalBusiness` for location pages, `Event` for events.
|
|
92
|
+
|
|
93
|
+
### 4. Crawlability Configuration
|
|
94
|
+
|
|
95
|
+
**robots.txt** rules:
|
|
96
|
+
```
|
|
97
|
+
User-agent: *
|
|
98
|
+
Disallow: /admin/
|
|
99
|
+
Disallow: /api/
|
|
100
|
+
Disallow: /?* # Block faceted URLs if not canonical
|
|
101
|
+
Allow: /
|
|
102
|
+
|
|
103
|
+
Sitemap: https://example.com/sitemap.xml
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**sitemap.xml** requirements:
|
|
107
|
+
- Max 50,000 URLs or 50MB per sitemap file; use sitemap index for larger sites.
|
|
108
|
+
- Include `<lastmod>` in ISO 8601 format; omit `<changefreq>` and `<priority>` (Google ignores them).
|
|
109
|
+
- Exclude noindex pages, paginated pages (except page 1), and URLs with canonical pointing elsewhere.
|
|
110
|
+
- Submit to Google Search Console and Bing Webmaster Tools.
|
|
111
|
+
|
|
112
|
+
### 5. Hreflang for Internationalization
|
|
113
|
+
|
|
114
|
+
For multilingual/multiregional sites:
|
|
115
|
+
```html
|
|
116
|
+
<link rel="alternate" hreflang="en-us" href="https://example.com/en-us/page/">
|
|
117
|
+
<link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/page/">
|
|
118
|
+
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page/">
|
|
119
|
+
<link rel="alternate" hreflang="x-default" href="https://example.com/page/">
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Rules: hreflang must be reciprocal (each URL in the set must reference all others). Use ISO 639-1 language + ISO 3166-1 region codes. `x-default` points to the language-selector or fallback page.
|
|
123
|
+
|
|
124
|
+
### 6. Core Web Vitals Targets
|
|
125
|
+
|
|
126
|
+
| Metric | Good | Needs Improvement | Poor |
|
|
127
|
+
|--------|------|-------------------|------|
|
|
128
|
+
| LCP (Largest Contentful Paint) | ≤ 2.5s | 2.5–4.0s | > 4.0s |
|
|
129
|
+
| INP (Interaction to Next Paint) | ≤ 200ms | 200–500ms | > 500ms |
|
|
130
|
+
| CLS (Cumulative Layout Shift) | ≤ 0.1 | 0.1–0.25 | > 0.25 |
|
|
131
|
+
|
|
132
|
+
LCP fixes: preload hero image (`<link rel="preload" as="image">`), use `fetchpriority="high"` on LCP image, eliminate render-blocking resources.
|
|
133
|
+
|
|
134
|
+
CLS fixes: set explicit `width`/`height` on images and iframes, avoid inserting DOM above existing content, use `font-display: optional` or `swap` with `size-adjust`.
|
|
135
|
+
|
|
136
|
+
INP fixes: break up long tasks with `scheduler.yield()`, defer non-critical JS, move heavy computation to Web Workers.
|
|
137
|
+
|
|
138
|
+
### 7. Output Artifacts
|
|
139
|
+
|
|
140
|
+
Produce:
|
|
141
|
+
1. **Audit findings table**: URL, issue type, severity (Critical/High/Medium/Low), current value, recommended value.
|
|
142
|
+
2. **Ready-to-paste code snippets** for each fix (meta tags, JSON-LD, robots.txt entries).
|
|
143
|
+
3. **Lighthouse score delta estimate** where measurable.
|
|
144
|
+
4. **Search Console monitoring checklist**: coverage errors to resolve, enhancements to validate.
|
|
145
|
+
|
|
146
|
+
## Edge Cases
|
|
147
|
+
|
|
148
|
+
**JavaScript-rendered content**: Googlebot renders JS but with a delay. Critical metadata and structured data must be in the initial HTML response (SSR or SSG), not injected after hydration. Use `next/head`, Nuxt's `useHead()`, or equivalent server-side head management.
|
|
149
|
+
|
|
150
|
+
**Canonicalization conflicts**: A page may have conflicting signals (canonical tag says URL A, but sitemap lists URL B, and internal links point to URL C). Audit all three signals and make them consistent. The canonical tag is the strongest signal but Google may override it.
|
|
151
|
+
|
|
152
|
+
**Paginated series**: Use `?page=N` with self-referencing canonicals on each paginated page. Only include page 1 in sitemaps.
|
|
153
|
+
|
|
154
|
+
**Site migration SEO:** Before launch, build a 1:1 redirect map from old URLs to new URLs. Implement 301 redirects (not 302). After launch, monitor Google Search Console → Coverage and URL Inspection weekly for 90 days. Watch for index drops, crawl errors, and lost impressions. Preserve backlink equity: never redirect an old high-authority URL to the homepage — redirect to the closest equivalent page.
|
|
155
|
+
|
|
156
|
+
**Programmatic meta generation at scale:** For sites with thousands of pages (e-commerce, real estate, directories), generate `<title>` and `<meta name="description">` from templates using page-specific data fields: `"{Category} {Brand} – Buy Online | {SiteName}"`. Ensure no two pages share identical meta. Set up automated checks (`sitemap.xml` fetch + scrape) to detect duplicate or missing tags across the full page set.
|