Bootstrap project context from .context/session/in/ with manifest-driven organisation and token-aware file sizing.
82
82%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Bootstrap project context from .context/session/in/ folder → .context/session/ctx/ snapshot + baseline + RISEN INPUT table.
CRITICAL: After EVERY AskUserQuestion call, check if answers are empty/blank. Known Claude Code bug: outside Plan Mode, AskUserQuestion silently returns empty answers without showing UI.
If answers are empty: DO NOT proceed with assumptions. Instead:
.context/session/in/: Immutable bootstrap (user dumps raw docs, never modified by commands).context/session/ctx/: Actionable snapshot (generated: manifest + summaries + copied files)[ -d .context/session/in/ ] || error "No .context/session/in/ folder found. Create it and add source files first."
[ -d .context/session/ctx/ ] && [ "$1" != "--force" ] && error ".context/session/ctx/ exists. Use --force to recreate."Skip security-sensitive files: .env*, *credentials*, *secrets*, *token*, *.key, *.pem, *.crt
.context/session/in/**/*.{md,txt,csv,yaml,json}Write .context/session/ctx/manifest.yaml — see reference.md for schema.
Token estimation: tokens ≈ words / 0.75 (via wc -w)
| Priority | ≤ threshold | > threshold, ≤25K | > 25K |
|---|---|---|---|
| HIGH | ≤1500 → inline | summarize directly | summarize via sub-agent |
| MEDIUM | ≤2500 → inline | summarize directly | summarize via sub-agent |
| LOW | reference only | — | — |
Copy HIGH/MEDIUM files to .context/session/ctx/, preserving subdirectory structure.
.context/session/ctx/{nn}-{basename}-summary-llm.mdsummarize-for-context) for files >25K tokensCreate .context/session/CONTEXT-baseline-llm.md with inline content + summary refs + LOW references.
Target: ≤2000 tokens.
Report: file counts, RISEN INPUT table, suggest /save-context baseline.
See reference.md for manifest schema, baseline template, and validation rules.
.context/session/in/ is intentional input; the manifest reflects it faithfully..context/session/in/ and no snapshot exists yet..context/session/ctx/ directory is missing or empty and a downstream skill (e.g., load-context) cannot find a manifest..context/session/in/ have been replaced or significantly updated and a fresh snapshot is required (use --force)..context/session/ctx/ already contains a current manifest and the source files have not changed — re-running without --force is a no-op and may discard existing summaries..context/session/in/ is empty; there is nothing to scan and the skill will error..context/session/ctx/ is not permitted.save-context instead..context/session/in/ — Skipping the input scan produces incomplete context. Why: Source materials in the in-folder define the scope; a context built without them is speculative and will mislead downstream agents.validate-manifest.sh. Why: The schema requires all three arrays to be present, even if empty, so that consumers can iterate predictably..context/session/ctx/ — Files matching .env*, *credentials*, *secrets*, *token*, *.key, *.pem, *.crt must be skipped. Why: The ctx snapshot may be committed or shared; leaking credentials through it is a serious security risk.save-context or load-context — Parallel writes to .context/session/ctx/ corrupt the manifest. Why: There is no locking mechanism; the last writer wins and partial manifests are silently invalid.Creating context at session start:
# Drop source files into the immutable in-folder
cp design-doc.md .context/session/in/
cp requirements.csv .context/session/in/
# Invoke the skill — it scans in-folder, classifies files, writes manifest
# Output: .context/session/ctx/manifest.yaml + summaries + CONTEXT-baseline-llm.mdForce-recreating context after source files change:
# Update a source document
cp updated-spec.md .context/session/in/spec.md
# Re-run with --force to overwrite the existing ctx snapshot
# The skill will re-scan, re-prioritize, and rewrite all ctx artefactsInspecting the generated manifest and baseline:
# After the skill completes, review the generated artefacts
ls .context/session/ctx/
# manifest.yaml 01-design-doc-summary-llm.md ...
# The baseline provides a single load point for all context
cat .context/session/CONTEXT-baseline-llm.md