Skip to content
Public template

About

Reproducible research publishing template for Python research projects: a declared pipeline, canonical exemplars, and multi-format outputs.

Topics

Resources

Contributing

Security policy

Accessibility

Stars

25 stars

Watchers

0 watching

Forks

Latest commit

 

History

3,481 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🚀 Research Project Template

Release line: 5.2.0. See the release notes and acceptance/publication boundary. This coordinated minor preparation preserves exemplar own versions and historical tags. Final publication outputs, measured coverage and the complete exact-source acceptance handoff must precede the matching tag and release. Candidate metadata does not establish acceptance or publication.

Build Coverage Tests Documentation DOI

📄 Publication reference: A template/ approach to Reproducible Generative Research: Architecture and Ergonomics from Configuration through Publication — declared DOI: 10.5281/zenodo.19139090. This reference does not establish availability of the prepared 5.2.0 release.

Template Repository - Click "Use this template" to create a research project with this structure

graph TB
    subgraph "Two-Layer Architecture (Infrastructure → Project)"
        INFRA["Infrastructure<br/>infrastructure/"] --> |"provides tools"| PROJECT["Project Code<br/>projects/&lt;qualified-name&gt;/src/"]
        PROJECT --> |"imported by"| SCRIPTS["Scripts<br/>projects/&lt;qualified-name&gt;/scripts/"]
        SCRIPTS --> |"generate"| WORKING["Working outputs<br/>projects/&lt;qualified-name&gt;/output/"]
        WORKING --> |"copy stage"| OUTPUTS["Final deliverables<br/>output/&lt;qualified-name&gt;/"]
        TESTS["Tests<br/>tests/ and per-project tests/"] --> |"validate"| PROJECT
        MANUSCRIPT["Manuscript<br/>projects/&lt;qualified-name&gt;/manuscript/"] --> |"references"| WORKING
    end

    subgraph "Core Pipeline (--mode core)"
        direction LR
        P_SETUP["Setup<br/>stage_00_setup.py"] --> P_TESTS["Tests<br/>stage_01_test.py"]
        P_TESTS --> P_ANALYSIS["Analysis<br/>stage_02_analysis.py"]
        P_ANALYSIS --> P_RENDER["Render<br/>stage_03_render.py"]
        P_RENDER --> P_VALIDATE["Validate<br/>stage_04_validate.py"]
        P_VALIDATE --> P_COPY["Copy<br/>stage_05_copy.py"]
    end

    SCRIPTS -.-> |"orchestrated by"| P_ANALYSIS
    P_COPY -.-> |"publishes"| OUTPUTS

    classDef core fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#0f172a
    classDef pipeline fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px,color:#0f172a
    classDef output fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#0f172a
    class INFRA,PROJECT,SCRIPTS,TESTS,MANUSCRIPT core
    class P_SETUP,P_TESTS,P_ANALYSIS,P_RENDER,P_VALIDATE,P_COPY pipeline
    class WORKING,OUTPUTS output
Loading

Quickstart

Install Git and uv before starting. The root lock uses Python 3.14 by default. For the PDF example, prepare Pandoc, pandoc-crossref and XeLaTeX using the system prerequisites.

  1. git clone https://github.com/docxology/template && cd template
  2. uv sync --locked (installs the declared root environment; independent project runtimes retain their own locks)
  3. ./run.sh (interactive menu) or ./run.sh --pipeline --project templates/template_code_project --mode core (non-interactive, no LLM)
  4. PDFs land in output/templates/<project>/pdf/. Logs in output/templates/<project>/logs/.
  5. Run ./run.sh --help for all flags. The always-present roster is generated from PUBLIC_PROJECT_NAMES in infrastructure/project/public_scope.py and published in docs/_generated/active_projects.md.

Prepare the selected project's declared runtime and system rendering tools before dispatch; use the startup and setup guide and prepared-dispatch guide. Ordinary run.sh dispatch uses an already prepared Root interpreter; it never installs uv or syncs dependencies as a fallback.

Repurposing for your research? See docs/repurposing-architectures.md — maps every reusable architecture (DAG pipeline, two-layer separation, evidence registry, multi-format rendering, MCP server, publishing stack) to its module and adoption path.

For deeper guidance see docs/guides/getting-started.md and docs/RUN_GUIDE.md.

Thin-orchestrator gates: after locked preparation, use .venv/bin/python scripts/audit/check_template_drift.py --strict, .venv/bin/python scripts/gates/module_line_count_check.py, and .venv/bin/python -m infrastructure.core.health — details in docs/architecture/thin-orchestrator-summary.md.

Fast local test loop: after locked preparation, run the high-signal subset (.venv/bin/python -m pytest tests/infra_tests/git_hook_smoke tests/infra_tests/core/test_pytest_orchestration.py tests/infra_tests/core/test_pipeline.py -q) — see docs/operational/config/performance-optimization.md. Required CI Gate owns ordinary PR admission; complete Root/native acceptance is a separate release requirement, not the local edit loop.

Assistants and editors: start with AGENTS.md for the repository contract and .agents/AGENTS.md for shared catalogs, workflows and local memory. CLAUDE.md remains a command cheat sheet. For routable agent workflows, start at docs/prompts/SKILL.md and the generated skill index docs/_generated/skills_index.md.

Contributors and CI: GitHub Actions, Dependabot, and PR/issue templates live under .github/GITHUB.md (agent entry point, doc map, CI inventory) and .github/AGENTS.md (job names, thresholds, troubleshooting).

For ordinary CI's shared exact-Source preparation DATA and independent project feedback, see Fast functional CI. Preparation reuse does not supply hosted test results, complete Root/native acceptance, or release authorization.

Local hooks: After uv sync, run pre-commit install and pre-commit install --hook-type pre-push to mirror Ruff, mypy, Bandit, and smoke tests locally (see .pre-commit-config.yaml).

Strict Mermaid/PDF checks: Use Node 24 and the exact npm version declared by packageManager in package.json, then run npm ci at the repository root. The Python documentation and rendering gates automatically resolve the pinned node_modules/.bin/mmdc; add that directory to PATH only when invoking mmdc directly. The existing Chrome resolver supplies the browser executable.

A system for research and development projects. This template provides a test-driven structure with automated PDF generation, professional documentation, and validated build pipelines.

🧭 Positioning (honest framing)

This is primarily Daniel Ari Friedman's research operating system, made public and Apache 2.0-licensed so other researchers can fork it if helpful. It is not a one-size-fits-all template — it is opinionated, Python+pytest+LaTeX-flavored, and tuned to the kind of work Daniel does (Active Inference, computational biology, cognitive security). Honest framing ages better than wishful adoption metrics.

If your workflow looks similar (TDD-on-research-code, Markdown→PDF, multi-project monorepo, optional local-LLM draft assistance, deterministic + watermarked outputs, Zenodo DOI publishing), the template will probably save you time. If it doesn't look similar, a lighter alternative (Quarto, MyST, Cookiecutter-data-science) may serve you better. See MAINTAINERS.md for ownership and STATUS.md for per-subsystem freshness so you can judge what's actively maintained vs dormant.

Long-horizon viability guides — toolchain migration, regression testing, archival redundancy, local CI, and the design for a future executable-bundle stage — live in docs/maintenance/.

🎯 What This Template Provides

This is a GitHub Template Repository that gives you:

  • ✅ Multi-project support - Run multiple projects in one repository
  • ✅ Project structure with clear separation of concerns
  • ✅ Test-driven development setup with coverage requirements
  • ✅ Automated PDF generation from markdown sources
  • ✅ Opt-in accessible presentation composition with transactional Beamer/Reveal pairs, projection-scale typography, semantic splitting, and fail-closed density diagnostics
  • ✅ Thin orchestrator pattern for maintainable code
  • ✅ Methods orchestration linking pipeline contracts, methods prose, artifacts, and evidence
  • ✅ Executable methods contracts with DAG, script, artifact, and verification validation
  • ✅ Bounded parallel quick testing with isolated project processes and serial oracles
  • ✅ Public exemplar capability inventory covering structure and declared skip reasons
  • ✅ Ready-to-use utilities for any research project
  • ✅ Professional documentation structure (full inventory: docs/documentation-index.md)
  • ✅ Advanced quality analysis and document metrics
  • ✅ Reproducibility tools for scientific workflows
  • ✅ Integrity verification and validation
  • ✅ Publishing tools for academic dissemination
  • ✅ Scientific development best practices
  • ✅ Reporting with error aggregation and performance metrics
  • ✅ Local Ollama workflow documented in infrastructure/llm/README.md and docs/operational/troubleshooting/llm-review.md

