From 5855bfa4cfb91a629e506b13bbcf16b25a478ecc Mon Sep 17 00:00:00 2001 From: JojiXavier Date: Wed, 10 Jun 2026 17:49:42 +0530 Subject: [PATCH 1/6] feat: add support for generating Claude Code rules and documentation index --- .gitignore | 2 + bin/_agents/claude.sh | 123 ++++++++++++++++++++++++++++++++++++++++++ bin/agentx.sh | 25 ++++++++- 3 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 bin/_agents/claude.sh diff --git a/.gitignore b/.gitignore index eb4b52b..01e118c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .cursor .agents +.claude .kiro +CLAUDE.md gen/ dist/ \ No newline at end of file diff --git a/bin/_agents/claude.sh b/bin/_agents/claude.sh new file mode 100644 index 0000000..08c3d6e --- /dev/null +++ b/bin/_agents/claude.sh @@ -0,0 +1,123 @@ +#!/usr/bin/env bash +set -euo pipefail + +_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=bin/_agents/_lib.sh +source "$_LIB_DIR/_lib.sh" + +RULES_ROOT_DIR="$1" +SKILLS_ROOT_DIR="$2" +BASE_DIR="${3:-.}" +EXCLUSIVE_ROOT_DIR="${4:-}" +# If BASE_DIR is empty (passed as ""), default to . +if [[ -z "$BASE_DIR" ]]; then + BASE_DIR="." +fi + +CLEAN="${5:-false}" + +RULES_DIR="$BASE_DIR/.claude/rules" +MANIFEST="$BASE_DIR/.claude/.agentx-manifest" + +# With --clean, remove files generated by the previous run (per the +# manifest) before regenerating. Hand-added files aren't in the manifest, +# so they are preserved. +if [[ "$CLEAN" == "true" ]]; then + manifest_clean "$MANIFEST" "$BASE_DIR" "$RULES_DIR" + rm -f "$BASE_DIR/CLAUDE.md" +fi + +mkdir -p "$RULES_DIR" +manifest_init "$MANIFEST" + +# Collects rule/skill names for the CLAUDE.md index. +RULE_ENTRIES=() + +# Helper function to process rules +# Claude Code uses plain markdown — no frontmatter. +process_rules() { + local src_dir="$1" + + if [[ ! -d "$src_dir" ]]; then return; fi + + while IFS= read -r -d '' rule_file; do + local rel_path filename output_file description + rel_path="${rule_file#"$src_dir"/}" + # Replace slashes with underscores for the output filename + filename="${rel_path//\//_}" + output_file="$RULES_DIR/$filename" + + description="$(fm_field "$rule_file" description)" + + # Claude Code: plain markdown, no frontmatter + fm_body "$rule_file" > "$output_file" + record_generated "$MANIFEST" "$BASE_DIR" "$output_file" + + # Collect for CLAUDE.md index + local label="${filename%.md}" + if [[ -n "$description" ]]; then + RULE_ENTRIES+=("- **${label}**: ${description}") + else + RULE_ENTRIES+=("- **${label}**") + fi + done < <(find "$src_dir" -name "*.md" -print0 | sort -z) +} + +# Helper function to process skills +# Claude Code has no native skills — flatten into .claude/rules/. +process_skills() { + local src_dir="$1" + + if [[ ! -d "$src_dir" ]]; then return; fi + + while IFS= read -r -d '' skill_file; do + local skill_name output_file description + skill_name="$(basename "$(dirname "$skill_file")")" + output_file="$RULES_DIR/${skill_name}.md" + + description="$(fm_field "$skill_file" description)" + + # Claude Code: plain markdown, no frontmatter + fm_body "$skill_file" > "$output_file" + record_generated "$MANIFEST" "$BASE_DIR" "$output_file" + + # Collect for CLAUDE.md index + if [[ -n "$description" ]]; then + RULE_ENTRIES+=("- **${skill_name}** (skill): ${description}") + else + RULE_ENTRIES+=("- **${skill_name}** (skill)") + fi + done < <(find "$src_dir" -name "SKILL.md" -print0 | sort -z) +} + +# 1. Process Core Rules +process_rules "$RULES_ROOT_DIR" + +# 2. Process Core Skills +process_skills "$SKILLS_ROOT_DIR" + +# 3. Process Exclusive content if provided +if [[ -n "$EXCLUSIVE_ROOT_DIR" ]] && [[ -d "$EXCLUSIVE_ROOT_DIR" ]]; then + echo "Applying exclusive content from: $EXCLUSIVE_ROOT_DIR" + process_rules "$EXCLUSIVE_ROOT_DIR/rules" + process_skills "$EXCLUSIVE_ROOT_DIR/skills" +fi + +# 4. Generate root CLAUDE.md index +CLAUDE_MD="$BASE_DIR/CLAUDE.md" +{ + echo "# Project Rules" + echo "" + echo "This project uses modular rules in \`.claude/rules/\`." + echo "All rules are auto-generated by agentx — do not edit them directly." + echo "" + echo "## Rules Index" + echo "" + for entry in "${RULE_ENTRIES[@]}"; do + echo "$entry" + done + echo "" +} > "$CLAUDE_MD" +record_generated "$MANIFEST" "$BASE_DIR" "$CLAUDE_MD" + +echo "Claude generation complete." diff --git a/bin/agentx.sh b/bin/agentx.sh index 589b1b5..739ce60 100755 --- a/bin/agentx.sh +++ b/bin/agentx.sh @@ -12,6 +12,7 @@ VERSION="dev" REPO_NAME="anoopsg/agent_rules" OUTPUT_DIR="" GEN_ANTIGRAVITY=true +GEN_CLAUDE=true GEN_CURSOR=true GEN_KIRO=true GEN_EXCLUSIVE=false @@ -51,6 +52,7 @@ BANNER resolve_target() { case "$1" in ag|antigravity) echo "antigravity" ;; + cl|claude) echo "claude" ;; cu|cursor) echo "cursor" ;; kr|kiro) echo "kiro" ;; *) return 1 ;; @@ -69,7 +71,7 @@ ARGUMENTS OPTIONS -t, --targets Comma-separated agents (default: all). - Values: antigravity (ag), cursor (cu), kiro (kr) + Values: antigravity (ag), claude (cl), cursor (cu), kiro (kr) -e, --exclusive Include opt-in content from exclusive/. -c, --clean Remove files generated by the previous run before writing (keeps hand-added files). @@ -86,6 +88,8 @@ EXAMPLES agentx -c . # Only Antigravity agentx -t ag . + # Only Claude Code CLI + agentx -t cl . # Cursor + Antigravity + Kiro with exclusive content agentx -t ag,cu,kr -e . EOF @@ -110,6 +114,20 @@ generate_antigravity() { gen_status "Antigravity" "$OUTPUT_DIR/.agents" } +generate_claude() { + local exclusive_path="" + if [ "$GEN_EXCLUSIVE" = true ]; then + exclusive_path="$EXCLUSIVE_DIR" + fi + bash "$SCRIPT_DIR/_agents/claude.sh" \ + "$RULES_DIR" \ + "$SKILLS_DIR" \ + "$OUTPUT_DIR" \ + "$exclusive_path" \ + "$GEN_CLEAN" >/dev/null + gen_status "Claude" "$OUTPUT_DIR/.claude" +} + generate_cursor() { local exclusive_path="" if [ "$GEN_EXCLUSIVE" = true ]; then @@ -216,6 +234,7 @@ main() { # First -t disables defaults; parse targets if [[ "$TARGETS_SET" = false ]]; then GEN_ANTIGRAVITY=false + GEN_CLAUDE=false GEN_CURSOR=false GEN_KIRO=false TARGETS_SET=true @@ -229,6 +248,7 @@ main() { } case "$_resolved" in antigravity) GEN_ANTIGRAVITY=true ;; + claude) GEN_CLAUDE=true ;; cursor) GEN_CURSOR=true ;; kiro) GEN_KIRO=true ;; esac @@ -302,6 +322,9 @@ main() { if [ "$GEN_ANTIGRAVITY" = true ]; then generate_antigravity fi + if [ "$GEN_CLAUDE" = true ]; then + generate_claude + fi if [ "$GEN_CURSOR" = true ]; then generate_cursor fi From d1036836f0ec46d5cb8ac439ea0712fa67ede3e8 Mon Sep 17 00:00:00 2001 From: JojiXavier Date: Wed, 10 Jun 2026 17:53:23 +0530 Subject: [PATCH 2/6] test: add validation assertions for Claude rules structure and index generation --- scripts/validate.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/validate.sh b/scripts/validate.sh index dc27046..df65097 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -92,7 +92,19 @@ assert_absent "$KS/core-code.md" "trigger: always" # skills are flattened to .md in steering/ assert_file "$KS/create-feature.md" -echo "== 6. --clean assertions ==" +echo "== 6. claude assertions ==" +CL="$OUT/.claude/rules" +# no frontmatter — plain markdown body only +assert_contains "$CL/core_code.md" "# Code Standards" +assert_absent "$CL/core_code.md" "trigger:" +assert_absent "$CL/core_code.md" "---" +# skills are flattened as plain rule files +assert_file "$CL/create-feature.md" +# CLAUDE.md index is generated at root +assert_file "$OUT/CLAUDE.md" +assert_contains "$OUT/CLAUDE.md" "## Rules Index" + +echo "== 7. --clean assertions ==" # Simulate a stale file from a prior run (recorded in the manifest) and a # hand-added user file (absent from the manifest). STALE="$OUT/.cursor/rules/core/stale.mdc" From 0e44da96d57e6c9bbce90c501cff40cdb8e71a2f Mon Sep 17 00:00:00 2001 From: JojiXavier Date: Wed, 10 Jun 2026 17:56:07 +0530 Subject: [PATCH 3/6] feat: add support for Claude Code CLI to documentation and generator configurations --- .gitignore | 1 - README.md | 27 ++++++++++++++++----------- bin/_agents/claude.sh | 36 ++---------------------------------- scripts/validate.sh | 3 --- 4 files changed, 18 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index 01e118c..a7bc44e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,5 @@ .agents .claude .kiro -CLAUDE.md gen/ dist/ \ No newline at end of file diff --git a/README.md b/README.md index ee64673..f4282e0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Agent Rules & Skills is the single source of truth for expert-level agent config ## Why This Exists -Different AI coding agents (Cursor, Antigravity, Kiro, etc.) each have their own configuration formats. Managing them independently leads to drift and inconsistency. This project solves that by: +Different AI coding agents (Antigravity, Claude, Cursor, Kiro, etc.) each have their own configuration formats. Managing them independently leads to drift and inconsistency. This project solves that by: - Authoring rules and skills **once**, in a clean Markdown format - Compiling them to agent-specific formats via a CLI tool @@ -41,6 +41,7 @@ agent_rules/ ├── agentx.sh # Main CLI entrypoint └── _agents/ ├── antigravity.sh # Antigravity generator + ├── claude.sh # Claude Code CLI generator ├── cursor.sh # Cursor generator └── kiro.sh # Kiro generator ``` @@ -84,13 +85,13 @@ agentx [OPTIONS] > Note: If using the source script, use `bin/agentx.sh`. If using the release asset, use `./agentx`. `OUTPUT_DIR` is the base directory of your project. The tool creates the -appropriate hidden directories (`.agents/`, `.cursor/`, `.kiro/`) inside it. +appropriate hidden directories (`.agents/`, `.claude/`, `.cursor/`, `.kiro/`) inside it. ### Options | Flag | Long Form | Description | |---|---|---| -| `-t` | `--targets ` | Comma-separated agents (default: all). Values: `antigravity` (`ag`), `cursor` (`cu`), `kiro` (`kr`) | +| `-t` | `--targets ` | Comma-separated agents (default: all). Values: `antigravity` (`ag`), `claude` (`cl`), `cursor` (`cu`), `kiro` (`kr`) | | `-e` | `--exclusive` | Include opt-in content from `exclusive/` | | `-c` | `--clean` | Remove files generated by the previous run before writing (preserves hand-added files) | | `-u` | `--update` | Update agentx binary to the latest release | @@ -112,8 +113,11 @@ agentx -c . # Only antigravity agentx -t ag . +# Only Claude Code CLI +agentx -t cl . + # Specific agents + exclusive -agentx -t ag,cu,kr -e . +agentx -t ag,cl,cu,kr -e . # Update the bundled binary ./agentx --update @@ -136,6 +140,7 @@ Rules and skills are compiled into the following output directories: | Agent | Rules | Skills | |---|---|---| | **Antigravity** | `.agents/rules/*.md` | `.agents/skills//SKILL.md` | +| **Claude** | `.claude/rules/*.md` | Flattened into `.claude/rules/*.md` | | **Cursor** | `.cursor/rules/**/*.mdc` | `.cursor/skills//SKILL.md` | | **Kiro** | `.kiro/steering/*.md` | `.kiro/steering/.md` | @@ -145,8 +150,8 @@ By default, generation **overwrites** matching files but leaves everything else untouched, so files you added by hand are safe — but files from a *previous* run that no longer have a source (renamed/deleted rules) linger. -Each run records what it produced in a manifest (`.cursor/.agentx-manifest`, -`.agents/.agentx-manifest`, `.kiro/.agentx-manifest`). Running with `--clean` removes exactly those +Each run records what it produced in a manifest (`.agents/.agentx-manifest`, +`.claude/.agentx-manifest`, `.cursor/.agentx-manifest`, `.kiro/.agentx-manifest`). Running with `--clean` removes exactly those previously-generated files before regenerating. Hand-added files are never in the manifest, so `--clean` never deletes them. @@ -181,11 +186,11 @@ description: When this rule should apply (required for `auto`). # Rule content... ``` -| Source `trigger` | Meaning | Cursor | Antigravity | Kiro | -|---|---|---|---|---| -| `always` | Always in context | `alwaysApply: true` | `trigger: always_on` | `inclusion: always` | -| `auto` | Agent decides via `description` | `description:` + `alwaysApply: false` | `trigger: model_decision` | `inclusion: auto` + `description` | -| `off` | Manual (`@`-mention) only | `alwaysApply: false` | `trigger: manual` | `inclusion: manual` | +| Source `trigger` | Meaning | Antigravity | Claude | Cursor | Kiro | +|---|---|---|---|---|---| +| `always` | Always in context | `trigger: always_on` | *(plain md, always active)* | `alwaysApply: true` | `inclusion: always` | +| `auto` | Agent decides via `description` | `trigger: model_decision` | *(plain md, always active)* | `description:` + `alwaysApply: false` | `inclusion: auto` + `description` | +| `off` | Manual (`@`-mention) only | `trigger: manual` | *(plain md, always active)* | `alwaysApply: false` | `inclusion: manual` | > `description` is required for `auto` rules — it's what the agent reads to > decide relevance. If `trigger` is omitted, it defaults to `always`. diff --git a/bin/_agents/claude.sh b/bin/_agents/claude.sh index 08c3d6e..d6973a3 100644 --- a/bin/_agents/claude.sh +++ b/bin/_agents/claude.sh @@ -24,14 +24,12 @@ MANIFEST="$BASE_DIR/.claude/.agentx-manifest" # so they are preserved. if [[ "$CLEAN" == "true" ]]; then manifest_clean "$MANIFEST" "$BASE_DIR" "$RULES_DIR" - rm -f "$BASE_DIR/CLAUDE.md" fi mkdir -p "$RULES_DIR" manifest_init "$MANIFEST" -# Collects rule/skill names for the CLAUDE.md index. -RULE_ENTRIES=() + # Helper function to process rules # Claude Code uses plain markdown — no frontmatter. @@ -52,14 +50,6 @@ process_rules() { # Claude Code: plain markdown, no frontmatter fm_body "$rule_file" > "$output_file" record_generated "$MANIFEST" "$BASE_DIR" "$output_file" - - # Collect for CLAUDE.md index - local label="${filename%.md}" - if [[ -n "$description" ]]; then - RULE_ENTRIES+=("- **${label}**: ${description}") - else - RULE_ENTRIES+=("- **${label}**") - fi done < <(find "$src_dir" -name "*.md" -print0 | sort -z) } @@ -80,13 +70,6 @@ process_skills() { # Claude Code: plain markdown, no frontmatter fm_body "$skill_file" > "$output_file" record_generated "$MANIFEST" "$BASE_DIR" "$output_file" - - # Collect for CLAUDE.md index - if [[ -n "$description" ]]; then - RULE_ENTRIES+=("- **${skill_name}** (skill): ${description}") - else - RULE_ENTRIES+=("- **${skill_name}** (skill)") - fi done < <(find "$src_dir" -name "SKILL.md" -print0 | sort -z) } @@ -103,21 +86,6 @@ if [[ -n "$EXCLUSIVE_ROOT_DIR" ]] && [[ -d "$EXCLUSIVE_ROOT_DIR" ]]; then process_skills "$EXCLUSIVE_ROOT_DIR/skills" fi -# 4. Generate root CLAUDE.md index -CLAUDE_MD="$BASE_DIR/CLAUDE.md" -{ - echo "# Project Rules" - echo "" - echo "This project uses modular rules in \`.claude/rules/\`." - echo "All rules are auto-generated by agentx — do not edit them directly." - echo "" - echo "## Rules Index" - echo "" - for entry in "${RULE_ENTRIES[@]}"; do - echo "$entry" - done - echo "" -} > "$CLAUDE_MD" -record_generated "$MANIFEST" "$BASE_DIR" "$CLAUDE_MD" + echo "Claude generation complete." diff --git a/scripts/validate.sh b/scripts/validate.sh index df65097..2f04d31 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -100,9 +100,6 @@ assert_absent "$CL/core_code.md" "trigger:" assert_absent "$CL/core_code.md" "---" # skills are flattened as plain rule files assert_file "$CL/create-feature.md" -# CLAUDE.md index is generated at root -assert_file "$OUT/CLAUDE.md" -assert_contains "$OUT/CLAUDE.md" "## Rules Index" echo "== 7. --clean assertions ==" # Simulate a stale file from a prior run (recorded in the manifest) and a From 0c8206cc5ece95339ff3468c8bf550253630e741 Mon Sep 17 00:00:00 2001 From: JojiXavier Date: Wed, 10 Jun 2026 18:28:13 +0530 Subject: [PATCH 4/6] feat: transition Claude agent from flattened rule files to native skill directory structure --- README.md | 2 +- bin/_agents/claude.sh | 9 ++++++--- scripts/validate.sh | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f4282e0..0c5ab13 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ Rules and skills are compiled into the following output directories: | Agent | Rules | Skills | |---|---|---| | **Antigravity** | `.agents/rules/*.md` | `.agents/skills//SKILL.md` | -| **Claude** | `.claude/rules/*.md` | Flattened into `.claude/rules/*.md` | +| **Claude** | `.claude/rules/*.md` | `.claude/skills//SKILL.md` | | **Cursor** | `.cursor/rules/**/*.mdc` | `.cursor/skills//SKILL.md` | | **Kiro** | `.kiro/steering/*.md` | `.kiro/steering/.md` | diff --git a/bin/_agents/claude.sh b/bin/_agents/claude.sh index d6973a3..4701370 100644 --- a/bin/_agents/claude.sh +++ b/bin/_agents/claude.sh @@ -23,7 +23,7 @@ MANIFEST="$BASE_DIR/.claude/.agentx-manifest" # manifest) before regenerating. Hand-added files aren't in the manifest, # so they are preserved. if [[ "$CLEAN" == "true" ]]; then - manifest_clean "$MANIFEST" "$BASE_DIR" "$RULES_DIR" + manifest_clean "$MANIFEST" "$BASE_DIR" "$RULES_DIR" "$BASE_DIR/.claude/skills" fi mkdir -p "$RULES_DIR" @@ -61,9 +61,12 @@ process_skills() { if [[ ! -d "$src_dir" ]]; then return; fi while IFS= read -r -d '' skill_file; do - local skill_name output_file description + local skill_name output_dir output_file description skill_name="$(basename "$(dirname "$skill_file")")" - output_file="$RULES_DIR/${skill_name}.md" + output_dir="$BASE_DIR/.claude/skills/${skill_name}" + output_file="$output_dir/SKILL.md" + + mkdir -p "$output_dir" description="$(fm_field "$skill_file" description)" diff --git a/scripts/validate.sh b/scripts/validate.sh index 2f04d31..4eff7de 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -98,8 +98,8 @@ CL="$OUT/.claude/rules" assert_contains "$CL/core_code.md" "# Code Standards" assert_absent "$CL/core_code.md" "trigger:" assert_absent "$CL/core_code.md" "---" -# skills are flattened as plain rule files -assert_file "$CL/create-feature.md" +# skills are natively supported in .claude/skills/ +assert_file "$OUT/.claude/skills/create-feature/SKILL.md" echo "== 7. --clean assertions ==" # Simulate a stale file from a prior run (recorded in the manifest) and a From 5a30adb0cb60f9c6d41eabe0202bfabfa658946f Mon Sep 17 00:00:00 2001 From: JojiXavier Date: Wed, 10 Jun 2026 18:32:35 +0530 Subject: [PATCH 5/6] refactor: remove unused description variable extraction in rule and skill processing --- bin/_agents/claude.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/_agents/claude.sh b/bin/_agents/claude.sh index 4701370..ff671a9 100644 --- a/bin/_agents/claude.sh +++ b/bin/_agents/claude.sh @@ -39,14 +39,12 @@ process_rules() { if [[ ! -d "$src_dir" ]]; then return; fi while IFS= read -r -d '' rule_file; do - local rel_path filename output_file description + local rel_path filename output_file rel_path="${rule_file#"$src_dir"/}" # Replace slashes with underscores for the output filename filename="${rel_path//\//_}" output_file="$RULES_DIR/$filename" - description="$(fm_field "$rule_file" description)" - # Claude Code: plain markdown, no frontmatter fm_body "$rule_file" > "$output_file" record_generated "$MANIFEST" "$BASE_DIR" "$output_file" @@ -61,15 +59,13 @@ process_skills() { if [[ ! -d "$src_dir" ]]; then return; fi while IFS= read -r -d '' skill_file; do - local skill_name output_dir output_file description + local skill_name output_dir output_file skill_name="$(basename "$(dirname "$skill_file")")" output_dir="$BASE_DIR/.claude/skills/${skill_name}" output_file="$output_dir/SKILL.md" mkdir -p "$output_dir" - description="$(fm_field "$skill_file" description)" - # Claude Code: plain markdown, no frontmatter fm_body "$skill_file" > "$output_file" record_generated "$MANIFEST" "$BASE_DIR" "$output_file" From 77c80214a0f0966e134207cdd7506886633d3cb6 Mon Sep 17 00:00:00 2001 From: JojiXavier Date: Wed, 10 Jun 2026 18:46:45 +0530 Subject: [PATCH 6/6] refactor: update validation script to support native Claude skills cleanup and manifest verification --- bin/_agents/claude.sh | 2 +- scripts/validate.sh | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/_agents/claude.sh b/bin/_agents/claude.sh index ff671a9..9e2318c 100644 --- a/bin/_agents/claude.sh +++ b/bin/_agents/claude.sh @@ -52,7 +52,7 @@ process_rules() { } # Helper function to process skills -# Claude Code has no native skills — flatten into .claude/rules/. +# Claude Code supports native skills via .claude/skills//SKILL.md process_skills() { local src_dir="$1" diff --git a/scripts/validate.sh b/scripts/validate.sh index 4eff7de..8c82b97 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -97,7 +97,6 @@ CL="$OUT/.claude/rules" # no frontmatter — plain markdown body only assert_contains "$CL/core_code.md" "# Code Standards" assert_absent "$CL/core_code.md" "trigger:" -assert_absent "$CL/core_code.md" "---" # skills are natively supported in .claude/skills/ assert_file "$OUT/.claude/skills/create-feature/SKILL.md" @@ -106,15 +105,23 @@ echo "== 7. --clean assertions ==" # hand-added user file (absent from the manifest). STALE="$OUT/.cursor/rules/core/stale.mdc" USER_RULE="$OUT/.cursor/rules/user-custom.mdc" +CLAUDE_STALE_SKILL="$OUT/.claude/skills/stale-skill/SKILL.md" + echo "stale" > "$STALE" echo ".cursor/rules/core/stale.mdc" >> "$OUT/.cursor/.agentx-manifest" echo "mine" > "$USER_RULE" -bash "$REPO_ROOT/bin/agentx.sh" -t cu -e -c "$OUT" >/dev/null -# Stale generated file is removed; user file survives; output regenerated. +mkdir -p "$(dirname "$CLAUDE_STALE_SKILL")" +echo "stale skill" > "$CLAUDE_STALE_SKILL" +echo ".claude/skills/stale-skill/SKILL.md" >> "$OUT/.claude/.agentx-manifest" + +bash "$REPO_ROOT/bin/agentx.sh" -t cu,cl -e -c "$OUT" >/dev/null +# Stale generated files are removed; user file survives; output regenerated. assert_no_file "$STALE" assert_file "$USER_RULE" assert_file "$CR/core/code.mdc" +assert_no_file "$CLAUDE_STALE_SKILL" +assert_file "$OUT/.claude/skills/create-feature/SKILL.md" echo "" echo "All $PASS checks passed."