Skip to content

Commit 64094c4

Browse files
authored
Merge pull request #70 from ryanmac/fix-conductor-init-task-creation
Fix: Always create initial task for new Code Conductor projects
2 parents bf9722c + b18e59e commit 64094c4

File tree

1 file changed

+191
-10
lines changed

1 file changed

+191
-10
lines changed

.conductor/conductor_setup/discovery_task.py

Lines changed: 191 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,22 @@ def __init__(self, project_root: Path):
1717
def create_discovery_task_if_needed(self) -> Optional[str]:
1818
"""Create initialization task for AI agents to discover project structure"""
1919

20-
# Check if project has substantial existing content
21-
if not self._should_create_discovery_task():
22-
print("\n📋 New project detected - skipping discovery task")
23-
return None
24-
2520
# Check GitHub CLI availability
2621
if not self._check_github_cli_ready():
2722
return None
2823

29-
print("\n📚 Existing project detected. Creating discovery task...")
24+
# Determine project type
25+
is_existing_project = self._should_create_discovery_task()
3026

31-
discovery_task_body = self._get_discovery_task_body()
27+
if is_existing_project:
28+
print("\n📚 Existing project detected. Creating discovery task...")
29+
discovery_task_body = self._get_discovery_task_body()
30+
else:
31+
print("\n🚀 New project detected. Creating initial planning task...")
32+
discovery_task_body = self._get_new_project_task_body()
3233

3334
# Create the discovery task
34-
return self._create_github_issue(discovery_task_body)
35+
return self._create_github_issue(discovery_task_body, is_existing_project)
3536

3637
def _should_create_discovery_task(self) -> bool:
3738
"""Determine if a discovery task should be created"""
@@ -67,16 +68,24 @@ def _check_github_cli_ready(self) -> bool:
6768

6869
return True
6970

