create-conductor-flow 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # Conductor Init
2
+
3
+ [![npm version](https://badge.fury.io/js/conductor-init.svg)](https://badge.fury.io/js/conductor-init)
4
+
5
+ <img src="./conductor_init_banner.png" height="400" alt="Conductor Init Banner" />
6
+
7
+ [English](./README.md) | [中文](./README_zh.md) | [日本語](./README_ja.md) | [한국어](./README_ko.md)
8
+
9
+ **Conductor Init** is a **Conductor Scaffolding CLI** that generates spec-driven, portable **Gemini [Conductor](https://github.com/gemini-cli-extensions/conductor)** workflows for **any** AI coding agent via `npx`. It enables the **[context-first evolution of spec-driven development](https://blog.jonkimi.com/2026/02/01/en/Vibe-Coding-with-context-driven-development-using-Conductor-for-Gemini-CLI/)** for **Claude Code**, **OpenCode**, **Cursor**, **Kilo Code**, and other leading AI Coding Assistants.
10
+
11
+ Originally developed for the Gemini CLI, the **Conductor** is now decoupled by this project, **empowering developers to maintain context, manage tasks, and orchestrate complex features**. It serves as a bridge between human intent and AI execution, ensuring "Context is King" in the era of Agentic AI.
12
+
13
+ ## 🎯 Goals
14
+
15
+ - **Universal Compatibility:** Enable the Conductor methodology outside of the Gemini CLI ecosystem.
16
+ - **Agent-Agnostic Setup:** Provide a mechanism to "install" Conductor commands and templates into a project, effectively "enabling" it for consumption by multiple different coding agents.
17
+ - **Standardization:** Create a unified interface for project orchestration that bridges the gap between human intent and AI execution.
18
+
19
+ ## ✨ Key Features
20
+
21
+ - **Universal AI Compatibility**: Works out-of-the-box with **Opencode**, **Claude Code**, **Antigravity**, **Cursor**, **VS Code Copilot**, **Codex**, **Windsurf**, **Cline**, **Kilo Code**, **Roo Code**, **Qwen Code**, **Factory Droid**, and **Gemini CLI**.
22
+ - **Context Management**: Structured artifacts (`spec.md`, `plan.md`) keep your AI agent focused and context-aware.
23
+ - **Spec-Driven Development**: Define *what* you want before asking the AI *how* to build it.
24
+ - **Agent-Agnostic Workflows**: Switch between agents without losing project context or progress.
25
+ - **Easy Initialization**: Single command setup with `npx conductor-init`.
26
+ - **Git Ignore Configuration**: Automatically configure `.gitignore` or `.git/info/exclude` to exclude agent configuration files from version control.
27
+
28
+ ## 🚀 Usage
29
+
30
+ ### 1. Setup Conductor in Your Project
31
+
32
+ ```text
33
+ conductor-init [path] [options]
34
+
35
+ Positionals:
36
+ path Directory to install Conductor [string] [default: "."]
37
+
38
+ Options:
39
+ -a, --agent Specify the coding agent
40
+ [string] [choices: "opencode", "claude-code", "antigravity", "cursor",
41
+ "vscode-copilot", "codex", "windsurf", "cline", "kilo-code", "roo-code",
42
+ "qwen-code", "factory-droid", "gemini"]
43
+ -r, --repo Git repository URL for conductor. If used without value,
44
+ defaults to official repository. [string]
45
+ -b, --branch Branch name for conductor repository
46
+ [string] [default: "main"]
47
+ -s, --scope Installation scope (project or global)
48
+ [string] [choices: "project", "global"]
49
+ -g, --git-ignore Configure git ignore for Conductor files (gitignore: add to
50
+ .gitignore, exclude: add to .git/info/exclude, none: remove
51
+ entries) [string] [choices: "gitignore", "exclude", "none"]
52
+ -f, --force Force overwrite existing installation
53
+ [boolean] [default: false]
54
+ -h, --help Show help [boolean]
55
+ -v, --version Show version number [boolean]
56
+
57
+ Examples:
58
+ conductor-init Install with interactive prompts
59
+ conductor-init --agent claude-code Install for Claude Code agent
60
+ conductor-init --git-ignore gitignore Add Conductor files to .gitignore
61
+ conductor-init --git-ignore exclude Add Conductor files to
62
+ .git/info/exclude
63
+ conductor-init --git-ignore none Remove Conductor entries from git
64
+ ignore
65
+ ```
66
+
67
+ To initialize Conductor in your project, simply run the following command in your project root:
68
+
69
+ ```bash
70
+ npx conductor-init
71
+ ```
72
+
73
+ You can also specify a custom template repository and branch:
74
+
75
+ ```bash
76
+ npx conductor-init --repo https://github.com/your-org/custom-conductor --branch v2
77
+ ```
78
+
79
+ Or specify the agent directly:
80
+
81
+ ```bash
82
+ npx conductor-init --agent claude-code
83
+ ```
84
+
85
+ ### 2. Alternative: Build from Source
86
+
87
+ If you prefer to build from source:
88
+
89
+ ```bash
90
+ pnpm install
91
+ pnpm build
92
+ node dist/index.js
93
+ ```
94
+
95
+ You will be prompted to select your AI Coding Agent:
96
+ - **Opencode**
97
+ - **Claude Code**
98
+ - **Antigravity**
99
+ - **Cursor**
100
+ - **VS Code Copilot**
101
+ - **Codex**
102
+ - **Windsurf**
103
+ - **Cline**
104
+ - **Kilo Code**
105
+ - **Roo Code**
106
+ - **Qwen Code**
107
+ - **Factory Droid**
108
+ - **Gemini CLI**
109
+
110
+ This will verify the environment and install the necessary Conductor files:
111
+ - **Commands:** Agent-specific prompt or command files (e.g., `.opencode/commands/conductor-setup.md` or `.gemini/commands/setup.toml`) that your agent can execute.
112
+ - **Templates:** Workflow guides and style guides (e.g., `.opencode/conductor/templates/`).
113
+
114
+ ### 3. Shell Completion
115
+
116
+ Enable tab completion for specific shells (Bash, Zsh) to make using `conductor-init` easier.
117
+
118
+ #### Zsh (Recommended)
119
+
120
+ **Option 1: Source from file (Best for performance)**
121
+
122
+ Generate the script to a file and source it in your `.zshrc`:
123
+
124
+ ```zsh
125
+ mkdir -p ~/.config/conductor
126
+ conductor-init completion > ~/.config/conductor/completion.zsh
127
+ echo 'source ~/.config/conductor/completion.zsh' >> ~/.zshrc
128
+ source ~/.zshrc
129
+ ```
130
+
131
+ **Option 2: One-liner**
132
+
133
+ Add this directly to your `.zshrc` (easiest setup):
134
+
135
+ ```zsh
136
+ echo 'source <(conductor-init completion)' >> ~/.zshrc
137
+ source ~/.zshrc
138
+ ```
139
+
140
+ #### Bash
141
+
142
+ Add the completion script to your `.bashrc`:
143
+
144
+ ```bash
145
+ conductor-init completion >> ~/.bashrc
146
+ source ~/.bashrc
147
+ ```
148
+
149
+ ### 4. Using Conductor with Your Agent
150
+
151
+ Once installed, you can instruct your AI Agent to perform Conductor tasks using the installed commands. For example:
152
+
153
+ - `/conductor-setup` - Initialize the project structure.
154
+ - `/conductor-newTrack` - Start a new feature or bug fix track.
155
+ - `/conductor-implement` - Implement the selected track.
156
+ - `/conductor-review` - Review the completed track work against guidelines and the plan.
157
+ - `/conductor-revert` - Revert previous work.
158
+ - `/conductor-status` - Check the status of current tracks.
159
+
160
+ *Note: The exact invocation syntax depends on your specific agent's slash command or file context capabilities.*
161
+
162
+
163
+
164
+ ## 🙏 Acknowledgements
165
+
166
+ This project is inspired by and based on the [Conductor](https://github.com/gemini-cli-extensions/conductor) and [Conductor-for-all](https://github.com/hlhr202/Conductor-for-all).
@@ -0,0 +1,41 @@
1
+ # Conductor Context
2
+
3
+ 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:**
13
+ a. Resolve and read the **Tracks Registry** (via Project Context).
14
+ b. Find the entry for the specific `<track_id>`.
15
+ c. Follow the link provided in the registry to locate the track's folder. The index file is `<track_folder>/index.md`.
16
+ d. **Fallback:** If the track is not yet registered (e.g., during creation) or the link is broken:
17
+ 1. Resolve the **Tracks Directory** (via Project Context).
18
+ 2. The index file is `<Tracks Directory>/<track_id>/index.md`.
19
+
20
+ 2. **Check Index:** Read the index file and look for a link with a matching or semantically similar label.
21
+
22
+ 3. **Resolve Path:** If a link is found, resolve its path **relative to the directory containing the `index.md` file**.
23
+ - *Example:* If `conductor/index.md` links to `./workflow.md`, the full path is `conductor/workflow.md`.
24
+
25
+ 4. **Fallback:** If the index file is missing or the link is absent, use the **Default Path** keys below.
26
+
27
+ 5. **Verify:** You MUST verify the resolved file actually exists on the disk.
28
+
29
+ **Standard Default Paths (Project):**
30
+ - **Product Definition**: `conductor/product.md`
31
+ - **Tech Stack**: `conductor/tech-stack.md`
32
+ - **Workflow**: `conductor/workflow.md`
33
+ - **Product Guidelines**: `conductor/product-guidelines.md`
34
+ - **Tracks Registry**: `conductor/tracks.md`
35
+ - **Tracks Directory**: `conductor/tracks/`
36
+
37
+ **Standard Default Paths (Track):**
38
+ - **Specification**: `conductor/tracks/<track_id>/spec.md`
39
+ - **Implementation Plan**: `conductor/tracks/<track_id>/plan.md`
40
+ - **Metadata**: `conductor/tracks/<track_id>/metadata.json`
41
+
@@ -0,0 +1,179 @@
1
+ description = "Executes the tasks defined in the specified track's plan"
2
+ prompt = """
3
+ ## 1.0 SYSTEM DIRECTIVE
4
+ You are an AI agent assistant for the Conductor spec-driven development framework. Your current task is to implement a track. You MUST follow this protocol precisely.
5
+
6
+ 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.
7
+
8
+ ---
9
+
10
+ ## 1.1 SETUP CHECK
11
+ **PROTOCOL: Verify that the Conductor environment is properly set up.**
12
+
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**
17
+
18
+ 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.
19
+
20
+
21
+ ---
22
+
23
+ ## 2.0 TRACK SELECTION
24
+ **PROTOCOL: Identify and select the track to be implemented.**
25
+
26
+ 1. **Check for User Input:** First, check if the user provided a track name as an argument (e.g., `/conductor-implement <track_description>`).
27
+
28
+ 2. **Locate and Parse Tracks Registry:**
29
+ - Resolve the **Tracks Registry**.
30
+ - 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.
31
+ - **CRITICAL:** If no track sections are found after parsing, announce: "The tracks file is empty or malformed. No tracks to implement." and halt.
32
+
33
+ 3. **Continue:** Immediately proceed to the next step to select a track.
34
+
35
+ 4. **Select Track:**
36
+ - **If a track name was provided:**
37
+ 1. Perform an exact, case-insensitive match for the provided name against the track descriptions you parsed.
38
+ 2. If a unique match is found, confirm the selection with the user: "I found track '<track_description>'. Is this correct?"
39
+ 3. If no match is found, or if the match is ambiguous, inform the user and ask for clarification. Suggest the next available track as below.
40
+ - **If no track name was provided (or if the previous step failed):**
41
+ 1. **Identify Next Track:** Find the first track in the parsed tracks file that is NOT marked as `[x] Completed`.
42
+ 2. **If a next track is found:**
43
+ - Announce: "No track name provided. Automatically selecting the next incomplete track: '<track_description>'."
44
+ - Proceed with this track.
45
+ 3. **If no incomplete tracks are found:**
46
+ - Announce: "No incomplete tracks found in the tracks file. All tasks are completed!"
47
+ - Halt the process and await further user instructions.
48
+
49
+ 5. **Handle No Selection:** If no track is selected, inform the user and await further instructions.
50
+
51
+ ---
52
+
53
+ ## 3.0 TRACK IMPLEMENTATION
54
+ **PROTOCOL: Execute the selected track.**
55
+
56
+ 1. **Announce Action:** Announce which track you are beginning to implement.
57
+
58
+ 2. **Update Status to 'In Progress':**
59
+ - Before beginning any work, you MUST update the status of the selected track in the **Tracks Registry** file.
60
+ - This requires finding the specific heading for the track (e.g., `## [ ] Track: <Description>`) and replacing it with the updated status (e.g., `## [~] Track: <Description>`) in the **Tracks Registry** file you identified earlier.
61
+
62
+ 3. **Load Track Context:**
63
+ a. **Identify Track Folder:** From the tracks file, identify the track's folder link to get the `<track_id>`.
64
+ b. **Read Files:**
65
+ - **Track Context:** Using the **Universal File Resolution Protocol**, resolve and read the **Specification** and **Implementation Plan** for the selected track.
66
+ - **Workflow:** Resolve **Workflow** (via the **Universal File Resolution Protocol** using the project's index file).
67
+ c. **Error Handling:** If you fail to read any of these files, you MUST stop and inform the user of the error.
68
+
69
+ 4. **Execute Tasks and Update Track Plan:**
70
+ a. **Announce:** State that you will now execute the tasks from the track's **Implementation Plan** by following the procedures in the **Workflow**.
71
+ b. **Iterate Through Tasks:** You MUST now loop through each task in the track's **Implementation Plan** one by one.
72
+ c. **For Each Task, You MUST:**
73
+ i. **Defer to Workflow:** The **Workflow** file is the **single source of truth** for the entire task lifecycle. You MUST now read and execute the procedures defined in the "Task Workflow" section of the **Workflow** file you have in your context. Follow its steps for implementation, testing, and committing precisely.
74
+
75
+ 5. **Finalize Track:**
76
+ - After all tasks in the track's local **Implementation Plan** are completed, you MUST update the track's status in the **Tracks Registry**.
77
+ - This requires finding the specific heading for the track (e.g., `## [~] Track: <Description>`) and replacing it with the completed status (e.g., `## [x] Track: <Description>`).
78
+ - **Commit Changes:** Stage the **Tracks Registry** file and commit with the message `chore(conductor): Mark track '<track_description>' as complete`.
79
+ - Announce that the track is fully complete and the tracks file has been updated.
80
+
81
+ ---
82
+
83
+ ## 4.0 SYNCHRONIZE PROJECT DOCUMENTATION
84
+ **PROTOCOL: Update project-level documentation based on the completed track.**
85
+
86
+ 1. **Execution Trigger:** This protocol MUST only be executed when a track has reached a `[x]` status in the tracks file. DO NOT execute this protocol for any other track status changes.
87
+
88
+ 2. **Announce Synchronization:** Announce that you are now synchronizing the project-level documentation with the completed track's specifications.
89
+
90
+ 3. **Load Track Specification:** Read the track's **Specification**.
91
+
92
+ 4. **Load Project Documents:**
93
+ - Resolve and read:
94
+ - **Product Definition**
95
+ - **Tech Stack**
96
+ - **Product Guidelines**
97
+
98
+ 5. **Analyze and Update:**
99
+ a. **Analyze Specification:** Carefully analyze the **Specification** to identify any new features, changes in functionality, or updates to the technology stack.
100
+ b. **Update Product Definition:**
101
+ i. **Condition for Update:** Based on your analysis, you MUST determine if the completed feature or bug fix significantly impacts the description of the product itself.
102
+ ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation:
103
+ > "Based on the completed track, I propose the following updates to the **Product Definition**:"
104
+ > ```diff
105
+ > [Proposed changes here, ideally in a diff format]
106
+ > ```
107
+ > "Do you approve these changes? (yes/no)"
108
+ iii. **Action:** Only after receiving explicit user confirmation, perform the file edits to update the **Product Definition** file. Keep a record of whether this file was changed.
109
+ c. **Update Tech Stack:**
110
+ i. **Condition for Update:** Similarly, you MUST determine if significant changes in the technology stack are detected as a result of the completed track.
111
+ ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation:
112
+ > "Based on the completed track, I propose the following updates to the **Tech Stack**:"
113
+ > ```diff
114
+ > [Proposed changes here, ideally in a diff format]
115
+ > ```
116
+ > "Do you approve these changes? (yes/no)"
117
+ iii. **Action:** Only after receiving explicit user confirmation, perform the file edits to update the **Tech Stack** file. Keep a record of whether this file was changed.
118
+ d. **Update Product Guidelines (Strictly Controlled):**
119
+ i. **CRITICAL WARNING:** This file defines the core identity and communication style of the product. It should be modified with extreme caution and ONLY in cases of significant strategic shifts, such as a product rebrand or a fundamental change in user engagement philosophy. Routine feature updates or bug fixes should NOT trigger changes to this file.
120
+ ii. **Condition for Update:** You may ONLY propose an update to this file if the track's **Specification** explicitly describes a change that directly impacts branding, voice, tone, or other core product guidelines.
121
+ iii. **Propose and Confirm Changes:** If the conditions are met, you MUST generate the proposed changes and present them to the user with a clear warning:
122
+ > "WARNING: The completed track suggests a change to the core **Product Guidelines**. This is an unusual step. Please review carefully:"
123
+ > ```diff
124
+ > [Proposed changes here, ideally in a diff format]
125
+ > ```
126
+ > "Do you approve these critical changes to the **Product Guidelines**? (yes/no)"
127
+ iv. **Action:** Only after receiving explicit user confirmation, perform the file edits. Keep a record of whether this file was changed.
128
+
129
+ 6. **Final Report:** Announce the completion of the synchronization process and provide a summary of the actions taken.
130
+ - **Construct the Message:** Based on the records of which files were changed, construct a summary message.
131
+ - **Commit Changes:**
132
+ - If any files were changed (**Product Definition**, **Tech Stack**, or **Product Guidelines**), you MUST stage them and commit them.
133
+ - **Commit Message:** `docs(conductor): Synchronize docs for track '<track_description>'`
134
+ - **Example (if Product Definition was changed, but others were not):**
135
+ > "Documentation synchronization is complete.
136
+ > - **Changes made to Product Definition:** The user-facing description of the product was updated to include the new feature.
137
+ > - **No changes needed for Tech Stack:** The technology stack was not affected.
138
+ > - **No changes needed for Product Guidelines:** Core product guidelines remain unchanged."
139
+ - **Example (if no files were changed):**
140
+ > "Documentation synchronization is complete. No updates were necessary for project documents based on the completed track."
141
+
142
+ ---
143
+
144
+ ## 5.0 TRACK CLEANUP
145
+ **PROTOCOL: Offer to archive or delete the completed track.**
146
+
147
+ 1. **Execution Trigger:** This protocol MUST only be executed after the current track has been successfully implemented and the `SYNCHRONIZE PROJECT DOCUMENTATION` step is complete.
148
+
149
+ 2. **Ask for User Choice:** You MUST prompt the user with the available options for the completed track.
150
+ > "Track '<track_description>' is now complete. What would you like to do?
151
+ > A. **Review (Recommended):** Run the review command to verify changes before finalizing.
152
+ > B. **Archive:** Move the track's folder to `conductor/archive/` and remove it from the tracks file.
153
+ > C. **Delete:** Permanently delete the track's folder and remove it from the tracks file.
154
+ > D. **Skip:** Do nothing and leave it in the tracks file.
155
+ > Please enter the option of your choice (A, B, C, or D)."
156
+
157
+ 3. **Handle User Response:**
158
+ * **If user chooses "A" (Review):**
159
+ * Announce: "Please run `/conductor-review` to verify your changes. You will be able to archive or delete the track after the review."
160
+ * **If user chooses "B" (Archive):**
161
+ i. **Create Archive Directory:** Check for the existence of `conductor/archive/`. If it does not exist, create it.
162
+ ii. **Archive Track Folder:** Move the track's folder from its current location (resolved via the **Tracks Directory**) to `conductor/archive/<track_id>`.
163
+ iii. **Remove from Tracks File:** Read the content of the **Tracks Registry** file, remove the entire section for the completed track (the part that starts with `---` and contains the track description), and write the modified content back to the file.
164
+ iv. **Commit Changes:** Stage the **Tracks Registry** file and `conductor/archive/`. Commit with the message `chore(conductor): Archive track '<track_description>'`.
165
+ v. **Announce Success:** Announce: "Track '<track_description>' has been successfully archived."
166
+ * **If user chooses "C" (Delete):**
167
+ i. **CRITICAL WARNING:** Before proceeding, you MUST ask for a final confirmation due to the irreversible nature of the action.
168
+ > "WARNING: This will permanently delete the track folder and all its contents. This action cannot be undone. Are you sure you want to proceed? (yes/no)"
169
+ ii. **Handle Confirmation:**
170
+ - **If 'yes'**:
171
+ a. **Delete Track Folder:** Resolve the **Tracks Directory** and permanently delete the track's folder from `<Tracks Directory>/<track_id>`.
172
+ b. **Remove from Tracks File:** Read the content of the **Tracks Registry** file, remove the entire section for the completed track, and write the modified content back to the file.
173
+ c. **Commit Changes:** Stage the **Tracks Registry** file and the deletion of the track directory. Commit with the message `chore(conductor): Delete track '<track_description>'`.
174
+ d. **Announce Success:** Announce: "Track '<track_description>' has been permanently deleted."
175
+ - **If 'no' (or anything else)**:
176
+ a. **Announce Cancellation:** Announce: "Deletion cancelled. The track has not been changed."
177
+ * **If user chooses "D" (Skip) or provides any other input:**
178
+ * Announce: "Okay, the completed track will remain in your tracks file for now."
179
+ """