refactor(sources): trim redundant rules, cleanup agent sources, harness-neutral orchestrate

- Drop rules/02-responses.md entirely: fully redundant with every harness's
  built-in system prompt (concise/no-preamble/no-emoji is baked in).
- Trim 04-tools.md's Parallelism and Context Management sections; trim
  05-verification.md's "run tests" bullet. All covered by harness defaults.
- Scope 01-session.md to claude only (memory/ hierarchy is Claude-specific).
- Update schemas/team.schema.json const-pin to match the new rules.order.
- Strip vestigial Claude-style YAML frontmatter from agents/*.md sources
  (extract_body was already discarding it; TEAM.yaml is the real source).
- Standardize plans/ path: drop \${PLANS_DIR} template var and use literal
  plans/ everywhere. Claude/codex/opencode now share one plans convention.
- Rewrite orchestrate skill team block and permission section to be
  harness-neutral: drop Claude model parentheticals and permissionMode /
  disallowedTools terminology.
- Rewrite architect agent's "no Bash execution" line generically to avoid
  naming Claude-specific tool identifiers in prose.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Ramos 2026-04-14 11:11:23 -04:00
parent 6eff5326d2
commit 26d004fe46
16 changed files with 34 additions and 213 deletions

View file

@ -263,7 +263,7 @@ map_portable_tool_to_claude() {
# map_model_to_opencode — all models map to the single local model
# ---------------------------------------------------------------------------
map_model_to_opencode() {
echo "llama.cpp/qwen3-coder:a3b"
echo "llama-stack/llamacpp/Qwen3-Coder-30B-A3B-Instruct-Q8_0"
}
# ---------------------------------------------------------------------------
@ -284,11 +284,7 @@ map_effort_to_temperature() {
# map_permission_mode_to_opencode_mode — maps permission mode to agent mode
# ---------------------------------------------------------------------------
map_permission_mode_to_opencode_mode() {
local permission_mode="$1"
case "$permission_mode" in
plan) echo "subagent" ;;
*) echo "primary" ;;
esac
echo "subagent"
}
# ---------------------------------------------------------------------------
@ -302,43 +298,30 @@ generate_opencode_permission_block() {
local disallowed_tools="$2"
local permission_mode="$3"
# Helper: is CLAUDE tool $1 present in $tools and not in $disallowed_tools?
tool_allowed() {
local t="$1"
echo "$tools" | grep -qE "\b${t}\b" || return 1
echo "$disallowed_tools" | grep -qE "\b${t}\b" && return 1
return 0
}
local write_perm="deny"
local edit_perm="deny"
local bash_perm="deny"
local webfetch_perm="deny"
if [ "$permission_mode" = "plan" ]; then
# Plan-mode agents: read-only, no edits, no bash
edit_perm="deny"
bash_perm="deny"
# Researchers/reviewers still need web access
if echo "$tools" | grep -qE '\bWebFetch\b|\bWebSearch\b'; then
webfetch_perm="allow"
fi
else
# Check edit permission
if echo "$tools" | grep -qE '\bWrite\b|\bEdit\b'; then
edit_perm="allow"
fi
if echo "$disallowed_tools" | grep -qE '\bWrite\b|\bEdit\b'; then
edit_perm="deny"
fi
tool_allowed "Write" && write_perm="allow"
tool_allowed "Edit" && edit_perm="allow"
tool_allowed "Bash" && bash_perm="ask"
# Check bash permission
if echo "$tools" | grep -q '\bBash\b'; then
bash_perm="ask"
fi
if echo "$disallowed_tools" | grep -q '\bBash\b'; then
bash_perm="deny"
fi
# Check web permission
if echo "$tools" | grep -qE '\bWebFetch\b|\bWebSearch\b'; then
webfetch_perm="allow"
fi
if tool_allowed "WebFetch" || tool_allowed "WebSearch"; then
webfetch_perm="allow"
fi
echo "permission:"
echo " edit: ${edit_perm}"
echo " write: ${write_perm}"
if [ "$bash_perm" = "ask" ]; then
echo " bash:"
@ -346,7 +329,7 @@ generate_opencode_permission_block() {
echo " \"git status\": allow"
echo " \"git diff *\": allow"
echo " \"git log *\": allow"
elif [ "$bash_perm" = "deny" ]; then
else
echo " bash:"
echo " \"*\": deny"
fi