thachvd-kit 1.0.29 → 1.0.30
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 +50 -149
- package/bin/cli.js +356 -284
- package/package.json +1 -10
- package/.agent/agents/backend-specialist.md +0 -263
- package/.agent/agents/code-archaeologist.md +0 -106
- package/.agent/agents/database-architect.md +0 -226
- package/.agent/agents/debugger.md +0 -225
- package/.agent/agents/devops-engineer.md +0 -242
- package/.agent/agents/documentation-writer.md +0 -104
- package/.agent/agents/explorer-agent.md +0 -73
- package/.agent/agents/frontend-specialist.md +0 -593
- package/.agent/agents/game-developer.md +0 -162
- package/.agent/agents/mobile-developer.md +0 -377
- package/.agent/agents/orchestrator.md +0 -416
- package/.agent/agents/penetration-tester.md +0 -188
- package/.agent/agents/performance-optimizer.md +0 -187
- package/.agent/agents/product-manager.md +0 -112
- package/.agent/agents/product-owner.md +0 -95
- package/.agent/agents/project-planner.md +0 -406
- package/.agent/agents/qa-automation-engineer.md +0 -103
- package/.agent/agents/security-auditor.md +0 -170
- package/.agent/agents/seo-specialist.md +0 -111
- package/.agent/agents/test-engineer.md +0 -158
- package/.agent/docs/architecture.md +0 -15
- package/.agent/docs/conventions.md +0 -16
- package/.agent/docs/getting-started.md +0 -95
- package/.agent/docs/project.md +0 -59
- package/.agent/docs/tooling.md +0 -136
- package/.agent/docs/workflow.md +0 -79
- package/.agent/rules/GEMINI.md +0 -62
- package/.agent/skills/api-design/SKILL.md +0 -156
- package/.agent/skills/api-patterns/SKILL.md +0 -81
- package/.agent/skills/api-patterns/api-style.md +0 -42
- package/.agent/skills/api-patterns/auth.md +0 -24
- package/.agent/skills/api-patterns/documentation.md +0 -26
- package/.agent/skills/api-patterns/graphql.md +0 -41
- package/.agent/skills/api-patterns/rate-limiting.md +0 -31
- package/.agent/skills/api-patterns/response.md +0 -37
- package/.agent/skills/api-patterns/rest.md +0 -40
- package/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
- package/.agent/skills/api-patterns/security-testing.md +0 -122
- package/.agent/skills/api-patterns/trpc.md +0 -41
- package/.agent/skills/api-patterns/versioning.md +0 -22
- package/.agent/skills/app-builder/SKILL.md +0 -75
- package/.agent/skills/app-builder/agent-coordination.md +0 -71
- package/.agent/skills/app-builder/feature-building.md +0 -53
- package/.agent/skills/app-builder/project-detection.md +0 -34
- package/.agent/skills/app-builder/scaffolding.md +0 -118
- package/.agent/skills/app-builder/tech-stack.md +0 -40
- package/.agent/skills/app-builder/templates/SKILL.md +0 -39
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
- package/.agent/skills/architecture/SKILL.md +0 -55
- package/.agent/skills/architecture/context-discovery.md +0 -43
- package/.agent/skills/architecture/examples.md +0 -94
- package/.agent/skills/architecture/pattern-selection.md +0 -68
- package/.agent/skills/architecture/patterns-reference.md +0 -50
- package/.agent/skills/architecture/trade-off-analysis.md +0 -77
- package/.agent/skills/bash-linux/SKILL.md +0 -199
- package/.agent/skills/behavioral-modes/SKILL.md +0 -242
- package/.agent/skills/brainstorming/SKILL.md +0 -163
- package/.agent/skills/brainstorming/dynamic-questioning.md +0 -350
- package/.agent/skills/clean-code/SKILL.md +0 -201
- package/.agent/skills/code-review-checklist/SKILL.md +0 -109
- package/.agent/skills/database-design/SKILL.md +0 -52
- package/.agent/skills/database-design/database-selection.md +0 -43
- package/.agent/skills/database-design/indexing.md +0 -39
- package/.agent/skills/database-design/migrations.md +0 -48
- package/.agent/skills/database-design/optimization.md +0 -36
- package/.agent/skills/database-design/orm-selection.md +0 -30
- package/.agent/skills/database-design/schema-design.md +0 -56
- package/.agent/skills/database-design/scripts/schema_validator.py +0 -172
- package/.agent/skills/deployment-procedures/SKILL.md +0 -241
- package/.agent/skills/desktop-design/SKILL.md +0 -25
- package/.agent/skills/dispatching-parallel-agents/SKILL.md +0 -112
- package/.agent/skills/doc.md +0 -177
- package/.agent/skills/docker-patterns/SKILL.md +0 -232
- package/.agent/skills/documentation-templates/SKILL.md +0 -194
- package/.agent/skills/executing-plans/SKILL.md +0 -61
- package/.agent/skills/finishing-a-development-branch/SKILL.md +0 -135
- package/.agent/skills/frontend-design/SKILL.md +0 -418
- package/.agent/skills/frontend-design/animation-guide.md +0 -331
- package/.agent/skills/frontend-design/color-system.md +0 -311
- package/.agent/skills/frontend-design/decision-trees.md +0 -418
- package/.agent/skills/frontend-design/motion-graphics.md +0 -306
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +0 -183
- package/.agent/skills/frontend-design/scripts/ux_audit.py +0 -722
- package/.agent/skills/frontend-design/typography-system.md +0 -345
- package/.agent/skills/frontend-design/ux-psychology.md +0 -1116
- package/.agent/skills/frontend-design/visual-effects.md +0 -383
- package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
- package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
- package/.agent/skills/game-development/SKILL.md +0 -167
- package/.agent/skills/game-development/game-art/SKILL.md +0 -185
- package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
- package/.agent/skills/game-development/game-design/SKILL.md +0 -129
- package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
- package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
- package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
- package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
- package/.agent/skills/game-development/web-games/SKILL.md +0 -150
- package/.agent/skills/geo-fundamentals/SKILL.md +0 -156
- package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +0 -289
- package/.agent/skills/golang-patterns/SKILL.md +0 -226
- package/.agent/skills/golang-testing/SKILL.md +0 -182
- package/.agent/skills/i18n-localization/SKILL.md +0 -154
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +0 -241
- package/.agent/skills/intelligent-routing/SKILL.md +0 -335
- package/.agent/skills/laravel-patterns/SKILL.md +0 -224
- package/.agent/skills/laravel-security/SKILL.md +0 -171
- package/.agent/skills/laravel-tdd/SKILL.md +0 -149
- package/.agent/skills/lint-and-validate/SKILL.md +0 -45
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +0 -184
- package/.agent/skills/lint-and-validate/scripts/type_coverage.py +0 -173
- package/.agent/skills/mcp-builder/SKILL.md +0 -176
- package/.agent/skills/mobile-design/SKILL.md +0 -394
- package/.agent/skills/mobile-design/decision-trees.md +0 -516
- package/.agent/skills/mobile-design/mobile-backend.md +0 -491
- package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
- package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
- package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
- package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
- package/.agent/skills/mobile-design/mobile-performance.md +0 -767
- package/.agent/skills/mobile-design/mobile-testing.md +0 -356
- package/.agent/skills/mobile-design/mobile-typography.md +0 -433
- package/.agent/skills/mobile-design/platform-android.md +0 -666
- package/.agent/skills/mobile-design/platform-ios.md +0 -561
- package/.agent/skills/mobile-design/scripts/mobile_audit.py +0 -670
- package/.agent/skills/mobile-design/touch-psychology.md +0 -537
- package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
- package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
- package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
- package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
- package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
- package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
- package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
- package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
- package/.agent/skills/nextjs-react-expert/SKILL.md +0 -286
- package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
- package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
- package/.agent/skills/nodejs-best-practices/SKILL.md +0 -333
- package/.agent/skills/parallel-agents/SKILL.md +0 -175
- package/.agent/skills/performance-profiling/SKILL.md +0 -143
- package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
- package/.agent/skills/plan-writing/SKILL.md +0 -152
- package/.agent/skills/powershell-windows/SKILL.md +0 -167
- package/.agent/skills/project-onboarding/SKILL.md +0 -42
- package/.agent/skills/python-patterns/SKILL.md +0 -441
- package/.agent/skills/react-frontend/SKILL.md +0 -25
- package/.agent/skills/receiving-code-review/SKILL.md +0 -120
- package/.agent/skills/red-team-tactics/SKILL.md +0 -199
- package/.agent/skills/requesting-code-review/SKILL.md +0 -67
- package/.agent/skills/rust-pro/SKILL.md +0 -176
- package/.agent/skills/seo-fundamentals/SKILL.md +0 -129
- package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
- package/.agent/skills/server-management/SKILL.md +0 -161
- package/.agent/skills/subagent-driven-development/SKILL.md +0 -76
- package/.agent/skills/systematic-debugging/SKILL.md +0 -109
- package/.agent/skills/tailwind-patterns/SKILL.md +0 -269
- package/.agent/skills/tdd-workflow/SKILL.md +0 -149
- package/.agent/skills/testing-patterns/SKILL.md +0 -178
- package/.agent/skills/testing-patterns/scripts/test_runner.py +0 -219
- package/.agent/skills/using-git-worktrees/SKILL.md +0 -121
- package/.agent/skills/verification-before-completion/SKILL.md +0 -99
- package/.agent/skills/vulnerability-scanner/SKILL.md +0 -276
- package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
- package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
- package/.agent/skills/web-design-guidelines/SKILL.md +0 -57
- package/.agent/skills/webapp-testing/SKILL.md +0 -187
- package/.agent/skills/webapp-testing/scripts/playwright_runner.py +0 -173
- package/.agent/skills/writing-skills/SKILL.md +0 -170
- package/.agent/workflows/brainstorm.md +0 -113
- package/.agent/workflows/create.md +0 -59
- package/.agent/workflows/debug.md +0 -103
- package/.agent/workflows/deploy.md +0 -176
- package/.agent/workflows/enhance.md +0 -63
- package/.agent/workflows/forge-debug.md +0 -12
- package/.agent/workflows/forge-fast.md +0 -22
- package/.agent/workflows/forge-release.md +0 -12
- package/.agent/workflows/forge-research.md +0 -24
- package/.agent/workflows/forge-review.md +0 -12
- package/.agent/workflows/forge-task.md +0 -37
- package/.agent/workflows/orchestrate.md +0 -237
- package/.agent/workflows/plan.md +0 -89
- package/.agent/workflows/preview.md +0 -81
- package/.agent/workflows/release.md +0 -42
- package/.agent/workflows/review.md +0 -125
- package/.agent/workflows/simple.md +0 -42
- package/.agent/workflows/spec.md +0 -140
- package/.agent/workflows/status.md +0 -86
- package/.agent/workflows/task.md +0 -59
- package/.agent/workflows/test.md +0 -144
- package/.agent/workflows/ui-ux-pro-max.md +0 -296
- package/agents/backend-specialist.md +0 -263
- package/agents/code-archaeologist.md +0 -106
- package/agents/database-architect.md +0 -226
- package/agents/debugger.md +0 -225
- package/agents/devops-engineer.md +0 -242
- package/agents/documentation-writer.md +0 -104
- package/agents/explorer-agent.md +0 -73
- package/agents/frontend-specialist.md +0 -593
- package/agents/game-developer.md +0 -162
- package/agents/mobile-developer.md +0 -377
- package/agents/orchestrator.md +0 -416
- package/agents/penetration-tester.md +0 -188
- package/agents/performance-optimizer.md +0 -187
- package/agents/product-manager.md +0 -112
- package/agents/product-owner.md +0 -95
- package/agents/project-planner.md +0 -406
- package/agents/qa-automation-engineer.md +0 -103
- package/agents/security-auditor.md +0 -170
- package/agents/seo-specialist.md +0 -111
- package/agents/test-engineer.md +0 -158
- package/commands/forge-debug.md +0 -12
- package/commands/forge-fast.md +0 -22
- package/commands/forge-release.md +0 -12
- package/commands/forge-research.md +0 -24
- package/commands/forge-review.md +0 -12
- package/commands/forge-task.md +0 -37
- package/kit/PROMPT_RECIPE.md +0 -30
- package/kit/README.md +0 -30
- package/prompts/debug.md +0 -11
- package/prompts/release.md +0 -11
- package/prompts/simple.md +0 -11
- package/prompts/spec.md +0 -11
- package/prompts/task.md +0 -12
- package/rules/GEMINI.md +0 -45
- package/scripts/auto_preview.py +0 -148
- package/scripts/checklist.py +0 -217
- package/scripts/session_manager.py +0 -120
- package/scripts/verify_all.py +0 -327
- package/skills/api-design/SKILL.md +0 -156
- package/skills/api-patterns/SKILL.md +0 -81
- package/skills/api-patterns/api-style.md +0 -42
- package/skills/api-patterns/auth.md +0 -24
- package/skills/api-patterns/documentation.md +0 -26
- package/skills/api-patterns/graphql.md +0 -41
- package/skills/api-patterns/rate-limiting.md +0 -31
- package/skills/api-patterns/response.md +0 -37
- package/skills/api-patterns/rest.md +0 -40
- package/skills/api-patterns/scripts/api_validator.py +0 -211
- package/skills/api-patterns/security-testing.md +0 -122
- package/skills/api-patterns/trpc.md +0 -41
- package/skills/api-patterns/versioning.md +0 -22
- package/skills/app-builder/SKILL.md +0 -75
- package/skills/app-builder/agent-coordination.md +0 -71
- package/skills/app-builder/feature-building.md +0 -53
- package/skills/app-builder/project-detection.md +0 -34
- package/skills/app-builder/scaffolding.md +0 -118
- package/skills/app-builder/tech-stack.md +0 -40
- package/skills/app-builder/templates/SKILL.md +0 -39
- package/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
- package/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
- package/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
- package/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
- package/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
- package/skills/architecture/SKILL.md +0 -55
- package/skills/architecture/context-discovery.md +0 -43
- package/skills/architecture/examples.md +0 -94
- package/skills/architecture/pattern-selection.md +0 -68
- package/skills/architecture/patterns-reference.md +0 -50
- package/skills/architecture/trade-off-analysis.md +0 -77
- package/skills/bash-linux/SKILL.md +0 -199
- package/skills/behavioral-modes/SKILL.md +0 -242
- package/skills/brainstorming/SKILL.md +0 -163
- package/skills/brainstorming/dynamic-questioning.md +0 -350
- package/skills/clean-code/SKILL.md +0 -201
- package/skills/code-review-checklist/SKILL.md +0 -142
- package/skills/database-design/SKILL.md +0 -52
- package/skills/database-design/database-selection.md +0 -43
- package/skills/database-design/indexing.md +0 -39
- package/skills/database-design/migrations.md +0 -48
- package/skills/database-design/optimization.md +0 -36
- package/skills/database-design/orm-selection.md +0 -30
- package/skills/database-design/schema-design.md +0 -56
- package/skills/database-design/scripts/schema_validator.py +0 -172
- package/skills/deployment-procedures/SKILL.md +0 -241
- package/skills/desktop-design/SKILL.md +0 -25
- package/skills/dispatching-parallel-agents/SKILL.md +0 -112
- package/skills/doc.md +0 -177
- package/skills/docker-patterns/SKILL.md +0 -232
- package/skills/documentation-templates/SKILL.md +0 -194
- package/skills/executing-plans/SKILL.md +0 -61
- package/skills/finishing-a-development-branch/SKILL.md +0 -135
- package/skills/frontend-design/SKILL.md +0 -418
- package/skills/frontend-design/animation-guide.md +0 -331
- package/skills/frontend-design/color-system.md +0 -311
- package/skills/frontend-design/decision-trees.md +0 -418
- package/skills/frontend-design/motion-graphics.md +0 -306
- package/skills/frontend-design/scripts/accessibility_checker.py +0 -183
- package/skills/frontend-design/scripts/ux_audit.py +0 -722
- package/skills/frontend-design/typography-system.md +0 -345
- package/skills/frontend-design/ux-psychology.md +0 -1116
- package/skills/frontend-design/visual-effects.md +0 -383
- package/skills/game-development/2d-games/SKILL.md +0 -119
- package/skills/game-development/3d-games/SKILL.md +0 -135
- package/skills/game-development/SKILL.md +0 -167
- package/skills/game-development/game-art/SKILL.md +0 -185
- package/skills/game-development/game-audio/SKILL.md +0 -190
- package/skills/game-development/game-design/SKILL.md +0 -129
- package/skills/game-development/mobile-games/SKILL.md +0 -108
- package/skills/game-development/multiplayer/SKILL.md +0 -132
- package/skills/game-development/pc-games/SKILL.md +0 -144
- package/skills/game-development/vr-ar/SKILL.md +0 -123
- package/skills/game-development/web-games/SKILL.md +0 -150
- package/skills/geo-fundamentals/SKILL.md +0 -156
- package/skills/geo-fundamentals/scripts/geo_checker.py +0 -289
- package/skills/golang-patterns/SKILL.md +0 -226
- package/skills/golang-testing/SKILL.md +0 -182
- package/skills/i18n-localization/SKILL.md +0 -154
- package/skills/i18n-localization/scripts/i18n_checker.py +0 -241
- package/skills/intelligent-routing/SKILL.md +0 -335
- package/skills/laravel-patterns/SKILL.md +0 -224
- package/skills/laravel-security/SKILL.md +0 -171
- package/skills/laravel-tdd/SKILL.md +0 -149
- package/skills/lint-and-validate/SKILL.md +0 -45
- package/skills/lint-and-validate/scripts/lint_runner.py +0 -184
- package/skills/lint-and-validate/scripts/type_coverage.py +0 -173
- package/skills/mcp-builder/SKILL.md +0 -176
- package/skills/mobile-design/SKILL.md +0 -394
- package/skills/mobile-design/decision-trees.md +0 -516
- package/skills/mobile-design/mobile-backend.md +0 -491
- package/skills/mobile-design/mobile-color-system.md +0 -420
- package/skills/mobile-design/mobile-debugging.md +0 -122
- package/skills/mobile-design/mobile-design-thinking.md +0 -357
- package/skills/mobile-design/mobile-navigation.md +0 -458
- package/skills/mobile-design/mobile-performance.md +0 -767
- package/skills/mobile-design/mobile-testing.md +0 -356
- package/skills/mobile-design/mobile-typography.md +0 -433
- package/skills/mobile-design/platform-android.md +0 -666
- package/skills/mobile-design/platform-ios.md +0 -561
- package/skills/mobile-design/scripts/mobile_audit.py +0 -670
- package/skills/mobile-design/touch-psychology.md +0 -537
- package/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
- package/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
- package/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
- package/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
- package/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
- package/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
- package/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
- package/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
- package/skills/nextjs-react-expert/SKILL.md +0 -286
- package/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
- package/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
- package/skills/nodejs-best-practices/SKILL.md +0 -333
- package/skills/parallel-agents/SKILL.md +0 -175
- package/skills/performance-profiling/SKILL.md +0 -143
- package/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
- package/skills/plan-writing/SKILL.md +0 -152
- package/skills/powershell-windows/SKILL.md +0 -167
- package/skills/project-onboarding/SKILL.md +0 -42
- package/skills/python-patterns/SKILL.md +0 -441
- package/skills/react-frontend/SKILL.md +0 -25
- package/skills/receiving-code-review/SKILL.md +0 -120
- package/skills/red-team-tactics/SKILL.md +0 -199
- package/skills/requesting-code-review/SKILL.md +0 -67
- package/skills/rust-pro/SKILL.md +0 -176
- package/skills/seo-fundamentals/SKILL.md +0 -129
- package/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
- package/skills/server-management/SKILL.md +0 -161
- package/skills/subagent-driven-development/SKILL.md +0 -76
- package/skills/systematic-debugging/SKILL.md +0 -109
- package/skills/tailwind-patterns/SKILL.md +0 -269
- package/skills/tdd-workflow/SKILL.md +0 -173
- package/skills/testing-patterns/SKILL.md +0 -178
- package/skills/testing-patterns/scripts/test_runner.py +0 -219
- package/skills/using-git-worktrees/SKILL.md +0 -121
- package/skills/verification-before-completion/SKILL.md +0 -113
- package/skills/vulnerability-scanner/SKILL.md +0 -276
- package/skills/vulnerability-scanner/checklists.md +0 -121
- package/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
- package/skills/web-design-guidelines/SKILL.md +0 -57
- package/skills/webapp-testing/SKILL.md +0 -187
- package/skills/webapp-testing/scripts/playwright_runner.py +0 -173
- package/skills/writing-skills/SKILL.md +0 -170
- package/workflows/brainstorm.md +0 -113
- package/workflows/create.md +0 -59
- package/workflows/debug.md +0 -103
- package/workflows/deploy.md +0 -176
- package/workflows/enhance.md +0 -63
- package/workflows/orchestrate.md +0 -237
- package/workflows/plan.md +0 -89
- package/workflows/preview.md +0 -81
- package/workflows/release.md +0 -42
- package/workflows/simple.md +0 -42
- package/workflows/status.md +0 -86
- package/workflows/task.md +0 -59
- package/workflows/test.md +0 -144
- package/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,226 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: golang-patterns
|
|
3
|
-
description: Go development patterns and idioms. Use when writing Go backend services, APIs, CLI tools — covers error handling, concurrency, interfaces, project layout, and tooling.
|
|
4
|
-
allowed-tools: Read, Edit, Write, Bash
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Go Development Patterns
|
|
8
|
-
|
|
9
|
-
## Core Principles
|
|
10
|
-
|
|
11
|
-
| Principle | Rule |
|
|
12
|
-
|-----------|------|
|
|
13
|
-
| Simplicity over cleverness | Code should be obvious, not smart |
|
|
14
|
-
| Errors are values | Return errors, don't panic |
|
|
15
|
-
| Accept interfaces, return structs | Flexible input, concrete output |
|
|
16
|
-
| Zero value useful | Types work without initialization |
|
|
17
|
-
| Context as first param | Always `ctx context.Context` first |
|
|
18
|
-
|
|
19
|
-
## Project Layout
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
myproject/
|
|
23
|
-
├── cmd/
|
|
24
|
-
│ └── myapp/
|
|
25
|
-
│ └── main.go # Entry point
|
|
26
|
-
├── internal/
|
|
27
|
-
│ ├── handler/ # HTTP handlers
|
|
28
|
-
│ ├── service/ # Business logic
|
|
29
|
-
│ ├── repository/ # Data access
|
|
30
|
-
│ └── config/ # Configuration
|
|
31
|
-
├── pkg/
|
|
32
|
-
│ └── client/ # Public API client
|
|
33
|
-
├── api/
|
|
34
|
-
│ └── v1/ # OpenAPI / proto definitions
|
|
35
|
-
├── testdata/
|
|
36
|
-
├── go.mod
|
|
37
|
-
└── Makefile
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Error Handling
|
|
41
|
-
|
|
42
|
-
```go
|
|
43
|
-
// Wrap errors with context
|
|
44
|
-
func LoadConfig(path string) (*Config, error) {
|
|
45
|
-
data, err := os.ReadFile(path)
|
|
46
|
-
if err != nil {
|
|
47
|
-
return nil, fmt.Errorf("load config %s: %w", path, err)
|
|
48
|
-
}
|
|
49
|
-
var cfg Config
|
|
50
|
-
if err := json.Unmarshal(data, &cfg); err != nil {
|
|
51
|
-
return nil, fmt.Errorf("parse config %s: %w", path, err)
|
|
52
|
-
}
|
|
53
|
-
return &cfg, nil
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Sentinel errors
|
|
57
|
-
var (
|
|
58
|
-
ErrNotFound = errors.New("resource not found")
|
|
59
|
-
ErrUnauthorized = errors.New("unauthorized")
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
// Type assertions
|
|
63
|
-
var validationErr *ValidationError
|
|
64
|
-
if errors.As(err, &validationErr) {
|
|
65
|
-
log.Printf("field %s: %s", validationErr.Field, validationErr.Message)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// NEVER ignore errors
|
|
69
|
-
result, _ := doSomething() // ❌ Bad
|
|
70
|
-
result, err := doSomething() // ✅ Good
|
|
71
|
-
if err != nil { return err }
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Concurrency Patterns
|
|
75
|
-
|
|
76
|
-
```go
|
|
77
|
-
// Worker pool
|
|
78
|
-
func WorkerPool(jobs <-chan Job, results chan<- Result, numWorkers int) {
|
|
79
|
-
var wg sync.WaitGroup
|
|
80
|
-
for i := 0; i < numWorkers; i++ {
|
|
81
|
-
wg.Add(1)
|
|
82
|
-
go func() {
|
|
83
|
-
defer wg.Done()
|
|
84
|
-
for job := range jobs {
|
|
85
|
-
results <- process(job)
|
|
86
|
-
}
|
|
87
|
-
}()
|
|
88
|
-
}
|
|
89
|
-
wg.Wait()
|
|
90
|
-
close(results)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Context for timeouts
|
|
94
|
-
func FetchWithTimeout(ctx context.Context, url string) ([]byte, error) {
|
|
95
|
-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
|
96
|
-
defer cancel()
|
|
97
|
-
req, _ := http.NewRequestWithContext(ctx, "GET", url, nil)
|
|
98
|
-
resp, err := http.DefaultClient.Do(req)
|
|
99
|
-
if err != nil {
|
|
100
|
-
return nil, fmt.Errorf("fetch %s: %w", url, err)
|
|
101
|
-
}
|
|
102
|
-
defer resp.Body.Close()
|
|
103
|
-
return io.ReadAll(resp.Body)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// errgroup for coordinated goroutines
|
|
107
|
-
func FetchAll(ctx context.Context, urls []string) ([][]byte, error) {
|
|
108
|
-
g, ctx := errgroup.WithContext(ctx)
|
|
109
|
-
results := make([][]byte, len(urls))
|
|
110
|
-
for i, url := range urls {
|
|
111
|
-
i, url := i, url
|
|
112
|
-
g.Go(func() error {
|
|
113
|
-
data, err := FetchWithTimeout(ctx, url)
|
|
114
|
-
if err != nil { return err }
|
|
115
|
-
results[i] = data
|
|
116
|
-
return nil
|
|
117
|
-
})
|
|
118
|
-
}
|
|
119
|
-
return results, g.Wait()
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Graceful shutdown
|
|
123
|
-
func GracefulShutdown(server *http.Server) {
|
|
124
|
-
quit := make(chan os.Signal, 1)
|
|
125
|
-
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
|
|
126
|
-
<-quit
|
|
127
|
-
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
|
128
|
-
defer cancel()
|
|
129
|
-
server.Shutdown(ctx)
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## Interface Design
|
|
134
|
-
|
|
135
|
-
```go
|
|
136
|
-
// Small, focused interfaces
|
|
137
|
-
type Reader interface { Read(p []byte) (n int, err error) }
|
|
138
|
-
type Writer interface { Write(p []byte) (n int, err error) }
|
|
139
|
-
|
|
140
|
-
// Accept interfaces, return structs
|
|
141
|
-
func ProcessData(r io.Reader) (*Result, error) {
|
|
142
|
-
data, err := io.ReadAll(r)
|
|
143
|
-
if err != nil { return nil, err }
|
|
144
|
-
return &Result{Data: data}, nil
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Struct Design
|
|
149
|
-
|
|
150
|
-
```go
|
|
151
|
-
// Functional options pattern
|
|
152
|
-
type Server struct {
|
|
153
|
-
host string
|
|
154
|
-
port int
|
|
155
|
-
timeout time.Duration
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
type Option func(*Server)
|
|
159
|
-
|
|
160
|
-
func WithTimeout(d time.Duration) Option { return func(s *Server) { s.timeout = d } }
|
|
161
|
-
|
|
162
|
-
func NewServer(opts ...Option) *Server {
|
|
163
|
-
s := &Server{host: "localhost", port: 8080, timeout: 30 * time.Second}
|
|
164
|
-
for _, opt := range opts { opt(s) }
|
|
165
|
-
return s
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// DI over global state
|
|
169
|
-
type Handler struct { db *sql.DB } // ✅ Good
|
|
170
|
-
var db *sql.DB; func init() { db, _ = ... } // ❌ Bad
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## Memory and Performance
|
|
174
|
-
|
|
175
|
-
```go
|
|
176
|
-
// Preallocate slices
|
|
177
|
-
users := make([]User, 0, len(rows)) // ✅ Known size
|
|
178
|
-
var users []User // ❌ Unknown size, reallocates
|
|
179
|
-
|
|
180
|
-
// sync.Pool for frequent allocations
|
|
181
|
-
var bufPool = sync.Pool{New: func() any { return new(bytes.Buffer) }}
|
|
182
|
-
buf := bufPool.Get().(*bytes.Buffer)
|
|
183
|
-
buf.Reset()
|
|
184
|
-
defer bufPool.Put(buf)
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
## Tooling
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
go fmt ./... # Format (mandatory)
|
|
191
|
-
go vet ./... # Static analysis
|
|
192
|
-
golangci-lint run # Comprehensive linting
|
|
193
|
-
go test ./... -race # Race detector (always use in CI)
|
|
194
|
-
go mod tidy # Clean dependencies
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
## Anti-Patterns
|
|
198
|
-
|
|
199
|
-
```go
|
|
200
|
-
// ❌ Naked returns in long functions
|
|
201
|
-
func process() (result int, err error) { return } // What is returned?
|
|
202
|
-
|
|
203
|
-
// ❌ Panic for control flow
|
|
204
|
-
panic(err) // Use return err instead
|
|
205
|
-
|
|
206
|
-
// ❌ Context in struct
|
|
207
|
-
type Req struct { ctx context.Context } // Must be first param, not field
|
|
208
|
-
|
|
209
|
-
// ❌ Mixing value and pointer receivers
|
|
210
|
-
func (c Counter) Value() int { return c.n }
|
|
211
|
-
func (c *Counter) Inc() { c.n++ } // Pick one style
|
|
212
|
-
|
|
213
|
-
// ❌ Package-level mutable state
|
|
214
|
-
var globalDB *sql.DB // Break this dependency with DI
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
## Quick Reference Idioms
|
|
218
|
-
|
|
219
|
-
| Idiom | Description |
|
|
220
|
-
|-------|-------------|
|
|
221
|
-
| `if err != nil { return err }` | Always handle errors |
|
|
222
|
-
| `defer f.Close()` | Cleanup immediately after open |
|
|
223
|
-
| `ctx, cancel := context.WithTimeout(...)` | Always defer cancel() |
|
|
224
|
-
| `i, v := i, v` | Capture loop variables in goroutines |
|
|
225
|
-
| `make([]T, 0, cap)` | Preallocate when size is known |
|
|
226
|
-
| Return early | Handle errors first, keep happy path flat |
|