diff --git a/.pi/skills/nix-style b/.pi/skills/nix-style index 1622f88..cb71dea 120000 --- a/.pi/skills/nix-style +++ b/.pi/skills/nix-style @@ -1 +1 @@ -../../src/skills/nix-style \ No newline at end of file +../../src/skills/style/nix \ No newline at end of file diff --git a/.pi/skills/rust-style b/.pi/skills/rust-style index 37ed939..b48fcfb 120000 --- a/.pi/skills/rust-style +++ b/.pi/skills/rust-style @@ -1 +1 @@ -../../src/skills/rust-style \ No newline at end of file +../../src/skills/style/rust \ No newline at end of file diff --git a/src/skills/README.md b/src/skills/README.md index 75ed668..4c86489 100644 --- a/src/skills/README.md +++ b/src/skills/README.md @@ -6,6 +6,7 @@ This directory contains monorepo-owned agent skill sources. ```text src/skills/ Monorepo-owned skill sources +src/skills/// Grouped monorepo skill sources .pi/skills/ Monorepo-wide enabled Pi skill symlinks src//skills/ Project-owned skill sources src//.pi/skills/ Project-specific enabled Pi skill symlinks diff --git a/src/skills/nix-style/SKILL.md b/src/skills/nix-style/SKILL.md deleted file mode 100644 index e943686..0000000 --- a/src/skills/nix-style/SKILL.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: nix-style -description: Use when creating, editing, or reviewing Nix files in this repository. ---- - -# nix-style - -Use this skill as the source of truth for repository Nix conventions. - -## 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 deleted file mode 100644 index 8abe570..0000000 --- a/src/skills/rust-style/RULE-FORMAT.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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 deleted file mode 100644 index 694e787..0000000 --- a/src/skills/rust-style/SKILL.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: rust-style -description: Use when creating, editing, or reviewing Rust files in this repository. ---- - -# rust-style - -Use this skill as the source of truth for repository Rust conventions. - -## 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/nix-style/RULE-FORMAT.md b/src/skills/style/RULE-FORMAT.md similarity index 100% rename from src/skills/nix-style/RULE-FORMAT.md rename to src/skills/style/RULE-FORMAT.md diff --git a/src/skills/style/STYLE.md b/src/skills/style/STYLE.md new file mode 100644 index 0000000..f187806 --- /dev/null +++ b/src/skills/style/STYLE.md @@ -0,0 +1,29 @@ +# 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 `src/skills/style/RULE-FORMAT.md` first. +Finish when the changed rule files follow that format. diff --git a/src/skills/style/nix/SKILL.md b/src/skills/style/nix/SKILL.md new file mode 100644 index 0000000..e5f9058 --- /dev/null +++ b/src/skills/style/nix/SKILL.md @@ -0,0 +1,9 @@ +--- +name: nix-style +description: Use when creating, editing, or reviewing Nix files in this repository. +--- + +# nix-style + +Use this skill as the source of truth for repository Nix conventions. +Follow the shared style skill instructions in `src/skills/style/STYLE.md`. diff --git a/src/skills/nix-style/rules/flake.md b/src/skills/style/nix/rules/flake.md similarity index 100% rename from src/skills/nix-style/rules/flake.md rename to src/skills/style/nix/rules/flake.md diff --git a/src/skills/nix-style/rules/let.md b/src/skills/style/nix/rules/let.md similarity index 100% rename from src/skills/nix-style/rules/let.md rename to src/skills/style/nix/rules/let.md diff --git a/src/skills/style/rust/SKILL.md b/src/skills/style/rust/SKILL.md new file mode 100644 index 0000000..f9dd09b --- /dev/null +++ b/src/skills/style/rust/SKILL.md @@ -0,0 +1,9 @@ +--- +name: rust-style +description: Use when creating, editing, or reviewing Rust files in this repository. +--- + +# rust-style + +Use this skill as the source of truth for repository Rust conventions. +Follow the shared style skill instructions in `src/skills/style/STYLE.md`. diff --git a/src/skills/rust-style/rules/bazel.md b/src/skills/style/rust/rules/bazel.md similarity index 100% rename from src/skills/rust-style/rules/bazel.md rename to src/skills/style/rust/rules/bazel.md diff --git a/src/skills/rust-style/rules/tests.md b/src/skills/style/rust/rules/tests.md similarity index 100% rename from src/skills/rust-style/rules/tests.md rename to src/skills/style/rust/rules/tests.md