🗺️ Choose Your Path

Pick the entry point that matches your goal:

🧭 Documentation Hub

📚 Documentation Index | 📖 Documentation Guide | 🔍 Quick Reference

The infrastructure manuscript describes the root repository’s architecture, render pipeline, and verification evidence. It includes a local render walkthrough.

The template ships with a large documentation corpus under docs/. The hierarchical map (with mermaid diagram) lives in docs/AGENTS.md; the curated long-lived documentation map lives in docs/documentation-index.md. Generated rosters and measured facts remain authoritative for their own scopes; do not rely on a hard-coded file count, which drifts. Top-level layout:

  • docs/core/ — essential reading: how-to-use, architecture, workflow
  • docs/guides/ — progressive walkthroughs by skill level (1–12)
  • docs/operational/ — build, configuration, troubleshooting, performance
  • docs/reference/ — FAQ, cheatsheet, common workflows, API reference
  • docs/architecture/ — two-layer architecture, thin orchestrator, decision tree
  • docs/usage/ — examples, showcase, markdown writing guide
  • docs/modules/ — module-by-module guides
  • docs/development/ — contributing, testing, roadmap

🤖 Agentic operation and SKILLS

Agents should load the smallest applicable workflow before editing. The routing surface is first-class and available via two skill discovery channels:

Hermes / agentskills.io project-local skills

Every canonical exemplar under projects/templates/ now ships its own .agents/skills/<name>/SKILL.md with YAML frontmatter discoverable by Hermes and agentskills.io runtimes. Each skill captures when to use, quick reference (pytest / analysis / render commands), pitfalls, and cross-refs for that template. Load the skill by its name (e.g. template-code-project, template-active-inference) when working inside that exemplar.

