Chuyển đến nội dung
Skillpedia
Agent7.6k · #13149

context-xray

Skill này làm gì

Skill này hiển thị các phần trong ngữ cảnh chat hiện tại của agent, cùng lượng không gian mỗi phần chiếm. Nó cho phép bạn hoặc agent giữ lại những phần quan trọng và ẩn những phần đã cũ. Skill dành cho người có cuộc chat dài bắt đầu chậm hoặc rối.

Khi nào nên dùng

  • ✓Khi một cuộc chat dài trở nên lớn và bạn muốn xem điều gì đang chiếm chỗ.
  • ✓Khi một kết quả công cụ hoặc file cũ không còn liên quan và nên bị bỏ qua.
  • ✓Khi một đặc tả tác vụ hoặc ràng buộc quan trọng cần được giữ xuyên suốt cuộc chat.

Liên kết skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/context-xray/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/context-xray/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Cuộc chat này đã rất dài. Bạn có thể cho tôi thấy điều gì đang chiếm nhiều chỗ nhất và giữ lại yêu cầu dự án của tôi không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent liệt kê các phần của cuộc chat cùng kích thước. Bạn hoặc agent có thể ghim một phần để giữ lại, hoặc ẩn một phần khỏi các câu trả lời sau. Việc ẩn không bao giờ xóa lịch sử chat.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Context X-Ray

Context X-Ray is the framework's context garbage-collection surface. It shows the current thread's model-bound context as content-derived segments with token counts, then lets the user or agent pin, evict, or restore individual segments.

Actions

Action When to use
context-manifest-get Read the current manifest for a thread. Returns token totals, segment status, source, and whether changes are enforceable.
context-preview-get Compose the would-be system context for the current user/org/app without a live thread. Returns labeled system sections with provenance, governance tier, token counts, and bounded previews. Backs the Agent page Context tab.
context-pin Preserve a segment across future compaction/model calls. Use for task specs, acceptance criteria, user constraints, and other durable context.
context-evict Exclude a stale or irrelevant segment from future model calls. Eviction is reversible and never deletes chat history.
context-restore Undo a pin, evict, or summarize directive for a segment.
context-report External hosts can report their visible context inventory. These manifests are advisory unless Agent-Native owns the emitted content.
context-compact Compact the thread now: fold every not-yet-compacted message into observational memory instead of waiting for the post-turn threshold. Takes effect on the next model call; the transcript is unchanged.

System Sections

Manifests now cover the system-prompt half of context, not just conversation segments. Each system section carries a provenance label (framework-core, actions-prompt, template, enterprise-workspace-core, sql-workspace, legacy-app-default, organization, personal, memory, db-schema, tools, model-overlay, runtime-context) and a governance tier:

  • required — framework/enterprise policy; can never be altered by the user.
  • inherited — template/org/workspace instructions; managed elsewhere, visible here.
  • user — personal instructions and memory; editable through Files.

System sections are display-only provenance: they cannot be pinned, evicted, or summarized. The persisted manifest stores source refs, scope, content hashes, token counts, and bounded previews (~200 chars) — never raw prompt bodies; full content stays behind the resource/access model. The in-chat X-Ray panel groups these under "System", and the Agent page Context tab renders the full breakdown (via context-preview-get) with a system-vs-conversation split meter. Manifests are the latest snapshot per thread; there is no per-iteration history.

Rules

  • Never evict or summarize protected segments. The manifest marks active-turn user/tool/thinking context as protected.
  • System sections are never evictable; required/inherited tiers are locked by design — do not present controls that imply otherwise.
  • Prefer pinning the user's task, requirements, and decisions before evicting large stale tool results.
  • Eviction excludes content from future model calls; it does not delete the canonical transcript or files.
  • In external/advisory mode, be honest: recorded directives are intent for the host except for Agent-Native-originated content we can actually withhold.
  • If token counts are estimated, describe reclaim as approximate.

Typical Flow

  1. Call context-manifest-get with the active threadId.
  2. Sort segments by tokenCount and inspect large stale Tool results or Files read entries.
  3. Call context-pin for essential specs or user instructions.
  4. Call context-evict for large irrelevant segments.
  5. Offer context-restore if the user wants undo.
Câu hỏi thường gặp

Ẩn một phần có xóa cuộc chat không?

Không. Việc ẩn có thể hoàn tác, và lịch sử chat không bao giờ bị xóa.

Ghim có tác dụng gì?

Nó giữ một phần ngữ cảnh qua các câu trả lời sau, nên nó không bị loại bỏ khi cuộc chat được nén.

Tôi có thể hoàn tác một thay đổi không?

Có. Khôi phục một đoạn sẽ hoàn tác việc ghim, ẩn hoặc thay đổi tóm tắt.

Chi tiết

Mô tả gốc của tác giả

Inspect and manage the live agent context window with Context X-Ray. Use when context is getting large, the user asks what is in context, or stale tool results/files should be pinned, evicted, restored, or reported by an external host.

repo: BuilderIO/agent-native

Độ phổ biến

Sao GitHub
7.6k
Vị trí xếp hạng
#13149
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự