|
1 | 1 | --- |
2 | | -description: Review the codebase and suggest (then implement) concrete improvements |
| 2 | +description: Review the codebase and suggest improvements |
| 3 | +argument-hint: additional optional context |
3 | 4 | --- |
4 | 5 |
|
5 | | -You are doing an improvement review of this codebase. The goal is to find **concrete, actionable improvements** — not a wishlist. Think like an experienced senior engineer or architect who respects the existing style and doesn't over-engineer. |
| 6 | +Find concrete improvements and flag things worth tracking for future work. Respect the existing style; don't over-engineer. Report findings only — do not make edits. The user will choose which suggestions to implement. |
6 | 7 |
|
7 | | -## What to read first |
| 8 | +If the user provided additional context with the prompt, treat it as a focus area (e.g. "focus on TypeScript types", "performance only"). |
8 | 9 |
|
9 | | -Get a broad picture of the project before forming any opinions. Use `#codebase` to survey the whole workspace — pay particular attention to: |
10 | | -- Package/dependency manifests (`package.json`, `Cargo.toml`, `pyproject.toml`, etc.) |
11 | | -- Compiler/type-checker config (`tsconfig.json`, `mypy.ini`, etc.) |
12 | | -- Runtime/bundler config (`bunfig.toml`, `vite.config.*`, etc.) |
13 | | -- Build and tooling scripts |
14 | | -- The README — how the project presents itself and what it's for |
| 10 | +## Steps |
| 11 | + |
| 12 | +1. Read `AGENTS.md` to understand the project structure. |
| 13 | +2. Survey the codebase, paying particular attention to: |
| 14 | + - Package/dependency manifests (`package.json`, etc.) |
| 15 | + - Compiler/type-checker config (`tsconfig.json`, etc.) |
| 16 | + - Runtime/bundler config (`bunfig.toml`, etc.) |
| 17 | + - Build and tooling scripts |
| 18 | + - `README` — how the project presents itself |
15 | 19 |
|
16 | 20 | ## Categories to evaluate |
17 | 21 |
|
18 | | -For each category below, look for real issues and note them. Skip categories where things look fine — don't invent problems. |
| 22 | +Skip categories where things look fine. Don't invent problems. |
19 | 23 |
|
20 | | -**Correctness / bugs** |
21 | | -- Are there any scripts or config values that are plainly wrong? (e.g. calling `npm run` in a Bun-only project) |
22 | | -- Any TypeScript errors or implicit `any` types? |
23 | | -- Any typos in user-facing strings (error messages, log output)? |
| 24 | +**Correctness / Bugs** — wrong config values, broken scripts, typos in user-facing output |
24 | 25 |
|
25 | | -**TypeScript quality** |
26 | | -- Are types as precise as they should be? (e.g. `String[]` vs `string[]`, missing type annotations on parameters) |
27 | | -- Are there untyped third-party modules that need a `.d.ts` declaration? |
28 | | -- Are there `tsconfig.json` options enabled that don't apply to this project? |
| 26 | +**Code Quality** — outdated practices, duplicated logic, unnecessary indirection, misleading comments, obvious simplifications |
29 | 27 |
|
30 | | -**Runtime / tooling overlap** |
31 | | -- Does the project use Node.js APIs where a Bun-native equivalent exists and is simpler? (e.g. `node:fs` vs `Bun.file()`) |
32 | | -- Are there npm/yarn artifacts in the scripts that should use `bun`? |
33 | | -- Are there dependencies that Bun now handles natively (e.g. a test runner, a bundler)? |
| 28 | +**Performance** — unnecessary looping, extra copies, redundant calls, known slow browser APIs |
34 | 29 |
|
35 | | -**Dev experience** |
36 | | -- Is there a fast linter+formatter that would be easy to add? (Biome is a good fit for Bun projects — one tool, zero config, very fast) |
37 | | -- Are there missing or misleading `package.json` scripts? |
38 | | -- Is the `.gitignore` / `.gitattributes` complete and correct? |
| 30 | +**TypeScript** (if used) — imprecise types, overuse of `any`/`unknown`, untyped third-party modules, irrelevant `tsconfig.json` options |
39 | 31 |
|
40 | | -**Code clarity** |
41 | | -- Are there comments that are outdated or misleading? |
42 | | -- Are there any obvious simplifications (not refactors — just noise removal)? |
| 32 | +**Testing** — coverage gaps, tests that don't actually verify what they claim |
43 | 33 |
|
44 | | -## How to respond |
| 34 | +**Runtime / tooling** (Bun-specific entries apply if used) — `node:*` APIs where Bun-native equivalents exist, `npm`/`yarn` artifacts in scripts, dependencies Bun now handles natively |
45 | 35 |
|
46 | | -1. **Group findings by category.** Within each category, distinguish between: |
47 | | - - 🔴 Real issues (bugs, broken things) — implement the fix immediately |
48 | | - - 🟡 Improvements (best practices, clarity) — implement unless non-trivial |
49 | | - - 💡 Suggestions (optional tools, bigger changes) — describe but don't implement; let the user decide |
| 36 | +**Developer Experience** — missing or misleading `package.json` scripts, incomplete `.gitignore`/`.gitattributes`, missing docs or source comments |
50 | 37 |
|
51 | | -2. **Be direct and brief.** One sentence per finding is usually enough. Don't pad. |
| 38 | +**Architecture / Technical Debt** — signs that complexity is accumulating: growing god-objects, framework or library choices that are becoming a liability, inconsistent patterns across similar code, coupling that makes changes harder than they should be, conventions the project has outgrown |
| 39 | + |
| 40 | +## How to respond |
52 | 41 |
|
53 | | -3. **Implement the 🔴 and 🟡 items** using file edits. Verify there are no new TypeScript errors afterward. |
| 42 | +Group findings by category. Number each suggestion sequentially across all categories (1, 2, 3…) so the user can refer to them by number. For each finding: |
| 43 | +- 🔥 Actionable issue (bug, broken) — should be fixed soon |
| 44 | +- 👉 Improvement (best practice, clarity) — worth doing |
| 45 | +- 💡 Suggestion (optional, bigger change) — idea to track for future work |
54 | 46 |
|
55 | | -4. **Do not over-engineer.** A bug fix doesn't need surrounding code cleaned up. A simple improvement doesn't need extra configurability. Only change what needs changing. |
| 47 | +<!-- sync: |
| 48 | +version=1 |
| 49 | +source=https://github.com/rapideditor/agent-practices/blob/main/templates/.github/prompts/suggest.prompt.md |
| 50 | +instructions="steps and categories may be adapted to this project's stack — keep categories that apply, drop ones that don't, and add new ones if the project uses tooling not represented here" |
| 51 | +--> |
0 commit comments