Skip to content

Commit 6979b34

Browse files
Antigravity Agentclaude
andcommitted
feat(tree): Tech Tree skill + issue-linked bridge commands
- /tree — full dependency DAG with prereqs and statuses - /tree next — READY tasks (all prereqs met) - /tree path — critical path to v1.0 - /tree blocked — blocked tasks and blockers - .trinity/tech_tree.json — initial tree definition - bridge-agent: parse #N from claude commands, post result as issue comment - Auto-track: every bridge job -> gh issue comment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ba6eef3 commit 6979b34

3 files changed

Lines changed: 303 additions & 0 deletions

File tree

.claude/skills/tech-tree/SKILL.md

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
---
2+
name: tree
3+
description: Technology dependency tree — shows issue DAG, prereqs, critical path, blocked/ready tasks. Single source of truth for work order.
4+
argument-hint: [next|path|blocked|update]
5+
allowed-tools: Bash(gh *), Bash(python3 *), Bash(cat *), Bash(echo *), Bash(date *), Bash(test *), Read, Edit, Write
6+
---
7+
8+
Show the Trinity technology dependency tree.
9+
Every task is an issue, every issue has prereqs, the tree determines work order.
10+
11+
## Rule: No Issue = No Work
12+
13+
- Every `claude:` bridge command MUST reference an issue: `claude:#N:prompt`
14+
- Before starting work: check prereqs in tree
15+
- After completing work: update tree (close issue, unblock dependents)
16+
- If no issue exists for the task: create one first
17+
18+
## Modes
19+
20+
Parse $ARGUMENTS:
21+
22+
- (no args) — Show full tree with statuses
23+
- `next` — Show only READY tasks (all prereqs met)
24+
- `path` — Show critical path to v1.0
25+
- `blocked` — Show blocked tasks and what blocks them
26+
- `update` — Re-read issues from GitHub, rebuild tree, sync board
27+
28+
## Data Collection
29+
30+
ALWAYS run these commands to get LIVE data:
31+
32+
```bash
33+
# All open issues with labels
34+
gh issue list --state open --json number,title,labels,state --limit 50 2>/dev/null
35+
36+
# Recently closed issues (last 30 days)
37+
SINCE_30D=$(date -v-30d +%Y-%m-%d 2>/dev/null || date -d "30 days ago" +%Y-%m-%d)
38+
gh issue list --state closed --search "closed:>=$SINCE_30D" --json number,title,labels,state --limit 50 2>/dev/null
39+
40+
# Read tree definition file
41+
cat .trinity/tech_tree.json 2>/dev/null || echo "NO_TREE"
42+
```
43+
44+
## Tree Definition File
45+
46+
The tree is stored in `.trinity/tech_tree.json`:
47+
48+
```json
49+
{
50+
"version": 1,
51+
"updated_at": "2026-03-11T03:00:00Z",
52+
"epics": [
53+
{
54+
"issue": 38,
55+
"title": "Ralph Agent Swarm v1.0",
56+
"priority": "P0",
57+
"children": [
58+
{"issue": 45, "title": "Phase 1: Architecture", "priority": "P1", "prereqs": [], "status": "open"},
59+
{"issue": 46, "title": "Phase 2: Core Pipeline", "priority": "P1", "prereqs": [45], "status": "open"},
60+
{"issue": 47, "title": "Phase 3: Agent MU", "priority": "P2", "prereqs": [46], "status": "open"},
61+
{"issue": 48, "title": "Phase 4: Quality", "priority": "P2", "prereqs": [47], "status": "open"},
62+
{"issue": 49, "title": "Phase 5: Deploy", "priority": "P2", "prereqs": [48], "status": "open"}
63+
]
64+
},
65+
{
66+
"issue": 27,
67+
"title": "Full Trinity Pipeline",
68+
"priority": "P1",
69+
"children": [
70+
{"issue": 69, "title": "Spec Enricher", "prereqs": [], "status": "closed"},
71+
{"issue": 71, "title": "Spec <-> Code Sync", "prereqs": [], "status": "closed"},
72+
{"issue": 77, "title": "Batch Pipeline", "prereqs": [], "status": "closed"}
73+
]
74+
},
75+
{
76+
"issue": 113,
77+
"title": "Scholar Agent",
78+
"priority": "P1",
79+
"children": []
80+
},
81+
{
82+
"issue": 57,
83+
"title": "tri-bot Phase 3",
84+
"priority": "P2",
85+
"children": []
86+
}
87+
]
88+
}
89+
```
90+
91+
### On first run or if NO_TREE:
92+
Build the tree from GitHub issues using labels and issue body references.
93+
Write to `.trinity/tech_tree.json`.
94+
95+
### On `update`:
96+
Re-read all issues from GitHub. Update statuses (open/closed).
97+
Check if any prereqs are now met -> mark dependents as READY.
98+
Sync project board columns.
99+
100+
## Status Logic
101+
102+
For each issue in the tree, compute status:
103+
104+
| Status | Condition | Board Column |
105+
|--------|-----------|-------------|
106+
| CLOSED | Issue is closed on GitHub | Done |
107+
| READY | All prereqs are CLOSED | Ready |
108+
| BLOCKED | At least one prereq is OPEN | Backlog |
109+
| IN_PROGRESS | Has `status:in-progress` label | In Progress |
110+
| REVIEW | Has PR open | In Review |
111+
112+
## Output Format: Full Tree
113+
114+
```
115+
===============================================
116+
🌳 TRINITY TECHNOLOGY TREE — {date}
117+
===============================================
118+
119+
#38 Ralph Agent Swarm v1.0 [P0 EPIC]
120+
├── #45 Phase 1: Architecture [P1, READY]
121+
│ └── Prereqs: none -> READY
122+
├── #46 Phase 2: Core Pipeline [P1, BLOCKED]
123+
│ └── Prereqs: #45 -> BLOCKED
124+
├── #47 Phase 3: Agent MU [P2, BLOCKED]
125+
│ └── Prereqs: #46 -> BLOCKED
126+
├── #48 Phase 4: Quality [P2, BLOCKED]
127+
│ └── Prereqs: #47 -> BLOCKED
128+
└── #49 Phase 5: Deploy [P2, BLOCKED]
129+
└── Prereqs: #48 -> BLOCKED
130+
131+
#27 Full Trinity Pipeline [P1 EPIC]
132+
├── #69 Spec Enricher [CLOSED]
133+
├── #71 Spec <-> Code Sync [CLOSED]
134+
└── #77 Batch Pipeline [CLOSED]
135+
136+
#113 Scholar Agent [P1, CLOSED]
137+
#57 tri-bot Phase 3 [P2, READY]
138+
139+
-----------------------------------------------
140+
Summary: {N} open, {N} closed, {N} ready, {N} blocked
141+
Critical path: #45 -> #46 -> #47 -> #48 -> #49
142+
Next task: #{N} {title}
143+
```
144+
145+
## Output Format: next
146+
147+
Show only READY tasks (all prereqs met, issue is open):
148+
149+
```
150+
===============================================
151+
🎯 READY TASKS — {date}
152+
===============================================
153+
154+
1. #45 Phase 1: Architecture [P1]
155+
Prereqs: none
156+
Epic: #38 Ralph Agent Swarm
157+
Command: claude:#45:Execute Protocol v2 Phase 1
158+
159+
2. #57 tri-bot Phase 3 [P2]
160+
Prereqs: none
161+
Command: claude:#57:Implement worktree/pr/board commands
162+
163+
Next action: Start #45 (highest priority READY task)
164+
```
165+
166+
## Output Format: path
167+
168+
Show critical path — longest chain of dependencies to v1.0:
169+
170+
```
171+
===============================================
172+
🛤️ CRITICAL PATH to v1.0 — {date}
173+
===============================================
174+
175+
#45 [READY] -> #46 [BLOCKED] -> #47 [BLOCKED] -> #48 [BLOCKED] -> #49 [BLOCKED]
176+
Architecture Pipeline MU Quality Deploy
177+
178+
Steps remaining: 5
179+
Estimated: 5 issues x ~1 issue/day = ~5 days
180+
Bottleneck: #45 (not started)
181+
182+
Start now: claude:#45:Execute Protocol v2 Phase 1 Architecture
183+
```
184+
185+
## Output Format: blocked
186+
187+
Show blocked tasks and what blocks them:
188+
189+
```
190+
===============================================
191+
🚫 BLOCKED TASKS — {date}
192+
===============================================
193+
194+
#46 Phase 2: Core Pipeline
195+
Blocked by: #45 Phase 1: Architecture [OPEN]
196+
Unblock: close #45
197+
198+
#47 Phase 3: Agent MU
199+
Blocked by: #46 -> #45 (chain)
200+
Unblock: close #45, then #46
201+
202+
... (all blocked issues with chain)
203+
```
204+
205+
## Board Sync
206+
207+
After showing the tree, sync project board:
208+
209+
```bash
210+
# For each READY issue, set board column to Ready
211+
# For each CLOSED issue, set board column to Done
212+
# For each IN_PROGRESS issue, set board column to In Progress
213+
# For each BLOCKED issue, set board column to Backlog
214+
215+
# Get project item IDs
216+
gh project item-list 6 --owner gHashTag --format json --limit 50 2>/dev/null
217+
```
218+
219+
Use `gh project item-edit` to update columns when status changes.
220+
221+
## Auto-Update on Issue Close
222+
223+
When a bridge job closes an issue:
224+
1. Mark issue as Done on board
225+
2. Check: did this unblock any dependent issues?
226+
3. If yes: move newly-unblocked issues to Ready column
227+
4. Log: "[tree] #N closed -> #M now READY"
228+
229+
## Translation Table (EN -> RU)
230+
231+
| EN | RU |
232+
|----|-----|
233+
| TECHNOLOGY TREE | ДЕРЕВО ТЕХНОЛОГИЙ |
234+
| READY TASKS | ГОТОВЫЕ ЗАДАЧИ |
235+
| CRITICAL PATH | КРИТИЧЕСКИЙ ПУТЬ |
236+
| BLOCKED TASKS | ЗАБЛОКИРОВАННЫЕ ЗАДАЧИ |
237+
| Prereqs | Зависимости |
238+
| Steps remaining | Осталось шагов |
239+
| Bottleneck | Узкое место |
240+
| Unblock | Разблокировать |
241+
| Start now | Начать сейчас |
242+
| none | нет |

.trinity/tech_tree.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"version": 1,
3+
"updated_at": "2026-03-11T03:00:00Z",
4+
"epics": [
5+
{
6+
"issue": 38,
7+
"title": "Ralph Agent Swarm v1.0",
8+
"priority": "P0",
9+
"children": [
10+
{"issue": 45, "title": "Phase 1: Architecture", "priority": "P1", "prereqs": [], "status": "open"},
11+
{"issue": 46, "title": "Phase 2: Core Pipeline", "priority": "P1", "prereqs": [45], "status": "open"},
12+
{"issue": 47, "title": "Phase 3: Agent MU", "priority": "P2", "prereqs": [46], "status": "open"},
13+
{"issue": 48, "title": "Phase 4: Quality", "priority": "P2", "prereqs": [47], "status": "open"},
14+
{"issue": 49, "title": "Phase 5: Deploy", "priority": "P2", "prereqs": [48], "status": "open"}
15+
]
16+
},
17+
{
18+
"issue": 27,
19+
"title": "Full Trinity Pipeline",
20+
"priority": "P1",
21+
"children": [
22+
{"issue": 69, "title": "Spec Enricher", "priority": "P1", "prereqs": [], "status": "closed"},
23+
{"issue": 71, "title": "Spec <-> Code Sync", "priority": "P1", "prereqs": [], "status": "closed"},
24+
{"issue": 77, "title": "Batch Pipeline", "priority": "P1", "prereqs": [], "status": "closed"}
25+
]
26+
},
27+
{
28+
"issue": 113,
29+
"title": "Scholar Agent",
30+
"priority": "P1",
31+
"children": [],
32+
"status": "closed"
33+
},
34+
{
35+
"issue": 57,
36+
"title": "tri-bot Phase 3",
37+
"priority": "P2",
38+
"children": [],
39+
"status": "open"
40+
}
41+
]
42+
}

