You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/design.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,29 +7,37 @@ The **Gemini CLI Opinionated Framework** is not just a collection of scripts; it
7
7
The project's "brain" resides in the `.gemini/` directory, which is organized into four primary systems:
8
8
9
9
### 1. The Hook System (`.gemini/hooks/`)
10
+
10
11
Hooks are Python-based scripts that intercept the Gemini CLI turn lifecycle. They are the framework's primary enforcement mechanism.
12
+
11
13
-**`session.py`:** Initializes the session and provides a project summary to the agent.
12
14
-**`journal.py`:** Enforces the mandatory daily journaling requirement for all significant changes.
13
15
-**`make.py`:** Automatically runs the `makefile` (tests/linting) to prevent regressions.
14
16
-**`cron.py`:** Synchronizes the project's background tasks with systemd user timers.
15
17
-**`utils.py`:** Provides a shared set of utilities for git status analysis and communication with the CLI.
16
18
17
19
### 2. The Command System (`.gemini/commands/`)
20
+
18
21
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.
22
+
19
23
-**`/plan`:** An interactive workflow that transitions between clarification, analysis, and strategy generation.
20
24
-**`/research`:** A deep-dive exploration that produces exhaustive reports in the `research/` directory.
21
25
-**`/debug`:** Activates a forensic investigation mode for root-cause analysis.
22
26
-**`/docs`:** Analyzes the codebase and project state to update the documentation suite.
23
27
-**`/task`:** The primary execution engine, managing `TASKS.md` and enforcing the strict TCR (Test-Commit-Revert) loop and feature branch isolation.
24
28
25
29
### 🔌 Synergistic Validation
30
+
26
31
The `/task` command works in tandem with the `make.py` hook to ensure a "no-regression" policy. While `/task` enforces testing during the Red-Green-Verify cycle, the `make.py` hook provides a final, infrastructure-level check after every turn. If any turn (manual or automated) results in broken code, the framework immediately detects it, ensuring that the repository's "last known state" is always stable.
27
32
28
33
### 3. Specialized Agents (`.gemini/agents/`)
34
+
29
35
Instead of a single "do-it-all" AI, the framework delegates tasks to specialized sub-agents with restricted toolsets and focused personas (e.g., `planner`, `debugger`, `editor`, `reporter`). This ensures higher reliability and more consistent results.
30
36
31
37
### 4. State Management
38
+
32
39
The framework maintains internal state to optimize operations and ensure continuity:
40
+
33
41
-**`.gemini/last_make_run`**: Stores the timestamp of the last successful validation, allowing the framework to skip redundant tests.
34
42
-**`.gemini/last_journal_update`**: Tracks when the journal was last updated to intelligently enforce the journaling requirement.
35
43
-**`.gemini/settings.json`**: Configures the framework's global behavior and hook execution order.
Copy file name to clipboardExpand all lines: docs/develop.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,29 +7,37 @@ The **Gemini CLI Opinionated Framework** enforces a high-discipline development
7
7
Every non-trivial change must follow this strict three-phase process:
8
8
9
9
### 1. Research & Analysis
10
+
10
11
Before proposing a change, use the `/research` command to gather context, analyze the current codebase, and identify potential risks.
11
12
12
13
### 2. Strategic Planning
14
+
13
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`.
14
16
15
17
### 3. Execution & Validation (TCR Protocol)
16
-
The `/task work` command implements a strict **TCR (Test-Commit-Revert)** protocol to ensure high-velocity, high-quality code.
18
+
19
+
The `/task work on ...` command implements a strict **TCR (Test-Commit-Revert)** protocol to ensure high-velocity, high-quality code.
17
20
18
21
#### **Phase 1: Pre-flight Verification**
22
+
19
23
The agent verifies that the working tree is clean, the current branch is `main`, and `make test` passes as a baseline.
20
24
21
25
#### **Phase 2: Task Isolation**
26
+
22
27
A dedicated feature branch (e.g., `feature/task-name`) is auto-generated and checked out. All subsequent work for this task occurs here.
23
28
24
29
#### **Phase 3: The Red-Green-Verify Loop**
30
+
25
31
For every granular step of the implementation:
32
+
26
33
1.**Red:** Write a failing test and verify failure with `make test`.
27
34
2.**Green:** Implement the minimal code to pass.
28
35
3.**Verify:** Run `make test`.
29
36
-**Pass:**`git commit` the step.
30
37
-**Fail:** Attempt one quick fix; if it still fails, **revert** to the last green state (`git checkout .`).
31
38
32
39
#### **Phase 4: Integration**
40
+
33
41
Once all steps are complete, a final test run is performed. Upon user approval, the branch is merged back to `main` and the roadmap in `TASKS.md` is updated.
34
42
35
43
## ✅ Testing & Quality Standards
@@ -41,17 +49,21 @@ Once all steps are complete, a final test run is performed. Upon user approval,
41
49
## 🌲 Git & Source Control
42
50
43
51
### 1. Clean Working Tree
52
+
44
53
The framework requires a clean working tree for critical actions. Commit often to avoid merge conflicts or large, unmanageable diffs.
45
54
46
55
### 2. Conventional Commits
56
+
47
57
All commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/) standard:
58
+
48
59
-**`feat:`**: A new feature for the user.
49
60
-**`fix:`**: A bug fix for the user.
50
61
-**`docs:`**: Documentation-only changes.
51
62
-**`chore:`**: Maintenance, dependencies, or internal tooling updates.
52
63
-**`refactor:`**: Code changes that neither fix a bug nor add a feature.
53
64
54
65
### 3. Commit Scoping
66
+
55
67
When possible, provide a scope to the commit message (e.g., `feat(onboard): add documentation discovery`).
Copy file name to clipboardExpand all lines: docs/index.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,19 @@ This project is more than just a template; it is a structured environment that e
9
9
The framework is built on the belief that AI is most effective when it is constrained by rigorous engineering standards and empowered by deep project context. We operate on three fundamental pillars:
10
10
11
11
### 1. Critical Cognitive Partnership
12
+
12
13
The agent is mandated to challenge ideas before implementing them. It identifies technical flaws, security risks, or redundant logic, acting as a "peer reviewer" in real-time.
13
14
14
15
### 2. Strategy-First (Research -> Plan -> Execute)
16
+
15
17
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.
16
18
17
19
### 3. Validation-as-Truth
20
+
18
21
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.
19
22
20
23
### 4. Task Isolation (Feature Branching)
24
+
21
25
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.
Copy file name to clipboardExpand all lines: docs/user-guide.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The framework is not just a set of scripts; it is a principled system designed t
8
8
9
9
## 🧠 Principles of Effective AI-Assisted Work
10
10
11
-
The most pressing limitation of modern LLMs is context saturation. When you work on a single project for a long time, the model can lose track of important details, leading to hallucinations or drift.
11
+
The most pressing limitation of modern LLMs is context saturation. When you work on a single project for a long time, the model can lose track of important details, leading to hallucinations or drift.
12
12
13
13
This framework solves this problem by enforcing three core principles:
14
14
@@ -23,12 +23,16 @@ This framework solves this problem by enforcing three core principles:
23
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.
24
24
25
25
### `/research`
26
+
26
27
Your primary tool for gathering external knowledge.
28
+
27
29
-**How it works:** When triggered, the `researcher` subagent scours the web for technical documentation, APIs, or case studies. It synthesizes this data into granular summaries saved in the `research/` directory.
28
30
-**When to use:** Use this when you need to understand a new library, a technical specification, or gather data for an article.
29
31
30
32
### `/plan`
33
+
31
34
Your tool for internal strategy and architectural design.
35
+
32
36
-**How it works:** The `planner` subagent conducts a thorough analysis of your codebase and journal. After clarifying the goal with you interactively, it produces a comprehensive Markdown plan in the `plans/` directory.
33
37
-**Crucial Rule:** The `/plan` command *never* executes the code. It maps the territory and provides a step-by-step execution roadmap for you to approve first.
34
38
@@ -39,35 +43,50 @@ Your tool for internal strategy and architectural design.
39
43
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.
40
44
41
45
### `/issues`
46
+
42
47
Your gateway to GitHub.
48
+
43
49
-**How it works:** Interfaces with the GitHub CLI to analyze open issues and recommend what to tackle next based on strategic impact.
44
50
51
+
45
52
### `/task`
53
+
46
54
Your roadmap manager.
55
+
47
56
-**How it works:** Manages a living `TASKS.md` document. Use it to `create` new tasks, `work` on existing ones, or `report` on the project's current status.
48
57
49
58
### `/commit`
59
+
50
60
Brings order to your version history.
61
+
51
62
-**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.
52
63
53
64
### `/release`
65
+
54
66
Automates the deployment process.
67
+
55
68
-**How it works:** Verifies workspace integrity (clean git tree, passing tests via `make`), analyzes commit history to propose the next version bump, drafts a `CHANGELOG.md` entry, and publishes the final tag to GitHub.
56
69
57
70
## 🔄 A Full Feature Development Walkthrough
58
71
59
72
A complete, principled development cycle follows the **Research -> Plan -> Execute** lifecycle.
60
73
61
74
### **Step 1: Research with `/research`**
75
+
62
76
You are integrating a new authentication library. You start by researching the technical requirements.
77
+
63
78
- The `researcher` subagent gathers documentation and synthesizes it into `research/auth-library-deep-dive.md`.
64
79
65
80
### **Step 2: Strategy with `/plan`**
81
+
66
82
Once you understand the requirements, you trigger the `/plan` command.
83
+
67
84
- The `planner` subagent analyzes the codebase and generates `plans/implement-auth.md`, mapping out the specific architectural changes and testing strategy.
68
85
69
86
### **Step 3: Execute with `/task work`**
87
+
70
88
The approved plan is linked to a task. You trigger the execution:
89
+
71
90
-**Pre-flight:** The agent verifies the tree is clean on `main`.
72
91
-**Isolation:** A `feature/auth-integration` branch is created.
73
92
-**Loop (Red-Green-Verify):**
@@ -77,21 +96,27 @@ The approved plan is linked to a task. You trigger the execution:
77
96
4. The loop repeats for every granular step.
78
97
79
98
### **Step 4: Review & Integrate**
99
+
80
100
After all steps pass, the agent presents the final work. Upon your approval, it merges back to `main` and cleans up the feature branch.
81
101
82
102
### **Step 5: Document & Release with `/docs` & `/release`**
103
+
83
104
Finally, use `/docs` to update the technical documentation and `/release` to publish the new version.
84
105
85
106
## ⚙️ Background Tasks & Maintenance
86
107
87
108
The real magic of AI-assisted development is what happens when you're not looking or when dealing with technical debt.
88
109
89
110
### `/cron`
111
+
90
112
Your background automation layer.
113
+
91
114
-**How it works:** Uses the `cron.toml` file to define scheduled tasks via systemd user timers. You can schedule natural language prompts (e.g., "Scour the web for new developments in X") to run overnight, ensuring your knowledge base is fresh by morning.
92
115
93
116
### `/maintenance`
117
+
94
118
Your defense against context rot.
119
+
95
120
-**How it works:** Performs a comprehensive audit of the codebase to identify technical debt, outdated implementations, or deviations between code and documentation. It presents a detailed refactoring plan for your approval before making any changes, ensuring the repository remains a clean environment for the AI to operate within.
0 commit comments