Skip to content

Commit b0eb7de

Browse files
authored
feat: add elegance-pipeline plugin (Codex bundle -> Claude Code native) (#156) (#156)
- 4 scouts (sonnet), 2 judges (opus), 1 planner, 1 verifier, 1 gated implementer - Persistent state manager with stage gates and implementation signal - 3 commands (init, status, run), 1 skill, 5 agent definitions - All .codex/ paths rewritten to Claude plugin structure - Codex-Spark->sonnet, GPT-5.4->opus, --solution-file->--project-anchor - State moved to project-local .claude/elegance_pipeline/state/ - Fix marketplace.json version mismatches: hookify 0.2.0->0.2.1, metacognitive-guard 0.4.5->0.5.0
1 parent b9d944f commit b0eb7de

File tree

20 files changed

+1027
-3
lines changed

20 files changed

+1027
-3
lines changed

.claude-plugin/marketplace.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"url": "https://github.com/ANcpLua"
66
},
77
"metadata": {
8-
"description": "Claude Code plugin marketplace: 10 plugins, 25 commands, 5 skills, 19 agents. Multi-agent orchestration, cognitive amplification, OpenTelemetry docs, .NET build enforcement, and design intelligence."
8+
"description": "Claude Code plugin marketplace: 11 plugins, 28 commands, 6 skills, 24 agents. Multi-agent orchestration, cognitive amplification, OpenTelemetry docs, .NET build enforcement, design intelligence, and code elegance pipeline."
99
},
1010
"plugins": [
1111
{
1212
"name": "metacognitive-guard",
1313
"description": "Cognitive amplification stack: epistemic hooks, competitive review, commit integrity checks, CI verification scripts, and deep-thinking agents.",
14-
"version": "0.4.5",
14+
"version": "0.5.0",
1515
"source": "./plugins/metacognitive-guard"
1616
},
1717
{
@@ -29,7 +29,7 @@
2929
{
3030
"name": "hookify",
3131
"description": "User-configurable hooks from .local.md files. Define blocking and warning rules for Bash commands, file edits, and session events.",
32-
"version": "0.2.0",
32+
"version": "0.2.1",
3333
"source": "./plugins/hookify"
3434
},
3535
{
@@ -67,6 +67,12 @@
6767
"description": "Design intelligence studio: creative direction + data-driven recommendations. 50 styles, 97 palettes, 57 font pairings, 99 UX guidelines, 25 chart types, 13 stacks. BM25 search engine with design system generator.",
6868
"version": "1.0.0",
6969
"source": "./plugins/design-studio"
70+
},
71+
{
72+
"name": "elegance-pipeline",
73+
"description": "Multi-agent code-elegance workflow: 4 scouts (sonnet), 2 judges (opus), 1 planner, 1 verifier, 1 gated implementer. Persistent state with stage gates.",
74+
"version": "1.0.0",
75+
"source": "./plugins/elegance-pipeline"
7076
}
7177
]
7278
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ obj/
4545
# --- Eight Gates runtime ---
4646
.eight-gates/
4747

48+
# --- Elegance pipeline runtime state ---
49+
.claude/elegance_pipeline/
50+
.codex.backup.*
51+
4852
# --- Metacognitive-guard runtime state ---
4953
.blackboard/
5054

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
88

99
### Added
1010

11+
- **`elegance-pipeline` plugin (1.0.0)**: Multi-agent code-elegance workflow converted from Codex bundle to native Claude Code plugin. 4 scouts (sonnet, read-only), 2 judges (opus, read-only), 1 planner (opus), 1 verifier (opus), 1 gated implementer (opus, full edit). Persistent state manager with stage gates and implementation signal. 3 commands (`init`, `status`, `run`), 1 skill, 5 agents. All `.codex/` paths rewritten to `${CLAUDE_PLUGIN_ROOT}`, Codex-Spark->sonnet, GPT-5.4->opus, state moved to project-local `.claude/elegance_pipeline/state/`
12+
13+
### Fixed
14+
15+
- **marketplace.json version mismatches**: hookify 0.2.0->0.2.1, metacognitive-guard 0.4.5->0.5.0 (synced with plugin.json)
16+
17+
### Added
18+
1119
- **Codex PR review automation**: Added `.github/workflows/codex-code-review.yml`, `.github/codex/prompts/review.md`, and `.github/codex/schemas/review-output.schema.json`. Codex now reviews pull requests in a read-only sandbox, returns structured verdicts, publishes formal GitHub reviews, and skips PRs that only modify Codex review automation
1220
- **metacognitive-guard `InstructionsLoaded` hook**: Truth beacon now fires on both SessionStart AND InstructionsLoaded — ground truth re-injected when CLAUDE.md/rules are loaded, ensuring authoritative facts arrive after instructions context
1321
- **metacognitive-guard `agent_type` filtering**: Struggle detector and Ralph Loop now skip subagents via `agent_type` field in hook events — prevents wasted haiku calls and false positives from subagent responses
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "elegance-pipeline",
3+
"version": "1.0.0",
4+
"description": "Multi-agent code-elegance workflow: 4 scouts, 2 judges, 1 planner, 1 verifier, 1 gated implementer. Persistent state manager with stage gates and implementation signal.",
5+
"author": {
6+
"name": "ANcpLua"
7+
},
8+
"repository": "https://github.com/ANcpLua/ancplua-claude-plugins",
9+
"license": "MIT",
10+
"keywords": [
11+
"elegance",
12+
"code-quality",
13+
"multi-agent",
14+
"refactoring",
15+
"pipeline",
16+
"scout",
17+
"judge"
18+
],
19+
"commands": "./commands",
20+
"agents": [
21+
"./agents/elegance-scout.md",
22+
"./agents/elegance-judge.md",
23+
"./agents/elegance-planner.md",
24+
"./agents/elegance-verifier.md",
25+
"./agents/elegance-implementer.md"
26+
]
27+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# elegance-pipeline
2+
3+
Multi-agent code-elegance workflow for Claude Code. Evaluates source files across a repository for elegance (difficulty handled / solution complexity) and optionally converts justified weaknesses into narrowly scoped refactor work.
4+
5+
## Pipeline
6+
7+
```text
8+
4 Scouts (parallel, sonnet) -> 2 Judges (parallel, opus) -> 1 Planner (opus)
9+
-> 1 Verifier (opus) -> 1 Implementer (gated, opus)
10+
```
11+
12+
- **Scouts**: Read-only. Each inspects an assigned scope for elegant code candidates.
13+
- **Judges**: Read-only. Verify scout findings against the codebase, produce final top-5 ranking.
14+
- **Planner**: Read-only. Converts judge verdicts into max 3 actionable refactor tasks.
15+
- **Verifier**: Read-only. Validates the plan is justified and narrow. Controls the implementation gate.
16+
- **Implementer**: Full edit access. Only runs when the verifier approves. Implements the verified plan.
17+
18+
## Setup
19+
20+
```bash
21+
python plugins/elegance-pipeline/elegance_pipeline/pipeline.py init \
22+
--project-anchor CLAUDE.md \
23+
--scope plugins/exodia \
24+
--scope plugins/metacognitive-guard \
25+
--scope plugins/hookify \
26+
--scope plugins/feature-dev
27+
```
28+
29+
## Usage
30+
31+
```text
32+
/elegance-pipeline:status # Check pipeline state
33+
/elegance-pipeline:run # Run next ready stage
34+
/elegance-pipeline:run scouts # Run only scout phase
35+
```
36+
37+
## State
38+
39+
State is project-local at `.claude/elegance_pipeline/state/`. Not committed to git.
40+
41+
## Origin
42+
43+
Converted from the Codex `elegance-pipeline-bundle.zip`. All `.codex/` references rewritten to Claude Code native plugin structure. Codex-Spark -> sonnet, GPT-5.4 -> opus. Manual thread creation replaced with Claude Code subagent orchestration.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: elegance-implementer
3+
description: Implementation agent. Executes the verifier-approved refactor plan with minimal correct changes. Only runs when the implementation signal is READY. Use when running the elegance pipeline implementer phase.
4+
tools: Read, Write, Edit, Grep, Glob, Bash
5+
model: opus
6+
---
7+
8+
You are the implementation agent in the elegance pipeline.
9+
10+
Your job is to correctly implement the verifier-approved plan with the smallest change set that fully satisfies the decision. You understand scope before changing code, prefer the project's existing abstractions, and verify your work.
11+
12+
You have full edit access. Follow the 4-phase protocol: understand scope, plan, implement, verify.
13+
14+
When you receive your task prompt (rendered by the pipeline state manager), follow it exactly. Submit your results through the pipeline state manager command provided in the prompt.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: elegance-judge
3+
description: Code elegance judge. Verifies scout findings against the actual codebase and produces the final top-5 ranking. Use when running the elegance pipeline judge phase.
4+
tools: Read, Grep, Glob, Bash
5+
model: opus
6+
---
7+
8+
You are a code elegance judge in the elegance pipeline.
9+
10+
Your job is to take the shortlist from all 4 scouts, verify finalists directly in the codebase, and produce the definitive top-5 most elegant source files. You score by difficulty times cleanliness.
11+
12+
You are read-only. Do not edit, create, or delete any files.
13+
14+
When you receive your task prompt (rendered by the pipeline state manager), follow it exactly. Submit your results through the pipeline state manager command provided in the prompt.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: elegance-planner
3+
description: Refactor planner. Converts judge verdicts into actionable engineering tasks only when evidence justifies real change. Use when running the elegance pipeline planner phase.
4+
tools: Read, Grep, Glob, Bash
5+
model: opus
6+
---
7+
8+
You are the refactor planner in the elegance pipeline.
9+
10+
Your job is to convert judge verdicts into at most 3 narrow, high-confidence implementation tasks. You do not invent work. If the judges found no actionable weaknesses, you say "No implementation warranted."
11+
12+
You are read-only. Do not edit, create, or delete any files.
13+
14+
When you receive your task prompt (rendered by the pipeline state manager), follow it exactly. Submit your results through the pipeline state manager command provided in the prompt.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: elegance-scout
3+
description: Read-only code elegance scout. Inspects an assigned scope for the most elegant source files. Use when running the elegance pipeline scout phase.
4+
tools: Read, Grep, Glob, Bash
5+
model: sonnet
6+
---
7+
8+
You are a code elegance scout in the elegance pipeline.
9+
10+
Your job is to inspect source files in your assigned scope and identify the strongest candidates for elegance. You evaluate files by the ratio of problem complexity to solution complexity.
11+
12+
You are read-only. Do not edit, create, or delete any files. Do not run formatting, refactoring, or build commands.
13+
14+
When you receive your task prompt (rendered by the pipeline state manager), follow it exactly. Submit your results through the pipeline state manager command provided in the prompt.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: elegance-verifier
3+
description: Plan verifier judge. Validates that the planner extracted the right work from judge evidence. Controls the implementation gate signal. Use when running the elegance pipeline verifier phase.
4+
tools: Read, Grep, Glob, Bash
5+
model: opus
6+
---
7+
8+
You are the plan verifier judge in the elegance pipeline.
9+
10+
Your job is to verify whether the refactor planner extracted the right work from the judge evidence. You reject fabricated work, under-scoped plans, and over-broad cleanup sprawl. Your verdict controls the implementation signal gate.
11+
12+
You are read-only. Do not edit, create, or delete any files.
13+
14+
When you receive your task prompt (rendered by the pipeline state manager), follow it exactly. Submit your results through the pipeline state manager command provided in the prompt.

0 commit comments

Comments
 (0)