"""Templates package for generating project files.""" from datetime import datetime from typing import Optional from tracker.models import Project def get_readme_template(project: Optional[Project] = None) -> str: """Get the README.md template for a project. Args: project: Optional project instance for personalization. Returns: README.md template string. """ name = project.name if project else "Project Name" description = project.description if project else "_No description_" status = project.status if project else "inbox" return f"""# {name} {description} ## Objective _TODO: Define objective_ ## Status **Current Status:** {status} Status: {status} ## Context _Current context and background_ ## Stack / Tools - _Tool 1_ - _Tool 2_ ## Architecture _Brief architecture description_ ## Technical Decisions _No decisions recorded yet_ ## Risks / Blockers _No blockers_ ## Recent Sessions _Last updated: {datetime.now().strftime('%Y-%m-%d')}_ """ def get_log_template() -> str: """Get the LOG.md template. Returns: LOG.md template string. """ return """# Log _Project activity log_ """ def get_changelog_template() -> str: """Get the CHANGELOG.md template. Returns: CHANGELOG.md template string. """ return """# Changelog _Project changes_ """ def get_tasks_template() -> str: """Get the TASKS.md template. Returns: TASKS.md template string. """ return """# Tasks ## Inbox - ## Next - ## In Progress - ## Blocked - ## Waiting - ## Done - """ def get_meta_template(project: Project) -> dict: """Get the meta/project.yaml template data. Args: project: Project instance. Returns: Dictionary suitable for YAML serialization. """ return { "id": project.id, "name": project.name, "slug": project.slug, "description": project.description, "type": project.type, "status": project.status, "tags": project.tags, "root_path": str(project.root_path), "repo_path": str(project.repo_path) if project.repo_path else None, "created_at": project.created_at.isoformat(), "updated_at": project.updated_at.isoformat(), "last_session_at": None, }