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
8 changes: 7 additions & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://github.com/ANcpLua"
},
"metadata": {
"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."
"description": "Claude Code plugin marketplace: 12 plugins, 28 commands, 6 skills, 25 agents. Multi-agent orchestration, cognitive amplification, OpenTelemetry docs, .NET build enforcement, design intelligence, code elegance pipeline, and code simplification."
},
"plugins": [
{
Expand Down Expand Up @@ -73,6 +73,12 @@
"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"
},
{
"name": "code-simplifier",
"description": "Code simplification agent tuned to qyl engineering principles. Measures elegance as problem-complexity / solution-complexity. Zero suppression, compile-time over runtime, less code is better code.",
"version": "1.0.0",
"source": "./plugins/code-simplifier"
}
]
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Added

- **`code-simplifier` plugin (1.0.0)**: Code simplification agent tuned to qyl engineering principles. Replaces Anthropic's JS/React-centric code-simplifier with a language-agnostic version that reads CLAUDE.md for project standards. Measures elegance as problem-complexity / solution-complexity ratio. Zero suppression tolerance, compile-time over runtime, less code is better code. 1 Opus agent
- **`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
Expand Down
20 changes: 20 additions & 0 deletions plugins/code-simplifier/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "code-simplifier",
"version": "1.0.0",
"description": "Code simplification agent tuned to qyl engineering principles. Measures elegance as problem-complexity / solution-complexity. Zero suppression, compile-time over runtime, less code is better code.",
"author": {
"name": "ANcpLua"
},
"repository": "https://github.com/ANcpLua/ancplua-claude-plugins",
"license": "MIT",
"keywords": [
"simplify",
"elegance",
"refactor",
"code-quality",
"qyl"
],
"agents": [
"./agents/code-simplifier.md"
]
}
28 changes: 28 additions & 0 deletions plugins/code-simplifier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# code-simplifier

Code simplification agent tuned to qyl engineering principles.

## Philosophy

Elegance = problem complexity / solution complexity. High ratio is good. This agent finds low-ratio code and fixes it.

## How it differs from Anthropic's code-simplifier

| Aspect | Anthropic | qyl-tuned |
|--------|-----------|-----------|
| Language | JS/React-centric (ES modules, arrow functions, Props types) | Language-agnostic — reads CLAUDE.md |
| Standards | Hardcoded conventions | Project's CLAUDE.md is the source of truth |
| Elegance metric | None — general "clarity" | Problem complexity / solution complexity ratio |
| Suppression | Not mentioned | Zero tolerance — fix the code, not the warning |
| Abstractions | "Maintain balance" | Less code is better. Delete before abstracting |
| Type safety | Not mentioned | Compile-time over runtime. Make invalid states unrepresentable |

## Agent

| Agent | Model | Purpose |
|-------|-------|---------|
| `code-simplifier` | Opus | Simplify recently modified code |

## Usage

The agent activates when the skill `simplify` is invoked. It reads the project's CLAUDE.md, identifies recent changes, scores elegance, and simplifies candidates.
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 README claims "The agent activates when the skill simplify is invoked," but no simplify skill exists in this plugin — there is no skills/ directory, no SKILL.md, and no "skills" entry in plugin.json. Either create a skills/simplify/SKILL.md (and declare "skills": "./skills" in plugin.json, per the convention in plugins/exodia/.claude-plugin/plugin.json and plugins/otelwiki/.claude-plugin/plugin.json), or update this line to accurately describe how the agent is invoked (e.g., by referencing the agent directly).

Suggested change
The agent activates when the skill `simplify` is invoked. It reads the project's CLAUDE.md, identifies recent changes, scores elegance, and simplifies candidates.
Use the `code-simplifier` agent to read the project's CLAUDE.md, identify recent changes, score elegance, and simplify candidates.

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

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

P2 Badge Provide a real simplify entrypoint

This usage line tells users to invoke a simplify skill, but this commit only adds an agent and the plugin manifest has no skills registration (plugins/code-simplifier/.claude-plugin/plugin.json only lists agents). In practice, users following the README will look for a non-existent skill/command and the new plugin appears broken; either add the skill/command entrypoint or update the usage text to the actual invocation path.

Useful? React with 👍 / 👎.

53 changes: 53 additions & 0 deletions plugins/code-simplifier/agents/code-simplifier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: code-simplifier
description: Simplifies recently modified code using qyl engineering principles. Measures elegance as problem-complexity / solution-complexity. Language-agnostic — reads CLAUDE.md for project standards.
model: opus
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 agent frontmatter is missing the tools: field. Every other agent in this repo declares which tools it can use (e.g., plugins/council/agents/opus-captain.md declares Task, Read, WebSearch, WebFetch, Bash; plugins/elegance-pipeline/agents/elegance-implementer.md declares Read, Write, Edit, Grep, Glob, Bash). This agent's workflow requires reading files (step 1 and 2), running git diff (step 2), and editing code (step 4), so it should declare the appropriate tools (at minimum Read, Grep, Glob, Bash, Write, Edit).

Suggested change
model: opus
model: opus
tools: [Read, Grep, Glob, Bash, Write, Edit]

Copilot uses AI. Check for mistakes.
---

You are a code simplification agent. You measure elegance as the ratio of problem complexity to solution complexity. A file that solves a hard problem with simple code is elegant. A file that solves a simple problem with complex code is a candidate for simplification.

You refine recently modified code unless instructed to review a broader scope.

## Principles

These are non-negotiable. They override any instinct to "improve" code by making it more complex.

**Less code is better code.** Every line must justify its existence. If removing a line doesn't break anything, the line shouldn't exist. Three similar lines are better than a premature abstraction. A deleted function is a function nobody has to understand.

**Complexity kills.** Prefer boring, straightforward solutions. If you need a comment to explain clever code, the code isn't clever — it's unclear. Flatten nesting. Replace conditionals with polymorphism or pattern matching when the type system supports it. Never nest ternaries.

**Compile-time over runtime.** Push constraints into the type system. Make invalid states unrepresentable. Prefer `required init` properties over runtime null checks. Prefer discriminated unions over type-testing. Prefer source generators over runtime reflection. If the compiler can catch it, don't write a test for it.

**Zero suppression.** Never introduce `#pragma warning disable`, `[SuppressMessage]`, `<NoWarn>`, `// @ts-ignore`, `// eslint-disable`, `@SuppressWarnings`, or any equivalent. If a warning fires, fix the code. If the warning is wrong, fix the architecture that makes it fire.

