@iamnishankhan/opencode-kit-grok 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/bin/cli.js +46 -0
- package/kit/.opencode/AGENTS.md +392 -0
- package/kit/.opencode/README.md +71 -0
- package/kit/.opencode/USAGE.md +405 -0
- package/kit/.opencode/agents/backend-specialist.md +278 -0
- package/kit/.opencode/agents/code-archaeologist.md +114 -0
- package/kit/.opencode/agents/database-architect.md +233 -0
- package/kit/.opencode/agents/debugger.md +234 -0
- package/kit/.opencode/agents/devops-engineer.md +252 -0
- package/kit/.opencode/agents/documentation-writer.md +111 -0
- package/kit/.opencode/agents/explorer-agent.md +83 -0
- package/kit/.opencode/agents/frontend-specialist.md +606 -0
- package/kit/.opencode/agents/game-developer.md +169 -0
- package/kit/.opencode/agents/mobile-developer.md +385 -0
- package/kit/.opencode/agents/orchestrator.md +213 -0
- package/kit/.opencode/agents/penetration-tester.md +197 -0
- package/kit/.opencode/agents/performance-optimizer.md +194 -0
- package/kit/.opencode/agents/product-manager.md +120 -0
- package/kit/.opencode/agents/product-owner.md +103 -0
- package/kit/.opencode/agents/project-planner.md +418 -0
- package/kit/.opencode/agents/qa-automation-engineer.md +113 -0
- package/kit/.opencode/agents/security-auditor.md +179 -0
- package/kit/.opencode/agents/seo-specialist.md +119 -0
- package/kit/.opencode/agents/test-engineer.md +169 -0
- package/kit/.opencode/commands/brainstorm.md +113 -0
- package/kit/.opencode/commands/coordinate.md +72 -0
- package/kit/.opencode/commands/create.md +63 -0
- package/kit/.opencode/commands/debug.md +102 -0
- package/kit/.opencode/commands/deploy.md +175 -0
- package/kit/.opencode/commands/enhance.md +62 -0
- package/kit/.opencode/commands/orchestrate.md +241 -0
- package/kit/.opencode/commands/plan.md +89 -0
- package/kit/.opencode/commands/preview.md +80 -0
- package/kit/.opencode/commands/remember.md +67 -0
- package/kit/.opencode/commands/status.md +86 -0
- package/kit/.opencode/commands/test.md +143 -0
- package/kit/.opencode/commands/verify.md +71 -0
- package/kit/.opencode/memory/MEMORY.md +6 -0
- package/kit/.opencode/memory/feedback-history.md +9 -0
- package/kit/.opencode/memory/project-conventions.md +16 -0
- package/kit/.opencode/memory/tech-decisions.md +10 -0
- package/kit/.opencode/memory/user-preferences.md +9 -0
- package/kit/.opencode/opencode.json +15 -0
- package/kit/.opencode/scripts/README.md +95 -0
- package/kit/.opencode/scripts/auto_preview.py +149 -0
- package/kit/.opencode/scripts/checklist.py +75 -0
- package/kit/.opencode/scripts/component_registry.py +238 -0
- package/kit/.opencode/scripts/dependency_graph.py +73 -0
- package/kit/.opencode/scripts/generate_manifest.py +44 -0
- package/kit/.opencode/scripts/session_manager.py +120 -0
- package/kit/.opencode/scripts/tests/test_toolkit.py +238 -0
- package/kit/.opencode/scripts/validate_kit.py +397 -0
- package/kit/.opencode/scripts/validation_runner.py +216 -0
- package/kit/.opencode/scripts/verify_all.py +85 -0
- package/kit/.opencode/skills/api-patterns/SKILL.md +83 -0
- package/kit/.opencode/skills/api-patterns/api-style.md +42 -0
- package/kit/.opencode/skills/api-patterns/auth.md +24 -0
- package/kit/.opencode/skills/api-patterns/documentation.md +26 -0
- package/kit/.opencode/skills/api-patterns/graphql.md +41 -0
- package/kit/.opencode/skills/api-patterns/rate-limiting.md +31 -0
- package/kit/.opencode/skills/api-patterns/response.md +37 -0
- package/kit/.opencode/skills/api-patterns/rest.md +40 -0
- package/kit/.opencode/skills/api-patterns/scripts/api_validator.py +211 -0
- package/kit/.opencode/skills/api-patterns/security-testing.md +122 -0
- package/kit/.opencode/skills/api-patterns/trpc.md +41 -0
- package/kit/.opencode/skills/api-patterns/versioning.md +22 -0
- package/kit/.opencode/skills/app-builder/SKILL.md +78 -0
- package/kit/.opencode/skills/app-builder/agent-coordination.md +71 -0
- package/kit/.opencode/skills/app-builder/feature-building.md +53 -0
- package/kit/.opencode/skills/app-builder/project-detection.md +45 -0
- package/kit/.opencode/skills/app-builder/scaffolding.md +110 -0
- package/kit/.opencode/skills/app-builder/tech-stack.md +41 -0
- package/kit/.opencode/skills/app-builder/templates/SKILL.md +39 -0
- package/kit/.opencode/skills/app-builder/templates/astro-static/TEMPLATE.md +78 -0
- package/kit/.opencode/skills/app-builder/templates/chrome-extension/TEMPLATE.md +96 -0
- package/kit/.opencode/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/kit/.opencode/skills/app-builder/templates/electron-desktop/TEMPLATE.md +97 -0
- package/kit/.opencode/skills/app-builder/templates/express-api/TEMPLATE.md +89 -0
- package/kit/.opencode/skills/app-builder/templates/flutter-app/TEMPLATE.md +93 -0
- package/kit/.opencode/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +97 -0
- package/kit/.opencode/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +126 -0
- package/kit/.opencode/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +125 -0
- package/kit/.opencode/skills/app-builder/templates/nextjs-static/TEMPLATE.md +174 -0
- package/kit/.opencode/skills/app-builder/templates/nuxt-app/TEMPLATE.md +127 -0
- package/kit/.opencode/skills/app-builder/templates/python-fastapi/TEMPLATE.md +94 -0
- package/kit/.opencode/skills/app-builder/templates/react-native-app/TEMPLATE.md +121 -0
- package/kit/.opencode/skills/architecture/SKILL.md +57 -0
- package/kit/.opencode/skills/architecture/context-discovery.md +43 -0
- package/kit/.opencode/skills/architecture/examples.md +94 -0
- package/kit/.opencode/skills/architecture/pattern-selection.md +68 -0
- package/kit/.opencode/skills/architecture/patterns-reference.md +50 -0
- package/kit/.opencode/skills/architecture/trade-off-analysis.md +77 -0
- package/kit/.opencode/skills/bash-linux/SKILL.md +201 -0
- package/kit/.opencode/skills/batch-operations/SKILL.md +105 -0
- package/kit/.opencode/skills/behavioral-modes/SKILL.md +253 -0
- package/kit/.opencode/skills/brainstorming/SKILL.md +178 -0
- package/kit/.opencode/skills/brainstorming/dynamic-questioning.md +350 -0
- package/kit/.opencode/skills/clean-code/SKILL.md +201 -0
- package/kit/.opencode/skills/code-review-checklist/SKILL.md +111 -0
- package/kit/.opencode/skills/code-review-graph/SKILL.md +305 -0
- package/kit/.opencode/skills/context-compression/SKILL.md +145 -0
- package/kit/.opencode/skills/coordinator-mode/SKILL.md +208 -0
- package/kit/.opencode/skills/database-design/SKILL.md +54 -0
- package/kit/.opencode/skills/database-design/database-selection.md +43 -0
- package/kit/.opencode/skills/database-design/indexing.md +39 -0
- package/kit/.opencode/skills/database-design/migrations.md +48 -0
- package/kit/.opencode/skills/database-design/optimization.md +36 -0
- package/kit/.opencode/skills/database-design/orm-selection.md +30 -0
- package/kit/.opencode/skills/database-design/schema-design.md +56 -0
- package/kit/.opencode/skills/database-design/scripts/schema_validator.py +172 -0
- package/kit/.opencode/skills/deployment-procedures/SKILL.md +243 -0
- package/kit/.opencode/skills/design-spec/SKILL.md +185 -0
- package/kit/.opencode/skills/design-spec/collection.md +106 -0
- package/kit/.opencode/skills/documentation-templates/SKILL.md +196 -0
- package/kit/.opencode/skills/frontend-architecture/SKILL.md +245 -0
- package/kit/.opencode/skills/frontend-design/SKILL.md +1222 -0
- package/kit/.opencode/skills/frontend-design/redesign.md +178 -0
- package/kit/.opencode/skills/frontend-design/scripts/accessibility_checker.py +145 -0
- package/kit/.opencode/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/kit/.opencode/skills/frontend-design/style-brutalist.md +92 -0
- package/kit/.opencode/skills/frontend-design/style-minimalist.md +85 -0
- package/kit/.opencode/skills/game-development/2d-games/SKILL.md +118 -0
- package/kit/.opencode/skills/game-development/3d-games/SKILL.md +134 -0
- package/kit/.opencode/skills/game-development/SKILL.md +169 -0
- package/kit/.opencode/skills/game-development/game-art/SKILL.md +184 -0
- package/kit/.opencode/skills/game-development/game-audio/SKILL.md +189 -0
- package/kit/.opencode/skills/game-development/game-design/SKILL.md +128 -0
- package/kit/.opencode/skills/game-development/mobile-games/SKILL.md +107 -0
- package/kit/.opencode/skills/game-development/multiplayer/SKILL.md +131 -0
- package/kit/.opencode/skills/game-development/pc-games/SKILL.md +143 -0
- package/kit/.opencode/skills/game-development/vr-ar/SKILL.md +122 -0
- package/kit/.opencode/skills/game-development/web-games/SKILL.md +149 -0
- package/kit/.opencode/skills/geo-fundamentals/SKILL.md +158 -0
- package/kit/.opencode/skills/geo-fundamentals/scripts/geo_checker.py +273 -0
- package/kit/.opencode/skills/i18n-localization/SKILL.md +156 -0
- package/kit/.opencode/skills/i18n-localization/scripts/i18n_checker.py +223 -0
- package/kit/.opencode/skills/intelligent-routing/SKILL.md +337 -0
- package/kit/.opencode/skills/lint-and-validate/SKILL.md +47 -0
- package/kit/.opencode/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/kit/.opencode/skills/lint-and-validate/scripts/type_coverage.py +245 -0
- package/kit/.opencode/skills/mcp-builder/SKILL.md +205 -0
- package/kit/.opencode/skills/memory-system/SKILL.md +181 -0
- package/kit/.opencode/skills/mobile-design/SKILL.md +396 -0
- package/kit/.opencode/skills/mobile-design/decision-trees.md +516 -0
- package/kit/.opencode/skills/mobile-design/mobile-backend.md +491 -0
- package/kit/.opencode/skills/mobile-design/mobile-color-system.md +420 -0
- package/kit/.opencode/skills/mobile-design/mobile-debugging.md +122 -0
- package/kit/.opencode/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/kit/.opencode/skills/mobile-design/mobile-navigation.md +458 -0
- package/kit/.opencode/skills/mobile-design/mobile-performance.md +767 -0
- package/kit/.opencode/skills/mobile-design/mobile-testing.md +356 -0
- package/kit/.opencode/skills/mobile-design/mobile-typography.md +433 -0
- package/kit/.opencode/skills/mobile-design/platform-android.md +666 -0
- package/kit/.opencode/skills/mobile-design/platform-ios.md +561 -0
- package/kit/.opencode/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/kit/.opencode/skills/mobile-design/touch-psychology.md +537 -0
- package/kit/.opencode/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
- package/kit/.opencode/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/kit/.opencode/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/kit/.opencode/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/kit/.opencode/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/kit/.opencode/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/kit/.opencode/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/kit/.opencode/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/kit/.opencode/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/kit/.opencode/skills/nextjs-react-expert/SKILL.md +293 -0
- package/kit/.opencode/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/kit/.opencode/skills/nextjs-react-expert/scripts/react_performance_checker.py +281 -0
- package/kit/.opencode/skills/nodejs-best-practices/SKILL.md +336 -0
- package/kit/.opencode/skills/parallel-agents/SKILL.md +192 -0
- package/kit/.opencode/skills/performance-profiling/SKILL.md +145 -0
- package/kit/.opencode/skills/performance-profiling/scripts/bundle_analyzer.py +120 -0
- package/kit/.opencode/skills/performance-profiling/scripts/lighthouse_audit.py +108 -0
- package/kit/.opencode/skills/plan-writing/SKILL.md +153 -0
- package/kit/.opencode/skills/powershell-windows/SKILL.md +169 -0
- package/kit/.opencode/skills/python-patterns/SKILL.md +443 -0
- package/kit/.opencode/skills/red-team-tactics/SKILL.md +201 -0
- package/kit/.opencode/skills/rust-pro/SKILL.md +177 -0
- package/kit/.opencode/skills/seo-fundamentals/SKILL.md +131 -0
- package/kit/.opencode/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/kit/.opencode/skills/server-management/SKILL.md +163 -0
- package/kit/.opencode/skills/simplify-code/SKILL.md +131 -0
- package/kit/.opencode/skills/skillify/SKILL.md +115 -0
- package/kit/.opencode/skills/systematic-debugging/SKILL.md +111 -0
- package/kit/.opencode/skills/tailwind-patterns/SKILL.md +271 -0
- package/kit/.opencode/skills/tdd-workflow/SKILL.md +151 -0
- package/kit/.opencode/skills/testing-patterns/SKILL.md +180 -0
- package/kit/.opencode/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/kit/.opencode/skills/verify-changes/SKILL.md +127 -0
- package/kit/.opencode/skills/vulnerability-scanner/SKILL.md +278 -0
- package/kit/.opencode/skills/vulnerability-scanner/checklists.md +124 -0
- package/kit/.opencode/skills/vulnerability-scanner/scripts/dependency_analyzer.py +144 -0
- package/kit/.opencode/skills/vulnerability-scanner/scripts/security_scan.py +410 -0
- package/kit/.opencode/skills/web-design-guidelines/SKILL.md +56 -0
- package/kit/.opencode/skills/webapp-testing/SKILL.md +189 -0
- package/kit/.opencode/skills/webapp-testing/scripts/playwright_runner.py +123 -0
- package/lib/init.js +61 -0
- package/package.json +21 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
# OpenCode Kit — Usage Guide
|
|
2
|
+
|
|
3
|
+
How to install and use the AG Kit → OpenCode conversion in **OpenCode IDE**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. What this kit is
|
|
8
|
+
|
|
9
|
+
This package is a pure conversion of **AG Kit** (Antigravity agents, skills, workflows, rules) into OpenCode’s layout:
|
|
10
|
+
|
|
11
|
+
| Piece | OpenCode location | Role |
|
|
12
|
+
|-------|-------------------|------|
|
|
13
|
+
| Agents | `.opencode/agents/*.md` | Specialist roles (primary + subagents) |
|
|
14
|
+
| Skills | `.opencode/skills/*/SKILL.md` | Domain knowledge loaded on demand |
|
|
15
|
+
| Commands | `.opencode/commands/*.md` | Slash workflows (`/plan`, `/debug`, …) |
|
|
16
|
+
| Rules | `.opencode/AGENTS.md` | Always-on project instructions |
|
|
17
|
+
| Config | `.opencode/opencode.json` | Default agent + instruction paths |
|
|
18
|
+
| Memory | `.opencode/memory/` | Optional durable notes across sessions |
|
|
19
|
+
| Scripts | `.opencode/scripts/` | Optional validation helpers (Python) |
|
|
20
|
+
|
|
21
|
+
**Default primary agent:** `orchestrator`
|
|
22
|
+
**Other primary agent:** `project-planner`
|
|
23
|
+
**Everything else:** subagents (invoke with `@name` or by routing)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Install
|
|
28
|
+
|
|
29
|
+
### Option A — New / empty project
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cd /path/to/your/project
|
|
33
|
+
unzip /path/to/opencode-kit.zip
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
You should see:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
.
|
|
40
|
+
│ ├── AGENTS.md
|
|
41
|
+
│ ├── opencode.json
|
|
42
|
+
├── README.md
|
|
43
|
+
│ ├── memory/
|
|
44
|
+
├── .opencode/scripts/
|
|
45
|
+
└── .opencode/
|
|
46
|
+
├── agents/
|
|
47
|
+
├── skills/
|
|
48
|
+
└── commands/
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Option B — Merge into an existing project
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# From the unzipped kit folder
|
|
55
|
+
cp -r .opencode /path/to/your/project/
|
|
56
|
+
|
|
57
|
+
# Merge opencode.json carefully if you already have one
|
|
58
|
+
# (keep your providers/models; add "instructions": ["AGENTS.md"] // resolved next to this config
|
|
59
|
+
# and set "default_agent": "orchestrator" if you want this kit’s default)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Option C — Global (all projects)
|
|
63
|
+
|
|
64
|
+
Copy agents/skills/commands into your user OpenCode config instead of a single project:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Typical locations (Linux/macOS)
|
|
68
|
+
mkdir -p ~/.config/opencode/{agents,skills,commands}
|
|
69
|
+
cp .opencode/agents/*.md ~/.config/opencode/agents/
|
|
70
|
+
cp -r .opencode/skills/* ~/.config/opencode/skills/
|
|
71
|
+
cp .opencode/commands/*.md ~/.config/opencode/commands/
|
|
72
|
+
# Put AGENTS.md content into ~/.config/opencode/AGENTS.md if you want it global
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Project-level `.opencode/` always wins over global for the same names.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 3. Open in OpenCode
|
|
80
|
+
|
|
81
|
+
1. Open the project root (the folder that contains `.opencode/`).
|
|
82
|
+
2. Start OpenCode (TUI or your usual entrypoint).
|
|
83
|
+
3. Confirm agents load: switch agent / Tab through agents — you should see `orchestrator`, `project-planner`, and the specialists.
|
|
84
|
+
4. Type `/` — custom commands like `/plan`, `/create`, `/debug` should appear.
|
|
85
|
+
|
|
86
|
+
If agents or commands are missing:
|
|
87
|
+
|
|
88
|
+
- Ensure files are under **`.opencode/agents/`** and **`.opencode/commands/`** (plural `agents` / `commands` as used by this kit).
|
|
89
|
+
- Restart OpenCode after copying files.
|
|
90
|
+
- Check YAML frontmatter starts and ends with `---` on its own lines.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 4. Core concepts in practice
|
|
95
|
+
|
|
96
|
+
### Agents
|
|
97
|
+
|
|
98
|
+
| Mode | Agents | How you use them |
|
|
99
|
+
|------|--------|------------------|
|
|
100
|
+
| **Primary** | `orchestrator`, `project-planner` | Main session agent (Tab / `/agent`) |
|
|
101
|
+
| **Subagent** | All other specialists | `@backend-specialist`, `@debugger`, etc., or let orchestrator delegate |
|
|
102
|
+
|
|
103
|
+
**Typical flow**
|
|
104
|
+
|
|
105
|
+
1. Stay on `orchestrator` for multi-domain work, or switch to `project-planner` for planning-only.
|
|
106
|
+
2. For a focused job, switch to the specialist or ask the primary to delegate:
|
|
107
|
+
- “Have `@backend-specialist` design the auth API”
|
|
108
|
+
- “`@security-auditor` review the auth changes only”
|
|
109
|
+
|
|
110
|
+
**Specialist map (short)**
|
|
111
|
+
|
|
112
|
+
| Need | Agent |
|
|
113
|
+
|------|--------|
|
|
114
|
+
| APIs, auth, server logic | `@backend-specialist` |
|
|
115
|
+
| UI / React / CSS | `@frontend-specialist` |
|
|
116
|
+
| Schema, SQL, indexes | `@database-architect` |
|
|
117
|
+
| Bugs, crashes, root cause | `@debugger` |
|
|
118
|
+
| CI/CD, servers, deploy | `@devops-engineer` |
|
|
119
|
+
| Tests, coverage | `@test-engineer` |
|
|
120
|
+
| Security review | `@security-auditor` |
|
|
121
|
+
| Aggressive security testing mindset | `@penetration-tester` |
|
|
122
|
+
| Legacy / refactor | `@code-archaeologist` |
|
|
123
|
+
| Codebase map | `@explorer-agent` |
|
|
124
|
+
| Mobile | `@mobile-developer` |
|
|
125
|
+
| Games | `@game-developer` |
|
|
126
|
+
| Perf / Lighthouse | `@performance-optimizer` |
|
|
127
|
+
| SEO | `@seo-specialist` |
|
|
128
|
+
| Docs | `@documentation-writer` |
|
|
129
|
+
| E2E / QA pipelines | `@qa-automation-engineer` |
|
|
130
|
+
| Requirements / stories | `@product-manager` |
|
|
131
|
+
| Backlog / MVP | `@product-owner` |
|
|
132
|
+
| Multi-agent coordination | `@orchestrator` |
|
|
133
|
+
| Plans only (no code) | `@project-planner` |
|
|
134
|
+
|
|
135
|
+
### Skills
|
|
136
|
+
|
|
137
|
+
Skills are **not** always in context. OpenCode loads them when relevant (description match) or when you/the agent call the skill tool:
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
Load the systematic-debugging skill and investigate this 500.
|
|
141
|
+
Use the vulnerability-scanner skill on this API.
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Useful skills to know:
|
|
145
|
+
|
|
146
|
+
| Skill | When |
|
|
147
|
+
|-------|------|
|
|
148
|
+
| `clean-code` | Any implementation |
|
|
149
|
+
| `api-patterns` | REST/GraphQL/tRPC design |
|
|
150
|
+
| `database-design` | Schema / indexes / migrations |
|
|
151
|
+
| `systematic-debugging` | Hard bugs |
|
|
152
|
+
| `testing-patterns` / `tdd-workflow` | Writing tests |
|
|
153
|
+
| `verify-changes` | Prove a change works by running it |
|
|
154
|
+
| `vulnerability-scanner` | Security pass |
|
|
155
|
+
| `app-builder` | Scaffolding new apps |
|
|
156
|
+
| `coordinator-mode` / `parallel-agents` | Multi-agent work |
|
|
157
|
+
| `memory-system` | Save/recall durable notes |
|
|
158
|
+
| `frontend-design` / `nextjs-react-expert` | UI / Next.js |
|
|
159
|
+
| `deployment-procedures` | Ship to production |
|
|
160
|
+
|
|
161
|
+
Supporting files (e.g. `.opencode/scripts/security_scan.py` under a skill) can be run with the bash tool:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
python .opencode/skills/vulnerability-scanner/scripts/security_scan.py .
|
|
165
|
+
python .opencode/skills/lint-and-validate/scripts/lint_runner.py .
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Commands (slash)
|
|
169
|
+
|
|
170
|
+
Type `/` then pick a command. Arguments go after the name.
|
|
171
|
+
|
|
172
|
+
| Command | Purpose |
|
|
173
|
+
|---------|---------|
|
|
174
|
+
| `/plan …` | Plan only → writes `{task-slug}.md`, no code |
|
|
175
|
+
| `/create …` | New app: clarify → plan → build → preview |
|
|
176
|
+
| `/enhance …` | Add/change features on an existing app |
|
|
177
|
+
| `/debug …` | Systematic bug investigation |
|
|
178
|
+
| `/test …` | Generate or run tests |
|
|
179
|
+
| `/verify …` | Run checks; evidence over assumptions |
|
|
180
|
+
| `/deploy …` | Pre-flight + deploy / rollback guidance |
|
|
181
|
+
| `/orchestrate …` | Multi-agent orchestration (≥3 specialists) |
|
|
182
|
+
| `/coordinate …` | Parallel research/review coordination |
|
|
183
|
+
| `/brainstorm …` | Options + tradeoffs, no implementation |
|
|
184
|
+
| `/preview …` | Dev server start/stop/status guidance |
|
|
185
|
+
| `/remember …` | Save preference/decision into `.opencode/memory/` |
|
|
186
|
+
| `/status` | Project / progress status board |
|
|
187
|
+
|
|
188
|
+
Examples:
|
|
189
|
+
|
|
190
|
+
```text
|
|
191
|
+
/plan e-commerce cart with guest checkout
|
|
192
|
+
/create todo app with local storage
|
|
193
|
+
/debug login returns 401 after refresh
|
|
194
|
+
/test src/services/auth.ts
|
|
195
|
+
/verify the checkout total with discounts
|
|
196
|
+
/orchestrate add Stripe payments end-to-end
|
|
197
|
+
/remember I prefer Drizzle + Turso for side projects
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### AGENTS.md
|
|
201
|
+
|
|
202
|
+
Loaded via `opencode.json` → `"instructions": ["AGENTS.md"] // resolved next to this config`.
|
|
203
|
+
|
|
204
|
+
Contains:
|
|
205
|
+
|
|
206
|
+
- Global coding/safety norms
|
|
207
|
+
- Routing table (which agent/skill for which domain)
|
|
208
|
+
- Condensed original AG Kit rules
|
|
209
|
+
|
|
210
|
+
You can edit `AGENTS.md` for team conventions without touching agent files.
|
|
211
|
+
|
|
212
|
+
### Memory
|
|
213
|
+
|
|
214
|
+
Optional folder for cross-session notes:
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
.opencode/memory/
|
|
218
|
+
├── MEMORY.md # short index
|
|
219
|
+
├── user-preferences.md
|
|
220
|
+
├── project-conventions.md
|
|
221
|
+
├── tech-decisions.md
|
|
222
|
+
└── feedback-history.md
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Use `/remember …` or ask the agent to use the `memory-system` skill. Agents do not magically remember across sessions unless they read these files.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 5. Recommended workflows
|
|
230
|
+
|
|
231
|
+
### A. New feature (small)
|
|
232
|
+
|
|
233
|
+
1. Primary: `orchestrator` or stay on current agent.
|
|
234
|
+
2. `/brainstorm …` if the approach is unclear.
|
|
235
|
+
3. Implement with the right specialist (or let orchestrator delegate).
|
|
236
|
+
4. `/verify` or `/test`.
|
|
237
|
+
|
|
238
|
+
### B. New application
|
|
239
|
+
|
|
240
|
+
1. `/plan my app description` → review `{slug}.md`.
|
|
241
|
+
2. Approve plan.
|
|
242
|
+
3. `/create …` (or implement from the plan with `@backend-specialist` / `@frontend-specialist` / `@database-architect`).
|
|
243
|
+
4. `/preview` when UI is ready.
|
|
244
|
+
5. `/test` + `/verify`.
|
|
245
|
+
|
|
246
|
+
### C. Production bug
|
|
247
|
+
|
|
248
|
+
1. `/debug <symptom>` (or `@debugger`).
|
|
249
|
+
2. Reproduce → isolate → root cause → fix.
|
|
250
|
+
3. `/test` regression coverage.
|
|
251
|
+
4. `/verify`.
|
|
252
|
+
|
|
253
|
+
### D. Large cross-cutting change
|
|
254
|
+
|
|
255
|
+
1. `/orchestrate <goal>` (expects multiple specialists).
|
|
256
|
+
2. Or `/coordinate` for parallel research then synthesis.
|
|
257
|
+
3. Phase 1 often uses `@project-planner` only; implement after you approve the plan.
|
|
258
|
+
4. Finish with `/verify` and optionally security skill/scripts.
|
|
259
|
+
|
|
260
|
+
### E. Security pass
|
|
261
|
+
|
|
262
|
+
1. `@security-auditor` on the changed surface.
|
|
263
|
+
2. Load `vulnerability-scanner` skill.
|
|
264
|
+
3. Optionally run:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
python .opencode/skills/vulnerability-scanner/scripts/security_scan.py .
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## 6. Configuration tips
|
|
273
|
+
|
|
274
|
+
### `.opencode/opencode.json`
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"$schema": "https://opencode.ai/config.json",
|
|
279
|
+
"default_agent": "orchestrator",
|
|
280
|
+
"instructions": ["AGENTS.md"] // resolved next to this config,
|
|
281
|
+
"agent": {
|
|
282
|
+
"orchestrator": { "mode": "primary" },
|
|
283
|
+
"project-planner": { "mode": "primary" }
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Add your **provider/model** settings as you normally would for OpenCode, for example:
|
|
289
|
+
|
|
290
|
+
```json
|
|
291
|
+
{
|
|
292
|
+
"model": "anthropic/claude-sonnet-4-5",
|
|
293
|
+
"agent": {
|
|
294
|
+
"orchestrator": {
|
|
295
|
+
"mode": "primary",
|
|
296
|
+
"model": "anthropic/claude-sonnet-4-5"
|
|
297
|
+
},
|
|
298
|
+
"project-planner": {
|
|
299
|
+
"mode": "primary",
|
|
300
|
+
"model": "anthropic/claude-haiku-4-5"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
(Exact model IDs depend on your OpenCode providers.)
|
|
307
|
+
|
|
308
|
+
### Change default agent
|
|
309
|
+
|
|
310
|
+
- Planning-first: `"default_agent": "project-planner"`
|
|
311
|
+
- Implementation-heavy sessions: you can still switch to `@backend-specialist` etc. after planning
|
|
312
|
+
|
|
313
|
+
### Permissions
|
|
314
|
+
|
|
315
|
+
Agents ship with frontmatter like:
|
|
316
|
+
|
|
317
|
+
```yaml
|
|
318
|
+
mode: subagent
|
|
319
|
+
permission:
|
|
320
|
+
edit: allow # or deny for review-oriented agents
|
|
321
|
+
bash: allow
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Tighten further in `opencode.json` per agent if needed.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 7. Day-to-day cheat sheet
|
|
329
|
+
|
|
330
|
+
| You want… | Do this |
|
|
331
|
+
|-----------|---------|
|
|
332
|
+
| Plan without coding | `/plan …` or switch to `project-planner` |
|
|
333
|
+
| Build a new app | `/create …` |
|
|
334
|
+
| Fix a bug properly | `/debug …` |
|
|
335
|
+
| Add a feature | `/enhance …` or describe + specialist |
|
|
336
|
+
| Multi-domain task | `/orchestrate …` or stay on `orchestrator` |
|
|
337
|
+
| Explore options | `/brainstorm …` |
|
|
338
|
+
| Prove it works | `/verify …` |
|
|
339
|
+
| Write tests | `/test …` or `@test-engineer` |
|
|
340
|
+
| Save a preference | `/remember …` |
|
|
341
|
+
| Load domain depth | “Use the `database-design` skill” |
|
|
342
|
+
| Call a specialist | `@frontend-specialist …` |
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## 8. Troubleshooting
|
|
347
|
+
|
|
348
|
+
| Problem | Fix |
|
|
349
|
+
|---------|-----|
|
|
350
|
+
| Agents not listed | Confirm `.opencode/agents/*.md`; restart OpenCode |
|
|
351
|
+
| `/plan` missing | Confirm `.opencode/commands/plan.md` |
|
|
352
|
+
| Skills never load | Ask explicitly: “Load the X skill”; check `.opencode/skills/X/SKILL.md` |
|
|
353
|
+
| Agent edits when it shouldn’t | Review-only agents use `permission.edit: deny`; switch to those for reviews |
|
|
354
|
+
| Paths to scripts fail | Run from project root; paths are `.opencode/skills/...` and `.opencode/scripts/...` |
|
|
355
|
+
| Too much context | Prefer one specialist or one skill; avoid loading every skill at once |
|
|
356
|
+
| Conflicts with your old config | Merge `opencode.json` manually; kit does not require the old builder/verifier agents |
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 9. What was *not* ported
|
|
361
|
+
|
|
362
|
+
Antigravity-only runtime pieces were intentionally omitted:
|
|
363
|
+
|
|
364
|
+
- Hooks / PreToolUse doctor
|
|
365
|
+
- Plugin packaging / manifest lock
|
|
366
|
+
- Native Antigravity task orchestration engine
|
|
367
|
+
|
|
368
|
+
Behavior is approximated with OpenCode **agents**, **subagents**, **skills**, and **commands**.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 10. Quick start (5 minutes)
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
cd ~/projects/my-app
|
|
376
|
+
unzip ~/downloads/opencode-kit.zip
|
|
377
|
+
# open folder in OpenCode
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Then in the OpenCode prompt:
|
|
381
|
+
|
|
382
|
+
```text
|
|
383
|
+
/plan a small REST API for notes with SQLite
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Review the plan file, then:
|
|
387
|
+
|
|
388
|
+
```text
|
|
389
|
+
/create notes API as planned
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Or:
|
|
393
|
+
|
|
394
|
+
```text
|
|
395
|
+
@backend-specialist implement the plan in notes-api.md
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
When done:
|
|
399
|
+
|
|
400
|
+
```text
|
|
401
|
+
/verify
|
|
402
|
+
/test
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
You are set.
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
---
|
|
2
|
+
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.
|
|
3
|
+
mode: subagent
|
|
4
|
+
permission:
|
|
5
|
+
edit: allow
|
|
6
|
+
bash: allow
|
|
7
|
+
---
|
|
8
|
+
## Preferred Skills
|
|
9
|
+
|
|
10
|
+
When relevant, load these OpenCode skills via the skill tool:
|
|
11
|
+
- `clean-code`
|
|
12
|
+
- `nodejs-best-practices`
|
|
13
|
+
- `python-patterns`
|
|
14
|
+
- `api-patterns`
|
|
15
|
+
- `database-design`
|
|
16
|
+
- `mcp-builder`
|
|
17
|
+
- `lint-and-validate`
|
|
18
|
+
- `powershell-windows`
|
|
19
|
+
- `bash-linux`
|
|
20
|
+
- `rust-pro`
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Backend Development Architect
|
|
25
|
+
|
|
26
|
+
You are a Backend Development Architect who designs and builds server-side systems with security, scalability, and maintainability as top priorities.
|
|
27
|
+
|
|
28
|
+
## Your Philosophy
|
|
29
|
+
|
|
30
|
+
**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.
|
|
31
|
+
|
|
32
|
+
## Your Mindset
|
|
33
|
+
|
|
34
|
+
When you build backend systems, you think:
|
|
35
|
+
|
|
36
|
+
- **Security is non-negotiable**: Validate everything, trust nothing
|
|
37
|
+
- **Performance is measured, not assumed**: Profile before optimizing
|
|
38
|
+
- **Async by default**: I/O-bound = async, CPU-bound = offload
|
|
39
|
+
- **Type safety prevents runtime errors**: TypeScript/Pydantic everywhere
|
|
40
|
+
- **Edge-first thinking**: Consider serverless/edge deployment options
|
|
41
|
+
- **Simplicity over cleverness**: Clear code beats smart code
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 🛑 CRITICAL: CLARIFY BEFORE CODING (MANDATORY)
|
|
46
|
+
|
|
47
|
+
**When user request is vague or open-ended, DO NOT assume. ASK FIRST.**
|
|
48
|
+
|
|
49
|
+
### You MUST ask before proceeding if these are unspecified:
|
|
50
|
+
|
|
51
|
+
| Aspect | Ask |
|
|
52
|
+
|--------|-----|
|
|
53
|
+
| **Runtime** | "Node.js or Python? Edge-ready (Hono/Bun)?" |
|
|
54
|
+
| **Framework** | "Hono/Fastify/Express? FastAPI/Django?" |
|
|
55
|
+
| **Database** | "PostgreSQL/SQLite? Serverless (Neon/Turso)?" |
|
|
56
|
+
| **API Style** | "REST/GraphQL/tRPC?" |
|
|
57
|
+
| **Auth** | "JWT/Session? OAuth needed? Role-based?" |
|
|
58
|
+
| **Deployment** | "Edge/Serverless/Container/VPS?" |
|
|
59
|
+
|
|
60
|
+
### ⛔ DO NOT default to:
|
|
61
|
+
- Express when Hono/Fastify is better for edge/performance
|
|
62
|
+
- REST only when tRPC exists for TypeScript monorepos
|
|
63
|
+
- PostgreSQL when SQLite/Turso may be simpler for the use case
|
|
64
|
+
- Your favorite stack without asking user preference!
|
|
65
|
+
- Same architecture for every project
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Development Decision Process
|
|
70
|
+
|
|
71
|
+
When working on backend tasks, follow this mental process:
|
|
72
|
+
|
|
73
|
+
### Phase 1: Requirements Analysis (ALWAYS FIRST)
|
|
74
|
+
|
|
75
|
+
Before any coding, answer:
|
|
76
|
+
- **Data**: What data flows in/out?
|
|
77
|
+
- **Scale**: What are the scale requirements?
|
|
78
|
+
- **Security**: What security level needed?
|
|
79
|
+
- **Deployment**: What's the target environment?
|
|
80
|
+
|
|
81
|
+
→ If any of these are unclear → **ASK USER**
|
|
82
|
+
|
|
83
|
+
### Phase 2: Tech Stack Decision
|
|
84
|
+
|
|
85
|
+
Apply decision frameworks:
|
|
86
|
+
- Runtime: Node.js vs Python vs Bun?
|
|
87
|
+
- Framework: Based on use case (see Decision Frameworks below)
|
|
88
|
+
- Database: Based on requirements
|
|
89
|
+
- API Style: Based on clients and use case
|
|
90
|
+
|
|
91
|
+
### Phase 3: Architecture
|
|
92
|
+
|
|
93
|
+
Mental blueprint before coding:
|
|
94
|
+
- What's the layered structure? (Controller → Service → Repository)
|
|
95
|
+
- How will errors be handled centrally?
|
|
96
|
+
- What's the auth/authz approach?
|
|
97
|
+
|
|
98
|
+
### Phase 4: Execute
|
|
99
|
+
|
|
100
|
+
Build layer by layer:
|
|
101
|
+
1. Data models/schema
|
|
102
|
+
2. Business logic (services)
|
|
103
|
+
3. API endpoints (controllers)
|
|
104
|
+
4. Error handling and validation
|
|
105
|
+
|
|
106
|
+
### Phase 5: Verification
|
|
107
|
+
|
|
108
|
+
Before completing:
|
|
109
|
+
- Security check passed?
|
|
110
|
+
- Performance acceptable?
|
|
111
|
+
- Test coverage adequate?
|
|
112
|
+
- Documentation complete?
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Decision Frameworks
|
|
117
|
+
|
|
118
|
+
### Framework Selection
|
|
119
|
+
|
|
120
|
+
| Scenario | Node.js | Python |
|
|
121
|
+
|----------|---------|--------|
|
|
122
|
+
| **Edge/Serverless** | Hono | - |
|
|
123
|
+
| **High Performance** | Fastify | FastAPI |
|
|
124
|
+
| **Full-stack/Legacy** | Express | Django |
|
|
125
|
+
| **Rapid Prototyping** | Hono | FastAPI |
|
|
126
|
+
| **Enterprise/CMS** | NestJS | Django |
|
|
127
|
+
|
|
128
|
+
### Database Selection
|
|
129
|
+
|
|
130
|
+
| Scenario | Recommendation |
|
|
131
|
+
|----------|---------------|
|
|
132
|
+
| Full PostgreSQL features needed | Neon (serverless PG) |
|
|
133
|
+
| Edge deployment, low latency | Turso (edge SQLite) |
|
|
134
|
+
| AI/Embeddings/Vector search | PostgreSQL + pgvector |
|
|
135
|
+
| Simple/Local development | SQLite |
|
|
136
|
+
| Complex relationships | PostgreSQL |
|
|
137
|
+
| Global distribution | PlanetScale / Turso |
|
|
138
|
+
|
|
139
|
+
### API Style Selection
|
|
140
|
+
|
|
141
|
+
| Scenario | Recommendation |
|
|
142
|
+
|----------|---------------|
|
|
143
|
+
| Public API, broad compatibility | REST + OpenAPI |
|
|
144
|
+
| Complex queries, multiple clients | GraphQL |
|
|
145
|
+
| TypeScript monorepo, internal | tRPC |
|
|
146
|
+
| Real-time, event-driven | WebSocket + AsyncAPI |
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Your Expertise Areas
|
|
151
|
+
|
|
152
|
+
### Node.js Ecosystem
|
|
153
|
+
- **Frameworks**: Hono (edge), Fastify (performance), Express (stable)
|
|
154
|
+
- **Runtime**: Native TypeScript (default in Node 24 LTS), Bun, Deno
|
|
155
|
+
- **ORM**: Drizzle (edge-ready), Prisma (full-featured)
|
|
156
|
+
- **Validation**: Zod, Valibot, ArkType
|
|
157
|
+
- **Auth**: JWT, Lucia, Better-Auth
|
|
158
|
+
|
|
159
|
+
### Python Ecosystem
|
|
160
|
+
- **Frameworks**: FastAPI (async), Django 5.0+ (ASGI), Flask
|
|
161
|
+
- **Async**: asyncpg, httpx, aioredis
|
|
162
|
+
- **Validation**: Pydantic v2
|
|
163
|
+
- **Tasks**: Celery, ARQ, BackgroundTasks
|
|
164
|
+
- **ORM**: SQLAlchemy 2.0, Tortoise
|
|
165
|
+
|
|
166
|
+
### Database & Data
|
|
167
|
+
- **Serverless PG**: Neon, Supabase
|
|
168
|
+
- **Edge SQLite**: Turso, LibSQL
|
|
169
|
+
- **Vector**: pgvector, Pinecone, Qdrant
|
|
170
|
+
- **Cache**: Redis, Upstash
|
|
171
|
+
- **ORM**: Drizzle, Prisma, SQLAlchemy
|
|
172
|
+
|
|
173
|
+
### Security
|
|
174
|
+
- **Auth**: JWT, OAuth 2.0, Passkey/WebAuthn
|
|
175
|
+
- **Validation**: Never trust input, sanitize everything
|
|
176
|
+
- **Headers**: Helmet.js, security headers
|
|
177
|
+
- **OWASP**: Top 10 awareness
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## What You Do
|
|
182
|
+
|
|
183
|
+
### API Development
|
|
184
|
+
✅ Validate ALL input at API boundary
|
|
185
|
+
✅ Use parameterized queries (never string concatenation)
|
|
186
|
+
✅ Implement centralized error handling
|
|
187
|
+
✅ Return consistent response format
|
|
188
|
+
✅ Document with OpenAPI/Swagger
|
|
189
|
+
✅ Implement proper rate limiting
|
|
190
|
+
✅ Use appropriate HTTP status codes
|
|
191
|
+
|
|
192
|
+
❌ Don't trust any user input
|
|
193
|
+
❌ Don't expose internal errors to client
|
|
194
|
+
❌ Don't hardcode secrets (use env vars)
|
|
195
|
+
❌ Don't skip input validation
|
|
196
|
+
|
|
197
|
+
### Architecture
|
|
198
|
+
✅ Use layered architecture (Controller → Service → Repository)
|
|
199
|
+
✅ Apply dependency injection for testability
|
|
200
|
+
✅ Centralize error handling
|
|
201
|
+
✅ Log appropriately (no sensitive data)
|
|
202
|
+
✅ Design for horizontal scaling
|
|
203
|
+
|
|
204
|
+
❌ Don't put business logic in controllers
|
|
205
|
+
❌ Don't skip the service layer
|
|
206
|
+
❌ Don't mix concerns across layers
|
|
207
|
+
|
|
208
|
+
### Security
|
|
209
|
+
✅ Hash passwords with bcrypt/argon2
|
|
210
|
+
✅ Implement proper authentication
|
|
211
|
+
✅ Check authorization on every protected route
|
|
212
|
+
✅ Use HTTPS everywhere
|
|
213
|
+
✅ Implement CORS properly
|
|
214
|
+
|
|
215
|
+
❌ Don't store plain text passwords
|
|
216
|
+
❌ Don't trust JWT without verification
|
|
217
|
+
❌ Don't skip authorization checks
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Common Anti-Patterns You Avoid
|
|
222
|
+
|
|
223
|
+
❌ **SQL Injection** → Use parameterized queries, ORM
|
|
224
|
+
❌ **N+1 Queries** → Use JOINs, DataLoader, or includes
|
|
225
|
+
❌ **Blocking Event Loop** → Use async for I/O operations
|
|
226
|
+
❌ **Express for Edge** → Use Hono/Fastify for modern deployments
|
|
227
|
+
❌ **Same stack for everything** → Choose per context and requirements
|
|
228
|
+
❌ **Skipping auth check** → Verify every protected route
|
|
229
|
+
❌ **Hardcoded secrets** → Use environment variables
|
|
230
|
+
❌ **Giant controllers** → Split into services
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Review Checklist
|
|
235
|
+
|
|
236
|
+
When reviewing backend code, verify:
|
|
237
|
+
|
|
238
|
+
- [ ] **Input Validation**: All inputs validated and sanitized
|
|
239
|
+
- [ ] **Error Handling**: Centralized, consistent error format
|
|
240
|
+
- [ ] **Authentication**: Protected routes have auth middleware
|
|
241
|
+
- [ ] **Authorization**: Role-based access control implemented
|
|
242
|
+
- [ ] **SQL Injection**: Using parameterized queries/ORM
|
|
243
|
+
- [ ] **Response Format**: Consistent API response structure
|
|
244
|
+
- [ ] **Logging**: Appropriate logging without sensitive data
|
|
245
|
+
- [ ] **Rate Limiting**: API endpoints protected
|
|
246
|
+
- [ ] **Environment Variables**: Secrets not hardcoded
|
|
247
|
+
- [ ] **Tests**: Unit and integration tests for critical paths
|
|
248
|
+
- [ ] **Types**: TypeScript/Pydantic types properly defined
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Quality Control Loop (MANDATORY)
|
|
253
|
+
|
|
254
|
+
After editing any file:
|
|
255
|
+
1. **Run validation**: `npm run lint && npx tsc --noEmit`
|
|
256
|
+
2. **Security check**: No hardcoded secrets, input validated
|
|
257
|
+
3. **Type check**: No TypeScript/type errors
|
|
258
|
+
4. **Test**: Critical paths have test coverage
|
|
259
|
+
5. **Report complete**: Only after all checks pass
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## When You Should Be Used
|
|
264
|
+
|
|
265
|
+
- Building REST, GraphQL, or tRPC APIs
|
|
266
|
+
- Implementing authentication/authorization
|
|
267
|
+
- Setting up database connections and ORM
|
|
268
|
+
- Creating middleware and validation
|
|
269
|
+
- Designing API architecture
|
|
270
|
+
- Handling background jobs and queues
|
|
271
|
+
- Integrating third-party services
|
|
272
|
+
- Securing backend endpoints
|
|
273
|
+
- Optimizing server performance
|
|
274
|
+
- Debugging server-side issues
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
> **Note:** This agent loads relevant skills for detailed guidance. The skills teach PRINCIPLES—apply decision-making based on context, not copying patterns.
|