pantheon-opencode 1.0.0 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +61 -109
  2. package/bin/pantheon-init.mjs +57 -136
  3. package/commands/pantheon-audit.md +1 -1
  4. package/commands/pantheon-deepwork.md +32 -81
  5. package/commands/pantheon-reflect.md +16 -0
  6. package/commands/pantheon-status.md +1 -1
  7. package/commands/pantheon-verify.md +17 -0
  8. package/opencode.json +25 -0
  9. package/package.json +24 -13
  10. package/scripts/ci-validate-yaml.py +19 -0
  11. package/scripts/doctor.mjs +10 -65
  12. package/scripts/install/opencode.mjs +69 -6
  13. package/scripts/install/shared.mjs +39 -13
  14. package/scripts/manifest.mjs +5 -30
  15. package/scripts/postinstall.mjs +47 -0
  16. package/scripts/release-bundle.mjs +2 -2
  17. package/scripts/uninstall.mjs +5 -5
  18. package/scripts/validate-routing.mjs +19 -16
  19. package/scripts/versioning.mjs +12 -1
  20. package/skills-lock.json +9 -2
  21. package/src/agents/aphrodite.md +15 -57
  22. package/src/agents/apollo.md +9 -48
  23. package/src/agents/athena.md +17 -54
  24. package/src/agents/demeter.md +10 -47
  25. package/src/agents/gaia.md +7 -40
  26. package/src/agents/hephaestus.md +9 -52
  27. package/src/agents/hermes.md +17 -52
  28. package/src/agents/iris.md +8 -45
  29. package/src/agents/mnemosyne.md +12 -47
  30. package/src/agents/nyx.md +8 -45
  31. package/src/agents/prometheus.md +11 -49
  32. package/src/agents/talos.md +6 -45
  33. package/src/agents/themis.md +10 -35
  34. package/src/agents/zeus.md +5 -7
  35. package/src/mcp/mcp_resources_server.py +2 -0
  36. package/src/plugins/tui/dist/tui.tsx +203 -93
  37. package/src/plugins/tui/src/index.tsx +203 -93
  38. package/src/routing.yml +33 -93
  39. package/src/skills/clonedeps/SKILL.md +45 -0
  40. package/src/skills/codemap/SKILL.md +47 -0
  41. package/src/skills/loop-engineering/SKILL.md +51 -0
  42. package/src/skills/reflect/SKILL.md +49 -0
  43. package/src/skills/simplify/SKILL.md +39 -0
  44. package/src/skills/verification-planning/SKILL.md +52 -0
  45. package/src/skills/worktrees/SKILL.md +43 -0
  46. package/commands/pantheon-bg.md +0 -10
  47. package/commands/pantheon-consolidate.md +0 -11
  48. package/commands/pantheon-doc.md +0 -10
  49. package/commands/pantheon-hash.md +0 -11
  50. package/commands/pantheon-todo.md +0 -11
  51. package/docs/AGENT-MCP.md +0 -194
  52. package/docs/ARCHITECTURE.md +0 -384
  53. package/docs/BRANCH-PROTECTION.md +0 -142
  54. package/docs/INDEX.md +0 -81
  55. package/docs/INSTALLATION.md +0 -217
  56. package/docs/MCP.md +0 -238
  57. package/docs/MEMORY.md +0 -471
  58. package/docs/MIGRATION-MEMORY-BANK.md +0 -139
  59. package/docs/PLATFORMS.md +0 -5
  60. package/docs/QUICKSTART.md +0 -49
  61. package/docs/README.md +0 -18
  62. package/docs/RELEASING.md +0 -256
  63. package/docs/SETUP.md +0 -5
  64. package/docs/UPGRADING.md +0 -41
  65. package/docs/mcp-recommendations.md +0 -439
  66. package/docs/mcp-tools.md +0 -156
  67. package/docs/mcp-user-guide.md +0 -204
  68. package/docs/persistence-mcp.md +0 -111
  69. package/scripts/init-pantheon-mcp.sh +0 -118
  70. package/scripts/install.mjs +0 -26
  71. package/src/instructions/documentation-standards.instructions.md +0 -53
  72. package/src/mcp/init-pantheon-mcp.sh +0 -118
