docs: update dead links

This commit is contained in:
2025-11-05 11:00:36 +01:00
parent b4f8875a0e
commit 66b0c3b40d
20 changed files with 126 additions and 83 deletions

View File

@@ -14,7 +14,7 @@ def parse_plan(plan_path):
content = f.read()
tasks = []
current_phase = None
current_epic = None
current_section = None
subtask_num = 1
@@ -23,11 +23,12 @@ def parse_plan(plan_path):
while i < len(lines):
line = lines[i].rstrip()
# Phase header
phase_match = re.match(r'^## Phase (\d+):', line)
if phase_match:
current_phase = int(phase_match.group(1))
subtask_num = 1 # Reset subtask counter for new phase
# Epic header (supports legacy Phase headers for compatibility)
epic_match = re.match(r'^## Epic (\d+):', line)
legacy_phase_match = re.match(r'^## Phase (\d+):', line)
if epic_match or legacy_phase_match:
current_epic = int((epic_match or legacy_phase_match).group(1))
subtask_num = 1 # Reset subtask counter for new epic
i += 1
continue
@@ -41,7 +42,7 @@ def parse_plan(plan_path):
# Task item (checkbox) - must match exactly
task_match = re.match(r'^- \[ \] (.+)', line)
if task_match and current_phase is not None and current_section is not None:
if task_match and current_epic is not None and current_section is not None:
task_desc = task_match.group(1).strip()
# Handle tasks that end with colon (might have code block or list following)
@@ -64,10 +65,10 @@ def parse_plan(plan_path):
else:
i += 1
# Only add if we have valid phase and section
if current_phase is not None and current_section is not None:
# Only add if we have valid epic and section
if current_epic is not None and current_section is not None:
tasks.append({
'phase': current_phase,
'epic': current_epic,
'section': current_section,
'subtask': subtask_num,
'description': task_desc,
@@ -82,14 +83,14 @@ def parse_plan(plan_path):
def create_task_file(task, output_dir):
"""Create a task markdown file"""
phase_dir = output_dir / f"phase{task['phase']}"
phase_dir.mkdir(exist_ok=True)
epic_dir = output_dir / f"epic{task['epic']}"
epic_dir.mkdir(exist_ok=True)
task_id = f"{task['section']}.{task['subtask']}"
# Create safe filename
safe_desc = re.sub(r'[^\w\s-]', '', task['description'])[:50].strip().replace(' ', '-').lower()
filename = f"{task_id}-{safe_desc}.md"
filepath = phase_dir / filename
filepath = epic_dir / filename
# Generate content
content = f"""# Task {task_id}: {task['description']}
@@ -97,7 +98,7 @@ def create_task_file(task, output_dir):
## Metadata
- **Task ID**: {task_id}
- **Title**: {task['description']}
- **Phase**: {task['phase']} - {get_phase_name(task['phase'])}
- **Epic**: {task['epic']} - {get_epic_name(task['epic'])}
- **Section**: {task['section']}
- **Status**: Pending
- **Priority**: High
@@ -142,9 +143,9 @@ go test ./...
return filepath
def get_phase_name(phase_num):
"""Get phase name from number"""
phases = {
def get_epic_name(epic_num):
"""Get epic name from number"""
epics = {
0: "Project Setup & Foundation",
1: "Core Kernel & Infrastructure",
2: "Authentication & Authorization",
@@ -155,7 +156,7 @@ def get_phase_name(phase_num):
7: "Testing, Documentation & CI/CD",
8: "Advanced Features & Polish"
}
return phases.get(phase_num, "Unknown")
return epics.get(epic_num, "Unknown")
def main():
script_dir = Path(__file__).parent
@@ -182,13 +183,13 @@ def main():
task_id = f"{task['section']}.{task['subtask']}"
# Determine filepath before creating
phase_dir = output_dir / f"phase{task['phase']}"
phase_dir.mkdir(exist_ok=True)
epic_dir = output_dir / f"epic{task['epic']}"
epic_dir.mkdir(exist_ok=True)
# Create safe filename
safe_desc = re.sub(r'[^\w\s-]', '', task['description'])[:50].strip().replace(' ', '-').lower()
filename = f"{task_id}-{safe_desc}.md"
filepath = phase_dir / filename
filepath = epic_dir / filename
# Check if file already exists (skip if so)
if filepath.exists() and filepath.stat().st_size > 100: