fraim-framework 1.0.2 → 1.0.3
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/package.json +1 -1
- package/setup.js +164 -135
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -53,90 +53,14 @@ function writeFile(filePath, content) {
|
|
|
53
53
|
logSuccess(`Created file: ${filePath}`);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{ name: 'status:wip', color: 'fbca04', description: 'Work in progress' },
|
|
62
|
-
{ name: 'status:needs-review', color: 'd93f0b', description: 'Ready for review' },
|
|
63
|
-
{ name: 'status:complete', color: '0e8a16', description: 'Completed and approved' },
|
|
64
|
-
{ name: 'ai-agent:cursor', color: '5319e7', description: 'Assigned to Cursor AI agent' },
|
|
65
|
-
{ name: 'ai-agent:claude', color: 'c2e0c6', description: 'Assigned to Claude AI agent' },
|
|
66
|
-
{ name: 'ai-agent:windsurf', color: 'bfdadc', description: 'Assigned to Windsurf AI agent' }
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
const labelsContent = JSON.stringify(labels, null, 2);
|
|
70
|
-
writeFile('.github/labels.json', labelsContent);
|
|
71
|
-
|
|
72
|
-
logInfo('GitHub labels configuration created');
|
|
73
|
-
logInfo('You can import these labels using GitHub CLI or the web interface');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function createGitHubWorkflows() {
|
|
77
|
-
// Phase change workflow
|
|
78
|
-
const phaseChangeWorkflow = `name: Phase Change Automation
|
|
79
|
-
|
|
80
|
-
on:
|
|
81
|
-
issues:
|
|
82
|
-
types: [labeled, unlabeled]
|
|
83
|
-
|
|
84
|
-
jobs:
|
|
85
|
-
phase-change:
|
|
86
|
-
runs-on: ubuntu-latest
|
|
87
|
-
if: contains(github.event.issue.labels.*.name, 'phase:') || contains(github.event.label.name, 'phase:')
|
|
88
|
-
steps:
|
|
89
|
-
- name: Checkout
|
|
90
|
-
uses: actions/checkout@v4
|
|
91
|
-
|
|
92
|
-
- name: Phase Change Handler
|
|
93
|
-
run: |
|
|
94
|
-
echo "Phase change detected for issue #\${{ github.event.issue.number }}"
|
|
95
|
-
echo "New phase: \${{ github.event.label.name || 'phase removed' }}"
|
|
96
|
-
|
|
97
|
-
- name: Update Issue Status
|
|
98
|
-
if: contains(github.event.label.name, 'phase:')
|
|
99
|
-
run: |
|
|
100
|
-
gh issue edit \${{ github.event.issue.number }} --add-label "status:wip"
|
|
101
|
-
echo "Status updated to WIP for new phase"
|
|
102
|
-
`;
|
|
56
|
+
function createAgentStructure() {
|
|
57
|
+
// Create the proper agent directory structure
|
|
58
|
+
ensureDirectory('agents/cursor/rules');
|
|
59
|
+
ensureDirectory('agents/claude/rules');
|
|
60
|
+
ensureDirectory('agents/windsurf/rules');
|
|
103
61
|
|
|
104
|
-
//
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
on:
|
|
108
|
-
issues:
|
|
109
|
-
types: [labeled, unlabeled]
|
|
110
|
-
|
|
111
|
-
jobs:
|
|
112
|
-
status-change:
|
|
113
|
-
runs-on: ubuntu-latest
|
|
114
|
-
if: contains(github.event.issue.labels.*.name, 'status:') || contains(github.event.label.name, 'status:')
|
|
115
|
-
steps:
|
|
116
|
-
- name: Checkout
|
|
117
|
-
uses: actions/checkout@v4
|
|
118
|
-
|
|
119
|
-
- name: Status Change Handler
|
|
120
|
-
run: |
|
|
121
|
-
echo "Status change detected for issue #\${{ github.event.issue.number }}"
|
|
122
|
-
echo "New status: \${{ github.event.label.name || 'status removed' }}"
|
|
123
|
-
|
|
124
|
-
- name: Notify Team
|
|
125
|
-
if: contains(github.event.label.name, 'status:needs-review')
|
|
126
|
-
run: |
|
|
127
|
-
echo "Issue ready for review - notifying team"
|
|
128
|
-
`;
|
|
129
|
-
|
|
130
|
-
writeFile('.github/workflows/phase-change.yml', phaseChangeWorkflow);
|
|
131
|
-
writeFile('.github/workflows/status-change.yml', statusChangeWorkflow);
|
|
132
|
-
|
|
133
|
-
logSuccess('GitHub workflows created');
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function createAgentConfigs() {
|
|
137
|
-
// Cursor rules - only create if it doesn't exist
|
|
138
|
-
if (!fs.existsSync('.cursorrules')) {
|
|
139
|
-
const cursorRules = `# FRAIM Cursor Rules
|
|
62
|
+
// Create .cursorrules that references modular rules
|
|
63
|
+
const cursorRules = `# FRAIM Cursor Rules
|
|
140
64
|
|
|
141
65
|
## Core Rules (Always Apply)
|
|
142
66
|
- **ashley-architecture.mdc** - Follow the established architecture patterns
|
|
@@ -179,24 +103,15 @@ function createAgentConfigs() {
|
|
|
179
103
|
- Enable observability through clear documentation
|
|
180
104
|
`;
|
|
181
105
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
} else {
|
|
185
|
-
logInfo('Cursor rules already exist, skipping');
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Claude rules - only create if it doesn't exist
|
|
189
|
-
if (!fs.existsSync('CLAUDE.md')) {
|
|
190
|
-
const claudeRules = `# FRAIM Claude Rules
|
|
106
|
+
// Create .windsurfrules that references modular rules
|
|
107
|
+
const windsurfRules = `# FRAIM Windsurf Rules
|
|
191
108
|
|
|
192
|
-
## Always
|
|
109
|
+
## Core Rules (Always Apply)
|
|
193
110
|
- **ashley-architecture.mdc** - Follow the established architecture patterns
|
|
194
111
|
- **continuous-learning.mdc** - Always review retrospectives and RFCs before starting work
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- **
|
|
198
|
-
- **implement.mdc** - Implementation phase rules
|
|
199
|
-
- **test.mdc** - Testing phase rules
|
|
112
|
+
- **local-development.mdc** - Work locally, coordinate remotely
|
|
113
|
+
- **simplicity.mdc** - Keep it simple, don't over-engineer
|
|
114
|
+
- **issue-resolution-process.mdc** - Follow the established issue resolution process
|
|
200
115
|
|
|
201
116
|
## Key Behavioral Requirements
|
|
202
117
|
- Always verify actions taken
|
|
@@ -217,29 +132,30 @@ function createAgentConfigs() {
|
|
|
217
132
|
- Use local Git for version control
|
|
218
133
|
- Test locally before committing
|
|
219
134
|
|
|
220
|
-
##
|
|
221
|
-
- Follow
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
`;
|
|
135
|
+
## Architecture and Optimization Principles
|
|
136
|
+
- Follow established patterns
|
|
137
|
+
- Optimize for performance and maintainability
|
|
138
|
+
- Document architectural decisions
|
|
139
|
+
- Consider scalability and security
|
|
226
140
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
141
|
+
## Your Role in FRAIM
|
|
142
|
+
- Provide technical expertise and optimization
|
|
143
|
+
- Maintain code quality and standards
|
|
144
|
+
- Ensure architectural consistency
|
|
145
|
+
- Support other agents with technical guidance
|
|
146
|
+
`;
|
|
232
147
|
|
|
233
|
-
//
|
|
234
|
-
|
|
235
|
-
const windsurfRules = `# FRAIM Windsurf Rules
|
|
148
|
+
// Create CLAUDE.md that references modular rules
|
|
149
|
+
const claudeRules = `# FRAIM Claude Rules
|
|
236
150
|
|
|
237
|
-
##
|
|
151
|
+
## Always-On Rules
|
|
238
152
|
- **ashley-architecture.mdc** - Follow the established architecture patterns
|
|
239
153
|
- **continuous-learning.mdc** - Always review retrospectives and RFCs before starting work
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
- **
|
|
154
|
+
|
|
155
|
+
## Phase-Specific Rules (Manual Trigger Only)
|
|
156
|
+
- **design.mdc** - Design phase rules
|
|
157
|
+
- **implement.mdc** - Implementation phase rules
|
|
158
|
+
- **test.mdc** - Testing phase rules
|
|
243
159
|
|
|
244
160
|
## Key Behavioral Requirements
|
|
245
161
|
- Always verify actions taken
|
|
@@ -260,24 +176,136 @@ function createAgentConfigs() {
|
|
|
260
176
|
- Use local Git for version control
|
|
261
177
|
- Test locally before committing
|
|
262
178
|
|
|
263
|
-
##
|
|
264
|
-
- Follow
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
179
|
+
## FRAIM Integration
|
|
180
|
+
- Follow the RIGOR methodology
|
|
181
|
+
- Maintain isolation between agents
|
|
182
|
+
- Use GitOps for coordination
|
|
183
|
+
- Enable observability through clear documentation
|
|
184
|
+
`;
|
|
268
185
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
186
|
+
writeFile('.cursorrules', cursorRules);
|
|
187
|
+
writeFile('.windsurfrules', windsurfRules);
|
|
188
|
+
writeFile('CLAUDE.md', claudeRules);
|
|
189
|
+
|
|
190
|
+
logSuccess('AI agent configuration files created');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function createGitHubWorkflows() {
|
|
194
|
+
// Phase change workflow
|
|
195
|
+
const phaseChangeWorkflow = `name: Phase Change Automation
|
|
196
|
+
|
|
197
|
+
on:
|
|
198
|
+
issues:
|
|
199
|
+
types: [labeled, unlabeled]
|
|
200
|
+
|
|
201
|
+
jobs:
|
|
202
|
+
phase-change:
|
|
203
|
+
runs-on: ubuntu-latest
|
|
204
|
+
if: contains(github.event.issue.labels.*.name, 'phase:') || contains(github.event.label.name, 'phase:')
|
|
205
|
+
steps:
|
|
206
|
+
- name: Checkout
|
|
207
|
+
uses: actions/checkout@v4
|
|
208
|
+
|
|
209
|
+
- name: Phase Change Handler
|
|
210
|
+
run: |
|
|
211
|
+
echo "Phase change detected for issue #\${{ github.event.issue.number }}"
|
|
212
|
+
echo "New phase: \${{ github.event.label.name || 'phase removed' }}"
|
|
213
|
+
|
|
214
|
+
- name: Update Issue Status
|
|
215
|
+
if: contains(github.event.label.name, 'phase:')
|
|
216
|
+
run: |
|
|
217
|
+
gh issue edit \${{ github.event.issue.number }} --add-label "status:wip"
|
|
218
|
+
echo "Status updated to WIP for new phase"
|
|
274
219
|
`;
|
|
275
220
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
221
|
+
// Status change workflow
|
|
222
|
+
const statusChangeWorkflow = `name: Status Change Automation
|
|
223
|
+
|
|
224
|
+
on:
|
|
225
|
+
issues:
|
|
226
|
+
types: [labeled, unlabeled]
|
|
227
|
+
|
|
228
|
+
jobs:
|
|
229
|
+
status-change:
|
|
230
|
+
runs-on: ubuntu-latest
|
|
231
|
+
if: contains(github.event.issue.labels.*.name, 'status:') || contains(github.event.label.name, 'status:')
|
|
232
|
+
steps:
|
|
233
|
+
- name: Checkout
|
|
234
|
+
uses: actions/checkout@v4
|
|
235
|
+
|
|
236
|
+
- name: Status Change Handler
|
|
237
|
+
run: |
|
|
238
|
+
echo "Status change detected for issue #\${{ github.event.issue.number }}"
|
|
239
|
+
echo "New status: \${{ github.event.label.name || 'status removed' }}"
|
|
240
|
+
|
|
241
|
+
- name: Notify Team
|
|
242
|
+
if: contains(github.event.label.name, 'status:needs-review')
|
|
243
|
+
run: |
|
|
244
|
+
echo "Issue ready for review - notifying team"
|
|
245
|
+
`;
|
|
246
|
+
|
|
247
|
+
// Sync on PR review workflow
|
|
248
|
+
const syncOnPRReviewWorkflow = `name: Sync on PR Review
|
|
249
|
+
|
|
250
|
+
on:
|
|
251
|
+
pull_request_review:
|
|
252
|
+
types: [submitted, edited, dismissed]
|
|
253
|
+
|
|
254
|
+
jobs:
|
|
255
|
+
sync-review:
|
|
256
|
+
runs-on: ubuntu-latest
|
|
257
|
+
steps:
|
|
258
|
+
- name: Checkout
|
|
259
|
+
uses: actions/checkout@v4
|
|
260
|
+
|
|
261
|
+
- name: Sync Review Status
|
|
262
|
+
env:
|
|
263
|
+
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
264
|
+
run: |
|
|
265
|
+
PR_NUMBER="\${{ github.event.pull_request.number }}"
|
|
266
|
+
REVIEW_STATE="\${{ github.event.review.state }}"
|
|
267
|
+
|
|
268
|
+
echo "PR #\$PR_NUMBER review state: \$REVIEW_STATE"
|
|
269
|
+
|
|
270
|
+
if [ "\$REVIEW_STATE" = "approved" ]; then
|
|
271
|
+
echo "PR approved - updating status"
|
|
272
|
+
gh pr edit \$PR_NUMBER --add-label "status:approved"
|
|
273
|
+
elif [ "\$REVIEW_STATE" = "changes_requested" ]; then
|
|
274
|
+
echo "Changes requested - updating status"
|
|
275
|
+
gh pr edit \$PR_NUMBER --add-label "status:changes-requested"
|
|
276
|
+
fi
|
|
277
|
+
|
|
278
|
+
echo "Review sync complete"
|
|
279
|
+
`;
|
|
280
|
+
|
|
281
|
+
writeFile('.github/workflows/phase-change.yml', phaseChangeWorkflow);
|
|
282
|
+
writeFile('.github/workflows/status-change.yml', statusChangeWorkflow);
|
|
283
|
+
writeFile('.github/workflows/sync-on-pr-review.yml', syncOnPRReviewWorkflow);
|
|
284
|
+
|
|
285
|
+
logSuccess('GitHub workflows created');
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function createGitHubLabels() {
|
|
289
|
+
const labels = [
|
|
290
|
+
{ name: 'phase:design', color: '0e8a16', description: 'Design phase - RFC creation and review' },
|
|
291
|
+
{ name: 'phase:impl', color: '1d76db', description: 'Implementation phase - coding and testing' },
|
|
292
|
+
{ name: 'phase:tests', color: 'fef2c0', description: 'Testing phase - validation and QA' },
|
|
293
|
+
{ name: 'status:wip', color: 'fbca04', description: 'Work in progress' },
|
|
294
|
+
{ name: 'status:needs-review', color: 'd93f0b', description: 'Ready for review' },
|
|
295
|
+
{ name: 'status:complete', color: '0e8a16', description: 'Completed and approved' },
|
|
296
|
+
{ name: 'status:approved', color: '0e8a16', description: 'Approved and ready to merge' },
|
|
297
|
+
{ name: 'status:changes-requested', color: 'd93f0b', description: 'Changes requested in review' },
|
|
298
|
+
{ name: 'ai-agent:cursor', color: '5319e7', description: 'Assigned to Cursor AI agent' },
|
|
299
|
+
{ name: 'ai-agent:claude', color: 'c2e0c6', description: 'Assigned to Claude AI agent' },
|
|
300
|
+
{ name: 'ai-agent:windsurf', color: 'bfdadc', description: 'Assigned to Windsurf AI agent' }
|
|
301
|
+
];
|
|
302
|
+
|
|
303
|
+
const labelsContent = JSON.stringify(labels, null, 2);
|
|
304
|
+
writeFile('.github/labels.json', labelsContent);
|
|
305
|
+
|
|
306
|
+
logInfo('GitHub labels configuration created');
|
|
307
|
+
logInfo('You can import these labels using GitHub CLI or the web interface');
|
|
308
|
+
logInfo('Or use the GitHub web interface: Settings > Labels > Import labels');
|
|
281
309
|
}
|
|
282
310
|
|
|
283
311
|
function createFRAIMConfig() {
|
|
@@ -299,7 +327,8 @@ function createFRAIMConfig() {
|
|
|
299
327
|
},
|
|
300
328
|
workflows: [
|
|
301
329
|
".github/workflows/phase-change.yml",
|
|
302
|
-
".github/workflows/status-change.yml"
|
|
330
|
+
".github/workflows/status-change.yml",
|
|
331
|
+
".github/workflows/sync-on-pr-review.yml"
|
|
303
332
|
]
|
|
304
333
|
};
|
|
305
334
|
|
|
@@ -315,10 +344,10 @@ function runSetup() {
|
|
|
315
344
|
// Create only essential directory structure
|
|
316
345
|
ensureDirectory('.github/workflows');
|
|
317
346
|
|
|
318
|
-
// Create
|
|
319
|
-
|
|
347
|
+
// Create all components
|
|
348
|
+
createAgentStructure();
|
|
320
349
|
createGitHubWorkflows();
|
|
321
|
-
|
|
350
|
+
createGitHubLabels();
|
|
322
351
|
createFRAIMConfig();
|
|
323
352
|
|
|
324
353
|
logHeader('🎉 Setup Complete!');
|