Repository navigation
Expand file tree
/
Copy pathreformat_tasks.py
More file actions
76 lines (63 loc) · 2.75 KB
/
Copy pathreformat_tasks.py
File metadata and controls
76 lines (63 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python3
"""
Reformat UICC provisioner tasks.md to match web-dashboard format.
"""
import re
def reformat_task_section(content):
"""Reformat a task section from old to new format."""
lines = content.split('\n')
output = []
i = 0
while i < len(lines):
line = lines[i]
# Check if this is a task header like "### 3. ATR Parser Implementation"
if re.match(r'^### \d+\.', line):
output.append(line)
output.append('')
i += 1
# Skip old _Leverage:, _Requirements:, _Prompt: lines
while i < len(lines) and (lines[i].startswith('_Leverage:') or
lines[i].startswith('_Requirements:') or
lines[i].startswith('_Prompt:') or
lines[i] == ''):
i += 1
# Now process subtasks
while i < len(lines):
line = lines[i]
# Check if we hit the next major section
if line.startswith('### ') or line.startswith('## '):
break
# Check if this is a subtask like "- [ ] 3.1. Create..."
match = re.match(r'^- \[ \] (\d+\.\d+)\. (.+)$', line)
if match:
task_num = match.group(1)
task_title = match.group(2)
output.append(f'- [ ] {task_num}. {task_title}')
output.append(' - File: [TO_BE_FILLED]')
output.append(' - [TO_BE_FILLED: Short description]')
output.append(' - Purpose: [TO_BE_FILLED]')
output.append(' - _Leverage: [TO_BE_FILLED]_')
output.append(' - _Requirements: [TO_BE_FILLED]_')
output.append(' - _Prompt: [TO_BE_FILLED]_')
output.append('')
else:
output.append(line)
i += 1
continue
else:
output.append(line)
i += 1
return '\n'.join(output)
# Read the file
with open('.spec-workflow/specs/uicc-provisioner/tasks.md', 'r', encoding='utf-8') as f:
content = f.read()
print("Due to the complexity of the reformatting task, this script provides")
print("a template. Manual review and completion is recommended.")
print()
print("The web-dashboard format requires for each subtask:")
print(" - File: [specific file path]")
print(" - [Short description of what to do]")
print(" - Purpose: [Why this task exists]")
print(" - _Leverage: [What existing code/docs to use]_")
print(" - _Requirements: [Which requirements this satisfies]_")
print(" - _Prompt: [Detailed prompt with Role, Task, Restrictions, Success criteria]_")