deploy/tri-bridge-agent.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ while true; do
104104
echo "[bridge-agent] WARNING: failed to post result for $JOB_ID"
105105

106106
echo "[bridge-agent] $(date '+%H:%M:%S') done=$JOB_ID exit=$EXIT_CODE (${#RESULT} bytes)"
107+
108+
# ─── Issue Tracking ──────────────────────────────────
109+
# Parse #N from claude commands: "timeout 600 claude --print '#69:Fix...'"
110+
ISSUE_NUM=$(echo "$CMD" | grep -oE "'#[0-9]+" | head -1 | tr -d "'#")
111+
if [ -n "$ISSUE_NUM" ]; then
112+
# Truncate result for comment (max 2000 chars)
113+
COMMENT_BODY=$(echo "$RESULT" | head -c 2000)
114+
gh issue comment "$ISSUE_NUM" --body "$(cat <<GHEOF
115+
🔱 **Bridge Job Result** | \`$JOB_ID\`
116+
📋 **Exit:** $EXIT_CODE | **Size:** ${#RESULT} bytes
117+
118+
\`\`\`
119+
$COMMENT_BODY
120+
\`\`\`
121+
GHEOF
122+
)" > /dev/null 2>&1 && \
123+
echo "[bridge-agent] $(date '+%H:%M:%S') commented on #$ISSUE_NUM" || \
124+
echo "[bridge-agent] WARNING: failed to comment on #$ISSUE_NUM"
125+
fi
107126
fi
108127

109128
# ─── Scholar Cron ─────────────────────────────────────────

0 commit comments

Comments
 (0)