Skip to content

Commit 04827d2

Browse files
committed
Update dependencies, update project docs, guides, prompts
1 parent 1ff1ca5 commit 04827d2

File tree

14 files changed

+434
-122
lines changed

14 files changed

+434
-122
lines changed

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=lf
2+
*.bat eol=crlf
3+
*.js eol=lf
4+
*.mjs eol=lf
5+
*.cjs eol=lf
6+
*.ts eol=lf
7+
8+
*.json linguist-detectable
9+
*.md linguist-documentation
10+
11+
dist/** linguist-generated

.github/prompts/commit.prompt.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
description: Stage and commit all changes in this repo
3+
---
4+
5+
You are performing a git commit for this repo. Do the following steps in order:
6+
7+
1. Run `git status` to see what's modified
8+
2. Run `git add -A` to stage everything (`.gitignore` already excludes transient runtime files)
9+
3. If there is nothing to stage, say so clearly and stop — do not create an empty commit
10+
4. Write a commit message that summarizes the recent work to a temp file, then run `git commit -F <tempfile>` and delete the temp file afterward.
11+
- Do NOT use `git commit -m` — multi-line messages with special characters break shell quoting.
12+
- Do NOT use heredoc syntax (`<< 'EOF'`) — it interacts badly with the terminal tool.
13+
- Instead, use `printf` to write the temp file, one `'line'` argument per line:
14+
```
15+
printf '%s\n' 'First line' '' 'Second line' 'Third line' > /tmp/commitmsg.txt
16+
git commit -F /tmp/commitmsg.txt
17+
rm /tmp/commitmsg.txt
18+
```
19+
5. Run `git push` to push commits up to the origin

.github/prompts/reflect.prompt.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
description: Reflect on recent work and bring all project documentation up to date
3+
---
4+
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+
7+
**Do not commit.** Make all edits and stop. The user will review before committing.
8+
9+
## How to approach this
10+
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
15+
16+
Then work through each documentation layer below.
17+
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)
70+
71+
Keep it brief. One line per finding is enough.
72+
Make all edits directly — don't ask for permission on small fixes.

.github/prompts/release.prompt.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
description: Prepare a new release (CHANGELOG, version bump)
3+
argument-hint: version number, for example: `A.B.C` or `A.B.C-pre.D`
4+
---
5+
6+
You are preparing release **${input:version}** for this repo. Do the following steps in order:
7+
8+
1. **Confirm the version** — the new release version is `${input:version}`. Read `package.json` to verify this is a valid bump from the current version.
9+
- The version must follow semver format, for example: `A.B.C` or `A.B.C-pre.D`
10+
- It must be strictly greater than the current version in `package.json`
11+
- If either check fails, stop immediately and explain the problem clearly — do not proceed with any further steps.
12+
13+
2. **Identify commits since the last release** by running:
14+
```
15+
git log --oneline
16+
```
17+
Find the commit that corresponds to the previous release (look for the version bump or a release tag) and note all commits after it.
18+
19+
3. **Look up PR numbers** by fetching:
20+
```
21+
https://github.com/bhousel/node-diff3/pulls?q=is%3Apr+is%3Aclosed
22+
```
23+
Match each commit to its PR number. PR titles listed there are authoritative — prefer them over raw commit messages.
24+
25+
4. **Update `CHANGELOG.md`** — insert a new section immediately above the previous release heading. Follow the existing format exactly:
26+
- Header: `# ${input:version}`
27+
- Date: `##### YYYY-Mon-DD` (use today's date)
28+
- Bullet points for each user-visible change (features, fixes, improvements)
29+
- For bug/fix commits, write a plain bullet
30+
- Internal/dev-only commits (CI config, agent setup, etc.) can be omitted or grouped into a single terse bullet
31+
- Add reference links at the bottom of the section:
32+
- PR links: `[#NNN]: https://github.com/bhousel/node-diff3/issues/NNN`
33+
34+
5. **Update `package.json`** — set `"version"` to `"${input:version}"`.

.github/prompts/suggest.prompt.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
description: Review the codebase and suggest (then implement) concrete improvements
3+
---
4+
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+
7+
## What to read first
8+
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
15+
16+
## Categories to evaluate
17+
18+
For each category below, look for real issues and note them. Skip categories where things look fine — don't invent problems.
19+
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+
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?
29+
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)?
34+
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?
39+
40+
**Code clarity**
41+
- Are there comments that are outdated or misleading?
42+
- Are there any obvious simplifications (not refactors — just noise removal)?
43+
44+
## How to respond
45+
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
50+
51+
2. **Be direct and brief.** One sentence per finding is usually enough. Don't pad.
52+
53+
3. **Implement the 🔴 and 🟡 items** using file edits. Verify there are no new TypeScript errors afterward.
54+
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.

.github/prompts/sync.prompt.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
description: Sync scaffold files in this project against a source repo, creating or updating files with details adapted to this project
3+
argument-hint: source repo URL or owner/repo, e.g. https://github.com/<owner>/<repo>
4+
---
5+
6+
You are doing a scaffold sync. For each file in the manifest below, fetch the source version, compare it to the local version, and **create or update the local file** — substituting any source-specific details with this project's equivalent. The goal is to carry the source's structure and generic content forward while keeping this project's identity intact.
7+
8+
## Setup
9+
10+
The source repo is: **${input:source_repo}**
11+
12+
Before doing anything else:
13+
1. Read this project's `package.json` (or equivalent manifest) to learn: project name, description, repo URL, license, author(s), and language/runtime.
14+
2. Read the source repo's `package.json` too — you'll need to know which details to substitute.
15+
3. Convert the source repo URL to a raw content base URL:
16+
- `https://github.com/owner/repo``https://raw.githubusercontent.com/owner/repo/main`
17+
18+
---
19+
20+
## Scaffold file manifest
21+
22+
Process each file below. For every file: fetch the source, read the local version (if it exists), then apply the specific instructions listed.
23+
24+
- `.github/prompts/commit.prompt.md` — generic workflow; substitute any repo-specific examples or URLs
25+
- `.github/prompts/reflect.prompt.md` — generic; substitute any repo-specific layer references (file names, tools, etc.)
26+
- `.github/prompts/release.prompt.md` — adapt the workflow to this project's release process (don't just string-replace tool names — rethink the steps if the workflow is fundamentally different); substitute repo URL and tooling references
27+
- `.github/prompts/suggest.prompt.md` — generic; substitute any repo-specific examples or file paths
28+
- `.github/prompts/sync.prompt.md` — generic; the argument-hint uses a placeholder URL and should not need substitution
29+
- `.gitattributes` — adapt file-type entries to match this project's actual file types (e.g. add `*.sh` if the project has shell scripts, drop `*.ts` if it doesn't use TypeScript); if local file exists, add missing entries without removing local-only ones
30+
- `.gitignore` — merge: add entries from source that are absent locally; do not remove local-only entries
31+
- `AGENTS.md` — the general guidelines section is portable; substitute project-specific references (scratchpad notes, file paths, tool names) with this project's equivalents; preserve any local sections that have no counterpart in the source
32+
- `CONTRIBUTING.md` — adapt to this project's tooling and runtime (don't just string-replace tool names — rethink setup steps and commands if the build workflow differs); keep the source's structural sections
33+
- `LICENSE.md` — if the local license type matches this project's `package.json`, it's correct — skip regardless of what the source uses; only flag if the local file contradicts this project's own `package.json`
34+
- `README.md` — preserve this project's actual description, icon list, and any unique content; adopt structural sections (badge layout, contributing footer, license block) from the source if they are absent locally; do not overwrite meaningful local content with source content
35+
- `RELEASE.md` — substitute this project's repo URL, branch names, and tooling references
36+
- `bunfig.toml` — skip entirely if this project does not use Bun; otherwise apply source content with any registry or test configuration substituted for this project's equivalents
37+
- `tsconfig.json` — apply structural changes and new compiler options from the source; flag any option that differs in value and ask before overwriting, since local values may be intentional
38+
39+
---
40+
41+
## Steps
42+
43+
For each file in the manifest:
44+
45+
1. Fetch the raw source content from `{raw_base_url}/{file_path}` (skip gracefully if the source repo doesn't have it)
46+
2. Check whether the file exists locally
47+
3. Identify all source-specific values: repo name, org, URLs, package names, author names, version numbers, tool names — anything that belongs to the source project rather than the template structure
48+
4. Replace each source-specific value with the corresponding value from this project (from `package.json` or existing local files)
49+
5. Create or update the local file with the adapted content
50+
51+
---
52+
53+
## How to report
54+
55+
After processing all files, produce a summary table:
56+
57+
| File | Status | Notes |
58+
|------|--------|-------|
59+
| `.github/prompts/commit.prompt.md` | ✅ In sync / 🔄 Updated / ✨ Created / ⏭️ Skipped ||
60+
||||
61+
62+
For each **🔄 Updated** or **✨ Created** file: briefly describe what was substituted or what structural changes were adopted.
63+
64+
For **⏭️ Skipped** files: one line explaining why (e.g. "source repo doesn't have this file" or "Bun not used in this project").
65+
66+
For files that were **✅ In sync**: one line is enough.
67+

.gitignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
coverage/
2-
dist/
3-
node_modules/
4-
51
.DS_Store
6-
.vscode
2+
SCRATCHPAD.md
3+
74
npm-debug.log
8-
lerna-debug.log
95
package-lock.json
6+
pnpm-lock.yaml
107
yarn.lock
8+
9+
.vscode/
10+
coverage/
11+
dist/
12+
node_modules/

AGENTS.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Agent Context
2+
3+
This file contains agent-specific guidance only.
4+
5+
Read [`README.md`](README.md) and [`CONTRIBUTING.md`](CONTRIBUTING.md) first for general project information.
6+
7+
---
8+
9+
## Scratchpad
10+
11+
You can use a `SCRATCHPAD.md` file (gitignored) for persistent working memory across chat sessions. At the start of a session, read it for additional context on recent work, lessons learned, and known quirks. As you work, feel free to update the scratchpad with any learnings that a future session would benefit from knowing.
12+
13+
## Prompt Files
14+
15+
This project has reusable Copilot prompt files in `.github/prompts/`:
16+
17+
- `/commit` — stage and commit all changes
18+
- `/reflect` — update all project documentation with the current state of the code
19+
- `/release` — prepare a new release (CHANGELOG entry + version bump); accepts version number as input
20+
- `/suggest` — review the codebase and suggest concrete improvements
21+
- `/sync` — sync scaffold files against a source repo; accepts source repo URL as input
22+
23+
When asked to do one of these tasks, prefer using the prompt file rather than improvising.
24+
25+
## General Guidelines
26+
27+
### Communication style
28+
- Be concise. Maintainers review many contributions — get to the point.
29+
- Plain language over formal structure. A sentence or two beats a page of headings.
30+
- Don't explain things the maintainer already knows (project context, how Git works, etc.).
31+
- If a PR does one thing, describe that one thing.
32+
33+
### Constructive Pushback
34+
- **Don't just implement what's asked** — briefly flag if you see a concern. The user values a 1-2 sentence heads-up over silent compliance.
35+
- This includes: unnecessary abstractions, deprecated patterns, simpler alternatives, or potential footguns.
36+
- When the user proposes a solution, briefly evaluate whether a more elegant solution exists.
37+
38+
### Secrets hygiene
39+
- Before making any edit or commit, ask: **could this write a secret in plaintext somewhere it shouldn't be?**
40+
- Never put tokens, keys, or passwords in plaintext in any unencryped file.
41+
42+
### Comments
43+
- **Never remove comments** when modifying files unless:
44+
- The comment applies to code being removed
45+
- The meaning of the code has changed
46+
- Specifically asked to remove them
47+
- Comments contain valuable domain knowledge - preserve them

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ It's also good to check on the dependencies sometimes with commands like:
2929
- `bun update --interactive` - choose which updates to apply
3030

3131
Try to keep things simple!
32+
33+
## AI-Assisted Contributions
34+
35+
We welcome contributions made with the help of AI tools.
36+
If you use them, you are responsible for understanding and reviewing the output before submitting it.
37+
Generated code, issues, and PR descriptions should be clear and relevant — not verbose for the sake of it.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For more detail please visit:
88

99
Copyright (c) 2006, 2008 Tony Garnock-Jones &lt;tonyg@lshift.net&gt;<br/>
1010
Copyright (c) 2006, 2008 LShift Ltd. &lt;query@lshift.net&gt;<br/>
11-
Copyright (c) 2019-2025 Bryan Housel &lt;bhousel@gmail.com&gt;<br/>
11+
Copyright (c) 2019-2026 Bryan Housel &lt;bhousel@gmail.com&gt;<br/>
1212

1313
Permission is hereby granted, free of charge, to any person
1414
obtaining a copy of this software and associated documentation files

0 commit comments

Comments
 (0)