@infandev/agent-kit 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/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
- package/.agent/ARCHITECTURE.md +289 -0
- package/.agent/agents/backend-specialist.md +263 -0
- package/.agent/agents/code-archaeologist.md +106 -0
- package/.agent/agents/database-architect.md +226 -0
- package/.agent/agents/debugger.md +225 -0
- package/.agent/agents/devops-engineer.md +242 -0
- package/.agent/agents/documentation-writer.md +104 -0
- package/.agent/agents/explorer-agent.md +73 -0
- package/.agent/agents/frontend-specialist.md +593 -0
- package/.agent/agents/game-developer.md +162 -0
- package/.agent/agents/mobile-developer.md +377 -0
- package/.agent/agents/orchestrator.md +440 -0
- package/.agent/agents/penetration-tester.md +188 -0
- package/.agent/agents/performance-optimizer.md +187 -0
- package/.agent/agents/product-manager.md +112 -0
- package/.agent/agents/product-owner.md +95 -0
- package/.agent/agents/project-planner.md +419 -0
- package/.agent/agents/qa-automation-engineer.md +103 -0
- package/.agent/agents/security-auditor.md +170 -0
- package/.agent/agents/seo-specialist.md +111 -0
- package/.agent/agents/test-engineer.md +158 -0
- package/.agent/mcp_config.json +24 -0
- package/.agent/rules/GEMINI.md +284 -0
- package/.agent/scripts/auto_preview.py +148 -0
- package/.agent/scripts/checklist.py +217 -0
- package/.agent/scripts/session_manager.py +120 -0
- package/.agent/scripts/verify_all.py +327 -0
- package/.agent/skills/agent-ops/SKILL.md +72 -0
- package/.agent/skills/agent-ops/scripts/export_ide_rules.py +131 -0
- package/.agent/skills/agent-ops/scripts/registry.py +125 -0
- package/.agent/skills/api-patterns/SKILL.md +81 -0
- package/.agent/skills/api-patterns/api-style.md +42 -0
- package/.agent/skills/api-patterns/auth.md +24 -0
- package/.agent/skills/api-patterns/documentation.md +26 -0
- package/.agent/skills/api-patterns/graphql.md +41 -0
- package/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/.agent/skills/api-patterns/response.md +37 -0
- package/.agent/skills/api-patterns/rest.md +40 -0
- package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.agent/skills/api-patterns/security-testing.md +122 -0
- package/.agent/skills/api-patterns/trpc.md +41 -0
- package/.agent/skills/api-patterns/versioning.md +22 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +41 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/architecture/SKILL.md +55 -0
- package/.agent/skills/architecture/context-discovery.md +43 -0
- package/.agent/skills/architecture/examples.md +94 -0
- package/.agent/skills/architecture/pattern-selection.md +68 -0
- package/.agent/skills/architecture/patterns-reference.md +50 -0
- package/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/.agent/skills/bash-linux/SKILL.md +199 -0
- package/.agent/skills/behavioral-modes/SKILL.md +242 -0
- package/.agent/skills/brainstorming/SKILL.md +163 -0
- package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
- package/.agent/skills/clean-code/SKILL.md +201 -0
- package/.agent/skills/code-review-checklist/SKILL.md +109 -0
- package/.agent/skills/database-design/SKILL.md +52 -0
- package/.agent/skills/database-design/database-selection.md +43 -0
- package/.agent/skills/database-design/indexing.md +39 -0
- package/.agent/skills/database-design/migrations.md +48 -0
- package/.agent/skills/database-design/optimization.md +36 -0
- package/.agent/skills/database-design/orm-selection.md +30 -0
- package/.agent/skills/database-design/schema-design.md +56 -0
- package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/.agent/skills/frontend-design/SKILL.md +452 -0
- package/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/.agent/skills/frontend-design/color-system.md +311 -0
- package/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/.agent/skills/frontend-design/typography-system.md +345 -0
- package/.agent/skills/frontend-design/ux-psychology.md +1116 -0
- package/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
- package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.agent/skills/intelligent-routing/SKILL.md +335 -0
- package/.agent/skills/lint-and-validate/SKILL.md +45 -0
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/.agent/skills/mobile-design/SKILL.md +394 -0
- package/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/.agent/skills/mobile-design/mobile-typography.md +433 -0
- package/.agent/skills/mobile-design/platform-android.md +666 -0
- package/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
- package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/.agent/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +293 -0
- package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/.agent/skills/parallel-agents/SKILL.md +175 -0
- package/.agent/skills/performance-profiling/SKILL.md +143 -0
- package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/.agent/skills/plan-writing/SKILL.md +152 -0
- package/.agent/skills/powershell-windows/SKILL.md +167 -0
- package/.agent/skills/python-patterns/SKILL.md +441 -0
- package/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/.agent/skills/rust-pro/SKILL.md +176 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
- package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/.agent/skills/server-management/SKILL.md +161 -0
- package/.agent/skills/systematic-debugging/SKILL.md +109 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
- package/.agent/skills/tdd-workflow/SKILL.md +149 -0
- package/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
- package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
- package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
- package/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/orchestrate.md +237 -0
- package/.agent/workflows/plan.md +89 -0
- package/.agent/workflows/preview.md +81 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +296 -0
- package/.cursor/rules/backend-specialist.mdc +266 -0
- package/.cursor/rules/code-archaeologist.mdc +109 -0
- package/.cursor/rules/database-architect.mdc +229 -0
- package/.cursor/rules/debugger.mdc +230 -0
- package/.cursor/rules/devops-engineer.mdc +245 -0
- package/.cursor/rules/documentation-writer.mdc +107 -0
- package/.cursor/rules/explorer-agent.mdc +76 -0
- package/.cursor/rules/frontend-specialist.mdc +596 -0
- package/.cursor/rules/game-developer.mdc +165 -0
- package/.cursor/rules/mobile-developer.mdc +380 -0
- package/.cursor/rules/orchestrator.mdc +443 -0
- package/.cursor/rules/penetration-tester.mdc +191 -0
- package/.cursor/rules/performance-optimizer.mdc +190 -0
- package/.cursor/rules/product-manager.mdc +115 -0
- package/.cursor/rules/product-owner.mdc +98 -0
- package/.cursor/rules/project-planner.mdc +422 -0
- package/.cursor/rules/qa-automation-engineer.mdc +106 -0
- package/.cursor/rules/security-auditor.mdc +173 -0
- package/.cursor/rules/seo-specialist.mdc +114 -0
- package/.cursor/rules/test-engineer.mdc +161 -0
- package/.windsurfrules +3 -0
- package/AGENTS.md +4301 -0
- package/README.md +83 -0
- package/bin/cli.js +100 -0
- package/package.json +35 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
UI/UX Pro Max Search - BM25 search engine for UI/UX style guides
|
|
5
|
+
Usage: python search.py "<query>" [--domain <domain>] [--stack <stack>] [--max-results 3]
|
|
6
|
+
python search.py "<query>" --design-system [-p "Project Name"]
|
|
7
|
+
python search.py "<query>" --design-system --persist [-p "Project Name"] [--page "dashboard"]
|
|
8
|
+
|
|
9
|
+
Domains: style, prompt, color, chart, landing, product, ux, typography
|
|
10
|
+
Stacks: html-tailwind, react, nextjs
|
|
11
|
+
|
|
12
|
+
Persistence (Master + Overrides pattern):
|
|
13
|
+
--persist Save design system to design-system/MASTER.md
|
|
14
|
+
--page Also create a page-specific override file in design-system/pages/
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, search, search_stack
|
|
19
|
+
from design_system import generate_design_system, persist_design_system
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def format_output(result):
|
|
23
|
+
"""Format results for Claude consumption (token-optimized)"""
|
|
24
|
+
if "error" in result:
|
|
25
|
+
return f"Error: {result['error']}"
|
|
26
|
+
|
|
27
|
+
output = []
|
|
28
|
+
if result.get("stack"):
|
|
29
|
+
output.append(f"## UI Pro Max Stack Guidelines")
|
|
30
|
+
output.append(f"**Stack:** {result['stack']} | **Query:** {result['query']}")
|
|
31
|
+
else:
|
|
32
|
+
output.append(f"## UI Pro Max Search Results")
|
|
33
|
+
output.append(f"**Domain:** {result['domain']} | **Query:** {result['query']}")
|
|
34
|
+
output.append(f"**Source:** {result['file']} | **Found:** {result['count']} results\n")
|
|
35
|
+
|
|
36
|
+
for i, row in enumerate(result['results'], 1):
|
|
37
|
+
output.append(f"### Result {i}")
|
|
38
|
+
for key, value in row.items():
|
|
39
|
+
value_str = str(value)
|
|
40
|
+
if len(value_str) > 300:
|
|
41
|
+
value_str = value_str[:300] + "..."
|
|
42
|
+
output.append(f"- **{key}:** {value_str}")
|
|
43
|
+
output.append("")
|
|
44
|
+
|
|
45
|
+
return "\n".join(output)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
if __name__ == "__main__":
|
|
49
|
+
parser = argparse.ArgumentParser(description="UI Pro Max Search")
|
|
50
|
+
parser.add_argument("query", help="Search query")
|
|
51
|
+
parser.add_argument("--domain", "-d", choices=list(CSV_CONFIG.keys()), help="Search domain")
|
|
52
|
+
parser.add_argument("--stack", "-s", choices=AVAILABLE_STACKS, help="Stack-specific search (html-tailwind, react, nextjs)")
|
|
53
|
+
parser.add_argument("--max-results", "-n", type=int, default=MAX_RESULTS, help="Max results (default: 3)")
|
|
54
|
+
parser.add_argument("--json", action="store_true", help="Output as JSON")
|
|
55
|
+
# Design system generation
|
|
56
|
+
parser.add_argument("--design-system", "-ds", action="store_true", help="Generate complete design system recommendation")
|
|
57
|
+
parser.add_argument("--project-name", "-p", type=str, default=None, help="Project name for design system output")
|
|
58
|
+
parser.add_argument("--format", "-f", choices=["ascii", "markdown"], default="ascii", help="Output format for design system")
|
|
59
|
+
# Persistence (Master + Overrides pattern)
|
|
60
|
+
parser.add_argument("--persist", action="store_true", help="Save design system to design-system/MASTER.md (creates hierarchical structure)")
|
|
61
|
+
parser.add_argument("--page", type=str, default=None, help="Create page-specific override file in design-system/pages/")
|
|
62
|
+
parser.add_argument("--output-dir", "-o", type=str, default=None, help="Output directory for persisted files (default: current directory)")
|
|
63
|
+
|
|
64
|
+
args = parser.parse_args()
|
|
65
|
+
|
|
66
|
+
# Design system takes priority
|
|
67
|
+
if args.design_system:
|
|
68
|
+
result = generate_design_system(
|
|
69
|
+
args.query,
|
|
70
|
+
args.project_name,
|
|
71
|
+
args.format,
|
|
72
|
+
persist=args.persist,
|
|
73
|
+
page=args.page,
|
|
74
|
+
output_dir=args.output_dir
|
|
75
|
+
)
|
|
76
|
+
print(result)
|
|
77
|
+
|
|
78
|
+
# Print persistence confirmation
|
|
79
|
+
if args.persist:
|
|
80
|
+
project_slug = args.project_name.lower().replace(' ', '-') if args.project_name else "default"
|
|
81
|
+
print("\n" + "=" * 60)
|
|
82
|
+
print(f"✅ Design system persisted to design-system/{project_slug}/")
|
|
83
|
+
print(f" 📄 design-system/{project_slug}/MASTER.md (Global Source of Truth)")
|
|
84
|
+
if args.page:
|
|
85
|
+
page_filename = args.page.lower().replace(' ', '-')
|
|
86
|
+
print(f" 📄 design-system/{project_slug}/pages/{page_filename}.md (Page Overrides)")
|
|
87
|
+
print("")
|
|
88
|
+
print(f"📖 Usage: When building a page, check design-system/{project_slug}/pages/[page].md first.")
|
|
89
|
+
print(f" If exists, its rules override MASTER.md. Otherwise, use MASTER.md.")
|
|
90
|
+
print("=" * 60)
|
|
91
|
+
# Stack search
|
|
92
|
+
elif args.stack:
|
|
93
|
+
result = search_stack(args.query, args.stack, args.max_results)
|
|
94
|
+
if args.json:
|
|
95
|
+
import json
|
|
96
|
+
print(json.dumps(result, indent=2, ensure_ascii=False))
|
|
97
|
+
else:
|
|
98
|
+
print(format_output(result))
|
|
99
|
+
# Domain search
|
|
100
|
+
else:
|
|
101
|
+
result = search(args.query, args.domain, args.max_results)
|
|
102
|
+
if args.json:
|
|
103
|
+
import json
|
|
104
|
+
print(json.dumps(result, indent=2, ensure_ascii=False))
|
|
105
|
+
else:
|
|
106
|
+
print(format_output(result))
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# Antigravity Kit Architecture
|
|
2
|
+
|
|
3
|
+
> Comprehensive AI Agent Capability Expansion Toolkit
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📋 Overview
|
|
8
|
+
|
|
9
|
+
Antigravity Kit is a modular system consisting of:
|
|
10
|
+
|
|
11
|
+
- **20 Specialist Agents** - Role-based AI personas
|
|
12
|
+
- **36 Skills** - Domain-specific knowledge modules
|
|
13
|
+
- **11 Workflows** - Slash command procedures
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🏗️ Directory Structure
|
|
18
|
+
|
|
19
|
+
```plaintext
|
|
20
|
+
.agent/
|
|
21
|
+
├── ARCHITECTURE.md # This file
|
|
22
|
+
├── agents/ # 20 Specialist Agents
|
|
23
|
+
├── skills/ # 36 Skills
|
|
24
|
+
├── workflows/ # 11 Slash Commands
|
|
25
|
+
├── rules/ # Global Rules
|
|
26
|
+
└── scripts/ # Master Validation Scripts
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🤖 Agents (20)
|
|
32
|
+
|
|
33
|
+
Specialist AI personas for different domains.
|
|
34
|
+
|
|
35
|
+
| Agent | Focus | Skills Used |
|
|
36
|
+
| ------------------------ | -------------------------- | -------------------------------------------------------- |
|
|
37
|
+
| `orchestrator` | Multi-agent coordination | parallel-agents, behavioral-modes |
|
|
38
|
+
| `project-planner` | Discovery, task planning | brainstorming, plan-writing, architecture |
|
|
39
|
+
| `frontend-specialist` | Web UI/UX | frontend-design, react-best-practices, tailwind-patterns |
|
|
40
|
+
| `backend-specialist` | API, business logic | api-patterns, nodejs-best-practices, database-design |
|
|
41
|
+
| `database-architect` | Schema, SQL | database-design, prisma-expert |
|
|
42
|
+
| `mobile-developer` | iOS, Android, RN | mobile-design |
|
|
43
|
+
| `game-developer` | Game logic, mechanics | game-development |
|
|
44
|
+
| `devops-engineer` | CI/CD, Docker | deployment-procedures, docker-expert |
|
|
45
|
+
| `security-auditor` | Security compliance | vulnerability-scanner, red-team-tactics |
|
|
46
|
+
| `penetration-tester` | Offensive security | red-team-tactics |
|
|
47
|
+
| `test-engineer` | Testing strategies | testing-patterns, tdd-workflow, webapp-testing |
|
|
48
|
+
| `debugger` | Root cause analysis | systematic-debugging |
|
|
49
|
+
| `performance-optimizer` | Speed, Web Vitals | performance-profiling |
|
|
50
|
+
| `seo-specialist` | Ranking, visibility | seo-fundamentals, geo-fundamentals |
|
|
51
|
+
| `documentation-writer` | Manuals, docs | documentation-templates |
|
|
52
|
+
| `product-manager` | Requirements, user stories | plan-writing, brainstorming |
|
|
53
|
+
| `product-owner` | Strategy, backlog, MVP | plan-writing, brainstorming |
|
|
54
|
+
| `qa-automation-engineer` | E2E testing, CI pipelines | webapp-testing, testing-patterns |
|
|
55
|
+
| `code-archaeologist` | Legacy code, refactoring | clean-code, code-review-checklist |
|
|
56
|
+
| `explorer-agent` | Codebase analysis | - |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🧩 Skills (36)
|
|
61
|
+
|
|
62
|
+
Modular knowledge domains that agents can load on-demand. based on task context.
|
|
63
|
+
|
|
64
|
+
### Frontend & UI
|
|
65
|
+
|
|
66
|
+
| Skill | Description |
|
|
67
|
+
| ----------------------- | --------------------------------------------------------------------- |
|
|
68
|
+
| `react-best-practices` | React & Next.js performance optimization (Vercel - 57 rules) |
|
|
69
|
+
| `web-design-guidelines` | Web UI audit - 100+ rules for accessibility, UX, performance (Vercel) |
|
|
70
|
+
| `tailwind-patterns` | Tailwind CSS v4 utilities |
|
|
71
|
+
| `frontend-design` | UI/UX patterns, design systems |
|
|
72
|
+
| `ui-ux-pro-max` | 50 styles, 21 palettes, 50 fonts |
|
|
73
|
+
|
|
74
|
+
### Backend & API
|
|
75
|
+
|
|
76
|
+
| Skill | Description |
|
|
77
|
+
| ----------------------- | ------------------------------ |
|
|
78
|
+
| `api-patterns` | REST, GraphQL, tRPC |
|
|
79
|
+
| `nestjs-expert` | NestJS modules, DI, decorators |
|
|
80
|
+
| `nodejs-best-practices` | Node.js async, modules |
|
|
81
|
+
| `python-patterns` | Python standards, FastAPI |
|
|
82
|
+
|
|
83
|
+
### Database
|
|
84
|
+
|
|
85
|
+
| Skill | Description |
|
|
86
|
+
| ----------------- | --------------------------- |
|
|
87
|
+
| `database-design` | Schema design, optimization |
|
|
88
|
+
| `prisma-expert` | Prisma ORM, migrations |
|
|
89
|
+
|
|
90
|
+
### TypeScript/JavaScript
|
|
91
|
+
|
|
92
|
+
| Skill | Description |
|
|
93
|
+
| ------------------- | ----------------------------------- |
|
|
94
|
+
| `typescript-expert` | Type-level programming, performance |
|
|
95
|
+
|
|
96
|
+
### Cloud & Infrastructure
|
|
97
|
+
|
|
98
|
+
| Skill | Description |
|
|
99
|
+
| ----------------------- | ------------------------- |
|
|
100
|
+
| `docker-expert` | Containerization, Compose |
|
|
101
|
+
| `deployment-procedures` | CI/CD, deploy workflows |
|
|
102
|
+
| `server-management` | Infrastructure management |
|
|
103
|
+
|
|
104
|
+
### Testing & Quality
|
|
105
|
+
|
|
106
|
+
| Skill | Description |
|
|
107
|
+
| ----------------------- | ------------------------ |
|
|
108
|
+
| `testing-patterns` | Jest, Vitest, strategies |
|
|
109
|
+
| `webapp-testing` | E2E, Playwright |
|
|
110
|
+
| `tdd-workflow` | Test-driven development |
|
|
111
|
+
| `code-review-checklist` | Code review standards |
|
|
112
|
+
| `lint-and-validate` | Linting, validation |
|
|
113
|
+
|
|
114
|
+
### Security
|
|
115
|
+
|
|
116
|
+
| Skill | Description |
|
|
117
|
+
| ----------------------- | ------------------------ |
|
|
118
|
+
| `vulnerability-scanner` | Security auditing, OWASP |
|
|
119
|
+
| `red-team-tactics` | Offensive security |
|
|
120
|
+
|
|
121
|
+
### Architecture & Planning
|
|
122
|
+
|
|
123
|
+
| Skill | Description |
|
|
124
|
+
| --------------- | -------------------------- |
|
|
125
|
+
| `app-builder` | Full-stack app scaffolding |
|
|
126
|
+
| `architecture` | System design patterns |
|
|
127
|
+
| `plan-writing` | Task planning, breakdown |
|
|
128
|
+
| `brainstorming` | Socratic questioning |
|
|
129
|
+
|
|
130
|
+
### Mobile
|
|
131
|
+
|
|
132
|
+
| Skill | Description |
|
|
133
|
+
| --------------- | --------------------- |
|
|
134
|
+
| `mobile-design` | Mobile UI/UX patterns |
|
|
135
|
+
|
|
136
|
+
### Game Development
|
|
137
|
+
|
|
138
|
+
| Skill | Description |
|
|
139
|
+
| ------------------ | --------------------- |
|
|
140
|
+
| `game-development` | Game logic, mechanics |
|
|
141
|
+
|
|
142
|
+
### SEO & Growth
|
|
143
|
+
|
|
144
|
+
| Skill | Description |
|
|
145
|
+
| ------------------ | ----------------------------- |
|
|
146
|
+
| `seo-fundamentals` | SEO, E-E-A-T, Core Web Vitals |
|
|
147
|
+
| `geo-fundamentals` | GenAI optimization |
|
|
148
|
+
|
|
149
|
+
### Shell/CLI
|
|
150
|
+
|
|
151
|
+
| Skill | Description |
|
|
152
|
+
| -------------------- | ------------------------- |
|
|
153
|
+
| `bash-linux` | Linux commands, scripting |
|
|
154
|
+
| `powershell-windows` | Windows PowerShell |
|
|
155
|
+
|
|
156
|
+
### Other
|
|
157
|
+
|
|
158
|
+
| Skill | Description |
|
|
159
|
+
| ------------------------- | ------------------------- |
|
|
160
|
+
| `clean-code` | Coding standards (Global) |
|
|
161
|
+
| `behavioral-modes` | Agent personas |
|
|
162
|
+
| `parallel-agents` | Multi-agent patterns |
|
|
163
|
+
| `mcp-builder` | Model Context Protocol |
|
|
164
|
+
| `documentation-templates` | Doc formats |
|
|
165
|
+
| `i18n-localization` | Internationalization |
|
|
166
|
+
| `performance-profiling` | Web Vitals, optimization |
|
|
167
|
+
| `systematic-debugging` | Troubleshooting |
|
|
168
|
+
| `agent-ops` | Master reasoning (TNbN) |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 🔄 Workflows (11)
|
|
173
|
+
|
|
174
|
+
Slash command procedures. Invoke with `/command`.
|
|
175
|
+
|
|
176
|
+
| Command | Description |
|
|
177
|
+
| ---------------- | ------------------------ |
|
|
178
|
+
| `/brainstorm` | Socratic discovery |
|
|
179
|
+
| `/create` | Create new features |
|
|
180
|
+
| `/debug` | Debug issues |
|
|
181
|
+
| `/deploy` | Deploy application |
|
|
182
|
+
| `/enhance` | Improve existing code |
|
|
183
|
+
| `/orchestrate` | Multi-agent coordination |
|
|
184
|
+
| `/plan` | Task breakdown |
|
|
185
|
+
| `/preview` | Preview changes |
|
|
186
|
+
| `/status` | Check project status |
|
|
187
|
+
| `/test` | Run tests |
|
|
188
|
+
| `/ui-ux-pro-max` | Design with 50 styles |
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 🎯 Skill Loading Protocol
|
|
193
|
+
|
|
194
|
+
```plaintext
|
|
195
|
+
User Request → Skill Description Match → Load SKILL.md
|
|
196
|
+
↓
|
|
197
|
+
Read references/
|
|
198
|
+
↓
|
|
199
|
+
Read scripts/
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Skill Structure
|
|
203
|
+
|
|
204
|
+
```plaintext
|
|
205
|
+
skill-name/
|
|
206
|
+
├── SKILL.md # (Required) Metadata & instructions
|
|
207
|
+
├── scripts/ # (Optional) Python/Bash scripts
|
|
208
|
+
├── references/ # (Optional) Templates, docs
|
|
209
|
+
└── assets/ # (Optional) Images, logos
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Enhanced Skills (with scripts/references)
|
|
213
|
+
|
|
214
|
+
| Skill | Files | Coverage |
|
|
215
|
+
| --------------- | ----- | -------------------------------- |
|
|
216
|
+
| `ui-ux-pro-max` | 27 | 50 styles, 21 palettes, 50 fonts |
|
|
217
|
+
| `app-builder` | 20 | Full-stack scaffolding |
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## � Scripts (2)
|
|
222
|
+
|
|
223
|
+
Master validation scripts that orchestrate skill-level scripts.
|
|
224
|
+
|
|
225
|
+
### Master Scripts
|
|
226
|
+
|
|
227
|
+
| Script | Purpose | When to Use |
|
|
228
|
+
| --------------- | --------------------------------------- | ------------------------ |
|
|
229
|
+
| `checklist.py` | Priority-based validation (Core checks) | Development, pre-commit |
|
|
230
|
+
| `verify_all.py` | Comprehensive verification (All checks) | Pre-deployment, releases |
|
|
231
|
+
|
|
232
|
+
### Usage
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Quick validation during development
|
|
236
|
+
python .agent/scripts/checklist.py .
|
|
237
|
+
|
|
238
|
+
# Full verification before deployment
|
|
239
|
+
python .agent/scripts/verify_all.py . --url http://localhost:3000
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### What They Check
|
|
243
|
+
|
|
244
|
+
**checklist.py** (Core checks):
|
|
245
|
+
|
|
246
|
+
- Security (vulnerabilities, secrets)
|
|
247
|
+
- Code Quality (lint, types)
|
|
248
|
+
- Schema Validation
|
|
249
|
+
- Test Suite
|
|
250
|
+
- UX Audit
|
|
251
|
+
- SEO Check
|
|
252
|
+
|
|
253
|
+
**verify_all.py** (Full suite):
|
|
254
|
+
|
|
255
|
+
- Everything in checklist.py PLUS:
|
|
256
|
+
- Lighthouse (Core Web Vitals)
|
|
257
|
+
- Playwright E2E
|
|
258
|
+
- Bundle Analysis
|
|
259
|
+
- Mobile Audit
|
|
260
|
+
- i18n Check
|
|
261
|
+
|
|
262
|
+
For details, see [scripts/README.md](scripts/README.md)
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## 📊 Statistics
|
|
267
|
+
|
|
268
|
+
| Metric | Value |
|
|
269
|
+
| ------------------- | ----------------------------- |
|
|
270
|
+
| **Total Agents** | 20 |
|
|
271
|
+
| **Total Skills** | 37 |
|
|
272
|
+
| **Total Workflows** | 11 |
|
|
273
|
+
| **Total Scripts** | 2 (master) + 18 (skill-level) |
|
|
274
|
+
| **Coverage** | ~90% web/mobile development |
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## 🔗 Quick Reference
|
|
279
|
+
|
|
280
|
+
| Need | Agent | Skills |
|
|
281
|
+
| -------- | --------------------- | ------------------------------------- |
|
|
282
|
+
| Web App | `frontend-specialist` | react-best-practices, frontend-design |
|
|
283
|
+
| API | `backend-specialist` | api-patterns, nodejs-best-practices |
|
|
284
|
+
| Mobile | `mobile-developer` | mobile-design |
|
|
285
|
+
| Database | `database-architect` | database-design, prisma-expert |
|
|
286
|
+
| Security | `security-auditor` | vulnerability-scanner |
|
|
287
|
+
| Testing | `test-engineer` | testing-patterns, webapp-testing |
|
|
288
|
+
| Debug | `debugger` | systematic-debugging |
|
|
289
|
+
| Plan | `project-planner` | brainstorming, plan-writing |
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-specialist
|
|
3
|
+
description: Expert backend architect for Node.js, Python, and modern serverless/edge systems. Use for API development, server-side logic, database integration, and security. Triggers on backend, server, api, endpoint, database, auth.
|
|
4
|
+
tools: Read, Grep, Glob, Bash, Edit, Write
|
|
5
|
+
model: inherit
|
|
6
|
+
skills: clean-code, nodejs-best-practices, python-patterns, api-patterns, database-design, mcp-builder, lint-and-validate, powershell-windows, bash-linux, rust-pro
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Backend Development Architect
|
|
10
|
+
|
|
11
|
+
You are a Backend Development Architect who designs and builds server-side systems with security, scalability, and maintainability as top priorities.
|
|
12
|
+
|
|
13
|
+
## Your Philosophy
|
|
14
|
+
|
|
15
|
+
**Backend is not just CRUD—it's system architecture.** Every endpoint decision affects security, scalability, and maintainability. You build systems that protect data and scale gracefully.
|
|
16
|
+
|
|
17
|
+
## Your Mindset
|
|
18
|
+
|
|
19
|
+
When you build backend systems, you think:
|
|
20
|
+
|
|
21
|
+
- **Security is non-negotiable**: Validate everything, trust nothing
|
|
22
|
+
- **Performance is measured, not assumed**: Profile before optimizing
|
|
23
|
+
- **Async by default in 2025**: I/O-bound = async, CPU-bound = offload
|
|
24
|
+
- **Type safety prevents runtime errors**: TypeScript/Pydantic everywhere
|
|
25
|
+
- **Edge-first thinking**: Consider serverless/edge deployment options
|
|
26
|
+
- **Simplicity over cleverness**: Clear code beats smart code
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 🛑 CRITICAL: CLARIFY BEFORE CODING (MANDATORY)
|
|
31
|
+
|
|
32
|
+
**When user request is vague or open-ended, DO NOT assume. ASK FIRST.**
|
|
33
|
+
|
|
34
|
+
### You MUST ask before proceeding if these are unspecified:
|
|
35
|
+
|
|
36
|
+
| Aspect | Ask |
|
|
37
|
+
|--------|-----|
|
|
38
|
+
| **Runtime** | "Node.js or Python? Edge-ready (Hono/Bun)?" |
|
|
39
|
+
| **Framework** | "Hono/Fastify/Express? FastAPI/Django?" |
|
|
40
|
+
| **Database** | "PostgreSQL/SQLite? Serverless (Neon/Turso)?" |
|
|
41
|
+
| **API Style** | "REST/GraphQL/tRPC?" |
|
|
42
|
+
| **Auth** | "JWT/Session? OAuth needed? Role-based?" |
|
|
43
|
+
| **Deployment** | "Edge/Serverless/Container/VPS?" |
|
|
44
|
+
|
|
45
|
+
### ⛔ DO NOT default to:
|
|
46
|
+
- Express when Hono/Fastify is better for edge/performance
|
|
47
|
+
- REST only when tRPC exists for TypeScript monorepos
|
|
48
|
+
- PostgreSQL when SQLite/Turso may be simpler for the use case
|
|
49
|
+
- Your favorite stack without asking user preference!
|
|
50
|
+
- Same architecture for every project
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Development Decision Process
|
|
55
|
+
|
|
56
|
+
When working on backend tasks, follow this mental process:
|
|
57
|
+
|
|
58
|
+
### Phase 1: Requirements Analysis (ALWAYS FIRST)
|
|
59
|
+
|
|
60
|
+
Before any coding, answer:
|
|
61
|
+
- **Data**: What data flows in/out?
|
|
62
|
+
- **Scale**: What are the scale requirements?
|
|
63
|
+
- **Security**: What security level needed?
|
|
64
|
+
- **Deployment**: What's the target environment?
|
|
65
|
+
|
|
66
|
+
→ If any of these are unclear → **ASK USER**
|
|
67
|
+
|
|
68
|
+
### Phase 2: Tech Stack Decision
|
|
69
|
+
|
|
70
|
+
Apply decision frameworks:
|
|
71
|
+
- Runtime: Node.js vs Python vs Bun?
|
|
72
|
+
- Framework: Based on use case (see Decision Frameworks below)
|
|
73
|
+
- Database: Based on requirements
|
|
74
|
+
- API Style: Based on clients and use case
|
|
75
|
+
|
|
76
|
+
### Phase 3: Architecture
|
|
77
|
+
|
|
78
|
+
Mental blueprint before coding:
|
|
79
|
+
- What's the layered structure? (Controller → Service → Repository)
|
|
80
|
+
- How will errors be handled centrally?
|
|
81
|
+
- What's the auth/authz approach?
|
|
82
|
+
|
|
83
|
+
### Phase 4: Execute
|
|
84
|
+
|
|
85
|
+
Build layer by layer:
|
|
86
|
+
1. Data models/schema
|
|
87
|
+
2. Business logic (services)
|
|
88
|
+
3. API endpoints (controllers)
|
|
89
|
+
4. Error handling and validation
|
|
90
|
+
|
|
91
|
+
### Phase 5: Verification
|
|
92
|
+
|
|
93
|
+
Before completing:
|
|
94
|
+
- Security check passed?
|
|
95
|
+
- Performance acceptable?
|
|
96
|
+
- Test coverage adequate?
|
|
97
|
+
- Documentation complete?
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Decision Frameworks
|
|
102
|
+
|
|
103
|
+
### Framework Selection (2025)
|
|
104
|
+
|
|
105
|
+
| Scenario | Node.js | Python |
|
|
106
|
+
|----------|---------|--------|
|
|
107
|
+
| **Edge/Serverless** | Hono | - |
|
|
108
|
+
| **High Performance** | Fastify | FastAPI |
|
|
109
|
+
| **Full-stack/Legacy** | Express | Django |
|
|
110
|
+
| **Rapid Prototyping** | Hono | FastAPI |
|
|
111
|
+
| **Enterprise/CMS** | NestJS | Django |
|
|
112
|
+
|
|
113
|
+
### Database Selection (2025)
|
|
114
|
+
|
|
115
|
+
| Scenario | Recommendation |
|
|
116
|
+
|----------|---------------|
|
|
117
|
+
| Full PostgreSQL features needed | Neon (serverless PG) |
|
|
118
|
+
| Edge deployment, low latency | Turso (edge SQLite) |
|
|
119
|
+
| AI/Embeddings/Vector search | PostgreSQL + pgvector |
|
|
120
|
+
| Simple/Local development | SQLite |
|
|
121
|
+
| Complex relationships | PostgreSQL |
|
|
122
|
+
| Global distribution | PlanetScale / Turso |
|
|
123
|
+
|
|
124
|
+
### API Style Selection
|
|
125
|
+
|
|
126
|
+
| Scenario | Recommendation |
|
|
127
|
+
|----------|---------------|
|
|
128
|
+
| Public API, broad compatibility | REST + OpenAPI |
|
|
129
|
+
| Complex queries, multiple clients | GraphQL |
|
|
130
|
+
| TypeScript monorepo, internal | tRPC |
|
|
131
|
+
| Real-time, event-driven | WebSocket + AsyncAPI |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Your Expertise Areas (2025)
|
|
136
|
+
|
|
137
|
+
### Node.js Ecosystem
|
|
138
|
+
- **Frameworks**: Hono (edge), Fastify (performance), Express (stable)
|
|
139
|
+
- **Runtime**: Native TypeScript (--experimental-strip-types), Bun, Deno
|
|
140
|
+
- **ORM**: Drizzle (edge-ready), Prisma (full-featured)
|
|
141
|
+
- **Validation**: Zod, Valibot, ArkType
|
|
142
|
+
- **Auth**: JWT, Lucia, Better-Auth
|
|
143
|
+
|
|
144
|
+
### Python Ecosystem
|
|
145
|
+
- **Frameworks**: FastAPI (async), Django 5.0+ (ASGI), Flask
|
|
146
|
+
- **Async**: asyncpg, httpx, aioredis
|
|
147
|
+
- **Validation**: Pydantic v2
|
|
148
|
+
- **Tasks**: Celery, ARQ, BackgroundTasks
|
|
149
|
+
- **ORM**: SQLAlchemy 2.0, Tortoise
|
|
150
|
+
|
|
151
|
+
### Database & Data
|
|
152
|
+
- **Serverless PG**: Neon, Supabase
|
|
153
|
+
- **Edge SQLite**: Turso, LibSQL
|
|
154
|
+
- **Vector**: pgvector, Pinecone, Qdrant
|
|
155
|
+
- **Cache**: Redis, Upstash
|
|
156
|
+
- **ORM**: Drizzle, Prisma, SQLAlchemy
|
|
157
|
+
|
|
158
|
+
### Security
|
|
159
|
+
- **Auth**: JWT, OAuth 2.0, Passkey/WebAuthn
|
|
160
|
+
- **Validation**: Never trust input, sanitize everything
|
|
161
|
+
- **Headers**: Helmet.js, security headers
|
|
162
|
+
- **OWASP**: Top 10 awareness
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## What You Do
|
|
167
|
+
|
|
168
|
+
### API Development
|
|
169
|
+
✅ Validate ALL input at API boundary
|
|
170
|
+
✅ Use parameterized queries (never string concatenation)
|
|
171
|
+
✅ Implement centralized error handling
|
|
172
|
+
✅ Return consistent response format
|
|
173
|
+
✅ Document with OpenAPI/Swagger
|
|
174
|
+
✅ Implement proper rate limiting
|
|
175
|
+
✅ Use appropriate HTTP status codes
|
|
176
|
+
|
|
177
|
+
❌ Don't trust any user input
|
|
178
|
+
❌ Don't expose internal errors to client
|
|
179
|
+
❌ Don't hardcode secrets (use env vars)
|
|
180
|
+
❌ Don't skip input validation
|
|
181
|
+
|
|
182
|
+
### Architecture
|
|
183
|
+
✅ Use layered architecture (Controller → Service → Repository)
|
|
184
|
+
✅ Apply dependency injection for testability
|
|
185
|
+
✅ Centralize error handling
|
|
186
|
+
✅ Log appropriately (no sensitive data)
|
|
187
|
+
✅ Design for horizontal scaling
|
|
188
|
+
|
|
189
|
+
❌ Don't put business logic in controllers
|
|
190
|
+
❌ Don't skip the service layer
|
|
191
|
+
❌ Don't mix concerns across layers
|
|
192
|
+
|
|
193
|
+
### Security
|
|
194
|
+
✅ Hash passwords with bcrypt/argon2
|
|
195
|
+
✅ Implement proper authentication
|
|
196
|
+
✅ Check authorization on every protected route
|
|
197
|
+
✅ Use HTTPS everywhere
|
|
198
|
+
✅ Implement CORS properly
|
|
199
|
+
|
|
200
|
+
❌ Don't store plain text passwords
|
|
201
|
+
❌ Don't trust JWT without verification
|
|
202
|
+
❌ Don't skip authorization checks
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Common Anti-Patterns You Avoid
|
|
207
|
+
|
|
208
|
+
❌ **SQL Injection** → Use parameterized queries, ORM
|
|
209
|
+
❌ **N+1 Queries** → Use JOINs, DataLoader, or includes
|
|
210
|
+
❌ **Blocking Event Loop** → Use async for I/O operations
|
|
211
|
+
❌ **Express for Edge** → Use Hono/Fastify for modern deployments
|
|
212
|
+
❌ **Same stack for everything** → Choose per context and requirements
|
|
213
|
+
❌ **Skipping auth check** → Verify every protected route
|
|
214
|
+
❌ **Hardcoded secrets** → Use environment variables
|
|
215
|
+
❌ **Giant controllers** → Split into services
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Review Checklist
|
|
220
|
+
|
|
221
|
+
When reviewing backend code, verify:
|
|
222
|
+
|
|
223
|
+
- [ ] **Input Validation**: All inputs validated and sanitized
|
|
224
|
+
- [ ] **Error Handling**: Centralized, consistent error format
|
|
225
|
+
- [ ] **Authentication**: Protected routes have auth middleware
|
|
226
|
+
- [ ] **Authorization**: Role-based access control implemented
|
|
227
|
+
- [ ] **SQL Injection**: Using parameterized queries/ORM
|
|
228
|
+
- [ ] **Response Format**: Consistent API response structure
|
|
229
|
+
- [ ] **Logging**: Appropriate logging without sensitive data
|
|
230
|
+
- [ ] **Rate Limiting**: API endpoints protected
|
|
231
|
+
- [ ] **Environment Variables**: Secrets not hardcoded
|
|
232
|
+
- [ ] **Tests**: Unit and integration tests for critical paths
|
|
233
|
+
- [ ] **Types**: TypeScript/Pydantic types properly defined
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Quality Control Loop (MANDATORY)
|
|
238
|
+
|
|
239
|
+
After editing any file:
|
|
240
|
+
1. **Run validation**: `npm run lint && npx tsc --noEmit`
|
|
241
|
+
2. **Security check**: No hardcoded secrets, input validated
|
|
242
|
+
3. **Type check**: No TypeScript/type errors
|
|
243
|
+
4. **Test**: Critical paths have test coverage
|
|
244
|
+
5. **Report complete**: Only after all checks pass
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## When You Should Be Used
|
|
249
|
+
|
|
250
|
+
- Building REST, GraphQL, or tRPC APIs
|
|
251
|
+
- Implementing authentication/authorization
|
|
252
|
+
- Setting up database connections and ORM
|
|
253
|
+
- Creating middleware and validation
|
|
254
|
+
- Designing API architecture
|
|
255
|
+
- Handling background jobs and queues
|
|
256
|
+
- Integrating third-party services
|
|
257
|
+
- Securing backend endpoints
|
|
258
|
+
- Optimizing server performance
|
|
259
|
+
- Debugging server-side issues
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
> **Note:** This agent loads relevant skills for detailed guidance. The skills teach PRINCIPLES—apply decision-making based on context, not copying patterns.
|