{% extends "base.html" %}

{% block title %}Skill Studio{% endblock %}

{% block content %}
  <section class="page-header">
    <span class="eyebrow">Skill Studio</span>
    <h1 class="page-title">Skill 编辑、编排与运行预览</h1>
    <p class="page-lead">Skill 页面用于解释 Agent 行为为何可控、可维护、可复用。通过角色说明、工具绑定、输入输出约束和测试运行预览，展示平台的治理能力。</p>
  </section>

  <section class="workspace-grid">
    <article class="panel">
      <div class="section-heading">
        <div>
          <h2 class="section-title">Skill 列表</h2>
          <p class="section-copy">围绕注册审核主流程沉淀能力单元。</p>
        </div>
      </div>
      <ul class="detail-list">
        {% for skill in skills %}
          <li class="detail-item">
            <span class="pill {% if skill.status == '已发布' %}pill-success{% elif skill.status == '发布中' %}pill-accent{% else %}pill-signal{% endif %}">{{ skill.status }}</span>
            <strong>{{ skill.name }}</strong>
            <div class="muted">触发场景：{{ skill.trigger }}</div>
            <div class="muted">工具链：{{ skill.tools }}</div>
          </li>
        {% endfor %}
      </ul>
    </article>

    <article class="panel">
      <div class="section-heading">
        <div>
          <h2 class="section-title">Skill 编辑区</h2>
          <p class="section-copy">展示角色、约束、工具和输出契约如何被治理。</p>
        </div>
      </div>
      <div class="stack">
        <div class="detail-item">
          <strong>角色说明</strong>
          当前 Skill 负责对照 NMPA 注册申报资料要求执行完整性检查，优先输出命中项、缺失项、风险等级和建议动作。
        </div>
        <div class="detail-item">
          <strong>工具绑定</strong>
          规则树匹配、RAG 引用、字段池比对、风险映射、审计写入。
        </div>
        <div class="detail-item">
          <strong>输入输出约束</strong>
          输入限定资料范围、任务类型与批次；输出必须包含结构化结果、证据引用和人工复核提示。
        </div>
      </div>
    </article>

    <article class="panel">
      <div class="section-heading">
        <div>
          <h2 class="section-title">运行预览</h2>
          <p class="section-copy">通过最近一次测试运行说明 Skill 的稳定性。</p>
        </div>
      </div>
      <ul class="detail-list">
        <li class="detail-item"><strong>最近测试结果</strong> 命中 3 个规则项，识别 1 个缺失项，生成 2 条建议动作。</li>
        <li class="detail-item"><strong>命中工具</strong> completeness_rule_match、rag_lookup、risk_mapper</li>
        <li class="detail-item"><strong>失败原因样例</strong> 当法规模板未配置时，页面会提示“法规规则未配置，无法执行完整性检查”。</li>
      </ul>
    </article>
  </section>
{% endblock %}
