Files
agent-coordinator/.github/instructions/no-duplicate-files.instructions.md
Ra 004ba6ab55 Fix VS Code MCP server initialization crash and multi-agent architecture
CRITICAL FIX:
- Removed auto-registration during initialization that was causing crashes
- Fixed pattern match error with Inbox.start_link (already_started case)
- Changed architecture to require explicit agent registration with unique IDs

MULTI-AGENT SUPPORT:
- Agents must now register themselves with unique identifiers (e.g., 'Green Platypus')
- register_agent tool now works without requiring prior agent_id
- All other tools require agent_id parameter to identify the calling agent
- Proper error handling for missing agent_id in tool calls

ARCHITECTURE CHANGE:
- One MCP server instance serves multiple agents (as per VS Code design)
- Removed auto-registration of 'GitHub Copilot' agent during initialization
- Each agent must explicitly call register_agent before using other tools

This fixes the VS Code connection error:
MatchError: no match of right hand side value: {:error, {:already_started, #PID<0.215.0>}}
2025-09-03 00:59:52 -07:00

50 lines
1.7 KiB
Markdown

---
applyTo: '**'
---
# No Duplicate Files Policy
## Critical Rule: NO DUPLICATE FILES
**NEVER** create files with adjectives or verbs that duplicate existing functionality:
-`enhanced_mcp_server.ex` when `mcp_server.ex` exists
-`unified_mcp_server.ex` when `mcp_server.ex` exists
-`mcp_server_manager.ex` when `mcp_server.ex` exists
-`new_config.ex` when `config.ex` exists
-`improved_task_registry.ex` when `task_registry.ex` exists
## What To Do Instead
1. **BEFORE** making changes that might create a new file:
```bash
git add . && git commit -m "Save current state before refactoring"
```
2. **MODIFY** the existing file directly instead of creating a "new" version
3. **IF** you need to completely rewrite a file:
- Make the changes directly to the original file
- Don't create `*_new.*` or `enhanced_*.*` versions
## Why This Rule Exists
When you create duplicate files:
- Future sessions can't tell which file is "real"
- The codebase becomes inconsistent and confusing
- Multiple implementations cause bugs and maintenance nightmares
- Even YOU get confused about which file to edit next time
## The Human Is Right
The human specifically said: "I fucking hate it when you do this retarded shit and recreate the same file with some adjective/verb but leave the original"
**Listen to them.** They prefer file replacement over duplicates.
## Implementation
- Always check if a file with similar functionality exists before creating a new one
- Use `git add . && git commit` before potentially destructive changes
- Replace, don't duplicate
- Keep the codebase clean and consistent
**This rule is more important than any specific feature request.**