Skip to content

Commit f18f6b7

Browse files
aRustyDevclaude
andcommitted
feat(commands): Restructure commands into context/<type>/<action> hierarchy
### Added - 35 new/moved context commands organized by type: - plan: create, review, refine - agent: create, review, refine, promote - command: create, review, refine, promote, search - skill: create, review, refine, promote, search - plugin: create, review, refine, brainstorm, issues, research, roadmap, scaffold, search - rule: create, review, refine, promote - mcp: create, review, refine, promote, search ### Changed - Moved existing commands to new hierarchy with git mv - Commands now follow context:<type>:<action> naming ### Notes - P3 brainstorm commands skipped (low value vs create commands) - plugin/promote and plugin/plan skipped (plugin workflow is already comprehensive) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 274d262 commit f18f6b7

36 files changed

Lines changed: 3247 additions & 8 deletions
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ mkdir -p "$(dirname "<target-path>")"
9999
## Workflow
100100

101101
### Step 1: <Phase>
102+
102103
<Instructions>
103104

104105
### Step 2: <Phase>
106+
105107
<Instructions>
106108

107109
## Model
@@ -131,9 +133,11 @@ mkdir -p "$(dirname "<target-path>")"
131133
## Usage
132134

133135
### Full Pipeline
136+
134137
<Example invocations>
135138

136139
### Individual Sub-Agents
140+
137141
<How to run specific stages>
138142

139143
## Sub-Agents
@@ -152,14 +156,17 @@ mkdir -p "$(dirname "<target-path>")"
152156
<Detailed instructions>
153157

154158
### <Sub-Agent 2 Name>
159+
155160
...
156161

157162
## Pipeline
158163

159164
```
165+
160166
Stage 1: <name> → Stage 2: <name> → Stage 3: <name>
161167
↘ Stage 3b: <name> (parallel)
162-
```
168+
169+
```text
163170
164171
## Configuration
165172
@@ -183,7 +190,7 @@ Stage 1: <name> → Stage 2: <name> → Stage 3: <name>
183190

184191
### Step 6: Report
185192

186-
```
193+
```text
187194
## Agent Created
188195
189196
| Field | Value |
@@ -201,7 +208,7 @@ Stage 1: <name> → Stage 2: <name> → Stage 3: <name>
201208

202209
## Examples
203210

204-
```
211+
```text
205212
/create-agent homebrew-expert --location context
206213
/create-agent code-reviewer --type solo
207214
/create-agent skill-reviewer --type orchestrated --location project
@@ -257,15 +264,18 @@ For orchestrated agents, assign the cheapest model that can handle each sub-agen
257264
## Troubleshooting
258265
259266
**Agent not being invoked:**
267+
260268
- Ensure the file is in `.claude/agents/` or `context/agents/`
261269
- Check the file has `.md` extension
262270
- Verify the first line is a `# Title` heading
263271

264272
**Sub-agents not executing in parallel:**
273+
265274
- Task tool calls must be in the same message to run in parallel
266275
- Verify sub-agents have no data dependencies between them
267276

