background
Use when the user wants to see, inspect, cancel, or prune background agents fired during prior chain runs. Read/manage `.hyperflow/background/registry.json` and the per-agent output buffers at `.hyperflow/background/<id>.md`. Standalone — never auto-invoked. Trigger with /hyperflow:background, "list background agents", "what's running in background", "cancel background agent", "show background result".
What this skill does
# Background Read-only-by-default management interface for background agents fired by other hyperflow skills (dispatch quality gates, deploy CI watcher, scaffold analysis refresh, cache compact, scope speculative prefetch). Reads from `.hyperflow/background/registry.json` + per-agent output buffers. Full doctrine: [background-agents.md](../hyperflow/background-agents.md). ## Subcommands | Subcommand | Description | |---|---| | `list` | Print the registry: in-flight · completed-uncollected · stalled · errored | | `show <id>` | Print one agent's output buffer (`.hyperflow/background/<id>.md`) | | `cancel <id>` | Cancel one specific in-flight agent | | `cancel --all` | Cancel every in-flight agent (use before closing a session) | | `prune` | Delete completed `.hyperflow/background/<id>.md` files older than 7 days | Default subcommand when none provided: `list`. ## Subcommand Details ### `list` Read `.hyperflow/background/registry.json`. Group entries by status and print a compact table: ```markdown ## In flight (N) | ID | Purpose | Fired | Timeout | Blocks | |-----------------------------------|--------------------------------------|------------|---------|---------| | `bg-1718049600-quality-gates-b2` | Layer 5 gates Batch 2 | 17:30 | 18:00 | step3 | | `bg-1718049820-ci-watcher` | GitHub Actions watch for v4.7.0 | 17:33 | 18:33 | — | ## Completed (uncollected, N) | ID | Purpose | Completed | Duration | Output | |-----------------------------------|--------------------------------------|------------|----------|--------| | `bg-1718045400-scaffold-refresh` | Refresh .hyperflow/architecture.md | 16:42 | 2m 18s | 1.4kb | ## Stalled / Errored (N) | ID | Purpose | Status | Reason | |-----------------------------------|--------------------------------------|-------------------|-------------------| | `bg-1717980000-cache-compact` | Compact learnings.md | STALLED | timeout (30m) | ``` Print one trailing line: `<count> in flight · <count> uncollected · <count> needs attention`. If registry is empty, print `No background agents.` and stop. ### `show <id>` Read `.hyperflow/background/<id>.md` and print it verbatim. If the agent is still running, print the registry entry first then `Output buffer not yet written.` and stop. ### `cancel <id>` 1. Read registry, find the entry. 2. If `status: running`, signal cancellation per the provider's mechanism (Claude Code: use the runtime's cancellation API for that subagent ID; if unavailable, mark the entry `status: cancelled` and leave the agent to time out on its own — the foreground orchestrator will drop the result on collection). 3. Update registry entry: `status: cancelled`, `cancelled_at: <now>`. 4. Print `Cancelled <id> — <purpose>`. If the agent already completed, print `Agent <id> already <status> — nothing to cancel.` ### `cancel --all` For every entry with `status: running`, run the `cancel` flow. Print summary: `Cancelled N agents.` ### `prune` `find .hyperflow/background/ -name "bg-*.md" -mtime +7 -delete` plus remove their entries from `registry.json` (only entries with `status: complete | error | stalled | cancelled` older than 7 days are pruned). Print: `Pruned N output buffers · N registry entries`. ## Flow 1. Parse subcommand from invocation (default: `list`). 2. Read `.hyperflow/background/registry.json` (if absent, treat as empty). 3. Execute subcommand. 4. Print result. ## Overview `/hyperflow:background` is the user-facing read/manage interface for background agents. The orchestrator itself maintains the registry as a side-effect of `run_in_background: true` Agent dispatches in other skills — this skill never *fires* a background agent, it only reads/manages the registry. ## Prerequisites - `.hyperflow/background/registry.json` exists (created on first background dispatch by any other skill — if absent, all subcommands degrade gracefully). - `.hyperflow/` initialized (run `/hyperflow:scaffold` if missing — though this skill works even without scaffold, since the registry is created on demand). ## Instructions See [Subcommands](#subcommands) and [Subcommand Details](#subcommand-details). Summary: 1. Parse the subcommand (default `list` when none given). 2. Read the registry from `.hyperflow/background/registry.json`. 3. Execute the subcommand against the registry + per-agent output buffers. 4. Print compact result; do not modify any source code. ## Output - `list` — table of in-flight / completed-uncollected / stalled+errored, with one trailing summary line. - `show <id>` — file contents of `.hyperflow/background/<id>.md`. - `cancel <id>` / `cancel --all` — one-line confirmation per cancelled agent + total. - `prune` — count of pruned buffers + registry entries. ## Error Handling | Failure | Behavior | |---|---| | Registry file missing | Treat as empty — `list` prints `No background agents.`; other subcommands print `No registry — fire a background agent first.` and stop. | | Registry JSON malformed | Print `Registry malformed — back up to .hyperflow/background/registry.json.bak and re-create empty.` Move file, write empty registry, continue. | | `show <id>` for unknown id | List 3 closest IDs by Levenshtein distance. | | `cancel <id>` for already-completed agent | Print `Agent <id> already <status> — nothing to cancel.` | | Provider cancellation API unavailable | Mark entry `status: cancelled` in registry; the foreground orchestrator drops the result on collection. Print `Marked <id> as cancelled (provider has no live cancellation API — agent will run to completion or timeout, but result will be discarded).` | | Prune called with no eligible entries | Print `Nothing to prune — no completed buffers older than 7 days.` | ## Examples ### List in-flight + completed background agents ``` /hyperflow:background list ## In flight (1) | ID | Purpose | Fired | Timeout | Blocks | |-----------------------------------|--------------------------------------|-------|---------|--------| | `bg-1718049600-quality-gates-b2` | Layer 5 gates Batch 2 | 17:30 | 18:00 | step3 | ## Completed (uncollected, 1) | ID | Purpose | Completed | Duration | Output | |-----------------------------------|--------------------------------------|-----------|----------|--------| | `bg-1718045400-scaffold-refresh` | Refresh .hyperflow/architecture.md | 16:42 | 2m 18s | 1.4kb | 1 in flight · 1 uncollected · 0 needs attention ``` ### Show a completed agent's output ``` /hyperflow:background show bg-1718045400-scaffold-refresh # Background Result — Refresh .hyperflow/architecture.md | Field | Value | |------------|--------------------------------------| | Agent ID | `bg-1718045400-scaffold-refresh` | | Fired at | 2026-05-16T16:40:00Z | | Completed | 2026-05-16T16:42:18Z (2m 18s) | | Status | complete | | Tokens | worker 4.2k | ## Output <refreshed architecture.md content fragments + diff summary> ``` ### Cancel everything before closing the session ``` /hyperflow:background cancel --all Cancelled bg-1718049600-quality-gates-b2 — Layer 5 gates Batch 2 Cancelled bg-1718049820-ci-watcher — GitHub Actions watch for v4.7.0 Cancelled 2 agents. ``` ## Resources - [background-agents.md](../hyperflow/background-agents.md) — full doctrine: when to use, hard rules, registry shape, failure modes, anti-patterns. - [DOCTRINE.md](../hyperflow/DOCTRINE.md) — rule 8 (background extensions), rule 9 (no AI-attributed background commits). - [o
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.