Help us improve
Share bugs, ideas, or general feedback.
From ark-skills
Load recent + relevant project context before any /ark-workflow chain. Runs as step 0 of every chain. Queries /notebooklm-vault (if set up), /wiki-query (if set up), and /ark-tasknotes (if set up) to emit a single Context Brief. Triggers on "warm up", "context brief", "load context", "start fresh on this project". Also invoked automatically as chain step 0 by /ark-workflow.
npx claudepluginhub helloworldsungin/ark-skills --plugin ark-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/ark-skills:ark-context-warmupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Load recent + relevant project context. Runs as step 0 of every `/ark-workflow` chain. Emits one structured `## Context Brief` synthesizing signals from NotebookLM, the vault, and TaskNotes — with an Evidence section surfacing possible duplicates, prior rejections, and in-flight collisions.
fixtures/degraded-coverage.yamlfixtures/duplicate-closed-ignored.yamlfixtures/duplicate-component-hit.yamlfixtures/duplicate-token-overlap-low-noise.yamlfixtures/duplicate-token-overlap-medium.yamlfixtures/in-flight-collision-component.yamlfixtures/prior-rejection-false-positive.yamlfixtures/prior-rejection-structured.yamlfixtures/stale-context.yamlscripts/availability.pyscripts/check_chain_drift.pyscripts/check_chain_integrity.pyscripts/check_contract_extension.pyscripts/check_path_b_coverage.pyscripts/contract.pyscripts/evidence.pyscripts/executor.pyscripts/integration/test_availability.batsscripts/mcp_concurrency_probe.shscripts/read_bridges.pyGuides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
Load recent + relevant project context. Runs as step 0 of every /ark-workflow chain. Emits one structured ## Context Brief synthesizing signals from NotebookLM, the vault, and TaskNotes — with an Evidence section surfacing possible duplicates, prior rejections, and in-flight collisions.
Spec: docs/superpowers/specs/2026-04-12-ark-context-warmup-design.md.
Pinned decisions: docs/superpowers/plans/2026-04-12-ark-context-warmup-implementation.md (D1–D6).
/ark-context-warmup — automatic invocation from /ark-workflow chain step 0; reads task context from .ark-workflow/current-chain.md/ark-context-warmup --refresh — bypass cache, force full fan-out/ark-context-warmup standalone (no chain file) — prompts for task text, derives scenarioFollow the plugin's context-discovery pattern (see plugin CLAUDE.md):
project_name, vault_root, project_docs_path, task_prefix, tasknotes_path{vault_root}/.notebooklm/config.json first, then {project_root}/.notebooklm/config.json"CLAUDE.md is missing [field] — context warm-up cannot run. Proceeding without warm-up." and EXIT 0ARK_SKILLS_ROOT (required for all later script invocations)In consumer projects (e.g., ArkNode-AI, ArkNode-Poly), this plugin's scripts live at ~/.claude/plugins/cache/.../ark-skills/ — not at ./skills/ of the CWD. All later script invocations in this skill must use absolute paths rooted at the plugin. Resolve once at the start:
# Already set by Claude Code when invoking a plugin skill? Prefer that.
if [ -n "${CLAUDE_PLUGIN_DIR:-}" ] && [ -d "$CLAUDE_PLUGIN_DIR" ]; then
ARK_SKILLS_ROOT="$CLAUDE_PLUGIN_DIR"
# Otherwise, discover via the plugin marketplace.json anchor.
elif [ -f "$(pwd)/.claude-plugin/marketplace.json" ]; then
# CWD is the ark-skills repo itself (dev/test mode)
ARK_SKILLS_ROOT="$(pwd)"
else
# Consumer project: search installed plugins.
ARK_SKILLS_ROOT=$(find ~/.claude/plugins -maxdepth 6 -type d -name ark-skills 2>/dev/null | head -1)
fi
if [ -z "$ARK_SKILLS_ROOT" ] || [ ! -f "$ARK_SKILLS_ROOT/skills/ark-context-warmup/SKILL.md" ]; then
echo "ark-skills plugin not found — context warm-up cannot run. Proceeding without warm-up." >&2
exit 0
fi
export ARK_SKILLS_ROOT
All subsequent python3 skills/... invocations in this skill MUST be rewritten to python3 "$ARK_SKILLS_ROOT/skills/..." — including the helpers in Step 1 below, the contract executor paths passed to subagents, and the script paths referenced in warmup_contract.preconditions. Python modules invoked via python3 "$ARK_SKILLS_ROOT/..." can continue to use Path(__file__).parent for sibling-file resolution, so no changes inside the scripts themselves are needed.
Read .ark-workflow/current-chain.md if present. The file should contain extended frontmatter with chain_id, task_text, task_normalized, task_summary, task_hash, scenario.
If any of those fields is missing (legacy chain, or file absent): prompt the user for the task text and compute the fields inline:
CHAIN_ID=$(python3 "$ARK_SKILLS_ROOT/skills/ark-context-warmup/scripts/warmup-helpers.py" chain-id)
TASK_NORMALIZED=$(python3 "$ARK_SKILLS_ROOT/skills/ark-context-warmup/scripts/warmup-helpers.py" normalize "$TASK_TEXT")
TASK_SUMMARY=$(python3 "$ARK_SKILLS_ROOT/skills/ark-context-warmup/scripts/warmup-helpers.py" summary "$TASK_TEXT")
TASK_HASH=$(python3 "$ARK_SKILLS_ROOT/skills/ark-context-warmup/scripts/warmup-helpers.py" hash "$TASK_NORMALIZED")
Log: "Legacy chain file — cache will be cold. Run updated /ark-workflow to regenerate."
After task intake, pick the relevant bridge (if any) and surface it in the final Context Brief.
PRIOR_BRIDGE_CONTENT=""
if [ -d ".omc/wiki" ]; then
BRIDGE_PATH=$(python3 "$ARK_SKILLS_ROOT/skills/ark-context-warmup/scripts/read_bridges.py" \
--wiki-dir ".omc/wiki" --chain-id "$CHAIN_ID" 2>/dev/null || true)
if [ -n "$BRIDGE_PATH" ] && [ -f "$BRIDGE_PATH" ]; then
PRIOR_BRIDGE_CONTENT=$(cat "$BRIDGE_PATH")
fi
fi
Later, Step 5 calls synthesize.assemble_brief(..., prior_bridge=$PRIOR_BRIDGE_CONTENT) — the brief renders a "Prior Session Handoff" section when non-empty.
Rules: chain_id match = ≤ 7 days; mismatch = single most-recent ≤ 48h. No qualifying bridge → empty string → section omitted.
Run availability.py probe(...) per D5 rules (see pinned decisions). Record which backends are available. If all three are unavailable, emit "No context backends available — proceeding without warm-up. Run /ark-health to diagnose." and EXIT 0.
Unless --refresh is passed:
python3 -c "
import sys
sys.path.insert(0, '$ARK_SKILLS_ROOT/skills/ark-context-warmup/scripts')
from synthesize import cached_brief_if_fresh
from pathlib import Path
b = cached_brief_if_fresh(cache_dir=Path('.ark-workflow'), chain_id='$CHAIN_ID', task_hash='$TASK_HASH')
if b: print(b)
"
If cache hit: emit the cached brief to the session and EXIT 0.
executor.py from Task 15)All shell substitution, precondition invocation, JSON parsing, and JSONPath extraction go through executor.execute_command(...) — the SKILL.md does NOT reimplement those. The D6 env vars (WARMUP_TASK_TEXT, WARMUP_TASK_NORMALIZED, WARMUP_TASK_HASH, WARMUP_TASK_SUMMARY, WARMUP_SCENARIO, WARMUP_CHAIN_ID, WARMUP_VAULT_PATH, WARMUP_PROJECT_DOCS_PATH, WARMUP_PROJECT_NAME, WARMUP_TASK_PREFIX, WARMUP_TASKNOTES_PATH) are exported before invoking either lane.
Lane 1 (parallel if available) — NotebookLM:
warmup_contract via contract.load_contract(Path("$ARK_SKILLS_ROOT/skills/notebooklm-vault/SKILL.md"))Agent tool, general-purpose type) with these instructions:
session-continue, then bootstrap as fallback): call executor.execute_command(cmd, config=notebooklm_config, templates=contract["prompt_templates"], env_overrides={}, timeout_s=90). Stop at the first command that returns non-None (not skipped).Lane 2 (serialized) — Vault-local:
Only run if HAS_WIKI or HAS_TASKNOTES. Dispatch one subagent that sequentially:
HAS_WIKI: load wiki-query contract, export WARMUP_SCENARIO_QUERY_TEMPLATE=<contract["scenario_templates"][scenario]> into the subagent's env (this is what the contract's scenario_query prompt template references), then call executor.execute_command(...). On None result, record a Degraded coverage candidate for the wiki lane and continue to tasknotes.HAS_TASKNOTES: load tasknotes contract, call executor.execute_command(...). Same Degraded coverage handling.{"wiki": ..., "tasknotes": ..., "degraded_lanes": [...]}Each lane has a 90s outer timeout at the subagent level (in addition to the 90s per-command timeout inside executor.execute_command).
evidence.derive_candidates(...)has_omc (from the availability.probe(...) result dict) + prior_bridge (from Step 1b — may be empty string) to synthesize.assemble_brief(..., has_omc=availability["has_omc"], prior_bridge=$PRIOR_BRIDGE_CONTENT). This renders the OMC detected: yes/no line AND the Prior Session Handoff section when a qualifying bridge exists.synthesize.write_brief_atomic(...) to cacheIf this was a cache miss AND a prompt (task_text) was supplied AND .omc/wiki/ exists:
if [ -d ".omc/wiki" ] && [ "$CACHE_HIT" != "true" ] && [ -n "$TASK_TEXT" ]; then
python3 "$ARK_SKILLS_ROOT/skills/ark-context-warmup/scripts/seed_omc.py" \
--wiki-dir ".omc/wiki" --chain-id "$CHAIN_ID" < "$SOURCES_JSON"
fi
$SOURCES_JSON is a temp file containing the JSON array emitted by evidence.derive_candidates(..., has_omc=True)["seed_sources"]. Step 5 writes this file after synthesis.
Degradation: no .omc/wiki/ → skip silent. No prompt → skip (Option E′). Cache hit → skip (seeds already present). Per-source write errors are logged and do not abort the fanout.
Print: "Context warm-up complete. Proceeding to next step: {chain's step 1}"
scripts/warmup-helpers.py — task_normalize, task_summary, task_hash, chain_id_new, CLI dispatchscripts/contract.py — warmup_contract YAML parser + validatorscripts/executor.py — runtime engine: resolves inputs, runs preconditions, substitutes shell templates, extracts JSONPath fields, validates required_fieldsscripts/availability.py — backend availability probe (D5-compliant multi-notebook handling)scripts/evidence.py — deterministic evidence-candidate generator (D3 rules)scripts/synthesize.py — brief assembly + atomic cache write + pruningscripts/stopwords.txt — committed stopwords wordlistfixtures/ — evidence-candidate regression fixturesscripts/smoke-test.md — manual release runbook