Skip to content

feat(web): open called skills in file viewer - #6553

Open
djfbryant wants to merge 13 commits into
pingdotgg:mainfrom
djfbryant:agent/clickable-skill-references
Open

feat(web): open called skills in file viewer#6553
djfbryant wants to merge 13 commits into
pingdotgg:mainfrom
djfbryant:agent/clickable-skill-references

Conversation

@djfbryant

@djfbryant djfbryant commented Aug 14, 2026

Copy link
Copy Markdown

Problem

Resolved skill invocations in submitted chat messages look like chips, but users cannot open them to inspect the instructions the agent used.

Solution

  • Make resolved skill invocations in submitted user messages clickable.
  • Open the current skill file read-only in the existing right-side file viewer.
  • Persist the resolved invocation name and path with new messages.
  • Resolve legacy messages against the current enabled provider skills.
  • Support relative skill documents and images while confining access to the skill directory.
  • Use signed asset URLs so local and remote environments behave consistently.
  • Keep assistant messages, code blocks, unresolved skills, and disabled skills inert.

User impact

Users can inspect an invoked skill directly from the conversation without leaving T3 Code. Linked documents remain within the same read-only file-viewer experience.

Supported surfaces

  • Web
  • Desktop
  • Local and remote environments
  • Providers that expose skill metadata

Mobile is intentionally out of scope for this change.

Verification

  • 143 focused tests passed across shared parsing, orchestration, secure skill-file access, assets, persistence, chat rendering, and right-panel behavior.
  • Contracts, shared, web, and server typechecks passed.
  • Independent specification and code-standards reviews passed after addressing their findings.

Screenshots

Before/after screenshots still need to be added before this draft is marked ready for review.


Implemented with GPT-5.6 in the Codex harness.

Note

Open called skills in the file viewer from chat message skill chips

  • Adds a skills.readFile WebSocket RPC that reads files from resolved skill directories with size limits, symlink/traversal protection, and structured SkillReadFileError responses.
  • Records resolvedSkills on thread messages at dispatch time by matching skill tokens in message text against the active provider's skill list; persisted via a new resolved_skills_json column (migration 041).
  • Adds openSkillFile to the right panel store, opening durable skill-file tabs (namespaced skill-file: IDs) that persist when the workspace becomes unavailable.
  • Introduces SkillTextFilePreviewPanel in FilePreviewPanel for read-only skill file preview, including markdown rendering, local image resolution via scoped asset URLs (skill-file-exact token kind), and relative link navigation within the skill directory.
  • Makes inline skill chips in the chat timeline interactive: clicking a chip opens the skill's SKILL.md in the right panel viewer.
  • Adds collectSubmittedSkillNames to extract skill references from submitted Markdown while correctly ignoring code blocks and inline code spans.
  • Risk: asset tokens for skill files set Cache-Control: no-store, which differs from the default private, max-age=3600 used for other assets.

Macroscope summarized c9a0429.


Note

Medium Risk
Touches filesystem reads, signed asset tokens, and message persistence with a DB migration; path containment and frozen resolution are tested but the surface area spans auth, RPC, and client state migration.

Overview
Invoked $skill chips in user messages are now clickable and open that skill’s SKILL.md (and linked files/images) in the existing right-panel file viewer, read-only.

On turn dispatch, the server derives resolvedSkills from submitted message text (Markdown-aware, ignoring code) and the active provider’s enabled skills—clients cannot inject paths. Those references are stored on messages (resolved_skills_json migration), projected through orchestration, and legacy messages without the field still resolve against the current provider. New messages with an empty list stay non-clickable even if a skill is enabled later.

Backend access adds skills.readFile (path containment, symlink checks) and skill-file signed asset URLs with no-store caching for images. Web UI adds skill-backed file tabs (skill-file: IDs, persisted state v12), timeline chips wired to frozen resolvedSkills, and skill markdown preview with local image/link handling.

Reviewed by Cursor Bugbot for commit c9a0429. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1714cce1-816e-41c9-8b11-74a446ae5b4e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 14, 2026
Comment thread packages/shared/src/composerInlineTokens.ts Outdated
Comment thread apps/server/src/skill/SkillFileAccess.ts Outdated
Comment thread apps/web/src/rightPanelStore.ts
Comment thread apps/web/src/rightPanelStore.ts

@macroscopeapp macroscopeapp Bot 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.

Effect service conventions review of the new skill file-read path. Three error-modeling issues in the changed scope; everything else (namespace imports, contract schemas, RPC wiring, projection changes) looks consistent with repo conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread packages/contracts/src/skill.ts
Comment thread apps/server/src/skill/SkillFileAccess.ts Outdated
Comment thread apps/server/src/skill/SkillFileAccess.ts
Comment thread apps/server/src/ws.ts
Comment thread packages/shared/src/composerInlineTokens.ts Outdated
@djfbryant
djfbryant force-pushed the agent/clickable-skill-references branch from 9e43366 to 38bb1e1 Compare August 14, 2026 07:58
Comment thread apps/server/src/orchestration/Normalizer.ts Outdated
Comment thread apps/server/src/skill/SkillFileAccess.ts
Comment thread apps/server/src/orchestration/Normalizer.ts Outdated
Comment thread packages/contracts/src/orchestration.ts
@djfbryant
djfbryant force-pushed the agent/clickable-skill-references branch from 38bb1e1 to b5aff1f Compare August 14, 2026 08:03
Comment thread apps/server/src/ws.ts Outdated
Legacy chips in archived threads could not find a provider because the
fallback used an active-only shell query. Skill file reads now follow
WorkspaceFileSystem instead of O_NOFOLLOW and inode checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
The includeArchived shell path still used an active-only latest-turn
query, so archived threads always came back with latestTurn null.

Co-authored-by: Cursor <cursoragent@cursor.com>
@djfbryant
djfbryant marked this pull request as ready for review August 14, 2026 22:22
Comment thread apps/server/src/ws.ts Outdated

@macroscopeapp macroscopeapp Bot 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.

UI consistency review found layout and focus-state issues in the new skill preview surfaces. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/files/FilePreviewPanel.tsx Outdated
Comment thread apps/web/src/components/chat/SkillInlineText.tsx Outdated
Comment thread apps/web/src/components/files/FilePreviewPanel.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR adds a new feature enabling skill file viewing in the file preview panel, including a database migration, new RPC endpoint, and UI components. The scope and cross-cutting nature of new features like this warrant human review.

You can customize Macroscope's approvability policy. Learn more.

djfbryant and others added 2 commits August 15, 2026 08:57
Skill preview headers used a removed global class and overflowed the
shared 40px row. Clickable chips also lacked a focus ring. Frozen
resolvedSkills lists were still falling through to live provider lookup.

Co-authored-by: Cursor <cursoragent@cursor.com>

@macroscopeapp macroscopeapp Bot 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.

Three consistency findings in the new skill file-preview surfaces (apps/web/src/components/files/FilePreviewPanel.tsx). The earlier subheader and focus-ring findings look resolved on this head.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/files/FilePreviewPanel.tsx Outdated
Comment thread apps/web/src/components/files/FilePreviewPanel.tsx
Comment thread apps/web/src/components/files/FilePreviewPanel.tsx
Persist the markdown source toggle, open workspace files (or toast)
when a skill markdown link points outside the skill folder, and show
the same image load-failure state as workspace previews.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/web/src/components/files/FilePreviewPanel.tsx

@macroscopeapp macroscopeapp Bot 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 the web UI changes (skill chips, skill file preview surfaces, right-panel store/tabs, ChatMarkdown renderers). The prior findings (focus ring on the clickable chip, persisted markdown source/rendered preference, image load-failure state, single-line subheader) are all resolved. Two remaining issues below.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/rightPanelStore.ts
Comment thread apps/web/src/components/chat/SkillInlineText.tsx
../ markdown links were matching the skill root by string prefix, so
they never fell through to the workspace. Skill tabs without a project
also stayed in the strip with a blank panel, and clickable chips were
stripped from rich copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/web/src/components/files/skillPreviewPaths.ts Outdated

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9eb22af. Configure here.

Comment thread apps/web/src/components/ChatView.tsx Outdated
Windows drive roots lost their slash after collapse, so containment
became case-sensitive. Skill previews without a project also passed a
worktree cwd they could not open, which swallowed the click.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/web/src/components/files/skillPreviewPaths.ts Outdated
Trailing-slash stripping turned `/` into an empty string, so markdown
links could not be classified as workspace files when cwd was the
filesystem root.

Co-authored-by: Cursor <cursoragent@cursor.com>

@macroscopeapp macroscopeapp Bot 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 the web UI changes for shared-primitive, Tailwind-ownership, and surface-consistency issues. The earlier findings (chip focus ring, persisted markdown toggle, image onError handling, rich-copy of the chip, skill tabs rendering without a project) look addressed at this head. Two remaining consistency gaps around the new skill file surface are noted inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/files/FilePreviewPanel.tsx Outdated
Comment thread apps/web/src/components/RightPanelTabs.tsx
Skill source now uses the same highlighted File viewer (including word wrap),
and Copy path on skill tabs copies the skill directory plus relative path
instead of just SKILL.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant