Document Consolidator
Use this skill to safely reduce document sprawl without destroying the work the documents perform.
The core rule is:
Preserve the document's function first.
Improve structure second.
Compress language third.
This skill is explicit-only. If it was not invoked by name, do not assume it applies.
Supported Work
- Analyze a folder or selected files and produce a short sprawl map plus cleanup plan.
- Compress one Markdown or plain-text document.
- Compress an instructional document, rule, runbook, or process note with stricter behavior preservation.
- Consolidate several documents into one or more new documents.
- Create a dry run showing structure, source mapping, risks, and key fragments without writing files.
- Move included source documents into
00_Source_Documents only after separate confirmation.
Do not use this skill for:
SKILL.md or skill-package compression;
- prompt files;
.docx, .pdf, spreadsheets, slide decks, images, code, or generated data files;
- ordinary copyediting, post writing, summary writing, or style polish;
- broad project redesign disguised as document cleanup.
If a requested file is a skill or prompt file, stop and say this skill does not own that work.
Reference Loading
Read only the references needed for the selected path:
- Read
references/mode-selection.md first for every run.
- Read
references/source-roles.md when more than one document is involved or a folder is being mapped.
- Read
references/compression.md for compress-one and compress-instructional-doc.
- Read
references/consolidation.md for merge-many, source movement, and source-link handling.
- Read
references/iterative-cleanup.md for folders, live contours, large scopes, or unclear cleanup paths.
- Read
references/file-safety.md before creating a candidate file, moving files, replacing files, or moving sources.
- Read
references/validation-and-findings.md before checking a candidate, reporting losses, or deciding whether to stop.
- Read
references/output-templates.md when presenting a map, dry run, confirmation request, findings, or final report.
Workflow
- Confirm explicit invocation and supported file type.
- Identify the scope: selected files, one folder, or a proposed output path.
- If the scope is broad, start with a shallow inventory: file names, sizes, dates, headings, and links. Do not read all content by default.
- Select the mode from
references/mode-selection.md.
- Map each document's function, source role, currentness, and protected anchors.
- If the task may write or move files, show the relevant map and ask for plain confirmation before writing.
- For large or uncertain work, complete only the nearest safe segment. Do not pretend the whole cleanup can be planned in one pass.
- Create a candidate version when writing is needed. Never overwrite the target directly.
- Read the candidate back and validate against the original source material.
- Ask for confirmation before final replacement or source movement.
- Use the filesystem scripts for move/rename operations.
- Report only the useful result, remaining risks, and next safe step. Do not create service-report files unless the user explicitly asks.
Candidate And Replacement Rule
For any document replacement:
target.md -> target.candidate.md
target.txt -> target.candidate.txt
target -> target.candidate
The target file must not be overwritten by writing content into it.
Required sequence:
- Read the original file.
- Create the candidate beside the original.
- Read the candidate back.
- Validate the candidate against protected anchors and source role.
- Ask for replacement confirmation.
- Move the original file to
_backup/<YYYY-MM-DD_HH-mm>/.
- Rename the candidate to the original name.
- Read the final file back and verify encoding, links when relevant, and protected anchors.
All backup, replacement, and source moves must use filesystem move/rename operations, not model-mediated copy/rewrite.
Use:
scripts/document_fs_ops.ps1 on Windows/PowerShell.
scripts/document_fs_ops.sh on macOS/Linux shells.
The scripts are for mechanical file operations only. The model remains responsible for reading, understanding, drafting, validating, and asking for approval.
Confirmation Rules
Use human-facing language. Say подтверждение записи, not Write-Lock, unless the user asks for the technical label.
Ask only for decisions that change behavior, risk, scope, or files. Do not ask about obvious implementation details.
Before a write or move, show:
- what will be created, replaced, or moved;
- where backup will be;
- what will not be touched;
- what validation will run after the operation;
- allowed answers such as
да / поправить / остановиться.
Do not treat tool approval, silence, or prior intent as confirmation.
Safety Rules
- Evidence beats brevity.
- A valid result may be: "Do not compress this; the length is carrying necessary evidence or behavior."
- Do not collapse current truth, raw/source material, archived history, drafts, TODOs, handoffs, and rules into one file without mapping their roles first.
- Do not fix references outside selected files by default; report the risk instead.
- Do not invent validation scenarios. Derive them from the current documents.
- Do not preserve reasons for past decisions by default unless they are needed for current use or the user asks.
- Do not create README, CHANGELOG, proof files, service reports, or logs as part of ordinary operation.
Output Style
Speak to the user in plain, practical language before technical details.
For Russian-speaking users, answer in Russian unless asked otherwise.
Keep service detail out of the main answer. Show file operations only when they were requested, are waiting for confirmation, or failed.
1---2name: document-consolidator3description: Use this skill only when explicitly invoked as $document-consolidator to analyze document sprawl, compress Markdown/text documents, consolidate multiple documents into candidate or final documents, or plan cleanup without losing evidence, source roles, protected facts, rules, decisions, links, or unfinished work. Supports .md and .txt only. Do not use for skill files, prompt files, docx/pdf, ordinary copyediting, publication writing, code refactors, or implicit summarization.4---56# Document Consolidator78Use this skill to safely reduce document sprawl without destroying the work the documents perform.910The core rule is:1112```text13Preserve the document's function first.14Improve structure second.15Compress language third.16```1718This skill is explicit-only. If it was not invoked by name, do not assume it applies.1920## Supported Work2122- Analyze a folder or selected files and produce a short sprawl map plus cleanup plan.23- Compress one Markdown or plain-text document.24- Compress an instructional document, rule, runbook, or process note with stricter behavior preservation.25- Consolidate several documents into one or more new documents.26- Create a dry run showing structure, source mapping, risks, and key fragments without writing files.27- Move included source documents into `00_Source_Documents` only after separate confirmation.2829Do not use this skill for:3031- `SKILL.md` or skill-package compression;32- prompt files;33- `.docx`, `.pdf`, spreadsheets, slide decks, images, code, or generated data files;34- ordinary copyediting, post writing, summary writing, or style polish;35- broad project redesign disguised as document cleanup.3637If a requested file is a skill or prompt file, stop and say this skill does not own that work.3839## Reference Loading4041Read only the references needed for the selected path:4243- Read `references/mode-selection.md` first for every run.44- Read `references/source-roles.md` when more than one document is involved or a folder is being mapped.45- Read `references/compression.md` for `compress-one` and `compress-instructional-doc`.46- Read `references/consolidation.md` for `merge-many`, source movement, and source-link handling.47- Read `references/iterative-cleanup.md` for folders, live contours, large scopes, or unclear cleanup paths.48- Read `references/file-safety.md` before creating a candidate file, moving files, replacing files, or moving sources.49- Read `references/validation-and-findings.md` before checking a candidate, reporting losses, or deciding whether to stop.50- Read `references/output-templates.md` when presenting a map, dry run, confirmation request, findings, or final report.5152## Workflow53541. Confirm explicit invocation and supported file type.552. Identify the scope: selected files, one folder, or a proposed output path.563. If the scope is broad, start with a shallow inventory: file names, sizes, dates, headings, and links. Do not read all content by default.574. Select the mode from `references/mode-selection.md`.585. Map each document's function, source role, currentness, and protected anchors.596. If the task may write or move files, show the relevant map and ask for plain confirmation before writing.607. For large or uncertain work, complete only the nearest safe segment. Do not pretend the whole cleanup can be planned in one pass.618. Create a candidate version when writing is needed. Never overwrite the target directly.629. Read the candidate back and validate against the original source material.6310. Ask for confirmation before final replacement or source movement.6411. Use the filesystem scripts for move/rename operations.6512. Report only the useful result, remaining risks, and next safe step. Do not create service-report files unless the user explicitly asks.6667## Candidate And Replacement Rule6869For any document replacement:7071```text72target.md -> target.candidate.md73target.txt -> target.candidate.txt74target -> target.candidate75```7677The target file must not be overwritten by writing content into it.7879Required sequence:80811. Read the original file.822. Create the candidate beside the original.833. Read the candidate back.844. Validate the candidate against protected anchors and source role.855. Ask for replacement confirmation.866. Move the original file to `_backup/<YYYY-MM-DD_HH-mm>/`.877. Rename the candidate to the original name.888. Read the final file back and verify encoding, links when relevant, and protected anchors.8990All backup, replacement, and source moves must use filesystem move/rename operations, not model-mediated copy/rewrite.9192Use:9394- `scripts/document_fs_ops.ps1` on Windows/PowerShell.95- `scripts/document_fs_ops.sh` on macOS/Linux shells.9697The scripts are for mechanical file operations only. The model remains responsible for reading, understanding, drafting, validating, and asking for approval.9899## Confirmation Rules100101Use human-facing language. Say `подтверждение записи`, not `Write-Lock`, unless the user asks for the technical label.102103Ask only for decisions that change behavior, risk, scope, or files. Do not ask about obvious implementation details.104105Before a write or move, show:106107- what will be created, replaced, or moved;108- where backup will be;109- what will not be touched;110- what validation will run after the operation;111- allowed answers such as `да / поправить / остановиться`.112113Do not treat tool approval, silence, or prior intent as confirmation.114115## Safety Rules116117- Evidence beats brevity.118- A valid result may be: "Do not compress this; the length is carrying necessary evidence or behavior."119- Do not collapse current truth, raw/source material, archived history, drafts, TODOs, handoffs, and rules into one file without mapping their roles first.120- Do not fix references outside selected files by default; report the risk instead.121- Do not invent validation scenarios. Derive them from the current documents.122- Do not preserve reasons for past decisions by default unless they are needed for current use or the user asks.123- Do not create README, CHANGELOG, proof files, service reports, or logs as part of ordinary operation.124125## Output Style126127Speak to the user in plain, practical language before technical details.128129For Russian-speaking users, answer in Russian unless asked otherwise.130131Keep service detail out of the main answer. Show file operations only when they were requested, are waiting for confirmation, or failed.