Dependencies
This skill requires Python 3.8+ and standard library only. No external packages needed.
Context Bundler Skill 📦
Overview
This skill centralizes workflows for compiling codebase files, documentation, and instructions into portable payloads (.md for AI chat UIs or .zip for offline/agent handoffs).
Storage & Git Discipline: All bundle manifests, markdown payloads, and archives MUST be generated inside a gitignored temp/ subfolder (e.g., temp/bundles/ or temp/context-bundle-[name]/). Never write bundle outputs to project root or non-ignored directories, which would pollute git status with massive generated review packages.
context-bundler supports 4 Execution Modes:
- Standard Bundle Mode: Custom interactive selection of files/directories for general review or context sharing.
- Persona-Driven Review / Handoff Mode: Injects specialized review or delegation persona prompts (
prompt.md) ahead of codebase files.
- Monorepo Segmented Mode: Full monorepo context packaging partitioned by domain (
/skills, /agents, /scripts, /docs).
- Multi-Persona Fan-Out Mode: Packages the same target content against multiple persona templates in one pass, producing one bundle per persona for parallel adversarial dispatch. This is the mechanism
graph-planning-superpowers-policy.md §2.2-2.3 refers to for Phase 1 plan review.
🎭 Persona Template Library (assets/templates/)
When bundling context for external models, sub-agents, or human reviews, select or recommend a template from assets/templates/:
1. Security & Quality Review Personas
adversarial-security-auditor.md: OWASP Top 10, auth bypasses, injection vectors, exploit scenarios, CVSS risk ratings.
refactoring-quality-specialist.md: DRY violations, code smells, cyclomatic complexity reduction, before/after code diffs.
compliance-standards-reviewer.md: Project conventions, 20-line purpose headers, ADR compliance, type annotations.
2. Architecture & Design Planning Personas
structural-architecture-reviewer.md: C4 model, SOLID principles, coupling, interface abstraction leaks, component boundaries.
plan-critique-reviewer.md: Stress-tests implementation plans, unstated dependencies, execution friction, rollback mechanisms.
3. Agent Task Handoff & Documentation Personas
agent-task-delegator.md: Builds turnkey task prompts for sub-agents (Copilot CLI, Claude Code, Gemini CLI) with explicit tool gates & test criteria.
docs-synthesis-specialist.md: Generates ADRs, C4 Mermaid diagrams, README guides, and API specs from raw codebase context.
4. Graph Planning Phase 1 Fan-Out Trio
The canonical three-persona set for graph-planning-superpowers-policy.md §2.3's adversarial
plan review — use all three together via Multi-Persona Fan-Out Mode, not individually:
structural-architecture-reviewer.md — Architecture Skeptic role: interfaces, dependency cycles, missing contracts.
adversarial-security-auditor.md — Security / Edge-Case Auditor role: injection, auth, failure paths, race conditions.
tdd-contract-reviewer.md — TDD Contract Reviewer role: deterministic test fixtures and assertion validity.
(For CLI-dispatched review instead of a bundle-to-external-chat handoff, the equivalent
cli-agents sub-agents are architect-review, security-auditor, and tdd-contract-reviewer.)
Core Workflow
Phase 1: Mode & Target Discovery
Evaluate the request and negotiate mode and format:
- Mode: Standard Bundle, Persona-Driven Review/Handoff (select persona template), Monorepo Segmented, or Multi-Persona Fan-Out (select persona set — see below).
- Format: Single Markdown payload (
.md) or Portable ZIP archive (.zip).
- Targets: Directories or file paths to package.
Phase 2: Recap & Pre-Execution Confirmation
Present execution plan to user before running scripts:
Context Bundle Plan:
- Mode: [Standard / Persona Review (Selected Persona) / Monorepo Segmented / Multi-Persona Fan-Out (Persona Set)]
- Format: [.md or .zip]
- Persona Prompt: assets/templates/[selected-persona].md
- Included Paths:
1. plugins/dev-utils/
2. docs/architecture.md
- Output Target: temp/context-bundle-[name]/payload.[md|zip]
Proceed? (yes / adjust)
Phase 3: Manifest Construction
Generate file-manifest.json in temporary directory (temp/context-bundle-[name]/).
For Persona-Driven mode, prompt.md (containing the selected persona prompt) MUST be listed as the first file entry in files.
{
"title": "Sub-Agent Handoff Bundle",
"description": "Task delegation bundle for Copilot CLI.",
"excludes": ["**/*.png", "**/node_modules/**"],
"files": [
{
"path": "temp/context-bundle-task/prompt.md",
"note": "Primary Persona & Handoff Instructions"
},
{
"path": "plugins/dev-utils/skills/github-issue-agent/",
"note": "Target codebase"
}
]
}
Phase 4: Bundler Script Execution
Markdown (.md):
python3 ./scripts/bundle.py --manifest temp/context-bundle-[name]/file-manifest.json --bundle temp/context-bundle-[name]/payload.md
ZIP Archive (.zip):
python3 ./scripts/bundle_zip.py --manifest temp/context-bundle-[name]/file-manifest.json --bundle temp/context-bundle-[name]/payload.zip
Inform user when payload is ready for handoff or clipboard copying.
Multi-Persona Fan-Out Mode (Mode 4)
Used when the same target content (typically a Phase 1 plan draft, per graph-planning-superpowers-policy.md §2.2-2.3) needs parallel review by more than one persona in a single pass, with a bounded convergence loop.
- Select the persona set — default to the Graph Planning Phase 1 Fan-Out Trio (
structural-architecture-reviewer.md, adversarial-security-auditor.md, tdd-contract-reviewer.md) unless the caller specifies a different set.
- Build one manifest per persona, each following the standard Phase 3 manifest format above, with that persona's
prompt.md as the first file entry and the same target content following it:temp/context-bundle-[name]/architecture-skeptic/file-manifest.json
temp/context-bundle-[name]/security-edge-case-auditor/file-manifest.json
temp/context-bundle-[name]/tdd-contract-reviewer/file-manifest.json
- Run Phase 4 (bundler script execution) once per manifest — this produces one payload per persona, ready for parallel dispatch (CLI sub-agents, or paste-to-chat/browser for each).
- Create a
responses/ subfolder inside each persona's own directory, so responses
collected back from external models land next to the prompt/payload that produced them:temp/context-bundle-[name]/architecture-skeptic/responses/round1.md
temp/context-bundle-[name]/security-edge-case-auditor/responses/round1.md
On a later round, regenerate prompt.md/payload.md in place (same paths) rather than
creating round-numbered prompt/payload files — only responses/ files are round-numbered.
- Convergence cap: the caller (typically
red-team-review) tracks round count across all
personas combined and caps at 2-3 rounds total, per graph-planning-superpowers-policy.md
§2.3 — context-bundler only packages each round's bundles, it does not track rounds itself.
1---2name: context-bundler3plugin: dev-utils4description: >5 Interactively creates targeted code, design, and documentation bundles for external review (Markdown or ZIP).6 Includes a comprehensive library of review & delegation persona templates (Adversarial Security, Plan Critique,7 Refactoring Quality, Sub-Agent Task Handoff, Documentation Synthesis, Architecture, Compliance, TDD Contract8 Review), plus a Multi-Persona Fan-Out mode for parallel adversarial plan review (see9 graph-planning-superpowers-policy.md Phase 1).10allowed-tools: Bash, Read, Write, Glob, Grep11---1213## Dependencies1415This skill requires **Python 3.8+** and standard library only. No external packages needed.1617---1819# Context Bundler Skill 📦2021## Overview22This skill centralizes workflows for compiling codebase files, documentation, and instructions into portable payloads (`.md` for AI chat UIs or `.zip` for offline/agent handoffs).2324> **Storage & Git Discipline:** All bundle manifests, markdown payloads, and archives MUST be generated inside a gitignored `temp/` subfolder (e.g., `temp/bundles/` or `temp/context-bundle-[name]/`). Never write bundle outputs to project root or non-ignored directories, which would pollute `git status` with massive generated review packages.2526`context-bundler` supports **4 Execution Modes**:271. **Standard Bundle Mode**: Custom interactive selection of files/directories for general review or context sharing.282. **Persona-Driven Review / Handoff Mode**: Injects specialized review or delegation persona prompts (`prompt.md`) ahead of codebase files.293. **Monorepo Segmented Mode**: Full monorepo context packaging partitioned by domain (`/skills`, `/agents`, `/scripts`, `/docs`).304. **Multi-Persona Fan-Out Mode**: Packages the *same* target content against **multiple** persona templates in one pass, producing one bundle per persona for parallel adversarial dispatch. This is the mechanism `graph-planning-superpowers-policy.md` §2.2-2.3 refers to for Phase 1 plan review.3132---3334## 🎭 Persona Template Library (`assets/templates/`)3536When bundling context for external models, sub-agents, or human reviews, select or recommend a template from `assets/templates/`:3738### 1. Security & Quality Review Personas39- **`adversarial-security-auditor.md`**: OWASP Top 10, auth bypasses, injection vectors, exploit scenarios, CVSS risk ratings.40- **`refactoring-quality-specialist.md`**: DRY violations, code smells, cyclomatic complexity reduction, before/after code diffs.41- **`compliance-standards-reviewer.md`**: Project conventions, 20-line purpose headers, ADR compliance, type annotations.4243### 2. Architecture & Design Planning Personas44- **`structural-architecture-reviewer.md`**: C4 model, SOLID principles, coupling, interface abstraction leaks, component boundaries.45- **`plan-critique-reviewer.md`**: Stress-tests implementation plans, unstated dependencies, execution friction, rollback mechanisms.4647### 3. Agent Task Handoff & Documentation Personas48- **`agent-task-delegator.md`**: Builds turnkey task prompts for sub-agents (Copilot CLI, Claude Code, Gemini CLI) with explicit tool gates & test criteria.49- **`docs-synthesis-specialist.md`**: Generates ADRs, C4 Mermaid diagrams, README guides, and API specs from raw codebase context.5051### 4. Graph Planning Phase 1 Fan-Out Trio52The canonical three-persona set for `graph-planning-superpowers-policy.md` §2.3's adversarial53plan review — use all three together via Multi-Persona Fan-Out Mode, not individually:54- **`structural-architecture-reviewer.md`** — **Architecture Skeptic** role: interfaces, dependency cycles, missing contracts.55- **`adversarial-security-auditor.md`** — **Security / Edge-Case Auditor** role: injection, auth, failure paths, race conditions.56- **`tdd-contract-reviewer.md`** — **TDD Contract Reviewer** role: deterministic test fixtures and assertion validity.5758(For CLI-dispatched review instead of a bundle-to-external-chat handoff, the equivalent59`cli-agents` sub-agents are `architect-review`, `security-auditor`, and `tdd-contract-reviewer`.)6061---6263## Core Workflow6465### Phase 1: Mode & Target Discovery66Evaluate the request and negotiate mode and format:671. **Mode**: Standard Bundle, Persona-Driven Review/Handoff (select persona template), Monorepo Segmented, or Multi-Persona Fan-Out (select persona set — see below).682. **Format**: Single Markdown payload (`.md`) or Portable ZIP archive (`.zip`).693. **Targets**: Directories or file paths to package.7071### Phase 2: Recap & Pre-Execution Confirmation72Present execution plan to user before running scripts:7374```text75Context Bundle Plan:76- Mode: [Standard / Persona Review (Selected Persona) / Monorepo Segmented / Multi-Persona Fan-Out (Persona Set)]77- Format: [.md or .zip]78- Persona Prompt: assets/templates/[selected-persona].md79- Included Paths:80 1. plugins/dev-utils/81 2. docs/architecture.md82- Output Target: temp/context-bundle-[name]/payload.[md|zip]8384Proceed? (yes / adjust)85```8687### Phase 3: Manifest Construction88Generate `file-manifest.json` in temporary directory (`temp/context-bundle-[name]/`).89For Persona-Driven mode, `prompt.md` (containing the selected persona prompt) MUST be listed as the first file entry in `files`.9091```json92{93 "title": "Sub-Agent Handoff Bundle",94 "description": "Task delegation bundle for Copilot CLI.",95 "excludes": ["**/*.png", "**/node_modules/**"],96 "files": [97 {98 "path": "temp/context-bundle-task/prompt.md",99 "note": "Primary Persona & Handoff Instructions"100 },101 {102 "path": "plugins/dev-utils/skills/github-issue-agent/",103 "note": "Target codebase"104 }105 ]106}107```108109### Phase 4: Bundler Script Execution110111- **Markdown (.md)**:112 ```bash113 python3 ./scripts/bundle.py --manifest temp/context-bundle-[name]/file-manifest.json --bundle temp/context-bundle-[name]/payload.md114 ```115116- **ZIP Archive (.zip)**:117 ```bash118 python3 ./scripts/bundle_zip.py --manifest temp/context-bundle-[name]/file-manifest.json --bundle temp/context-bundle-[name]/payload.zip119 ```120121Inform user when payload is ready for handoff or clipboard copying.122123---124125## Multi-Persona Fan-Out Mode (Mode 4)126127Used when the same target content (typically a Phase 1 plan draft, per `graph-planning-superpowers-policy.md` §2.2-2.3) needs parallel review by more than one persona in a single pass, with a bounded convergence loop.1281291. **Select the persona set** — default to the Graph Planning Phase 1 Fan-Out Trio (`structural-architecture-reviewer.md`, `adversarial-security-auditor.md`, `tdd-contract-reviewer.md`) unless the caller specifies a different set.1302. **Build one manifest per persona**, each following the standard Phase 3 manifest format above, with that persona's `prompt.md` as the first file entry and the *same* target content following it:131 ```132 temp/context-bundle-[name]/architecture-skeptic/file-manifest.json133 temp/context-bundle-[name]/security-edge-case-auditor/file-manifest.json134 temp/context-bundle-[name]/tdd-contract-reviewer/file-manifest.json135 ```1363. **Run Phase 4 (bundler script execution) once per manifest** — this produces one payload per persona, ready for parallel dispatch (CLI sub-agents, or paste-to-chat/browser for each).1374. **Create a `responses/` subfolder inside each persona's own directory**, so responses138 collected back from external models land next to the prompt/payload that produced them:139 ```140 temp/context-bundle-[name]/architecture-skeptic/responses/round1.md141 temp/context-bundle-[name]/security-edge-case-auditor/responses/round1.md142 ```143 On a later round, regenerate `prompt.md`/`payload.md` in place (same paths) rather than144 creating round-numbered prompt/payload files — only `responses/` files are round-numbered.1455. **Convergence cap**: the caller (typically `red-team-review`) tracks round count across all146 personas combined and caps at 2-3 rounds total, per `graph-planning-superpowers-policy.md`147 §2.3 — `context-bundler` only packages each round's bundles, it does not track rounds itself.