Skip to content

feat(chat): show loaded skills as markdown cards - #16788

Merged
bolichen97 merged 1 commit into
mainfrom
feat/skill-load-card
Oct 6, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/skill-load-card

Conversation

@hoang-phan98

@hoang-phan98 hoang-phan98 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let users inspect the exact skill instructions loaded through the $ picker without expanding the transcript by default.

A selected skill currently leaves one plain confirmation line. The transcript gives no way to inspect the instructions that entered that turn.

Why it matters

Users can verify which procedure guided a turn. The collapsed default keeps routine skill loads compact, while the saved body remains accurate after a skill changes or disappears.

Not a goal

  • Change how the $ picker resolves or loads skills.
  • Fetch the current skill file when an old transcript expands.
  • Change Dev Fleet pod discovery or lifecycle behavior.

What changed

Skills are reusable instruction documents that guide an agent turn. The card lets users verify those exact instructions without keeping them expanded in the transcript.

Area Result
src/kiro_crew/dashboard The skill-load row keeps the exact ordered, redacted, frontmatter-free skill bodies that entered the turn.
website/src/pages/chat and website/src/app-sdk A collapsed card uses a book icon and names the loaded skill or skills. The shared outer header now gains a visible background on hover, so skill and compaction headers read as buttons. A one-skill card keeps the existing outer toggle and capped, faded body. A card with several skills opens to one dimmed context line and one row per skill. Each saved-skill button opens only that skill's capped, keyboard-scrollable body, so every other skill header remains reachable. A new skill with an empty body stays static and says “This skill has no instructions”.
website/src/i18n Every shipped locale carries “Skill instructions the agent followed this turn”, “Instructions weren't recorded for older turns”, and “This skill has no instructions”.
website/src/test Component coverage pins the shared hover class, two initially collapsed skill rows, per-skill expansion, the reachable second row, unchanged single-skill layout, mixed saved and empty bodies, legacy multi-skill rows, scroll cues, and both transcript registries.

The gateway attaches body snapshots to the existing system row, so expansion needs no later filesystem read. The frontend validates the metadata and falls back to a finished, non-interactive name-only card for older rows.

Saving the redacted body in history is intentional. It preserves the exact instructions used by the turn after a skill changes or disappears. Existing dollar-skill count and file-read caps bound each row, and the collapsed default prevents visual transcript growth.

The rendered body uses the existing sanitized markdown pipeline.

Backwards compatibility

Compatible: existing transcript rows retain their text and render as finished name-only cards when no body snapshot exists.

Removes nothing: skill selection, prompt injection, persisted rows, and older gateway payloads remain supported.

Tests

  • Backend tests verify ordered body snapshots, redaction reuse, and frontmatter removal.
  • Eleven skill-card tests cover singular and plural titles, collapsed defaults, shared header hover, two per-skill rows, isolated row expansion, the reachable second row, unchanged single-skill rendering, mixed saved and empty bodies, legacy multi-skill rows, long bodies, and both renderer registries.
  • Twenty compaction-card tests verify that the shared disclosure shell preserves every existing compaction state and receives the hover affordance.
  • The final local checks passed: 31 focused frontend tests, TypeScript, ESLint, i18n against the rebased base, docs lint, the theme-color check, and the production frontend build.
  • CI runs the full frontend and backend suites plus review lanes on this head.

Manual verification

One isolated gateway ran from this worktree's own virtual environment. It used a fresh temporary home copied from the minimal fixture, the standalone profile, disabled crons, a disabled tunnel, and the packaged fake ACP backend.

The legacy prompt, exact legacy row, and a short assistant reply were planted by hand before gateway startup. The row was 📎 Loaded skill(s) via $: **legacy-explain-for**.

The mixed-body prompt, structured row, and a short assistant reply were also planted before startup. The row contains one saved body and one empty body. A live load can produce this mix only when one resolved skill's body is empty, because _expand_dollar_skills saves a body for every resolved skill. The empty row says “This skill has no instructions”. A malformed row is not needed.

Every other $ message was typed into the dashboard composer and sent with Enter. No message was posted directly to the chat API. Each screenshot confirms that the prompt bubble is visible above its card.

The seven screenshots show the completed legacy turn, the collapsed multi-skill card under the visible header hover, both collapsed skill rows, one capped skill body with the other row still reachable, the unchanged single-skill body at desktop and 390 by 844, and the completed planted mixed turn. Geometry checks confirmed the active bottom fade, 15px H1, 14px H2, and no mobile horizontal overflow on commit b8fa754cc792c4b0533465df9eb60b9fb9a66dc3.

The gateway was stopped by its recorded PID. Its temporary home was deleted.

Screenshots / video

Before

Plain loaded-skill line

After

Legacy name-only row

Legacy loaded skill card under a completed planted turn

Two skills collapsed with header hover

Two loaded skills collapsed with the shared header hover state visible

Two skill rows collapsed

Two loaded skills with the outer card open and both skill rows collapsed

One skill row open

Explain-for open in a capped body while the five-whys row remains visible

Single skill at desktop width

Single loaded skill expanded at desktop width with compact headings and bottom fade

Single skill at 390 by 844

Single loaded skill expanded at 390 by 844 with no horizontal overflow

Mixed saved and empty bodies

Completed planted mixed turn with one saved body and one empty body

Related Issues

Closes #16754

Checklist

  • At most two commits, with one conventional commit
  • Existing feature-related tests pass and new tests cover the new behavior
  • Self-review completed; code follows project style guidelines
  • Documentation updated
  • No secrets, credentials, or internal references in the diff

@hoang-phan98
hoang-phan98 requested a review from a team October 4, 2026 16:36
@hoang-phan98
hoang-phan98 requested a review from a team as a code owner October 4, 2026 16:36
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of b8fa754cc792c4b0533465df9eb60b9fb9a66dc3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that legacy rows, recognised only by the exact 📎 Loaded skill(s) via \$`` text, still render as cards whenever that notice wording changes.

[DESIGN-REVIEWED] b8fa754

Description read

[DESCRIPTION-READ] 6bcd5b06715a024c305833a41a50bfeb18c6d3e9cde16c3667928277a1a474c6

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of b8fa754cc792c4b0533465df9eb60b9fb9a66dc3 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The capped skill body's bottom fade adds .markdown-disclosure-scroll-more, a second copy of the existing .pinned-scroll-more fade.

Not justified as shipped

  • Item 6 — duplicate of website/src/index.css .pinned-scroll-more: the new .markdown-disclosure-scroll-more{mask-image:linear-gradient(to bottom,var(--text) calc(100% - 20px),transparent)} uses the same gradient, the same 20px feather and the same bottom-only placement as .pinned-scroll-more{mask-image:linear-gradient(to bottom,black calc(100% - 20px),transparent)}. A mask reads only alpha, and var(--text) and black are both opaque, so the two classes render identically. I grepped scroll-more and found 1 existing class doing this job.
    Subtraction: delete .markdown-disclosure-scroll-more and have MarkdownDisclosureBody apply pinned-scroll-more.
    Clears when: the new class is deleted and the existing one is reused, or a render shows the two fades differ.
  • Item 7 — undeclared: compaction summaries now get the bottom scroll fade too, because they render through the shared MarkdownDisclosureBody. The description mentions only the hover change reaching compaction ("receives the hover affordance").

What this change ships

Inventory (9 items) — 7 justified