Skill Template When to load
template-active-inference template_active_inference Use this template when several independent research tracks must compose into one manuscript whose claims stay consistent where the tracks overlap — here: a closed-form analytical oracle, a pymdp simulation harness, a Lean formalization boundary, and shared GNN/ontology notation.
template-advanced-literature-review template_advanced_literature_review Use this template when one review question needs distinct retrieval phases, phase-specific filters, and explicit cross-phase provenance.
template-autoresearch-project template_autoresearch_project Use this template when you need a bounded, offline AutoResearch loop: deterministic ML candidate evaluation over a fixed local dataset, with evidence-linked claims, machine-readable ledgers, artifact-integrity manifests, and deferred human-review gates.
template-autopoiesis template_autopoiesis Use this template when you need to generate runnable project trees deterministically: a child project with analysis.py, primitives/, tests/, and manuscript/, selected by a seed and explicit grammar filters.
template-code-project template_code_project Use this template for code-driven computational research: algorithms in src/, numerical experiments with deterministic seeds, automated publication-quality figures, and a manuscript that reports the computed results.
template-data-descriptor template_data_descriptor Use this template when the contribution is a published dataset or data paper: a schema contract, file inventory, data dictionary, provenance chain, license boundary, quality checks, and machine-readable descriptor must all stay consistent before publication.
template-eda-notebook template_eda_notebook Use this template for exploratory data analysis on tabular data: load a dataset, surface missingness, compute descriptive statistics and per-group means, rank features by correlation, and produce a few diagnostic figures.
template-experiment-tree template_experiment_tree Use template_experiment_tree when the deliverable is a research log that stays honest over months: you want planned, preregistered, and answered experiments in one durable tree, negative results registered (not buried), and a manuscript that regenerates from the tree instead of drifting from it.
template-formal template_formal Use this template when the research subject is the type architecture itself: illegal-state-unrepresentable design, session-typed protocols, affine/linear resource-handle discipline, or a decentralized (no-shared-global-state) multiagent simulation that needs its own local storage and local networking per agent.
template-literature-meta-analysis template_literature_meta_analysis Use it whenever the research object is a body of literature about a topic and you want every reported number to trace to committed, regenerable artifacts.
template-madlib template_madlib Use this template when you need configuration-driven manuscript generation with auditable token provenance, conditional section structure, explicit/default field visibility, failure-boundary reporting, and a reviewer-visible authoring contract: lexicon categories, section titles, narrative moves, method steps, design principles, pipeline phases, evaluation criteria, QA probes, failure modes, authoring obligations, visualization controls, audit rules, and slots are declared in YAML; src/ deterministically expands those declarations; and the manuscript receives large-grain {{TOKEN}} bodies only after the source code has generated the supporting artifacts.
template-newspaper template_newspaper Use this template when you need data-driven, large-format print layout: multi-page broadsheets/tabloids with precise column geometry, typography-first constraints, and strict content/engine separation (YAML editions in content/, pure-Python ReportLab engine in src/).
template-pools-rules-tools template_pools_rules_tools Use this project when you need to: - Demonstrate how a research project integrates multiple resource directories (fonds, tools, rules) in a single pipeline - Validate that your fonds, tools, and rule infrastructure modules are correctly wired and discoverable - Onboard new teams to the three-resource architecture with a concrete, runnable example - Test cross-cutting concern integration where fonds supply data, rules govern validation, and tools execute transforms - Extend the architecture by adding new resource types; copy this project as a starting point for integration testing This template is ideal for platform teams, CI engineers, and infrastructure maintainers who need a self-validating meta-project that exercises all three resource layers without coupling to a specific domain science.
template-prose-project template_prose_project Use this template for manuscript-focused editorial pipelines: readability gates (Flesch-Kincaid bands), structural checking, citation/BibTeX validation, and prose-quality review workflows where the document itself is the artifact under test.
template-autoscientists template_autoscientists Use this template when you need to isolate and measure agent-coordination mechanisms: coordinated teams vs single-thread baselines under matched budgets, deterministic ablation studies, and honest per-mechanism effect reporting (including nulls).
template-gold-refinement template_gold_refinement Use this template for analogical manuscript composition research: projects that map a scientific domain onto a refinement pipeline and generate the manuscript through deterministic mega-madlib token injection.
template-methods-paper template_methods_paper Use this template when the paper you are writing describes a methodology rather than reports results: a procedure, protocol, or specification language, where the contribution is the controlled vocabulary and its guarantees (dimensional safety, staged validation, deterministic compilation) rather than a numeric outcome.
template-redacted-report template_redacted_report Use this template when a report needs formal redaction before release: classification ceilings, source-control markings, redaction decisions, authority review, reviewer approvals, source-safe hash ledgers, residual-risk checks, mosaic-risk checks, and a public audit packet must be validated before any sanitized narrative is published.
template-registered-report template_registered_report Use this template when the core method is a registered report or preregistered replication: hypotheses, outcomes, exclusion rules, analysis plan, power or sensitivity rationale, deviation ledger, and confirmatory-versus-exploratory claim boundaries must be locked before results are interpreted.
template-search-project template_search_project Use this template for literature-review and evidence-synthesis pipelines: multi-backend search (arXiv, Crossref, local corpora, optional Paperclip), deduplication, BibTeX generation, and LLM-assisted per-paper and corpus-level synthesis.
template-sia template_sia Use this template when you need a self-improvement-agent evaluation harness: Meta → Target → Feedback generation loops, public/private task splits to detect overfitting, deterministic fixture replay for testability, and fail-closed loop validation.
template-storybook template_storybook Use this template when you need full-page illustrated PDF storytelling: picture-book pages, symbolic scenes, character-generation methods, page-level orchestrators, and deterministic raster art assembled into a print-ready PDF.
template-template template_template Use this template when your research subject is the repository itself — programmatic introspection of architecture, pipeline DAGs, module inventories, and security layers, rendered as a manuscript whose every metric is computed live (autopoietic: the paper regenerates itself from the code it describes).
template-textbook template_textbook Use this template for book-length manuscripts: units → chapters → labs → question banks declared in a single config.yaml, with auto-numbering, deterministic figure/diagram generation, and structural-contract tests that keep hundreds of pages from drifting.
template-pitch-deck template_pitch_deck Use this template when you need a pitch, grant report, or recurring stakeholder update treated as a build artifact — bound to live repository facts, validated for unresolved tokens and pitch-deck cliché, and regenerable byte-for-byte from source rather than hand-maintained in a proprietary slide tool.

Generated infrastructure skills

In addition to the project-local skills, the repo generates infrastructure-level SKILL.md files from live discovery: