Commit Graph
11 Commits
Author SHA1 Message Date
haelyra e9f95e394f fix: reconcile profile projections and selected-model fallback checks 2026-10-11 03:05:59 -04:00
haelyra 807c98aff6 fix: preserve cheap native context routing from PR 2740 2026-10-11 02:02:55 -04:00
affaan-m f4d06f7211 docs(context-budget): scope transcript accounting to explicit private inputs
Preserve contributor history while applying the exact reviewed current-main repair.

Source-PR: https://github.com/affaan-m/ECC/pull/2819
Source-Parent: 67ba5685ff
Integration-Main: d3b8a3e908
Review-Manifest-SHA256: 73b385b84c741b0266ab33008abb5cc1ac90b1db411053203ce11fac6556131b
2026-09-28 03:49:38 -04:00
robinryuk 67ba5685ff fix(skills): remove duplicated CLAUDE.md heading
Splice artifact from the previous commit — the replacement text ended with the same
anchor string it was spliced against, so the heading was emitted twice. Caught in review.
2026-08-19 10:21:30 +07:00
robinryuk b620c0d605 fix(skills): correct the headroom guidance in context-budget
Both reviewers were right and the original guidance was self-contradictory: it said
attachments are charged to the context window, then told the report to exclude them
when stating remaining room.

Greptile's P1 is the sharper half — after a compaction, pre-compaction turns remain in
the JSONL while the model's active context holds only the summary, so counting
persisted bytes misreports headroom in the other direction too.

The section now says plainly that a transcript is a durable log, not a view of the
context window, and that remaining room must not be reported from its size. The
number is framed as a cost signal instead: scaffolding is rebuilt on every reconnect,
so trimming a component saves tokens once per reconnect rather than once per session.

Snippet fixes: emits an explicit >40% warning with one decimal place rather than
leaving the threshold in prose, guards a missing transcript, exits cleanly on an empty
one, counts bytes rather than characters, and treats a malformed line as conversation
instead of crashing. Verified against all four cases.
2026-08-19 09:27:26 +07:00
robinryuk c00eb80904 feat(skills): context-budget — account for reconnect scaffolding
context-budget inventories components that load once at startup. On a reconnect the
app re-injects much of that inventory into the session transcript as attachment lines,
and that lands in the same context window.

Measured on a session that had reconnected once: 33,884 of 49,830 bytes was
scaffolding — skill_listing 14.6KB, mcp_instructions_delta 8.1KB, deferred_tools_delta
7.1KB, agent_listing_delta 2.6KB — against 15.9KB of actual conversation.

