refactor: engineering improvements -- API versioning, structured logging, Alembic, error standardization, test coverage
- API versioning: all REST endpoints prefixed with /api/v1/ - Structured logging: replaced stdlib logging with structlog (console/JSON modes) - Alembic migrations: versioned DB schema with initial migration - Error standardization: global exception handlers for consistent envelope format - Interrupt cleanup: asyncio background task for expired interrupt removal - Integration tests: +30 tests (analytics, replay, openapi, error, session APIs) - Frontend tests: +57 tests (all components, pages, useWebSocket hook) - Backend: 557 tests, 89.75% coverage | Frontend: 80 tests, 16 test files
This commit is contained in:
57
CLAUDE.md
57
CLAUDE.md
@@ -30,7 +30,7 @@ pytest --cov=app --cov-report=term-missing
|
||||
# - If any test fails, fix it before starting the new phase
|
||||
|
||||
# 3. Create checkpoint to snapshot the starting state
|
||||
/everything-claude-code:checkpoint create "phase-name"
|
||||
/ecc:checkpoint create "phase-name"
|
||||
|
||||
# 4. Create the phase branch
|
||||
git checkout main
|
||||
@@ -50,25 +50,32 @@ git checkout -b phase-{N}/{short-description}
|
||||
3. Identify all tasks, acceptance criteria, and dependencies for this phase
|
||||
4. Create a phase dev log **skeleton** at `docs/phases/phase-{N}-dev-log.md` (date, branch name, plan link only -- content filled in Step 5)
|
||||
|
||||
### Step 2: Develop Using Orchestrate Skill
|
||||
### Step 2: Develop Using ECC Skills
|
||||
|
||||
Route to the correct orchestration mode based on work type:
|
||||
Route to the correct skill based on work type:
|
||||
|
||||
| Work Type | Skill Command |
|
||||
|-----------|---------------|
|
||||
| New feature | `/everything-claude-code:orchestrate feature` |
|
||||
| Bug fix | `/everything-claude-code:orchestrate bugfix` |
|
||||
| Refactor | `/everything-claude-code:orchestrate refactor` |
|
||||
| Work Type | Skill Command | What It Does |
|
||||
|-----------|---------------|--------------|
|
||||
| New feature | `/ecc:feature-dev <desc>` | Discovery -> Exploration -> Architecture -> TDD -> Review -> Summary |
|
||||
| Bug fix | `/ecc:tdd` then `/ecc:code-review` | RED -> GREEN -> REFACTOR cycle, then review |
|
||||
| Refactor | `/ecc:plan` then `/ecc:tdd` then `/ecc:code-review` | Plan refactor scope, TDD, review |
|
||||
| Security-sensitive | Add `/ecc:security-review` after code-review | Auth, payments, user input, external APIs |
|
||||
| Final verification | `/ecc:verify` | Build + tests + lint + coverage + security scan |
|
||||
|
||||
ALWAYS use the appropriate orchestrate skill. Never develop without it.
|
||||
|
||||
A single phase may contain mixed work types (e.g., Phase 5 has feature + bugfix + refactor). Call the orchestrate skill **per sub-task** with the matching mode. Example:
|
||||
A single phase may contain mixed work types. Call the appropriate skill **per sub-task**:
|
||||
|
||||
```
|
||||
# Within Phase 5:
|
||||
/everything-claude-code:orchestrate feature # for demo script
|
||||
/everything-claude-code:orchestrate bugfix # for error handling fixes
|
||||
/everything-claude-code:orchestrate refactor # for code cleanup
|
||||
# Within a phase:
|
||||
/ecc:feature-dev "demo script" # for new features
|
||||
/ecc:tdd # for bug fixes (write failing test, then fix)
|
||||
/ecc:plan "consolidate error handling" # for refactors (plan first, then TDD)
|
||||
```
|
||||
|
||||
For full multi-phase autonomous execution, use GSD:
|
||||
|
||||
```
|
||||
/gsd:autonomous # execute all remaining phases
|
||||
/gsd:execute-phase 6 # execute a specific phase
|
||||
```
|
||||
|
||||
### Step 3: Module Independence (CRITICAL)
|
||||
@@ -171,10 +178,10 @@ After all development and testing, run verification in this exact order:
|
||||
|
||||
```
|
||||
# 1. Run the verification skill -- must pass
|
||||
/everything-claude-code:verify
|
||||
/ecc:verify
|
||||
|
||||
# 2. Verify the checkpoint -- validates all phase deliverables
|
||||
/everything-claude-code:checkpoint verify "phase-name"
|
||||
/ecc:checkpoint verify "phase-name"
|
||||
```
|
||||
|
||||
The checkpoint verify validates:
|
||||
@@ -222,11 +229,11 @@ git push origin main --tags
|
||||
All four markers must be consistent. If any is missed, the next phase's Step 0 regression gate will catch the discrepancy.
|
||||
|
||||
A checkpoint includes:
|
||||
- `/everything-claude-code:checkpoint create` at phase start
|
||||
- `/everything-claude-code:checkpoint verify` at phase end
|
||||
- `/ecc:checkpoint create` at phase start
|
||||
- `/ecc:checkpoint verify` at phase end
|
||||
- All tests passing (80%+ coverage)
|
||||
- Phase dev log written and linked
|
||||
- `/everything-claude-code:verify` passed
|
||||
- `/ecc:verify` passed
|
||||
- Git tag `checkpoint/phase-{N}` created
|
||||
- Phase marked COMPLETED in four locations
|
||||
- Branch merged to main
|
||||
@@ -264,7 +271,7 @@ This project inherits from `~/.claude/rules/`. CLAUDE.md only contains project-s
|
||||
|
||||
### Hooks (ECC Plugin -- No Custom Hooks)
|
||||
|
||||
All hooks come from the ECC plugin (`everything-claude-code`). No project-level hooks in `.claude/settings.local.json`.
|
||||
All hooks come from the ECC plugin (`ecc`). No project-level hooks in `.claude/settings.local.json`.
|
||||
|
||||
| ECC Hook | Type | What It Does |
|
||||
|----------|------|-------------|
|
||||
@@ -290,7 +297,7 @@ Controlled by `ECC_HOOK_PROFILE` env var in `~/.claude/settings.json` (currently
|
||||
- Architecture doc: `docs/ARCHITECTURE.md`
|
||||
- Phase dev logs: `docs/phases/phase-{N}-dev-log.md`
|
||||
- Test command: `pytest --cov=app --cov-report=term-missing`
|
||||
- **Phase start:** `/everything-claude-code:checkpoint create "phase-name"`
|
||||
- **Phase end:** `/everything-claude-code:checkpoint verify "phase-name"`
|
||||
- Verify command: `/everything-claude-code:verify`
|
||||
- Orchestrate: `/everything-claude-code:orchestrate {feature|bugfix|refactor}`
|
||||
- **Phase start:** `/ecc:checkpoint create "phase-name"`
|
||||
- **Phase end:** `/ecc:checkpoint verify "phase-name"`
|
||||
- Verify command: `/ecc:verify`
|
||||
- Orchestrate: `/ecc:orchestrate {feature|bugfix|refactor}`
|
||||
|
||||
Reference in New Issue
Block a user