Skip to content

Commit 9dff79b

Browse files
committed
feat: Implement Universal File Resolution Protocol
Updates GEMINI.md with the resolution protocol and refactors all commands (implement, revert, status, newTrack) to resolve file paths dynamically via index.md, removing hardcoded defaults.
1 parent 2ed9f87 commit 9dff79b

File tree

5 files changed

+79
-63
lines changed

5 files changed

+79
-63
lines changed

GEMINI.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
11
# Conductor Context
22

33
If a user mentions a "plan" or asks about the plan, and they have used the conductor extension in the current session, they are likely referring to the `conductor/tracks.md` file or one of the track plans (`conductor/tracks/<track_id>/plan.md`).
4+
5+
## Universal File Resolution Protocol
6+
7+
**PROTOCOL: How to locate files.**
8+
To find a file (e.g., "**Product Definition**") within a specific context (Project Root or a specific Track):
9+
10+
1. **Identify Index:** Determine the relevant index file:
11+
- **Project Context:** `conductor/index.md`
12+
- **Track Context:** `conductor/tracks/<track_id>/index.md`
13+
14+
2. **Check Index:** Read the index file and look for a link with a matching or semantically similar label.
15+
16+
3. **Resolve Path:** If a link is found, resolve its path **relative to the directory containing the `index.md` file**.
17+
- *Example:* If `conductor/index.md` links to `./workflow.md`, the full path is `conductor/workflow.md`.
18+
19+
4. **Fallback:** If the index file is missing or the link is absent, use the **Default Path** keys below.
20+
21+
5. **Verify:** You MUST verify the resolved file actually exists on the disk.
22+
23+
**Standard Default Paths (Project):**
24+
- **Product Definition**: `conductor/product.md`
25+
- **Tech Stack**: `conductor/tech-stack.md`
26+
- **Workflow**: `conductor/workflow.md`
27+
- **Product Guidelines**: `conductor/product-guidelines.md`
28+
- **Tracks Registry**: `conductor/tracks.md`
29+
30+
**Standard Default Paths (Track):**
31+
- **Specification**: `conductor/tracks/<track_id>/spec.md`
32+
- **Implementation Plan**: `conductor/tracks/<track_id>/plan.md`
33+
- **Metadata**: `conductor/tracks/<track_id>/metadata.json`
34+

