# TASKS ## TASK-000 — Bootstrap RDB project standards Status: Done Goal: Add the project control files used by RDB agent workflows. Acceptance Criteria: - PROJECT_STATE.md exists - AGENT_HANDOFF.md exists - .rdb/project.json exists - context/repository-context.md exists - TEST_PLAN.md exists - RUN_LOG.md exists - README.md explains the structure ## TASK-001 — Implement rdb init Status: Done Goal: Create the command that initialises the standard RDB project structure. ## TASK-002 — Generate agent prompts Status: Done Goal: Add a command that generates a ready-to-paste implementation prompt for the next Todo task. Acceptance Criteria: - `rdb prompt` reads the next Todo task from TASKS.md - The prompt tells the agent to read README.md, TASKS.md, PROJECT_STATE.md, AGENT_HANDOFF.md, and context/agent-guidelines.md - The prompt says to implement one task only - The prompt includes the task title, status, goal, and acceptance criteria - The prompt includes validation instructions - The prompt includes reporting instructions - Add or update tests ## TASK-003 — Improve discovery workflow Status: Done Goal: Improve `rdb discover` so it records structured answers into the discovery ledger. Acceptance Criteria: - Ask the 10 core discovery questions - Record: - Question - Answer - Confidence - Follow-up needed - Linked decision - Linked task - Date - Append answers safely - Preserve existing discovery history - Add/update tests - Update RUN_LOG.md ## TASK-004 — Implement ask-more command Status: Done Goal: Add a command that finds weak answers and asks deeper follow-up questions. Acceptance Criteria: - command reads discovery-log.md - low-confidence answers are detected - follow-up answers are appended to discovery-log.md ## TASK-005 — Task lifecycle commands Status: Done Goal: Allow tasks to be managed from the CLI rather than manually editing TASKS.md. Acceptance Criteria: - `rdb start TASK-ID` - Marks task In Progress - `rdb complete TASK-ID` - Marks task Done - Updates PROJECT_STATE.md - Updates AGENT_HANDOFF.md - Updates RUN_LOG.md - Preserves task formatting - Add/update tests - Run python -m pytest ## TASK-006 — Agent execution guardrails Status: Done Goal: Detect agent stalls, repeated reads, long reasoning loops, and non-progressing execution. Acceptance Criteria: - `rdb guardrails` command exists ✓ - Detects repeated file reads via AGENT_HANDOFF.md analysis ✓ - Detects repeated command entries in RUN_LOG.md ✓ - Flags project files not modified in >48 hours ✓ - Flags missing test run records in RUN_LOG.md ✓ - Checks TASKS.md ↔ RUN_LOG.md consistency ✓ - Produces clear human-readable report with overall status ✓ - All existing tests still pass (33 → 51) ✓ - Guardrail-specific tests added (18 new tests) ✓ ## TASK-007 — Improve generated agent prompts Status: Done Goal: Make `rdb prompt` produce smaller, more direct prompts for Claude Code/local LLM agents. Acceptance Criteria: - Prompt includes exact known implementation gap when available - Prompt includes existing test command from CLAUDE.md - Prompt tells agent not to repeatedly reread unchanged files - Prompt tells agent to inspect first, then edit - Prompt limits scope to one small implementation step - Add/update tests ## TASK-012 — Telemetry foundation Status: Done Goal: Create a minimal telemetry system that can record structured agent activity for future guardrail and analysis features. Implementation Gap: The project currently infers agent behaviour from documentation, task files, and run logs. There is no structured event log showing what actions an agent actually performed during a session. Acceptance Criteria: - Create a telemetry module - Create `.rdb/session-log.jsonl` automatically when recording an event - Support recording events in JSONL format - Each event contains: - timestamp - event_type - target - details - Provide a simple public function for writing telemetry events - Add/update tests Example Event: ```json { "timestamp": "2026-06-02T12:00:00Z", "event_type": "command", "target": "rdb prompt", "details": {} } ``` Constraints: - Do not integrate telemetry into existing commands yet - Do not modify guardrails yet - Do not implement dashboards or reporting - Build the smallest useful telemetry foundation only Definition of Done: - Telemetry writer exists - JSONL file is created correctly - Events append correctly - Tests pass - Documentation updated if required ## TASK-013 — Record CLI command execution Status: Done Goal: Record rdb CLI command execution using the telemetry system. Implementation Gap: Telemetry storage exists but no command activity is recorded. Acceptance Criteria: - Record command execution events - Include command name - Include timestamp - Add/update tests Definition of Done: - All 10 CLI commands record a telemetry event on invocation - Events have event_type "command" and target "rdb " - Timestamps are present in UTC ISO format - New integration tests added to test_telemetry.py (4 new tests) - All 75 tests pass ## TASK-014 — Integrate telemetry with guardrails Status: Done Goal: Use structured telemetry data in guardrail analysis. Implementation Gap: Guardrails currently rely on heuristics and markdown files rather than actual activity records. Acceptance Criteria: - Read telemetry events ✓ - Detect repeated commands ✓ - Detect repeated reads when available ✓ - Fall back gracefully when telemetry is absent ✓ - Add/update tests ✓ Result: Two new guardrail checks added: - `check_repeated_commands_telemetry` — uses session-log.jsonl to detect repeated CLI commands (>3x) - `check_repeated_reads_telemetry` — uses session-log.jsonl to detect repeated file reads (>3x) Both integrate into `run_all_guardrails` alongside existing heuristic checks. When telemetry data is absent, both return `"ok"` with an informative fallback message instead of failing.