By mikecubed
Composable, multi-language, TDD-first clean code enforcement system. Orchestrates 10 check sub-skills (tdd, arch, type, naming, size, dead, test, sec, dep, obs) across TypeScript, JavaScript, Python, Go, and Rust.
Enforces architectural boundary rules (ARCH-1 through ARCH-6). Loaded by the conductor for review, refactor, and new-service operations. Detects layer violations, circular imports, and missing public API declarations. Architecture boundaries are language-agnostic — no language reference files needed.
Core orchestrator for Clean Code Codex enforcement. Auto-invoked when writing, reviewing, refactoring, or testing code in TypeScript, Python, Go, Rust, or JavaScript. Detects language, routes to targeted check sub-skills, enforces the TDD gate on write operations, and runs a Boy Scout check at session end. Do NOT invoke for documentation-only edits, configuration files (JSON/YAML/TOML), or non-code content.
Enforces dead code elimination rules (DEAD-1 through DEAD-5). Loaded by the conductor for review, refactor, and cleanup operations. Detects commented-out code, unused exports, orphaned files, unlinked TODOs, and stub/placeholder functions. References scripts/lint_dead_code.py for export and orphan detection.
Enforces dependency health rules (DEP-1 through DEP-5). Loaded by the conductor for dependency update operations and CI full-check runs. Detects known vulnerabilities, version lag, unused dependencies, misclassified dev/prod dependencies, and unpinned production versions. Invokes scripts/dep_audit.sh for automated vulnerability scanning. Activated by: "check dependencies", "update deps", "CVE", "vulnerability scan", "npm audit".
Enforces naming convention rules (NAME-1 through NAME-7). Loaded by the conductor for write and review operations. Detects meaningless names, incorrect boolean prefixes, misleading names, abbreviations, and naming inconsistencies. Loads references/{language}.md for language-specific casing conventions before checking.
Executes bash commands
Hook triggers when Bash tool is used
Modifies files
Hook triggers on file write and edit operations
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
A composable, multi-language, TDD-first clean code enforcement system for AI agents.
Version: 1.1.2 | Languages: TypeScript · Python · Go · Rust · JavaScript
# Install directly from this repo
claude --plugin-dir /path/to/clean-code-codex
# Or clone and install
git clone https://github.com/mikecubed/clean-code-codex.git
claude --plugin-dir ./clean-code-codex
GitHub Copilot uses agent files in .github/agents/ and coding instructions in
.github/copilot-instructions.md. Install in three steps:
Step 1 — Clone the plugin
git clone https://github.com/mikecubed/clean-code-codex.git
Step 2 — Copy the agent and skills to your project
# Agent definition (makes the agent available in Copilot Chat / CLI)
mkdir -p .github/agents
cp /path/to/clean-code-codex/agents/clean-code-codex.agent.md .github/agents/
# Skills (required for the agent to function)
cp -r /path/to/clean-code-codex/skills ./skills
cp -r /path/to/clean-code-codex/commands ./commands
cp -r /path/to/clean-code-codex/hooks ./hooks
cp -r /path/to/clean-code-codex/gh-hooks ./gh-hooks
Step 3 — Generate coding instructions (optional but recommended)
Populates .github/copilot-instructions.md with the top-priority rules so Copilot
applies them in every response — without any explicit invocation.
bash /path/to/clean-code-codex/scripts/generate-instructions.sh
The agent is now available as @clean-code-codex in GitHub Copilot Chat and
activates automatically on write, review, refactor, and test operations.
Set up enforcement hooks (recommended):
Hooks fire automatically at write/edit/bash time for real-time rule enforcement.
# Copy the Copilot CLI hook configuration to your project
mkdir -p .github/hooks
cp /path/to/clean-code-codex/gh-hooks/hooks.json .github/hooks/hooks.json
# Make hook scripts executable
chmod +x /path/to/clean-code-codex/hooks/scripts/*.sh
Update the script paths in .github/hooks/hooks.json to absolute paths pointing
to the copied hooks/scripts/ directory.
Note: Without hooks, the agent still enforces all 65 rules on demand — hooks add real-time blocking/warning at the point of action. See
docs/hooks.mdfor full hook details and per-CLI configuration.
cp -r . ~/.agent/skills/clean-code-codex
The conductor skill (skills/conductor/SKILL.md) is the sole entry point.
All other sub-skills are loaded on demand.
Via slash command (Claude Code):
/codex # Auto-detect language + full review
/codex src/ # Scope to src/ directory
/codex --fix # Auto-remediate WARN violations
/codex src/ --scope "**/*.ts" # TypeScript files in src/ only
/codex --deep --history # Exhaustive scan + git history analysis
/codex --scaffold-tests # Generate test skeletons on TDD-1 blocks
/codex --diff-only # Review only changed files (git diff HEAD)
/codex --explain NAME-1 # Print NAME-1 explanation and exit
/codex --explain # Add explanations to all violations
/codex --refresh # Re-detect language/framework/layers
Auto-activation: The conductor also activates automatically when you write, review, refactor, or test code — no explicit invocation required.
CLI arguments (all optional; defaults are safe):
/codex [path] [--scope <glob>] [--fix] [--write] [--history] [--deep] [--scaffold-tests] [--diff-only] [--explain [RULE-ID]] [--refresh]
| Argument | Default | Description |
|---|---|---|
path | repo root | Limit scope to a file or directory |
--scope <glob> | repo root | Restrict all operations to matching paths |
--fix | off | Permit auto-remediation edits for WARN violations |
--write | off | Permit scaffold/write operations (TDD-gated) |
--history | off | Include git history analysis (needed for SEC-1/SEC-6) |
--deep | off | Enable slower exhaustive scans |
--scaffold-tests | off | Generate test skeletons on TDD-1 blocks |
--diff-only | off | Review only changed files (git diff HEAD) |
--explain [RULE-ID] | off | Print explanation for a specific rule, or add explanations to all violations |
--refresh | off | Re-detect language/framework/layers (clears .codex/config.json cache) |
Safety defaults:
--fix: zero file modifications, regardless of violations found--scope or path: agent asks for scope when repo has > 50 tracked files--fix AND explicit user confirmationnpx claudepluginhub mikecubed/clean-code-codex --plugin clean-code-codexTactical code cleanup: type strictness, single responsibility, and fail-fast patterns. Detects sloppy code, workarounds, and silent failures.
Self-review workflow: Simplifier + Scrutinizer for code quality
Process discipline for AI coding agents — TDD enforcement and policies.
Code review, refactoring, linting, anti-pattern detection, and static analysis
Automated Test-Driven Development enforcement
使用多個專門代理進行自動化程式碼審查,配備基於置信度的評分系統以過濾誤報