fraim-framework 1.0.11 → 2.0.1
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/.ai-agents/agent-guardrails.md +58 -0
- package/.ai-agents/mcp-template.jsonc +34 -0
- package/.ai-agents/rules/agent-testing-guidelines.md +545 -0
- package/.ai-agents/rules/architecture.md +52 -0
- package/.ai-agents/rules/communication.md +122 -0
- package/.ai-agents/rules/continuous-learning.md +55 -0
- package/.ai-agents/rules/git-safe-commands.md +34 -0
- package/.ai-agents/rules/integrity-and-test-ethics.md +223 -0
- package/.ai-agents/rules/local-development.md +252 -0
- package/.ai-agents/rules/merge-requirements.md +231 -0
- package/.ai-agents/rules/pr-workflow-completeness.md +191 -0
- package/.ai-agents/rules/simplicity.md +112 -0
- package/.ai-agents/rules/software-development-lifecycle.md +276 -0
- package/.ai-agents/rules/spike-first-development.md +199 -0
- package/.ai-agents/rules/successful-debugging-patterns.md +313 -0
- package/.ai-agents/scripts/cleanup-branch.ts +278 -0
- package/.ai-agents/scripts/exec-with-timeout.ts +122 -0
- package/.ai-agents/scripts/prep-issue.sh +162 -0
- package/.ai-agents/templates/evidence/Design-Evidence.md +30 -0
- package/.ai-agents/templates/evidence/Implementation-BugEvidence.md +48 -0
- package/.ai-agents/templates/evidence/Implementation-FeatureEvidence.md +54 -0
- package/.ai-agents/templates/evidence/Spec-Evidence.md +19 -0
- package/.ai-agents/templates/help/HelpNeeded.md +14 -0
- package/.ai-agents/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +55 -0
- package/.ai-agents/templates/specs/BUGSPEC-TEMPLATE.md +37 -0
- package/.ai-agents/templates/specs/FEATURESPEC-TEMPLATE.md +29 -0
- package/.ai-agents/templates/specs/TECHSPEC-TEMPLATE.md +39 -0
- package/.ai-agents/workflows/design.md +121 -0
- package/.ai-agents/workflows/implement.md +170 -0
- package/.ai-agents/workflows/resolve.md +152 -0
- package/.ai-agents/workflows/retrospect.md +84 -0
- package/.ai-agents/workflows/spec.md +103 -0
- package/.ai-agents/workflows/test.md +90 -0
- package/.cursor/rules/cursor-rules.mdc +8 -0
- package/.cursor/rules/design.mdc +4 -0
- package/.cursor/rules/implement.mdc +6 -0
- package/.cursor/rules/resolve.mdc +5 -0
- package/.cursor/rules/retrospect.mdc +4 -0
- package/.cursor/rules/spec.mdc +4 -0
- package/.cursor/rules/test.mdc +5 -0
- package/.windsurf/rules/windsurf-rules.md +7 -0
- package/.windsurf/workflows/resolve-issue.md +6 -0
- package/.windsurf/workflows/retrospect.md +6 -0
- package/.windsurf/workflows/start-design.md +6 -0
- package/.windsurf/workflows/start-impl.md +6 -0
- package/.windsurf/workflows/start-spec.md +6 -0
- package/.windsurf/workflows/start-tests.md +6 -0
- package/CHANGELOG.md +66 -0
- package/CODEOWNERS +24 -0
- package/DISTRIBUTION.md +6 -6
- package/PUBLISH_INSTRUCTIONS.md +93 -0
- package/README.md +330 -104
- package/bin/fraim.js +49 -3
- package/index.js +30 -3
- package/install.sh +58 -58
- package/labels.json +52 -0
- package/linkedin-post.md +23 -0
- package/package.json +12 -7
- package/sample_package.json +18 -0
- package/setup.js +712 -389
- package/test-utils.ts +118 -0
- package/tsconfig.json +22 -0
- package/agents/claude/CLAUDE.md +0 -42
- package/agents/cursor/rules/architecture.mdc +0 -49
- package/agents/cursor/rules/continuous-learning.mdc +0 -48
- package/agents/cursor/rules/cursor-workflow.mdc +0 -29
- package/agents/cursor/rules/design.mdc +0 -25
- package/agents/cursor/rules/implement.mdc +0 -26
- package/agents/cursor/rules/local-development.mdc +0 -104
- package/agents/cursor/rules/prep.mdc +0 -15
- package/agents/cursor/rules/resolve.mdc +0 -46
- package/agents/cursor/rules/simplicity.mdc +0 -18
- package/agents/cursor/rules/software-development-lifecycle.mdc +0 -41
- package/agents/cursor/rules/test.mdc +0 -25
- package/agents/windsurf/rules/architecture.md +0 -49
- package/agents/windsurf/rules/continuous-learning.md +0 -47
- package/agents/windsurf/rules/local-development.md +0 -103
- package/agents/windsurf/rules/remote-development.md +0 -22
- package/agents/windsurf/rules/simplicity.md +0 -17
- package/agents/windsurf/rules/windsurf-workflow.md +0 -28
- package/agents/windsurf/workflows/prep.md +0 -20
- package/agents/windsurf/workflows/resolve-issue.md +0 -47
- package/agents/windsurf/workflows/start-design.md +0 -26
- package/agents/windsurf/workflows/start-impl.md +0 -27
- package/agents/windsurf/workflows/start-tests.md +0 -26
- package/github/phase-change.yml +0 -218
- package/github/status-change.yml +0 -68
- package/github/sync-on-pr-review.yml +0 -66
- package/scripts/__init__.py +0 -10
- package/scripts/cli.py +0 -141
- package/setup.py +0 -0
- package/test-config.json +0 -32
- package/workflows/setup-fraim.yml +0 -147
package/test-utils.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import dotenv from 'dotenv';
|
|
2
|
+
dotenv.config({override:true});
|
|
3
|
+
|
|
4
|
+
import { test } from 'node:test';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// Base test case interface that all test cases should extend
|
|
8
|
+
export interface BaseTestCase {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
tags?: string[];
|
|
12
|
+
testFn?: () => Promise<boolean>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Global tracker for failed tests across all suites
|
|
16
|
+
const globalFailedTests: string[] = [];
|
|
17
|
+
|
|
18
|
+
// Generic test runner function that can run any type of test
|
|
19
|
+
|
|
20
|
+
export async function runTests<T extends BaseTestCase>(
|
|
21
|
+
testCases: T[],
|
|
22
|
+
runTestFn: (testCase: T) => Promise<boolean>,
|
|
23
|
+
testTitle: string
|
|
24
|
+
): Promise<void> {
|
|
25
|
+
console.log(`🧪 Testing ${testTitle}...\n`);
|
|
26
|
+
|
|
27
|
+
// Check if we need to filter by tags
|
|
28
|
+
let tagsFilter: string[] = [];
|
|
29
|
+
|
|
30
|
+
console.log(`Command line arguments: ${process.argv.join(', ')}`);
|
|
31
|
+
|
|
32
|
+
// First try command line arguments
|
|
33
|
+
const tagsArg = process.argv.find(arg => arg && typeof arg === 'string' && arg.startsWith('--tags='));
|
|
34
|
+
if (tagsArg) {
|
|
35
|
+
const tagValue = tagsArg.split('=')[1];
|
|
36
|
+
if (tagValue) {
|
|
37
|
+
tagsFilter = tagValue.split(',');
|
|
38
|
+
console.log(`Filtering tests by tags (from CLI): ${tagsFilter.join(', ')}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Then try environment variable (for npm scripts)
|
|
43
|
+
if (tagsFilter.length === 0 && process.env.TAGS) {
|
|
44
|
+
tagsFilter = process.env.TAGS.split(',');
|
|
45
|
+
console.log(`Filtering tests by tags (from ENV): ${tagsFilter.join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Check for exclusion tags
|
|
49
|
+
let excludeTags: string[] = [];
|
|
50
|
+
if (process.env.EXCLUDE_TAGS) {
|
|
51
|
+
excludeTags = process.env.EXCLUDE_TAGS.split(',');
|
|
52
|
+
console.log(`Excluding tests with tags (from ENV): ${excludeTags.join(', ')}`);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Filter test cases by tags if specified
|
|
56
|
+
const testsToRun = testCases.filter(test => {
|
|
57
|
+
// First check inclusion filter
|
|
58
|
+
if (tagsFilter.length > 0) {
|
|
59
|
+
// Ensure test.tags exists before calling .some() on it
|
|
60
|
+
if (!test.tags || !test.tags.some(tag => tagsFilter.includes(tag))) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Then check exclusion filter
|
|
66
|
+
if (excludeTags.length > 0) {
|
|
67
|
+
// Exclude tests with specified tags
|
|
68
|
+
if (test.tags && test.tags.some(tag => excludeTags.includes(tag))) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return true;
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
if (testsToRun.length === 0) {
|
|
77
|
+
console.log('No tests to run for suite: ' + testTitle);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
console.log(`Running ${testsToRun.length} tests${tagsFilter.length > 0 ? ` with tags: ${tagsFilter.join(', ')}` : ''}\n`);
|
|
82
|
+
|
|
83
|
+
// Use Node.js built-in test() function for each test case
|
|
84
|
+
// This allows the TAP reporter to properly aggregate results across all test files
|
|
85
|
+
for (const testCase of testsToRun) {
|
|
86
|
+
await test(testCase.name, async () => {
|
|
87
|
+
try {
|
|
88
|
+
const success = await runTestFn(testCase);
|
|
89
|
+
if (!success) {
|
|
90
|
+
const failedTestName = `${testTitle}: ${testCase.name}`;
|
|
91
|
+
if (!globalFailedTests.includes(failedTestName)) {
|
|
92
|
+
globalFailedTests.push(failedTestName);
|
|
93
|
+
}
|
|
94
|
+
throw new Error(`Test failed: ${testCase.name}`);
|
|
95
|
+
}
|
|
96
|
+
} catch (error) {
|
|
97
|
+
const failedTestName = `${testTitle}: ${testCase.name}`;
|
|
98
|
+
if (!globalFailedTests.includes(failedTestName)) {
|
|
99
|
+
globalFailedTests.push(failedTestName);
|
|
100
|
+
}
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Display comprehensive final summary
|
|
107
|
+
console.log(`\n🚨 FINAL TEST SUMMARY:`);
|
|
108
|
+
console.log(` ❌ Total Failed Tests: ${globalFailedTests.length}`);
|
|
109
|
+
|
|
110
|
+
if (globalFailedTests.length > 0) {
|
|
111
|
+
console.log(` 📋 Failed Test Names:`);
|
|
112
|
+
globalFailedTests.forEach(testName => {
|
|
113
|
+
console.log(` - ${testName}`);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
process.exit(globalFailedTests.length > 0 ? 1 : 0);
|
|
118
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2021",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["es2021"],
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true
|
|
12
|
+
},
|
|
13
|
+
"include": [
|
|
14
|
+
"src/**/*.ts",
|
|
15
|
+
"test/**/*.ts",
|
|
16
|
+
"test-runner.ts",
|
|
17
|
+
"test-utils.ts"
|
|
18
|
+
],
|
|
19
|
+
"exclude": [
|
|
20
|
+
"node_modules"
|
|
21
|
+
]
|
|
22
|
+
}
|
package/agents/claude/CLAUDE.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# Claude Code Configuration for Ashley Calendar AI
|
|
2
|
-
|
|
3
|
-
## Always-On Rules
|
|
4
|
-
The following rules from `.cursor/rules/` should ALWAYS be followed by Claude Code instances:
|
|
5
|
-
|
|
6
|
-
- **architecture.mdc** - Core architecture principles (BAML for LLM tasks, TypeScript for deterministic logic)
|
|
7
|
-
- **continuous-learning.mdc** - Always review retrospectives and RFCs before starting work
|
|
8
|
-
- **cursor-workflow.mdc** - Standard Claude Code development workflow
|
|
9
|
-
- **local-development.mdc** - Local development guidelines and tool usage
|
|
10
|
-
- **resolve.mdc** - Issue resolution process
|
|
11
|
-
- **software-development-lifecycle.mdc** - Complete SDLC process
|
|
12
|
-
|
|
13
|
-
## Phase-Specific Rules (Manual Trigger Only)
|
|
14
|
-
These rules should only be applied when explicitly requested:
|
|
15
|
-
|
|
16
|
-
- **prep.md** - Apply when user says "prep issue" or similar
|
|
17
|
-
- **design.md** - Apply when user says "design phase" or similar
|
|
18
|
-
- **implement.md** - Apply when user says "implementation phase" or similar
|
|
19
|
-
- **test.md** - Apply when user says "test phase" or similar
|
|
20
|
-
|
|
21
|
-
## Key Behavioral Requirements
|
|
22
|
-
1. **Never commit** unless explicitly asked
|
|
23
|
-
2. **Use TodoWrite** tool for all multi-step tasks
|
|
24
|
-
3. **Review retrospectives** before starting similar work
|
|
25
|
-
4. **Follow architecture principles** - BAML for natural language, TypeScript for deterministic logic
|
|
26
|
-
5. **Verify working directory** before file operations
|
|
27
|
-
6. **Promise to follow these rules** when asked
|
|
28
|
-
|
|
29
|
-
## Project Structure Awareness
|
|
30
|
-
- BAML sources: `/baml_src/**/*.baml`
|
|
31
|
-
- Generated client: `/baml_client/**`
|
|
32
|
-
- Deterministic logic: `/src/**`
|
|
33
|
-
- Design docs: `/docs/rfcs/*.md`
|
|
34
|
-
- Retrospectives: `/retrospectives/`
|
|
35
|
-
- Scripts: `/scripts/`
|
|
36
|
-
|
|
37
|
-
## Tool Usage Guidelines
|
|
38
|
-
- Use Read, Edit, Write tools for file operations
|
|
39
|
-
- Use Grep, Glob for searching
|
|
40
|
-
- Use Bash for commands and tests
|
|
41
|
-
- Use TodoWrite for progress tracking
|
|
42
|
-
- Always verify working directory before file operations
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Architecture principles and guidelines
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Architecture
|
|
7
|
-
|
|
8
|
-
## Intent
|
|
9
|
-
Keep the architecture clean: use BAML (LLM) for any natural-language understanding, fuzzy matching, or semantic comparison. Use deterministic TypeScript only for side-effectful or strictly rule-based work (APIs, DB, validation, formatting, scheduling, retries).
|
|
10
|
-
|
|
11
|
-
## Principles (follow in this order)
|
|
12
|
-
1. Parse (LLM/BAML) → 2. Normalize (deterministic) → 3. Validate (deterministic) → 4. Decide (LLM if subjective; code if rules) → 5. Act (deterministic side effects)
|
|
13
|
-
|
|
14
|
-
## LLM/BAML Usage
|
|
15
|
-
- Entity/intent extraction, timezone/place inference, date/time range interpretation
|
|
16
|
-
- Participant role classification, preference inference, text similarity
|
|
17
|
-
- De-dupe by meaning, natural language understanding
|
|
18
|
-
|
|
19
|
-
## Deterministic TypeScript Usage
|
|
20
|
-
- ISO date math, schema validation, authZ/authN, idempotency keys
|
|
21
|
-
- OpenAPI I/O, DB writes, calendar invites, retries/timeouts
|
|
22
|
-
- Metrics/telemetry, side effects
|
|
23
|
-
|
|
24
|
-
## Do / Don't
|
|
25
|
-
|
|
26
|
-
### Do (LLM/BAML)
|
|
27
|
-
- NLP; Anything that needs understanding from user unstructured input
|
|
28
|
-
|
|
29
|
-
### Do (Deterministic TS)
|
|
30
|
-
- Ensure structure through interfaces, folder management, test cases
|
|
31
|
-
|
|
32
|
-
### Don't
|
|
33
|
-
- Don't hand-roll regex/heuristics for dates/locations/intent
|
|
34
|
-
- Don't duplicate LLM functionality
|
|
35
|
-
- Don't call BAML for pure formatting (e.g., toISOString, trimming)
|
|
36
|
-
|
|
37
|
-
## Project Structure
|
|
38
|
-
- **BAML sources**: `/baml_src/**/*.baml`
|
|
39
|
-
- **Generated client**: `/baml_client/**` (run `baml-cli generate`)
|
|
40
|
-
- **Deterministic logic**: `/src/**`
|
|
41
|
-
- **Design docs + Test plans**: `/docs/rfcs/*.md`
|
|
42
|
-
- **Random utility scripts**: `/scripts`
|
|
43
|
-
- **Test cases**: `/` (at root level, these are the most important artifacts)
|
|
44
|
-
|
|
45
|
-
## Local Development Notes
|
|
46
|
-
- Test deterministic logic with unit tests before integrating with LLM components
|
|
47
|
-
- Write test cases for each change. Tag representative ones with 'smoke'
|
|
48
|
-
- Keep architecture boundaries clear between LLM and deterministic code
|
|
49
|
-
- Document any architectural decisions in your RFC or implementation notes
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Continuous learning from retrospectives and past work
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Continuous Learning
|
|
7
|
-
|
|
8
|
-
## Retrospectives Review
|
|
9
|
-
- **Always review** the `/retrospectives/` folder before starting work on similar issues
|
|
10
|
-
- **Learn from past problems** - understand root cause analysis and lessons learned
|
|
11
|
-
- **Apply previous solutions** - don't repeat mistakes that have already been solved
|
|
12
|
-
|
|
13
|
-
## Knowledge Integration
|
|
14
|
-
- **Read related RFCs** in `/docs/rfcs/` to understand design decisions
|
|
15
|
-
- **Review test cases** to see how similar problems were approached
|
|
16
|
-
- **Check issue history** for patterns in failures and solutions
|
|
17
|
-
|
|
18
|
-
## Local Development Benefits
|
|
19
|
-
- **Avoid known pitfalls** by learning from retrospectives
|
|
20
|
-
- **Build on existing solutions** rather than starting from scratch
|
|
21
|
-
- **Understand system constraints** from past architectural decisions
|
|
22
|
-
|
|
23
|
-
## Before Starting Work
|
|
24
|
-
1. **Search retrospectives** for related issues or similar problems
|
|
25
|
-
2. **Read relevant RFCs** to understand the design context
|
|
26
|
-
3. **Review test cases** to see expected behavior
|
|
27
|
-
4. **Check issue comments** for previous attempts and solutions
|
|
28
|
-
|
|
29
|
-
## Document Your Learning
|
|
30
|
-
- **Update retrospectives** if you discover new insights
|
|
31
|
-
- **Add to RFCs** if you find better approaches
|
|
32
|
-
- **Share solutions** with other agents through issue comments
|
|
33
|
-
|
|
34
|
-
## Retrospective Triggers
|
|
35
|
-
|
|
36
|
-
### **Automatic Retrospective Requirements**
|
|
37
|
-
- **Complex Issues (>3 iterations)**: Must create retrospective before issue closure
|
|
38
|
-
- **Process Violations**: Any workflow rule violations require retrospectives
|
|
39
|
-
- **Work Loss Incidents**: Any incidents where work is lost require detailed retrospectives
|
|
40
|
-
|
|
41
|
-
### **Retrospective Creation Process**
|
|
42
|
-
1. **Stop Current Work**: Pause issue resolution if retrospective is required
|
|
43
|
-
2. **Create Retrospective**: Use standard template in retrospectives folder
|
|
44
|
-
3. **Root Cause Analysis**: Identify underlying causes, not just symptoms
|
|
45
|
-
4. **Prevention Measures**: Document specific actions to prevent recurrence
|
|
46
|
-
5. **Process Updates**: Update rules and workflows based on learnings
|
|
47
|
-
|
|
48
|
-
Remember: The best code is often written by those who learn from history rather than repeat it.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Cursor development workflow and output guidelines
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Cursor Development Workflow
|
|
7
|
-
|
|
8
|
-
## Goal
|
|
9
|
-
Work efficiently in local environment while maintaining coordination with remote repository and other agents.
|
|
10
|
-
|
|
11
|
-
## Behavior
|
|
12
|
-
- Use local file system for development work
|
|
13
|
-
- ***NEVER*** commit unless asked to do so
|
|
14
|
-
- Produce clear progress updates with:
|
|
15
|
-
1. Actions executed (imperative, past tense)
|
|
16
|
-
2. Local progress (files modified, tests run)
|
|
17
|
-
3. Remote artifacts (branch, PR status)
|
|
18
|
-
4. Next steps for this issue
|
|
19
|
-
5. Blocking issues (if any)
|
|
20
|
-
|
|
21
|
-
## Stop Criteria
|
|
22
|
-
- When the assigned work is complete
|
|
23
|
-
- When tests pass and PR is ready for review
|
|
24
|
-
- When waiting for reviewer feedback
|
|
25
|
-
|
|
26
|
-
## Output Template
|
|
27
|
-
- Summary:
|
|
28
|
-
- Local progress: [what you accomplished locally]
|
|
29
|
-
- Remote status: [branch/PR status]
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Start designing the solution
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
Step 1: Ask for {issue_number} (and optional {slug})
|
|
6
|
-
|
|
7
|
-
Step 2: Label the issue 'phase:design' (GitHub Action will automatically create a branch, label the issue `status:wip`, create a draft PR)
|
|
8
|
-
|
|
9
|
-
Step 3: Using GitHub MCP, wait for the branch to get created, then do a checkout to start your work.
|
|
10
|
-
|
|
11
|
-
*** IMPORTANT IF YOU ARE WORKING LOCALLY **** switch into your branch and ensure you work in your own folder.
|
|
12
|
-
|
|
13
|
-
Step 4: Do your work either remotely or locally as defined by the user. If unsure, ask the user. Once sure, let the user know.
|
|
14
|
-
|
|
15
|
-
Step 5: Your work entails the following
|
|
16
|
-
|
|
17
|
-
- Create docs/rfcs/{issue_number}-{slug}.md.
|
|
18
|
-
|
|
19
|
-
- If the issue requires a small fix or bug fix, use this template - docs/rfcs/BUG-TEMPLATE.md
|
|
20
|
-
|
|
21
|
-
- If the issue requires major changes, use this template - docs/rfcs/RFC-TEMPLATE.md
|
|
22
|
-
|
|
23
|
-
- When ready for review, flip issue to 'status:needs-review' and remove 'status:wip'
|
|
24
|
-
|
|
25
|
-
Step 6: If workflow actions or reviewer feedback indicates more work is needed, ensure the issue is set back to `status:wip` and continue working as above.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Start implementing the solution
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
Step 1: Ask for {issue_number} (and optional {slug}); confirm target branch feature/{issue_number}-{slug}.
|
|
6
|
-
|
|
7
|
-
Step 2: Ensure the branch exists (your GitHub Action will usually auto-create it) and checkout it.
|
|
8
|
-
|
|
9
|
-
Step 3: Label the issue 'phase:impl'. (GitHub Action will automatically label the issue `status:wip`, create a draft PR)
|
|
10
|
-
|
|
11
|
-
Step 4: Do your work either remotely or locally as defined by the user. If unsure, ask the user. Once sure, let the user know.
|
|
12
|
-
|
|
13
|
-
Step 5: Your work entails the following
|
|
14
|
-
|
|
15
|
-
- Review the RFC associated with this issue.
|
|
16
|
-
|
|
17
|
-
- Determine whether changes need to be made to existing code, or brand new code needs to be written.
|
|
18
|
-
|
|
19
|
-
- Write the minimal set of code and test cases needed for this issue.
|
|
20
|
-
|
|
21
|
-
- **Test cases must inherit from test-utils and follow the structure of the rest of the test suite**
|
|
22
|
-
- Ensure test cases pass.
|
|
23
|
-
|
|
24
|
-
- When ready for review, flip issue to 'status:needs-review' and remove 'status:wip'
|
|
25
|
-
|
|
26
|
-
Step 6: If workflow actions or reviewer feedback indicates more work is needed, ensure the issue is set back to `status:wip` and continue working as above.
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Local development with remote coordination guidelines
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Local Development with Remote Coordination
|
|
7
|
-
|
|
8
|
-
- Use local file system for development work in your own cloned repository folder
|
|
9
|
-
- Push to feature branches only; never push to master
|
|
10
|
-
- Do NOT open PRs; push and let Actions open/update Draft PRs
|
|
11
|
-
- Always work in your own cloned repository folder: `git clone <repo> "<repo> - Issue {issue_number}"`
|
|
12
|
-
- After you create the clone, do not forget to change into that working directory. All your work **MUST** be in your working directory.
|
|
13
|
-
- Coordinate with other agents through GitHub issues and PRs
|
|
14
|
-
- Each agent works independently in their own folder to enable true parallel development
|
|
15
|
-
|
|
16
|
-
## CRITICAL RULE: Absolute Workspace Separation
|
|
17
|
-
|
|
18
|
-
### Local Clone: WORK-ONLY
|
|
19
|
-
- **Directory**: `<repo> - Issue <issue number>`
|
|
20
|
-
- **Purpose**: All development work happens here exclusively
|
|
21
|
-
- **Rule**: ALL file operations must be within this directory
|
|
22
|
-
|
|
23
|
-
## Mandatory Pre-File-Operation Checklist
|
|
24
|
-
|
|
25
|
-
**Before ANY file operation (edit_file, delete_file, etc.), verify:**
|
|
26
|
-
|
|
27
|
-
1. ✅ **Directory Check**: `pwd` shows local clone with issue number in path
|
|
28
|
-
2. ✅ **Path Verification**: File path is relative (no "../" or main workspace name)
|
|
29
|
-
3. ✅ **Branch Check**: `git branch` shows correct feature branch
|
|
30
|
-
4. ❌ **If ANY check fails**: STOP immediately and fix location
|
|
31
|
-
|
|
32
|
-
**This checklist is MANDATORY, not optional.**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
## Enhanced Stop Conditions
|
|
36
|
-
|
|
37
|
-
**Stop ALL work immediately if:**
|
|
38
|
-
- You create a file and it appears in main workspace
|
|
39
|
-
- You use edit_file with "../" paths
|
|
40
|
-
- You work in directory without issue number in name
|
|
41
|
-
- `pwd` shows main workspace path
|
|
42
|
-
- Any file operation targets main workspace
|
|
43
|
-
|
|
44
|
-
**Take corrective action before continuing.**
|
|
45
|
-
|
|
46
|
-
## Workspace Validation Commands
|
|
47
|
-
|
|
48
|
-
**Before starting work, run:**
|
|
49
|
-
```bash
|
|
50
|
-
echo "Working in: $(pwd)"
|
|
51
|
-
echo "Should contain issue number in path"
|
|
52
|
-
git branch
|
|
53
|
-
echo "Should show feature branch"
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**If output doesn't match expectations, fix before proceeding.**
|
|
57
|
-
|
|
58
|
-
## Tool Usage Restrictions
|
|
59
|
-
|
|
60
|
-
### File Operations - Local Only
|
|
61
|
-
- `edit_file()` - ONLY with relative paths in local repo
|
|
62
|
-
- `delete_file()` - ONLY within local repo
|
|
63
|
-
- `search_replace()` - ONLY on local repo files
|
|
64
|
-
|
|
65
|
-
### Reference Operations - Main Workspace OK
|
|
66
|
-
- `read_file()` - OK to read from main workspace for reference
|
|
67
|
-
- `list_dir()` - OK to explore main workspace structure
|
|
68
|
-
- `grep()` - OK to search main workspace for patterns
|
|
69
|
-
|
|
70
|
-
## Violation Recovery Process
|
|
71
|
-
|
|
72
|
-
**If you violate workspace boundaries:**
|
|
73
|
-
|
|
74
|
-
1. **Stop immediately** - Do not continue file operations
|
|
75
|
-
2. **Assess damage** - Check what was created in wrong location
|
|
76
|
-
3. **Clean up** - Delete files created in main workspace
|
|
77
|
-
4. **Recreate correctly** - Recreate files in local repo only
|
|
78
|
-
5. **Document violation** - Update post-mortem with details
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## Enhanced Output Template
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
Summary:
|
|
85
|
-
- Work completed in local repository: [path]
|
|
86
|
-
- Files created/modified: [list with relative paths]
|
|
87
|
-
- Workspace violations: [none/details if any occurred]
|
|
88
|
-
|
|
89
|
-
Artifacts:
|
|
90
|
-
- Branch: [URL]
|
|
91
|
-
- Local directory: [full path to local clone]
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Emergency Safeguards
|
|
95
|
-
|
|
96
|
-
**If assistant shows signs of workspace confusion:**
|
|
97
|
-
- User should immediately clarify working directory
|
|
98
|
-
- Assistant should run `pwd` and verify location
|
|
99
|
-
- All file operations should pause until location confirmed
|
|
100
|
-
- Assistant should explicitly state file paths being used
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
**Bottom Line**: The local development workflow requires absolute discipline about workspace boundaries.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Step 1: Ask for {issue_number}
|
|
2
|
-
|
|
3
|
-
Step 2: Clone the repo to "<repo> - Issue {issue_number}"
|
|
4
|
-
- **CRITICAL**: Clone ONE LEVEL ABOVE the current workspace directory
|
|
5
|
-
- **DO NOT** clone inside the current workspace folder
|
|
6
|
-
- **VERIFY LOCATION**: Use `pwd` to confirm you're in the parent directory before cloning
|
|
7
|
-
|
|
8
|
-
Step 3: Confirm items in the checklist and say "Huzzah!"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Safety Checklist
|
|
12
|
-
- [ ] Confirmed current workspace path with `pwd`
|
|
13
|
-
- [ ] Changed to parent directory (`cd ..`) before cloning
|
|
14
|
-
- [ ] Verified clone location is outside current workspace
|
|
15
|
-
- [ ] Successfully changed into cloned repository
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Start resolution workflow
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
Ensure branch: feature/{issue}-{slug} is checked out (create if needed).
|
|
6
|
-
|
|
7
|
-
Commit & push any pending changes.
|
|
8
|
-
|
|
9
|
-
Sync from origin/master into this branch (merge or rebase), resolve conflicts, push again.
|
|
10
|
-
|
|
11
|
-
Check the results of GitHub Action that runs the full tests in the cloud.
|
|
12
|
-
|
|
13
|
-
If they pass: open/update the Implementation PR, label it, and enable auto-merge.
|
|
14
|
-
|
|
15
|
-
If they fail: no PR is opened/updated; fix, push again, repeat.
|
|
16
|
-
|
|
17
|
-
Once PR is approved and related actions succeed, do the following:
|
|
18
|
-
- **MANDATORY**: Verify PR is actually merged to master before proceeding
|
|
19
|
-
- **MANDATORY**: Run merge verification checks (see below)
|
|
20
|
-
- Close the issue ONLY after merge verification passes
|
|
21
|
-
- Delete the branch remotely.
|
|
22
|
-
- If operating locally, delete the local branch and the local codebase.
|
|
23
|
-
- Say Hoorah !
|
|
24
|
-
|
|
25
|
-
## Mandatory Merge Verification
|
|
26
|
-
|
|
27
|
-
**Before closing ANY issue, verify the following:**
|
|
28
|
-
|
|
29
|
-
1. ✅ **PR Status**: PR shows "merged" status, not just "closed"
|
|
30
|
-
2. ✅ **Merge Commit**: Verify merge commit exists in master
|
|
31
|
-
3. ✅ **Files in Master**: Confirm expected files are present in master
|
|
32
|
-
|
|
33
|
-
### **Verification Commands**
|
|
34
|
-
```bash
|
|
35
|
-
# Check PR is merged, not just closed
|
|
36
|
-
gh pr view <PR_NUMBER> --json merged
|
|
37
|
-
|
|
38
|
-
# Verify merge commit in master
|
|
39
|
-
git fetch origin master
|
|
40
|
-
git log origin/master --oneline | grep "PR #<PR_NUMBER>"
|
|
41
|
-
|
|
42
|
-
# Verify files in master
|
|
43
|
-
git show origin/master:path/to/expected/file
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
**CRITICAL**: Do not close the issue until merge verification passes. This prevents work loss incidents.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description:
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
****Keep it simple. Don't over-engineer. *****
|
|
8
|
-
Don't over-think it.
|
|
9
|
-
While fixing an issue, focus on that issue only. Don't fix other issues. Don't make unrelated changes. Instead, file a Git issue if you find other issues that aren't already tracked by an existing Git issue.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Always verify the action you have taken. Do not expect the user to verify it for you.
|
|
13
|
-
If you kicked off a Git workflow, verify it completed successfully (e.g., gh checks: list or PR status).
|
|
14
|
-
If you wrote a test and expect it to pass, run it yourself and verify it passes; if you expect it to fail, verify it fails.
|
|
15
|
-
Always link work to the issue (use “Closes #<n>” in the Implementation PR).
|
|
16
|
-
Open Draft PRs early; review happens in the PR, not in chat.
|
|
17
|
-
|
|
18
|
-
Agents must not run gh pr create. Push to the feature branch and let Actions open Draft PRs.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Issue resolution process for local development with branch/clone approach
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Issue Resolution Process
|
|
7
|
-
|
|
8
|
-
Always work on the feature branch for the current issue: `feature/<issue#>-<kebab-title>`. Never push to master.
|
|
9
|
-
|
|
10
|
-
## Development Workflow
|
|
11
|
-
1. **Clone Setup**: Work in your own cloned repository folder.
|
|
12
|
-
2. **Branch Management**: Create/checkout feature branch for your issue
|
|
13
|
-
3. **Local Development**: Make changes, run tests locally
|
|
14
|
-
4. **Check before commit**: Only commit after approval from the user.
|
|
15
|
-
5. **Remote Coordination**: Use GitHub MCP for issue labels
|
|
16
|
-
|
|
17
|
-
## Phases
|
|
18
|
-
- **Design**: Set ISSUE to `phase:design` → create RFC
|
|
19
|
-
- **Implementation**: Set ISSUE to `phase:impl` → implement solution
|
|
20
|
-
|
|
21
|
-
## Status Management
|
|
22
|
-
- **WIP**: Automatically set when entering new phase
|
|
23
|
-
- **Needs Review**: Set this when work is ready for review
|
|
24
|
-
- **Complete**: Automatically set when PR is approved
|
|
25
|
-
|
|
26
|
-
## PR Requirements
|
|
27
|
-
- Implementation PR body MUST include `Closes #<n>`
|
|
28
|
-
- Let Actions handle PR creation and updates
|
|
29
|
-
- Address all reviewer feedback before completion
|
|
30
|
-
|
|
31
|
-
## Cleanup
|
|
32
|
-
When user confirms code is correctly merged into master, confirm with the user, then
|
|
33
|
-
- delete remote branch
|
|
34
|
-
- delete local branch
|
|
35
|
-
- remove your local clone folder:
|
|
36
|
-
```
|
|
37
|
-
cd ..
|
|
38
|
-
Remove-Item -Recurse -Force "<repo> - Issue {issue_number}"
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Respect CODEOWNERS; don't modify auth/CI without approval.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Start testing workflow
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
Step 1: Ask for {issue_number} (and optional {slug}); confirm target branch feature/{issue_number}-{slug}.
|
|
6
|
-
|
|
7
|
-
Step 2: Using GitHub MCP, ensure the branch exists (your GitHub Action will usually auto-create it) and checkout it.
|
|
8
|
-
|
|
9
|
-
Step 3: Label the issue 'phase:tests'. (GitHub Action will automatically label the issue `status:wip`, create a draft PR)
|
|
10
|
-
|
|
11
|
-
Step 4: Do your work either remotely or locally as defined by the user. If unsure, ask the user. Once sure, let the user know.
|
|
12
|
-
|
|
13
|
-
Step 5: Your work entails the following
|
|
14
|
-
|
|
15
|
-
- Review the RFC associated with this issue.
|
|
16
|
-
|
|
17
|
-
- Determine whether tests need to be added to an existing test suite, or a new one needs to be created.
|
|
18
|
-
|
|
19
|
-
- Write the minimal set of test cases that accurately reproduce the issue
|
|
20
|
-
|
|
21
|
-
- Run the test cases to ensure they fail
|
|
22
|
-
|
|
23
|
-
- Flip issue to 'status:needs-review' and remove 'status:wip'
|
|
24
|
-
|
|
25
|
-
Step 6: If workflow actions or reviewer feedback indicates more work is needed, ensure the issue is set back to `status:wip` and continue working as above.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
trigger: always_on
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# Architecture
|
|
7
|
-
|
|
8
|
-
## Intent
|
|
9
|
-
Keep the architecture clean: use BAML (LLM) for any natural-language understanding, fuzzy matching, or semantic comparison. Use deterministic TypeScript only for side-effectful or strictly rule-based work (APIs, DB, validation, formatting, scheduling, retries).
|
|
10
|
-
|
|
11
|
-
## Principles (follow in this order)
|
|
12
|
-
1. Parse (LLM/BAML) → 2. Normalize (deterministic) → 3. Validate (deterministic) → 4. Decide (LLM if subjective; code if rules) → 5. Act (deterministic side effects)
|
|
13
|
-
|
|
14
|
-
## LLM/BAML Usage
|
|
15
|
-
- Entity/intent extraction, timezone/place inference, date/time range interpretation
|
|
16
|
-
- Participant role classification, preference inference, text similarity
|
|
17
|
-
- De-dupe by meaning, natural language understanding
|
|
18
|
-
|
|
19
|
-
## Deterministic TypeScript Usage
|
|
20
|
-
- ISO date math, schema validation, authZ/authN, idempotency keys
|
|
21
|
-
- OpenAPI I/O, DB writes, calendar invites, retries/timeouts
|
|
22
|
-
- Metrics/telemetry, side effects
|
|
23
|
-
|
|
24
|
-
## Do / Don't
|
|
25
|
-
|
|
26
|
-
### Do (LLM/BAML)
|
|
27
|
-
- NLP; Anything that needs understanding from user unstructured input
|
|
28
|
-
|
|
29
|
-
### Do (Deterministic TS)
|
|
30
|
-
- Ensure structure through interfaces, folder management, test cases
|
|
31
|
-
|
|
32
|
-
### Don't
|
|
33
|
-
- Don't hand-roll regex/heuristics for dates/locations/intent
|
|
34
|
-
- Don't duplicate LLM functionality
|
|
35
|
-
- Don't call BAML for pure formatting (e.g., toISOString, trimming)
|
|
36
|
-
|
|
37
|
-
## Project Structure
|
|
38
|
-
- **BAML sources**: `/baml_src/**/*.baml`
|
|
39
|
-
- **Generated client**: `/baml_client/**` (run `baml-cli generate`)
|
|
40
|
-
- **Deterministic logic**: `/src/**`
|
|
41
|
-
- **Design docs + Test plans**: `/docs/rfcs/*.md`
|
|
42
|
-
- **Random utility scripts**: `/scripts`
|
|
43
|
-
- **Test cases**: `/` (at root level, these are the most important artifacts)
|
|
44
|
-
|
|
45
|
-
## Local Development Notes
|
|
46
|
-
- Test deterministic logic with unit tests before integrating with LLM components
|
|
47
|
-
- Write test cases for each change. Tag representative ones with 'smoke'
|
|
48
|
-
- Keep architecture boundaries clear between LLM and deterministic code
|
|
49
|
-
- Document any architectural decisions in your RFC or implementation notes
|