一键导入
bridge
Trinity Bridge manual — architecture, endpoints, commands, patterns for Perplexity-Railway-Mac-Claude Code channel. Reference for all AI agents.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Trinity Bridge manual — architecture, endpoints, commands, patterns for Perplexity-Railway-Mac-Claude Code channel. Reference for all AI agents.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate Zig or Verilog code from VIBEE specifications. Use when creating or updating .tri specs and regenerating code.
GOD MODE — Agent monitoring dashboard. Shows swarm status, task queue, pipeline compliance, circuit breakers, git activity, and rule violations.
Generate Zig or Verilog code from VIBEE specifications. Use when creating or updating .tri specs and regenerating code.
HEALER — diagnose, heal, commit dirty files, monitor junk & docs & duplicates, report honestly. Every loop = action + proof.
Agent swarm development dashboard — live Railway containers, issue queue, PR pipeline, JSONL events, pool utilization, and queue drain status. Use when checking agent dev tasks, spawning status, or monitoring issues #315-#319.
Trinity Arena 2.0 — LLM Battle Platform dashboard. Live leaderboard, battle history, scientific metrics, deploy to Railway.
| name | bridge |
| description | Trinity Bridge manual — architecture, endpoints, commands, patterns for Perplexity-Railway-Mac-Claude Code channel. Reference for all AI agents. |
| argument-hint | ["status|test|manual"] |
| allowed-tools | Bash(curl *), Bash(pgrep *), Bash(tail *), Bash(cat *), Bash(echo *), Bash(date *), Read |
AI Agent (Perplexity/other)
|
| GET /px/exec?cmd=<command>&token=<TOKEN>
v
Railway Server (trinity-production-a1d4.up.railway.app)
| perplexity_bridge.zig -> creates job -> queue
v
Mac Bridge Agent (tri-bridge-agent.sh, PID on Mac)
| poll every 3s -> picks up job
| if cmd starts with "claude:" -> env -u CLAUDECODE claude --print "<prompt>"
| else -> shell exec (diag, status, build, test...)
v
Claude Code (autonomous session, timeout 600s)
| executes prompt -> stdout
v
Bridge Agent -> POST /px/done -> result saved
v
AI Agent -> GET /px/result?id=<job_id> -> reads result
https://trinity-production-a1d4.up.railway.app
PX_BRIDGE_TOKEN=<TOKEN> # Set via env var or Railway secret
| Endpoint | Method | Description | Example |
|---|---|---|---|
/px/status | GET | Server health + queue | ?token=TOKEN |
/px/exec | GET | Submit command | ?cmd=diag&token=TOKEN |
/px/jobs | GET | List all jobs | ?token=TOKEN |
/px/result | GET | Result of specific job | ?id=JOB_ID&token=TOKEN |
/px/done | POST | Write result (bridge-agent) | body: raw text, id+exit in query |
| Command | What it does | When to use |
|---|---|---|
diag | zig build + compile rate + dirty files | Quick health check |
status | git status --short + git log -5 | What changed? |
build | zig build 2>&1 | Check compilation |
test | zig build test 2>&1 | Run tests |
issues | gh issue list --limit 20 | List open issues |
log | git log --oneline -20 | Recent commits |
branch | git branch --show-current | Current branch |
help | List available commands | Help |
Format: claude:<prompt>
| Example | What it does |
|---|---|
claude:Fix 5 broken specs | Find and fix broken specs |
claude:Run /scholar scan | Launch Scholar research |
claude:Run /scholar full | Full Scholar cycle |
claude:Run /scholar topic:"quantum computing" | Deep research on topic |
claude:Execute Protocol v2 on issue 79 | Full development cycle |
claude:Run /tri | Full system diagnostic |
claude:git add -A && git commit -m "msg" && git push | Commit and push |
To create a feature via Claude Code:
claude:Execute Protocol v2 on issue {N}.
Create sub-issues RESEARCH PLAN IMPLEMENT TEST VERIFY.
Implement code, run tests, close all sub-issues.
Phases:
| Command | Action |
|---|---|
/scholar scan | Scan: open issues + broken specs + TODOs -> call perplexity_research MCP |
/scholar eval | Evaluate findings: HIGH (>0.8) / MEDIUM (>0.5) / LOW |
/scholar apply | HIGH -> gh issue create, MEDIUM -> MU DB, LOW -> archive |
/scholar full | scan -> eval -> apply sequentially |
/scholar errors | Focus on current compile failures |
/scholar report | Show cached results (no API calls) |
/scholar topic:"query" | Deep research on specific topic |
Via bridge:
/px/exec?cmd=claude:Run /scholar full&token=TOKEN
1. GET /px/exec?cmd=diag -> compile rate, dirty files
2. GET /px/result?id=<id> -> read result
3. If compile < 90% -> send fix command
4. If dirty > 0 -> send commit command
1. GET /px/exec?cmd=claude:Find and fix all zig ast-check failures. Commit fixes.
2. Wait 5-10 min
3. GET /px/result?id=<id> -> read what was fixed
4. GET /px/exec?cmd=diag -> confirm new compile rate
1. GET /px/exec?cmd=claude:Run /scholar full
2. Wait 10-15 min
3. GET /px/exec?cmd=issues -> see new research issues
1. GET /px/exec?cmd=claude:Execute Protocol v2 on issue {N}
2. Wait 10-30 min
3. GET /px/result?id=<id> -> status
4. GET /px/exec?cmd=diag -> build health after changes
| Error | Cause | Solution |
|---|---|---|
{"error":"unknown command"} | Command not in whitelist | Use claude: prefix |
404 on /px/result | Job cleaned or doesn't exist | Job may have expired, resend |
status: pending | Bridge-agent not running on Mac | Start: ./deploy/tri-bridge-agent.sh |
nested session error | CLAUDECODE env var not unset | In agent.sh: env -u CLAUDECODE |
timeout | Claude Code thinking >600s | Break task into smaller pieces |
failed to post result | Railway didn't accept POST | Check /px/done endpoint |
Empty /px/jobs | Railway redeploy cleared queue | Normal — send new job |
GET /px/status -> {"status":"ok","queue_pending":N,"queue_running":N}
| Component | Check | Expected |
|---|---|---|
| Railway Server | GET /px/status | {"status":"ok"} |
| Bridge Agent | pgrep -f tri-bridge-agent on Mac | PID exists |
| Claude Code | Send claude:echo hello | Result: "hello" |
| Perplexity MCP | claude:Run perplexity_search "test" | Search results |
| GitHub Board | https://github.com/users/gHashTag/projects/6 | Issues visible |
https://github.com/gHashTag/trinity
https://github.com/users/gHashTag/projects/6/views/1
| Column | Meaning |
|---|---|
| Backlog | New/pending issues |
| Ready | P0/P1, ready to work |
| In Progress | Currently in development |
| In Review | Code written, needs review |
| Done | Closed and verified |
| Label | Meaning |
|---|---|
| P0 | Critical priority |
| P1 | High priority |
| P2 | Medium priority |
| agent:ralph | For Ralph Agent |
| agent:mu | For MU Agent |
| agent:swarm | For Swarm Agent |
| research:high | Scholar finding, high relevance |
| Agent | Role | How to invoke |
|---|---|---|
| Ralph | Engineer — build, fix, implement | claude:Execute Protocol v2 on issue N |
| Scholar | Researcher — search, analyze | claude:Run /scholar scan |
| MU | Memory — error patterns, learning | claude:Run /tri (MU section) |
| Oracle | phi-Analyst — metrics, harmony | claude:Run /tri (Oracle section) |
| Swarm | Coordinator — task decomposition | claude:tri swarm run N |
| Linter | QA — vibee check, ast-check | claude:zig build 2>&1 |
| Bridge | Comms — Perplexity <-> Trinity | /px/status |
| Metric | Command | Target |
|---|---|---|
| Compile Rate | diag -> COMPILE:X/Y | >= 90% |
| Build Status | build | EXIT:0 |
| Dirty Files | diag -> DIRTY:N | 0 |
| Open Issues | issues | Decreasing |
| Task Success | /tri -> job success % | > 50% |
| V (Oracle) | phi * (compile%)^2 | -> 1.618 (phi) |
Spaces in commands:
+ -> space (preferred)%20 -> space%3A -> : (for claude:)Full URL example:
https://trinity-production-a1d4.up.railway.app/px/exec?cmd=claude:Fix+broken+specs&token=TOKEN
+-----------------------------------------------------+
| AGI LOOP (24h) |
| |
| 06:00 UTC Scholar /scholar full |
| | -> scan -> eval -> apply |
| v |
| 06:30 UTC New research issues on board |
| | |
| v |
| 07:00 UTC Ralph: Protocol v2 on each HIGH issue |
| | -> RESEARCH -> PLAN -> IMPLEMENT -> TEST |
| v |
| 12:00 UTC MU: analyze morning errors |
| | -> update Learning DB |
| v |
| 18:00 UTC Scholar /scholar errors |
| | -> fix what broke |
| v |
| 00:00 UTC Diag -> report -> Telegram |
| | -> daily metrics |
| v |
| Repeat |
+-----------------------------------------------------+
If $ARGUMENTS is provided:
status — Run quick bridge health check: curl /px/status, pgrep bridge-agent, show resultstest — Send a test command (claude:echo bridge test ok) and poll for resultmanual — Display this full manualDefault (no args): show status.