@dedesfr/prompter 0.9.0 → 1.1.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.
Files changed (225) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +105 -77
  3. package/dist/cli/index.js +25 -1
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +35 -9
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/login.d.ts +4 -0
  9. package/dist/commands/login.d.ts.map +1 -0
  10. package/dist/commands/login.js +56 -0
  11. package/dist/commands/login.js.map +1 -0
  12. package/dist/commands/logout.d.ts +4 -0
  13. package/dist/commands/logout.d.ts.map +1 -0
  14. package/dist/commands/logout.js +14 -0
  15. package/dist/commands/logout.js.map +1 -0
  16. package/dist/commands/update.d.ts +0 -2
  17. package/dist/commands/update.d.ts.map +1 -1
  18. package/dist/commands/update.js +19 -48
  19. package/dist/commands/update.js.map +1 -1
  20. package/dist/commands/whoami.d.ts +4 -0
  21. package/dist/commands/whoami.d.ts.map +1 -0
  22. package/dist/commands/whoami.js +42 -0
  23. package/dist/commands/whoami.js.map +1 -0
  24. package/dist/core/auth-store.d.ts +10 -0
  25. package/dist/core/auth-store.d.ts.map +1 -0
  26. package/dist/core/auth-store.js +39 -0
  27. package/dist/core/auth-store.js.map +1 -0
  28. package/dist/core/config.d.ts +0 -7
  29. package/dist/core/config.d.ts.map +1 -1
  30. package/dist/core/config.js +0 -128
  31. package/dist/core/config.js.map +1 -1
  32. package/dist/core/registry.d.ts +18 -0
  33. package/dist/core/registry.d.ts.map +1 -0
  34. package/dist/core/registry.js +94 -0
  35. package/dist/core/registry.js.map +1 -0
  36. package/package.json +7 -1
  37. package/AGENTS.md +0 -123
  38. package/CLAUDE.md +0 -17
  39. package/build.js +0 -20
  40. package/convex-setup.md +0 -403
  41. package/dist/core/prompt-templates.d.ts +0 -23
  42. package/dist/core/prompt-templates.d.ts.map +0 -1
  43. package/dist/core/prompt-templates.js +0 -3485
  44. package/dist/core/prompt-templates.js.map +0 -1
  45. package/prompt/ai-humanizer.md +0 -45
  46. package/prompt/api-contract-generator.md +0 -234
  47. package/prompt/apply.md +0 -17
  48. package/prompt/archive.md +0 -21
  49. package/prompt/design-system.md +0 -210
  50. package/prompt/document-explainer.md +0 -149
  51. package/prompt/epic-generator.md +0 -198
  52. package/prompt/epic-single.md +0 -47
  53. package/prompt/erd-generator.md +0 -130
  54. package/prompt/fsd-generator.md +0 -157
  55. package/prompt/prd-agent-generator.md +0 -147
  56. package/prompt/prd-generator.md +0 -195
  57. package/prompt/product-brief.md +0 -289
  58. package/prompt/proposal.md +0 -22
  59. package/prompt/qa-test-scenario.md +0 -133
  60. package/prompt/skill-creator.md +0 -350
  61. package/prompt/story-generator.md +0 -278
  62. package/prompt/story-single.md +0 -70
  63. package/prompt/tdd-generator.md +0 -294
  64. package/prompt/tdd-lite-generator.md +0 -224
  65. package/prompt/wireframe-generator.md +0 -219
  66. package/skills/ai-context-generator/SKILL.md +0 -54
  67. package/skills/ai-context-generator/references/AGENTS.template.md +0 -83
  68. package/skills/ai-context-generator/references/CLAUDE.template.md +0 -39
  69. package/skills/ai-context-generator/references/behavioral-guidelines.md +0 -71
  70. package/skills/ai-context-generator/references/discovery-checklist.md +0 -40
  71. package/skills/ai-context-generator/references/examples/AGENTS.good.md +0 -103
  72. package/skills/ai-context-generator/references/extraction-checklist.md +0 -23
  73. package/skills/ai-context-generator/references/overlays/laravel.md +0 -44
  74. package/skills/ai-humanizer/SKILL.md +0 -50
  75. package/skills/api-contract-generator/SKILL.md +0 -243
  76. package/skills/apply/SKILL.md +0 -23
  77. package/skills/archive/SKILL.md +0 -27
  78. package/skills/cerebro/SKILL.md +0 -187
  79. package/skills/cerebro/references/agents.md +0 -213
  80. package/skills/code-review/SKILL.md +0 -373
  81. package/skills/code-review/assets/report-template-agent.md +0 -212
  82. package/skills/code-review/assets/report-template-compact.md +0 -81
  83. package/skills/code-review/assets/report-template-full.md +0 -264
  84. package/skills/code-review/assets/report-template-human.md +0 -168
  85. package/skills/code-review/references/universal-patterns.md +0 -495
  86. package/skills/design-md/README.md +0 -34
  87. package/skills/design-md/SKILL.md +0 -172
  88. package/skills/design-md/examples/DESIGN.md +0 -154
  89. package/skills/design-system/SKILL.md +0 -216
  90. package/skills/design-system-generator/SKILL.md +0 -324
  91. package/skills/design-system-generator/assets/design-system-template.md +0 -348
  92. package/skills/design-system-generator/references/extraction-patterns.md +0 -321
  93. package/skills/doc-builder/SKILL.md +0 -115
  94. package/skills/doc-builder/references/ui-patterns.md +0 -394
  95. package/skills/document-explainer/SKILL.md +0 -155
  96. package/skills/document-translator/SKILL.md +0 -58
  97. package/skills/enhance/SKILL.md +0 -47
  98. package/skills/enhance-prompt/README.md +0 -34
  99. package/skills/enhance-prompt/SKILL.md +0 -204
  100. package/skills/enhance-prompt/references/KEYWORDS.md +0 -114
  101. package/skills/epic-generator/SKILL.md +0 -204
  102. package/skills/epic-single/SKILL.md +0 -63
  103. package/skills/erd-generator/SKILL.md +0 -138
  104. package/skills/feature-planner/SKILL.md +0 -305
  105. package/skills/feature-planner/assets/implementation-plan-template.md +0 -85
  106. package/skills/frontend-design/LICENSE.txt +0 -177
  107. package/skills/frontend-design/SKILL.md +0 -42
  108. package/skills/fsd-generator/SKILL.md +0 -163
  109. package/skills/gamma-builder/SKILL.md +0 -134
  110. package/skills/laravel-code-review/SKILL.md +0 -383
  111. package/skills/laravel-code-review/assets/report-template-agent.md +0 -195
  112. package/skills/laravel-code-review/assets/report-template-compact.md +0 -79
  113. package/skills/laravel-code-review/assets/report-template-full.md +0 -253
  114. package/skills/laravel-code-review/assets/report-template-human.md +0 -159
  115. package/skills/laravel-code-review/references/laravel-patterns.md +0 -571
  116. package/skills/laravel-code-review/references/php84-features.md +0 -442
  117. package/skills/mcp-builder/LICENSE.txt +0 -202
  118. package/skills/mcp-builder/SKILL.md +0 -236
  119. package/skills/mcp-builder/reference/evaluation.md +0 -602
  120. package/skills/mcp-builder/reference/mcp_best_practices.md +0 -249
  121. package/skills/mcp-builder/reference/node_mcp_server.md +0 -970
  122. package/skills/mcp-builder/reference/python_mcp_server.md +0 -719
  123. package/skills/mcp-builder/scripts/connections.py +0 -151
  124. package/skills/mcp-builder/scripts/evaluation.py +0 -373
  125. package/skills/mcp-builder/scripts/example_evaluation.xml +0 -22
  126. package/skills/mcp-builder/scripts/requirements.txt +0 -2
  127. package/skills/meeting-notes/SKILL.md +0 -159
  128. package/skills/meeting-notes/evals/evals.json +0 -23
  129. package/skills/prd-agent-generator/SKILL.md +0 -132
  130. package/skills/prd-generator/SKILL.md +0 -211
  131. package/skills/product-brief/SKILL.md +0 -141
  132. package/skills/project-orchestrator/SKILL.md +0 -487
  133. package/skills/project-orchestrator/assets/caddy-vps-setup.md +0 -180
  134. package/skills/project-orchestrator/assets/plan-summary-template.md +0 -159
  135. package/skills/prompter-specs/SKILL.md +0 -115
  136. package/skills/prompter-workflow/SKILL.md +0 -166
  137. package/skills/prompter-workflow/evals/evals.json +0 -89
  138. package/skills/proposal/SKILL.md +0 -28
  139. package/skills/qa-test-scenario/SKILL.md +0 -149
  140. package/skills/skill-creator/SKILL.md +0 -173
  141. package/skills/sph-generator/SKILL.md +0 -488
  142. package/skills/story-generator/SKILL.md +0 -285
  143. package/skills/story-single/SKILL.md +0 -86
  144. package/skills/tdd-generator/SKILL.md +0 -300
  145. package/skills/tdd-lite-generator/SKILL.md +0 -230
  146. package/skills/ui-ux-pro/SKILL.md +0 -199
  147. package/skills/ui-ux-pro/assets/design-spec-template.md +0 -173
  148. package/skills/ui-ux-pro/references/component-patterns.md +0 -255
  149. package/skills/ui-ux-pro/references/design-principles.md +0 -167
  150. package/skills/wireframe-generator/SKILL.md +0 -227
  151. package/src/cli/index.ts +0 -223
  152. package/src/commands/archive.ts +0 -302
  153. package/src/commands/change.ts +0 -292
  154. package/src/commands/config.ts +0 -233
  155. package/src/commands/guide.ts +0 -50
  156. package/src/commands/init.ts +0 -597
  157. package/src/commands/list.ts +0 -194
  158. package/src/commands/show.ts +0 -138
  159. package/src/commands/spec.ts +0 -251
  160. package/src/commands/update.ts +0 -129
  161. package/src/commands/upgrade.ts +0 -30
  162. package/src/commands/validate.ts +0 -326
  163. package/src/core/artifact-graph/graph.ts +0 -167
  164. package/src/core/artifact-graph/index.ts +0 -44
  165. package/src/core/artifact-graph/instruction-loader.ts +0 -302
  166. package/src/core/artifact-graph/resolver.ts +0 -226
  167. package/src/core/artifact-graph/schema.ts +0 -124
  168. package/src/core/artifact-graph/state.ts +0 -64
  169. package/src/core/artifact-graph/types.ts +0 -65
  170. package/src/core/completions/command-registry.ts +0 -382
  171. package/src/core/completions/completion-provider.ts +0 -128
  172. package/src/core/completions/generators/bash-generator.ts +0 -191
  173. package/src/core/completions/generators/fish-generator.ts +0 -188
  174. package/src/core/completions/generators/powershell-generator.ts +0 -223
  175. package/src/core/completions/generators/zsh-generator.ts +0 -281
  176. package/src/core/completions/templates/bash-templates.ts +0 -24
  177. package/src/core/completions/templates/fish-templates.ts +0 -40
  178. package/src/core/completions/templates/powershell-templates.ts +0 -25
  179. package/src/core/completions/templates/zsh-templates.ts +0 -36
  180. package/src/core/completions/types.ts +0 -90
  181. package/src/core/config-schema.ts +0 -230
  182. package/src/core/config.ts +0 -181
  183. package/src/core/configurators/slash/antigravity.ts +0 -10
  184. package/src/core/configurators/slash/base.ts +0 -109
  185. package/src/core/configurators/slash/claude.ts +0 -10
  186. package/src/core/configurators/slash/codex.ts +0 -10
  187. package/src/core/configurators/slash/droid.ts +0 -10
  188. package/src/core/configurators/slash/forge.ts +0 -10
  189. package/src/core/configurators/slash/github-copilot.ts +0 -10
  190. package/src/core/configurators/slash/index.ts +0 -10
  191. package/src/core/configurators/slash/kilocode.ts +0 -10
  192. package/src/core/configurators/slash/opencode.ts +0 -10
  193. package/src/core/configurators/slash/registry.ts +0 -51
  194. package/src/core/converters/json-converter.ts +0 -62
  195. package/src/core/global-config.ts +0 -136
  196. package/src/core/parsers/change-parser.ts +0 -234
  197. package/src/core/parsers/markdown-parser.ts +0 -237
  198. package/src/core/parsers/requirement-blocks.ts +0 -234
  199. package/src/core/prompt-templates.ts +0 -3504
  200. package/src/core/schemas/base.schema.ts +0 -20
  201. package/src/core/schemas/change.schema.ts +0 -42
  202. package/src/core/schemas/index.ts +0 -20
  203. package/src/core/schemas/spec.schema.ts +0 -17
  204. package/src/core/skill-discovery.ts +0 -68
  205. package/src/core/specs-apply.ts +0 -483
  206. package/src/core/styles/palette.ts +0 -8
  207. package/src/core/templates/agents-template.ts +0 -459
  208. package/src/core/templates/claude-template.ts +0 -2
  209. package/src/core/templates/index.ts +0 -3
  210. package/src/core/templates/project-template.ts +0 -32
  211. package/src/core/validation/constants.ts +0 -48
  212. package/src/core/validation/types.ts +0 -19
  213. package/src/core/validation/validator.ts +0 -449
  214. package/src/core/view.ts +0 -219
  215. package/src/index.ts +0 -1
  216. package/src/utils/change-metadata.ts +0 -171
  217. package/src/utils/change-utils.ts +0 -131
  218. package/src/utils/file-system.ts +0 -252
  219. package/src/utils/index.ts +0 -12
  220. package/src/utils/interactive.ts +0 -29
  221. package/src/utils/item-discovery.ts +0 -66
  222. package/src/utils/match.ts +0 -26
  223. package/src/utils/shell-detection.ts +0 -62
  224. package/src/utils/task-progress.ts +0 -43
  225. package/tsconfig.json +0 -28
