Skip to content
Back to skills

Maintain

ASecurity

Runs a full, incremental, targeted, recurring or audit-only optimization and hardening pass over a repository: dead code, duplicates, dependencies, architecture, tests, performance, security, reliability, build and CI, docs and instruction drift, hygiene. Resumes from a local coverage ledger.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsgodockergitsecurityperformance

Works with

  • claude code
  • cli

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add CedarLoom/cedarloom --skill maintain --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Maintain?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Maintain
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cedarloom-maintain/badge)](https://www.skillsdirectory.com/skills/cedarloom-maintain)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: maintain
description: "Runs a full, incremental, targeted, recurring or audit-only optimization and hardening pass over a repository: dead code, duplicates, dependencies, architecture, tests, performance, security, reliability, build and CI, docs and instruction drift, hygiene. Resumes from a local coverage ledger."
disable-model-invocation: true
disallowed-tools: "Edit Write NotebookEdit"
argument-hint: "[full | incremental <categories, paths> | targeted <problem> | recurring | resume] [audit-only] [conservative | balanced | extensive] [once | <n> passes | converge]"
metadata:
  when: "On request, on a clean working tree. A run nobody can answer audits only."
  writes: "Nothing until you approve the findings (Edit and Write are off), apart from the project's local knowledge base (verdicts, coverage ledger, baseline) and the `.cedarloom/knowledge/` line in `.git/info/exclude` that keeps it local; then the commits of each approved change under `workflow`."
---

# Maintaining repositories

Read only until the findings are approved. Start on a clean tree (`git status --porcelain` prints nothing; else stop and say so) and note `git rev-parse HEAD`. Read the project's local knowledge base first and write it back as [knowledge.md](knowledge.md) says.

## Settings

From $ARGUMENTS (Codex: the text after the skill name):

- **Mode.** `full`: every category over every component. `incremental`: only the categories, paths, pass count or budget named. `targeted <problem>` (slow tests, a heavy dependency, duplicated logic, memory use): reproduce or measure the problem first, then run the categories that bear on it. `recurring`: the components the knowledge base re-checks or lacks, every category, `conservative` unless named. `resume`: the work the ledger lists as left and the components it lacks. `audit-only`, alone (then `full`, budget `once`) or with a mode: no strategy; stop after the Report and the knowledge base write.
- **Strategy.** `conservative`: removals the reference search proves unused, fixes of a shown defect, patch and minor updates. `balanced`: also refactors inside one module, merged tests, major updates. `extensive`: also changes across modules.
- **Budget.** `once`, up to `<n>` passes, or `converge`.

A setting missing: ask once for all of them, recommending `full`, `balanced`, `converge`. When nobody can answer (a scheduled or headless run, no question tool), run `audit-only` without asking: keep the named mode and scope, and fill the other missing settings with `once` and `conservative`; with no mode named, audit the full scope.

## Categories

Run each one the mode selects and the repository supports; read a reference file only when its category runs.

- `cleanup`: a code audit skill, when installed; then duplicated code, unused files, exports, options and dependencies with the stack's tools from [tools.md](tools.md), each finding read in the code.
- `architecture`: cycles, shallow or forwarding modules, one source of truth, semantic duplicates, documented against actual structure: [architecture.md](architecture.md).
- `dependencies`: advisories, grouped updates and their changelogs: [dependencies.md](dependencies.md).
- `pins` that no update bot covers (`pkg@x.y.z` in docs, scripts, Dockerfiles): compare each with the newest release that is at least 3 days old. List the bumps (package, pinned, newest). Each accepted bump changes every occurrence on a branch. Recorded benchmark or release pins stay.
- `debt`: each `shortcut:` comment is still valid, upgraded, or becomes an issue (a debt-ledger skill lists them, when installed).
- `performance`: measured hot paths: [performance.md](performance.md).
- `hardening`: security and reliability: [hardening.md](hardening.md).
- `build`: build, tooling and CI: [build.md](build.md).
- `docs`: the `drift` audit of this plugin's audit skill: follow [its steps](../audit/SKILL.md) with the target `drift`.
- `instructions`: the `instructions` audit of the same skill. Claude Code: `/skill-doctor` for unused skills and their context cost.
- `issues`: open issues filed for the maintenance pass (search the tracker the project names for "maintenance pass"): each joins the findings, or is listed as already fixed.
- `tests`, last because it is the longest: speed, flakiness and a mutation audit: [test-audit.md](test-audit.md). It sets the time and memory bounds for the run.
- `hygiene`: merged branches and worktrees, stopped containers, tickets in the project's tracker that the merged work already closed. Open requests and sessions that went sideways: suggest a triage skill and a retro skill, when installed; the user starts them.

A tool that is missing and cannot be installed is not a failed pass: do that part by reference search and reading, and say so in the report.

## Discovery and baseline

1. Inventory the components (packages, modules, top folders by the build and import graph), entry points, public contracts (exports, CLI, config and data formats, plugin interfaces), generated and vendored content (left out, and listed), and tooling.
2. Baseline at the commit the pass starts from, measured anew by every mode but `resume`, which reuses the stored one when `kb read` has one: the build, tests, lint and type check that `AGENTS.md` or the package scripts name, each with its result and seconds, and the existing failures by name, kept apart so no change is blamed for them. A check that leaves files git does not ignore runs in a scratch copy.

## Passes

- The repository-wide categories (`cleanup`, `architecture`, `dependencies`) run once over the whole tree; the others run per component, in batches that fit the context. Write the ledger after each batch. Skip what it reuses, re-check what it lists in `recheck`, and name each component left out: none is skipped silently.
- With a subagent tool, give independent components or categories to read-only subagents in parallel; each returns findings with file and line, and you judge them and write the ledger. Changes never run in parallel on the same files.
- After approved changes, the next pass re-inspects the components they touched (their ledger entries go stale) and what they may expose: a dependency or test left without purpose.
- Stop when the scope is covered and a pass finds nothing worth its risk, the budget is spent, or what remains needs the user's approval.

Never, without the user's yes for that item: change intended behavior or a public contract, architecture, persistent data or a security boundary; remove supported functionality that only looks unused; rewrite a stable module; make a change that cannot be undone. Never: remove or weaken a meaningful test or check to improve a metric, hide an error, weaken a security control, add a dependency or abstraction nobody needs, edit generated or vendored files instead of their source, churn formatting or style, add features, or call fewer lines or tests a gain without the value they bought.

## Report

Head: mode, scope, strategy, budget, and coverage (components inspected of those found, categories run, what was left out and why). Then one list, ranked: correctness, security and data; reliability; simplification and dead code; performance; tests; maintainability; cleanup. Each finding has its file and line, the tool or search that found it, effort, risk and confidence.

After changes, add each check of the baseline before and after (result, seconds), the existing failures apart, and put each item in one class: verified (a check passed), measured (numbers before and after), expected but unmeasured, or not implemented (needs approval, deferred or rejected, with why).

## Changes after approval

Each approved item is an `approved` verdict and a change under `cl-workflow:workflow` (the cl-workflow plugin, when installed; a refactor across modules is at least elevated; several small items on one branch run as a batch, a critical item on its own), behavior unchanged, the project's tests before and after. Before deleting anything, search every reference to it (code, tests, docs, scripts, config) and record the result. Remove a test only with its recorded reason: it protects nothing, or the code it covers is removed with it. A done item becomes `fixed` with its check.

Files in this skill

  • SKILL.md3.6 KB
  • agents/openai.yaml137 B
  • architecture.md1.6 KB
  • dependencies.md1.5 KB
  • knowledge.md2.5 KB
  • knowledge.mjs15.7 KB
  • test-audit.md3.2 KB
  • tools.md3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.