@mrtrinhvn/ag-kit 1.0.10 → 1.1.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 (218) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/bin/cli.js +62 -0
  4. package/package.json +7 -1
  5. package/template/.agent/rules/GEMINI.md +1 -1
  6. package/template/.agent/skills/regent-orchestrator/SKILL.md +31 -0
  7. package/template/.agent/skills/telegram-bridge/SKILL.md +30 -0
  8. package/.agent/.shared/ui-ux-pro-max/data/charts.csv +0 -26
  9. package/.agent/.shared/ui-ux-pro-max/data/colors.csv +0 -97
  10. package/.agent/.shared/ui-ux-pro-max/data/icons.csv +0 -101
  11. package/.agent/.shared/ui-ux-pro-max/data/landing.csv +0 -31
  12. package/.agent/.shared/ui-ux-pro-max/data/products.csv +0 -97
  13. package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +0 -24
  14. package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +0 -45
  15. package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +0 -53
  16. package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +0 -56
  17. package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +0 -53
  18. package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +0 -53
  19. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +0 -51
  20. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +0 -59
  21. package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +0 -52
  22. package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +0 -54
  23. package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +0 -61
  24. package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +0 -54
  25. package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +0 -51
  26. package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +0 -50
  27. package/.agent/.shared/ui-ux-pro-max/data/styles.csv +0 -59
  28. package/.agent/.shared/ui-ux-pro-max/data/typography.csv +0 -58
  29. package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +0 -101
  30. package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
  31. package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +0 -31
  32. package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
  33. package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
  34. package/.agent/.shared/ui-ux-pro-max/scripts/core.py +0 -258
  35. package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +0 -1067
  36. package/.agent/.shared/ui-ux-pro-max/scripts/search.py +0 -106
  37. package/.agent/ARCHITECTURE.md +0 -288
  38. package/.agent/agents/backend-specialist.md +0 -263
  39. package/.agent/agents/code-archaeologist.md +0 -106
  40. package/.agent/agents/database-architect.md +0 -226
  41. package/.agent/agents/debugger.md +0 -225
  42. package/.agent/agents/devops-engineer.md +0 -242
  43. package/.agent/agents/documentation-writer.md +0 -104
  44. package/.agent/agents/explorer-agent.md +0 -73
  45. package/.agent/agents/frontend-specialist.md +0 -556
  46. package/.agent/agents/game-developer.md +0 -162
  47. package/.agent/agents/mobile-developer.md +0 -377
  48. package/.agent/agents/orchestrator.md +0 -416
  49. package/.agent/agents/penetration-tester.md +0 -188
  50. package/.agent/agents/performance-optimizer.md +0 -187
  51. package/.agent/agents/product-manager.md +0 -112
  52. package/.agent/agents/product-owner.md +0 -95
  53. package/.agent/agents/project-planner.md +0 -406
  54. package/.agent/agents/qa-automation-engineer.md +0 -103
  55. package/.agent/agents/quant-architect.md +0 -31
  56. package/.agent/agents/security-auditor.md +0 -170
  57. package/.agent/agents/seo-specialist.md +0 -111
  58. package/.agent/agents/test-engineer.md +0 -158
  59. package/.agent/mcp_config.json +0 -24
  60. package/.agent/rules/GEMINI.md +0 -280
  61. package/.agent/scripts/auto_preview.py +0 -148
  62. package/.agent/scripts/checklist.py +0 -217
  63. package/.agent/scripts/session_manager.py +0 -120
  64. package/.agent/scripts/verify_all.py +0 -327
  65. package/.agent/skills/api-patterns/SKILL.md +0 -81
  66. package/.agent/skills/api-patterns/api-style.md +0 -42
  67. package/.agent/skills/api-patterns/auth.md +0 -24
  68. package/.agent/skills/api-patterns/documentation.md +0 -26
  69. package/.agent/skills/api-patterns/graphql.md +0 -41
  70. package/.agent/skills/api-patterns/rate-limiting.md +0 -31
  71. package/.agent/skills/api-patterns/response.md +0 -37
  72. package/.agent/skills/api-patterns/rest.md +0 -40
  73. package/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
  74. package/.agent/skills/api-patterns/security-testing.md +0 -122
  75. package/.agent/skills/api-patterns/trpc.md +0 -41
  76. package/.agent/skills/api-patterns/versioning.md +0 -22
  77. package/.agent/skills/app-builder/SKILL.md +0 -75
  78. package/.agent/skills/app-builder/agent-coordination.md +0 -71
  79. package/.agent/skills/app-builder/feature-building.md +0 -53
  80. package/.agent/skills/app-builder/project-detection.md +0 -34
  81. package/.agent/skills/app-builder/scaffolding.md +0 -118
  82. package/.agent/skills/app-builder/tech-stack.md +0 -40
  83. package/.agent/skills/app-builder/templates/SKILL.md +0 -39
  84. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
  85. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
  86. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
  87. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
  88. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
  89. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
  90. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
  91. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -82
  92. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -100
  93. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -106
  94. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -101
  95. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
  96. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -93
  97. package/.agent/skills/architecture/SKILL.md +0 -55
  98. package/.agent/skills/architecture/context-discovery.md +0 -43
  99. package/.agent/skills/architecture/examples.md +0 -94
  100. package/.agent/skills/architecture/pattern-selection.md +0 -68
  101. package/.agent/skills/architecture/patterns-reference.md +0 -50
  102. package/.agent/skills/architecture/trade-off-analysis.md +0 -77
  103. package/.agent/skills/bash-linux/SKILL.md +0 -199
  104. package/.agent/skills/behavioral-modes/SKILL.md +0 -242
  105. package/.agent/skills/brainstorming/SKILL.md +0 -168
  106. package/.agent/skills/brainstorming/dynamic-questioning.md +0 -350
  107. package/.agent/skills/business-ops/SKILL.md +0 -26
  108. package/.agent/skills/clean-code/SKILL.md +0 -202
  109. package/.agent/skills/cli-generator/SKILL.md +0 -48
  110. package/.agent/skills/code-review-checklist/SKILL.md +0 -109
  111. package/.agent/skills/cognitive-session/SKILL.md +0 -28
  112. package/.agent/skills/data-science/SKILL.md +0 -28
  113. package/.agent/skills/database-design/SKILL.md +0 -52
  114. package/.agent/skills/database-design/database-selection.md +0 -43
  115. package/.agent/skills/database-design/indexing.md +0 -39
  116. package/.agent/skills/database-design/migrations.md +0 -48
  117. package/.agent/skills/database-design/optimization.md +0 -36
  118. package/.agent/skills/database-design/orm-selection.md +0 -30
  119. package/.agent/skills/database-design/schema-design.md +0 -56
  120. package/.agent/skills/database-design/scripts/schema_validator.py +0 -172
  121. package/.agent/skills/deployment-procedures/SKILL.md +0 -241
  122. package/.agent/skills/doc.md +0 -177
  123. package/.agent/skills/documentation-templates/SKILL.md +0 -194
  124. package/.agent/skills/frontend-design/SKILL.md +0 -418
  125. package/.agent/skills/frontend-design/animation-guide.md +0 -331
  126. package/.agent/skills/frontend-design/color-system.md +0 -311
  127. package/.agent/skills/frontend-design/decision-trees.md +0 -418
  128. package/.agent/skills/frontend-design/motion-graphics.md +0 -306
  129. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +0 -183
  130. package/.agent/skills/frontend-design/scripts/ux_audit.py +0 -722
  131. package/.agent/skills/frontend-design/typography-system.md +0 -345
  132. package/.agent/skills/frontend-design/ux-psychology.md +0 -541
  133. package/.agent/skills/frontend-design/visual-effects.md +0 -383
  134. package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  135. package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  136. package/.agent/skills/game-development/SKILL.md +0 -167
  137. package/.agent/skills/game-development/game-art/SKILL.md +0 -185
  138. package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  139. package/.agent/skills/game-development/game-design/SKILL.md +0 -129
  140. package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  141. package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  142. package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  143. package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  144. package/.agent/skills/game-development/web-games/SKILL.md +0 -150
  145. package/.agent/skills/geo-fundamentals/SKILL.md +0 -156
  146. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +0 -289
  147. package/.agent/skills/i18n-localization/SKILL.md +0 -154
  148. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +0 -241
  149. package/.agent/skills/intelligent-routing/SKILL.md +0 -335
  150. package/.agent/skills/knowledge-management/SKILL.md +0 -66
  151. package/.agent/skills/lint-and-validate/SKILL.md +0 -45
  152. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +0 -172
  153. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +0 -173
  154. package/.agent/skills/llm-routing-quirks/SKILL.md +0 -41
  155. package/.agent/skills/mcp-builder/SKILL.md +0 -176
  156. package/.agent/skills/memory-architecture/SKILL.md +0 -107
  157. package/.agent/skills/mini-antigravity-injection/SKILL.md +0 -61
  158. package/.agent/skills/mobile-design/SKILL.md +0 -394
  159. package/.agent/skills/mobile-design/decision-trees.md +0 -516
  160. package/.agent/skills/mobile-design/mobile-backend.md +0 -491
  161. package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
  162. package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
  163. package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
  164. package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
  165. package/.agent/skills/mobile-design/mobile-performance.md +0 -767
  166. package/.agent/skills/mobile-design/mobile-testing.md +0 -356
  167. package/.agent/skills/mobile-design/mobile-typography.md +0 -433
  168. package/.agent/skills/mobile-design/platform-android.md +0 -666
  169. package/.agent/skills/mobile-design/platform-ios.md +0 -561
  170. package/.agent/skills/mobile-design/scripts/mobile_audit.py +0 -670
  171. package/.agent/skills/mobile-design/touch-psychology.md +0 -537
  172. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  173. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  174. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  175. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  176. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  177. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  178. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  179. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  180. package/.agent/skills/nextjs-react-expert/9-cache-components.md +0 -103
  181. package/.agent/skills/nextjs-react-expert/SKILL.md +0 -267
  182. package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
  183. package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
  184. package/.agent/skills/nodejs-best-practices/SKILL.md +0 -333
  185. package/.agent/skills/parallel-agents/SKILL.md +0 -175
  186. package/.agent/skills/performance-profiling/SKILL.md +0 -143
  187. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
  188. package/.agent/skills/plan-writing/SKILL.md +0 -153
  189. package/.agent/skills/powershell-windows/SKILL.md +0 -167
  190. package/.agent/skills/product-management/SKILL.md +0 -30
  191. package/.agent/skills/python-patterns/SKILL.md +0 -441
  192. package/.agent/skills/red-team-tactics/SKILL.md +0 -199
  193. package/.agent/skills/rust-pro/SKILL.md +0 -176
  194. package/.agent/skills/seo-fundamentals/SKILL.md +0 -129
  195. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
  196. package/.agent/skills/server-management/SKILL.md +0 -161
  197. package/.agent/skills/systematic-debugging/SKILL.md +0 -120
  198. package/.agent/skills/tailwind-patterns/SKILL.md +0 -269
  199. package/.agent/skills/tdd-workflow/SKILL.md +0 -148
  200. package/.agent/skills/testing-patterns/SKILL.md +0 -178
  201. package/.agent/skills/testing-patterns/scripts/test_runner.py +0 -219
  202. package/.agent/skills/vulnerability-scanner/SKILL.md +0 -276
  203. package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
  204. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  205. package/.agent/skills/web-design-guidelines/SKILL.md +0 -57
  206. package/.agent/skills/webapp-testing/SKILL.md +0 -187
  207. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +0 -173
  208. package/.agent/workflows/brainstorm.md +0 -113
  209. package/.agent/workflows/create.md +0 -59
  210. package/.agent/workflows/debug.md +0 -103
  211. package/.agent/workflows/deploy.md +0 -176
  212. package/.agent/workflows/enhance.md +0 -63
  213. package/.agent/workflows/orchestrate.md +0 -237
  214. package/.agent/workflows/plan.md +0 -89
  215. package/.agent/workflows/preview.md +0 -81
  216. package/.agent/workflows/status.md +0 -86
  217. package/.agent/workflows/test.md +0 -144
  218. package/.agent/workflows/ui-ux-pro-max.md +0 -296
@@ -1,156 +0,0 @@
1
- ---
2
- name: geo-fundamentals
3
- description: Generative Engine Optimization for AI search engines (ChatGPT, Claude, Perplexity).
4
- allowed-tools: Read, Glob, Grep
5
- ---
6
-
7
- # GEO Fundamentals
8
-
9
- > Optimization for AI-powered search engines.
10
-
11
- ---
12
-
13
- ## 1. What is GEO?
14
-
15
- **GEO** = Generative Engine Optimization
16
-
17
- | Goal | Platform |
18
- |------|----------|
19
- | Be cited in AI responses | ChatGPT, Claude, Perplexity, Gemini |
20
-
21
- ### SEO vs GEO
22
-
23
- | Aspect | SEO | GEO |
24
- |--------|-----|-----|
25
- | Goal | #1 ranking | AI citations |
26
- | Platform | Google | AI engines |
27
- | Metrics | Rankings, CTR | Citation rate |
28
- | Focus | Keywords | Entities, data |
29
-
30
- ---
31
-
32
- ## 2. AI Engine Landscape
33
-
34
- | Engine | Citation Style | Opportunity |
35
- |--------|----------------|-------------|
36
- | **Perplexity** | Numbered [1][2] | Highest citation rate |
37
- | **ChatGPT** | Inline/footnotes | Custom GPTs |
38
- | **Claude** | Contextual | Long-form content |
39
- | **Gemini** | Sources section | SEO crossover |
40
-
41
- ---
42
-
43
- ## 3. RAG Retrieval Factors
44
-
45
- How AI engines select content to cite:
46
-
47
- | Factor | Weight |
48
- |--------|--------|
49
- | Semantic relevance | ~40% |
50
- | Keyword match | ~20% |
51
- | Authority signals | ~15% |
52
- | Freshness | ~10% |
53
- | Source diversity | ~15% |
54
-
55
- ---
56
-
57
- ## 4. Content That Gets Cited
58
-
59
- | Element | Why It Works |
60
- |---------|--------------|
61
- | **Original statistics** | Unique, citable data |
62
- | **Expert quotes** | Authority transfer |
63
- | **Clear definitions** | Easy to extract |
64
- | **Step-by-step guides** | Actionable value |
65
- | **Comparison tables** | Structured info |
66
- | **FAQ sections** | Direct answers |
67
-
68
- ---
69
-
70
- ## 5. GEO Content Checklist
71
-
72
- ### Content Elements
73
-
74
- - [ ] Question-based titles
75
- - [ ] Summary/TL;DR at top
76
- - [ ] Original data with sources
77
- - [ ] Expert quotes (name, title)
78
- - [ ] FAQ section (3-5 Q&A)
79
- - [ ] Clear definitions
80
- - [ ] "Last updated" timestamp
81
- - [ ] Author with credentials
82
-
83
- ### Technical Elements
84
-
85
- - [ ] Article schema with dates
86
- - [ ] Person schema for author
87
- - [ ] FAQPage schema
88
- - [ ] Fast loading (< 2.5s)
89
- - [ ] Clean HTML structure
90
-
91
- ---
92
-
93
- ## 6. Entity Building
94
-
95
- | Action | Purpose |
96
- |--------|---------|
97
- | Google Knowledge Panel | Entity recognition |
98
- | Wikipedia (if notable) | Authority source |
99
- | Consistent info across web | Entity consolidation |
100
- | Industry mentions | Authority signals |
101
-
102
- ---
103
-
104
- ## 7. AI Crawler Access
105
-
106
- ### Key AI User-Agents
107
-
108
- | Crawler | Engine |
109
- |---------|--------|
110
- | GPTBot | ChatGPT/OpenAI |
111
- | Claude-Web | Claude |
112
- | PerplexityBot | Perplexity |
113
- | Googlebot | Gemini (shared) |
114
-
115
- ### Access Decision
116
-
117
- | Strategy | When |
118
- |----------|------|
119
- | Allow all | Want AI citations |
120
- | Block GPTBot | Don't want OpenAI training |
121
- | Selective | Allow some, block others |
122
-
123
- ---
124
-
125
- ## 8. Measurement
126
-
127
- | Metric | How to Track |
128
- |--------|--------------|
129
- | AI citations | Manual monitoring |
130
- | "According to [Brand]" mentions | Search in AI |
131
- | Competitor citations | Compare share |
132
- | AI-referred traffic | UTM parameters |
133
-
134
- ---
135
-
136
- ## 9. Anti-Patterns
137
-
138
- | ❌ Don't | ✅ Do |
139
- |----------|-------|
140
- | Publish without dates | Add timestamps |
141
- | Vague attributions | Name sources |
142
- | Skip author info | Show credentials |
143
- | Thin content | Comprehensive coverage |
144
-
145
- ---
146
-
147
- > **Remember:** AI cites content that's clear, authoritative, and easy to extract. Be the best answer.
148
-
149
- ---
150
-
151
- ## Script
152
-
153
- | Script | Purpose | Command |
154
- |--------|---------|---------|
155
- | `scripts/geo_checker.py` | GEO audit (AI citation readiness) | `python scripts/geo_checker.py <project_path>` |
156
-
@@ -1,289 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- GEO Checker - Generative Engine Optimization Audit
4
- Checks PUBLIC WEB CONTENT for AI citation readiness.
5
-
6
- PURPOSE:
7
- - Analyze pages that will be INDEXED by AI engines (ChatGPT, Perplexity, etc.)
8
- - Check for structured data, author info, dates, FAQ sections
9
- - Help content rank in AI-generated answers
10
-
11
- WHAT IT CHECKS:
12
- - HTML files (actual web pages)
13
- - JSX/TSX files (React page components)
14
- - NOT markdown files (those are developer docs, not public content)
15
-
16
- Usage:
17
- python geo_checker.py <project_path>
18
- """
19
- import sys
20
- import re
21
- import json
22
- from pathlib import Path
23
-
24
- # Fix Windows console encoding
25
- try:
26
- sys.stdout.reconfigure(encoding='utf-8', errors='replace')
27
- sys.stderr.reconfigure(encoding='utf-8', errors='replace')
28
- except AttributeError:
29
- pass
30
-
31
-
32
- # Directories to skip (not public content)
33
- SKIP_DIRS = {
34
- 'node_modules', '.next', 'dist', 'build', '.git', '.github',
35
- '__pycache__', '.vscode', '.idea', 'coverage', 'test', 'tests',
36
- '__tests__', 'spec', 'docs', 'documentation'
37
- }
38
-
39
- # Files to skip (not public pages)
40
- SKIP_FILES = {
41
- 'jest.config', 'webpack.config', 'vite.config', 'tsconfig',
42
- 'package.json', 'package-lock', 'yarn.lock', '.eslintrc',
43
- 'tailwind.config', 'postcss.config', 'next.config'
44
- }
45
-
46
-
47
- def is_page_file(file_path: Path) -> bool:
48
- """Check if this file is likely a public-facing page."""
49
- name = file_path.stem.lower()
50
-
51
- # Skip config/utility files
52
- if any(skip in name for skip in SKIP_FILES):
53
- return False
54
-
55
- # Skip test files
56
- if name.endswith('.test') or name.endswith('.spec'):
57
- return False
58
- if name.startswith('test_') or name.startswith('spec_'):
59
- return False
60
-
61
- # Likely page indicators
62
- page_indicators = ['page', 'index', 'home', 'about', 'contact', 'blog',
63
- 'post', 'article', 'product', 'service', 'landing']
64
-
65
- # Check if it's in a pages/app directory (Next.js, etc.)
66
- parts = [p.lower() for p in file_path.parts]
67
- if 'pages' in parts or 'app' in parts or 'routes' in parts:
68
- return True
69
-
70
- # Check filename indicators
71
- if any(ind in name for ind in page_indicators):
72
- return True
73
-
74
- # HTML files are usually pages
75
- if file_path.suffix.lower() == '.html':
76
- return True
77
-
78
- return False
79
-
80
-
81
- def find_web_pages(project_path: Path) -> list:
82
- """Find public-facing web pages only."""
83
- patterns = ['**/*.html', '**/*.htm', '**/*.jsx', '**/*.tsx']
84
-
85
- files = []
86
- for pattern in patterns:
87
- for f in project_path.glob(pattern):
88
- # Skip excluded directories
89
- if any(skip in f.parts for skip in SKIP_DIRS):
90
- continue
91
-
92
- # Check if it's likely a page
93
- if is_page_file(f):
94
- files.append(f)
95
-
96
- return files[:30] # Limit to 30 pages
97
-
98
-
99
- def check_page(file_path: Path) -> dict:
100
- """Check a single web page for GEO elements."""
101
- try:
102
- content = file_path.read_text(encoding='utf-8', errors='ignore')
103
- except Exception as e:
104
- return {'file': str(file_path.name), 'passed': [], 'issues': [f"Error: {e}"], 'score': 0}
105
-
106
- issues = []
107
- passed = []
108
-
109
- # 1. JSON-LD Structured Data (Critical for AI)
110
- if 'application/ld+json' in content:
111
- passed.append("JSON-LD structured data found")
112
- if '"@type"' in content:
113
- if 'Article' in content:
114
- passed.append("Article schema present")
115
- if 'FAQPage' in content:
116
- passed.append("FAQ schema present")
117
- if 'Organization' in content or 'Person' in content:
118
- passed.append("Entity schema present")
119
- else:
120
- issues.append("No JSON-LD structured data (AI engines prefer structured content)")
121
-
122
- # 2. Heading Structure
123
- h1_count = len(re.findall(r'<h1[^>]*>', content, re.I))
124
- h2_count = len(re.findall(r'<h2[^>]*>', content, re.I))
125
-
126
- if h1_count == 1:
127
- passed.append("Single H1 heading (clear topic)")
128
- elif h1_count == 0:
129
- issues.append("No H1 heading - page topic unclear")
130
- else:
131
- issues.append(f"Multiple H1 headings ({h1_count}) - confusing for AI")
132
-
133
- if h2_count >= 2:
134
- passed.append(f"{h2_count} H2 subheadings (good structure)")
135
- else:
136
- issues.append("Add more H2 subheadings for scannable content")
137
-
138
- # 3. Author Attribution (E-E-A-T signal)
139
- author_patterns = ['author', 'byline', 'written-by', 'contributor', 'rel="author"']
140
- has_author = any(p in content.lower() for p in author_patterns)
141
- if has_author:
142
- passed.append("Author attribution found")
143
- else:
144
- issues.append("No author info (AI prefers attributed content)")
145
-
146
- # 4. Publication Date (Freshness signal)
147
- date_patterns = ['datePublished', 'dateModified', 'datetime=', 'pubdate', 'article:published']
148
- has_date = any(re.search(p, content, re.I) for p in date_patterns)
149
- if has_date:
150
- passed.append("Publication date found")
151
- else:
152
- issues.append("No publication date (freshness matters for AI)")
153
-
154
- # 5. FAQ Section (Highly citable)
155
- faq_patterns = [r'<details', r'faq', r'frequently.?asked', r'"FAQPage"']
156
- has_faq = any(re.search(p, content, re.I) for p in faq_patterns)
157
- if has_faq:
158
- passed.append("FAQ section detected (highly citable)")
159
-
160
- # 6. Lists (Structured content)
161
- list_count = len(re.findall(r'<(ul|ol)[^>]*>', content, re.I))
162
- if list_count >= 2:
163
- passed.append(f"{list_count} lists (structured content)")
164
-
165
- # 7. Tables (Comparison data)
166
- table_count = len(re.findall(r'<table[^>]*>', content, re.I))
167
- if table_count >= 1:
168
- passed.append(f"{table_count} table(s) (comparison data)")
169
-
170
- # 8. Entity Recognition (E-E-A-T signal) - NEW 2025
171
- entity_patterns = [
172
- r'"@type"\s*:\s*"Organization"',
173
- r'"@type"\s*:\s*"LocalBusiness"',
174
- r'"@type"\s*:\s*"Brand"',
175
- r'itemtype.*schema\.org/(Organization|Person|Brand)',
176
- r'rel="author"'
177
- ]
178
- has_entity = any(re.search(p, content, re.I) for p in entity_patterns)
179
- if has_entity:
180
- passed.append("Entity/Brand recognition (E-E-A-T)")
181
-
182
- # 9. Original Statistics/Data (AI citation magnet) - NEW 2025
183
- stat_patterns = [
184
- r'\d+%', # Percentages
185
- r'\$[\d,]+', # Dollar amounts
186
- r'study\s+(shows|found)', # Research citations
187
- r'according to', # Source attribution
188
- r'data\s+(shows|reveals)', # Data-backed claims
189
- r'\d+x\s+(faster|better|more)', # Comparison stats
190
- r'(million|billion|trillion)', # Large numbers
191
- ]
192
- stat_matches = sum(1 for p in stat_patterns if re.search(p, content, re.I))
193
- if stat_matches >= 2:
194
- passed.append("Original statistics/data (citation magnet)")
195
-
196
- # 10. Conversational/Direct answers - NEW 2025
197
- direct_answer_patterns = [
198
- r'is defined as',
199
- r'refers to',
200
- r'means that',
201
- r'the answer is',
202
- r'in short,',
203
- r'simply put,',
204
- r'<dfn'
205
- ]
206
- has_direct = any(re.search(p, content, re.I) for p in direct_answer_patterns)
207
- if has_direct:
208
- passed.append("Direct answer patterns (LLM-friendly)")
209
-
210
- # Calculate score
211
- total = len(passed) + len(issues)
212
- score = (len(passed) / total * 100) if total > 0 else 0
213
-
214
- return {
215
- 'file': str(file_path.name),
216
- 'passed': passed,
217
- 'issues': issues,
218
- 'score': round(score)
219
- }
220
-
221
-
222
- def main():
223
- target = sys.argv[1] if len(sys.argv) > 1 else "."
224
- target_path = Path(target).resolve()
225
-
226
- print("\n" + "=" * 60)
227
- print(" GEO CHECKER - AI Citation Readiness Audit")
228
- print("=" * 60)
229
- print(f"Project: {target_path}")
230
- print("-" * 60)
231
-
232
- # Find web pages only
233
- pages = find_web_pages(target_path)
234
-
235
- if not pages:
236
- print("\n[!] No public web pages found.")
237
- print(" Looking for: HTML, JSX, TSX files in pages/app directories")
238
- print(" Skipping: docs, tests, config files, node_modules")
239
- output = {"script": "geo_checker", "pages_found": 0, "passed": True}
240
- print("\n" + json.dumps(output, indent=2))
241
- sys.exit(0)
242
-
243
- print(f"Found {len(pages)} public pages to analyze\n")
244
-
245
- # Check each page
246
- results = []
247
- for page in pages:
248
- result = check_page(page)
249
- results.append(result)
250
-
251
- # Print results
252
- for result in results:
253
- status = "[OK]" if result['score'] >= 60 else "[!]"
254
- print(f"{status} {result['file']}: {result['score']}%")
255
- if result['issues'] and result['score'] < 60:
256
- for issue in result['issues'][:2]: # Show max 2 issues
257
- print(f" - {issue}")
258
-
259
- # Average score
260
- avg_score = sum(r['score'] for r in results) / len(results) if results else 0
261
-
262
- print("\n" + "=" * 60)
263
- print(f"AVERAGE GEO SCORE: {avg_score:.0f}%")
264
- print("=" * 60)
265
-
266
- if avg_score >= 80:
267
- print("[OK] Excellent - Content well-optimized for AI citations")
268
- elif avg_score >= 60:
269
- print("[OK] Good - Some improvements recommended")
270
- elif avg_score >= 40:
271
- print("[!] Needs work - Add structured elements")
272
- else:
273
- print("[X] Poor - Content needs GEO optimization")
274
-
275
- # JSON output
276
- output = {
277
- "script": "geo_checker",
278
- "project": str(target_path),
279
- "pages_checked": len(results),
280
- "average_score": round(avg_score),
281
- "passed": avg_score >= 60
282
- }
283
- print("\n" + json.dumps(output, indent=2))
284
-
285
- sys.exit(0 if avg_score >= 60 else 1)
286
-
287
-
288
- if __name__ == "__main__":
289
- main()
@@ -1,154 +0,0 @@
1
- ---
2
- name: i18n-localization
3
- description: Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.
4
- allowed-tools: Read, Glob, Grep
5
- ---
6
-
7
- # i18n & Localization
8
-
9
- > Internationalization (i18n) and Localization (L10n) best practices.
10
-
11
- ---
12
-
13
- ## 1. Core Concepts
14
-
15
- | Term | Meaning |
16
- |------|---------|
17
- | **i18n** | Internationalization - making app translatable |
18
- | **L10n** | Localization - actual translations |
19
- | **Locale** | Language + Region (en-US, tr-TR) |
20
- | **RTL** | Right-to-left languages (Arabic, Hebrew) |
21
-
22
- ---
23
-
24
- ## 2. When to Use i18n
25
-
26
- | Project Type | i18n Needed? |
27
- |--------------|--------------|
28
- | Public web app | ✅ Yes |
29
- | SaaS product | ✅ Yes |
30
- | Internal tool | ⚠️ Maybe |
31
- | Single-region app | ⚠️ Consider future |
32
- | Personal project | ❌ Optional |
33
-
34
- ---
35
-
36
- ## 3. Implementation Patterns
37
-
38
- ### React (react-i18next)
39
-
40
- ```tsx
41
- import { useTranslation } from 'react-i18next';
42
-
43
- function Welcome() {
44
- const { t } = useTranslation();
45
- return <h1>{t('welcome.title')}</h1>;
46
- }
47
- ```
48
-
49
- ### Next.js (next-intl)
50
-
51
- ```tsx
52
- import { useTranslations } from 'next-intl';
53
-
54
- export default function Page() {
55
- const t = useTranslations('Home');
56
- return <h1>{t('title')}</h1>;
57
- }
58
- ```
59
-
60
- ### Python (gettext)
61
-
62
- ```python
63
- from gettext import gettext as _
64
-
65
- print(_("Welcome to our app"))
66
- ```
67
-
68
- ---
69
-
70
- ## 4. File Structure
71
-
72
- ```
73
- locales/
74
- ├── en/
75
- │ ├── common.json
76
- │ ├── auth.json
77
- │ └── errors.json
78
- ├── tr/
79
- │ ├── common.json
80
- │ ├── auth.json
81
- │ └── errors.json
82
- └── ar/ # RTL
83
- └── ...
84
- ```
85
-
86
- ---
87
-
88
- ## 5. Best Practices
89
-
90
- ### DO ✅
91
-
92
- - Use translation keys, not raw text
93
- - Namespace translations by feature
94
- - Support pluralization
95
- - Handle date/number formats per locale
96
- - Plan for RTL from the start
97
- - Use ICU message format for complex strings
98
-
99
- ### DON'T ❌
100
-
101
- - Hardcode strings in components
102
- - Concatenate translated strings
103
- - Assume text length (German is 30% longer)
104
- - Forget about RTL layout
105
- - Mix languages in same file
106
-
107
- ---
108
-
109
- ## 6. Common Issues
110
-
111
- | Issue | Solution |
112
- |-------|----------|
113
- | Missing translation | Fallback to default language |
114
- | Hardcoded strings | Use linter/checker script |
115
- | Date format | Use Intl.DateTimeFormat |
116
- | Number format | Use Intl.NumberFormat |
117
- | Pluralization | Use ICU message format |
118
-
119
- ---
120
-
121
- ## 7. RTL Support
122
-
123
- ```css
124
- /* CSS Logical Properties */
125
- .container {
126
- margin-inline-start: 1rem; /* Not margin-left */
127
- padding-inline-end: 1rem; /* Not padding-right */
128
- }
129
-
130
- [dir="rtl"] .icon {
131
- transform: scaleX(-1);
132
- }
133
- ```
134
-
135
- ---
136
-
137
- ## 8. Checklist
138
-
139
- Before shipping:
140
-
141
- - [ ] All user-facing strings use translation keys
142
- - [ ] Locale files exist for all supported languages
143
- - [ ] Date/number formatting uses Intl API
144
- - [ ] RTL layout tested (if applicable)
145
- - [ ] Fallback language configured
146
- - [ ] No hardcoded strings in components
147
-
148
- ---
149
-
150
- ## Script
151
-
152
- | Script | Purpose | Command |
153
- |--------|---------|---------|
154
- | `scripts/i18n_checker.py` | Detect hardcoded strings & missing translations | `python scripts/i18n_checker.py <project_path>` |