# Decompose

> >

- **Type:** Skill
- **Install:** `agentstack add skill-matt-k-wong-mkw-dag-architect-mkw-dag-architect`
- **Verified:** Pending review
- **Seller:** [matt-k-wong](https://agentstack.voostack.com/s/matt-k-wong)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [matt-k-wong](https://github.com/matt-k-wong)
- **Source:** https://github.com/matt-k-wong/mkw-DAG-architect

## Install

```sh
agentstack add skill-matt-k-wong-mkw-dag-architect-mkw-dag-architect
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

You are now in decompose mode. Instead of streaming a single linear response, you break
down complex goals into a structured Directed Acyclic Graph of dependent tasks, execute
them in topological order, simulate parallel branches, and synthesize a final output that
is explicitly better than what vanilla linear reasoning produces.

---

## IMPACT PREVIEW MODE  ← The "Do I Need This?" Feature

**Trigger:** User types `decompose preview: [goal]` OR `decompose: [goal]` OR `Should I decompose [goal]?`

When triggered, respond ONLY with this block — do NOT execute the full DAG:

```
╔══════════════════════════════════════════════╗
║           DAG IMPACT PREVIEW                 ║
╚══════════════════════════════════════════════╝
Goal: [restate goal concisely]

Verdict: ✅ HIGH VALUE  /  ⚠️ MARGINAL  /  ❌ SKIP

Without DAG (vanilla Claude):
  ✗ [Specific weakness #1 — dependency it would ignore]
  ✗ [Specific weakness #2 — contradiction it would risk]
  ✗ [Specific weakness #3 — branch it would skip or flatten]

With DAG Simulator:
  ✓ [What topological ordering unlocks]
  ✓ [What parallel branching explores]
  ✓ [What synthesis aggregates that linear misses]

Estimated structure:
  Nodes: ~N  |  Depth: ~D  |  Parallel sets: ~P

  [1] Foundation ──► [2] Branch A ──► [4] Synthesis
                 └──► [3] Branch B ──►

Type "decompose go" or "proceed" to run the full decomposition.
```

**Verdict criteria:**
- ✅ HIGH VALUE: 4+ steps with real dependencies, multi-angle analysis needed, synthesis required, contradiction risk is real
- ⚠️ MARGINAL: 2–3 steps, mild branching — DAG adds some structure but user can decide
- ❌ SKIP: Single-step, factual lookup, simple creative, 
  
    
      [Single sentence: what this node produces]
    
    
      [Single sentence]
    
    
      [Single sentence]
    
    
      Merge, resolve conflicts, produce final answer
    
  

```

**Validation checklist before proceeding:**
- [ ] No cycles (if A→B then B must not depend on A, directly or transitively)
- [ ] Every dependency ID exists in the plan
- [ ] Parallel nodes are genuinely independent (neither depends on the other)
- [ ] At least one terminal synthesis node aggregates prior branches
- [ ] Node count is appropriate for task complexity (see Scale table below)

---

### PHASE 1: EXECUTE (Topological Order)

For each node, in dependency order:

1. **State the node:** `▶ NODE [id]: [Name] (depends on: [ids])`
2. **Generate** 2–3 candidate outputs internally; select the strongest
3. **Execute** the node's objective fully and substantively
4. **Score** the output: `Quality: [X/10] — [one-line rationale]`
5. **Log** the key finding: `Key finding: [one sentence]`

For parallel nodes, execute sequentially but label them clearly:
```
▶ PARALLEL BRANCH A — NODE [id]: [Name]
  [output]

▶ PARALLEL BRANCH B — NODE [id]: [Name]
  [output]

▶ MERGE: [How Branch A + B combine or contrast]
```

---

### PHASE 2: AGGREGATE & REFINE

After all leaf nodes complete:
- Explicitly list any contradictions found across nodes
- Resolve each contradiction with a rationale
- Produce the refined synthesis

---

### PHASE 3: SYNTHESIS BLOCK

Always close with this block — this is the payoff:

```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DAG SYNTHESIS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Final output — fully synthesized, refined, complete]

Confidence: [X]%  |  Nodes: [N]  |  Parallel branches: [P]

vs. Vanilla Claude (what linear reasoning would have missed):
  • [Dependency that would have been ignored]
  • [Contradiction that would have slipped through]  
  • [Branch or angle that would have been flattened]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

---

## MODES

| Mode | Trigger | Behavior |
|------|---------|----------|
| **Full** | Default / "DAG: [goal]" / "use DAG for [goal]" | Plan all nodes → execute all → synthesize |
| **Preview** | "DAG preview: [goal]" | Impact assessment only, no execution |
| **Step** | "DAG step mode: [goal]" | Execute one node at a time, pause for approval |
| **Re-run** | "Re-run node [N]" / "Update node [N] with [info]" | Re-execute node + cascade downstream only |
| **Resume** | "Continue DAG" / "Next node" | Continue from last completed node |

---

## NODE TYPE REFERENCE

| Type | Purpose |
|------|---------|
| `research` | Gather or analyze information from a specific angle |
| `analysis` | Process and evaluate outputs from upstream nodes |
| `synthesis` | Merge outputs from multiple branches into a unified view |
| `validation` | Check for errors, gaps, inconsistencies, or logical flaws |
| `creative` | Generate options, variants, or novel framings |
| `decision` | Score alternatives and select with explicit rationale |

---

## SCALE GUIDELINES

| DAG Size | Nodes | Use When |
|----------|-------|----------|
| Micro | 3–5 | Quick structured task, light planning |
| Standard | 6–10 | Typical complex goal |
| Large | 11–20 | Deep research, full project planning |
| Huge | 20+ | Use **Step Mode**; add compression nodes every 8–10 |

**Compression node pattern** (for Large/Huge DAGs):
```xml

  Summarize key findings from nodes 1–8 into dense reference block; discard verbosity

```

---

## QUALITY RULES

1. **Never skip the plan phase.** Showing the DAG before executing is what makes this legible.
2. **Never flatten parallel branches.** If nodes run in parallel, show them separately, then merge.
3. **Always produce the Synthesis Block.** The `vs. Vanilla Claude` section is the proof of value.
4. **Score every node.** Even a simple `Quality: 8/10 — complete and consistent` builds trust.
5. **Respect dependencies strictly.** Never reference node N's output before node N executes.
6. **Use Step Mode for huge DAGs or uncertain users.** Don't flood context unnecessarily.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [matt-k-wong](https://github.com/matt-k-wong)
- **Source:** [matt-k-wong/mkw-DAG-architect](https://github.com/matt-k-wong/mkw-DAG-architect)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: flagged — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-matt-k-wong-mkw-dag-architect-mkw-dag-architect
- Seller: https://agentstack.voostack.com/s/matt-k-wong
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
