Compare commits

..

7 Commits

Author SHA1 Message Date
00cdb91f09 chore: move documentation files to old2 folder
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:29:53 +01:00
fa2165ac01 chore: move agents and skills to old2 folder
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:28:06 +01:00
6a6c3739e6 chore(settings): add padding config to statusLine
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:25:55 +01:00
7058eb2e50 feat(dashboard): add dashboard skill for milestone/issue overview
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:45:55 +01:00
f99f8f072e chore: update model names and gitea allowed-tools
- Use full model names (claude-haiku-4-5, etc.) in create-capability
- Add allowed-tools to gitea skill for tea/jq commands
- Set default model to opus in settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:45:51 +01:00
8f4fb16a09 fix(worktrees): fix tea issues title parsing for branch names
- tea issues output has title on line 2, not line 1
- Update sed command to extract from correct line
- Fixes branches being named "issue-N-" or "issue-N-untitled"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:45:37 +01:00
3983a6ba24 feat(code-reviewer): auto-merge approved PRs with rebase
- Add step 5 to merge approved PRs using tea pulls merge --style rebase
- Clean up branch after merge with tea pulls clean
- Update role description and outputs to reflect merge responsibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:45:32 +01:00
48 changed files with 160 additions and 368 deletions

View File

@@ -21,7 +21,8 @@ Review one PR completely:
2. Analyze the code changes 2. Analyze the code changes
3. Check for quality, bugs, tests, documentation 3. Check for quality, bugs, tests, documentation
4. Post concise review comment (issues with file:line, no fluff) 4. Post concise review comment (issues with file:line, no fluff)
5. Return verdict (approved or needs-work) 5. If approved: merge with rebase and delete branch
6. Return verdict (approved or needs-work)
## When Invoked ## When Invoked
@@ -32,6 +33,7 @@ You receive:
You produce: You produce:
- Concise review comment on PR (issues with file:line, no thanking/fluff) - Concise review comment on PR (issues with file:line, no thanking/fluff)
- If approved: merged PR and deleted branch
- Verdict for orchestrator - Verdict for orchestrator
## Process ## Process
@@ -182,7 +184,20 @@ Implementation looks solid. No blocking issues found.
- Consider adding rate limiting - Consider adding rate limiting
``` ```
### 5. Output Result ### 5. If Approved: Merge and Clean Up
**Only if verdict is approved**, merge the PR and delete the branch:
```bash
tea pulls merge <PR_NUMBER> --style rebase
tea pulls clean <PR_NUMBER>
```
This rebases the PR onto main and deletes the source branch.
**If merge fails:** Still output the result with verdict "approved" but note the merge failure in the summary.
### 6. Output Result
**CRITICAL**: Your final output must be exactly this format: **CRITICAL**: Your final output must be exactly this format:
@@ -194,7 +209,7 @@ summary: <1-2 sentences>
``` ```
**Verdict values:** **Verdict values:**
- `approved` - PR is ready to merge - `approved` - PR is ready to merge (and was merged if step 5 succeeded)
- `needs-work` - PR has issues that must be fixed - `needs-work` - PR has issues that must be fixed
**Important:** **Important:**

View File

@@ -3,6 +3,9 @@ name: gitea
model: claude-haiku-4-5 model: claude-haiku-4-5
description: View, create, and manage Gitea issues and pull requests using tea CLI. Use when working with issues, PRs, viewing issue details, creating pull requests, adding comments, merging PRs, or when the user mentions tea, gitea, issue numbers, or PR numbers. description: View, create, and manage Gitea issues and pull requests using tea CLI. Use when working with issues, PRs, viewing issue details, creating pull requests, adding comments, merging PRs, or when the user mentions tea, gitea, issue numbers, or PR numbers.
user-invocable: false user-invocable: false
allowed-tools:
- Bash(tea*)
- Bash(jq*)
--- ---
# Gitea CLI (tea) # Gitea CLI (tea)

View File

