{
  "markdown": "<p align=\"center\"><img src=\"logo.png\" width=\"120\" alt=\"logo\" /></p>\n\n# clean-code\n\nA repository-aware agent skill for refactoring legacy code without casually changing its behavior.\n\nIts enforced sequence is:\n\n1. inspect the repository and record the baseline;\n2. add retained characterization tests that pass on unchanged production code;\n3. when the target is an API, resolve whether to preserve v1 in place or leave v1 untouched and add v2;\n4. refactor in small verified batches;\n5. report exact evidence and any remaining risk.\n\nThe skill deliberately prioritizes precise naming and locality. It does not equate clean code with more files, smaller methods, interfaces, patterns, or abstraction layers.\n\n## Install\n\n### Codex project scope\n\nCopy the folder to:\n\n```text\n<repository>/.agents/skills/clean-code/\n```\n\n### Codex user scope\n\nCopy the folder to:\n\n```text\n$HOME/.agents/skills/clean-code/\n```\n\n### Other Agent Skills-compatible clients\n\nPlace the complete `clean-code` directory in the client's configured skills directory. Keep `SKILL.md` at the root of the skill folder.\n\n## Invoke\n\nExplicit invocation in Codex:\n\n```text\n$clean-code Refactor the legacy order-pricing module without changing behavior.\n```\n\nThe description also supports implicit routing for requests about legacy cleanup, maintainability, naming, technical debt, and behavior-preserving refactoring.\n\n## Package contents\n\n```text\nclean-code/\n├── SKILL.md\n├── README.md\n├── REFERENCES.md\n├── LICENSE\n├── agents/\n│   └── openai.yaml\n├── references/\n│   ├── api-versioning.md\n│   ├── characterization-tests.md\n│   ├── refactoring-heuristics.md\n│   └── verification-and-reporting.md\n├── evals/\n│   ├── evals.json\n│   └── trigger-queries.json\n└── scripts/\n    └── validate_skill.py\n```\n\n`SKILL.md` contains the mandatory workflow. Supporting references are loaded only when their step is reached, keeping the primary instructions focused.\n\n## Validate\n\nFrom the skill directory:\n\n```bash\npython3 scripts/validate_skill.py\n```\n\nThe validator checks frontmatter, naming, required files, local links, evaluation fixtures, and OpenAI metadata without third-party packages.\n\n## Core guarantees\n\n- Production behavior is characterized before production edits.\n- Characterization tests are retained as legacy regression tests.\n- API versioning is an explicit decision gate after tests and before implementation.\n- Side-by-side v2 work leaves v1 production files untouched.\n- Refactoring and behavior changes remain separate.\n- Names, cohesion, and local comprehension take priority over arbitrary size metrics.\n- Verification results distinguish passing checks, pre-existing failures, new failures, and commands not run.\n\n## Non-goals\n\nThis skill is not primarily for:\n\n- greenfield implementation;\n- debugging a behavior defect;\n- broad dependency upgrades;\n- formatting-only changes;\n- architecture diagrams or educational explanations;\n- intentional breaking API migrations without a behavior-preserving refactor scope.\n\nSee [REFERENCES.md](REFERENCES.md) for the source material that informed the workflow.\n",
  "bytes": 3081,
  "sha": "7091a785ccdd04efdcd94e9282018b607c47d7fd3266daaa8beb43235728e617",
  "repo_slug": "cskwork/clean-code",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_cskwork_clean_code_246333c2/readme"
}