Skip to content

Commit 9cf3d64

Browse files
committed
chore: improve skill
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
1 parent e378803 commit 9cf3d64

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

CLAUDE.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,29 @@ AI tool ← MCP server (get_build_errors) ← store.Drain() ← per
5656
- **Host field**: `LogMessage.Host` is set via cached `os.Hostname()` at capture startup. Used for multi-source origin labeling. GreptimeDB uses `COALESCE(host, '')` for backward compat with pre-existing rows.
5757
- **File store IPC**: `pending.jsonl` → atomic rename to `pending.jsonl.draining` → read → delete. Leftover lines written back to prevent data loss.
5858
- **Config merge**: `.mcp.json` / `settings.json` / `opencode.json` reads existing → upserts devtap entry → writes back. Never overwrites other tools' config.
59-
- **Instruction injection**: Appends `<!-- devtap:start -->` / `<!-- devtap:end -->` block to project instruction files. Idempotent via marker detection.
59+
- **Instruction injection**: Appends `<!-- devtap:start -->
60+
## devtap
61+
62+
devtap captures build/dev output from a separate terminal and delivers it here via MCP.
63+
64+
**You MUST check devtap in these situations:**
65+
- At the start of each new task or conversation turn
66+
- Before writing or editing any code
67+
- After being told that a build, test, or dev server has new output
68+
69+
**Use this call order:**
70+
1. Call "get_build_status" once at the start of the turn.
71+
2. Call "get_build_errors" when status reports pending messages, when the user says new output arrived, or before the first code edit in the turn.
72+
73+
**Call limit per turn:** call "get_build_errors" at most once per turn unless new output is reported.
74+
75+
**Multi-source mode:** when devtap drains from multiple sources, tags are prefixed with "host/label |" (for example, "[devtap: myhost/local | make]"). "host" is the machine name, "label" identifies the source. Show these prefixes as-is. If output includes source warnings (for example, source unreachable), show those warnings verbatim and continue with output from reachable sources.
76+
77+
**Output format:** when "get_build_errors" returns content:
78+
If build succeeded, acknowledge briefly (do not repeat the output).
79+
If build failed, present the error output verbatim in a fenced code block.
80+
Then add one line: "Next action: <what you will do>".
81+
<!-- devtap:end -->` block to project instruction files. Idempotent via marker detection.
6082
- **Session encoding**: `session.EncodeDir("/foo/bar")``"-foo-bar"`, shared across adapters.
6183
- **Capture modes**: `runner.go` (batch, flush every 50 lines) vs `longrun.go` (debounce timer, for dev servers).
6284
- **Scanner buffers**: 64KB initial / 1MB max (`internal/capture/errors.go`). On scanner error (line >1MB), pipe is drained to discard to prevent child process deadlock.

skills/devtap-get-build-errors/SKILL.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: devtap-get-build-errors
3-
description: Fetch pending devtap build/dev output for the current turn using get_build_status and get_build_errors. Use when the user asks to check build errors, latest build logs, or "/get_build_errors"-style actions.
3+
description: Fetch devtap output for the current turn. Default to concise summaries and print raw logs only on explicit request.
44
metadata:
55
short-description: Fetch devtap output
66
---
@@ -16,14 +16,18 @@ Use this skill when the user asks for build errors, latest build output, or an e
1616
- status reports pending output
1717
- user explicitly asks to fetch/check logs now
1818
- user says new build/test/dev output arrived
19-
3. If build succeeded, acknowledge briefly (do not repeat the output).
20-
4. If build failed, present the error output verbatim in a fenced code block.
21-
5. Keep source warnings verbatim (for example, unreachable source warnings).
22-
6. After the output, add one line: `Next action: <what you will do>`.
19+
3. If build succeeded, acknowledge briefly (do not repeat output).
20+
4. If build failed, provide a concise summary by default:
21+
- source label(s)
22+
- final failure signal (for example exit code or test summary)
23+
- most actionable failing case/file/error line(s)
24+
5. Show raw output verbatim only when the user explicitly asks for full/raw/original logs.
25+
6. Keep source warnings verbatim (for example, unreachable source warnings).
26+
7. After the output (or summary), add one line: `Next action: <what you will do>`.
2327

2428
## Rules
2529

2630
- Do not fabricate or reinterpret error content.
2731
- Do not call `get_build_errors` repeatedly in the same turn unless new output is reported.
28-
- MCP tool names map to CLI subcommands: `get_build_status` `devtap status`, `get_build_errors` `devtap drain`.
32+
- MCP tool names map to CLI subcommands: `get_build_status` -> `devtap status`, `get_build_errors` -> `devtap drain`.
2933
- If MCP tools are unavailable, use `scripts/get_build_errors.sh` as CLI fallback.

0 commit comments

Comments
 (0)