-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_task.py
More file actions
executable file
·86 lines (67 loc) · 2.4 KB
/
new_task.py
File metadata and controls
executable file
·86 lines (67 loc) · 2.4 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
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env python3
import uuid
from datetime import datetime
from pathlib import Path
import json
import sys
def create_new_task(task_name):
# Define base directory
base_dir = Path.home() / ".gemini" / "antigravity" / "brain"
base_dir.mkdir(parents=True, exist_ok=True)
# Generate UUID for task directory
task_guid = str(uuid.uuid4())
task_dir = base_dir / task_guid
task_dir.mkdir(exist_ok=True)
# Create task.md
task_md_content = f"""# {task_name}
- [ ] Task item 1 <!-- id: 0 -->
- [ ] Task item 2 <!-- id: 1 -->
- [ ] Task item 3 <!-- id: 2 -->
"""
with open(task_dir / "task.md", "w") as f:
f.write(task_md_content)
# Create implementation_plan.md
implementation_plan_content = """# Implementation Plan
"""
with open(task_dir / "implementation_plan.md", "w") as f:
f.write(implementation_plan_content)
# Create walkthrough.md
walkthrough_content = """# Walkthrough
Task completed successfully.
"""
with open(task_dir / "walkthrough.md", "w") as f:
f.write(walkthrough_content)
# Create .metadata.json for task.md
task_metadata = {
"artifactType": "ARTIFACT_TYPE_TASK",
"summary": task_name,
"updatedAt": datetime.utcnow().isoformat() + "Z",
"version": 0
}
with open(task_dir / ".task.metadata.json", "w") as f:
json.dump(task_metadata, f, indent=2)
# Create .metadata.json for implementation_plan.md
plan_metadata = {
"artifactType": "ARTIFACT_TYPE_IMPLEMENTATION_PLAN",
"summary": task_name,
"updatedAt": datetime.utcnow().isoformat() + "Z",
"version": 0
}
with open(task_dir / ".implementation_plan.metadata.json", "w") as f:
json.dump(plan_metadata, f, indent=2)
# Create .metadata.json for walkthrough.md
walkthrough_metadata = {
"artifactType": "ARTIFACT_TYPE_WALKTHROUGH",
"summary": task_name,
"updatedAt": datetime.utcnow().isoformat() + "Z",
"version": 0
}
with open(task_dir / ".walkthrough.metadata.json", "w") as f:
json.dump(walkthrough_metadata, f, indent=2)
print(f"Created new task {task_guid} with name '{task_name}'")
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: new-task <task_name>")
sys.exit(1)
task_name = sys.argv[1]
create_new_task(task_name)