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-bundler3description: Interactively creates targeted code, design, and documentation bundles for external review (Markdown or ZIP). Includes a comprehensive library of review & delegation persona templates (Adversarial Security, Plan Critique, Refactoring Quality, Sub-Agent Task Handoff, Documentation Synthesis, Architecture, Compliance, TDD Contract Review), plus a Multi-Persona Fan-Out mode for parallel adversarial plan review (see graph-planning-superpowers-policy.md Phase 1).4---56## Dependencies78This skill requires **Python 3.8+** and standard library only. No external packages needed.910---1112# Context Bundler Skill 📦1314## Overview15This skill centralizes workflows for compiling codebase files, documentation, and instructions into portable payloads (`.md` for AI chat UIs or `.zip` for offline/agent handoffs).1617> **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.1819`context-bundler` supports **4 Execution Modes**:201. **Standard Bundle Mode**: Custom interactive selection of files/directories for general review or context sharing.212. **Persona-Driven Review / Handoff Mode**: Injects specialized review or delegation persona prompts (`prompt.md`) ahead of codebase files.223. **Monorepo Segmented Mode**: Full monorepo context packaging partitioned by domain (`/skills`, `/agents`, `/scripts`, `/docs`).234. **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.2425---2627## 🎭 Persona Template Library (`assets/templates/`)2829When bundling context for external models, sub-agents, or human reviews, select or recommend a template from `assets/templates/`:3031### 1. Security & Quality Review Personas32- **`adversarial-security-auditor.md`**: OWASP Top 10, auth bypasses, injection vectors, exploit scenarios, CVSS risk ratings.33- **`refactoring-quality-specialist.md`**: DRY violations, code smells, cyclomatic complexity reduction, before/after code diffs.34- **`compliance-standards-reviewer.md`**: Project conventions, 20-line purpose headers, ADR compliance, type annotations.3536### 2. Architecture & Design Planning Personas37- **`structural-architecture-reviewer.md`**: C4 model, SOLID principles, coupling, interface abstraction leaks, component boundaries.38- **`plan-critique-reviewer.md`**: Stress-tests implementation plans, unstated dependencies, execution friction, rollback mechanisms.3940### 3. Agent Task Handoff & Documentation Personas41- **`agent-task-delegator.md`**: Builds turnkey task prompts for sub-agents (Copilot CLI, Claude Code, Gemini CLI) with explicit tool gates & test criteria.42- **`docs-synthesis-specialist.md`**: Generates ADRs, C4 Mermaid diagrams, README guides, and API specs from raw codebase context.4344### 4. Graph Planning Phase 1 Fan-Out Trio45The canonical three-persona set for `graph-planning-superpowers-policy.md` §2.3's adversarial46plan review — use all three together via Multi-Persona Fan-Out Mode, not individually:47- **`structural-architecture-reviewer.md`** — **Architecture Skeptic** role: interfaces, dependency cycles, missing contracts.48- **`adversarial-security-auditor.md`** — **Security / Edge-Case Auditor** role: injection, auth, failure paths, race conditions.49- **`tdd-contract-reviewer.md`** — **TDD Contract Reviewer** role: deterministic test fixtures and assertion validity.5051(For CLI-dispatched review instead of a bundle-to-external-chat handoff, the equivalent52`cli-agents` sub-agents are `architect-review`, `security-auditor`, and `tdd-contract-reviewer`.)5354---5556## Core Workflow5758### Phase 1: Mode & Target Discovery59Evaluate the request and negotiate mode and format:601. **Mode**: Standard Bundle, Persona-Driven Review/Handoff (select persona template), Monorepo Segmented, or Multi-Persona Fan-Out (select persona set — see below).612. **Format**: Single Markdown payload (`.md`) or Portable ZIP archive (`.zip`).623. **Targets**: Directories or file paths to package.6364### Phase 2: Recap & Pre-Execution Confirmation65Present execution plan to user before running scripts:6667```text68Context Bundle Plan:69- Mode: [Standard / Persona Review (Selected Persona) / Monorepo Segmented / Multi-Persona Fan-Out (Persona Set)]70- Format: [.md or .zip]71- Persona Prompt: assets/templates/[selected-persona].md72- Included Paths:73 1. plugins/dev-utils/74 2. docs/architecture.md75- Output Target: temp/context-bundle-[name]/payload.[md|zip]7677Proceed? (yes / adjust)78```7980### Phase 3: Manifest Construction81Generate `file-manifest.json` in temporary directory (`temp/context-bundle-[name]/`).82For Persona-Driven mode, `prompt.md` (containing the selected persona prompt) MUST be listed as the first file entry in `files`.8384```json85{86 "title": "Sub-Agent Handoff Bundle",87 "description": "Task delegation bundle for Copilot CLI.",88 "excludes": ["**/*.png", "**/node_modules/**"],89 "files": [90 {91 "path": "temp/context-bundle-task/prompt.md",92 "note": "Primary Persona & Handoff Instructions"93 },94 {95 "path": "plugins/dev-utils/skills/github-issue-agent/",96 "note": "Target codebase"97 }98 ]99}100```101102### Phase 4: Bundler Script Execution103104- **Markdown (.md)**:105 ```bash106 python3 ./scripts/bundle.py --manifest temp/context-bundle-[name]/file-manifest.json --bundle temp/context-bundle-[name]/payload.md107 ```108109- **ZIP Archive (.zip)**:110 ```bash111 python3 ./scripts/bundle_zip.py --manifest temp/context-bundle-[name]/file-manifest.json --bundle temp/context-bundle-[name]/payload.zip112 ```113114Inform user when payload is ready for handoff or clipboard copying.115116---117118## Multi-Persona Fan-Out Mode (Mode 4)119120Used 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.1211221. **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.1232. **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:124 ```125 temp/context-bundle-[name]/architecture-skeptic/file-manifest.json126 temp/context-bundle-[name]/security-edge-case-auditor/file-manifest.json127 temp/context-bundle-[name]/tdd-contract-reviewer/file-manifest.json128 ```1293. **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).1304. **Create a `responses/` subfolder inside each persona's own directory**, so responses131 collected back from external models land next to the prompt/payload that produced them:132 ```133 temp/context-bundle-[name]/architecture-skeptic/responses/round1.md134 temp/context-bundle-[name]/security-edge-case-auditor/responses/round1.md135 ```136 On a later round, regenerate `prompt.md`/`payload.md` in place (same paths) rather than137 creating round-numbered prompt/payload files — only `responses/` files are round-numbered.1385. **Convergence cap**: the caller (typically `red-team-review`) tracks round count across all139 personas combined and caps at 2-3 rounds total, per `graph-planning-superpowers-policy.md`140 §2.3 — `context-bundler` only packages each round's bundles, it does not track rounds itself.