[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F1VKBPE6HW0YPC5JESWSV4":3,"skill-same:01M7F1VKBPE6HW0YPC5JESWSV4":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":48},"01M7F1VKBPE6HW0YPC5JESWSV4","web-interface",null,"Operate and safely adapt the MedRAX Gradio chat interface around an initialized agent, including image and DICOM uploads, chat threads, tool-result images, and server configuration.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fmedrax\u002Fsub-skills\u002Fweb-interface\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: web-interface\ndescription: \"Operate and safely adapt the MedRAX Gradio chat interface around\n  an initialized agent, including image and DICOM uploads, chat threads,\n  tool-result images, and server configuration.\"\ndisable-model-invocation: true\nmetadata:\n  disco-role: operating\nlicense: Apache 2.0\n---\n\n# MedRAX web interface\n\nUse this skill when a researcher needs to run or modify the browser UI around an\nalready initialized MedRAX agent. This is an interface adapter, not a tool\nimplementation or an agent-graph tutorial.\n\n## Operating contract\n\n- Input: an initialized `agent` exposing `workflow.stream(...)`, plus a\n  `tools_dict` mapping the selected tool names to initialized tool instances.\n- Output: a Gradio `Blocks` demo that accepts a user message and optional image,\n  streams assistant\u002Ftool events, and returns `(chat_history, image_path, text)`\n  for the bound outputs.\n- Keep the original uploaded path for tools and keep a separately viewable path\n  for the UI. Never silently replace a DICOM path with its converted PNG when a\n  downstream tool needs the DICOM.\n- The interface is a convenience for analysis, not a diagnostic device. Do not\n  present model output as a clinical conclusion; retain a visible safety notice\n  appropriate to the deployment.\n\nFor the detailed event and upload sequence, read [workflows.md](references\u002Fworkflows.md).\nFor launch and resource settings, read [configuration.md](references\u002Fconfiguration.md).\nFor failure diagnosis, read [troubleshooting.md](references\u002Ftroubleshooting.md).\n\n## Entrypoint and lifecycle\n\n1. Load the medical system prompt and call the application initializer. Its\n   configuration includes `tools_to_use`, `model_dir`, `temp_dir`, `device`,\n   model name, temperature, top-p, and OpenAI-compatible keyword arguments.\n2. Select only tools that are installed and affordable. The initializer's\n   utility choices include `ImageVisualizerTool` and `DicomProcessorTool`; its\n   model-backed choices include classification, segmentation, visual QA,\n   report generation, grounding, LLaVA-Med, and generation. A selected tool\n   must be present in both the agent tool list and `tools_dict`.\n3. Call `create_demo(agent, tools_dict)`. It constructs `ChatInterface`, a\n   `gr.Blocks` layout, a messages-style `Chatbot`, text input, image display,\n   upload buttons, and Clear Chat\u002FNew Thread controls.\n4. Bind text submission as two stages: `add_message` first appends the user\n   image and text and disables the textbox; `process_message` then streams\n   agent events and updates chatbot, display image, and textbox. Re-enable the\n   textbox after completion, including failure.\n5. Launch with explicit, reviewed server settings. A safe local default is\n   loopback and `share=False`; do not inherit the example's broad bind and\n   public share settings without a deployment decision.\n\n`ChatInterface` currently stores `current_thread_id`, `original_file_path`, and\n`display_file_path` on one Python object. That is adequate for a single-user\ndemo only. For concurrent users, put these values in per-session `gr.State` (or\na server-side session store), use a collision-resistant thread identifier, and\nnever let one browser's upload or thread be reused by another browser.\n\n## Upload and path rules\n\n- `UploadButton` is configured separately for ordinary images and DICOM. The\n  current DICOM button accepts a generic file, so validate the lower-cased\n  suffix before processing rather than trusting the widget.\n- Copy uploads into a controlled temporary directory using a generated name.\n  Preserve the original suffix; do not use the client filename as a path.\n  Prefer a UUID plus suffix over a seconds-only timestamp to avoid collisions.\n  Apply size, count, and suffix allowlists and clean old files deliberately.\n- For an ordinary image, the copied path can serve both purposes after basic\n  validation. For `.dcm`, call the selected `DicomProcessorTool` and read the\n  returned display mapping's `image_path` for the UI.\n- Keep `original_file_path` as the path sent in the textual `image_path:`\n  message. Keep `display_file_path` as the PNG or other viewable conversion.\n  If a multimodal payload is also built, encode the display path with its real\n  MIME type; never label raw DICOM bytes as JPEG. This distinction is required\n  even though the current implementation uses one fallback path for both.\n- If DICOM is enabled, fail early with a clear configuration error when\n  `tools_dict[\"DicomProcessorTool\"]` is missing. Do not catch that as an\n  unexplained chat failure.\n\n## Message and event handling\n\nBuild the current request in the shape expected by the agent:\n\n- Optional path message: `{\"role\": \"user\", \"content\": \"image_path: \u003Cpath>\"}`.\n- Optional multimodal message: a user content list containing an\n  `image_url` data payload for the viewable image.\n- Optional text message: a user content list containing\n  `{\"type\": \"text\", \"text\": \u003Cmessage>}`.\n\nThe current LangGraph call is conceptually:\n\n```python\nagent.workflow.stream(\n    {\"messages\": messages},\n    {\"configurable\": {\"thread_id\": thread_id}},\n)\n```\n\nThe checkpointer and thread ID carry graph state; the visible Gradio history is\nnot itself the complete graph conversation. New threads must receive a new ID.\nClear Chat should also decide whether it is merely a visual reset or a new\nconversation; make that choice explicit instead of leaving stale graph state.\n\nHandle the stream defensively:\n\n- For a `process` event, take the latest message content, format it as text,\n  and append an assistant `ChatMessage`.\n- For an `execute` event, iterate tool messages, use the emitted tool name, and\n  display textual results plus any validated image result. The current image\n  branch recognizes the emitted name `image_visualizer`; do not assume it is\n  the same spelling\u002Fcase as `ImageVisualizerTool` in `tools_dict`.\n- Never use `eval` on tool output. Prefer structured tool returns; for a legacy\n  serialized value, use a constrained parser and validate the result shape and\n  path before rendering it.\n- Every normal and error path must yield the same number and order of outputs:\n  `(history, display_path, \"\")`. Do not expose raw temporary paths in assistant\n  text, and do not put an unredacted provider exception or credential in chat.\n\n## Reset, rendering, and assets\n\n- Clear Chat should clear visible messages and the displayed image, remove or\n  rotate the active session's upload references, and—if conversation reset is\n  intended—rotate the thread ID too.\n- New Thread should rotate only the conversation ID unless the product\n  explicitly promises to remove the selected image. Document the behavior.\n- Tool-generated images should be rendered only after checking that the path is\n  an expected local result, not an arbitrary path returned by a model or tool.\n- Resolve the avatar\u002Flogo from a packaged resource at runtime. If it is absent,\n  use a no-avatar configuration instead of making startup depend on the\n  process's current working directory.\n\n## Resource-constrained adaptation\n\nFor a CPU-only utility demonstration, initialize only\n`ImageVisualizerTool` and `DicomProcessorTool` with `device=\"cpu\"` where the\ninitializer requires a device. This avoids local vision-model weight loading,\nbut the normal `process_message` still calls the configured chat model. A full\nchat demo therefore still needs an accessible OpenAI-compatible model endpoint,\nor a test\u002Fstub agent whose `workflow.stream` produces deterministic events.\nDo not claim a no-weight, no-model setup can answer medical questions.\n\nUse [configuration.md](references\u002Fconfiguration.md) for a minimal selection\nmatrix and [troubleshooting.md](references\u002Ftroubleshooting.md) when an\noptional model-backed tool prevents startup.\n\n## Scope boundaries\n\nRoute tool signatures, image processing, DICOM conversion implementation, and\nresult schemas to `chest-xray-analysis` or `image-data-utilities`. Route\nLangGraph agent construction, prompts, checkpointers, and tool binding to\n`agent-orchestration`. Route benchmark execution and scoring to\n`benchmark-evaluation`. This skill only adapts their initialized outputs to a\nsafe Gradio lifecycle.\n","# MedRAX web interface\n\nUse this skill when a researcher needs to run or modify the browser UI around an\nalready initialized MedRAX agent. This is an interface adapter, not a tool\nimplementation or an agent-graph tutorial.\n\n## Operating contract\n\n- Input: an initialized `agent` exposing `workflow.stream(...)`, plus a\n  `tools_dict` mapping the selected tool names to initialized tool instances.\n- Output: a Gradio `Blocks` demo that accepts a user message and optional image,\n  streams assistant\u002Ftool events, and returns `(chat_history, image_path, text)`\n  for the bound outputs.\n- Keep the original uploaded path for tools and keep a separately viewable path\n  for the UI. Never silently replace a DICOM path with its converted PNG when a\n  downstream tool needs the DICOM.\n- The interface is a convenience for analysis, not a diagnostic device. Do not\n  present model output as a clinical conclusion; retain a visible safety notice\n  appropriate to the deployment.\n\nFor the detailed event and upload sequence, read [workflows.md](references\u002Fworkflows.md).\nFor launch and resource settings, read [configuration.md](references\u002Fconfiguration.md).\nFor failure diagnosis, read [troubleshooting.md](references\u002Ftroubleshooting.md).\n\n## Entrypoint and lifecycle\n\n1. Load the medical system prompt and call the application initializer. Its\n   configuration includes `tools_to_use`, `model_dir`, `temp_dir`, `device`,\n   model name, temperature, top-p, and OpenAI-compatible keyword arguments.\n2. Select only tools that are installed and affordable. The initializer's\n   utility choices include `ImageVisualizerTool` and `DicomProcessorTool`; its\n   model-backed choices include classification, segmentation, visual QA,\n   report generation, grounding, LLaVA-Med, and generation. A selected tool\n   must be present in both the agent tool list and `tools_dict`.\n3. Call `create_demo(agent, tools_dict)`. It constructs `ChatInterface`, a\n   `gr.Blocks` layout, a messages-style `Chatbot`, text input, image display,\n   upload buttons, and Clear Chat\u002FNew Thread controls.\n4. Bind text submission as two stages: `add_message` first appends the user\n   image and text and disables the textbox; `process_message` then streams\n   agent events and updates chatbot, display image, and textbox. Re-enable the\n   textbox after completion, including failure.\n5. Launch with explicit, reviewed server settings. A safe local default is\n   loopback and `share=False`; do not inherit the example's broad bind and\n   public share settings without a deployment decision.\n\n`ChatInterface` currently stores `current_thread_id`, `original_file_path`, and\n`display_file_path` on one Python object. That is adequate for a single-user\ndemo only. For concurrent users, put these values in per-session `gr.State` (or\na server-side session store), use a collision-resistant thread identifier, and\nnever let one browser's upload or thread be reused by another browser.\n\n## Upload and path rules\n\n- `UploadButton` is configured separately for ordinary images and DICOM. The\n  current DICOM button accepts a generic file, so validate the lower-cased\n  suffix before processing rather than trusting the widget.\n- Copy uploads into a controlled temporary directory using a generated name.\n  Preserve the original suffix; do not use the client filename as a path.\n  Prefer a UUID plus suffix over a seconds-only timestamp to avoid collisions.\n  Apply size, count, and suffix allowlists and clean old files deliberately.\n- For an ordinary image, the copied path can serve both purposes after basic\n  validation. For `.dcm`, call the selected `DicomProcessorTool` and read the\n  returned display mapping's `image_path` for the UI.\n- Keep `original_file_path` as the path sent in the textual `image_path:`\n  message. Keep `display_file_path` as the PNG or other viewable conversion.\n  If a multimodal payload is also built, encode the display path with its real\n  MIME type; never label raw DICOM bytes as JPEG. This distinction is required\n  even though the current implementation uses one fallback path for both.\n- If DICOM is enabled, fail early with a clear configuration error when\n  `tools_dict[\"DicomProcessorTool\"]` is missing. Do not catch that as an\n  unexplained chat failure.\n\n## Message and event handling\n\nBuild the current request in the shape expected by the agent:\n\n- Optional path message: `{\"role\": \"user\", \"content\": \"image_path: \u003Cpath>\"}`.\n- Optional multimodal message: a user content list containing an\n  `image_url` data payload for the viewable image.\n- Optional text message: a user content list containing\n  `{\"type\": \"text\", \"text\": \u003Cmessage>}`.\n\nThe current LangGraph call is conceptually:\n\n```python\nagent.workflow.stream(\n    {\"messages\": messages},\n    {\"configurable\": {\"thread_id\": thread_id}},\n)\n```\n\nThe checkpointer and thread ID carry graph state; the visible Gradio history is\nnot itself the complete graph conversation. New threads must receive a new ID.\nClear Chat should also decide whether it is merely a visual reset or a new\nconversation; make that choice explicit instead of leaving stale graph state.\n\nHandle the stream defensively:\n\n- For a `process` event, take the latest message content, format it as text,\n  and append an assistant `ChatMessage`.\n- For an `execute` event, iterate tool messages, use the emitted tool name, and\n  display textual results plus any validated image result. The current image\n  branch recognizes the emitted name `image_visualizer`; do not assume it is\n  the same spelling\u002Fcase as `ImageVisualizerTool` in `tools_dict`.\n- Never use `eval` on tool output. Prefer structured tool returns; for a legacy\n  serialized value, use a constrained parser and validate the result shape and\n  path before rendering it.\n- Every normal and error path must yield the same number and order of outputs:\n  `(history, display_path, \"\")`. Do not expose raw temporary paths in assistant\n  text, and do not put an unredacted provider exception or credential in chat.\n\n## Reset, rendering, and assets\n\n- Clear Chat should clear visible messages and the displayed image, remove or\n  rotate the active session's upload references, and—if conversation reset is\n  intended—rotate the thread ID too.\n- New Thread should rotate only the conversation ID unless the product\n  explicitly promises to remove the selected image. Document the behavior.\n- Tool-generated images should be rendered only after checking that the path is\n  an expected local result, not an arbitrary path returned by a model or tool.\n- Resolve the avatar\u002Flogo from a packaged resource at runtime. If it is absent,\n  use a no-avatar configuration instead of making startup depend on the\n  process's current working directory.\n\n## Resource-constrained adaptation\n\nFor a CPU-only utility demonstration, initialize only\n`ImageVisualizerTool` and `DicomProcessorTool` with `device=\"cpu\"` where the\ninitializer requires a device. This avoids local vision-model weight loading,\nbut the normal `process_message` still calls the configured chat model. A full\nchat demo therefore still needs an accessible OpenAI-compatible model endpoint,\nor a test\u002Fstub agent whose `workflow.stream` produces deterministic events.\nDo not claim a no-weight, no-model setup can answer medical questions.\n\nUse [configuration.md](references\u002Fconfiguration.md) for a minimal selection\nmatrix and [troubleshooting.md](references\u002Ftroubleshooting.md) when an\noptional model-backed tool prevents startup.\n\n## Scope boundaries\n\nRoute tool signatures, image processing, DICOM conversion implementation, and\nresult schemas to `chest-xray-analysis` or `image-data-utilities`. Route\nLangGraph agent construction, prompts, checkpointers, and tool binding to\n`agent-orchestration`. Route benchmark execution and scoring to\n`benchmark-evaluation`. This skill only adapts their initialized outputs to a\nsafe Gradio lifecycle.\n",{"name":5,"license":24,"metadata":25,"description":7,"disable-model-invocation":27},"Apache 2.0",{"disco-role":26},"operating",true,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Fmedrax\u002Fsub-skills\u002Fweb-interface",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":27},[38,41,44],{"tool":39,"command":40},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill web-interface",{"tool":42,"command":43},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill web-interface",{"tool":45,"command":46},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill web-interface","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fmedrax\u002Fsub-skills\u002Fweb-interface\u002FSKILL.md",[49,55,59],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fconfiguration.md","REFERENCE","参考文档",4559,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fmedrax\u002Fsub-skills\u002Fweb-interface\u002Freferences\u002Fconfiguration.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Ftroubleshooting.md",5077,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fmedrax\u002Fsub-skills\u002Fweb-interface\u002Freferences\u002Ftroubleshooting.md",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fworkflows.md",5828,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fmedrax\u002Fsub-skills\u002Fweb-interface\u002Freferences\u002Fworkflows.md",[64,72,77,84,91,98],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":73,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]