chore: bootstrap rdb-discovery
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
CORE_QUESTIONS = [
|
||||
"What problem are we solving?",
|
||||
"Who is the user?",
|
||||
"What does success look like?",
|
||||
"What is the minimum useful version?",
|
||||
"What data do we need?",
|
||||
"What systems must it connect to?",
|
||||
"What are the risks?",
|
||||
"What must not happen?",
|
||||
"How will we test it?",
|
||||
"How will it be deployed?",
|
||||
]
|
||||
|
||||
CONTEXT_FILES: dict[str, str] = {
|
||||
"context/discovery-log.md": """# Discovery Log
|
||||
|
||||
| ID | Question | Answer | Confidence | Follow-up needed | Linked decision | Linked task | Date |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
""",
|
||||
"context/product-brief.md": """# Product Brief
|
||||
|
||||
## Problem
|
||||
|
||||
TBD
|
||||
|
||||
## Users
|
||||
|
||||
TBD
|
||||
|
||||
## Success Criteria
|
||||
|
||||
TBD
|
||||
|
||||
## Minimum Useful Version
|
||||
|
||||
TBD
|
||||
""",
|
||||
"context/architecture.md": """# Architecture
|
||||
|
||||
## Overview
|
||||
|
||||
TBD
|
||||
|
||||
## Components
|
||||
|
||||
TBD
|
||||
|
||||
## Integrations
|
||||
|
||||
TBD
|
||||
|
||||
## Deployment
|
||||
|
||||
TBD
|
||||
""",
|
||||
"context/decisions.md": """# Decisions
|
||||
|
||||
| ID | Decision | Reason | Date |
|
||||
|---|---|---|---|
|
||||
""",
|
||||
"context/risks.md": """# Risks
|
||||
|
||||
| ID | Risk | Impact | Mitigation | Status |
|
||||
|---|---|---|---|---|
|
||||
""",
|
||||
"context/assumptions.md": """# Assumptions
|
||||
|
||||
| ID | Assumption | Confidence | Validation Needed |
|
||||
|---|---|---|---|
|
||||
""",
|
||||
"context/open-questions.md": """# Open Questions
|
||||
|
||||
| ID | Question | Reason | Owner | Status |
|
||||
|---|---|---|---|---|
|
||||
""",
|
||||
"TASKS.md": """# TASKS.md
|
||||
|
||||
## TASK-001 - Create Python CLI project skeleton
|
||||
Status: Done
|
||||
|
||||
Goal: Create the initial package structure, CLI entry point, and markdown-first bootstrap.
|
||||
|
||||
Acceptance Criteria:
|
||||
- `rdb --help` runs
|
||||
- `rdb init` creates project files
|
||||
- README exists
|
||||
|
||||
## TASK-002 - Run initial project discovery
|
||||
Status: Todo
|
||||
|
||||
Goal: Run `rdb discover` and capture the core project answers.
|
||||
|
||||
Acceptance Criteria:
|
||||
- all 10 core questions are answered
|
||||
- discovery-log.md contains ledger entries
|
||||
- low-confidence answers are marked for follow-up
|
||||
|
||||
## TASK-003 - Review generated context files
|
||||
Status: Todo
|
||||
|
||||
Goal: Review the generated markdown files and fill in obvious gaps.
|
||||
|
||||
Acceptance Criteria:
|
||||
- product-brief.md reviewed
|
||||
- architecture.md reviewed
|
||||
- open-questions.md updated
|
||||
|
||||
## TASK-004 - Implement ask-more command
|
||||
Status: Todo
|
||||
|
||||
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
|
||||
""",
|
||||
"TEST_PLAN.md": """# TEST_PLAN.md
|
||||
|
||||
## Manual Tests
|
||||
|
||||
| ID | Test | Expected Result | Status |
|
||||
|---|---|---|---|
|
||||
| TEST-001 | Run `rdb --help` | CLI help is displayed | Not run |
|
||||
| TEST-002 | Run `rdb init` | Markdown files are created | Not run |
|
||||
| TEST-003 | Run `rdb status` | Project status is displayed | Not run |
|
||||
| TEST-004 | Run `rdb next` | Next Todo task is shown | Not run |
|
||||
|
||||
## Automated Tests
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
pytest
|
||||
```
|
||||
""",
|
||||
"RUN_LOG.md": """# RUN_LOG.md
|
||||
|
||||
| Date | Event | Task | Notes |
|
||||
|---|---|---|---|
|
||||
""",
|
||||
}
|
||||
|
||||
|
||||
def write_file_if_missing(root: Path, relative_path: str, content: str) -> bool:
|
||||
target = root / relative_path
|
||||
if target.exists():
|
||||
return False
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
target.write_text(content, encoding="utf-8")
|
||||
return True
|
||||
Reference in New Issue
Block a user