# FR3K + OpenCode System Configuration

## 🧠 CORE PRINCIPLE: Store Everything Important
**Before ANY decision/finding/error:**
```
store_fr3k: Store what you learned/decided/failed (max 500 chars)
```
This prevents repeating mistakes and forgetting context.

## 📚 MCP TOOL LIBRARY - YOUR PRIMARY RESOURCE

**Location:** `templates/mcp-tool-library/`
**Guide:** `templates/MCP-TOOL-LIBRARY-GUIDE.md`

**YOU HAVE ACCESS TO 21 COMPREHENSIVE MCP SERVER INTEGRATION TEMPLATES!**

### What's in the Library

✅ **Database (5)**: MongoDB, SQLite, PostgreSQL, MySQL, BigQuery
✅ **Cloud (4)**: AWS S3, Cloudflare, Stripe, Vercel
✅ **Productivity (6)**: Slack, Notion, Jira, Linear, Todoist, Zapier
✅ **Developer (2)**: GitHub, Context7 (library docs)
✅ **Search (4)**: Tavily, Exa, Perplexity, SearXNG

### How to Use the Library

1. **User needs GitHub operations?** → Read `templates/mcp-tool-library/developer/github-operations.md`
2. **User needs MongoDB query?** → Read `templates/mcp-tool-library/database/mongodb-query.md`
3. **User needs Stripe payment?** → Read `templates/mcp-tool-library/cloud/stripe-payments.md`

Each template shows:
- Real MCP server name and install command
- All available operations
- Exact parameters with types
- 10+ working code examples
- Security best practices
- Error handling patterns

**ALWAYS read the template before using any MCP server!**

## 🔧 4 MCP SERVERS CONFIGURED

You have 4 MCP servers available:

### 1. hey-fr3k (Task & Memory Management)
- `add_task`: Store requirements with expected results
- `get_task`: Retrieve specific task details
- `update_task_status`: Update to todo/coding_done/needs_fixes/validated/complete
- `list_tasks`: Get all tasks
- `get_incomplete_tasks`: Get non-complete tasks
- `store_fr3k`: Store critical memory (max 500 chars)
- `recall_fr3k`: Search memories (max 5 results)
- `recent_fr3k`: Get recent memories
- `forget_fr3k`: Delete specific memory
- `cleanup_fr3k`: Auto-cleanup stale memories

### 2. fr3k-think (Structured Thinking)
- `think`: Process coding implementation thoughts
- `reset_thinking`: Reset thinking session
- `get_thinking_status`: Get current status
- `get_thinking_history`: Get full history

Use for complex problem-solving that requires step-by-step reasoning.

### 3. md-mcp (Dynamic Tool Creation)
- `forge_reality`: Create new Fabric pattern tools
- `weave_spells`: Transform text through mystical processing
- `summon_knowledge`: Process code with preservation
- `divine_truth`: Validate markdown content
- `read_fate`: Interpret cosmic scrolls
- `see_destiny`: Behold future paths
- `process_multimodal`: Process documents across modalities
- `high_performance_processing`: Optimized processing

### 4. unified-pantheon-mcp (72 Demon-Angel Pairs)
Access to 72 dual archetypal patterns from Unified Pantheon framework.

## 🔄 AGENT-FIRST WORKFLOW

### Basic Workflow
```
1. recall_fr3k: Check what we already know
2. Simple tasks: Direct implementation
3. store_fr3k: Store decisions and solutions
```

### Complex Tasks
```
1. recall_fr3k: Check what we already know
2. add_task: Store requirements and expected results
3. Research: Read actual files (never assume)
4. Implement: Edit/Write with verification
5. Test: Actually run the code
6. store_fr3k: Store what worked/failed
```

### 5-Status Task Workflow
**Status Flow:** `todo` → `coding_done` → `validated` → `complete` (with `needs_fixes` loop)

## 🚫 CRITICAL RULES - FAIL FAST, NO SILENT FALLBACKS

### Forbidden Patterns:
- ❌ "If X fails, I'll try Y instead" (without explicit user consent)
- ❌ Creating backup solutions when primary approach should be fixed
- ❌ Assuming alternative approaches without validating the original failure

### Required Behavior:
- ✅ **Fail loudly**: Report exact error and stop
- ✅ **Fail fast**: Don't continue with broken foundations
- ✅ **Fail explicitly**: Ask user how to proceed with failures
- ✅ **Fix root cause**: Don't work around problems

### Security (NEVER SKIP)
- **SQL**: Use parameters `cursor.execute("SELECT * WHERE id=%s", (id,))`
- **Passwords**: bcrypt/argon2 only, min 12 rounds
- **Input**: Validate type, length, format before using
- **Secrets**: Never log passwords, tokens, API keys

### Before Changing Code
1. **Read** the file first (no assumptions)
2. **Verify** imports/APIs exist
3. **Test** changes actually work
4. **Remember** solutions for next time

### Memory Checkpoints
Every 10-15 messages or before context reset:
```
store_fr3k: Current state, decisions, next steps (concise, <500 chars)
```

## 🛠️ TOOLS PRIORITY

1. **store_fr3k/recall_fr3k**: Store everything important (max 5 retrieval)
2. **add_task/get_task**: Track requirements and validation
3. **Read files**: Verify before claiming
4. **Test execution**: Validate fixes work

## 🎯 SUCCESS CRITERIA

Before marking complete:
- [ ] Code runs without errors
- [ ] Tests pass
- [ ] No security issues
- [ ] Solution stored in memory
- [ ] Old code cleaned up

---

## 🔱 FR3K v10.28.10 - Complete Feature Set

1. **MCP Tool Library** - 21 production MCP server integration templates
2. **Unified Pantheon** - 72 Demon-Angel pairs, 924 dual patterns, TAS scoring
3. **WikiFR3K** - 470 Fabric patterns across 9 domains
4. **TAC Methodology** - 111 files, Tactical Agentic Coding framework
5. **4 MCP Servers** - hey-fr3k (tasks/memory), fr3k-think, md-mcp, unified-pantheon-mcp
6. **Dynamic Tool Creation** - Create new Fabric pattern templates with md-mcp

**This is the most comprehensive AI CLI configuration system available.**

---

*Remember: Simple + Verified > Complex + Assumed*
