| name | gpd-export |
| description | Export research results to HTML, LaTeX, or ZIP package |
| argument-hint | [--format html|latex|zip|all] |
| context_mode | project-required |
| allowed-tools | ["read_file","write_file","shell","grep","glob"] |
<codex_runtime_notes>
Codex shell compatibility:
- When shell steps call the GPD CLI, use /Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local instead of the ambient
gpd on PATH.
- If you intentionally need the repo environment, keep the runtime pin:
GPD_ACTIVE_RUNTIME=codex uv run gpd ....
</codex_runtime_notes>
Export research results into shareable formats. Collects key results, equations, derivations, and figures from all completed phases and packages them for external consumption.
Formats:
html: Standalone HTML with MathJax equations, structured results, and figures
latex: LaTeX document with derivations as appendices, ready for journal submission scaffold
zip: Package of scripts, data files, derivations, and a README for reproducibility
all: Generate all formats
Use this when sharing results with collaborators, preparing for publication, or archiving a milestone.
<execution_context>
Export research results into shareable formats. Collects key results, equations, derivations, and figures from all completed phases and packages them for external consumption. Supports HTML (with MathJax), LaTeX (journal-ready scaffold), ZIP (reproducibility package), or all formats.
<required_reading>
Read all files referenced by the invoking prompt's execution_context before starting.
</required_reading>
**Load project context:**
read_file:
.gpd/PROJECT.md -- project title, description, conventions
.gpd/ROADMAP.md -- phase structure and status
.gpd/STATE.md -- current position
ROADMAP=$(/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local roadmap analyze)
if [ $? -ne 0 ]; then
echo "ERROR: gpd roadmap analyze failed: $ROADMAP"
fi
Extract: project_title, milestone, completed phases list, total phase count.
If no completed phases:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
No completed phases found. Nothing to export.
Complete at least one phase before exporting:
$gpd-execute-phase <phase-number>
Exit.
**Scan all completed phase directories for exportable content:**
For each completed phase:
- Read all SUMMARY.md files:
/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local summary-extract {path} --field one_liner --field key_results --field equations --field key_files
-
Collect:
- Key results -- equations, numerical values, qualitative findings
- Equations -- all numbered equations from derivations
- Scripts --
*.py, *.jl, *.m, *.nb files
- Data files --
*.csv, *.json, *.dat, *.h5
- Figures --
*.png, *.pdf, *.svg in phase directories
- Convention changes -- from SUMMARY.md
affects fields
-
Also collect VERIFICATION.md results for validation summary.
Store collected items grouped by phase.
**Parse format from arguments:**
Parse --format from $ARGUMENTS.
| Argument | Format |
|---|
--format html or html | HTML only |
--format latex or latex | LaTeX only |
--format zip or zip | ZIP only |
--format all or all | All formats |
| (none) | Ask user |
If no format specified, ask:
╔══════════════════════════════════════════════════════════════╗
║ CHECKPOINT: Decision Required ║
╚══════════════════════════════════════════════════════════════╝
Export format:
1. **html** -- Standalone HTML with MathJax equations and structured results
2. **latex** -- LaTeX document scaffold ready for journal submission
3. **zip** -- Reproducibility package (scripts, data, derivations, README)
4. **all** -- Generate all formats
──────────────────────────────────────────────────────────────
→ Select: 1 / 2 / 3 / 4
──────────────────────────────────────────────────────────────
**Create export directory:**
mkdir -p exports
**If format is `html` or `all`:**
Write exports/results.html:
Structure:
<!doctype html>
<html>
<head>
<title>{project_title} -- Research Results</title>
<style>
body {
font-family: "Computer Modern", Georgia, serif;
max-width: 900px;
margin: 0 auto;
padding: 2em;
}
h1 {
border-bottom: 2px solid #333;
}
h2 {
color: #444;
margin-top: 2em;
}
table {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
}
th,
td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f5f5f5;
}
.equation {
margin: 1em 2em;
padding: 0.5em;
background: #fafafa;
border-left: 3px solid #ccc;
}
.phase {
margin: 2em 0;
padding: 1em;
border: 1px solid #eee;
border-radius: 4px;
}
.verification {
padding: 0.5em 1em;
border-radius: 4px;
}
.passed {
background: #e8f5e9;
}
.warning {
background: #fff3e0;
}
.failed {
background: #ffebee;
}
</style>
</head>
<body>
<h1>{project_title}</h1>
<p><em>Generated with Get Physics Done (PSI) | {YYYY-MM-DD} | Milestone: {milestone_name}</em></p>
<h2>Summary</h2>
<p>{project description from PROJECT.md}</p>
<h2>Results by Phase</h2>
{For each completed phase:}
<div class="phase">
<h3>Phase {N}: {Name}</h3>
<p>{one_liner from SUMMARY.md}</p>
<h4>Key Results</h4>
<ul>
{key results as list items}
</ul>
<h4>Equations</h4>
{equations wrapped in \(...\) or \[...\] for MathJax}
</div>
<h2>Conventions</h2>
{Convention table from PROJECT.md and affects fields}
<h2>Verification Summary</h2>
{Aggregate verification results}
</body>
</html>
**If format is `latex` or `all`:**
Write exports/results.tex:
Structure:
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{physics}
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{graphicx}
\title{{project_title}}
\author{[Author Name]}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}
{Project description from PROJECT.md -- placeholder for user to refine}
\end{abstract}
\section{Introduction}
% Generated scaffold -- fill in motivation and context
\section{Methods}
% Generated from phase descriptions and approaches
{For each completed phase:}
\subsection{Phase {N}: {Name}}
{One-liner description}
\subsubsection{Key Results}
\begin{itemize}
{key results as \item entries}
\end{itemize}
{Equations as \begin{equation} blocks}
\section{Results}
% Aggregate key findings across all phases
\section{Discussion}
% Placeholder for interpretation
\section{Conclusion}
% Placeholder for summary
\appendix
{For each phase with detailed derivations:}
\section{Phase {N}: {Name} -- Derivation Details}
{Detailed derivation content from SUMMARY.md}
\begin{center}
{\footnotesize\textit{Generated with Get Physics Done (PSI)}}
\end{center}
\end{document}
Also write exports/results.bib if any citations found in SUMMARY files.
**If format is `zip` or `all`:**
Collect all exportable files:
- All scripts (
*.py, *.jl, *.m, *.nb) from completed phase directories
- All data files (
*.csv, *.json, *.dat, *.h5) from completed phase directories
- All SUMMARY.md files
- PROJECT.md and ROADMAP.md
- VERIFICATION.md files
Write exports/README.md:
# {project_title} -- Reproducibility Package
## Contents
- `scripts/` -- Computation scripts by phase
- `data/` -- Output data files by phase
- `summaries/` -- Research summary for each plan
- `PROJECT.md` -- Project description and conventions
- `ROADMAP.md` -- Research phase structure
## Phase Index
{Table: phase number, name, status, scripts included, data included}
## Reproduction Instructions
{For each phase with scripts: how to run them, dependencies, expected outputs}
## Generated
Date: {YYYY-MM-DD}
Attribution: Generated with Get Physics Done (PSI)
Copy collected files into the exports directory structure:
mkdir -p exports/scripts exports/data exports/summaries
cp .gpd/PROJECT.md exports/PROJECT.md 2>/dev/null
cp .gpd/ROADMAP.md exports/ROADMAP.md 2>/dev/null
Create the ZIP:
cd exports && zip -r results.zip README.md scripts/ data/ summaries/ PROJECT.md ROADMAP.md 2>/dev/null
If no zip utility available, create a tar.gz instead:
cd exports && tar -czf results.tar.gz README.md scripts/ data/ summaries/ PROJECT.md ROADMAP.md 2>/dev/null
**Present export summary:**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GPD > EXPORT COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Project:** {project_title}
**Phases exported:** {N} completed phases
**Formats:** {list of formats generated}
| File | Size | Format |
|------|------|--------|
| exports/results.html | {size} | HTML + MathJax |
| exports/results.tex | {size} | LaTeX |
| exports/results.bib | {size} | BibTeX |
| exports/results.zip | {size} | ZIP package |
### Notes
- **HTML:** Open in any browser. Equations render via MathJax (requires internet).
- **LaTeX:** Compile with `pdflatex results.tex`. Fill in [Author Name] and placeholder sections.
- **ZIP:** Self-contained reproducibility package with README.
───────────────────────────────────────────────────────────────
**Also available:**
- `$gpd-write-paper` -- draft a full paper from research results
- `$gpd-progress` -- check research progress
───────────────────────────────────────────────────────────────
**Commit text-based exports (not binary archives):**
Commit the HTML and LaTeX exports. Do NOT commit ZIP/tar.gz archives (binary artifacts that bloat git).
COMMIT_FILES=()
for path in exports/results.html exports/results.tex exports/results.bib; do
if [ -f "$path" ]; then
COMMIT_FILES+=("$path")
fi
done
if [ ${#COMMIT_FILES[@]} -gt 0 ]; then
PRE_CHECK=$(/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local pre-commit-check --files "${COMMIT_FILES[@]}" 2>&1) || true
echo "$PRE_CHECK"
/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local commit \
"docs: export research results" \
--files "${COMMIT_FILES[@]}"
else
echo "No text exports generated; nothing to commit."
fi
The commit CLI respects commit_docs from config internally — if disabled, the commit is automatically skipped.
<anti_patterns>
- Don't export incomplete phases -- only include phases with at least one SUMMARY.md
- Don't hardcode MathJax version -- use latest CDN URL
- Don't skip the verification summary -- collaborators need to know what's validated
- Don't include raw planning artifacts (PLAN.md, RESEARCH.md) in exports -- those are internal
- Don't overwrite existing exports without noting it
- Don't generate empty sections -- omit sections with no content
- Don't commit ZIP/tar.gz archives to git -- they are binary artifacts
</anti_patterns>
<success_criteria>
Export is complete when:
</success_criteria>
</execution_context>
Format: $ARGUMENTS (optional -- if not provided, ask user)
@.gpd/PROJECT.md
@.gpd/ROADMAP.md
@.gpd/STATE.md
Execute the export workflow from @./.codex/get-physics-done/workflows/export.md end-to-end.
Step 1: Load Project Context
Read PROJECT.md, ROADMAP.md, and all SUMMARY.md files from completed phases.
Step 2: Determine Format
Parse --format from $ARGUMENTS. If not specified, ask user.
Step 3: Generate Export
Route to appropriate generator (html, latex, zip, or all).
Step 4: Write Output
Write files to exports/.
Step 5: Report
Display file locations, sizes, and instructions for each format.
<success_criteria>