-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeveloper-workflow-template.yml
More file actions
107 lines (90 loc) · 3.54 KB
/
developer-workflow-template.yml
File metadata and controls
107 lines (90 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Developer Implementation
on:
issues:
types: [opened, labeled]
jobs:
implement-feature:
if: |
contains(github.event.issue.labels.*.name, 'implementation') ||
contains(github.event.issue.labels.*.name, 'feature') ||
contains(github.event.issue.labels.*.name, 'bug')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create feature branch
run: |
BRANCH_NAME="feature/issue-${{ github.event.issue.number }}"
git checkout -b $BRANCH_NAME
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Prepare developer prompt
run: |
cat > /tmp/developer-prompt.txt << 'PROMPT_EOF'
You are the Developer persona. Implement the following issue:
Issue #${{ github.event.issue.number }}: ${{ github.event.issue.title }}
${{ github.event.issue.body }}
Requirements:
1. Implement the complete feature/fix as described
2. Write comprehensive tests
3. Ensure code follows best practices
4. Add appropriate documentation
5. Make sure all tests pass
Create production-ready code with no TODOs or placeholders.
PROMPT_EOF
- name: Run SuperClaude Developer
uses: anthropics/claude-code-github-action@main
with:
prompt-file: /tmp/developer-prompt.txt
model: opus
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
github-token: ${{ secrets.ORG_ADMIN_TOKEN }}
working-directory: .
flags: |
--persona developer
--mode implementation
--complete
--test
- name: Commit changes
run: |
git config user.name "SuperClaude Developer"
git config user.email "superclaude@code-orchestration.com"
git add -A
git commit -m "feat: Implement #${{ github.event.issue.number }} - ${{ github.event.issue.title }}"
- name: Push branch
run: |
git push origin $BRANCH_NAME
- name: Create Pull Request
uses: actions/github-script@v7
with:
github-token: ${{ secrets.ORG_ADMIN_TOKEN }}
script: |
const pr = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `feat: ${context.payload.issue.title}`,
body: `
## Description
This PR implements the requirements from #${context.payload.issue.number}
## Changes
- Implementation completed by SuperClaude Developer persona
- Tests added
- Documentation updated
## Related Issue
Closes #${context.payload.issue.number}
## Checklist
- [ ] Code follows project standards
- [ ] Tests are passing
- [ ] Documentation is updated
- [ ] Ready for review
`,
head: process.env.BRANCH_NAME,
base: 'main',
draft: false
});
// Add labels
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.data.number,
labels: ['automated-pr', 'needs-review']
});