Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"url": "https://github.com/ANcpLua"
},
"metadata": {
"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."
"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."
},
"plugins": [
{
"name": "metacognitive-guard",
"description": "Cognitive amplification stack: epistemic hooks, competitive review, commit integrity checks, CI verification scripts, and deep-thinking agents.",
"version": "0.4.5",
"version": "0.5.0",
"source": "./plugins/metacognitive-guard"
},
{
Expand All @@ -29,7 +29,7 @@
{
"name": "hookify",
"description": "User-configurable hooks from .local.md files. Define blocking and warning rules for Bash commands, file edits, and session events.",
"version": "0.2.0",
"version": "0.2.1",
"source": "./plugins/hookify"
},
{
Expand Down Expand Up @@ -67,6 +67,12 @@
"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.",
"version": "1.0.0",
"source": "./plugins/design-studio"
},
{
"name": "elegance-pipeline",
"description": "Multi-agent code-elegance workflow: 4 scouts (sonnet), 2 judges (opus), 1 planner, 1 verifier, 1 gated implementer. Persistent state with stage gates.",
"version": "1.0.0",
"source": "./plugins/elegance-pipeline"
}
]
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ obj/
# --- Eight Gates runtime ---
.eight-gates/

# --- Elegance pipeline runtime state ---
.claude/elegance_pipeline/
.codex.backup.*

# --- Metacognitive-guard runtime state ---
.blackboard/

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Added

- **`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/`

### Fixed

- **marketplace.json version mismatches**: hookify 0.2.0->0.2.1, metacognitive-guard 0.4.5->0.5.0 (synced with plugin.json)

### Added

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This ### Added heading is a duplicate. To follow the Keep a Changelog format, all new additions for this release should be grouped under a single ### Added section. Please move the items from this section to the ### Added section at line 9.


Comment on lines 9 to +18
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Unreleased section now has multiple ### Added headings (one at the top, then another at line 17), which diverges from Keep a Changelog structure and makes entries harder to scan. Consider merging this plugin entry into the existing ### Added section and placing the marketplace sync note under the existing ### Fixed section (without reintroducing duplicate headings).

Copilot uses AI. Check for mistakes.
- **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
- **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
- **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
Expand Down
27 changes: 27 additions & 0 deletions plugins/elegance-pipeline/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "elegance-pipeline",
"version": "1.0.0",
"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.",
"author": {
"name": "ANcpLua"
},
"repository": "https://github.com/ANcpLua/ancplua-claude-plugins",
"license": "MIT",
"keywords": [
"elegance",
"code-quality",
"multi-agent",
"refactoring",
"pipeline",
"scout",
"judge"
],
"commands": "./commands",
"agents": [
"./agents/elegance-scout.md",
"./agents/elegance-judge.md",
"./agents/elegance-planner.md",
"./agents/elegance-verifier.md",
"./agents/elegance-implementer.md"
]
Comment on lines +18 to +26
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plugin includes a skills/ directory, but plugin.json doesn’t declare it (other skill-bearing plugins use "skills": "./skills"). Without this, the elegance-pipeline skill may not be discoverable/loaded by Claude Code.

Copilot uses AI. Check for mistakes.
}
43 changes: 43 additions & 0 deletions plugins/elegance-pipeline/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# elegance-pipeline

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.

## Pipeline

```text
4 Scouts (parallel, sonnet) -> 2 Judges (parallel, opus) -> 1 Planner (opus)
-> 1 Verifier (opus) -> 1 Implementer (gated, opus)
```

- **Scouts**: Read-only. Each inspects an assigned scope for elegant code candidates.
- **Judges**: Read-only. Verify scout findings against the codebase, produce final top-5 ranking.
- **Planner**: Read-only. Converts judge verdicts into max 3 actionable refactor tasks.
- **Verifier**: Read-only. Validates the plan is justified and narrow. Controls the implementation gate.
- **Implementer**: Full edit access. Only runs when the verifier approves. Implements the verified plan.

## Setup

```bash
python plugins/elegance-pipeline/elegance_pipeline/pipeline.py init \
--project-anchor CLAUDE.md \
--scope plugins/exodia \
--scope plugins/metacognitive-guard \
--scope plugins/hookify \
--scope plugins/feature-dev
```

## Usage

```text
/elegance-pipeline:status # Check pipeline state
/elegance-pipeline:run # Run next ready stage
/elegance-pipeline:run scouts # Run only scout phase
```

## State

State is project-local at `.claude/elegance_pipeline/state/`. Not committed to git.

## Origin

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.
14 changes: 14 additions & 0 deletions plugins/elegance-pipeline/agents/elegance-implementer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: elegance-implementer
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.
tools: Read, Write, Edit, Grep, Glob, Bash
model: opus
---

You are the implementation agent in the elegance pipeline.

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.

You have full edit access. Follow the 4-phase protocol: understand scope, plan, implement, verify.

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.
14 changes: 14 additions & 0 deletions plugins/elegance-pipeline/agents/elegance-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: elegance-judge
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.
tools: Read, Grep, Glob, Bash
model: opus
---

You are a code elegance judge in the elegance pipeline.

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.

You are read-only. Do not edit, create, or delete any files.

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.
14 changes: 14 additions & 0 deletions plugins/elegance-pipeline/agents/elegance-planner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: elegance-planner
description: Refactor planner. Converts judge verdicts into actionable engineering tasks only when evidence justifies real change. Use when running the elegance pipeline planner phase.
tools: Read, Grep, Glob, Bash
model: opus
---

You are the refactor planner in the elegance pipeline.

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."

You are read-only. Do not edit, create, or delete any files.

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.
14 changes: 14 additions & 0 deletions plugins/elegance-pipeline/agents/elegance-scout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: elegance-scout
description: Read-only code elegance scout. Inspects an assigned scope for the most elegant source files. Use when running the elegance pipeline scout phase.
tools: Read, Grep, Glob, Bash
model: sonnet
---

You are a code elegance scout in the elegance pipeline.

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.

You are read-only. Do not edit, create, or delete any files. Do not run formatting, refactoring, or build commands.

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.
14 changes: 14 additions & 0 deletions plugins/elegance-pipeline/agents/elegance-verifier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: elegance-verifier
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.
tools: Read, Grep, Glob, Bash
model: opus
---

You are the plan verifier judge in the elegance pipeline.

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.

You are read-only. Do not edit, create, or delete any files.

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.
22 changes: 22 additions & 0 deletions plugins/elegance-pipeline/commands/init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
description: Initialize the elegance pipeline for this repository
disable-model-invocation: true
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disable-model-invocation: true is not used by other commands in this repo and may prevent the interactive behavior described below (asking the user for missing args). Unless this key is confirmed supported and intended here, consider removing it.

Suggested change
disable-model-invocation: true

Copilot uses AI. Check for mistakes.
---

Initialize the elegance pipeline state manager.

Run:

```bash
python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py init \
--project-anchor $ARGUMENTS \
--scope <scope-1> \
--scope <scope-2> \
--scope <scope-3> \
--scope <scope-4>
```

If `$ARGUMENTS` is empty, ask the user for the project anchor file and 4 scout scopes.

The project anchor is any meaningful root file (e.g., `CLAUDE.md`, `package.json`, `*.sln`).
Scout scopes are directories that each scout will analyze independently.
54 changes: 54 additions & 0 deletions plugins/elegance-pipeline/commands/run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: Run the next ready stage of the elegance pipeline
disable-model-invocation: true
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disable-model-invocation: true is not used by other commands in this repo and may prevent the command from actually being executed as an LLM-driven workflow (this command requires tool use + summarization). Unless this flag is confirmed supported/required, consider removing it to match the established command format here.

Suggested change
disable-model-invocation: true

Copilot uses AI. Check for mistakes.
allowed-tools: Read, Grep, Glob, Bash, Agent
---
Comment on lines +1 to +5
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allowed-tools includes Agent, but this repo’s orchestration commands consistently use the Task tool to spawn subagents (and no other command declares an Agent tool). If this is meant to allow subagent spawning, switch to Task and update the command text accordingly.

Copilot uses AI. Check for mistakes.

Run the next ready stage of the elegance pipeline.

## Procedure

1. Check status:

```bash
python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py status
```

2. For each ready slot, render the prompt:

```bash
python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py prompt --role <role> --slot <slot>
```

3. Spawn the matching subagent with the rendered prompt as the task:
- `scout-*` slots -> spawn `elegance-scout` agent (run all 4 in parallel as background agents)
- `judge-*` slots -> spawn `elegance-judge` agent (run both in parallel as background agents)
- `planner-1` -> spawn `elegance-planner` agent
- `verifier-1` -> spawn `elegance-verifier` agent
- `implementer-1` -> spawn `elegance-implementer` agent

4. After each agent completes, pipe its result to the state manager:

```bash
echo "<agent output>" | python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py submit \
--role <role> --slot <slot> --stdin
Comment on lines +33 to +34
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example pipeline submission command echo "<agent output>" | python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py submit ... embeds untrusted agent output directly into a Bash command in double quotes, which still allows command substitution via $(...) or backticks and can lead to arbitrary command execution if the output contains shell metacharacters. An attacker who can influence agent output (e.g., via repository content that the agent echoes) could inject $(malicious_command) and have it executed when this pattern is followed. Adjust the orchestration pattern so agent output is passed to pipeline.py via stdin or a temporary file without going through shell interpolation (for example, by avoiding echo with inline output and using safer redirection or tooling APIs that pass data directly).

Suggested change
echo "<agent output>" | python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py submit \
--role <role> --slot <slot> --stdin
# Recommended: save agent output to a file and pass it via stdin
python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py submit \
--role <role> --slot <slot> --stdin < agent_output.json
# Or, for manual pasting, use a quoted heredoc to avoid shell interpolation:
python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py submit \
--role <role> --slot <slot> --stdin << 'EOF'
<paste agent output here, then press Enter and Ctrl-D>
EOF

Copilot uses AI. Check for mistakes.
```
Comment on lines +33 to +35

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

The procedure for running the pipeline instructs the orchestrator (Claude Code) to pipe agent output into the state manager using echo "<agent output>" | python .... This is a critical command injection vulnerability. If the agent output contains shell metacharacters (e.g., backticks, $(...), or semicolons), they will be executed by the shell when the command is constructed. Since agents can be manipulated or produce unexpected output, this allows for arbitrary command execution on the user's machine.

Suggested change
echo "<agent output>" | python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py submit \
--role <role> --slot <slot> --stdin
```
4. After each agent completes, submit its result to the state manager using the --file argument to avoid shell injection:
```bash
python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py submit \
--role <role> --slot <slot> --file <path_to_agent_output_file>


5. Check status again and repeat for newly unlocked slots.

6. Stop when no more slots are ready or the pipeline is complete.

## Arguments

Pass `$ARGUMENTS` to control which stage to run:
- `scouts` — run only scout phase
- `judges` — run only judge phase
- `all` — run all phases sequentially (default)
- A specific slot like `scout-1` or `judge-2`

Comment on lines +43 to +48
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ## Arguments section claims /elegance-pipeline:run can run phases sequentially based on $ARGUMENTS (e.g., all, scouts, a specific slot), but the command body only documents a manual procedure and the state manager doesn’t implement any “run stage” subcommand. Either implement argument-driven behavior (likely by adding a run command in pipeline.py) or adjust this section to avoid promising functionality that doesn’t exist.

Suggested change
Pass `$ARGUMENTS` to control which stage to run:
- `scouts` — run only scout phase
- `judges` — run only judge phase
- `all` — run all phases sequentially (default)
- A specific slot like `scout-1` or `judge-2`
This command currently documents a **manual procedure** for running the pipeline.
Any `$ARGUMENTS` passed to `/elegance-pipeline:run` **do not change** the behavior described above;
you must explicitly follow the status → prompt → subagent → submit loop.
You MAY still use `$ARGUMENTS` as a human-facing note (for example, to remind yourself you are focusing
on “scouts”, “judges”, or a specific slot), but pipeline execution is not automated by these values.

Copilot uses AI. Check for mistakes.
## Rules

- Never bypass stage gates
- Run scouts and judges in parallel (background agents)
- Run planner, verifier, implementer sequentially (foreground)
- If the verifier says no implementation is warranted, report that and stop
14 changes: 14 additions & 0 deletions plugins/elegance-pipeline/commands/status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Show elegance pipeline workflow status
disable-model-invocation: true
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disable-model-invocation: true is not used by other commands in this repo and may prevent Claude from following the instructions (this command asks to run Bash and then report the output to the user). Unless this is known-good for Claude Code commands, consider removing it.

Suggested change
disable-model-invocation: true

Copilot uses AI. Check for mistakes.
---

Show the current elegance pipeline status.

Run:

```bash
python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py status
```

Report the output to the user, highlighting which agents are ready to run next.
Loading
Loading