diff --git a/README.md b/README.md index 3b0a3f2..d718a98 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,158 @@ -# claude +# claude-config -Config de claude \ No newline at end of file +Global Claude Code configuration — agents, skills, and project templates. + +--- + +## Overview + +This repo contains the global Claude Code setup used across all projects. + +``` +claude-config/ +├── CLAUDE.md # Global coding preferences (style, rules, workflow) +├── agents/ # Specialized agent definitions (called by skills or orchestrators) +├── skills/ # Slash commands (/analyze, /debug, /ship-feature, ...) +└── templates/ + └── project-CLAUDE.md # Template for per-project .claude/CLAUDE.md +``` + +**Architecture principle:** +- `skills/` = entry points you invoke manually via `/skill-name` +- `agents/` = execution units called by skills or by orchestrator agents +- A skill delegates to one or more agents — it never contains logic itself + +--- + +## Installation + +Clone the repo and symlink it into `~/.claude/`: + +```bash +git clone git@github.com:youruser/claude-config.git ~/claude-config + +mkdir -p ~/.claude + +ln -sf ~/claude-config/agents ~/.claude/agents +ln -sf ~/claude-config/skills ~/.claude/skills +ln -sf ~/claude-config/CLAUDE.md ~/.claude/CLAUDE.md +``` + +Symlinks mean any update to this repo is immediately active — no manual sync needed. + +Verify the skills are loaded: + +```bash +claude +/skills +``` + +You should see all custom skills listed (`analyze`, `debug`, `ship-feature`, etc.). + +--- + +## Available slash commands + +| Command | Description | +|---|---| +| `/analyze` | Deep analysis of code or a codebase before any modification | +| `/architect` | Design a robust and scalable system architecture | +| `/debug` | Find root cause and fix an issue precisely | +| `/implement` | Implement a feature following project conventions | +| `/refactor` | Improve code quality without changing behavior | +| `/review` | Strict code review with severity-graded issues | +| `/init-project` | Initialize a complete project from scratch (orchestrator) | +| `/ship-feature` | Deliver a feature end-to-end via multi-agent pipeline (orchestrator) | + +Orchestrators (`/init-project`, `/ship-feature`) coordinate multiple agents sequentially with validation gates. +Standalone skills (`/analyze`, `/debug`, etc.) invoke a single specialized agent. + +--- + +## Agent pipeline (ship-feature) + +``` +/ship-feature + └── ship-feature (orchestrator) + ├── analyzer → understand the problem + ├── designer → design the solution + ├── [validation gate — waits for user approval] + ├── implementer → write the code + ├── reviewer → review loop (max 3 iterations) + └── tester → define test strategy +``` + +--- + +## Per-project setup + +Each project gets its own `.claude/CLAUDE.md` for local context and overrides. + +```bash +# In your project root +mkdir -p .claude +cp ~/claude-config/templates/project-CLAUDE.md .claude/CLAUDE.md +``` + +Then fill in the relevant sections: build commands, test commands, conventions, +architecture, and any exceptions to global rules. + +**Override rules:** +- Local `.claude/` takes precedence over global `~/.claude/` for identical filenames +- Files not defined locally fall back to global automatically +- Use local overrides only for project-specific deviations — keep global rules generic + +--- + +## Updating + +```bash +cd ~/claude-config +git pull +``` + +Changes are immediately active via symlinks. No restart needed for agents and skills +(Claude Code reloads them at the start of each session). + +--- + +## Adding a new skill or agent + +**New standalone skill** (single agent): + +1. Create `agents/myagent.md` — define role, tasks, rules, output format +2. Create `skills/myskill.md`: + +```markdown +--- +name: myskill +description: One-line description of what this skill does +argument-hint: +--- + +Load and follow strictly: +- .claude/agents/myagent.md + +Execute the MYAGENT agent on the following request: + +$ARGUMENTS +``` + +**New orchestrator skill** (multiple agents): + +1. Create `agents/myorchestrator.md` — define the workflow and agent call sequence +2. Create `skills/myorchestrator.md` referencing all involved agents + +--- + +## Extending per project + +If a project needs a modified version of an agent, place it in `.claude/agents/`: + +```bash +# Override the implementer for a specific project +cp ~/claude-config/agents/implementer.md .claude/agents/implementer.md +# Edit to add project-specific constraints +``` + +The local version takes precedence. All other agents continue to load from global. \ No newline at end of file diff --git a/claude.tar b/claude.tar new file mode 100644 index 0000000..f53dab9 Binary files /dev/null and b/claude.tar differ diff --git a/skills/analyze.md b/skills/analyze.md index 64b618a..cb50d72 100644 --- a/skills/analyze.md +++ b/skills/analyze.md @@ -1,23 +1,12 @@ -ROLE -You are a senior software engineer specialized in code analysis. +--- +name: analyze +description: Analyze code or a codebase deeply before any modification +argument-hint: +--- -OBJECTIF -Understand the provided code or project deeply before any modification. +Load and follow strictly: +- .claude/agents/analyzer.md -CONTRAINTES -- Do not modify anything -- Do not assume missing behavior -- Stay factual +Execute the ANALYZER agent on the following target: -PROCESS -1. Identify the purpose of the code -2. Identify main components (functions, modules, flows) -3. Explain data flow -4. Detect potential issues or unclear parts -5. Highlight complexity or risks - -OUTPUT -- Summary of what the code does -- Key components -- Data flow explanation -- Risks / unclear areas \ No newline at end of file +$ARGUMENTS diff --git a/skills/architect.md b/skills/architect.md new file mode 100644 index 0000000..e1429d0 --- /dev/null +++ b/skills/architect.md @@ -0,0 +1,12 @@ +--- +name: architect +description: Design a robust and scalable system architecture +argument-hint: +--- + +Load and follow strictly: +- .claude/agents/architect.md + +Execute the ARCHITECT agent on the following request: + +$ARGUMENTS diff --git a/skills/debug.md b/skills/debug.md index 8a8e13d..180fad7 100644 --- a/skills/debug.md +++ b/skills/debug.md @@ -1,24 +1,12 @@ -ROLE -You are a senior engineer specialized in debugging. +--- +name: debug +description: Find root cause and fix an issue precisely +argument-hint: +--- -OBJECTIF -Find root cause and fix the issue. +Load and follow strictly: +- .claude/agents/debugger.md -CONTRAINTES -- Do not patch blindly -- Identify root cause first -- Preserve existing behavior outside the fix +Execute the DEBUGGER agent on the following issue: -PROCESS -1. Understand expected behavior -2. Reconstruct failing scenario -3. Trace execution path -4. Identify root cause -5. Implement minimal fix -6. Check for side effects - -OUTPUT -- Root cause -- Fix explanation -- Code changes -- Edge cases to watch \ No newline at end of file +$ARGUMENTS diff --git a/skills/implement.md b/skills/implement.md index bf027c8..33090e6 100644 --- a/skills/implement.md +++ b/skills/implement.md @@ -1,25 +1,12 @@ -ROLE -You are a senior engineer implementing a feature. +--- +name: implement +description: Implement a feature cleanly following project conventions +argument-hint: +--- -OBJECTIF -Implement the requested feature cleanly and safely. +Load and follow strictly: +- .claude/agents/implementer.md -CONTRAINTES -- Follow project conventions -- Respect existing architecture -- Preserve existing behavior -- Follow strict code quality rules (see CLAUDE.md global) +Execute the IMPLEMENTER agent on the following request: -PROCESS -1. Analyze existing code -2. Identify integration points -3. Propose minimal design -4. Implement step by step -5. Ensure no regression -6. Keep code readable and modular - -OUTPUT -- Explanation of approach -- Code changes -- Impacted parts -- Potential risks \ No newline at end of file +$ARGUMENTS diff --git a/skills/init-project.md b/skills/init-project.md new file mode 100644 index 0000000..ee47cb9 --- /dev/null +++ b/skills/init-project.md @@ -0,0 +1,17 @@ +--- +name: init-project +description: Initialize a complete project from scratch with structure, stack, and base files +argument-hint: +--- + +Load and follow strictly: +- .claude/agents/init-project.md +- .claude/agents/analyzer.md +- .claude/agents/designer.md +- .claude/agents/implementer.md +- .claude/agents/reviewer.md +- .claude/agents/tester.md + +Execute the orchestrator defined in .claude/agents/init-project.md with the following request: + +$ARGUMENTS diff --git a/skills/refactor.md b/skills/refactor.md index 1f033f7..6d79c80 100644 --- a/skills/refactor.md +++ b/skills/refactor.md @@ -1,24 +1,12 @@ -ROLE -You are a senior engineer performing a safe refactor. +--- +name: refactor +description: Improve code quality without changing behavior +argument-hint: +--- -OBJECTIF -Improve code quality without changing behavior. +Load and follow strictly: +- .claude/agents/refactorer.md -CONTRAINTES -- Zero functional change -- Follow global coding standards -- Remove legacy residue -- Respect project conventions +Execute the REFACTORER agent on the following target: -PROCESS -1. Identify problems (complexity, duplication, readability) -2. Propose refactor plan -3. Apply small safe transformations -4. Ensure behavior is unchanged -5. Remove outdated or unused code - -OUTPUT -- What was improved -- Before/after reasoning -- Any deviations from standards (with justification) -- Confirmation that no old logic remains \ No newline at end of file +$ARGUMENTS diff --git a/skills/review.md b/skills/review.md index 0daa6fd..4909f38 100644 --- a/skills/review.md +++ b/skills/review.md @@ -1,25 +1,12 @@ -ROLE -You are a strict but pragmatic code reviewer. +--- +name: review +description: Strict code review with severity-graded issues +argument-hint: +--- -OBJECTIF -Evaluate code quality and compliance with standards. +Load and follow strictly: +- .claude/agents/reviewer.md -CONTRAINTES -- Apply global coding standards -- Be precise, not verbose -- Distinguish critical vs minor issues +Execute the REVIEWER agent on the following code: -PROCESS -1. Check structure and readability -2. Check function size and responsibilities -3. Check parameters and variables -4. Check naming clarity -5. Detect code smells -6. Identify deviations from standards -7. Evaluate justification of deviations - -OUTPUT -- Critical issues -- Improvements -- Deviations from standard -- Justified vs unjustified deviations \ No newline at end of file +$ARGUMENTS diff --git a/skills/ship-feature.md b/skills/ship-feature.md new file mode 100644 index 0000000..9fe37a1 --- /dev/null +++ b/skills/ship-feature.md @@ -0,0 +1,17 @@ +--- +name: ship-feature +description: Ship a feature end-to-end via multi-agent orchestrator +argument-hint: +--- + +Load and follow strictly these agent files: +- .claude/agents/ship-feature.md +- .claude/agents/analyzer.md +- .claude/agents/designer.md +- .claude/agents/implementer.md +- .claude/agents/reviewer.md +- .claude/agents/tester.md + +Execute the orchestrator defined in .claude/agents/ship-feature.md with the following request: + +$ARGUMENTS diff --git a/projet/CLAUDE.md b/templates/project-CLAUDE.md similarity index 100% rename from projet/CLAUDE.md rename to templates/project-CLAUDE.md