|
| 1 | +# EdgeFlow Development Agents & Rules |
| 2 | + |
| 3 | +## CRITICAL RULES - MUST BE FOLLOWED |
| 4 | + |
| 5 | +### Rule 1: CLI-API Parity (STRICTLY ENFORCED) |
| 6 | +Every CLI command MUST have a corresponding API endpoint. NO EXCEPTIONS. |
| 7 | + |
| 8 | +| CLI Command | API Endpoint | Status | |
| 9 | +|------------|--------------|--------| |
| 10 | +| `python edgeflowc.py config.ef` | `POST /api/compile` | ✅ | |
| 11 | +| `python edgeflowc.py config.ef --verbose` | `POST /api/compile/verbose` | ✅ | |
| 12 | +| `python edgeflowc.py --version` | `GET /api/version` | ✅ | |
| 13 | +| `python edgeflowc.py --help` | `GET /api/help` | ✅ | |
| 14 | + |
| 15 | +Enforcement: |
| 16 | +- PR will be REJECTED if CLI functionality exists without API endpoint |
| 17 | +- PR will be REJECTED if API endpoint exists without CLI equivalent (except /health) |
| 18 | + |
| 19 | +### Rule 2: Pre-PR Checklist (MANDATORY) |
| 20 | +Before raising ANY PR: |
| 21 | + |
| 22 | +- [ ] Run `make lint-backend` - MUST PASS |
| 23 | +- [ ] Run `make lint-frontend` - MUST PASS |
| 24 | +- [ ] Run `make test-backend` - MUST PASS (target ≥90% coverage) |
| 25 | +- [ ] Run `make test-frontend` - MUST PASS (target ≥80% coverage) |
| 26 | +- [ ] Run `make pre-commit` - ALL CHECKS MUST PASS |
| 27 | +- [ ] Update API documentation if endpoints changed |
| 28 | +- [ ] Update Agents.md if new CLI commands added |
| 29 | + |
| 30 | +Evidence Required in PR: |
| 31 | +``` |
| 32 | +make pre-commit |
| 33 | +``` |
| 34 | + |
| 35 | +### Rule 3: Documentation Requirements |
| 36 | +Every PR must include: |
| 37 | +1. Updated OpenAPI spec (auto-generated by FastAPI) |
| 38 | +2. Updated README if user-facing changes |
| 39 | +3. Docstrings/JSDoc for all new functions |
| 40 | +4. Updated Agents.md for new features |
| 41 | + |
| 42 | +## Development Agents |
| 43 | + |
| 44 | +### Backend Agent |
| 45 | +- Maintains API server |
| 46 | +- Ensures CLI wrapper functions work correctly |
| 47 | +- Responsible for backend tests |
| 48 | +- Reviews: API design, security, performance |
| 49 | + |
| 50 | +### Frontend Agent |
| 51 | +- Maintains UI components |
| 52 | +- Ensures API integration works |
| 53 | +- Responsible for frontend tests |
| 54 | +- Reviews: UX, accessibility, browser compatibility |
| 55 | + |
| 56 | +### Integration Agent |
| 57 | +- Maintains docker-compose setup |
| 58 | +- Ensures frontend-backend communication |
| 59 | +- Responsible for E2E tests |
| 60 | +- Reviews: System integration, deployment |
| 61 | + |
| 62 | +## Workflow |
| 63 | + |
| 64 | +1. Feature development |
| 65 | +``` |
| 66 | +git checkout -b feature/your-feature |
| 67 | +# Make changes |
| 68 | +make pre-commit # MUST PASS |
| 69 | +git add . |
| 70 | +git commit -m "feat: your feature" |
| 71 | +git push origin feature/your-feature |
| 72 | +``` |
| 73 | + |
| 74 | +2. PR Template |
| 75 | +``` |
| 76 | +## Changes |
| 77 | +- [ ] Added CLI command: `___` |
| 78 | +- [ ] Added API endpoint: `___` |
| 79 | +- [ ] CLI-API parity maintained |
| 80 | +
|
| 81 | +## Testing |
| 82 | +- [ ] Backend tests pass |
| 83 | +- [ ] Frontend tests pass |
| 84 | +- [ ] E2E tests pass |
| 85 | +- [ ] Pre-commit checks pass |
| 86 | +
|
| 87 | +## Evidence |
| 88 | +``` |
| 89 | +make pre-commit |
| 90 | +``` |
| 91 | +``` |
| 92 | + |
| 93 | +## Monitoring |
| 94 | + |
| 95 | +Dashboard tracking: |
| 96 | +- CLI commands without API endpoints: 0 (MUST be 0) |
| 97 | +- API endpoints without CLI commands: 1 (/health only) |
| 98 | +- Test coverage: Backend >90%, Frontend >80% |
| 99 | +- Lint violations: 0 |
| 100 | + |
0 commit comments