Skip to content

feat: add AI defensive-layer cleanup mode and portable harness guidance #2

Description

@zhouyuanxinand

Problem

$simplify-codebase already provides a strong evidence-based workflow for ordinary codebase simplification. AI-assisted implementation introduces a second, distinct maintenance burden: implementation-shape tests, build/CI guards, static scans, and inventories that were added only to prevent an AI-generated change from regressing.

Those guardrails need a dedicated investigation and delivery workflow. Treating them as ordinary dead code risks deleting active business, API, security, persistence, lifecycle, or deployment protections. The package also needs a portable SKILL.md contract so the same workflow can be discovered consistently by major coding harnesses.

Proposal

  • Keep the existing $simplify-codebase identity and ordinary-simplification workflow intact.
  • Add an explicit objective selector for AI defensive-layer cleanup; do not mix its candidates with ordinary simplification in one unreviewed change batch.
  • Add focused references for cleanup categories, proof records, stop conditions, and an itemized Handoff deletion ledger.
  • Add cross-harness discovery guidance for Codex, Claude Code, Cursor, GitHub Copilot, Cline, Gemini CLI, and OpenCode.
  • Add a small portable-contract check for the skill name, frontmatter, and local reference links.

Safety boundaries

Selecting a cleanup category authorizes investigation, not removal of a live contract. Security, credentials, input validation, persistence, lifecycle, real deployment behavior, public APIs, and stored-format compatibility remain protected unless explicitly authorized and independently proven safe to retire.

Acceptance criteria

  • Existing $simplify-codebase invocation remains valid.
  • The new objective is explicit and routes to category-specific references only when selected.
  • A defensive-cleanup Handoff explains each deleted file or material section, its original role, evidence, retained behavior, reintroduction trigger, and verification.
  • The package documents portable installation/discovery without vendor-only core frontmatter.
  • Structural validation passes.

A follow-up PR implements this proposal against main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions