Skip to content

Commit 68a2a2c

Browse files
committed
feat(setup): implement shallow artifact inference with state priority table
1 parent 276f964 commit 68a2a2c

1 file changed

Lines changed: 28 additions & 40 deletions

File tree

commands/conductor/setup.toml

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,28 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
2222
2323
---
2424
25-
## 1.2 BEGIN `RESUME` CHECK
26-
**PROTOCOL: Before starting the setup, determine the project's state using the state file.**
27-
28-
1. **Read State File:** Check for the existence of `conductor/setup_state.json`.
29-
- If it does not exist, this is a new project setup. Proceed directly to Step 1.2.
30-
- If it exists, read its content.
31-
32-
2. **Resume Based on State:**
33-
- Let the value of `last_successful_step` in the JSON file be `STEP`.
34-
- Based on the value of `STEP`, jump to the **next logical section**:
35-
36-
- If `STEP` is "2.1_product_guide", announce "Resuming setup: The Product Guide (`product.md`) is already complete. Next, we will create the Product Guidelines." and proceed to **Section 2.2**.
37-
- If `STEP` is "2.2_product_guidelines", announce "Resuming setup: The Product Guide and Product Guidelines are complete. Next, we will define the Technology Stack." and proceed to **Section 2.3**.
38-
- If `STEP` is "2.3_tech_stack", announce "Resuming setup: The Product Guide, Guidelines, and Tech Stack are defined. Next, we will select Code Styleguides." and proceed to **Section 2.4**.
39-
- If `STEP` is "2.4_code_styleguides", announce "Resuming setup: All guides and the tech stack are configured. Next, we will define the project workflow." and proceed to **Section 2.5**.
40-
- If `STEP` is "2.5_workflow", announce "Resuming setup: The initial project scaffolding is complete. Next, we will generate the first track." and proceed to **Phase 2 (3.0)**.
41-
- If `STEP` is "3.3_initial_track_generated":
42-
- Announce: "The project has already been initialized. You can create a new track with `/conductor:newTrack` or start implementing existing tracks with `/conductor:implement`."
43-
- Halt the `setup` process.
44-
- If `STEP` is unrecognized, announce an error and halt.
25+
## 1.2 PROJECT AUDIT
26+
**PROTOCOL: Before starting the setup, determine the project's state by auditing existing artifacts.**
27+
28+
1. **Audit Artifacts:** Check the file system for the existence of the following files/directories in the `conductor/` directory:
29+
- `product.md`
30+
- `product-guidelines.md`
31+
- `tech-stack.md`
32+
- `code_styleguides/`
33+
- `workflow.md`
34+
- `tracks/`
35+
36+
2. **Determine Entry Point:** Map the project's state to the starting section using the following priority table (highest match wins):
37+
38+
| Artifact Exists | Resume At | Announcement |
39+
| :--- | :--- | :--- |
40+
| `tracks/` | **HALT** | "The project is already initialized. Use `/conductor:newTrack` or `/conductor:implement`." |
41+
| `workflow.md` | **Section 3.0** | "Resuming setup: Scaffolding is complete. Next: generate the first track." |
42+
| `code_styleguides/` | **Section 2.5** | "Resuming setup: Guides/Tech Stack configured. Next: define project workflow." |
43+
| `tech-stack.md` | **Section 2.4** | "Resuming setup: Tech Stack defined. Next: select Code Styleguides." |
44+
| `product-guidelines.md` | **Section 2.3** | "Resuming setup: Guidelines are complete. Next: define the Technology Stack." |
45+
| `product.md` | **Section 2.2** | "Resuming setup: Product Guide is complete. Next: create Product Guidelines." |
46+
| (None) | **Section 2.0** | (None) |
4547
4648
---
4749
@@ -112,8 +114,6 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
112114
- **CRITICAL: You MUST NOT execute any tool calls until the user has provided a response.**
113115
- **Upon receiving the user's response:**
114116
- Execute `mkdir -p conductor`.
115-
- **Initialize State File:** Immediately after creating the `conductor` directory, you MUST create `conductor/setup_state.json` with the exact content:
116-
`{"last_successful_step": ""}`
117117
- Write the user's response into `conductor/product.md` under a header named `# Initial Concept`.
118118
119119
5. **Continue:** Immediately proceed to the next section.
@@ -164,9 +164,7 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
164164
- Label: "Approve", Description: "The guide looks good, proceed to the next step."
165165
- Label: "Suggest changes", Description: "I want to modify the drafted content."
166166
6. **Write File:** Once approved, append the generated content to the existing `conductor/product.md` file, preserving the `# Initial Concept` section.
167-
7. **Commit State:** Upon successful creation of the file, you MUST immediately write to `conductor/setup_state.json` with the exact content:
168-
`{"last_successful_step": "2.1_product_guide"}`
169-
8. **Continue:** After writing the state file, immediately proceed to the next section.
167+
7. **Continue:** Immediately proceed to the next section.
170168
171169
### 2.2 Generate Product Guidelines (Interactive)
172170
1. **Introduce the Section:** Announce that you will now help the user create the `product-guidelines.md`.
@@ -214,9 +212,7 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
214212
- Label: "Approve", Description: "The guidelines look good, proceed to the next step."
215213
- Label: "Suggest changes", Description: "I want to modify the drafted content."
216214
6. **Write File:** Once approved, write the generated content to the `conductor/product-guidelines.md` file.
217-
7. **Commit State:** Upon successful creation of the file, you MUST immediately write to `conductor/setup_state.json` with the exact content:
218-
`{"last_successful_step": "2.2_product_guidelines"}`
219-
8. **Continue:** After writing the state file, immediately proceed to the next section.
215+
7. **Continue:** Immediately proceed to the next section.
220216
221217
### 2.3 Generate Tech Stack (Interactive)
222218
1. **Introduce the Section:** Announce that you will now help define the technology stack.
@@ -272,9 +268,7 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
272268
- Label: "Approve", Description: "The tech stack looks good, proceed to the next step."
273269
- Label: "Suggest changes", Description: "I want to modify the drafted content."
274270
6. **Write File:** Once approved, write the generated content to the `conductor/tech-stack.md` file.
275-
7. **Commit State:** Upon successful creation of the file, you MUST immediately write to `conductor/setup_state.json` with the exact content:
276-
`{"last_successful_step": "2.3_tech_stack"}`
277-
8. **Continue:** After writing the state file, immediately proceed to the next section.
271+
7. **Continue:** Immediately proceed to the next section.
278272
279273
### 2.4 Select Guides (Interactive)
280274
1. **Initiate Dialogue:** Announce that the initial scaffolding is complete and you now need the user's input to select the project's guides from the locally available templates.
@@ -317,9 +311,7 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
317311
- **Method:** Use a single `ask_user` tool call. Dynamically split the available guides into batches of 4 options max. Create one `multiSelect: true` question for each batch.
318312
319313
3. **Action:** Construct and execute a command to create the directory and copy all selected files. For example: `mkdir -p conductor/code_styleguides && cp ~/.gemini/extensions/conductor/templates/code_styleguides/python.md ~/.gemini/extensions/conductor/templates/code_styleguides/javascript.md conductor/code_styleguides/`
320-
4. **Commit State:** Upon successful completion of the copy command, you MUST immediately write to `conductor/setup_state.json` with the exact content:
321-
`{"last_successful_step": "2.4_code_styleguides"}`
322-
5. **Continue:** Immediately proceed to the next section.
314+
4. **Continue:** Immediately proceed to the next section.
323315
324316
### 2.5 Select Workflow (Interactive)
325317
1. **Copy Initial Workflow:**
@@ -365,8 +357,7 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
365357
Is there anything else you'd like to change or add to the workflow? (Leave blank to finish or type your additional requirements).
366358
367359
4. **Action:** Update `conductor/workflow.md` based on all user answers from both steps.
368-
5. **Commit State:** After the `workflow.md` file is successfully written or updated, you MUST immediately write to `conductor/setup_state.json` with the exact content:
369-
`{"last_successful_step": "2.5_workflow"}`
360+
370361
371362
### 2.6 Finalization
372363
1. **Generate Index File:**
@@ -486,10 +477,7 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
486477
- [Metadata](./metadata.json)
487478
```
488479
489-
d. **Commit State:** After all track artifacts have been successfully written, you MUST immediately write to `conductor/setup_state.json` with the exact content:
490-
`{"last_successful_step": "3.3_initial_track_generated"}`
491-
492-
e. **Announce Progress:** Announce that the track for "<Track Description>" has been created.
480+
d. **Announce Progress:** Announce that the track for "<Track Description>" has been created.
493481
494482
### 3.4 Final Announcement
495483
1. **Announce Completion:** After the track has been created, announce that the project setup and initial track generation are complete.

0 commit comments

Comments
 (0)