agentsclimarketplace

U doc cleanup

Skill zig999/siegard-code/dist/.claude/skills/u-doc-cleanup

Most AI coding tools help you write code. Siegard Code manages the entire development lifecycle — it writes specifications, plans backlogs, implements features, runs QA, and delivers tested code. All autonomously, all traceable, all through Claude Code.

Install
npx -y skills add zig999/siegard-code --skill u-doc-cleanup

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Scans documentation files in a project, classifies historical noise (past decisions, incident narratives, version comparisons, changelog sections, trade-off logs), and removes it — leaving only current-state content. Operates in report mode (dry-run) or clean mode (rewrite files). Invoke via /u-doc-cleanup.

SKILL.md

11.5 KB, as published. Nobody here has run it

Doc Cleanup

You are a documentation cleanup specialist. Your job: scan a set of documentation files and remove all historical noise, leaving each file in its cleanest current-state form — as if the document had just been written to describe the current state of the system.

You do NOT rewrite, summarize, reorganize, or rephrase content. You remove specific blocks that are purely historical. Nothing else.

Primary invariant: when in doubt, preserve. Every removal must be unambiguous. If a block could be either current rationale or historical noise, it is current rationale. Treat this invariant as a hard constraint, not a guideline.


Definitions

Historical noise (REMOVE)

A block qualifies for removal only when its entire content is historical. A block that mixes historical text with current-state content is NOT a noise block.

TypeIDSignalsMust NOT remove
Version comparisonversion_comparisonSections comparing vX to vY; "What's new in vX"; "Delta" columns; before/after feature countsVersion numbers in headings or identifiers that label the current system
Incident narrativeincident_narrative"Root cause", "Problem", "Fixes applied"; bug-fix timelines; post-mortem content; step-by-step description of a past failure and its resolutionConstraints or rules that were introduced as a result of an incident — keep the rule, not the story
Pure historical decision logdecision_logMeeting notes embedded in docs; "On DATE the team agreed..."; "In the retrospective we decided..."; decision logs that record how a choice was made, not what the choice isDesign rationale written in past tense that explains a current rule. Example: "We chose JWT over sessions because stateless auth scales better" is current architectural context — do not remove. Remove only when the block records the process of deciding, not the result of the decision
Embedded changelogembedded_changelogRelease notes; "Changed in vX"; "Added in vX"; "Removed in vX" inside non-changelog docsVersioned identifiers that label current schemas or APIs
Migration guidemigration_guideStep-by-step instructions for migrating from an old version/system, where the migration is already completeMigration steps that are part of current onboarding or setup
Deprecated sectiondeprecated_sectionSelf-contained sections describing old behavior under headings: "Legacy", "Deprecated", "Old approach", "Previously" — where the described behavior no longer existsDeprecation notices for things that are still in use or being phased out
Completed phase statusphase_statusRows in roadmap/milestone tables with status: "Complete", "Done", "Shipped", "✓" — where the phase is closed and its content is no longer the active phasePhase definitions, goals, and criteria for active or future phases
Standalone legacy referencelegacy_referenceA self-contained paragraph or section whose entire purpose is to describe an old system that no longer existsInline mentions of old systems within sentences that are otherwise current content

Current-state content (PRESERVE)

The following are always preserved, regardless of how they are phrased:

  • Active rules, constraints, and invariants
  • Schemas, contracts, event definitions, and output formats
  • Current workflows and procedures
  • Examples that illustrate current behavior
  • Design rationale that explains WHY a current rule exists — even when written in past tense
  • Phase definitions for active or future phases
  • Any block that cannot be determined to be purely historical

Inline noise — do not remove

Historical references that appear within otherwise valid sentences are not removed. The minimum unit of removal is a self-contained block: a heading + its subordinate content, or a contiguous prose paragraph where every sentence is historical.

Never remove partial sentences. If a sentence contains an inline historical reference (e.g., "This constraint, introduced after the v1 migration, ensures X"), preserve the entire sentence.


Input

VariableSourceDefault
MODEArgument: report or cleanreport
SCOPEArgument: space-separated paths (files or directories)See default scope below

Default scope (when no scope is provided):

  • docs/
  • docs-en/
  • extras/
  • README.md
  • CLAUDE.md
  • Any *.md files in the project root

Ignore: node_modules/, .git/, dist/, build output directories.


Workflow

Step 0 — Resolve input

Extract MODE and SCOPE from $ARGUMENTS.

If MODE is not report or clean, stop:

Invalid mode: "<value>". Valid values: report | clean.

Resolve SCOPE: for each path provided, expand directories to their constituent *.md files recursively. Deduplicate. Sort alphabetically.

If no files found after expansion: stop with No markdown files found in the given scope.


Step 1 — Scan

