pantheon-opencode 2.0.0-beta.6 → 2.0.0-rc.1
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.global.md +6 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +45 -0
- package/README.md +169 -510
- package/README.pt-BR.md +177 -149
- package/bin/pantheon-init.mjs +1 -1
- package/commands/pantheon-deepwork.md +6 -1
- package/commands/pantheon.md +10 -5
- package/package.json +1 -1
- package/plugin.json +2 -2
- package/prompts/orchestrate-with-zeus.prompt.md +82 -290
- package/prompts/subtask.prompt.md +1 -1
- package/pyproject.toml +1 -1
- package/scripts/doctor.mjs +27 -11
- package/scripts/hooks/format-multi-language.sh +30 -48
- package/scripts/jev-live-probe.mjs +1 -1
- package/scripts/release-gates.mjs +19 -5
- package/scripts/skill-search.mjs +27 -3
- package/scripts/test-opencode-sandbox.sh +44 -15
- package/scripts/update.mjs +9 -2
- package/skills-lock.json +5 -3
- package/src/agents/aphrodite.md +2 -0
- package/src/agents/apollo.md +8 -206
- package/src/agents/athena.md +25 -29
- package/src/agents/hermes.md +3 -1
- package/src/agents/mnemosyne.md +1 -1
- package/src/agents/nyx.md +1 -1
- package/src/agents/prometheus.md +0 -203
- package/src/agents/talos.md +2 -0
- package/src/agents/themis.md +8 -3
- package/src/agents/zeus.md +18 -12
- package/src/instructions/memory-protocol.instructions.md +4 -0
- package/src/instructions/test-economy.instructions.md +1 -0
- package/src/instructions/zeus-council-synthesis.instructions.md +13 -1
- package/src/pantheon/pantheon-decision-catalog.ts +8 -0
- package/src/pantheon/skill-search-tool.ts +193 -0
- package/src/pantheon/tools.ts +2 -0
- package/src/plugins/tui/dist/tui.d.ts +12 -2
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +980 -358
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/autonomy-state.ts +1 -1
- package/src/plugins/tui/src/context-gauge.ts +64 -5
- package/src/plugins/tui/src/decision-router-state.ts +49 -2
- package/src/plugins/tui/src/index.tsx +25 -3
- package/src/plugins/tui/src/pantheon-settings-state.ts +99 -0
- package/src/plugins/tui/src/pantheon-settings.tsx +391 -101
- package/src/plugins/tui/src/tui-prefs.ts +161 -9
- package/src/plugins/tui/src/update-status.ts +27 -8
- package/src/routing.yml +9 -0
- package/src/skills/README.md +35 -25
- package/src/skills/fast-path-execution/SKILL.md +54 -0
- package/src/skills/prompt-refinery/SKILL.md +51 -65
- package/src/skills/tdd-with-agents/SKILL.md +22 -10
- package/src/skills/test-slicing/SKILL.md +56 -0
- package/src/skills/verification-planning/SKILL.md +4 -3
|
@@ -11,55 +11,37 @@ REPO_ROOT="$(cd -- "$SCRIPT_DIR/../.." && pwd)"
|
|
|
11
11
|
# Extracts file_path from Edit/Write or file paths from Bash commands.
|
|
12
12
|
if [ -p /dev/stdin ]; then
|
|
13
13
|
STDIN_JSON=$(cat)
|
|
14
|
-
|
|
15
|
-
import sys, json
|
|
16
|
-
d = json.load(sys.stdin)
|
|
17
|
-
print(d.get('tool_name', ''))
|
|
18
|
-
" 2>/dev/null || echo "")
|
|
19
|
-
# Normalize to lowercase — opencode sends lowercase (edit/write/bash),
|
|
20
|
-
# Claude Code protocol may send capitalized (Edit/Write/Bash).
|
|
21
|
-
TOOL_NAME_LOWER=$(echo "$TOOL_NAME" | tr '[:upper:]' '[:lower:]')
|
|
22
|
-
|
|
23
|
-
case "$TOOL_NAME_LOWER" in
|
|
24
|
-
edit|write)
|
|
25
|
-
JSON_PATH=$(echo "$STDIN_JSON" | python3 -c "
|
|
26
|
-
import sys, json
|
|
27
|
-
d = json.load(sys.stdin)
|
|
28
|
-
print(d.get('tool_input', {}).get('file_path', ''))
|
|
29
|
-
" 2>/dev/null || echo "")
|
|
30
|
-
if [ -n "$JSON_PATH" ]; then
|
|
31
|
-
FILE_PATH="$JSON_PATH"
|
|
32
|
-
fi
|
|
33
|
-
;;
|
|
34
|
-
bash)
|
|
35
|
-
COMMAND=$(echo "$STDIN_JSON" | python3 -c "
|
|
36
|
-
import sys, json
|
|
37
|
-
d = json.load(sys.stdin)
|
|
38
|
-
print(d.get('tool_input', {}).get('command', ''))
|
|
39
|
-
" 2>/dev/null || echo "")
|
|
40
|
-
if [ -n "$COMMAND" ]; then
|
|
41
|
-
# Extract first file-like path from bash command (supports relative and quoted paths)
|
|
42
|
-
CANDIDATE=$(python3 -c "
|
|
43
|
-
import re, shlex, sys
|
|
44
|
-
command = sys.argv[1]
|
|
14
|
+
EXTRACTED_PATH=$(python3 -c "
|
|
15
|
+
import sys, json, re, shlex
|
|
45
16
|
try:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
17
|
+
d = json.load(sys.stdin)
|
|
18
|
+
t = str(d.get('tool_name', '')).lower()
|
|
19
|
+
inp = d.get('tool_input', {})
|
|
20
|
+
if not isinstance(inp, dict):
|
|
21
|
+
inp = {}
|
|
22
|
+
fp = ''
|
|
23
|
+
if t in ('edit', 'write', 'hashline_edit'):
|
|
24
|
+
fp = inp.get('file_path', '') or inp.get('filePath', '') or inp.get('path', '')
|
|
25
|
+
elif t == 'bash':
|
|
26
|
+
cmd = inp.get('command', '')
|
|
27
|
+
if cmd:
|
|
28
|
+
try:
|
|
29
|
+
tokens = shlex.split(cmd)
|
|
30
|
+
except ValueError:
|
|
31
|
+
tokens = cmd.split()
|
|
32
|
+
path_re = re.compile(r'^([^\\n]+\\.[A-Za-z0-9]+)$')
|
|
33
|
+
for tok in tokens:
|
|
34
|
+
if not tok.startswith('-') and path_re.match(tok):
|
|
35
|
+
fp = tok
|
|
36
|
+
break
|
|
37
|
+
if fp:
|
|
38
|
+
print(fp)
|
|
39
|
+
except Exception:
|
|
40
|
+
pass
|
|
41
|
+
" <<< "$STDIN_JSON" 2>/dev/null || echo "")
|
|
42
|
+
if [ -n "$EXTRACTED_PATH" ]; then
|
|
43
|
+
FILE_PATH="$EXTRACTED_PATH"
|
|
44
|
+
fi
|
|
63
45
|
fi
|
|
64
46
|
|
|
65
47
|
FILE_PATH="${FILE_PATH:-${1:-}}"
|
|
@@ -168,7 +168,7 @@ function main(args = process.argv.slice(2)) {
|
|
|
168
168
|
rows.push({ state: scenario.state, expect: scenario.expect, got: `ERROR: ${r.raw}` })
|
|
169
169
|
continue
|
|
170
170
|
}
|
|
171
|
-
const cost = r.data?.cost ?? 0
|
|
171
|
+
const cost = r.data?.data?.cost ?? r.data?.cost ?? 0
|
|
172
172
|
totalCost += Number(cost) || 0
|
|
173
173
|
rows.push({ state: scenario.state, expect: scenario.expect, got: answerChoice(r.data), cost })
|
|
174
174
|
}
|
|
@@ -301,8 +301,22 @@ function hostGate(options) {
|
|
|
301
301
|
const tarball = singleTarball(options)
|
|
302
302
|
const matrix = matrixFromEnv()
|
|
303
303
|
validateMatrix(matrix)
|
|
304
|
+
// PANTHEON_RELEASE_HOST_ONLY lets the workflow run the matrix CONCURRENTLY
|
|
305
|
+
// (one invocation per host — the sandbox roots and ports are already
|
|
306
|
+
// per-index disjoint). The full matrix is validated first; the filter only
|
|
307
|
+
// chooses which rows THIS invocation executes.
|
|
308
|
+
const only = process.env.PANTHEON_RELEASE_HOST_ONLY ?? ''
|
|
309
|
+
const selected = only ? matrix.filter((row) => row.host === only) : matrix
|
|
310
|
+
if (only && selected.length === 0) {
|
|
311
|
+
throw new Error(`PANTHEON_RELEASE_HOST_ONLY="${only}" matches no matrix row`)
|
|
312
|
+
}
|
|
304
313
|
const checks = []
|
|
305
|
-
|
|
314
|
+
selected.forEach((row) => {
|
|
315
|
+
// Port derives from the ORIGINAL matrix index — the concurrent
|
|
316
|
+
// PANTHEON_RELEASE_HOST_ONLY invocations each re-run this gate, and a
|
|
317
|
+
// filtered forEach index would collide both sandboxes on 49380 (field
|
|
318
|
+
// evidence: MCP-handshake timeout on the split-host CI run).
|
|
319
|
+
const matrixIndex = matrix.indexOf(row)
|
|
306
320
|
const root = join(runnerTemp(), `pantheon-release-host-${safeName(row.host)}`)
|
|
307
321
|
rmSync(root, { recursive: true, force: true })
|
|
308
322
|
checks.push(
|
|
@@ -311,12 +325,12 @@ function hostGate(options) {
|
|
|
311
325
|
'bash',
|
|
312
326
|
['scripts/test-opencode-sandbox.sh', '--prepare', '--run', 'v2'],
|
|
313
327
|
{
|
|
314
|
-
env: sandboxEnv(root, row.host, tarball, 49380 +
|
|
328
|
+
env: sandboxEnv(root, row.host, tarball, 49380 + matrixIndex),
|
|
315
329
|
},
|
|
316
330
|
),
|
|
317
331
|
)
|
|
318
332
|
})
|
|
319
|
-
const measuredFamilies = [...new Set(
|
|
333
|
+
const measuredFamilies = [...new Set(selected.map((row) => row.line))]
|
|
320
334
|
const unmeasuredFamilies = SUPPORTED_FAMILIES.filter(
|
|
321
335
|
(family) => !measuredFamilies.includes(family),
|
|
322
336
|
)
|
|
@@ -513,7 +527,7 @@ function metadataGate(options) {
|
|
|
513
527
|
throw new Error(`--version ${options.version} does not match package.json`)
|
|
514
528
|
}
|
|
515
529
|
const stable = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/
|
|
516
|
-
const beta = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-beta\.[1-9]\d*$/
|
|
530
|
+
const beta = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-(?:beta|rc)\.[1-9]\d*$/
|
|
517
531
|
if (!['stable', 'beta'].includes(options.channel)) {
|
|
518
532
|
throw new Error(`unknown channel ${options.channel}`)
|
|
519
533
|
}
|
|
@@ -521,7 +535,7 @@ function metadataGate(options) {
|
|
|
521
535
|
throw new Error(`stable channel requires X.Y.Z, found ${options.version}`)
|
|
522
536
|
}
|
|
523
537
|
if (options.channel === 'beta' && !beta.test(options.version)) {
|
|
524
|
-
throw new Error(`beta channel requires X.Y.Z-beta.N, found ${options.version}`)
|
|
538
|
+
throw new Error(`beta channel requires X.Y.Z-beta.N or X.Y.Z-rc.N, found ${options.version}`)
|
|
525
539
|
}
|
|
526
540
|
const checks = [
|
|
527
541
|
run('version-manifests', 'node', ['scripts/version-check.mjs']),
|
package/scripts/skill-search.mjs
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
import { spawnSync } from 'node:child_process'
|
|
24
24
|
import { pathToFileURL } from 'node:url'
|
|
25
25
|
|
|
26
|
-
const FIND_TIMEOUT_MS =
|
|
26
|
+
const FIND_TIMEOUT_MS = 15_000
|
|
27
27
|
const DEFAULT_LIMIT = 5
|
|
28
28
|
/** SGR escape sequences are matched via the ESC codepoint (lint-clean, same semantics). */
|
|
29
29
|
const ANSI_SGR = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, 'g')
|
|
@@ -119,7 +119,7 @@ export function searchSkills(query, { limit = DEFAULT_LIMIT, owner, spawn = spaw
|
|
|
119
119
|
return { ok: true, entries, raw, emptyIsAmbiguous: false }
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
const GITHUB_TIMEOUT_MS =
|
|
122
|
+
const GITHUB_TIMEOUT_MS = 10_000
|
|
123
123
|
const ANTHROPIC_SKILLS_REPO = 'anthropics/skills'
|
|
124
124
|
|
|
125
125
|
/**
|
|
@@ -220,10 +220,26 @@ export function searchGithubSkills(query, { limit = DEFAULT_LIMIT, spawn = spawn
|
|
|
220
220
|
*/
|
|
221
221
|
export const SKILL_SEARCH_SOURCES = Object.freeze(['anthropic', 'skills-sh', 'github'])
|
|
222
222
|
|
|
223
|
+
const SEARCH_CACHE = new Map()
|
|
224
|
+
const CACHE_TTL_MS = 24 * 60 * 60 * 1000 // 24 hours
|
|
225
|
+
|
|
223
226
|
export function searchSkillSources(
|
|
224
227
|
query,
|
|
225
228
|
{ limit = DEFAULT_LIMIT, owner, sources = SKILL_SEARCH_SOURCES, spawn = spawnSync } = {},
|
|
226
229
|
) {
|
|
230
|
+
const cacheKey = JSON.stringify({
|
|
231
|
+
query: String(query).toLowerCase().trim(),
|
|
232
|
+
limit,
|
|
233
|
+
owner,
|
|
234
|
+
sources,
|
|
235
|
+
})
|
|
236
|
+
if (spawn === spawnSync && SEARCH_CACHE.has(cacheKey)) {
|
|
237
|
+
const cached = SEARCH_CACHE.get(cacheKey)
|
|
238
|
+
if (Date.now() - cached.timestamp < CACHE_TTL_MS) {
|
|
239
|
+
return cached.result
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
227
243
|
const perTier = Math.max(1, Math.ceil(limit / sources.length))
|
|
228
244
|
const out = []
|
|
229
245
|
const failures = []
|
|
@@ -259,7 +275,15 @@ export function searchSkillSources(
|
|
|
259
275
|
if (tier !== 0) return tier
|
|
260
276
|
return installsWeight(left) - installsWeight(right)
|
|
261
277
|
})
|
|
262
|
-
|
|
278
|
+
const finalResult = {
|
|
279
|
+
ok: failures.length < sources.length,
|
|
280
|
+
entries: out.slice(0, limit),
|
|
281
|
+
failures,
|
|
282
|
+
}
|
|
283
|
+
if (spawn === spawnSync && finalResult.ok) {
|
|
284
|
+
SEARCH_CACHE.set(cacheKey, { timestamp: Date.now(), result: finalResult })
|
|
285
|
+
}
|
|
286
|
+
return finalResult
|
|
263
287
|
}
|
|
264
288
|
|
|
265
289
|
function main(args = process.argv.slice(2)) {
|
|
@@ -310,7 +310,7 @@ wait_for_v2_mcp_registrations() {
|
|
|
310
310
|
print_v2_diagnostics
|
|
311
311
|
return 1
|
|
312
312
|
fi
|
|
313
|
-
if SERVICE_LOG="$V2_SERVER_LOG" RUNTIME_DIR="$runtime_dir" MCP_PYTHON="$python_bin" \
|
|
313
|
+
if SERVICE_LOG="$V2_SERVER_LOG" RUNTIME_DIR="$runtime_dir" MCP_PYTHON="$python_bin" RUNTIME_LOG="$LOG_PATH" \
|
|
314
314
|
python3 - <<'PY'
|
|
315
315
|
import os
|
|
316
316
|
import re
|
|
@@ -319,7 +319,7 @@ from pathlib import Path
|
|
|
319
319
|
try:
|
|
320
320
|
log = Path(os.environ["SERVICE_LOG"]).read_text(encoding="utf-8")
|
|
321
321
|
except OSError:
|
|
322
|
-
|
|
322
|
+
log = ""
|
|
323
323
|
expected = {
|
|
324
324
|
"code_mode.py",
|
|
325
325
|
"memory_mcp.py",
|
|
@@ -335,8 +335,8 @@ pattern = re.compile(
|
|
|
335
335
|
re.DOTALL,
|
|
336
336
|
)
|
|
337
337
|
records = list(pattern.finditer(log))
|
|
338
|
-
runtime_dir = os.environ
|
|
339
|
-
python_bin = os.environ
|
|
338
|
+
runtime_dir = os.environ.get("RUNTIME_DIR", "")
|
|
339
|
+
python_bin = os.environ.get("MCP_PYTHON", "")
|
|
340
340
|
registered = set()
|
|
341
341
|
for record in records:
|
|
342
342
|
command = record.group("command")
|
|
@@ -345,11 +345,24 @@ for record in records:
|
|
|
345
345
|
if command != python_bin or cwd != runtime_dir or script not in expected:
|
|
346
346
|
raise SystemExit(1)
|
|
347
347
|
registered.add(script)
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
if
|
|
352
|
-
|
|
348
|
+
if registered == expected:
|
|
349
|
+
raise SystemExit(0)
|
|
350
|
+
runtime_log_path = os.environ.get("RUNTIME_LOG")
|
|
351
|
+
if runtime_log_path and Path(runtime_log_path).is_file():
|
|
352
|
+
try:
|
|
353
|
+
rlog = Path(runtime_log_path).read_text(encoding="utf-8")
|
|
354
|
+
expected_servers = {
|
|
355
|
+
"pantheon-code-mode",
|
|
356
|
+
"pantheon-memory",
|
|
357
|
+
"pantheon-persistence",
|
|
358
|
+
"pantheon-resources",
|
|
359
|
+
"pantheon-vision",
|
|
360
|
+
}
|
|
361
|
+
if all(f'message="mcp connected" server={s}' in rlog for s in expected_servers):
|
|
362
|
+
raise SystemExit(0)
|
|
363
|
+
except OSError:
|
|
364
|
+
pass
|
|
365
|
+
raise SystemExit(1)
|
|
353
366
|
PY
|
|
354
367
|
then
|
|
355
368
|
return 0
|
|
@@ -717,7 +730,7 @@ wait_for_v2_mcp_registrations() {
|
|
|
717
730
|
print_v2_diagnostics
|
|
718
731
|
return 1
|
|
719
732
|
fi
|
|
720
|
-
if SERVICE_LOG="$V2_SERVER_LOG" RUNTIME_DIR="$runtime_dir" MCP_PYTHON="$python_bin" \
|
|
733
|
+
if SERVICE_LOG="$V2_SERVER_LOG" RUNTIME_DIR="$runtime_dir" MCP_PYTHON="$python_bin" RUNTIME_LOG="$LOG_PATH" \
|
|
721
734
|
python3 - <<'PY'
|
|
722
735
|
import os
|
|
723
736
|
import re
|
|
@@ -726,7 +739,7 @@ from pathlib import Path
|
|
|
726
739
|
try:
|
|
727
740
|
log = Path(os.environ["SERVICE_LOG"]).read_text(encoding="utf-8")
|
|
728
741
|
except OSError:
|
|
729
|
-
|
|
742
|
+
log = ""
|
|
730
743
|
expected = {
|
|
731
744
|
"code_mode.py",
|
|
732
745
|
"memory_mcp.py",
|
|
@@ -742,8 +755,8 @@ pattern = re.compile(
|
|
|
742
755
|
re.DOTALL,
|
|
743
756
|
)
|
|
744
757
|
records = list(pattern.finditer(log))
|
|
745
|
-
runtime_dir = os.environ
|
|
746
|
-
python_bin = os.environ
|
|
758
|
+
runtime_dir = os.environ.get("RUNTIME_DIR", "")
|
|
759
|
+
python_bin = os.environ.get("MCP_PYTHON", "")
|
|
747
760
|
registered = set()
|
|
748
761
|
for record in records:
|
|
749
762
|
command = record.group("command")
|
|
@@ -752,8 +765,24 @@ for record in records:
|
|
|
752
765
|
if command != python_bin or cwd != runtime_dir or script not in expected:
|
|
753
766
|
raise SystemExit(1)
|
|
754
767
|
registered.add(script)
|
|
755
|
-
if
|
|
756
|
-
raise SystemExit(
|
|
768
|
+
if registered == expected:
|
|
769
|
+
raise SystemExit(0)
|
|
770
|
+
runtime_log_path = os.environ.get("RUNTIME_LOG")
|
|
771
|
+
if runtime_log_path and Path(runtime_log_path).is_file():
|
|
772
|
+
try:
|
|
773
|
+
rlog = Path(runtime_log_path).read_text(encoding="utf-8")
|
|
774
|
+
expected_servers = {
|
|
775
|
+
"pantheon-code-mode",
|
|
776
|
+
"pantheon-memory",
|
|
777
|
+
"pantheon-persistence",
|
|
778
|
+
"pantheon-resources",
|
|
779
|
+
"pantheon-vision",
|
|
780
|
+
}
|
|
781
|
+
if all(f'message="mcp connected" server={s}' in rlog for s in expected_servers):
|
|
782
|
+
raise SystemExit(0)
|
|
783
|
+
except OSError:
|
|
784
|
+
pass
|
|
785
|
+
raise SystemExit(1)
|
|
757
786
|
PY
|
|
758
787
|
then
|
|
759
788
|
return 0
|
package/scripts/update.mjs
CHANGED
|
@@ -171,9 +171,16 @@ export function runUpdate(
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
const globalEntry = path.join(refreshedPackageRoot, 'bin', 'pantheon-init.mjs')
|
|
174
|
+
const forwardedFlags = []
|
|
175
|
+
if (args.includes('--project')) forwardedFlags.push('--project')
|
|
176
|
+
if (args.includes('--no-mcp')) forwardedFlags.push('--no-mcp')
|
|
177
|
+
if (args.includes('--verbose')) forwardedFlags.push('--verbose')
|
|
178
|
+
|
|
174
179
|
const init = refresh
|
|
175
|
-
? refresh(globalEntry)
|
|
176
|
-
: spawnSync(execPath, [globalEntry, 'init', '--yes', '--headless'], {
|
|
180
|
+
? refresh(globalEntry, forwardedFlags)
|
|
181
|
+
: spawnSync(execPath, [globalEntry, 'init', '--yes', '--headless', ...forwardedFlags], {
|
|
182
|
+
stdio: 'inherit',
|
|
183
|
+
})
|
|
177
184
|
if (init.status !== 0 || init.error) {
|
|
178
185
|
console.error(
|
|
179
186
|
'⚠️ Updated, but the config refresh did not complete — run `npx pantheon-opencode init` manually.',
|
package/skills-lock.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"src/skills/code-review-checklist/SKILL.md": "cdca3dbd7393cd8b379297be8bf68d456e7217b0238eaeea13b35a96d553414f",
|
|
11
11
|
"src/skills/codemap/SKILL.md": "d21b3fa66b931b29dcf1ec0f0fcf1ec28514642a9f33f96e4b2901a0be74c72d",
|
|
12
12
|
"src/skills/context-compression/SKILL.md": "4d8368309ec72fefac69ad5cddd43650647d0bc684b6f8bf3cacc004edb56ef5",
|
|
13
|
+
"src/skills/fast-path-execution/SKILL.md": "040bb97ac5d930dcee47d5d0e2fc1ef637a4762998990475d876ec7f17977c69",
|
|
13
14
|
"src/skills/git-workflow-and-versioning/SKILL.md": "685a94041f1b4ce2a430301f517b89102055696267c369a7e8fb191606659276",
|
|
14
15
|
"src/skills/incremental-implementation/SKILL.md": "7065ddb45da3c6b6751de07f290e92e6cb072e949a2e3aaae13ee7762f0a70fc",
|
|
15
16
|
"src/skills/instruction-forge/references/agents-md-doctrine.md": "23623cc40e830ba5f2f11b7b005e85b3f4d260428f1c31cb9840e7b9baa81360",
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"src/skills/memory-bank/references/storage-model.md": "728a9e5f2055ce0f74c759405072a6fe57f65587bdb7b9e5e7fa90b60528b085",
|
|
23
24
|
"src/skills/memory-bank/references/structure-and-frequency.md": "09caedf905870c688401a2e58b2776a9c6187fe724c576019c58c3b80fe1b98f",
|
|
24
25
|
"src/skills/memory-bank/SKILL.md": "047b3049c27e908b1d79afb14f79336e32f775385ba23956771166d445944f2f",
|
|
25
|
-
"src/skills/prompt-refinery/SKILL.md": "
|
|
26
|
+
"src/skills/prompt-refinery/SKILL.md": "1efbe6700dbcf357c1eab38662ff9572b163abb262915ce615694829682922c5",
|
|
26
27
|
"src/skills/reflect/SKILL.md": "297c374f1fbc8e15d3848f51e811e0614d4a008c7d0e1daf88bbb240d605b8a8",
|
|
27
28
|
"src/skills/security-hardening/SKILL.md": "6d637e122421f7bc3b751f04854ad343a5a5d35249458bc8939233138fd3f20d",
|
|
28
29
|
"src/skills/session-goal/references/goal-format.md": "071f6f8f12cfbc26d4703cd5f34f839f91e586a3b969bf5f81a74b961c254a83",
|
|
@@ -32,8 +33,9 @@
|
|
|
32
33
|
"src/skills/spec-driven-development/SKILL.md": "ccfbc0c32116a1d144f5c12a4187c053322ed31625a622a58c59739a57a86743",
|
|
33
34
|
"src/skills/tdd-with-agents/references/advanced-testing-patterns.md": "4aac82748bb670a61d67732168f8a265d5e66895a9183029e3da03de8e024788",
|
|
34
35
|
"src/skills/tdd-with-agents/references/testing-by-layer.md": "545291301661e57d846b2db2acca1edb1219a102dce4aad7e0c3cc1a250b570a",
|
|
35
|
-
"src/skills/tdd-with-agents/SKILL.md": "
|
|
36
|
-
"src/skills/
|
|
36
|
+
"src/skills/tdd-with-agents/SKILL.md": "825d5e5eadbe487db382918a2181a4a993d8f722c38bd7f104f89b00004d6223",
|
|
37
|
+
"src/skills/test-slicing/SKILL.md": "ff70cddc66261049250b82f7aeabbfd6bcd00f9abe34cc8d5f20aa35333b1590",
|
|
38
|
+
"src/skills/verification-planning/SKILL.md": "6a3c6cb5bd5076862d369885bf0b3ba086b625495fe7a42f3f5116d07b470f3e",
|
|
37
39
|
"src/skills/visual-review-pipeline/references/findings-schema.md": "776511757c0d8387fab232fced8ac9ce031a03f62b6ca539e3c38b0d45035c8e",
|
|
38
40
|
"src/skills/visual-review-pipeline/references/workflow-steps.md": "1f763f39d9218263bfb10f575d739d9eb62d89cd9f00d38c21cd729b078b44c8",
|
|
39
41
|
"src/skills/visual-review-pipeline/SKILL.md": "7f66f0426868535db891bccd8e21c719b7dcbb16625ea75edbf436ccb1896ac1",
|
package/src/agents/aphrodite.md
CHANGED
|
@@ -16,11 +16,13 @@ permission:
|
|
|
16
16
|
"*": deny
|
|
17
17
|
temperature: 0.3
|
|
18
18
|
skills:
|
|
19
|
+
- fast-path-execution
|
|
19
20
|
- incremental-implementation
|
|
20
21
|
- loop-engineering
|
|
21
22
|
- reflect
|
|
22
23
|
- simplify
|
|
23
24
|
- tdd-with-agents
|
|
25
|
+
- test-slicing
|
|
24
26
|
- visual-review-pipeline
|
|
25
27
|
- worktrees
|
|
26
28
|
mcp_tools:
|
package/src/agents/apollo.md
CHANGED
|
@@ -30,7 +30,7 @@ mcp_tools:
|
|
|
30
30
|
pantheon-memory: [memory_search, code_query, code_neighbors]
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## When NOT to Use Apollo
|
|
34
34
|
- When you already know the exact file path — read it directly
|
|
35
35
|
- When you need to modify files — Apollo is read-only
|
|
36
36
|
- When the search can be done with a simple grep/glob — use direct tools instead
|
|
@@ -61,209 +61,6 @@ mcp_tools:
|
|
|
61
61
|
|
|
62
62
|
## Core Capabilities
|
|
63
63
|
|
|
64
|
-
### 1. **Test-Driven Development**
|
|
65
|
-
See `skill: tdd-with-agents` for the full TDD cycle.
|
|
66
|
-
|
|
67
|
-
### 2. **Context Conservation**
|
|
68
|
-
- Focus ONLY on files you're modifying
|
|
69
|
-
- Don't re-read entire project architecture
|
|
70
|
-
- Return summaries of your changes
|
|
71
|
-
- Ask the Orchestrator only when missing context or a material choice blocks safe progress
|
|
72
|
-
|
|
73
|
-
### 3. **Proper Handoffs**
|
|
74
|
-
- Use a supplied plan when one exists; do not require one for bounded work
|
|
75
|
-
- Ask a clarifying question only when ambiguity blocks a safe implementation
|
|
76
|
-
- Return clear, structured results
|
|
77
|
-
- Report readiness for next phase
|
|
78
|
-
|
|
79
|
-
### 4. **Parallel Execution Mode**
|
|
80
|
-
- Zeus may dispatch @aphrodite and @demeter in parallel on independent scopes; a Hermes child session works only its assigned scope and reports coordination needs to Zeus
|
|
81
|
-
- Your scope: backend files only (routers, services, tests)
|
|
82
|
-
- Signal clearly when done; preserve Themis review for security/auth, data/schema, and material changes
|
|
83
|
-
- Do NOT wait for other workers to finish before starting your work
|
|
84
|
-
|
|
85
|
-
## Search Policy
|
|
86
|
-
- Investigate beyond the assigned context only when necessary to resolve the task or when broader discovery materially reduces risk; verify changed behavior proportionally to its scope and risk, using focused checks for bounded changes and broader checks only when integration boundaries or risk warrant them.
|
|
87
|
-
- You do NOT perform web searches directly
|
|
88
|
-
- Inspect relevant files directly; only a root Hermes session may delegate discovery to @apollo when broad/unfamiliar discovery materially reduces risk. A child session has a parent and must not dispatch another Pantheon agent; report wider discovery needs to Zeus.
|
|
89
|
-
- For library documentation → Context7 is allowed for library documentation (FastAPI, SQLAlchemy, Pydantic)
|
|
90
|
-
- For web research → a root Hermes may delegate to @apollo; a child session asks Zeus to route it
|
|
91
|
-
- Only use `webfetch` for specific URLs you already know (not for general search)
|
|
92
|
-
|
|
93
|
-
## MCP Security: PostgreSQL
|
|
94
|
-
|
|
95
|
-
> **Risk level: HIGH** — Read-only query capability, but injection still possible.
|
|
96
|
-
|
|
97
|
-
### Parameterized Query Mandate
|
|
98
|
-
- **NEVER** use f-strings, `format()`, or `+` concatenation for SQL query construction
|
|
99
|
-
- **ALWAYS** use parameterized queries:
|
|
100
|
-
```python
|
|
101
|
-
# [OK] SAFE — parameterized
|
|
102
|
-
psql_query("SELECT * FROM products WHERE id = $1", [product_id])
|
|
103
|
-
|
|
104
|
-
# [FAIL] UNSAFE — string interpolation
|
|
105
|
-
psql_query(f"SELECT * FROM products WHERE id = {product_id}")
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### Read-Only Constraint
|
|
109
|
-
- `postgresql_query` for SELECT only — NEVER for DDL, INSERT, UPDATE, DELETE, or EXECUTE
|
|
110
|
-
- If write access is needed, ask Zeus to route the database work to **@demeter** (they have `postgresql_execute` with stricter controls); a child session does not dispatch it directly.
|
|
111
|
-
|
|
112
|
-
### Verify Query Before Execution
|
|
113
|
-
- Check the SQL string for string interpolation patterns (`f"`, `.format(`, `+`)
|
|
114
|
-
- If any found, rewrite with parameterized syntax before executing
|
|
115
|
-
|
|
116
|
-
## Core Responsibilities
|
|
117
|
-
|
|
118
|
-
### 1. FastAPI Endpoints & Routers
|
|
119
|
-
- Create async endpoints with proper HTTP methods (GET, POST, PUT, PATCH, DELETE)
|
|
120
|
-
- Implement routers for domain logic (auth, media, products, offers, etc.)
|
|
121
|
-
- Use Pydantic schemas for request/response validation
|
|
122
|
-
- Apply dependency injection for database sessions, authentication
|
|
123
|
-
- Implement pagination, filtering, sorting in list endpoints
|
|
124
|
-
|
|
125
|
-
### 2. Service Layer Architecture
|
|
126
|
-
- Build service classes with business logic isolated from routers
|
|
127
|
-
- Implement service methods: `create`, `read`, `update`, `delete`, `list`, `search`
|
|
128
|
-
- Use async/await for I/O operations (database, external APIs)
|
|
129
|
-
- Handle errors gracefully with FastAPI HTTPException
|
|
130
|
-
- Integrate with external services (Gemini AI, R2 storage, Telegram)
|
|
131
|
-
|
|
132
|
-
### 3. Integration Points
|
|
133
|
-
- **Database**: SQLAlchemy async sessions via dependency injection
|
|
134
|
-
- **Cache**: Caching layer (e.g., Redis) for session management and API caching
|
|
135
|
-
- **Storage**: Object storage for media uploads (e.g., S3, R2, GCS)
|
|
136
|
-
- **External APIs**: REST/gRPC integrations (AI services, payment, messaging, etc.)
|
|
137
|
-
|
|
138
|
-
### 4. Security & Performance
|
|
139
|
-
- JWT authentication with httpOnly cookies
|
|
140
|
-
- CSRF protection via middleware
|
|
141
|
-
- Rate limiting for public endpoints
|
|
142
|
-
- Input validation and sanitization
|
|
143
|
-
- Query optimization (avoid N+1 problems)
|
|
144
|
-
- Async operations for concurrent requests
|
|
145
|
-
|
|
146
|
-
## Project Context
|
|
147
|
-
|
|
148
|
-
> **Adopt this agent for your product:** Replace this section with your project's specific routers, services, and models. Store durable reusable facts through `pantheon-memory` when warranted and when the tool is granted, or reference project documentation under `.pantheon/memory-bank/`, which is read on demand rather than auto-loaded.
|
|
149
|
-
|
|
150
|
-
## Implementation Process
|
|
151
|
-
|
|
152
|
-
When creating a new feature:
|
|
153
|
-
|
|
154
|
-
1. **Router First**: Create endpoint in appropriate router file
|
|
155
|
-
```python
|
|
156
|
-
@router.post("", response_model=ResponseSchema)
|
|
157
|
-
async def create_item(
|
|
158
|
-
data: CreateSchema,
|
|
159
|
-
db: AsyncSession = Depends(get_db),
|
|
160
|
-
current_user: User = Depends(get_current_user)
|
|
161
|
-
):
|
|
162
|
-
service = ItemService(db)
|
|
163
|
-
return await service.create(data)
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
2. **Service Layer**: Implement business logic
|
|
167
|
-
```python
|
|
168
|
-
class ItemService:
|
|
169
|
-
def __init__(self, db: AsyncSession):
|
|
170
|
-
self.db = db
|
|
171
|
-
|
|
172
|
-
async def create(self, data: CreateSchema) -> Item:
|
|
173
|
-
# Validation, business logic, persistence
|
|
174
|
-
pass
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
3. **Error Handling**: Use FastAPI exceptions
|
|
178
|
-
```python
|
|
179
|
-
if not item:
|
|
180
|
-
raise HTTPException(status_code=404, detail="Item not found")
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
4. **Testing**: Write unit tests in `backend/tests/`
|
|
184
|
-
|
|
185
|
-
## Code Quality Standards
|
|
186
|
-
|
|
187
|
-
> See instructions/backend-standards.instructions.md for the complete backend standards.
|
|
188
|
-
|
|
189
|
-
## Modern Python & Dependency Hygiene
|
|
190
|
-
|
|
191
|
-
### Obsolete Library Detection
|
|
192
|
-
When adding or changing dependencies, check for obsolete/deprecated libraries and audit the affected dependency set. Do not run dependency-audit tools for an unrelated one-line or documentation fix:
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
# Detect stdlib backports, zombie shims, deprecated packages
|
|
196
|
-
pip install dep-audit && dep-audit . --exit-code
|
|
197
|
-
|
|
198
|
-
# Scan for known CVEs in dependencies
|
|
199
|
-
pip-audit -r requirements.txt
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
**Common Python stdlib replacements (use these instead of third-party):**
|
|
203
|
-
| Obsolete | Modern stdlib | Since |
|
|
204
|
-
|----------|--------------|-------|
|
|
205
|
-
| `pytz` | `zoneinfo.ZoneInfo` | Python 3.9 |
|
|
206
|
-
| `tomli` | `tomllib` | Python 3.11 |
|
|
207
|
-
| `six`, `future` | native Python 3 syntax | Python 3.0+ |
|
|
208
|
-
| `dataclasses` backport | `dataclasses` stdlib | Python 3.7+ |
|
|
209
|
-
| `typing_extensions` (most) | `typing` stdlib | Python 3.9-3.11+ |
|
|
210
|
-
| `importlib_metadata` | `importlib.metadata` | Python 3.8+ |
|
|
211
|
-
| `contextlib2` | `contextlib` stdlib | Python 3.7+ |
|
|
212
|
-
| `mock` (PyPI) | `unittest.mock` | Python 3.3+ |
|
|
213
|
-
|
|
214
|
-
### LTS & Modern Version Policy
|
|
215
|
-
- Always pin dependencies to **LTS-compatible versions**
|
|
216
|
-
- Prefer latest **stable major version**: FastAPI ≥0.110, Pydantic ≥2.7, SQLAlchemy ≥2.0
|
|
217
|
-
- Never use EOL Python versions (3.8 and below are unsupported)
|
|
218
|
-
- Check `pip-audit` output to ensure no vulnerable deps
|
|
219
|
-
- Use `ruff check --select UP` to auto-migrate to modern Python syntax
|
|
220
|
-
- Prefer `pyproject.toml` over `setup.py` for project metadata
|
|
221
|
-
|
|
222
|
-
## Documentation Policy
|
|
223
|
-
|
|
224
|
-
Use artifact-management only for planned multi-phase or materially risky work. A bounded fix needs no IMPL artifact; return the structured summary instead. Never create permanent ADRs directly.
|
|
225
|
-
|
|
226
|
-
**Artifact Protocol Reference:** `skill: artifact-management`
|
|
227
|
-
|
|
228
|
-
## Pre-Implementation Recall
|
|
229
|
-
Use supplied memory/ADR context when relevant. Do not block a bounded fix on a separate memory-bank recall or repeat searches that do not change the implementation.
|
|
230
|
-
|
|
231
|
-
## When to Delegate
|
|
232
|
-
|
|
233
|
-
- **@apollo**: Only a root Hermes session may dispatch Apollo for broad/unfamiliar discovery that materially reduces risk; a child session reports that need to Zeus and inspects assigned context directly otherwise
|
|
234
|
-
- **@mnemosyne**: For permanent ADRs or substantial memory-bank artifacts, not routine summaries
|
|
235
|
-
- **@themis**: Required for auth/security, data/schema, and material changes; request required review through Zeus, who dispatches Themis from root. Do not create a separate review phase for a trivial isolated fix
|
|
236
|
-
- **@aphrodite / @demeter / **: Route through **Zeus** — Hermes cannot directly invoke these agents
|
|
237
|
-
|
|
238
|
-
## Output Format
|
|
239
|
-
|
|
240
|
-
When completing a task, provide:
|
|
241
|
-
- [OK] Complete router code with all endpoints
|
|
242
|
-
- [OK] Service implementation with business logic
|
|
243
|
-
- [OK] Pydantic schemas (request/response)
|
|
244
|
-
- [OK] Error handling and validation
|
|
245
|
-
- [OK] Docstrings explaining functionality
|
|
246
|
-
- [OK] Example curl commands for testing
|
|
247
|
-
- [OK] Unit test skeleton (optional)
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
**Philosophy**: Clean code, clear error messages, proper async patterns, thorough testing.
|
|
252
|
-
|
|
253
|
-
## Verification Tiers (match the change, not a ritual)
|
|
254
|
-
|
|
255
|
-
- **Small bounded fix** (typo, config, copy, single-function tweak): make the change, run the one targeted test or command that proves it, report. No RED→GREEN→REFACTOR ceremony, no extra discovery passes.
|
|
256
|
-
- **Material change** (new endpoint, schema, service, auth, public behavior): full TDD cycle via `skill: tdd-with-agents`, then the Themis handoff.
|
|
257
|
-
- Auto-continue through the chosen tier for authorized work; stop for required Themis review; stop and diagnose when tests fail unexpectedly; no partial results.
|
|
258
|
-
|
|
259
|
-
## Skills
|
|
260
|
-
Implementação: `tdd-with-agents`, `incremental-implementation`, `code-review-checklist`, `git-workflow-and-versioning`
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
- **Code-mode / infrastructure reads** — cheap and on demand; never for decisions the ladder already answers.
|
|
264
|
-
|
|
265
|
-
## Core Capabilities
|
|
266
|
-
|
|
267
64
|
### 1. Codebase Discovery
|
|
268
65
|
- Use direct targeted searches for straightforward questions; batch independent searches only when the discovery scope benefits from it
|
|
269
66
|
- Search for files, patterns, symbols, imports
|
|
@@ -282,13 +79,18 @@ Implementação: `tdd-with-agents`, `incremental-implementation`, `code-review-c
|
|
|
282
79
|
- Identify architecture patterns and tech debt signals
|
|
283
80
|
- Return hierarchical summaries (60-70% token savings vs raw file reads)
|
|
284
81
|
|
|
285
|
-
##
|
|
82
|
+
## TOOLS NOT AVAILABLE
|
|
286
83
|
- bash - forbidden (cannot run commands)
|
|
287
84
|
- edit - forbidden (read-only agent)
|
|
288
85
|
- Web search by default - no search MCP is bundled or pre-configured. Use one
|
|
289
86
|
ONLY if the user's own config exposes it; otherwise state that external search
|
|
290
87
|
was unavailable instead of improvising.
|
|
291
88
|
|
|
89
|
+
## Pragmatism and Non-Destructive Inspection
|
|
90
|
+
- Diagnostic operations (reading files, targeted webfetch for documentation/status, symbol search) are inherently safe and non-destructive.
|
|
91
|
+
- Do not debate hypothetical side-effects (e.g. click counting, redirect chains) or invent reasons to avoid inspecting what was requested.
|
|
92
|
+
- Focus on returning objective findings directly, without paralysis over capabilities.
|
|
93
|
+
|
|
292
94
|
## MCP Security
|
|
293
95
|
- Never embed credentials in URLs (grep for token=, key=, secret=)
|
|
294
96
|
- Use environment variables for auth
|
|
@@ -302,7 +104,7 @@ Return structured findings with:
|
|
|
302
104
|
- **summary:** What was found
|
|
303
105
|
- **confidence:** high | medium | low
|
|
304
106
|
|
|
305
|
-
##
|
|
107
|
+
## Auto-Continue (Embedded: Discovery)
|
|
306
108
|
|
|
307
109
|
- Continue through independent discovery queries when more evidence is needed; use only the breadth justified by the request
|
|
308
110
|
- Partial results OK on timeout — return whatever is found
|