import os import json def init_environment(): """ Resets the HMCMkit environment to its initial state. - state.json is reset to defaults. - blueprint.md is reset to a baseline template. """ hmcmkit_root = ".hmcmkit" if not os.path.exists(hmcmkit_root): print(f"Error: {hmcmkit_root} directory not found.") return state_path = os.path.join(hmcmkit_root, "state.json") blueprint_path = os.path.join(hmcmkit_root, "blueprint.md") # 1. Reset state.json default_state = { "project_name": "New HMCMkit Project", "current_feature": None, "features": {}, "team_config": { "enabled": False, "max_teammates": 4 }, "last_bootup": None, "project_level": "Starter" } try: with open(state_path, 'w', encoding='utf-8') as f: json.dump(default_state, f, indent=2, ensure_ascii=False) print(f"āœ… Reset state: {state_path}") except Exception as e: print(f"āŒ Failed to reset state: {e}") # 2. Reset blueprint.md blueprint_template = """# Project Blueprint (Domain Knowledge Layer) > **Role**: The single source of truth for "What" we are building. > **Usage**: Read this file at the start of every session to understand the project context. ## 1. Project Overview - **Name**: New HMCMkit Project - **Goal**: [Define your project goal here] - **Tech Stack**: [List your technology stack] ## 2. Architecture Diagram (Mermaid) ```mermaid graph TD User[User] -->|Request| Antigravity[Antigravity Agent] subgraph Context_Layer [.hmcmkit/] Blueprint[blueprint.md] Governance[governance.md] State[state.json] end Antigravity -->|Read Context| Context_Layer ``` ## 3. Data Models [Define your core data models and entities] ## 4. API Specifications [List your API endpoints if applicable] ## 5. Conventions & Standards - **Naming**: kebab-case for files, PascalCase for components. - **Language**: English for code, Korean for user communication. """ try: with open(blueprint_path, 'w', encoding='utf-8') as f: f.write(blueprint_template) print(f"āœ… Reset blueprint: {blueprint_path}") except Exception as e: print(f"āŒ Failed to reset blueprint: {e}") print("\nšŸš€ HMCMkit environment has been initialized.") if __name__ == "__main__": init_environment()