Skip to content

Commit 6731479

Browse files
authored
Merge pull request #63 from ryanmac/fix/github-token-documentation
Fix GitHub token configuration for user projects
2 parents a3c1cde + 9ed574c commit 6731479

File tree

11 files changed

+322
-133
lines changed

11 files changed

+322
-133
lines changed

.conductor/GITHUB_TOKEN_SETUP.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ When you install Code Conductor in your project:
1111
- **Limitations**: Can't trigger other workflows, rate limited
1212
- **Optional upgrade**: Create a PAT for enhanced features (see below)
1313

14+
**Important**: The workflows generated by setup.py are configured to use `github.token` by default. This is the recommended approach for most users.
15+
1416
### 2. For Code Conductor Development (Maintainers Only)
1517
The ryanmac/code-conductor repository itself uses:
1618
- **Token name**: `CONDUCTOR_GITHUB_TOKEN`
Lines changed: 36 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,72 @@
1-
name: 🎯 Conductor Task
2-
description: Create a new task for AI agent coordination
3-
title: "[Task] "
1+
name: Conductor Task
2+
description: Create a new task for agent coordination
3+
title: "[TASK] "
44
labels: ["conductor:task"]
55
body:
6-
- type: markdown
7-
attributes:
8-
value: |
9-
## 🎼 Create a Conductor Task
10-
11-
This template helps you create a structured task that can be automatically processed by Code-Conductor agents.
12-
13-
**Note**: Adding the `conductor:task` label will automatically convert this issue into a task.
14-
156
- type: input
16-
id: task_title
7+
id: title
178
attributes:
189
label: Task Title
19-
description: A clear, concise title for the task
20-
placeholder: "Implement user authentication system"
10+
description: Brief description of what needs to be done
11+
placeholder: "Implement user authentication"
2112
validations:
2213
required: true
2314

2415
- type: textarea
2516
id: description
2617
attributes:
27-
label: Description
28-
description: Detailed description of what needs to be accomplished
18+
label: Task Description
19+
description: Detailed description of the task
2920
placeholder: |
30-
Create a secure user authentication system with the following features:
31-
- User registration and login
32-
- Password hashing with bcrypt
33-
- JWT token management
34-
- Session persistence
35-
- Password reset functionality
21+
Implement JWT-based authentication with:
22+
- Login endpoint
23+
- Logout endpoint
24+
- Token refresh mechanism
3625
validations:
3726
required: true
3827

3928
- type: dropdown
40-
id: effort
29+
id: priority
4130
attributes:
42-
label: Estimated Effort
43-
description: How much work is this task?
31+
label: Priority
4432
options:
45-
- small (< 4 hours)
46-
- medium (4-16 hours)
47-
- large (> 16 hours)
33+
- High
34+
- Medium
35+
- Low
4836
validations:
4937
required: true
5038

51-
- type: checkboxes
52-
id: required_skills
53-
attributes:
54-
label: Required Skills
55-
description: What specialized skills are needed? (Leave empty for general dev tasks)
56-
options:
57-
- label: DevOps (deployment, infrastructure, CI/CD)
58-
- label: Security (authentication, encryption, compliance)
59-
- label: UI/UX Design (interface design, user experience)
60-
- label: Rust Development (systems programming, performance)
61-
- label: Database (optimization, migrations, architecture)
62-
63-
- type: textarea
64-
id: files
65-
attributes:
66-
label: Files Involved
67-
description: List the files that will be modified (one per line)
68-
placeholder: |
69-
src/auth/models.py
70-
src/auth/views.py
71-
src/auth/serializers.py
72-
tests/test_auth.py
73-
requirements.txt
74-
75-
- type: textarea
76-
id: specifications
39+
- type: input
40+
id: effort
7741
attributes:
78-
label: Specifications
79-
description: Link to design docs, API specs, or detailed requirements
80-
placeholder: |
81-
- API Documentation: docs/auth-api.md
82-
- Database Schema: docs/auth-schema.sql
83-
- Security Requirements: docs/security-requirements.md
42+
label: Estimated Effort
43+
description: Rough estimate (small/medium/large)
44+
placeholder: "medium"
8445

85-
- type: textarea
86-
id: best_practices
46+
- type: input
47+
id: skills
8748
attributes:
88-
label: Best Practices
89-
description: Important guidelines and coding standards to follow
90-
placeholder: |
91-
- Follow Django REST framework conventions
92-
- Use type hints for all function signatures
93-
- Implement comprehensive error handling
94-
- Add logging for all authentication events
95-
- Follow OWASP security guidelines
49+
label: Required Skills
50+
description: Comma-separated list of required skills (leave empty for general dev)
51+
placeholder: "security, backend"
9652

9753
- type: textarea
9854
id: success_criteria
9955
attributes:
10056
label: Success Criteria
101-
description: How will we know this task is complete?
57+
description: How will we know when this task is complete?
10258
placeholder: |
103-
**Tests**: All tests pass with 95% code coverage
104-
**Security**: Passes security audit checklist
105-
**Performance**: Login completes in under 200ms
106-
**Documentation**: All API endpoints documented
107-
**Code Review**: Approved by security team member
59+
- All authentication endpoints working
60+
- Tests written with 100% coverage
61+
- Security review passed
62+
validations:
63+
required: true
10864

10965
- type: textarea
11066
id: dependencies
11167
attributes:
11268
label: Dependencies
113-
description: Other tasks or issues that must be completed first
69+
description: List any tasks or PRs this depends on
11470
placeholder: |
115-
- Issue #123: Database migration system
116-
- Task user_model_001: User model updates
117-
118-
- type: checkboxes
119-
id: acknowledgments
120-
attributes:
121-
label: Acknowledgments
122-
description: Please confirm you understand how Conductor tasks work
123-
options:
124-
- label: I understand this will be converted to an agent task automatically
125-
required: true
126-
- label: I have provided enough detail for an AI agent to complete this work
127-
required: true
128-
- label: I will monitor the progress and provide feedback as needed
129-
required: true
130-
131-
- type: markdown
132-
attributes:
133-
value: |
134-
---
135-
136-
## 🚀 What Happens Next?
137-
138-
1. **Task Creation**: This issue will be automatically converted to a conductor task
139-
2. **Agent Assignment**: Available agents can claim this task via the bootstrap script
140-
3. **Isolation**: Work happens in isolated git worktrees to prevent conflicts
141-
4. **Progress**: Monitor via GitHub Actions and system health checks
142-
5. **Completion**: Agent creates PR when task is finished
143-
144-
📚 **Learn more**: [Code-Conductor Documentation](docs/USAGE.md)
71+
- PR#123 (Database schema)
72+
- Task#456 (User model)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Conductor Cleanup
2+
3+
on:
4+
schedule:
5+
- cron: '0 */6 * * *' # Every 6 hours
6+
workflow_dispatch:
7+
8+
jobs:
9+
cleanup-stale-work:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.12'
18+
19+
- name: Install dependencies
20+
run: |
21+
pip install pyyaml
22+
23+
- name: Clean up abandoned worktrees
24+
run: |
25+
python .conductor/scripts/cleanup-worktrees.py
26+
27+
- name: Archive completed tasks
28+
run: |
29+
python .conductor/scripts/archive-completed.py
30+
31+
- name: Commit cleanup changes
32+
uses: stefanzweifel/git-auto-commit-action@v4
33+
with:
34+
commit_message: '🧹 Cleanup stale work and archive completed tasks'
35+
file_pattern: '.conductor/*.json'

.github/workflows/pr-review-tasks.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
id: check
3333
uses: actions/github-script@v7
3434
with:
35-
github-token: ${{ secrets.CONDUCTOR_GITHUB_TOKEN }}
35+
github-token: ${{ secrets.CONDUCTOR_GITHUB_TOKEN || github.token }}
3636
script: |
3737
let shouldReview = false;
3838
let prNumber = null;
@@ -141,7 +141,7 @@ jobs:
141141
142142
- name: Setup GitHub CLI
143143
run: |
144-
echo "${{ secrets.CONDUCTOR_GITHUB_TOKEN }}" > token.txt
144+
echo "${{ secrets.CONDUCTOR_GITHUB_TOKEN || github.token }}" > token.txt
145145
gh auth login --with-token < token.txt
146146
rm -f token.txt
147147
@@ -157,7 +157,7 @@ jobs:
157157
gh label create "${name}" --color "${color}" --description "${desc}" || true
158158
done
159159
env:
160-
GH_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN }}
160+
GH_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN || github.token }}
161161

162162
- name: Create review task issue
163163
run: |
@@ -166,16 +166,16 @@ jobs:
166166
--repo "${{ github.repository }}" \
167167
--event-type "${{ github.event_name }}"
168168
env:
169-
GH_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN }}
170-
GITHUB_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN }}
169+
GH_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN || github.token }}
170+
GITHUB_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN || github.token }}
171171

172172
- name: Add acknowledgment comment
173173
if: github.event_name == 'issue_comment'
174174
run: |
175175
gh pr comment ${{ github.event.issue.number }} \
176176
--body "✅ Review task created! An AI agent will claim and complete the code review."
177177
env:
178-
GH_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN }}
178+
GH_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN || github.token }}
179179

180180
- name: Remove needs-review label
181181
if: github.event_name == 'pull_request'
@@ -184,4 +184,4 @@ jobs:
184184
gh pr edit ${{ needs.check-review-needed.outputs.pr_number }} \
185185
--remove-label "needs-review" || true
186186
env:
187-
GH_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN }}
187+
GH_TOKEN: ${{ secrets.CONDUCTOR_GITHUB_TOKEN || github.token }}

.github/workflows/pr-review.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: AI Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
pull_request_review_comment:
7+
types: [created, edited]
8+
issue_comment:
9+
types: [created]
10+
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
issues: write
15+
16+
jobs:
17+
ai-review:
18+
name: AI Code Review
19+
runs-on: ubuntu-latest
20+
# Skip if PR is from a bot or if skip-review label is present
21+
if: |
22+
github.event.pull_request &&
23+
github.event.pull_request.user.type != 'Bot' &&
24+
!contains(github.event.pull_request.labels.*.name, 'skip-review')
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: '3.12'
35+
36+
- name: Install dependencies
37+
run: |
38+
pip install pyyaml requests
39+
40+
- name: Run AI Code Review
41+
env:
42+
GH_TOKEN: ${{ github.token }}
43+
PR_NUMBER: ${{ github.event.pull_request.number }}
44+
run: |
45+
# Simple AI review trigger
46+
echo "🔍 AI Code Review triggered for PR #$PR_NUMBER"
47+
48+
# Check if code-reviewer role exists
49+
if [ -f ".conductor/roles/code-reviewer.md" ]; then
50+
echo "✅ Code reviewer role found"
51+
# The actual review would be done by the code-reviewer agent
52+
# This workflow just ensures the infrastructure is in place
53+
else
54+
echo "⚠️ Code reviewer role not configured"
55+
fi

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5959
- 🐛 Glob pattern support for .NET project detection (*.csproj)
6060
- 🔒 Code-reviewer role always included in auto-configuration
6161
- 📋 Demo tasks only created if none exist
62+
- 🔧 **GitHub Token Configuration**: Fixed workflow token issues for user projects
63+
- User projects now correctly use `github.token` instead of `CONDUCTOR_GITHUB_TOKEN`
64+
- Updated conductor-init.sh to not copy workflow files during installation
65+
- setup.py now generates all necessary workflows including PR review workflow
66+
- Prevents "Input required and not supplied: github-token" errors in user projects
6267

6368
## [2.0.0] - 2025-07-23
6469

CLAUDE.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -291,18 +291,21 @@ GOOD:
291291

292292
This prevents both external (GitHub issues) and internal (todo list) duplication.
293293

294-
## GitHub Authentication Setup
294+
## GitHub Authentication
295295

296-
Code Conductor requires a GitHub token with appropriate permissions for managing issues, pull requests, and labels.
296+
Code Conductor uses GitHub's built-in authentication for all operations. No manual token setup is required for most users!
297297

298-
### Quick Setup
299-
1. Create a GitHub Personal Access Token with `repo` scope at https://github.com/settings/tokens
300-
2. Add it as `CONDUCTOR_GITHUB_TOKEN` in your repository's Settings → Secrets → Actions
301-
3. The token is automatically passed to all conductor scripts
298+
### Default Setup (Recommended)
299+
The workflows generated by Code Conductor automatically use GitHub Actions' built-in `${{ github.token }}`, which provides:
300+
- ✅ Read/write access to issues, pull requests, and code
301+
- ✅ Ability to create and manage labels
302+
- ✅ No setup required - works out of the box!
302303

303-
### Required Permissions
304-
- **repo** scope (includes all repository permissions)
305-
- Optional: **workflow** scope if modifying GitHub Actions
304+
### Advanced Setup (Optional)
305+
Only create a Personal Access Token if you need:
306+
- Higher API rate limits (5,000/hour instead of 1,000/hour)
307+
- Cross-repository access
308+
- Ability to trigger other workflows
306309

307310
For detailed setup instructions and troubleshooting, see [.conductor/GITHUB_TOKEN_SETUP.md](.conductor/GITHUB_TOKEN_SETUP.md).
308311

0 commit comments

Comments
 (0)