commands/conductor/implement.toml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,13 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
77
88
---
99
10-
## 1.1 UNIVERSAL FILE RESOLUTION PROTOCOL
11-
**PROTOCOL: How to locate files.**
12-
To find a file (e.g., "**Product Definition**"), you MUST:
13-
1. **Check Index:** Look for a link with that label in `conductor/index.md` (if it exists).
14-
2. **Fallback:** If `conductor/index.md` is missing or the link is absent, use the **Default Path** keys specified in the steps below.
15-
3. **Verify:** You MUST verify the resolved file actually exists on the disk.
16-
17-
---
18-
19-
## 1.2 SETUP CHECK
10+
## 1.1 SETUP CHECK
2011
**PROTOCOL: Verify that the Conductor environment is properly set up.**
2112
22-
1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, verify the existence of:
23-
- **Product Definition** (Default: `conductor/product.md`)
24-
- **Tech Stack** (Default: `conductor/tech-stack.md`)
25-
- **Workflow** (Default: `conductor/workflow.md`)
13+
1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, resolve and verify the existence of:
14+
- **Product Definition**
15+
- **Tech Stack**
16+
- **Workflow**
2617
2718
2. **Handle Failure:** If ANY of these are missing (or their resolved paths do not exist), Announce: "Conductor is not set up. Please run `/conductor:setup`." and HALT.
2819
@@ -35,7 +26,7 @@ To find a file (e.g., "**Product Definition**"), you MUST:
3526
1. **Check for User Input:** First, check if the user provided a track name as an argument (e.g., `/conductor:implement <track_description>`).
3627
3728
2. **Locate and Parse Tracks Registry:**
38-
- Resolve the **Tracks Registry** file (Default: `conductor/tracks.md`).
29+
- Resolve the **Tracks Registry**.
3930
- Read and parse this file. You must parse the file by splitting its content by the `---` separator to identify each track section. For each section, extract the status (`[ ]`, `[~]`, `[x]`), the track description (from the `##` heading), and the link to the track folder.
4031
- **CRITICAL:** If no track sections are found after parsing, announce: "The tracks file is empty or malformed. No tracks to implement." and halt.
4132
@@ -71,11 +62,7 @@ To find a file (e.g., "**Product Definition**"), you MUST:
7162
3. **Load Track Context:**
7263
a. **Identify Track Folder:** From the tracks file, identify the track's folder link to get the `<track_id>`.
7364
b. **Read Files:**
74-
- **Track Context:** Check for `conductor/tracks/<track_id>/index.md`.
75-
- **If found:** Use it to resolve **Specification** and **Implementation Plan**.
76-
- **If missing:** Use Defaults:
77-
- **Specification**: `conductor/tracks/<track_id>/spec.md`
78-
- **Implementation Plan**: `conductor/tracks/<track_id>/plan.md`
65+
- **Track Context:** Using the **Universal File Resolution Protocol**, resolve and read the **Specification** and **Implementation Plan** for the selected track.
7966
- **Workflow:** Resolve **Workflow** (Default: `conductor/workflow.md`).
8067
c. **Error Handling:** If you fail to read any of these files, you MUST stop and inform the user of the error.
8168
@@ -104,9 +91,9 @@ To find a file (e.g., "**Product Definition**"), you MUST:
10491
10592
4. **Load Project Documents:**
10693
- Resolve and read:
107-
- **Product Definition** (Default: `conductor/product.md`)
108-
- **Tech Stack** (Default: `conductor/tech-stack.md`)
109-
- **Product Guidelines** (Default: `conductor/product-guidelines.md`)
94+
- **Product Definition**
95+
- **Tech Stack**
96+
- **Product Guidelines**
11097
11198
5. **Analyze and Update:**
11299
a. **Analyze Specification:** Carefully analyze the **Specification** to identify any new features, changes in functionality, or updates to the technology stack.

