| # Contributing to LifeStack |
|
|
| This document defines the **documentation rule** for the project. |
| **Nothing ships without its matching doc entry.** |
|
|
| --- |
|
|
| ## The Rule: Doc-First Development |
|
|
| Every change that adds, removes, or significantly modifies a feature must include |
| **all three** of the following before the commit is made: |
|
|
| | # | Action | Where | |
| |---|---|---| |
| | 1 | **Create or update a doc file** | `docs/<topic>.md` | |
| | 2 | **Update README.md** | File Structure table + relevant section | |
| | 3 | **Update `docs/INDEX.md`** | Add a one-line entry for the new doc | |
|
|
| > [!IMPORTANT] |
| > A pull request / commit that adds a new script, module, or feature **without** |
| > updating `docs/INDEX.md` and `README.md` is considered incomplete and should |
| > not be merged. |
|
|
| --- |
|
|
| ## What Counts as "a Feature" |
|
|
| | Change type | Doc required? | |
| |---|---| |
| | New Python module (`core/`, `agent/`, `intake/`) | β
Yes β `docs/<module>.md` | |
| | New script (`scripts/*.py`) | β
Yes β entry in `docs/scripts.md` | |
| | New Gradio tab in `app.py` | β
Yes β entry in `docs/app.md` | |
| | New CLI argument to an existing script | β
Yes β update relevant doc | |
| | Bug fix with no API surface change | β No (but update changelog if breaking) | |
| | Refactor with no API surface change | β No | |
| | New environment variable / secret | β
Yes β update `docs/configuration.md` | |
| | New dependency in `requirements.txt` | β
Yes β note in relevant doc + README | |
|
|
| --- |
|
|
| ## Doc File Conventions |
|
|
| - All docs live in `docs/`. No `.md` files at repo root except `README.md` and this file. |
| - File names are lowercase with underscores: `docs/lifestack_env.md`, `docs/eval.md`. |
| - Each doc starts with a `# Title` h1 and a one-line summary. |
| - Use `## Overview`, `## Usage`, `## API / Parameters`, `## Examples` sections. |
| - Code blocks must have a language tag (` ```python `, ` ```bash `). |
|
|
| --- |
|
|
| ## Checklist (copy into every PR / commit message) |
|
|
| ``` |
| Docs checklist: |
| [ ] docs/<topic>.md created or updated |
| [ ] docs/INDEX.md updated with new entry |
| [ ] README.md File Structure table updated |
| [ ] README.md Quickstart / relevant section updated (if CLI changed) |
| ``` |
|
|
| --- |
|
|
| ## Docs Folder Structure |
|
|
| ``` |
| docs/ |
| βββ INDEX.md β Master index of all docs (ALWAYS update this) |
| βββ CONTRIBUTING.md β This file β the rule |
| βββ lifestack_env.md β core/lifestack_env.py reference |
| βββ reward.md β core/reward.py reference |
| βββ task.md β core/task.py schema reference |
| βββ memory.md β agent/memory.py reference |
| βββ conflict_generator.md β agent/conflict_generator.py reference |
| βββ app.md β app.py Gradio interface reference |
| βββ eval.md β scripts/eval.py reference |
| βββ train_trl.md β scripts/train_trl.md reference |
| βββ scripts.md β All other scripts reference |
| βββ configuration.md β Env vars, secrets, openenv.yaml |
| ``` |
|
|
| --- |
|
|
| ## Commit Message Format |
|
|
| ``` |
| <type>: <short description> |
| |
| - <file changed>: <what changed> |
| - docs/<doc>.md: <created|updated> |
| - docs/INDEX.md: <added entry for X> |
| - README.md: <updated section Y> |
| |
| Docs checklist: β
all three updated |
| ``` |
|
|
| Types: `feat` | `fix` | `refactor` | `docs` | `test` | `chore` |
|
|