Agent skill

interop

Use this skill when routing a Superpowers plan file through the /work-backlog-item pipeline — creates a SAM task file and writes back-references into the original plan

Stars 33
Forks 4

Install this agent skill to your Project

npx add-skill https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/development-harness/skills/interop

SKILL.md

/dh:interop — Superpowers Plan Interop Adapter

Routes a Superpowers plan file through the /work-backlog-item pipeline to produce a SAM task file, then writes back-references into the original plan. Does not re-implement any pipeline logic — delegates entirely to /work-backlog-item.

The plan file path is provided as $ARGUMENTS.

Invocation: /dh:interop <path-to-plan-file>

SOURCE: plan/architect-dh-phase2-interop-adapter.md (historical plan artifact, archived to ~/.dh/projects/{project-slug}/plan/)


Step 1 — Validate the argument

If $ARGUMENTS is empty, abort immediately:

text
ERROR: `/dh:interop` requires a path to a Superpowers plan file.
Usage: `/dh:interop docs/superpowers/plans/YYYY-MM-DD-slug.md`

Use the Read tool to open the file at the path given in $ARGUMENTS. If the file does not exist or cannot be read, abort:

text
ERROR: Cannot read plan file: {path}

Make no changes to the file or backlog before this check passes.


Step 2 — Extract fields from the plan file

Extract the following fields by exact pattern match against the raw file text. No inference.

mermaid
flowchart TD
    Read([Raw file text in memory]) --> ExtractTitle[Extract Title<br>Pattern: first line matching ^# .+]
    ExtractTitle --> HasTitle{Title found?}
    HasTitle -->|No| AbortTitle["ABORT: Missing required field<br>ERROR: Plan file has no # heading — title is required"]
    HasTitle -->|Yes| ExtractGoal[Extract Goal<br>Pattern: line matching ^\*\*Goal:\*\*\s*.+]
    ExtractGoal --> HasGoal{Goal found?}
    HasGoal -->|No| AbortGoal["ABORT: Missing required field<br>ERROR: Plan file has no **Goal:** field — goal is required"]
    HasGoal -->|Yes| ExtractSpec[Extract Spec<br>Pattern: line matching ^\*\*Spec:\*\*\s*.+]
    ExtractSpec --> HasSpec{Spec found?}
    HasSpec -->|No| WarnSpec["Log warning: no **Spec:** field found — continuing"]
    HasSpec -->|Yes| SpecOK[Spec captured]
    WarnSpec --> ExtractBacklog
    SpecOK --> ExtractBacklog[Extract Backlog item<br>Pattern: line matching ^\*\*Backlog item:\*\*\s*#\d+]
    ExtractBacklog --> HasBacklog{Backlog item found?}
    HasBacklog -->|Yes — integer N captured| ExtractChunks
    HasBacklog -->|No| CreateBacklog[Step 3 — create backlog item]
    CreateBacklog --> ExtractChunks
    ExtractChunks[Extract Chunks<br>Pattern: all lines matching ^## Chunk \d+: .+] --> HasChunks{At least one chunk found?}
    HasChunks -->|No| WarnChunks["Log warning: no ## Chunk N: headings found<br>Chunk annotation step will be skipped"]
    HasChunks -->|Yes| ChunksOK[All chunk numbers and names captured]
    WarnChunks --> Proceed([Proceed to Step 3])
    ChunksOK --> Proceed

Field extraction rules:

  • Title: first line matching ^# (.+)$ — capture the text after #
  • Goal: line matching ^\*\*Goal:\*\*\s*(.+)$ — capture remainder of the line
  • Spec: line matching ^\*\*Spec:\*\*\s*(.+)$ — capture remainder of the line (may be a file path or URL)
  • Backlog item: line matching ^\*\*Backlog item:\*\*\s*#(\d+)$ — capture the integer N
  • Chunks: all lines matching ^## Chunk (\d+): (.+)$ — capture chunk number and name for each heading

Abort conditions (make no changes before aborting):

  • Title absent: ERROR: Plan file has no # heading — title is required to name the backlog item
  • Goal absent: ERROR: Plan file has no **Goal:** field — goal is required as backlog item description

Step 3 — Ensure a backlog item exists

mermaid
flowchart TD
    Q{Backlog item #N<br>found in Step 2?}
    Q -->|Yes| UseExisting[Use existing item #N<br>Proceed to Step 4]
    Q -->|No| Create["Call mcp__plugin_dh_backlog__backlog_add<br>title = Title extracted in Step 2<br>description = Goal extracted in Step 2<br>plan = $ARGUMENTS"]
    Create --> CheckError{Response has<br>error key?}
    CheckError -->|Yes| AbortCreate["ABORT<br>ERROR: Failed to create backlog item<br>Print exact error from response"]
    CheckError -->|No| CaptureN[Capture new issue number N from response]
    CaptureN --> WriteRef["Write **Backlog item:** #N into the plan file<br>using Edit tool<br>Insert after the last existing bold-field line<br>or after the # Title heading if no bold fields present"]
    WriteRef --> UseExisting

When writing the backlog item reference into the plan file, use the Edit tool to insert:

markdown
**Backlog item:** #N

Position: immediately after the last existing **Field:** line in the header block, or after the # Title heading if no bold fields are present.


Step 4 — Invoke /work-backlog-item

Invoke the /work-backlog-item skill using the Skill tool with the backlog item number:

text
Skill(skill="work-backlog-item", args="#N")

Include the Superpowers plan file path as additional context in the invocation prompt so the pipeline can read the plan's Goal, Spec, and Chunks when producing the SAM task file. Pass the plan file path as a note in the prompt (e.g., "Plan file for context: {plan-file-path}") — the work-backlog-item skill does not accept a second positional argument, so the path is passed as contextual prose in the delegation prompt, not as an arg.

This step runs: groom → RT-ICA → SAM planning and produces ~/.dh/projects/{project-slug}/plan/tasks-N-slug.md (resolved via dh_paths.plan_dir()).

Wait for /work-backlog-item to complete. The task file path it produces is required for Steps 5 and 6.


Step 5 — Capture the task file path

After /work-backlog-item completes, identify the task file it produced. Plan files are stored under ~/.dh/projects/{slug}/plan/ (resolved via dh_paths.plan_dir()). Use Glob with the resolved path:

python
from dh_paths import plan_dir
plan_root = plan_dir()
# Find the specific plan file:
Glob(pattern=str(plan_root / "tasks-N-*.md"))

Where N is the backlog item number from Step 3. If the item number is unknown or the glob returns no results, broaden to:

python
Glob(pattern=str(plan_dir() / "tasks-*.md"))

Compare results against any task file paths mentioned in the /work-backlog-item output. Select the file whose slug matches the backlog item title.

If no matching file exists after the Glob check, abort:

text
ERROR: /work-backlog-item did not produce a task file. Cannot write back-references.

Record the exact filename (e.g., tasks-3-oauth-token-refresh.md) for use in Steps 6 and 7.


Step 6 — Write the SAM tasks back-reference

Read the current content of the plan file. Locate the **Backlog item:** line.

mermaid
flowchart TD
    Q{Does a **SAM tasks:** line<br>already exist in the file?}
    Q -->|Yes — re-run scenario| Replace["Replace the existing **SAM tasks:** line in-place<br>Do not insert a duplicate"]
    Q -->|No| Insert["Insert on the line immediately after **Backlog item:**"]
    Replace --> Done([Write complete])
    Insert --> Done

The exact text to write (substituting the real task filename and full state path):

markdown
**SAM tasks:** ~/.dh/projects/{project-slug}/plan/tasks-N-slug.md

Plan files live outside the repository under ~/.dh/projects/{project-slug}/plan/ (resolved via dh_paths.plan_dir()). Use the absolute path — relative paths from docs/superpowers/plans/ cannot reach state files outside the repo.

Use the Edit tool to make this change. Do not rewrite the file.


Step 7 — Write chunk annotations

If no chunks were found in Step 2 (warning was logged), skip this step entirely.

For each ## Chunk N: heading captured in Step 2:

mermaid
flowchart TD
    ForEach([For each Chunk N captured]) --> HasTask{Does chunk number N<br>have a corresponding SAM task T{N}?}
    HasTask -->|No — chunk count exceeds task count| Skip[Skip this chunk — no annotation]
    HasTask -->|Yes| CheckExisting{Does the line immediately<br>following this heading already<br>contain a SAM annotation comment?}
    CheckExisting -->|Yes — re-run scenario| ReplaceAnnotation["Replace existing annotation in-place<br><!-- SAM: T{N} in ~/.dh/projects/{project-slug}/plan/tasks-N-slug.md -->"]
    CheckExisting -->|No| InsertAnnotation["Insert on the line immediately<br>after the ## Chunk N: heading<br><!-- SAM: T{N} in ~/.dh/projects/{project-slug}/plan/tasks-N-slug.md -->"]
    ReplaceAnnotation --> Next([Next chunk])
    InsertAnnotation --> Next
    Skip --> Next

Annotation format — substitute the real chunk number and task filename:

markdown
<!-- SAM: T3 in ~/.dh/projects/{project-slug}/plan/tasks-N-slug.md -->

The task number T{N} matches the chunk number N by position. Chunk 1 → T1, chunk 2 → T2. If chunk count exceeds SAM task count, annotate only the chunks that have a corresponding task number. Unmatched chunks receive no annotation.

Use the Edit tool for each annotation. Do not rewrite the file.


Idempotency rules

Running /dh:interop on the same plan file a second time must produce identical output to the first run — no duplicates, no data loss.

  • **SAM tasks:** line: if it already exists, replace in-place. Never insert a second line.
  • Chunk annotations: if the comment already exists on the line immediately after a ## Chunk N: heading, replace in-place. Never insert a duplicate.
  • **Backlog item:** line: if it already exists, use the existing number. Never create a second backlog item.

Abort conditions summary

Stop immediately and make no further changes when:

  • $ARGUMENTS is empty
  • The file at $ARGUMENTS cannot be read
  • Title (# heading) is absent from the plan file
  • Goal (**Goal:** field) is absent from the plan file
  • mcp__plugin_dh_backlog__backlog_add returns an error response
  • /work-backlog-item completes without producing a task file

All abort messages are prefixed with ERROR: and printed to the user before stopping.


Example invocations

text
/dh:interop docs/superpowers/plans/2026-03-11-oauth-token-refresh.md
/dh:interop docs/superpowers/plans/2026-02-28-manifest-discovery.md

Expand your agent's capabilities with these related and highly-rated skills.

Jamie-BitFlight/claude_skills

ccc

This skill should be used when code search is needed (whether explicitly requested or as part of completing a task), when indexing the codebase after changes, or when the user asks about ccc, cocoindex-code, or the codebase index. Trigger phrases include 'search the codebase', 'find code related to', 'update the index', 'ccc', 'cocoindex-code'.

33 4
Explore
Jamie-BitFlight/claude_skills

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

33 4
Explore
Jamie-BitFlight/claude_skills

delegate

Quick delegation template for sub-agent prompts. Use when assigning work to a sub-agent, before invoking the Agent tool, or when preparing prompts for specialized agents. Provides the WHERE-WHAT-WHY framework. For comprehensive delegation guidance, activate the agent-orchestration how-to-delegate skill.

33 4
Explore
Jamie-BitFlight/claude_skills

swarm-spawning

Spawn agents and teammates in Claude Code swarms. Use when choosing between subagents vs teammates, selecting agent types (Explore, Plan, general-purpose, plugin agents), configuring spawn backends (in-process, tmux, iterm2), or setting environment variables for spawned agents.

33 4
Explore
Jamie-BitFlight/claude_skills

knowledge-explorer

Manage the research/ knowledge base (KB) of tool and library research entries. Use when browsing KB topics, adding new research entries, updating existing entries with dated revisions, fetching GitHub repo metadata into a draft KB entry, or migrating old-format entries to skill-spec frontmatter. Triggers on tasks like "what do we have on X", "add this to the KB", "update the KB entry for Y", "fetch github info for owner/repo", or "migrate old entries".

33 4
Explore
Jamie-BitFlight/claude_skills

design-anti-patterns

Enforce anti-AI UI design rules based on the Uncodixfy methodology. Use when generating HTML, CSS, React, Vue, Svelte, or any frontend UI code. Prevents "Codex UI" — the generic AI aesthetic of soft gradients, floating panels, oversized rounded corners, glassmorphism, hero sections in dashboards, and decorative copy. Applies constraints from Linear/Raycast/Stripe/GitHub design philosophy: functional, honest, human-designed interfaces. Triggers on: UI generation, dashboard building, frontend component creation, CSS styling, landing page design, or any task producing visual interface code.

33 4
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results