Intent: let users read the exact skill instructions a $-picked skill injected into a turn, collapsed by default. This is an ADDITION (closes #16754).

  1. The skill-load line now shows as a collapsed card with a book icon and the skill names — justified
  2. Expanding the card shows the saved, redacted skill body for that turn — justified
  3. Chat history now saves each loaded skill's redacted body in the row's metadata — justified
  4. A card with several skills opens to one row per skill, each expanding on its own — justified
  5. Skill-load rows from older gateways show names only and say instructions weren't recorded — justified
  6. Capped skill bodies fade at the bottom until scrolled to the end — duplicate of index.css .pinned-scroll-more
  7. Compaction summary bodies gain the same bottom fade — undeclared
  8. Skill and compaction card headers get a hover background — justified
  9. Headings inside skill bodies render smaller than headings in assistant answers — justified

[FIRST-PRINCIPLES-REVIEWED] b8fa754

Description read

[DESCRIPTION-READ] f7e2ae01beb1548e2de6ec012f29f2e809a02191bf083c573f45e8d4ffc82fcf

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of b8fa754cc792c4b0533465df9eb60b9fb9a66dc3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The first-time reader's take on the collapsed "Loaded skills" header was only "a guess", and the word "turn" in the new copy confused them.

Watch

  • Collapsed header. The new Loaded skills / Loaded skill header is the main control. The blind reader read it correctly ("it opens to show more") but rated it "a guess" (shot-02, shot-03). Nothing tells a newcomer what is inside: the header shows the book icon, the title and the skill names, and nothing more. Every skill load in every session gets this card, so the uncertainty comes back each time. Severity: low-medium.
  • "Turn" in the new strings. body_context ("Skill instructions the agent followed this turn") and body_unavailable ("Instructions weren't recorded for older turns") both lean on "turn". The reader said: "I'm guessing it means one question-and-answer, but I'm not sure." The friction is small, but it shows up on every expanded card and every legacy card.

Suggestions

  • body_context: change it to "Instructions the agent followed for this reply".
  • body_unavailable: change it to "Instructions weren't saved for older messages".

[UX-REVIEWED] b8fa754

Description read

[DESCRIPTION-READ] 6d9eb716ac277b9ef7a81bcbc9e98344a72b25797dffc4939a6a54ba0684447e

That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed b8fa754cc792c4b0533465df9eb60b9fb9a66dc3 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b8fa754

Verdict parsed from the review's SHA-scoped output markers for commit b8fa754cc792c4b0533465df9eb60b9fb9a66dc3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable b8fa754cc792c4b0533465df9eb60b9fb9a66dc3: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of b8fa754cc792c4b0533465df9eb60b9fb9a66dc3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b8fa754

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b8fa754cc792c4b0533465df9eb60b9fb9a66dc3: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 4, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 4, 2026
@hoang-phan98

Copy link
Copy Markdown
Contributor Author
  • fixed span=8f6155dbd4eb

Commit 3e62210 makes legacy rows finished and non-interactive, with the localized detail “Instructions were not saved for this turn”.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author
  • fixed span=8e88b58ba6f3

Commit 3e62210 adds a measured bottom fade while content remains below the capped body and removes it at the scroll end.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author
  • fixed span=b18f1e66aeac

Commit 3e62210 renders skill H1 at 15px and H2 at 14px, below the assistant answer hierarchy.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author
  • rebutted span=9ad53bf7b48e

The product decision keeps the concise state title “Loaded skill” and “Loaded skills”. The expanded body and card context show what was loaded without renaming the event.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author

UX evidence follow-up: the legacy row was planted by hand with the exact old notice. The upgraded row is visible here: https://github.com/user-attachments/assets/22a59a4b-6030-40d2-b0a8-4bbec3712470

@hoang-phan98

Copy link
Copy Markdown
Contributor Author

@hoang-phan98

Copy link
Copy Markdown
Contributor Author
  • rebutted span=f6a0894816d9

The new desktop and mobile evidence shows the active bottom fade: https://github.com/user-attachments/assets/ff2fd302-1dd4-4e68-b076-5326fea7cdaa and https://github.com/user-attachments/assets/542fd5c2-31d3-4138-a4bc-92da6dc94119
Capture geometry also verified a non-none mask while scrollHeight exceeded clientHeight.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author
  • needs-a-decision span=12df7d8feaf8

The paperclip remains unchanged in this revision. The operator will decide whether the event should use a document-oriented icon.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author
  • needs-a-decision span=21415a7e3fff

The expanded detail label is not added in this revision. The operator will decide whether the body should state “Instructions given to the agent for this turn”.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author

Design follow-up: saving each redacted skill body in meta.skills is intentional. _MAX_DOLLAR_SKILLS and existing file-read caps bound the row. The snapshot preserves the exact instructions used by the turn after a skill changes or disappears, with no expansion-time filesystem read. The PR body now records this tradeoff.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author

First Principles follow-up: the saved-body growth is accepted for this design because exact historical instructions are the feature, and existing skill count and read caps bound each row. The shared disclosure toggle is again a native <button> with aria-expanded and aria-controls; keyboard and screen-reader semantics remain native.

@hoang-phan98

Copy link
Copy Markdown
Contributor Author
  • fixed span=f9b1a99e7ef6

The PR body now declares that skill cards and compaction summaries intentionally inherit the capped region, measured fade, and aria-controls semantics from the shared shell.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 4, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 5, 2026
@hoang-phan98

hoang-phan98 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

The seven final screenshots are shown once in the PR body under Screenshots / video.

1 similar comment
@hoang-phan98

hoang-phan98 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

The seven final screenshots are shown once in the PR body under Screenshots / video.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 5, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Re-reviewed at e7ef335. I checked the sanitization concern myself: skill bodies render through the shared MarkdownRenderer, the same one assistant messages use, with rehypeSanitize after rehypeRaw. So third-party skill text gets the same treatment as model output, and I'm dropping that concern. The new per-skill disclosure and the empty/legacy states look reasonable. I'm still holding because #16754 is still needs-investigation, so the product shape isn't accepted yet. Once a maintainer moves it out of investigation, I'll approve.

I wrote two temporary diff scripts in the workspace and deleted them, so no files are left behind.

@bolichen97

Copy link
Copy Markdown
Contributor

Sweep 2026-10-06: the PR this one was stacked on (#16681) is now merged into main, and GitHub reports this branch as conflicting. Please rebase onto current main so only this PR's own commit remains; I will review and merge once PR Readiness is green on the new head.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 6, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 6, 2026
Snapshot redacted skill bodies in transcript metadata and render them
inside a reusable, collapsed markdown disclosure card.
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 6, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed on behalf of the maintainers (sweep 2026-10-06): full diff read after the rebase (now only this PR's own change), callers verified against current main, readiness passed, CI green. Product shape accepted on the owner's behalf: the one-line skill chip becomes a collapsed markdown card; bodies pass the same redaction as the block sent to the model and render through the sanitizing MarkdownRenderer. Approving and merging.

@bolichen97
bolichen97 merged commit b13cebd into main Oct 6, 2026
101 checks passed
@bolichen97
bolichen97 deleted the feat/skill-load-card branch October 6, 2026 10:26
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show loaded skills as collapsible markdown cards

3 participants