cp-toolkit 2.0.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.
- package/README.md +130 -0
- package/bin/cp-kit.js +72 -0
- package/package.json +46 -0
- package/src/commands/add.js +212 -0
- package/src/commands/doctor.js +149 -0
- package/src/commands/init.js +662 -0
- package/src/commands/list.js +128 -0
- package/src/index.js +13 -0
- package/templates/agents/backend-specialist.md +263 -0
- package/templates/agents/code-archaeologist.md +106 -0
- package/templates/agents/database-architect.md +226 -0
- package/templates/agents/debugger.md +225 -0
- package/templates/agents/devops-engineer.md +242 -0
- package/templates/agents/documentation-writer.md +104 -0
- package/templates/agents/explorer-agent.md +73 -0
- package/templates/agents/frontend-specialist.md +556 -0
- package/templates/agents/game-developer.md +162 -0
- package/templates/agents/mobile-developer.md +377 -0
- package/templates/agents/orchestrator.md +416 -0
- package/templates/agents/penetration-tester.md +188 -0
- package/templates/agents/performance-optimizer.md +187 -0
- package/templates/agents/product-manager.md +112 -0
- package/templates/agents/product-owner.md +95 -0
- package/templates/agents/project-planner.md +406 -0
- package/templates/agents/qa-automation-engineer.md +103 -0
- package/templates/agents/security-auditor.md +170 -0
- package/templates/agents/seo-specialist.md +111 -0
- package/templates/agents/test-engineer.md +158 -0
- package/templates/github/agents/backend-specialist.md +67 -0
- package/templates/github/agents/code-archaeologist.md +61 -0
- package/templates/github/agents/database-architect.md +73 -0
- package/templates/github/agents/debugger.md +71 -0
- package/templates/github/agents/devops-engineer.md +85 -0
- package/templates/github/agents/documentation-writer.md +107 -0
- package/templates/github/agents/explorer-agent.md +87 -0
- package/templates/github/agents/frontend-specialist.md +54 -0
- package/templates/github/agents/game-developer.md +94 -0
- package/templates/github/agents/mobile-developer.md +75 -0
- package/templates/github/agents/orchestrator.md +48 -0
- package/templates/github/agents/penetration-tester.md +87 -0
- package/templates/github/agents/performance-optimizer.md +70 -0
- package/templates/github/agents/product-manager.md +85 -0
- package/templates/github/agents/product-owner.md +77 -0
- package/templates/github/agents/project-planner.md +83 -0
- package/templates/github/agents/qa-automation-engineer.md +95 -0
- package/templates/github/agents/security-auditor.md +72 -0
- package/templates/github/agents/seo-specialist.md +78 -0
- package/templates/github/agents/test-engineer.md +79 -0
- package/templates/github/instructions/database.instructions.md +74 -0
- package/templates/github/instructions/python.instructions.md +76 -0
- package/templates/github/instructions/security.instructions.md +73 -0
- package/templates/github/instructions/typescript.instructions.md +50 -0
- package/templates/rules/GEMINI.md +273 -0
- package/templates/scripts/mcp-server.js +704 -0
- package/templates/skills/core/behavioral-modes/SKILL.md +242 -0
- package/templates/skills/core/brainstorming/SKILL.md +163 -0
- package/templates/skills/core/brainstorming/dynamic-questioning.md +350 -0
- package/templates/skills/core/clean-code/SKILL.md +201 -0
- package/templates/skills/core/intelligent-routing/SKILL.md +335 -0
- package/templates/skills/core/mcp-builder/SKILL.md +176 -0
- package/templates/skills/core/parallel-agents/SKILL.md +175 -0
- package/templates/skills/core/plan-writing/SKILL.md +152 -0
- package/templates/skills/optional/api-patterns/SKILL.md +81 -0
- package/templates/skills/optional/api-patterns/api-style.md +42 -0
- package/templates/skills/optional/api-patterns/auth.md +24 -0
- package/templates/skills/optional/api-patterns/documentation.md +26 -0
- package/templates/skills/optional/api-patterns/graphql.md +41 -0
- package/templates/skills/optional/api-patterns/rate-limiting.md +31 -0
- package/templates/skills/optional/api-patterns/response.md +37 -0
- package/templates/skills/optional/api-patterns/rest.md +40 -0
- package/templates/skills/optional/api-patterns/scripts/api_validator.py +211 -0
- package/templates/skills/optional/api-patterns/security-testing.md +122 -0
- package/templates/skills/optional/api-patterns/trpc.md +41 -0
- package/templates/skills/optional/api-patterns/versioning.md +22 -0
- package/templates/skills/optional/app-builder/SKILL.md +75 -0
- package/templates/skills/optional/app-builder/agent-coordination.md +71 -0
- package/templates/skills/optional/app-builder/feature-building.md +53 -0
- package/templates/skills/optional/app-builder/project-detection.md +34 -0
- package/templates/skills/optional/app-builder/scaffolding.md +118 -0
- package/templates/skills/optional/app-builder/tech-stack.md +40 -0
- package/templates/skills/optional/app-builder/templates/SKILL.md +39 -0
- package/templates/skills/optional/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/templates/skills/optional/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/templates/skills/optional/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/templates/skills/optional/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/templates/skills/optional/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/templates/skills/optional/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/templates/skills/optional/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/templates/skills/optional/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/templates/skills/optional/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/templates/skills/optional/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/templates/skills/optional/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/templates/skills/optional/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/templates/skills/optional/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/templates/skills/optional/architecture/SKILL.md +55 -0
- package/templates/skills/optional/architecture/context-discovery.md +43 -0
- package/templates/skills/optional/architecture/examples.md +94 -0
- package/templates/skills/optional/architecture/pattern-selection.md +68 -0
- package/templates/skills/optional/architecture/patterns-reference.md +50 -0
- package/templates/skills/optional/architecture/trade-off-analysis.md +77 -0
- package/templates/skills/optional/bash-linux/SKILL.md +199 -0
- package/templates/skills/optional/code-review-checklist/SKILL.md +109 -0
- package/templates/skills/optional/database-design/SKILL.md +52 -0
- package/templates/skills/optional/database-design/database-selection.md +43 -0
- package/templates/skills/optional/database-design/indexing.md +39 -0
- package/templates/skills/optional/database-design/migrations.md +48 -0
- package/templates/skills/optional/database-design/optimization.md +36 -0
- package/templates/skills/optional/database-design/orm-selection.md +30 -0
- package/templates/skills/optional/database-design/schema-design.md +56 -0
- package/templates/skills/optional/database-design/scripts/schema_validator.py +172 -0
- package/templates/skills/optional/deployment-procedures/SKILL.md +241 -0
- package/templates/skills/optional/documentation-templates/SKILL.md +194 -0
- package/templates/skills/optional/frontend-design/SKILL.md +418 -0
- package/templates/skills/optional/frontend-design/animation-guide.md +331 -0
- package/templates/skills/optional/frontend-design/color-system.md +311 -0
- package/templates/skills/optional/frontend-design/decision-trees.md +418 -0
- package/templates/skills/optional/frontend-design/motion-graphics.md +306 -0
- package/templates/skills/optional/frontend-design/scripts/accessibility_checker.py +183 -0
- package/templates/skills/optional/frontend-design/scripts/ux_audit.py +722 -0
- package/templates/skills/optional/frontend-design/typography-system.md +345 -0
- package/templates/skills/optional/frontend-design/ux-psychology.md +541 -0
- package/templates/skills/optional/frontend-design/visual-effects.md +383 -0
- package/templates/skills/optional/game-development/2d-games/SKILL.md +119 -0
- package/templates/skills/optional/game-development/3d-games/SKILL.md +135 -0
- package/templates/skills/optional/game-development/SKILL.md +167 -0
- package/templates/skills/optional/game-development/game-art/SKILL.md +185 -0
- package/templates/skills/optional/game-development/game-audio/SKILL.md +190 -0
- package/templates/skills/optional/game-development/game-design/SKILL.md +129 -0
- package/templates/skills/optional/game-development/mobile-games/SKILL.md +108 -0
- package/templates/skills/optional/game-development/multiplayer/SKILL.md +132 -0
- package/templates/skills/optional/game-development/pc-games/SKILL.md +144 -0
- package/templates/skills/optional/game-development/vr-ar/SKILL.md +123 -0
- package/templates/skills/optional/game-development/web-games/SKILL.md +150 -0
- package/templates/skills/optional/geo-fundamentals/SKILL.md +156 -0
- package/templates/skills/optional/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/templates/skills/optional/i18n-localization/SKILL.md +154 -0
- package/templates/skills/optional/i18n-localization/scripts/i18n_checker.py +241 -0
- package/templates/skills/optional/lint-and-validate/SKILL.md +45 -0
- package/templates/skills/optional/lint-and-validate/scripts/lint_runner.py +172 -0
- package/templates/skills/optional/lint-and-validate/scripts/type_coverage.py +173 -0
- package/templates/skills/optional/mobile-design/SKILL.md +394 -0
- package/templates/skills/optional/mobile-design/decision-trees.md +516 -0
- package/templates/skills/optional/mobile-design/mobile-backend.md +491 -0
- package/templates/skills/optional/mobile-design/mobile-color-system.md +420 -0
- package/templates/skills/optional/mobile-design/mobile-debugging.md +122 -0
- package/templates/skills/optional/mobile-design/mobile-design-thinking.md +357 -0
- package/templates/skills/optional/mobile-design/mobile-navigation.md +458 -0
- package/templates/skills/optional/mobile-design/mobile-performance.md +767 -0
- package/templates/skills/optional/mobile-design/mobile-testing.md +356 -0
- package/templates/skills/optional/mobile-design/mobile-typography.md +433 -0
- package/templates/skills/optional/mobile-design/platform-android.md +666 -0
- package/templates/skills/optional/mobile-design/platform-ios.md +561 -0
- package/templates/skills/optional/mobile-design/scripts/mobile_audit.py +670 -0
- package/templates/skills/optional/mobile-design/touch-psychology.md +537 -0
- package/templates/skills/optional/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/templates/skills/optional/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/templates/skills/optional/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/templates/skills/optional/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/templates/skills/optional/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/templates/skills/optional/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/templates/skills/optional/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/templates/skills/optional/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/templates/skills/optional/nextjs-react-expert/SKILL.md +267 -0
- package/templates/skills/optional/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/templates/skills/optional/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/templates/skills/optional/nodejs-best-practices/SKILL.md +333 -0
- package/templates/skills/optional/performance-profiling/SKILL.md +143 -0
- package/templates/skills/optional/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/templates/skills/optional/powershell-windows/SKILL.md +167 -0
- package/templates/skills/optional/python-patterns/SKILL.md +441 -0
- package/templates/skills/optional/red-team-tactics/SKILL.md +199 -0
- package/templates/skills/optional/seo-fundamentals/SKILL.md +129 -0
- package/templates/skills/optional/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/templates/skills/optional/server-management/SKILL.md +161 -0
- package/templates/skills/optional/systematic-debugging/SKILL.md +109 -0
- package/templates/skills/optional/tailwind-patterns/SKILL.md +269 -0
- package/templates/skills/optional/tdd-workflow/SKILL.md +149 -0
- package/templates/skills/optional/testing-patterns/SKILL.md +178 -0
- package/templates/skills/optional/testing-patterns/scripts/test_runner.py +219 -0
- package/templates/skills/optional/vulnerability-scanner/SKILL.md +276 -0
- package/templates/skills/optional/vulnerability-scanner/checklists.md +121 -0
- package/templates/skills/optional/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/templates/skills/optional/web-design-guidelines/SKILL.md +57 -0
- package/templates/skills/optional/webapp-testing/SKILL.md +187 -0
- package/templates/skills/optional/webapp-testing/scripts/playwright_runner.py +173 -0
- package/templates/workflows/brainstorm.md +113 -0
- package/templates/workflows/create.md +59 -0
- package/templates/workflows/debug.md +103 -0
- package/templates/workflows/deploy.md +176 -0
- package/templates/workflows/enhance.md +63 -0
- package/templates/workflows/orchestrate.md +237 -0
- package/templates/workflows/plan.md +89 -0
- package/templates/workflows/preview.md +81 -0
- package/templates/workflows/status.md +86 -0
- package/templates/workflows/test.md +144 -0
- package/templates/workflows/ui-ux-pro-max.md +296 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: seo-fundamentals
|
|
3
|
+
description: SEO fundamentals, E-E-A-T, Core Web Vitals, and Google algorithm principles.
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SEO Fundamentals
|
|
8
|
+
|
|
9
|
+
> Principles for search engine visibility.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. E-E-A-T Framework
|
|
14
|
+
|
|
15
|
+
| Principle | Signals |
|
|
16
|
+
|-----------|---------|
|
|
17
|
+
| **Experience** | First-hand knowledge, real examples |
|
|
18
|
+
| **Expertise** | Credentials, depth of knowledge |
|
|
19
|
+
| **Authoritativeness** | Backlinks, mentions, industry recognition |
|
|
20
|
+
| **Trustworthiness** | HTTPS, transparency, accurate info |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Core Web Vitals
|
|
25
|
+
|
|
26
|
+
| Metric | Target | Measures |
|
|
27
|
+
|--------|--------|----------|
|
|
28
|
+
| **LCP** | < 2.5s | Loading performance |
|
|
29
|
+
| **INP** | < 200ms | Interactivity |
|
|
30
|
+
| **CLS** | < 0.1 | Visual stability |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 3. Technical SEO Principles
|
|
35
|
+
|
|
36
|
+
### Site Structure
|
|
37
|
+
|
|
38
|
+
| Element | Purpose |
|
|
39
|
+
|---------|---------|
|
|
40
|
+
| XML sitemap | Help crawling |
|
|
41
|
+
| robots.txt | Control access |
|
|
42
|
+
| Canonical tags | Prevent duplicates |
|
|
43
|
+
| HTTPS | Security signal |
|
|
44
|
+
|
|
45
|
+
### Performance
|
|
46
|
+
|
|
47
|
+
| Factor | Impact |
|
|
48
|
+
|--------|--------|
|
|
49
|
+
| Page speed | Core Web Vital |
|
|
50
|
+
| Mobile-friendly | Ranking factor |
|
|
51
|
+
| Clean URLs | Crawlability |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 4. Content SEO Principles
|
|
56
|
+
|
|
57
|
+
### Page Elements
|
|
58
|
+
|
|
59
|
+
| Element | Best Practice |
|
|
60
|
+
|---------|---------------|
|
|
61
|
+
| Title tag | 50-60 chars, keyword front |
|
|
62
|
+
| Meta description | 150-160 chars, compelling |
|
|
63
|
+
| H1 | One per page, main keyword |
|
|
64
|
+
| H2-H6 | Logical hierarchy |
|
|
65
|
+
| Alt text | Descriptive, not stuffed |
|
|
66
|
+
|
|
67
|
+
### Content Quality
|
|
68
|
+
|
|
69
|
+
| Factor | Importance |
|
|
70
|
+
|--------|------------|
|
|
71
|
+
| Depth | Comprehensive coverage |
|
|
72
|
+
| Freshness | Regular updates |
|
|
73
|
+
| Uniqueness | Original value |
|
|
74
|
+
| Readability | Clear writing |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 5. Schema Markup Types
|
|
79
|
+
|
|
80
|
+
| Type | Use |
|
|
81
|
+
|------|-----|
|
|
82
|
+
| Article | Blog posts, news |
|
|
83
|
+
| Organization | Company info |
|
|
84
|
+
| Person | Author profiles |
|
|
85
|
+
| FAQPage | Q&A content |
|
|
86
|
+
| Product | E-commerce |
|
|
87
|
+
| Review | Ratings |
|
|
88
|
+
| BreadcrumbList | Navigation |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 6. AI Content Guidelines
|
|
93
|
+
|
|
94
|
+
### What Google Looks For
|
|
95
|
+
|
|
96
|
+
| ✅ Do | ❌ Don't |
|
|
97
|
+
|-------|----------|
|
|
98
|
+
| AI draft + human edit | Publish raw AI content |
|
|
99
|
+
| Add original insights | Copy without value |
|
|
100
|
+
| Expert review | Skip fact-checking |
|
|
101
|
+
| Follow E-E-A-T | Keyword stuffing |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 7. Ranking Factors (Prioritized)
|
|
106
|
+
|
|
107
|
+
| Priority | Factor |
|
|
108
|
+
|----------|--------|
|
|
109
|
+
| 1 | Quality, relevant content |
|
|
110
|
+
| 2 | Backlinks from authority sites |
|
|
111
|
+
| 3 | Page experience (Core Web Vitals) |
|
|
112
|
+
| 4 | Mobile optimization |
|
|
113
|
+
| 5 | Technical SEO fundamentals |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 8. Measurement
|
|
118
|
+
|
|
119
|
+
| Metric | Tool |
|
|
120
|
+
|--------|------|
|
|
121
|
+
| Rankings | Search Console, Ahrefs |
|
|
122
|
+
| Traffic | Analytics |
|
|
123
|
+
| Core Web Vitals | PageSpeed Insights |
|
|
124
|
+
| Indexing | Search Console |
|
|
125
|
+
| Backlinks | Ahrefs, Semrush |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
> **Remember:** SEO is a long-term game. Quality content + technical excellence + patience = results.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
SEO Checker - Search Engine Optimization Audit
|
|
4
|
+
Checks HTML/JSX/TSX pages for SEO best practices.
|
|
5
|
+
|
|
6
|
+
PURPOSE:
|
|
7
|
+
- Verify meta tags, titles, descriptions
|
|
8
|
+
- Check Open Graph tags for social sharing
|
|
9
|
+
- Validate heading hierarchy
|
|
10
|
+
- Check image accessibility (alt attributes)
|
|
11
|
+
|
|
12
|
+
WHAT IT CHECKS:
|
|
13
|
+
- HTML files (actual web pages)
|
|
14
|
+
- JSX/TSX files (React page components)
|
|
15
|
+
- Only files that are likely PUBLIC pages
|
|
16
|
+
|
|
17
|
+
Usage:
|
|
18
|
+
python seo_checker.py <project_path>
|
|
19
|
+
"""
|
|
20
|
+
import sys
|
|
21
|
+
import json
|
|
22
|
+
import re
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
from datetime import datetime
|
|
25
|
+
|
|
26
|
+
# Fix Windows console encoding
|
|
27
|
+
try:
|
|
28
|
+
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
|
|
29
|
+
except:
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# Directories to skip
|
|
34
|
+
SKIP_DIRS = {
|
|
35
|
+
'node_modules', '.next', 'dist', 'build', '.git', '.github',
|
|
36
|
+
'__pycache__', '.vscode', '.idea', 'coverage', 'test', 'tests',
|
|
37
|
+
'__tests__', 'spec', 'docs', 'documentation', 'examples'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# Files to skip (not pages)
|
|
41
|
+
SKIP_PATTERNS = [
|
|
42
|
+
'config', 'setup', 'util', 'helper', 'hook', 'context', 'store',
|
|
43
|
+
'service', 'api', 'lib', 'constant', 'type', 'interface', 'mock',
|
|
44
|
+
'.test.', '.spec.', '_test.', '_spec.'
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def is_page_file(file_path: Path) -> bool:
|
|
49
|
+
"""Check if this file is likely a public-facing page."""
|
|
50
|
+
name = file_path.name.lower()
|
|
51
|
+
stem = file_path.stem.lower()
|
|
52
|
+
|
|
53
|
+
# Skip utility/config files
|
|
54
|
+
if any(skip in name for skip in SKIP_PATTERNS):
|
|
55
|
+
return False
|
|
56
|
+
|
|
57
|
+
# Check path - pages in specific directories are likely pages
|
|
58
|
+
parts = [p.lower() for p in file_path.parts]
|
|
59
|
+
page_dirs = ['pages', 'app', 'routes', 'views', 'screens']
|
|
60
|
+
|
|
61
|
+
if any(d in parts for d in page_dirs):
|
|
62
|
+
return True
|
|
63
|
+
|
|
64
|
+
# Filename indicators for pages
|
|
65
|
+
page_names = ['page', 'index', 'home', 'about', 'contact', 'blog',
|
|
66
|
+
'post', 'article', 'product', 'landing', 'layout']
|
|
67
|
+
|
|
68
|
+
if any(p in stem for p in page_names):
|
|
69
|
+
return True
|
|
70
|
+
|
|
71
|
+
# HTML files are usually pages
|
|
72
|
+
if file_path.suffix.lower() in ['.html', '.htm']:
|
|
73
|
+
return True
|
|
74
|
+
|
|
75
|
+
return False
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def find_pages(project_path: Path) -> list:
|
|
79
|
+
"""Find page files to check."""
|
|
80
|
+
patterns = ['**/*.html', '**/*.htm', '**/*.jsx', '**/*.tsx']
|
|
81
|
+
|
|
82
|
+
files = []
|
|
83
|
+
for pattern in patterns:
|
|
84
|
+
for f in project_path.glob(pattern):
|
|
85
|
+
# Skip excluded directories
|
|
86
|
+
if any(skip in f.parts for skip in SKIP_DIRS):
|
|
87
|
+
continue
|
|
88
|
+
|
|
89
|
+
# Check if it's likely a page
|
|
90
|
+
if is_page_file(f):
|
|
91
|
+
files.append(f)
|
|
92
|
+
|
|
93
|
+
return files[:50] # Limit to 50 files
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def check_page(file_path: Path) -> dict:
|
|
97
|
+
"""Check a single page for SEO issues."""
|
|
98
|
+
issues = []
|
|
99
|
+
|
|
100
|
+
try:
|
|
101
|
+
content = file_path.read_text(encoding='utf-8', errors='ignore')
|
|
102
|
+
except Exception as e:
|
|
103
|
+
return {"file": str(file_path.name), "issues": [f"Error: {e}"]}
|
|
104
|
+
|
|
105
|
+
# Detect if this is a layout/template file (has Head component)
|
|
106
|
+
is_layout = 'Head>' in content or '<head' in content.lower()
|
|
107
|
+
|
|
108
|
+
# 1. Title tag
|
|
109
|
+
has_title = '<title' in content.lower() or 'title=' in content or 'Head>' in content
|
|
110
|
+
if not has_title and is_layout:
|
|
111
|
+
issues.append("Missing <title> tag")
|
|
112
|
+
|
|
113
|
+
# 2. Meta description
|
|
114
|
+
has_description = 'name="description"' in content.lower() or 'name=\'description\'' in content.lower()
|
|
115
|
+
if not has_description and is_layout:
|
|
116
|
+
issues.append("Missing meta description")
|
|
117
|
+
|
|
118
|
+
# 3. Open Graph tags
|
|
119
|
+
has_og = 'og:' in content or 'property="og:' in content.lower()
|
|
120
|
+
if not has_og and is_layout:
|
|
121
|
+
issues.append("Missing Open Graph tags")
|
|
122
|
+
|
|
123
|
+
# 4. Heading hierarchy - multiple H1s
|
|
124
|
+
h1_matches = re.findall(r'<h1[^>]*>', content, re.I)
|
|
125
|
+
if len(h1_matches) > 1:
|
|
126
|
+
issues.append(f"Multiple H1 tags ({len(h1_matches)})")
|
|
127
|
+
|
|
128
|
+
# 5. Images without alt
|
|
129
|
+
img_pattern = r'<img[^>]+>'
|
|
130
|
+
imgs = re.findall(img_pattern, content, re.I)
|
|
131
|
+
for img in imgs:
|
|
132
|
+
if 'alt=' not in img.lower():
|
|
133
|
+
issues.append("Image missing alt attribute")
|
|
134
|
+
break
|
|
135
|
+
if 'alt=""' in img or "alt=''" in img:
|
|
136
|
+
issues.append("Image has empty alt attribute")
|
|
137
|
+
break
|
|
138
|
+
|
|
139
|
+
# 6. Check for canonical link (nice to have)
|
|
140
|
+
# has_canonical = 'rel="canonical"' in content.lower()
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
"file": str(file_path.name),
|
|
144
|
+
"issues": issues
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def main():
|
|
149
|
+
project_path = Path(sys.argv[1] if len(sys.argv) > 1 else ".").resolve()
|
|
150
|
+
|
|
151
|
+
print(f"\n{'='*60}")
|
|
152
|
+
print(f" SEO CHECKER - Search Engine Optimization Audit")
|
|
153
|
+
print(f"{'='*60}")
|
|
154
|
+
print(f"Project: {project_path}")
|
|
155
|
+
print(f"Time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
|
|
156
|
+
print("-"*60)
|
|
157
|
+
|
|
158
|
+
# Find pages
|
|
159
|
+
pages = find_pages(project_path)
|
|
160
|
+
|
|
161
|
+
if not pages:
|
|
162
|
+
print("\n[!] No page files found.")
|
|
163
|
+
print(" Looking for: HTML, JSX, TSX in pages/app/routes directories")
|
|
164
|
+
output = {"script": "seo_checker", "files_checked": 0, "passed": True}
|
|
165
|
+
print("\n" + json.dumps(output, indent=2))
|
|
166
|
+
sys.exit(0)
|
|
167
|
+
|
|
168
|
+
print(f"Found {len(pages)} page files to analyze\n")
|
|
169
|
+
|
|
170
|
+
# Check each page
|
|
171
|
+
all_issues = []
|
|
172
|
+
for f in pages:
|
|
173
|
+
result = check_page(f)
|
|
174
|
+
if result["issues"]:
|
|
175
|
+
all_issues.append(result)
|
|
176
|
+
|
|
177
|
+
# Summary
|
|
178
|
+
print("=" * 60)
|
|
179
|
+
print("SEO ANALYSIS RESULTS")
|
|
180
|
+
print("=" * 60)
|
|
181
|
+
|
|
182
|
+
if all_issues:
|
|
183
|
+
# Group by issue type
|
|
184
|
+
issue_counts = {}
|
|
185
|
+
for item in all_issues:
|
|
186
|
+
for issue in item["issues"]:
|
|
187
|
+
issue_counts[issue] = issue_counts.get(issue, 0) + 1
|
|
188
|
+
|
|
189
|
+
print("\nIssue Summary:")
|
|
190
|
+
for issue, count in sorted(issue_counts.items(), key=lambda x: -x[1]):
|
|
191
|
+
print(f" [{count}] {issue}")
|
|
192
|
+
|
|
193
|
+
print(f"\nAffected files ({len(all_issues)}):")
|
|
194
|
+
for item in all_issues[:5]:
|
|
195
|
+
print(f" - {item['file']}")
|
|
196
|
+
if len(all_issues) > 5:
|
|
197
|
+
print(f" ... and {len(all_issues) - 5} more")
|
|
198
|
+
else:
|
|
199
|
+
print("\n[OK] No SEO issues found!")
|
|
200
|
+
|
|
201
|
+
total_issues = sum(len(item["issues"]) for item in all_issues)
|
|
202
|
+
passed = total_issues == 0
|
|
203
|
+
|
|
204
|
+
output = {
|
|
205
|
+
"script": "seo_checker",
|
|
206
|
+
"project": str(project_path),
|
|
207
|
+
"files_checked": len(pages),
|
|
208
|
+
"files_with_issues": len(all_issues),
|
|
209
|
+
"issues_found": total_issues,
|
|
210
|
+
"passed": passed
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
print("\n" + json.dumps(output, indent=2))
|
|
214
|
+
|
|
215
|
+
sys.exit(0 if passed else 1)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
if __name__ == "__main__":
|
|
219
|
+
main()
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: server-management
|
|
3
|
+
description: Server management principles and decision-making. Process management, monitoring strategy, and scaling decisions. Teaches thinking, not commands.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Server Management
|
|
8
|
+
|
|
9
|
+
> Server management principles for production operations.
|
|
10
|
+
> **Learn to THINK, not memorize commands.**
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. Process Management Principles
|
|
15
|
+
|
|
16
|
+
### Tool Selection
|
|
17
|
+
|
|
18
|
+
| Scenario | Tool |
|
|
19
|
+
|----------|------|
|
|
20
|
+
| **Node.js app** | PM2 (clustering, reload) |
|
|
21
|
+
| **Any app** | systemd (Linux native) |
|
|
22
|
+
| **Containers** | Docker/Podman |
|
|
23
|
+
| **Orchestration** | Kubernetes, Docker Swarm |
|
|
24
|
+
|
|
25
|
+
### Process Management Goals
|
|
26
|
+
|
|
27
|
+
| Goal | What It Means |
|
|
28
|
+
|------|---------------|
|
|
29
|
+
| **Restart on crash** | Auto-recovery |
|
|
30
|
+
| **Zero-downtime reload** | No service interruption |
|
|
31
|
+
| **Clustering** | Use all CPU cores |
|
|
32
|
+
| **Persistence** | Survive server reboot |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 2. Monitoring Principles
|
|
37
|
+
|
|
38
|
+
### What to Monitor
|
|
39
|
+
|
|
40
|
+
| Category | Key Metrics |
|
|
41
|
+
|----------|-------------|
|
|
42
|
+
| **Availability** | Uptime, health checks |
|
|
43
|
+
| **Performance** | Response time, throughput |
|
|
44
|
+
| **Errors** | Error rate, types |
|
|
45
|
+
| **Resources** | CPU, memory, disk |
|
|
46
|
+
|
|
47
|
+
### Alert Severity Strategy
|
|
48
|
+
|
|
49
|
+
| Level | Response |
|
|
50
|
+
|-------|----------|
|
|
51
|
+
| **Critical** | Immediate action |
|
|
52
|
+
| **Warning** | Investigate soon |
|
|
53
|
+
| **Info** | Review daily |
|
|
54
|
+
|
|
55
|
+
### Monitoring Tool Selection
|
|
56
|
+
|
|
57
|
+
| Need | Options |
|
|
58
|
+
|------|---------|
|
|
59
|
+
| Simple/Free | PM2 metrics, htop |
|
|
60
|
+
| Full observability | Grafana, Datadog |
|
|
61
|
+
| Error tracking | Sentry |
|
|
62
|
+
| Uptime | UptimeRobot, Pingdom |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 3. Log Management Principles
|
|
67
|
+
|
|
68
|
+
### Log Strategy
|
|
69
|
+
|
|
70
|
+
| Log Type | Purpose |
|
|
71
|
+
|----------|---------|
|
|
72
|
+
| **Application logs** | Debug, audit |
|
|
73
|
+
| **Access logs** | Traffic analysis |
|
|
74
|
+
| **Error logs** | Issue detection |
|
|
75
|
+
|
|
76
|
+
### Log Principles
|
|
77
|
+
|
|
78
|
+
1. **Rotate logs** to prevent disk fill
|
|
79
|
+
2. **Structured logging** (JSON) for parsing
|
|
80
|
+
3. **Appropriate levels** (error/warn/info/debug)
|
|
81
|
+
4. **No sensitive data** in logs
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 4. Scaling Decisions
|
|
86
|
+
|
|
87
|
+
### When to Scale
|
|
88
|
+
|
|
89
|
+
| Symptom | Solution |
|
|
90
|
+
|---------|----------|
|
|
91
|
+
| High CPU | Add instances (horizontal) |
|
|
92
|
+
| High memory | Increase RAM or fix leak |
|
|
93
|
+
| Slow response | Profile first, then scale |
|
|
94
|
+
| Traffic spikes | Auto-scaling |
|
|
95
|
+
|
|
96
|
+
### Scaling Strategy
|
|
97
|
+
|
|
98
|
+
| Type | When to Use |
|
|
99
|
+
|------|-------------|
|
|
100
|
+
| **Vertical** | Quick fix, single instance |
|
|
101
|
+
| **Horizontal** | Sustainable, distributed |
|
|
102
|
+
| **Auto** | Variable traffic |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 5. Health Check Principles
|
|
107
|
+
|
|
108
|
+
### What Constitutes Healthy
|
|
109
|
+
|
|
110
|
+
| Check | Meaning |
|
|
111
|
+
|-------|---------|
|
|
112
|
+
| **HTTP 200** | Service responding |
|
|
113
|
+
| **Database connected** | Data accessible |
|
|
114
|
+
| **Dependencies OK** | External services reachable |
|
|
115
|
+
| **Resources OK** | CPU/memory not exhausted |
|
|
116
|
+
|
|
117
|
+
### Health Check Implementation
|
|
118
|
+
|
|
119
|
+
- Simple: Just return 200
|
|
120
|
+
- Deep: Check all dependencies
|
|
121
|
+
- Choose based on load balancer needs
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 6. Security Principles
|
|
126
|
+
|
|
127
|
+
| Area | Principle |
|
|
128
|
+
|------|-----------|
|
|
129
|
+
| **Access** | SSH keys only, no passwords |
|
|
130
|
+
| **Firewall** | Only needed ports open |
|
|
131
|
+
| **Updates** | Regular security patches |
|
|
132
|
+
| **Secrets** | Environment vars, not files |
|
|
133
|
+
| **Audit** | Log access and changes |
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 7. Troubleshooting Priority
|
|
138
|
+
|
|
139
|
+
When something's wrong:
|
|
140
|
+
|
|
141
|
+
1. **Check if running** (process status)
|
|
142
|
+
2. **Check logs** (error messages)
|
|
143
|
+
3. **Check resources** (disk, memory, CPU)
|
|
144
|
+
4. **Check network** (ports, DNS)
|
|
145
|
+
5. **Check dependencies** (database, APIs)
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 8. Anti-Patterns
|
|
150
|
+
|
|
151
|
+
| ❌ Don't | ✅ Do |
|
|
152
|
+
|----------|-------|
|
|
153
|
+
| Run as root | Use non-root user |
|
|
154
|
+
| Ignore logs | Set up log rotation |
|
|
155
|
+
| Skip monitoring | Monitor from day one |
|
|
156
|
+
| Manual restarts | Auto-restart config |
|
|
157
|
+
| No backups | Regular backup schedule |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
> **Remember:** A well-managed server is boring. That's the goal.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: systematic-debugging
|
|
3
|
+
description: 4-phase systematic debugging methodology with root cause analysis and evidence-based verification. Use when debugging complex issues.
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Systematic Debugging
|
|
8
|
+
|
|
9
|
+
> Source: obra/superpowers
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
This skill provides a structured approach to debugging that prevents random guessing and ensures problems are properly understood before solving.
|
|
13
|
+
|
|
14
|
+
## 4-Phase Debugging Process
|
|
15
|
+
|
|
16
|
+
### Phase 1: Reproduce
|
|
17
|
+
Before fixing, reliably reproduce the issue.
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
## Reproduction Steps
|
|
21
|
+
1. [Exact step to reproduce]
|
|
22
|
+
2. [Next step]
|
|
23
|
+
3. [Expected vs actual result]
|
|
24
|
+
|
|
25
|
+
## Reproduction Rate
|
|
26
|
+
- [ ] Always (100%)
|
|
27
|
+
- [ ] Often (50-90%)
|
|
28
|
+
- [ ] Sometimes (10-50%)
|
|
29
|
+
- [ ] Rare (<10%)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Phase 2: Isolate
|
|
33
|
+
Narrow down the source.
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
## Isolation Questions
|
|
37
|
+
- When did this start happening?
|
|
38
|
+
- What changed recently?
|
|
39
|
+
- Does it happen in all environments?
|
|
40
|
+
- Can we reproduce with minimal code?
|
|
41
|
+
- What's the smallest change that triggers it?
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Phase 3: Understand
|
|
45
|
+
Find the root cause, not just symptoms.
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
## Root Cause Analysis
|
|
49
|
+
### The 5 Whys
|
|
50
|
+
1. Why: [First observation]
|
|
51
|
+
2. Why: [Deeper reason]
|
|
52
|
+
3. Why: [Still deeper]
|
|
53
|
+
4. Why: [Getting closer]
|
|
54
|
+
5. Why: [Root cause]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Phase 4: Fix & Verify
|
|
58
|
+
Fix and verify it's truly fixed.
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
## Fix Verification
|
|
62
|
+
- [ ] Bug no longer reproduces
|
|
63
|
+
- [ ] Related functionality still works
|
|
64
|
+
- [ ] No new issues introduced
|
|
65
|
+
- [ ] Test added to prevent regression
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Debugging Checklist
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
## Before Starting
|
|
72
|
+
- [ ] Can reproduce consistently
|
|
73
|
+
- [ ] Have minimal reproduction case
|
|
74
|
+
- [ ] Understand expected behavior
|
|
75
|
+
|
|
76
|
+
## During Investigation
|
|
77
|
+
- [ ] Check recent changes (git log)
|
|
78
|
+
- [ ] Check logs for errors
|
|
79
|
+
- [ ] Add logging if needed
|
|
80
|
+
- [ ] Use debugger/breakpoints
|
|
81
|
+
|
|
82
|
+
## After Fix
|
|
83
|
+
- [ ] Root cause documented
|
|
84
|
+
- [ ] Fix verified
|
|
85
|
+
- [ ] Regression test added
|
|
86
|
+
- [ ] Similar code checked
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Common Debugging Commands
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Recent changes
|
|
93
|
+
git log --oneline -20
|
|
94
|
+
git diff HEAD~5
|
|
95
|
+
|
|
96
|
+
# Search for pattern
|
|
97
|
+
grep -r "errorPattern" --include="*.ts"
|
|
98
|
+
|
|
99
|
+
# Check logs
|
|
100
|
+
pm2 logs app-name --err --lines 100
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Anti-Patterns
|
|
104
|
+
|
|
105
|
+
❌ **Random changes** - "Maybe if I change this..."
|
|
106
|
+
❌ **Ignoring evidence** - "That can't be the cause"
|
|
107
|
+
❌ **Assuming** - "It must be X" without proof
|
|
108
|
+
❌ **Not reproducing first** - Fixing blindly
|
|
109
|
+
❌ **Stopping at symptoms** - Not finding root cause
|