Skip to content

Commit d53d2cc

Browse files
committed
docs: update comprehensive documentation suite
1 parent 939a6e7 commit d53d2cc

File tree

6 files changed

+85
-21
lines changed

6 files changed

+85
-21
lines changed

docs/deploy.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,21 @@ Running `install.sh` in an empty directory will:
2020
- Initialize baseline files (`README.md`, `CHANGELOG.md`, `TASKS.md`, `makefile`).
2121
- Perform an initial "feat" commit.
2222

23-
### 2. Existing Project (Integration)
23+
### 2. Existing Project (Integration & Updates)
2424

25-
If run inside an existing project, the script will:
25+
If run inside an existing project, the script performs a **Surgical Update**:
2626

27-
- **Validate:** Ensure you have a clean Git working tree.
28-
- **Analyze:** Identify which framework files are missing or need updating.
29-
- **Confirm:** Present a summary of all proposed changes and wait for your approval.
30-
- **Integrate:** Add the `.gemini/` directory and core Markdown files without deleting your existing content.
31-
- **Commit:** Create a descriptive "feat" or "chore" commit with the changes.
27+
- **Validate:** Ensure a clean Git working tree to prevent data loss.
28+
- **Surgical Sync:** Updates core framework components (`hooks/`, `commands/`, `agents/`, `scripts/`) individually.
29+
- **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.
3236

33-
## 🛠️ Prerequisites
37+
## 🛠️ Prerequisites & Setup
3438

3539
To ensure full functionality, your environment should have:
3640

@@ -39,6 +43,16 @@ To ensure full functionality, your environment should have:
3943
- **Python 3.10+:** Required for executing the project's automation hooks (`.gemini/hooks/`).
4044
- **Make:** Used for project validation and health checks.
4145

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+
4256
## 🚢 Getting Started
4357

4458
Once the installation is complete, follow these steps to orient yourself:

docs/design.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,38 @@ The project's "brain" resides in the `.gemini/` directory, which is organized in
1010

1111
Hooks are Python-based scripts that intercept the Gemini CLI turn lifecycle. They are the framework's primary enforcement mechanism.
1212

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.
1515
- **`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.
1717
- **`utils.py`:** Provides a shared set of utilities for git status analysis and communication with the CLI.
1818

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/`)
2026

2127
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.
2228

2329
- **`/plan`:** An interactive workflow that transitions between clarification, analysis, and strategy generation.
2430
- **`/research`:** A deep-dive exploration that produces exhaustive reports in the `research/` directory.
2531
- **`/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.
2733
- **`/task`:** The primary execution engine, managing `TASKS.md` and enforcing the strict TCR (Test-Commit-Revert) loop and feature branch isolation.
2834

29-
### 🔌 Synergistic Validation
35+
### 🔍 Deep Dive: Timestamp-Based Validation
36+
37+
The `pre-commit.py` hook implements a sophisticated cross-file validation strategy:
3038

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.
3243

33-
### 3. Specialized Agents (`.gemini/agents/`)
44+
### 4. Specialized Agents (`.gemini/agents/`)
3445

3546
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.
3647

docs/develop.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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 three-phase process:
7+
Every non-trivial change must follow this strict four-phase process:
88

99
### 1. Research & Analysis
1010

@@ -40,6 +40,16 @@ For every granular step of the implementation:
4040

4141
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.
4242

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+
4353
## ✅ Testing & Quality Standards
4454

4555
- **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
5666

5767
All commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/) standard:
5868

59-
- **`feat:`**: A new feature for the user.
69+
- **`feat:`**: A new feature for the user (e.g., `feat(hooks): add notify-send alert`).
6070
- **`fix:`**: A bug fix for the user.
6171
- **`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`).
6373
- **`refactor:`**: Code changes that neither fix a bug nor add a feature.
6474

6575
### 3. Commit Scoping

docs/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ The framework is built on the belief that AI is most effective when it is constr
1212

1313
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.
1414

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)
1620

1721
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.
1822

docs/user-guide.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,36 @@ The approved plan is linked to a task. You trigger the execution:
9999

100100
After all steps pass, the agent presents the final work. Upon your approval, it merges back to `main` and cleans up the feature branch.
101101

102-
### **Step 5: Document & Release with `/docs` & `/release`**
102+
### Step 5: Document & Release with `/docs` & `/release`
103103

104104
Finally, use `/docs` to update the technical documentation and `/release` to publish the new version.
105105

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+
106129
## ⚙️ Background Tasks & Maintenance
107130

131+
108132
The real magic of AI-assisted development is what happens when you're not looking or when dealing with technical debt.
109133

110134
### `/cron`

journal/2026-03-20.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
[2026-03-20T08:43:37] - chore(release): version 0.17.0
1111
[2026-03-20T08:45:12] - refactor(docs): simplify journal entry logic in install.sh
1212
[2026-03-20T08:46:18] - chore(release): version 0.17.1
13+
[2026-03-20T09:54:08] - docs: update comprehensive documentation suite (index, deploy, design, develop, user-guide) with latest framework improvements

0 commit comments

Comments
 (0)