commands/conductor/newTrack.toml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,15 @@ You are an AI agent assistant for the Conductor spec-driven development framewor
55
66
CRITICAL: You must validate the success of every tool call. If any tool call fails, you MUST halt the current operation immediately, announce the failure to the user, and await further instructions.
77
8-
## 1.1 UNIVERSAL FILE RESOLUTION PROTOCOL
9-
**PROTOCOL: How to locate files.**
10-
To find a file (e.g., "**Product Definition**"), you MUST:
11-
1. **Check Index:** Look for a link with that label in `conductor/index.md` (if it exists).
12-
2. **Fallback:** If `conductor/index.md` is missing or the link is absent, use the **Default Path** keys specified in the steps below.
13-
3. **Verify:** You MUST verify the resolved file actually exists on the disk.
14-
158
---
169
17-
## 1.2 SETUP CHECK
10+
## 1.1 SETUP CHECK
1811
**PROTOCOL: Verify that the Conductor environment is properly set up.**
1912
20-
1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, verify the existence of:
21-
- **Product Definition** (Default: `conductor/product.md`)
22-
- **Tech Stack** (Default: `conductor/tech-stack.md`)
23-
- **Workflow** (Default: `conductor/workflow.md`)
13+
1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, resolve and verify the existence of:
14+
- **Product Definition**
15+
- **Tech Stack**
16+
- **Workflow**
2417
2518
2. **Handle Failure:**
2619
- If ANY of these files are missing, you MUST halt the operation immediately.
@@ -100,11 +93,11 @@ To find a file (e.g., "**Product Definition**"), you MUST:
10093
* Read the confirmed `spec.md` content for this track.
10194
* Resolve and read the **Workflow** file (Default: `conductor/workflow.md`).
10295
* Generate a `plan.md` with a hierarchical list of Phases, Tasks, and Sub-tasks.
103-
* **CRITICAL:** The plan structure MUST adhere to the methodology in the workflow file (e.g., TDD tasks for "Write Tests" and "Implement").
96+
* **CRITICAL:** The plan structure MUST adhere to the methodology in the **Workflow** file (e.g., TDD tasks for "Write Tests" and "Implement").
10497
* Include status markers `[ ]` for **EVERY** task and sub-task. The format must be:
10598
- Parent Task: `- [ ] Task: ...`
10699
- Sub-task: ` - [ ] ...`
107-
* **CRITICAL: Inject Phase Completion Tasks.** Determine if a "Phase Completion Verification and Checkpointing Protocol" is defined in `conductor/workflow.md`. If this protocol exists, then for each **Phase** that you generate in `plan.md`, you MUST append a final meta-task to that phase. The format for this meta-task is: `- [ ] Task: Conductor - User Manual Verification '<Phase Name>' (Protocol in workflow.md)`.
100+
* **CRITICAL: Inject Phase Completion Tasks.** Determine if a "Phase Completion Verification and Checkpointing Protocol" is defined in the **Workflow**. If this protocol exists, then for each **Phase** that you generate in `plan.md`, you MUST append a final meta-task to that phase. The format for this meta-task is: `- [ ] Task: Conductor - User Manual Verification '<Phase Name>' (Protocol in workflow.md)`.
108101
109102
3. **User Confirmation:** Present the drafted `plan.md` to the user for review and approval.
110103
> "I've drafted the implementation plan. Please review the following:"
@@ -146,7 +139,7 @@ To find a file (e.g., "**Product Definition**"), you MUST:
146139
```
147140
6. **Update Tracks Registry:**
148141
- **Announce:** Inform the user you are updating the **Tracks Registry**.
149-
- **Append Section:** Resolve the **Tracks Registry** file (Default: `conductor/tracks.md`) via the **Universal File Resolution Protocol**. Append a new section for the track to the end of this file. The format MUST be:
142+
- **Append Section:** Resolve the **Tracks Registry** via the **Universal File Resolution Protocol**. Append a new section for the track to the end of this file. The format MUST be:
150143
```markdown
151144
- [ ] **Track: <Track Description>**
152145
*Link: [./conductor/tracks/<track_id>/](./conductor/tracks/<track_id>/)*

commands/conductor/revert.toml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@ Your workflow MUST anticipate and handle common non-linear Git histories, such a
99
1010
**CRITICAL**: The user's explicit confirmation is required at multiple checkpoints. If a user denies a confirmation, the process MUST halt immediately and follow further instructions.
1111
12-
**CRITICAL:** Before proceeding, you should start by checking if the project has been properly set up.
13-
1. **Verify Tracks File:** Check if the file `conductor/tracks.md` exists. If it does not, HALT execution and instruct the user: "The project has not been set up or conductor/tracks.md has been corrupted. Please run `/conductor:setup` to set up the plan, or restore conductor/tracks.md."
14-
2. **Verify Track Exists:** Check if the file `conductor/tracks.md` is not empty. If it is empty, HALT execution and instruct the user: "The project has not been set up or conductor/tracks.md has been corrupted. Please run `/conductor:setup` to set up the plan, or restore conductor/tracks.md."
12+
CRITICAL: You must validate the success of every tool call. If any tool call fails, you MUST halt the current operation immediately, announce the failure to the user, and await further instructions.
1513
16-
**CRITICAL**: You must validate the success of every tool call. If any tool call fails, you MUST halt the current operation immediately, announce the failure to the user, and await further instructions.
14+
---
15+
16+
## 1.1 SETUP CHECK
17+
**PROTOCOL: Verify that the Conductor environment is properly set up.**
18+
19+
1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, resolve and verify the existence of the **Tracks Registry**.
20+
21+
2. **Verify Track Exists:** Check if the **Tracks Registry** is not empty.
22+
23+
3. **Handle Failure:** If the file is missing or empty, HALT execution and instruct the user: "The project has not been set up or the tracks file has been corrupted. Please run `/conductor:setup` to set up the plan, or restore the tracks file."
1724
1825
---
1926
@@ -29,7 +36,7 @@ Your workflow MUST anticipate and handle common non-linear Git histories, such a
2936
3. **Interaction Paths:**
3037
3138
* **PATH A: Direct Confirmation**
32-
1. Find the specific track, phase, or task the user referenced in the project's `tracks.md` or `plan.md` files.
39+
1. Find the specific track, phase, or task the user referenced in the **Tracks Registry** or **Implementation Plan** files (resolved via **Universal File Resolution Protocol**).
3340
2. Ask the user for confirmation: "You asked to revert the [Track/Phase/Task]: '[Description]'. Is this correct?".
3441
- **Structure:**
3542
A) Yes
@@ -38,7 +45,7 @@ Your workflow MUST anticipate and handle common non-linear Git histories, such a
3845
3946
* **PATH B: Guided Selection Menu**
4047
1. **Identify Revert Candidates:** Your primary goal is to find relevant items for the user to revert.
41-
* **Scan All Plans:** You MUST read the main `conductor/tracks.md` and every `conductor/tracks/*/plan.md` file.
48+
* **Scan All Plans:** You MUST read the **Tracks Registry** and every track's **Implementation Plan** (resolved via **Universal File Resolution Protocol**, checking `conductor/tracks/<track_id>/index.md` if available).
4249
* **Prioritize In-Progress:** First, find **all** Tracks, Phases, and Tasks marked as "in-progress" (`[~]`).
4350
* **Fallback to Completed:** If and only if NO in-progress items are found, find the **5 most recently completed** Tasks and Phases (`[x]`).
4451
2. **Present a Unified Hierarchical Menu:** You MUST present the results to the user in a clear, numbered, hierarchical list grouped by Track. The introductory text MUST change based on the context.
@@ -76,15 +83,15 @@ Your workflow MUST anticipate and handle common non-linear Git histories, such a
7683
**GOAL: Find ALL actual commit(s) in the Git history that correspond to the user's confirmed intent and analyze them.**
7784
7885
1. **Identify Implementation Commits:**
79-
* Find the primary SHA(s) for all tasks and phases recorded in the target's `plan.md`.
86+
* Find the primary SHA(s) for all tasks and phases recorded in the target's **Implementation Plan**.
8087
* **Handle "Ghost" Commits (Rewritten History):** If a SHA from a plan is not found in Git, announce this. Search the Git log for a commit with a highly similar message and ask the user to confirm it as the replacement. If not confirmed, halt.
8188
8289
2. **Identify Associated Plan-Update Commits:**
83-
* For each validated implementation commit, use `git log` to find the corresponding plan-update commit that happened *after* it and modified the relevant `plan.md` file.
90+
* For each validated implementation commit, use `git log` to find the corresponding plan-update commit that happened *after* it and modified the relevant **Implementation Plan** file.
8491
8592
3. **Identify the Track Creation Commit (Track Revert Only):**
8693
* **IF** the user's intent is to revert an entire track, you MUST perform this additional step.
87-
* **Method:** Use `git log -- conductor/tracks.md` and search for the commit that first introduced the track entry.
94+
* **Method:** Use `git log -- <path_to_tracks_registry>` (resolved via protocol) and search for the commit that first introduced the track entry.
8895
* Look for lines matching either `- [ ] **Track: <Track Description>**` (new format) OR `## [ ] Track: <Track Description>` (legacy format).
8996
* Add this "track creation" commit's SHA to the list of commits to be reverted.
9097
@@ -118,7 +125,6 @@ Your workflow MUST anticipate and handle common non-linear Git histories, such a
118125
119126
1. **Execute Reverts:** Run `git revert --no-edit <sha>` for each commit in your final list, starting from the most recent and working backward.
120127
2. **Handle Conflicts:** If any revert command fails due to a merge conflict, halt and provide the user with clear instructions for manual resolution.
121-
3. **Verify Plan State:** After all reverts succeed, read the relevant `plan.md` file(s) again to ensure the reverted item has been correctly reset. If not, perform a file edit to fix it and commit the correction.
128+
3. **Verify Plan State:** After all reverts succeed, read the relevant **Implementation Plan** file(s) again to ensure the reverted item has been correctly reset. If not, perform a file edit to fix it and commit the correction.
122129
4. **Announce Completion:** Inform the user that the process is complete and the plan is synchronized.
123-
"""
124-
130+
"""

commands/conductor/status.toml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
description = "Displays the current progress of the project"
22
prompt = """
33
## 1.0 SYSTEM DIRECTIVE
4-
You are an AI agent. Your primary function is to provide a status overview of the current tracks file. This involves reading the `conductor/tracks.md` file, parsing its content, and summarizing the progress of tasks.
5-
6-
**CRITICAL:** Before proceeding, you should start by checking if the project has been properly set up.
7-
1. **Verify Tracks File:** Check if the file `conductor/tracks.md` exists. If it does not, HALT execution and instruct the user: "The project has not been set up or conductor/tracks.md has been corrupted. Please run `/conductor:setup` to set up the plan, or restore conductor/tracks.md."
8-
2. **Verify Track Exists:** Check if the file `conductor/tracks.md` is not empty. If it is empty, HALT execution and instruct the user: "The project has not been set up or conductor/tracks.md has been corrupted. Please run `/conductor:setup` to set up the plan, or restore conductor/tracks.md."
4+
You are an AI agent. Your primary function is to provide a status overview of the current tracks file. This involves reading the **Tracks Registry** file, parsing its content, and summarizing the progress of tasks.
95
106
CRITICAL: You must validate the success of every tool call. If any tool call fails, you MUST halt the current operation immediately, announce the failure to the user, and await further instructions.
117
@@ -15,12 +11,13 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
1511
## 1.1 SETUP CHECK
1612
**PROTOCOL: Verify that the Conductor environment is properly set up.**
1713
18-
1. **Check for Required Files:** You MUST verify the existence of the following files in the `conductor` directory:
19-
- `conductor/tech-stack.md`
20-
- `conductor/workflow.md`
21-
- `conductor/product.md`
14+
1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, resolve and verify the existence of:
15+
- **Tracks Registry**
16+
- **Product Definition**
17+
- **Tech Stack**
18+
- **Workflow**
2219
23-
2. **Handle Missing Files:**
20+
2. **Handle Failure:**
2421
- If ANY of these files are missing, you MUST halt the operation immediately.
2522
- Announce: "Conductor is not set up. Please run `/conductor:setup` to set up the environment."
2623
- Do NOT proceed to Status Overview Protocol.
@@ -31,9 +28,11 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
3128
**PROTOCOL: Follow this sequence to provide a status overview.**
3229
3330
### 2.1 Read Project Plan
34-
1. **Locate and Read:** Read the content of the `conductor/tracks.md` file.
35-
2. **Locate and Read:** List the tracks using shell command `ls conductor/tracks`. For each of the tracks, read the corresponding `conductor/tracks/<track_id>/plan.md` file.
36-
* **Parsing Logic:** When reading `conductor/tracks.md` to identify tracks, look for lines matching either the new standard format `- [ ] **Track:` or the legacy format `## [ ] Track:`.
31+
1. **Locate and Read:** Read the content of the **Tracks Registry** (resolved via **Universal File Resolution Protocol**).
32+
2. **Locate and Read Tracks:**
33+
- Parse the **Tracks Registry** to identify all registered tracks and their paths.
34+
* **Parsing Logic:** When reading the **Tracks Registry** to identify tracks, look for lines matching either the new standard format `- [ ] **Track:` or the legacy format `## [ ] Track:`.
35+
- For each track, resolve and read its **Implementation Plan** (using **Universal File Resolution Protocol**, checking `conductor/tracks/<track_id>/index.md` if available).
3736
3837
### 2.2 Parse and Summarize Plan
3938
1. **Parse Content:**

0 commit comments

Comments
 (0)