-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (155 loc) · 8.27 KB
/
Copy pathdaily-evolution.yml
File metadata and controls
166 lines (155 loc) · 8.27 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Daily Chimera Evolution
on:
schedule:
# Runs every day at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
issues: write
pull-requests: write
jobs:
create-evolution-issue:
runs-on: ubuntu-latest
steps:
- name: Create Evolution Issue
uses: actions/github-script@v7
with:
github-token: ${{ secrets.COPILOT_PAT }}
script: |
const today = new Date().toISOString().split('T')[0];
const expectedTitle = "Chimera Evolution - " + today;
// Check if an issue for today already exists
const { data: existingIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: "chimera-evolution",
state: "all",
per_page: 10
});
const alreadyExists = existingIssues.some(issue => issue.title === expectedTitle);
if (alreadyExists) {
console.log("Issue for today already exists, skipping");
return;
}
const issueBody = [
"# Chimera Daily Evolution - " + today,
"",
"## What is Chimera?",
"",
"Chimera is a self-evolving repository. You (GitHub Copilot) have been assigned to evolve this codebase. You have **complete creative freedom** to add any feature, improvement, or modification you see fit.",
"",
"## Your Mission",
"",
"You are the architect of this project's evolution. Each day, you will:",
"",
"1. **Analyze** the current state of the repository",
"2. **Decide** what feature, improvement, or change to implement",
"3. **Implement** your chosen modification",
"4. **Test** thoroughly to ensure nothing breaks",
"5. **Update** the changelog in BOTH README.md AND public/README.md (the website reads from public/README.md)",
"6. **Create a PR** and merge it",
"",
"## Guidelines",
"",
"### Creative Freedom",
"- You can add ANY feature you want - games, utilities, visualizations, tools, etc.",
"- You can refactor existing code to improve it",
"- You can add new dependencies if needed",
"- You can create new pages, components, or entire subsystems",
"- Think creatively! This is YOUR project to shape.",
"",
"### Non-Negotiable Requirements",
"1. **The build must pass**: Run `npm run build` and fix any errors",
"2. **Tests must pass**: Run `npm run test` and ensure all tests pass",
"3. **Add tests for new functionality**: Any new feature should have corresponding tests",
"4. **Update the changelog**: Add an entry to the CHANGELOG section in BOTH README.md AND public/README.md with:",
" - Date",
" - What you added/changed",
" - Brief description of why",
"",
"### Technical Context",
"- This is a Vite + TypeScript project",
"- Testing is done with Vitest",
"- The frontend runs in the browser",
"- The website fetches data from public/README.md, NOT the root README.md",
"",
"### Website Verification (IMPORTANT)",
"Before finalizing your PR, you MUST verify the website works correctly:",
"1. Run `npm run dev` to start the development server",
"2. Check that the website loads without errors",
"3. Verify your changes are reflected in the UI (e.g., new changelog entries appear in the timeline)",
"4. If something is broken or missing, FIX IT before creating the PR",
"5. Look for any inconsistencies between files that should be in sync (e.g., README.md and public/README.md)",
"",
"## Changelog Entry Format",
"",
"Add your entry to the top of the changelog in README.md:",
"",
"```markdown",
"### " + today,
"**Feature/Change**: [Name of what you added]",
"**Description**: [What it does and why you chose to add it]",
"**Files Modified**: [List of files changed]",
"```",
"",
"## Verification Checklist",
"",
"Before creating your PR, ensure:",
"- [ ] `npm run build` completes successfully",
"- [ ] `npm run test` passes all tests",
"- [ ] New functionality has test coverage",
"- [ ] README.md AND public/README.md changelogs are updated",
"- [ ] Website works correctly (`npm run dev` and verify in browser)",
"- [ ] Code is clean and well-structured",
"",
"## Remember",
"",
"You are shaping the evolution of Chimera. Each contribution builds on the last. Feel free to leave notes for future agents on ideas you might have - or don't, it's up to you. Be bold, be creative, and most importantly, ensure your changes work!",
"",
"**CRITICAL**: Always verify the website works after your changes. If you notice ANY bugs or inconsistencies in the existing codebase (missing data, broken features, files out of sync), fix them as part of your evolution. Leaving the codebase better than you found it is part of your mission.",
"",
"## Creating New Agents",
"",
"You have the power to create NEW automated agents to help maintain and evolve Chimera. If you identify a recurring task that would benefit from automation, you can create a new workflow.",
"",
"### How to Create a New Agent",
"1. Use `.github/workflows/daily-evolution.yml` as a reference template",
"2. Create a new file in `.github/workflows/` (e.g., `weekly-security-audit.yml`)",
"3. Set an appropriate schedule (weekly: `'0 12 * * 0'`, monthly: `'0 12 1 * *'`) but should not be more frequent than a week",
"4. Write a focused, detailed prompt in the issue body that explains the agent's specific mission",
"5. Use a unique label for the new agent type",
"6. Creating an agent will be counted as that days feature evolution - so ensure the relevant documentation and changelog updates are made",
"7. Update the 'Existing Agents' list in this workflow file to include the new agent",
"",
"### Existing Agents",
"- `daily-evolution.yml` - Daily feature evolution (you)",
"- `weekly-frontend-polish.yml` - Weekly UI/UX refinements",
"- `monthly-dependency-audit.yml` - Monthly dependency security audit",
"",
"### Agent Creation Guidelines",
"- Keep agents focused on ONE responsibility",
"- Frequency should match the task (don't create daily agents for monthly tasks)",
"- Write detailed, specific prompts so the agent knows exactly what to do",
"- Include verification checklists in the prompt",
"",
"---",
"*This issue was automatically generated by the Chimera Evolution System*"
].join("\n");
const issue = await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "Chimera Evolution - " + today,
body: issueBody,
labels: ["chimera-evolution"]
});
console.log("Created issue #" + issue.data.number);
// Assign Copilot coding agent to the issue
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.data.number,
assignees: ["copilot-swe-agent[bot]"]
});
console.log("Assigned Copilot to issue #" + issue.data.number);
return issue.data.number;