Skip to content

Commit ddb535c

Browse files
committed
sync scaffold files against agent-practices templates
- Add .editorconfig (new file) - Update .gitattributes, .gitignore with canonical entries and sync metadata - Update AGENTS.md: adopt Lint warnings, File Operations, Comments guidelines; fix typo - Update CONTRIBUTING.md: adopt canonical structure with project-specific values - Update bunfig.toml: add [test] coverage config and sync metadata - Update all .github/prompts/*.prompt.md with canonical content and sync metadata - Update .github/workflows/build.yml, README.md with sync metadata - Fix tsconfig.json: add rootDir to resolve outDir error
1 parent 04827d2 commit ddb535c

17 files changed

Lines changed: 278 additions & 217 deletions

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true
6+
end_of_line = lf
7+
8+
[*.{js,mjs,cjs,ts,json}]
9+
indent_style = space
10+
indent_size = 2
11+
12+
# sync:
13+
# version=1
14+
# source=https://github.com/rapideditor/agent-practices/blob/main/templates/.editorconfig
15+
# instructions="adapt the per-extension indent rules to match this project's actual file types"

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77

88
*.json linguist-detectable
99
*.md linguist-documentation
10+
*.yml linguist-detectable
1011

1112
dist/** linguist-generated
13+
14+
# sync:
15+
# version=1
16+
# source=https://github.com/rapideditor/agent-practices/blob/main/templates/.gitattributes
17+
# instructions="adapt file-type entries to this project's actual file types; add missing entries but do not replace local edits"

.github/prompts/commit.prompt.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
description: Stage and commit all changes in this repo
2+
description: Stage, commit, and push all changes in this repo
3+
argument-hint: commit detail to include, for example: `(closes ​#123)`
34
---
45

56
You are performing a git commit for this repo. Do the following steps in order:
@@ -14,6 +15,15 @@ You are performing a git commit for this repo. Do the following steps in order:
1415
```
1516
printf '%s\n' 'First line' '' 'Second line' 'Third line' > /tmp/commitmsg.txt
1617
git commit -F /tmp/commitmsg.txt
17-
rm /tmp/commitmsg.txt
18+
rm -f /tmp/commitmsg.txt
19+
```
20+
- If a commit detail argument was provided (e.g. `closes #123`), include it on its own line after the first line (subject), separated by a blank line:
21+
```
22+
printf '%s\n' 'First line' '' 'closes #123' > /tmp/commitmsg.txt
1823
```
1924
5. Run `git push` to push commits up to the origin
25+
26+
<!-- sync:
27+
version=1
28+
source=https://github.com/rapideditor/agent-practices/blob/main/templates/.github/prompts/commit.prompt.md
29+
-->

.github/prompts/reflect.prompt.md

Lines changed: 17 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,27 @@
11
---
22
description: Reflect on recent work and bring all project documentation up to date
3+
argument-hint: additional optional context
34
---
45

5-
You are doing a documentation update pass. Recent code changes may have left docs, guides, and inline comments out of date. Your job is to find and fix those gaps — not to write new documentation for its own sake.
6+
Update all project documentation to match the current state of the code. Fix gaps, stale content, spelling mistakes, and anything unclear. Make all edits — do not just list findings. Do not commit; the user will review first.
67

7-
**Do not commit.** Make all edits and stop. The user will review before committing.
8+
If the user provided additional context with the prompt, treat it as a focus area (e.g. "only README", "check AGENTS.md is accurate").
89

9-
## How to approach this
10+
## Steps
1011

11-
First, get oriented:
12-
1. Review the current chat session history — this is your primary source of context for what was discussed, decided, and changed
13-
2. Run `git log --oneline -20` to see recent commits and confirm what was actually landed
14-
3. Use `#codebase` to survey the current state of the project
12+
1. Read `AGENTS.md` to understand the project structure.
13+
2. Review the current chat session history — primary source of context for what changed.
14+
3. Run `git log --oneline -20` to confirm what was actually landed.
15+
4. Search the codebase as needed to verify current state.
1516

16-
Then work through each documentation layer below.
17+
## What to update
1718

18-
---
19-
20-
## Documentation layers to check
21-
22-
### SCRATCHPAD.md (if present)
23-
A working-memory file for agents (gitignored). Update it with:
24-
- Any new quirks, gotchas, or lessons learned from recent work
25-
- Any known issues or follow-up tasks worth remembering
26-
- Remove anything that is now resolved or stale
27-
28-
### AGENTS.md (if present)
29-
Agent context file. Check that:
30-
- The described project structure still matches reality
31-
- Any tool, script, or workflow guidance is still accurate
32-
- Nothing important from recent work is missing
33-
34-
### README.md
35-
The public face of the project. Check that:
36-
- The feature list / description still reflects what the project does
37-
- Setup and usage instructions still work as written
38-
- Any referenced scripts, commands, or file paths still exist and are correct
39-
- Version numbers or compatibility notes aren't stale
40-
41-
### CONTRIBUTING.md (if present)
42-
Check that:
43-
- Development setup instructions are still accurate
44-
- Any described workflow (build steps, naming conventions, PR process) reflects current practice
45-
46-
### Other markdown files (CHANGELOG.md, RELEASE.md, etc.)
47-
- CHANGELOG: verify the most recent entry matches the current `package.json` version (or equivalent). Flag if they're out of sync — but do not generate a new changelog entry here; that's for `/release`.
48-
- RELEASE.md or similar: check that documented release steps match current tooling
49-
50-
### Prompt files (`.github/prompts/*.prompt.md`, `.instructions.md`, etc.)
51-
Check that:
52-
- Referenced file paths, script names, and commands still exist
53-
- Any example version numbers or outputs are not misleading
54-
- Steps are still in the right order
55-
56-
### Inline code documentation
57-
Look for comments in source files that reference something that has since changed:
58-
- Outdated file paths or module names
59-
- Comments describing behavior that has been refactored
60-
- TODO/FIXME comments that have been resolved by recent work (remove or update them)
61-
62-
---
63-
64-
## How to respond
65-
66-
For each layer, report one of:
67-
-**Up to date** — nothing to do
68-
- 🟡 **Updated** — briefly describe what you changed
69-
- 💡 **Flag for user** — something needs a human decision (e.g. a CHANGELOG version mismatch, a structural README question)
19+
- Inline documentation (JSDoc, comments)
20+
- Markdown files (`README`, design docs, contributing guides)
21+
- Agent instructions (`AGENTS.md`, `copilot-instructions`, etc.)
22+
- Working memory — e.g. `SCRATCHPAD.md`, `.scratchpad/*`, or whatever convention this project uses (see `AGENTS.md`)
7023

71-
Keep it brief. One line per finding is enough.
72-
Make all edits directly — don't ask for permission on small fixes.
24+
<!-- sync:
25+
version=1
26+
source=https://github.com/rapideditor/agent-practices/blob/main/templates/.github/prompts/reflect.prompt.md
27+
-->

.github/prompts/release.prompt.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ You are preparing release **${input:version}** for this repo. Do the following s
3232
- PR links: `[#NNN]: https://github.com/bhousel/node-diff3/issues/NNN`
3333

3434
5. **Update `package.json`** — set `"version"` to `"${input:version}"`.
35+
36+
<!-- sync:
37+
version=1
38+
source=https://github.com/rapideditor/agent-practices/blob/main/templates/.github/prompts/release.prompt.md
39+
instructions="adapt the release workflow to this project's process; rethink steps if release tooling differs"
40+
-->

.github/prompts/suggest.prompt.md

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,51 @@
11
---
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
34
---
45

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.
67

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").
89

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
1519

1620
## Categories to evaluate
1721

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.
1923

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
2425

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
2927

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
3429

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
3931

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
4333

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
4535

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
5037

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
5241

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
5446

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

Comments
 (0)