Skip to content

feat: add elegance-pipeline plugin (Codex bundle -> Claude Code native)#156

Merged
ANcpLua merged 1 commit intomainfrom
feat/elegance-pipeline
Mar 6, 2026
Merged

feat: add elegance-pipeline plugin (Codex bundle -> Claude Code native)#156
ANcpLua merged 1 commit intomainfrom
feat/elegance-pipeline

Conversation

@ANcpLua
Copy link
Owner

@ANcpLua ANcpLua commented Mar 6, 2026

Summary

Converts the Codex elegance-pipeline-bundle.zip into a native Claude Code plugin.

Pipeline

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

What changed

  • 17 new files in plugins/elegance-pipeline/: plugin manifest, 5 agents, 3 commands, 1 skill, pipeline.py state manager, 5 templates
  • All .codex/ paths rewritten to ${CLAUDE_PLUGIN_ROOT}
  • Codex-Spark -> sonnet, GPT-5.4 -> opus
  • --solution-file -> --project-anchor (framework-agnostic)
  • State moved to project-local .claude/elegance_pipeline/state/
  • Initialized with 4 scout scopes: exodia, metacognitive-guard, hookify, feature-dev

Also fixed

  • marketplace.json version mismatches: hookify 0.2.0->0.2.1, metacognitive-guard 0.4.5->0.5.0

Validation

  • All 17 expected files present
  • JSON valid, shellcheck clean, Pyright clean
  • pipeline.py status and prompt commands verified working
  • 11/11 plugins in marketplace, all versions synced

Summary by CodeRabbit

  • New Features

    • Added elegance-pipeline plugin featuring a multi-agent workflow to evaluate code elegance with initialization, status, and execution commands.
  • Documentation

    • Added comprehensive documentation for the elegance-pipeline plugin, including workflow guides and agent role specifications.

