Skip to content

Commit 753d432

Browse files
aRustyDevclaude
andauthored
refactor: reorganize repo structure with plugin build system (#821)
* chore: remove legacy/ directory Content previously reorganized into context/, build/, and settings/. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: remove .todo/ reference material Third-party repos and reference material previously staged for evaluation (claude-cookbooks, context-engineering-intro, claude-code-spec-workflow, super-claude-framework, etc.). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: remove components/ after migration to context/ Skills, commands, rules, hooks, and settings relocated to the context/ directory structure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: remove unused scaffold directories and files Remove .templates/, .ctx/sitemap.xml, tools/, mcp/, schemas/, profiles/ placeholders, and top-level main.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add context/.context/ reference and research material Includes category definitions, research repos (claude-code-dev-kit, claude-cookbooks, context-engineering-intro, super-claude-framework), and context sitemap. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add context/skills/ directory Skills migrated from components/skills/ with updated directory structure. Includes all language, CI/CD, meta, method, and domain-specific skills. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add context/ agents, commands, hooks, rules, and plugins Migrated from components/ and legacy/ directories. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add .beads/ interaction tracking Config, metadata, and interaction logs for session tracking. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add assets/ directory Sound files for notifications and mustache templates relocated from .templates/. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add build/ output directory scaffolding Build target directories for claude, claude-code, cortex, gemini, vscode, and zed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add settings/ directory Editor and tool settings (claude, cursor, vscode, windsurf, zed) and build configuration TODO. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add .gitattributes and AGENTS.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * added homebrew plugin * feat: add plugin build system, shared components, and templates Add plugin.sources.json sidecar for source-to-local path mapping, justfile recipes for install/build/check/uninstall plugins, shared commands and agents, plugin template with mdbook docs scaffold, and signed-commits-only hook. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Signed-off-by: aRustyDev <36318507+aRustyDev@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 629f384 commit 753d432

88 files changed

Lines changed: 4664 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/marketplace.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "arustydev",
3+
"owner": {
4+
"name": "aRustyDev",
5+
"email": "developer@arusty.dev"
6+
},
7+
"plugins": [
8+
{
9+
"name": "homebrew-dev",
10+
"source": "./context/plugins/homebrew-dev",
11+
"description": "Homebrew formula development toolkit — research packages, generate formulas from JSON schema, validate with brew audit/style, and batch-create formulas for a custom tap.",
12+
"version": "1.0.0",
13+
"author": {
14+
"name": "Adam Smith",
15+
"email": "developer@gh.arusty.dev"
16+
},
17+
"keywords": ["homebrew", "formula", "tap", "package-manager", "macos"],
18+
"license": "MIT",
19+
"homepage": "https://docs.arusty.dev/ai/plugins/homebrew-dev",
20+
"repository": "https://github.com/aRustyDev/ai.git"
21+
}
22+
]
23+
}

.claude/commands/create-agent.md

Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
---
2+
description: Create a new Claude Code agent definition with proper structure, sub-agent roles, and pipeline stages
3+
argument-hint: <agent-name> [--location project|context] [--type solo|orchestrated]
4+
allowed-tools: Read, Write, Glob, Grep, Bash(mkdir:*), Bash(ls:*), AskUserQuestion, Task
5+
---
6+
7+
# Create Claude Code Agent
8+
9+
Scaffold a new agent definition with proper structure, model assignments, and pipeline design.
10+
11+
## Arguments
12+
13+
- `$1` - Agent name (lowercase, hyphenated, max 48 chars). Example: `homebrew-expert`
14+
- `--location` - Where to create the agent:
15+
- `project` (default): `.claude/agents/<agent-name>.md`
16+
- `context`: `context/agents/<agent-name>.md`
17+
- `--type` - Agent architecture:
18+
- `solo` (default): Single agent with direct instructions
19+
- `orchestrated`: Multi-agent pipeline with sub-agents
20+
21+
## Agent vs Command vs Skill
22+
23+
| Use Agent When | Use Command When | Use Skill When |
24+
|----------------|------------------|----------------|
25+
| Complex multi-step pipeline | User-triggered one-off workflow | Auto-triggered by context |
26+
| Needs sub-agent coordination | Single sequential workflow | Consistent behavior |
27+
| Domain expertise required | Parameters vary per invocation | Implicit, frequent use |
28+
| Long-running autonomous work | Quick, focused tasks | Pattern matching |
29+
30+
## Workflow
31+
32+
### Step 1: Parse and Validate
33+
34+
1. Extract agent name from `$1` — validate: `^[a-z][a-z0-9-]{0,46}[a-z0-9]$`
35+
2. Parse `--location` (default: `project`) and `--type` (default: `solo`)
36+
3. Determine target path:
37+
- `project``.claude/agents/<agent-name>.md`
38+
- `context``context/agents/<agent-name>.md`
39+
4. Check if file exists — if so, ask to overwrite or rename
40+
41+
### Step 2: Gather Agent Information
42+
43+
Use AskUserQuestion to collect:
44+
45+
1. **Domain / Purpose**: What domain does this agent operate in? What problems does it solve? (2-3 sentences)
46+
2. **Key Capabilities**: What can this agent do? (3-6 bullet points)
47+
3. **Input / Output**: What does the agent receive and what does it produce?
48+
4. **Tool Requirements**: Which tools does this agent need? (Read, Write, Bash, WebSearch, etc.)
49+
5. **Model Preference**: Which model should this agent use?
50+
- `haiku` — Fast, low-cost tasks (status updates, simple checks)
51+
- `sonnet` — Balanced analysis and generation (default)
52+
- `opus` — Complex reasoning, architecture decisions
53+
54+
For `orchestrated` type, also ask:
55+
56+
6. **Sub-Agents**: What specialized roles are needed? For each:
57+
- Name, model, purpose, tools
58+
7. **Pipeline Stages**: What is the execution order? Which stages can run in parallel?
59+
60+
### Step 3: Create Directory
61+
62+
```bash
63+
mkdir -p "$(dirname "<target-path>")"
64+
```
65+
66+
### Step 4: Generate Agent File
67+
68+
#### Solo Agent Structure
69+
70+
```markdown
71+
# <Agent Title>
72+
73+
<Purpose description>
74+
75+
## Overview
76+
77+
<What this agent does and when to use it>
78+
79+
## Capabilities
80+
81+
- <capability 1>
82+
- <capability 2>
83+
- ...
84+
85+
## Usage
86+
87+
### Invocation
88+
89+
<How to invoke this agent — direct reference, Task tool, etc.>
90+
91+
### Input
92+
93+
<What the agent expects as input>
94+
95+
### Output
96+
97+
<What the agent produces>
98+
99+
## Workflow
100+
101+
### Step 1: <Phase>
102+
<Instructions>
103+
104+
### Step 2: <Phase>
105+
<Instructions>
106+
107+
## Model
108+
109+
<model> — <rationale for choice>
110+
111+
## Tools Required
112+
113+
<tool list with rationale>
114+
115+
## Notes
116+
117+
<Edge cases, limitations, integration points>
118+
```
119+
120+
#### Orchestrated Agent Structure
121+
122+
```markdown
123+
# <Agent Title>
124+
125+
<Purpose description>
126+
127+
## Overview
128+
129+
<Pipeline description>
130+
131+
## Usage
132+
133+
### Full Pipeline
134+
<Example invocations>
135+
136+
### Individual Sub-Agents
137+
<How to run specific stages>
138+
139+
## Sub-Agents
140+
141+
| Agent | Model | Purpose |
142+
|-------|-------|---------|
143+
| `<name>` | <model> | <purpose> |
144+
145+
### <Sub-Agent 1 Name>
146+
147+
**Model**: <model>
148+
**Tools**: <tool list>
149+
**Input**: <what it receives>
150+
**Output**: <what it produces>
151+
152+
<Detailed instructions>
153+
154+
### <Sub-Agent 2 Name>
155+
...
156+
157+
## Pipeline
158+
159+
```
160+
Stage 1: <name> → Stage 2: <name> → Stage 3: <name>
161+
↘ Stage 3b: <name> (parallel)
162+
```
163+
164+
## Configuration
165+
166+
<Config file location and options>
167+
168+
## Session Data
169+
170+
<Where intermediate results are stored>
171+
172+
## Cost Estimation
173+
174+
<Per-run cost breakdown by model tier>
175+
```
176+
177+
### Step 5: Validate
178+
179+
1. Confirm the file has proper markdown structure
180+
2. Verify all sections are populated (no placeholders)
181+
3. Check model assignments are valid
182+
4. Ensure tool lists match capabilities described
183+
184+
### Step 6: Report
185+
186+
```
187+
## Agent Created
188+
189+
| Field | Value |
190+
|-------|-------|
191+
| Agent | `<agent-name>` |
192+
| Location | `<path>` |
193+
| Type | solo / orchestrated |
194+
| Model | <primary model> |
195+
196+
**Next steps:**
197+
1. Review and refine the agent definition
198+
2. Test with a sample input
199+
3. Iterate on workflow steps based on results
200+
```
201+
202+
## Examples
203+
204+
```
205+
/create-agent homebrew-expert --location context
206+
/create-agent code-reviewer --type solo
207+
/create-agent skill-reviewer --type orchestrated --location project
208+
```
209+
210+
## Common Patterns
211+
212+
### Domain Expert (Solo)
213+
214+
Single agent with deep knowledge of a specific domain. Good for: code review, formula generation, security auditing.
215+
216+
```yaml
217+
Model: sonnet
218+
Tools: Read, Glob, Grep, Write
219+
Workflow: Analyze → Assess → Generate → Validate
220+
```
221+
222+
### Research Pipeline (Orchestrated)
223+
224+
Multiple agents gathering and synthesizing information. Good for: package research, dependency analysis, competitive analysis.
225+
226+
```yaml
227+
Sub-agents:
228+
- researcher (haiku) — Gather raw data from multiple sources
229+
- analyzer (sonnet) — Synthesize findings, identify patterns
230+
- reporter (haiku) — Format output
231+
Pipeline: researcher (parallel, N instances) → analyzer → reporter
232+
```
233+
234+
### Review Pipeline (Orchestrated)
235+
236+
Staged quality gates with increasing depth. Good for: code review, PR review, skill review.
237+
238+
```yaml
239+
Sub-agents:
240+
- validator (haiku) — Quick structural checks
241+
- complexity-assessor (sonnet) — Determine analysis depth
242+
- deep-analyzer (dynamic) — Full analysis (model based on complexity)
243+
- fixer (sonnet) — Apply improvements
244+
Pipeline: validator → complexity-assessor → deep-analyzer → fixer
245+
```
246+
247+
## Model Selection Guide
248+
249+
| Model | Cost/call | Use When |
250+
|-------|-----------|----------|
251+
| Haiku | ~$0.01 | Status updates, simple validation, formatting |
252+
| Sonnet | ~$0.07 | Analysis, code generation, balanced tasks |
253+
| Opus | ~$0.30 | Architecture decisions, complex reasoning, ambiguous problems |
254+
255+
For orchestrated agents, assign the cheapest model that can handle each sub-agent's task. Reserve Opus for the stage that requires the most judgment.
256+
257+
## Troubleshooting
258+
259+
**Agent not being invoked:**
260+
- Ensure the file is in `.claude/agents/` or `context/agents/`
261+
- Check the file has `.md` extension
262+
- Verify the first line is a `# Title` heading
263+
264+
**Sub-agents not executing in parallel:**
265+
- Task tool calls must be in the same message to run in parallel
266+
- Verify sub-agents have no data dependencies between them
267+
268+
**Agent producing inconsistent results:**
269+
- Add explicit validation steps after each phase
270+
- Include example inputs/outputs in the agent definition
271+
- Constrain the tool list to only what's needed
272+
273+
## Related Commands
274+
275+
- `/create-command` — Create a user-triggered slash command (simpler than agents)
276+
- `/create-skill` — Create a model-invoked skill (auto-triggered)
277+
278+
## Notes
279+
280+
- Solo agents are simpler and cheaper — prefer them unless you need parallel sub-agent work
281+
- Orchestrated agents should have clear stage boundaries and well-defined data flow between sub-agents
282+
- Model assignments matter for cost: a pipeline with 5 Opus sub-agents costs ~$7.50/run vs ~$0.15 with Haiku
283+
- Agent files are documentation for Claude — write them as instructions, not descriptions
284+
- Reference existing agents in `.claude/agents/` and `context/agents/` for patterns

0 commit comments

Comments
 (0)