Skip to content

Enhancement: one-line clipped descriptions in the "Available Skills" system-prompt section #910

Closed

Description

@maxivillus

Summary

The "Available Skills" section of the system prompt lists every loaded skill's full description verbatim. Long descriptions (200–400 chars, often multi-line with [[wiki]]-style references) make the section heavy, and since the section is part of the cache-stable prompt prefix, its size costs tokens on every turn regardless of whether the skill is ever invoked. Skills are invoked by /name — the full description is rarely needed up front.

Gap

build_system_prompt_full_with_capabilities and build_system_prompt_split_with_capabilities (crates/jcode-base/src/prompt.rs) append - \/name` — ` with no clipping or whitespace normalization; a description containing newlines breaks the one-line-per-skill format.

Proposed change (implemented and verified locally)

  • clip_skill_description: collapse all whitespace to single spaces (one line per entry), clip to SKILL_DESC_MAX_CHARS = 120 chars on a char boundary with a … suffix when truncated.
  • Applied in both section builders; full bodies still load on demand via /skillname.

Impact (measured, tiktoken o200k_base)

23 skills, host runtime set: Available Skills section 1 243 → 668 tokens (x1.86); descriptions part 5 179 → ~2.4 KB.

Verification

  • 4 unit tests (skills_clip_tests): long-description clipping, short-description whitespace collapse, Cyrillic char-boundary, section-builder integration.
  • cargo check -p jcode-base + ACP smoke pass on the built image.

Files

crates/jcode-base/src/prompt.rs (clip_skill_description, both section builders).

Activity

  1. added
    enhancement
    priority: low
    autonomous: clear
    ux
    on Aug 13, 2026
  2. 1jehuang commented on Aug 13, 2026

    @1jehuang
    Owner

    I added shared one-line, whitespace-normalized, UTF-8-safe clipping for skill descriptions in both system-prompt builders, with prompt regression tests. Fix: #918.

    --- — Jcode agent (automated triage), on behalf of @1jehuang

  3. added
    triage: fixed-pending-release
    on Aug 13, 2026
  4. added a commit that references this issue on Aug 13, 2026
    898e3ef
  5. added a commit that references this issue on Aug 15, 2026
    a8e0afd
  6. added a commit that references this issue on Aug 28, 2026
    877e57f
  7. added 5 commits that reference this issue on Aug 30, 2026
    468f3a1
    74c3148
    7df9d7b
    4258a49
    c70f45c
  8. added a commit that references this issue on Sep 18, 2026
    84740e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: clearenhancementpriority: lowtriage: fixed-pending-releaseux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions