From a06e21e315e9f4d105fb2e9f75b57aab96d3d8dc Mon Sep 17 00:00:00 2001 From: shahondin1624 Date: Mon, 16 Mar 2026 18:30:35 +0100 Subject: [PATCH] Restructure repo for Claude Code user-level deployment Move agent files into agents//AGENT.md convention, add install.sh symlink script with --uninstall support, and add placeholder directories for skills and output-styles. Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 53 ++++++++ .../acceptance-criteria-verifier/AGENT.md | 0 .../code-reviewer/AGENT.md | 0 .../issue-planner/AGENT.md | 0 .../issue-selector/AGENT.md | 0 .../plan-implementer/AGENT.md | 0 .../user-story-drafter/AGENT.md | 0 install.sh | 113 ++++++++++++++++++ output-styles/.gitkeep | 0 skills/.gitkeep | 0 10 files changed, 166 insertions(+) create mode 100644 README.md rename acceptance-criteria-verifier.md => agents/acceptance-criteria-verifier/AGENT.md (100%) rename code-reviewer.md => agents/code-reviewer/AGENT.md (100%) rename issue-planner.md => agents/issue-planner/AGENT.md (100%) rename issue-selector.md => agents/issue-selector/AGENT.md (100%) rename plan-implementer.md => agents/plan-implementer/AGENT.md (100%) rename user-story-drafter.md => agents/user-story-drafter/AGENT.md (100%) create mode 100755 install.sh create mode 100644 output-styles/.gitkeep create mode 100644 skills/.gitkeep diff --git a/README.md b/README.md new file mode 100644 index 0000000..6988dbb --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# Claude Code Agents + +A collection of custom Claude Code agents for software development workflows. + +## Included Agents + +| Agent | Description | +|-------|-------------| +| `acceptance-criteria-verifier` | Verifies implementation against acceptance criteria | +| `code-reviewer` | Performs code reviews | +| `issue-planner` | Creates implementation plans from issues | +| `issue-selector` | Helps select the next issue to work on | +| `plan-implementer` | Implements a plan step by step | +| `user-story-drafter` | Drafts user stories with Gitea integration | + +## Directory Structure + +``` +agents//AGENT.md — Agent definitions +skills//SKILL.md — Skill definitions (future) +output-styles/.md — Output style definitions (future) +install.sh — Symlink installer +``` + +## Installation + +```bash +git clone +cd agents +./install.sh +``` + +This symlinks all agents, skills, and output styles into `~/.claude/`. +Restart Claude Code to pick up the changes. + +To use a non-standard Claude home directory: + +```bash +CLAUDE_HOME=/path/to/claude ./install.sh +``` + +## Uninstall + +```bash +./install.sh --uninstall +``` + +Only removes symlinks that point back into this repo. + +## Adding New Agents + +1. Create `agents//AGENT.md` +2. Run `./install.sh` to symlink it into `~/.claude/agents/` diff --git a/acceptance-criteria-verifier.md b/agents/acceptance-criteria-verifier/AGENT.md similarity index 100% rename from acceptance-criteria-verifier.md rename to agents/acceptance-criteria-verifier/AGENT.md diff --git a/code-reviewer.md b/agents/code-reviewer/AGENT.md similarity index 100% rename from code-reviewer.md rename to agents/code-reviewer/AGENT.md diff --git a/issue-planner.md b/agents/issue-planner/AGENT.md similarity index 100% rename from issue-planner.md rename to agents/issue-planner/AGENT.md diff --git a/issue-selector.md b/agents/issue-selector/AGENT.md similarity index 100% rename from issue-selector.md rename to agents/issue-selector/AGENT.md diff --git a/plan-implementer.md b/agents/plan-implementer/AGENT.md similarity index 100% rename from plan-implementer.md rename to agents/plan-implementer/AGENT.md diff --git a/user-story-drafter.md b/agents/user-story-drafter/AGENT.md similarity index 100% rename from user-story-drafter.md rename to agents/user-story-drafter/AGENT.md diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..9e5715e --- /dev/null +++ b/install.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +CLAUDE_HOME="${CLAUDE_HOME:-$HOME/.claude}" + +UNINSTALL=false +if [[ "${1:-}" == "--uninstall" ]]; then + UNINSTALL=true +fi + +# link_directory SOURCE_BASE TARGET_BASE KIND +# Symlinks each subdirectory (or file for output-styles) from source into target. +link_directory() { + local source_base="$1" + local target_base="$2" + local kind="$3" + + if [[ ! -d "$source_base" ]]; then + return + fi + + mkdir -p "$target_base" + + for entry in "$source_base"/*/; do + # Skip if glob didn't match + [[ -d "$entry" ]] || continue + + local name + name="$(basename "$entry")" + local target="$target_base/$name" + local source + source="$(cd "$entry" && pwd)" + + if $UNINSTALL; then + if [[ -L "$target" ]]; then + local link_target + link_target="$(readlink -f "$target")" + if [[ "$link_target" == "$REPO_DIR"* ]]; then + rm "$target" + echo "Removed $kind symlink: $name" + else + echo "Skipped $name — symlink points outside this repo" + fi + fi + continue + fi + + if [[ -L "$target" ]]; then + rm "$target" + ln -s "$source" "$target" + echo "Updated $kind symlink: $name" + elif [[ -e "$target" ]]; then + echo "Warning: $target already exists and is not a symlink — skipping" + else + ln -s "$source" "$target" + echo "Linked $kind: $name" + fi + done + + # Handle plain files (for output-styles/*.md) + for entry in "$source_base"/*; do + [[ -f "$entry" ]] || continue + local name + name="$(basename "$entry")" + [[ "$name" == ".gitkeep" ]] && continue + + local target="$target_base/$name" + local source + source="$(cd "$(dirname "$entry")" && pwd)/$name" + + if $UNINSTALL; then + if [[ -L "$target" ]]; then + local link_target + link_target="$(readlink -f "$target")" + if [[ "$link_target" == "$REPO_DIR"* ]]; then + rm "$target" + echo "Removed $kind file symlink: $name" + else + echo "Skipped $name — symlink points outside this repo" + fi + fi + continue + fi + + if [[ -L "$target" ]]; then + rm "$target" + ln -s "$source" "$target" + echo "Updated $kind file symlink: $name" + elif [[ -e "$target" ]]; then + echo "Warning: $target already exists and is not a symlink — skipping" + else + ln -s "$source" "$target" + echo "Linked $kind file: $name" + fi + done +} + +if $UNINSTALL; then + echo "Uninstalling agents, skills, and output-styles from $CLAUDE_HOME ..." +else + echo "Installing agents, skills, and output-styles into $CLAUDE_HOME ..." +fi + +link_directory "$REPO_DIR/agents" "$CLAUDE_HOME/agents" "agent" +link_directory "$REPO_DIR/skills" "$CLAUDE_HOME/skills" "skill" +link_directory "$REPO_DIR/output-styles" "$CLAUDE_HOME/output-styles" "output-style" + +if $UNINSTALL; then + echo "Done. Symlinks pointing to this repo have been removed." +else + echo "Done. Restart Claude Code to pick up changes." +fi diff --git a/output-styles/.gitkeep b/output-styles/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/skills/.gitkeep b/skills/.gitkeep new file mode 100644 index 0000000..e69de29