Create Developer Guides (Blueprint)
This document serves as a general blueprint for creating developer guides across different project structures: R Packages, Python Projects, Documentation Projects, and Hybrid R/Python Projects.
A developer guide clarifies codebase structure, module boundaries, data routing, reactivity flow, and custom design patterns. It helps human maintainers and AI pair-programming agents understand how to extend and debug the system without introducing architectural drift.
In addition to a Developer Guide, a project would benefit from the following complementary files:
- R Package Developer Guide
- Python Developer Guide
- Documentation Developer Guide
- Hybrid R & Python Developer Guide
- Additional Pages
AGENTS.md: Repository-level systems instructions and agent skillsREADME.md: Repository overview and quick startDEVELOPER.md: Developer-facing architecture notes and whole-repo guidance
[!TIP] For a concrete case study of this blueprint applied to a mature R Shiny package, see the qtl2shiny Developer Guide Reference. For a hybrid R/Python package case study, see the
geyserdeveloper documentation.
R Package Developer Guides (Vignette-Based)
In mature R packages, developer guides are best placed as package vignettes (e.g., vignettes/DeveloperGuide.Rmd) so they render as part of the official package documentation (e.g., via pkgdown).
Directory Layout
my_package/
├── vignettes/
│ ├── DeveloperGuide.Rmd # Master developer guide index
│ └── devel/
│ ├── data_flow.Rmd # Detailed submodule guide
│ └── custom_plots.Rmd # Detailed plotting guide
├── _pkgdown.yml # Configures navigation bar
└── R/ # Package source code
Actionable Prompts
- Directory & Index Setup:
“Create a master developer guide vignette
vignettes/DeveloperGuide.Rmd(or.qmd). The guide should detail the high-level architecture of the package, including execution entrypoints and core dependencies. Provide an index of all.Rsource files and group them by function category (e.g., DB querying, data loading, plotting, UI panels). Document this creation process inprompts/devel_guide.md.” - Sub-module/Panel Details:
“Develop a detailed developer sub-guide in
vignettes/devel/module_name.Rmddescribingmodule_name. Document the inputs and outputs, reactive logic, data dependencies, and custom defensive checks. Include a Mermaid reactivity flow diagram if applicable.” - Internal Linking:
“Update
vignettes/DeveloperGuide.Rmdto link to the new sub-guidevignettes/devel/module_name.Rmdand ensure all file links are relative. Register the vignettes in the_pkgdown.ymlsite config so they are visible under the articles tab.”
Steps to Perform
- Analyze File Structure: Identify all source files in the
R/directory. Trace their dependencies and namespace exports. - Create Vignettes Directory: Ensure
vignettes/(and subdirectories likevignettes/devel/) exists. - Build the Prototype: Create a single sub-module guide (e.g.,
vignettes/devel/geno_module.Rmd) to serve as a format prototype. - Draft the Master Vignette: Create
vignettes/DeveloperGuide.Rmdwith high-level architecture, module categorization, layout descriptions, and utility mappings. - Add Sub-module Guides: Flesh out guides for remaining sub-modules, using the prototype as a blueprint.
- Compile and Verify: Run
devtools::build_vignettes()to compile andpkgdown::build_site()to verify website navigation and layout.
Python Project Developer Guides
Python developer guides are typically placed in docs/devel/ (e.g., docs/devel/python.md for website rendering via Quarto/MkDocs) or inside the Python package source directory (my_module/README.md) for package developers, anchored by a root DEVELOPER.md.
Directory Layout
my_project/
├── DEVELOPER.md # Root architecture & developer guide entrypoint
├── docs/
│ └── devel/
│ ├── python.md # Detailed Python Developer Guide (rendered on site)
│ └── environment_setup.md # Python environment & dependencies
├── tests/ # Test suite (pytest)
├── pyproject.toml / setup.py # Configuration and dependencies
└── my_module/ # Python package source code
└── README.md # Sub-directory developer reference inside Python package source
Actionable Prompts
- Initial Architecture Map:
“Inspect the python package
my_module/and map out the directory layout and core execution pathways (e.g., entrypoint__main__.pyor class interfaces). Create a developer guide indocs/developer_guide.mddetailing how classes interact and outline data processing pipelines.” - Setup and Testing Instructions:
“Draft
docs/environment_setup.mdcontaining detailed commands to configure the python virtual environment (using venv, conda, or poetry), install developer dependencies, and execute the test suite via pytest. Note how code linting (ruff, black, flake8) is configured.” - API & Extension Guide:
“Write documentation on how to extend the module. Outline class hierarchy interfaces (e.g., adding a new database engine or plot format) and define rules for code standards (e.g., docstrings style, type hints).”
Steps to Perform
- Source Discovery: Run
find my_module -name "*.py"to map out files and subdirectories. - Trace Class Interfaces: Inspect imports and inheritance relationships to map out object-oriented structures.
- Create Environment Reference: Document dependencies defined in
pyproject.toml,setup.py, orrequirements.txt. - Draft the Developer Guide: Structure the files into Overview, Class/Module Architecture, Testing Workflows, and Extension Guidelines.
- Code Style Definitions: Detail constraints around docstring formats (Google, NumPy, Sphinx style) and type hinting protocols.
Documentation Projects
For projects whose main deliverable is documentation (such as a Quarto book, Jupyter Book, or Just-the-Docs Jekyll site), the developer guide details site layout, configuration variables, page metadata, navigation structures, and automated checks.
Directory Layout
documentation_site/
├── guides.md # Navigation to user and developer guides
├── AGENTS.md # Project-level constraints for AI agents
├── _config.yml / _quarto.yml # Site config files
├── index.md / README.md # Landing / index page
└── scripts/
└── check_links.py # Automated link-validation scripts
Actionable Prompts
- Site Layout Documentation:
“Map out the site’s folder hierarchy and page navigation in a root
guides.mdfile. Explain the purpose of key configuration files like_config.ymlor_quarto.ymland how the side navigation menu is generated.” - Metadata & Writing Conventions:
“Add rules to the top-level developer index or
AGENTS.mdspecifying frontmatter metadata standards (e.g.,title,parent,nav_order, andpermalink). Establish conventions for markdown headers, cross-references, and slide inclusions.” - Automation & Link Validation:
“Create documentation in
prompts/check_links.mdon how to run automated link verification scripts. Outline how to identify and prune broken internal relative links and external web URLs before publishing.”
Steps to Perform
- Identify Configuration Entrypoints: Map YAML configuration properties to the resulting website structure (navigation menus, page hierarchies).
- Define Frontmatter Conventions: List required frontmatter elements for new pages to ensure correct layout and theme mapping.
- Setup Link-Check Tools: Implement automated checks (e.g., python or bash scripts) to parse markdown links and identify 404s.
- Write guides.md / AGENTS.md: Combine rules, templates, and procedures into readable documents for future editors and AI agents.
Hybrid R & Python Projects
In research repositories (like geyser or landmapyr), R and Python code often sit side-by-side. The developer guide must reconcile both ecosystems, outlining boundaries and interfaces.
Dual-Housing Documentation Strategy
Based on experience with the geyser package, hybrid repositories succeed by adopting a multi-tiered documentation and publishing strategy:
- Root Repository Guide (
DEVELOPER.md):- Primary entry point for developers of the overall project.
- Documents shared architecture, cross-language module mappings (e.g., R 5-function modules vs Python
@module.ui/@module.server), execution entry points, setup commands (devtools::load_all()andpip install -e .), port discovery, and reserved file patterns. - Links out to ecosystem-specific sub-guides.
- R Package Sub-Guide (
vignettes/DeveloperGuide.Rmd):- Master vignette for R package compilation (
devtools::build_vignettes()) andpkgdown/ Quarto site rendering. - Focuses on R reactive flow, S3/S4 object structures, and R Shiny module patterns.
- Master vignette for R package compilation (
- Python Package Sub-Guide (
docs/devel/python.md&my_module/README.md):- Housed in
docs/devel/python.mdfor web/Quarto site rendering (byandell.github.io/<project>). - Housed in
my_module/README.mdas an in-source developer reference for Python package developers. - Focuses on Python reactivity, async loops, Shinylive WebAssembly build flows, and
rpy2/ dataframe data exchange.
- Housed in
- Planning & Execution Record (
guides.md):- Consolidates initial blueprint prompts, the implementation plan, and the execution walkthrough for auditability and pair-programming context.
- Website Publishing & Dual-Linking:
- Registers all developer guides (
DEVELOPER.md,vignettes/DeveloperGuide.Rmd,docs/devel/python.md) in site render configurations (e.g.,_quarto.yml). - Integrates a Developer Guides dropdown menu into the website navbar linking to all three guides.
- Provides dual links in
README.mdto both the published website pages and the raw GitHub source code files.
- Registers all developer guides (
Directory Layout
hybrid_project/
├── DEVELOPER.md # Root architecture index & hybrid guide (both R & Python)
├── README.md # Repository overview & quickstart (links to DEVELOPER.md)
├── guides.md # Consolidated blueprint prompts, plan, and walkthrough
├── R/ # R package source code
├── vignettes/ # R-centric Vignettes
│ └── DeveloperGuide.Rmd # Master R developer guide vignette
├── my_module/ # Python package source code
│ ├── README.md # Python package sub-directory developer reference
│ └── io.py, hist.py, etc. # Python package modules
└── docs/ # Documentation & Quarto / MkDocs Website
└── devel/ # Extended sub-guides directory
└── python.md # Detailed Python Developer Guide (rendered on site)
Actionable Prompts
- Bridge Architecture Map:
“Create a root
DEVELOPER.mddescribing how the R and Python components cooperate. Trace the communication boundaries (e.g.,reticulate,rpy2, subprocess calls, REST APIs, or shared SQLite/Parquet files). Provide a side-by-side R and Python module cross-reference table mapping equivalent features across ecosystems.” - Dual-Environment Configuration:
“Create environment guides mapping out how to bootstrap both R and Python environments on a local machine. Document installation commands (
devtools::load_all()for R andpip install -e .for Python) and dependency declarations.” - Shared Data & API Schemas:
“Document data structures shared between R and Python code. Define SQLite database schemas, HDF5 hierarchies, or Parquet column schemas, detailing validation checks on both sides (e.g.,
pandas.DataFrameand Rdata.frameconversion rules).” - Site Publishing & Navbar Integration:
“Configure site render targets (e.g., in
_quarto.ymlor_pkgdown.yml) to compileDEVELOPER.md,vignettes/DeveloperGuide.Rmd, anddocs/devel/python.mdinto published HTML site pages. Add a ‘Developer Guides’ dropdown menu to the website navbar and updateREADME.mdwith side-by-side links to both published site pages and GitHub source code.”
Steps to Perform
- Establish Root Entry Point: Create
DEVELOPER.mdin the repository root as the master developer guide indexing both R and Python architectures. - Implement R Vignette Guide: Draft
vignettes/DeveloperGuide.Rmdto document R package modules and integration withpkgdown/Quarto. - Implement Python Sub-Guides:
- Create
docs/devel/python.mdfor site documentation (e.g., Quarto). - Create
my_module/README.mdwithin the Python source folder for direct developer reference.
- Create
- Define Dual-Testing Workflows: Outline execution scripts that run both
pytestanddevtools::testas part of verification. - Coordinate Shared Data Schemas & Planning: Formulate explicit specifications for exchange file formats (CSV, Parquet, SQLite) and maintain a
guides.mdfile recording initial prompts, implementation plan, and completion walkthrough. - Publish & Integrate Navbar Navigation: Add developer guide files to the site build targets (
_quarto.yml), configure a Developer Guides navbar dropdown menu, and updateREADME.mdwith dual links (Published Page + GitHub Source).