claude-code-conductor 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 +201 -0
- package/README.md +72 -0
- package/conductor/archive/init_cli_setup_20260107/metadata.json +8 -0
- package/conductor/archive/init_cli_setup_20260107/plan.md +22 -0
- package/conductor/archive/init_cli_setup_20260107/spec.md +78 -0
- package/conductor/archive/npm_publish_20260107/metadata.json +8 -0
- package/conductor/archive/npm_publish_20260107/plan.md +18 -0
- package/conductor/archive/npm_publish_20260107/spec.md +34 -0
- package/conductor/code_styleguides/javascript.md +51 -0
- package/conductor/code_styleguides/typescript.md +43 -0
- package/conductor/product-guidelines.md +16 -0
- package/conductor/product.md +20 -0
- package/conductor/setup_state.json +1 -0
- package/conductor/tech-stack.md +19 -0
- package/conductor/tracks/rename_cli_20260107/metadata.json +8 -0
- package/conductor/tracks/rename_cli_20260107/plan.md +25 -0
- package/conductor/tracks/rename_cli_20260107/spec.md +25 -0
- package/conductor/tracks.md +11 -0
- package/conductor/workflow.md +333 -0
- package/dist/bin/claude-code-conductor.js +30 -0
- package/dist/bin/claude-conductor.js +30 -0
- package/dist/src/commands/implement.js +15 -0
- package/dist/src/commands/init.js +24 -0
- package/dist/src/commands/setup.js +30 -0
- package/dist/src/commands/status.js +15 -0
- package/dist/src/index.js +4 -0
- package/dist/src/services/CommandRegistrar.js +26 -0
- package/dist/src/services/FileGenerator.js +42 -0
- package/dist/src/services/ProjectDiscovery.js +48 -0
- package/dist/src/services/SetupWizard.js +40 -0
- package/package.json +52 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Specification: Rename to Claude Code Conductor
|
|
2
|
+
|
|
3
|
+
## 1. Overview
|
|
4
|
+
The project needs to be renamed from `claude-conductor` to `claude-code-conductor` because the former name is already taken on npm. This change will affect the package metadata, the CLI executable command, and user-facing documentation/strings. This is a "Surface Refactor," meaning internal code identifiers will largely remain unchanged to ensure stability.
|
|
5
|
+
|
|
6
|
+
## 2. Functional Requirements
|
|
7
|
+
1. **Package Identity:**
|
|
8
|
+
* Update `package.json` name to `claude-code-conductor`.
|
|
9
|
+
* Update `package.json` description if necessary to reflect the new identity.
|
|
10
|
+
2. **CLI Command:**
|
|
11
|
+
* Replace the `claude-conductor` binary command with `claude-code-conductor`.
|
|
12
|
+
* Rename the bin script (e.g., `bin/claude-conductor.ts` -> `bin/claude-code-conductor.ts`).
|
|
13
|
+
* Ensure `npm link` or `npm install -g` exposes the new command.
|
|
14
|
+
3. **User Interface:**
|
|
15
|
+
* Update CLI output headers, help text, and welcome messages to read "Claude Code Conductor".
|
|
16
|
+
* Update error messages that reference the tool name.
|
|
17
|
+
|
|
18
|
+
## 3. Documentation
|
|
19
|
+
1. **README:** Update all references to the installation and usage commands.
|
|
20
|
+
2. **Conductor Docs:** Update `conductor/` context files (e.g., `product.md`, `tech-stack.md`) if they reference the CLI command explicitly.
|
|
21
|
+
|
|
22
|
+
## 4. Out of Scope
|
|
23
|
+
1. Deep refactoring of internal TypeScript classes (e.g., `class ClaudeConductor` will remain as is).
|
|
24
|
+
2. Renaming of internal source files (other than the main bin entry point).
|
|
25
|
+
3. Backward compatibility aliases (the old command will be removed).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Project Tracks
|
|
2
|
+
|
|
3
|
+
This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [x] Track: Rename claude-conductor to claude-code-conductor
|
|
11
|
+
*Link: [./conductor/tracks/rename_cli_20260107/](./conductor/tracks/rename_cli_20260107/)*
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# Project Workflow
|
|
2
|
+
|
|
3
|
+
## Guiding Principles
|
|
4
|
+
|
|
5
|
+
1. **The Plan is the Source of Truth:** All work must be tracked in `plan.md`
|
|
6
|
+
2. **The Tech Stack is Deliberate:** Changes to the tech stack must be documented in `tech-stack.md` *before* implementation
|
|
7
|
+
3. **Test-Driven Development:** Write unit tests before implementing functionality
|
|
8
|
+
4. **High Code Coverage:** Aim for >80% code coverage for all modules
|
|
9
|
+
5. **User Experience First:** Every decision should prioritize user experience
|
|
10
|
+
6. **Non-Interactive & CI-Aware:** Prefer non-interactive commands. Use `CI=true` for watch-mode tools (tests, linters) to ensure single execution.
|
|
11
|
+
|
|
12
|
+
## Task Workflow
|
|
13
|
+
|
|
14
|
+
All tasks follow a strict lifecycle:
|
|
15
|
+
|
|
16
|
+
### Standard Task Workflow
|
|
17
|
+
|
|
18
|
+
1. **Select Task:** Choose the next available task from `plan.md` in sequential order
|
|
19
|
+
|
|
20
|
+
2. **Mark In Progress:** Before beginning work, edit `plan.md` and change the task from `[ ]` to `[~]`
|
|
21
|
+
|
|
22
|
+
3. **Write Failing Tests (Red Phase):**
|
|
23
|
+
- Create a new test file for the feature or bug fix.
|
|
24
|
+
- Write one or more unit tests that clearly define the expected behavior and acceptance criteria for the task.
|
|
25
|
+
- **CRITICAL:** Run the tests and confirm that they fail as expected. This is the "Red" phase of TDD. Do not proceed until you have failing tests.
|
|
26
|
+
|
|
27
|
+
4. **Implement to Pass Tests (Green Phase):**
|
|
28
|
+
- Write the minimum amount of application code necessary to make the failing tests pass.
|
|
29
|
+
- Run the test suite again and confirm that all tests now pass. This is the "Green" phase.
|
|
30
|
+
|
|
31
|
+
5. **Refactor (Optional but Recommended):**
|
|
32
|
+
- With the safety of passing tests, refactor the implementation code and the test code to improve clarity, remove duplication, and enhance performance without changing the external behavior.
|
|
33
|
+
- Rerun tests to ensure they still pass after refactoring.
|
|
34
|
+
|
|
35
|
+
6. **Verify Coverage:** Run coverage reports using the project's chosen tools. For example, in a Python project, this might look like:
|
|
36
|
+
```bash
|
|
37
|
+
pytest --cov=app --cov-report=html
|
|
38
|
+
```
|
|
39
|
+
Target: >80% coverage for new code. The specific tools and commands will vary by language and framework.
|
|
40
|
+
|
|
41
|
+
7. **Document Deviations:** If implementation differs from tech stack:
|
|
42
|
+
- **STOP** implementation
|
|
43
|
+
- Update `tech-stack.md` with new design
|
|
44
|
+
- Add dated note explaining the change
|
|
45
|
+
- Resume implementation
|
|
46
|
+
|
|
47
|
+
8. **Commit Code Changes:**
|
|
48
|
+
- Stage all code changes related to the task.
|
|
49
|
+
- Propose a clear, concise commit message e.g, `feat(ui): Create basic HTML structure for calculator`.
|
|
50
|
+
- Perform the commit.
|
|
51
|
+
|
|
52
|
+
9. **Attach Task Summary with Git Notes:**
|
|
53
|
+
- **Step 9.1: Get Commit Hash:** Obtain the hash of the *just-completed commit* (`git log -1 --format="%H"`).
|
|
54
|
+
- **Step 9.2: Draft Note Content:** Create a detailed summary for the completed task. This should include the task name, a summary of changes, a list of all created/modified files, and the core "why" for the change.
|
|
55
|
+
- **Step 9.3: Attach Note:** Use the `git notes` command to attach the summary to the commit.
|
|
56
|
+
```bash
|
|
57
|
+
# The note content from the previous step is passed via the -m flag.
|
|
58
|
+
git notes add -m "<note content>" <commit_hash>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
10. **Get and Record Task Commit SHA:**
|
|
62
|
+
- **Step 10.1: Update Plan:** Read `plan.md`, find the line for the completed task, update its status from `[~]` to `[x]`, and append the first 7 characters of the *just-completed commit's* commit hash.
|
|
63
|
+
- **Step 10.2: Write Plan:** Write the updated content back to `plan.md`.
|
|
64
|
+
|
|
65
|
+
11. **Commit Plan Update:**
|
|
66
|
+
- **Action:** Stage the modified `plan.md` file.
|
|
67
|
+
- **Action:** Commit this change with a descriptive message (e.g., `conductor(plan): Mark task 'Create user model' as complete`).
|
|
68
|
+
|
|
69
|
+
### Phase Completion Verification and Checkpointing Protocol
|
|
70
|
+
|
|
71
|
+
**Trigger:** This protocol is executed immediately after a task is completed that also concludes a phase in `plan.md`.
|
|
72
|
+
|
|
73
|
+
1. **Announce Protocol Start:** Inform the user that the phase is complete and the verification and checkpointing protocol has begun.
|
|
74
|
+
|
|
75
|
+
2. **Ensure Test Coverage for Phase Changes:**
|
|
76
|
+
- **Step 2.1: Determine Phase Scope:** To identify the files changed in this phase, you must first find the starting point. Read `plan.md` to find the Git commit SHA of the *previous* phase's checkpoint. If no previous checkpoint exists, the scope is all changes since the first commit.
|
|
77
|
+
- **Step 2.2: List Changed Files:** Execute `git diff --name-only <previous_checkpoint_sha> HEAD` to get a precise list of all files modified during this phase.
|
|
78
|
+
- **Step 2.3: Verify and Create Tests:** For each file in the list:
|
|
79
|
+
- **CRITICAL:** First, check its extension. Exclude non-code files (e.g., `.json`, `.md`, `.yaml`).
|
|
80
|
+
- For each remaining code file, verify a corresponding test file exists.
|
|
81
|
+
- If a test file is missing, you **must** create one. Before writing the test, **first, analyze other test files in the repository to determine the correct naming convention and testing style.** The new tests **must** validate the functionality described in this phase's tasks (`plan.md`).
|
|
82
|
+
|
|
83
|
+
3. **Execute Automated Tests with Proactive Debugging:**
|
|
84
|
+
- Before execution, you **must** announce the exact shell command you will use to run the tests.
|
|
85
|
+
- **Example Announcement:** "I will now run the automated test suite to verify the phase. **Command:** `CI=true npm test`"
|
|
86
|
+
- Execute the announced command.
|
|
87
|
+
- If tests fail, you **must** inform the user and begin debugging. You may attempt to propose a fix a **maximum of two times**. If the tests still fail after your second proposed fix, you **must stop**, report the persistent failure, and ask the user for guidance.
|
|
88
|
+
|
|
89
|
+
4. **Propose a Detailed, Actionable Manual Verification Plan:**
|
|
90
|
+
- **CRITICAL:** To generate the plan, first analyze `product.md`, `product-guidelines.md`, and `plan.md` to determine the user-facing goals of the completed phase.
|
|
91
|
+
- You **must** generate a step-by-step plan that walks the user through the verification process, including any necessary commands and specific, expected outcomes.
|
|
92
|
+
- The plan you present to the user **must** follow this format:
|
|
93
|
+
|
|
94
|
+
**For a Frontend Change:**
|
|
95
|
+
```
|
|
96
|
+
The automated tests have passed. For manual verification, please follow these steps:
|
|
97
|
+
|
|
98
|
+
**Manual Verification Steps:**
|
|
99
|
+
1. **Start the development server with the command:** `npm run dev`
|
|
100
|
+
2. **Open your browser to:** `http://localhost:3000`
|
|
101
|
+
3. **Confirm that you see:** The new user profile page, with the user's name and email displayed correctly.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**For a Backend Change:**
|
|
105
|
+
```
|
|
106
|
+
The automated tests have passed. For manual verification, please follow these steps:
|
|
107
|
+
|
|
108
|
+
**Manual Verification Steps:**
|
|
109
|
+
1. **Ensure the server is running.**
|
|
110
|
+
2. **Execute the following command in your terminal:** `curl -X POST http://localhost:8080/api/v1/users -d '{"name": "test"}'`
|
|
111
|
+
3. **Confirm that you receive:** A JSON response with a status of `201 Created`.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
5. **Await Explicit User Feedback:**
|
|
115
|
+
- After presenting the detailed plan, ask the user for confirmation: "**Does this meet your expectations? Please confirm with yes or provide feedback on what needs to be changed.**"
|
|
116
|
+
- **PAUSE** and await the user's response. Do not proceed without an explicit yes or confirmation.
|
|
117
|
+
|
|
118
|
+
6. **Create Checkpoint Commit:**
|
|
119
|
+
- Stage all changes. If no changes occurred in this step, proceed with an empty commit.
|
|
120
|
+
- Perform the commit with a clear and concise message (e.g., `conductor(checkpoint): Checkpoint end of Phase X`).
|
|
121
|
+
|
|
122
|
+
7. **Attach Auditable Verification Report using Git Notes:**
|
|
123
|
+
- **Step 8.1: Draft Note Content:** Create a detailed verification report including the automated test command, the manual verification steps, and the user's confirmation.
|
|
124
|
+
- **Step 8.2: Attach Note:** Use the `git notes` command and the full commit hash from the previous step to attach the full report to the checkpoint commit.
|
|
125
|
+
|
|
126
|
+
8. **Get and Record Phase Checkpoint SHA:**
|
|
127
|
+
- **Step 7.1: Get Commit Hash:** Obtain the hash of the *just-created checkpoint commit* (`git log -1 --format="%H"`).
|
|
128
|
+
- **Step 7.2: Update Plan:** Read `plan.md`, find the heading for the completed phase, and append the first 7 characters of the commit hash in the format `[checkpoint: <sha>]`.
|
|
129
|
+
- **Step 7.3: Write Plan:** Write the updated content back to `plan.md`.
|
|
130
|
+
|
|
131
|
+
9. **Commit Plan Update:**
|
|
132
|
+
- **Action:** Stage the modified `plan.md` file.
|
|
133
|
+
- **Action:** Commit this change with a descriptive message following the format `conductor(plan): Mark phase '<PHASE NAME>' as complete`.
|
|
134
|
+
|
|
135
|
+
10. **Announce Completion:** Inform the user that the phase is complete and the checkpoint has been created, with the detailed verification report attached as a git note.
|
|
136
|
+
|
|
137
|
+
### Quality Gates
|
|
138
|
+
|
|
139
|
+
Before marking any task complete, verify:
|
|
140
|
+
|
|
141
|
+
- [ ] All tests pass
|
|
142
|
+
- [ ] Code coverage meets requirements (>80%)
|
|
143
|
+
- [ ] Code follows project's code style guidelines (as defined in `code_styleguides/`)
|
|
144
|
+
- [ ] All public functions/methods are documented (e.g., docstrings, JSDoc, GoDoc)
|
|
145
|
+
- [ ] Type safety is enforced (e.g., type hints, TypeScript types, Go types)
|
|
146
|
+
- [ ] No linting or static analysis errors (using the project's configured tools)
|
|
147
|
+
- [ ] Works correctly on mobile (if applicable)
|
|
148
|
+
- [ ] Documentation updated if needed
|
|
149
|
+
- [ ] No security vulnerabilities introduced
|
|
150
|
+
|
|
151
|
+
## Development Commands
|
|
152
|
+
|
|
153
|
+
**AI AGENT INSTRUCTION: This section should be adapted to the project's specific language, framework, and build tools.**
|
|
154
|
+
|
|
155
|
+
### Setup
|
|
156
|
+
```bash
|
|
157
|
+
# Example: Commands to set up the development environment (e.g., install dependencies, configure database)
|
|
158
|
+
# e.g., for a Node.js project: npm install
|
|
159
|
+
# e.g., for a Go project: go mod tidy
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Daily Development
|
|
163
|
+
```bash
|
|
164
|
+
# Example: Commands for common daily tasks (e.g., start dev server, run tests, lint, format)
|
|
165
|
+
# e.g., for a Node.js project: npm run dev, npm test, npm run lint
|
|
166
|
+
# e.g., for a Go project: go run main.go, go test ./..., go fmt ./...
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Before Committing
|
|
170
|
+
```bash
|
|
171
|
+
# Example: Commands to run all pre-commit checks (e.g., format, lint, type check, run tests)
|
|
172
|
+
# e.g., for a Node.js project: npm run check
|
|
173
|
+
# e.g., for a Go project: make check (if a Makefile exists)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Testing Requirements
|
|
177
|
+
|
|
178
|
+
### Unit Testing
|
|
179
|
+
- Every module must have corresponding tests.
|
|
180
|
+
- Use appropriate test setup/teardown mechanisms (e.g., fixtures, beforeEach/afterEach).
|
|
181
|
+
- Mock external dependencies.
|
|
182
|
+
- Test both success and failure cases.
|
|
183
|
+
|
|
184
|
+
### Integration Testing
|
|
185
|
+
- Test complete user flows
|
|
186
|
+
- Verify database transactions
|
|
187
|
+
- Test authentication and authorization
|
|
188
|
+
- Check form submissions
|
|
189
|
+
|
|
190
|
+
### Mobile Testing
|
|
191
|
+
- Test on actual iPhone when possible
|
|
192
|
+
- Use Safari developer tools
|
|
193
|
+
- Test touch interactions
|
|
194
|
+
- Verify responsive layouts
|
|
195
|
+
- Check performance on 3G/4G
|
|
196
|
+
|
|
197
|
+
## Code Review Process
|
|
198
|
+
|
|
199
|
+
### Self-Review Checklist
|
|
200
|
+
Before requesting review:
|
|
201
|
+
|
|
202
|
+
1. **Functionality**
|
|
203
|
+
- Feature works as specified
|
|
204
|
+
- Edge cases handled
|
|
205
|
+
- Error messages are user-friendly
|
|
206
|
+
|
|
207
|
+
2. **Code Quality**
|
|
208
|
+
- Follows style guide
|
|
209
|
+
- DRY principle applied
|
|
210
|
+
- Clear variable/function names
|
|
211
|
+
- Appropriate comments
|
|
212
|
+
|
|
213
|
+
3. **Testing**
|
|
214
|
+
- Unit tests comprehensive
|
|
215
|
+
- Integration tests pass
|
|
216
|
+
- Coverage adequate (>80%)
|
|
217
|
+
|
|
218
|
+
4. **Security**
|
|
219
|
+
- No hardcoded secrets
|
|
220
|
+
- Input validation present
|
|
221
|
+
- SQL injection prevented
|
|
222
|
+
- XSS protection in place
|
|
223
|
+
|
|
224
|
+
5. **Performance**
|
|
225
|
+
- Database queries optimized
|
|
226
|
+
- Images optimized
|
|
227
|
+
- Caching implemented where needed
|
|
228
|
+
|
|
229
|
+
6. **Mobile Experience**
|
|
230
|
+
- Touch targets adequate (44x44px)
|
|
231
|
+
- Text readable without zooming
|
|
232
|
+
- Performance acceptable on mobile
|
|
233
|
+
- Interactions feel native
|
|
234
|
+
|
|
235
|
+
## Commit Guidelines
|
|
236
|
+
|
|
237
|
+
### Message Format
|
|
238
|
+
```
|
|
239
|
+
<type>(<scope>): <description>
|
|
240
|
+
|
|
241
|
+
[optional body]
|
|
242
|
+
|
|
243
|
+
[optional footer]
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Types
|
|
247
|
+
- `feat`: New feature
|
|
248
|
+
- `fix`: Bug fix
|
|
249
|
+
- `docs`: Documentation only
|
|
250
|
+
- `style`: Formatting, missing semicolons, etc.
|
|
251
|
+
- `refactor`: Code change that neither fixes a bug nor adds a feature
|
|
252
|
+
- `test`: Adding missing tests
|
|
253
|
+
- `chore`: Maintenance tasks
|
|
254
|
+
|
|
255
|
+
### Examples
|
|
256
|
+
```bash
|
|
257
|
+
git commit -m "feat(auth): Add remember me functionality"
|
|
258
|
+
git commit -m "fix(posts): Correct excerpt generation for short posts"
|
|
259
|
+
git commit -m "test(comments): Add tests for emoji reaction limits"
|
|
260
|
+
git commit -m "style(mobile): Improve button touch targets"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Definition of Done
|
|
264
|
+
|
|
265
|
+
A task is complete when:
|
|
266
|
+
|
|
267
|
+
1. All code implemented to specification
|
|
268
|
+
2. Unit tests written and passing
|
|
269
|
+
3. Code coverage meets project requirements
|
|
270
|
+
4. Documentation complete (if applicable)
|
|
271
|
+
5. Code passes all configured linting and static analysis checks
|
|
272
|
+
6. Works beautifully on mobile (if applicable)
|
|
273
|
+
7. Implementation notes added to `plan.md`
|
|
274
|
+
8. Changes committed with proper message
|
|
275
|
+
9. Git note with task summary attached to the commit
|
|
276
|
+
|
|
277
|
+
## Emergency Procedures
|
|
278
|
+
|
|
279
|
+
### Critical Bug in Production
|
|
280
|
+
1. Create hotfix branch from main
|
|
281
|
+
2. Write failing test for bug
|
|
282
|
+
3. Implement minimal fix
|
|
283
|
+
4. Test thoroughly including mobile
|
|
284
|
+
5. Deploy immediately
|
|
285
|
+
6. Document in plan.md
|
|
286
|
+
|
|
287
|
+
### Data Loss
|
|
288
|
+
1. Stop all write operations
|
|
289
|
+
2. Restore from latest backup
|
|
290
|
+
3. Verify data integrity
|
|
291
|
+
4. Document incident
|
|
292
|
+
5. Update backup procedures
|
|
293
|
+
|
|
294
|
+
### Security Breach
|
|
295
|
+
1. Rotate all secrets immediately
|
|
296
|
+
2. Review access logs
|
|
297
|
+
3. Patch vulnerability
|
|
298
|
+
4. Notify affected users (if any)
|
|
299
|
+
5. Document and update security procedures
|
|
300
|
+
|
|
301
|
+
## Deployment Workflow
|
|
302
|
+
|
|
303
|
+
### Pre-Deployment Checklist
|
|
304
|
+
- [ ] All tests passing
|
|
305
|
+
- [ ] Coverage >80%
|
|
306
|
+
- [ ] No linting errors
|
|
307
|
+
- [ ] Mobile testing complete
|
|
308
|
+
- [ ] Environment variables configured
|
|
309
|
+
- [ ] Database migrations ready
|
|
310
|
+
- [ ] Backup created
|
|
311
|
+
|
|
312
|
+
### Deployment Steps
|
|
313
|
+
1. Merge feature branch to main
|
|
314
|
+
2. Tag release with version
|
|
315
|
+
3. Push to deployment service
|
|
316
|
+
4. Run database migrations
|
|
317
|
+
5. Verify deployment
|
|
318
|
+
6. Test critical paths
|
|
319
|
+
7. Monitor for errors
|
|
320
|
+
|
|
321
|
+
### Post-Deployment
|
|
322
|
+
1. Monitor analytics
|
|
323
|
+
2. Check error logs
|
|
324
|
+
3. Gather user feedback
|
|
325
|
+
4. Plan next iteration
|
|
326
|
+
|
|
327
|
+
## Continuous Improvement
|
|
328
|
+
|
|
329
|
+
- Review workflow weekly
|
|
330
|
+
- Update based on pain points
|
|
331
|
+
- Document lessons learned
|
|
332
|
+
- Optimize for user happiness
|
|
333
|
+
- Keep things simple and maintainable
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const setup_1 = require("../src/commands/setup");
|
|
12
|
+
const implement_1 = require("../src/commands/implement");
|
|
13
|
+
const status_1 = require("../src/commands/status");
|
|
14
|
+
const init_1 = require("../src/commands/init");
|
|
15
|
+
const program = new commander_1.Command();
|
|
16
|
+
// Read package.json securely
|
|
17
|
+
const packageJsonPath = path_1.default.join(__dirname, '../package.json');
|
|
18
|
+
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf8'));
|
|
19
|
+
program
|
|
20
|
+
.version(packageJson.version)
|
|
21
|
+
.description(chalk_1.default.blue('Claude Code Conductor: A context-driven wrapper for Claude Code'));
|
|
22
|
+
(0, setup_1.registerSetupCommand)(program);
|
|
23
|
+
(0, implement_1.registerImplementCommand)(program);
|
|
24
|
+
(0, status_1.registerStatusCommand)(program);
|
|
25
|
+
(0, init_1.registerInitCommand)(program);
|
|
26
|
+
program.action(() => {
|
|
27
|
+
console.log(chalk_1.default.green('Welcome to Claude Code Conductor!'));
|
|
28
|
+
program.help();
|
|
29
|
+
});
|
|
30
|
+
program.parse(process.argv);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const setup_1 = require("../src/commands/setup");
|
|
12
|
+
const implement_1 = require("../src/commands/implement");
|
|
13
|
+
const status_1 = require("../src/commands/status");
|
|
14
|
+
const init_1 = require("../src/commands/init");
|
|
15
|
+
const program = new commander_1.Command();
|
|
16
|
+
// Read package.json securely
|
|
17
|
+
const packageJsonPath = path_1.default.join(__dirname, '../package.json');
|
|
18
|
+
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf8'));
|
|
19
|
+
program
|
|
20
|
+
.version(packageJson.version)
|
|
21
|
+
.description(chalk_1.default.blue('Conductor: A context-driven wrapper for Claude Code'));
|
|
22
|
+
(0, setup_1.registerSetupCommand)(program);
|
|
23
|
+
(0, implement_1.registerImplementCommand)(program);
|
|
24
|
+
(0, status_1.registerStatusCommand)(program);
|
|
25
|
+
(0, init_1.registerInitCommand)(program);
|
|
26
|
+
program.action(() => {
|
|
27
|
+
console.log(chalk_1.default.green('Welcome to Conductor!'));
|
|
28
|
+
program.help();
|
|
29
|
+
});
|
|
30
|
+
program.parse(process.argv);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerImplementCommand = registerImplementCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
function registerImplementCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command('implement')
|
|
11
|
+
.description('Implement a selected track')
|
|
12
|
+
.action(() => {
|
|
13
|
+
console.log(chalk_1.default.yellow('Implement command is not yet implemented.'));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerInitCommand = registerInitCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const CommandRegistrar_1 = require("../services/CommandRegistrar");
|
|
9
|
+
function registerInitCommand(program) {
|
|
10
|
+
program
|
|
11
|
+
.command('init')
|
|
12
|
+
.description('Initialize Conductor commands in the workspace')
|
|
13
|
+
.action(async () => {
|
|
14
|
+
console.log(chalk_1.default.blue('Init command initiated'));
|
|
15
|
+
try {
|
|
16
|
+
await CommandRegistrar_1.CommandRegistrar.registerCommands(process.cwd());
|
|
17
|
+
console.log(chalk_1.default.green('Successfully registered Conductor commands in .claude/commands'));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.error(chalk_1.default.red('Failed to register commands:'), error);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerSetupCommand = registerSetupCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const ProjectDiscovery_1 = require("../services/ProjectDiscovery");
|
|
9
|
+
const SetupWizard_1 = require("../services/SetupWizard");
|
|
10
|
+
const FileGenerator_1 = require("../services/FileGenerator");
|
|
11
|
+
function registerSetupCommand(program) {
|
|
12
|
+
program
|
|
13
|
+
.command('setup')
|
|
14
|
+
.description('Initialize or adopt a project into the Conductor workflow')
|
|
15
|
+
.action(async () => {
|
|
16
|
+
console.log(chalk_1.default.blue('Setup command initiated'));
|
|
17
|
+
// 1. Discovery
|
|
18
|
+
const projectType = await ProjectDiscovery_1.ProjectDiscovery.detectType(process.cwd());
|
|
19
|
+
console.log(chalk_1.default.green(`Detected Project Type: ${projectType}`));
|
|
20
|
+
if (projectType === ProjectDiscovery_1.ProjectType.BROWNFIELD) {
|
|
21
|
+
console.log(chalk_1.default.yellow('Note: Existing project structure detected. Setup will adopt existing files.'));
|
|
22
|
+
}
|
|
23
|
+
// 2. Wizard
|
|
24
|
+
const productDefinition = await SetupWizard_1.SetupWizard.collectProductDefinition();
|
|
25
|
+
// 3. Generation
|
|
26
|
+
console.log(chalk_1.default.blue('Generating Conductor files...'));
|
|
27
|
+
await FileGenerator_1.FileGenerator.generateFiles(process.cwd(), productDefinition);
|
|
28
|
+
console.log(chalk_1.default.green('Setup complete! Welcome to Claude Code Conductor.'));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerStatusCommand = registerStatusCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
function registerStatusCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command('status')
|
|
11
|
+
.description('Check the status of project tracks')
|
|
12
|
+
.action(() => {
|
|
13
|
+
console.log(chalk_1.default.yellow('Status command is not yet implemented.'));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CommandRegistrar = void 0;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
class CommandRegistrar {
|
|
10
|
+
static async ensureCommandsDir(cwd) {
|
|
11
|
+
const commandsDir = path_1.default.join(cwd, '.claude/commands');
|
|
12
|
+
await fs_extra_1.default.ensureDir(commandsDir);
|
|
13
|
+
return commandsDir;
|
|
14
|
+
}
|
|
15
|
+
static async registerCommands(cwd) {
|
|
16
|
+
const commandsDir = await this.ensureCommandsDir(cwd);
|
|
17
|
+
const commands = ['setup', 'implement', 'status'];
|
|
18
|
+
for (const cmd of commands) {
|
|
19
|
+
const scriptPath = path_1.default.join(commandsDir, `conductor:${cmd}`);
|
|
20
|
+
const content = `#!/bin/sh\nnpx claude-code-conductor ${cmd} "$@"\n`;
|
|
21
|
+
await fs_extra_1.default.writeFile(scriptPath, content);
|
|
22
|
+
await fs_extra_1.default.chmod(scriptPath, '755');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.CommandRegistrar = CommandRegistrar;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FileGenerator = void 0;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
class FileGenerator {
|
|
10
|
+
static async generateFiles(cwd, definition) {
|
|
11
|
+
const conductorDir = path_1.default.join(cwd, 'conductor');
|
|
12
|
+
await fs_extra_1.default.ensureDir(conductorDir);
|
|
13
|
+
// 1. product.md
|
|
14
|
+
const productContent = `# Product: ${definition.productName}
|
|
15
|
+
|
|
16
|
+
## Description
|
|
17
|
+
${definition.productDescription}
|
|
18
|
+
`;
|
|
19
|
+
await fs_extra_1.default.outputFile(path_1.default.join(conductorDir, 'product.md'), productContent);
|
|
20
|
+
// 2. tech-stack.md
|
|
21
|
+
const techStackContent = `# Tech Stack
|
|
22
|
+
|
|
23
|
+
${definition.techStack}
|
|
24
|
+
`;
|
|
25
|
+
await fs_extra_1.default.outputFile(path_1.default.join(conductorDir, 'tech-stack.md'), techStackContent);
|
|
26
|
+
// 3. product-guidelines.md
|
|
27
|
+
const guidelinesContent = `# Product Guidelines
|
|
28
|
+
|
|
29
|
+
## Tone & Style
|
|
30
|
+
${definition.guidelines}
|
|
31
|
+
`;
|
|
32
|
+
await fs_extra_1.default.outputFile(path_1.default.join(conductorDir, 'product-guidelines.md'), guidelinesContent);
|
|
33
|
+
// 4. setup_state.json
|
|
34
|
+
const state = {
|
|
35
|
+
setupComplete: true,
|
|
36
|
+
generatedAt: new Date().toISOString(),
|
|
37
|
+
productName: definition.productName
|
|
38
|
+
};
|
|
39
|
+
await fs_extra_1.default.outputJSON(path_1.default.join(conductorDir, 'setup_state.json'), state, { spaces: 2 });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.FileGenerator = FileGenerator;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ProjectDiscovery = exports.ProjectType = void 0;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
var ProjectType;
|
|
10
|
+
(function (ProjectType) {
|
|
11
|
+
ProjectType["GREENFIELD"] = "GREENFIELD";
|
|
12
|
+
ProjectType["BROWNFIELD"] = "BROWNFIELD";
|
|
13
|
+
})(ProjectType || (exports.ProjectType = ProjectType = {}));
|
|
14
|
+
const BROWNFIELD_INDICATORS = [
|
|
15
|
+
'.git',
|
|
16
|
+
'package.json',
|
|
17
|
+
'pom.xml',
|
|
18
|
+
'build.gradle',
|
|
19
|
+
'build.gradle.kts',
|
|
20
|
+
'requirements.txt',
|
|
21
|
+
'Pipfile',
|
|
22
|
+
'pyproject.toml',
|
|
23
|
+
'Cargo.toml',
|
|
24
|
+
'go.mod',
|
|
25
|
+
'composer.json',
|
|
26
|
+
'Gemfile',
|
|
27
|
+
'mix.exs',
|
|
28
|
+
'Makefile',
|
|
29
|
+
'README.md', // Presence of README often indicates an initialized project
|
|
30
|
+
'README.txt'
|
|
31
|
+
];
|
|
32
|
+
class ProjectDiscovery {
|
|
33
|
+
static async detectType(cwd) {
|
|
34
|
+
// Check for specific indicator files/directories
|
|
35
|
+
for (const indicator of BROWNFIELD_INDICATORS) {
|
|
36
|
+
const exists = await fs_extra_1.default.pathExists(path_1.default.join(cwd, indicator));
|
|
37
|
+
if (exists) {
|
|
38
|
+
return ProjectType.BROWNFIELD;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Also check if directory is not empty (ignoring system files like .DS_Store if we wanted to be robust, but strict empty check is usually fine for "Greenfield")
|
|
42
|
+
// For now, if no indicators are found, we assume Greenfield.
|
|
43
|
+
// Ideally, we might check if *any* file exists, but "Greenfield" usually implies we are setting up completely new structure.
|
|
44
|
+
// However, the spec says "Check for .git... Check for package.json... If no indicators, classify as Greenfield".
|
|
45
|
+
return ProjectType.GREENFIELD;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.ProjectDiscovery = ProjectDiscovery;
|