Adds a measure-it-yourself snippet, a >40% flag, and the consequence for the rest of
the skill: a trimmed skill or MCP server saves tokens once per reconnect, not once per
session. Also notes that transcript size is a poor proxy for context fullness unless
attachment lines are excluded.
2026-08-19 08:41:22 +07:00
d29cf651c7 fix(skills): declare activation triggers in descriptions and normalize version metadata (#2618)
* fix(skills): move version into metadata and normalize to semver

29 skills declared `version` at the top level of their frontmatter. The
schema reads it from `metadata`, so tooling that follows the schema either
misses it or has to special-case the top level.

Three motion skills also declared `version: 1.0`, which is not a valid
semantic version; normalized to `1.0.0`.

No behavioral change — frontmatter metadata only.

* fix(skills): state activation triggers in skill descriptions

148 skills described what they cover but never named the situation that
should trigger them. Since the description is what Claude matches against
to decide whether to load a skill, a description without a trigger makes
activation guesswork — the skill is either missed or loaded at the wrong
time.

Added a "Use when ..." clause to each, derived from the skill's own body
(most already stated the trigger under "## When to Use" or in the opening
line; that intent is now reflected in the frontmatter where it is actually
read from).

Descriptions were only appended to; no existing wording was removed.

* fix(skills): sync activation triggers into the Codex skill mirror

10 of the skills whose descriptions changed are also mirrored under
`.agents/skills/`, where the description was previously a verbatim copy.
Left alone, the two surfaces would disagree about when the skill applies.

Only the description line is synced; the Codex copies keep their reduced
frontmatter, since that validator accepts only name, description,
metadata, license, and allowed-tools.

* fix(skills): correct three activation clauses from review

- autonomous-loops: the clause pulled new loop work into a skill that its
  own body marks as a compatibility shim retained for one release. It now
  points at the canonical continuous-agent-loop instead.
- continuous-learning: the description carried the v1 routing directive
  twice; collapsed to one.
- homelab-pihole-dns: the clause fired on any broken home DNS. Narrowed to
  tasks that actually involve Pi-hole.

* chore: retain current main lockfile

---------

Co-authored-by: Çağrı Solakoğlu <cagri.solakoglu@vtcenerji.com>
Co-authored-by: haelyra <49814733+haelyra@users.noreply.github.com>
2026-08-11 23:58:14 -04:00
haelyra 6ab6cfd9b4 fix: route context checks to native meters 2026-08-09 17:32:15 -04:00
BERORINPO db7f2a6fd5 fix(skills): move top-level origin frontmatter key under metadata
The official Agent Skills spec (agentskills.io/specification) whitelists exactly
6 top-level frontmatter keys (name/description/license/compatibility/metadata/
allowed-tools). A top-level `origin` key fails the official validator
(anthropics/skills quick_validate.py ALLOWED_PROPERTIES; skills-ref validate).

This moves `origin: X` -> `metadata.origin: X` across the canonical skills/
tree, preserving each value verbatim. Frontmatter-only, minimal diff.

- 251 SKILL.md updated (242 new metadata block, 9 appended to existing metadata)
- origin values preserved verbatim (verified 251/251)
- YAML validated on all changed files
- scoped to canonical skills/ only (docs/<lang> translations + tool mirrors
  .cursor/.kiro/.agents left untouched; presumably regenerated from canonical)

Addresses #2233
2026-06-11 21:12:21 +09:00
Affaan Mustafa 866d9ebb53 fix: harden unicode safety checks 2026-03-29 21:21:18 -04:00
vazidmansuri005andvazidmansuri005 0efd6ed914 feat(commands): add /context-budget optimizer command (#554)
* feat(commands): add /context-budget optimizer command

Adds a command that audits context window token consumption across
agents, skills, rules, MCP servers, and CLAUDE.md files.

Detects bloated agent descriptions, redundant components, MCP
over-subscription, and CLAUDE.md bloat. Produces a prioritized
report with specific token savings per optimization.

Directly relevant to #434 (agent descriptions too verbose, ~26k
tokens causing performance warnings).

* fix: address review feedback on context-budget command

- Add $ARGUMENTS to enable --verbose flag passthrough
- Fix MCP token estimate: 45 tools × ~500 tokens = ~22,500 (was ~2,200)
- Fix heavy agents example: all 3 now exceed 200-line threshold
- Fix description threshold: warning at >30 words, fail at >50 words
- Add Step 4 instructions (was empty)
- Fix audit cadence: "quarterly" → "regularly" + "monthly" consistently
- Fix Output Format heading level under Step 4
- Replace "Antigravity" with generic "harness versions"
- Recalculate total overhead to match corrected MCP numbers

* fix: correct MCP tool count and savings percentage in sample output

- Fix MCP tool count: table now shows 87 tools matching the issues
  section (was 45 in table vs 87 in issues)
- Fix savings percentage: 5,100 / 66,400 = 7.7% (was 20.6%)
- Recalculate total overhead and effective context to match

* fix: correct sample output arithmetic

- Fix total overhead: 66,400 → 66,100 to match component table sum
  (12,400 + 6,200 + 2,800 + 43,500 + 1,200 = 66,100)
- Fix MCP savings: ~1,500 → ~27,500 tokens (55 tools × 500 tokens/tool)
  to match the per-tool formula defined in Step 1
- Reorder optimizations by savings (MCP removal is now #1)
- Fix total savings and percentage (31,100 / 66,100 = 47.0%)

* fix: distinguish always-on vs on-demand agent overhead

Agent descriptions are always loaded into Task tool routing context,
but the full agent body is only loaded when invoked. The audit now
measures both: description-only tokens as always-on overhead and
full-file tokens as worst-case overhead. This resolves the
contradiction between Step 1 (counting full files) and Tip 1 (saying
only descriptions are loaded per session).

* fix: simplify agent accounting and resolve inconsistencies

- Revert to single agent overhead metric (full file tokens) — simpler
  and matches what the report actually displays
- Add back 200-line threshold for heavy agents in Step 1
- Fix heavy agents action to match issue type (split/trim, not
  description-only)
- Remove .agents/skills/ scan path (doesn't exist in ECC repo)
- Consolidate description threshold to single 30-word check

* fix: add model assumption and verbose mode activation

- Step 4: assume 200K context window by default (Claude has no way to
  introspect its model at runtime)
- Step 4: add explicit instruction to check $ARGUMENTS for --verbose
  flag and include additional output when present

* fix: handle .agents/skills/ duplicates in skill scan

Skills scan now checks .agents/skills/ for Codex harness copies and
skips identical duplicates to avoid double-counting overhead.

* fix: add savings estimate to heavy agents action for consistency

* feat(skills): add context-budget backing skill, slim command to delegator

* fix: use structurally detectable classification criteria instead of session frequency

---------

Co-authored-by: vazidmansuri005 <vazidmansuri005@users.noreply.github.com>
2026-03-20 00:20:23 -07:00