pan-wizard 2.8.1
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/LICENSE +21 -0
- package/README.md +772 -0
- package/agents/pan-debugger.md +1246 -0
- package/agents/pan-document_code.md +965 -0
- package/agents/pan-executor.md +469 -0
- package/agents/pan-integration-checker.md +443 -0
- package/agents/pan-phase-researcher.md +572 -0
- package/agents/pan-plan-checker.md +763 -0
- package/agents/pan-planner.md +1297 -0
- package/agents/pan-project-researcher.md +647 -0
- package/agents/pan-research-synthesizer.md +239 -0
- package/agents/pan-reviewer.md +112 -0
- package/agents/pan-roadmapper.md +642 -0
- package/agents/pan-verifier.md +672 -0
- package/assets/pan-logo-2000-transparent.svg +30 -0
- package/assets/pan-logo-2000.svg +43 -0
- package/assets/terminal.svg +119 -0
- package/bin/install-lib.cjs +616 -0
- package/bin/install.js +1936 -0
- package/commands/pan/add-phase.md +44 -0
- package/commands/pan/assumptions.md +47 -0
- package/commands/pan/audit-deployment.md +378 -0
- package/commands/pan/debug.md +168 -0
- package/commands/pan/discord.md +19 -0
- package/commands/pan/discuss-phase.md +84 -0
- package/commands/pan/exec-phase.md +45 -0
- package/commands/pan/focus-auto.md +323 -0
- package/commands/pan/focus-design.md +816 -0
- package/commands/pan/focus-exec.md +316 -0
- package/commands/pan/focus-plan.md +101 -0
- package/commands/pan/focus-scan.md +272 -0
- package/commands/pan/focus-sync.md +104 -0
- package/commands/pan/health.md +23 -0
- package/commands/pan/help.md +23 -0
- package/commands/pan/insert-phase.md +33 -0
- package/commands/pan/map-codebase.md +72 -0
- package/commands/pan/milestone-audit.md +37 -0
- package/commands/pan/milestone-cleanup.md +19 -0
- package/commands/pan/milestone-done.md +137 -0
- package/commands/pan/milestone-gaps.md +35 -0
- package/commands/pan/milestone-new.md +45 -0
- package/commands/pan/new-project.md +43 -0
- package/commands/pan/patches.md +110 -0
- package/commands/pan/pause.md +39 -0
- package/commands/pan/phase-budget.md +23 -0
- package/commands/pan/phase-tests.md +42 -0
- package/commands/pan/plan-phase.md +46 -0
- package/commands/pan/profile.md +36 -0
- package/commands/pan/progress.md +25 -0
- package/commands/pan/quick.md +42 -0
- package/commands/pan/remove-phase.md +32 -0
- package/commands/pan/research-phase.md +190 -0
- package/commands/pan/resume.md +41 -0
- package/commands/pan/retro.md +33 -0
- package/commands/pan/settings.md +37 -0
- package/commands/pan/todo-add.md +48 -0
- package/commands/pan/todo-check.md +46 -0
- package/commands/pan/update.md +38 -0
- package/commands/pan/verify-phase.md +39 -0
- package/hooks/dist/pan-check-update.js +62 -0
- package/hooks/dist/pan-context-monitor.js +122 -0
- package/hooks/dist/pan-statusline.js +108 -0
- package/package.json +66 -0
- package/pan-wizard-core/bin/lib/codebase.cjs +746 -0
- package/pan-wizard-core/bin/lib/commands.cjs +1435 -0
- package/pan-wizard-core/bin/lib/config.cjs +611 -0
- package/pan-wizard-core/bin/lib/constants.cjs +696 -0
- package/pan-wizard-core/bin/lib/context-budget.cjs +150 -0
- package/pan-wizard-core/bin/lib/core.cjs +650 -0
- package/pan-wizard-core/bin/lib/focus.cjs +900 -0
- package/pan-wizard-core/bin/lib/frontmatter.cjs +442 -0
- package/pan-wizard-core/bin/lib/init.cjs +881 -0
- package/pan-wizard-core/bin/lib/milestone.cjs +276 -0
- package/pan-wizard-core/bin/lib/phase.cjs +1212 -0
- package/pan-wizard-core/bin/lib/roadmap.cjs +470 -0
- package/pan-wizard-core/bin/lib/state.cjs +1029 -0
- package/pan-wizard-core/bin/lib/template.cjs +314 -0
- package/pan-wizard-core/bin/lib/utils.cjs +171 -0
- package/pan-wizard-core/bin/lib/verify.cjs +1808 -0
- package/pan-wizard-core/bin/pan-tools.cjs +773 -0
- package/pan-wizard-core/references/checkpoints.md +776 -0
- package/pan-wizard-core/references/continuation-format.md +249 -0
- package/pan-wizard-core/references/decimal-phase-calculation.md +65 -0
- package/pan-wizard-core/references/git-integration.md +248 -0
- package/pan-wizard-core/references/git-planning-commit.md +38 -0
- package/pan-wizard-core/references/model-profile-resolution.md +34 -0
- package/pan-wizard-core/references/model-profiles.md +111 -0
- package/pan-wizard-core/references/phase-argument-parsing.md +61 -0
- package/pan-wizard-core/references/planning-config.md +196 -0
- package/pan-wizard-core/references/questioning.md +145 -0
- package/pan-wizard-core/references/tdd.md +263 -0
- package/pan-wizard-core/references/ui-brand.md +160 -0
- package/pan-wizard-core/references/verification-patterns.md +612 -0
- package/pan-wizard-core/templates/codebase/architecture.md +283 -0
- package/pan-wizard-core/templates/codebase/best-practices.md +133 -0
- package/pan-wizard-core/templates/codebase/concerns.md +325 -0
- package/pan-wizard-core/templates/codebase/conventions.md +307 -0
- package/pan-wizard-core/templates/codebase/integrations.md +305 -0
- package/pan-wizard-core/templates/codebase/relationships.md +124 -0
- package/pan-wizard-core/templates/codebase/stack.md +199 -0
- package/pan-wizard-core/templates/codebase/structure.md +298 -0
- package/pan-wizard-core/templates/codebase/testing.md +480 -0
- package/pan-wizard-core/templates/config.json +37 -0
- package/pan-wizard-core/templates/context.md +283 -0
- package/pan-wizard-core/templates/continue-here.md +78 -0
- package/pan-wizard-core/templates/debug-subagent-prompt.md +91 -0
- package/pan-wizard-core/templates/debug.md +164 -0
- package/pan-wizard-core/templates/discovery.md +146 -0
- package/pan-wizard-core/templates/milestone-archive.md +123 -0
- package/pan-wizard-core/templates/milestone.md +115 -0
- package/pan-wizard-core/templates/phase-prompt.md +593 -0
- package/pan-wizard-core/templates/planner-subagent-prompt.md +117 -0
- package/pan-wizard-core/templates/project.md +184 -0
- package/pan-wizard-core/templates/requirements.md +231 -0
- package/pan-wizard-core/templates/research-project/architecture.md +204 -0
- package/pan-wizard-core/templates/research-project/features.md +147 -0
- package/pan-wizard-core/templates/research-project/pitfalls.md +200 -0
- package/pan-wizard-core/templates/research-project/stack.md +120 -0
- package/pan-wizard-core/templates/research-project/summary.md +170 -0
- package/pan-wizard-core/templates/research.md +552 -0
- package/pan-wizard-core/templates/retrospective.md +54 -0
- package/pan-wizard-core/templates/roadmap.md +202 -0
- package/pan-wizard-core/templates/standards.md +24 -0
- package/pan-wizard-core/templates/state.md +176 -0
- package/pan-wizard-core/templates/summary-complex.md +59 -0
- package/pan-wizard-core/templates/summary-minimal.md +41 -0
- package/pan-wizard-core/templates/summary-standard.md +49 -0
- package/pan-wizard-core/templates/summary.md +249 -0
- package/pan-wizard-core/templates/uat.md +247 -0
- package/pan-wizard-core/templates/user-setup.md +311 -0
- package/pan-wizard-core/templates/validation.md +76 -0
- package/pan-wizard-core/templates/verification-report.md +322 -0
- package/pan-wizard-core/workflows/add-phase.md +111 -0
- package/pan-wizard-core/workflows/assumptions.md +178 -0
- package/pan-wizard-core/workflows/diagnose-issues.md +219 -0
- package/pan-wizard-core/workflows/discuss-phase.md +542 -0
- package/pan-wizard-core/workflows/exec-phase.md +572 -0
- package/pan-wizard-core/workflows/execute-plan.md +448 -0
- package/pan-wizard-core/workflows/health.md +156 -0
- package/pan-wizard-core/workflows/help.md +431 -0
- package/pan-wizard-core/workflows/insert-phase.md +129 -0
- package/pan-wizard-core/workflows/map-codebase.md +401 -0
- package/pan-wizard-core/workflows/milestone-audit.md +297 -0
- package/pan-wizard-core/workflows/milestone-cleanup.md +152 -0
- package/pan-wizard-core/workflows/milestone-gaps.md +274 -0
- package/pan-wizard-core/workflows/milestone-new.md +382 -0
- package/pan-wizard-core/workflows/new-project.md +1178 -0
- package/pan-wizard-core/workflows/pause.md +122 -0
- package/pan-wizard-core/workflows/phase-tests.md +388 -0
- package/pan-wizard-core/workflows/plan-phase.md +569 -0
- package/pan-wizard-core/workflows/profile.md +115 -0
- package/pan-wizard-core/workflows/progress.md +381 -0
- package/pan-wizard-core/workflows/quick.md +453 -0
- package/pan-wizard-core/workflows/remove-phase.md +154 -0
- package/pan-wizard-core/workflows/research-phase.md +73 -0
- package/pan-wizard-core/workflows/resume-project.md +306 -0
- package/pan-wizard-core/workflows/retro.md +121 -0
- package/pan-wizard-core/workflows/settings.md +213 -0
- package/pan-wizard-core/workflows/todo-add.md +157 -0
- package/pan-wizard-core/workflows/todo-check.md +176 -0
- package/pan-wizard-core/workflows/transition.md +544 -0
- package/pan-wizard-core/workflows/update.md +219 -0
- package/pan-wizard-core/workflows/verify-phase.md +301 -0
- package/scripts/build-hooks.js +43 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# Architecture Template
|
|
2
|
+
|
|
3
|
+
Template for `.planning/codebase/ARCHITECTURE.md` - captures conceptual code organization.
|
|
4
|
+
|
|
5
|
+
**Purpose:** Document how the code is organized at a conceptual level. Complements STRUCTURE.md (which shows physical file locations).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## File Template
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
# Architecture
|
|
13
|
+
|
|
14
|
+
**Analysis Date:** [YYYY-MM-DD]
|
|
15
|
+
|
|
16
|
+
## Business Architecture
|
|
17
|
+
|
|
18
|
+
[What the system does — capabilities, user-facing processes, business value]
|
|
19
|
+
|
|
20
|
+
**Purpose:** [What problem the system solves]
|
|
21
|
+
|
|
22
|
+
**Key Capabilities:**
|
|
23
|
+
- [Capability 1]
|
|
24
|
+
- [Capability 2]
|
|
25
|
+
- [Capability 3]
|
|
26
|
+
|
|
27
|
+
## Application Architecture
|
|
28
|
+
|
|
29
|
+
### Pattern Overview
|
|
30
|
+
|
|
31
|
+
**Overall:** [Pattern name: e.g., "Monolithic CLI", "Serverless API", "Full-stack MVC"]
|
|
32
|
+
|
|
33
|
+
**Key Characteristics:**
|
|
34
|
+
- [Characteristic 1: e.g., "Single executable"]
|
|
35
|
+
- [Characteristic 2: e.g., "Stateless request handling"]
|
|
36
|
+
- [Characteristic 3: e.g., "Event-driven"]
|
|
37
|
+
|
|
38
|
+
### Component Relationships
|
|
39
|
+
|
|
40
|
+
[Mermaid flowchart showing how major components relate to each other]
|
|
41
|
+
|
|
42
|
+
```mermaid
|
|
43
|
+
graph LR
|
|
44
|
+
EntryPoint[Entry Point] --> Router[Router/Dispatcher]
|
|
45
|
+
Router --> ServiceA[Service A]
|
|
46
|
+
Router --> ServiceB[Service B]
|
|
47
|
+
ServiceA --> Core[Core/Shared]
|
|
48
|
+
ServiceB --> Core
|
|
49
|
+
Core --> Utils[Utilities]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Layers
|
|
53
|
+
|
|
54
|
+
**[Layer Name]:**
|
|
55
|
+
- Purpose: [What this layer does]
|
|
56
|
+
- Contains: [Types of code: e.g., "route handlers", "business logic"]
|
|
57
|
+
- Depends on: [What it uses: e.g., "data layer only"]
|
|
58
|
+
- Used by: [What uses it: e.g., "API routes"]
|
|
59
|
+
|
|
60
|
+
**[Layer Name]:**
|
|
61
|
+
- Purpose: [What this layer does]
|
|
62
|
+
- Contains: [Types of code]
|
|
63
|
+
- Depends on: [What it uses]
|
|
64
|
+
- Used by: [What uses it]
|
|
65
|
+
|
|
66
|
+
### Request Lifecycle
|
|
67
|
+
|
|
68
|
+
[Mermaid sequence diagram showing the primary data flow]
|
|
69
|
+
|
|
70
|
+
```mermaid
|
|
71
|
+
sequenceDiagram
|
|
72
|
+
participant U as User
|
|
73
|
+
participant E as Entry Point
|
|
74
|
+
participant R as Router
|
|
75
|
+
participant S as Service
|
|
76
|
+
participant D as Data Layer
|
|
77
|
+
U->>E: Input
|
|
78
|
+
E->>R: Route request
|
|
79
|
+
R->>S: Invoke handler
|
|
80
|
+
S->>D: Read/write data
|
|
81
|
+
D-->>S: Result
|
|
82
|
+
S-->>R: Response
|
|
83
|
+
R-->>E: Output
|
|
84
|
+
E-->>U: Display result
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Data Flow
|
|
88
|
+
|
|
89
|
+
**[Flow Name] (e.g., "HTTP Request", "CLI Command", "Event Processing"):**
|
|
90
|
+
|
|
91
|
+
1. [Entry point: e.g., "User runs command"]
|
|
92
|
+
2. [Processing step: e.g., "Router matches path"]
|
|
93
|
+
3. [Processing step: e.g., "Controller validates input"]
|
|
94
|
+
4. [Processing step: e.g., "Service executes logic"]
|
|
95
|
+
5. [Output: e.g., "Response returned"]
|
|
96
|
+
|
|
97
|
+
**State Management:**
|
|
98
|
+
- [How state is handled: e.g., "Stateless - no persistent state", "Database per request", "In-memory cache"]
|
|
99
|
+
|
|
100
|
+
### Key Abstractions
|
|
101
|
+
|
|
102
|
+
**[Abstraction Name]:**
|
|
103
|
+
- Purpose: [What it represents]
|
|
104
|
+
- Examples: [e.g., "UserService, ProjectService"]
|
|
105
|
+
- Pattern: [e.g., "Singleton", "Factory", "Repository"]
|
|
106
|
+
|
|
107
|
+
### Entry Points
|
|
108
|
+
|
|
109
|
+
**[Entry Point]:**
|
|
110
|
+
- Location: [Brief: e.g., "src/index.ts", "API Gateway triggers"]
|
|
111
|
+
- Triggers: [What invokes it: e.g., "CLI invocation", "HTTP request"]
|
|
112
|
+
- Responsibilities: [What it does: e.g., "Parse args, route to command"]
|
|
113
|
+
|
|
114
|
+
### Error Handling
|
|
115
|
+
|
|
116
|
+
**Strategy:** [How errors are handled]
|
|
117
|
+
|
|
118
|
+
**Patterns:**
|
|
119
|
+
- [Pattern: e.g., "try/catch at controller level"]
|
|
120
|
+
- [Pattern: e.g., "Error codes returned to user"]
|
|
121
|
+
|
|
122
|
+
### Cross-Cutting Concerns
|
|
123
|
+
|
|
124
|
+
**Logging:** [Approach]
|
|
125
|
+
**Validation:** [Approach]
|
|
126
|
+
**Authentication:** [Approach]
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
*Architecture analysis: [date]*
|
|
131
|
+
*Update when major patterns change*
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
<good_examples>
|
|
135
|
+
```markdown
|
|
136
|
+
# Architecture
|
|
137
|
+
|
|
138
|
+
**Analysis Date:** 2025-01-20
|
|
139
|
+
|
|
140
|
+
## Pattern Overview
|
|
141
|
+
|
|
142
|
+
**Overall:** CLI Application with Plugin System
|
|
143
|
+
|
|
144
|
+
**Key Characteristics:**
|
|
145
|
+
- Single executable with subcommands
|
|
146
|
+
- Plugin-based extensibility
|
|
147
|
+
- File-based state (no database)
|
|
148
|
+
- Synchronous execution model
|
|
149
|
+
|
|
150
|
+
## Layers
|
|
151
|
+
|
|
152
|
+
**Command Layer:**
|
|
153
|
+
- Purpose: Parse user input and route to appropriate handler
|
|
154
|
+
- Contains: Command definitions, argument parsing, help text
|
|
155
|
+
- Location: `src/commands/*.ts`
|
|
156
|
+
- Depends on: Service layer for business logic
|
|
157
|
+
- Used by: CLI entry point (`src/index.ts`)
|
|
158
|
+
|
|
159
|
+
**Service Layer:**
|
|
160
|
+
- Purpose: Core business logic
|
|
161
|
+
- Contains: FileService, TemplateService, InstallService
|
|
162
|
+
- Location: `src/services/*.ts`
|
|
163
|
+
- Depends on: File system utilities, external tools
|
|
164
|
+
- Used by: Command handlers
|
|
165
|
+
|
|
166
|
+
**Utility Layer:**
|
|
167
|
+
- Purpose: Shared helpers and abstractions
|
|
168
|
+
- Contains: File I/O wrappers, path resolution, string formatting
|
|
169
|
+
- Location: `src/utils/*.ts`
|
|
170
|
+
- Depends on: Node.js built-ins only
|
|
171
|
+
- Used by: Service layer
|
|
172
|
+
|
|
173
|
+
## Data Flow
|
|
174
|
+
|
|
175
|
+
**CLI Command Execution:**
|
|
176
|
+
|
|
177
|
+
1. User runs: `pan new-project`
|
|
178
|
+
2. Commander parses args and flags
|
|
179
|
+
3. Command handler invoked (`src/commands/new-project.ts`)
|
|
180
|
+
4. Handler calls service methods (`src/services/project.ts` → `create()`)
|
|
181
|
+
5. Service reads templates, processes files, writes output
|
|
182
|
+
6. Results logged to console
|
|
183
|
+
7. Process exits with status code
|
|
184
|
+
|
|
185
|
+
**State Management:**
|
|
186
|
+
- File-based: All state lives in `.planning/` directory
|
|
187
|
+
- No persistent in-memory state
|
|
188
|
+
- Each command execution is independent
|
|
189
|
+
|
|
190
|
+
## Key Abstractions
|
|
191
|
+
|
|
192
|
+
**Service:**
|
|
193
|
+
- Purpose: Encapsulate business logic for a domain
|
|
194
|
+
- Examples: `src/services/file.ts`, `src/services/template.ts`, `src/services/project.ts`
|
|
195
|
+
- Pattern: Singleton-like (imported as modules, not instantiated)
|
|
196
|
+
|
|
197
|
+
**Command:**
|
|
198
|
+
- Purpose: CLI command definition
|
|
199
|
+
- Examples: `src/commands/new-project.ts`, `src/commands/plan-phase.ts`
|
|
200
|
+
- Pattern: Commander.js command registration
|
|
201
|
+
|
|
202
|
+
**Template:**
|
|
203
|
+
- Purpose: Reusable document structures
|
|
204
|
+
- Examples: project.md, plan.md templates
|
|
205
|
+
- Pattern: Markdown files with substitution variables
|
|
206
|
+
|
|
207
|
+
## Entry Points
|
|
208
|
+
|
|
209
|
+
**CLI Entry:**
|
|
210
|
+
- Location: `src/index.ts`
|
|
211
|
+
- Triggers: User runs `pan <command>`
|
|
212
|
+
- Responsibilities: Register commands, parse args, display help
|
|
213
|
+
|
|
214
|
+
**Commands:**
|
|
215
|
+
- Location: `src/commands/*.ts`
|
|
216
|
+
- Triggers: Matched command from CLI
|
|
217
|
+
- Responsibilities: Validate input, call services, format output
|
|
218
|
+
|
|
219
|
+
## Error Handling
|
|
220
|
+
|
|
221
|
+
**Strategy:** Throw exceptions, catch at command level, log and exit
|
|
222
|
+
|
|
223
|
+
**Patterns:**
|
|
224
|
+
- Services throw Error with descriptive messages
|
|
225
|
+
- Command handlers catch, log error to stderr, exit(1)
|
|
226
|
+
- Validation errors shown before execution (fail fast)
|
|
227
|
+
|
|
228
|
+
## Cross-Cutting Concerns
|
|
229
|
+
|
|
230
|
+
**Logging:**
|
|
231
|
+
- Console.log for normal output
|
|
232
|
+
- Console.error for errors
|
|
233
|
+
- Chalk for colored output
|
|
234
|
+
|
|
235
|
+
**Validation:**
|
|
236
|
+
- Zod schemas for config file parsing
|
|
237
|
+
- Manual validation in command handlers
|
|
238
|
+
- Fail fast on invalid input
|
|
239
|
+
|
|
240
|
+
**File Operations:**
|
|
241
|
+
- FileService abstraction over fs-extra
|
|
242
|
+
- All paths validated before operations
|
|
243
|
+
- Atomic writes (temp file + rename)
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
*Architecture analysis: 2025-01-20*
|
|
248
|
+
*Update when major patterns change*
|
|
249
|
+
```
|
|
250
|
+
</good_examples>
|
|
251
|
+
|
|
252
|
+
<guidelines>
|
|
253
|
+
**What belongs in ARCHITECTURE.md:**
|
|
254
|
+
- Overall architectural pattern (monolith, microservices, layered, etc.)
|
|
255
|
+
- Conceptual layers and their relationships
|
|
256
|
+
- Data flow / request lifecycle
|
|
257
|
+
- Key abstractions and patterns
|
|
258
|
+
- Entry points
|
|
259
|
+
- Error handling strategy
|
|
260
|
+
- Cross-cutting concerns (logging, auth, validation)
|
|
261
|
+
|
|
262
|
+
**What does NOT belong here:**
|
|
263
|
+
- Exhaustive file listings (that's STRUCTURE.md)
|
|
264
|
+
- Technology choices (that's STACK.md)
|
|
265
|
+
- Line-by-line code walkthrough (defer to code reading)
|
|
266
|
+
- Implementation details of specific features
|
|
267
|
+
|
|
268
|
+
**File paths ARE welcome:**
|
|
269
|
+
Include file paths as concrete examples of abstractions. Use backtick formatting: `src/services/user.ts`. This makes the architecture document actionable for Claude when planning.
|
|
270
|
+
|
|
271
|
+
**When filling this template:**
|
|
272
|
+
- Read main entry points (index, server, main)
|
|
273
|
+
- Identify layers by reading imports/dependencies
|
|
274
|
+
- Trace a typical request/command execution
|
|
275
|
+
- Note recurring patterns (services, controllers, repositories)
|
|
276
|
+
- Keep descriptions conceptual, not mechanical
|
|
277
|
+
|
|
278
|
+
**Useful for phase planning when:**
|
|
279
|
+
- Adding new features (where does it fit in the layers?)
|
|
280
|
+
- Refactoring (understanding current patterns)
|
|
281
|
+
- Identifying where to add code (which layer handles X?)
|
|
282
|
+
- Understanding dependencies between components
|
|
283
|
+
</guidelines>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Best Practices Template
|
|
2
|
+
|
|
3
|
+
Template for `.planning/codebase/best-practices.md` - assesses coding practices across categories.
|
|
4
|
+
|
|
5
|
+
**Purpose:** Score and document which best practices the codebase follows, with prescriptive recommendations for improvement.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## File Template
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
# Best Practices Assessment
|
|
13
|
+
|
|
14
|
+
**Analysis Date:** [YYYY-MM-DD]
|
|
15
|
+
**Overall Score:** [N]/10
|
|
16
|
+
|
|
17
|
+
## Score Summary
|
|
18
|
+
|
|
19
|
+
| Category | Score | Status |
|
|
20
|
+
|----------|-------|--------|
|
|
21
|
+
| Error Handling | [N]/10 | [Good/Needs Work/Critical] |
|
|
22
|
+
| Testing | [N]/10 | [Good/Needs Work/Critical] |
|
|
23
|
+
| Naming Conventions | [N]/10 | [Good/Needs Work/Critical] |
|
|
24
|
+
| Security | [N]/10 | [Good/Needs Work/Critical] |
|
|
25
|
+
| Performance | [N]/10 | [Good/Needs Work/Critical] |
|
|
26
|
+
|
|
27
|
+
## Error Handling ([N]/10)
|
|
28
|
+
|
|
29
|
+
**Detected patterns:**
|
|
30
|
+
- [Pattern description with percentage or count]
|
|
31
|
+
- [Example: "try-catch in async functions: 85% coverage"]
|
|
32
|
+
|
|
33
|
+
**Code examples:**
|
|
34
|
+
```[language]
|
|
35
|
+
// Pattern found in `[file path]`
|
|
36
|
+
[Show actual pattern from codebase]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Recommendations:**
|
|
40
|
+
- [Specific, actionable recommendation with file path]
|
|
41
|
+
|
|
42
|
+
## Testing ([N]/10)
|
|
43
|
+
|
|
44
|
+
**Detected patterns:**
|
|
45
|
+
- [Test framework and runner]
|
|
46
|
+
- [Test file count and location]
|
|
47
|
+
- [Coverage configuration status]
|
|
48
|
+
- [Test types present: unit, integration, e2e]
|
|
49
|
+
|
|
50
|
+
**Recommendations:**
|
|
51
|
+
- [Specific, actionable recommendation]
|
|
52
|
+
|
|
53
|
+
## Naming Conventions ([N]/10)
|
|
54
|
+
|
|
55
|
+
**Detected patterns:**
|
|
56
|
+
- Files: [Pattern observed — kebab-case, camelCase, PascalCase, snake_case]
|
|
57
|
+
- Functions: [Pattern observed]
|
|
58
|
+
- Variables: [Pattern observed]
|
|
59
|
+
- Constants: [Pattern observed]
|
|
60
|
+
|
|
61
|
+
**Violations:**
|
|
62
|
+
- `[file path]` — [What's wrong and what it should be]
|
|
63
|
+
|
|
64
|
+
**Recommendations:**
|
|
65
|
+
- [Standardization suggestion]
|
|
66
|
+
|
|
67
|
+
## Security ([N]/10)
|
|
68
|
+
|
|
69
|
+
**Detected patterns:**
|
|
70
|
+
- [.env handling]
|
|
71
|
+
- [Secret management]
|
|
72
|
+
- [Input validation approach]
|
|
73
|
+
- [Dependency security]
|
|
74
|
+
|
|
75
|
+
**Recommendations:**
|
|
76
|
+
- [Specific security improvement with file path]
|
|
77
|
+
|
|
78
|
+
## Performance ([N]/10)
|
|
79
|
+
|
|
80
|
+
**Detected patterns:**
|
|
81
|
+
- [Memoization usage]
|
|
82
|
+
- [Lazy loading patterns]
|
|
83
|
+
- [Bundle optimization]
|
|
84
|
+
- [Caching strategies]
|
|
85
|
+
|
|
86
|
+
**Recommendations:**
|
|
87
|
+
- [Specific performance improvement with file path]
|
|
88
|
+
|
|
89
|
+
## Priority Actions
|
|
90
|
+
|
|
91
|
+
Top 3 improvements ranked by impact:
|
|
92
|
+
|
|
93
|
+
1. **[Category]:** [Action] — Impact: [High/Medium]
|
|
94
|
+
2. **[Category]:** [Action] — Impact: [High/Medium]
|
|
95
|
+
3. **[Category]:** [Action] — Impact: [High/Medium]
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
*Best practices assessment: [date]*
|
|
100
|
+
*Update after significant codebase changes*
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
<guidelines>
|
|
104
|
+
**What belongs in best-practices.md:**
|
|
105
|
+
- Scored assessment across 5 categories (0-10 each)
|
|
106
|
+
- Detected patterns with evidence (file paths, counts, percentages)
|
|
107
|
+
- Code examples showing actual patterns found
|
|
108
|
+
- Specific, actionable recommendations
|
|
109
|
+
- Priority actions ranked by impact
|
|
110
|
+
|
|
111
|
+
**What does NOT belong here:**
|
|
112
|
+
- Detailed code style rules (that's CONVENTIONS.md)
|
|
113
|
+
- Bug reports (that's CONCERNS.md)
|
|
114
|
+
- Architecture decisions (that's ARCHITECTURE.md)
|
|
115
|
+
|
|
116
|
+
**Scoring guide:**
|
|
117
|
+
- 9-10: Excellent — consistent, well-established practices
|
|
118
|
+
- 7-8: Good — mostly consistent with minor gaps
|
|
119
|
+
- 5-6: Needs Work — inconsistent or missing in areas
|
|
120
|
+
- 3-4: Poor — significant gaps
|
|
121
|
+
- 0-2: Critical — practices largely absent
|
|
122
|
+
|
|
123
|
+
**Status thresholds:**
|
|
124
|
+
- Good: score >= 7
|
|
125
|
+
- Needs Work: score 4-6
|
|
126
|
+
- Critical: score <= 3
|
|
127
|
+
|
|
128
|
+
**When filling this template:**
|
|
129
|
+
- Use pre-computed best-practices data if provided in the prompt
|
|
130
|
+
- Always include file paths as evidence
|
|
131
|
+
- Recommendations must be specific ("Add try-catch to X") not vague ("Improve error handling")
|
|
132
|
+
- Priority actions should be the highest-impact, lowest-effort improvements
|
|
133
|
+
</guidelines>
|