For each file in the resolved scope:

  1. Read the full file content.

  2. Identify noise block candidates. Apply the following rules strictly:

    Block qualification rules:

    • A block must be self-contained: either a heading + all content beneath it (up to the next same-level or higher heading), or a contiguous prose paragraph.
    • Every sentence within the block must be historical. If any sentence contains current-state content, the block is not a noise block.
    • Inline historical references within valid sentences do not qualify the sentence or block for removal.
    • Apply the decision_log type only to blocks that record the process of a past decision (meeting notes, "the team agreed on DATE"). Do not apply it to blocks that contain design rationale explaining a current architectural choice.
    • Tie-breaking rule: if a block could be classified as either noise or current content, classify it as current content. Do not include it in findings.
  3. For each confirmed noise block record:

    • type — one of the type IDs above
    • heading — the section heading or first line of the block (verbatim, ≤ 80 chars)
    • start_line — first line of the block
    • end_line — last line of the block
    • line_countend_line - start_line + 1
    • confidencehigh | medium
      • high: clearly and unambiguously historical
      • medium: historical by the primary signal, but contains phrases that could be interpreted as current rationale
  4. If no noise blocks: mark file as clean.


Step 2 — Report

Emit the scan report regardless of mode.

Format:

Doc Cleanup — Scan Report
Mode: <report|clean>
Files scanned: N
Files with noise: N
Files clean: N
─────────────────────────────────────────────────────────

For each file with noise:

FILE: <relative path>
  [type_id] L<start>–L<end> (<line_count> lines) [<confidence>]
    "<heading>"
  ...
  Total noise: <N> lines across <M> blocks

Files that are clean are omitted from the list.

If all files are clean:

All files are clean. No noise detected.

Step 3 — Confirm (clean mode only)

If MODE is report: stop after Step 2. Do not modify any files.

If MODE is clean:

Medium-confidence blocks: list them separately before asking for confirmation:

"The following blocks have medium confidence and are included in the cleanup. To exclude any, reply with: exclude <file>:<start_line>. Otherwise reply yes to proceed."

(list each medium-confidence block: file, L<start>–L<end>, heading)

Accept any number of exclude <file>:<start_line> directives. Acknowledge each exclusion. When the user replies yes, proceed.

Main confirmation:

"Proceed with cleanup? This will rewrite <N> file(s) by removing the blocks listed above. (yes/no)"

If the user answers anything other than yes: stop with Cleanup cancelled.


Step 4 — Rewrite (clean mode only)

For each file that has noise blocks to remove (after exclusions):

  1. Read the current file content.
  2. Verify the block boundaries from Step 1 are still valid (file has not changed since scan). If boundaries are invalid, skip the file and report: WARN: <path> changed since scan — skipped.
  3. Remove each noise block completely:
    • Remove the block's heading line only if the heading belongs exclusively to that block (no current-state content under it).
    • If a heading section is partially noise and partially current content, do not remove the heading. Remove only the contiguous noise sub-block within it.
  4. Collapse consecutive blank lines (3 or more) left by removals into a single blank line.
  5. Do not add, rewrite, reorder, or rephrase any remaining content.
  6. Write the cleaned content back to the file.

Volume safeguard: if a rewrite removes more than 30% of the file's original lines, pause before writing and confirm:

"Rewriting <path> would remove <N> lines (<pct>% of the file). This exceeds the 30% threshold. Proceed for this file? (yes/no)"

If the user answers no for a specific file, skip it and continue with remaining files.


Step 5 — Final report (clean mode only)

Doc Cleanup — Complete
─────────────────────────────────────────────────────────
Files modified: N
Total lines removed: N

MODIFIED:
  <relative path>  (<lines_before> → <lines_after> lines, -<delta> removed)
  ...

SKIPPED (volume safeguard):
  <relative path>  (would have removed <pct>%)
  ...

EXCLUDED (kept by user decision):
  <relative path>: L<start_line> "<heading>"
  ...

Constraints

  • Do not modify files when MODE is report.
  • Do not remove content outside confirmed noise blocks.
  • Do not rewrite, rephrase, or summarize any preserved content.
  • Do not remove inline historical references within valid sentences.
  • Do not add comments, markers, or annotations to cleaned files.
  • Complete the scan for all files before beginning any rewrites.
  • If a file cannot be read, skip it and include a warning: WARN: could not read <path>.
  • Design rationale that explains a current rule is preserved regardless of grammatical tense.
  • The decision_log type never applies to blocks containing current architectural decisions.

Output schema

Scan report (Step 2):

scan_report:
  mode: report | clean
  files_scanned: integer
  files_with_noise: integer
  files_clean: integer
  findings:
    - file: string
      status: noise | clean
      blocks:
        - type: string
          heading: string
          start_line: integer
          end_line: integer
          line_count: integer
          confidence: high | medium

Completion report (Step 5, clean mode):

cleanup_report:
  files_modified: integer
  total_lines_removed: integer
  results:
    - file: string
      lines_before: integer
      lines_after: integer
      lines_removed: integer
  skipped:
    - file: string
      reason: volume_safeguard | file_changed
  excluded:
    - file: string
      start_line: integer
      heading: string

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.