Skip to content

Commit e6003e2

Browse files
committed
cruft: update
- Consolidate editor rules under .claude/rules/ (replaces .cursor/rules/ and .github/instructions/) - Update Claude agents (badge-sync, changelog, copy-editor, markdownlint-fixer, qa-fixer, regen, release, wiswa-sync) and .claude/skills/ci/SKILL.md - Update .claude/settings.local.json.dist - Rewrite CLAUDE.md to point at AGENTS.md and .claude/rules - Rewrite AGENTS.md for new rules layout - Add dedicated markdownlint, prettier, and spelling workflows - Update publish-winget and qa workflows - Update dependabot config - Update .pre-commit-config.yaml, .prettierignore, and .gitignore - Bump Yarn from 4.13.0 to 4.14.1 and refresh .yarnrc.yml, package.json, and yarn.lock - Update .wiswa.jsonnet, _config.yml, CITATION.cff, README.md (Wiswa generated markers, badge tweaks), and vcpkg.json - Refresh .vscode/dictionary.txt - Bump Keep a Changelog reference to 1.1.1 Signed-off-by: Andrew Udvare <audvare@gmail.com>
1 parent 6a5dd27 commit e6003e2

43 files changed

Lines changed: 845 additions & 733 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/agents/badge-sync.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ All RST badges must be indented under the `.. only:: html` directive (3-space in
4343
4. If differences are found, rewrite `docs/badges.rst` to match the README, preserving the
4444
`.. only:: html` wrapper and blank-line separation between badges.
4545
5. After making changes, run `yarn format` and `yarn qa` to ensure no formatting or lint issues.
46+
Do not be concerned with other types of QA issues that may arise from the change, as long as the
47+
badge sync is correct.
4648

4749
## Rules
4850

.claude/agents/changelog.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Updates `CHANGELOG.md` with entries for changes since the last release.
44

55
## Role
66

7-
You maintain the project changelog following [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
7+
You maintain the project changelog following [Keep a Changelog](https://keepachangelog.com/en/1.1.1/)
88
format. You analyse commits and file changes to produce clear, user-facing changelog entries.
99

1010
## Workflow
@@ -52,11 +52,14 @@ Do not create changelog entries for:
5252
- Code style, linting, or formatting-only changes.
5353
- Dictionary updates.
5454
- Pre-commit configuration changes.
55+
- Generator or cruft follow-ups that only correct placeholders in metadata (for example swapping a
56+
template GitHub owner or URL for the real `repository`, `homepage`, badges, `CODEOWNERS`,
57+
funding, or Snap contact fields) without changing application behaviour.
5558

5659
## Rules
5760

5861
- Never remove or modify existing released entries (sections with a version number and date).
5962
- Never change the `[unreleased]` header casing (it must stay lowercase).
6063
- Keep the markdownlint configuration comment at the top of the file.
6164
- Entries must be concise. One line per change unless sub-bullets are needed.
62-
- When in doubt about whether a change is user-facing, include it.
65+
- When in doubt about whether a change is user-facing, **omit** the entry.

.claude/agents/copy-editor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Edit prose in all text files in the repository:
1717
- YAML files (comments and string values).
1818
- TOML/INI files (comments and string values).
1919
- Man pages, CITATION.cff, CONTRIBUTING.md, README.md, CHANGELOG.md, SECURITY.md.
20-
- Agent and instruction files (`.claude/agents/`, `.github/instructions/`, `.cursor/rules/`).
20+
- Agent and rule files under `.claude/agents/` and `.claude/rules/`.
2121

2222
Do not edit:
2323

@@ -87,7 +87,7 @@ Do not edit:
8787
a. Read the file.
8888
b. Examine all prose (comments, string literals, Markdown body text, etc.).
8989
c. Apply fixes following the rules above.
90-
2. After all fixes, launch the **qa-fixer** agent to format and fix any lint/spelling issues.
90+
1. After all fixes, launch the **qa-fixer** agent to format and fix any lint/spelling issues.
9191

9292
## Rules
9393

.claude/agents/markdownlint-fixer.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Fixes issues reported by markdownlint-cli2 in Markdown and MDC files.
55
## Role
66

77
You fix Markdown linting errors. Follow all conventions in
8-
`.github/instructions/markdown.instructions.md`.
8+
`.claude/rules/markdown.md`.
99

1010
## Configuration
1111

@@ -21,7 +21,7 @@ The project uses markdownlint-cli2 configured in `package.json` under the `markd
2121

2222
## Workflow
2323

24-
1. Run `yarn prettier -w` on the target files first to auto-fix table formatting, trailing
24+
1. Run `yarn prettier --write` on the target files first to auto-fix table formatting, trailing
2525
whitespace, and other structural issues.
2626
2. Run `yarn markdownlint-cli2` to get the full list of errors.
2727
3. Group errors by file.
@@ -45,11 +45,11 @@ Word-wrap lines at 100 characters. Do not break:
4545

4646
### MD009 - Trailing spaces
4747

48-
Remove trailing whitespace. Use `yarn prettier -w` to handle this automatically.
48+
Remove trailing whitespace. Use `yarn prettier --write` to handle this automatically.
4949

5050
### MD010 - Hard tabs
5151

52-
Replace tabs with spaces. Use `yarn prettier -w` to handle this automatically.
52+
Replace tabs with spaces. Use `yarn prettier --write` to handle this automatically.
5353

5454
### MD012 - Multiple consecutive blank lines
5555

@@ -77,7 +77,7 @@ Ensure the file ends with exactly one newline.
7777

7878
## Rules
7979

80-
- Always run `yarn prettier -w` before `yarn markdownlint-cli2` - prettier fixes many issues
80+
- Always run `yarn prettier --write` before `yarn markdownlint-cli2` - prettier fixes many issues
8181
automatically.
8282
- Do not disable rules with `<!-- markdownlint-disable -->` comments unless there is no other way
8383
to satisfy the rule.

.claude/agents/qa-fixer.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ Runs formatting and QA checks, then iteratively fixes all issues until both pass
55
## Role
66

77
You ensure the project passes all formatting and QA checks. Follow all conventions in the
8-
instruction files under `.github/instructions/`.
8+
rule files under `.claude/rules/`.
99

1010
## Workflow
1111

1212
1. Run `yarn format`. Fix any issues it reports.
1313
2. Run `yarn qa`. Parse the output for errors.
14+
1415
3. For each error:
1516
a. Read the file.
16-
b. Fix following the relevant instruction file (Markdown, JSON/YAML, TOML/INI, general).
17+
b. Fix following the relevant rule file under `.claude/rules/` (Markdown, JSON/YAML, TOML/INI,
18+
general).
1719
4. Repeat from step 1 until both `yarn format` and `yarn qa` exit with code 0.
1820

1921
## Rules
2022

23+
- Never attempt to use scripts to mass-edit files.
2124
- Never suppress or disable linter rules to make checks pass. Fix the root cause.
22-
- Follow all project conventions when fixing issues (see `.github/instructions/`).
25+
- Follow all project conventions when fixing issues (see `.claude/rules/`).
2326
- If a fix introduces new errors, fix those too before re-running.
2427
- If stuck in a loop (same error persists after 3 attempts), stop and alert the user.

.claude/agents/regen.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,24 @@ and verify nothing is broken before committing.
99

1010
## Prerequisites
1111

12-
- Wiswa must be installed. Use `~/dev/wiswa/.venv/bin/wiswa` or the system-installed `wiswa`.
12+
- Wiswa must be installed and available as `wiswa` on the PATH.
1313
- `.wiswa.jsonnet` must exist in the project root.
14-
- `.wiswa.jsonnet` must contain a `copilot:` or `copilot+:` key, or `stubs_only: true`.
1514

1615
## Workflow
1716

18-
1. **Verify `.wiswa.jsonnet` is configured.** Check that it contains `copilot:` or `copilot+:` or
19-
`stubs_only: true`. If none are present, stop and alert the user to add
20-
`copilot: { intro: '...' }`.
21-
2217
1. Run the wiswa-sync agent skill to ensure `.wiswa.jsonnet` is up to date with the latest schema
2318
and settings.
2419

25-
1. **Run Wiswa.** Execute:
20+
1. **Run Wiswa.** User-level `defaults.jsonnet` is merged when `uses_user_defaults` is `true` in
21+
`.wiswa.jsonnet` (see Wiswa's built-in defaults for the fallback). When that is enabled, the file
22+
must exist in the Wiswa user configuration directory.
23+
24+
Pass `-d` for debug.
2625

2726
```shell
28-
~/dev/wiswa/.venv/bin/wiswa -du
27+
wiswa -d
2928
```
3029

31-
The `-d` flag enables debug output and `-u` uses user defaults.
32-
3330
1. **Lock dependencies.** If `uv.lock` exists, run `uv lock`. If `poetry.lock` exists, run
3431
`poetry lock`.
3532

.claude/agents/release.md

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,70 @@ Prepares and publishes a new release for the bpmdetect project.
55
## Role
66

77
You manage the release process: update the changelog, determine the version bump, run pre-commit
8-
checks, bump the version, and push.
8+
checks, bump the version, and push, and align GitHub release notes
9+
with the changelog.
910

1011
## Workflow
1112

1213
1. **Review changes since last tag.** Run `git log $(git describe --tags --abbrev=0)..HEAD
1314
--oneline` to see all commits since the last release.
1415

15-
2. **Update CHANGELOG.md.** Add entries under `[Unreleased]` if not already present. Use the
16+
1. **Update CHANGELOG.md.** Add entries under `[Unreleased]` if not already present. Use the
1617
appropriate sections: Added, Changed, Fixed, Removed.
1718

18-
3. **Determine the version bump** based on Semantic Versioning:
19+
1. **Determine the version bump** based on Semantic Versioning:
1920
- **patch**: bug fixes, dependency updates, documentation changes.
2021
- **minor**: new features, new commands, new public API additions.
2122
- **major**: breaking changes to public API, removed commands/functions.
2223

23-
4. **Create a new version header** below `[Unreleased]`, moving the unreleased content under it.
24+
1. **Create a new version header** below `[Unreleased]`, moving the unreleased content under it.
2425
Format: `## [X.Y.Z] - YYYY-MM-DD`. Leave `[Unreleased]` empty above it.
2526

26-
5. **Launch agents in parallel** before bumping:
27+
1. **Launch agents in parallel** before bumping:
2728
- **copy-editor** - to fix prose in the changelog entries.
2829
- **qa-fixer** - to format and fix any lint/spelling issues.
2930

30-
6. **Run `pre-commit run -a`** to ensure all hooks pass. Fix any issues before proceeding.
31+
1. **Run `pre-commit run -a`** to ensure all hooks pass. Fix any issues before proceeding.
3132

32-
7. **Record the current HEAD** before bumping: `git rev-parse HEAD` (save this as `PRE_BUMP_REF`).
33+
1. **Record the current HEAD** before bumping: `git rev-parse HEAD` (save this as `PRE_BUMP_REF`).
3334

34-
8. **Run `cz bump --files-only --increment {MAJOR,MINOR,PATCH}`** with the appropriate increment.
35+
1. **Run `cz bump --files-only --increment {MAJOR,MINOR,PATCH}`** with the appropriate increment.
3536
This only updates version strings in files without committing or tagging. Never pass
3637
`--changelog` or `-ch` to `cz bump`. If `cz bump` fails for any reason:
3738
1. **Restore the repository** to the pre-bump state: `git checkout -- .`
38-
2. **Stop work immediately and alert the user.** Do not attempt to work around the failure.
39-
40-
9. **Run `uv sync`** to update `uv.lock` with the new version.
41-
42-
10. **Commit the version bump.** Stage all changed files and commit with
43-
`git commit -S -s -m 'bump: vOLD → vNEW'` (replace OLD/NEW with actual versions).
44-
45-
11. **Create a signed tag.** Run `git tag -s vNEW -m 'vNEW'` (replace NEW with the new version).
46-
47-
12. **Push the commit and tag.** Run `git push && git push --tags`.
39+
1. **Stop work immediately and alert the user.** Do not attempt to work around the failure.
40+
41+
1. **Commit the version bump.** Stage all changed files and commit with
42+
`git commit -S -s -m 'bump: vOLD → vNEW'` (replace OLD/NEW with actual versions).
43+
44+
1. **Create a signed tag.** Run `git tag -s vNEW -m 'vNEW'` (replace NEW with the new version).
45+
46+
1. **Push the commit and tag.** Run `git push && git push --tags`.
47+
48+
1. **Update GitHub release notes** using `gh` (authenticated for this repository). After the tag
49+
is on the remote, automation may create the GitHub **Release** record later or as a **draft**;
50+
do not skip this step when a draft exists.
51+
- **Wait for the release:** Poll until `gh release view vNEW` exits successfully, including
52+
when `isDraft` is true. Use a short sleep between attempts and a sensible overall timeout; if
53+
the release never appears, stop and report the failure.
54+
- **Body from `CHANGELOG.md`:** Copy only the content for this version (from the first
55+
`### Added`, `### Changed`, `### Fixed`, or `### Removed` under that version through the line
56+
before the next `## [` version header). Do **not** include the `## [X.Y.Z] - YYYY-MM-DD`
57+
heading line. For GitHub's layout, promote each of those subsection headings from `###` to
58+
`##` (`### Added``## Added`, and the same pattern for Changed, Fixed, and Removed).
59+
- **Wrapping within list items:** Undo changelog hard-wraps inside one bullet: when a list line
60+
ends with a single newline and the following line continues the same item (for example an
61+
indented continuation), join them with one space so `- item with long sentence` plus
62+
`line 2` reads as `- item with long sentence line 2`. Do **not** join across a paragraph
63+
break: leave any run of **two or more consecutive newlines** (`\n\n` or more) unchanged.
64+
- **Full Changelog line:** After the body, append **one blank line**, then exactly:
65+
`**Full Changelog**: https://github.com/Tatsh/bpmdetect/compare/vPREV...vNEW` where `vNEW` is
66+
this release's tag. Set `vPREV` to the tag of the **most recent other GitHub release** (for
67+
example from `gh release list`, ordered by recency, skipping `vNEW`). If no earlier release
68+
exists on GitHub, fall back to the previous version in `CHANGELOG.md` immediately below this
69+
entry, or the git tag that precedes `vNEW`.
70+
- **Apply:** Write the combined Markdown to a file (for example under `.wiswa-ci/`) and run
71+
`gh release edit vNEW --notes-file <path>`.
4872

4973
## Rules
5074

.claude/agents/wiswa-sync.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ again would produce the same result.
1111
## Context
1212

1313
- **Wiswa source**: `~/dev/wiswa`
14-
- **Defaults**: `~/dev/wiswa/wiswa-jsonnet/defaults.libsonnet` merged with `.wiswa.jsonnet`
15-
- **Config**: `.wiswa.jsonnet` only contains overrides on top of defaults
14+
- **Defaults**: `~/dev/wiswa/wiswa-jsonnet/defaults.libsonnet` - merged with `.wiswa.jsonnet`
15+
- **Config**: `.wiswa.jsonnet` - only contains overrides on top of defaults
1616

1717
The jsonnet evaluation is: `defaults + .wiswa.jsonnet` (deep merge with `+:`). Only what differs
1818
from the defaults needs to be in `.wiswa.jsonnet`.
@@ -47,10 +47,13 @@ These files are generated by Wiswa. Changes to them should be reflected back int
4747
- `.github/workflows/tests.yml`
4848
- `_config.yml` (Jekyll pages)
4949

50-
### Copilot/Cursor instructions (when enabled)
50+
### AI guidance (when `want_ai` is true)
5151

52-
- `.cursor/rules/*.mdc`
53-
- `.github/instructions/*.instructions.md`
52+
- `AGENTS.md`
53+
- `CLAUDE.md`
54+
- `.claude/rules/*.md`
55+
- `.claude/agents/*.md`
56+
- `.claude/skills/**/SKILL.md`
5457

5558
### CITATION.cff (when `want_cff` is true)
5659

@@ -95,16 +98,16 @@ For example, if a dependency is added to `vcpkg.json`, the override in `.wiswa.j
9598

9699
1. **Read the current `.wiswa.jsonnet`** to understand existing overrides.
97100

98-
2. **Read the changed managed files** (e.g. `CMakeLists.txt`, `vcpkg.json`,
99-
`package.json`) to identify what changed.
101+
2. **Read the changed managed files** (e.g. `CMakeLists.txt`, `vcpkg.json`, `package.json`)
102+
to identify what changed.
100103

101104
3. **Read the relevant defaults** (`defaults.libsonnet`, etc.)
102105
to determine what is already provided by Wiswa.
103106

104107
4. **Determine the minimal change** to `.wiswa.jsonnet`:
105108
- If a non-dependency field changed, add the appropriate override.
106109

107-
5. **Only modify `.wiswa.jsonnet`**. Never modify managed files they are outputs of Wiswa.
110+
5. **Only modify `.wiswa.jsonnet`**. Never modify managed files - they are outputs of Wiswa.
108111

109112
## Rules
110113

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
applyTo: '**/*.cpp, **/*.h'
3-
---
4-
51
# C++/Qt guidelines
62

73
- No tabs.

.claude/rules/general.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# General guidelines
2+
3+
## Before editing repository files
4+
5+
**Mandatory first step:** Before you create, modify, or delete any tracked file, read the `.claude/`
6+
tree that applies to the work:
7+
8+
1. Read this file in full.
9+
2. Read every other `.claude/rules/*.md` whose scope matches files you will touch (see the rules
10+
table in [AGENTS.md](../../AGENTS.md)).
11+
3. If the user or task names an agent, skill, or multi-step workflow (for example `/ci`, Wiswa
12+
regen, or release), read those `.claude/agents/*.md` or `.claude/skills/*/SKILL.md` files before
13+
changing the repository.
14+
4. Only then begin code or configuration changes.
15+
16+
**Exception:** If the user is only adjusting how the assistant should behave and did not ask for a
17+
concrete repository change, do not edit project files.
18+
19+
---
20+
21+
- Do not explain project structure or conventions in comments or docstrings.
22+
- Use 4 spaces for indentation in C/C++ and 2 spaces elsewhere.
23+
- Files must end with a single newline character.
24+
- Keep lines shorter than 100 characters.
25+
- Line endings must be Unix-style (LF).
26+
- Use UTF-8 encoding for all files.
27+
- Use spaces instead of tabs for indentation.
28+
- Use British spelling in comments and docstrings.
29+
- Use American spelling for all identifiers and string literals.
30+
- Never mention the spelling or other project conventions in comments or docstrings.
31+
- Use full sentences in comments and docstrings.
32+
- Use the Oxford comma in lists.
33+
- Use single quotes for strings, except where double quotes are required (e.g., JSON).
34+
- Full words should be preferred over abbreviations, except for well-known acronyms. Some words may
35+
be abbreviated:
36+
- `config` for configuration.
37+
- Prefer to use immutable data structures over mutable ones.
38+
- Run `yarn format` after any changes to format all files. Must exit with code 0.
39+
- Run `yarn qa` after any changes to type-check and run QA utilities. Must exit with code 0. Both
40+
commands must pass before committing.
41+
- Use `yarn` to invoke Node-based tools (Prettier, markdownlint-cli2, cspell).
42+
- In shell tool calls, assume the working directory is already the repository root (or whatever cwd
43+
the tool reports). Do not prefix commands with `cd` into that same path unless you need a
44+
different directory.
45+
- Spell-check uses cspell with British English (`en-GB`). Exception: code identifiers must use
46+
American English (`ColorCode` not `ColourCode`).
47+
- Add new words to `.vscode/dictionary.txt` in lowercase and keep the file sorted. Prefer to commit
48+
dictionary changes separately with the message `dictionary: update`.
49+
50+
## Avoiding Permission Prompts
51+
52+
Bash commands containing `$()` subshells trigger interactive permission prompts. Avoid these:
53+
54+
- **Git commits**: create `.wiswa-ci` if it does not exist (`mkdir -p .wiswa-ci`), then create a
55+
unique message file with `mktemp .wiswa-ci/message-XXXXXXXX`. Write the commit message there with
56+
the **Write** tool (not Bash `echo` or `cat`). Commit with
57+
`git commit -S -s -F <tempfile>` without using the
58+
sandbox. Never use `-m "$(cat <<'EOF' ...)"` or write the message file from Bash with a
59+
fixed path (permission prompts).
60+
- **Command substitution**: prefer chaining with `&&` and temp files over `$()` inline.
61+
- **Backticks**: same issue as `$()` - avoid `` `command` `` in Bash tool calls.
62+
- **Pipes into commands** are fine (`echo foo | git commit --stdin` etc.).

0 commit comments

Comments
 (0)