feat: add global commands support with /branch command

Commands directory linked via junction, same as skills/rules.
Updated install/backup scripts and framework docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
beo3000 2026-02-09 15:28:55 +01:00
parent 9c53c43c84
commit 5b1c238395
5 changed files with 26 additions and 4 deletions

View File

@ -21,6 +21,7 @@ claude-meta/
| `rules/*.md` | **On-demand** via @import | ~50-80/Datei | Nur wenn thematisch relevant |
| `projekt/CLAUDE.md` | **Immer** im Projekt | 500-2000 | Build-Commands, Architektur |
| `skills/*.md` | **Nur bei /skill** Aufruf | 200-500 | Skill-Anweisungen |
| `commands/*.md` | **Nur bei /command** Aufruf | 200-500 | Command-Anweisungen |
| `settings.json` | **Nie** im Context | 0 | Intern verarbeitet (Permissions) |
| `memory/*.md` | **Nur wenn** referenziert | variabel | Via @import aus CLAUDE.md |
| `docs/FRAMEWORK.md` | **Nie** automatisch | 0 | Nur wenn manuell gelesen |
@ -38,6 +39,7 @@ Gilt für **alle Projekte** auf diesem Rechner:
- Git Workflow: `rules/git.md`
- Permissions: `settings.json` (46 konsolidierte Regeln)
- Skills: `/gemini-image`, `/review`, `/plan-project`
- Commands: `/branch` (globale Slash-Commands)
### Projekt-spezifisch (bleibt im Projekt-Repo)
- `CLAUDE.md` — Build-Commands, Architektur, Patterns
@ -56,6 +58,7 @@ Gilt für **alle Projekte** auf diesem Rechner:
|---|---|---|
| Neue globale Regel | `home-claude/rules/neue-regel.md` + @import in CLAUDE.md | git commit + push |
| Neuer Skill | `home-claude/skills/name/SKILL.md` | git commit + push |
| Neuer Command | `home-claude/commands/name.md` | git commit + push |
| Neue Permission | `home-claude/settings.json` allow-Array | git commit + push |
| Neues Projekt | `scripts/init-project.ps1 <pfad> <name>` | Editiere CLAUDE.md |
| Neuer Rechner | `git clone` + `scripts/install.ps1` | Fertig |
@ -91,6 +94,7 @@ cd ~/work/claude-meta
| `settings.json` | `home-claude/settings.json` | File-Symlink | Symlink |
| `skills/` | `home-claude/skills/` | Junction | Symlink |
| `rules/` | `home-claude/rules/` | Junction | Symlink |
| `commands/` | `home-claude/commands/` | Junction | Symlink |
**Wichtig**: `~/.claude/` selbst ist IMMER ein echtes Verzeichnis (nie symlinken — Claude Code Bug #764).

View File

@ -0,0 +1,18 @@
---
allowed-tools: Bash(git status:*), Bash(git branch:*), Bash(git checkout:*), Bash(git switch:*), AskUserQuestion
description: Check git status and create a new branch
---
## Context
- Current git status: !`git status --porcelain`
- Current branch: !`git branch --show-current`
- Existing branches: !`git branch -a`
## Your task
1. Check if working directory is clean (no uncommitted changes from git status above)
2. If there are uncommitted changes, warn user and stop
3. If clean, ask user for new branch name using AskUserQuestion
4. Create and switch to the new branch using `git checkout -b <branch-name>`
5. Confirm success with current branch info

View File

@ -25,7 +25,7 @@ foreach ($file in $files) {
}
# Backup directories
$dirs = @("skills", "rules")
$dirs = @("skills", "rules", "commands")
foreach ($dir in $dirs) {
$src = Join-Path $claudeDir $dir
if (Test-Path $src) {

View File

@ -73,7 +73,7 @@ foreach ($file in $files) {
}
# --- Directory Junctions ---
$dirs = @("skills", "rules")
$dirs = @("skills", "rules", "commands")
foreach ($dir in $dirs) {
$src = Join-Path $sourceDir $dir
$dst = Join-Path $claudeDir $dir

View File

@ -42,7 +42,7 @@ for file in CLAUDE.md settings.json; do
done
# Directory symlinks
for dir in skills rules; do
for dir in skills rules commands; do
src="$SOURCE_DIR/$dir"
dst="$CLAUDE_DIR/$dir"
@ -72,7 +72,7 @@ for file in CLAUDE.md settings.json; do
fi
done
for dir in skills rules; do
for dir in skills rules commands; do
dst="$CLAUDE_DIR/$dir"
if [ -d "$dst" ]; then
count=$(find "$dst" -type f | wc -l)