xtrm-tools 0.5.35 → 0.5.37
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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +14 -0
- package/README.md +11 -4
- package/cli/dist/index.cjs +1302 -601
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/config/instructions/agents-top.md +48 -1
- package/config/instructions/claude-top.md +30 -1
- package/config/pi/extensions/lsp-bootstrap/index.ts +1 -1
- package/config/pi/extensions/pi-serena-compact/index.ts +121 -0
- package/config/pi/extensions/pi-serena-compact/package.json +16 -0
- package/config/pi/install-schema.json +2 -1
- package/config/pi/settings.json.template +2 -1
- package/hooks/beads-gate-messages.mjs +11 -5
- package/hooks/tsconfig-cache.json +14 -0
- package/package.json +4 -2
- package/plugins/xtrm-tools/.claude-plugin/plugin.json +1 -1
- package/plugins/xtrm-tools/hooks/beads-gate-messages.mjs +11 -5
- package/plugins/xtrm-tools/hooks/tsconfig-cache.json +14 -0
- package/plugins/xtrm-tools/skills/sync-docs/SKILL.md +90 -14
- package/plugins/xtrm-tools/skills/using-xtrm/SKILL.md +4 -1
- package/plugins/xtrm-tools/skills/xt-end/SKILL.md +199 -59
- package/skills/sync-docs/SKILL.md +90 -14
- package/skills/using-xtrm/SKILL.md +4 -1
- package/skills/xt-end/SKILL.md +199 -59
package/cli/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
1. `bd prime` — load workflow context and active claims
|
|
9
9
|
2. `bd memories <keyword>` — retrieve memories relevant to today's task
|
|
10
10
|
3. `bd recall <key>` — retrieve a specific memory by key if needed
|
|
11
|
-
4. `
|
|
11
|
+
4. `bv --robot-triage` — graph-aware triage: ranked picks, unblock targets, project health
|
|
12
12
|
5. `bd update <id> --claim` — claim before any file edit
|
|
13
13
|
|
|
14
14
|
## Active Gates (extensions enforce these — not optional)
|
|
@@ -88,6 +88,53 @@ Run on every file edit via PostToolUse extension:
|
|
|
88
88
|
|
|
89
89
|
Gate output appears as extension context. Fix failures before proceeding — do not commit with lint errors.
|
|
90
90
|
|
|
91
|
+
## bv — Graph-Aware Triage
|
|
92
|
+
|
|
93
|
+
bv is a graph-aware triage engine for the beads issue board. Use it instead of `bd ready` when you need ranked picks, dependency-aware scheduling, or project health signals.
|
|
94
|
+
|
|
95
|
+
> **CRITICAL: Use ONLY `--robot-*` flags. Bare `bv` launches an interactive TUI that blocks your session.**
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
bv --robot-triage # THE entry point — ranked picks, quick wins, blockers, health
|
|
99
|
+
bv --robot-next # Single top pick + claim command (minimal output)
|
|
100
|
+
bv --robot-triage --format toon # Token-optimized output for lower context usage
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Scope boundary:** bv = *what to work on*. `bd` = creating, claiming, closing issues.
|
|
104
|
+
|
|
105
|
+
### Planning & Analysis
|
|
106
|
+
|
|
107
|
+
| Command | Returns |
|
|
108
|
+
|---------|---------|
|
|
109
|
+
| `--robot-plan` | Parallel execution tracks with unblocks lists |
|
|
110
|
+
| `--robot-priority` | Priority misalignment detection |
|
|
111
|
+
| `--robot-insights` | Full graph metrics: PageRank, betweenness, HITS, eigenvector, critical path, cycles |
|
|
112
|
+
| `--robot-forecast <id\|all>` | ETA predictions with dependency-aware scheduling |
|
|
113
|
+
| `--robot-alerts` | Stale issues, blocking cascades, priority mismatches |
|
|
114
|
+
| `--robot-diff --diff-since <ref>` | Changes since ref: new/closed/modified, cycles introduced/resolved |
|
|
115
|
+
|
|
116
|
+
### Scoping & Filtering
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
bv --robot-plan --label backend # Scope to label's subgraph
|
|
120
|
+
bv --recipe actionable --robot-plan # Pre-filter: ready to work (no blockers)
|
|
121
|
+
bv --recipe high-impact --robot-triage # Pre-filter: top PageRank scores
|
|
122
|
+
bv --robot-triage --robot-triage-by-track # Group by parallel work streams
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Understanding Output
|
|
126
|
+
|
|
127
|
+
- `data_hash` — fingerprint of beads state (verify consistency across calls)
|
|
128
|
+
- Phase 1 (instant): degree, topo sort, density
|
|
129
|
+
- Phase 2 (async, 500ms): PageRank, betweenness, HITS, cycles — check `status` flags
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
bv --robot-triage | jq '.quick_ref' # At-a-glance summary
|
|
133
|
+
bv --robot-triage | jq '.recommendations[0]' # Top recommendation
|
|
134
|
+
bv --robot-plan | jq '.plan.summary.highest_impact'
|
|
135
|
+
bv --robot-insights | jq '.Cycles' # Circular deps — must fix
|
|
136
|
+
```
|
|
137
|
+
|
|
91
138
|
## Worktree Sessions
|
|
92
139
|
|
|
93
140
|
- `xt pi` — launch Pi in a sandboxed worktree
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
1. `bd prime` — load workflow context and active claims
|
|
9
9
|
2. `bd memories <keyword>` — retrieve memories relevant to today's task
|
|
10
10
|
3. `bd recall <key>` — retrieve a specific memory by key if needed
|
|
11
|
-
4. `
|
|
11
|
+
4. `bv --robot-triage` — graph-aware triage: ranked picks, unblock targets, project health
|
|
12
12
|
5. `bd update <id> --claim` — claim before any file edit
|
|
13
13
|
|
|
14
14
|
## Active Gates (hooks enforce these — not optional)
|
|
@@ -80,6 +80,35 @@ xt end # push, PR, merge, worktree cleanup
|
|
|
80
80
|
|
|
81
81
|
**Never** continue new work on a previously used branch.
|
|
82
82
|
|
|
83
|
+
## bv — Graph-Aware Triage
|
|
84
|
+
|
|
85
|
+
bv is a graph-aware triage engine for the beads issue board. Use it instead of `bd ready` when you need ranked picks, dependency-aware scheduling, or project health signals.
|
|
86
|
+
|
|
87
|
+
> **CRITICAL: Use ONLY `--robot-*` flags. Bare `bv` launches an interactive TUI that blocks your session.**
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
bv --robot-triage # THE entry point — ranked picks, quick wins, blockers, health
|
|
91
|
+
bv --robot-next # Single top pick + claim command (minimal output)
|
|
92
|
+
bv --robot-triage --format toon # Token-optimized output for lower context usage
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Scope boundary:** bv = *what to work on*. `bd` = creating, claiming, closing issues.
|
|
96
|
+
|
|
97
|
+
| Command | Returns |
|
|
98
|
+
|---------|---------|
|
|
99
|
+
| `--robot-plan` | Parallel execution tracks with unblocks lists |
|
|
100
|
+
| `--robot-insights` | PageRank, betweenness, HITS, cycles, critical path |
|
|
101
|
+
| `--robot-forecast <id\|all>` | ETA predictions with dependency-aware scheduling |
|
|
102
|
+
| `--robot-alerts` | Stale issues, blocking cascades, priority mismatches |
|
|
103
|
+
| `--robot-diff --diff-since <ref>` | Changes since ref: new/closed/modified |
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
bv --recipe actionable --robot-plan # Pre-filter: ready to work
|
|
107
|
+
bv --robot-triage --robot-triage-by-track # Group by parallel work streams
|
|
108
|
+
bv --robot-triage | jq '.quick_ref' # At-a-glance summary
|
|
109
|
+
bv --robot-insights | jq '.Cycles' # Circular deps — must fix
|
|
110
|
+
```
|
|
111
|
+
|
|
83
112
|
## Code Intelligence (mandatory before edits)
|
|
84
113
|
|
|
85
114
|
Use **Serena** (`using-serena-lsp` skill) for all code reads and edits:
|
|
@@ -114,7 +114,7 @@ function runInstall(target: LspTarget, ctx: any): void {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
export default function register(api: ExtensionAPI) {
|
|
117
|
-
api.on("
|
|
117
|
+
api.on("before_agent_start", async (_event: any, ctx: any) => {
|
|
118
118
|
const cwd = process.cwd();
|
|
119
119
|
const detected = detectTargets(cwd);
|
|
120
120
|
if (detected.length === 0) return;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { ExtensionAPI, ToolResultEvent } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
// Serena/GitNexus MCP tool names that produce verbose output
|
|
4
|
+
const COMPACT_TOOLS = new Set([
|
|
5
|
+
// Serena symbol operations
|
|
6
|
+
"find_symbol",
|
|
7
|
+
"find_referencing_symbols",
|
|
8
|
+
"get_symbols_overview",
|
|
9
|
+
"jet_brains_find_symbol",
|
|
10
|
+
"jet_brains_find_referencing_symbols",
|
|
11
|
+
"jet_brains_get_symbols_overview",
|
|
12
|
+
"jet_brains_type_hierarchy",
|
|
13
|
+
|
|
14
|
+
// Serena file operations
|
|
15
|
+
"read_file",
|
|
16
|
+
"create_text_file",
|
|
17
|
+
"replace_content",
|
|
18
|
+
"replace_lines",
|
|
19
|
+
"delete_lines",
|
|
20
|
+
"insert_at_line",
|
|
21
|
+
|
|
22
|
+
// Serena search/navigation
|
|
23
|
+
"search_for_pattern",
|
|
24
|
+
"list_dir",
|
|
25
|
+
"find_file",
|
|
26
|
+
|
|
27
|
+
// Serena symbol editing
|
|
28
|
+
"replace_symbol_body",
|
|
29
|
+
"insert_after_symbol",
|
|
30
|
+
"insert_before_symbol",
|
|
31
|
+
"rename_symbol",
|
|
32
|
+
|
|
33
|
+
// GitNexus
|
|
34
|
+
"gitnexus_query",
|
|
35
|
+
"gitnexus_context",
|
|
36
|
+
"gitnexus_impact",
|
|
37
|
+
"gitnexus_detect_changes",
|
|
38
|
+
"gitnexus_list_repos",
|
|
39
|
+
|
|
40
|
+
// Serena memory
|
|
41
|
+
"read_memory",
|
|
42
|
+
"write_memory",
|
|
43
|
+
"list_memories",
|
|
44
|
+
|
|
45
|
+
// Other verbose tools
|
|
46
|
+
"execute_shell_command",
|
|
47
|
+
"structured_return",
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
// Tools that should show more output even when compacted
|
|
51
|
+
const PRESERVE_OUTPUT_TOOLS = new Set([
|
|
52
|
+
"read_file",
|
|
53
|
+
"read_memory",
|
|
54
|
+
"execute_shell_command",
|
|
55
|
+
"structured_return",
|
|
56
|
+
]);
|
|
57
|
+
|
|
58
|
+
function isSerenaTool(toolName: string): boolean {
|
|
59
|
+
return COMPACT_TOOLS.has(toolName);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getTextContent(content: Array<{ type: string; text?: string }>): string {
|
|
63
|
+
const item = content.find((c) => c.type === "text");
|
|
64
|
+
return item?.text ?? "";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function truncateLines(text: string, maxLines: number, maxLineLen = 180): string {
|
|
68
|
+
const lines = text.split("\n");
|
|
69
|
+
const truncated = lines.map(line =>
|
|
70
|
+
line.length > maxLineLen ? line.slice(0, maxLineLen) + "…" : line
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
if (truncated.length <= maxLines) return truncated.join("\n");
|
|
74
|
+
return truncated.slice(0, maxLines).join("\n") + `\n… +${truncated.length - maxLines} more lines`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function compactResult(
|
|
78
|
+
toolName: string,
|
|
79
|
+
content: Array<{ type: string; text?: string }>,
|
|
80
|
+
maxLines: number = 6,
|
|
81
|
+
): Array<{ type: string; text: string }> {
|
|
82
|
+
const textContent = getTextContent(content);
|
|
83
|
+
|
|
84
|
+
if (!textContent) {
|
|
85
|
+
return [{ type: "text", text: "✓ No output" }];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// For certain tools, show more output
|
|
89
|
+
const effectiveMaxLines = PRESERVE_OUTPUT_TOOLS.has(toolName) ? 12 : maxLines;
|
|
90
|
+
|
|
91
|
+
const compacted = truncateLines(textContent, effectiveMaxLines, 180);
|
|
92
|
+
|
|
93
|
+
return [{ type: "text", text: compacted }];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default function serenaCompactExtension(pi: ExtensionAPI): void {
|
|
97
|
+
let toolsExpanded = false;
|
|
98
|
+
|
|
99
|
+
// Track tools expanded state
|
|
100
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
101
|
+
toolsExpanded = ctx.ui.getToolsExpanded();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
pi.on("session_switch", async (_event, ctx) => {
|
|
105
|
+
toolsExpanded = ctx.ui.getToolsExpanded();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Compact Serena tool results
|
|
109
|
+
pi.on("tool_result", async (event: ToolResultEvent) => {
|
|
110
|
+
// Only handle Serena/MCP tools
|
|
111
|
+
if (!isSerenaTool(event.toolName)) return undefined;
|
|
112
|
+
|
|
113
|
+
// If tools are expanded, don't compact
|
|
114
|
+
if (toolsExpanded) return undefined;
|
|
115
|
+
|
|
116
|
+
// Compact the content
|
|
117
|
+
const compacted = compactResult(event.toolName, event.content, 6);
|
|
118
|
+
|
|
119
|
+
return { content: compacted };
|
|
120
|
+
});
|
|
121
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-serena-compact",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Compact output for Serena MCP tools in Pi",
|
|
5
|
+
"keywords": ["pi", "pi-extension", "serena", "mcp"],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "index.ts",
|
|
9
|
+
"peerDependencies": {
|
|
10
|
+
"@mariozechner/pi-coding-agent": "^0.56.0",
|
|
11
|
+
"@mariozechner/pi-tui": "^0.56.0"
|
|
12
|
+
},
|
|
13
|
+
"pi": {
|
|
14
|
+
"extensions": ["./index.ts"]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -59,13 +59,19 @@ export function stopBlockMessage(summary, claimed) {
|
|
|
59
59
|
export function memoryPromptMessage(claimId, sessionId) {
|
|
60
60
|
const claimLine = claimId ? `claim \`${claimId}\` was closed.\n` : '';
|
|
61
61
|
const ackCmd = sessionId
|
|
62
|
-
? `bd kv set "memory-gate-done:${sessionId}"
|
|
62
|
+
? `bd kv set "memory-gate-done:${sessionId}"`
|
|
63
63
|
: 'touch .beads/.memory-gate-done';
|
|
64
64
|
return (
|
|
65
65
|
`\u25cf Memory gate: ${claimLine}` +
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
|
|
66
|
+
'For each candidate insight, check ALL 4:\n' +
|
|
67
|
+
' 1. Hard to rediscover from code/docs?\n' +
|
|
68
|
+
' 2. Not obvious from the current implementation?\n' +
|
|
69
|
+
' 3. Will affect a future decision?\n' +
|
|
70
|
+
' 4. Still relevant in ~14 days?\n' +
|
|
71
|
+
'KEEP (all 4 yes) → `bd remember "<insight>"`\n' +
|
|
72
|
+
'SKIP examples: file maps, flag inventories, per-issue summaries,\n' +
|
|
73
|
+
' wording tweaks, facts obvious from reading the source.\n' +
|
|
74
|
+
`KEEP: \`${ackCmd} "saved: <key>"\`\n` +
|
|
75
|
+
`SKIP: \`${ackCmd} "nothing novel — <one-line reason>"\`\n`
|
|
70
76
|
);
|
|
71
77
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hashes": {
|
|
3
|
+
"/home/dawid/projects/specialists/tsconfig.json": "84f37aa64b949b7aaba41974cb6137341a36730b7d3e174803cb9289eae1e7c7"
|
|
4
|
+
},
|
|
5
|
+
"mappings": {
|
|
6
|
+
"src/**/*": {
|
|
7
|
+
"configPath": "/home/dawid/projects/specialists/tsconfig.json",
|
|
8
|
+
"excludes": [
|
|
9
|
+
"node_modules",
|
|
10
|
+
"dist"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xtrm-tools",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.37",
|
|
4
4
|
"description": "Claude Code tools installer (skills, hooks, MCP servers)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"node": ">=20.0.0"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
+
"@artale/pi-procs": "^1.1.0",
|
|
62
63
|
"comment-json": "^4.2.3",
|
|
63
64
|
"conf": "^15.1.0",
|
|
64
65
|
"dotenv": "^17.3.1",
|
|
@@ -77,7 +78,8 @@
|
|
|
77
78
|
"npm:pi-serena-tools",
|
|
78
79
|
"npm:@zenobius/pi-worktrees",
|
|
79
80
|
"npm:@robhowley/pi-structured-return",
|
|
80
|
-
"npm:@aliou/pi-guardrails"
|
|
81
|
+
"npm:@aliou/pi-guardrails",
|
|
82
|
+
"npm:@aliou/pi-processes"
|
|
81
83
|
]
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -59,13 +59,19 @@ export function stopBlockMessage(summary, claimed) {
|
|
|
59
59
|
export function memoryPromptMessage(claimId, sessionId) {
|
|
60
60
|
const claimLine = claimId ? `claim \`${claimId}\` was closed.\n` : '';
|
|
61
61
|
const ackCmd = sessionId
|
|
62
|
-
? `bd kv set "memory-gate-done:${sessionId}"
|
|
62
|
+
? `bd kv set "memory-gate-done:${sessionId}"`
|
|
63
63
|
: 'touch .beads/.memory-gate-done';
|
|
64
64
|
return (
|
|
65
65
|
`\u25cf Memory gate: ${claimLine}` +
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
|
|
66
|
+
'For each candidate insight, check ALL 4:\n' +
|
|
67
|
+
' 1. Hard to rediscover from code/docs?\n' +
|
|
68
|
+
' 2. Not obvious from the current implementation?\n' +
|
|
69
|
+
' 3. Will affect a future decision?\n' +
|
|
70
|
+
' 4. Still relevant in ~14 days?\n' +
|
|
71
|
+
'KEEP (all 4 yes) → `bd remember "<insight>"`\n' +
|
|
72
|
+
'SKIP examples: file maps, flag inventories, per-issue summaries,\n' +
|
|
73
|
+
' wording tweaks, facts obvious from reading the source.\n' +
|
|
74
|
+
`KEEP: \`${ackCmd} "saved: <key>"\`\n` +
|
|
75
|
+
`SKIP: \`${ackCmd} "nothing novel — <one-line reason>"\`\n`
|
|
70
76
|
);
|
|
71
77
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hashes": {
|
|
3
|
+
"/home/dawid/projects/specialists/tsconfig.json": "84f37aa64b949b7aaba41974cb6137341a36730b7d3e174803cb9289eae1e7c7"
|
|
4
|
+
},
|
|
5
|
+
"mappings": {
|
|
6
|
+
"src/**/*": {
|
|
7
|
+
"configPath": "/home/dawid/projects/specialists/tsconfig.json",
|
|
8
|
+
"excludes": [
|
|
9
|
+
"node_modules",
|
|
10
|
+
"dist"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -4,11 +4,12 @@ description: >-
|
|
|
4
4
|
Doc audit and structural sync for xtrm projects. Use whenever the README
|
|
5
5
|
feels too long, docs are out of sync after a sprint, the CHANGELOG is behind,
|
|
6
6
|
or the user asks to "sync docs", "doc audit", "split readme", "check docs
|
|
7
|
-
health", or "detect drift".
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
health", or "detect drift". Prefer the xtrm docs command suite (`xtrm docs
|
|
8
|
+
list`, `xtrm docs show`, `xtrm docs cross-check`) for operator-facing
|
|
9
|
+
inspection, then use docs-only drift detection on README.md, CHANGELOG.md,
|
|
10
|
+
and docs/ plus the Python analyzers as validation/backstop tools.
|
|
10
11
|
gemini-command: sync-docs
|
|
11
|
-
version: 1.
|
|
12
|
+
version: 1.3.0
|
|
12
13
|
---
|
|
13
14
|
|
|
14
15
|
# sync-docs
|
|
@@ -19,18 +20,37 @@ Keeps project documentation in sync with code reality.
|
|
|
19
20
|
|
|
20
21
|
```
|
|
21
22
|
Phase 1: Gather context — what changed recently?
|
|
22
|
-
Phase 2:
|
|
23
|
-
Phase 3:
|
|
24
|
-
Phase 4:
|
|
25
|
-
Phase 5:
|
|
23
|
+
Phase 2: Inspect with xtrm — what does the docs suite already report?
|
|
24
|
+
Phase 3: Detect docs drift — which docs/ files are stale?
|
|
25
|
+
Phase 4: Analyze structure — what belongs outside README?
|
|
26
|
+
Phase 5: Plan + execute — fix docs and changelog
|
|
27
|
+
Phase 6: Validate — schema-check all docs/
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
**
|
|
30
|
+
**Preferred workflow:** use the `xtrm docs` command suite first for human/operator-facing inspection, then use the Python scripts for drift validation, structure analysis, metadata checks, and sync checkpoints.
|
|
31
|
+
|
|
32
|
+
**Audit vs Execute mode:** If the user asked for an audit/report/check-only task, stop after Phase 4. Only run fixes when the user explicitly asks for changes.
|
|
29
33
|
|
|
30
34
|
---
|
|
31
35
|
|
|
32
36
|
## Phase 1: Gather Context
|
|
33
37
|
|
|
38
|
+
Start with the user-facing docs suite so the agent sees the same command surfaces users do:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
xtrm docs list
|
|
42
|
+
xtrm docs list --json
|
|
43
|
+
xtrm docs show --json
|
|
44
|
+
xtrm docs cross-check --json --days 30
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Use these commands for:
|
|
48
|
+
- `xtrm docs list` — inventory docs files, paths, titles, types, and cache-backed scans
|
|
49
|
+
- `xtrm docs show --json` — inspect frontmatter for README, CHANGELOG, and `docs/*.md`
|
|
50
|
+
- `xtrm docs cross-check --json` — gather stale-doc, coverage-gap, and open-issue-ref signals
|
|
51
|
+
|
|
52
|
+
Then gather deeper repository context if needed:
|
|
53
|
+
|
|
34
54
|
```bash
|
|
35
55
|
# Global install
|
|
36
56
|
python3 "$HOME/.agents/skills/sync-docs/scripts/context_gatherer.py" [--since=30]
|
|
@@ -47,7 +67,30 @@ Outputs JSON with:
|
|
|
47
67
|
|
|
48
68
|
---
|
|
49
69
|
|
|
50
|
-
## Phase 2:
|
|
70
|
+
## Phase 2: Inspect with `xtrm docs`
|
|
71
|
+
|
|
72
|
+
Treat the CLI docs suite as the primary operator workflow:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
xtrm docs --help
|
|
76
|
+
xtrm docs list --json
|
|
77
|
+
xtrm docs show --json
|
|
78
|
+
xtrm docs cross-check --json --days 30
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use it to answer:
|
|
82
|
+
- what docs currently exist?
|
|
83
|
+
- which docs have missing or outdated metadata?
|
|
84
|
+
- are there coverage gaps between recent work and docs?
|
|
85
|
+
- do docs reference open issues?
|
|
86
|
+
|
|
87
|
+
If the xtrm docs suite already isolates the problem clearly, proceed directly to fixes. If you need machine-level drift validation for `docs/*.md`, continue to the Python drift detector.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Phase 3: Detect docs/ Drift
|
|
92
|
+
|
|
93
|
+
Use the Python detector as the authoritative drift/backstop check for tracked `docs/*.md` pages:
|
|
51
94
|
|
|
52
95
|
```bash
|
|
53
96
|
python3 "skills/sync-docs/scripts/drift_detector.py" scan --since 30
|
|
@@ -82,7 +125,7 @@ This sets `synced_at` to current HEAD, marking the doc as synced.
|
|
|
82
125
|
|
|
83
126
|
---
|
|
84
127
|
|
|
85
|
-
## Phase
|
|
128
|
+
## Phase 4: Analyze Document Structure
|
|
86
129
|
|
|
87
130
|
```bash
|
|
88
131
|
python3 "skills/sync-docs/scripts/doc_structure_analyzer.py"
|
|
@@ -96,11 +139,13 @@ Checks:
|
|
|
96
139
|
|
|
97
140
|
Statuses: `BLOATED`, `EXTRACTABLE`, `MISSING`, `STALE`, `INVALID_SCHEMA`, `OK`.
|
|
98
141
|
|
|
99
|
-
If this is audit-only, stop here and report.
|
|
142
|
+
If this is audit-only, stop here and report. In the report, include both:
|
|
143
|
+
- `xtrm docs` findings (operator-facing)
|
|
144
|
+
- Python analyzer findings (drift/structure enforcement)
|
|
100
145
|
|
|
101
146
|
---
|
|
102
147
|
|
|
103
|
-
## Phase
|
|
148
|
+
## Phase 5: Execute Fixes
|
|
104
149
|
|
|
105
150
|
| Situation | Action |
|
|
106
151
|
|---|---|
|
|
@@ -131,6 +176,16 @@ python3 "skills/sync-docs/scripts/validate_doc.py" --generate docs/hooks.md \
|
|
|
131
176
|
python3 "skills/sync-docs/scripts/validate_metadata.py" docs/
|
|
132
177
|
```
|
|
133
178
|
|
|
179
|
+
### Re-run xtrm docs suite after fixes
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
xtrm docs list --json
|
|
183
|
+
xtrm docs show --json
|
|
184
|
+
xtrm docs cross-check --json --days 30
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Use this pass to confirm the user-facing docs workflow now reflects the repaired state before final validation.
|
|
188
|
+
|
|
134
189
|
### Add changelog entry
|
|
135
190
|
|
|
136
191
|
```bash
|
|
@@ -140,13 +195,20 @@ python3 "skills/sync-docs/scripts/changelog/add_entry.py" \
|
|
|
140
195
|
|
|
141
196
|
---
|
|
142
197
|
|
|
143
|
-
## Phase
|
|
198
|
+
## Phase 6: Final Validation
|
|
199
|
+
|
|
200
|
+
Run both layers:
|
|
144
201
|
|
|
145
202
|
```bash
|
|
203
|
+
xtrm docs list --json
|
|
204
|
+
xtrm docs show --json
|
|
205
|
+
xtrm docs cross-check --json --days 30
|
|
146
206
|
python3 "skills/sync-docs/scripts/validate_doc.py" docs/
|
|
147
207
|
python3 "skills/sync-docs/scripts/drift_detector.py" scan --since 30
|
|
148
208
|
```
|
|
149
209
|
|
|
210
|
+
The `xtrm docs` commands confirm the end-user/operator view; the Python tools confirm schema and tracked-doc drift guarantees.
|
|
211
|
+
|
|
150
212
|
---
|
|
151
213
|
|
|
152
214
|
## Frontmatter Schema
|
|
@@ -208,3 +270,17 @@ title: What's New in v2.0
|
|
|
208
270
|
`docs/` is the only source of truth for project documentation in this workflow.
|
|
209
271
|
Scripts validate `docs/*.md` only — subdirectories (`docs/plans/`, `docs/reference/`) are ignored.
|
|
210
272
|
Use frontmatter (`source_of_truth_for`) to link docs pages to code areas and detect drift.
|
|
273
|
+
|
|
274
|
+
## Command Selection Rules
|
|
275
|
+
|
|
276
|
+
Use `xtrm docs` commands first when the task is about understanding the current docs state:
|
|
277
|
+
- `xtrm docs list --json` → inventory and filtering
|
|
278
|
+
- `xtrm docs show --json` → frontmatter inspection
|
|
279
|
+
- `xtrm docs cross-check --json` → recent-work drift, coverage gaps, open issue refs
|
|
280
|
+
|
|
281
|
+
Use Python scripts when the task is about enforcement or synchronization internals:
|
|
282
|
+
- `drift_detector.py` → `synced_at` / `source_of_truth_for` drift checks for `docs/*.md`
|
|
283
|
+
- `doc_structure_analyzer.py` → README bloat, missing focused docs, changelog version gaps
|
|
284
|
+
- `validate_metadata.py` / `validate_doc.py` → schema/index validation
|
|
285
|
+
|
|
286
|
+
Do not replace the Python tools with `xtrm docs`; use the CLI for operator-facing inspection and the scripts for authoritative structural validation.
|
|
@@ -19,10 +19,12 @@ priority: high
|
|
|
19
19
|
```bash
|
|
20
20
|
bd prime # load workflow context + active claims
|
|
21
21
|
bd memories <today's topic> # retrieve relevant past context
|
|
22
|
-
|
|
22
|
+
bv --robot-triage # graph-ranked picks, quick wins, unblock targets
|
|
23
23
|
bd update <id> --claim # claim before any edit
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
> Use `bv --robot-next` for the single top pick. Use `bv --robot-triage --format toon` to save context tokens. **Never run bare `bv` — it launches an interactive TUI.**
|
|
27
|
+
|
|
26
28
|
---
|
|
27
29
|
|
|
28
30
|
## Trigger Patterns
|
|
@@ -30,6 +32,7 @@ bd update <id> --claim # claim before any edit
|
|
|
30
32
|
| Situation | Action |
|
|
31
33
|
|-----------|--------|
|
|
32
34
|
| User prompt contains `?` | `bd memories <keywords>` before answering — check stored context first |
|
|
35
|
+
| "What should I work on?" | `bv --robot-triage` — ranked picks with dependency context |
|
|
33
36
|
| "What was I working on?" | `bd list --status=in_progress` |
|
|
34
37
|
| Unfamiliar area of code | `gitnexus_query({query: "concept"})` before opening any file |
|
|
35
38
|
| About to edit a symbol | `gitnexus_impact({target: "name", direction: "upstream"})` |
|