Skip to content

Commit 6c328de

Browse files
committed
docs(core): document procedural task management and tier protocol
1 parent 7cb0e63 commit 6c328de

6 files changed

Lines changed: 66 additions & 7 deletions

File tree

.gemini/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@
99
"model": "gemini-3.1-pro-preview"
1010
}
1111
},
12+
{
13+
"match": {
14+
"overrideScope": "debugger"
15+
},
16+
"modelConfig": {
17+
"model": "gemini-3.1-pro-preview"
18+
}
19+
},
20+
{
21+
"match": {
22+
"overrideScope": "learner"
23+
},
24+
"modelConfig": {
25+
"model": "gemini-3.1-pro-preview"
26+
}
27+
},
1228
{
1329
"match": {
1430
"overrideScope": "reviewer"

docs/design.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ Helper scripts that standardize framework operations across different environmen
3434

3535
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+
#### **Semantic Tier Routing (The Tier Protocol)**
38+
The framework implements a dual-tier model routing strategy to optimize for intelligence, cost, and execution speed. This is configured in `.gemini/settings.json` via `modelConfigs.overrides`.
39+
40+
- **The "Thinking" Tier (Clever/Pro):** High-reasoning agents (`planner`, `reviewer`, `learner`, `debugger`) are mapped to `gemini-3.1-pro-preview`. This ensures that architectural decisions, master-level learning, and forensic root-cause analysis are performed by the most capable models.
41+
- **The "Execution" Tier (Dumber/Lite):** High-volume, procedural agents (`writer`, `researcher`) are mapped to `gemini-2.5-flash-lite`. This provides high-velocity drafting and discovery without excessive context costs.
42+
3743
#### Phase 1: Discovery & Audit (Read-Only)
3844
- **`/research`:** Deep-dive exploration producing exhaustive Markdown reports.
3945
- **`/maintenance`:** A non-destructive codebase audit generating a 'Maintenance Report Card'.
@@ -45,7 +51,7 @@ Commands define structured, multi-phase workflows that automate the development
4551
- **`/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/`.
4652

4753
#### Phase 3: Execution (Side-Effects)
48-
- **`/task`:** The primary execution engine, managing `TASKS.md` and enforcing the **strict TCR (Test-Commit-Revert) loop** and feature branch isolation.
54+
- **`/task`:** The primary execution engine, managing `TASKS.md` and enforcing the **strict TCR (Test-Commit-Revert) loop** and feature branch isolation. **Procedural Task Management:** The `/task` command operates exclusively via `.gemini/scripts/task.py`, which acts as the single source of truth for the project roadmap.
4955
- **`/draft`:** The content execution engine, transforming plans or `.review.md` reports into finished Markdown documents.
5056
- **`/document`:** Analyzes the codebase and project state to update the documentation suite.
5157

@@ -87,6 +93,15 @@ The `pre-commit.py` hook implements a sophisticated cross-file validation strate
8793
3. **Audit Trail Check:** Parses the **last entry** in the current day's journal file (`journal/YYYY-MM-DD.md`) and extracts its ISO timestamp.
8894
4. **Temporal Consistency:** If the journal entry timestamp is **older** than the latest file change, the commit is blocked. This forces the agent (or user) to document the work *after* it is done but *before* it is finalized.
8995

96+
### 🔍 Deep Dive: Procedural Task Management (`task.py`)
97+
98+
The framework enforces a **CLI-First** roadmap discipline. The `TASKS.md` file is a machine-managed artifact produced by the `.gemini/scripts/task.py` utility.
99+
100+
- **Data Integrity:** The script parses `TASKS.md` into a structured `Task` model, ensuring that IDs (e.g., `G.4`), labels, and dependencies are consistent.
101+
- **State Lifecycle:** Tasks move through a strictly defined lifecycle: `add` (Todo) -> `start` (In Progress) -> `archive` (Done/Archive).
102+
- **Migration Logic:** The script automatically assigns IDs and categorizes tasks during its initial run on a legacy `TASKS.md` file.
103+
- **Test Isolation:** The script's test suite (`tests/test_task_script.py`) utilizes the `GEMINI_TASKS_FILE` environment variable and `tempfile` to operate on a temporary roadmap, preventing verification logic from corrupting the actual project state.
104+
90105
### 4. Specialized Agents (`.gemini/agents/`)
91106

92107
Instead of a single "do-it-all" AI, the framework delegates tasks to specialized sub-agents with restricted toolsets and focused personas.

docs/develop.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ Once a plan is approved, you move to execution. This is the **only** phase where
3131

3232
#### For Code: The TCR Protocol
3333
The `/task` command is the primary tool for repository execution:
34-
- **`/task create`**: Adds a new task to `TASKS.md`.
35-
- **`/task work on ...`**: Implements a strict **TCR (Test-Commit-Revert)** protocol to ensure high-velocity, high-quality code.
34+
- **`/task create`**: Adds a new task using the `task.py` script.
35+
- **`/task work on ...`**: Implements a strict **TCR (Test-Commit-Revert)** protocol to ensure high-velocity, high-quality code. The orchestrator automatically uses `task.py` to mark the task as in-progress.
3636
- **`/task report`**: Provides a summary of the roadmap and current priorities.
37-
- **`/task update`**: Updates the status of an existing task.
37+
- **`/task update`**: Updates the status or plan-path of an existing task via the script.
38+
39+
**CLI-First Roadmap Discipline:**
40+
The project roadmap (`TASKS.md`) must **never** be edited by hand. All task operations must be performed via the `.gemini/scripts/task.py` script or the corresponding `/task` actions. This ensures structural integrity and a verifiable audit trail.
3841

3942
#### **The TCR Loop (Work Action)**
4043

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ curl -fsSL https://apiad.github.io/starter/install.sh | bash
4646

4747
- **Deep Discovery:** Use `/research` for multi-phase domain investigations.
4848
- **Knowledge Mastering:** Use `/learn` to explore and codify new libraries or topics into permanent project skills.
49+
- **Semantic Tier Routing (The Tier Protocol):** Optimizes for intelligence, cost, and speed by mapping specialized agents (`planner`, `debugger`, `learner`, `reviewer`) to high-reasoning models.
4950
- **Architectural Planning:** Use `/plan` to generate persistent, actionable strategies.
5051
- **Forensic Debugging:** Use `/debug` for root-cause analysis without immediate (and potentially incorrect) fixes.
5152
- **Automated Documentation:** Use `/document` to keep the documentation synchronized with the evolving codebase.
52-
- **Roadmap Management:** Use `/task` to maintain a clear, version-controlled project roadmap in `TASKS.md`.
53+
- **Procedural Roadmap Management:** Use `/task` and the `.gemini/scripts/task.py` utility to maintain a structured, machine-managed project roadmap in `TASKS.md`.
5354

5455
## 🔄 Project Lifecycle
5556

docs/user-guide.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,34 @@ Your tool for project initialization.
9393

9494
Your roadmap manager.
9595

96-
- **How it works:** Manages a living `TASKS.md` document. Use it to `create` new tasks, `work` on existing ones, `report` on priorities, or `update` statuses. In the `work` mode, it acts as an orchestrator, delegating granular implementation steps to the specialized `coder` subagent.
96+
- **How it works:** Manages a living `TASKS.md` document **exclusively** via the `.gemini/scripts/task.py` utility. Use it to `create` new tasks, `start` work on existing ones, `report` on priorities, or `archive` completed tasks.
97+
- **Why it works:** By treating the roadmap as a machine-managed artifact, the framework ensures consistent formatting, automated ID generation (e.g., `G.4`), and a clear transition from `Todo` to `Archive` that aligns with the agent's turn lifecycle.
98+
- **Workflow Example:**
99+
1. `python .gemini/scripts/task.py add --label "New Feature" --description "..." --category "Logic"`
100+
2. `python .gemini/scripts/task.py start --task-id L.1` (marks as In Progress)
101+
3. Perform work via `/task work` (TCR loop).
102+
4. `python .gemini/scripts/task.py archive --task-id L.1` (moves to Archive)
97103

98104
### `/commit`
105+
...
106+
## 🌲 The Tier Protocol (Semantic Routing)
107+
108+
To balance speed, cost, and architectural integrity, the framework implements a **Tier Protocol** for model routing. This is configured in `.gemini/settings.json`.
109+
110+
### The "Thinking" Tier (Clever/Pro)
111+
Specialized agents that require high-reasoning and deep causal analysis are mapped to **`gemini-3.1-pro-preview`**.
112+
- **`planner`**: For architectural design and strategy.
113+
- **`debugger`**: For forensic root-cause analysis.
114+
- **`learner`**: For mastering new technologies without hallucinations.
115+
- **`reviewer`**: For critical editorial audits.
116+
117+
### The "Execution" Tier (Dumber/Lite)
118+
Agents optimized for high-volume drafting and discovery are mapped to **`gemini-2.5-flash-lite`**.
119+
- **`writer`**: For section-by-section drafting.
120+
- **`researcher`**: For rapid information gathering.
121+
122+
## 🔄 A Full Feature Development Walkthrough
99123

100-
Brings order to your version history.
101124

102125
- **How it works:** Instead of monolithic "WIP" commits, this command analyzes your `git diff` and logically groups modifications into cohesive units. It proposes a series of atomic, Conventional Commits (e.g., separating a feature update from a documentation tweak) for your approval.
103126

journal/2026-03-24.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
[2026-03-24T13:27:52] - Started procedural task management implementation
66
[2026-03-24T13:36:58] - Implemented core Task model and parser/formatter logic
77
[2026-03-24T14:22:22] - Implement procedural task management script and update core configs
8+
[2026-03-24T14:32:36] - Document Procedural Task Management and Tier Protocol (Semantic Routing)

0 commit comments

Comments
 (0)