Lesson 3.1: Implement with Quality
Module: 3 — Build
Time: ~45 minutes
Format: I Do — Concepts
What is ce-work?
ce-work is the execution phase of the Compound Engineering loop. It wraps the full implementation cycle — reading the plan, running the build, running quality gates, verifying against acceptance commands — so you finish a feature in one focused run.
Use it when:
- You have a clear plan and are ready to implement.
- You’re mid-implementation and need to stay focused and verify as you go.
- You want to hand off a partially completed feature to yourself (resuming later).
The execution loop
ce-work runs this loop:
1. Read the plan → confirm scope, blockers, acceptance commands.
2. Implement phase-by-phase → one phase at a time.
3. After each phase:
a. Run quality gates (lint, types, tests).
b. Verify against acceptance commands.
c. If a gate fails → fix before moving to the next phase.
4. When all phases pass → proceed to commit.
The key discipline is not moving to the next phase until the current one passes its gates. This prevents late-stage surprises and keeps the review surface small.
Quality gates
Every phase should run through these before declaring done:
| Gate | Command | Threshold |
|---|---|---|
| Lint | npm run lint (platform) / ruff check . (Python) | Zero errors |
| Types | npm run types (platform) / mypy . (Python) | Zero errors |
| Tests | npm run test:unit (platform) / pytest (Python) | All pass |
| Build | npm run build (platform only — do not run during sessions) | Pass |
In a real work session, you run what applies. During this learning exercise, run the relevant ones for your project.
Phase execution in practice
Using the Dagster example from the Plan module:
Phase 1 — Slack client setup
op read item brainforge/slack-webhookto get the URL.- Add the webhook URL to your local
.env(never commit it). - Write a small test script that calls the Slack client and verifies a message appears in
#pipeline-alerts. - Run lint and type checks.
Phase 2 — Error handler integration
- Edit
notification_handler.pyto add the Slack call innotify_run_failure(). - Trigger a deliberate failure in the local Dagster dev instance.
- Watch
#pipeline-alerts— confirm the message arrives within 60 seconds. - Run tests.
Phase 3 — Unit test
- Write
test_notify_failure_slackwith mocking. - Run
pytest pipelines_tests/test_notification_handler.py -v. - Confirm all tests pass and coverage meets threshold.
Invoking the skill
/ce-work
Describe your current plan phase and where you are in the loop. The skill will help you stay disciplined about gates and verification.
Check your understanding
- Why should you run quality gates after each phase, not just at the end?
- Name the four quality gates for a platform (Next.js) project and a Python (Dagster) project.
- A phase’s acceptance command says “message appears in pipeline-alerts within 60 seconds.” You trigger the failure and nothing appears after 90 seconds. What do you do?
Navigation
- Previous: Module 2 — Plan
- Next: Module 4 — Review