refactor: both tools import the same fragments; scope code comments by path

Codex reads ~/.codex/AGENTS.md, not ~/.agents/AGENTS.md, so the file
generated there last commit was inert. Both tools support @path imports,
which removes the generate-and-drift step entirely.

code-comments.md moves to ~/.claude/rules/ with paths frontmatter, so its
24 lines load only when a source file is read.
This commit is contained in:
naps62
2026-08-01 14:08:44 +00:00
parent 36372f85b2
commit ccfb5192f8
6 changed files with 44 additions and 42 deletions
+3 -5
View File
@@ -21,11 +21,9 @@
".claude/writing.md".source = "${agent-skills}/claude-md/writing.md";
".claude/operating.md".source = "${agent-skills}/claude-md/operating.md";
# Codex has no @import, so the fragments are concatenated into one file.
".agents/AGENTS.md".text = builtins.concatStringsSep "\n" [
(builtins.readFile "${agent-skills}/claude-md/operating.md")
(builtins.readFile "${agent-skills}/claude-md/writing.md")
];
# Path-scoped: loads only when Claude reads a matching source file.
".claude/rules/code-comments.md".source = "${agent-skills}/claude-md/code-comments.md";
};
}
# Hook wiring lives in ~/.claude/settings.json, which this module does not own.