From d8b13021dc3d6f3b65e11031d743813ff4b6010c Mon Sep 17 00:00:00 2001 From: alexion Date: Thu, 17 Sep 2026 01:40:31 -0400 Subject: [PATCH] refactor(skills): keep style instructions local --- src/skills/AGENTS.md | 0 src/skills/{ => nix-style}/RULE-FORMAT.md | 0 src/skills/nix-style/SKILL.md | 27 ++++++++++++++++++++- src/skills/rust-style/RULE-FORMAT.md | 17 +++++++++++++ src/skills/rust-style/SKILL.md | 27 ++++++++++++++++++++- src/skills/style-skill.md | 29 ----------------------- 6 files changed, 69 insertions(+), 31 deletions(-) delete mode 100644 src/skills/AGENTS.md rename src/skills/{ => nix-style}/RULE-FORMAT.md (100%) create mode 100644 src/skills/rust-style/RULE-FORMAT.md delete mode 100644 src/skills/style-skill.md diff --git a/src/skills/AGENTS.md b/src/skills/AGENTS.md deleted file mode 100644 index e69de29..0000000 diff --git a/src/skills/RULE-FORMAT.md b/src/skills/nix-style/RULE-FORMAT.md similarity index 100% rename from src/skills/RULE-FORMAT.md rename to src/skills/nix-style/RULE-FORMAT.md diff --git a/src/skills/nix-style/SKILL.md b/src/skills/nix-style/SKILL.md index a3efce4..e943686 100644 --- a/src/skills/nix-style/SKILL.md +++ b/src/skills/nix-style/SKILL.md @@ -6,4 +6,29 @@ description: Use when creating, editing, or reviewing Nix files in this reposito # nix-style Use this skill as the source of truth for repository Nix conventions. -Follow the shared style skill instructions in `src/skills/style-skill.md`. + +## Load rules + +Read every Markdown file directly under [`rules/`](rules/) before applying this skill. +Resolve [`rules/`](rules/) relative to this `SKILL.md`. + +Finish when all discovered rule files have been read. + +## Apply rules + +Apply the loaded rules when editing or reviewing Nix files. +When loaded rules conflict, follow the most specific rule. + +After editing Nix files, run: + +```bash +nix run .#fix +``` + +Finish when `nix run .#fix` succeeds and the Nix change follows the loaded rules. +If the command fails, report the failure. + +## Maintain rules + +When adding or changing files under [`rules/`](rules/), read [`RULE-FORMAT.md`](RULE-FORMAT.md) first. +Finish when the changed rule files follow that format. diff --git a/src/skills/rust-style/RULE-FORMAT.md b/src/skills/rust-style/RULE-FORMAT.md new file mode 100644 index 0000000..8abe570 --- /dev/null +++ b/src/skills/rust-style/RULE-FORMAT.md @@ -0,0 +1,17 @@ +# Rule format + +Use this structure for each rule: + +```md +## Rule title + +### Rule + +State enforceable instructions. + +### Rationale + +Explain why the rule exists. +``` + +Add `### Examples` only when examples clarify the rule. diff --git a/src/skills/rust-style/SKILL.md b/src/skills/rust-style/SKILL.md index fdea8a0..694e787 100644 --- a/src/skills/rust-style/SKILL.md +++ b/src/skills/rust-style/SKILL.md @@ -6,4 +6,29 @@ description: Use when creating, editing, or reviewing Rust files in this reposit # rust-style Use this skill as the source of truth for repository Rust conventions. -Follow the shared style skill instructions in `src/skills/style-skill.md`. + +## Load rules + +Read every Markdown file directly under [`rules/`](rules/) before applying this skill. +Resolve [`rules/`](rules/) relative to this `SKILL.md`. + +Finish when all discovered rule files have been read. + +## Apply rules + +Apply the loaded rules when editing or reviewing Rust files. +When loaded rules conflict, follow the most specific rule. + +After editing Rust files, run: + +```bash +nix run .#fix +``` + +Finish when `nix run .#fix` succeeds and the Rust change follows the loaded rules. +If the command fails, report the failure. + +## Maintain rules + +When adding or changing files under [`rules/`](rules/), read [`RULE-FORMAT.md`](RULE-FORMAT.md) first. +Finish when the changed rule files follow that format. diff --git a/src/skills/style-skill.md b/src/skills/style-skill.md deleted file mode 100644 index 3351cde..0000000 --- a/src/skills/style-skill.md +++ /dev/null @@ -1,29 +0,0 @@ -# Style skill instructions - -Use this document for skills that own repository style conventions. - -## Load rules - -Read every Markdown file directly under `rules/` before applying the skill. -Resolve `rules/` relative to the skill's `SKILL.md`. - -Finish when all discovered rule files have been read. - -## Apply rules - -Apply the loaded rules when editing or reviewing files covered by the skill. -When loaded rules conflict, follow the most specific rule. - -After editing files covered by the skill, run: - -```bash -nix run .#fix -``` - -Finish when `nix run .#fix` succeeds and the change follows the loaded rules. -If the command fails, report the failure. - -## Maintain rules - -When adding or changing files under `rules/`, read the shared rule format at `src/skills/RULE-FORMAT.md` first. -Finish when the changed rule files follow that format.