galmuri:doc — Document adapter
Prerequisites
scripts/preflight.shpasses.skills/distill/engine is installed.scripts/record-asset.shis executable.
Step 1: Alias detection + Audience
When triggered via shrink / 줄여줘 / 압축:
if [ ! -f ".galmuri/tmp/.warned-shrink" ]; then
echo "[deprecated] the 'shrink' trigger is routed to a context-based adapter. Scheduled for removal in a future release." >&2
touch ".galmuri/tmp/.warned-shrink"
fi
# source_tokens ≥ 80 AND ratio > 0.1 → doc runs; otherwise → delegate to another adapter
"Who is this document for? (e.g. the whole team, future-me, an external reviewer)"
- Ask if audience is missing.
Step 2: Engine Invoke
- Call
distill --mode reduce --ratio 0.3 --audience {X}. - Receive the EngineOutput JSON.
Step 3: Render
- EngineOutput.units → markdown body:
- Section title = first unit's
claim. - Each unit's
essence+evidencebecomes the body copy. dropped[]becomes a "## Omitted items" section.
- Section title = first unit's
Step 4: Save
Default path: docs/galmuri-doc-{slug}.md
"Save to
docs/galmuri-doc-{slug}.md? (y/n/edit-slug)"
y→ create the file, then proceed to Step 5.n→ stdout only.edit-slug→ rename, then create.
Step 5: Asset record
The PostToolUse hook (hooks/shims/asset-record.sh) runs automatically when the Write tool creates docs/galmuri-doc-{slug}.md. You do not need to invoke record-asset.sh manually.
If for any reason the hook did not run (e.g., direct CLI invocation without hooks), call it manually:
bash scripts/record-asset.sh --type doc --tags "doc,{slug}" \
--source-ref ".galmuri/tmp/source-{slug}.txt" --output "docs/galmuri-doc-{slug}.md"
Output Schema
A markdown file (docs/galmuri-doc-{slug}.md) + an asset record.