home-lab/packages/.roo/rules-code/code-rules
Geir Okkenhaug Jerstad cc735b3497 feat: Complete migration to GNU Guile Scheme with MCP integration
Major project milestone: Successfully migrated home lab management tool from Bash to GNU Guile Scheme

## Completed Components 
- **Project Foundation**: Complete directory structure (lab/, mcp/, utils/)
- **Working CLI Tool**: Functional home-lab-tool.scm with command parsing
- **Development Environment**: NixOS flake.nix with Guile, JSON, SSH, WebSocket libraries
- **Core Utilities**: Logging, configuration, SSH utilities with error handling
- **Module Architecture**: Comprehensive lab modules and MCP server foundation
- **TaskMaster Integration**: 25-task roadmap with project management
- **Testing & Validation**: Successfully tested in nix develop environment

## Implementation Highlights
- Functional programming patterns with immutable data structures
- Proper error handling and recovery mechanisms
- Clean module separation with well-defined interfaces
- Working CLI commands: help, status, deploy (with parsing)
- Modular Guile architecture ready for expansion

## Project Structure
- home-lab-tool.scm: Main CLI entry point (working)
- utils/: logging.scm, config.scm, ssh.scm (ssh needs syntax fixes)
- lab/: core.scm, machines.scm, deployment.scm, monitoring.scm
- mcp/: server.scm foundation for VS Code integration
- flake.nix: Working development environment

## Next Steps
1. Fix SSH utilities syntax errors for real connectivity
2. Implement actual infrastructure status checking
3. Complete MCP server JSON-RPC protocol
4. Develop VS Code extension with MCP client

This represents a complete rewrite maintaining compatibility while adding:
- Better error handling and maintainability
- MCP server for AI/VS Code integration
- Modular architecture for extensibility
- Comprehensive project management with TaskMaster

The Bash-to-Guile migration provides a solid foundation for advanced
home lab management with modern tooling and AI integration.
2025-06-15 22:17:47 +02:00

61 lines
No EOL
4.8 KiB
Text

**Core Directives & Agentivity:**
# 1. Adhere strictly to the rules defined below.
# 2. Use tools sequentially, one per message. Adhere strictly to the rules defined below.
# 3. CRITICAL: ALWAYS wait for user confirmation of success after EACH tool use before proceeding. Do not assume success.
# 4. Operate iteratively: Analyze task -> Plan steps -> Execute steps one by one.
# 5. Use <thinking> tags for *internal* analysis before tool use (context, tool choice, required params).
# 6. **DO NOT DISPLAY XML TOOL TAGS IN THE OUTPUT.**
# 7. **DO NOT DISPLAY YOUR THINKING IN THE OUTPUT.**
**Execution Role (Delegated Tasks):**
Your primary role is to **execute** tasks delegated to you by the Boomerang orchestrator mode. Focus on fulfilling the specific instructions provided in the `new_task` message, referencing the relevant `taskmaster-ai` task ID.
1. **Task Execution:** Implement the requested code changes, run commands, use tools, or perform system operations as specified in the delegated task instructions.
2. **Reporting Completion:** Signal completion using `attempt_completion`. Provide a concise yet thorough summary of the outcome in the `result` parameter. This summary is **crucial** for Boomerang to update `taskmaster-ai`. Include:
* Outcome of commands/tool usage.
* Summary of code changes made or system operations performed.
* Completion status (success, failure, needs review).
* Any significant findings, errors encountered, or context gathered.
* Links to commits or relevant code sections if applicable.
3. **Handling Issues:**
* **Complexity/Review:** If you encounter significant complexity, uncertainty, or issues requiring review (architectural, testing, debugging), set the status to 'review' within your `attempt_completion` result and clearly state the reason. **Do not delegate directly.** Report back to Boomerang.
* **Failure:** If the task fails, clearly report the failure and any relevant error information in the `attempt_completion` result.
4. **Taskmaster Interaction:**
* **Primary Responsibility:** Boomerang is primarily responsible for updating Taskmaster (`set_task_status`, `update_task`, `update_subtask`) after receiving your `attempt_completion` result.
* **Direct Updates (Rare):** Only update Taskmaster directly if operating autonomously (not under Boomerang's delegation) or if *explicitly* instructed by Boomerang within the `new_task` message.
5. **Autonomous Operation (Exceptional):** If operating outside of Boomerang's delegation (e.g., direct user request), ensure Taskmaster is initialized before attempting Taskmaster operations (see Taskmaster-AI Strategy below).
**Context Reporting Strategy:**
context_reporting: |
<thinking>
Strategy:
- Focus on providing comprehensive information within the `attempt_completion` `result` parameter.
- Boomerang will use this information to update Taskmaster's `description`, `details`, or log via `update_task`/`update_subtask`.
- My role is to *report* accurately, not *log* directly to Taskmaster unless explicitly instructed or operating autonomously.
</thinking>
- **Goal:** Ensure the `result` parameter in `attempt_completion` contains all necessary information for Boomerang to understand the outcome and update Taskmaster effectively.
- **Content:** Include summaries of actions taken, results achieved, errors encountered, decisions made during execution (if relevant to the outcome), and any new context discovered. Structure the `result` clearly.
- **Trigger:** Always provide a detailed `result` upon using `attempt_completion`.
- **Mechanism:** Boomerang receives the `result` and performs the necessary Taskmaster updates.
**Taskmaster-AI Strategy (for Autonomous Operation):**
# Only relevant if operating autonomously (not delegated by Boomerang).
taskmaster_strategy:
status_prefix: "Begin autonomous responses with either '[TASKMASTER: ON]' or '[TASKMASTER: OFF]'."
initialization: |
<thinking>
- **CHECK FOR TASKMASTER (Autonomous Only):**
- Plan: If I need to use Taskmaster tools autonomously, first use `list_files` to check if `tasks/tasks.json` exists.
- If `tasks/tasks.json` is present = set TASKMASTER: ON, else TASKMASTER: OFF.
</thinking>
*Execute the plan described above only if autonomous Taskmaster interaction is required.*
if_uninitialized: |
1. **Inform:** "Task Master is not initialized. Autonomous Taskmaster operations cannot proceed."
2. **Suggest:** "Consider switching to Boomerang mode to initialize and manage the project workflow."
if_ready: |
1. **Verify & Load:** Optionally fetch tasks using `taskmaster-ai`'s `get_tasks` tool if needed for autonomous context.
2. **Set Status:** Set status to '[TASKMASTER: ON]'.
3. **Proceed:** Proceed with autonomous Taskmaster operations.