Nm Sanctum Doc Consolidation

v1.0.0

Merge report and analysis artifacts into permanent docs, then delete source files

0· 42·1 current·1 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the implementation: the modules detect untracked report-style markdown files, analyze and route content, write/modify documentation files, and delete source files. No unrelated credentials, binaries, or external services are requested.
Instruction Scope
SKILL.md explicitly instructs repository scanning (git status), reading and parsing candidate files, creating/updating docs, and deleting source files after successful consolidation. This is coherent with the described purpose, but the instructions perform destructive filesystem operations (unlinking sources) and create a local consolidation log; ensure the user-approval checkpoint is enforced and that users back up or run on a branch. The skill does not transmit data to external endpoints.
Install Mechanism
Instruction-only skill with no install spec and no bundled code files; nothing is written to disk by an installer. Risk from install mechanism is minimal.
Credentials
No environment variables, credentials, or config paths are requested. All filesystem and git operations referenced are proportional to the stated task.
Persistence & Privilege
always is false and the skill does not request system-wide persistence or modify other skills. It will create a local `.consolidation-log.json` and write docs in the repository, which is expected behavior. Note: autonomous invocation of skills is permitted by default on the platform; while not inherently suspicious here, you should confirm the user-approval checkpoint is respected to avoid unapproved deletions.
Assessment
This skill appears internally consistent with its goal of consolidating ephemeral report markdown files into permanent docs and then removing the originals. However, it performs destructive local operations (creating/updating files and deleting source files) so do the following before using it: - Review the generated consolidation plan before approving Phase 2; the SKILL.md expects a user approval checkpoint. Do not skip that step. - Back up your repository or run the skill on a branch/copy so deletions are recoverable. Deleted source files cannot be automatically restored by the provided rollback (the rollback warns it cannot restore deleted sources). - Confirm there are no sensitive or uncommitted files that you do not want scanned or deleted; the detection step scans untracked markdown files and nested untracked directories. - Test on a small sample first to verify merge strategies (weave/replace/append) behave as you expect. - No external network access or credentials are required by the skill; the main risk is local file modification/deletion. Proceed if you are comfortable with these repository changes and keep a commit or backup before executing.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

📝 Clawdis
latestvk97bpmxhqwjsfgnjbqfwy0f42h84we4s
42downloads
0stars
1versions
Updated 4d ago
v1.0.0
MIT-0

Night Market Skill — ported from claude-night-market/sanctum. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Table of Contents

Doc Consolidation

Extracts valuable knowledge from ephemeral LLM outputs and merges it into permanent documentation.

When To Use

Use this skill when:

  • You have untracked *_REPORT.md or *_ANALYSIS.md files from Claude sessions
  • Git status shows markdown files that shouldn't be committed but contain useful content
  • You want to preserve insights from code reviews, refactoring reports, or API audits
  • Preparing a PR and need to clean up working artifacts

Do NOT use when:

  • Files are already in proper documentation locations (docs/, skills/)
  • Files are intentionally temporary scratch notes
  • User explicitly wants to preserve the original report format
  • Source files have no extractable value (pure log output)

Formatting

When merging content into permanent documentation, follow Skill(leyline:markdown-formatting) conventions: wrap prose at 80 chars (prefer sentence/clause boundaries), blank lines around headings, ATX headings only, blank line before lists, and reference-style links for long URLs.

Quick Start

/consolidate-docs

Or invoke directly:

I have some report files that need consolidating into permanent docs.

Two-Phase Workflow

Phase 1: Triage (Fast Model)

Read-only analysis to generate a consolidation plan:

  1. Detect candidates - Find untracked markdown files with LLM output markers
  2. Analyze content - Extract and categorize valuable sections
  3. Route destinations - Match content to existing docs or propose new files
  4. Present plan - Show user what will be consolidated and where

Checkpoint: User reviews and approves plan before execution.

Phase 2: Execute (Main Model)

After approval, performs the consolidation:

  1. Merge content - Weave into existing docs or create new files
  2. Delete sources - Remove ephemeral files after successful merge
  3. Generate summary - Report what was created/updated/deleted

Workflow Details

Step 1: Candidate Detection

Load: @modules/candidate-detection.md

Identifies files using:

  • Git status (untracked .md files)
  • Location (not in standard doc directories)
  • Naming (ALL_CAPS non-standard names)
  • Content markers (Executive Summary, Findings, Action Items)

Step 2: Content Analysis

Load: @modules/content-analysis.md

For each candidate:

  • Extract sections as content chunks
  • Categorize: Actionable Items, Decisions, Findings, Metrics, Migration Guides, API Changes
  • Score value: high/medium/low

Step 3: Destination Routing

Load: @modules/destination-routing.md

For each valuable chunk:

  • Semantic match against existing documentation
  • Apply default mappings if no good match
  • Determine merge strategy (weave, replace, append, create)

Step 4: Generate Plan

Present consolidation plan to user:

# Consolidation Plan

## Source: API_REVIEW_REPORT.md

| Content | Category | Value | Destination | Action |
|---------|----------|-------|-------------|--------|
| API inventory | Findings | High | docs/api-overview.md | Create |
| Action items | Actionable | High | docs/plans/2025-12-06-api.md | Create |

### Post-Consolidation
- Delete: API_REVIEW_REPORT.md

Proceed with consolidation? [Y/n]

Step 5: Execute Merges

Load: @modules/merge-execution.md

After user approval:

  • Group operations by destination file
  • Apply merge strategies
  • Validate results (frontmatter intact, structure preserved)
  • Delete source files
  • Generate execution summary

Fast Model Delegation

Phase 1 tasks are delegated to haiku-class models for efficiency:

# plugins/sanctum/scripts/consolidation_planner.py handles:
- scan_for_candidates()
- extract_content_chunks()
- categorize_chunks()
- score_value()
- find_semantic_matches()

Phase 2 stays on the main model for careful merge execution.

Content Categories

CategoryDescriptionDefault Destination
Actionable ItemsTasks, TODOs, next stepsdocs/plans/YYYY-MM-DD-{topic}.md
Decisions MadeArchitecture choicesdocs/adr/NNNN-{date}-{topic}.md
Findings/InsightsAudit results, analysisBest-match existing doc
Metrics/BaselinesBefore/after comparisonsdocs/benchmarks/
Migration GuidesStep-by-step proceduresdocs/migration-guide.md
API ChangesBreaking changes, deprecationsCHANGELOG or api docs

Merge Strategies

Intelligent Weave

Insert content into matching existing sections, preserving style.

Use when: Destination has relevant section, content is additive.

Replace Section

Replace existing section with more detailed new content.

Use when: New content 2x+ more detailed or has later date.

Append with Context

Add new section with date and source reference.

Use when: No matching section, content doesn't fit existing structure.

Create New File

Generate complete new document.

Use when: No suitable destination exists, content warrants standalone doc.

Integration

Works with other sanctum skills:

  • git-workspace-review: May suggest consolidation when untracked reports detected
  • pr-prep: Warns about untracked analysis files before PR creation
  • doc-updates: Can invoke for final polish after consolidation

Example Session

User: I have API_REVIEW_REPORT.md from our review session. Can you consolidate it?

Claude: I'll consolidate the report into permanent documentation.

**Phase 1: Triage**

Scanning for candidates...
- Found: API_REVIEW_REPORT.md (untracked, LLM markers detected)

Analyzing content...
- Extracted 6 content chunks
- High value: API inventory, action items, CLI recommendation
- Medium value: security assessment
- Low value: executive summary (generic)

Routing destinations...
- API inventory → docs/api-overview.md (CREATE)
- Action items → docs/plans/2025-12-06-api-consistency.md (CREATE)
- CLI naming → docs/adr/0002-cli-naming.md (CREATE ADR)
- Security → Already covered in docs/security.md (SKIP)

**Consolidation Plan**
[table shown]

Proceed? [Y/n]

User: Y

Claude: **Phase 2: Executing**

Created: docs/api-overview.md (1,247 bytes)
Created: docs/plans/2025-12-06-api-consistency.md (892 bytes)
Created: docs/adr/0002-2025-12-06-cli-naming.md (634 bytes)
Deleted: API_REVIEW_REPORT.md

Consolidation complete. Review the created files and commit when ready.

Troubleshooting

No candidates found

  • Check git status for untracked files
  • Files may already be in standard locations
  • Try explicit file path: "Consolidate API_REVIEW_REPORT.md"

Low-quality extractions

  • Source file may lack structured sections
  • Content may be too generic to categorize
  • Try manual extraction for unstructured reports

Merge conflicts

  • Destination file structure changed
  • Try APPEND strategy instead of WEAVE
  • Manual intervention may be needed

Related Skills

  • sanctum:doc-updates - General documentation updates
  • sanctum:git-workspace-review - Pre-flight workspace analysis
  • sanctum:pr-prep - Pull request preparation
  • imbue:catchup - Understanding recent changes

Comments

Loading comments...