…e) (#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
Copilot AI review requested due to automatic review settings March 6, 2026 07:22
@ANcpLua ANcpLua merged commit b0eb7de into main Mar 6, 2026
6 of 8 checks passed
@ANcpLua ANcpLua deleted the feat/elegance-pipeline branch March 6, 2026 07:22
@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 93f92f65-8069-450b-a542-fdbd962d2fcb

📥 Commits

Reviewing files that changed from the base of the PR and between b9d944f and 9d8d6dc.

📒 Files selected for processing (20)
  • .claude-plugin/marketplace.json
  • .gitignore
  • CHANGELOG.md
  • plugins/elegance-pipeline/.claude-plugin/plugin.json
  • plugins/elegance-pipeline/README.md
  • plugins/elegance-pipeline/agents/elegance-implementer.md
  • plugins/elegance-pipeline/agents/elegance-judge.md
  • plugins/elegance-pipeline/agents/elegance-planner.md
  • plugins/elegance-pipeline/agents/elegance-scout.md
  • plugins/elegance-pipeline/agents/elegance-verifier.md
  • plugins/elegance-pipeline/commands/init.md
  • plugins/elegance-pipeline/commands/run.md
  • plugins/elegance-pipeline/commands/status.md
  • plugins/elegance-pipeline/elegance_pipeline/pipeline.py
  • plugins/elegance-pipeline/elegance_pipeline/templates/implementer.md
  • plugins/elegance-pipeline/elegance_pipeline/templates/judge.md
  • plugins/elegance-pipeline/elegance_pipeline/templates/planner.md
  • plugins/elegance-pipeline/elegance_pipeline/templates/scout.md
  • plugins/elegance-pipeline/elegance_pipeline/templates/verifier.md
  • plugins/elegance-pipeline/skills/elegance-pipeline/SKILL.md

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting


📝 Walkthrough

Walkthrough

Introduces the "elegance-pipeline" plugin, a multi-agent code-analysis system with scouts, judges, planner, verifier, and implementer agents coordinated via a Python state manager. Updates marketplace metadata and versioning for related plugins.

Changes

Cohort / File(s) Summary
Plugin Registration and Metadata
.claude-plugin/marketplace.json, .gitignore, plugins/elegance-pipeline/.claude-plugin/plugin.json
Registered new elegance-pipeline plugin (v1.0.0) in marketplace, bumped versions for metacognitive-guard (0.5.0) and hookify (0.2.1), added ignore patterns for pipeline state and backups.
Plugin Documentation
plugins/elegance-pipeline/README.md, CHANGELOG.md
Added plugin README describing multi-agent workflow and commands; added unreleased changelog entries documenting elegance-pipeline introduction, marketplace fixes, and new features.
Agent Specifications
plugins/elegance-pipeline/agents/elegance-scout.md, elegance-judge.md, elegance-planner.md, elegance-verifier.md, elegance-implementer.md
Defined five agent roles with YAML metadata and detailed task descriptions: read-only scouts evaluate files by complexity; judge selects top 5; planner generates tasks; verifier gates implementation; implementer executes approved refactors.
Command Documentation
plugins/elegance-pipeline/commands/init.md, status.md, run.md
Documented three CLI commands: init (setup with project anchor and scopes), status (show workflow progress), run (execute ready pipeline stages with sequencing rules).
Pipeline State Manager
plugins/elegance-pipeline/elegance_pipeline/pipeline.py
Implemented 350+ lines of workflow coordination: FileStore for persistent state, WorkflowCoordinator for agent orchestration, data models (AgentRecord, WorkflowConfig, WorkflowState), template rendering, and CLI interface supporting init/status/prompt/submit/signal subcommands.
Workflow Templates and Skill
plugins/elegance-pipeline/elegance_pipeline/templates/scout.md, judge.md, planner.md, verifier.md, implementer.md, plugins/elegance-pipeline/skills/elegance-pipeline/SKILL.md
Added five agent instruction templates with structured evaluation criteria, decision rules, and output formats; documented skill overview with stage definitions, orchestration rules, and agent-to-model mapping.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Pipeline as Pipeline Manager
    participant Scouts
    participant Judges
    participant Planner
    participant Verifier
    participant Implementer
    participant StateStore as State Store

    User->>Pipeline: init (project_anchor, scopes)
    Pipeline->>StateStore: create initial state
    User->>Pipeline: run
    Pipeline->>StateStore: load state
    Pipeline->>Scouts: prompt (4 parallel)
    Scouts-->>StateStore: submit results
    Pipeline->>Judges: prompt (2 parallel)
    Judges-->>StateStore: submit results
    Pipeline->>Planner: prompt (sequential)
    Planner-->>StateStore: submit tasks
    Pipeline->>Verifier: prompt (sequential)
    Verifier-->>StateStore: submit approval + signal
    alt Verifier: READY
        Pipeline->>Implementer: prompt (gated)
        Implementer-->>StateStore: submit refactors
    else Verifier: NOT READY
        Pipeline->>User: stop (no implementation)
    end
    Pipeline->>User: workflow complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/elegance-pipeline

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Claude Code plugin ecosystem by integrating a sophisticated multi-agent code elegance pipeline. This new plugin automates the process of identifying and addressing code quality issues, transforming a previously external workflow into a native, integrated experience. The changes also include crucial updates to plugin metadata, ensuring the marketplace accurately reflects the available tools and their versions.

Highlights

  • New Elegance Pipeline Plugin: Introduced a new elegance-pipeline plugin, converting a Codex bundle into a native Claude Code plugin for multi-agent code elegance workflow. This includes 17 new files covering agents, commands, templates, and a state manager.
  • Multi-Agent Workflow Structure: The pipeline is structured with 4 scouts (sonnet), 2 judges (opus), 1 planner (opus), 1 verifier (opus), and 1 gated implementer (opus), designed to evaluate code elegance and facilitate refactoring.
  • Configuration and Path Modernization: Updated all .codex/ paths to ${CLAUDE_PLUGIN_ROOT} and replaced --solution-file with the more framework-agnostic --project-anchor. Model mappings were updated from Codex-Spark to sonnet and GPT-5.4 to opus.
  • Local State Management: The pipeline's persistent state is now managed locally within .claude/elegance_pipeline/state/, ensuring it is not committed to git.
  • Marketplace Version Sync: Fixed version mismatches in marketplace.json for the hookify (0.2.0 -> 0.2.1) and metacognitive-guard (0.4.5 -> 0.5.0) plugins, ensuring consistency with their respective plugin.json files.
Changelog
  • .claude-plugin/marketplace.json
    • Updated marketplace description to reflect 11 plugins, 28 commands, 6 skills, and 24 agents, including the new elegance pipeline.
    • Updated the version of the metacognitive-guard plugin from 0.4.5 to 0.5.0.
    • Updated the version of the hookify plugin from 0.2.0 to 0.2.1.
    • Added a new entry for the elegance-pipeline plugin (version 1.0.0).
  • .gitignore
    • Added entries to ignore runtime state files for the elegance pipeline (.claude/elegance_pipeline/ and .codex.backup.*).
  • CHANGELOG.md
    • Added a new entry for the elegance-pipeline plugin (1.0.0), detailing its multi-agent workflow and conversion from a Codex bundle.
    • Added a fix entry for marketplace.json version mismatches for hookify and metacognitive-guard.
  • plugins/elegance-pipeline/.claude-plugin/plugin.json
    • Added the plugin manifest for the new elegance-pipeline plugin, defining its name, version, description, author, repository, license, keywords, commands, and agents.
  • plugins/elegance-pipeline/README.md
    • Added comprehensive documentation for the elegance-pipeline plugin, explaining its purpose, multi-agent pipeline stages, setup instructions, usage examples, state management, and origin.
  • plugins/elegance-pipeline/agents/elegance-implementer.md
    • Added the agent definition for elegance-implementer, outlining its role in executing verifier-approved refactor plans with full edit access.
  • plugins/elegance-pipeline/agents/elegance-judge.md
    • Added the agent definition for elegance-judge, describing its function in verifying scout findings against the codebase and producing a top-5 ranking of elegant files.
  • plugins/elegance-pipeline/agents/elegance-planner.md
    • Added the agent definition for elegance-planner, detailing its responsibility to convert judge verdicts into actionable refactor tasks.
  • plugins/elegance-pipeline/agents/elegance-scout.md
    • Added the agent definition for elegance-scout, specifying its read-only role in inspecting assigned scopes for elegant code candidates.
  • plugins/elegance-pipeline/agents/elegance-verifier.md
    • Added the agent definition for elegance-verifier, outlining its function in validating planner outputs and controlling the implementation signal gate.
  • plugins/elegance-pipeline/commands/init.md
    • Added the command definition for initializing the elegance pipeline, including arguments for project anchor and scout scopes.
  • plugins/elegance-pipeline/commands/run.md
    • Added the command definition for running stages of the elegance pipeline, detailing the procedure for orchestration and agent spawning.
  • plugins/elegance-pipeline/commands/status.md
    • Added the command definition for displaying the current status of the elegance pipeline workflow.
  • plugins/elegance-pipeline/elegance_pipeline/pipeline.py
    • Added the core Python script for the elegance pipeline state manager, handling workflow state, agent coordination, configuration, and command-line interface for init, status, prompt, submit, and signal operations.
  • plugins/elegance-pipeline/elegance_pipeline/templates/implementer.md
    • Added the prompt template for the elegance-implementer agent, detailing its task, scope rules, implementation phases, and output contract.
  • plugins/elegance-pipeline/elegance_pipeline/templates/judge.md
    • Added the prompt template for the elegance-judge agent, outlining its task to verify scout findings, define elegance, and format its top-5 picks.
  • plugins/elegance-pipeline/elegance_pipeline/templates/planner.md
    • Added the prompt template for the elegance-planner agent, specifying its task to convert judge verdicts into justified implementation tasks.
  • plugins/elegance-pipeline/elegance_pipeline/templates/scout.md
    • Added the prompt template for the elegance-scout agent, detailing its task to inspect code for elegance candidates within its assigned scope.
  • plugins/elegance-pipeline/elegance_pipeline/templates/verifier.md
    • Added the prompt template for the elegance-verifier agent, outlining its role in validating the planner's output and controlling the implementation signal.
  • plugins/elegance-pipeline/skills/elegance-pipeline/SKILL.md
    • Added the skill definition for the elegance-pipeline, describing its multi-agent workflow, state manager commands, orchestration rules, and agent model mapping.
Activity
  • The new elegance-pipeline plugin was successfully integrated and verified.
  • All 17 new files expected for the plugin were confirmed present.
  • JSON validity, shellcheck cleanliness, and Pyright cleanliness were verified for the new code.
  • The pipeline.py status and prompt commands were tested and confirmed working.
  • All 11 plugins in the marketplace were checked, and their versions were synced.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new "elegance-pipeline" plugin, a significant feature involving a multi-agent workflow. However, several security vulnerabilities were identified, including a critical command injection risk in the orchestration instructions and potential prompt injection and security logic bypasses in the state manager, stemming from insecure handling of LLM-generated content. Additionally, critical logic bugs were found in the Python state manager ("pipeline.py") related to template rendering safety, state transition logic, and readiness checks, along with a minor formatting issue in "CHANGELOG.md".

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

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>

Comment on lines +208 to +213
if approved:
state.implementation_signal = True
state.verifier_signal_source = slot
else:
state.implementation_signal = False
state.verifier_signal_source = slot

Choose a reason for hiding this comment

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

high

This logic for setting the implementation_signal has a subtle bug. If approved is None (i.e., the verifier's output did not contain a clear 'yes' or 'no'), the else branch is executed, which incorrectly sets state.implementation_signal to False. The signal should only be updated when a definitive decision is found. The current implementation could prematurely block the pipeline on ambiguous output. Additionally, the assignment to verifier_signal_source is duplicated.

Suggested change
if approved:
state.implementation_signal = True
state.verifier_signal_source = slot
else:
state.implementation_signal = False
state.verifier_signal_source = slot
if approved is not None:
state.implementation_signal = approved
state.verifier_signal_source = slot

Comment on lines +238 to +245
if record.slot not in ready and record.status != "submitted":
reasons = {
"judge": "All 4 scouts must be submitted first.",
"planner": "Both judges must be submitted first.",
"verifier": "Planner must be submitted first.",
"implementer": "Verifier must approve implementation first or set signal manually.",
}
raise SystemExit(reasons.get(record.role, "This slot is not ready yet."))

Choose a reason for hiding this comment

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

high

There's a logic flaw in _assert_ready. It incorrectly allows generating a new prompt for a pipeline stage that has already been completed. The condition and record.status != "submitted" bypasses the readiness check for submitted slots, which could lead to re-running parts of the pipeline unnecessarily. The check should fail for any slot that is not in the ready set, with a more specific error message for already-submitted slots.

Suggested change
if record.slot not in ready and record.status != "submitted":
reasons = {
"judge": "All 4 scouts must be submitted first.",
"planner": "Both judges must be submitted first.",
"verifier": "Planner must be submitted first.",
"implementer": "Verifier must approve implementation first or set signal manually.",
}
raise SystemExit(reasons.get(record.role, "This slot is not ready yet."))
if record.slot not in ready:
if record.status == "submitted":
raise SystemExit(f"Slot {record.slot} has already been submitted.")
reasons = {
"judge": "All 4 scouts must be submitted first.",
"planner": "Both judges must be submitted first.",
"verifier": "Planner must be submitted first.",
"implementer": "Verifier must approve implementation first or set signal manually.",
}
raise SystemExit(reasons.get(record.role, f"This slot is not ready yet: {record.slot}"))

Comment on lines +112 to +119
def render(self, name: str, context: Dict[str, str]) -> str:
template_path = TEMPLATE_DIR / f"{name}.md"
if not template_path.exists():
raise SystemExit(f"Missing template: {template_path}")
text = template_path.read_text(encoding="utf-8")
for key, value in context.items():
text = text.replace("{" + key + "}", value)
return text

Choose a reason for hiding this comment

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

security-medium medium

The TemplateRenderer.render method uses text.replace() in a loop, making it vulnerable to recursive replacement (a form of prompt injection). This could allow an agent to inject instructions or placeholders into subsequent prompts, leading to information leakage or manipulation. The current str.replace logic is also not safe for template rendering as it can lead to incorrect prompt generation if a replacement value contains a placeholder, making the output brittle and dependent on iteration order. A single-pass substitution using re.sub is recommended for safer and more predictable templating, preventing recursive injection.

Suggested change
def render(self, name: str, context: Dict[str, str]) -> str:
template_path = TEMPLATE_DIR / f"{name}.md"
if not template_path.exists():
raise SystemExit(f"Missing template: {template_path}")
text = template_path.read_text(encoding="utf-8")
for key, value in context.items():
text = text.replace("{" + key + "}", value)
return text
def render(self, name: str, context: Dict[str, str]) -> str:
template_path = TEMPLATE_DIR / f"{name}.md"
if not template_path.exists():
raise SystemExit(f"Missing template: {template_path}")
text = template_path.read_text(encoding="utf-8")
# Use a single-pass replacement to prevent recursive injection
def replace(match):
return context.get(match.group(1), match.group(0))
import re
return re.sub(r"\{([^\{}]+)\}", replace, text)

Comment on lines +204 to +207
if role == "verifier":
approved = self._parse_bool(text, r"Implementation approved:\s*(yes|no)")
if approved is None:
approved = self._parse_bool(text, r"Implementation warranted:\s*(yes|no)")

Choose a reason for hiding this comment

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

security-medium medium

The submit command parses the verifier's output using re.search on the entire text to determine the implementation_signal. Since the verifier's prompt includes the output of the planner, a malicious or compromised planner could inject a fake verdict (e.g., "Implementation approved: yes") into its output. If the verifier includes this in its response, the script might find it and enable the implementation phase (which has full write access) even if the verifier's own verdict was "no".

Suggested change
if role == "verifier":
approved = self._parse_bool(text, r"Implementation approved:\s*(yes|no)")
if approved is None:
approved = self._parse_bool(text, r"Implementation warranted:\s*(yes|no)")
if role == "verifier":
# Narrow the search to the Verdict section to prevent injection from context
verdict_match = re.search(r"## Verdict\s*(.*)", text, flags=re.DOTALL | re.IGNORECASE)
verdict_text = verdict_match.group(1) if verdict_match else text
approved = self._parse_bool(verdict_text, r"Implementation approved:\s*(yes|no)")
if approved is None:
approved = self._parse_bool(verdict_text, r"Implementation warranted:\s*(yes|no)")


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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Claude Code-native plugin (elegance-pipeline) that ports the prior Codex “elegance pipeline bundle” into this repo’s plugin marketplace, including a Python state manager and agent/command/skill assets, and updates the marketplace + changelog accordingly.

Changes:

  • Added plugins/elegance-pipeline/ with a persistent pipeline state manager (pipeline.py), prompt templates, 5 agent definitions, 3 commands, and 1 skill.
  • Updated .claude-plugin/marketplace.json to add the new plugin and to sync hookify/metacognitive-guard versions.
  • Updated CHANGELOG.md and .gitignore to document/ignore the new plugin’s runtime state.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
plugins/elegance-pipeline/skills/elegance-pipeline/SKILL.md Adds a skill definition describing the pipeline workflow and how to orchestrate it.
plugins/elegance-pipeline/elegance_pipeline/templates/scout.md Adds scout role prompt template.
plugins/elegance-pipeline/elegance_pipeline/templates/judge.md Adds judge role prompt template.
plugins/elegance-pipeline/elegance_pipeline/templates/planner.md Adds planner role prompt template.
plugins/elegance-pipeline/elegance_pipeline/templates/verifier.md Adds verifier role prompt template (controls gate).
plugins/elegance-pipeline/elegance_pipeline/templates/implementer.md Adds implementer role prompt template (execution protocol).
plugins/elegance-pipeline/elegance_pipeline/pipeline.py Introduces the Python workflow state manager (init/status/prompt/submit/signal).
plugins/elegance-pipeline/commands/init.md Adds a slash command to initialize pipeline state.
plugins/elegance-pipeline/commands/status.md Adds a slash command to show pipeline status.
plugins/elegance-pipeline/commands/run.md Adds a slash command intended to run the next stage via orchestration steps.
plugins/elegance-pipeline/agents/elegance-scout.md Adds scout agent definition.
plugins/elegance-pipeline/agents/elegance-judge.md Adds judge agent definition.
plugins/elegance-pipeline/agents/elegance-planner.md Adds planner agent definition.
plugins/elegance-pipeline/agents/elegance-verifier.md Adds verifier agent definition.
plugins/elegance-pipeline/agents/elegance-implementer.md Adds implementer agent definition.
plugins/elegance-pipeline/README.md Documents purpose, setup, usage, and state location for the plugin.
plugins/elegance-pipeline/.claude-plugin/plugin.json Adds plugin manifest registering commands and agents.
.claude-plugin/marketplace.json Adds the new plugin and bumps versions for hookify/metacognitive-guard.
CHANGELOG.md Documents the new plugin and marketplace version sync changes.
.gitignore Ignores project-local elegance pipeline state directory and Codex backup artifacts.

Comment on lines +204 to +213
if role == "verifier":
approved = self._parse_bool(text, r"Implementation approved:\s*(yes|no)")
if approved is None:
approved = self._parse_bool(text, r"Implementation warranted:\s*(yes|no)")
if approved:
state.implementation_signal = True
state.verifier_signal_source = slot
else:
state.implementation_signal = False
state.verifier_signal_source = slot
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.

Verifier decision parsing: if neither "Implementation approved:" nor "Implementation warranted:" is found, approved stays None and the code falls into the else branch, silently forcing implementation_signal = False. This should fail loudly (exit with an error) so a malformed verifier output can’t accidentally block (or mis-set) the implementation gate.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +26

SCRIPT_DIR = Path(__file__).resolve().parent
TEMPLATE_DIR = SCRIPT_DIR / "templates"
STATE_DIR = Path.cwd() / ".claude" / "elegance_pipeline" / "state"
CONFIG_PATH = STATE_DIR / "config.json"
STATE_PATH = STATE_DIR / "workflow_state.json"
PIPELINE_CMD = f"python {SCRIPT_DIR / 'pipeline.py'}"
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.

PIPELINE_CMD hardcodes python and doesn’t quote the script path. This can break in environments where python isn’t on PATH, where Python 2 is default, or when the plugin path contains spaces. Prefer building the command from sys.executable and shell-quoting the path (or emit a list/JSON form if supported).

Suggested change
SCRIPT_DIR = Path(__file__).resolve().parent
TEMPLATE_DIR = SCRIPT_DIR / "templates"
STATE_DIR = Path.cwd() / ".claude" / "elegance_pipeline" / "state"
CONFIG_PATH = STATE_DIR / "config.json"
STATE_PATH = STATE_DIR / "workflow_state.json"
PIPELINE_CMD = f"python {SCRIPT_DIR / 'pipeline.py'}"
import shlex
SCRIPT_DIR = Path(__file__).resolve().parent
TEMPLATE_DIR = SCRIPT_DIR / "templates"
STATE_DIR = Path.cwd() / ".claude" / "elegance_pipeline" / "state"
CONFIG_PATH = STATE_DIR / "config.json"
STATE_PATH = STATE_DIR / "workflow_state.json"
PIPELINE_CMD = f"{shlex.quote(sys.executable)} {shlex.quote(str(SCRIPT_DIR / 'pipeline.py'))}"

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
---
description: Run the next ready stage of the elegance pipeline
disable-model-invocation: true
allowed-tools: Read, Grep, Glob, Bash, Agent
---
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.
@@ -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.
@@ -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.

SCRIPT_DIR = Path(__file__).resolve().parent
TEMPLATE_DIR = SCRIPT_DIR / "templates"
STATE_DIR = Path.cwd() / ".claude" / "elegance_pipeline" / "state"
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.

--project-root is stored in config and printed, but STATE_DIR is always computed from Path.cwd(). That means running the command from a different working directory will write state to the wrong place, and project_root has no functional effect. Consider deriving the state directory from cfg.project_root (or remove --project-root if it’s intentionally unused).

Suggested change
STATE_DIR = Path.cwd() / ".claude" / "elegance_pipeline" / "state"
_ENV_PROJECT_ROOT = os.environ.get("ELEGANCE_PIPELINE_PROJECT_ROOT")
_BASE_DIR = Path(_ENV_PROJECT_ROOT) if _ENV_PROJECT_ROOT else Path.cwd()
STATE_DIR = _BASE_DIR / ".claude" / "elegance_pipeline" / "state"

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +26
],
"commands": "./commands",
"agents": [
"./agents/elegance-scout.md",
"./agents/elegance-judge.md",
"./agents/elegance-planner.md",
"./agents/elegance-verifier.md",
"./agents/elegance-implementer.md"
]
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.
@@ -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.
Comment on lines +43 to +48
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`

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.
Comment on lines +33 to +34
echo "<agent output>" | python ${CLAUDE_PLUGIN_ROOT}/elegance_pipeline/pipeline.py submit \
--role <role> --slot <slot> --stdin
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants