Skip to content

Commit 281a0d0

Browse files
committed
Docs <-> Galaxy Review Agents
1 parent fa0d864 commit 281a0d0

44 files changed

Lines changed: 7333 additions & 9 deletions

Some content is hidden

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

.claude/CLAUDE.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ Each topic is defined by three files:
105105
- Related topics and code paths
106106

107107
2. **content.yaml** - Ordered sequence of content blocks
108-
- Each block: type (prose/slide), id, heading, content source
109-
- Smart defaults: prose renders in docs only; slides render everywhere
108+
- Each block: type, id, heading, content source
110109
- Content from inline, single file, or multiple fragments
111110

112111
3. **fragments/** - Actual content (optional for granular organization)
@@ -115,6 +114,20 @@ Each topic is defined by three files:
115114

116115
All content validated with Pydantic v2 models before build.
117116

117+
### Content Block Types
118+
119+
| Type | Slides | Sphinx Docs | Agent Commands | Use Case |
120+
|------|--------|-------------|----------------|----------|
121+
| `slide` |||| Training slides, also rendered in docs |
122+
| `prose` |||| Extended docs content, not for slides |
123+
| `agent-context` |||| Context only for agent command generation |
124+
125+
**slide** - Primary content type. Rendered in training slides AND Sphinx docs. Use for core architectural explanations.
126+
127+
**prose** - Extended documentation. Rendered in Sphinx docs only. Use for detailed explanations too verbose for slides.
128+
129+
**agent-context** - Agent-only context. NOT rendered anywhere. Use for guidance, examples, anti-patterns, and tips specifically for AI agents generating code or performing reviews. This content enriches generated agentic operations without cluttering human-facing docs.
130+
118131
## Build Artifacts
119132

120133
- **outputs/training-slides/generated/** - GTN-compatible Remark.js slides

.claude/commands/generate-agentic-op.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Generate Claude slash command or skill from topic content by reading and reasoni
2929

3030
2. **Understand the operation:**
3131
- Read the operation's `prompt` field to understand the development task
32+
- If the prompt contains a TODO item, it is a indication that this is information you should
33+
generate from the topic content and embed in the generated artifact.
3234
- Determine the operation type (claude-slash-command or claude-skill)
3335

3436
3. **Reason about relevant content:**
@@ -61,6 +63,8 @@ Generate Claude slash command or skill from topic content by reading and reasoni
6163
## Important Notes
6264

6365
- **DO NOT mechanically copy** all content - use judgment about what's relevant
66+
- **DO** If either the files you're asked to generate already exist, do not read them, back them up,
67+
and your new summary to the supplied path.
6468
- **DO** synthesize and reformulate content appropriately for the operation
6569
- **DO** prominently feature related_code_paths (Galaxy available at these paths)
6670
- **DO** fail if the operation doesn't exist or content is insufficient

.claude/commands/harmonize.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Harmonize Agentic Operation
2+
3+
Improve alignment between architecture documentation and generated agentic operations.
4+
5+
This command orchestrates the positive feedback loop between architecture documentation in this repository and agentic operations for acting on the Galaxy codebase. The goal is to make commands as sharp and intelligent as possible while being completely generated from architecture documentation.
6+
7+
## Usage
8+
9+
```
10+
/harmonize <existing-command-path> <topic-id> <operation-name>
11+
```
12+
13+
## Arguments
14+
15+
- **existing-command-path**: Path to current slash command (e.g., `~/.claude/commands/review-di.md`)
16+
- **topic-id**: Topic in this repo (e.g., `dependency-injection`)
17+
- **operation-name**: Operation from metadata.yaml (e.g., `review-di`)
18+
19+
## Your Task
20+
21+
### Phase 1: Load and Analyze
22+
23+
1. **Read the existing command** from the supplied path
24+
2. **Read topic content**: `topics/<topic>/metadata.yaml` and `topics/<topic>/content.yaml`
25+
3. **Read the operation's prompt** from metadata.yaml
26+
4. **Create directory** `topics/<topic>/harmonize/` if needed
27+
5. **Write analysis** to `topics/<topic>/harmonize/<op>_analysis.md`:
28+
29+
```markdown
30+
# Harmonization Analysis: <operation-name>
31+
32+
## Information in Command NOT in Docs
33+
34+
<!-- List specific patterns, examples, guidance present in command but missing from content.yaml -->
35+
36+
- [ ] ...
37+
38+
## Information in Docs NOT in Command
39+
40+
<!-- List architectural content from content.yaml not reflected in the command -->
41+
42+
- [ ] ...
43+
44+
## Gaps in Operation Prompt
45+
46+
<!-- What does the prompt ask for that the docs can't provide? -->
47+
48+
- [ ] ...
49+
```
50+
51+
### Phase 2: Generate Fresh Command
52+
53+
Launch a **subagent** to generate a fresh command in isolation:
54+
55+
```
56+
Use the Task tool with:
57+
- subagent_type: "general-purpose"
58+
- prompt: |
59+
Run the /generate-agentic-op skill with arguments: <topic-id> <operation-name>
60+
61+
This will read topics/<topic>/metadata.yaml and content.yaml, then generate
62+
a command to generated_agentic_operations/commands/<topic>-<op>.md
63+
64+
Return the path to the generated file when complete.
65+
```
66+
67+
**Why a subagent?** The generation task should reason fresh from the documentation without being influenced by knowledge of the existing command or harmonization goals. This isolation ensures we see what the docs *actually* produce.
68+
69+
After the subagent completes, read the generated file at `generated_agentic_operations/commands/<topic>-<op>.md` for Phase 3 comparison.
70+
71+
### Phase 3: Compare Commands
72+
73+
Read both commands and append a comparison section to the analysis file:
74+
75+
```markdown
76+
## Command Comparison
77+
78+
| Dimension | Original | Generated | Winner |
79+
|-----------|----------|-----------|--------|
80+
| Specificity of code patterns | ... | ... | ... |
81+
| Coverage of anti-patterns | ... | ... | ... |
82+
| Actionability of guidance | ... | ... | ... |
83+
| Use of related_code_paths | ... | ... | ... |
84+
| Alignment with docs | ... | ... | ... |
85+
86+
## Key Differences
87+
88+
1. ...
89+
2. ...
90+
3. ...
91+
```
92+
93+
### Phase 4: Generate Recommendations
94+
95+
Write recommendations to `topics/<topic>/harmonize/<op>_recommendations.md`.
96+
97+
Split into two categories - this separation is critical:
98+
99+
```markdown
100+
# Harmonization Recommendations: <operation-name>
101+
102+
## Documentation Improvements
103+
104+
<!-- Changes to content.yaml to add missing reference info -->
105+
<!-- These become the source of truth that commands are generated from -->
106+
107+
1. Add prose block about X
108+
2. Expand slide Y to include Z pattern
109+
3. Add agent-context block for anti-patterns
110+
4. Add example code showing pattern W
111+
112+
## Prompt Improvements
113+
114+
<!-- Changes to metadata.yaml operation prompt -->
115+
<!-- NOT content duplication - prompts should reference docs, not repeat them -->
116+
<!-- Focus on: how to interact with agent, prods to pull specific info from docs -->
117+
118+
1. Add instruction to consult related_code_paths for examples
119+
2. Add TODO marker for agent to extract patterns from docs
120+
3. Refine scope/focus of the operation
121+
4. Clarify input format expectations
122+
```
123+
124+
### Phase 5: Summary
125+
126+
Output a brief summary to the user:
127+
- What gaps were found
128+
- Key differences between original and generated commands
129+
- Top 3 actionable recommendations
130+
- Paths to created artifacts
131+
132+
## Important Notes
133+
134+
- **Documentation is source of truth** - prompts should reference docs, not duplicate content
135+
- **Create concrete artifacts** - don't just think, write files
136+
- **Isolation matters** - Phase 2 subagent must not see the existing command
137+
- **Prompt changes are about interaction** - how to guide the agent to use docs, not what to embed
138+
- If prose content is too verbose for slides, suggest prose blocks or agent-context blocks

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "review/galaxy-plugins"]
2+
path = review/galaxy-plugins
3+
url = https://github.com/galaxyproject/claude-galaxy-plugins

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,77 @@ galaxy-architecture/
192192
- **Hub Articles**: Generate galaxyproject.org articles
193193
- **Galaxy Repo Migration**: Move content into main Galaxy repository
194194

195+
## Agentic Code Review
196+
197+
Architecture documentation enables **agentic code review** - generating AI-powered review commands from architectural knowledge.
198+
199+
### The Plugin Marketplace
200+
201+
The `review/` directory builds the `claude-galaxy-plugins` marketplace containing slash commands for reviewing Galaxy contributions. Commands come from two sources:
202+
203+
- **Static commands**: Hand-written review prompts (`review/static_commands/`)
204+
- **Generated commands**: Created from architecture topics via `/generate-agentic-op`
205+
206+
Build and use:
207+
```bash
208+
cd review && make
209+
claude --plugin-dir review/galaxy-plugins
210+
/gx-arch-review:gx-review <pr-or-commit>
211+
```
212+
213+
Or install from GitHub:
214+
```bash
215+
/plugin marketplace add galaxyproject/claude-galaxy-plugins
216+
/plugin install gx-arch-review@claude-galaxy-plugins
217+
```
218+
219+
See [review/galaxy-plugins/README.md](review/galaxy-plugins/README.md) for full marketplace documentation.
220+
221+
### The Feedback Loop
222+
223+
Architecture documentation, agentic commands, and code reviews form a **positive feedback loop**:
224+
225+
```
226+
┌─────────────────────────────────────────────────────────────────────┐
227+
│ │
228+
│ ┌──────────────────┐ ┌──────────────────┐ │
229+
│ │ Architecture │────────▶│ Agentic Commands │ │
230+
│ │ Documentation │ │ (gx-review) │ │
231+
│ └────────▲─────────┘ └────────┬─────────┘ │
232+
│ │ │ │
233+
│ │ ▼ │
234+
│ ┌────────┴─────────┐ ┌──────────────────┐ │
235+
│ │ Suggestions │◀────────│ Code Reviews │ │
236+
│ │ (topic/suggests/)│ │ │ │
237+
│ └──────────────────┘ └──────────────────┘ │
238+
│ │
239+
└─────────────────────────────────────────────────────────────────────┘
240+
```
241+
242+
**Documentation → Commands**: Generating agentic commands from architecture docs produces `suggestions/` files identifying documentation gaps. If a topic lacks detail to produce a useful review command, that's signal to improve the docs.
243+
244+
**Commands → Reviews**: Better architecture documentation yields more comprehensive review commands that catch more issues.
245+
246+
**Reviews → Documentation**: When agentic reviews miss something a human reviewer catches, this reveals gaps in architecture documentation. The missed pattern should be documented, improving future command generation.
247+
248+
This virtuous cycle means:
249+
- Every documentation improvement makes reviews better
250+
- Every review gap improves documentation
251+
- The system self-improves through use
252+
253+
### Slash Commands
254+
255+
| Command | Source | Description |
256+
|---------|--------|-------------|
257+
| `/generate-agentic-op` | Built-in | Generate review command from topic |
258+
| `/gx-arch-review:gx-review` | Plugin | Orchestrator - runs applicable sub-reviews |
259+
| `/gx-arch-review:review-di` | Generated | Dependency injection patterns |
260+
| `/gx-arch-review:review-business-logic-organization` | Generated | Controller/Service/Manager layers |
261+
| `/gx-arch-review:py-challenge-patches` | Static | Mock/patch quality in tests |
262+
| `/gx-arch-review:gx-vitest-review` | Static | Vue/TypeScript test review |
263+
264+
See `review/galaxy-plugins/plugins/gx-arch-review/README.md` for the complete command list.
265+
195266
## Philosophy
196267

197268
- **Clean Content First**: Source of truth is markdown, not presentation markup

0 commit comments

Comments
 (0)