flyee 0.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.
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/bin/install.js +357 -0
- package/bridge/bridge.py +1780 -0
- package/bridge/local_tracker.py +722 -0
- package/core/agents/backend-specialist.md +266 -0
- package/core/agents/code-archaeologist.md +106 -0
- package/core/agents/database-architect.md +226 -0
- package/core/agents/debugger.md +225 -0
- package/core/agents/devops-engineer.md +323 -0
- package/core/agents/documentation-writer.md +104 -0
- package/core/agents/explorer-agent.md +73 -0
- package/core/agents/frontend-specialist.md +743 -0
- package/core/agents/game-developer.md +162 -0
- package/core/agents/mobile-developer.md +377 -0
- package/core/agents/orchestrator.md +416 -0
- package/core/agents/penetration-tester.md +188 -0
- package/core/agents/performance-optimizer.md +187 -0
- package/core/agents/product-manager.md +112 -0
- package/core/agents/product-owner.md +95 -0
- package/core/agents/project-planner.md +470 -0
- package/core/agents/qa-automation-engineer.md +103 -0
- package/core/agents/security-auditor.md +170 -0
- package/core/agents/seo-specialist.md +111 -0
- package/core/agents/stitch-designer.md +190 -0
- package/core/agents/tdd-reviewer.md +282 -0
- package/core/agents/test-engineer.md +158 -0
- package/core/scripts/auto_preview.py +148 -0
- package/core/scripts/checklist.py +243 -0
- package/core/scripts/cost_report.py +149 -0
- package/core/scripts/doc-sync-check.py +461 -0
- package/core/scripts/parse_user_stories.py +79 -0
- package/core/scripts/prepare_notion_updates.py +172 -0
- package/core/scripts/print_create_payload.py +18 -0
- package/core/scripts/session_manager.py +120 -0
- package/core/scripts/task_complete.py +127 -0
- package/core/scripts/verify_all.py +327 -0
- package/core/skills/analytics-strategy/SKILL.md +128 -0
- package/core/skills/api-patterns/SKILL.md +81 -0
- package/core/skills/api-patterns/api-style.md +42 -0
- package/core/skills/api-patterns/auth.md +24 -0
- package/core/skills/api-patterns/documentation.md +26 -0
- package/core/skills/api-patterns/graphql.md +41 -0
- package/core/skills/api-patterns/rate-limiting.md +31 -0
- package/core/skills/api-patterns/response.md +37 -0
- package/core/skills/api-patterns/rest.md +40 -0
- package/core/skills/api-patterns/scripts/api_validator.py +211 -0
- package/core/skills/api-patterns/security-testing.md +122 -0
- package/core/skills/api-patterns/trpc.md +41 -0
- package/core/skills/api-patterns/versioning.md +22 -0
- package/core/skills/app-builder/SKILL.md +75 -0
- package/core/skills/app-builder/agent-coordination.md +71 -0
- package/core/skills/app-builder/feature-building.md +53 -0
- package/core/skills/app-builder/project-detection.md +34 -0
- package/core/skills/app-builder/scaffolding.md +118 -0
- package/core/skills/app-builder/tech-stack.md +40 -0
- package/core/skills/app-builder/templates/SKILL.md +39 -0
- package/core/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/core/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/core/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/core/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/core/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/core/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/core/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/core/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/core/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/core/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/core/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/core/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/core/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/core/skills/architecture/SKILL.md +55 -0
- package/core/skills/architecture/context-discovery.md +43 -0
- package/core/skills/architecture/examples.md +94 -0
- package/core/skills/architecture/pattern-selection.md +68 -0
- package/core/skills/architecture/patterns-reference.md +50 -0
- package/core/skills/architecture/trade-off-analysis.md +77 -0
- package/core/skills/atomic-design/SKILL.md +282 -0
- package/core/skills/atomic-design/references/classification-guide.md +132 -0
- package/core/skills/atomic-design/references/quality-checklist.md +60 -0
- package/core/skills/atomic-design/references/stacks/stack-blade.md +254 -0
- package/core/skills/atomic-design/references/stacks/stack-nextjs.md +272 -0
- package/core/skills/atomic-design/references/stacks/stack-react.md +239 -0
- package/core/skills/atomic-design/references/stacks/stack-vue.md +224 -0
- package/core/skills/bash-linux/SKILL.md +199 -0
- package/core/skills/behavioral-modes/SKILL.md +242 -0
- package/core/skills/brainstorming/SKILL.md +163 -0
- package/core/skills/brainstorming/dynamic-questioning.md +373 -0
- package/core/skills/checkpointing-patterns/SKILL.md +163 -0
- package/core/skills/clean-code/SKILL.md +201 -0
- package/core/skills/code-review-checklist/SKILL.md +109 -0
- package/core/skills/code-truth-validation/SKILL.md +149 -0
- package/core/skills/component-library-discovery/SKILL.md +154 -0
- package/core/skills/content-strategy/SKILL.md +222 -0
- package/core/skills/context-budget/SKILL.md +155 -0
- package/core/skills/context-gathering-patterns/SKILL.md +278 -0
- package/core/skills/cost-tracking/SKILL.md +206 -0
- package/core/skills/database-design/SKILL.md +52 -0
- package/core/skills/database-design/database-selection.md +43 -0
- package/core/skills/database-design/indexing.md +39 -0
- package/core/skills/database-design/migrations.md +48 -0
- package/core/skills/database-design/optimization.md +36 -0
- package/core/skills/database-design/orm-selection.md +30 -0
- package/core/skills/database-design/schema-design.md +56 -0
- package/core/skills/database-design/scripts/schema_validator.py +172 -0
- package/core/skills/deployment-procedures/SKILL.md +295 -0
- package/core/skills/design-md/README.md +34 -0
- package/core/skills/design-md/SKILL.md +172 -0
- package/core/skills/design-md/examples/DESIGN.md +154 -0
- package/core/skills/design-system-enforcement/SKILL.md +339 -0
- package/core/skills/doc.md +177 -0
- package/core/skills/document-registry/SKILL.md +130 -0
- package/core/skills/documentation-publishing/SKILL.md +174 -0
- package/core/skills/documentation-templates/SKILL.md +194 -0
- package/core/skills/enhance-prompt/README.md +34 -0
- package/core/skills/enhance-prompt/SKILL.md +204 -0
- package/core/skills/enhance-prompt/references/KEYWORDS.md +114 -0
- package/core/skills/frontend-design/SKILL.md +430 -0
- package/core/skills/frontend-design/animation-guide.md +331 -0
- package/core/skills/frontend-design/color-system.md +311 -0
- package/core/skills/frontend-design/decision-trees.md +418 -0
- package/core/skills/frontend-design/motion-graphics.md +306 -0
- package/core/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/core/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/core/skills/frontend-design/typography-system.md +345 -0
- package/core/skills/frontend-design/ux-psychology.md +541 -0
- package/core/skills/frontend-design/visual-effects.md +383 -0
- package/core/skills/game-development/2d-games/SKILL.md +119 -0
- package/core/skills/game-development/3d-games/SKILL.md +135 -0
- package/core/skills/game-development/SKILL.md +167 -0
- package/core/skills/game-development/game-art/SKILL.md +185 -0
- package/core/skills/game-development/game-audio/SKILL.md +190 -0
- package/core/skills/game-development/game-design/SKILL.md +129 -0
- package/core/skills/game-development/mobile-games/SKILL.md +108 -0
- package/core/skills/game-development/multiplayer/SKILL.md +132 -0
- package/core/skills/game-development/pc-games/SKILL.md +144 -0
- package/core/skills/game-development/vr-ar/SKILL.md +123 -0
- package/core/skills/game-development/web-games/SKILL.md +150 -0
- package/core/skills/geo-fundamentals/SKILL.md +156 -0
- package/core/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/core/skills/git-workflow/SKILL.md +263 -0
- package/core/skills/history-check-patterns/SKILL.md +125 -0
- package/core/skills/i18n-localization/SKILL.md +154 -0
- package/core/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/core/skills/integration-completeness/SKILL.md +219 -0
- package/core/skills/intelligent-routing/SKILL.md +370 -0
- package/core/skills/lint-and-validate/SKILL.md +45 -0
- package/core/skills/lint-and-validate/scripts/lint_runner.py +173 -0
- package/core/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/core/skills/local-verification/SKILL.md +195 -0
- package/core/skills/mcp-builder/SKILL.md +176 -0
- package/core/skills/mobile-design/SKILL.md +394 -0
- package/core/skills/mobile-design/decision-trees.md +516 -0
- package/core/skills/mobile-design/mobile-backend.md +491 -0
- package/core/skills/mobile-design/mobile-color-system.md +420 -0
- package/core/skills/mobile-design/mobile-debugging.md +122 -0
- package/core/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/core/skills/mobile-design/mobile-navigation.md +458 -0
- package/core/skills/mobile-design/mobile-performance.md +767 -0
- package/core/skills/mobile-design/mobile-testing.md +356 -0
- package/core/skills/mobile-design/mobile-typography.md +433 -0
- package/core/skills/mobile-design/platform-android.md +666 -0
- package/core/skills/mobile-design/platform-ios.md +561 -0
- package/core/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/core/skills/mobile-design/touch-psychology.md +537 -0
- package/core/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/core/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/core/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/core/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/core/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/core/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/core/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/core/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/core/skills/nextjs-react-expert/SKILL.md +267 -0
- package/core/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/core/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/core/skills/nodejs-best-practices/SKILL.md +333 -0
- package/core/skills/notion-task-patterns/SKILL.md +2529 -0
- package/core/skills/page-specifications/SKILL.md +367 -0
- package/core/skills/parallel-agents/SKILL.md +175 -0
- package/core/skills/performance-profiling/SKILL.md +143 -0
- package/core/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/core/skills/plan-writing/SKILL.md +190 -0
- package/core/skills/powershell-windows/SKILL.md +167 -0
- package/core/skills/project-foundation/SKILL.md +117 -0
- package/core/skills/project-setup/SKILL.md +141 -0
- package/core/skills/project-tracking-patterns/SKILL.md +357 -0
- package/core/skills/project-type-discovery/SKILL.md +239 -0
- package/core/skills/python-patterns/SKILL.md +441 -0
- package/core/skills/qa-test-generation/SKILL.md +156 -0
- package/core/skills/react-components/README.md +36 -0
- package/core/skills/react-components/SKILL.md +47 -0
- package/core/skills/react-components/examples/gold-standard-card.tsx +80 -0
- package/core/skills/react-components/package-lock.json +231 -0
- package/core/skills/react-components/package.json +16 -0
- package/core/skills/react-components/resources/architecture-checklist.md +15 -0
- package/core/skills/react-components/resources/component-template.tsx +37 -0
- package/core/skills/react-components/resources/stitch-api-reference.md +14 -0
- package/core/skills/react-components/resources/style-guide.json +27 -0
- package/core/skills/react-components/scripts/fetch-stitch.sh +30 -0
- package/core/skills/react-components/scripts/validate.js +68 -0
- package/core/skills/red-team-tactics/SKILL.md +199 -0
- package/core/skills/remotion/README.md +105 -0
- package/core/skills/remotion/SKILL.md +393 -0
- package/core/skills/remotion/examples/WalkthroughComposition.tsx +78 -0
- package/core/skills/remotion/examples/screens.json +56 -0
- package/core/skills/remotion/resources/composition-checklist.md +124 -0
- package/core/skills/remotion/resources/screen-slide-template.tsx +123 -0
- package/core/skills/remotion/scripts/download-stitch-asset.sh +38 -0
- package/core/skills/seo-fundamentals/SKILL.md +129 -0
- package/core/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/core/skills/server-management/SKILL.md +161 -0
- package/core/skills/session-resilience/SKILL.md +199 -0
- package/core/skills/shadcn-ui/README.md +248 -0
- package/core/skills/shadcn-ui/SKILL.md +326 -0
- package/core/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
- package/core/skills/shadcn-ui/examples/data-table.tsx +313 -0
- package/core/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
- package/core/skills/shadcn-ui/resources/component-catalog.md +481 -0
- package/core/skills/shadcn-ui/resources/customization-guide.md +516 -0
- package/core/skills/shadcn-ui/resources/migration-guide.md +463 -0
- package/core/skills/shadcn-ui/resources/setup-guide.md +412 -0
- package/core/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
- package/core/skills/state-machine/SKILL.md +264 -0
- package/core/skills/stitch-loop/README.md +54 -0
- package/core/skills/stitch-loop/SKILL.md +203 -0
- package/core/skills/stitch-loop/examples/SITE.md +73 -0
- package/core/skills/stitch-loop/examples/next-prompt.md +25 -0
- package/core/skills/stitch-loop/resources/baton-schema.md +61 -0
- package/core/skills/stitch-loop/resources/site-template.md +104 -0
- package/core/skills/systematic-debugging/SKILL.md +109 -0
- package/core/skills/tailwind-patterns/SKILL.md +284 -0
- package/core/skills/tdd-validation/SKILL.md +243 -0
- package/core/skills/tdd-workflow/SKILL.md +284 -0
- package/core/skills/testing-patterns/SKILL.md +196 -0
- package/core/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/core/skills/ui-ux-discovery/SKILL.md +329 -0
- package/core/skills/ui-validation/SKILL.md +190 -0
- package/core/skills/ui-validation/scripts/ui_antipattern_check.py +317 -0
- package/core/skills/verification-gate/SKILL.md +205 -0
- package/core/skills/vulnerability-scanner/SKILL.md +276 -0
- package/core/skills/vulnerability-scanner/checklists.md +121 -0
- package/core/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/core/skills/web-design-guidelines/SKILL.md +57 -0
- package/core/skills/webapp-testing/SKILL.md +187 -0
- package/core/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/core/templates/ARCHITECTURE.template.md +407 -0
- package/core/templates/project-resources.example.json +71 -0
- package/core/workflows/atomic.md +182 -0
- package/core/workflows/brainstorm.md +134 -0
- package/core/workflows/check-task.md +242 -0
- package/core/workflows/copy-collect.md +306 -0
- package/core/workflows/create-agent.md +33 -0
- package/core/workflows/create-skill.md +39 -0
- package/core/workflows/create-workflow.md +33 -0
- package/core/workflows/create.md +92 -0
- package/core/workflows/debug.md +186 -0
- package/core/workflows/demand.md +443 -0
- package/core/workflows/deploy.md +260 -0
- package/core/workflows/discovery.md +267 -0
- package/core/workflows/document.md +272 -0
- package/core/workflows/ds-components.md +296 -0
- package/core/workflows/ds-init.md +58 -0
- package/core/workflows/ds-refactor.md +245 -0
- package/core/workflows/ds-references.md +197 -0
- package/core/workflows/ds-styleguide.md +237 -0
- package/core/workflows/ds-token-diff.md +103 -0
- package/core/workflows/ds-tokens.md +317 -0
- package/core/workflows/ds-validate.md +309 -0
- package/core/workflows/execute.md +483 -0
- package/core/workflows/extract-template.md +278 -0
- package/core/workflows/fix-failed-tests.md +160 -0
- package/core/workflows/init-project.md +386 -0
- package/core/workflows/legacy-project.md +849 -0
- package/core/workflows/log.md +97 -0
- package/core/workflows/new-project.md +610 -0
- package/core/workflows/new-project.md.bak +3292 -0
- package/core/workflows/new-task.md +404 -0
- package/core/workflows/orchestrate.md +237 -0
- package/core/workflows/page-build.md +296 -0
- package/core/workflows/plan.md +89 -0
- package/core/workflows/prd.md +255 -0
- package/core/workflows/preview.md +81 -0
- package/core/workflows/review-page.md +304 -0
- package/core/workflows/status.md +86 -0
- package/core/workflows/stitch.md +226 -0
- package/core/workflows/task-complete.md +473 -0
- package/core/workflows/task-update.md +163 -0
- package/core/workflows/tdd.md +344 -0
- package/core/workflows/test.md +251 -0
- package/core/workflows/ui-ux-pro-max.md +437 -0
- package/core/workflows/ux-mobile-optimize.md +262 -0
- package/core/workflows/ux-mobile-validate.md +297 -0
- package/engine-files/GEMINI.md +69 -0
- package/package.json +47 -0
- package/runtime-adapters/antigravity.js +26 -0
- package/runtime-adapters/claude.js +57 -0
- package/runtime-adapters/codex.js +51 -0
- package/runtime-adapters/copilot.js +51 -0
- package/runtime-adapters/cursor.js +51 -0
- package/runtime-adapters/gemini-cli.js +30 -0
- package/runtime-adapters/opencode.js +51 -0
- package/runtime-adapters/windsurf.js +51 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Full Verification Suite - Antigravity Kit
|
|
4
|
+
==========================================
|
|
5
|
+
|
|
6
|
+
Runs COMPLETE validation including all checks + performance + E2E.
|
|
7
|
+
Use this before deployment or major releases.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
python scripts/verify_all.py . --url <URL>
|
|
11
|
+
|
|
12
|
+
Includes ALL checks:
|
|
13
|
+
✅ Security Scan (OWASP, secrets, dependencies)
|
|
14
|
+
✅ Lint & Type Coverage
|
|
15
|
+
✅ Schema Validation
|
|
16
|
+
✅ Test Suite (unit + integration)
|
|
17
|
+
✅ UX Audit (psychology, accessibility)
|
|
18
|
+
✅ SEO Check
|
|
19
|
+
✅ Lighthouse (Core Web Vitals)
|
|
20
|
+
✅ Playwright E2E
|
|
21
|
+
✅ Bundle Analysis (if applicable)
|
|
22
|
+
✅ Mobile Audit (if applicable)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
import sys
|
|
26
|
+
import subprocess
|
|
27
|
+
import argparse
|
|
28
|
+
from pathlib import Path
|
|
29
|
+
from typing import List, Dict, Optional
|
|
30
|
+
from datetime import datetime
|
|
31
|
+
|
|
32
|
+
# ANSI colors
|
|
33
|
+
class Colors:
|
|
34
|
+
HEADER = '\033[95m'
|
|
35
|
+
BLUE = '\033[94m'
|
|
36
|
+
CYAN = '\033[96m'
|
|
37
|
+
GREEN = '\033[92m'
|
|
38
|
+
YELLOW = '\033[93m'
|
|
39
|
+
RED = '\033[91m'
|
|
40
|
+
ENDC = '\033[0m'
|
|
41
|
+
BOLD = '\033[1m'
|
|
42
|
+
|
|
43
|
+
def print_header(text: str):
|
|
44
|
+
print(f"\n{Colors.BOLD}{Colors.CYAN}{'='*70}{Colors.ENDC}")
|
|
45
|
+
print(f"{Colors.BOLD}{Colors.CYAN}{text.center(70)}{Colors.ENDC}")
|
|
46
|
+
print(f"{Colors.BOLD}{Colors.CYAN}{'='*70}{Colors.ENDC}\n")
|
|
47
|
+
|
|
48
|
+
def print_step(text: str):
|
|
49
|
+
print(f"{Colors.BOLD}{Colors.BLUE}🔄 {text}{Colors.ENDC}")
|
|
50
|
+
|
|
51
|
+
def print_success(text: str):
|
|
52
|
+
print(f"{Colors.GREEN}✅ {text}{Colors.ENDC}")
|
|
53
|
+
|
|
54
|
+
def print_warning(text: str):
|
|
55
|
+
print(f"{Colors.YELLOW}⚠️ {text}{Colors.ENDC}")
|
|
56
|
+
|
|
57
|
+
def print_error(text: str):
|
|
58
|
+
print(f"{Colors.RED}❌ {text}{Colors.ENDC}")
|
|
59
|
+
|
|
60
|
+
# Complete verification suite
|
|
61
|
+
VERIFICATION_SUITE = [
|
|
62
|
+
# P0: Security (CRITICAL)
|
|
63
|
+
{
|
|
64
|
+
"category": "Security",
|
|
65
|
+
"checks": [
|
|
66
|
+
("Security Scan", ".agent/skills/vulnerability-scanner/scripts/security_scan.py", True),
|
|
67
|
+
("Dependency Analysis", ".agent/skills/vulnerability-scanner/scripts/dependency_analyzer.py", False),
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
# P1: Code Quality (CRITICAL)
|
|
72
|
+
{
|
|
73
|
+
"category": "Code Quality",
|
|
74
|
+
"checks": [
|
|
75
|
+
("Lint Check", ".agent/skills/lint-and-validate/scripts/lint_runner.py", True),
|
|
76
|
+
("Type Coverage", ".agent/skills/lint-and-validate/scripts/type_coverage.py", False),
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
# P2: Data Layer
|
|
81
|
+
{
|
|
82
|
+
"category": "Data Layer",
|
|
83
|
+
"checks": [
|
|
84
|
+
("Schema Validation", ".agent/skills/database-design/scripts/schema_validator.py", False),
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
# P3: Testing
|
|
89
|
+
{
|
|
90
|
+
"category": "Testing",
|
|
91
|
+
"checks": [
|
|
92
|
+
("Test Suite", ".agent/skills/testing-patterns/scripts/test_runner.py", False),
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
# P4: UX & Accessibility
|
|
97
|
+
{
|
|
98
|
+
"category": "UX & Accessibility",
|
|
99
|
+
"checks": [
|
|
100
|
+
("UX Audit", ".agent/skills/frontend-design/scripts/ux_audit.py", False),
|
|
101
|
+
("Accessibility Check", ".agent/skills/frontend-design/scripts/accessibility_checker.py", False),
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
# P5: SEO & Content
|
|
106
|
+
{
|
|
107
|
+
"category": "SEO & Content",
|
|
108
|
+
"checks": [
|
|
109
|
+
("SEO Check", ".agent/skills/seo-fundamentals/scripts/seo_checker.py", False),
|
|
110
|
+
("GEO Check", ".agent/skills/geo-fundamentals/scripts/geo_checker.py", False),
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
# P6: Performance (requires URL)
|
|
115
|
+
{
|
|
116
|
+
"category": "Performance",
|
|
117
|
+
"requires_url": True,
|
|
118
|
+
"checks": [
|
|
119
|
+
("Lighthouse Audit", ".agent/skills/performance-profiling/scripts/lighthouse_audit.py", True),
|
|
120
|
+
("Bundle Analysis", ".agent/skills/performance-profiling/scripts/bundle_analyzer.py", False),
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
# P7: E2E Testing (requires URL)
|
|
125
|
+
{
|
|
126
|
+
"category": "E2E Testing",
|
|
127
|
+
"requires_url": True,
|
|
128
|
+
"checks": [
|
|
129
|
+
("Playwright E2E", ".agent/skills/webapp-testing/scripts/playwright_runner.py", False),
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
# P8: Mobile (if applicable)
|
|
134
|
+
{
|
|
135
|
+
"category": "Mobile",
|
|
136
|
+
"checks": [
|
|
137
|
+
("Mobile Audit", ".agent/skills/mobile-design/scripts/mobile_audit.py", False),
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
# P9: Internationalization
|
|
142
|
+
{
|
|
143
|
+
"category": "Internationalization",
|
|
144
|
+
"checks": [
|
|
145
|
+
("i18n Check", ".agent/skills/i18n-localization/scripts/i18n_checker.py", False),
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
]
|
|
149
|
+
|
|
150
|
+
def run_script(name: str, script_path: Path, project_path: str, url: Optional[str] = None) -> dict:
|
|
151
|
+
"""Run validation script"""
|
|
152
|
+
if not script_path.exists():
|
|
153
|
+
print_warning(f"{name}: Script not found, skipping")
|
|
154
|
+
return {"name": name, "passed": True, "skipped": True, "duration": 0}
|
|
155
|
+
|
|
156
|
+
print_step(f"Running: {name}")
|
|
157
|
+
start_time = datetime.now()
|
|
158
|
+
|
|
159
|
+
# Build command
|
|
160
|
+
cmd = ["python", str(script_path), project_path]
|
|
161
|
+
if url and ("lighthouse" in script_path.name.lower() or "playwright" in script_path.name.lower()):
|
|
162
|
+
cmd.append(url)
|
|
163
|
+
|
|
164
|
+
# Run
|
|
165
|
+
try:
|
|
166
|
+
result = subprocess.run(
|
|
167
|
+
cmd,
|
|
168
|
+
capture_output=True,
|
|
169
|
+
text=True,
|
|
170
|
+
timeout=600 # 10 minute timeout for slow checks
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
duration = (datetime.now() - start_time).total_seconds()
|
|
174
|
+
passed = result.returncode == 0
|
|
175
|
+
|
|
176
|
+
if passed:
|
|
177
|
+
print_success(f"{name}: PASSED ({duration:.1f}s)")
|
|
178
|
+
else:
|
|
179
|
+
print_error(f"{name}: FAILED ({duration:.1f}s)")
|
|
180
|
+
if result.stderr:
|
|
181
|
+
print(f" {result.stderr[:300]}")
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
"name": name,
|
|
185
|
+
"passed": passed,
|
|
186
|
+
"output": result.stdout,
|
|
187
|
+
"error": result.stderr,
|
|
188
|
+
"skipped": False,
|
|
189
|
+
"duration": duration
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
except subprocess.TimeoutExpired:
|
|
193
|
+
duration = (datetime.now() - start_time).total_seconds()
|
|
194
|
+
print_error(f"{name}: TIMEOUT (>{duration:.0f}s)")
|
|
195
|
+
return {"name": name, "passed": False, "skipped": False, "duration": duration, "error": "Timeout"}
|
|
196
|
+
|
|
197
|
+
except Exception as e:
|
|
198
|
+
duration = (datetime.now() - start_time).total_seconds()
|
|
199
|
+
print_error(f"{name}: ERROR - {str(e)}")
|
|
200
|
+
return {"name": name, "passed": False, "skipped": False, "duration": duration, "error": str(e)}
|
|
201
|
+
|
|
202
|
+
def print_final_report(results: List[dict], start_time: datetime):
|
|
203
|
+
"""Print comprehensive final report"""
|
|
204
|
+
total_duration = (datetime.now() - start_time).total_seconds()
|
|
205
|
+
|
|
206
|
+
print_header("📊 FULL VERIFICATION REPORT")
|
|
207
|
+
|
|
208
|
+
# Statistics
|
|
209
|
+
total = len(results)
|
|
210
|
+
passed = sum(1 for r in results if r["passed"] and not r.get("skipped"))
|
|
211
|
+
failed = sum(1 for r in results if not r["passed"] and not r.get("skipped"))
|
|
212
|
+
skipped = sum(1 for r in results if r.get("skipped"))
|
|
213
|
+
|
|
214
|
+
print(f"Total Duration: {total_duration:.1f}s")
|
|
215
|
+
print(f"Total Checks: {total}")
|
|
216
|
+
print(f"{Colors.GREEN}✅ Passed: {passed}{Colors.ENDC}")
|
|
217
|
+
print(f"{Colors.RED}❌ Failed: {failed}{Colors.ENDC}")
|
|
218
|
+
print(f"{Colors.YELLOW}⏭️ Skipped: {skipped}{Colors.ENDC}")
|
|
219
|
+
print()
|
|
220
|
+
|
|
221
|
+
# Category breakdown
|
|
222
|
+
print(f"{Colors.BOLD}Results by Category:{Colors.ENDC}")
|
|
223
|
+
current_category = None
|
|
224
|
+
for r in results:
|
|
225
|
+
# Print category header if changed
|
|
226
|
+
if r.get("category") and r["category"] != current_category:
|
|
227
|
+
current_category = r["category"]
|
|
228
|
+
print(f"\n{Colors.BOLD}{Colors.CYAN}{current_category}:{Colors.ENDC}")
|
|
229
|
+
|
|
230
|
+
# Print result
|
|
231
|
+
if r.get("skipped"):
|
|
232
|
+
status = f"{Colors.YELLOW}⏭️ {Colors.ENDC}"
|
|
233
|
+
elif r["passed"]:
|
|
234
|
+
status = f"{Colors.GREEN}✅{Colors.ENDC}"
|
|
235
|
+
else:
|
|
236
|
+
status = f"{Colors.RED}❌{Colors.ENDC}"
|
|
237
|
+
|
|
238
|
+
duration_str = f"({r.get('duration', 0):.1f}s)" if not r.get("skipped") else ""
|
|
239
|
+
print(f" {status} {r['name']} {duration_str}")
|
|
240
|
+
|
|
241
|
+
print()
|
|
242
|
+
|
|
243
|
+
# Failed checks detail
|
|
244
|
+
if failed > 0:
|
|
245
|
+
print(f"{Colors.BOLD}{Colors.RED}❌ FAILED CHECKS:{Colors.ENDC}")
|
|
246
|
+
for r in results:
|
|
247
|
+
if not r["passed"] and not r.get("skipped"):
|
|
248
|
+
print(f"\n{Colors.RED}✗ {r['name']}{Colors.ENDC}")
|
|
249
|
+
if r.get("error"):
|
|
250
|
+
error_preview = r["error"][:200]
|
|
251
|
+
print(f" Error: {error_preview}")
|
|
252
|
+
print()
|
|
253
|
+
|
|
254
|
+
# Final verdict
|
|
255
|
+
if failed > 0:
|
|
256
|
+
print_error(f"VERIFICATION FAILED - {failed} check(s) need attention")
|
|
257
|
+
print(f"\n{Colors.YELLOW}💡 Tip: Fix critical (security, lint) issues first{Colors.ENDC}")
|
|
258
|
+
return False
|
|
259
|
+
else:
|
|
260
|
+
print_success("✨ ALL CHECKS PASSED - Ready for deployment! ✨")
|
|
261
|
+
return True
|
|
262
|
+
|
|
263
|
+
def main():
|
|
264
|
+
parser = argparse.ArgumentParser(
|
|
265
|
+
description="Run complete Antigravity Kit verification suite",
|
|
266
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
267
|
+
epilog="""
|
|
268
|
+
Examples:
|
|
269
|
+
python scripts/verify_all.py . --url http://localhost:3000
|
|
270
|
+
python scripts/verify_all.py . --url https://staging.example.com --no-e2e
|
|
271
|
+
"""
|
|
272
|
+
)
|
|
273
|
+
parser.add_argument("project", help="Project path to validate")
|
|
274
|
+
parser.add_argument("--url", required=True, help="URL for performance & E2E checks")
|
|
275
|
+
parser.add_argument("--no-e2e", action="store_true", help="Skip E2E tests")
|
|
276
|
+
parser.add_argument("--stop-on-fail", action="store_true", help="Stop on first failure")
|
|
277
|
+
|
|
278
|
+
args = parser.parse_args()
|
|
279
|
+
|
|
280
|
+
project_path = Path(args.project).resolve()
|
|
281
|
+
|
|
282
|
+
if not project_path.exists():
|
|
283
|
+
print_error(f"Project path does not exist: {project_path}")
|
|
284
|
+
sys.exit(1)
|
|
285
|
+
|
|
286
|
+
print_header("🚀 ANTIGRAVITY KIT - FULL VERIFICATION SUITE")
|
|
287
|
+
print(f"Project: {project_path}")
|
|
288
|
+
print(f"URL: {args.url}")
|
|
289
|
+
print(f"Started: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
|
|
290
|
+
|
|
291
|
+
start_time = datetime.now()
|
|
292
|
+
results = []
|
|
293
|
+
|
|
294
|
+
# Run all verification categories
|
|
295
|
+
for suite in VERIFICATION_SUITE:
|
|
296
|
+
category = suite["category"]
|
|
297
|
+
requires_url = suite.get("requires_url", False)
|
|
298
|
+
|
|
299
|
+
# Skip if requires URL and not provided
|
|
300
|
+
if requires_url and not args.url:
|
|
301
|
+
continue
|
|
302
|
+
|
|
303
|
+
# Skip E2E if flag set
|
|
304
|
+
if args.no_e2e and category == "E2E Testing":
|
|
305
|
+
continue
|
|
306
|
+
|
|
307
|
+
print_header(f"📋 {category.upper()}")
|
|
308
|
+
|
|
309
|
+
for name, script_path, required in suite["checks"]:
|
|
310
|
+
script = project_path / script_path
|
|
311
|
+
result = run_script(name, script, str(project_path), args.url)
|
|
312
|
+
result["category"] = category
|
|
313
|
+
results.append(result)
|
|
314
|
+
|
|
315
|
+
# Stop on critical failure if flag set
|
|
316
|
+
if args.stop_on_fail and required and not result["passed"] and not result.get("skipped"):
|
|
317
|
+
print_error(f"CRITICAL: {name} failed. Stopping verification.")
|
|
318
|
+
print_final_report(results, start_time)
|
|
319
|
+
sys.exit(1)
|
|
320
|
+
|
|
321
|
+
# Print final report
|
|
322
|
+
all_passed = print_final_report(results, start_time)
|
|
323
|
+
|
|
324
|
+
sys.exit(0 if all_passed else 1)
|
|
325
|
+
|
|
326
|
+
if __name__ == "__main__":
|
|
327
|
+
main()
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: analytics-strategy
|
|
3
|
+
description: Analytics planning and measurement strategy. Stack selection, event mapping, funnels, feature flags, and A/B testing. Used during design phases before implementation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Analytics Strategy
|
|
7
|
+
|
|
8
|
+
> Define WHAT to measure, WHERE to measure, and HOW to measure before implementing.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🎯 When to Use
|
|
13
|
+
|
|
14
|
+
| Workflow | Phase | Trigger |
|
|
15
|
+
|----------|-------|---------|
|
|
16
|
+
| `/new-project` | Phase 2.9 | After PAGE-SPECs approved |
|
|
17
|
+
| `/legacy-project` | Analytics audit | After reverse engineering |
|
|
18
|
+
| `/new-task` | New feature analytics | When feature needs metrics |
|
|
19
|
+
|
|
20
|
+
> [!NOTE]
|
|
21
|
+
> **Skip if:** Project is an internal POC without metrics needs.
|
|
22
|
+
> **Mandatory for:** Any product that needs to measure conversion, engagement, or retention.
|
|
23
|
+
|
|
24
|
+
**Output:** `## 📊 Analytics` section in each PAGE-SPEC + config in TDD.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 📋 Process (5 Steps)
|
|
29
|
+
|
|
30
|
+
### Step 1: Define Analytics Stack
|
|
31
|
+
|
|
32
|
+
| Tool | Purpose | Phase |
|
|
33
|
+
|------|---------|-------|
|
|
34
|
+
| **PostHog** | Product Analytics, Session Replay, Feature Flags, Funnels | MVP |
|
|
35
|
+
| **Google Search Console** | SEO: indexing, keywords, CTR | MVP |
|
|
36
|
+
| **UTM Tracking** | Campaign attribution (captured by PostHog) | MVP |
|
|
37
|
+
| **Google Tag Manager** | Centralized tag management | Growth |
|
|
38
|
+
| **Meta Pixel** | Facebook/Instagram Ads, Remarketing | When advertising |
|
|
39
|
+
| **Google Ads Tag** | Google Ads conversions | When advertising |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### Step 2: Map Events per Page
|
|
44
|
+
|
|
45
|
+
For **EACH** PAGE-SPEC, add section:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
## 📊 Analytics (PostHog)
|
|
49
|
+
|
|
50
|
+
### Custom Events
|
|
51
|
+
| Event | Trigger | Properties |
|
|
52
|
+
|-------|---------|------------|
|
|
53
|
+
| `page_name_viewed` | Pageview | `referrer`, `utm_*` |
|
|
54
|
+
| `cta_clicked` | Click CTA | `cta_type`, `section` |
|
|
55
|
+
| ... | ... | ... |
|
|
56
|
+
|
|
57
|
+
### Funnels to Measure
|
|
58
|
+
- Funnel 1: ...
|
|
59
|
+
- Funnel 2: ...
|
|
60
|
+
|
|
61
|
+
### Feature Flags (A/B)
|
|
62
|
+
- `flag_name`: Test description
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### Step 3: Ask the User (MANDATORY)
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
## 📊 Analytics Strategy
|
|
71
|
+
|
|
72
|
+
To define tracking for this project, I need to know:
|
|
73
|
+
|
|
74
|
+
### 1. Success Metrics
|
|
75
|
+
What are the **3 main metrics** you want to track?
|
|
76
|
+
- [ ] Visitor → signup conversion
|
|
77
|
+
- [ ] Free → paid conversion
|
|
78
|
+
- [ ] Engagement (time on platform)
|
|
79
|
+
- [ ] Retention (return in 7 days)
|
|
80
|
+
- [ ] Feature adoption
|
|
81
|
+
- [ ] Other: ___
|
|
82
|
+
|
|
83
|
+
### 2. Paid Acquisition
|
|
84
|
+
Do you plan to run **paid ads** (Meta, Google)?
|
|
85
|
+
- [ ] Yes, soon → Configure pixels
|
|
86
|
+
- [ ] Not now → Skip pixels
|
|
87
|
+
- [ ] Not sure yet → Prepare but don't activate
|
|
88
|
+
|
|
89
|
+
### 3. A/B Testing
|
|
90
|
+
Which elements do you want to test?
|
|
91
|
+
- [ ] CTAs (text, color)
|
|
92
|
+
- [ ] Pricing page (plan order)
|
|
93
|
+
- [ ] Onboarding flow
|
|
94
|
+
- [ ] None for now
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Step 4: Update TDD
|
|
100
|
+
|
|
101
|
+
Add/update section `## 📈 Analytics & Tracking Strategy` in TDD with:
|
|
102
|
+
- Stack tools
|
|
103
|
+
- Events per page
|
|
104
|
+
- Required environment variables (e.g. `NEXT_PUBLIC_POSTHOG_KEY`)
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### Step 5: Update PAGE-SPECs
|
|
109
|
+
|
|
110
|
+
For each prioritized PAGE-SPEC, add `## 📊 Analytics (PostHog)` section with:
|
|
111
|
+
- Custom events
|
|
112
|
+
- Funnels to measure
|
|
113
|
+
- Feature flags for A/B
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 🔴 Exit Gate
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
[ ] Analytics stack defined in TDD
|
|
121
|
+
[ ] Events mapped for each PAGE-SPEC
|
|
122
|
+
[ ] Environment variables listed in TDD
|
|
123
|
+
[ ] User confirmed success metrics
|
|
124
|
+
[ ] PAGE-SPECs updated with Analytics section
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
> [!CAUTION]
|
|
128
|
+
> **BLOCKER:** Do not proceed to Breakdown without Analytics Strategy defined.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-patterns
|
|
3
|
+
description: API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# API Patterns
|
|
8
|
+
|
|
9
|
+
> API design principles and decision-making for 2025.
|
|
10
|
+
> **Learn to THINK, not copy fixed patterns.**
|
|
11
|
+
|
|
12
|
+
## 🎯 Selective Reading Rule
|
|
13
|
+
|
|
14
|
+
**Read ONLY files relevant to the request!** Check the content map, find what you need.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📑 Content Map
|
|
19
|
+
|
|
20
|
+
| File | Description | When to Read |
|
|
21
|
+
|------|-------------|--------------|
|
|
22
|
+
| `api-style.md` | REST vs GraphQL vs tRPC decision tree | Choosing API type |
|
|
23
|
+
| `rest.md` | Resource naming, HTTP methods, status codes | Designing REST API |
|
|
24
|
+
| `response.md` | Envelope pattern, error format, pagination | Response structure |
|
|
25
|
+
| `graphql.md` | Schema design, when to use, security | Considering GraphQL |
|
|
26
|
+
| `trpc.md` | TypeScript monorepo, type safety | TS fullstack projects |
|
|
27
|
+
| `versioning.md` | URI/Header/Query versioning | API evolution planning |
|
|
28
|
+
| `auth.md` | JWT, OAuth, Passkey, API Keys | Auth pattern selection |
|
|
29
|
+
| `rate-limiting.md` | Token bucket, sliding window | API protection |
|
|
30
|
+
| `documentation.md` | OpenAPI/Swagger best practices | Documentation |
|
|
31
|
+
| `security-testing.md` | OWASP API Top 10, auth/authz testing | Security audits |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🔗 Related Skills
|
|
36
|
+
|
|
37
|
+
| Need | Skill |
|
|
38
|
+
|------|-------|
|
|
39
|
+
| API implementation | `@[skills/backend-development]` |
|
|
40
|
+
| Data structure | `@[skills/database-design]` |
|
|
41
|
+
| Security details | `@[skills/security-hardening]` |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## ✅ Decision Checklist
|
|
46
|
+
|
|
47
|
+
Before designing an API:
|
|
48
|
+
|
|
49
|
+
- [ ] **Asked user about API consumers?**
|
|
50
|
+
- [ ] **Chosen API style for THIS context?** (REST/GraphQL/tRPC)
|
|
51
|
+
- [ ] **Defined consistent response format?**
|
|
52
|
+
- [ ] **Planned versioning strategy?**
|
|
53
|
+
- [ ] **Considered authentication needs?**
|
|
54
|
+
- [ ] **Planned rate limiting?**
|
|
55
|
+
- [ ] **Documentation approach defined?**
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## ❌ Anti-Patterns
|
|
60
|
+
|
|
61
|
+
**DON'T:**
|
|
62
|
+
- Default to REST for everything
|
|
63
|
+
- Use verbs in REST endpoints (/getUsers)
|
|
64
|
+
- Return inconsistent response formats
|
|
65
|
+
- Expose internal errors to clients
|
|
66
|
+
- Skip rate limiting
|
|
67
|
+
|
|
68
|
+
**DO:**
|
|
69
|
+
- Choose API style based on context
|
|
70
|
+
- Ask about client requirements
|
|
71
|
+
- Document thoroughly
|
|
72
|
+
- Use appropriate status codes
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Script
|
|
77
|
+
|
|
78
|
+
| Script | Purpose | Command |
|
|
79
|
+
|--------|---------|---------|
|
|
80
|
+
| `scripts/api_validator.py` | API endpoint validation | `python scripts/api_validator.py <project_path>` |
|
|
81
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# API Style Selection (2025)
|
|
2
|
+
|
|
3
|
+
> REST vs GraphQL vs tRPC - Hangi durumda hangisi?
|
|
4
|
+
|
|
5
|
+
## Decision Tree
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Who are the API consumers?
|
|
9
|
+
│
|
|
10
|
+
├── Public API / Multiple platforms
|
|
11
|
+
│ └── REST + OpenAPI (widest compatibility)
|
|
12
|
+
│
|
|
13
|
+
├── Complex data needs / Multiple frontends
|
|
14
|
+
│ └── GraphQL (flexible queries)
|
|
15
|
+
│
|
|
16
|
+
├── TypeScript frontend + backend (monorepo)
|
|
17
|
+
│ └── tRPC (end-to-end type safety)
|
|
18
|
+
│
|
|
19
|
+
├── Real-time / Event-driven
|
|
20
|
+
│ └── WebSocket + AsyncAPI
|
|
21
|
+
│
|
|
22
|
+
└── Internal microservices
|
|
23
|
+
└── gRPC (performance) or REST (simplicity)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Comparison
|
|
27
|
+
|
|
28
|
+
| Factor | REST | GraphQL | tRPC |
|
|
29
|
+
|--------|------|---------|------|
|
|
30
|
+
| **Best for** | Public APIs | Complex apps | TS monorepos |
|
|
31
|
+
| **Learning curve** | Low | Medium | Low (if TS) |
|
|
32
|
+
| **Over/under fetching** | Common | Solved | Solved |
|
|
33
|
+
| **Type safety** | Manual (OpenAPI) | Schema-based | Automatic |
|
|
34
|
+
| **Caching** | HTTP native | Complex | Client-based |
|
|
35
|
+
|
|
36
|
+
## Selection Questions
|
|
37
|
+
|
|
38
|
+
1. Who are the API consumers?
|
|
39
|
+
2. Is the frontend TypeScript?
|
|
40
|
+
3. How complex are the data relationships?
|
|
41
|
+
4. Is caching critical?
|
|
42
|
+
5. Public or internal API?
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Authentication Patterns
|
|
2
|
+
|
|
3
|
+
> Choose auth pattern based on use case.
|
|
4
|
+
|
|
5
|
+
## Selection Guide
|
|
6
|
+
|
|
7
|
+
| Pattern | Best For |
|
|
8
|
+
|---------|----------|
|
|
9
|
+
| **JWT** | Stateless, microservices |
|
|
10
|
+
| **Session** | Traditional web, simple |
|
|
11
|
+
| **OAuth 2.0** | Third-party integration |
|
|
12
|
+
| **API Keys** | Server-to-server, public APIs |
|
|
13
|
+
| **Passkey** | Modern passwordless (2025+) |
|
|
14
|
+
|
|
15
|
+
## JWT Principles
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Important:
|
|
19
|
+
├── Always verify signature
|
|
20
|
+
├── Check expiration
|
|
21
|
+
├── Include minimal claims
|
|
22
|
+
├── Use short expiry + refresh tokens
|
|
23
|
+
└── Never store sensitive data in JWT
|
|
24
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# API Documentation Principles
|
|
2
|
+
|
|
3
|
+
> Good docs = happy developers = API adoption.
|
|
4
|
+
|
|
5
|
+
## OpenAPI/Swagger Essentials
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Include:
|
|
9
|
+
├── All endpoints with examples
|
|
10
|
+
├── Request/response schemas
|
|
11
|
+
├── Authentication requirements
|
|
12
|
+
├── Error response formats
|
|
13
|
+
└── Rate limiting info
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Good Documentation Has
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Essentials:
|
|
20
|
+
├── Quick start / Getting started
|
|
21
|
+
├── Authentication guide
|
|
22
|
+
├── Complete API reference
|
|
23
|
+
├── Error handling guide
|
|
24
|
+
├── Code examples (multiple languages)
|
|
25
|
+
└── Changelog
|
|
26
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# GraphQL Principles
|
|
2
|
+
|
|
3
|
+
> Flexible queries for complex, interconnected data.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
✅ Good fit:
|
|
9
|
+
├── Complex, interconnected data
|
|
10
|
+
├── Multiple frontend platforms
|
|
11
|
+
├── Clients need flexible queries
|
|
12
|
+
├── Evolving data requirements
|
|
13
|
+
└── Reducing over-fetching matters
|
|
14
|
+
|
|
15
|
+
❌ Poor fit:
|
|
16
|
+
├── Simple CRUD operations
|
|
17
|
+
├── File upload heavy
|
|
18
|
+
├── HTTP caching important
|
|
19
|
+
└── Team unfamiliar with GraphQL
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Schema Design Principles
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Principles:
|
|
26
|
+
├── Think in graphs, not endpoints
|
|
27
|
+
├── Design for evolvability (no versions)
|
|
28
|
+
├── Use connections for pagination
|
|
29
|
+
├── Be specific with types (not generic "data")
|
|
30
|
+
└── Handle nullability thoughtfully
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Security Considerations
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Protect against:
|
|
37
|
+
├── Query depth attacks → Set max depth
|
|
38
|
+
├── Query complexity → Calculate cost
|
|
39
|
+
├── Batching abuse → Limit batch size
|
|
40
|
+
├── Introspection → Disable in production
|
|
41
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Rate Limiting Principles
|
|
2
|
+
|
|
3
|
+
> Protect your API from abuse and overload.
|
|
4
|
+
|
|
5
|
+
## Why Rate Limit
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Protect against:
|
|
9
|
+
├── Brute force attacks
|
|
10
|
+
├── Resource exhaustion
|
|
11
|
+
├── Cost overruns (if pay-per-use)
|
|
12
|
+
└── Unfair usage
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Strategy Selection
|
|
16
|
+
|
|
17
|
+
| Type | How | When |
|
|
18
|
+
|------|-----|------|
|
|
19
|
+
| **Token bucket** | Burst allowed, refills over time | Most APIs |
|
|
20
|
+
| **Sliding window** | Smooth distribution | Strict limits |
|
|
21
|
+
| **Fixed window** | Simple counters per window | Basic needs |
|
|
22
|
+
|
|
23
|
+
## Response Headers
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Include in headers:
|
|
27
|
+
├── X-RateLimit-Limit (max requests)
|
|
28
|
+
├── X-RateLimit-Remaining (requests left)
|
|
29
|
+
├── X-RateLimit-Reset (when limit resets)
|
|
30
|
+
└── Return 429 when exceeded
|
|
31
|
+
```
|