@@ -95,9 +95,9 @@ Create new capabilities following latest Anthropic best practices (progressive d
| Model | Use For | Cost vs Haiku | | Model | Use For | Cost vs Haiku |
|-------|---------|---------------| |-------|---------|---------------|
| `haiku` | Most skills and agents (DEFAULT) | Baseline | | `claude-haiku-4-5` | Most skills and agents (DEFAULT) | Baseline |
| `sonnet` | When Haiku would struggle (<80% success rate) | 12x more expensive | | `claude-sonnet-4-5` | When Haiku would struggle (<80% success rate) | 12x more expensive |
| `opus` | Deep reasoning, architectural analysis | 60x more expensive | | `claude-opus-4-5` | Deep reasoning, architectural analysis | 60x more expensive |
**Ask for justification if not Haiku:** **Ask for justification if not Haiku:**
- "This looks like a simple workflow. Should we try Haiku first?" - "This looks like a simple workflow. Should we try Haiku first?"

View File

@@ -0,0 +1,47 @@
---
name: dashboard
description: >
Display milestones with unblocked issues at a glance.
Use when you want to see project progress and which issues are ready to work on.
Invoke with /dashboard [milestone-name-filter]
model: claude-haiku-4-5
user-invocable: true
context: fork
allowed-tools:
- Bash(~/.claude/skills/dashboard/scripts/generate-dashboard.sh*)
---
# Dashboard
@~/.claude/skills/gitea/SKILL.md
Display all milestones and their unblocked issues. Issues are considered unblocked if they have no open blockers in their dependency list.
## Workflow
1. **Run the dashboard script** with the milestone filter argument (if provided):
```bash
~/.claude/skills/dashboard/scripts/generate-dashboard.sh "$1"
```
2. **Display the output** to the user
The script automatically:
- Fetches all milestones from the repository
- For each milestone, gets all open issues
- For each issue, checks dependencies with `tea issues deps list`
- Categorizes issues as unblocked (no open dependencies) or blocked (has open dependencies)
- Displays results grouped by milestone in this format:
```
## Milestone: Release 1.0
✓ Unblocked (3):
#42 Implement feature X
#43 Fix bug in Y
#45 Add tests for Z
⊘ Blocked (2):
#40 Feature A (blocked by #39)
#41 Feature B (blocked by #38, #37)
```

View File

@@ -0,0 +1,83 @@
#!/bin/bash
set -euo pipefail
# Generate dashboard showing milestones with unblocked/blocked issues
# Usage: ./generate-dashboard.sh [milestone-filter]
MILESTONE_FILTER="${1:-}"
# Get all milestones
milestones_json=$(tea milestones -o json)
# Parse milestone names
milestone_names=$(echo "$milestones_json" | jq -r '.[].title')
# Process each milestone
while IFS= read -r milestone; do
# Skip if filter provided and doesn't match
if [[ -n "$MILESTONE_FILTER" && ! "$milestone" =~ $MILESTONE_FILTER ]]; then
continue
fi
echo "## Milestone: $milestone"
echo ""
# Get open issues for this milestone
issues_json=$(tea issues --milestones "$milestone" --state open -o json 2>/dev/null || echo "[]")
# Skip empty milestones or invalid JSON
issue_count=$(echo "$issues_json" | jq -e 'length' 2>/dev/null || echo "0")
if [[ "$issue_count" -eq 0 ]]; then
echo "No open issues"
echo ""
continue
fi
# Arrays for categorizing issues
declare -a unblocked=()
declare -a blocked=()
# Process each issue
while IFS=$'\t' read -r number title; do
# Check dependencies (tea returns plain text "Issue #N has no dependencies" when empty)
deps_output=$(tea issues deps list "$number" -o json 2>/dev/null || echo "")
# If output contains "has no dependencies", treat as empty array
if [[ "$deps_output" == *"has no dependencies"* ]]; then
deps_json="[]"
else
deps_json="$deps_output"
fi
# Count open dependencies
open_deps=$(echo "$deps_json" | jq -r '[.[] | select(.state == "open")] | length' 2>/dev/null || echo "0")
if [[ "$open_deps" -eq 0 ]]; then
# No open blockers - unblocked
unblocked+=("#$number $title")
else
# Has open blockers - blocked
blocker_list=$(echo "$deps_json" | jq -r '[.[] | select(.state == "open") | "#\(.index)"] | join(", ")')
blocked+=("#$number $title (blocked by $blocker_list)")
fi
done < <(echo "$issues_json" | jq -r '.[] | [.index, .title] | @tsv')
# Display unblocked issues
echo "✓ Unblocked (${#unblocked[@]}):"
if [[ ${#unblocked[@]} -eq 0 ]]; then
echo " (none)"
else
printf ' %s\n' "${unblocked[@]}"
fi
echo ""
# Display blocked issues
echo "⊘ Blocked (${#blocked[@]}):"
if [[ ${#blocked[@]} -eq 0 ]]; then
echo " (none)"
else
printf ' %s\n' "${blocked[@]}"
fi
echo ""
done <<< "$milestone_names"

View File

@@ -27,8 +27,8 @@ case "$MODE" in
WORKTREE_NAME="${REPO_NAME}-issue-${ISSUE_NUMBER}" WORKTREE_NAME="${REPO_NAME}-issue-${ISSUE_NUMBER}"
WORKTREE_PATH="${WORKTREES_DIR}/${WORKTREE_NAME}" WORKTREE_PATH="${WORKTREES_DIR}/${WORKTREE_NAME}"
# Get issue title for branch name # Get issue title for branch name (tea issues output has title on line 2: " # #1 Title here")
ISSUE_TITLE=$(tea issues "$ISSUE_NUMBER" 2>/dev/null | grep -i "title" | head -1 | cut -d: -f2- | xargs || echo "untitled") ISSUE_TITLE=$(tea issues "$ISSUE_NUMBER" 2>/dev/null | sed -n '2p' | sed 's/.*#[0-9]* //' | xargs || echo "untitled")
# Create safe branch name # Create safe branch name
BRANCH_NAME="issue-${ISSUE_NUMBER}-$(echo "$ISSUE_TITLE" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd '[:alnum:]-' | cut -c1-50)" BRANCH_NAME="issue-${ISSUE_NUMBER}-$(echo "$ISSUE_TITLE" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd '[:alnum:]-' | cut -c1-50)"

View File

@@ -25,9 +25,11 @@
}, },
"statusLine": { "statusLine": {
"type": "command", "type": "command",
"command": "input=$(cat); current_dir=$(echo \"$input\" | jq -r '.workspace.current_dir'); model=$(echo \"$input\" | jq -r '.model.display_name'); style=$(echo \"$input\" | jq -r '.output_style.name'); git_info=\"\"; if [ -d \"$current_dir/.git\" ]; then cd \"$current_dir\" && branch=$(git branch --show-current 2>/dev/null) && status=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ') && git_info=\" [$branch$([ \"$status\" != \"0\" ] && echo \"*\")]\"; fi; printf \"\\033[2m$(whoami)@$(hostname -s) $(basename \"$current_dir\")$git_info | $model ($style)\\033[0m\"" "command": "input=$(cat); current_dir=$(echo \"$input\" | jq -r '.workspace.current_dir'); model=$(echo \"$input\" | jq -r '.model.display_name'); style=$(echo \"$input\" | jq -r '.output_style.name'); git_info=\"\"; if [ -d \"$current_dir/.git\" ]; then cd \"$current_dir\" && branch=$(git branch --show-current 2>/dev/null) && status=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ') && git_info=\" [$branch$([ \"$status\" != \"0\" ] && echo \"*\")]\"; fi; printf \"\\033[2m$(whoami)@$(hostname -s) $(basename \"$current_dir\")$git_info | $model ($style)\\033[0m\"",
"padding": 0
}, },
"enabledPlugins": { "enabledPlugins": {
"gopls-lsp@claude-plugins-official": true "gopls-lsp@claude-plugins-official": true
} },
"model": "opus"
} }

View File

@@ -1,358 +0,0 @@
---
name: capability-writing
description: >
Guide for designing and creating capabilities for the architecture repository.
A capability is a cohesive set of components (skill + agent).
Use when creating new skills, agents, or extending the
AI workflow system. Includes templates, design guidance, and conventions.
user-invocable: false
---
# Capability Writing
How to design and create capabilities for the architecture repository using Anthropic's latest best practices (January 2025).
## Core Principles (NEW)
### 1. Conciseness is Critical
**Default assumption: Claude already knows.**
- Don't explain git, tea, standard CLI tools
- Don't explain concepts Claude understands
- Only add domain-specific context
- Keep main SKILL.md under 500 lines
**Bad:** "Git is a version control system. The commit command saves changes..."
**Good:** "`git commit -m 'feat: add feature'`"
### 2. Progressive Disclosure
Skills can bundle reference files and scripts that load/execute on-demand:
```
skill-name/
├── SKILL.md # Main workflow (200-500 lines)
├── best-practices.md # Detailed guidance (loaded when referenced)
├── examples/
│ ├── example1.md
│ └── example2.md
├── reference/
│ ├── api-docs.md
│ └── checklists.md
└── scripts/ # Bundled with this skill
├── validate.sh # Executed, not loaded into context
└── process.sh
```
**Benefits:**
- Main SKILL.md stays concise
- Reference files load only when Claude references them
- Scripts execute without consuming context tokens
- Each skill is self-contained
### 3. Script Bundling
Bundle error-prone bash operations as scripts within the skill:
**Instead of inline bash:**
```markdown
5. Create PR: `tea pulls create --title "..." --description "..."`
```
**Bundle a script:**
```markdown
5. **Create PR**: `./scripts/create-pr.sh $issue "$title"`
```
```bash
# In skill-name/scripts/create-pr.sh
#!/bin/bash
set -e
# Script handles errors, retries, validation
```
**When to bundle scripts:**
- Operations with complex error handling
- Operations that need retries
- Operations with multiple validation steps
- Fragile bash operations
### 4. Degrees of Freedom
Match instruction style to task fragility:
| Degree | When | Example |
|--------|------|---------|
| **High** (text) | Multiple valid approaches | "Review code quality and suggest improvements" |
| **Medium** (template) | Preferred pattern with variation | "Use this template, customize as needed" |
| **Low** (script) | Fragile operation, exact sequence | "Run: `./scripts/validate.sh`" |
### 5. Model Selection (UPDATED)
**New guidance:** Default to Haiku, justify if not.
| Model | Use When | Cost vs Haiku |
|-------|----------|---------------|
| **Haiku** | Simple workflows, validated steps, with scripts | Baseline |
| **Sonnet** | When Haiku testing shows <80% success rate | 12x more expensive |
| **Opus** | Deep reasoning, architectural judgment | 60x more expensive |
**Haiku works well when:**
- Steps are simple and validated
- Instructions are concise
- Error-prone operations use scripts
- Outputs have structured templates
**Test with Haiku first.** Only upgrade if needed.
## Component Overview
| Component | Location | Purpose | Example |
|-----------|----------|---------|---------|
| **User-invocable Skill** | `skills/name/SKILL.md` | Workflow users trigger with `/name` | /work-issue, /dashboard |
| **Background Skill** | `skills/name/SKILL.md` | Knowledge auto-loaded when needed | gitea, issue-writing |
| **Agent** | `agents/name/AGENT.md` | Isolated subtask handler | code-reviewer |
## When to Use Each Component
### Decision Tree
```
Start here: What do you need?
|
+--> Just knowledge to apply automatically?
| --> Background skill (user-invocable: false)
|
+--> User-initiated workflow?
| --> User-invocable skill (user-invocable: true)
|
+--> Complex isolated work needing focused context?
| --> User-invocable skill + Agent
|
+--> New domain expertise + workflow + isolated work?
--> Full capability (background skill + user-invocable skill + agent)
```
**Detailed decision criteria:** See [best-practices.md](best-practices.md)
## Component Templates
### User-Invocable Skill Template
```yaml
---
name: skill-name
description: >
What this skill does and when to use it.
Use when [trigger conditions] or when user says /skill-name.
model: haiku
argument-hint: <required> [optional]
user-invocable: true
---
# Skill Title
@~/.claude/skills/relevant-skill/SKILL.md
Brief intro if needed.
1. **First step**: What to do
2. **Second step**: What to do next
3. **Ask for approval** before significant actions
4. **Execute** the approved actions
5. **Present results** with links and summary
```
**Complete template with all fields:** See [templates/user-invocable-skill.md](templates/user-invocable-skill.md)
### Background Skill Template
```yaml
---
name: skill-name
description: >
What this skill teaches and when to use it.
Include trigger conditions in description.
user-invocable: false
---
# Skill Name
Brief description of what this skill covers.
## Core Concepts
## Patterns and Templates
## Guidelines
## Examples
```
**Complete template:** See [templates/background-skill.md](templates/background-skill.md)
### Agent Template
```yaml
---
name: agent-name
description: What this agent does and when to spawn it
model: haiku
skills: skill1, skill2
disallowedTools:
- Edit # For read-only agents
- Write
---
You are a [role] specialist that [primary function].
## When Invoked
1. **Gather context**
2. **Analyze**
3. **Act**
4. **Report**
```
**Complete template:** See [templates/agent.md](templates/agent.md)
**Helper script template:** See [templates/helper-script.sh](templates/helper-script.sh)
## Structure Examples
### Simple Skill (< 300 lines, no scripts)
```
skills/simple-skill/
└── SKILL.md
```
### Progressive Disclosure (with reference files)
```
skills/complex-skill/
├── SKILL.md (~200 lines)
├── reference/
│ ├── detailed-guide.md
│ └── api-reference.md
└── examples/
└── usage-examples.md
```
### With Bundled Scripts
```
skills/skill-with-scripts/
├── SKILL.md
├── reference/
│ └── error-handling.md
└── scripts/
├── validate.sh
└── process.sh
```
**Detailed examples:** See [examples/](examples/) folder
## Referencing Skills
### In User-Invocable Skills
Use `@` file reference syntax to guarantee background skill content is loaded:
```markdown
@~/.claude/skills/gitea/SKILL.md
@~/.claude/skills/issue-writing/SKILL.md
```
**Important:** Do NOT use phrases like "Use the gitea skill" - file references guarantee the content is available.
### In Agents
List skill names in frontmatter (not paths):
```yaml
---
name: product-manager
skills: gitea, issue-writing, backlog-grooming
---
```
## Common Patterns
### Approval Workflow
```markdown
4. **Present plan** for approval
5. **If approved**, create the issues
6. **Present summary** with links
```
### Conditional Behavior
```markdown
## If issue number provided ($1):
1. Fetch specific issue
2. Process it
## If no argument (batch mode):
1. List all issues
2. Process each
```
### Spawning Agents
```markdown
9. **Auto-review**: Spawn the `code-reviewer` agent with the PR number
```
### Read-Only Agents
```yaml
---
name: code-reviewer
disallowedTools:
- Edit
- Write
---
```
## Quick Reference
**Frontmatter fields:** See [reference/frontmatter-fields.md](reference/frontmatter-fields.md)
**Model selection:** See [reference/model-selection.md](reference/model-selection.md)
**Anti-patterns:** See [reference/anti-patterns.md](reference/anti-patterns.md)
**Best practices:** See [best-practices.md](best-practices.md)
## Naming Conventions
| Component | Convention | Examples |
|-----------|------------|----------|
| Skill folder | kebab-case | `software-architecture`, `work-issue` |
| Skill file | UPPERCASE | `SKILL.md` |
| Agent folder | kebab-case | `code-reviewer`, `issue-worker` |
| Agent file | UPPERCASE | `AGENT.md` |
**Skills:** Name after domain/action (good: `gitea`, `work-issue`; bad: `utils`, `helpers`)
**Agents:** Name by role/persona (good: `code-reviewer`; bad: `helper`, `agent1`)
## Checklists
### Before Creating a User-Invocable Skill
- [ ] Workflow is used multiple times
- [ ] User explicitly triggers it (not automatic)
- [ ] Clear start and end points
- [ ] Frontmatter has `user-invocable: true`
- [ ] Description includes "Use when... or when user says /skill-name"
- [ ] Background skills referenced via `@~/.claude/skills/<name>/SKILL.md`
- [ ] Approval checkpoints before significant actions
- [ ] File at `skills/<name>/SKILL.md`
- [ ] **Model defaults to `haiku`** unless justified
### Before Creating a Background Skill
- [ ] Knowledge is used in multiple places (not just once)
- [ ] Existing skills do not already cover this domain
- [ ] Content is specific and actionable (not generic)
- [ ] Frontmatter has `user-invocable: false`
- [ ] Description includes trigger terms
- [ ] File at `skills/<name>/SKILL.md`
### Before Creating an Agent
- [ ] Built-in agents (Explore, Plan) are not sufficient
- [ ] Context isolation or skill composition is needed
- [ ] Clear role/persona emerges
- [ ] `model` selection is deliberate (default to `haiku`)
- [ ] `skills` list is right-sized (not too many)
- [ ] File at `agents/<name>/AGENT.md`