268277
**Agent producing inconsistent results:**
278+
269279
- Add explicit validation steps after each phase
270280
- Include example inputs/outputs in the agent definition
271281
- Constrain the tool list to only what's needed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
description: Promote an agent to the AI Config Library
3+
argument-hint: <agent-path>
4+
allowed-tools: Read, Write, Bash(git:*), Bash(gh:*), Bash(mkdir:*), Bash(cp:*), AskUserQuestion
5+
---
6+
7+
# Promote Agent
8+
9+
Promote an agent from the current project to the aRustyDev/ai repository.
10+
11+
## Arguments
12+
13+
- `$1` - Path to the agent file. Example: `.claude/agents/terraform-planner.md`
14+
15+
## Configuration
16+
17+
The ai repo location is determined in order of precedence:
18+
19+
1. Environment variable `$AI_CONFIG_REPO` if set
20+
2. Git submodule named `ai` in current repo's parent
21+
3. Default: `~/repos/configs/ai`
22+
23+
```bash
24+
AI_REPO="${AI_CONFIG_REPO:-$(git config --file .gitmodules --get submodule.ai.path 2>/dev/null || echo "$HOME/repos/configs/ai")}"
25+
```
26+
27+
## Workflow
28+
29+
### Phase 1: Validate and Analyze
30+
31+
1. **Verify agent exists**:
32+
- Confirm the agent file exists at the provided path
33+
- Verify proper markdown structure with frontmatter
34+
35+
2. **Extract agent metadata**:
36+
- Parse frontmatter for name/description
37+
- Identify any supporting files
38+
- Note tool requirements
39+
40+
3. **Check for existing agent in ai repo**:
41+
42+
```bash
43+
ls "$AI_REPO/context/agents/"
44+
```
45+
46+
- If found, compare and determine: Identical, Extension, Upgrade, or Separate
47+
48+
4. **Check for existing branch/issue/PR**:
49+
50+
```bash
51+
git -C "$AI_REPO" branch --list "feat/add-agent-<name>"
52+
gh issue list --repo aRustyDev/ai --search "[AGENT] <name> in:title"
53+
gh pr list --repo aRustyDev/ai --search "feat(agent): add <name> in:title"
54+
```
55+
56+
### Phase 2: User Decision (if existing)
57+
58+
If existing agent found, ask user:
59+
60+
1. **Upgrade existing** - Replace with new version
61+
2. **Extend existing** - Merge new content
62+
3. **Create separate** - Use different name
63+
4. **Cancel** - Abort
64+
65+
### Phase 3: Create Issue
66+
67+
Create GitHub Issue with:
68+
69+
- **Agent Name**: From frontmatter
70+
- **Description**: From frontmatter
71+
- **Source Path**: Original path
72+
- **Agent Content**: Summary or embedded
73+
- **Tool Requirements**: List from frontmatter
74+
75+
### Phase 4: Create Feature Branch and PR
76+
77+
1. **Create feature branch**:
78+
79+
```bash
80+
git -C "$AI_REPO" checkout main && git -C "$AI_REPO" pull
81+
git -C "$AI_REPO" checkout -b feat/add-agent-<name>
82+
```
83+
84+
2. **Copy agent file**:
85+
86+
```bash
87+
cp "<path>" "$AI_REPO/context/agents/<name>.md"
88+
```
89+
90+
3. **Commit and push**:
91+
92+
```bash
93+
git -C "$AI_REPO" add context/agents/<name>.md
94+
git -C "$AI_REPO" commit -m "feat(agent): add <name>"
95+
git -C "$AI_REPO" push -u origin feat/add-agent-<name>
96+
```
97+
98+
4. **Create PR**:
99+
100+
```bash
101+
gh pr create --repo aRustyDev/ai \
102+
--head feat/add-agent-<name> --base main \
103+
--title "feat(agent): add <name>" \
104+
--body "..."
105+
```
106+
107+
### Phase 5: Report
108+
109+
| Item | URL |
110+
|------|-----|
111+
| Issue | `<url>` |
112+
| PR | `<url>` |
113+
114+
## Examples
115+
116+
```bash
117+
/context:agent:promote .claude/agents/terraform-planner.md
118+
/context:agent:promote context/agents/code-reviewer.md
119+
```
120+
121+
## Related Commands
122+
123+
- `/context:agent:create` - Create a new agent
124+
- `/context:agent:review` - Review agent quality
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
description: Refine an agent definition based on review feedback
3+
argument-hint: <agent-path>
4+
allowed-tools: Read, Write, Edit, AskUserQuestion
5+
---
6+
7+
# Refine Agent
8+
9+
Improve an agent definition based on review findings or user feedback.
10+
11+
## Arguments
12+
13+
- `$1` - Path to agent file (required)
14+
15+
## Workflow
16+
17+
### Step 1: Load and Analyze
18+
19+
1. Read agent file
20+
2. Run quick review to identify issues
21+
3. Present findings to user
22+
23+
### Step 2: Gather Feedback
24+
25+
Use AskUserQuestion:
26+
27+
1. Which issues to address?
28+
2. Any additional changes needed?
29+
30+
### Step 3: Apply Refinements
31+
32+
Common refinements:
33+
34+
- Add missing sections
35+
- Adjust model assignments
36+
- Reduce tool scope
37+
- Clarify workflow steps
38+
- Add error handling
39+
- Include examples
40+
41+
### Step 4: Validate
42+
43+
1. Re-run review checks
44+
2. Verify structure is valid
45+
3. Confirm no regressions
46+
47+
### Step 5: Report
48+
49+
```text
50+
## Agent Refined
51+
52+
| Field | Value |
53+
|-------|-------|
54+
| Agent | <name> |
55+
| Changes | N |
56+
57+
**Modifications:**
58+
- <change 1>
59+
- <change 2>
60+
61+
Run `/context:agent:review` to verify.
62+
```
63+
64+
## Examples
65+
66+
```bash
67+
/context:agent:refine .claude/agents/code-reviewer.md
68+
```
69+
70+
## Related Commands
71+
72+
- `/context:agent:review` - Review agent quality
73+
- `/context:agent:create` - Create new agent

0 commit comments

Comments
 (0)