70-
def _create_github_issue(self, body: str) -> Optional[str]:
71+
def _create_github_issue(
72+
self, body: str, is_existing_project: bool = True
73+
) -> Optional[str]:
7174
"""Create GitHub issue and return issue number"""
75+
title = (
76+
"🔍 [INIT] Discover project documentation and create task map"
77+
if is_existing_project
78+
else "🚀 [INIT] Plan project structure and create initial tasks"
79+
)
80+
7281
try:
7382
result = subprocess.run(
7483
[
7584
"gh",
7685
"issue",
7786
"create",
7887
"--title",
79-
"🔍 [INIT] Discover project documentation and create task map",
88+
title,
8089
"--body",
8190
body,
8291
"--label",
@@ -262,4 +271,176 @@ def _get_discovery_task_body(self) -> str:
262271
---
263272
*This is a one-time initialization task. Once complete, all future work will be
264273
properly coordinated.*
274+
"""
275+
276+
def _get_new_project_task_body(self) -> str:
277+
"""Get the initial task body for new projects"""
278+
return """## 🚀 Project Planning and Initial Task Creation
279+
280+
**This is the first task for your new project. Your mission is to understand the
281+
project goals and create a comprehensive task list.**
282+
283+
## Your Mission
284+
285+
For this new project, you need to:
286+
1. Understand what the project should become
287+
2. Create a project roadmap
288+
3. Generate initial development tasks
289+
4. Set up the documentation structure
290+
291+
## Step-by-Step Instructions
292+
293+
### 1. Analyze Project Intent
294+
```bash
295+
# Look for any initial documentation
296+
cat README.md 2>/dev/null || echo "No README yet"
297+
cat requirements.txt requirements*.txt 2>/dev/null || echo "No requirements files"
298+
cat package.json 2>/dev/null | jq '.name, .description' || echo "No package.json"
299+
300+
# Check for any initial code
301+
find . -name "*.py" -o -name "*.js" -o -name "*.ts" | grep -v node_modules | head -10
302+
303+
# Look for any specification files
304+
find . -name "*.md" -o -name "*.txt" | grep -E "(spec|requirement|design)" | head -10
305+
```
306+
307+
### 2. Create Initial Documentation Map
308+
309+
Create `.conductor/documentation-map.yaml` with your project plan:
310+
311+
```yaml
312+
# Project definition - REQUIRED
313+
project:
314+
name: "[project name from context or ask user]"
315+
description: "[what this project will do]"
316+
type: "[planned type: web-app|api|library|cli|mobile|desktop]"
317+
primary_language: "[planned: python|javascript|typescript|go|rust|etc]"
318+
framework: "[planned: react|django|express|etc]"
319+
status: "planning"
320+
estimated_completion: "0%"
321+
322+
# Initial project structure plan
323+
planned_structure:
324+
core_components:
325+
- name: "[component name]"
326+
purpose: "[what it will do]"
327+
technology: "[how it will be built]"
328+
329+
key_features:
330+
- name: "[feature name]"
331+
description: "[what users can do]"
332+
priority: "[must-have|nice-to-have]"
333+
334+
# Documentation to create
335+
documentation_plan:
336+
- type: "README"
337+
purpose: "Project overview and setup instructions"
338+
status: "to_create"
339+
340+
- type: "ARCHITECTURE"
341+
purpose: "Technical design and decisions"
342+
status: "to_create"
343+
344+
- type: "API"
345+
purpose: "API specifications"
346+
status: "to_create"
347+
348+
# Initial development tasks - CREATE 15-25 TASKS
349+
proposed_tasks:
350+
# Setup and infrastructure tasks
351+
- title: "Set up project structure and initial configuration"
352+
description: "Create basic project structure with folders for source, tests, docs"
353+
type: "setup"
354+
priority: "critical"
355+
estimated_effort: "small"
356+
assigned_role: "dev"
357+
success_criteria:
358+
- "Project structure created"
359+
- "Configuration files initialized"
360+
- "Development environment documented"
361+
362+
- title: "Create comprehensive README with setup instructions"
363+
description: "Write README with project overview, setup, and contribution guide"
364+
type: "documentation"
365+
priority: "high"
366+
estimated_effort: "small"
367+
assigned_role: "dev"
368+
success_criteria:
369+
- "README includes project description"
370+
- "Setup instructions are clear"
371+
- "Contribution guidelines included"
372+
373+
# Add 13-23 more specific tasks based on the project type...
374+
# Include tasks for:
375+
# - Core functionality implementation
376+
# - Testing setup and initial tests
377+
# - CI/CD configuration
378+
# - Security considerations
379+
# - Performance requirements
380+
# - User interface (if applicable)
381+
# - API design (if applicable)
382+
# - Database design (if applicable)
383+
384+
# Summary
385+
summary:
386+
total_tasks: [number]
387+
phases:
388+
- name: "Setup Phase"
389+
tasks: [number]
390+
duration: "[estimated days]"
391+
- name: "Core Development"
392+
tasks: [number]
393+
duration: "[estimated days]"
394+
- name: "Testing & Polish"
395+
tasks: [number]
396+
duration: "[estimated days]"
397+
```
398+
399+
### 3. Generate Comprehensive Task List
400+
401+
Think about the full project lifecycle:
402+
- **Setup**: Project structure, tooling, environments
403+
- **Core Features**: Main functionality broken into small tasks
404+
- **Testing**: Unit tests, integration tests, E2E tests
405+
- **Documentation**: User docs, API docs, developer guides
406+
- **DevOps**: CI/CD, deployment, monitoring
407+
- **Polish**: Performance, security, accessibility
408+
409+
### 4. Validate and Create Tasks
410+
411+
1. Validate the YAML:
412+
```bash
413+
python -c "import yaml; yaml.safe_load(open('.conductor/documentation-map.yaml'))"
414+
```
415+
416+
2. Generate GitHub issues from your map:
417+
```bash
418+
python .conductor/scripts/generate-tasks-from-map.py --auto
419+
```
420+
421+
3. Verify tasks were created:
422+
```bash
423+
gh issue list -l 'conductor:task' --limit 25
424+
```
425+
426+
## Success Criteria
427+
428+
- [ ] Created `.conductor/documentation-map.yaml` with project plan
429+
- [ ] Defined clear project goals and structure
430+
- [ ] Created 15-25 specific, actionable tasks
431+
- [ ] Tasks cover entire project lifecycle
432+
- [ ] Each task has clear success criteria
433+
- [ ] Tasks are properly prioritized
434+
435+
## Completion
436+
437+
After creating the task map:
438+
1. Run: `python .conductor/scripts/generate-tasks-from-map.py --auto`
439+
2. Verify tasks in GitHub: `gh issue list -l 'conductor:task'`
440+
3. Comment summary on this issue
441+
4. Mark complete: `./conductor complete`
442+
443+
---
444+
*This initial planning task sets up all future work. Take time to think through
445+
the project comprehensively.*
265446
"""

0 commit comments

Comments
 (0)