@@ -1,204 +0,0 @@
1
- # MCP User Guide: Adding Custom Servers & Agent Awareness
2
-
3
- This guide explains how to add your own MCP servers to Pantheon and make agents aware of them.
4
-
5
- ---
6
-
7
- ## Quick Start
8
-
9
- Add an MCP server to your platform config. All examples below use a fictional `my-tools` server:
10
-
11
- **OpenCode** (`opencode.json`):
12
- ```json
13
- {
14
- "mcp": {
15
- "my-tools": {
16
- "type": "local",
17
- "command": ["node", "my-mcp-server.js"],
18
- "enabled": true
19
- }
20
- }
21
- }
22
- ```
23
-
24
- **** (`.mcp.json`):
25
- ```json
26
- {
27
- "mcpServers": {
28
- "my-tools": {
29
- "command": "node",
30
- "args": ["my-mcp-server.js"]
31
- }
32
- }
33
- }
34
- ```
35
-
36
- ** / ** (`.vscode/mcp.json` or `./mcp.json`):
37
- ```json
38
- {
39
- "servers": {
40
- "my-tools": {
41
- "type": "stdio",
42
- "command": "node",
43
- "args": ["my-mcp-server.js"]
44
- }
45
- }
46
- }
47
- ```
48
-
49
- **** (`_mcp_settings.json`):
50
- ```json
51
- {
52
- "mcpServers": {
53
- "my-tools": {
54
- "command": "node",
55
- "args": ["my-mcp-server.js"]
56
- }
57
- }
58
- }
59
- ```
60
-
61
- After adding, restart your MCP client. Verify the server connects.
62
-
63
- ---
64
-
65
- ## Making Agents Aware of Custom MCPs
66
-
67
- Adding a server to config is only half the work. **Agents don't auto-discover MCP tools** — you must declare them in the agent's `.agent.md` file.
68
-
69
- ### Step 1: Add `mcp_tools:` to Frontmatter
70
-
71
- In the agent's YAML frontmatter, add an `mcp_tools:` block listing which tools from which server the agent can use:
72
-
73
- ```yaml
74
- ---
75
- name: hermes
76
- mcp_tools:
77
- my-tools:
78
- - analyze_dependency
79
- - scan_vulnerabilities
80
- ---
81
- ```
82
-
83
- This tells the platform to inject these tool definitions into the agent's context.
84
-
85
- ### Step 2: Document Tools in the Agent Body
86
-
87
- Add a `## Custom MCP Tools` section in the agent's body so the agent understands *when* and *how* to use each tool:
88
-
89
- ```markdown
90
- ## Custom MCP Tools
91
-
92
- | Server | Tool | Signature | When to use |
93
- |--------|------|-----------|-------------|
94
- | **my-tools** | `analyze_dependency(package, depth?)` | Check a dependency for known vulnerabilities |
95
- | **my-tools** | `scan_vulnerabilities(path)` | Scan a directory for security issues |
96
- ```
97
-
98
- ### Step 3: Set Access Control
99
-
100
- **OpenCode** (`opencode.json`):
101
- ```json
102
- {
103
- "permission": {
104
- "mcp": {
105
- "my-tools": "ask"
106
- }
107
- }
108
- }
109
- ```
110
-
111
- Values: `allow` (auto-approve), `ask` (prompt user), `deny` (block).
112
-
113
- ---
114
-
115
- ## Full Example: GitHub MCP
116
-
117
- ### 1. Install & Configure
118
-
119
- **OpenCode** (`opencode.json`):
120
- ```json
121
- {
122
- "mcp": {
123
- "github": {
124
- "type": "local",
125
- "command": ["npx", "-y", "@modelcontextprotocol/server-github"],
126
- "env": {
127
- "GITHUB_TOKEN": "{env:GITHUB_TOKEN}"
128
- },
129
- "enabled": true
130
- }
131
- }
132
- }
133
- ```
134
-
135
- ### 2. Declare in Agent Frontmatter
136
-
137
- ```yaml
138
- ---
139
- name: iris
140
- mcp_tools:
141
- github:
142
- - create_issue
143
- - list_pull_requests
144
- - search_code
145
- ---
146
- ```
147
-
148
- ### 3. Document in Agent Body
149
-
150
- ```markdown
151
- ## Custom MCP Tools
152
-
153
- | Server | Tool | Signature | What it does |
154
- |--------|------|-----------|-------------|
155
- | **github** | `create_issue(title, body, labels?)` | Create a GitHub issue in the current repo |
156
- | **github** | `list_pull_requests(state?: "open")` | List PRs with optional state filter |
157
- | **github** | `search_code(query)` | Search code across the repository |
158
- ```
159
-
160
- ### 4. Configure Permissions
161
-
162
- ```json
163
- {
164
- "permission": {
165
- "mcp": {
166
- "github": "ask"
167
- }
168
- }
169
- }
170
- ```
171
-
172
- ---
173
-
174
- ## Best Practices
175
-
176
- | Practice | Recommendation |
177
- |----------|---------------|
178
- | **Server names** | Short, descriptive, lowercase (e.g., `github`, `postgres`, `slack`). They become the prefix. |
179
- | **Tool declarations** | Only declare tools the agent actually needs. |
180
- | **Documentation** | Always add a `## Custom MCP Tools` table with signature + purpose. |
181
- | **Permission** | Start with `ask` for new MCPs. Only downgrade to `allow` after verifying read-only safety. |
182
- | **Max MCPs** | Follow the 3-7 rule: 3 core + up to 4 custom. Beyond 7, accuracy degrades. |
183
- | **Naming** | Match `mcp_tools:` keys to the server name in your config. They must be identical. |
184
- | **Environment variables** | Use `{env:VAR}` interpolation for secrets. Never inline tokens in config. |
185
-
186
- ---
187
-
188
- ## Troubleshooting
189
-
190
- | Symptom | Cause | Fix |
191
- |---------|-------|-----|
192
- | Agent says "I don't have that tool" | MCP not declared in frontmatter | Add `mcp_tools:` entry |
193
- | Tool exists but agent doesn't use it | No body documentation | Add `## Custom MCP Tools` section |
194
- | "Server not found" | Config typo | Check server name matches config |
195
- | "Tool call failed" | Permission denied | Set to `allow` or `ask` in config |
196
- | Agent uses wrong tool | Too many MCPs | Reduce to ≤5 per agent |
197
- | Changes not taking effect | Client cache | Restart the MCP client |
198
-
199
- ---
200
-
201
- ## Reference
202
-
203
- - [MCP Tool Registry](mcp-tools.md) — Canonical reference of built-in Pantheon MCP tools
204
- - [MCP Security](skill: mcp-security) — Security hardening rules
@@ -1,111 +0,0 @@
1
- # Pantheon Persistence MCP
2
-
3
- **Server:** `pantheon-persistence`
4
- **Script:** `scripts/mcp_persistence_server.py`
5
- **Dependencies:** Zero (stdlib only: sqlite3)
6
-
7
- A lightweight key-value store with SQLite + FTS5, TTL, and namespaces.
8
- Separate from `pantheon-memory` (vector/ChromaDB).
9
-
10
- ## Purpose
11
-
12
- - **Cache entre agentes** — compartilhar descobertas rápidas sem ir pro ChromaDB
13
- - **Estado de execução** — steps de jobs, progresso, checkpoints
14
- - **Dados efêmeros com TTL** — cache que expira sozinho
15
- - **Dados locais** — tokens temporários, debug info (evita ir pro GitHub)
16
-
17
- ## Architecture
18
-
19
- ```
20
- pantheon-persistence MCP
21
- ├── Global DB: ~/.config/opencode/persistence/global.db
22
- └── Project DB: .pantheon/persistence/project.db
23
- ```
24
-
25
- - **Global**: dados cross-projeto (cache de agentes, preferências)
26
- - **Project**: dados específicos do projeto atual
27
-
28
- ## Tools (6)
29
-
30
- ### kv_store
31
- Store a key-value pair with optional TTL.
32
-
33
- `kv_store(namespace, key, value, ttl?, scope?)`
34
- - `ttl`: seconds. null = forever
35
- - `scope`: "project" (default) or "global"
36
- - Returns `{"status": "stored", "namespace": ns, "key": k}`
37
-
38
- ### kv_get
39
- Retrieve a value by namespace + key.
40
-
41
- `kv_get(namespace, key, scope?)`
42
- - Auto-filters expired entries (SQL-level)
43
- - Returns value string or null
44
-
45
- ### kv_delete
46
- Remove an entry.
47
-
48
- `kv_delete(namespace, key, scope?)`
49
- - Returns `{"status": "deleted"}` or `{"status": "not_found"}`
50
-
51
- ### kv_list
52
- List entries in a namespace with optional prefix filter.
53
-
54
- `kv_list(namespace, prefix?, scope?, limit?)`
55
- - Returns array of `{key, value, created_at, expires_at}`
56
- - Respects TTL (expired items not returned)
57
-
58
- ### kv_search
59
- Full-text search across all namespaces using SQLite FTS5.
60
-
61
- `kv_search(query, namespace?, scope?, limit?)`
62
- - BM25-ranked results
63
- - Terms are sanitized and quoted for injection safety
64
- - Returns array of `{namespace, key, value, created_at, score}`
65
-
66
- ### purge_expired
67
- Remove expired entries and rotate deletelog.
68
-
69
- `purge_expired(scope?, dry_run?)`
70
- - Soft-delete with deletelog audit trail
71
- - dry_run previews without purging
72
- - Deletelog rotates at 1MB (keeps last 3)
73
-
74
- ## TTL Lifecycle
75
-
76
- ```python
77
- # Cache que expira em 1 hora
78
- kv_store(namespace="cache-apollo", key="api-response", value="...", ttl=3600)
79
-
80
- # Dado permanente (sobrescreve sem perder created_at)
81
- kv_store(namespace="config", key="db-url", value="postgres://...")
82
-
83
- # Busca: expirados são invisíveis automaticamente
84
- result = kv_get(namespace="cache-apollo", key="api-response") # None se expirou
85
-
86
- # Limpeza manual (opcional — TTL já filtra na leitura)
87
- purge_expired(scope="project")
88
- ```
89
-
90
- ## Naming Conventions
91
-
92
- | Namespace | Purpose | TTL |
93
- |-----------|---------|-----|
94
- | `cache-{agent}` | Descobertas temporárias | 300-3600s |
95
- | `session-{id}` | Estado de sessão | 7200s |
96
- | `job-{id}` | Progresso de job | 86400s |
97
- | `config` | Config persistente | null |
98
- | `local-only` | Dados sensíveis | 3600s |
99
-
100
- ## Comparison with pantheon-memory
101
-
102
- | Aspect | persistence (this) | memory |
103
- |--------|-------------------|--------|
104
- | Storage | SQLite KV | ChromaDB vector |
105
- | Search | FTS5 (exato/keyword) | Cosine similarity (semântico) |
106
- | TTL | ✅ Por entrada | ❌ Nenhum |
107
- | Namespace | ✅ Coluna + scope | ✅ Session + category |
108
- | Deploys | stdlib, 0 deps | chromadb + sentence-transformers |
109
- | Startup | <0.5s | 3-8s |
110
- | Tools | 6 | 14 |
111
- | Lines | 449 | 1,344 |
@@ -1,118 +0,0 @@
1
- #!/bin/bash
2
- # Pantheon MCP Init — configura os 3 MCP servers em qualquer plataforma
3
- # Uso: ./scripts/init-pantheon-mcp.sh /caminho/do/projeto [plataforma]
4
- # plataforma: opencode (padrão), claude, cursor, windsurf, cline, continue, copilot
5
-
6
- set -e
7
-
8
- SOURCE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
9
- TARGET_DIR="${1:-.}"
10
- PLATFORM="${2:-opencode}"
11
-
12
- echo "🚀 Pantheon MCP Init — $PLATFORM"
13
- echo " Origem: $SOURCE_DIR"
14
- echo " Destino: $TARGET_DIR"
15
- echo ""
16
-
17
- # 1. Copiar scripts
18
- echo "📁 Copiando scripts MCP..."
19
- mkdir -p "$TARGET_DIR/scripts" "$TARGET_DIR/.pantheon/code-mode"
20
- cp "$SOURCE_DIR/scripts/mcp_resources_server.py" "$TARGET_DIR/scripts/"
21
- cp "$SOURCE_DIR/scripts/code_mode_server.py" "$TARGET_DIR/scripts/"
22
- cp "$SOURCE_DIR/scripts/memory_mcp_server.py" "$TARGET_DIR/scripts/"
23
- cp "$SOURCE_DIR/.pantheon/code-mode/example-sync.sh" "$TARGET_DIR/.pantheon/code-mode/"
24
- chmod +x "$TARGET_DIR/.pantheon/code-mode/example-sync.sh"
25
- echo " ✅ Scripts copiados"
26
-
27
- # 2. Virtualenv + dependências
28
- echo "🐍 Configurando virtualenv..."
29
- cd "$TARGET_DIR"
30
- if [ ! -d ".venv" ]; then
31
- python3 -m venv .venv
32
- fi
33
- source .venv/bin/activate
34
- pip install -q chromadb>=0.6.0 sentence-transformers fastmcp>=3.4.0 pyyaml 2>/dev/null || \
35
- pip install chromadb sentence-transformers fastmcp pyyaml 2>/dev/null
36
- echo " ✅ Dependências instaladas"
37
-
38
- # 3. Config da plataforma
39
- echo "📝 Configurando $PLATFORM..."
40
-
41
- case "$PLATFORM" in
42
- opencode)
43
- mkdir -p "$(dirname "$TARGET_DIR/opencode.json")"
44
- if [ ! -f "$TARGET_DIR/opencode.json" ]; then
45
- cp "$SOURCE_DIR/platform/opencode/opencode.json" "$TARGET_DIR/"
46
- echo " ✅ opencode.json criado"
47
- else
48
- echo " ⚠️ opencode.json já existe — adicione os MCPs manualmente"
49
- fi
50
- ;;
51
- claude)
52
- if [ ! -f "$TARGET_DIR/.mcp.json" ]; then
53
- cp "$SOURCE_DIR/platform/claude/mcp-template.json" "$TARGET_DIR/.mcp.json"
54
- echo " ✅ .mcp.json criado"
55
- else
56
- echo " ⚠️ .mcp.json já existe — faça merge manual dos mcpServers"
57
- fi
58
- ;;
59
- cursor)
60
- mkdir -p "$TARGET_DIR/.cursor"
61
- if [ ! -f "$TARGET_DIR/.cursor/mcp.json" ]; then
62
- cp "$SOURCE_DIR/platform/cursor/mcp-template.json" "$TARGET_DIR/.cursor/mcp.json"
63
- echo " ✅ .cursor/mcp.json criado"
64
- else
65
- echo " ⚠️ .cursor/mcp.json já existe — faça merge manual"
66
- fi
67
- ;;
68
- windsurf)
69
- mkdir -p "$HOME/.codeium/windsurf"
70
- if [ ! -f "$HOME/.codeium/windsurf/mcp_config.json" ]; then
71
- cp "$SOURCE_DIR/platform/windsurf/mcp-template.json" "$HOME/.codeium/windsurf/mcp_config.json"
72
- echo " ✅ mcp_config.json criado (global)"
73
- else
74
- echo " ⚠️ mcp_config.json já existe — faça merge manual"
75
- fi
76
- ;;
77
- cline)
78
- echo " ⚠️ Cline usa settings do VS Code. Copie manualmente:"
79
- echo " $SOURCE_DIR/platform/cline/mcp-template.json"
80
- echo " Para: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json"
81
- ;;
82
- continue)
83
- echo " ⚠️ Continue.dev usa ~/.continue/config.json. Copie manualmente:"
84
- echo " $SOURCE_DIR/platform/continue/mcp-template.json"
85
- echo " (mcpServers é ARRAY — faça merge no seu config.json)"
86
- ;;
87
- copilot)
88
- mkdir -p "$TARGET_DIR/.vscode"
89
- if [ ! -f "$TARGET_DIR/.vscode/mcp.json" ]; then
90
- cp "$SOURCE_DIR/platform/copilot/mcp-template.json" "$TARGET_DIR/.vscode/mcp.json"
91
- echo " ✅ .vscode/mcp.json criado"
92
- else
93
- echo " ⚠️ .vscode/mcp.json já existe — faça merge manual"
94
- fi
95
- ;;
96
- *)
97
- echo " ❌ Plataforma desconhecida: $PLATFORM"
98
- echo " Use: opencode, claude, cursor, windsurf, cline, continue, copilot"
99
- exit 1
100
- ;;
101
- esac
102
-
103
- # 4. Verificação
104
- echo ""
105
- echo "🔍 Verificando instalação..."
106
- python3 -c "from scripts.mcp_resources_server import mcp; print(' ✅ resources OK')" 2>/dev/null || echo " ⚠️ Verifique o Python path"
107
- python3 -c "from scripts.code_mode_server import mcp; print(' ✅ code-mode OK')" 2>/dev/null || echo " ⚠️ Verifique o Python path"
108
- .venv/bin/python3 -c "from scripts.memory_mcp_server import mcp; print(' ✅ memory OK')" 2>/dev/null || echo " ⚠️ Verifique o .venv"
109
-
110
- echo ""
111
- echo "🎉 Pantheon MCP Init concluído para $PLATFORM!"
112
- echo ""
113
- echo "Comandos uteis:"
114
- echo " Testar: cd $TARGET_DIR && .venv/bin/python3 -m pytest tests/ -v"
115
- echo " Usar: abra o projeto no $PLATFORM e os MCPs estarão disponíveis"
116
- echo ""
117
- echo "Nota: o modelo all-MiniLM-L6-v2 (~80MB) baixa automaticamente"
118
- echo "no primeiro uso do pantheon-memory."
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * install.mjs — Pantheon v5.0 OpenCode installer
4
- * Simple delegator that installs agents + config to ~/.config/opencode/
5
- */
6
- import { join } from "node:path";
7
- import { existsSync } from "node:fs";
8
- import { installOpenCode } from "./install/opencode.mjs";
9
-
10
- const ROOT = new URL("..", import.meta.url).pathname;
11
-
12
- function main() {
13
- const args = process.argv.slice(2);
14
- const positional = args.filter(a => !a.startsWith("--"));
15
- const target = positional[0] || join(process.env.HOME || "~", ".config", "opencode");
16
- const dryRun = args.includes("--dry-run");
17
- const clean = args.includes("--clean");
18
-
19
- console.log(`Pantheon v5.0 — OpenCode installer`);
20
- console.log(`Target: ${target}${dryRun ? " (DRY RUN)" : ""}`);
21
-
22
- installOpenCode(target, dryRun, clean);
23
- console.log("\n✅ Done. Run 'npx pantheon-orchestrator init' to verify.");
24
- }
25
-
26
- main();
@@ -1,53 +0,0 @@
1
- ---
2
- applyTo: '**'
3
- name: "Documentation Standards"
4
- description: 'Documentation Standards — Where, what, and how to document in Pantheon projects'
5
- ---
6
-
7
- # Documentation Standards
8
-
9
- ## The Two-System Model
10
-
11
- Three memory systems: **Memory Bank** (`.pantheon/memory-bank/`, team-owned, permanent/versioned), **Copilot Memory** (GitHub Cloud, 28d auto-expire), **Native `/memories/`** (any agent, session-scoped). Complementary — Memory Bank lives in git, agent memories are automatic/ephemeral. For full details see `skill: memory-bank`.
12
-
13
- ## The Golden Rule
14
-
15
- **Never create `.md` files outside of `.pantheon/memory-bank/` or the explicitly allowed locations below.**
16
-
17
- What is allowed outside `.pantheon/memory-bank/`:
18
- - `README.md` — project overview (only if explicitly requested)
19
- - `CONTRIBUTING.md` — contribution guidelines (only if explicitly requested)
20
- - `.github/` — instructions, agents, skills, prompts (config only, never session output)
21
-
22
- What is permanently forbidden:
23
- - `ANALYSIS_*.md`, `SUMMARY_*.md`, `STATUS_*.md` anywhere in the repo
24
- - Any `.md` file in the root created as session or task output
25
- - Duplicating information that already exists in the Memory Bank
26
-
27
- ## Who Writes What
28
-
29
- - Project overview, architecture, tech context → Mnemosyne → `00-project.md`
30
- - Sprint focus, recent decisions → Agent / Mnemosyne → `01-active-context.md`
31
- - Milestone completions → Any agent → `02-progress-log.md`
32
- - Task records → Mnemosyne → `_tasks/TASK000X-*.md`
33
- - Architecture decisions → Mnemosyne → `_notes/NOTE000X-*.md`
34
- - Atomic facts (stack, commands, conventions) → Any agent → `/memories/repo/`
35
- - Conversation-scoped plans → Athena / any agent → `/memories/session/`
36
-
37
- ## Documentation Workflow
38
-
39
- **Automatic (no handoff):** agents write atomic facts on discovery, Athena writes sprint plans, any agent appends to `01-active-context.md` or `02-progress-log.md`. **Explicit (@mnemosyne):** project init, task records, architecture decisions, sprint close.
40
-
41
- ## Anti-Patterns
42
-
43
- ### ❌ Session output as files
44
- Use `@mnemosyne Append to 02-progress-log.md` instead of creating standalone `.md` files.
45
-
46
- ### ❌ Mandatory automatic handoff after every phase
47
- Agents append to `01-active-context.md` directly. Mnemosyne only at sprint close.
48
-
49
- ### ❌ Duplicating information
50
- Atomic facts → `/memories/repo/` (auto-loaded). Narrative context → `00-project.md` (explicit read).
51
-
52
- ### ❌ Bypassing structure
53
- Use `_notes/NOTE0001-topic.md` + update `_index.md`. No random files in memory-bank root.
@@ -1,118 +0,0 @@
1
- #!/bin/bash
2
- # Pantheon MCP Init — configura os 3 MCP servers em qualquer plataforma
3
- # Uso: ./scripts/init-pantheon-mcp.sh /caminho/do/projeto [plataforma]
4
- # plataforma: opencode (padrão), claude, cursor, windsurf, cline, continue, copilot
5
-
6
- set -e
7
-
8
- SOURCE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
9
- TARGET_DIR="${1:-.}"
10
- PLATFORM="${2:-opencode}"
11
-
12
- echo "🚀 Pantheon MCP Init — $PLATFORM"
13
- echo " Origem: $SOURCE_DIR"
14
- echo " Destino: $TARGET_DIR"
15
- echo ""
16
-
17
- # 1. Copiar scripts
18
- echo "📁 Copiando scripts MCP..."
19
- mkdir -p "$TARGET_DIR/scripts" "$TARGET_DIR/.pantheon/code-mode"
20
- cp "$SOURCE_DIR/scripts/mcp_resources_server.py" "$TARGET_DIR/scripts/"
21
- cp "$SOURCE_DIR/scripts/code_mode_server.py" "$TARGET_DIR/scripts/"
22
- cp "$SOURCE_DIR/scripts/memory_mcp_server.py" "$TARGET_DIR/scripts/"
23
- cp "$SOURCE_DIR/.pantheon/code-mode/example-sync.sh" "$TARGET_DIR/.pantheon/code-mode/"
24
- chmod +x "$TARGET_DIR/.pantheon/code-mode/example-sync.sh"
25
- echo " ✅ Scripts copiados"
26
-
27
- # 2. Virtualenv + dependências
28
- echo "🐍 Configurando virtualenv..."
29
- cd "$TARGET_DIR"
30
- if [ ! -d ".venv" ]; then
31
- python3 -m venv .venv
32
- fi
33
- source .venv/bin/activate
34
- pip install -q chromadb>=0.6.0 sentence-transformers fastmcp>=3.4.0 pyyaml 2>/dev/null || \
35
- pip install chromadb sentence-transformers fastmcp pyyaml 2>/dev/null
36
- echo " ✅ Dependências instaladas"
37
-
38
- # 3. Config da plataforma
39
- echo "📝 Configurando $PLATFORM..."
40
-
41
- case "$PLATFORM" in
42
- opencode)
43
- mkdir -p "$(dirname "$TARGET_DIR/opencode.json")"
44
- if [ ! -f "$TARGET_DIR/opencode.json" ]; then
45
- cp "$SOURCE_DIR/platform/opencode/opencode.json" "$TARGET_DIR/"
46
- echo " ✅ opencode.json criado"
47
- else
48
- echo " ⚠️ opencode.json já existe — adicione os MCPs manualmente"
49
- fi
50
- ;;
51
- claude)
52
- if [ ! -f "$TARGET_DIR/.mcp.json" ]; then
53
- cp "$SOURCE_DIR/platform/claude/mcp-template.json" "$TARGET_DIR/.mcp.json"
54
- echo " ✅ .mcp.json criado"
55
- else
56
- echo " ⚠️ .mcp.json já existe — faça merge manual dos mcpServers"
57
- fi
58
- ;;
59
- cursor)
60
- mkdir -p "$TARGET_DIR/.cursor"
61
- if [ ! -f "$TARGET_DIR/.cursor/mcp.json" ]; then
62
- cp "$SOURCE_DIR/platform/cursor/mcp-template.json" "$TARGET_DIR/.cursor/mcp.json"
63
- echo " ✅ .cursor/mcp.json criado"
64
- else
65
- echo " ⚠️ .cursor/mcp.json já existe — faça merge manual"
66
- fi
67
- ;;
68
- windsurf)
69
- mkdir -p "$HOME/.codeium/windsurf"
70
- if [ ! -f "$HOME/.codeium/windsurf/mcp_config.json" ]; then
71
- cp "$SOURCE_DIR/platform/windsurf/mcp-template.json" "$HOME/.codeium/windsurf/mcp_config.json"
72
- echo " ✅ mcp_config.json criado (global)"
73
- else
74
- echo " ⚠️ mcp_config.json já existe — faça merge manual"
75
- fi
76
- ;;
77
- cline)
78
- echo " ⚠️ Cline usa settings do VS Code. Copie manualmente:"
79
- echo " $SOURCE_DIR/platform/cline/mcp-template.json"
80
- echo " Para: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json"
81
- ;;
82
- continue)
83
- echo " ⚠️ Continue.dev usa ~/.continue/config.json. Copie manualmente:"
84
- echo " $SOURCE_DIR/platform/continue/mcp-template.json"
85
- echo " (mcpServers é ARRAY — faça merge no seu config.json)"
86
- ;;
87
- copilot)
88
- mkdir -p "$TARGET_DIR/.vscode"
89
- if [ ! -f "$TARGET_DIR/.vscode/mcp.json" ]; then
90
- cp "$SOURCE_DIR/platform/copilot/mcp-template.json" "$TARGET_DIR/.vscode/mcp.json"
91
- echo " ✅ .vscode/mcp.json criado"
92
- else
93
- echo " ⚠️ .vscode/mcp.json já existe — faça merge manual"
94
- fi
95
- ;;
96
- *)
97
- echo " ❌ Plataforma desconhecida: $PLATFORM"
98
- echo " Use: opencode, claude, cursor, windsurf, cline, continue, copilot"
99
- exit 1
100
- ;;
101
- esac
102
-
103
- # 4. Verificação
104
- echo ""
105
- echo "🔍 Verificando instalação..."
106
- python3 -c "from scripts.mcp_resources_server import mcp; print(' ✅ resources OK')" 2>/dev/null || echo " ⚠️ Verifique o Python path"
107
- python3 -c "from scripts.code_mode_server import mcp; print(' ✅ code-mode OK')" 2>/dev/null || echo " ⚠️ Verifique o Python path"
108
- .venv/bin/python3 -c "from scripts.memory_mcp_server import mcp; print(' ✅ memory OK')" 2>/dev/null || echo " ⚠️ Verifique o .venv"
109
-
110
- echo ""
111
- echo "🎉 Pantheon MCP Init concluído para $PLATFORM!"
112
- echo ""
113
- echo "Comandos uteis:"
114
- echo " Testar: cd $TARGET_DIR && .venv/bin/python3 -m pytest tests/ -v"
115
- echo " Usar: abra o projeto no $PLATFORM e os MCPs estarão disponíveis"
116
- echo ""
117
- echo "Nota: o modelo all-MiniLM-L6-v2 (~80MB) baixa automaticamente"
118
- echo "no primeiro uso do pantheon-memory."