pantheon-opencode 1.0.0
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.
- package/AGENTS.md +37 -0
- package/LICENSE +21 -0
- package/README.md +1013 -0
- package/bin/pantheon-init.mjs +183 -0
- package/commands/pantheon-audit.md +25 -0
- package/commands/pantheon-bg.md +10 -0
- package/commands/pantheon-consolidate.md +11 -0
- package/commands/pantheon-deepwork.md +128 -0
- package/commands/pantheon-doc.md +10 -0
- package/commands/pantheon-focus.md +9 -0
- package/commands/pantheon-forget.md +58 -0
- package/commands/pantheon-hash.md +11 -0
- package/commands/pantheon-optimize.md +79 -0
- package/commands/pantheon-remember.md +44 -0
- package/commands/pantheon-search.md +48 -0
- package/commands/pantheon-status.md +71 -0
- package/commands/pantheon-todo.md +11 -0
- package/commands/pantheon.md +49 -0
- package/docs/AGENT-MCP.md +194 -0
- package/docs/ARCHITECTURE.md +384 -0
- package/docs/BRANCH-PROTECTION.md +142 -0
- package/docs/INDEX.md +81 -0
- package/docs/INSTALLATION.md +217 -0
- package/docs/MCP.md +238 -0
- package/docs/MEMORY.md +471 -0
- package/docs/MIGRATION-MEMORY-BANK.md +139 -0
- package/docs/PLATFORMS.md +5 -0
- package/docs/QUICKSTART.md +49 -0
- package/docs/README.md +18 -0
- package/docs/RELEASING.md +256 -0
- package/docs/SETUP.md +5 -0
- package/docs/UPGRADING.md +41 -0
- package/docs/mcp-recommendations.md +439 -0
- package/docs/mcp-tools.md +156 -0
- package/docs/mcp-user-guide.md +204 -0
- package/docs/persistence-mcp.md +111 -0
- package/package.json +72 -0
- package/pantheon.schema.json +158 -0
- package/scripts/__init__.py +0 -0
- package/scripts/_pantheon_paths.py +68 -0
- package/scripts/check-version-consistency.sh +23 -0
- package/scripts/code_mode_server.py +202 -0
- package/scripts/doctor.mjs +763 -0
- package/scripts/generate-prompts.sh +222 -0
- package/scripts/generate-routing-docs.mjs +104 -0
- package/scripts/hash_verify.py +192 -0
- package/scripts/init-pantheon-mcp.sh +118 -0
- package/scripts/install/agents-md.mjs +214 -0
- package/scripts/install/health-check.mjs +196 -0
- package/scripts/install/migrate.mjs +209 -0
- package/scripts/install/opencode.mjs +645 -0
- package/scripts/install/shared.mjs +655 -0
- package/scripts/install/venv.mjs +116 -0
- package/scripts/install-mcp.mjs +885 -0
- package/scripts/install.mjs +26 -0
- package/scripts/manifest.mjs +622 -0
- package/scripts/mcp_persistence_server.py +459 -0
- package/scripts/mcp_resources_server.py +206 -0
- package/scripts/memory_cache.py +78 -0
- package/scripts/memory_mcp_server.py +605 -0
- package/scripts/paths.py +64 -0
- package/scripts/prune_context.py +72 -0
- package/scripts/release-bundle.mjs +109 -0
- package/scripts/scrub-secrets.py +282 -0
- package/scripts/scrub_secrets.py +281 -0
- package/scripts/test-context-compression.sh +166 -0
- package/scripts/themis_heuristic_scan.py +287 -0
- package/scripts/todo_enforcer.py +242 -0
- package/scripts/uninstall.mjs +1057 -0
- package/scripts/validate-routing.mjs +160 -0
- package/scripts/validate_agent_frontmatter.py +226 -0
- package/scripts/versioning.mjs +254 -0
- package/skills-lock.json +16 -0
- package/src/agents/aphrodite.md +162 -0
- package/src/agents/apollo.md +109 -0
- package/src/agents/athena.md +226 -0
- package/src/agents/demeter.md +146 -0
- package/src/agents/gaia.md +82 -0
- package/src/agents/hephaestus.md +105 -0
- package/src/agents/hermes.md +302 -0
- package/src/agents/iris.md +99 -0
- package/src/agents/mnemosyne.md +226 -0
- package/src/agents/nyx.md +87 -0
- package/src/agents/prometheus.md +199 -0
- package/src/agents/talos.md +93 -0
- package/src/agents/themis.md +187 -0
- package/src/agents/zeus.md +209 -0
- package/src/instructions/agent-return-format.instructions.md +26 -0
- package/src/instructions/backend-standards.instructions.md +45 -0
- package/src/instructions/documentation-standards.instructions.md +53 -0
- package/src/instructions/frontend-standards.instructions.md +46 -0
- package/src/instructions/memory-protocol.instructions.md +67 -0
- package/src/instructions/yagni.instructions.md +21 -0
- package/src/instructions/zeus-anti-stall.instructions.md +72 -0
- package/src/instructions/zeus-communication-rules.instructions.md +15 -0
- package/src/instructions/zeus-council-synthesis.instructions.md +105 -0
- package/src/instructions/zeus-timeout-retry.instructions.md +127 -0
- package/src/mcp/_pantheon_paths.py +67 -0
- package/src/mcp/code_mode_server.py +202 -0
- package/src/mcp/init-pantheon-mcp.sh +118 -0
- package/src/mcp/install-mcp.mjs +885 -0
- package/src/mcp/mcp_persistence_server.py +458 -0
- package/src/mcp/mcp_resources_server.py +205 -0
- package/src/mcp/memory_mcp_server.py +604 -0
- package/src/mcp/requirements-mcp-core.txt +5 -0
- package/src/mcp/requirements-mcp.txt +5 -0
- package/src/plugin.ts +19 -0
- package/src/plugins/tui/dist/tui.js +143 -0
- package/src/plugins/tui/dist/tui.tsx +144 -0
- package/src/plugins/tui/package.json +32 -0
- package/src/plugins/tui/src/index.tsx +144 -0
- package/src/plugins/tui/tsdown.config.ts +22 -0
- package/src/routing.yml +499 -0
- package/src/skills/README.md +230 -0
- package/src/skills/agent-coordination/SKILL.md +95 -0
- package/src/skills/artifact-management/SKILL.md +118 -0
- package/src/skills/auto-continue/SKILL.md +280 -0
- package/src/skills/code-review-checklist/SKILL.md +139 -0
- package/src/skills/context-compression/SKILL.md +861 -0
- package/src/skills/git-workflow-and-versioning/SKILL.md +32 -0
- package/src/skills/incremental-implementation/SKILL.md +27 -0
- package/src/skills/memory-bank/SKILL.md +165 -0
- package/src/skills/orchestration-workflow/SKILL.md +311 -0
- package/src/skills/security-hardening/SKILL.md +36 -0
- package/src/skills/session-goal/SKILL.md +138 -0
- package/src/skills/spec-driven-development/SKILL.md +23 -0
- package/src/skills/tdd-with-agents/SKILL.md +170 -0
- package/src/skills/visual-review-pipeline/SKILL.md +200 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow-and-versioning
|
|
3
|
+
description: "Atomic commits, conventional commits, trunk-based development"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Workflow & Versioning
|
|
7
|
+
|
|
8
|
+
**Commits atômicos, mensagens claras, trunk-based.**
|
|
9
|
+
|
|
10
|
+
## Commit Style (Conventional Commits)
|
|
11
|
+
```
|
|
12
|
+
feat: add login endpoint
|
|
13
|
+
fix: handle null user in profile
|
|
14
|
+
refactor: extract auth middleware
|
|
15
|
+
test: add migration up/down test
|
|
16
|
+
docs: update README setup steps
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
1. **Atomic commits** — um commit = uma mudança lógica. Não acumule
|
|
21
|
+
2. **Trunk-based** — branches curtas (< 2 dias), PRs pequenos
|
|
22
|
+
3. **Mensagens no imperativo** — "add" não "added" ou "adds"
|
|
23
|
+
4. **Commits quebram o build?** Só se for intencional (WIP)
|
|
24
|
+
5. **Nunca force push em branch compartilhada**
|
|
25
|
+
|
|
26
|
+
## Branch Strategy
|
|
27
|
+
```
|
|
28
|
+
main ← produção
|
|
29
|
+
├── feat/<descrição> — features
|
|
30
|
+
├── fix/<descrição> — bug fixes
|
|
31
|
+
└── refactor/<descrição> — refatorações
|
|
32
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: incremental-implementation
|
|
3
|
+
description: "Implement in thin vertical slices — one commit per task, testable, rollback-safe"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Incremental Implementation
|
|
7
|
+
|
|
8
|
+
**Construa em fatias finas testáveis. Um commit por task.**
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
1. Cada slice entrega valor testável de forma independente
|
|
12
|
+
2. Um commit por slice — sempre com tests passando
|
|
13
|
+
3. Se o slice cresceu > 50 linhas, quebre em 2
|
|
14
|
+
4. Rollback de um slice não quebra os anteriores
|
|
15
|
+
|
|
16
|
+
## Slice Pattern
|
|
17
|
+
```
|
|
18
|
+
Slice 1 — Schema + model (migration up/down testada)
|
|
19
|
+
Slice 2 — API endpoint (teste → implementação → refactor)
|
|
20
|
+
Slice 3 — Frontend component (mock API → UI → integração)
|
|
21
|
+
Slice N — Integração E2E (caminho feliz + edge cases)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Anti-patterns
|
|
25
|
+
- ❌ Slices horizontais (backend inteiro, depois frontend inteiro)
|
|
26
|
+
- ❌ Commits de 500+ linhas
|
|
27
|
+
- ❌ Implementar sem testar antes (RED → GREEN)
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-bank
|
|
3
|
+
description: "Memory bank rules, structure, and optimization — complete guide to Pantheon memory management."
|
|
4
|
+
context: fork
|
|
5
|
+
globs: []
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Memory Bank
|
|
10
|
+
|
|
11
|
+
Complete guide to Pantheon memory bank — structure, rules, optimization, and maintenance.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Two-System Model
|
|
16
|
+
|
|
17
|
+
| System | Where | Owner | Lifetime | Purpose |
|
|
18
|
+
|--------|-------|-------|----------|---------|
|
|
19
|
+
| **Memory Bank** | `.pantheon/memory-bank/` | Team | Permanent, versioned | Project context: architecture, patterns, progress |
|
|
20
|
+
| **VS Code `/memories/`** | `.vscode/` or workspace | Agent | Session/repo scoped | Atomic facts, conversation plans |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Memory Bank Structure
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
.pantheon/memory-bank/
|
|
28
|
+
├── 00-project.md ← What is this project? (fill once)
|
|
29
|
+
├── 00-architecture.md ← System design and agent hierarchy
|
|
30
|
+
├── 00-components.md ← Component breakdown and ownership
|
|
31
|
+
├── 00-tech-stack.md ← Tech stack, setup, environment
|
|
32
|
+
├── 01-active-context.md ← Current sprint focus, decisions, blockers (MOST IMPORTANT)
|
|
33
|
+
├── 02-progress-log.md ← What works, what's left, milestones (append-only)
|
|
34
|
+
├── _tasks/
|
|
35
|
+
│ ├── _index.md ← Task master list
|
|
36
|
+
│ └── TASK0001-name.md ← Individual task records
|
|
37
|
+
└── _notes/
|
|
38
|
+
├── _index.md ← Notes index
|
|
39
|
+
└── NOTE0001-topic.md ← Architectural decisions, findings
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### File Update Frequency
|
|
43
|
+
|
|
44
|
+
| File | Fill when | Update frequency |
|
|
45
|
+
|------|-----------|-----------------|
|
|
46
|
+
| `00-project.md` | Project start | Rarely |
|
|
47
|
+
| `00-architecture.md` | Project start | On significant changes |
|
|
48
|
+
| `00-components.md` | Project start | When components added/removed |
|
|
49
|
+
| `00-tech-stack.md` | Project start | On stack changes |
|
|
50
|
+
| `01-active-context.md` | Each sprint | Each sprint / major decision |
|
|
51
|
+
| `02-progress-log.md` | First completion | Append-only per milestone |
|
|
52
|
+
| `_tasks/` | Sprint tracking | Per task |
|
|
53
|
+
| `_notes/` | Significant findings | Per finding |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Golden Rules
|
|
58
|
+
|
|
59
|
+
1. **Never create `.md` files outside `.pantheon/memory-bank/`** (except `README.md`, `CONTRIBUTING.md`)
|
|
60
|
+
2. **Never create `ANALYSIS_*.md`, `SUMMARY_*.md`, `STATUS_*.md`** anywhere
|
|
61
|
+
3. **`01-active-context.md` is the priority file** — keep it current
|
|
62
|
+
4. **`02-progress-log.md` is append-only** — never edit history
|
|
63
|
+
5. **`_notes/` decisions are immutable** — supersede, never edit
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Session → Active Context Graduation
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
During sprint:
|
|
71
|
+
Athena writes plan → /memories/session/sprint-plan.md (ephemeral)
|
|
72
|
+
Agents track wip → /memories/session/wip.md (ephemeral)
|
|
73
|
+
|
|
74
|
+
At sprint close:
|
|
75
|
+
@mnemosyne consolidates → .pantheon/memory-bank/01-active-context.md
|
|
76
|
+
→ .pantheon/memory-bank/02-progress-log.md (appended)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Who Writes What
|
|
82
|
+
|
|
83
|
+
| Content | Written by | Where |
|
|
84
|
+
|---------|-----------|-------|
|
|
85
|
+
| Project overview, architecture | Mnemosyne (at init) | `00-03.md` |
|
|
86
|
+
| Sprint context, decisions | Agent / Mnemosyne | `01-active-context.md` |
|
|
87
|
+
| Milestone completions | Any agent | `02-progress-log.md` (append) |
|
|
88
|
+
| Task records | Mnemosyne (on request) | `_tasks/TASK000X-*.md` |
|
|
89
|
+
| Architecture decisions | Mnemosyne (on request) | `_notes/NOTE000X-*.md` |
|
|
90
|
+
| Atomic facts | Any agent | `/memories/repo/` |
|
|
91
|
+
| Conversation plans | Athena / any agent | `/memories/session/` |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Optimization: Compression Rules
|
|
96
|
+
|
|
97
|
+
### Problem: Memory bank files grow too large, wasting tokens on every load.
|
|
98
|
+
|
|
99
|
+
### Strategy: Lazy-load only what's needed
|
|
100
|
+
|
|
101
|
+
| Rule | Before | After |
|
|
102
|
+
|------|--------|-------|
|
|
103
|
+
| **Active context** | 500+ lines of history | 50 lines: current sprint only |
|
|
104
|
+
| **Progress log** | Everything since day 1 | Link to archived logs; keep last 50 lines |
|
|
105
|
+
| **Task records** | All tasks in one file | One file per task; archive completed |
|
|
106
|
+
| **Notes** | Long narrative | Bullet points with links to source |
|
|
107
|
+
|
|
108
|
+
### Compression Targets
|
|
109
|
+
|
|
110
|
+
- `01-active-context.md`: Keep under 100 lines. Archive old sprints to `_notes/`.
|
|
111
|
+
- `02-progress-log.md`: Keep last 20 entries. Archive older to `_notes/archive/`.
|
|
112
|
+
- `_tasks/`: Mark completed tasks `[x]`, move to `_tasks/archive/`.
|
|
113
|
+
|
|
114
|
+
### Commands
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
@mnemosyne Compress memory bank # Audit and compress all files
|
|
118
|
+
@mnemosyne Archive completed tasks # Move done tasks to archive
|
|
119
|
+
@mnemosyne Trim active context # Keep only current sprint
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Anti-Patterns
|
|
125
|
+
|
|
126
|
+
### ❌ Session output as files
|
|
127
|
+
```
|
|
128
|
+
# Wrong
|
|
129
|
+
Create IMPLEMENTATION_SUMMARY.md
|
|
130
|
+
Create STATUS.md
|
|
131
|
+
|
|
132
|
+
# Right
|
|
133
|
+
@mnemosyne Append to 02-progress-log.md: [summary]
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### ❌ Mandatory handoff after every phase
|
|
137
|
+
```
|
|
138
|
+
# Wrong: After every phase → handoff to @mnemosyne
|
|
139
|
+
|
|
140
|
+
# Right: Agent appends to 01-active-context.md directly
|
|
141
|
+
At sprint close → explicit @mnemosyne invocation
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### ❌ Duplicating information
|
|
145
|
+
```
|
|
146
|
+
# Wrong: Stack in 00-project.md AND /memories/repo/stack.json
|
|
147
|
+
|
|
148
|
+
# Right: Atomic facts → /memories/repo/ (auto-loaded)
|
|
149
|
+
Narrative context → 00-project.md (explicit read)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Adopting in a Product
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
mkdir -p .pantheon/memory-bank/_tasks .pantheon/memory-bank/_notes
|
|
158
|
+
touch .pantheon/memory-bank/_tasks/.gitkeep .pantheon/memory-bank/_notes/.gitkeep
|
|
159
|
+
# @mnemosyne Initialize memory bank for this repository
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Add to `.github/copilot-instructions.md`:
|
|
163
|
+
```markdown
|
|
164
|
+
Always read .pantheon/memory-bank/01-active-context.md before answering.
|
|
165
|
+
```
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orchestration-workflow
|
|
3
|
+
description: "Practical step-by-step walkthrough for orchestrating features end-to-end using the multi-agent system, from planning through deployment"
|
|
4
|
+
context: fork
|
|
5
|
+
globs: ["**/AGENTS.md", "**/agents/*.agent.md"]
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Orchestration Workflow: Step-by-Step Guide
|
|
10
|
+
|
|
11
|
+
Practical walkthrough for using the multi-agent system end-to-end. This is your "how-to" guide for orchestrating features from planning through production deployment.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Your First Feature (Real Example)
|
|
16
|
+
|
|
17
|
+
**Scenario:** You want to add JWT authentication to your app.
|
|
18
|
+
**Time:** ~6-8 hours total (spread across 1-2 days)
|
|
19
|
+
**Team:** All agents working together
|
|
20
|
+
**Result:** Complete feature with 95% coverage, security audit passed, ready to deploy
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 1: Plan the Feature (30 minutes)
|
|
25
|
+
|
|
26
|
+
### What You Do
|
|
27
|
+
|
|
28
|
+
Open VS Code, start a chat with Copilot:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
@athena: Plan JWT authentication with refresh tokens
|
|
32
|
+
|
|
33
|
+
Requirements:
|
|
34
|
+
- User login with email + password
|
|
35
|
+
- JWT access token (15 min expiry)
|
|
36
|
+
- Refresh token (7 day expiry)
|
|
37
|
+
- Secure token storage (httpOnly cookies)
|
|
38
|
+
- Token verification on protected routes
|
|
39
|
+
- Rate limiting (5 attempts/min)
|
|
40
|
+
- OWASP Top 10 compliant
|
|
41
|
+
|
|
42
|
+
Please create a detailed 3-4 phase implementation plan.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### What Athena Does
|
|
46
|
+
|
|
47
|
+
Athena researches patterns, calls Apollo for existing auth code, and creates:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
📋 Plan: JWT Authentication
|
|
51
|
+
├─ Phase 1: Database Schema (Demeter)
|
|
52
|
+
│ ├─ Tasks: Create user + token tables
|
|
53
|
+
│ ├─ Test requirements: 5 test cases
|
|
54
|
+
│ └─ Risk: Zero-downtime migration
|
|
55
|
+
├─ Phase 2: Backend Services (Hermes)
|
|
56
|
+
│ ├─ Tasks: JWT service + endpoints
|
|
57
|
+
│ ├─ Test requirements: 8 test cases
|
|
58
|
+
│ └─ Risk: Token expiry edge cases
|
|
59
|
+
├─ Phase 3: Frontend Integration (Aphrodite)
|
|
60
|
+
│ ├─ Tasks: LoginForm + useAuth hook
|
|
61
|
+
│ ├─ Test requirements: 6 test cases
|
|
62
|
+
│ └─ Risk: Token refresh race condition
|
|
63
|
+
└─ FAQ: Answers to common questions
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### What You Do
|
|
67
|
+
|
|
68
|
+
1. Review the plan presented by Athena in chat
|
|
69
|
+
2. **Ask questions or approve**
|
|
70
|
+
- If concerns: `@athena: Please adjust plan because...`
|
|
71
|
+
- If approved: "Plan looks good, let's proceed"
|
|
72
|
+
|
|
73
|
+
### ⏸️ PAUSE POINT 1: Plan Approval
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
Athena: ✅ Plan approved! Ready to orchestrate implementation
|
|
77
|
+
Zeus: Starting Phase 1 - Database Schema
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Step 2: Orchestrate Implementation
|
|
83
|
+
|
|
84
|
+
### Phase 1: Database Schema
|
|
85
|
+
|
|
86
|
+
**Zeus delegates to Demeter:**
|
|
87
|
+
```
|
|
88
|
+
@demeter: Implement database schema for JWT auth
|
|
89
|
+
|
|
90
|
+
Requirements:
|
|
91
|
+
- User table: id, email, hashed_password
|
|
92
|
+
- Token table: id, user_id, token, issued_at, expires_at, revoked_at
|
|
93
|
+
- Indexes: user(email), token(user_id, token)
|
|
94
|
+
|
|
95
|
+
TDD: RED → GREEN → REFACTOR
|
|
96
|
+
Coverage target: >80%
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Demeter does:**
|
|
100
|
+
1. Write FAILING migration test (RED)
|
|
101
|
+
2. Write minimal migration (GREEN)
|
|
102
|
+
3. Refactor (REFACTOR) — add types, indexes, constraints, timestamps
|
|
103
|
+
|
|
104
|
+
**Demeter delivers:** Schema files + tests, >80% coverage
|
|
105
|
+
|
|
106
|
+
**Themis reviews:** Coverage, security, performance, tests → APPROVED
|
|
107
|
+
|
|
108
|
+
**Background dispatch for independent phases (OpenCode v1.16.2+):**
|
|
109
|
+
If Phase 2 (backend) and Phase 3 (frontend) have no file dependencies, Zeus can dispatch both in **background** simultaneously and continue working while they execute. This eliminates the sequential wait.
|
|
110
|
+
|
|
111
|
+
### ⏸️ PAUSE POINT 2: Phase Review
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Zeus: "Phase 1 complete! Coverage: >80% ✅ Security: ✅ Tests: passing ✅
|
|
115
|
+
Ready to continue to Phase 2?"
|
|
116
|
+
|
|
117
|
+
User: "continue"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Phase 2: Backend Services
|
|
121
|
+
|
|
122
|
+
**Zeus delegates to Hermes:**
|
|
123
|
+
```
|
|
124
|
+
@hermes: Implement backend services for JWT auth
|
|
125
|
+
|
|
126
|
+
Create:
|
|
127
|
+
1. JWTService: generate, verify, refresh JWT
|
|
128
|
+
2. AuthService: handle login/logout
|
|
129
|
+
3. Auth endpoints: POST /auth/login, POST /auth/refresh, GET /auth/verify
|
|
130
|
+
|
|
131
|
+
TDD: RED → GREEN → REFACTOR
|
|
132
|
+
Coverage target: >80%
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Hermes does (TDD):**
|
|
136
|
+
1. Write failing test for JWT generation (RED)
|
|
137
|
+
2. Write minimal JWT service (GREEN)
|
|
138
|
+
3. Refactor with proper types, error handling (REFACTOR)
|
|
139
|
+
4. Repeat for all endpoints
|
|
140
|
+
|
|
141
|
+
**Hermes delivers:** Services + tests, >80% coverage
|
|
142
|
+
|
|
143
|
+
**Themis reviews:** Coverage, security (OWASP), performance → APPROVED
|
|
144
|
+
|
|
145
|
+
### ⏸️ PAUSE POINT 2: Phase Review
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Zeus: "Phase 2 complete! Coverage: >80% ✅ Security: OWASP ✅ Tests: passing ✅
|
|
149
|
+
Ready to continue to Phase 3?"
|
|
150
|
+
|
|
151
|
+
User: "continue"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Phase 3: Frontend Integration
|
|
155
|
+
|
|
156
|
+
**Zeus delegates to Aphrodite:**
|
|
157
|
+
```
|
|
158
|
+
@aphrodite: Implement frontend for JWT auth
|
|
159
|
+
|
|
160
|
+
Create:
|
|
161
|
+
1. LoginForm component
|
|
162
|
+
2. useAuth hook for state management
|
|
163
|
+
3. Protected route wrapper
|
|
164
|
+
|
|
165
|
+
TDD: RED → GREEN → REFACTOR
|
|
166
|
+
Coverage target: >80%
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Aphrodite does (TDD):**
|
|
170
|
+
1. Write failing component test (RED)
|
|
171
|
+
2. Write minimal component (GREEN)
|
|
172
|
+
3. Refactor with proper accessibility, error handling (REFACTOR)
|
|
173
|
+
|
|
174
|
+
**Aphrodite delivers:** Components + tests, >80% coverage
|
|
175
|
+
|
|
176
|
+
**Themis reviews:** Coverage, accessibility, security → APPROVED
|
|
177
|
+
|
|
178
|
+
### ⏸️ PAUSE POINT 2: Phase Review
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
Zeus: "Phase 3 complete! Coverage: >80% ✅ Accessibility: ✅ Tests: passing ✅
|
|
182
|
+
All phases approved!"
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Step 3: Final Summary
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
✅ JWT Authentication Complete
|
|
191
|
+
|
|
192
|
+
📊 Metrics:
|
|
193
|
+
- 3 phases: Database, Backend, Frontend
|
|
194
|
+
- >80% coverage across all layers
|
|
195
|
+
- Security: OWASP compliant ✅
|
|
196
|
+
- All tests passing ✅
|
|
197
|
+
|
|
198
|
+
🚀 Ready to commit
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Step 4: Git Commit
|
|
204
|
+
|
|
205
|
+
### ⏸️ PAUSE POINT 3: Git Commit
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
Zeus: "All phases approved! Ready to commit."
|
|
209
|
+
|
|
210
|
+
Suggested commit message:
|
|
211
|
+
feat: Add JWT authentication with refresh tokens
|
|
212
|
+
|
|
213
|
+
- Create User + Token database schema
|
|
214
|
+
- Implement JWTService + AuthService
|
|
215
|
+
- Add login, refresh, verify endpoints
|
|
216
|
+
- Create LoginForm + useAuth hook
|
|
217
|
+
- Full TDD: >80% coverage
|
|
218
|
+
- Security: OWASP Top 10 compliant
|
|
219
|
+
|
|
220
|
+
User: git add -A && git commit -m "..."
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Quick Reference: Workflow Commands
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Step 1: Plan
|
|
229
|
+
@athena: Plan [feature description]
|
|
230
|
+
|
|
231
|
+
# Step 2: Orchestrate
|
|
232
|
+
@zeus: Implement feature using plan
|
|
233
|
+
|
|
234
|
+
# Step 3: At pause points
|
|
235
|
+
# - Review phase results
|
|
236
|
+
# - Approve before proceeding
|
|
237
|
+
|
|
238
|
+
# Step 4: Commit
|
|
239
|
+
git add -A
|
|
240
|
+
git commit -m "feat: ..."
|
|
241
|
+
|
|
242
|
+
# Step 5: Deploy
|
|
243
|
+
git push origin [branch]
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Troubleshooting
|
|
249
|
+
|
|
250
|
+
### Problem: Phase coverage is <80%
|
|
251
|
+
**Solution:** Implementer adds missing test cases, re-runs coverage, Themis re-reviews.
|
|
252
|
+
|
|
253
|
+
### Problem: Security audit found issue
|
|
254
|
+
**Solution:** Relevant agent fixes (parameterized queries, input validation), re-audit, Themis approves.
|
|
255
|
+
|
|
256
|
+
### Problem: Frontend accessibility below target
|
|
257
|
+
**Solution:** Aphrodite improves ARIA labels, keyboard navigation, re-checks, Themis approves.
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Common Patterns
|
|
262
|
+
|
|
263
|
+
### Pattern 1: Simple Bug Fix (Skip Athena)
|
|
264
|
+
```
|
|
265
|
+
Discovery: @apollo: Find bug in authentication
|
|
266
|
+
Fix: @hermes: Fix the validation error
|
|
267
|
+
Review: @themis: Auto-invoked after fix
|
|
268
|
+
Result: Minimal change, minimal risk (~30 min)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Pattern 2: Complex Feature (Full System)
|
|
272
|
+
```
|
|
273
|
+
Plan: @athena: Plan architecture
|
|
274
|
+
Orchestrate: @zeus: Implement using plan
|
|
275
|
+
Result: Complete feature, >80% coverage (1-2 days)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Pattern 3: Database Optimization
|
|
279
|
+
```
|
|
280
|
+
Discovery: @apollo: Find N+1 queries
|
|
281
|
+
Optimize: @demeter: Add indexes + optimize
|
|
282
|
+
Review: @themis: Auto-invoked
|
|
283
|
+
Result: 10x faster queries (~2 hours)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Pro Tips
|
|
289
|
+
|
|
290
|
+
🎯 **Plan First** — Saves 2-3x rework time
|
|
291
|
+
🎯 **Use Pause Points** — You control when to proceed
|
|
292
|
+
🎯 **Trust Themis** — Code review catches issues early
|
|
293
|
+
🎯 **Commit Atomically** — One phase = one commit
|
|
294
|
+
🎯 **Test First** — RED tests before code
|
|
295
|
+
🎯 **Coverage Matters** — <80% = blocked, no exceptions
|
|
296
|
+
🎯 **Security First** — Themis enforces OWASP compliance
|
|
297
|
+
🎯 **Background Dispatch** — Use OpenCode v1.16.2+ background agents to run independent phases in parallel without polling
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Next Steps
|
|
302
|
+
|
|
303
|
+
1. ✅ Read this guide
|
|
304
|
+
2. ✅ Review agent reference in `agent-coordination/SKILL.md`
|
|
305
|
+
3. ✅ Review TDD standards in `tdd-with-agents/SKILL.md`
|
|
306
|
+
4. 🚀 Start your first feature: `@athena: Plan [your idea]`
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
**Philosophy:** Plan → Orchestrate → Review → Commit → Deploy
|
|
311
|
+
Every phase has a pause point where YOU control the outcome.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-hardening
|
|
3
|
+
description: "Security gate — OWASP, SAST, secrets, MCP hardening, dependency audit"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Hardening
|
|
7
|
+
|
|
8
|
+
**Código inseguro em produção = pesadelo. Isso é não-negociável.**
|
|
9
|
+
|
|
10
|
+
## Scope
|
|
11
|
+
| Domain | Coverage |
|
|
12
|
+
|--------|----------|
|
|
13
|
+
| **SAST** | SQL injection, XSS, CSRF, path traversal, command injection |
|
|
14
|
+
| **MCP** | Credential leakage prevention, tool access control, input sanitization |
|
|
15
|
+
| **Secrets** | No hardcoded keys, tokens, passwords in code/logs |
|
|
16
|
+
| **Deps** | Known CVEs, outdated packages, deprecated libs |
|
|
17
|
+
| **Container** | Non-root user, health checks, minimal base images |
|
|
18
|
+
|
|
19
|
+
## MCP Security (Mandatory)
|
|
20
|
+
- Never log credentials, tokens, or API keys
|
|
21
|
+
- Validate all MCP inputs
|
|
22
|
+
- Restrict tool access per agent via `mcp_tools` YAML field
|
|
23
|
+
- Audit MCP server URLs (no unverified endpoints)
|
|
24
|
+
|
|
25
|
+
## SAST Checklist
|
|
26
|
+
- [ ] Input validation on ALL endpoints
|
|
27
|
+
- [ ] Parameterized queries (no string concatenation)
|
|
28
|
+
- [ ] CSRF protection on state-changing requests
|
|
29
|
+
- [ ] Rate limiting on sensitive endpoints
|
|
30
|
+
- [ ] Safe error messages (no stack traces to client)
|
|
31
|
+
|
|
32
|
+
## Dep Audit
|
|
33
|
+
```bash
|
|
34
|
+
pip-audit --requirement requirements.txt
|
|
35
|
+
npm audit
|
|
36
|
+
```
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: session-goal
|
|
3
|
+
description: "Pin session objectives to prevent scope creep. Use for alignment across long multi-agent sessions."
|
|
4
|
+
context: fork
|
|
5
|
+
globs: []
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Session Goal — Alignment Anchor
|
|
10
|
+
|
|
11
|
+
Use this skill to pin a session objective at the start of a long or complex session. All subsequent todos, delegation decisions, and verification steps must align with the pinned goal.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
Invoke via the `/focus` command:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/focus Implement JWT authentication with refresh token rotation
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or state it explicitly at the start of a session:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
SESSION GOAL: Add product review feature with backend, frontend, and database layers.
|
|
27
|
+
All work in this session must serve this goal.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## What Pinning a Goal Does
|
|
33
|
+
|
|
34
|
+
1. **Focuses todos** — every todo added must relate to the goal
|
|
35
|
+
2. **Focuses delegation** — Zeus only invokes agents relevant to the goal
|
|
36
|
+
3. **Focuses verification** — Themis checks that implementations serve the goal
|
|
37
|
+
4. **Surfaces drift** — if a task drifts from the goal, flag it before proceeding
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Goal Format
|
|
42
|
+
|
|
43
|
+
A good session goal has 4 components:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
GOAL: <What to build>
|
|
47
|
+
SCOPE: <Which layers/modules are in scope>
|
|
48
|
+
SUCCESS CRITERIA: <How we know it's done>
|
|
49
|
+
OUT OF SCOPE: <What to explicitly exclude>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Example:**
|
|
53
|
+
```
|
|
54
|
+
GOAL: Add email verification to the registration flow
|
|
55
|
+
SCOPE: Backend (POST /auth/verify, token model), Frontend (VerifyEmail page), DB (verification_tokens table)
|
|
56
|
+
SUCCESS CRITERIA: User can register, receive a verification email link, click it, and have their account marked as verified. All layers tested >80% coverage.
|
|
57
|
+
OUT OF SCOPE: Password reset, 2FA, email template design
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Alignment Check Pattern
|
|
63
|
+
|
|
64
|
+
Before each major delegation or decision, run this quick check:
|
|
65
|
+
|
|
66
|
+
> "Does this task directly serve the pinned goal?"
|
|
67
|
+
> - **Yes** → proceed
|
|
68
|
+
> - **Partial** → flag the out-of-scope portion and ask for clarification
|
|
69
|
+
> - **No** → defer to a future session, note it as a separate task
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Cross-Session Persistence
|
|
74
|
+
|
|
75
|
+
For goals that span multiple sessions, write the goal to `/memories/session/`:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
/memories/session/current-goal.md
|
|
79
|
+
|
|
80
|
+
# Active Session Goal
|
|
81
|
+
Goal: Implement JWT authentication
|
|
82
|
+
Started: 2026-05-15
|
|
83
|
+
Status: Phase 2 of 3 (backend done, frontend in progress)
|
|
84
|
+
Next: POST /auth/refresh endpoint
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This ensures the goal survives context compaction and session restarts.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## When to Update the Goal
|
|
92
|
+
|
|
93
|
+
- When the user explicitly redirects the session
|
|
94
|
+
- When a phase completes and the next phase has a different scope
|
|
95
|
+
- When an unexpected blocker changes the scope
|
|
96
|
+
|
|
97
|
+
Never silently drift from the goal — always confirm with the user before changing it.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Session Reuse (Cross-Task Continuity)
|
|
102
|
+
|
|
103
|
+
Reuse agent sessions between related delegations to avoid re-reading files and re-building context.
|
|
104
|
+
|
|
105
|
+
### When to Reuse
|
|
106
|
+
|
|
107
|
+
Prefer reusing an existing session when:
|
|
108
|
+
- Follow-up task touches the **same files** or **same feature thread** as a previous delegation
|
|
109
|
+
- The specialist already loaded relevant file context in the prior session
|
|
110
|
+
- Debugging continues on the same stack trace or module
|
|
111
|
+
|
|
112
|
+
### When to Start Fresh
|
|
113
|
+
|
|
114
|
+
Force a new session when:
|
|
115
|
+
- Unrelated feature or different part of the codebase
|
|
116
|
+
- Previous session has too much noise from an abandoned investigation
|
|
117
|
+
- The specialist's accumulated context would mislead the new task
|
|
118
|
+
|
|
119
|
+
### How to Signal Reuse
|
|
120
|
+
|
|
121
|
+
When dispatching a follow-up task, include the session reuse context explicitly:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
@hermes — continuing the auth endpoint work from the previous session.
|
|
125
|
+
Files already explored: backend/routers/auth.py, backend/services/auth_service.py.
|
|
126
|
+
New task: add refresh token rotation.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Session Tracking
|
|
130
|
+
|
|
131
|
+
Zeus tracks active sessions with a `task_id` per delegation:
|
|
132
|
+
|
|
133
|
+
| Agent | Active Session | Files in Context | Max Age |
|
|
134
|
+
|-------|---------------|-----------------|---------|
|
|
135
|
+
| hermes | ses_abc123 | 4 files | 15 min |
|
|
136
|
+
| aphrodite | ses_def456 | 3 files | 15 min |
|
|
137
|
+
|
|
138
|
+
When `session_max: 2` is set in routing.yml, Zeus keeps the last 2 sessions for that agent and discards older ones. This prevents stale context from accumulating.
|