TFW Handoff โ Task Execution by New Agent¶
Roles: Coordinator (hands off) โ Executor (receives, questions, implements) Input: Approved HL + TS files Output: RF file with implementation results
๐ ROLE LOCK: EXECUTOR Permitted artifacts: ONB, RF. Forbidden actions: writing HL, writing TS, writing REVIEW, modifying HL, changing scope. The executor MUST NOT modify HL or TS. If scope issues are found โ write them in ONB and STOP.
Step 0: Name This Session¶
Name this session: Executor | {TASK-ID} | Phase {X}
Set this as the session/conversation name before doing anything else.
Context Loading (Executor)¶
When starting as executor, load in order:
1. AGENTS.md โ agent instructions
2. .tfw/conventions.md โ project conventions
3. .tfw/glossary.md โ terminology
4. KNOWLEDGE.md โ architecture, decisions, legacy (if exists)
5. Master HL for the task โ understand vision, design philosophy, architecture decisions
6. Phase HL (if multi-phase) โ phase-specific scope and context
7. TS file for the task โ exact scope, DoD, constraints
8. Related HL/TS/RF files referenced in the task
9. Relevant code files listed in TS
Phase 1: Executor Onboarding¶
- Read all context โ HL, TS, referenced files, relevant code
- Analyze the task โ identify:
- Questions that need clarification (blocking and non-blocking)
- Recommendations for improvement
- Risks and edge cases not covered in TS
- Read HL ยง7.2 Knowledge Citations โ verify each item, fill ONB ยง7. For each citation: confirm read, state how applied or why N/A. Add any NEW PV items you find relevant that coordinator missed.
- Inconsistencies between HL/TS/KNOWLEDGE.md and actual code
- Missing information or incomplete specifications
- Errors, gaps, or oversights in the spec
- Write ONB file โ use
.tfw/templates/ONB.mdas canonical format. Structured as:
## Questions (blocking โ cannot proceed without answers)
| # | Question | Answer |
|---|----------|--------|
## Recommendations (suggestions, not blocking)
1. ...
## Risks Found (edge cases, potential issues not in TS)
1. ...
## Inconsistencies with Code (spec vs reality)
1. ...
- Commit and push ONB โ the onboarding report is a first-class artifact
- Wait for user approval โ do NOT proceed until all blocking questions resolved
Coordinator ONB answer protocol: When answering blocking questions โ if the answer is not explicitly stated in HL, TS, or KNOWLEDGE.md, present 2-3 options with tradeoffs. Do not decide on behalf of the stakeholder.
- Update project task board โ status to
๐ ONB
Phase 2: Execution¶
- Update project task board โ change status to
๐ข RF(in progress) - Implement โ follow TS step by step:
- For code changes: write production-ready code, no placeholders
- For CL tasks: present commands/SQL to user, wait for execution
- For AG tasks: create artifacts directly
Execution Loops โ if TS acceptance criteria have [depends: AC-X] annotations (meaning one AC must be verified before another can start): verify the prerequisite AC gate passes before starting the dependent AC. Example: if AC-2 has [depends: AC-1], verify AC-1 is complete before implementing AC-2. Independent ACs (no [depends]) may be implemented in any order.
- Run tests โ as specified in TS verification section
- Build gate โ run build/compile command from TS verification section. If build fails โ fix BEFORE writing RF. Never write RF with failing build.
Phase 3: Write RF¶
-
Pre-RF Gate โ open
.tfw/templates/RF.md. Read all section headings before writing anything. Then write RF following this structure. -
Create RF file โ use
.tfw/templates/RF.mdas canonical format. MANDATORY sections:- ยง1 What Was Done โ changes list with file paths
- ยง2 Key Decisions โ decisions and rationale
- ยง3 Acceptance Criteria โ checkmark each TS DoD item
- ยง4 Verification โ lint/test/verify results
- ยง5 Observations โ out-of-scope items noticed (table format). Quality bar: only issues that would bite the next developer.
- ยง6 Fact Candidates โ review conversation history, extract human-sourced knowledge. If none: "No fact candidates."
- ยง7 Strategic Insights โ capture domain knowledge with implications. If none: "No strategic insights."
- ยง8 Diagrams โ architecture, data flow, component interaction. If none: "No diagrams." Never omit ยง6-8. Empty content is acceptable ("No X."); absent section is not.
๐ก As you work, capture strategic knowledge about the project โ stakeholder priorities, domain patterns, business context, external constraints โ in ยง6 Fact Candidates. These save the next agent from missing critical context.
Before writing Fact Candidates, review the conversation history. The human's messages are the primary source โ their decisions, priorities, concerns, and domain insights. Extract what informs decisions, not implementation details.
Observations Section (mandatory in RF)¶
Executors MUST report anything they noticed but did NOT modify:
## Observations (out-of-scope, not modified)
| # | File | Line(s) | Type | Description |
|---|------|---------|------|-------------|
| 1 | `example.tsx` | 42 | dead-code | Unused import `OldComponent` |
| 2 | `utils.ts` | 15-20 | duplication | Same helper exists in 3 files |
Types: dead-code, naming, todo, duplication, perf, security, style, missing-test, ux
Quality bar: report only issues that would bite the next developer. Don't generate observations just because the section exists.
If nothing found, write: No observations.
๐ Executor STOP¶
Your work is done. Do NOT proceed to review. Inform the user: "RF is complete. Start
/tfw-reviewto review the results." Writing a REVIEW file as executor is a ๐ Role Lock violation.
Multi-Phase Task Flow¶
For large tasks broken into phases:
Coordinator: Master HL (approved)
โ
โโโ Phase A: Coordinator writes HL__PhaseA + TS__PhaseA
โ โโโ Executor Agent: reads โ ONB โ executes โ RF__PhaseA
โ โโโ After RF, run /tfw-review for review
โ
โโโ Phase B: Coordinator writes HL__PhaseB + TS__PhaseB
โ โโโ Executor Agent: reads โ ONB โ executes โ RF__PhaseB
โ โโโ After RF, run /tfw-review for review
โ
โโโ ... repeat per Phase
Each Phase Agent starts with full context loading. Coordinator maintains the Master HL for continuity.
Anti-patterns¶
Full generic list โ conventions.md ยง14. Role-specific items below:
- Executor continues past Phase 3 โ must STOP after RF
- Executor writes REVIEW file โ ๐ Role Lock violation
- ๐ Executor MUST NOT write HL, TS, REVIEW, or change scope โ Role Lock violation