Spaces:
Sleeping
Sleeping
| """Project memory templates β scaffolding for per-project cognition.""" | |
| from pathlib import Path | |
| # ββ Directories ββββββββββββββββββββββββββββββββββββββββββββ | |
| PROJECT_DIRS = [ | |
| "docs", | |
| "logs", | |
| "agents", | |
| ] | |
| # ββ Template content ββββββββββββββββββββββββββββββββββββββ | |
| PROJECT_TEMPLATES: dict[str, str] = { | |
| "context.md": """\ | |
| # Project Context | |
| ## Overview | |
| ## Technologies | |
| ## Key Components | |
| """, | |
| "architecture.md": """\ | |
| # Architecture | |
| ## Overview | |
| ## Structure | |
| ## Key Patterns | |
| """, | |
| "decisions.md": """\ | |
| # Architecture Decisions | |
| | Date | Decision | Rationale | Status | | |
| |------|----------|-----------|--------| | |
| """, | |
| "tasks.md": """\ | |
| # Active Tasks | |
| ## In Progress | |
| ## Pending | |
| ## Completed | |
| """, | |
| "handoff.md": """\ | |
| # Current Objective | |
| # Current State | |
| # Active Tasks | |
| # Blockers | |
| # Suggested Next Step | |
| """, | |
| } | |
| def scaffold_project_memory(project_path: Path) -> None: | |
| """Create project memory structure with template files.""" | |
| project_path.mkdir(parents=True, exist_ok=True) | |
| for d in PROJECT_DIRS: | |
| (project_path / d).mkdir(parents=True, exist_ok=True) | |
| for rel_path, content in PROJECT_TEMPLATES.items(): | |
| file_path = project_path / rel_path | |
| file_path.write_text(content, encoding="utf-8") | |