Input: Design documents from /specs/001-specManager-perp/
Prerequisites: plan.md (required), research.md, data-model.md, contracts/
1. Load plan.md from feature directory
→ If not found: ERROR "No implementation plan found"
→ Extract: tech stack, libraries, structure
2. Load optional design documents:
→ data-model.md: Extract entities → model tasks
→ contracts/: Each file → contract test task
→ research.md: Extract decisions → setup tasks
3. Generate tasks by category:
→ Setup: environment, proxies, credentials, risk configs
→ Tests: dry-run simulations, orderbook validation, multi-account integration
→ Core: hedging engines, order routing, exposure monitoring
→ Integration: exchange adapters, observability, rollback safeguards
→ Polish: performance verification, documentation, operational rehearsals
4. Apply task rules:
→ Different files = mark [P] for parallel
→ Same file = sequential (no [P])
→ Tests before implementation (TDD)
→ Exposure-related safeguards MUST precede new trading flows
5. Number tasks sequentially (T001, T002...)
6. Generate dependency graph
7. Create parallel execution examples
8. Validate task completeness:
→ All contracts have tests?
→ All entities have models?
→ All endpoints implemented?
9. Return: SUCCESS (tasks ready for execution)
[ID] [P?] Description
src/
, tests/
at repository rootbackend/src/
, frontend/src/
api/src/
, ios/src/
or android/src/
CRITICAL: These tests MUST be written and MUST FAIL before ANY implementation
# Launch T006-T012 together:
Task: "Contract test account-sync in tests/contract/test_account_sync.ts"
Task: "Contract test hedge-execution in tests/contract/test_hedge_execution.ts"
Task: "Contract test market-data-failover in tests/contract/test_market_data_failover.ts"
Task: "Integration test utilization rebalancing in tests/integration/test_utilization_rebalance.ts"
Task: "Integration test delta hedging in tests/integration/test_delta_hedging.ts"
Task: "Integration test market data failover in tests/integration/test_market_data_failover.ts"
Task: "Integration test strategy module sandbox in tests/integration/test_strategy_sandbox.ts"
Applied during main() execution
From Contracts:
From Data Model:
From User Stories:
Ordering:
GATE: Checked by main() before returning