From 243fae8476f947005ab151cc3845c69e51e903b6 Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 20:07:35 +0100 Subject: [PATCH 01/10] Add token-budget-advisor skill Skill that intercepts prompts, estimates token consumption across 4 depth levels, and lets the user choose before Claude responds. --- skills/token-budget-advisor/SKILL.md | 122 +++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 skills/token-budget-advisor/SKILL.md diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md new file mode 100644 index 00000000..ea126742 --- /dev/null +++ b/skills/token-budget-advisor/SKILL.md @@ -0,0 +1,122 @@ +--- +name: token-budget-advisor +description: >- + Intercepts the response flow to offer the user an informed choice about + how much depth/tokens to consume — BEFORE responding. Use this skill + when the user wants to control token consumption, adjust response depth, + choose between short/long answers, or optimize their prompt. + TRIGGER when: "tokens", "token budget", "profundidad", "consumo", + "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", + "responde al 50%", "dame la versión corta", "quiero controlar cuánto usas", + "ajusta tu respuesta", "short version", "tldr", "brief", "in 25%", + "in 50%", "in 75%", "exhaustive", or any variant where the user wants + to control length, depth, or token usage — even without mentioning tokens. + DO NOT TRIGGER when: user has already specified a level in the current + session (maintain it) or the request is clearly a one-word answer. +origin: community +--- + +# Token Budget Advisor (TBA) + +Intercept the response flow to offer the user a choice about response depth **before** Claude answers. + +## When to Use + +- User wants to control how long or detailed a response is +- User mentions tokens, budget, depth, or response length +- User says "short version", "tldr", "brief", "al 25%", "exhaustive", etc. +- Any time the user wants to choose depth/detail level upfront + +**Do not trigger** when: user already set a level this session (maintain it silently), or the answer is trivially one line. + +## Workflow + +### Step 1 — Estimate input tokens + +Use the calibration tables below to estimate the prompt's token count mentally. + +**Chars-per-token by content type:** + +| Content type | Chars / Token | +|-------------------|---------------| +| English natural | ~4.0 | +| Spanish natural | ~3.5 | +| Code | ~3.0 | +| JSON | ~2.8 | +| Markdown | ~3.3 | + +Formula: `input_tokens ≈ char_count / chars_per_token` + +For mixed content, use the dominant type's ratio. + +### Step 2 — Estimate response size by complexity + +Classify the prompt, then apply the multiplier range to get the full response window: + +| Complexity | Multiplier range | Example prompts | +|--------------|------------------|------------------------------------------------------| +| Simple | 3× – 8× | "What is X?", yes/no, single fact | +| Medium | 8× – 20× | "How does X work?" | +| Medium-High | 10× – 25× | Code request with context | +| Complex | 15× – 40× | Multi-part analysis, comparisons, architecture | +| Creative | 10× – 30× | Stories, essays, narrative writing | + +Response window = `input_tokens × mult_min` to `input_tokens × mult_max` (cap at 8 000). + +### Step 3 — Present depth options + +Present this block **before** answering, using the actual estimated numbers: + +``` +Analyzing your prompt... + +Input: ~[N] tokens | Type: [type] | Complexity: [level] | Language: [lang] + +Choose your depth level: + +[1] Essential (25%) -> ~[tokens] Direct answer only, no preamble +[2] Moderate (50%) -> ~[tokens] Answer + context + 1 example +[3] Detailed (75%) -> ~[tokens] Full answer with alternatives +[4] Exhaustive (100%) -> ~[tokens] Everything, no limits + +Which level? (1-4 or say "25%", "50%", "75%", "100%") + +Precision: heuristic estimate ~85-90% accuracy (±15%). +``` + +Level token estimates (within the response window): +- 25% → `min + (max - min) × 0.15` +- 50% → `min + (max - min) × 0.45` +- 75% → `min + (max - min) × 0.75` +- 100% → `max` + +### Step 4 — Respond at the chosen level + +| Level | Target length | Include | Omit | +|------------------|---------------------|-----------------------------------------------------|---------------------------------------------------| +| 25% Essential | 2-4 sentences max | Direct answer, key conclusion | Context, examples, nuance, alternatives | +| 50% Moderate | 1-3 paragraphs | Answer + necessary context + 1 example | Deep analysis, edge cases, references | +| 75% Detailed | Structured response | Multiple examples, pros/cons, alternatives | Extreme edge cases, exhaustive references | +| 100% Exhaustive | No restriction | Everything — full analysis, all code, all perspectives | Nothing | + +## Shortcuts — skip the question + +If the user already signals a level, respond at that level immediately without asking: + +| What they say | Level | +|----------------------------------------------------|-------| +| "25%" / "short" / "brief" / "tldr" / "one-liner" | 25% | +| "50%" / "moderate" / "normal" | 50% | +| "75%" / "detailed" / "thorough" / "complete" | 75% | +| "100%" / "exhaustive" / "everything" / "no limit" | 100% | + +If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it. + +## Precision note + +This skill uses heuristic estimation — no real tokenizer. Accuracy ~85-90%, variance ±15%. Always show the disclaimer. + +## Source + +Standalone skill from [TBA — Token Budget Advisor for Claude Code](https://github.com/Xabilimon1/Token-Budget-Advisor-Claude-Code-). +Full version includes a Python estimator script for exact counts: `npx token-budget-advisor`. From 7a17ec9b14300fdc18613e559d997d97405b78a9 Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 21:58:09 +0100 Subject: [PATCH 02/10] Update skills/token-budget-advisor/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- skills/token-budget-advisor/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index ea126742..0e36eaae 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -85,8 +85,8 @@ Precision: heuristic estimate ~85-90% accuracy (±15%). ``` Level token estimates (within the response window): -- 25% → `min + (max - min) × 0.15` -- 50% → `min + (max - min) × 0.45` +- 25% → `min + (max - min) × 0.25` +- 50% → `min + (max - min) × 0.50` - 75% → `min + (max - min) × 0.75` - 100% → `max` From 0284f6087192409fd63df9f2d59490faed144686 Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 21:58:23 +0100 Subject: [PATCH 03/10] Update skills/token-budget-advisor/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- skills/token-budget-advisor/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index 0e36eaae..fd814336 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -5,7 +5,7 @@ description: >- how much depth/tokens to consume — BEFORE responding. Use this skill when the user wants to control token consumption, adjust response depth, choose between short/long answers, or optimize their prompt. - TRIGGER when: "tokens", "token budget", "profundidad", "consumo", + TRIGGER when: "token budget", "token count", "token usage", "token limit", "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión corta", "quiero controlar cuánto usas", "ajusta tu respuesta", "short version", "tldr", "brief", "in 25%", From 9cfcfac665b20b721cf3a082e47594cbd9a054fd Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 21:58:31 +0100 Subject: [PATCH 04/10] Update skills/token-budget-advisor/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- skills/token-budget-advisor/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index fd814336..14aed72b 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -108,7 +108,7 @@ If the user already signals a level, respond at that level immediately without a | "25%" / "short" / "brief" / "tldr" / "one-liner" | 25% | | "50%" / "moderate" / "normal" | 50% | | "75%" / "detailed" / "thorough" / "complete" | 75% | -| "100%" / "exhaustive" / "everything" / "no limit" | 100% | +| "75%" / "detailed" / "thorough" | 75% | If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it. From 7cabf77142ab5957b3855e4de1bd79233605b701 Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 21:58:51 +0100 Subject: [PATCH 05/10] Update skills/token-budget-advisor/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- skills/token-budget-advisor/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index 14aed72b..2b70ea57 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -8,8 +8,8 @@ description: >- TRIGGER when: "token budget", "token count", "token usage", "token limit", "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión corta", "quiero controlar cuánto usas", - "ajusta tu respuesta", "short version", "tldr", "brief", "in 25%", - "in 50%", "in 75%", "exhaustive", or any variant where the user wants + "ajusta tu respuesta", "short version", "tldr", "brief", "25%", "50%", + "75%", "at 25%", "at 50%", "at 75%", "exhaustive", or any variant where the user wants to control length, depth, or token usage — even without mentioning tokens. DO NOT TRIGGER when: user has already specified a level in the current session (maintain it) or the request is clearly a one-word answer. From e6eb99271fb14a06351f355df331a3b47c521abf Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 21:58:59 +0100 Subject: [PATCH 06/10] Update skills/token-budget-advisor/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- skills/token-budget-advisor/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index 2b70ea57..c24662ed 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -61,7 +61,7 @@ Classify the prompt, then apply the multiplier range to get the full response wi | Complex | 15× – 40× | Multi-part analysis, comparisons, architecture | | Creative | 10× – 30× | Stories, essays, narrative writing | -Response window = `input_tokens × mult_min` to `input_tokens × mult_max` (cap at 8 000). +Response window = `input_tokens × mult_min` to `input_tokens × mult_max` (but don’t exceed your model’s configured output-token limit). ### Step 3 — Present depth options From ee3f348dcb2e7d4c589bdf8c48a8702dd078b0d0 Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 21:59:15 +0100 Subject: [PATCH 07/10] Update skills/token-budget-advisor/SKILL.md Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- skills/token-budget-advisor/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index c24662ed..625edeec 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -107,7 +107,7 @@ If the user already signals a level, respond at that level immediately without a |----------------------------------------------------|-------| | "25%" / "short" / "brief" / "tldr" / "one-liner" | 25% | | "50%" / "moderate" / "normal" | 50% | -| "75%" / "detailed" / "thorough" / "complete" | 75% | +| "75%" / "detailed" / "thorough" | 75% | | "75%" / "detailed" / "thorough" | 75% | If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it. From 917c35bb6f4658b18497223b82a5b23e8dd0e7c5 Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 22:02:13 +0100 Subject: [PATCH 08/10] Update skills/token-budget-advisor/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- skills/token-budget-advisor/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index 625edeec..4a3652cb 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -107,8 +107,8 @@ If the user already signals a level, respond at that level immediately without a |----------------------------------------------------|-------| | "25%" / "short" / "brief" / "tldr" / "one-liner" | 25% | | "50%" / "moderate" / "normal" | 50% | -| "75%" / "detailed" / "thorough" | 75% | -| "75%" / "detailed" / "thorough" | 75% | +| "75%" / "detailed" / "thorough" / "complete" | 75% | +| "100%" / "exhaustive" / "everything" / "full" | 100% | If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it. From 4da1fb388c29aac9aa2c19f72d85e20b18c9f1ef Mon Sep 17 00:00:00 2001 From: Xabilimon <9402474@alumnos.ufv.es> Date: Wed, 25 Mar 2026 22:02:20 +0100 Subject: [PATCH 09/10] Update skills/token-budget-advisor/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- skills/token-budget-advisor/SKILL.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index 4a3652cb..4f863e6f 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -8,8 +8,7 @@ description: >- TRIGGER when: "token budget", "token count", "token usage", "token limit", "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión corta", "quiero controlar cuánto usas", - "ajusta tu respuesta", "short version", "tldr", "brief", "25%", "50%", - "75%", "at 25%", "at 50%", "at 75%", "exhaustive", or any variant where the user wants + "75%", "100%", "at 25%", "at 50%", "at 75%", "at 100%", "exhaustive", or any variant where the user wants to control length, depth, or token usage — even without mentioning tokens. DO NOT TRIGGER when: user has already specified a level in the current session (maintain it) or the request is clearly a one-word answer. From 9a55fd069bba5e35990ad1aa197d4a0453b31f5b Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Sun, 29 Mar 2026 00:14:17 -0400 Subject: [PATCH 10/10] fix(skills): harden token budget advisor skill --- AGENTS.md | 4 +-- README.md | 6 ++-- manifests/install-modules.json | 1 + skills/token-budget-advisor/SKILL.md | 52 +++++++++++++++++----------- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 750414de..e195b696 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # Everything Claude Code (ECC) — Agent Instructions -This is a **production-ready AI coding plugin** providing 28 specialized agents, 125 skills, 60 commands, and automated hook workflows for software development. +This is a **production-ready AI coding plugin** providing 29 specialized agents, 133 skills, 60 commands, and automated hook workflows for software development. **Version:** 1.9.0 @@ -141,7 +141,7 @@ Troubleshoot failures: check test isolation → verify mocks → fix implementat ## Project Structure ``` -agents/ — 28 specialized subagents +agents/ — 29 specialized subagents skills/ — 125 workflow skills and domain knowledge commands/ — 60 slash commands hooks/ — Trigger-based automations diff --git a/README.md b/README.md index 8d3b5bd3..c28048f1 100644 --- a/README.md +++ b/README.md @@ -212,7 +212,7 @@ For manual install instructions see the README in the `rules/` folder. /plugin list everything-claude-code@everything-claude-code ``` -✨ **That's it!** You now have access to 28 agents, 125 skills, and 60 commands. +✨ **That's it!** You now have access to 29 agents, 133 skills, and 60 commands. --- @@ -273,7 +273,7 @@ everything-claude-code/ | |-- plugin.json # Plugin metadata and component paths | |-- marketplace.json # Marketplace catalog for /plugin marketplace add | -|-- agents/ # 28 specialized subagents for delegation +|-- agents/ # 29 specialized subagents for delegation | |-- planner.md # Feature implementation planning | |-- architect.md # System design decisions | |-- tdd-guide.md # Test-driven development @@ -1085,7 +1085,7 @@ The configuration is automatically detected from `.opencode/opencode.json`. |---------|-------------|----------|--------| | Agents | ✅ 28 agents | ✅ 12 agents | **Claude Code leads** | | Commands | ✅ 60 commands | ✅ 31 commands | **Claude Code leads** | -| Skills | ✅ 125 skills | ✅ 37 skills | **Claude Code leads** | +| Skills | ✅ 133 skills | ✅ 37 skills | **Claude Code leads** | | Hooks | ✅ 8 event types | ✅ 11 events | **OpenCode has more!** | | Rules | ✅ 29 rules | ✅ 13 instructions | **Claude Code leads** | | MCP Servers | ✅ 14 servers | ✅ Full | **Full parity** | diff --git a/manifests/install-modules.json b/manifests/install-modules.json index 8b6e175a..c35578ff 100644 --- a/manifests/install-modules.json +++ b/manifests/install-modules.json @@ -407,6 +407,7 @@ "skills/ralphinho-rfc-pipeline", "skills/regex-vs-llm-structured-text", "skills/search-first", + "skills/token-budget-advisor", "skills/team-builder" ], "targets": [ diff --git a/skills/token-budget-advisor/SKILL.md b/skills/token-budget-advisor/SKILL.md index 4f863e6f..019c4366 100644 --- a/skills/token-budget-advisor/SKILL.md +++ b/skills/token-budget-advisor/SKILL.md @@ -5,10 +5,13 @@ description: >- how much depth/tokens to consume — BEFORE responding. Use this skill when the user wants to control token consumption, adjust response depth, choose between short/long answers, or optimize their prompt. - TRIGGER when: "token budget", "token count", "token usage", "token limit", + TRIGGER when: "token budget", "response token budget", "token count", + "token usage", "response length", "response depth", "brief answer", + "short answer", "detailed answer", "full answer", "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión corta", "quiero controlar cuánto usas", - "75%", "100%", "at 25%", "at 50%", "at 75%", "at 100%", "exhaustive", or any variant where the user wants + "75%", "100%", "at 25%", "at 50%", "at 75%", "at 100%", + "give me the full answer", or any variant where the user wants to control length, depth, or token usage — even without mentioning tokens. DO NOT TRIGGER when: user has already specified a level in the current session (maintain it) or the request is clearly a one-word answer. @@ -28,25 +31,16 @@ Intercept the response flow to offer the user a choice about response depth **be **Do not trigger** when: user already set a level this session (maintain it silently), or the answer is trivially one line. -## Workflow +## How It Works ### Step 1 — Estimate input tokens -Use the calibration tables below to estimate the prompt's token count mentally. +Use the repository's canonical estimation guidance from `skills/context-budget`. -**Chars-per-token by content type:** +- Prose-first prompts: `input_tokens ≈ word_count × 1.3` +- Code-heavy or mixed prompts: `input_tokens ≈ char_count / 4` -| Content type | Chars / Token | -|-------------------|---------------| -| English natural | ~4.0 | -| Spanish natural | ~3.5 | -| Code | ~3.0 | -| JSON | ~2.8 | -| Markdown | ~3.3 | - -Formula: `input_tokens ≈ char_count / chars_per_token` - -For mixed content, use the dominant type's ratio. +For mixed content, prefer the code-heavy estimate as the conservative default. ### Step 2 — Estimate response size by complexity @@ -104,10 +98,10 @@ If the user already signals a level, respond at that level immediately without a | What they say | Level | |----------------------------------------------------|-------| -| "25%" / "short" / "brief" / "tldr" / "one-liner" | 25% | -| "50%" / "moderate" / "normal" | 50% | -| "75%" / "detailed" / "thorough" / "complete" | 75% | -| "100%" / "exhaustive" / "everything" / "full" | 100% | +| "1" / "25%" / "short answer" / "brief" / "tldr" / "one-liner" | 25% | +| "2" / "50%" / "moderate detail" / "balanced answer" | 50% | +| "3" / "75%" / "detailed answer" / "thorough explanation" | 75% | +| "4" / "100%" / "exhaustive" / "everything" / "full answer" | 100% | If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it. @@ -115,7 +109,23 @@ If the user set a level earlier in the session, **maintain it silently** for sub This skill uses heuristic estimation — no real tokenizer. Accuracy ~85-90%, variance ±15%. Always show the disclaimer. +## Examples + +### Triggers + +- "Give me the brief answer first." +- "How many tokens will your response use?" +- "Respond at 50% depth." +- "I want the full answer." +- "Dame la version corta." + +### Does Not Trigger + +- "Explain OAuth token refresh flow." (`token` here is domain language, not a budget request) +- "Why is this JWT token invalid?" (security/domain usage, not response sizing) +- "What is 2 + 2?" (trivially short answer) + ## Source Standalone skill from [TBA — Token Budget Advisor for Claude Code](https://github.com/Xabilimon1/Token-Budget-Advisor-Claude-Code-). -Full version includes a Python estimator script for exact counts: `npx token-budget-advisor`. +The upstream project includes an optional estimator script, but this ECC skill intentionally stays zero-dependency and heuristic-only.