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
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,30 @@ Commands define structured, multi-phase workflows that automate the development
28
28
29
29
-**`/plan`:** An interactive workflow that transitions between clarification, analysis, and strategy generation.
30
30
-**`/research`:** A deep-dive exploration that produces exhaustive reports in the `research/` directory.
31
-
-**`/debug`:** Activates a forensic investigation mode for root-cause analysis.
31
+
-**`/debug`:** Activates a **forensic investigation mode** using a scientific, hypothesis-driven workflow.
32
32
-**`/document`:** Analyzes the codebase and project state to update the documentation suite.
33
-
-**`/task`:** The primary execution engine, managing `TASKS.md` and enforcing the strict TCR (Test-Commit-Revert) loop and feature branch isolation.
33
+
-**`/task`:** The primary execution engine, managing `TASKS.md` and enforcing the **strict TCR (Test-Commit-Revert) loop** and feature branch isolation.
34
+
35
+
### 🔍 Deep Dive: Scientific Debugging
36
+
37
+
The `/debug` command implements a principled approach to problem-solving, moving through four distinct phases:
38
+
39
+
1.**Status & Context Analysis:** The agent gathers all relevant error logs, stack traces, and recent changes.
40
+
2.**Hypothesis Formulation:** Instead of guessing, the agent must propose a specific hypothesis for the root cause and obtain user approval.
41
+
3.**Isolated Hypothesis Testing:** The agent creates a temporary **diagnostic branch** (`debug/hyp-*`) and is granted restricted `write_file` access *only* for diagnostic code (logs, reproduction scripts).
42
+
4.**Synthesis & RCA Report:** Once verified, the agent synthesizes the findings into a structured Root Cause Analysis (RCA) report, ensuring the "fix" is understood before it is implemented.
43
+
44
+
### 🔍 Deep Dive: TCR (Test-Commit-Revert) Protocol
45
+
46
+
The `/task work` command enforces a high-discipline development lifecycle through a strict TCR loop:
47
+
48
+
1.**Pre-flight Verification:** Ensures a clean `main` branch and passing tests.
49
+
2.**Isolation:** All work occurs on an auto-generated, kebab-case feature branch.
50
+
3.**The Loop (Red-Green-Verify):**
51
+
-**Red:** A failing test is written to define the step's goal.
52
+
-**Green:** Minimal code is written to pass the test.
53
+
-**Verify:** If the test fails, the agent is allowed **one quick fix**. If it fails again, the change is **automatically reverted** (`git checkout .`), preserving the last known stable state.
54
+
4.**Integration:** Upon completion, the feature branch is merged, the roadmap is updated, and the branch is deleted.
Copy file name to clipboardExpand all lines: docs/develop.md
+23-19Lines changed: 23 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,33 +14,37 @@ Before proposing a change, use the `/research` command to gather context, analyz
14
14
15
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`.
16
16
17
-
### 3. Execution & Validation (TCR Protocol)
17
+
### 3. Execution & Validation (The TCR Protocol)
18
18
19
-
The `/task work on ...` command implements a strict **TCR (Test-Commit-Revert)** protocol to ensure high-velocity, high-quality code.
19
+
The `/task` command is the primary tool for repository execution. It supports multiple actions to manage the project roadmap:
20
20
21
-
#### **Phase 1: Pre-flight Verification**
21
+
-**`/task create`**: Adds a new task to `TASKS.md`.
22
+
-**`/task work on ...`**: Implements a strict **TCR (Test-Commit-Revert)** protocol to ensure high-velocity, high-quality code.
23
+
-**`/task report`**: Provides a summary of the roadmap and current priorities.
24
+
-**`/task update`**: Updates the status of an existing task.
22
25
23
-
The agent verifies that the working tree is clean, the current branch is `main`, and `make test` passes as a baseline.
26
+
#### **The TCR Loop (Work Action)**
24
27
25
-
#### **Phase 2: Task Isolation**
28
+
1.**Phase 1 (Pre-flight Verification):** The agent verifies that the working tree is clean, the current branch is `main`, and `make test` passes as a baseline.
29
+
2.**Phase 2 (Task Isolation):** A dedicated feature branch (e.g., `feature/task-name`) is auto-generated and checked out. All work occurs on this isolated branch.
30
+
3.**Phase 3 (The Red-Green-Verify Loop):** For every granular step of the implementation:
31
+
-**Red:** Write a failing test and verify failure with `make test`.
32
+
-**Green:** Implement the minimal code to pass the test.
33
+
-**Verify:** Run `make test`.
34
+
-**Pass:**`git commit` the step.
35
+
-**Fail:** Attempt **one quick fix**. If it fails again, the change is **automatically reverted** (`git checkout .`).
36
+
4.**Phase 4 (Integration):** Once all steps are complete, the agent performs a final test run. Upon approval, the branch is merged into `main` and deleted.
26
37
27
-
A dedicated feature branch (e.g., `feature/task-name`) is auto-generated and checked out. All subsequent work for this task occurs here.
38
+
### 4. Forensic Investigation (The Scientific Debugging Discipline)
28
39
29
-
#### **Phase 3: The Red-Green-Verify Loop**
40
+
When a bug is detected, the `/debug` command enforces a structured, scientific investigation:
30
41
31
-
For every granular step of the implementation:
42
+
1.**Phase 1 (Status & Context):** Analyze the current environment and gather reproduction information.
43
+
2.**Phase 2 (Hypothesis Formulation):** Formulate a specific hypothesis for the root cause.
44
+
3.**Phase 3 (Isolated Testing):** Test the hypothesis on a temporary diagnostic branch (`debug/hyp-*`). Diagnostic code should be minimal and focused.
45
+
4.**Phase 4 (Synthesis & RCA):** Summarize the investigation into a **Root Cause Analysis (RCA)** report. This report serves as the documentation for the subsequent fix.
32
46
33
-
1.**Red:** Write a failing test and verify failure with `make test`.
34
-
2.**Green:** Implement the minimal code to pass.
35
-
3.**Verify:** Run `make test`.
36
-
-**Pass:**`git commit` the step.
37
-
-**Fail:** Attempt one quick fix; if it still fails, **revert** to the last green state (`git checkout .`).
38
-
39
-
#### **Phase 4: Integration**
40
-
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
-
43
-
### 4. Audit & Documentation (NEW)
47
+
### 5. Audit & Documentation (NEW)
44
48
45
49
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:
Copy file name to clipboardExpand all lines: docs/user-guide.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,12 @@ This framework solves this problem by enforcing three core principles:
22
22
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
-
### `/research`
25
+
### `/debug`
26
26
27
-
Your primary tool for gathering external knowledge.
27
+
Your primary tool for forensic, scientific investigation.
28
28
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.
30
-
-**When to use:**Use this when you need to understand a new library, a technical specification, or gather data for an article.
29
+
-**How it works:** When a bug is detected, the `/debug` command implements a principled approach to problem-solving. 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.
30
+
-**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.
31
31
32
32
### `/plan`
33
33
@@ -53,7 +53,7 @@ Your gateway to GitHub.
53
53
54
54
Your roadmap manager.
55
55
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.
56
+
-**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.
57
57
58
58
### `/commit`
59
59
@@ -90,10 +90,11 @@ The approved plan is linked to a task. You trigger the execution:
90
90
-**Pre-flight:** The agent verifies the tree is clean on `main`.
91
91
-**Isolation:** A `feature/auth-integration` branch is created.
92
92
-**Loop (Red-Green-Verify):**
93
-
1. Agent writes a failing `test_auth_logic.py`.
93
+
1. Agent writes a failing `test_auth_logic.py` based on the plan.
94
94
2. Agent implements the minimal logic to pass.
95
95
3. Agent runs `make test`. If successful, the step is committed.
96
-
4. The loop repeats for every granular step.
96
+
4. If it fails, the agent tries **one quick fix**. If it fails again, the change is **automatically reverted**, preserving the last stable state.
97
+
5. The loop repeats for every granular step defined in the plan.
97
98
98
99
### **Step 4: Review & Integrate**
99
100
@@ -103,6 +104,15 @@ After all steps pass, the agent presents the final work. Upon your approval, it
103
104
104
105
Finally, use `/docs` to update the technical documentation and `/release` to publish the new version.
105
106
107
+
## 🔍 Walkthrough: Solving a Bug with `/debug`
108
+
109
+
When a bug is detected, the `/debug` command ensures a scientific resolution:
110
+
111
+
1.**Analyze Context:** The agent gathers all relevant logs and context.
112
+
2.**Formulate Hypothesis:** The agent proposes a root cause hypothesis (e.g., "The auth token is not being correctly passed to the header").
113
+
3.**Isolate & Test:** The agent creates a temporary branch `debug/hyp-auth-token`. It implements a minimal reproduction script or logging.
114
+
4.**RCA Synthesis:** Once confirmed, the agent generates a **Root Cause Analysis (RCA)** report. This report is used as the basis for the subsequent `/task work` to implement the fix on a feature branch.
115
+
106
116
## ✍️ Maintaining your Journal
107
117
108
118
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.
0 commit comments