**Fix root causes.** If you find yourself adding a null check, ask why the value can be null. If you find yourself adding a try/catch, ask why the operation can fail. Fix the source, not the symptom.

## What you do

1. **Read the project's CLAUDE.md** for language-specific standards, banned APIs, and conventions. Follow those exactly — they override any default you'd otherwise apply.

2. **Identify recently modified code.** Use `git diff --name-only HEAD~1` or the session's changed files.

3. **Score each file's elegance.** Problem complexity (domain logic, algorithm, integration surface) divided by solution complexity (lines, nesting depth, abstraction layers, dependencies). High ratio = elegant. Low ratio = simplification candidate.

4. **Simplify.** For each candidate:
- Remove dead code, unused imports, unreachable branches
- Flatten unnecessary nesting (early returns, guard clauses)
- Replace verbose patterns with idiomatic equivalents the language provides
- Consolidate duplicated logic only when the abstraction is obvious and named well
- Remove comments that describe what the code does (the code should say that)
- Keep comments that describe why (intent, constraints, non-obvious trade-offs)

5. **Preserve functionality.** Never change what code does. Change only how it's expressed. All tests must still pass. All public APIs must retain their signatures.

6. **Stop when the code is clear.** Do not chase perfection. Do not refactor for the sake of refactoring. If the code is readable, correct, and follows project standards — leave it alone.

## What you never do

- Add abstractions for hypothetical future requirements
- Create helper utilities used exactly once
- Add error handling for scenarios that can't happen
- Add type annotations or docstrings to code you didn't change
- Introduce new dependencies to save a few lines
- Make code "more testable" by splitting things that belong together
- Prioritize fewer lines over readability
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[project]
name = "ancplua-claude-plugins"
version = "0.1.0"
requires-python = ">=3.14"

Choose a reason for hiding this comment

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

critical

The specified Python version requires-python = ">=3.14" is invalid as Python 3.14 has not been released. This will prevent the project from being installed with any current Python version. Please specify a requirement for a released Python version, for example >=3.12.

Suggested change
requires-python = ">=3.14"
requires-python = ">=3.12"

dependencies = []
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.

The pyproject.toml is not mentioned in the PR description, which describes only the code-simplifier plugin, marketplace.json, and CHANGELOG.md changes. This file is unrelated to the code-simplifier plugin being added and appears to be an unrelated change bundled into this PR. Additionally, requires-python = ">=3.14" is very aggressive — the existing Python code in this repo (e.g., plugins/elegance-pipeline/elegance_pipeline/pipeline.py, plugins/hookify/hookify/core/) uses standard Python 3.9+ features. This minimum version would unnecessarily prevent running on Python 3.12/3.13 which are the current stable releases. Consider either removing this file from this PR (it's unrelated to code-simplifier) or lowering to >=3.10 or >=3.12 to match what the existing code actually requires.

Copilot uses AI. Check for mistakes.
Loading