prjct-cli 1.45.5 → 1.45.7

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.
Files changed (136) hide show
  1. package/CHANGELOG.md +30 -4
  2. package/dist/bin/prjct-core.mjs +124 -124
  3. package/dist/cli/jira.mjs +1 -1
  4. package/dist/cli/linear.mjs +1 -1
  5. package/dist/templates.json +1 -1
  6. package/package.json +2 -1
  7. package/templates/agentic/agent-routing.md +45 -0
  8. package/templates/agentic/agents/uxui.md +63 -0
  9. package/templates/agentic/checklist-routing.md +98 -0
  10. package/templates/agentic/orchestrator.md +68 -0
  11. package/templates/agentic/task-fragmentation.md +89 -0
  12. package/templates/agents/AGENTS.md +67 -0
  13. package/templates/analysis/analyze.md +84 -0
  14. package/templates/analysis/patterns.md +60 -0
  15. package/templates/antigravity/SKILL.md +39 -0
  16. package/templates/architect/discovery.md +67 -0
  17. package/templates/architect/phases.md +59 -0
  18. package/templates/baseline/anti-patterns/nextjs.json +18 -0
  19. package/templates/baseline/anti-patterns/react.json +18 -0
  20. package/templates/baseline/anti-patterns/typescript.json +18 -0
  21. package/templates/baseline/patterns/nextjs.json +18 -0
  22. package/templates/baseline/patterns/react.json +18 -0
  23. package/templates/baseline/patterns/typescript.json +18 -0
  24. package/templates/checklists/architecture.md +28 -0
  25. package/templates/checklists/code-quality.md +28 -0
  26. package/templates/checklists/data.md +33 -0
  27. package/templates/checklists/documentation.md +33 -0
  28. package/templates/checklists/infrastructure.md +33 -0
  29. package/templates/checklists/performance.md +33 -0
  30. package/templates/checklists/security.md +33 -0
  31. package/templates/checklists/testing.md +33 -0
  32. package/templates/checklists/ux-ui.md +37 -0
  33. package/templates/codex/SKILL.md +36 -0
  34. package/templates/commands/analyze.md +11 -0
  35. package/templates/commands/auth.md +15 -0
  36. package/templates/commands/bug.md +28 -0
  37. package/templates/commands/cleanup.md +11 -0
  38. package/templates/commands/dash.md +16 -0
  39. package/templates/commands/design.md +11 -0
  40. package/templates/commands/done.md +33 -0
  41. package/templates/commands/enrich.md +20 -0
  42. package/templates/commands/git.md +17 -0
  43. package/templates/commands/history.md +13 -0
  44. package/templates/commands/idea.md +13 -0
  45. package/templates/commands/impact.md +13 -0
  46. package/templates/commands/init.md +11 -0
  47. package/templates/commands/jira.md +88 -0
  48. package/templates/commands/learnings.md +11 -0
  49. package/templates/commands/linear.md +82 -0
  50. package/templates/commands/merge.md +25 -0
  51. package/templates/commands/next.md +12 -0
  52. package/templates/commands/p.md +62 -0
  53. package/templates/commands/p.toml +37 -0
  54. package/templates/commands/pause.md +16 -0
  55. package/templates/commands/plan.md +13 -0
  56. package/templates/commands/prd.md +21 -0
  57. package/templates/commands/resume.md +12 -0
  58. package/templates/commands/review.md +20 -0
  59. package/templates/commands/serve.md +11 -0
  60. package/templates/commands/sessions.md +13 -0
  61. package/templates/commands/setup.md +11 -0
  62. package/templates/commands/ship.md +46 -0
  63. package/templates/commands/skill.md +13 -0
  64. package/templates/commands/spec.md +20 -0
  65. package/templates/commands/status.md +11 -0
  66. package/templates/commands/sync.md +23 -0
  67. package/templates/commands/task.md +52 -0
  68. package/templates/commands/test.md +22 -0
  69. package/templates/commands/update.md +11 -0
  70. package/templates/commands/verify.md +11 -0
  71. package/templates/commands/workflow.md +69 -0
  72. package/templates/config/skill-mappings.json +82 -0
  73. package/templates/context/dashboard.md +251 -0
  74. package/templates/context/roadmap.md +221 -0
  75. package/templates/cursor/commands/bug.md +8 -0
  76. package/templates/cursor/commands/done.md +4 -0
  77. package/templates/cursor/commands/pause.md +6 -0
  78. package/templates/cursor/commands/resume.md +4 -0
  79. package/templates/cursor/commands/ship.md +8 -0
  80. package/templates/cursor/commands/sync.md +4 -0
  81. package/templates/cursor/commands/task.md +8 -0
  82. package/templates/cursor/p.md +29 -0
  83. package/templates/cursor/router.mdc +28 -0
  84. package/templates/design/api.md +95 -0
  85. package/templates/design/architecture.md +77 -0
  86. package/templates/design/component.md +89 -0
  87. package/templates/design/database.md +78 -0
  88. package/templates/design/flow.md +94 -0
  89. package/templates/global/ANTIGRAVITY.md +17 -0
  90. package/templates/global/CLAUDE.md +20 -0
  91. package/templates/global/CURSOR.mdc +20 -0
  92. package/templates/global/GEMINI.md +17 -0
  93. package/templates/global/STORAGE-SPEC.md +328 -0
  94. package/templates/global/WINDSURF.md +22 -0
  95. package/templates/global/modules/CLAUDE-commands.md +1 -0
  96. package/templates/global/modules/CLAUDE-core.md +16 -0
  97. package/templates/global/modules/CLAUDE-git.md +1 -0
  98. package/templates/global/modules/CLAUDE-intelligence.md +1 -0
  99. package/templates/global/modules/CLAUDE-storage.md +1 -0
  100. package/templates/global/modules/module-config.json +12 -0
  101. package/templates/mcp-config.json +29 -0
  102. package/templates/permissions/default.jsonc +60 -0
  103. package/templates/permissions/permissive.jsonc +49 -0
  104. package/templates/permissions/strict.jsonc +58 -0
  105. package/templates/planning-methodology.md +195 -0
  106. package/templates/skills/code-review.md +47 -0
  107. package/templates/skills/debug.md +61 -0
  108. package/templates/skills/refactor.md +47 -0
  109. package/templates/subagents/agent-base.md +21 -0
  110. package/templates/subagents/domain/backend.md +109 -0
  111. package/templates/subagents/domain/database.md +121 -0
  112. package/templates/subagents/domain/devops.md +152 -0
  113. package/templates/subagents/domain/frontend.md +103 -0
  114. package/templates/subagents/domain/testing.md +169 -0
  115. package/templates/subagents/pm-expert.md +366 -0
  116. package/templates/subagents/workflow/chief-architect.md +653 -0
  117. package/templates/subagents/workflow/prjct-planner.md +120 -0
  118. package/templates/subagents/workflow/prjct-shipper.md +175 -0
  119. package/templates/subagents/workflow/prjct-workflow.md +82 -0
  120. package/templates/tools/bash.txt +22 -0
  121. package/templates/tools/edit.txt +18 -0
  122. package/templates/tools/glob.txt +19 -0
  123. package/templates/tools/grep.txt +21 -0
  124. package/templates/tools/read.txt +14 -0
  125. package/templates/tools/task.txt +20 -0
  126. package/templates/tools/webfetch.txt +16 -0
  127. package/templates/tools/websearch.txt +18 -0
  128. package/templates/tools/write.txt +17 -0
  129. package/templates/windsurf/router.md +28 -0
  130. package/templates/windsurf/workflows/bug.md +8 -0
  131. package/templates/windsurf/workflows/done.md +4 -0
  132. package/templates/windsurf/workflows/pause.md +4 -0
  133. package/templates/windsurf/workflows/resume.md +4 -0
  134. package/templates/windsurf/workflows/ship.md +8 -0
  135. package/templates/windsurf/workflows/sync.md +4 -0
  136. package/templates/windsurf/workflows/task.md +8 -0
@@ -0,0 +1,49 @@
1
+ {
2
+ // Permissive preset for prjct-cli
3
+ // For trusted environments - minimal restrictions
4
+
5
+ "bash": {
6
+ // Most commands allowed
7
+ "git*": "allow",
8
+ "npm*": "allow",
9
+ "bun*": "allow",
10
+ "node*": "allow",
11
+ "ls*": "allow",
12
+ "cat*": "allow",
13
+ "mkdir*": "allow",
14
+ "cp*": "allow",
15
+ "mv*": "allow",
16
+ "rm*": "allow",
17
+ "chmod*": "allow",
18
+
19
+ // Still protect against catastrophic mistakes
20
+ "rm -rf /*": "deny",
21
+ "rm -rf ~/*": "deny",
22
+ "sudo rm -rf*": "deny",
23
+ ":(){ :|:& };:*": "deny"
24
+ },
25
+
26
+ "files": {
27
+ "read": {
28
+ "**/*": "allow"
29
+ },
30
+ "write": {
31
+ "**/*": "allow"
32
+ },
33
+ "delete": {
34
+ "**/*": "allow",
35
+ "**/node_modules/**": "deny" // Protect dependencies
36
+ }
37
+ },
38
+
39
+ "web": {
40
+ "enabled": true
41
+ },
42
+
43
+ "doomLoop": {
44
+ "enabled": true,
45
+ "maxRetries": 5
46
+ },
47
+
48
+ "externalDirectories": "allow"
49
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ // Strict permissions preset for prjct-cli
3
+ // Maximum safety - requires approval for most operations
4
+
5
+ "bash": {
6
+ // Only read-only commands allowed
7
+ "git status": "allow",
8
+ "git log*": "allow",
9
+ "git diff*": "allow",
10
+ "ls*": "allow",
11
+ "pwd": "allow",
12
+ "cat*": "allow",
13
+ "head*": "allow",
14
+ "tail*": "allow",
15
+ "which*": "allow",
16
+
17
+ // Everything else requires approval
18
+ "git*": "ask",
19
+ "npm*": "ask",
20
+ "bun*": "ask",
21
+ "node*": "ask",
22
+ "rm*": "ask",
23
+ "mv*": "ask",
24
+ "cp*": "ask",
25
+ "mkdir*": "ask",
26
+
27
+ // Always denied
28
+ "rm -rf*": "deny",
29
+ "sudo*": "deny",
30
+ "chmod 777*": "deny"
31
+ },
32
+
33
+ "files": {
34
+ "read": {
35
+ "**/*": "allow",
36
+ "**/.*": "ask", // Hidden files need approval
37
+ "**/.env*": "deny" // Never read env files
38
+ },
39
+ "write": {
40
+ "**/*": "ask" // All writes need approval
41
+ },
42
+ "delete": {
43
+ "**/*": "deny" // No deletions without explicit override
44
+ }
45
+ },
46
+
47
+ "web": {
48
+ "enabled": true,
49
+ "blockedDomains": ["localhost", "127.0.0.1", "internal"]
50
+ },
51
+
52
+ "doomLoop": {
53
+ "enabled": true,
54
+ "maxRetries": 2
55
+ },
56
+
57
+ "externalDirectories": "deny"
58
+ }
@@ -0,0 +1,195 @@
1
+ # Software Planning Methodology for prjct
2
+
3
+ This methodology guides the AI through developing ideas into complete technical specifications.
4
+
5
+ ## Phase 1: Discovery & Problem Definition
6
+
7
+ ### Questions to Ask
8
+ - What specific problem does this solve?
9
+ - Who is the target user?
10
+ - What's the budget and timeline?
11
+ - What happens if this problem isn't solved?
12
+
13
+ ### Output
14
+ - Problem statement
15
+ - User personas
16
+ - Business constraints
17
+ - Success metrics
18
+
19
+ ## Phase 2: User Flows & Journeys
20
+
21
+ ### Process
22
+ 1. Map primary user journey
23
+ 2. Identify entry points
24
+ 3. Define success states
25
+ 4. Document error states
26
+ 5. Note edge cases
27
+
28
+ ### Jobs-to-be-Done
29
+ When [situation], I want to [motivation], so I can [expected outcome]
30
+
31
+ ## Phase 3: Domain Modeling
32
+
33
+ ### Entity Definition
34
+ For each entity, define:
35
+ - Description
36
+ - Attributes (name, type, constraints)
37
+ - Relationships
38
+ - Business rules
39
+ - Lifecycle states
40
+
41
+ ### Bounded Contexts
42
+ Group entities into logical boundaries with:
43
+ - Owned entities
44
+ - External dependencies
45
+ - Events published/consumed
46
+
47
+ ## Phase 4: API Contract Design
48
+
49
+ ### Style Selection
50
+ | Style | Best For |
51
+ |----------|----------|
52
+ | REST | Simple CRUD, broad compatibility |
53
+ | GraphQL | Complex data requirements |
54
+ | tRPC | Full-stack TypeScript |
55
+ | gRPC | Microservices |
56
+
57
+ ### Endpoint Specification
58
+ - Method/Type
59
+ - Path/Name
60
+ - Authentication
61
+ - Input/Output schemas
62
+ - Error responses
63
+
64
+ ## Phase 5: System Architecture
65
+
66
+ ### Pattern Selection
67
+ | Pattern | Best For |
68
+ |---------|----------|
69
+ | Modular Monolith | Small team, fast iteration |
70
+ | Serverless-First | Variable load, event-driven |
71
+ | Microservices | Large team, complex domain |
72
+
73
+ ### C4 Model
74
+ 1. Context - System and external actors
75
+ 2. Container - Major components
76
+ 3. Component - Internal structure
77
+
78
+ ## Phase 6: Data Architecture
79
+
80
+ ### Database Selection
81
+ | Type | Options | Best For |
82
+ |------|---------|----------|
83
+ | Relational | PostgreSQL | ACID, structured data |
84
+ | Document | MongoDB | Flexible schema |
85
+ | Key-Value | Redis | Caching, sessions |
86
+
87
+ ### Schema Design
88
+ - Tables and columns
89
+ - Indexes
90
+ - Constraints
91
+ - Relationships
92
+
93
+ ## Phase 7: Tech Stack Decision
94
+
95
+ ### Frontend Stack
96
+ - Framework (Next.js, Remix, SvelteKit)
97
+ - Styling (Tailwind, CSS Modules)
98
+ - State management (Zustand, Jotai)
99
+ - Data fetching (TanStack Query, SWR)
100
+
101
+ ### Backend Stack
102
+ - Runtime (Node.js, Bun)
103
+ - Framework (Next.js API, Hono)
104
+ - ORM (Drizzle, Prisma)
105
+ - Validation (Zod, Valibot)
106
+
107
+ ### Infrastructure
108
+ - Hosting (Vercel, Railway, Fly.io)
109
+ - Database (Neon, PlanetScale)
110
+ - Cache (Upstash, Redis)
111
+ - Monitoring (Sentry, Axiom)
112
+
113
+ ## Phase 8: Implementation Roadmap
114
+
115
+ ### MVP Scope Definition
116
+ - Must-have features (P0)
117
+ - Should-have features (P1)
118
+ - Nice-to-have features (P2)
119
+ - Future considerations (P3)
120
+
121
+ ### Development Phases
122
+ 1. Foundation - Setup, core infrastructure
123
+ 2. Core Features - Primary functionality
124
+ 3. Polish & Launch - Optimization, deployment
125
+
126
+ ### Risk Assessment
127
+ - Technical risks and mitigation
128
+ - Business risks and mitigation
129
+ - Dependencies and assumptions
130
+
131
+ ## Output Structure
132
+
133
+ When complete, generate:
134
+
135
+ 1. **Executive Summary** - Problem, solution, key decisions
136
+ 2. **Architecture Documents** - All phases detailed
137
+ 3. **Implementation Plan** - Prioritized tasks with estimates
138
+ 4. **Decision Log** - Key choices and reasoning
139
+
140
+ ## Interactive Development Process
141
+
142
+ 1. **Classification**: Determine if idea needs full architecture
143
+ 2. **Discovery**: Ask clarifying questions
144
+ 3. **Generation**: Create architecture phase by phase
145
+ 4. **Validation**: Review with user at key points
146
+ 5. **Refinement**: Iterate based on feedback
147
+ 6. **Output**: Save complete specification
148
+
149
+ ## Success Criteria
150
+
151
+ A complete architecture includes:
152
+ - Clear problem definition
153
+ - User flows mapped
154
+ - Domain model defined
155
+ - API contracts specified
156
+ - Tech stack chosen
157
+ - Database schema designed
158
+ - Implementation roadmap created
159
+ - Risk assessment completed
160
+
161
+ ## Templates
162
+
163
+ ### Entity Template
164
+ ```
165
+ Entity: [Name]
166
+ ├── Description: [What it represents]
167
+ ├── Attributes:
168
+ │ ├── id: uuid (primary key)
169
+ │ └── [field]: [type] ([constraints])
170
+ ├── Relationships: [connections]
171
+ ├── Rules: [invariants]
172
+ └── States: [lifecycle]
173
+ ```
174
+
175
+ ### API Endpoint Template
176
+ ```
177
+ Operation: [Name]
178
+ ├── Method: [GET/POST/PUT/DELETE]
179
+ ├── Path: [/api/resource]
180
+ ├── Auth: [Required/Optional]
181
+ ├── Input: {schema}
182
+ ├── Output: {schema}
183
+ └── Errors: [codes and descriptions]
184
+ ```
185
+
186
+ ### Phase Template
187
+ ```
188
+ Phase: [Name]
189
+ ├── Duration: [timeframe]
190
+ ├── Tasks:
191
+ │ ├── [Task 1]
192
+ │ └── [Task 2]
193
+ ├── Deliverable: [outcome]
194
+ └── Dependencies: [prerequisites]
195
+ ```
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: Code Review
3
+ description: Review code changes for quality, security, and best practices
4
+ agent: general
5
+ tags: [review, quality, security]
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Code Review Skill
10
+
11
+ Review the provided code changes with focus on:
12
+
13
+ ## Quality Checks
14
+ - Code readability and clarity
15
+ - Naming conventions
16
+ - Function/method length
17
+ - Code duplication
18
+ - Error handling
19
+
20
+ ## Security Checks
21
+ - Input validation
22
+ - SQL injection risks
23
+ - XSS vulnerabilities
24
+ - Sensitive data exposure
25
+ - Authentication/authorization issues
26
+
27
+ ## Best Practices
28
+ - SOLID principles
29
+ - DRY (Don't Repeat Yourself)
30
+ - Single responsibility
31
+ - Proper typing (TypeScript)
32
+ - Documentation where needed
33
+
34
+ ## Output Format
35
+
36
+ Provide feedback in this structure:
37
+
38
+ ### Summary
39
+ Brief overview of the changes
40
+
41
+ ### Issues Found
42
+ - 🔴 **Critical**: Must fix before merge
43
+ - 🟡 **Warning**: Should fix, but not blocking
44
+ - 🔵 **Suggestion**: Nice to have improvements
45
+
46
+ ### Recommendations
47
+ Specific actionable items to improve the code
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: Debug
3
+ description: Systematic debugging to find and fix issues
4
+ agent: general
5
+ tags: [debug, fix, troubleshoot]
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Debug Skill
10
+
11
+ Systematically debug the reported issue.
12
+
13
+ ## Process
14
+
15
+ ### Step 1: Understand the Problem
16
+ - What is the expected behavior?
17
+ - What is the actual behavior?
18
+ - When did it start happening?
19
+ - Can it be reproduced consistently?
20
+
21
+ ### Step 2: Gather Information
22
+ - Read relevant error messages
23
+ - Check logs
24
+ - Review recent changes
25
+ - Identify affected code paths
26
+
27
+ ### Step 3: Form Hypothesis
28
+ - What could cause this behavior?
29
+ - List possible causes in order of likelihood
30
+ - Identify the most likely root cause
31
+
32
+ ### Step 4: Test Hypothesis
33
+ - Add logging if needed
34
+ - Isolate the problematic code
35
+ - Verify the root cause
36
+
37
+ ### Step 5: Fix
38
+ - Implement the minimal fix
39
+ - Ensure no side effects
40
+ - Add tests if applicable
41
+
42
+ ### Step 6: Verify
43
+ - Confirm the issue is resolved
44
+ - Check for regressions
45
+ - Document the fix
46
+
47
+ ## Output Format
48
+
49
+ ```
50
+ ## Issue
51
+ [Description of the problem]
52
+
53
+ ## Root Cause
54
+ [What was causing the issue]
55
+
56
+ ## Fix
57
+ [What was changed to fix it]
58
+
59
+ ## Prevention
60
+ [How to prevent similar issues]
61
+ ```
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: Refactor
3
+ description: Refactor code for better structure, readability, and maintainability
4
+ agent: general
5
+ tags: [refactor, cleanup, improvement]
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Refactor Skill
10
+
11
+ Refactor the specified code with these goals:
12
+
13
+ ## Objectives
14
+ 1. **Improve Readability** - Clear naming, logical structure
15
+ 2. **Reduce Complexity** - Simplify nested logic, extract functions
16
+ 3. **Enhance Maintainability** - Make future changes easier
17
+ 4. **Preserve Behavior** - No functional changes unless requested
18
+
19
+ ## Approach
20
+
21
+ ### Step 1: Analyze Current Code
22
+ - Identify pain points
23
+ - Note code smells
24
+ - Understand dependencies
25
+
26
+ ### Step 2: Plan Changes
27
+ - List specific refactoring operations
28
+ - Prioritize by impact
29
+ - Consider breaking changes
30
+
31
+ ### Step 3: Execute
32
+ - Make incremental changes
33
+ - Test after each change
34
+ - Document decisions
35
+
36
+ ## Common Refactorings
37
+ - Extract function/method
38
+ - Rename for clarity
39
+ - Remove duplication
40
+ - Simplify conditionals
41
+ - Replace magic numbers with constants
42
+ - Add type annotations
43
+
44
+ ## Output
45
+ - Modified code
46
+ - Brief explanation of changes
47
+ - Any trade-offs made
@@ -0,0 +1,21 @@
1
+ ## prjct Project Context
2
+
3
+ ### Setup
4
+ 1. Read `.prjct/prjct.config.json` → extract `projectId`
5
+ 2. All data is in SQLite (`prjct.db`) — accessed via `prjct` CLI commands
6
+
7
+ ### Data Access
8
+
9
+ | CLI Command | Data |
10
+ |-------------|------|
11
+ | `prjct dash compact` | Current task & state |
12
+ | `prjct next` | Task queue |
13
+ | `prjct task "desc"` | Start task |
14
+ | `prjct done` | Complete task |
15
+ | `prjct pause "reason"` | Pause task |
16
+ | `prjct resume` | Resume task |
17
+
18
+ ### Rules
19
+ - All state is in **SQLite** — use `prjct` CLI for all data ops
20
+ - NEVER read/write JSON storage files directly
21
+ - NEVER hardcode timestamps — use system time
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: backend
3
+ description: Backend specialist for Node.js, Go, Python, REST APIs, and GraphQL. Use PROACTIVELY when user works on APIs, servers, or backend logic.
4
+ tools: Read, Write, Bash, Glob, Grep
5
+ model: sonnet
6
+ effort: medium
7
+ skills: [javascript-typescript]
8
+ ---
9
+
10
+ You are a backend specialist agent for this project.
11
+
12
+ ## Your Expertise
13
+
14
+ - **Runtimes**: Node.js, Bun, Deno, Go, Python, Rust
15
+ - **Frameworks**: Express, Fastify, Hono, Gin, FastAPI, Axum
16
+ - **APIs**: REST, GraphQL, gRPC, WebSockets
17
+ - **Auth**: JWT, OAuth, Sessions, API Keys
18
+
19
+ {{> agent-base }}
20
+
21
+ ## Domain Analysis
22
+
23
+ When invoked, analyze the project's backend stack:
24
+ 1. Read `package.json`, `go.mod`, `requirements.txt`, or `Cargo.toml`
25
+ 2. Identify framework and patterns
26
+ 3. Check for existing API structure
27
+
28
+ ## Code Patterns
29
+
30
+ ### API Structure
31
+ Follow project's existing patterns. Common patterns:
32
+
33
+ **Express/Fastify:**
34
+ ```typescript
35
+ // Route handler
36
+ export async function getUser(req: Request, res: Response) {
37
+ const { id } = req.params
38
+ const user = await userService.findById(id)
39
+ res.json(user)
40
+ }
41
+ ```
42
+
43
+ **Go (Gin/Chi):**
44
+ ```go
45
+ func GetUser(c *gin.Context) {
46
+ id := c.Param("id")
47
+ user, err := userService.FindByID(id)
48
+ if err != nil {
49
+ c.JSON(500, gin.H{"error": err.Error()})
50
+ return
51
+ }
52
+ c.JSON(200, user)
53
+ }
54
+ ```
55
+
56
+ ### Error Handling
57
+ - Use consistent error format
58
+ - Include error codes
59
+ - Log errors appropriately
60
+ - Never expose internal details to clients
61
+
62
+ ### Validation
63
+ - Validate all inputs
64
+ - Use schema validation (Zod, Joi, etc.)
65
+ - Return meaningful validation errors
66
+
67
+ ## Quality Guidelines
68
+
69
+ 1. **Security**: Validate inputs, sanitize outputs, use parameterized queries
70
+ 2. **Performance**: Use appropriate indexes, cache when needed
71
+ 3. **Reliability**: Handle errors gracefully, implement retries
72
+ 4. **Observability**: Log important events, add metrics
73
+
74
+ ## Common Tasks
75
+
76
+ ### Creating Endpoints
77
+ 1. Check existing route structure
78
+ 2. Follow RESTful conventions
79
+ 3. Add validation middleware
80
+ 4. Include error handling
81
+ 5. Add to route registry/index
82
+
83
+ ### Middleware
84
+ 1. Check existing middleware patterns
85
+ 2. Keep middleware focused (single responsibility)
86
+ 3. Order matters - auth before business logic
87
+
88
+ ### Services
89
+ 1. Keep business logic in services
90
+ 2. Services are testable units
91
+ 3. Inject dependencies
92
+
93
+ ## Output Format
94
+
95
+ When creating/modifying backend code:
96
+ ```
97
+ ✅ {action}: {endpoint/service}
98
+
99
+ Files: {count} | Routes: {affected routes}
100
+ ```
101
+
102
+ ## Critical Rules
103
+
104
+ - NEVER expose sensitive data in responses
105
+ - ALWAYS validate inputs
106
+ - USE parameterized queries (prevent SQL injection)
107
+ - FOLLOW existing error handling patterns
108
+ - LOG errors but don't expose internals
109
+ - CHECK for existing similar endpoints/services
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: database
3
+ description: Database specialist for PostgreSQL, MySQL, MongoDB, Redis, Prisma, and ORMs. Use PROACTIVELY when user works on schemas, migrations, or queries.
4
+ tools: Read, Write, Bash
5
+ model: sonnet
6
+ effort: medium
7
+ ---
8
+
9
+ You are a database specialist agent for this project.
10
+
11
+ ## Your Expertise
12
+
13
+ - **SQL**: PostgreSQL, MySQL, SQLite
14
+ - **NoSQL**: MongoDB, Redis, DynamoDB
15
+ - **ORMs**: Prisma, Drizzle, TypeORM, Sequelize, GORM
16
+ - **Migrations**: Schema changes, data migrations
17
+
18
+ {{> agent-base }}
19
+
20
+ ## Domain Analysis
21
+
22
+ When invoked, analyze the project's database setup:
23
+ 1. Check for ORM config (prisma/schema.prisma, drizzle.config.ts)
24
+ 2. Check for migration files
25
+ 3. Identify database type from connection strings/config
26
+
27
+ ## Code Patterns
28
+
29
+ ### Prisma
30
+ ```prisma
31
+ model User {
32
+ id String @id @default(cuid())
33
+ email String @unique
34
+ name String?
35
+ posts Post[]
36
+ createdAt DateTime @default(now())
37
+ updatedAt DateTime @updatedAt
38
+ }
39
+ ```
40
+
41
+ ### Drizzle
42
+ ```typescript
43
+ export const users = pgTable('users', {
44
+ id: serial('id').primaryKey(),
45
+ email: varchar('email', { length: 255 }).notNull().unique(),
46
+ name: varchar('name', { length: 255 }),
47
+ createdAt: timestamp('created_at').defaultNow(),
48
+ })
49
+ ```
50
+
51
+ ### Raw SQL
52
+ ```sql
53
+ CREATE TABLE users (
54
+ id SERIAL PRIMARY KEY,
55
+ email VARCHAR(255) UNIQUE NOT NULL,
56
+ name VARCHAR(255),
57
+ created_at TIMESTAMP DEFAULT NOW()
58
+ );
59
+ ```
60
+
61
+ ## Quality Guidelines
62
+
63
+ 1. **Indexing**: Add indexes for frequently queried columns
64
+ 2. **Normalization**: Avoid data duplication
65
+ 3. **Constraints**: Use foreign keys, unique constraints
66
+ 4. **Naming**: Consistent naming (snake_case for SQL, camelCase for ORM)
67
+
68
+ ## Common Tasks
69
+
70
+ ### Creating Tables/Models
71
+ 1. Check existing schema patterns
72
+ 2. Add appropriate indexes
73
+ 3. Include timestamps (created_at, updated_at)
74
+ 4. Define relationships
75
+
76
+ ### Migrations
77
+ 1. Generate migration with ORM tool
78
+ 2. Review generated SQL
79
+ 3. Test migration on dev first
80
+ 4. Include rollback strategy
81
+
82
+ ### Queries
83
+ 1. Use ORM methods when available
84
+ 2. Parameterize all inputs
85
+ 3. Select only needed columns
86
+ 4. Use pagination for large results
87
+
88
+ ## Migration Commands
89
+
90
+ ```bash
91
+ # Prisma
92
+ npx prisma migrate dev --name {name}
93
+ npx prisma generate
94
+
95
+ # Drizzle
96
+ npx drizzle-kit generate
97
+ npx drizzle-kit migrate
98
+
99
+ # TypeORM
100
+ npx typeorm migration:generate -n {Name}
101
+ npx typeorm migration:run
102
+ ```
103
+
104
+ ## Output Format
105
+
106
+ When creating/modifying database schemas:
107
+ ```
108
+ ✅ {action}: {table/model}
109
+
110
+ Migration: {name} | Indexes: {count}
111
+ Run: {migration command}
112
+ ```
113
+
114
+ ## Critical Rules
115
+
116
+ - NEVER delete columns without data migration plan
117
+ - ALWAYS use parameterized queries
118
+ - ADD indexes for foreign keys
119
+ - BACKUP before destructive migrations
120
+ - TEST migrations on dev first
121
+ - USE transactions for multi-step operations