@@ -1,383 +0,0 @@
1
- ---
2
- name: laravel-code-review
3
- description: Perform static code review on git staged files for Laravel 12 + PHP 8.4 projects. Identifies Laravel-specific issues like N+1 queries, missing validation, security vulnerabilities, Eloquent anti-patterns, and PHP 8.4 best practices. Outputs structured Markdown report to test-hunter/ folder. Use when reviewing Laravel code before commit, or with /laravel-code-review command.
4
- ---
5
-
6
- # Laravel 12 + PHP 8.4 Code Review
7
-
8
- Perform specialized static analysis on staged git files for Laravel 12 projects running PHP 8.4.
9
-
10
- ## Quick Start
11
-
12
- 1. **ASK USER** which review style to use (Strict/Balanced/Lenient) - Balanced is default
13
- 2. **ASK USER** which report format to use (Full/Human/Compact/Agent)
14
- 3. Get staged files: `git diff --cached --name-only`
15
- 4. Analyze each file based on selected review style and focus areas
16
- 5. Generate report using selected format to `test-hunter/laravel-issues-<timestamp>.md`
17
-
18
- ---
19
-
20
- ## Step 0a: Ask User for Review Style (REQUIRED)
21
-
22
- **IMPORTANT:** Before proceeding with any analysis, you MUST ask the user which review style they prefer.
23
-
24
- Present the following options to the user:
25
-
26
- ```
27
- Which review style would you like? (Default: Balanced)
28
-
29
- 1. **Strict** 🔒
30
- Flag all potential issues, prioritize quality and security
31
-
32
- Focus Areas:
33
- ✅ Security vulnerabilities (SQL injection, XSS, mass assignment, etc.)
34
- ✅ Performance issues (N+1 queries, missing indexes, inefficient loops)
35
- ✅ Bug detection (Logic errors, edge cases, runtime errors)
36
- ✅ Code style (PSR-12, naming conventions, Laravel conventions)
37
- ✅ Test coverage (Missing or inadequate tests)
38
- ✅ Documentation (Missing PHPDoc, unclear APIs)
39
-
40
- 2. **Balanced** ⚖️ (Default)
41
- Focus on high-confidence issues, balance thoroughness with practicality
42
-
43
- Focus Areas:
44
- ✅ Security vulnerabilities (SQL injection, XSS, mass assignment, etc.)
45
- ✅ Performance issues (N+1 queries, missing indexes, inefficient loops)
46
- ✅ Bug detection (Logic errors, edge cases, runtime errors)
47
- ⚪ Code style (Only major violations)
48
- ⚪ Test coverage (Critical paths only)
49
- ❌ Documentation
50
-
51
- 3. **Lenient** 💚
52
- Only critical bugs and security issues, be encouraging
53
-
54
- Focus Areas:
55
- ✅ Security vulnerabilities (Critical only)
56
- ⚪ Performance issues (Severe bottlenecks only)
57
- ✅ Bug detection (Critical bugs only)
58
- ❌ Code style
59
- ❌ Test coverage
60
- ❌ Documentation
61
-
62
- Please select (1-3) or type the style name, or press Enter for Balanced:
63
- ```
64
-
65
- **Wait for user response before continuing. If no response or Enter, use Balanced.**
66
-
67
- ### Review Style to Focus Areas Mapping
68
-
69
- | Focus Area | Strict | Balanced | Lenient |
70
- | ---------------------------- | ---------- | ---------------- | ------------------ |
71
- | **Security vulnerabilities** | All issues | All issues | Critical only |
72
- | **Performance issues** | All issues | All issues | Severe bottlenecks |
73
- | **Bug detection** | All issues | High confidence | Critical only |
74
- | **Code style** | All issues | Major violations | ❌ Skip |
75
- | **Test coverage** | All issues | Critical paths | ❌ Skip |
76
- | **Documentation** | All issues | ❌ Skip | ❌ Skip |
77
-
78
- ### Severity Threshold by Style
79
-
80
- | Style | Report Threshold | Tone |
81
- | -------- | --------------------- | ----------------------- |
82
- | Strict | All severities (🔴🟠🟡🔵) | Direct, thorough |
83
- | Balanced | Warning+ (🔴🟠🟡) | Constructive, practical |
84
- | Lenient | Critical only (🔴) | Encouraging, supportive |
85
-
86
- ---
87
-
88
- ## Step 0b: Ask User for Report Format (REQUIRED)
89
-
90
- Present the following options to the user:
91
-
92
- ```
93
- Which report format would you like for the code review?
94
-
95
- 1. **Full** - Complete detailed analysis (~200-300 lines per file)
96
- - All issue details with code snippets
97
- - Suggested fixes with full code examples
98
- - Machine-readable JSON blocks
99
- - Component-based organization
100
-
101
- 2. **Human** - Optimized for readability (~50-80 lines per file)
102
- - Clean, scannable format
103
- - Grouped by severity with clear headers
104
- - Brief descriptions with line references
105
- - Quick action items
106
-
107
- 3. **Compact** - Condensed summary (~15-25 lines per file)
108
- - One-line per issue format
109
- - Essential info only: file, line, severity, issue
110
- - Summary statistics
111
- - Ideal for quick reviews
112
-
113
- 4. **Agent** - Machine-readable for AI tools (~30-50 lines per file)
114
- - Task-based checklist format
115
- - Structured for automated processing
116
- - Executable tasks with status tracking
117
- - Ideal for CI/CD integration
118
-
119
- Please select (1-4) or type the format name:
120
- ```
121
-
122
- **Wait for user response before continuing.**
123
-
124
- ---
125
-
126
- ## Workflow
127
-
128
- ### Step 1: Retrieve Staged Files
129
-
130
- ```bash
131
- git diff --cached --name-only
132
- ```
133
-
134
- Filter for relevant file types:
135
- - `*.php` - PHP source files
136
- - `*.blade.php` - Blade templates
137
- - `routes/*.php` - Route definitions
138
- - `config/*.php` - Configuration files
139
- - `database/migrations/*.php` - Migrations
140
- - `database/factories/*.php` - Factories
141
- - `database/seeders/*.php` - Seeders
142
-
143
- ### Step 2: Categorize Files
144
-
145
- Group files by Laravel component:
146
- - **Controllers** - `app/Http/Controllers/`
147
- - **Models** - `app/Models/`
148
- - **Services** - `app/Services/`
149
- - **Repositories** - `app/Repositories/`
150
- - **Requests** - `app/Http/Requests/`
151
- - **Resources** - `app/Http/Resources/`
152
- - **Middleware** - `app/Http/Middleware/`
153
- - **Commands** - `app/Console/Commands/`
154
- - **Jobs** - `app/Jobs/`
155
- - **Events/Listeners** - `app/Events/`, `app/Listeners/`
156
- - **Policies** - `app/Policies/`
157
- - **Rules** - `app/Rules/`
158
- - **Views** - `resources/views/`
159
- - **Routes** - `routes/`
160
- - **Migrations** - `database/migrations/`
161
- - **Config** - `config/`
162
- - **Tests** - `tests/` (review only, no execution)
163
-
164
- ### Step 3: Analyze Each File
165
-
166
- **Apply Review Style Filter:** Based on the user's selected review style, filter issues according to the mapping table in Step 0a.
167
-
168
- | Review Style | Include These Severities | Focus On |
169
- | ------------ | ------------------------ | --------------------------------------------- |
170
- | **Strict** | 🔴🟠🟡🔵 All | All focus areas, flag everything |
171
- | **Balanced** | 🔴🟠🟡 Warning+ | Security, Performance, Bugs, Major code style |
172
- | **Lenient** | 🔴 Critical only | Security vulnerabilities, Critical bugs |
173
-
174
- Review for these Laravel/PHP 8.4 specific issues (filtered by review style):
175
-
176
- #### 🔴 Critical Issues
177
-
178
- **Security Vulnerabilities:**
179
- - Mass assignment without `$fillable` or `$guarded`
180
- - Raw SQL queries without parameter binding
181
- - Missing CSRF protection
182
- - Unvalidated user input
183
- - Exposed sensitive data in responses
184
- - Hardcoded credentials/secrets
185
- - Missing authorization checks
186
- - XSS in Blade (unescaped `{!! !!}` with user data)
187
-
188
- **Runtime Errors:**
189
- - Missing model relationships
190
- - Undefined route names
191
- - Missing middleware
192
- - Invalid dependency injection
193
- - Missing return types (PHP 8.4 strict)
194
-
195
- #### 🟠 Warning Issues
196
-
197
- **Eloquent Anti-patterns:**
198
- - N+1 query problems (missing `with()`, `load()`)
199
- - Using `get()` when `first()` or `find()` is appropriate
200
- - Missing `select()` for large queries
201
- - Chunking not used for large datasets
202
- - Missing indexes on frequently queried columns
203
-
204
- **Laravel Convention Violations:**
205
- - Fat controllers (logic should be in services)
206
- - Missing Form Request validation
207
- - Direct `$request->all()` usage
208
- - Missing API Resources for responses
209
- - Improper exception handling
210
-
211
- **PHP 8.4 Deprecations:**
212
- - Implicit nullable parameters
213
- - Dynamic properties on classes
214
- - `${var}` string interpolation (use `{$var}`)
215
-
216
- #### 🟡 Optimization Issues
217
-
218
- **Performance:**
219
- - Eager loading missing
220
- - Caching not utilized
221
- - Queue not used for heavy operations
222
- - Missing database indexes
223
- - Inefficient collection operations
224
-
225
- **Query Optimization:**
226
- - `whereIn()` with large arrays
227
- - Missing `limit()` on queries
228
- - `pluck()` after `get()` (use direct `pluck()`)
229
- - `count()` after `get()` (use `count()` query)
230
-
231
- #### 🔵 Code Quality Issues
232
-
233
- **PHP 8.4 Best Practices:**
234
- - Missing constructor property promotion
235
- - Not using named arguments where beneficial
236
- - Missing `readonly` properties
237
- - Not using `match` expression
238
- - Missing union/intersection types
239
- - Not using `#[Override]` attribute
240
-
241
- **Laravel 12 Standards:**
242
- - Missing method return types
243
- - Incorrect PHPDoc annotations
244
- - Not using Invokable controllers for single-action
245
- - Missing enum for status constants
246
- - Not using Laravel Pint formatting
247
-
248
- ### Step 4: Generate Report
249
-
250
- ```bash
251
- mkdir -p test-hunter
252
- ```
253
-
254
- Filename: `laravel-issues-YYYY-MM-DD-HHMMSS.md`
255
-
256
- ### Step 5: Write Report
257
-
258
- Use structured format with Laravel-specific context:
259
-
260
- ```markdown
261
- # Laravel Code Review Report
262
-
263
- **Generated:** <timestamp>
264
- **Review Style:** <Strict|Balanced|Lenient>
265
- **Laravel Version:** 12.x
266
- **PHP Version:** 8.4
267
- **Reviewed Files:** <count>
268
- **Total Issues:** <count>
269
-
270
- ---
271
-
272
- ## Summary
273
-
274
- | Severity | Count |
275
- | -------------- | ----- |
276
- | 🔴 Critical | X |
277
- | 🟠 Warning | X |
278
- | 🟡 Optimization | X |
279
- | 🔵 Code Quality | X |
280
-
281
- ---
282
-
283
- ## Issues by Component
284
-
285
- ### Controllers
286
-
287
- #### `App\Http\Controllers\UserController`
288
-
289
- ##### Issue 1: N+1 Query Problem
290
-
291
- | Attribute | Value |
292
- | ------------ | ----------------------------------------- |
293
- | **Severity** | 🟠 Warning |
294
- | **Line** | 25 |
295
- | **Type** | Eloquent Anti-pattern |
296
- | **File** | `app/Http/Controllers/UserController.php` |
297
-
298
- **Description:**
299
- Loading users without eager loading their posts causes N+1 queries.
300
-
301
- **Code:**
302
- ```php
303
- // Line 25
304
- $users = User::all();
305
- foreach ($users as $user) {
306
- echo $user->posts->count(); // N+1!
307
- }
308
- ```
309
-
310
- **Recommendation:**
311
- Use eager loading to prevent N+1 queries.
312
-
313
- **Suggested Fix:**
314
- ```php
315
- $users = User::with('posts')->get();
316
- foreach ($users as $user) {
317
- echo $user->posts->count();
318
- }
319
- ```
320
-
321
- **Laravel Docs:** [Eager Loading](https://laravel.com/docs/12.x/eloquent-relationships#eager-loading)
322
-
323
- ---
324
-
325
- <!-- MACHINE_READABLE_START
326
- {
327
- "file": "app/Http/Controllers/UserController.php",
328
- "line": 25,
329
- "severity": "warning",
330
- "type": "eloquent-antipattern",
331
- "category": "n-plus-one",
332
- "description": "N+1 query problem",
333
- "recommendation": "Use eager loading with with()",
334
- "laravel_docs": "eloquent-relationships#eager-loading"
335
- }
336
- MACHINE_READABLE_END -->
337
- ```
338
-
339
- ## Issue Categories Reference
340
-
341
- ### Security
342
- - `mass-assignment` - Missing $fillable/$guarded
343
- - `sql-injection` - Raw queries without binding
344
- - `xss` - Unescaped output
345
- - `csrf` - Missing CSRF protection
346
- - `authorization` - Missing policy/gate checks
347
-
348
- ### Eloquent
349
- - `n-plus-one` - Missing eager loading
350
- - `inefficient-query` - Suboptimal query patterns
351
- - `missing-relationship` - Undefined relationships
352
- - `mass-assignment` - Unsafe mass assignment
353
-
354
- ### PHP 8.4
355
- - `deprecation` - Using deprecated features
356
- - `type-safety` - Missing type declarations
357
- - `modern-syntax` - Not using modern PHP features
358
-
359
- ### Laravel Conventions
360
- - `fat-controller` - Too much logic in controller
361
- - `validation` - Missing or improper validation
362
- - `resource` - Missing API Resource
363
- - `naming` - Convention violations
364
-
365
- ## Output Location
366
-
367
- Save to: `<project-root>/test-hunter/laravel-issues-<timestamp>.md`
368
-
369
- ## Report Format Templates
370
-
371
- Based on user selection, use the appropriate template:
372
-
373
- | Format | Template File | Use Case |
374
- | ------- | ----------------------------------- | -------------------------- |
375
- | Full | `assets/report-template-full.md` | Comprehensive review |
376
- | Human | `assets/report-template-human.md` | Developer-friendly reading |
377
- | Compact | `assets/report-template-compact.md` | Quick summary |
378
- | Agent | `assets/report-template-agent.md` | CI/CD & AI integration |
379
-
380
- ## Resources
381
-
382
- - See `references/laravel-patterns.md` for detailed patterns
383
- - See `references/php84-features.md` for PHP 8.4 features
@@ -1,195 +0,0 @@
1
- # Laravel Code Review — Agent Task List
2
-
3
- > Executable task list for AI agents. Process each task sequentially, marking as complete when done.
4
-
5
- ## Review Summary
6
-
7
- | Attribute | Value |
8
- | ------------------ | ------------------------------------ |
9
- | **Generated** | {{TIMESTAMP}} |
10
- | **Review Style** | {{REVIEW_STYLE}} |
11
- | **Framework** | Laravel 12.x |
12
- | **PHP Version** | 8.4 |
13
- | **Files Reviewed** | {{FILE_COUNT}} |
14
- | **Total Tasks** | {{TASK_COUNT}} |
15
- | **Completed** | {{COMPLETED_COUNT}} / {{TASK_COUNT}} |
16
-
17
- ### Task Statistics
18
-
19
- | Priority | Total | Remaining | Completed |
20
- | -------------- | ---------------------- | -------------------------- | -------------------------- |
21
- | 🔴 Critical | {{CRITICAL_COUNT}} | {{CRITICAL_REMAINING}} | {{CRITICAL_COMPLETED}} |
22
- | 🟠 Warning | {{WARNING_COUNT}} | {{WARNING_REMAINING}} | {{WARNING_COMPLETED}} |
23
- | 🟡 Optimization | {{OPTIMIZATION_COUNT}} | {{OPTIMIZATION_REMAINING}} | {{OPTIMIZATION_COMPLETED}} |
24
- | 🔵 Quality | {{QUALITY_COUNT}} | {{QUALITY_REMAINING}} | {{QUALITY_COMPLETED}} |
25
-
26
- ### Categories
27
-
28
- | Category | Count |
29
- | ----------- | --------------------- |
30
- | Security | {{SECURITY_COUNT}} |
31
- | Eloquent | {{ELOQUENT_COUNT}} |
32
- | PHP 8.4 | {{PHP84_COUNT}} |
33
- | Conventions | {{CONVENTIONS_COUNT}} |
34
-
35
- ---
36
-
37
- ## Pending Tasks
38
-
39
- > Execute these tasks in order. Check the box `[x]` when completed.
40
-
41
- ### 🔴 Critical Tasks (Execute First)
42
-
43
- {{#each critical_tasks}}
44
- - [ ] **TASK-{{task_id}}** | `{{file}}:{{line}}` | {{component}}
45
- - **Issue:** {{title}}
46
- - **Category:** {{category}}
47
- - **Action:** {{action_verb}}
48
- - **Target Code:**
49
- ```php
50
- {{target_code}}
51
- ```
52
- - **Replace With:**
53
- ```php
54
- {{replacement_code}}
55
- ```
56
- - **Docs:** [{{laravel_docs_label}}]({{laravel_docs_url}})
57
-
58
- {{/each}}
59
-
60
- ### 🟠 Warning Tasks
61
-
62
- {{#each warning_tasks}}
63
- - [ ] **TASK-{{task_id}}** | `{{file}}:{{line}}` | {{component}}
64
- - **Issue:** {{title}}
65
- - **Category:** {{category}}
66
- - **Action:** {{action_verb}}
67
- - **Details:** {{description}}
68
- - **Fix:** {{recommendation}}
69
-
70
- {{/each}}
71
-
72
- ### 🟡 Optimization Tasks
73
-
74
- {{#each optimization_tasks}}
75
- - [ ] **TASK-{{task_id}}** | `{{file}}:{{line}}` | {{component}}
76
- - **Issue:** {{title}}
77
- - **Improvement:** {{recommendation}}
78
-
79
- {{/each}}
80
-
81
- ### 🔵 Quality Tasks
82
-
83
- {{#each quality_tasks}}
84
- - [ ] **TASK-{{task_id}}** | `{{file}}:{{line}}` | {{component}}
85
- - **Issue:** {{title}}
86
- - **Suggestion:** {{recommendation}}
87
-
88
- {{/each}}
89
-
90
- ---
91
-
92
- ## Completed Tasks
93
-
94
- > Move completed tasks here with `[x]` checked.
95
-
96
- {{#each completed_tasks}}
97
- - [x] **TASK-{{task_id}}** | `{{file}}:{{line}}` — {{title}} ✅
98
- {{/each}}
99
-
100
- ---
101
-
102
- ## Agent Execution Commands
103
-
104
- > Ready-to-execute commands for automated processing.
105
-
106
- ### File Edit Operations
107
-
108
- ```json
109
- {
110
- "operations": [
111
- {{#each edit_operations}}
112
- {
113
- "task_id": "TASK-{{task_id}}",
114
- "operation": "replace",
115
- "file": "{{file}}",
116
- "component": "{{component}}",
117
- "start_line": {{start_line}},
118
- "end_line": {{end_line}},
119
- "target": "{{target_code_escaped}}",
120
- "replacement": "{{replacement_code_escaped}}",
121
- "status": "{{status}}"
122
- }{{#unless @last}},{{/unless}}
123
- {{/each}}
124
- ]
125
- }
126
- ```
127
-
128
- ### Validation Commands
129
-
130
- After completing tasks, run these commands to verify:
131
-
132
- ```bash
133
- # Static analysis
134
- ./vendor/bin/phpstan analyse
135
-
136
- # Code style check
137
- ./vendor/bin/pint --test
138
-
139
- # Run tests
140
- php artisan test
141
-
142
- # Clear caches
143
- php artisan optimize:clear
144
- ```
145
-
146
- ---
147
-
148
- ## Task Execution Protocol
149
-
150
- For each pending task:
151
-
152
- 1. **READ** the task details and target code
153
- 2. **LOCATE** the file and line number
154
- 3. **APPLY** the replacement code or fix
155
- 4. **VERIFY** the change doesn't break other code
156
- 5. **MARK** the task as complete `[x]`
157
- 6. **MOVE** to Completed Tasks section
158
-
159
- ### Status Flags
160
-
161
- ```json
162
- {
163
- "review_style": "{{REVIEW_STYLE}}",
164
- "all_critical_resolved": {{all_critical_resolved}},
165
- "all_warnings_resolved": {{all_warnings_resolved}},
166
- "ready_for_commit": {{ready_for_commit}},
167
- "requires_human_review": {{requires_human_review}},
168
- "blocking_issues": {{blocking_count}},
169
- "has_security_issues": {{has_security}},
170
- "has_n_plus_one": {{has_n_plus_one}},
171
- "has_mass_assignment": {{has_mass_assignment}}
172
- }
173
- ```
174
-
175
- ---
176
-
177
- ## Quick Reference
178
-
179
- | Task ID Format | Meaning |
180
- | -------------- | --------------------- |
181
- | `TASK-C###` | Critical priority |
182
- | `TASK-W###` | Warning priority |
183
- | `TASK-O###` | Optimization priority |
184
- | `TASK-Q###` | Quality priority |
185
-
186
- | Status | Symbol |
187
- | ----------- | ------ |
188
- | Pending | `[ ]` |
189
- | In Progress | `[-]` |
190
- | Completed | `[x]` |
191
- | Skipped | `[~]` |
192
-
193
- ---
194
-
195
- *Format: agent-tasks | Schema: laravel-code-review/v2 | {{REVIEW_STYLE}} mode*
@@ -1,79 +0,0 @@
1
- # Laravel Code Review — Compact
2
-
3
- **{{TIMESTAMP}}** | **{{REVIEW_STYLE}}** mode | {{FILE_COUNT}} files | {{ISSUE_COUNT}} issues
4
-
5
- ## Review Configuration
6
-
7
- | Style | Focus Areas Applied |
8
- | ------------------------------------------- | ----------------------- |
9
- | {{REVIEW_STYLE_EMOJI}} **{{REVIEW_STYLE}}** | {{FOCUS_AREAS_SUMMARY}} |
10
-
11
- ## Summary
12
-
13
- 🔴 {{CRITICAL_COUNT}} critical | 🟠 {{WARNING_COUNT}} warning | 🟡 {{OPTIMIZATION_COUNT}} optimize | 🔵 {{QUALITY_COUNT}} quality
14
-
15
- **By Category:** {{SECURITY_COUNT}} sec | {{ELOQUENT_COUNT}} eloquent | {{PHP84_COUNT}} php84 | {{CONVENTIONS_COUNT}} conventions
16
-
17
- ---
18
-
19
- ## Issues
20
-
21
- | Sev | File | Line | Issue | Category |
22
- | --- | ---- | ---: | ----- | -------- |
23
- {{#each issues}}
24
- | {{severity_emoji}} | `{{file_short}}` | {{line}} | {{title}} | {{category}} |
25
- {{/each}}
26
-
27
- ---
28
-
29
- ## By Component
30
-
31
- {{#each components_with_issues}}
32
- ### {{component}}
33
-
34
- {{#each files}}
35
- **`{{file_short}}`**
36
- {{#each issues}}
37
- - {{severity_emoji}} L{{line}}: {{title}} → {{recommendation_short}}
38
- {{/each}}
39
-
40
- {{/each}}
41
- {{/each}}
42
-
43
- ---
44
-
45
- ## Action Items
46
-
47
- **🔴 Critical ({{CRITICAL_COUNT}}):** {{#if_strict_or_balanced}}*All flagged*{{/if_strict_or_balanced}}{{#if_lenient}}*Critical only*{{/if_lenient}}
48
- {{#each critical_issues}}
49
- - [ ] {{file_short}}:{{line}} — {{title}}
50
- {{/each}}
51
-
52
- {{#if_not_lenient}}
53
- **🟠 Warnings ({{WARNING_COUNT}}):**
54
- {{#each warning_issues}}
55
- - [ ] {{file_short}}:{{line}} — {{title}}
56
- {{/each}}
57
-
58
- **🟡 Optimization ({{OPTIMIZATION_COUNT}}):**
59
- {{#each optimization_issues}}
60
- - [ ] {{file_short}}:{{line}} — {{title}}
61
- {{/each}}
62
- {{/if_not_lenient}}
63
-
64
- {{#if_strict}}
65
- **🔵 Quality ({{QUALITY_COUNT}}):**
66
- {{#each quality_issues}}
67
- - [ ] {{file_short}}:{{line}} — {{title}}
68
- {{/each}}
69
- {{/if_strict}}
70
-
71
- ---
72
-
73
- ## Focus Areas Applied
74
-
75
- {{#if FOCUS_SECURITY}}✅{{else}}❌{{/if}} Security | {{#if FOCUS_PERFORMANCE}}✅{{else}}❌{{/if}} Performance | {{#if FOCUS_BUGS}}✅{{else}}❌{{/if}} Bugs | {{#if FOCUS_STYLE}}✅{{else}}❌{{/if}} Style | {{#if FOCUS_TESTS}}✅{{else}}❌{{/if}} Tests | {{#if FOCUS_DOCS}}✅{{else}}❌{{/if}} Docs
76
-
77
- ---
78
-
79
- *laravel-code-review • compact • {{REVIEW_STYLE}}*