| name | implement-agentflow-plan |
| description | Implement a registered Django AgentFlow plan in the owning apps, preserve schema and async contracts, and prove exact architecture coverage. |
Implement Django AgentFlow Plan
Use this skill when the user asks to implement a registered plan from approved Django AgentFlow
architecture.
Contract
Implement every plan task and nothing outside it. Repository rules control code quality, security,
testing, and style, but cannot expand product scope. If implementation requires a model, field,
enum, endpoint behavior, task, schedule, or platform difference, stop and create a new proposal.
Prepare
- Read repository instructions, memories,
.agentflow/references/django-architecture.md, the
registered plan, and its manifest.
- Read the exact approved architecture revision named by the plan.
- Inspect active Django settings, app ownership, existing migrations, URLs, models, serializers,
views, tasks, and tests involved in the plan.
- Record the starting Git state so unrelated user work remains separate.
- Confirm the plan targets the latest approved revision:
python3 .agentflow/scripts/agentflow.py status
python3 .agentflow/scripts/agentflow.py plan list
Implement In Plan Order
- Keep every code and migration change attributable to plan task IDs.
- Put domain code in the owning app and cross-app primitives in
common only when approved.
- Match approved model names, fields, nullability, defaults, relations,
on_delete, reverse names,
enums, indexes, and constraints exactly.
- Create migrations with safe dependency and deployment ordering. Do not generate unrelated model
churn. Include approved data migrations or backfills and make them bounded and reversible when
repository practice requires it.
- Implement complete API paths: URL ownership, validation, authentication, permissions, scope,
transactions, persistence, task/event handoffs, responses, and errors.
- Enqueue Celery work after commit when it depends on committed data. Preserve approved queue,
idempotency, retry, timeout, failure, state-transition, and Beat schedule behavior.
- Do not introduce nearby fields, responses, signals, jobs, utilities, abstractions, or refactors.
- Run focused checks after each task, followed by relevant Django, migration, Celery, and broader
project checks.
Audit The Complete Diff
Inspect every changed file and runtime operation. Preserve unrelated pre-existing changes and
exclude them from AgentFlow evidence. Create temporary evidence mapping each implementation item
and file to plan task IDs:
{
"schemaVersion": 2,
"planId": "add-course-enrollment",
"architectureRevision": "rev-...",
"items": [
{
"taskId": "persist-course-user-mapping",
"status": "implemented",
"summary": "Added the approved model, migration, constraints, and tests."
}
],
"changes": [
{
"path": "courses/models.py",
"kind": "code",
"symbol": "CourseUserMapping",
"taskIds": ["persist-course-user-mapping"],
"evidence": "Fields and constraints match the approved table."
Allowed evidence kinds are code, migration, test, config, runtime, and documentation.
Every task appears exactly once and every implemented task has evidence.
python3 .agentflow/scripts/agentflow.py implementation audit --input /tmp/evidence.json
Also verify manually:
- app ownership and names match approved architecture;
- migrations contain no accidental field, index, or constraint changes;
- APIs and tasks use the exact approved model states and enum values;
- every permission, decision, transaction, async boundary, retry, failure, and outcome is present;
- every changed file maps to a plan task and no unapproved behavior appears;
- focused tests and relevant Django checks support the evidence.
Fix every mismatch. Do not complete while any task is blocked. After a clean audit:
python3 .agentflow/scripts/agentflow.py implementation complete --input /tmp/evidence.json
Finish
Update memory only for durable repository conventions or architecture preferences. Report the
implemented revision, task coverage, migration and verification results, and blockers. Never claim
the approved architecture is implemented before implementation complete succeeds.