Skip to content

Commit 93811de

Browse files
committed
docs: update documentation to reflect unified discovery-plan-execute lifecycle
1 parent 35e1d12 commit 93811de

5 files changed

Lines changed: 70 additions & 25 deletions

File tree

docs/deploy.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ To ensure full functionality, your environment should have:
4040

4141
- **Git:** Required for state management and change detection hooks.
4242
- **Node.js:** Necessary for running the `gemini` CLI.
43-
- **Python 3.10+:** Required for executing the project's automation hooks (`.gemini/hooks/`).
44-
- **Make:** Used for project validation and health checks.
43+
- **Python 3.12+:** Required for executing the project's automation hooks (`.gemini/hooks/`).
44+
- **uv:** The required Python package and project manager.
45+
- **Make:** Used for project validation and health checks (runs `uv run pytest`).
4546

4647
### Installing Git Hooks
4748

docs/design.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,30 @@ Helper scripts that standardize framework operations across different environmen
3232

3333
### 3. The Command System (`.gemini/commands/`)
3434

35-
Commands define structured, multi-phase workflows that automate the development lifecycle. Each command is a TOML file containing specific instructions and context for the agent.
35+
Commands define structured, multi-phase workflows that automate the development lifecycle. They are strictly categorized by their role in the Unified Lifecycle Flow.
3636

37-
- **`/plan`:** An interactive workflow that transitions between clarification, analysis, and strategy generation.
38-
- **`/research`:** A deep-dive exploration that produces exhaustive reports in the `research/` directory.
39-
- **`/debug`:** Activates a **forensic investigation mode** using a scientific, hypothesis-driven workflow.
37+
#### Phase 1: Discovery & Audit (Read-Only)
38+
- **`/research`:** Deep-dive exploration producing exhaustive Markdown reports.
39+
- **`/maintenance`:** A non-destructive codebase audit generating a 'Maintenance Report Card'.
40+
- **`/review`:** A multi-phase linguistic and structural audit of a document, producing a sidecar `.review.md` file.
41+
- **`/debug`:** A scientific, hypothesis-driven forensic investigation ending in a Root Cause Analysis (RCA) report.
4042
- **`/learn`:** A grounded learning lifecycle for mastering new technologies and codifying them into project skills.
41-
- **`/document`:** Analyzes the codebase and project state to update the documentation suite.
43+
44+
#### Phase 2: Strategy (The Bridge)
45+
- **`/plan`:** The mandatory bridge. An interactive workflow that transitions between clarification, analysis of discovery artifacts, and strategy generation. It produces a persistent Markdown plan in `plans/`.
46+
47+
#### Phase 3: Execution (Side-Effects)
4248
- **`/task`:** The primary execution engine, managing `TASKS.md` and enforcing the **strict TCR (Test-Commit-Revert) loop** and feature branch isolation.
49+
- **`/draft`:** The content execution engine, transforming plans or `.review.md` reports into finished Markdown documents.
50+
- **`/document`:** Analyzes the codebase and project state to update the documentation suite.
51+
52+
### 🔄 The Unified Lifecycle Flow
53+
54+
The framework enforces a strict architectural boundary between discovering what to do and actually doing it. Data flows unidirectionally:
55+
56+
1. **Artifact Generation:** Discovery commands (`/maintenance`, `/review`, `/debug`) create read-only artifacts (`research/`, `*.review.md`).
57+
2. **Strategy Synthesis:** The `planner` agent ingests these artifacts via the `/plan` command to generate an actionable, step-by-step roadmap.
58+
3. **Execution Routing:** The verified plan is handed off to the appropriate execution command (`/task` for logic, `/draft` for prose).
4359

4460
### 🔍 Deep Dive: Scientific Debugging
4561

docs/develop.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,33 @@ The **Gemini CLI Opinionated Framework** enforces a high-discipline development
44

55
## 🔄 The Mandatory Workflow Lifecycle
66

7-
Every non-trivial change must follow this strict four-phase process:
7+
Every non-trivial change must follow this strict three-phase process:
88

9-
### 1. Research & Analysis
9+
```text
10+
[Phase 1: Discovery] -> [Phase 2: Strategy] -> [Phase 3: Execution]
11+
(Audit/Research) (Planning Bridge) (Tasks/Drafting)
12+
```
13+
14+
### 1. Discovery & Audit (Read-Only)
15+
16+
Before proposing a change, you must gather context and identify risks. Use the specialized discovery commands:
17+
- **`/research`**: For domain knowledge and external libraries.
18+
- **`/maintenance`**: To audit the codebase for technical debt.
19+
- **`/debug`**: To perform a root-cause analysis (RCA) on a bug.
20+
- **`/review`**: To audit a document's structure and prose.
1021

11-
Before proposing a change, use the `/research` command to gather context, analyze the current codebase, and identify potential risks.
22+
*Crucially, these commands are read-only; they produce artifacts (`research/`, `*.review.md`), not code changes.*
1223

13-
### 2. Strategic Planning
24+
### 2. Strategic Planning (The Bridge)
1425

15-
A feature is not considered "active" until a persistent Markdown plan has been created in the `plans/` directory. Use the `/plan` command to generate this strategy and synchronize it with `TASKS.md`.
26+
A feature or fix is not considered "active" until a persistent Markdown plan has been created in the `plans/` directory. Use the `/plan` command to synthesize the artifacts generated in Phase 1 into an actionable strategy, and synchronize it with `TASKS.md`.
1627

17-
### 3. Execution & Validation (The TCR Protocol)
28+
### 3. Execution & Validation (Side-Effects)
1829

19-
The `/task` command is the primary tool for repository execution. It supports multiple actions to manage the project roadmap:
30+
Once a plan is approved, you move to execution. This is the **only** phase where files are modified.
2031

32+
#### For Code: The TCR Protocol
33+
The `/task` command is the primary tool for repository execution:
2134
- **`/task create`**: Adds a new task to `TASKS.md`.
2235
- **`/task work on ...`**: Implements a strict **TCR (Test-Commit-Revert)** protocol to ensure high-velocity, high-quality code.
2336
- **`/task report`**: Provides a summary of the roadmap and current priorities.

docs/index.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ The agent is mandated to challenge ideas before implementing them. It identifies
1616

1717
All significant work must be preceded or accompanied by a structured journal entry. The framework enforces this via a **timestamp-based pre-commit hook**, ensuring that the project's history is an accurate, human-and-AI-readable audit trail of intent and execution.
1818

19-
### 3. Strategy-First (Research -> Plan -> Execute)
19+
### 3. Strategy-First (Discovery -> Plan -> Execute)
2020

21-
Every non-trivial change follows a strict, non-negotiable lifecycle. The agent first researches the domain, proposes a detailed implementation plan, obtains user approval, and only then begins writing code. This is enforced by the **TCR (Test-Commit-Revert)** protocol, ensuring a "Green-only" development path.
21+
Every non-trivial change follows a strict, non-negotiable lifecycle.
22+
1. **Discovery & Audit:** The agent first researches the domain (`/research`), audits the codebase (`/maintenance`, `/review`), or investigates bugs (`/debug`) without modifying anything.
23+
2. **Strategy:** A detailed implementation plan is proposed (`/plan`) based on discovery artifacts and requires user approval.
24+
3. **Execution:** Only then does the agent begin writing code (`/task`) or content (`/draft`). This is enforced by the **TCR (Test-Commit-Revert)** protocol, ensuring a "Green-only" development path.
2225

23-
### 3. Validation-as-Truth
26+
### 4. Validation-as-Truth
2427

2528
The `makefile` is the ultimate source of truth for project health. Automated hooks ensure that every agent action is followed by a validation run (linting, testing, formatting) to prevent regressions.
2629

27-
### 4. Task Isolation (Feature Branching)
30+
### 5. Task Isolation (Feature Branching)
2831

2932
All development work is strictly performed on dedicated, auto-generated feature branches. This keeps the `main` branch protected and always in a deployable state, while providing a clean, granular history for every task.
3033

@@ -52,7 +55,7 @@ curl -fsSL https://apiad.github.io/starter/install.sh | bash
5255

5356
1. **Onboarding:** Run `/onboard` to get a high-signal overview of the repository.
5457
2. **Scaffolding:** Use `/scaffold` to initialize new project components with modern tooling.
55-
3. **Iterative Development:** Follow the Research-Plan-Execute cycle for every feature.
58+
3. **Iterative Development:** Follow the Discovery -> Plan -> Execute cycle for every feature.
5659
4. **Quality Control:** Rely on the `make.py` hook to maintain codebase integrity.
5760
5. **Releasing:** Use `/release` to automate versioning, changelog updates, and git tagging.
5861

docs/user-guide.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ This framework solves this problem by enforcing three core principles:
1818

1919
---
2020

21-
## 🔍 The Discovery & Strategy Workflow
21+
## 🔍 Phase 1: Discovery & Audit
2222

23-
The most critical phase of any project occurs before you write a single line of code. This framework moves away from impulsive execution toward a deliberate, architected approach.
23+
The most critical phase of any project occurs before you write a single line of code. This phase uses read-only commands to gather information safely.
24+
25+
### `/research`
26+
27+
Your tool for deep domain exploration.
28+
- **How it works:** Gathers documentation and synthesizes it into `research/` reports.
2429

2530
### `/debug`
2631

@@ -29,6 +34,12 @@ Your primary tool for forensic, scientific investigation.
2934
- **How it works:** When a bug is detected, the `/debug` command implements a principled approach to problem-solving using the specialized `debugger` subagent. It moves through four distinct phases: Context Analysis, Hypothesis Formulation, Isolated Testing on a temporary branch (`debug/hyp-*`), and finally a Synthesis of the findings into a **Root Cause Analysis (RCA)** report.
3035
- **Why it works:** It forces the agent to identify the root cause *before* attempting a fix, preventing "guess-and-check" coding that can lead to regressions.
3136

37+
---
38+
39+
## 🌉 Phase 2: Strategy & Planning
40+
41+
Once you have gathered discovery artifacts, you must synthesize them into an actionable strategy.
42+
3243
### `/plan`
3344

3445
Your tool for internal strategy and architectural design.
@@ -54,7 +65,7 @@ Your tool for rapid project orientation.
5465

5566
---
5667

57-
## 💻 The Software Development Workflow
68+
## 🚀 Phase 3: Execution & Implementation
5869

5970
Once you have a solid strategy in `plans/`, you can move into execution. These commands eliminate the friction of context-switching between your IDE and terminal.
6071

@@ -91,13 +102,14 @@ Automates the deployment process.
91102

92103
## 🔄 A Full Feature Development Walkthrough
93104

94-
A complete, principled development cycle follows the **Research -> Plan -> Execute** lifecycle.
105+
A complete, principled development cycle follows the **Discovery -> Plan -> Execute** lifecycle.
95106

96-
### **Step 1: Research with `/research`**
107+
### **Step 1: Discovery with `/research`, `/maintenance`, or `/review`**
97108

98-
You are integrating a new authentication library. You start by researching the technical requirements.
109+
Before acting, you must gather context. For example, if you are integrating a new authentication library, you start by researching the technical requirements.
99110

100111
- The `researcher` subagent gathers documentation and synthesizes it into `research/auth-library-deep-dive.md`.
112+
- Alternatively, you might run `/maintenance` to audit the codebase or `/review` to audit a document. In all cases, a read-only artifact is produced.
101113

102114
### **Step 2: Strategy with `/plan`**
103115

0 commit comments

Comments
 (0)