Export
The export phase transforms spec files into a format optimized for a specific AI agent.
intake export <SPEC_DIR> -f <format> -o <output>
Available Formats
| Format | Status | What it generates |
|---|---|---|
architect | Implemented | pipeline.yaml + spec copy |
generic | Implemented | SPEC.md + verify.sh + spec copy |
claude-code | Planned | CLAUDE.md + tasks + verify.sh |
cursor | Planned | Cursor format |
kiro | Planned | Kiro format |
Architect
Generates a pipeline.yaml compatible with architect and a copy of the spec files.
intake export specs/my-feature/ -f architect -o output/
Generated Structure
output/
├── pipeline.yaml # Workflow with one step per task
└── spec/ # Copy of all spec files
├── requirements.md
├── design.md
├── tasks.md
├── acceptance.yaml
├── context.md
└── sources.md
pipeline.yaml
name: my-feature
description: "Pipeline generated by intake from spec 'my-feature'"
steps:
- name: task-1
agent: build
prompt: |
Implement task 1: Setup project structure
Create the initial project structure with the following files...
Project context:
[first 2000 chars of context.md]
checkpoint: true
- name: task-2
agent: build
prompt: |
Implement task 2: Implement user model
...
checkpoint: true
# ... one step per task in tasks.md ...
- name: final-verification
agent: review
prompt: "Verify that the entire implementation meets the spec requirements."
checks:
- "python -m pytest tests/ -q"
- "ruff check src/"
# ... all required command checks from acceptance.yaml ...
Each step includes:
| Field | Description |
|---|---|
name | task-{id} based on the task ID |
agent | build for tasks, review for final verification |
prompt | Title + description + project context |
checkpoint | true — pauses after each task for review |
checks | Only in the final step: list of verification commands |
Options
The ArchitectExporter accepts include_guardrails (configurable via export.architect_include_guardrails).
Generic
Generates a consolidated SPEC.md, an executable verify.sh, and a copy of the spec files. Compatible with any agent or manual workflow.
intake export specs/my-feature/ -f generic -o output/
Generated Structure
output/
├── SPEC.md # Consolidated Markdown with all sections
├── verify.sh # Executable bash script
└── spec/ # Copy of all spec files
├── requirements.md
├── design.md
├── tasks.md
├── acceptance.yaml
├── context.md
└── sources.md
SPEC.md
A single Markdown file that consolidates:
- Project Context — contents of
context.md - Requirements — contents of
requirements.md - Design — contents of
design.md - Tasks — contents of
tasks.md - Sources — contents of
sources.md
Useful for pasting directly into an agent’s context.
verify.sh
A self-contained bash script that runs the command checks from acceptance.yaml:
#!/usr/bin/env bash
set -euo pipefail
PROJECT_DIR="${1:-.}"
PASS=0
FAIL=0
check() {
local name="$1"
local cmd="$2"
if (cd "$PROJECT_DIR" && eval "$cmd") > /dev/null 2>&1; then
echo "PASS: $name"
PASS=$((PASS + 1))
else
echo "FAIL: $name"
FAIL=$((FAIL + 1))
fi
}
check "Tests pass" "python -m pytest tests/ -q"
check "Lint clean" "ruff check src/"
echo ""
echo "Passed: $PASS Failed: $FAIL"
if [ "$FAIL" -gt 0 ]; then
exit 1
fi
The script:
- Accepts an optional
PROJECT_DIRargument (default:.) - Runs each check with the
check()function - Reports PASS/FAIL for each check
- Shows totals at the end
- Exit code 1 if any check failed, 0 if all passed
- Generated with automatic
chmod +x
Usage Without intake
The generic exporter allows verification without having intake installed:
# In CI or on the developer's machine
./output/verify.sh /path/to/project
Exporter Protocol
Exporters follow the Exporter Protocol:
@runtime_checkable
class Exporter(Protocol):
def export(self, spec_dir: str, output_dir: str) -> list[str]: ...
The export() method receives the spec directory and the output directory, and returns the list of generated files.
To add a new exporter there are two options:
Option 1: Built-in Exporter
- Create a file in
src/intake/export/(e.g.:cursor.py) - Implement the
export(spec_dir, output_dir) -> list[str]method - Register it in
create_default_registry()and as an entry_point inpyproject.toml
Option 2: External Plugin (V2 ExporterPlugin)
- Create a separate Python package
- Implement the
ExporterPluginprotocol fromintake.plugins.protocols - Register as an entry_point in the
intake.exportersgroup in yourpyproject.toml
The exporter will be discovered automatically when the package is installed. See Plugins for details.
Note: Since v0.2.0, exporters are discovered automatically via the plugin system. The ExporterRegistry attempts plugin discovery first and falls back to manual registration if it fails.
Related Configuration
export:
default_format: generic # Default format
architect_include_guardrails: true # Guardrails in pipeline.yaml
architect_pipeline_template: standard # Pipeline template
claude_code_generate_claude_md: true # Generate CLAUDE.md (future)
The default format can be overridden with --format in the CLI:
# Uses the config default
intake init "My feature" -s reqs.md
# Overrides with architect
intake init "My feature" -s reqs.md -f architect