kramme-cc-workflow/skills/kramme:code:cleanup-ai/SKILL.md
Remove AI-generated code slop from a branch. Use when cleaning up AI-generated code, removing unnecessary comments, defensive checks, or type casts. Checks the branch diff against the resolved base and fixes style inconsistencies. Not for generated, vendored, lockfile, snapshot, or `*.d.ts` files.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:code:cleanup-aiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill uses the kramme:deslop-reviewer agent to identify AI slop in the branch's diff against a base, then applies the agent's recommended fixes.
Sibling: this is the AI-slop-specific pass via kramme:deslop-reviewer; for a general simplification pass on the same post-feature branch, use kramme:code:refactor-pass.
Parse $ARGUMENTS before the preconditions. If --auto is present, set AUTO_MODE=true and remove the flag before base-branch resolution. If one non-option argument remains, set BASE_BRANCH_OVERRIDE to that value. --auto applies medium-confidence cleanup findings automatically; it does not bypass dirty-worktree protection or behavior/API/test-expectation safeguards.
Run git status --porcelain. If the working tree is dirty and AUTO_MODE=true, stop with MISSING REQUIREMENT: working tree is dirty; rerun without --auto to decide whether to continue. If the working tree is dirty and AUTO_MODE is false, confirm with the user before continuing — the skill's edits will land alongside theirs in git diff and will be hard to separate when reverting.
Synced base/diff scope contract (keep aligned across base-aware and diff-aware skills): use the shared resolve-base.sh script for base refs; use the shared collect-review-diff.sh script for unified changed-file scope; canonical base priority is explicit --base, PR target branch, then origin/HEAD, origin/main, or origin/master, and canonical diff scope is committed PR diff from MERGE_BASE...HEAD plus staged, unstaged, and untracked paths.
Resolve the base branch — use the shared plugin script. The optional positional base argument becomes BASE_BRANCH_OVERRIDE; otherwise let the script resolve the PR target branch and remote default fallback chain.
RESOLVE_ARGS=(--strict)
[ -n "${BASE_BRANCH_OVERRIDE:-}" ] && RESOLVE_ARGS+=(--base "$BASE_BRANCH_OVERRIDE")
RESOLVED=$("${CLAUDE_PLUGIN_ROOT}/scripts/resolve-base.sh" "${RESOLVE_ARGS[@]}") || {
echo "Base resolution failed; see the message above and stop. Re-run with a base branch argument if the target branch is ambiguous." >&2
exit 1
}
eval "$RESOLVED"
The script exports BASE_REF, BASE_BRANCH, and MERGE_BASE.
Scan for slop
If git diff "$MERGE_BASE"...HEAD is empty, report "no branch changes to review" and stop.
Launch kramme:deslop-reviewer in code review mode against git diff "$MERGE_BASE"...HEAD.
Filter the findings
Discard any finding whose file is generated, vendored, a lockfile, a snapshot, or *.d.ts before deciding what to fix.
Apply fixes by confidence
The agent scores findings 0–100. Apply the agent's specific recommendation per finding — do not pattern-match generically:
AUTO_MODE=true, apply automatically and count it separately as medium-confidence auto-applied.Leave a finding unchanged when applying it would alter test expectations, public APIs, or behavior the agent itself flagged as possibly intentional.
Report
1–3 sentences: which files were edited, plus counts for applied / confirmed / skipped / filtered.
tools
Requires Linear MCP. Implements one Linear issue end to end, selects applicable code-review, convention, and PR-refactor gates, runs them to bounded convergence, verifies, and optionally opens the PR and iterates on CI and review feedback until green. Use when the user wants a single Linear issue taken from implementation through a clean Pull Request. Not for implementation-only work, SIW-tracked issues, stacked PRs, existing PR updates, or post-merge rollout.
development
Reviews PR and local changes for convention drift and overcaution against documented rules and mined peer-file practice. Use for new patterns, dependencies, abstractions, or defensive complexity that departs from established practice; every finding cites evidence. Supports --inline. Not for general code quality (use kramme:pr:code-review) or spec review (use kramme:siw:spec-audit --team).
testing
Charts huge or foggy initiatives into a local `.context` decision map and resolves one typed frontier ticket per session until the work is ready for SIW or another execution workflow. Use when the route to a destination cannot fit in one agent session or parallel workspaces need coordinated planning state. Not for clear specs, ordinary issue decomposition, implementation, or Linear-native tracking.
development
Investigates a question against primary sources and saves one cited Markdown artifact. Use for reading legwork: official docs/API facts, source-code or spec checks, standards, and first-party service behavior before planning or implementation. Not for making product or architecture decisions, implementing code, broad web search, secondary blog summaries, or uncited answers.