prjct-cli 1.45.4 → 1.45.6

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 (137) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/dist/bin/prjct-core.mjs +160 -160
  3. package/dist/cli/jira.mjs +1 -1
  4. package/dist/cli/linear.mjs +1 -1
  5. package/dist/daemon/entry.mjs +99 -99
  6. package/dist/templates.json +1 -1
  7. package/package.json +2 -1
  8. package/templates/agentic/agent-routing.md +45 -0
  9. package/templates/agentic/agents/uxui.md +63 -0
  10. package/templates/agentic/checklist-routing.md +98 -0
  11. package/templates/agentic/orchestrator.md +68 -0
  12. package/templates/agentic/task-fragmentation.md +89 -0
  13. package/templates/agents/AGENTS.md +67 -0
  14. package/templates/analysis/analyze.md +84 -0
  15. package/templates/analysis/patterns.md +60 -0
  16. package/templates/antigravity/SKILL.md +39 -0
  17. package/templates/architect/discovery.md +67 -0
  18. package/templates/architect/phases.md +59 -0
  19. package/templates/baseline/anti-patterns/nextjs.json +18 -0
  20. package/templates/baseline/anti-patterns/react.json +18 -0
  21. package/templates/baseline/anti-patterns/typescript.json +18 -0
  22. package/templates/baseline/patterns/nextjs.json +18 -0
  23. package/templates/baseline/patterns/react.json +18 -0
  24. package/templates/baseline/patterns/typescript.json +18 -0
  25. package/templates/checklists/architecture.md +28 -0
  26. package/templates/checklists/code-quality.md +28 -0
  27. package/templates/checklists/data.md +33 -0
  28. package/templates/checklists/documentation.md +33 -0
  29. package/templates/checklists/infrastructure.md +33 -0
  30. package/templates/checklists/performance.md +33 -0
  31. package/templates/checklists/security.md +33 -0
  32. package/templates/checklists/testing.md +33 -0
  33. package/templates/checklists/ux-ui.md +37 -0
  34. package/templates/codex/SKILL.md +36 -0
  35. package/templates/commands/analyze.md +11 -0
  36. package/templates/commands/auth.md +15 -0
  37. package/templates/commands/bug.md +28 -0
  38. package/templates/commands/cleanup.md +11 -0
  39. package/templates/commands/dash.md +16 -0
  40. package/templates/commands/design.md +11 -0
  41. package/templates/commands/done.md +33 -0
  42. package/templates/commands/enrich.md +20 -0
  43. package/templates/commands/git.md +17 -0
  44. package/templates/commands/history.md +13 -0
  45. package/templates/commands/idea.md +13 -0
  46. package/templates/commands/impact.md +13 -0
  47. package/templates/commands/init.md +11 -0
  48. package/templates/commands/jira.md +88 -0
  49. package/templates/commands/learnings.md +11 -0
  50. package/templates/commands/linear.md +82 -0
  51. package/templates/commands/merge.md +25 -0
  52. package/templates/commands/next.md +12 -0
  53. package/templates/commands/p.md +62 -0
  54. package/templates/commands/p.toml +37 -0
  55. package/templates/commands/pause.md +16 -0
  56. package/templates/commands/plan.md +13 -0
  57. package/templates/commands/prd.md +21 -0
  58. package/templates/commands/resume.md +12 -0
  59. package/templates/commands/review.md +20 -0
  60. package/templates/commands/serve.md +11 -0
  61. package/templates/commands/sessions.md +13 -0
  62. package/templates/commands/setup.md +11 -0
  63. package/templates/commands/ship.md +46 -0
  64. package/templates/commands/skill.md +13 -0
  65. package/templates/commands/spec.md +20 -0
  66. package/templates/commands/status.md +11 -0
  67. package/templates/commands/sync.md +23 -0
  68. package/templates/commands/task.md +52 -0
  69. package/templates/commands/test.md +22 -0
  70. package/templates/commands/update.md +11 -0
  71. package/templates/commands/verify.md +11 -0
  72. package/templates/commands/workflow.md +69 -0
  73. package/templates/config/skill-mappings.json +82 -0
  74. package/templates/context/dashboard.md +251 -0
  75. package/templates/context/roadmap.md +221 -0
  76. package/templates/cursor/commands/bug.md +8 -0
  77. package/templates/cursor/commands/done.md +4 -0
  78. package/templates/cursor/commands/pause.md +6 -0
  79. package/templates/cursor/commands/resume.md +4 -0
  80. package/templates/cursor/commands/ship.md +8 -0
  81. package/templates/cursor/commands/sync.md +4 -0
  82. package/templates/cursor/commands/task.md +8 -0
  83. package/templates/cursor/p.md +29 -0
  84. package/templates/cursor/router.mdc +28 -0
  85. package/templates/design/api.md +95 -0
  86. package/templates/design/architecture.md +77 -0
  87. package/templates/design/component.md +89 -0
  88. package/templates/design/database.md +78 -0
  89. package/templates/design/flow.md +94 -0
  90. package/templates/global/ANTIGRAVITY.md +17 -0
  91. package/templates/global/CLAUDE.md +20 -0
  92. package/templates/global/CURSOR.mdc +20 -0
  93. package/templates/global/GEMINI.md +17 -0
  94. package/templates/global/STORAGE-SPEC.md +328 -0
  95. package/templates/global/WINDSURF.md +22 -0
  96. package/templates/global/modules/CLAUDE-commands.md +1 -0
  97. package/templates/global/modules/CLAUDE-core.md +16 -0
  98. package/templates/global/modules/CLAUDE-git.md +1 -0
  99. package/templates/global/modules/CLAUDE-intelligence.md +1 -0
  100. package/templates/global/modules/CLAUDE-storage.md +1 -0
  101. package/templates/global/modules/module-config.json +12 -0
  102. package/templates/mcp-config.json +29 -0
  103. package/templates/permissions/default.jsonc +60 -0
  104. package/templates/permissions/permissive.jsonc +49 -0
  105. package/templates/permissions/strict.jsonc +58 -0
  106. package/templates/planning-methodology.md +195 -0
  107. package/templates/skills/code-review.md +47 -0
  108. package/templates/skills/debug.md +61 -0
  109. package/templates/skills/refactor.md +47 -0
  110. package/templates/subagents/agent-base.md +21 -0
  111. package/templates/subagents/domain/backend.md +109 -0
  112. package/templates/subagents/domain/database.md +121 -0
  113. package/templates/subagents/domain/devops.md +152 -0
  114. package/templates/subagents/domain/frontend.md +103 -0
  115. package/templates/subagents/domain/testing.md +169 -0
  116. package/templates/subagents/pm-expert.md +366 -0
  117. package/templates/subagents/workflow/chief-architect.md +653 -0
  118. package/templates/subagents/workflow/prjct-planner.md +120 -0
  119. package/templates/subagents/workflow/prjct-shipper.md +175 -0
  120. package/templates/subagents/workflow/prjct-workflow.md +82 -0
  121. package/templates/tools/bash.txt +22 -0
  122. package/templates/tools/edit.txt +18 -0
  123. package/templates/tools/glob.txt +19 -0
  124. package/templates/tools/grep.txt +21 -0
  125. package/templates/tools/read.txt +14 -0
  126. package/templates/tools/task.txt +20 -0
  127. package/templates/tools/webfetch.txt +16 -0
  128. package/templates/tools/websearch.txt +18 -0
  129. package/templates/tools/write.txt +17 -0
  130. package/templates/windsurf/router.md +28 -0
  131. package/templates/windsurf/workflows/bug.md +8 -0
  132. package/templates/windsurf/workflows/done.md +4 -0
  133. package/templates/windsurf/workflows/pause.md +4 -0
  134. package/templates/windsurf/workflows/resume.md +4 -0
  135. package/templates/windsurf/workflows/ship.md +8 -0
  136. package/templates/windsurf/workflows/sync.md +4 -0
  137. package/templates/windsurf/workflows/task.md +8 -0
@@ -0,0 +1,221 @@
1
+ ---
2
+ description: 'Template for generated roadmap context'
3
+ generated-by: 'p. plan, p. sync'
4
+ data-source: 'prjct.db (SQLite)'
5
+ ---
6
+
7
+ # Roadmap Context Template
8
+
9
+ This template defines the format for `{globalPath}/context/roadmap.md` generated by:
10
+ - `p. plan` - After quarter planning
11
+ - `p. sync` - After roadmap generation from git
12
+
13
+ ---
14
+
15
+ ## Template
16
+
17
+ ```markdown
18
+ # Roadmap
19
+
20
+ **Last Updated:** {lastUpdated}
21
+
22
+ ---
23
+
24
+ ## Strategy
25
+
26
+ **Goal:** {strategy.goal}
27
+
28
+ ### Phases
29
+ {FOR EACH phase in strategy.phases:}
30
+ - **{phase.id}**: {phase.name} ({phase.status})
31
+ {END FOR}
32
+
33
+ ### Success Metrics
34
+ {FOR EACH metric in strategy.successMetrics:}
35
+ - {metric}
36
+ {END FOR}
37
+
38
+ ---
39
+
40
+ ## Quarters
41
+
42
+ {FOR EACH quarter in quarters:}
43
+ ### {quarter.id}: {quarter.name}
44
+
45
+ **Status:** {quarter.status}
46
+ **Theme:** {quarter.theme}
47
+ **Capacity:** {capacity.allocatedHours}/{capacity.totalHours}h ({utilization}%)
48
+
49
+ #### Goals
50
+ {FOR EACH goal in quarter.goals:}
51
+ - {goal}
52
+ {END FOR}
53
+
54
+ #### Features
55
+ {FOR EACH featureId in quarter.features:}
56
+ - [{status icon}] **{feature.name}** ({feature.status}, {feature.progress}%)
57
+ - PRD: {feature.prdId || 'None (legacy)'}
58
+ - Estimated: {feature.effortTracking?.estimated?.hours || '?'}h
59
+ - Value Score: {feature.valueScore || 'N/A'}
60
+ - Dependencies: {feature.dependencies?.join(', ') || 'None'}
61
+ {END FOR}
62
+
63
+ {END FOR}
64
+
65
+ ---
66
+
67
+ ## Active Work
68
+
69
+ {FOR EACH feature WHERE status == 'active':}
70
+ ### {feature.name}
71
+
72
+ | Attribute | Value |
73
+ |-----------|-------|
74
+ | Progress | {feature.progress}% |
75
+ | Branch | {feature.branch || 'N/A'} |
76
+ | Quarter | {feature.quarter || 'Unassigned'} |
77
+ | PRD | {feature.prdId || 'Legacy (no PRD)'} |
78
+ | Started | {feature.createdAt} |
79
+
80
+ #### Tasks
81
+ {FOR EACH task in feature.tasks:}
82
+ - [{task.completed ? 'x' : ' '}] {task.description}
83
+ {END FOR}
84
+
85
+ {END FOR}
86
+
87
+ ---
88
+
89
+ ## Completed Features
90
+
91
+ {FOR EACH feature WHERE status == 'completed' OR status == 'shipped':}
92
+ - **{feature.name}** (v{feature.version || 'N/A'})
93
+ - Shipped: {feature.shippedAt || feature.completedDate}
94
+ - Actual: {feature.effortTracking?.actual?.hours || '?'}h vs Est: {feature.effortTracking?.estimated?.hours || '?'}h
95
+ {END FOR}
96
+
97
+ ---
98
+
99
+ ## Backlog
100
+
101
+ Priority-ordered list of unscheduled items:
102
+
103
+ | Priority | Item | Value | Effort | Score |
104
+ |----------|------|-------|--------|-------|
105
+ {FOR EACH item in backlog:}
106
+ | {rank} | {item.title} | {item.valueScore} | {item.effortEstimate}h | {priorityScore} |
107
+ {END FOR}
108
+
109
+ ---
110
+
111
+ ## Legacy Features
112
+
113
+ Features detected from git history (no PRD required):
114
+
115
+ {FOR EACH feature WHERE legacy == true:}
116
+ - **{feature.name}**
117
+ - Inferred From: {feature.inferredFrom}
118
+ - Status: {feature.status}
119
+ - Commits: {feature.commits?.length || 0}
120
+ {END FOR}
121
+
122
+ ---
123
+
124
+ ## Dependencies
125
+
126
+ ```
127
+ {FOR EACH feature WHERE dependencies?.length > 0:}
128
+ {feature.name}
129
+ {FOR EACH depId in feature.dependencies:}
130
+ └── {dependency.name}
131
+ {END FOR}
132
+ {END FOR}
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Metrics Summary
138
+
139
+ | Metric | Value |
140
+ |--------|-------|
141
+ | Total Features | {features.length} |
142
+ | Planned | {planned.length} |
143
+ | Active | {active.length} |
144
+ | Completed | {completed.length} |
145
+ | Shipped | {shipped.length} |
146
+ | Legacy | {legacy.length} |
147
+ | PRD-Backed | {prdBacked.length} |
148
+ | Backlog | {backlog.length} |
149
+
150
+ ### Capacity by Quarter
151
+
152
+ | Quarter | Allocated | Total | Utilization |
153
+ |---------|-----------|-------|-------------|
154
+ {FOR EACH quarter in quarters:}
155
+ | {quarter.id} | {capacity.allocatedHours}h | {capacity.totalHours}h | {utilization}% |
156
+ {END FOR}
157
+
158
+ ### Effort Accuracy (Shipped Features)
159
+
160
+ | Feature | Estimated | Actual | Variance |
161
+ |---------|-----------|--------|----------|
162
+ {FOR EACH feature WHERE status == 'shipped' AND effortTracking:}
163
+ | {feature.name} | {estimated.hours}h | {actual.hours}h | {variance}% |
164
+ {END FOR}
165
+
166
+ **Average Variance:** {averageVariance}%
167
+
168
+ ---
169
+
170
+ *Generated by prjct-cli | https://prjct.app*
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Status Icons
176
+
177
+ | Status | Icon |
178
+ |--------|------|
179
+ | planned | [ ] |
180
+ | active | [~] |
181
+ | completed | [x] |
182
+ | shipped | [+] |
183
+
184
+ ---
185
+
186
+ ## Variable Reference
187
+
188
+ | Variable | Source | Description |
189
+ |----------|--------|-------------|
190
+ | `lastUpdated` | roadmap.lastUpdated | ISO timestamp |
191
+ | `strategy` | roadmap.strategy | Strategy object |
192
+ | `quarters` | roadmap.quarters | Array of quarters |
193
+ | `features` | roadmap.features | Array of features |
194
+ | `backlog` | roadmap.backlog | Array of backlog items |
195
+ | `utilization` | Calculated | (allocated/total) * 100 |
196
+ | `priorityScore` | Calculated | valueScore / (effort/10) |
197
+
198
+ ---
199
+
200
+ ## Generation Rules
201
+
202
+ 1. **Quarters** - Show only `planned` and `active` quarters by default
203
+ 2. **Features** - Group by status (active first, then planned)
204
+ 3. **Backlog** - Sort by priority score (descending)
205
+ 4. **Legacy** - Always show separately to distinguish from PRD-backed
206
+ 5. **Dependencies** - Only show features with dependencies
207
+ 6. **Metrics** - Always include for dashboard views
208
+
209
+ ---
210
+
211
+ ## Integration with Linear/Jira/Monday
212
+
213
+ The context file maps to PM tool exports:
214
+
215
+ | Context Section | Linear | Jira | Monday |
216
+ |-----------------|--------|------|--------|
217
+ | Quarters | Cycles | Sprints | Timelines |
218
+ | Features | Issues | Stories | Items |
219
+ | Backlog | Backlog | Backlog | Inbox |
220
+ | Status | State | Status | Status |
221
+ | Capacity | Estimates | Story Points | Time |
@@ -0,0 +1,8 @@
1
+ # /bug - Report a bug
2
+
3
+ **ARGUMENTS**: {{args}}
4
+
5
+ Run `npm root -g` to get npm global root, then read and execute:
6
+ `{npmRoot}/prjct-cli/templates/commands/bug.md`
7
+
8
+ Pass the arguments as the bug description.
@@ -0,0 +1,4 @@
1
+ # /done - Complete current subtask
2
+
3
+ Run `npm root -g` to get npm global root, then read and execute:
4
+ `{npmRoot}/prjct-cli/templates/commands/done.md`
@@ -0,0 +1,6 @@
1
+ # /pause - Pause current task
2
+
3
+ **ARGUMENTS**: {{args}}
4
+
5
+ Run `npm root -g` to get npm global root, then read and execute:
6
+ `{npmRoot}/prjct-cli/templates/commands/pause.md`
@@ -0,0 +1,4 @@
1
+ # /resume - Resume paused task
2
+
3
+ Run `npm root -g` to get npm global root, then read and execute:
4
+ `{npmRoot}/prjct-cli/templates/commands/resume.md`
@@ -0,0 +1,8 @@
1
+ # /ship - Ship feature with PR + version bump
2
+
3
+ **ARGUMENTS**: {{args}}
4
+
5
+ Run `npm root -g` to get npm global root, then read and execute:
6
+ `{npmRoot}/prjct-cli/templates/commands/ship.md`
7
+
8
+ Pass the arguments as the feature name (optional).
@@ -0,0 +1,4 @@
1
+ # /sync - Analyze project
2
+
3
+ Run `npm root -g` to get npm global root, then read and execute:
4
+ `{npmRoot}/prjct-cli/templates/commands/sync.md`
@@ -0,0 +1,8 @@
1
+ # /task - Start a task
2
+
3
+ **ARGUMENTS**: {{args}}
4
+
5
+ Run `npm root -g` to get npm global root, then read and execute:
6
+ `{npmRoot}/prjct-cli/templates/commands/task.md`
7
+
8
+ Pass the arguments as the task description.
@@ -0,0 +1,29 @@
1
+ # p. Command Router for Cursor IDE
2
+
3
+ **ARGUMENTS**: {{args}}
4
+
5
+ ## Instructions
6
+
7
+ 1. **Get npm root**: Run `npm root -g`
8
+ 2. **Parse arguments**: First word = `command`, rest = `commandArgs`
9
+ 3. **Read template**: `{npmRoot}/prjct-cli/templates/commands/{command}.md`
10
+ 4. **Execute**: Follow the template with `commandArgs` as input
11
+
12
+ ## Example
13
+
14
+ If arguments = `task fix the login bug`:
15
+ - command = `task`
16
+ - commandArgs = `fix the login bug`
17
+ - npm root → `/opt/homebrew/lib/node_modules`
18
+ - Read: `/opt/homebrew/lib/node_modules/prjct-cli/templates/commands/task.md`
19
+ - Execute template with: `fix the login bug`
20
+
21
+ ## Available Commands
22
+
23
+ task, done, ship, sync, init, idea, dash, next, pause, resume, bug,
24
+ linear, github, jira, monday, enrich, feature, prd, plan, review,
25
+ merge, git, test, cleanup, design, analyze, history, update, spec
26
+
27
+ ## Action
28
+
29
+ NOW run `npm root -g` and read the appropriate command template.
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: "prjct - Context layer for AI coding agents"
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # prjct
7
+
8
+ You are using **prjct**, a context layer for AI coding agents.
9
+
10
+ ## Load Full Instructions
11
+
12
+ 1. Run: `npm root -g` to get the npm global root
13
+ 2. Read: `{npmRoot}/prjct-cli/templates/global/CURSOR.mdc`
14
+ 3. Follow those instructions for ALL `/command` requests
15
+
16
+ ## Quick Reference
17
+
18
+ | Command | Action |
19
+ |---------|--------|
20
+ | `/sync` | Analyze project, generate agents |
21
+ | `/task "..."` | Start a task |
22
+ | `/done` | Complete subtask |
23
+ | `/ship` | Ship with PR + version |
24
+
25
+ ## Note
26
+
27
+ This router auto-regenerates with `/sync` if deleted.
28
+ Full instructions are in the npm package (always up-to-date).
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: api-design
3
+ description: Design API endpoints and contracts
4
+ allowed-tools: [Read, Glob, Grep]
5
+ ---
6
+
7
+ # API Design
8
+
9
+ Design RESTful API endpoints for the given feature.
10
+
11
+ ## Input
12
+ - Target: {{target}}
13
+ - Requirements: {{requirements}}
14
+
15
+ ## Analysis Steps
16
+
17
+ 1. **Identify Resources**
18
+ - What entities are involved?
19
+ - What operations are needed?
20
+ - What relationships exist?
21
+
22
+ 2. **Review Existing APIs**
23
+ - Read existing route files
24
+ - Match naming conventions
25
+ - Use consistent patterns
26
+
27
+ 3. **Design Endpoints**
28
+ - RESTful resource naming
29
+ - Appropriate HTTP methods
30
+ - Request/response shapes
31
+
32
+ 4. **Define Validation**
33
+ - Input validation rules
34
+ - Error responses
35
+ - Edge cases
36
+
37
+ ## Output Format
38
+
39
+ ```markdown
40
+ # API Design: {target}
41
+
42
+ ## Endpoints
43
+
44
+ ### GET /api/{resource}
45
+ **Description**: List all resources
46
+
47
+ **Query Parameters**:
48
+ - `limit`: number (default: 20)
49
+ - `offset`: number (default: 0)
50
+
51
+ **Response** (200):
52
+ ```json
53
+ {
54
+ "data": [...],
55
+ "total": 100,
56
+ "limit": 20,
57
+ "offset": 0
58
+ }
59
+ ```
60
+
61
+ ### POST /api/{resource}
62
+ **Description**: Create resource
63
+
64
+ **Request Body**:
65
+ ```json
66
+ {
67
+ "field": "value"
68
+ }
69
+ ```
70
+
71
+ **Response** (201):
72
+ ```json
73
+ {
74
+ "id": "...",
75
+ "field": "value"
76
+ }
77
+ ```
78
+
79
+ **Errors**:
80
+ - 400: Invalid input
81
+ - 401: Unauthorized
82
+ - 409: Conflict
83
+
84
+ ## Authentication
85
+ - Method: Bearer token / API key
86
+ - Required for: POST, PUT, DELETE
87
+
88
+ ## Rate Limiting
89
+ - 100 requests/minute per user
90
+ ```
91
+
92
+ ## Guidelines
93
+ - Follow REST conventions
94
+ - Use consistent error format
95
+ - Document all parameters
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: architecture-design
3
+ description: Design system architecture
4
+ allowed-tools: [Read, Glob, Grep]
5
+ ---
6
+
7
+ # Architecture Design
8
+
9
+ Design the system architecture for the given requirements.
10
+
11
+ ## Input
12
+ - Target: {{target}}
13
+ - Requirements: {{requirements}}
14
+ - Project context
15
+
16
+ ## Analysis Steps
17
+
18
+ 1. **Understand Requirements**
19
+ - What problem are we solving?
20
+ - What are the constraints?
21
+ - What scale do we need?
22
+
23
+ 2. **Review Existing Architecture**
24
+ - Read current codebase structure
25
+ - Identify existing patterns
26
+ - Note integration points
27
+
28
+ 3. **Design Components**
29
+ - Core modules and responsibilities
30
+ - Data flow between components
31
+ - External dependencies
32
+
33
+ 4. **Define Interfaces**
34
+ - API contracts
35
+ - Data structures
36
+ - Event/message formats
37
+
38
+ ## Output Format
39
+
40
+ Generate markdown document:
41
+
42
+ ```markdown
43
+ # Architecture: {target}
44
+
45
+ ## Overview
46
+ Brief description of the architecture.
47
+
48
+ ## Components
49
+ - **Component A**: Responsibility
50
+ - **Component B**: Responsibility
51
+
52
+ ## Data Flow
53
+ ```
54
+ [Diagram using ASCII or mermaid]
55
+ ```
56
+
57
+ ## Interfaces
58
+ ### API Endpoints
59
+ - `GET /resource` - Description
60
+ - `POST /resource` - Description
61
+
62
+ ### Data Models
63
+ - `Model`: { field: type }
64
+
65
+ ## Dependencies
66
+ - External service X
67
+ - Library Y
68
+
69
+ ## Decisions
70
+ - Decision 1: Rationale
71
+ - Decision 2: Rationale
72
+ ```
73
+
74
+ ## Guidelines
75
+ - Match existing project patterns
76
+ - Keep it simple - avoid over-engineering
77
+ - Document decisions and trade-offs
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: component-design
3
+ description: Design UI/code component
4
+ allowed-tools: [Read, Glob, Grep]
5
+ ---
6
+
7
+ # Component Design
8
+
9
+ Design a reusable component for the given requirements.
10
+
11
+ ## Input
12
+ - Target: {{target}}
13
+ - Requirements: {{requirements}}
14
+
15
+ ## Analysis Steps
16
+
17
+ 1. **Understand Purpose**
18
+ - What does this component do?
19
+ - Where will it be used?
20
+ - What inputs/outputs?
21
+
22
+ 2. **Review Existing Components**
23
+ - Read similar components
24
+ - Match project patterns
25
+ - Use existing utilities
26
+
27
+ 3. **Design Interface**
28
+ - Props/parameters
29
+ - Events/callbacks
30
+ - State management
31
+
32
+ 4. **Plan Implementation**
33
+ - File structure
34
+ - Dependencies
35
+ - Testing approach
36
+
37
+ ## Output Format
38
+
39
+ ```markdown
40
+ # Component: {ComponentName}
41
+
42
+ ## Purpose
43
+ Brief description of what this component does.
44
+
45
+ ## Props/Interface
46
+ | Prop | Type | Required | Default | Description |
47
+ |------|------|----------|---------|-------------|
48
+ | id | string | yes | - | Unique identifier |
49
+ | onClick | function | no | - | Click handler |
50
+
51
+ ## State
52
+ - `isLoading`: boolean - Loading state
53
+ - `data`: array - Fetched data
54
+
55
+ ## Events
56
+ - `onChange(value)`: Fired when value changes
57
+ - `onSubmit(data)`: Fired on form submit
58
+
59
+ ## Usage Example
60
+ ```jsx
61
+ <ComponentName
62
+ id="example"
63
+ onClick={handleClick}
64
+ />
65
+ ```
66
+
67
+ ## File Structure
68
+ ```
69
+ components/
70
+ └── ComponentName/
71
+ ├── index.js
72
+ ├── ComponentName.jsx
73
+ ├── ComponentName.test.js
74
+ └── styles.css
75
+ ```
76
+
77
+ ## Dependencies
78
+ - Library X for Y
79
+ - Utility Z
80
+
81
+ ## Testing
82
+ - Unit tests for logic
83
+ - Integration test for interactions
84
+ ```
85
+
86
+ ## Guidelines
87
+ - Match project component patterns
88
+ - Keep components focused
89
+ - Document all props
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: database-design
3
+ description: Design database schema
4
+ allowed-tools: [Read, Glob, Grep]
5
+ ---
6
+
7
+ # Database Design
8
+
9
+ Design database schema for the given requirements.
10
+
11
+ ## Input
12
+ - Target: {{target}}
13
+ - Requirements: {{requirements}}
14
+
15
+ ## Analysis Steps
16
+
17
+ 1. **Identify Entities**
18
+ - What data needs to be stored?
19
+ - What are the relationships?
20
+ - What queries will be common?
21
+
22
+ 2. **Review Existing Schema**
23
+ - Read current models/migrations
24
+ - Match naming conventions
25
+ - Use consistent patterns
26
+
27
+ 3. **Design Tables/Collections**
28
+ - Fields and types
29
+ - Indexes for queries
30
+ - Constraints and defaults
31
+
32
+ 4. **Plan Migrations**
33
+ - Order of operations
34
+ - Data transformations
35
+ - Rollback strategy
36
+
37
+ ## Output Format
38
+
39
+ ```markdown
40
+ # Database Design: {target}
41
+
42
+ ## Entities
43
+
44
+ ### users
45
+ | Column | Type | Constraints | Description |
46
+ |--------|------|-------------|-------------|
47
+ | id | uuid | PK | Unique identifier |
48
+ | email | varchar(255) | UNIQUE, NOT NULL | User email |
49
+ | created_at | timestamp | NOT NULL, DEFAULT now() | Creation time |
50
+
51
+ ### posts
52
+ | Column | Type | Constraints | Description |
53
+ |--------|------|-------------|-------------|
54
+ | id | uuid | PK | Unique identifier |
55
+ | user_id | uuid | FK(users.id) | Author reference |
56
+ | title | varchar(255) | NOT NULL | Post title |
57
+
58
+ ## Relationships
59
+ - users 1:N posts (one user has many posts)
60
+
61
+ ## Indexes
62
+ - `users_email_idx` on users(email)
63
+ - `posts_user_id_idx` on posts(user_id)
64
+
65
+ ## Migrations
66
+ 1. Create users table
67
+ 2. Create posts table with FK
68
+ 3. Add indexes
69
+
70
+ ## Queries (common)
71
+ - Get user by email: `SELECT * FROM users WHERE email = ?`
72
+ - Get user posts: `SELECT * FROM posts WHERE user_id = ?`
73
+ ```
74
+
75
+ ## Guidelines
76
+ - Normalize appropriately
77
+ - Add indexes for common queries
78
+ - Document relationships clearly