pipeline-tune
Analyse the user's Claude Code (or other agent) logs and auto-configure the layered-pipeline compression profiles for their tools, models, and workflow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyse the user's Claude Code (or other agent) logs and auto-configure the layered-pipeline compression profiles for their tools, models, and workflow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Walk a project from "no values provisioned" to "doctor --secrets is green" — eight idempotent steps with resume support via setup-state.toml. Wraps the secret framework (ADR-023 §3.8) for AI agents and headless onboarding.
Bootstrap devboy from scratch — install the CLI if missing, register the MCP server, run `devboy onboard` for the active agent, optionally bootstrap the secret framework, verify with `doctor`. First-run skill for both manual installs and the Claude Code / Codex plugin.
First-run wizard for the devboy secret framework — walk a fresh project from "no secret manifest, no router, no daemon" to "every required secret provisioned and verified". Idempotent eight-step flow per ADR-023 §3.8 with state at ~/.devboy/secrets/setup-state.toml so the user can resume or skip.
Diagnose and fix a broken devboy-tools setup — corrupt config, missing tokens, keychain trouble, wrong paths, plugin install failures.
Enumerate and introspect the active tool bundle — names, categories, schemas, how to invoke each tool from the CLI.
Create a well-structured issue in the configured tracker using Feature, Defect, or Task templates.
| name | pipeline-tune |
| description | Analyse the user's Claude Code (or other agent) logs and auto-configure the layered-pipeline compression profiles for their tools, models, and workflow. |
| category | self-bootstrap |
| version | 1 |
| compatibility | devboy-tools >= 0.19 |
| activation | ["tune devboy pipeline","configure compression","analyse claude logs","set up pipeline profiles","what compression settings should I use"] |
| tools | ["tune","show","doctor"] |
Adapt the layered-pipeline (Paper 2 / crates/plugins/format-pipeline) to this user. The pipeline has four profile axes — tokenizer, LLM, agent/session, data/endpoint — and a horizontal hint policy. Defaults are conservative; this skill mines the user's existing agent logs to pick a tuned profile that matches their actual tool and model mix.
mcp__gitlab__get_issues) is dominating the context.After running this skill the user has a ~/.config/devboy/pipeline_config.toml (or ~/.devboy/pipeline_config.toml for the MCP-server hot path) with:
profiles.llm.active pinned to their dominant model (if ≥80% share);profiles.agent.active pinned to one of default / file_search_heavy / marathon_refactor based on session length, read-share, and compaction count;profiles.data.variants extended with placeholder entries for every observed mcp__* endpoint, ready for them to set preferred_format;hints policy left at safe defaults: schema_explainer is off (confirmed 0 lift in the 2026-04-25 evaluation), inline_format_hint is on only for local Ollama models.Once telemetry is on ([telemetry] enabled = true), live FormatMetadata from the MCP path reports the split savings:
dedup_savings_pct — fraction of tokens reclaimed by L0 cross-turn hints;encoder_savings_pct — fraction reclaimed by L1/L2 encoders, computed only over the L0-miss share of responses;combined_savings_pct — multiplicative composition (dedup + (1 − dedup) × encoder);baseline — the fixed baseline against which the percentages are taken (json_pretty for typed-domain transforms, json_compact for the offline tune analyze path);tokenizer — the BPE family driving the count (o200k_base / cl100k_base / heuristic).Quote those four numbers (plus the baseline + tokenizer) — not a single "saved X%" — when reporting back to the user. Per Paper 2 §Savings Accounting, savings without a named baseline and tokenizer are not comparable across systems.
command -v devboy >/dev/null || { echo "install devboy first"; exit 1; }
ls ~/.claude/projects/ >/dev/null 2>&1 || \
echo "no Claude logs at ~/.claude/projects — pass --input-dir <PATH> instead"
devboy tune from-claude-logs --dry-run
The command:
~/.claude/projects/<project>/*.jsonl and parses every line.mcp__* endpoint hits, sessions, and /compact events.profiles.llm.active, profiles.agent.active, and the new data-profile variants — without touching disk.Read the summary aloud to the user before applying:
# events — total parsed (more than ~5 000 means a confident fit).# model distribution — verify the dominant model is what they intend to keep using.# top mcp endpoints — these are candidates for per-domain templates.If the user agrees, drop --dry-run:
devboy tune from-claude-logs
Output ends with # wrote → ~/.config/devboy/pipeline_config.toml. The file is human-readable TOML — encourage the user to commit a project-local copy if they want it under VCS.
devboy tune show | head -80
Look for these markers:
[profiles.tokenizer] has all three variants (anthropic_class, openai_o200k, ollama_bpe).[profiles.llm] has active = "<their_model>".[profiles.agent] has active = "<inferred_variant>".[hints.types.schema_explainer] has enabled = false.If the active LLM is not in the variants list, the active value will fall back to "auto" — explain to the user that they can hand-add their model:
[profiles.llm.variants."their-model-name"]
tokenizer = "anthropic_class" # or openai_o200k / ollama_bpe
prefer_explicit_keys = true
context_window = 100000
max_inline_nested = 128
For every mcp__* endpoint that landed in profiles.data.variants without a preferred_format, ask the user what shape that tool returns:
| User says | Set preferred_format to |
|---|---|
| "list of issues / PRs / records" | csv_from_md |
| "log lines or pipeline output" | pipeline_deep_mckp |
| "code diff" | mr_diff_fence |
| "single configuration object" | kv |
| "free text / prose" | leave unset |
Edit the TOML directly and rerun devboy tune show to confirm.
After the first session with the new config, compare token usage in devboy doctor (or the user's billing dashboard). If the LLM accuracy drops on a specific endpoint, the most likely cause is an over-aggressive preferred_format — revert that endpoint to no preference and retry.
profiles.llm.active = "claude-sonnet-4.6" if the user's actual dominant model is something else. The tokenizer profile drives encoder choice; mismatching it will produce token estimates that are wrong by ~2× on Anthropic-class tokenizers.schema_explainer. It was confirmed to add 0 percentage points of accuracy lift in the 2026-04-25 evaluation. If a user asks for it, point them at §"Encoder Bug Postmortem" in paper-2-mckp-format-adaptive.md.from-claude-logs against a directory containing other tools' logs without --project. The aggregator does not anonymise across project boundaries; mixing projects produces a noisy fit.| Symptom | Cause | Fix |
|---|---|---|
claude logs directory not found | ~/.claude/projects doesn't exist on this machine | Pass --input-dir <PATH> to wherever the user keeps their agent logs. |
no jsonl events parsed — check the path | Path exists but contains no .jsonl, or the format is not a Claude Code log | Verify with `ls -R |
profiles.llm.active = "auto" after the run | Dominant model didn't reach 80% share, or it isn't in the built-in variants | Either accept the auto-resolution, or hand-add the model to profiles.llm.variants (see step 3). |
Wrong profiles.agent.active | The classifier saw an atypical session window | Override manually: edit pipeline_config.toml and set profiles.agent.active = "default" (or whatever fits). The next tune run respects the explicit value. |
docs/research/paper-2-mckp-format-adaptive.md §"Configuration Extensibility".crates/plugins/format-pipeline/src/adaptive_config.rs.crates/plugins/format-pipeline/src/bin/tune.rs; subcommand from-claude-logs.