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
-**Protection:** Explicitly preserves user configurations in **Protected Files**:
30
+
-`.gemini/settings.json`
31
+
-`.gemini/style-guide.md`
32
+
-**Intelligent GEMINI.md Merge:** Preserves your custom content in the `## Project Notes` section of `GEMINI.md` while updating the core mandates above it.
33
+
-**Confirm:** Presents a detailed summary of which files will be **created**, **updated**, or **protected** and waits for your approval.
34
+
-**Integrate:** Adds missing directory structures (`journal/`, `plans/`, etc.) if they don't exist.
35
+
-**Commit:** Automatically creates a descriptive `chore` commit marking the update.
32
36
33
-
## 🛠️ Prerequisites
37
+
## 🛠️ Prerequisites & Setup
34
38
35
39
To ensure full functionality, your environment should have:
36
40
@@ -39,6 +43,16 @@ To ensure full functionality, your environment should have:
39
43
-**Python 3.10+:** Required for executing the project's automation hooks (`.gemini/hooks/`).
40
44
-**Make:** Used for project validation and health checks.
41
45
46
+
### Installing Git Hooks
47
+
48
+
After installation, you **must** link the framework's hooks to your git repository:
49
+
50
+
```bash
51
+
make install-hooks
52
+
```
53
+
54
+
This target creates a symbolic link from `.gemini/hooks/pre-commit.py` to `.git/hooks/pre-commit`, enabling the automated journal and validation checks.
55
+
42
56
## 🚢 Getting Started
43
57
44
58
Once the installation is complete, follow these steps to orient yourself:
Copy file name to clipboardExpand all lines: docs/design.md
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,27 +10,38 @@ The project's "brain" resides in the `.gemini/` directory, which is organized in
10
10
11
11
Hooks are Python-based scripts that intercept the Gemini CLI turn lifecycle. They are the framework's primary enforcement mechanism.
12
12
13
-
-**`session.py`:** Initializes the session and provides a project summary to the agent.
14
-
-**`journal.py`:** Enforces the mandatory daily journaling requirement for all significant changes.
13
+
-**`welcome.py`:** Initializes the session and provides a project summary to the agent. It also checks for the presence of the pre-commit hook and alerts the user if missing.
14
+
-**`pre-commit.py`:** Enforces the mandatory daily journaling and **timestamp-based validation** before any code changes are finalized.
15
15
-**`make.py`:** Automatically runs the `makefile` (tests/linting) to prevent regressions.
16
-
-**`cron.py`:**Synchronizes the project's background tasks with systemd user timers.
16
+
-**`notify.py`:**Sends a desktop notification after each agent turn is successfully completed and validated.
17
17
-**`utils.py`:** Provides a shared set of utilities for git status analysis and communication with the CLI.
18
18
19
-
### 2. The Command System (`.gemini/commands/`)
19
+
### 2. The Script Utility System (`.gemini/scripts/`)
20
+
21
+
Helper scripts that standardize framework operations across different environments.
22
+
23
+
-**`journal.py`:** A dedicated script to correctly format and append new journal entries (`[timestamp ISO] - description`). This ensures consistency and prevents AI hallucinations of dates or formats.
24
+
25
+
### 3. The Command System (`.gemini/commands/`)
20
26
21
27
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
28
23
29
-**`/plan`:** An interactive workflow that transitions between clarification, analysis, and strategy generation.
24
30
-**`/research`:** A deep-dive exploration that produces exhaustive reports in the `research/` directory.
25
31
-**`/debug`:** Activates a forensic investigation mode for root-cause analysis.
26
-
-**`/docs`:** Analyzes the codebase and project state to update the documentation suite.
32
+
-**`/document`:** Analyzes the codebase and project state to update the documentation suite.
27
33
-**`/task`:** The primary execution engine, managing `TASKS.md` and enforcing the strict TCR (Test-Commit-Revert) loop and feature branch isolation.
28
34
29
-
### 🔌 Synergistic Validation
35
+
### 🔍 Deep Dive: Timestamp-Based Validation
36
+
37
+
The `pre-commit.py` hook implements a sophisticated cross-file validation strategy:
30
38
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.
39
+
1.**Change Detection:** Uses `git status --porcelain` to identify all modified files, excluding internal framework files (`.gemini/`) and the journal itself.
40
+
2.**MTime Analysis:** Calculates the maximum modification time (`max(mtime)`) among all meaningful changes.
41
+
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.
42
+
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.
32
43
33
-
### 3. Specialized Agents (`.gemini/agents/`)
44
+
### 4. Specialized Agents (`.gemini/agents/`)
34
45
35
46
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.
Copy file name to clipboardExpand all lines: docs/develop.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The **Gemini CLI Opinionated Framework** enforces a high-discipline development
4
4
5
5
## 🔄 The Mandatory Workflow Lifecycle
6
6
7
-
Every non-trivial change must follow this strict three-phase process:
7
+
Every non-trivial change must follow this strict four-phase process:
8
8
9
9
### 1. Research & Analysis
10
10
@@ -40,6 +40,16 @@ For every granular step of the implementation:
40
40
41
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.
42
42
43
+
### 4. Audit & Documentation (NEW)
44
+
45
+
Before merging or committing any final change, the work **must** be documented in the daily journal. This is enforced by a **timestamp-based git hook**. Use the following tool to satisfy the requirement:
46
+
47
+
```bash
48
+
python3 .gemini/scripts/journal.py 'one-line description of the work'
49
+
```
50
+
51
+
Failure to do this will block your commit or turn execution.
52
+
43
53
## ✅ Testing & Quality Standards
44
54
45
55
-**Source of Truth:** The `makefile` is the central definition of project health.
@@ -56,10 +66,10 @@ The framework requires a clean working tree for critical actions. Commit often t
56
66
57
67
All commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/) standard:
58
68
59
-
-**`feat:`**: A new feature for the user.
69
+
-**`feat:`**: A new feature for the user (e.g., `feat(hooks): add notify-send alert`).
60
70
-**`fix:`**: A bug fix for the user.
61
71
-**`docs:`**: Documentation-only changes.
62
-
-**`chore:`**: Maintenance, dependencies, or internal tooling updates.
72
+
-**`chore:`**: Maintenance, dependencies, or internal tooling updates (e.g., `chore(release): version 0.17.1`).
63
73
-**`refactor:`**: Code changes that neither fix a bug nor add a feature.
Copy file name to clipboardExpand all lines: docs/index.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,11 @@ The framework is built on the belief that AI is most effective when it is constr
12
12
13
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.
14
14
15
-
### 2. Strategy-First (Research -> Plan -> Execute)
15
+
### 2. Journal-First Discipline (NEW)
16
+
17
+
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.
18
+
19
+
### 3. Strategy-First (Research -> Plan -> Execute)
16
20
17
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.
Copy file name to clipboardExpand all lines: docs/user-guide.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,12 +99,36 @@ The approved plan is linked to a task. You trigger the execution:
99
99
100
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.
101
101
102
-
### **Step 5: Document & Release with `/docs` & `/release`**
102
+
### Step 5: Document & Release with `/docs` & `/release`
103
103
104
104
Finally, use `/docs` to update the technical documentation and `/release` to publish the new version.
105
105
106
+
## ✍️ Maintaining your Journal
107
+
108
+
The framework's most powerful feature is its automated audit trail. This is enforced by a **timestamp-based pre-commit hook** that ensures your code never gets ahead of your documentation.
109
+
110
+
### The Rule of Temporal Consistency
111
+
112
+
Every code change must be documented in `journal/YYYY-MM-DD.md`. If you modify a file at 10:00 AM, you must have a journal entry with a timestamp of 10:00 AM or later before you can commit.
113
+
114
+
### Using the Journal Tool
115
+
116
+
To simplify this, the framework includes a dedicated script. Always use it instead of manual editing:
117
+
118
+
```bash
119
+
python3 .gemini/scripts/journal.py "Brief description of your work"
120
+
```
121
+
122
+
This tool automatically:
123
+
1. Detects the current date and finds/creates the correct journal file.
124
+
2. Generates a precise ISO timestamp.
125
+
3. Appends the entry in the standard `[timestamp] - description` format.
126
+
127
+
By following this discipline, you ensure that the AI agent always has an up-to-date "long-term memory" to draw from in future sessions.
128
+
106
129
## ⚙️ Background Tasks & Maintenance
107
130
131
+
108
132
The real magic of AI-assisted development is what happens when you're not looking or when dealing with technical debt.
0 commit comments