dev-booster 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +203 -0
- package/bin/dev-booster.js +4 -0
- package/package.json +41 -0
- package/src/index.js +78 -0
- package/src/sync-template.js +55 -0
- package/template/.devbooster/MANIFEST.md +177 -0
- package/template/.devbooster/boosters/accessibility.md +63 -0
- package/template/.devbooster/boosters/advisor.md +68 -0
- package/template/.devbooster/boosters/atomic.md +58 -0
- package/template/.devbooster/boosters/backend.md +75 -0
- package/template/.devbooster/boosters/changelog.md +126 -0
- package/template/.devbooster/boosters/create.md +85 -0
- package/template/.devbooster/boosters/debug.md +55 -0
- package/template/.devbooster/boosters/deploy.md +11 -0
- package/template/.devbooster/boosters/design.md +56 -0
- package/template/.devbooster/boosters/discovery.md +75 -0
- package/template/.devbooster/boosters/documentation.md +106 -0
- package/template/.devbooster/boosters/frontend.md +82 -0
- package/template/.devbooster/boosters/i18n.md +63 -0
- package/template/.devbooster/boosters/implementation.md +82 -0
- package/template/.devbooster/boosters/investigation.md +96 -0
- package/template/.devbooster/boosters/mobile.md +56 -0
- package/template/.devbooster/boosters/performance.md +70 -0
- package/template/.devbooster/boosters/planning.md +92 -0
- package/template/.devbooster/boosters/refactor.md +17 -0
- package/template/.devbooster/boosters/review.md +88 -0
- package/template/.devbooster/boosters/security.md +60 -0
- package/template/.devbooster/boosters/seo.md +59 -0
- package/template/.devbooster/boosters/templates/implementation_heavy.md +130 -0
- package/template/.devbooster/boosters/templates/implementation_simple.md +109 -0
- package/template/.devbooster/boosters/templates/implementation_standard.md +134 -0
- package/template/.devbooster/boosters/testing.md +76 -0
- package/template/.devbooster/hub/personas/agent_backend-specialist.md +263 -0
- package/template/.devbooster/hub/personas/agent_code-archaeologist.md +106 -0
- package/template/.devbooster/hub/personas/agent_database-architect.md +226 -0
- package/template/.devbooster/hub/personas/agent_debugger.md +225 -0
- package/template/.devbooster/hub/personas/agent_devops-engineer.md +242 -0
- package/template/.devbooster/hub/personas/agent_documentation-writer.md +104 -0
- package/template/.devbooster/hub/personas/agent_explorer-agent.md +73 -0
- package/template/.devbooster/hub/personas/agent_frontend-specialist.md +593 -0
- package/template/.devbooster/hub/personas/agent_game-developer.md +162 -0
- package/template/.devbooster/hub/personas/agent_mobile-developer.md +377 -0
- package/template/.devbooster/hub/personas/agent_orchestrator.md +416 -0
- package/template/.devbooster/hub/personas/agent_penetration-tester.md +188 -0
- package/template/.devbooster/hub/personas/agent_performance-optimizer.md +187 -0
- package/template/.devbooster/hub/personas/agent_product-manager.md +112 -0
- package/template/.devbooster/hub/personas/agent_product-owner.md +95 -0
- package/template/.devbooster/hub/personas/agent_project-planner.md +406 -0
- package/template/.devbooster/hub/personas/agent_qa-automation-engineer.md +103 -0
- package/template/.devbooster/hub/personas/agent_security-auditor.md +170 -0
- package/template/.devbooster/hub/personas/agent_seo-specialist.md +111 -0
- package/template/.devbooster/hub/personas/agent_test-engineer.md +158 -0
- package/template/.devbooster/hub/personas/backend-specialist.md +263 -0
- package/template/.devbooster/hub/personas/brainstorm.md +113 -0
- package/template/.devbooster/hub/personas/code-archaeologist.md +106 -0
- package/template/.devbooster/hub/personas/create.md +59 -0
- package/template/.devbooster/hub/personas/database-architect.md +226 -0
- package/template/.devbooster/hub/personas/debug.md +103 -0
- package/template/.devbooster/hub/personas/debugger.md +225 -0
- package/template/.devbooster/hub/personas/deploy.md +176 -0
- package/template/.devbooster/hub/personas/devops-engineer.md +242 -0
- package/template/.devbooster/hub/personas/documentation-writer.md +104 -0
- package/template/.devbooster/hub/personas/enhance.md +63 -0
- package/template/.devbooster/hub/personas/explorer-agent.md +73 -0
- package/template/.devbooster/hub/personas/frontend-specialist.md +593 -0
- package/template/.devbooster/hub/personas/game-developer.md +162 -0
- package/template/.devbooster/hub/personas/mobile-developer.md +377 -0
- package/template/.devbooster/hub/personas/orchestrate.md +237 -0
- package/template/.devbooster/hub/personas/orchestrator.md +416 -0
- package/template/.devbooster/hub/personas/penetration-tester.md +188 -0
- package/template/.devbooster/hub/personas/performance-optimizer.md +187 -0
- package/template/.devbooster/hub/personas/plan.md +89 -0
- package/template/.devbooster/hub/personas/preview.md +81 -0
- package/template/.devbooster/hub/personas/product-manager.md +112 -0
- package/template/.devbooster/hub/personas/product-owner.md +95 -0
- package/template/.devbooster/hub/personas/project-planner.md +406 -0
- package/template/.devbooster/hub/personas/qa-automation-engineer.md +103 -0
- package/template/.devbooster/hub/personas/security-auditor.md +170 -0
- package/template/.devbooster/hub/personas/seo-specialist.md +111 -0
- package/template/.devbooster/hub/personas/skill_api-patterns.md +567 -0
- package/template/.devbooster/hub/personas/skill_app-builder.md +1855 -0
- package/template/.devbooster/hub/personas/skill_architecture.md +417 -0
- package/template/.devbooster/hub/personas/skill_bash-linux.md +199 -0
- package/template/.devbooster/hub/personas/skill_behavioral-modes.md +242 -0
- package/template/.devbooster/hub/personas/skill_brainstorming.md +519 -0
- package/template/.devbooster/hub/personas/skill_clean-code.md +201 -0
- package/template/.devbooster/hub/personas/skill_code-review-checklist.md +109 -0
- package/template/.devbooster/hub/personas/skill_database-design.md +340 -0
- package/template/.devbooster/hub/personas/skill_deployment-procedures.md +241 -0
- package/template/.devbooster/hub/personas/skill_doc.md +177 -0
- package/template/.devbooster/hub/personas/skill_documentation-templates.md +194 -0
- package/template/.devbooster/hub/personas/skill_frontend-design.md +3670 -0
- package/template/.devbooster/hub/personas/skill_game-development.md +167 -0
- package/template/.devbooster/hub/personas/skill_geo-fundamentals.md +156 -0
- package/template/.devbooster/hub/personas/skill_i18n-localization.md +154 -0
- package/template/.devbooster/hub/personas/skill_intelligent-routing.md +335 -0
- package/template/.devbooster/hub/personas/skill_lint-and-validate.md +45 -0
- package/template/.devbooster/hub/personas/skill_mcp-builder.md +176 -0
- package/template/.devbooster/hub/personas/skill_mobile-design.md +6150 -0
- package/template/.devbooster/hub/personas/skill_nextjs-react-expert.md +3487 -0
- package/template/.devbooster/hub/personas/skill_nodejs-best-practices.md +333 -0
- package/template/.devbooster/hub/personas/skill_parallel-agents.md +175 -0
- package/template/.devbooster/hub/personas/skill_performance-profiling.md +143 -0
- package/template/.devbooster/hub/personas/skill_plan-writing.md +152 -0
- package/template/.devbooster/hub/personas/skill_powershell-windows.md +167 -0
- package/template/.devbooster/hub/personas/skill_python-patterns.md +441 -0
- package/template/.devbooster/hub/personas/skill_red-team-tactics.md +199 -0
- package/template/.devbooster/hub/personas/skill_rust-pro.md +176 -0
- package/template/.devbooster/hub/personas/skill_seo-fundamentals.md +129 -0
- package/template/.devbooster/hub/personas/skill_server-management.md +161 -0
- package/template/.devbooster/hub/personas/skill_systematic-debugging.md +109 -0
- package/template/.devbooster/hub/personas/skill_tailwind-patterns.md +269 -0
- package/template/.devbooster/hub/personas/skill_tdd-workflow.md +149 -0
- package/template/.devbooster/hub/personas/skill_testing-patterns.md +178 -0
- package/template/.devbooster/hub/personas/skill_vulnerability-scanner.md +403 -0
- package/template/.devbooster/hub/personas/skill_web-design-guidelines.md +57 -0
- package/template/.devbooster/hub/personas/skill_webapp-testing.md +187 -0
- package/template/.devbooster/hub/personas/status.md +86 -0
- package/template/.devbooster/hub/personas/test-engineer.md +158 -0
- package/template/.devbooster/hub/personas/test.md +144 -0
- package/template/.devbooster/hub/personas/ui-ux-pro-max.md +296 -0
- package/template/.devbooster/hub/scripts/accessibility_checker.py +183 -0
- package/template/.devbooster/hub/scripts/api_validator.py +211 -0
- package/template/.devbooster/hub/scripts/auto_preview.py +148 -0
- package/template/.devbooster/hub/scripts/checklist.py +217 -0
- package/template/.devbooster/hub/scripts/convert_rules.py +222 -0
- package/template/.devbooster/hub/scripts/geo_checker.py +289 -0
- package/template/.devbooster/hub/scripts/i18n_checker.py +241 -0
- package/template/.devbooster/hub/scripts/lighthouse_audit.py +76 -0
- package/template/.devbooster/hub/scripts/lint_runner.py +184 -0
- package/template/.devbooster/hub/scripts/mobile_audit.py +670 -0
- package/template/.devbooster/hub/scripts/playwright_runner.py +173 -0
- package/template/.devbooster/hub/scripts/react_performance_checker.py +252 -0
- package/template/.devbooster/hub/scripts/schema_validator.py +172 -0
- package/template/.devbooster/hub/scripts/security_scan.py +458 -0
- package/template/.devbooster/hub/scripts/seo_checker.py +219 -0
- package/template/.devbooster/hub/scripts/session_manager.py +120 -0
- package/template/.devbooster/hub/scripts/test_runner.py +219 -0
- package/template/.devbooster/hub/scripts/type_coverage.py +173 -0
- package/template/.devbooster/hub/scripts/ux_audit.py +722 -0
- package/template/.devbooster/hub/scripts/verify_all.py +327 -0
- package/template/.devbooster/hub/skills/api-patterns/SKILL.md +81 -0
- package/template/.devbooster/hub/skills/api-patterns/api-style.md +42 -0
- package/template/.devbooster/hub/skills/api-patterns/auth.md +24 -0
- package/template/.devbooster/hub/skills/api-patterns/documentation.md +26 -0
- package/template/.devbooster/hub/skills/api-patterns/graphql.md +41 -0
- package/template/.devbooster/hub/skills/api-patterns/rate-limiting.md +31 -0
- package/template/.devbooster/hub/skills/api-patterns/response.md +37 -0
- package/template/.devbooster/hub/skills/api-patterns/rest.md +40 -0
- package/template/.devbooster/hub/skills/api-patterns/scripts/api_validator.py +211 -0
- package/template/.devbooster/hub/skills/api-patterns/security-testing.md +122 -0
- package/template/.devbooster/hub/skills/api-patterns/trpc.md +41 -0
- package/template/.devbooster/hub/skills/api-patterns/versioning.md +22 -0
- package/template/.devbooster/hub/skills/app-builder/SKILL.md +75 -0
- package/template/.devbooster/hub/skills/app-builder/agent-coordination.md +71 -0
- package/template/.devbooster/hub/skills/app-builder/feature-building.md +53 -0
- package/template/.devbooster/hub/skills/app-builder/project-detection.md +34 -0
- package/template/.devbooster/hub/skills/app-builder/scaffolding.md +118 -0
- package/template/.devbooster/hub/skills/app-builder/tech-stack.md +40 -0
- package/template/.devbooster/hub/skills/app-builder/templates/SKILL.md +39 -0
- package/template/.devbooster/hub/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/template/.devbooster/hub/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/template/.devbooster/hub/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/template/.devbooster/hub/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/template/.devbooster/hub/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/template/.devbooster/hub/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/template/.devbooster/hub/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/template/.devbooster/hub/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/template/.devbooster/hub/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/template/.devbooster/hub/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/template/.devbooster/hub/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/template/.devbooster/hub/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/template/.devbooster/hub/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/template/.devbooster/hub/skills/architecture/SKILL.md +55 -0
- package/template/.devbooster/hub/skills/architecture/context-discovery.md +43 -0
- package/template/.devbooster/hub/skills/architecture/examples.md +94 -0
- package/template/.devbooster/hub/skills/architecture/pattern-selection.md +68 -0
- package/template/.devbooster/hub/skills/architecture/patterns-reference.md +50 -0
- package/template/.devbooster/hub/skills/architecture/trade-off-analysis.md +77 -0
- package/template/.devbooster/hub/skills/bash-linux/SKILL.md +199 -0
- package/template/.devbooster/hub/skills/behavioral-modes/SKILL.md +242 -0
- package/template/.devbooster/hub/skills/brainstorming/SKILL.md +163 -0
- package/template/.devbooster/hub/skills/brainstorming/dynamic-questioning.md +350 -0
- package/template/.devbooster/hub/skills/clean-code/SKILL.md +201 -0
- package/template/.devbooster/hub/skills/code-review-checklist/SKILL.md +109 -0
- package/template/.devbooster/hub/skills/database-design/SKILL.md +52 -0
- package/template/.devbooster/hub/skills/database-design/database-selection.md +43 -0
- package/template/.devbooster/hub/skills/database-design/indexing.md +39 -0
- package/template/.devbooster/hub/skills/database-design/migrations.md +48 -0
- package/template/.devbooster/hub/skills/database-design/optimization.md +36 -0
- package/template/.devbooster/hub/skills/database-design/orm-selection.md +30 -0
- package/template/.devbooster/hub/skills/database-design/schema-design.md +56 -0
- package/template/.devbooster/hub/skills/database-design/scripts/schema_validator.py +172 -0
- package/template/.devbooster/hub/skills/deployment-procedures/SKILL.md +241 -0
- package/template/.devbooster/hub/skills/doc.md +177 -0
- package/template/.devbooster/hub/skills/documentation-templates/SKILL.md +194 -0
- package/template/.devbooster/hub/skills/frontend-design/SKILL.md +418 -0
- package/template/.devbooster/hub/skills/frontend-design/animation-guide.md +331 -0
- package/template/.devbooster/hub/skills/frontend-design/anti-generic-guide.md +252 -0
- package/template/.devbooster/hub/skills/frontend-design/color-system.md +311 -0
- package/template/.devbooster/hub/skills/frontend-design/decision-trees.md +418 -0
- package/template/.devbooster/hub/skills/frontend-design/motion-graphics.md +306 -0
- package/template/.devbooster/hub/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/template/.devbooster/hub/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/template/.devbooster/hub/skills/frontend-design/typography-system.md +345 -0
- package/template/.devbooster/hub/skills/frontend-design/ux-psychology.md +1116 -0
- package/template/.devbooster/hub/skills/frontend-design/visual-effects.md +383 -0
- package/template/.devbooster/hub/skills/game-development/2d-games/SKILL.md +119 -0
- package/template/.devbooster/hub/skills/game-development/3d-games/SKILL.md +135 -0
- package/template/.devbooster/hub/skills/game-development/SKILL.md +167 -0
- package/template/.devbooster/hub/skills/game-development/game-art/SKILL.md +185 -0
- package/template/.devbooster/hub/skills/game-development/game-audio/SKILL.md +190 -0
- package/template/.devbooster/hub/skills/game-development/game-design/SKILL.md +129 -0
- package/template/.devbooster/hub/skills/game-development/mobile-games/SKILL.md +108 -0
- package/template/.devbooster/hub/skills/game-development/multiplayer/SKILL.md +132 -0
- package/template/.devbooster/hub/skills/game-development/pc-games/SKILL.md +144 -0
- package/template/.devbooster/hub/skills/game-development/vr-ar/SKILL.md +123 -0
- package/template/.devbooster/hub/skills/game-development/web-games/SKILL.md +150 -0
- package/template/.devbooster/hub/skills/geo-fundamentals/SKILL.md +156 -0
- package/template/.devbooster/hub/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/template/.devbooster/hub/skills/i18n-localization/SKILL.md +154 -0
- package/template/.devbooster/hub/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/template/.devbooster/hub/skills/intelligent-routing/SKILL.md +335 -0
- package/template/.devbooster/hub/skills/lint-and-validate/SKILL.md +45 -0
- package/template/.devbooster/hub/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/template/.devbooster/hub/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/template/.devbooster/hub/skills/mcp-builder/SKILL.md +176 -0
- package/template/.devbooster/hub/skills/mobile-design/SKILL.md +394 -0
- package/template/.devbooster/hub/skills/mobile-design/decision-trees.md +516 -0
- package/template/.devbooster/hub/skills/mobile-design/mobile-backend.md +491 -0
- package/template/.devbooster/hub/skills/mobile-design/mobile-color-system.md +420 -0
- package/template/.devbooster/hub/skills/mobile-design/mobile-debugging.md +122 -0
- package/template/.devbooster/hub/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/template/.devbooster/hub/skills/mobile-design/mobile-navigation.md +458 -0
- package/template/.devbooster/hub/skills/mobile-design/mobile-performance.md +767 -0
- package/template/.devbooster/hub/skills/mobile-design/mobile-testing.md +356 -0
- package/template/.devbooster/hub/skills/mobile-design/mobile-typography.md +433 -0
- package/template/.devbooster/hub/skills/mobile-design/platform-android.md +666 -0
- package/template/.devbooster/hub/skills/mobile-design/platform-ios.md +561 -0
- package/template/.devbooster/hub/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/template/.devbooster/hub/skills/mobile-design/touch-psychology.md +537 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/SKILL.md +286 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/template/.devbooster/hub/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/template/.devbooster/hub/skills/nodejs-best-practices/SKILL.md +333 -0
- package/template/.devbooster/hub/skills/parallel-agents/SKILL.md +175 -0
- package/template/.devbooster/hub/skills/performance-profiling/SKILL.md +143 -0
- package/template/.devbooster/hub/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/template/.devbooster/hub/skills/plan-writing/SKILL.md +152 -0
- package/template/.devbooster/hub/skills/powershell-windows/SKILL.md +167 -0
- package/template/.devbooster/hub/skills/python-patterns/SKILL.md +441 -0
- package/template/.devbooster/hub/skills/red-team-tactics/SKILL.md +199 -0
- package/template/.devbooster/hub/skills/rust-pro/SKILL.md +176 -0
- package/template/.devbooster/hub/skills/seo-fundamentals/SKILL.md +129 -0
- package/template/.devbooster/hub/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/template/.devbooster/hub/skills/server-management/SKILL.md +161 -0
- package/template/.devbooster/hub/skills/systematic-debugging/SKILL.md +109 -0
- package/template/.devbooster/hub/skills/tailwind-patterns/SKILL.md +269 -0
- package/template/.devbooster/hub/skills/tdd-workflow/SKILL.md +149 -0
- package/template/.devbooster/hub/skills/testing-patterns/SKILL.md +178 -0
- package/template/.devbooster/hub/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/template/.devbooster/hub/skills/vulnerability-scanner/SKILL.md +276 -0
- package/template/.devbooster/hub/skills/vulnerability-scanner/checklists.md +121 -0
- package/template/.devbooster/hub/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/template/.devbooster/hub/skills/web-design-guidelines/SKILL.md +57 -0
- package/template/.devbooster/hub/skills/webapp-testing/SKILL.md +187 -0
- package/template/.devbooster/hub/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/template/.devbooster/hub/workflows/brainstorm.md +113 -0
- package/template/.devbooster/hub/workflows/create.md +59 -0
- package/template/.devbooster/hub/workflows/debug.md +103 -0
- package/template/.devbooster/hub/workflows/deploy.md +176 -0
- package/template/.devbooster/hub/workflows/enhance.md +63 -0
- package/template/.devbooster/hub/workflows/orchestrate.md +237 -0
- package/template/.devbooster/hub/workflows/plan.md +89 -0
- package/template/.devbooster/hub/workflows/preview.md +81 -0
- package/template/.devbooster/hub/workflows/status.md +86 -0
- package/template/.devbooster/hub/workflows/test.md +144 -0
- package/template/.devbooster/hub/workflows/ui-ux-pro-max.md +296 -0
- package/template/.devbooster/rules/BACKEND.md +72 -0
- package/template/.devbooster/rules/COMERCIAL.md +69 -0
- package/template/.devbooster/rules/FRONTEND.md +76 -0
- package/template/.devbooster/rules/GUIDE.md +111 -0
- package/template/.devbooster/rules/PROJECT.md +83 -0
- package/template/.devbooster/rules/PROTOCOL.md +42 -0
- package/template/.devbooster/rules/USER_PREFERENCES.md +33 -0
- package/template/DEVBOOSTER_INIT.md +42 -0
|
@@ -0,0 +1,1855 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: app-builder
|
|
3
|
+
description: Main application building orchestrator. Creates full-stack applications from natural language requests. Determines project type, selects tech stack, coordinates agents.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Agent
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# App Builder - Application Building Orchestrator
|
|
8
|
+
|
|
9
|
+
> Analyzes user's requests, determines tech stack, plans structure, and coordinates agents.
|
|
10
|
+
|
|
11
|
+
## 🎯 Selective Reading Rule
|
|
12
|
+
|
|
13
|
+
**Read ONLY files relevant to the request!** Check the content map, find what you need.
|
|
14
|
+
|
|
15
|
+
| File | Description | When to Read |
|
|
16
|
+
|------|-------------|--------------|
|
|
17
|
+
| `project-detection.md` | Keyword matrix, project type detection | Starting new project |
|
|
18
|
+
| `tech-stack.md` | 2026 default stack, alternatives | Choosing technologies |
|
|
19
|
+
| `agent-coordination.md` | Agent pipeline, execution order | Coordinating multi-agent work |
|
|
20
|
+
| `scaffolding.md` | Directory structure, core files | Creating project structure |
|
|
21
|
+
| `feature-building.md` | Feature analysis, error handling | Adding features to existing project |
|
|
22
|
+
| `templates/SKILL.md` | **Project templates** | Scaffolding new project |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 📦 Templates (13)
|
|
27
|
+
|
|
28
|
+
Quick-start scaffolding for new projects. **Read the matching template only!**
|
|
29
|
+
|
|
30
|
+
| Template | Tech Stack | When to Use |
|
|
31
|
+
|----------|------------|-------------|
|
|
32
|
+
| [nextjs-fullstack](templates/nextjs-fullstack/TEMPLATE.md) | Next.js + Prisma | Full-stack web app |
|
|
33
|
+
| [nextjs-saas](templates/nextjs-saas/TEMPLATE.md) | Next.js + Stripe | SaaS product |
|
|
34
|
+
| [nextjs-static](templates/nextjs-static/TEMPLATE.md) | Next.js + Framer | Landing page |
|
|
35
|
+
| [nuxt-app](templates/nuxt-app/TEMPLATE.md) | Nuxt 3 + Pinia | Vue full-stack app |
|
|
36
|
+
| [express-api](templates/express-api/TEMPLATE.md) | Express + JWT | REST API |
|
|
37
|
+
| [python-fastapi](templates/python-fastapi/TEMPLATE.md) | FastAPI | Python API |
|
|
38
|
+
| [react-native-app](templates/react-native-app/TEMPLATE.md) | Expo + Zustand | Mobile app |
|
|
39
|
+
| [flutter-app](templates/flutter-app/TEMPLATE.md) | Flutter + Riverpod | Cross-platform mobile |
|
|
40
|
+
| [electron-desktop](templates/electron-desktop/TEMPLATE.md) | Electron + React | Desktop app |
|
|
41
|
+
| [chrome-extension](templates/chrome-extension/TEMPLATE.md) | Chrome MV3 | Browser extension |
|
|
42
|
+
| [cli-tool](templates/cli-tool/TEMPLATE.md) | Node.js + Commander | CLI app |
|
|
43
|
+
| [monorepo-turborepo](templates/monorepo-turborepo/TEMPLATE.md) | Turborepo + pnpm | Monorepo |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 🔗 Related Agents
|
|
48
|
+
|
|
49
|
+
| Agent | Role |
|
|
50
|
+
|-------|------|
|
|
51
|
+
| `project-planner` | Task breakdown, dependency graph |
|
|
52
|
+
| `frontend-specialist` | UI components, pages |
|
|
53
|
+
| `backend-specialist` | API, business logic |
|
|
54
|
+
| `database-architect` | Schema, migrations |
|
|
55
|
+
| `devops-engineer` | Deployment, preview |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Usage Example
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
User: "Make an Instagram clone with photo sharing and likes"
|
|
63
|
+
|
|
64
|
+
App Builder Process:
|
|
65
|
+
1. Project type: Social Media App
|
|
66
|
+
2. Tech stack: Next.js + Prisma + Cloudinary + Clerk
|
|
67
|
+
3. Create plan:
|
|
68
|
+
├─ Database schema (users, posts, likes, follows)
|
|
69
|
+
├─ API routes (12 endpoints)
|
|
70
|
+
├─ Pages (feed, profile, upload)
|
|
71
|
+
└─ Components (PostCard, Feed, LikeButton)
|
|
72
|
+
4. Coordinate agents
|
|
73
|
+
5. Report progress
|
|
74
|
+
6. Start preview
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
# Content from agent-coordination.md
|
|
81
|
+
|
|
82
|
+
# Agent Coordination
|
|
83
|
+
|
|
84
|
+
> How App Builder orchestrates specialist agents.
|
|
85
|
+
|
|
86
|
+
## Agent Pipeline
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
90
|
+
│ APP BUILDER (Orchestrator) │
|
|
91
|
+
└─────────────────────────────────────────────────────────────┘
|
|
92
|
+
│
|
|
93
|
+
▼
|
|
94
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
95
|
+
│ PROJECT PLANNER │
|
|
96
|
+
│ • Task breakdown │
|
|
97
|
+
│ • Dependency graph │
|
|
98
|
+
│ • File structure planning │
|
|
99
|
+
│ • Create {task-slug}.md in project root (MANDATORY) │
|
|
100
|
+
└─────────────────────────────────────────────────────────────┘
|
|
101
|
+
│
|
|
102
|
+
▼
|
|
103
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
104
|
+
│ CHECKPOINT: PLAN VERIFICATION │
|
|
105
|
+
│ 🔴 VERIFY: Does {task-slug}.md exist in project root? │
|
|
106
|
+
│ 🔴 If NO → STOP → Create plan file first │
|
|
107
|
+
│ 🔴 If YES → Proceed to specialist agents │
|
|
108
|
+
└─────────────────────────────────────────────────────────────┘
|
|
109
|
+
│
|
|
110
|
+
┌───────────────────┼───────────────────┐
|
|
111
|
+
▼ ▼ ▼
|
|
112
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
113
|
+
│ DATABASE │ │ BACKEND │ │ FRONTEND │
|
|
114
|
+
│ ARCHITECT │ │ SPECIALIST │ │ SPECIALIST │
|
|
115
|
+
│ │ │ │ │ │
|
|
116
|
+
│ • Schema design │ │ • API routes │ │ • Components │
|
|
117
|
+
│ • Migrations │ │ • Controllers │ │ • Pages │
|
|
118
|
+
│ • Seed data │ │ • Middleware │ │ • Styling │
|
|
119
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
120
|
+
│ │ │
|
|
121
|
+
└───────────────────┼───────────────────┘
|
|
122
|
+
▼
|
|
123
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
124
|
+
│ PARALLEL PHASE (Optional) │
|
|
125
|
+
│ • Security Auditor → Vulnerability check │
|
|
126
|
+
│ • Test Engineer → Unit tests │
|
|
127
|
+
│ • Performance Optimizer → Bundle analysis │
|
|
128
|
+
└─────────────────────────────────────────────────────────────┘
|
|
129
|
+
│
|
|
130
|
+
▼
|
|
131
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
132
|
+
│ DEVOPS ENGINEER │
|
|
133
|
+
│ • Environment setup │
|
|
134
|
+
│ • Preview deployment │
|
|
135
|
+
│ • Health check │
|
|
136
|
+
└─────────────────────────────────────────────────────────────┘
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Execution Order
|
|
140
|
+
|
|
141
|
+
| Phase | Agent(s) | Parallel? | Prerequisite | CHECKPOINT |
|
|
142
|
+
|-------|----------|-----------|--------------|------------|
|
|
143
|
+
| 0 | Socratic Gate | ❌ | - | ✅ Ask 3 questions |
|
|
144
|
+
| 1 | Project Planner | ❌ | Questions answered | ✅ **PLAN.md created** |
|
|
145
|
+
| 1.5 | **PLAN VERIFICATION** | ❌ | PLAN.md exists | ✅ **File exists in root** |
|
|
146
|
+
| 2 | Database Architect | ❌ | Plan ready | Schema defined |
|
|
147
|
+
| 3 | Backend Specialist | ❌ | Schema ready | API routes created |
|
|
148
|
+
| 4 | Frontend Specialist | ✅ | API ready (partial) | UI components ready |
|
|
149
|
+
| 5 | Security Auditor, Test Engineer | ✅ | Code ready | Tests & audit pass |
|
|
150
|
+
| 6 | DevOps Engineer | ❌ | All code ready | Deployment ready |
|
|
151
|
+
|
|
152
|
+
> 🔴 **CRITICAL:** Phase 1.5 is MANDATORY. No specialist agents proceed without PLAN.md verification.
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
# Content from feature-building.md
|
|
158
|
+
|
|
159
|
+
# Feature Building
|
|
160
|
+
|
|
161
|
+
> How to analyze and implement new features.
|
|
162
|
+
|
|
163
|
+
## Feature Analysis
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
Request: "add payment system"
|
|
167
|
+
|
|
168
|
+
Analysis:
|
|
169
|
+
├── Required Changes:
|
|
170
|
+
│ ├── Database: orders, payments tables
|
|
171
|
+
│ ├── Backend: /api/checkout, /api/webhooks/stripe
|
|
172
|
+
│ ├── Frontend: CheckoutForm, PaymentSuccess
|
|
173
|
+
│ └── Config: Stripe API keys
|
|
174
|
+
│
|
|
175
|
+
├── Dependencies:
|
|
176
|
+
│ ├── stripe package
|
|
177
|
+
│ └── Existing user authentication
|
|
178
|
+
│
|
|
179
|
+
└── Estimated Time: 15-20 minutes
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Iterative Enhancement Process
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
1. Analyze existing project
|
|
186
|
+
2. Create change plan
|
|
187
|
+
3. Present plan to user
|
|
188
|
+
4. Get approval
|
|
189
|
+
5. Apply changes
|
|
190
|
+
6. Test
|
|
191
|
+
7. Show preview
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Error Handling
|
|
195
|
+
|
|
196
|
+
| Error Type | Solution Strategy |
|
|
197
|
+
|------------|-------------------|
|
|
198
|
+
| TypeScript Error | Fix type, add missing import |
|
|
199
|
+
| Missing Dependency | Run npm install |
|
|
200
|
+
| Port Conflict | Suggest alternative port |
|
|
201
|
+
| Database Error | Check migration, validate connection |
|
|
202
|
+
|
|
203
|
+
## Recovery Strategy
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
1. Detect error
|
|
207
|
+
2. Try automatic fix
|
|
208
|
+
3. If failed, report to user
|
|
209
|
+
4. Suggest alternative
|
|
210
|
+
5. Rollback if necessary
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
# Content from project-detection.md
|
|
217
|
+
|
|
218
|
+
# Project Type Detection
|
|
219
|
+
|
|
220
|
+
> Analyze user requests to determine project type and template.
|
|
221
|
+
|
|
222
|
+
## Keyword Matrix
|
|
223
|
+
|
|
224
|
+
| Keywords | Project Type | Template |
|
|
225
|
+
|----------|--------------|----------|
|
|
226
|
+
| blog, post, article | Blog | astro-static |
|
|
227
|
+
| e-commerce, product, cart, payment | E-commerce | nextjs-saas |
|
|
228
|
+
| dashboard, panel, management | Admin Dashboard | nextjs-fullstack |
|
|
229
|
+
| api, backend, service, rest | API Service | express-api |
|
|
230
|
+
| python, fastapi, django | Python API | python-fastapi |
|
|
231
|
+
| mobile, android, ios, react native | Mobile App (RN) | react-native-app |
|
|
232
|
+
| flutter, dart | Mobile App (Flutter) | flutter-app |
|
|
233
|
+
| portfolio, personal, cv | Portfolio | nextjs-static |
|
|
234
|
+
| crm, customer, sales | CRM | nextjs-fullstack |
|
|
235
|
+
| saas, subscription, stripe | SaaS | nextjs-saas |
|
|
236
|
+
| landing, promotional, marketing | Landing Page | nextjs-static |
|
|
237
|
+
| docs, documentation | Documentation | astro-static |
|
|
238
|
+
| extension, plugin, chrome | Browser Extension | chrome-extension |
|
|
239
|
+
| desktop, electron | Desktop App | electron-desktop |
|
|
240
|
+
| cli, command line, terminal | CLI Tool | cli-tool |
|
|
241
|
+
| monorepo, workspace | Monorepo | monorepo-turborepo |
|
|
242
|
+
|
|
243
|
+
## Detection Process
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
1. Tokenize user request
|
|
247
|
+
2. Extract keywords
|
|
248
|
+
3. Determine project type
|
|
249
|
+
4. Detect missing information → forward to conversation-manager
|
|
250
|
+
5. Suggest tech stack
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
# Content from scaffolding.md
|
|
257
|
+
|
|
258
|
+
# Project Scaffolding
|
|
259
|
+
|
|
260
|
+
> Directory structure and core files for new projects.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Next.js Full-Stack Structure (2025 Optimized)
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
project-name/
|
|
268
|
+
├── src/
|
|
269
|
+
│ ├── app/ # Routes only (thin layer)
|
|
270
|
+
│ │ ├── layout.tsx
|
|
271
|
+
│ │ ├── page.tsx
|
|
272
|
+
│ │ ├── globals.css
|
|
273
|
+
│ │ ├── (auth)/ # Route group - auth pages
|
|
274
|
+
│ │ │ ├── login/page.tsx
|
|
275
|
+
│ │ │ └── register/page.tsx
|
|
276
|
+
│ │ ├── (dashboard)/ # Route group - dashboard layout
|
|
277
|
+
│ │ │ ├── layout.tsx
|
|
278
|
+
│ │ │ └── page.tsx
|
|
279
|
+
│ │ └── api/
|
|
280
|
+
│ │ └── [resource]/route.ts
|
|
281
|
+
│ │
|
|
282
|
+
│ ├── features/ # Feature-based modules
|
|
283
|
+
│ │ ├── auth/
|
|
284
|
+
│ │ │ ├── components/
|
|
285
|
+
│ │ │ ├── hooks/
|
|
286
|
+
│ │ │ ├── actions.ts # Server Actions
|
|
287
|
+
│ │ │ ├── queries.ts # Data fetching
|
|
288
|
+
│ │ │ └── types.ts
|
|
289
|
+
│ │ ├── products/
|
|
290
|
+
│ │ │ ├── components/
|
|
291
|
+
│ │ │ ├── actions.ts
|
|
292
|
+
│ │ │ └── queries.ts
|
|
293
|
+
│ │ └── cart/
|
|
294
|
+
│ │ └── ...
|
|
295
|
+
│ │
|
|
296
|
+
│ ├── shared/ # Shared utilities
|
|
297
|
+
│ │ ├── components/ui/ # Reusable UI components
|
|
298
|
+
│ │ ├── lib/ # Utils, helpers
|
|
299
|
+
│ │ └── hooks/ # Global hooks
|
|
300
|
+
│ │
|
|
301
|
+
│ └── server/ # Server-only code
|
|
302
|
+
│ ├── db/ # Database client (Prisma)
|
|
303
|
+
│ ├── auth/ # Auth config
|
|
304
|
+
│ └── services/ # External API integrations
|
|
305
|
+
│
|
|
306
|
+
├── prisma/
|
|
307
|
+
│ ├── schema.prisma
|
|
308
|
+
│ ├── migrations/
|
|
309
|
+
│ └── seed.ts
|
|
310
|
+
│
|
|
311
|
+
├── public/
|
|
312
|
+
├── .env.example
|
|
313
|
+
├── .env.local
|
|
314
|
+
├── package.json
|
|
315
|
+
├── tailwind.config.ts
|
|
316
|
+
├── tsconfig.json
|
|
317
|
+
└── README.md
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Structure Principles
|
|
323
|
+
|
|
324
|
+
| Principle | Implementation |
|
|
325
|
+
|-----------|----------------|
|
|
326
|
+
| **Feature isolation** | Each feature in `features/` with its own components, hooks, actions |
|
|
327
|
+
| **Server/Client separation** | Server-only code in `server/`, prevents accidental client imports |
|
|
328
|
+
| **Thin routes** | `app/` only for routing, logic lives in `features/` |
|
|
329
|
+
| **Route groups** | `(groupName)/` for layout sharing without URL impact |
|
|
330
|
+
| **Shared code** | `shared/` for truly reusable UI and utilities |
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Core Files
|
|
335
|
+
|
|
336
|
+
| File | Purpose |
|
|
337
|
+
|------|---------|
|
|
338
|
+
| `package.json` | Dependencies |
|
|
339
|
+
| `tsconfig.json` | TypeScript + path aliases (`@/features/*`) |
|
|
340
|
+
| `tailwind.config.ts` | Tailwind config |
|
|
341
|
+
| `.env.example` | Environment template |
|
|
342
|
+
| `README.md` | Project documentation |
|
|
343
|
+
| `.gitignore` | Git ignore rules |
|
|
344
|
+
| `prisma/schema.prisma` | Database schema |
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Path Aliases (tsconfig.json)
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
{
|
|
352
|
+
"compilerOptions": {
|
|
353
|
+
"paths": {
|
|
354
|
+
"@/*": ["./src/*"],
|
|
355
|
+
"@/features/*": ["./src/features/*"],
|
|
356
|
+
"@/shared/*": ["./src/shared/*"],
|
|
357
|
+
"@/server/*": ["./src/server/*"]
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## When to Use What
|
|
366
|
+
|
|
367
|
+
| Need | Location |
|
|
368
|
+
|------|----------|
|
|
369
|
+
| New page/route | `app/(group)/page.tsx` |
|
|
370
|
+
| Feature component | `features/[name]/components/` |
|
|
371
|
+
| Server action | `features/[name]/actions.ts` |
|
|
372
|
+
| Data fetching | `features/[name]/queries.ts` |
|
|
373
|
+
| Reusable button/input | `shared/components/ui/` |
|
|
374
|
+
| Database query | `server/db/` |
|
|
375
|
+
| External API call | `server/services/` |
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
# Content from tech-stack.md
|
|
381
|
+
|
|
382
|
+
# Tech Stack Selection (2026)
|
|
383
|
+
|
|
384
|
+
> Default and alternative technology choices for web applications.
|
|
385
|
+
|
|
386
|
+
## Default Stack (Web App - 2026)
|
|
387
|
+
|
|
388
|
+
```yaml
|
|
389
|
+
Frontend:
|
|
390
|
+
framework: Next.js 16 (Stable)
|
|
391
|
+
language: TypeScript 5.7+
|
|
392
|
+
styling: Tailwind CSS v4
|
|
393
|
+
state: React 19 Actions / Server Components
|
|
394
|
+
bundler: Turbopack (Stable for Dev)
|
|
395
|
+
|
|
396
|
+
Backend:
|
|
397
|
+
runtime: Node.js 23
|
|
398
|
+
framework: Next.js API Routes / Hono (for Edge)
|
|
399
|
+
validation: Zod / TypeBox
|
|
400
|
+
|
|
401
|
+
Database:
|
|
402
|
+
primary: PostgreSQL
|
|
403
|
+
orm: Prisma / Drizzle
|
|
404
|
+
hosting: Supabase / Neon
|
|
405
|
+
|
|
406
|
+
Auth:
|
|
407
|
+
provider: Auth.js (v5) / Clerk
|
|
408
|
+
|
|
409
|
+
Monorepo:
|
|
410
|
+
tool: Turborepo 2.0
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
## Alternative Options
|
|
414
|
+
|
|
415
|
+
| Need | Default | Alternative |
|
|
416
|
+
|------|---------|-------------|
|
|
417
|
+
| Real-time | - | Supabase Realtime, Socket.io |
|
|
418
|
+
| File storage | - | Cloudinary, S3 |
|
|
419
|
+
| Payment | Stripe | LemonSqueezy, Paddle |
|
|
420
|
+
| Email | - | Resend, SendGrid |
|
|
421
|
+
| Search | - | Algolia, Typesense |
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
# Content from TEMPLATE.md
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
name: astro-static
|
|
430
|
+
description: Astro static site template principles. Content-focused websites, blogs, documentation.
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
# Astro Static Site Template
|
|
434
|
+
|
|
435
|
+
## Tech Stack
|
|
436
|
+
|
|
437
|
+
| Component | Technology |
|
|
438
|
+
|-----------|------------|
|
|
439
|
+
| Framework | Astro 4.x |
|
|
440
|
+
| Content | MDX + Content Collections |
|
|
441
|
+
| Styling | Tailwind CSS |
|
|
442
|
+
| Integrations | Sitemap, RSS, SEO |
|
|
443
|
+
| Output | Static/SSG |
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## Directory Structure
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
project-name/
|
|
451
|
+
├── src/
|
|
452
|
+
│ ├── components/ # .astro components
|
|
453
|
+
│ ├── content/ # MDX content
|
|
454
|
+
│ │ ├── blog/
|
|
455
|
+
│ │ └── config.ts # Collection schemas
|
|
456
|
+
│ ├── layouts/ # Page layouts
|
|
457
|
+
│ ├── pages/ # File-based routing
|
|
458
|
+
│ └── styles/
|
|
459
|
+
├── public/ # Static assets
|
|
460
|
+
├── astro.config.mjs
|
|
461
|
+
└── package.json
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## Key Concepts
|
|
467
|
+
|
|
468
|
+
| Concept | Description |
|
|
469
|
+
|---------|-------------|
|
|
470
|
+
| Content Collections | Type-safe content with Zod schemas |
|
|
471
|
+
| Islands Architecture | Partial hydration for interactivity |
|
|
472
|
+
| Zero JS by default | Static HTML unless needed |
|
|
473
|
+
| MDX Support | Markdown with components |
|
|
474
|
+
|
|
475
|
+
---
|
|
476
|
+
|
|
477
|
+
## Setup Steps
|
|
478
|
+
|
|
479
|
+
1. `npm create astro@latest {{name}}`
|
|
480
|
+
2. Add integrations: `npx astro add mdx tailwind sitemap`
|
|
481
|
+
3. Configure `astro.config.mjs`
|
|
482
|
+
4. Create content collections
|
|
483
|
+
5. `npm run dev`
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## Deployment
|
|
488
|
+
|
|
489
|
+
| Platform | Method |
|
|
490
|
+
|----------|--------|
|
|
491
|
+
| Vercel | Auto-detected |
|
|
492
|
+
| Netlify | Auto-detected |
|
|
493
|
+
| Cloudflare Pages | Auto-detected |
|
|
494
|
+
| GitHub Pages | Build + deploy action |
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
## Best Practices
|
|
499
|
+
|
|
500
|
+
- Use Content Collections for type safety
|
|
501
|
+
- Leverage static generation
|
|
502
|
+
- Add islands only where needed
|
|
503
|
+
- Optimize images with Astro Image
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
# Content from TEMPLATE.md
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
name: chrome-extension
|
|
512
|
+
description: Chrome Extension template principles. Manifest V3, React, TypeScript.
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
# Chrome Extension Template
|
|
516
|
+
|
|
517
|
+
## Tech Stack
|
|
518
|
+
|
|
519
|
+
| Component | Technology |
|
|
520
|
+
|-----------|------------|
|
|
521
|
+
| Manifest | V3 |
|
|
522
|
+
| UI | React 18 |
|
|
523
|
+
| Language | TypeScript |
|
|
524
|
+
| Styling | Tailwind CSS |
|
|
525
|
+
| Bundler | Vite |
|
|
526
|
+
| Storage | Chrome Storage API |
|
|
527
|
+
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
## Directory Structure
|
|
531
|
+
|
|
532
|
+
```
|
|
533
|
+
project-name/
|
|
534
|
+
├── src/
|
|
535
|
+
│ ├── popup/ # Extension popup
|
|
536
|
+
│ ├── options/ # Options page
|
|
537
|
+
│ ├── background/ # Service worker
|
|
538
|
+
│ ├── content/ # Content scripts
|
|
539
|
+
│ ├── components/
|
|
540
|
+
│ ├── hooks/
|
|
541
|
+
│ └── lib/
|
|
542
|
+
│ ├── storage.ts # Chrome storage helpers
|
|
543
|
+
│ └── messaging.ts # Message passing
|
|
544
|
+
├── public/
|
|
545
|
+
│ ├── icons/
|
|
546
|
+
│ └── manifest.json
|
|
547
|
+
└── package.json
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
## Manifest V3 Concepts
|
|
553
|
+
|
|
554
|
+
| Component | Purpose |
|
|
555
|
+
|-----------|---------|
|
|
556
|
+
| Service Worker | Background processing |
|
|
557
|
+
| Content Scripts | Page injection |
|
|
558
|
+
| Popup | User interface |
|
|
559
|
+
| Options Page | Settings |
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
563
|
+
## Permissions
|
|
564
|
+
|
|
565
|
+
| Permission | Use |
|
|
566
|
+
|------------|-----|
|
|
567
|
+
| storage | Save user data |
|
|
568
|
+
| activeTab | Current tab access |
|
|
569
|
+
| scripting | Inject scripts |
|
|
570
|
+
| host_permissions | Site access |
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
## Setup Steps
|
|
575
|
+
|
|
576
|
+
1. `npm create vite {{name}} -- --template react-ts`
|
|
577
|
+
2. Add Chrome types: `npm install -D @types/chrome`
|
|
578
|
+
3. Configure Vite for multi-entry
|
|
579
|
+
4. Create manifest.json
|
|
580
|
+
5. `npm run dev` (watch mode)
|
|
581
|
+
6. Load in Chrome: `chrome://extensions` → Load unpacked
|
|
582
|
+
|
|
583
|
+
---
|
|
584
|
+
|
|
585
|
+
## Development Tips
|
|
586
|
+
|
|
587
|
+
| Task | Method |
|
|
588
|
+
|------|--------|
|
|
589
|
+
| Debug Popup | Right-click icon → Inspect |
|
|
590
|
+
| Debug Background | Extensions page → Service worker |
|
|
591
|
+
| Debug Content | DevTools console on page |
|
|
592
|
+
| Hot Reload | `npm run dev` with watch |
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
## Best Practices
|
|
597
|
+
|
|
598
|
+
- Use type-safe messaging
|
|
599
|
+
- Wrap Chrome APIs in promises
|
|
600
|
+
- Minimize permissions
|
|
601
|
+
- Handle offline gracefully
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
---
|
|
606
|
+
# Content from TEMPLATE.md
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
name: cli-tool
|
|
610
|
+
description: Node.js CLI tool template principles. Commander.js, interactive prompts.
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
# CLI Tool Template
|
|
614
|
+
|
|
615
|
+
## Tech Stack
|
|
616
|
+
|
|
617
|
+
| Component | Technology |
|
|
618
|
+
|-----------|------------|
|
|
619
|
+
| Runtime | Node.js 20+ |
|
|
620
|
+
| Language | TypeScript |
|
|
621
|
+
| CLI Framework | Commander.js |
|
|
622
|
+
| Prompts | Inquirer.js |
|
|
623
|
+
| Output | chalk + ora |
|
|
624
|
+
| Config | cosmiconfig |
|
|
625
|
+
|
|
626
|
+
---
|
|
627
|
+
|
|
628
|
+
## Directory Structure
|
|
629
|
+
|
|
630
|
+
```
|
|
631
|
+
project-name/
|
|
632
|
+
├── src/
|
|
633
|
+
│ ├── index.ts # Entry point
|
|
634
|
+
│ ├── cli.ts # CLI setup
|
|
635
|
+
│ ├── commands/ # Command handlers
|
|
636
|
+
│ ├── lib/
|
|
637
|
+
│ │ ├── config.ts # Config loader
|
|
638
|
+
│ │ └── logger.ts # Styled output
|
|
639
|
+
│ └── types/
|
|
640
|
+
├── bin/
|
|
641
|
+
│ └── cli.js # Executable
|
|
642
|
+
└── package.json
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
647
|
+
## CLI Design Principles
|
|
648
|
+
|
|
649
|
+
| Principle | Description |
|
|
650
|
+
|-----------|-------------|
|
|
651
|
+
| Subcommands | Group related actions |
|
|
652
|
+
| Options | Flags with defaults |
|
|
653
|
+
| Interactive | Prompts when needed |
|
|
654
|
+
| Non-interactive | Support --yes flags |
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## Key Components
|
|
659
|
+
|
|
660
|
+
| Component | Purpose |
|
|
661
|
+
|-----------|---------|
|
|
662
|
+
| Commander | Command parsing |
|
|
663
|
+
| Inquirer | Interactive prompts |
|
|
664
|
+
| Chalk | Colored output |
|
|
665
|
+
| Ora | Spinners/loading |
|
|
666
|
+
| Cosmiconfig | Config file discovery |
|
|
667
|
+
|
|
668
|
+
---
|
|
669
|
+
|
|
670
|
+
## Setup Steps
|
|
671
|
+
|
|
672
|
+
1. Create project directory
|
|
673
|
+
2. `npm init -y`
|
|
674
|
+
3. Install deps: `npm install commander @inquirer/prompts chalk ora cosmiconfig`
|
|
675
|
+
4. Configure bin in package.json
|
|
676
|
+
5. `npm link` for local testing
|
|
677
|
+
|
|
678
|
+
---
|
|
679
|
+
|
|
680
|
+
## Publishing
|
|
681
|
+
|
|
682
|
+
```bash
|
|
683
|
+
npm login
|
|
684
|
+
npm publish
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
---
|
|
688
|
+
|
|
689
|
+
## Best Practices
|
|
690
|
+
|
|
691
|
+
- Provide helpful error messages
|
|
692
|
+
- Support both interactive and non-interactive modes
|
|
693
|
+
- Use consistent output styling
|
|
694
|
+
- Validate inputs with Zod
|
|
695
|
+
- Exit with proper codes (0 success, 1 error)
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
---
|
|
700
|
+
# Content from TEMPLATE.md
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
name: electron-desktop
|
|
704
|
+
description: Electron desktop app template principles. Cross-platform, React, TypeScript.
|
|
705
|
+
---
|
|
706
|
+
|
|
707
|
+
# Electron Desktop App Template
|
|
708
|
+
|
|
709
|
+
## Tech Stack
|
|
710
|
+
|
|
711
|
+
| Component | Technology |
|
|
712
|
+
|-----------|------------|
|
|
713
|
+
| Framework | Electron 28+ |
|
|
714
|
+
| UI | React 18 |
|
|
715
|
+
| Language | TypeScript |
|
|
716
|
+
| Styling | Tailwind CSS |
|
|
717
|
+
| Bundler | Vite + electron-builder |
|
|
718
|
+
| IPC | Type-safe communication |
|
|
719
|
+
|
|
720
|
+
---
|
|
721
|
+
|
|
722
|
+
## Directory Structure
|
|
723
|
+
|
|
724
|
+
```
|
|
725
|
+
project-name/
|
|
726
|
+
├── electron/
|
|
727
|
+
│ ├── main.ts # Main process
|
|
728
|
+
│ ├── preload.ts # Preload script
|
|
729
|
+
│ └── ipc/ # IPC handlers
|
|
730
|
+
├── src/
|
|
731
|
+
│ ├── App.tsx
|
|
732
|
+
│ ├── components/
|
|
733
|
+
│ │ ├── TitleBar.tsx # Custom title bar
|
|
734
|
+
│ │ └── ...
|
|
735
|
+
│ └── hooks/
|
|
736
|
+
├── public/
|
|
737
|
+
└── package.json
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
---
|
|
741
|
+
|
|
742
|
+
## Process Model
|
|
743
|
+
|
|
744
|
+
| Process | Role |
|
|
745
|
+
|---------|------|
|
|
746
|
+
| Main | Node.js, system access |
|
|
747
|
+
| Renderer | Chromium, React UI |
|
|
748
|
+
| Preload | Bridge, context isolation |
|
|
749
|
+
|
|
750
|
+
---
|
|
751
|
+
|
|
752
|
+
## Key Concepts
|
|
753
|
+
|
|
754
|
+
| Concept | Purpose |
|
|
755
|
+
|---------|---------|
|
|
756
|
+
| contextBridge | Safe API exposure |
|
|
757
|
+
| ipcMain/ipcRenderer | Process communication |
|
|
758
|
+
| nodeIntegration: false | Security |
|
|
759
|
+
| contextIsolation: true | Security |
|
|
760
|
+
|
|
761
|
+
---
|
|
762
|
+
|
|
763
|
+
## Setup Steps
|
|
764
|
+
|
|
765
|
+
1. `npm create vite {{name}} -- --template react-ts`
|
|
766
|
+
2. Install: `npm install -D electron electron-builder vite-plugin-electron`
|
|
767
|
+
3. Create electron/ directory
|
|
768
|
+
4. Configure main process
|
|
769
|
+
5. `npm run electron:dev`
|
|
770
|
+
|
|
771
|
+
---
|
|
772
|
+
|
|
773
|
+
## Build Targets
|
|
774
|
+
|
|
775
|
+
| Platform | Output |
|
|
776
|
+
|----------|--------|
|
|
777
|
+
| Windows | NSIS, Portable |
|
|
778
|
+
| macOS | DMG, ZIP |
|
|
779
|
+
| Linux | AppImage, DEB |
|
|
780
|
+
|
|
781
|
+
---
|
|
782
|
+
|
|
783
|
+
## Best Practices
|
|
784
|
+
|
|
785
|
+
- Use preload script for main/renderer bridge
|
|
786
|
+
- Type-safe IPC with typed handlers
|
|
787
|
+
- Custom title bar for native feel
|
|
788
|
+
- Handle window state (maximize, minimize)
|
|
789
|
+
- Auto-updates with electron-updater
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
---
|
|
794
|
+
# Content from TEMPLATE.md
|
|
795
|
+
|
|
796
|
+
---
|
|
797
|
+
name: express-api
|
|
798
|
+
description: Express.js REST API template principles. TypeScript, Prisma, JWT.
|
|
799
|
+
---
|
|
800
|
+
|
|
801
|
+
# Express.js API Template
|
|
802
|
+
|
|
803
|
+
## Tech Stack
|
|
804
|
+
|
|
805
|
+
| Component | Technology |
|
|
806
|
+
|-----------|------------|
|
|
807
|
+
| Runtime | Node.js 20+ |
|
|
808
|
+
| Framework | Express.js |
|
|
809
|
+
| Language | TypeScript |
|
|
810
|
+
| Database | PostgreSQL + Prisma |
|
|
811
|
+
| Validation | Zod |
|
|
812
|
+
| Auth | JWT + bcrypt |
|
|
813
|
+
|
|
814
|
+
---
|
|
815
|
+
|
|
816
|
+
## Directory Structure
|
|
817
|
+
|
|
818
|
+
```
|
|
819
|
+
project-name/
|
|
820
|
+
├── prisma/
|
|
821
|
+
│ └── schema.prisma
|
|
822
|
+
├── src/
|
|
823
|
+
│ ├── app.ts # Express setup
|
|
824
|
+
│ ├── config/ # Environment
|
|
825
|
+
│ ├── routes/ # Route handlers
|
|
826
|
+
│ ├── controllers/ # Business logic
|
|
827
|
+
│ ├── services/ # Data access
|
|
828
|
+
│ ├── middleware/
|
|
829
|
+
│ │ ├── auth.ts # JWT verify
|
|
830
|
+
│ │ ├── error.ts # Error handler
|
|
831
|
+
│ │ └── validate.ts # Zod validation
|
|
832
|
+
│ ├── schemas/ # Zod schemas
|
|
833
|
+
│ └── utils/
|
|
834
|
+
└── package.json
|
|
835
|
+
```
|
|
836
|
+
|
|
837
|
+
---
|
|
838
|
+
|
|
839
|
+
## Middleware Stack
|
|
840
|
+
|
|
841
|
+
| Order | Middleware |
|
|
842
|
+
|-------|------------|
|
|
843
|
+
| 1 | helmet (security) |
|
|
844
|
+
| 2 | cors |
|
|
845
|
+
| 3 | morgan (logging) |
|
|
846
|
+
| 4 | body parsing |
|
|
847
|
+
| 5 | routes |
|
|
848
|
+
| 6 | error handler |
|
|
849
|
+
|
|
850
|
+
---
|
|
851
|
+
|
|
852
|
+
## API Response Format
|
|
853
|
+
|
|
854
|
+
| Type | Structure |
|
|
855
|
+
|------|-----------|
|
|
856
|
+
| Success | `{ success: true, data: {...} }` |
|
|
857
|
+
| Error | `{ error: "message", details: [...] }` |
|
|
858
|
+
|
|
859
|
+
---
|
|
860
|
+
|
|
861
|
+
## Setup Steps
|
|
862
|
+
|
|
863
|
+
1. Create project directory
|
|
864
|
+
2. `npm init -y`
|
|
865
|
+
3. Install deps: `npm install express prisma zod bcrypt jsonwebtoken`
|
|
866
|
+
4. Configure Prisma
|
|
867
|
+
5. `npm run db:push`
|
|
868
|
+
6. `npm run dev`
|
|
869
|
+
|
|
870
|
+
---
|
|
871
|
+
|
|
872
|
+
## Best Practices
|
|
873
|
+
|
|
874
|
+
- Layer architecture (routes → controllers → services)
|
|
875
|
+
- Validate all inputs with Zod
|
|
876
|
+
- Centralized error handling
|
|
877
|
+
- Environment-based config
|
|
878
|
+
- Use Prisma for type-safe DB access
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
---
|
|
883
|
+
# Content from TEMPLATE.md
|
|
884
|
+
|
|
885
|
+
---
|
|
886
|
+
name: flutter-app
|
|
887
|
+
description: Flutter mobile app template principles. Riverpod, Go Router, clean architecture.
|
|
888
|
+
---
|
|
889
|
+
|
|
890
|
+
# Flutter App Template
|
|
891
|
+
|
|
892
|
+
## Tech Stack
|
|
893
|
+
|
|
894
|
+
| Component | Technology |
|
|
895
|
+
|-----------|------------|
|
|
896
|
+
| Framework | Flutter 3.x |
|
|
897
|
+
| Language | Dart 3.x |
|
|
898
|
+
| State | Riverpod 2.0 |
|
|
899
|
+
| Navigation | Go Router |
|
|
900
|
+
| HTTP | Dio |
|
|
901
|
+
| Storage | Hive |
|
|
902
|
+
|
|
903
|
+
---
|
|
904
|
+
|
|
905
|
+
## Directory Structure
|
|
906
|
+
|
|
907
|
+
```
|
|
908
|
+
project_name/
|
|
909
|
+
├── lib/
|
|
910
|
+
│ ├── main.dart
|
|
911
|
+
│ ├── app.dart
|
|
912
|
+
│ ├── core/
|
|
913
|
+
│ │ ├── constants/
|
|
914
|
+
│ │ ├── theme/
|
|
915
|
+
│ │ ├── router/
|
|
916
|
+
│ │ └── utils/
|
|
917
|
+
│ ├── features/
|
|
918
|
+
│ │ ├── auth/
|
|
919
|
+
│ │ │ ├── data/
|
|
920
|
+
│ │ │ ├── domain/
|
|
921
|
+
│ │ │ └── presentation/
|
|
922
|
+
│ │ └── home/
|
|
923
|
+
│ ├── shared/
|
|
924
|
+
│ │ ├── widgets/
|
|
925
|
+
│ │ └── providers/
|
|
926
|
+
│ └── services/
|
|
927
|
+
│ ├── api/
|
|
928
|
+
│ └── storage/
|
|
929
|
+
├── test/
|
|
930
|
+
└── pubspec.yaml
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
---
|
|
934
|
+
|
|
935
|
+
## Architecture Layers
|
|
936
|
+
|
|
937
|
+
| Layer | Contents |
|
|
938
|
+
|-------|----------|
|
|
939
|
+
| Presentation | Screens, Widgets, Providers |
|
|
940
|
+
| Domain | Entities, Use Cases |
|
|
941
|
+
| Data | Repositories, Models |
|
|
942
|
+
|
|
943
|
+
---
|
|
944
|
+
|
|
945
|
+
## Key Packages
|
|
946
|
+
|
|
947
|
+
| Package | Purpose |
|
|
948
|
+
|---------|---------|
|
|
949
|
+
| flutter_riverpod | State management |
|
|
950
|
+
| riverpod_annotation | Code generation |
|
|
951
|
+
| go_router | Navigation |
|
|
952
|
+
| dio | HTTP client |
|
|
953
|
+
| freezed | Immutable models |
|
|
954
|
+
| hive | Local storage |
|
|
955
|
+
|
|
956
|
+
---
|
|
957
|
+
|
|
958
|
+
## Setup Steps
|
|
959
|
+
|
|
960
|
+
1. `flutter create {{name}} --org com.{{bundle}}`
|
|
961
|
+
2. Update `pubspec.yaml`
|
|
962
|
+
3. `flutter pub get`
|
|
963
|
+
4. Run code generation: `dart run build_runner build`
|
|
964
|
+
5. `flutter run`
|
|
965
|
+
|
|
966
|
+
---
|
|
967
|
+
|
|
968
|
+
## Best Practices
|
|
969
|
+
|
|
970
|
+
- Feature-first folder structure
|
|
971
|
+
- Riverpod for state, React Query pattern for server state
|
|
972
|
+
- Freezed for immutable data classes
|
|
973
|
+
- Go Router for declarative navigation
|
|
974
|
+
- Material 3 theming
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
---
|
|
979
|
+
# Content from TEMPLATE.md
|
|
980
|
+
|
|
981
|
+
---
|
|
982
|
+
name: monorepo-turborepo
|
|
983
|
+
description: Turborepo monorepo template principles. pnpm workspaces, shared packages.
|
|
984
|
+
---
|
|
985
|
+
|
|
986
|
+
# Turborepo Monorepo Template
|
|
987
|
+
|
|
988
|
+
## Tech Stack
|
|
989
|
+
|
|
990
|
+
| Component | Technology |
|
|
991
|
+
|-----------|------------|
|
|
992
|
+
| Build System | Turborepo |
|
|
993
|
+
| Package Manager | pnpm |
|
|
994
|
+
| Apps | Next.js, Express |
|
|
995
|
+
| Packages | Shared UI, Config, Types |
|
|
996
|
+
| Language | TypeScript |
|
|
997
|
+
|
|
998
|
+
---
|
|
999
|
+
|
|
1000
|
+
## Directory Structure
|
|
1001
|
+
|
|
1002
|
+
```
|
|
1003
|
+
project-name/
|
|
1004
|
+
├── apps/
|
|
1005
|
+
│ ├── web/ # Next.js app
|
|
1006
|
+
│ ├── api/ # Express API
|
|
1007
|
+
│ └── docs/ # Documentation
|
|
1008
|
+
├── packages/
|
|
1009
|
+
│ ├── ui/ # Shared components
|
|
1010
|
+
│ ├── config/ # ESLint, TS, Tailwind
|
|
1011
|
+
│ ├── types/ # Shared types
|
|
1012
|
+
│ └── utils/ # Shared utilities
|
|
1013
|
+
├── turbo.json
|
|
1014
|
+
├── pnpm-workspace.yaml
|
|
1015
|
+
└── package.json
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
---
|
|
1019
|
+
|
|
1020
|
+
## Key Concepts
|
|
1021
|
+
|
|
1022
|
+
| Concept | Description |
|
|
1023
|
+
|---------|-------------|
|
|
1024
|
+
| Workspaces | pnpm-workspace.yaml |
|
|
1025
|
+
| Pipeline | turbo.json task graph |
|
|
1026
|
+
| Caching | Remote/local task caching |
|
|
1027
|
+
| Dependencies | `workspace:*` protocol |
|
|
1028
|
+
|
|
1029
|
+
---
|
|
1030
|
+
|
|
1031
|
+
## Turbo Pipeline
|
|
1032
|
+
|
|
1033
|
+
| Task | Depends On |
|
|
1034
|
+
|------|------------|
|
|
1035
|
+
| build | ^build (dependencies first) |
|
|
1036
|
+
| dev | cache: false, persistent |
|
|
1037
|
+
| lint | ^build |
|
|
1038
|
+
| test | ^build |
|
|
1039
|
+
|
|
1040
|
+
---
|
|
1041
|
+
|
|
1042
|
+
## Setup Steps
|
|
1043
|
+
|
|
1044
|
+
1. Create root directory
|
|
1045
|
+
2. `pnpm init`
|
|
1046
|
+
3. Create pnpm-workspace.yaml
|
|
1047
|
+
4. Create turbo.json
|
|
1048
|
+
5. Add apps and packages
|
|
1049
|
+
6. `pnpm install`
|
|
1050
|
+
7. `pnpm dev`
|
|
1051
|
+
|
|
1052
|
+
---
|
|
1053
|
+
|
|
1054
|
+
## Common Commands
|
|
1055
|
+
|
|
1056
|
+
| Command | Description |
|
|
1057
|
+
|---------|-------------|
|
|
1058
|
+
| `pnpm dev` | Run all apps |
|
|
1059
|
+
| `pnpm build` | Build all |
|
|
1060
|
+
| `pnpm --filter @name/web dev` | Run specific app |
|
|
1061
|
+
| `pnpm --filter @name/web add axios` | Add dep to app |
|
|
1062
|
+
|
|
1063
|
+
---
|
|
1064
|
+
|
|
1065
|
+
## Best Practices
|
|
1066
|
+
|
|
1067
|
+
- Shared configs in packages/config
|
|
1068
|
+
- Shared types in packages/types
|
|
1069
|
+
- Internal packages with `workspace:*`
|
|
1070
|
+
- Use Turbo remote caching for CI
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
---
|
|
1075
|
+
# Content from TEMPLATE.md
|
|
1076
|
+
|
|
1077
|
+
---
|
|
1078
|
+
name: nextjs-fullstack
|
|
1079
|
+
description: Next.js full-stack template principles. App Router, Prisma, Tailwind v4.
|
|
1080
|
+
---
|
|
1081
|
+
|
|
1082
|
+
# Next.js Full-Stack Template (2026 Edition)
|
|
1083
|
+
|
|
1084
|
+
## Tech Stack
|
|
1085
|
+
|
|
1086
|
+
| Component | Technology | Version / Notes |
|
|
1087
|
+
|-----------|------------|-----------------|
|
|
1088
|
+
| Framework | Next.js | v16+ (App Router, Turbopack) |
|
|
1089
|
+
| Language | TypeScript | v5+ (Strict Mode) |
|
|
1090
|
+
| Database | PostgreSQL | Prisma ORM (Serverless friendly) |
|
|
1091
|
+
| Styling | Tailwind CSS | v4.0 (Zero-config, CSS-first) |
|
|
1092
|
+
| Auth | Clerk / Better Auth | Middleware Protected Routes |
|
|
1093
|
+
| UI Logic | React 19 | Server Actions, useActionState |
|
|
1094
|
+
| Validation | Zod | Schema validation (API & Forms) |
|
|
1095
|
+
|
|
1096
|
+
---
|
|
1097
|
+
|
|
1098
|
+
## Directory Structure
|
|
1099
|
+
|
|
1100
|
+
```
|
|
1101
|
+
project-name/
|
|
1102
|
+
├── prisma/
|
|
1103
|
+
│ └── schema.prisma # Database schema
|
|
1104
|
+
├── src/
|
|
1105
|
+
│ ├── app/
|
|
1106
|
+
│ │ ├── (auth)/ # Route groups for Login/Register
|
|
1107
|
+
│ │ ├── (dashboard)/ # Protected routes
|
|
1108
|
+
│ │ ├── api/ # Route Handlers (only for Webhooks/External integration)
|
|
1109
|
+
│ │ ├── layout.tsx # Root Layout (Metadata, Providers)
|
|
1110
|
+
│ │ ├── page.tsx # Landing Page
|
|
1111
|
+
│ │ └── globals.css # Tailwind v4 config (@theme) lives here
|
|
1112
|
+
│ ├── components/
|
|
1113
|
+
│ │ ├── ui/ # Reusable UI (Button, Input)
|
|
1114
|
+
│ │ └── forms/ # Client forms using useActionState
|
|
1115
|
+
│ ├── lib/
|
|
1116
|
+
│ │ ├── db.ts # Prisma singleton client
|
|
1117
|
+
│ │ ├── utils.ts # Helper functions
|
|
1118
|
+
│ │ └── dal.ts # Data Access Layer (Server-only)
|
|
1119
|
+
│ ├── actions/ # Server Actions (Mutations)
|
|
1120
|
+
│ └── types/ # Global TS Types
|
|
1121
|
+
├── public/
|
|
1122
|
+
├── next.config.ts # TypeScript Config
|
|
1123
|
+
└── package.json
|
|
1124
|
+
```
|
|
1125
|
+
|
|
1126
|
+
---
|
|
1127
|
+
|
|
1128
|
+
## Key Concepts (Updated)
|
|
1129
|
+
|
|
1130
|
+
| Concept | Description |
|
|
1131
|
+
|---------|-------------|
|
|
1132
|
+
| Server Components | Render on server (default). Direct DB access (Prisma) without APIs. |
|
|
1133
|
+
| Server Actions | Handle Form mutations. Replaces traditional API Routes. Use in action={}. |
|
|
1134
|
+
| React 19 Hooks | Form state management: useActionState, useFormStatus, useOptimistic. |
|
|
1135
|
+
| Data Access Layer | Data security. Separation of DB logic (DTOs) for safe reuse. |
|
|
1136
|
+
| Tailwind v4 | Styling engine. No tailwind.config.js. Config directly in CSS. |
|
|
1137
|
+
|
|
1138
|
+
---
|
|
1139
|
+
|
|
1140
|
+
## Environment Variables
|
|
1141
|
+
|
|
1142
|
+
| Variable | Purpose |
|
|
1143
|
+
|----------|---------|
|
|
1144
|
+
| DATABASE_URL | PostgreSQL connection string (Prisma) |
|
|
1145
|
+
| NEXT_PUBLIC_APP_URL | Public application URL |
|
|
1146
|
+
| NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Auth (if using Clerk) |
|
|
1147
|
+
| CLERK_SECRET_KEY | Auth Secret (Server only) |
|
|
1148
|
+
|
|
1149
|
+
---
|
|
1150
|
+
|
|
1151
|
+
## Setup Steps
|
|
1152
|
+
|
|
1153
|
+
1. Initialize Project:
|
|
1154
|
+
```bash
|
|
1155
|
+
npx create-next-app@latest my-app --typescript --tailwind --eslint
|
|
1156
|
+
# Select Yes for App Router
|
|
1157
|
+
# Select No for src directory (optional, this template uses src)
|
|
1158
|
+
```
|
|
1159
|
+
|
|
1160
|
+
2. Install DB & Validation:
|
|
1161
|
+
```bash
|
|
1162
|
+
npm install prisma @prisma/client zod
|
|
1163
|
+
npm install -D ts-node # For running seed scripts
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
3. Configure Tailwind v4 (If missing):
|
|
1167
|
+
Ensure `src/app/globals.css` uses the new import syntax instead of a config file:
|
|
1168
|
+
```css
|
|
1169
|
+
@import "tailwindcss";
|
|
1170
|
+
|
|
1171
|
+
@theme {
|
|
1172
|
+
--color-primary: oklch(0.5 0.2 240);
|
|
1173
|
+
--font-sans: "Inter", sans-serif;
|
|
1174
|
+
}
|
|
1175
|
+
```
|
|
1176
|
+
|
|
1177
|
+
4. Initialize Database:
|
|
1178
|
+
```bash
|
|
1179
|
+
npx prisma init
|
|
1180
|
+
# Update schema.prisma
|
|
1181
|
+
npm run db:push
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
5. Run Developer Server:
|
|
1185
|
+
```bash
|
|
1186
|
+
npm run dev --turbo
|
|
1187
|
+
# --turbo to enable faster Turbopack
|
|
1188
|
+
```
|
|
1189
|
+
|
|
1190
|
+
---
|
|
1191
|
+
|
|
1192
|
+
## Best Practices (2026 Standards)
|
|
1193
|
+
|
|
1194
|
+
- **Fetch Data**: Call Prisma directly in Server Components (async/await). Do not use useEffect for initial data fetching.
|
|
1195
|
+
- **Mutations**: Use Server Actions combined with React 19's `useActionState` to handle loading and error states instead of manual useState.
|
|
1196
|
+
- **Type Safety**: Share Zod schemas between Server Actions (input validation) and Client Forms.
|
|
1197
|
+
- **Security**: Always validate input data with Zod before passing it to Prisma.
|
|
1198
|
+
- **Styling**: Use native CSS variables in Tailwind v4 for easier dynamic theming.
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
---
|
|
1203
|
+
# Content from TEMPLATE.md
|
|
1204
|
+
|
|
1205
|
+
---
|
|
1206
|
+
name: nextjs-saas
|
|
1207
|
+
description: Next.js SaaS template principles (2026 Standards). React 19, Server Actions, Auth.js v6.
|
|
1208
|
+
---
|
|
1209
|
+
|
|
1210
|
+
# Next.js SaaS Template (Updated 2026)
|
|
1211
|
+
|
|
1212
|
+
## Tech Stack
|
|
1213
|
+
|
|
1214
|
+
| Component | Technology | Version / Notes |
|
|
1215
|
+
|-----------|------------|-----------------|
|
|
1216
|
+
| Framework | Next.js | v16+ (App Router, React Compiler) |
|
|
1217
|
+
| Runtime | Node.js | v24 (Krypton LTS) |
|
|
1218
|
+
| Auth | Auth.js | v6 (formerly NextAuth) |
|
|
1219
|
+
| Payments | Stripe API | Latest |
|
|
1220
|
+
| Database | PostgreSQL | Prisma v6 (Serverless Driver) |
|
|
1221
|
+
| Email | Resend | React Email |
|
|
1222
|
+
| UI | Tailwind CSS | v4 (Oxide Engine, no config file) |
|
|
1223
|
+
|
|
1224
|
+
---
|
|
1225
|
+
|
|
1226
|
+
## Directory Structure
|
|
1227
|
+
|
|
1228
|
+
```
|
|
1229
|
+
project-name/
|
|
1230
|
+
├── prisma/
|
|
1231
|
+
│ └── schema.prisma # Database Schema
|
|
1232
|
+
├── src/
|
|
1233
|
+
│ ├── actions/ # NEW: Server Actions (Replaces API Routes for data mutation)
|
|
1234
|
+
│ │ ├── auth-actions.ts
|
|
1235
|
+
│ │ ├── billing-actions.ts
|
|
1236
|
+
│ │ └── user-actions.ts
|
|
1237
|
+
│ ├── app/
|
|
1238
|
+
│ │ ├── (auth)/ # Route Group: Login, register
|
|
1239
|
+
│ │ ├── (dashboard)/ # Route Group: Protected routes (App Layout)
|
|
1240
|
+
│ │ ├── (marketing)/ # Route Group: Landing, pricing (Marketing Layout)
|
|
1241
|
+
│ │ └── api/ # Only used for Webhooks or Edge cases
|
|
1242
|
+
│ │ └── webhooks/stripe/
|
|
1243
|
+
│ ├── components/
|
|
1244
|
+
│ │ ├── emails/ # React Email templates
|
|
1245
|
+
│ │ ├── forms/ # Client components using useActionState (React 19)
|
|
1246
|
+
│ │ └── ui/ # Shadcn UI
|
|
1247
|
+
│ ├── lib/
|
|
1248
|
+
│ │ ├── auth.ts # Auth.js v6 config
|
|
1249
|
+
│ │ ├── db.ts # Prisma Singleton
|
|
1250
|
+
│ │ └── stripe.ts # Stripe Singleton
|
|
1251
|
+
│ └── styles/
|
|
1252
|
+
│ └── globals.css # Tailwind v4 imports (CSS only)
|
|
1253
|
+
└── package.json
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
---
|
|
1257
|
+
|
|
1258
|
+
## SaaS Features
|
|
1259
|
+
|
|
1260
|
+
| Feature | Implementation |
|
|
1261
|
+
|---------|---------------|
|
|
1262
|
+
| Auth | Auth.js v6 + Passkeys + OAuth |
|
|
1263
|
+
| Data Mutation | Server Actions (No API routes) |
|
|
1264
|
+
| Subscriptions | Stripe Checkout & Customer Portal |
|
|
1265
|
+
| Webhooks | Asynchronous Stripe event handling |
|
|
1266
|
+
| Email | Transactional via Resend |
|
|
1267
|
+
| Validation | Zod (Server-side validation) |
|
|
1268
|
+
|
|
1269
|
+
---
|
|
1270
|
+
|
|
1271
|
+
## Database Schema
|
|
1272
|
+
|
|
1273
|
+
| Model | Fields (Key fields) |
|
|
1274
|
+
|-------|---------------------|
|
|
1275
|
+
| User | id, email, stripeCustomerId, subscriptionId, plan |
|
|
1276
|
+
| Account | OAuth provider data (Google, GitHub...) |
|
|
1277
|
+
| Session | User sessions (Database strategy) |
|
|
1278
|
+
|
|
1279
|
+
---
|
|
1280
|
+
|
|
1281
|
+
## Environment Variables
|
|
1282
|
+
|
|
1283
|
+
| Variable | Purpose |
|
|
1284
|
+
|----------|---------|
|
|
1285
|
+
| DATABASE_URL | Prisma connection string (Postgres) |
|
|
1286
|
+
| AUTH_SECRET | Replaces NEXTAUTH_SECRET (Auth.js v6) |
|
|
1287
|
+
| STRIPE_SECRET_KEY | Payments (Server-side) |
|
|
1288
|
+
| STRIPE_WEBHOOK_SECRET | Webhook verification |
|
|
1289
|
+
| RESEND_API_KEY | Email sending |
|
|
1290
|
+
| NEXT_PUBLIC_APP_URL | Application Canonical URL |
|
|
1291
|
+
|
|
1292
|
+
---
|
|
1293
|
+
|
|
1294
|
+
## Setup Steps
|
|
1295
|
+
|
|
1296
|
+
1. Initialize project (Node 24):
|
|
1297
|
+
```bash
|
|
1298
|
+
npx create-next-app@latest {{name}} --typescript --eslint
|
|
1299
|
+
```
|
|
1300
|
+
|
|
1301
|
+
2. Install core libraries:
|
|
1302
|
+
```bash
|
|
1303
|
+
npm install next-auth@beta stripe resend @prisma/client
|
|
1304
|
+
```
|
|
1305
|
+
|
|
1306
|
+
3. Install Tailwind v4 (Add to globals.css):
|
|
1307
|
+
```css
|
|
1308
|
+
@import "tailwindcss";
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
4. Configure environment (.env.local)
|
|
1312
|
+
|
|
1313
|
+
5. Sync Database:
|
|
1314
|
+
```bash
|
|
1315
|
+
npx prisma db push
|
|
1316
|
+
```
|
|
1317
|
+
|
|
1318
|
+
6. Run local Webhook:
|
|
1319
|
+
```bash
|
|
1320
|
+
npm run stripe:listen
|
|
1321
|
+
```
|
|
1322
|
+
|
|
1323
|
+
7. Run project:
|
|
1324
|
+
```bash
|
|
1325
|
+
npm run dev
|
|
1326
|
+
```
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
---
|
|
1331
|
+
# Content from TEMPLATE.md
|
|
1332
|
+
|
|
1333
|
+
---
|
|
1334
|
+
name: nextjs-static
|
|
1335
|
+
description: Modern template for Next.js 16, React 19 & Tailwind v4. Optimized for Landing pages and Portfolios.
|
|
1336
|
+
---
|
|
1337
|
+
|
|
1338
|
+
# Next.js Static Site Template (Modern Edition)
|
|
1339
|
+
|
|
1340
|
+
## Tech Stack
|
|
1341
|
+
|
|
1342
|
+
| Component | Technology | Notes |
|
|
1343
|
+
|-----------|------------|-------|
|
|
1344
|
+
| Framework | Next.js 16+ | App Router, Turbopack, Static Exports |
|
|
1345
|
+
| Core | React 19 | Server Components, New Hooks, Compiler |
|
|
1346
|
+
| Language | TypeScript | Strict Mode |
|
|
1347
|
+
| Styling | Tailwind CSS v4 | CSS-first configuration (No js config), Oxide Engine |
|
|
1348
|
+
| Animations | Framer Motion | Layout animations & gestures |
|
|
1349
|
+
| Icons | Lucide React | Lightweight SVG icons |
|
|
1350
|
+
| SEO | Metadata API | Native Next.js API (Replaces next-seo) |
|
|
1351
|
+
|
|
1352
|
+
---
|
|
1353
|
+
|
|
1354
|
+
## Directory Structure
|
|
1355
|
+
|
|
1356
|
+
Streamlined structure thanks to Tailwind v4 (theme configuration lives inside CSS).
|
|
1357
|
+
|
|
1358
|
+
```
|
|
1359
|
+
project-name/
|
|
1360
|
+
├── src/
|
|
1361
|
+
│ ├── app/
|
|
1362
|
+
│ │ ├── layout.tsx # Contains root SEO Metadata
|
|
1363
|
+
│ │ ├── page.tsx # Landing Page
|
|
1364
|
+
│ │ ├── globals.css # Import Tailwind v4 & @theme config
|
|
1365
|
+
│ │ ├── not-found.tsx # Custom 404 page
|
|
1366
|
+
│ │ └── (routes)/ # Route groups (about, contact...)
|
|
1367
|
+
│ ├── components/
|
|
1368
|
+
│ │ ├── layout/ # Header, Footer
|
|
1369
|
+
│ │ ├── sections/ # Hero, Features, Pricing, CTA
|
|
1370
|
+
│ │ └── ui/ # Atomic components (Button, Card)
|
|
1371
|
+
│ └── lib/
|
|
1372
|
+
│ └── utils.ts # Helper functions (cn, formatters)
|
|
1373
|
+
├── content/ # Markdown/MDX content
|
|
1374
|
+
├── public/ # Static assets (images, fonts)
|
|
1375
|
+
├── next.config.ts # Next.js Config (TypeScript)
|
|
1376
|
+
└── package.json
|
|
1377
|
+
```
|
|
1378
|
+
|
|
1379
|
+
---
|
|
1380
|
+
|
|
1381
|
+
## Static Export Config
|
|
1382
|
+
|
|
1383
|
+
Using `next.config.ts` instead of `.js` for better type safety.
|
|
1384
|
+
|
|
1385
|
+
```typescript
|
|
1386
|
+
// next.config.ts
|
|
1387
|
+
import type { NextConfig } from "next";
|
|
1388
|
+
|
|
1389
|
+
const nextConfig: NextConfig = {
|
|
1390
|
+
output: 'export', // Required for Static Hosting (S3, GitHub Pages)
|
|
1391
|
+
images: {
|
|
1392
|
+
unoptimized: true // Required if not using Node.js server image optimization
|
|
1393
|
+
},
|
|
1394
|
+
trailingSlash: true, // Recommended for SEO and fixing 404s on some hosts
|
|
1395
|
+
reactStrictMode: true,
|
|
1396
|
+
};
|
|
1397
|
+
|
|
1398
|
+
export default nextConfig;
|
|
1399
|
+
```
|
|
1400
|
+
|
|
1401
|
+
---
|
|
1402
|
+
|
|
1403
|
+
## SEO Implementation (Metadata API)
|
|
1404
|
+
|
|
1405
|
+
Deprecated next-seo. Configure directly in layout.tsx or page.tsx.
|
|
1406
|
+
|
|
1407
|
+
```typescript
|
|
1408
|
+
// src/app/layout.tsx
|
|
1409
|
+
import type { Metadata } from 'next';
|
|
1410
|
+
|
|
1411
|
+
export const metadata: Metadata = {
|
|
1412
|
+
title: {
|
|
1413
|
+
template: '%s | Product Name',
|
|
1414
|
+
default: 'Home - Product Name',
|
|
1415
|
+
},
|
|
1416
|
+
description: 'SEO optimized description for the landing page.',
|
|
1417
|
+
openGraph: {
|
|
1418
|
+
type: 'website',
|
|
1419
|
+
locale: 'en_US',
|
|
1420
|
+
url: 'https://mysite.com',
|
|
1421
|
+
siteName: 'My Brand',
|
|
1422
|
+
},
|
|
1423
|
+
};
|
|
1424
|
+
```
|
|
1425
|
+
|
|
1426
|
+
---
|
|
1427
|
+
|
|
1428
|
+
## Landing Page Sections
|
|
1429
|
+
|
|
1430
|
+
| Section | Purpose | Suggested Component |
|
|
1431
|
+
|---------|---------|---------------------|
|
|
1432
|
+
| Hero | First impression, H1 & Main CTA | `<HeroSection />` |
|
|
1433
|
+
| Features | Product benefits (Grid/Bento layout) | `<FeaturesGrid />` |
|
|
1434
|
+
| Social Proof | Partner logos, User numbers | `<LogoCloud />` |
|
|
1435
|
+
| Testimonials | Customer reviews | `<TestimonialCarousel />` |
|
|
1436
|
+
| Pricing | Service plans | `<PricingCards />` |
|
|
1437
|
+
| FAQ | Questions & Answers (Good for SEO) | `<Accordion />` |
|
|
1438
|
+
| CTA | Final conversion | `<CallToAction />` |
|
|
1439
|
+
|
|
1440
|
+
---
|
|
1441
|
+
|
|
1442
|
+
## Animation Patterns (Framer Motion)
|
|
1443
|
+
|
|
1444
|
+
| Pattern | Usage | Implementation |
|
|
1445
|
+
|---------|-------|----------------|
|
|
1446
|
+
| Fade Up | Headlines, paragraphs | `initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }}` |
|
|
1447
|
+
| Stagger | Lists of Features/Cards | Use variants with `staggerChildren` |
|
|
1448
|
+
| Parallax | Background images or floating elements | `useScroll` & `useTransform` |
|
|
1449
|
+
| Micro-interactions | Hover buttons, click effects | `whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }}` |
|
|
1450
|
+
|
|
1451
|
+
---
|
|
1452
|
+
|
|
1453
|
+
## Setup Steps
|
|
1454
|
+
|
|
1455
|
+
1. Initialize Project:
|
|
1456
|
+
```bash
|
|
1457
|
+
npx create-next-app@latest my-site --typescript --tailwind --eslint
|
|
1458
|
+
# Select 'Yes' for App Router
|
|
1459
|
+
# Select 'No' for 'Would you like to customize the default import alias?'
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
2. Install Auxiliary Libraries:
|
|
1463
|
+
```bash
|
|
1464
|
+
npm install framer-motion lucide-react clsx tailwind-merge
|
|
1465
|
+
# clsx and tailwind-merge help handle dynamic classes better
|
|
1466
|
+
```
|
|
1467
|
+
|
|
1468
|
+
3. Configure Tailwind v4 (in `src/app/globals.css`):
|
|
1469
|
+
```css
|
|
1470
|
+
@import "tailwindcss";
|
|
1471
|
+
|
|
1472
|
+
@theme {
|
|
1473
|
+
--color-primary: #3b82f6;
|
|
1474
|
+
--font-sans: 'Inter', sans-serif;
|
|
1475
|
+
}
|
|
1476
|
+
```
|
|
1477
|
+
|
|
1478
|
+
4. Development:
|
|
1479
|
+
```bash
|
|
1480
|
+
npm run dev --turbopack
|
|
1481
|
+
```
|
|
1482
|
+
|
|
1483
|
+
---
|
|
1484
|
+
|
|
1485
|
+
## Deployment
|
|
1486
|
+
|
|
1487
|
+
| Platform | Method | Important Notes |
|
|
1488
|
+
|----------|--------|-----------------|
|
|
1489
|
+
| Vercel | Git Push | Auto-detects Next.js. Best for performance. |
|
|
1490
|
+
| GitHub Pages | GitHub Actions | Need to set `basePath` in `next.config.ts` if not using a custom domain. |
|
|
1491
|
+
| AWS S3 / CloudFront | Upload out folder | Ensure Error Document is configured to `404.html`. |
|
|
1492
|
+
| Netlify | Git Push | Set build command to `npm run build`. |
|
|
1493
|
+
|
|
1494
|
+
---
|
|
1495
|
+
|
|
1496
|
+
## Best Practices (Modern)
|
|
1497
|
+
|
|
1498
|
+
- **React Server Components (RSC)**: Default all components to Server Components. Only add `'use client'` when you need state (`useState`) or event listeners (`onClick`).
|
|
1499
|
+
- **Image Optimization**: Use the `<Image />` component but remember `unoptimized: true` for static export or use an external image CDN (Cloudinary/Imgix).
|
|
1500
|
+
- **Font Optimization**: Use `next/font` (Google Fonts) to automatically host fonts and prevent layout shift.
|
|
1501
|
+
- **Responsive**: Mobile-first design using Tailwind prefixes like `sm:`, `md:`, `lg:`.
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
|
|
1505
|
+
---
|
|
1506
|
+
# Content from TEMPLATE.md
|
|
1507
|
+
|
|
1508
|
+
---
|
|
1509
|
+
name: nuxt-app
|
|
1510
|
+
description: Nuxt 4 full-stack template. Vue 3 (Vapor), Pinia, Tailwind v4, Prisma.
|
|
1511
|
+
---
|
|
1512
|
+
|
|
1513
|
+
# Nuxt 4 Full-Stack Template (2026 Edition)
|
|
1514
|
+
|
|
1515
|
+
Mẫu template Full-Stack hiện đại cho Nuxt 4, tối ưu hóa hiệu suất với Vue Vapor Mode và Tailwind v4.
|
|
1516
|
+
|
|
1517
|
+
## Tech Stack
|
|
1518
|
+
|
|
1519
|
+
| Component | Technology | Version / Notes |
|
|
1520
|
+
|-----------|------------|-----------------|
|
|
1521
|
+
| Framework | Nuxt | v4.0+ (App Directory structure) |
|
|
1522
|
+
| UI Engine | Vue | v3.6+ (Vapor Mode enabled) |
|
|
1523
|
+
| Language | TypeScript | v5+ (Strict Mode) |
|
|
1524
|
+
| State | Pinia | v3+ (Store syntax) |
|
|
1525
|
+
| Database | PostgreSQL | Prisma ORM |
|
|
1526
|
+
| Styling | Tailwind CSS | v4.0 (Vite Plugin, Zero-config) |
|
|
1527
|
+
| UI Lib | Nuxt UI | v3 (Tailwind v4 native) |
|
|
1528
|
+
| Validation | Zod | Schema validation |
|
|
1529
|
+
|
|
1530
|
+
---
|
|
1531
|
+
|
|
1532
|
+
## Directory Structure (Nuxt 4 Standard)
|
|
1533
|
+
|
|
1534
|
+
Sử dụng cấu trúc `app/` để giữ thư mục gốc gọn gàng.
|
|
1535
|
+
|
|
1536
|
+
```
|
|
1537
|
+
project-name/
|
|
1538
|
+
├── app/ # Application Source
|
|
1539
|
+
│ ├── assets/
|
|
1540
|
+
│ │ └── css/
|
|
1541
|
+
│ │ └── main.css # Tailwind v4 imports
|
|
1542
|
+
│ ├── components/ # Auto-imported components
|
|
1543
|
+
│ ├── composables/ # Auto-imported logic
|
|
1544
|
+
│ ├── layouts/
|
|
1545
|
+
│ ├── pages/ # File-based routing
|
|
1546
|
+
│ ├── app.vue # Root component
|
|
1547
|
+
│ └── router.options.ts
|
|
1548
|
+
├── server/ # Nitro Server Engine
|
|
1549
|
+
│ ├── api/ # API Routes (e.g. /api/users)
|
|
1550
|
+
│ ├── routes/ # Server Routes
|
|
1551
|
+
│ └── utils/ # Server-only helpers (Prisma)
|
|
1552
|
+
├── prisma/
|
|
1553
|
+
│ └── schema.prisma
|
|
1554
|
+
├── public/
|
|
1555
|
+
├── nuxt.config.ts # Main Config
|
|
1556
|
+
└── package.json
|
|
1557
|
+
```
|
|
1558
|
+
|
|
1559
|
+
---
|
|
1560
|
+
|
|
1561
|
+
## Key Concepts (2026)
|
|
1562
|
+
|
|
1563
|
+
| Concept | Description | Future Update |
|
|
1564
|
+
|---------|-------------|---------------|
|
|
1565
|
+
| **App Directory** | `app/` | Tách biệt mã nguồn ứng dụng và file cấu hình root. |
|
|
1566
|
+
| **Vapor Mode** | Opt-in performance | Render không cần Virtual DOM (như SolidJS). Bật trong `nuxt.config`. |
|
|
1567
|
+
| **Server Functions** | RPC-style calls | Gọi hàm server trực tiếp từ client (thay thế dần API routes thủ công). |
|
|
1568
|
+
| **Tailwind v4** | CSS-first | Cấu hình theme trực tiếp trong CSS, không cần `tailwind.config.js`. |
|
|
1569
|
+
| **Nuxt Islands** | Server Components | Render component cô lập trên server (`<NuxtIsland name="..." />`). |
|
|
1570
|
+
|
|
1571
|
+
---
|
|
1572
|
+
|
|
1573
|
+
## Environment Variables
|
|
1574
|
+
|
|
1575
|
+
| Variable | Purpose |
|
|
1576
|
+
|----------|---------|
|
|
1577
|
+
| DATABASE_URL | Prisma connection string (PostgreSQL) |
|
|
1578
|
+
| NUXT_PUBLIC_APP_URL | Canonical URL |
|
|
1579
|
+
| NUXT_SESSION_PASSWORD | Session encryption key |
|
|
1580
|
+
|
|
1581
|
+
---
|
|
1582
|
+
|
|
1583
|
+
## Setup Steps
|
|
1584
|
+
|
|
1585
|
+
1. Initialize Project:
|
|
1586
|
+
```bash
|
|
1587
|
+
npx nuxi@latest init my-app
|
|
1588
|
+
# Select "Nuxt 4 structure" if prompted
|
|
1589
|
+
```
|
|
1590
|
+
|
|
1591
|
+
2. Install Core Deps:
|
|
1592
|
+
```bash
|
|
1593
|
+
npm install @pinia/nuxt @prisma/client zod
|
|
1594
|
+
npm install -D prisma
|
|
1595
|
+
```
|
|
1596
|
+
|
|
1597
|
+
3. Setup Tailwind v4:
|
|
1598
|
+
Install the Vite plugin (new standard):
|
|
1599
|
+
```bash
|
|
1600
|
+
npm install tailwindcss @tailwindcss/vite
|
|
1601
|
+
```
|
|
1602
|
+
|
|
1603
|
+
Add to `nuxt.config.ts`:
|
|
1604
|
+
```ts
|
|
1605
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
1606
|
+
export default defineNuxtConfig({
|
|
1607
|
+
vite: {
|
|
1608
|
+
plugins: [tailwindcss()]
|
|
1609
|
+
},
|
|
1610
|
+
css: ['~/assets/css/main.css']
|
|
1611
|
+
})
|
|
1612
|
+
```
|
|
1613
|
+
|
|
1614
|
+
4. Configure CSS:
|
|
1615
|
+
In `app/assets/css/main.css`:
|
|
1616
|
+
```css
|
|
1617
|
+
@import "tailwindcss";
|
|
1618
|
+
@theme {
|
|
1619
|
+
--color-primary: oklch(0.6 0.15 150);
|
|
1620
|
+
}
|
|
1621
|
+
```
|
|
1622
|
+
|
|
1623
|
+
5. Run Development:
|
|
1624
|
+
```bash
|
|
1625
|
+
npm run dev
|
|
1626
|
+
# Runs with Turbo/Vite
|
|
1627
|
+
```
|
|
1628
|
+
|
|
1629
|
+
---
|
|
1630
|
+
|
|
1631
|
+
## Best Practices
|
|
1632
|
+
|
|
1633
|
+
- **Vapor Mode**: Kích hoạt cho các component nặng về render:
|
|
1634
|
+
```ts
|
|
1635
|
+
<script setup lang="ts" vapor>
|
|
1636
|
+
// Component này sẽ compile sang chế độ Vapor (No VDOM)
|
|
1637
|
+
</script>
|
|
1638
|
+
```
|
|
1639
|
+
- **Data Fetching**: Sử dụng `useFetch` với `server: false` cho các tác vụ client-only, hoặc dùng Server Functions để type-safety tốt hơn.
|
|
1640
|
+
- **State**: Dùng `defineStore` (Pinia) cho global state, `useState` của Nuxt cho state đơn giản chia sẻ giữa Server/Client.
|
|
1641
|
+
- **Type Safety**: Tự động tạo type cho API routes (`$fetch` typed automatically).
|
|
1642
|
+
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
---
|
|
1646
|
+
# Content from TEMPLATE.md
|
|
1647
|
+
|
|
1648
|
+
---
|
|
1649
|
+
name: python-fastapi
|
|
1650
|
+
description: FastAPI REST API template principles. SQLAlchemy, Pydantic, Alembic.
|
|
1651
|
+
---
|
|
1652
|
+
|
|
1653
|
+
# FastAPI API Template
|
|
1654
|
+
|
|
1655
|
+
## Tech Stack
|
|
1656
|
+
|
|
1657
|
+
| Component | Technology |
|
|
1658
|
+
|-----------|------------|
|
|
1659
|
+
| Framework | FastAPI |
|
|
1660
|
+
| Language | Python 3.11+ |
|
|
1661
|
+
| ORM | SQLAlchemy 2.0 |
|
|
1662
|
+
| Validation | Pydantic v2 |
|
|
1663
|
+
| Migrations | Alembic |
|
|
1664
|
+
| Auth | JWT + passlib |
|
|
1665
|
+
|
|
1666
|
+
---
|
|
1667
|
+
|
|
1668
|
+
## Directory Structure
|
|
1669
|
+
|
|
1670
|
+
```
|
|
1671
|
+
project-name/
|
|
1672
|
+
├── alembic/ # Migrations
|
|
1673
|
+
├── app/
|
|
1674
|
+
│ ├── main.py # FastAPI app
|
|
1675
|
+
│ ├── config.py # Settings
|
|
1676
|
+
│ ├── database.py # DB connection
|
|
1677
|
+
│ ├── models/ # SQLAlchemy models
|
|
1678
|
+
│ ├── schemas/ # Pydantic schemas
|
|
1679
|
+
│ ├── routers/ # API routes
|
|
1680
|
+
│ ├── services/ # Business logic
|
|
1681
|
+
│ ├── dependencies/ # DI
|
|
1682
|
+
│ └── utils/
|
|
1683
|
+
├── tests/
|
|
1684
|
+
├── .env.example
|
|
1685
|
+
└── requirements.txt
|
|
1686
|
+
```
|
|
1687
|
+
|
|
1688
|
+
---
|
|
1689
|
+
|
|
1690
|
+
## Key Concepts
|
|
1691
|
+
|
|
1692
|
+
| Concept | Description |
|
|
1693
|
+
|---------|-------------|
|
|
1694
|
+
| Async | async/await throughout |
|
|
1695
|
+
| Dependency Injection | FastAPI Depends |
|
|
1696
|
+
| Pydantic v2 | Validation + serialization |
|
|
1697
|
+
| SQLAlchemy 2.0 | Async sessions |
|
|
1698
|
+
|
|
1699
|
+
---
|
|
1700
|
+
|
|
1701
|
+
## API Structure
|
|
1702
|
+
|
|
1703
|
+
| Layer | Responsibility |
|
|
1704
|
+
|-------|---------------|
|
|
1705
|
+
| Routers | HTTP handling |
|
|
1706
|
+
| Dependencies | Auth, validation |
|
|
1707
|
+
| Services | Business logic |
|
|
1708
|
+
| Models | Database entities |
|
|
1709
|
+
| Schemas | Request/response |
|
|
1710
|
+
|
|
1711
|
+
---
|
|
1712
|
+
|
|
1713
|
+
## Setup Steps
|
|
1714
|
+
|
|
1715
|
+
1. `python -m venv venv`
|
|
1716
|
+
2. `source venv/bin/activate`
|
|
1717
|
+
3. `pip install fastapi uvicorn sqlalchemy alembic pydantic`
|
|
1718
|
+
4. Create `.env`
|
|
1719
|
+
5. `alembic upgrade head`
|
|
1720
|
+
6. `uvicorn app.main:app --reload`
|
|
1721
|
+
|
|
1722
|
+
---
|
|
1723
|
+
|
|
1724
|
+
## Best Practices
|
|
1725
|
+
|
|
1726
|
+
- Use async everywhere
|
|
1727
|
+
- Pydantic v2 for validation
|
|
1728
|
+
- SQLAlchemy 2.0 async sessions
|
|
1729
|
+
- Alembic for migrations
|
|
1730
|
+
- pytest-asyncio for tests
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
---
|
|
1735
|
+
# Content from TEMPLATE.md
|
|
1736
|
+
|
|
1737
|
+
---
|
|
1738
|
+
name: react-native-app
|
|
1739
|
+
description: React Native mobile app template principles. Expo, TypeScript, navigation.
|
|
1740
|
+
---
|
|
1741
|
+
|
|
1742
|
+
# React Native App Template (2026 Edition)
|
|
1743
|
+
|
|
1744
|
+
Modern mobile app template, optimized for New Architecture and React 19.
|
|
1745
|
+
|
|
1746
|
+
## Tech Stack
|
|
1747
|
+
|
|
1748
|
+
| Component | Technology | Version / Notes |
|
|
1749
|
+
|-----------|------------|-----------------|
|
|
1750
|
+
| Core | React Native + Expo | SDK 52+ (New Architecture Enabled) |
|
|
1751
|
+
| Language | TypeScript | v5+ (Strict Mode) |
|
|
1752
|
+
| UI Logic | React | v19 (React Compiler, auto-memoization) |
|
|
1753
|
+
| Navigation | Expo Router | v4+ (File-based, Universal Links) |
|
|
1754
|
+
| Styling | NativeWind | v4.0 (Tailwind v4, CSS-first config) |
|
|
1755
|
+
| State | Zustand + React Query | v5+ (Async State Management) |
|
|
1756
|
+
| Storage | Expo SecureStore | Encrypted local storage |
|
|
1757
|
+
|
|
1758
|
+
---
|
|
1759
|
+
|
|
1760
|
+
## Directory Structure
|
|
1761
|
+
|
|
1762
|
+
Standardized structure for Expo Router and NativeWind v4.
|
|
1763
|
+
|
|
1764
|
+
```
|
|
1765
|
+
project-name/
|
|
1766
|
+
├── app/ # Expo Router (File-based routing)
|
|
1767
|
+
│ ├── _layout.tsx # Root Layout (Stack/Tabs config)
|
|
1768
|
+
│ ├── index.tsx # Main Screen
|
|
1769
|
+
│ ├── (tabs)/ # Route Group for Tab Bar
|
|
1770
|
+
│ │ ├── _layout.tsx
|
|
1771
|
+
│ │ ├── home.tsx
|
|
1772
|
+
│ │ └── profile.tsx
|
|
1773
|
+
│ ├── +not-found.tsx # 404 Page
|
|
1774
|
+
│ └── [id].tsx # Dynamic Route (Typed)
|
|
1775
|
+
├── components/
|
|
1776
|
+
│ ├── ui/ # Primitive Components (Button, Text)
|
|
1777
|
+
│ └── features/ # Complex Components
|
|
1778
|
+
├── hooks/ # Custom Hooks
|
|
1779
|
+
├── lib/
|
|
1780
|
+
│ ├── api.ts # Axios/Fetch client
|
|
1781
|
+
│ └── storage.ts # SecureStore wrapper
|
|
1782
|
+
├── store/ # Zustand stores
|
|
1783
|
+
├── constants/ # Colors, Theme config
|
|
1784
|
+
├── assets/ # Fonts, Images
|
|
1785
|
+
├── global.css # Entry point for NativeWind v4
|
|
1786
|
+
├── tailwind.config.ts # Tailwind Config (if custom theme needed)
|
|
1787
|
+
├── babel.config.js # NativeWind Babel Plugin
|
|
1788
|
+
└── app.json # Expo Config
|
|
1789
|
+
```
|
|
1790
|
+
|
|
1791
|
+
---
|
|
1792
|
+
|
|
1793
|
+
## Navigation Patterns (Expo Router)
|
|
1794
|
+
|
|
1795
|
+
| Pattern | Description | Implement |
|
|
1796
|
+
|---------|-------------|-----------|
|
|
1797
|
+
| Stack | Hierarchical navigation (Push/Pop) | `<Stack />` in `_layout.tsx` |
|
|
1798
|
+
| Tabs | Bottom navigation bar | `<Tabs />` in `(tabs)/_layout.tsx` |
|
|
1799
|
+
| Drawer | Side slide-out menu | `expo-router/drawer` |
|
|
1800
|
+
| Modals | Overlay screens | `presentation: 'modal'` in Stack screen |
|
|
1801
|
+
|
|
1802
|
+
---
|
|
1803
|
+
|
|
1804
|
+
## Key Packages & Purpose
|
|
1805
|
+
|
|
1806
|
+
| Package | Purpose |
|
|
1807
|
+
|---------|---------|
|
|
1808
|
+
| expo-router | File-based routing (Next.js like) |
|
|
1809
|
+
| nativewind | Use Tailwind CSS classes in React Native |
|
|
1810
|
+
| react-native-reanimated | Smooth animations (runs on UI thread) |
|
|
1811
|
+
| @tanstack/react-query | Server state management, caching, pre-fetching |
|
|
1812
|
+
| zustand | Global state management (lighter than Redux) |
|
|
1813
|
+
| expo-image | Optimized image rendering for performance |
|
|
1814
|
+
|
|
1815
|
+
---
|
|
1816
|
+
|
|
1817
|
+
## Setup Steps (2026 Standard)
|
|
1818
|
+
|
|
1819
|
+
1. Initialize Project:
|
|
1820
|
+
```bash
|
|
1821
|
+
npx create-expo-app@latest my-app --template default
|
|
1822
|
+
cd my-app
|
|
1823
|
+
```
|
|
1824
|
+
|
|
1825
|
+
2. Install Core Dependencies:
|
|
1826
|
+
```bash
|
|
1827
|
+
npx expo install expo-router react-native-safe-area-context react-native-screens expo-link expo-constants expo-status-bar
|
|
1828
|
+
```
|
|
1829
|
+
|
|
1830
|
+
3. Install NativeWind v4:
|
|
1831
|
+
```bash
|
|
1832
|
+
npm install nativewind tailwindcss react-native-reanimated
|
|
1833
|
+
```
|
|
1834
|
+
|
|
1835
|
+
4. Configure NativeWind (Babel & CSS):
|
|
1836
|
+
- Add plugin to `babel.config.js`: `plugins: ["nativewind/babel"]`.
|
|
1837
|
+
- Create `global.css` with: `@import "tailwindcss";`.
|
|
1838
|
+
- Import `global.css` in `app/_layout.tsx`.
|
|
1839
|
+
|
|
1840
|
+
5. Run Project:
|
|
1841
|
+
```bash
|
|
1842
|
+
npx expo start -c
|
|
1843
|
+
# Press 'i' for iOS simulator or 'a' for Android emulator
|
|
1844
|
+
```
|
|
1845
|
+
|
|
1846
|
+
---
|
|
1847
|
+
|
|
1848
|
+
## Best Practices (Updated)
|
|
1849
|
+
|
|
1850
|
+
- **New Architecture**: Ensure `newArchEnabled: true` in `app.json` to leverage TurboModules and Fabric Renderer.
|
|
1851
|
+
- **Typed Routes**: Use Expo Router's "Typed Routes" feature for type-safe routing (e.g., `router.push('/path')`).
|
|
1852
|
+
- **React 19**: Reduce usage of `useMemo` or `useCallback` thanks to React Compiler (if enabled).
|
|
1853
|
+
- **Components**: Build UI primitives (Box, Text) with NativeWind className for reusability.
|
|
1854
|
+
- **Assets**: Use `expo-image` instead of default `<Image />` for better caching and performance.
|
|
1855
|
+
- **API**: Always wrap API calls with TanStack Query, avoid direct calls in `useEffect`.
|