@jaggerxtrm/specialists 3.2.0 → 3.3.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jaggerxtrm/specialists",
3
- "version": "3.2.0",
4
- "description": "OmniSpecialist \u2014 7-tool MCP orchestration layer powered by the Specialist System. Discover and execute .specialist.yaml files across project/user/system scopes via pi.",
3
+ "version": "3.3.0",
4
+ "description": "OmniSpecialist 7-tool MCP orchestration layer powered by the Specialist System. Discover and execute .specialist.yaml files across project/user/system scopes via pi.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "files": [
@@ -12,6 +12,7 @@
12
12
  ],
13
13
  "bin": {
14
14
  "specialists": "dist/index.js",
15
+ "sp": "dist/index.js",
15
16
  "install": "bin/install.js"
16
17
  },
17
18
  "scripts": {
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env node
2
- // beads-close-memory-prompt — Claude Code PostToolUse hook
3
- // After `bd close`: injects a short reminder into Claude's context to capture
4
- // knowledge and consider underused beads features.
5
- // Output to stdout is shown to Claude as additional context.
6
- //
7
- // Installed by: specialists install
8
-
9
- import { readFileSync, existsSync } from 'node:fs';
10
- import { join } from 'node:path';
11
-
12
- let input;
13
- try {
14
- input = JSON.parse(readFileSync(0, 'utf8'));
15
- } catch {
16
- process.exit(0);
17
- }
18
-
19
- // Only fire on Bash tool
20
- if (input.tool_name !== 'Bash') process.exit(0);
21
-
22
- const cmd = (input.tool_input?.command ?? '').trim();
23
-
24
- // Only fire when the command is `bd close ...`
25
- if (!/\bbd\s+close\b/.test(cmd)) process.exit(0);
26
-
27
- // Only fire in projects that use beads
28
- const cwd = input.cwd ?? process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
29
- if (!existsSync(join(cwd, '.beads'))) process.exit(0);
30
-
31
- // Inject reminder into Claude's context
32
- process.stdout.write(
33
- '\n[beads] Issue(s) closed. Before moving on:\n\n' +
34
- ' Knowledge worth keeping?\n' +
35
- ' bd remember "key insight from this work"\n' +
36
- ' bd memories <keyword> -- search what is already stored\n\n' +
37
- ' Discovered related work while implementing?\n' +
38
- ' bd create --title="..." --deps=discovered-from:<id>\n\n' +
39
- ' Underused features to consider:\n' +
40
- ' bd dep add <a> <b> -- link blocking relationships between issues\n' +
41
- ' bd graph -- visualize issue dependency graph\n' +
42
- ' bd orphans -- issues referenced in commits but still open\n' +
43
- ' bd preflight -- PR readiness checklist before gh pr create\n' +
44
- ' bd stale -- issues not touched recently\n'
45
- );
46
-
47
- process.exit(0);
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- // beads-commit-gate — Claude Code PreToolUse hook
3
- // Blocks `git commit` when in_progress beads issues still exist.
4
- // Forces: close issues first, THEN commit.
5
- // Exit 0: allow | Exit 2: block (stderr shown to Claude)
6
- //
7
- // Installed by: specialists install
8
-
9
- import { execSync } from 'node:child_process';
10
- import { readFileSync, existsSync } from 'node:fs';
11
- import { join } from 'node:path';
12
-
13
- let input;
14
- try {
15
- input = JSON.parse(readFileSync(0, 'utf8'));
16
- } catch {
17
- process.exit(0);
18
- }
19
-
20
- const tool = input.tool_name ?? '';
21
- if (tool !== 'Bash') process.exit(0);
22
-
23
- const cmd = input.tool_input?.command ?? '';
24
- if (!/\bgit\s+commit\b/.test(cmd)) process.exit(0);
25
-
26
- const cwd = input.cwd ?? process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
27
- if (!existsSync(join(cwd, '.beads'))) process.exit(0);
28
-
29
- let inProgress = 0;
30
- let summary = '';
31
- try {
32
- const output = execSync('bd list --status=in_progress', {
33
- encoding: 'utf8',
34
- cwd,
35
- stdio: ['pipe', 'pipe', 'pipe'],
36
- timeout: 8000,
37
- });
38
- inProgress = (output.match(/in_progress/g) ?? []).length;
39
- summary = output.trim();
40
- } catch {
41
- process.exit(0);
42
- }
43
-
44
- if (inProgress > 0) {
45
- process.stderr.write(
46
- '🚫 BEADS GATE: Close open issues before committing.\n\n' +
47
- `Open issues:\n${summary}\n\n` +
48
- 'Next steps:\n' +
49
- ' 3. bd close <id1> <id2> ... ← you are here\n' +
50
- ' 4. git add <files> && git commit -m "..."\n' +
51
- ' 5. git push -u origin <feature-branch>\n' +
52
- ' 6. gh pr create --fill && gh pr merge --squash\n' +
53
- ' 7. git checkout master && git reset --hard origin/master\n'
54
- );
55
- process.exit(2);
56
- }
57
-
58
- process.exit(0);
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env node
2
- // beads-edit-gate — Claude Code PreToolUse hook
3
- // Blocks file edits when no beads issue is in_progress.
4
- // Only active in projects with a .beads/ directory.
5
- // Exit 0: allow | Exit 2: block (stderr shown to Claude)
6
- //
7
- // Installed by: specialists install
8
-
9
- import { execSync } from 'node:child_process';
10
- import { readFileSync, existsSync } from 'node:fs';
11
- import { join } from 'node:path';
12
-
13
- let input;
14
- try {
15
- input = JSON.parse(readFileSync(0, 'utf8'));
16
- } catch {
17
- process.exit(0);
18
- }
19
-
20
- const cwd = input.cwd ?? process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
21
- if (!existsSync(join(cwd, '.beads'))) process.exit(0);
22
-
23
- let inProgress = 0;
24
- try {
25
- const output = execSync('bd list --status=in_progress', {
26
- encoding: 'utf8',
27
- cwd,
28
- stdio: ['pipe', 'pipe', 'pipe'],
29
- timeout: 8000,
30
- });
31
- inProgress = (output.match(/in_progress/g) ?? []).length;
32
- } catch {
33
- process.exit(0);
34
- }
35
-
36
- if (inProgress === 0) {
37
- process.stderr.write(
38
- '🚫 BEADS GATE: No active issue — create one before editing files.\n\n' +
39
- ' bd create --title="<what you\'re doing>" --type=task --priority=2\n' +
40
- ' bd update <id> --status=in_progress\n\n' +
41
- 'Full workflow (do this every session):\n' +
42
- ' 1. bd create + bd update in_progress ← you are here\n' +
43
- ' 2. Edit files / write code\n' +
44
- ' 3. bd close <id> close when done\n' +
45
- ' 4. git add <files> && git commit\n' +
46
- ' 5. git push -u origin <feature-branch>\n' +
47
- ' 6. gh pr create --fill && gh pr merge --squash\n' +
48
- ' 7. git checkout master && git reset --hard origin/master\n'
49
- );
50
- process.exit(2);
51
- }
52
-
53
- process.exit(0);
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
- // beads-stop-gate — Claude Code Stop hook
3
- // Blocks the agent from stopping when in_progress beads issues remain.
4
- // Exit 0: allow stop | Exit 2: block stop (stderr shown to Claude)
5
- //
6
- // Installed by: specialists install
7
-
8
- import { execSync } from 'node:child_process';
9
- import { readFileSync, existsSync } from 'node:fs';
10
- import { join } from 'node:path';
11
-
12
- let input;
13
- try {
14
- input = JSON.parse(readFileSync(0, 'utf8'));
15
- } catch {
16
- process.exit(0);
17
- }
18
-
19
- const cwd = input.cwd ?? process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
20
- if (!existsSync(join(cwd, '.beads'))) process.exit(0);
21
-
22
- let inProgress = 0;
23
- let summary = '';
24
- try {
25
- const output = execSync('bd list --status=in_progress', {
26
- encoding: 'utf8',
27
- cwd,
28
- stdio: ['pipe', 'pipe', 'pipe'],
29
- timeout: 8000,
30
- });
31
- inProgress = (output.match(/in_progress/g) ?? []).length;
32
- summary = output.trim();
33
- } catch {
34
- process.exit(0);
35
- }
36
-
37
- if (inProgress > 0) {
38
- process.stderr.write(
39
- '🚫 BEADS STOP GATE: Unresolved issues — complete the session close protocol.\n\n' +
40
- `Open issues:\n${summary}\n\n` +
41
- 'Session close protocol:\n' +
42
- ' 3. bd close <id1> <id2> ... close all in_progress issues\n' +
43
- ' 4. git add <files> && git commit -m "..." commit your changes\n' +
44
- ' 5. git push -u origin <feature-branch> push feature branch\n' +
45
- ' 6. gh pr create --fill create PR\n' +
46
- ' 7. gh pr merge --squash merge PR\n' +
47
- ' 8. git checkout master && git reset --hard origin/master\n'
48
- );
49
- process.exit(2);
50
- }
51
-
52
- process.exit(0);
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
- // specialists-complete — Claude Code UserPromptSubmit hook
3
- // Checks .specialists/ready/ for completed background job markers and injects
4
- // completion banners into Claude's context.
5
- //
6
- // Installed by: specialists install
7
-
8
- import { existsSync, readdirSync, readFileSync, unlinkSync } from 'node:fs';
9
- import { join } from 'node:path';
10
-
11
- const cwd = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
12
- const readyDir = join(cwd, '.specialists', 'ready');
13
-
14
- // Exit silently if no ready dir or nothing to report
15
- if (!existsSync(readyDir)) process.exit(0);
16
-
17
- let markers;
18
- try {
19
- markers = readdirSync(readyDir).filter(f => !f.startsWith('.'));
20
- } catch {
21
- process.exit(0);
22
- }
23
-
24
- if (markers.length === 0) process.exit(0);
25
-
26
- const banners = [];
27
-
28
- for (const jobId of markers) {
29
- const markerPath = join(readyDir, jobId);
30
- const statusPath = join(cwd, '.specialists', 'jobs', jobId, 'status.json');
31
-
32
- try {
33
- let specialist = jobId;
34
- let elapsed = '';
35
-
36
- if (existsSync(statusPath)) {
37
- const status = JSON.parse(readFileSync(statusPath, 'utf-8'));
38
- specialist = status.specialist ?? jobId;
39
- elapsed = status.elapsed_s !== undefined ? `, ${status.elapsed_s}s` : '';
40
- }
41
-
42
- banners.push(
43
- `[Specialist '${specialist}' completed (job ${jobId}${elapsed}). Run: specialists result ${jobId}]`
44
- );
45
-
46
- // Delete marker so it only fires once
47
- unlinkSync(markerPath);
48
- } catch {
49
- // Ignore malformed entries
50
- try { unlinkSync(markerPath); } catch { /* ignore */ }
51
- }
52
- }
53
-
54
- if (banners.length === 0) process.exit(0);
55
-
56
- // UserPromptSubmit hooks inject content via JSON
57
- process.stdout.write(JSON.stringify({
58
- type: 'inject',
59
- content: banners.join('\n'),
60
- }) + '\n');
@@ -1,90 +0,0 @@
1
- #!/usr/bin/env node
2
- // Claude Code PreToolUse hook — block writes and direct master pushes
3
- // Exit 0: allow | Exit 2: block (message shown to user)
4
- //
5
- // Installed by: specialists install
6
-
7
- import { execSync } from 'node:child_process';
8
- import { readFileSync } from 'node:fs';
9
-
10
- let branch = '';
11
- try {
12
- branch = execSync('git branch --show-current', {
13
- encoding: 'utf8',
14
- stdio: ['pipe', 'pipe', 'pipe'],
15
- }).trim();
16
- } catch {}
17
-
18
- // Not in a git repo or not on a protected branch — allow
19
- if (!branch || (branch !== 'main' && branch !== 'master')) {
20
- process.exit(0);
21
- }
22
-
23
- let input;
24
- try {
25
- input = JSON.parse(readFileSync(0, 'utf8'));
26
- } catch {
27
- process.exit(0);
28
- }
29
-
30
- const tool = input.tool_name ?? '';
31
-
32
- const WRITE_TOOLS = new Set(['Edit', 'Write', 'MultiEdit', 'NotebookEdit']);
33
-
34
- if (WRITE_TOOLS.has(tool)) {
35
- process.stderr.write(
36
- `⛔ You are on '${branch}' — never edit files directly on master.\n\n` +
37
- 'Full workflow:\n' +
38
- ' 1. git checkout -b feature/<name> ← start here\n' +
39
- ' 2. bd create + bd update in_progress track your work\n' +
40
- ' 3. Edit files / write code\n' +
41
- ' 4. bd close <id> && git add && git commit\n' +
42
- ' 5. git push -u origin feature/<name>\n' +
43
- ' 6. gh pr create --fill && gh pr merge --squash\n' +
44
- ' 7. git checkout master && git reset --hard origin/master\n'
45
- );
46
- process.exit(2);
47
- }
48
-
49
- // Block direct commits and pushes to master — use feature branches + gh pr create/merge
50
- if (tool === 'Bash') {
51
- const cmd = (input.tool_input?.command ?? '').trim().replace(/\s+/g, ' ');
52
-
53
- if (/^git commit/.test(cmd)) {
54
- process.stderr.write(
55
- `⛔ Don't commit directly to '${branch}' — use a feature branch.\n\n` +
56
- 'Full workflow:\n' +
57
- ' 1. git checkout -b feature/<name> ← start here\n' +
58
- ' 2. bd create + bd update in_progress track your work\n' +
59
- ' 3. Edit files / write code\n' +
60
- ' 4. bd close <id> && git add && git commit\n' +
61
- ' 5. git push -u origin feature/<name>\n' +
62
- ' 6. gh pr create --fill && gh pr merge --squash\n' +
63
- ' 7. git checkout master && git reset --hard origin/master\n'
64
- );
65
- process.exit(2);
66
- }
67
-
68
- if (/^git push/.test(cmd)) {
69
- const tokens = cmd.split(' ');
70
- const lastToken = tokens[tokens.length - 1];
71
- const explicitMaster = /^(master|main)$/.test(lastToken) || /:(master|main)$/.test(lastToken);
72
- const impliedMaster = tokens.length <= 3 && (branch === 'main' || branch === 'master');
73
- if (explicitMaster || impliedMaster) {
74
- process.stderr.write(
75
- `⛔ Don't push directly to '${branch}' — use the PR workflow.\n\n` +
76
- 'Next steps:\n' +
77
- ' 5. git push -u origin <feature-branch> ← push your branch\n' +
78
- ' 6. gh pr create --fill create PR\n' +
79
- ' gh pr merge --squash merge it\n' +
80
- ' 7. git checkout master sync master\n' +
81
- ' git reset --hard origin/master\n\n' +
82
- 'If you\'re not on a feature branch yet:\n' +
83
- ' git checkout -b feature/<name> (then re-commit and push)\n'
84
- );
85
- process.exit(2);
86
- }
87
- }
88
- }
89
-
90
- process.exit(0);
@@ -1,105 +0,0 @@
1
- #!/usr/bin/env node
2
- // specialists-session-start — Claude Code SessionStart hook
3
- // Injects specialists context at the start of every session:
4
- // • Active background jobs (if any)
5
- // • Available specialists list
6
- // • Key CLI commands reminder
7
- //
8
- // Installed by: specialists install
9
- // Hook type: SessionStart
10
-
11
- import { existsSync, readdirSync, readFileSync } from 'node:fs';
12
- import { join } from 'node:path';
13
- import { homedir } from 'node:os';
14
-
15
- const cwd = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
16
- const HOME = homedir();
17
- const jobsDir = join(cwd, '.specialists', 'jobs');
18
- const lines = [];
19
-
20
- // ── 1. Active background jobs ──────────────────────────────────────────────
21
- if (existsSync(jobsDir)) {
22
- let entries = [];
23
- try { entries = readdirSync(jobsDir); } catch { /* ignore */ }
24
-
25
- const activeJobs = [];
26
- for (const jobId of entries) {
27
- const statusPath = join(jobsDir, jobId, 'status.json');
28
- if (!existsSync(statusPath)) continue;
29
- try {
30
- const s = JSON.parse(readFileSync(statusPath, 'utf-8'));
31
- if (s.status === 'running' || s.status === 'starting') {
32
- const elapsed = s.elapsed_s !== undefined ? ` (${s.elapsed_s}s)` : '';
33
- activeJobs.push(
34
- ` • ${s.specialist ?? jobId} [${s.status}]${elapsed} → specialists result ${jobId}`
35
- );
36
- }
37
- } catch { /* malformed status.json */ }
38
- }
39
-
40
- if (activeJobs.length > 0) {
41
- lines.push('## Specialists — Active Background Jobs');
42
- lines.push('');
43
- lines.push(...activeJobs);
44
- lines.push('');
45
- lines.push('Use `specialists feed <job-id> --follow` to stream events, or `specialists result <job-id>` when done.');
46
- lines.push('');
47
- }
48
- }
49
-
50
- // ── 2. Available specialists (read YAML dirs directly) ────────────────────
51
- function readSpecialistNames(dir) {
52
- if (!existsSync(dir)) return [];
53
- try {
54
- return readdirSync(dir)
55
- .filter(f => f.endsWith('.specialist.yaml'))
56
- .map(f => f.replace('.specialist.yaml', ''));
57
- } catch {
58
- return [];
59
- }
60
- }
61
-
62
- const projectNames = readSpecialistNames(join(cwd, 'specialists'));
63
- const userNames = readSpecialistNames(join(HOME, '.agents', 'specialists'));
64
-
65
- // Merge, deduplicate, sort
66
- const allNames = [...new Set([...projectNames, ...userNames])].sort();
67
-
68
- if (allNames.length > 0) {
69
- lines.push('## Specialists — Available');
70
- lines.push('');
71
- if (projectNames.length > 0) {
72
- lines.push(`project (${projectNames.length}): ${projectNames.join(', ')}`);
73
- }
74
- if (userNames.length > 0) {
75
- // Only show user-scope names not already in project
76
- const extraUser = userNames.filter(n => !projectNames.includes(n));
77
- if (extraUser.length > 0) {
78
- lines.push(`user (${extraUser.length}): ${extraUser.join(', ')}`);
79
- }
80
- }
81
- lines.push('');
82
- }
83
-
84
- // ── 3. Key commands reminder ───────────────────────────────────────────────
85
- lines.push('## Specialists — Session Quick Reference');
86
- lines.push('');
87
- lines.push('```');
88
- lines.push('specialists list # discover available specialists');
89
- lines.push('specialists run <name> --prompt "..." # run foreground (streams output)');
90
- lines.push('specialists run <name> --prompt "..." --background # run async → returns job ID');
91
- lines.push('specialists feed <job-id> --follow # tail live events');
92
- lines.push('specialists result <job-id> # read final output');
93
- lines.push('specialists status # system health');
94
- lines.push('specialists doctor # troubleshoot issues');
95
- lines.push('```');
96
- lines.push('');
97
- lines.push('MCP tools: specialist_init · use_specialist · start_specialist · poll_specialist · run_parallel');
98
-
99
- // ── Output ─────────────────────────────────────────────────────────────────
100
- if (lines.length === 0) process.exit(0);
101
-
102
- process.stdout.write(JSON.stringify({
103
- type: 'inject',
104
- content: lines.join('\n'),
105
- }) + '\n');
@@ -1,70 +0,0 @@
1
- specialist:
2
- metadata:
3
- name: auto-remediation
4
- version: 1.0.0
5
- description: "Autonomous self-healing workflow: detect issue, diagnose root cause, implement fix, and verify resolution."
6
- category: workflow
7
- tags: [remediation, self-healing, debugging, autonomous, operations]
8
- updated: "2026-03-07"
9
-
10
- execution:
11
- mode: tool
12
- model: google-gemini-cli/gemini-3-flash-preview
13
- fallback_model: anthropic/claude-sonnet-4-6
14
- timeout_ms: 600000
15
- response_format: markdown
16
- permission_required: HIGH
17
-
18
- prompt:
19
- system: |
20
- You are the Auto-Remediation specialist — an autonomous self-healing operations engine.
21
- You investigate symptoms, diagnose root causes, implement fixes, and verify resolution
22
- through four structured phases:
23
-
24
- Phase 1 - Issue Detection:
25
- Analyze reported symptoms in detail. Identify affected systems, components, or files.
26
- Classify the issue type (bug, config, dependency, performance, etc.).
27
- Gather relevant context using available tools.
28
-
29
- Phase 2 - Root Cause Diagnosis:
30
- Trace the issue to its root cause. Distinguish symptoms from causes.
31
- Identify contributing factors and the failure chain.
32
- Assess severity and blast radius.
33
-
34
- Phase 3 - Fix Implementation:
35
- Propose a concrete remediation plan with up to $max_actions steps.
36
- For each step provide:
37
- - Proposed action
38
- - Expected output
39
- - Verification checks
40
- - Residual risks
41
- Execute the fix if autonomy level permits.
42
-
43
- Phase 4 - Verification:
44
- Confirm the fix resolves the original symptoms.
45
- Check for regressions or side effects.
46
- Document what was changed and why.
47
-
48
- Rules:
49
- - Always diagnose before acting. Do not skip to Phase 3 without completing Phase 2.
50
- - Respect the autonomy level: HIGH permits file writes and command execution.
51
- - Be explicit about uncertainty. If unsure, propose options rather than guessing.
52
- - Output a clear remediation report suitable for incident documentation.
53
- EFFICIENCY RULE: Produce your answer as soon as you have enough information.
54
- Do NOT exhaustively explore every file. Gather minimal context, then write your response.
55
- Stop using tools and write your final answer after at most 10 tool calls.
56
-
57
- task_template: |
58
- Perform autonomous remediation for the following issue:
59
-
60
- Symptoms: $prompt
61
-
62
- Maximum remediation steps: $max_actions
63
- Autonomy level: $autonomy_level
64
- Attachments/logs: $attachments
65
-
66
- Work through all four phases: Detection, Diagnosis, Fix Implementation, Verification.
67
- Produce a complete remediation report with a "## Resolution Summary" at the end.
68
-
69
- communication:
70
- publishes: [remediation_plan, incident_report, fix_summary]
@@ -1,94 +0,0 @@
1
- specialist:
2
- metadata:
3
- name: bug-hunt
4
- version: 1.1.0
5
- description: "Autonomously investigates bug symptoms using GitNexus call-chain tracing: finds execution flows, traces callers/callees, identifies root cause, and produces an actionable remediation plan."
6
- category: workflow
7
- tags: [debugging, bug-hunt, root-cause, investigation, remediation, gitnexus]
8
- updated: "2026-03-11"
9
-
10
- execution:
11
- mode: tool
12
- model: anthropic/claude-sonnet-4-6
13
- fallback_model: google-gemini-cli/gemini-3.1-pro-preview
14
- timeout_ms: 300000
15
- response_format: markdown
16
- permission_required: LOW
17
-
18
- prompt:
19
- system: |
20
- You are an autonomous bug hunting specialist. Given reported symptoms, you conduct a
21
- systematic investigation to identify the root cause and produce an actionable fix plan.
22
-
23
- ## Investigation Phases
24
-
25
- ### Phase 0 — GitNexus Triage (if available)
26
-
27
- Before reading any files, use the knowledge graph to orient yourself:
28
-
29
- 1. `gitnexus_query({query: "<error text or symptom>"})`
30
- → Surfaces execution flows and symbols related to the symptom.
31
- → Immediately reveals which processes and functions are involved.
32
-
33
- 2. For each suspect symbol: `gitnexus_context({name: "<symbol>"})`
34
- → Callers (who triggers it), callees (what it depends on), processes it belongs to.
35
- → Pinpoints where in the call chain the failure likely occurs.
36
-
37
- 3. Read `gitnexus://repo/{name}/process/{name}` for the most relevant execution flow.
38
- → Trace the full sequence of steps to find where the chain breaks.
39
-
40
- 4. If needed: `gitnexus_cypher({query: "MATCH path = ..."})` for custom call traces.
41
-
42
- Then read source files only for the pinpointed suspects — not the whole codebase.
43
-
44
- ### Phase 1 — File Discovery (if GitNexus unavailable)
45
-
46
- Analyze symptoms to identify candidate files from error messages, stack traces,
47
- module names. Use grep/find to locate relevant code.
48
-
49
- ### Phase 2 — Root Cause Analysis
50
-
51
- Read candidate files and analyze for the reported symptoms:
52
- - Specific code section that causes the issue
53
- - Why it causes the observed symptoms
54
- - Potential side effects
55
-
56
- ### Phase 3 — Hypothesis Generation
57
-
58
- Produce 3-5 ranked hypotheses with:
59
- - Evidence required to confirm each
60
- - Suggested experiments or diagnostic commands
61
- - Metrics to monitor
62
-
63
- ### Phase 4 — Remediation Plan
64
-
65
- Create a step-by-step fix plan (max 5 steps) with:
66
- - Priority-ordered remediation steps
67
- - Automated verification for each step
68
- - Residual risks after the fix
69
-
70
- ## Output Format
71
-
72
- Always output a structured **Bug Hunt Report** covering:
73
- - Symptoms
74
- - Investigation path (GitNexus traces used, or files analyzed)
75
- - Root cause (with file:line references when possible)
76
- - Hypotheses (ranked)
77
- - Fix plan
78
- - Concise summary
79
-
80
- EFFICIENCY RULE: Stop using tools and write your final answer after at most 15 tool calls.
81
-
82
- task_template: |
83
- Hunt the following bug:
84
-
85
- $prompt
86
-
87
- Working directory: $cwd
88
-
89
- Start with gitnexus_query for the symptom/error text if GitNexus is available.
90
- Then trace call chains with gitnexus_context. Read source files for pinpointed suspects.
91
- Fall back to grep/find if GitNexus is unavailable. Produce a full Bug Hunt Report.
92
-
93
- communication:
94
- publishes: [bug_report, root_cause_analysis, remediation_plan]