Agent Skills › eosphoros-ai/DB-GPT

eosphoros-ai/DB-GPT

GitHub

专为AI代理优化的无头浏览器自动化工具。通过无障碍树快照和引用实现确定性元素选择,支持多步工作流、会话隔离、状态持久化及网络控制,适用于复杂SPA自动化。

5 skills 19,368

Install All Skills

npx skills add eosphoros-ai/DB-GPT --all -g -y
More Options

List skills in collection

npx skills add eosphoros-ai/DB-GPT --list

Skills in Collection (5)

专为AI代理优化的无头浏览器自动化工具。通过无障碍树快照和引用实现确定性元素选择,支持多步工作流、会话隔离、状态持久化及网络控制,适用于复杂SPA自动化。
需要确定性的页面元素交互 执行多步骤网页自动化工作流 处理复杂的单页应用(SPA) 需要会话隔离或状态持久化 对自动化性能有较高要求
skills/agent-browser/SKILL.md
npx skills add eosphoros-ai/DB-GPT --skill agent-browser -g -y
SKILL.md
Frontmatter
{
    "name": "agent-browser",
    "metadata": {
        "clawdbot": {
            "emoji": "🌐",
            "homepage": "https:\/\/github.com\/vercel-labs\/agent-browser",
            "requires": {
                "commands": [
                    "agent-browser"
                ]
            }
        }
    },
    "description": "Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection"
}

Agent Browser Skill

Fast browser automation using accessibility tree snapshots with refs for deterministic element selection.

Why Use This Over Built-in Browser Tool

Use agent-browser when:

  • Automating multi-step workflows
  • Need deterministic element selection
  • Performance is critical
  • Working with complex SPAs
  • Need session isolation

Use built-in browser tool when:

  • Need screenshots/PDFs for analysis
  • Visual inspection required
  • Browser extension integration needed

Core Workflow

# 1. Navigate and snapshot
agent-browser open https://example.com
agent-browser snapshot -i --json

# 2. Parse refs from JSON, then interact
agent-browser click @e2
agent-browser fill @e3 "text"

# 3. Re-snapshot after page changes
agent-browser snapshot -i --json

Key Commands

Navigation

agent-browser open <url>
agent-browser back | forward | reload | close

Snapshot (Always use -i --json)

agent-browser snapshot -i --json          # Interactive elements, JSON output
agent-browser snapshot -i -c -d 5 --json  # + compact, depth limit
agent-browser snapshot -s "#main" -i      # Scope to selector

Interactions (Ref-based)

agent-browser click @e2
agent-browser fill @e3 "text"
agent-browser type @e3 "text"
agent-browser hover @e4
agent-browser check @e5 | uncheck @e5
agent-browser select @e6 "value"
agent-browser press "Enter"
agent-browser scroll down 500
agent-browser drag @e7 @e8

Get Information

agent-browser get text @e1 --json
agent-browser get html @e2 --json
agent-browser get value @e3 --json
agent-browser get attr @e4 "href" --json
agent-browser get title --json
agent-browser get url --json
agent-browser get count ".item" --json

Check State

agent-browser is visible @e2 --json
agent-browser is enabled @e3 --json
agent-browser is checked @e4 --json

Wait

agent-browser wait @e2                    # Wait for element
agent-browser wait 1000                   # Wait ms
agent-browser wait --text "Welcome"       # Wait for text
agent-browser wait --url "**/dashboard"   # Wait for URL
agent-browser wait --load networkidle     # Wait for network
agent-browser wait --fn "window.ready === true"

Sessions (Isolated Browsers)

agent-browser --session admin open site.com
agent-browser --session user open site.com
agent-browser session list
# Or via env: AGENT_BROWSER_SESSION=admin agent-browser ...

State Persistence

agent-browser state save auth.json        # Save cookies/storage
agent-browser state load auth.json        # Load (skip login)

Screenshots & PDFs

agent-browser screenshot page.png
agent-browser screenshot --full page.png
agent-browser pdf page.pdf

Network Control

agent-browser network route "**/ads/*" --abort           # Block
agent-browser network route "**/api/*" --body '{"x":1}'  # Mock
agent-browser network requests --filter api              # View

Cookies & Storage

agent-browser cookies                     # Get all
agent-browser cookies set name value
agent-browser storage local key           # Get localStorage
agent-browser storage local set key val

Tabs & Frames

agent-browser tab new https://example.com
agent-browser tab 2                       # Switch to tab
agent-browser frame @e5                   # Switch to iframe
agent-browser frame main                  # Back to main

Snapshot Output Format

{
  "success": true,
  "data": {
    "snapshot": "...",
    "refs": {
      "e1": {"role": "heading", "name": "Example Domain"},
      "e2": {"role": "button", "name": "Submit"},
      "e3": {"role": "textbox", "name": "Email"}
    }
  }
}

Best Practices

  1. Always use -i flag - Focus on interactive elements
  2. Always use --json - Easier to parse
  3. Wait for stability - agent-browser wait --load networkidle
  4. Save auth state - Skip login flows with state save/load
  5. Use sessions - Isolate different browser contexts
  6. Use --headed for debugging - See what's happening

Example: Search and Extract

agent-browser open https://www.google.com
agent-browser snapshot -i --json
# AI identifies search box @e1
agent-browser fill @e1 "AI agents"
agent-browser press Enter
agent-browser wait --load networkidle
agent-browser snapshot -i --json
# AI identifies result refs
agent-browser get text @e3 --json
agent-browser get attr @e4 "href" --json

Example: Multi-Session Testing

# Admin session
agent-browser --session admin open app.com
agent-browser --session admin state load admin-auth.json
agent-browser --session admin snapshot -i --json

# User session (simultaneous)
agent-browser --session user open app.com
agent-browser --session user state load user-auth.json
agent-browser --session user snapshot -i --json

Installation

npm install -g agent-browser
agent-browser install                     # Download Chromium
agent-browser install --with-deps         # Linux: + system deps

Credits

Skill created by Yossi Elkrief (@MaTriXy)

agent-browser CLI by Vercel Labs

用于分析CSV或Excel文件,自动提取统计特征、检测异常并生成交互式可视化报告。支持数据统计、图表生成及归因分析,适用于数据探索与洞察发现场景。
analyze CSV analyze Excel data analysis CSV analysis Excel analysis data statistics generate charts data visualization 分析CSV 分析Excel 数据分析 CSV分析 Excel分析 数据统计 生成图表 数据可视化
skills/csv-data-analysis/SKILL.md
npx skills add eosphoros-ai/DB-GPT --skill csv-data-analysis -g -y
SKILL.md
Frontmatter
{
    "name": "csv-data-analysis",
    "description": "This skill should be used when users need to analyze CSV or Excel files, understand data patterns, generate statistical summaries, or create data visualizations. Trigger keywords include \"analyze CSV\", \"analyze Excel\", \"data analysis\", \"CSV analysis\", \"Excel analysis\", \"data statistics\", \"generate charts\", \"data visualization\", \"分析CSV\", \"分析Excel\", \"数据分析\", \"CSV分析\", \"Excel分析\", \"数据统计\", \"生成图表\", \"数据可视化\"."
}

Intelligent Deep Data Analysis Tool

The Data Analysis Tool is an AI-powered deep automated data exploration tool built on frontend visualization technologies (ECharts + Tailwind CSS). It rapidly extracts statistical features, data quality metrics, numerical distributions, outlier detection, categorical information, correlations, rankings, and time series trends. The latter half of the report supplements these with anomaly overviews, attribution clues, and summary recommendations, producing highly polished and interactive web-based analysis reports. Supported formats include CSV, Excel (.xlsx/.xls), and TSV.

The report follows a structure of "foundational data analysis in the first half, anomaly detection and attribution enhancement in the second half." Core sections include: Executive Summary, Data Overview & Quality Check, Numerical Distribution Features, Feature Analysis & Structural Analysis, Relationship Analysis & Anomaly Identification, Data Anomaly Overview, Attribution Analysis Module, Analysis Results & Statistical Details, Root Cause Inference / Conclusions / Recommendations.

Core Workflow (Required Reading for LLMs)

As an AI assistant, when a user uploads a CSV or Excel file and requests analysis, you must strictly follow these two steps:

Step 1: Extract Data Features (Execute Script)

Use the execute_skill_script_file tool to run csv_analyzer.py, passing in the data file path (supports .csv, .xlsx, .xls, .tsv formats).

Tool call parameter example:

{
  "skill_name": "csv-data-analysis",
  "script_file_name": "csv_analyzer.py",
  "args": {"input_file": "/path/to/data.csv or /path/to/data.xlsx"}
}

Script return explanation: The script returns a large block of text content containing two parts:

  1. [Statistical Summary]: For you to read and understand the dataset's basic characteristics, distributions, correlations, and categorical composition.
  2. [Marker-wrapped data blocks]: The script output contains marker data blocks in the format ###KEY_START###...###KEY_END###. The backend automatically captures and injects these into the template — you do not need to handle or pass this content.

Step 2: Generate Insights & Display Report (Inject into Template)

Read the "Statistical Summary" obtained in Step 1, and reason about the business significance or patterns behind the data. Then use the html_interpreter tool to load the template and inject data.

Critical Rules (Must Follow):

  1. You must set template_path to csv-data-analysis/templates/report_template.html. The template has built-in complete ECharts rendering JavaScript code and all section titles and footer text. You only need to fill in 9 content placeholders via the data parameter. Never write or modify any JavaScript chart rendering code yourself.

  2. Marker data blocks are automatically injected by the backend — you must not pass them in data. The backend automatically extracts content from ###KEY_START###...###KEY_END### markers in the script output and injects it into the template; in this skill, this is primarily CHART_DATA_JSON.

  3. *_INSIGHTS, EXEC_SUMMARY, and CONCLUSIONS must use HTML formatting (e.g., <p>, <ul>, <li>, <strong>, <ol>) to ensure proper layout. These are deep business insights you write based on the statistical summary.

  4. The output language must match the user's input language. You must also pass the LANG placeholder ("en" or "zh") so that the template's hardcoded section titles, labels, and footer text are displayed in the matching language. Detect language from the user's query: if the user writes in English, set LANG to "en"; if the user writes in Chinese, set LANG to "zh". Default to "zh" when uncertain.

  5. Pass exactly 9 placeholders — no more, no less. Auto-injected marker fields like CHART_DATA_JSON are handled by the backend and should not be passed by you. The template already hardcodes all section titles (Distribution Analysis, Correlation Analysis, etc.), insight box titles ("Insights"), and footer text — you do not need to pass these (the template will automatically translate them based on the LANG placeholder).

  6. Insight content must be substantive. Each insight module should cover 4 layers of information: observation, possible causes, business impact, and action recommendations. Do not merely restate statistical values or write only a few vague conclusions.

  7. Foundational analysis first, attribution as an enhancement module. The first half of the report must focus on analyzing the data features of the CSV itself, including numerical distributions, categorical structures, outliers, correlations, ranking patterns, etc., and should incorporate chart interpretations wherever possible. "Data Anomaly Overview," "Attribution Analysis," and "Root Cause Inference" should appear in the second half as enhancement modules — the entire report must not consist solely of attribution content.

html_interpreter call example:

{
  "template_path": "csv-data-analysis/templates/report_template.html",
  "data": {
    "LANG": "en",
    "REPORT_TITLE": "Sales Dataset Deep Analysis Report",
    "REPORT_SUBTITLE": "Multi-dimensional Data Feature & Business Insight Mining",
    "EXEC_SUMMARY": "<p>This dataset contains 1,000 rows and 5 columns with good data completeness. Key findings include:</p><ul><li><strong>Audience Distribution:</strong> Primarily concentrated in the 25-35 age group...</li></ul>",
    "DISTRIBUTION_INSIGHTS": "<p>The numerical distribution chart reveals that Metric A exhibits a pronounced right-skewed distribution, suggesting...</p>",
    "CORRELATION_INSIGHTS": "<p>The heatmap between variables reveals strong positive correlations, particularly between..., which implies...</p>",
    "CATEGORICAL_INSIGHTS": "<p>Category proportions show that Beijing and Shanghai account for over 50% of the 'City' field.</p>",
    "TIME_SERIES_INSIGHTS": "<p>The time series trend indicates a significant seasonal uptick toward year-end.</p>",
    "CONCLUSIONS": "<p>Based on the comprehensive multi-dimensional analysis, the data exhibits clear structural features and patterns.</p><h3>Recommendations</h3><ul><li>Regularly monitor missing value ratios...</li><li>Focus on high-growth market segments...</li></ul>"
  }
}

Strictly Prohibited:

  • Do NOT pass CHART_DATA_JSON or any auto-injected marker fields in data (handled automatically by the backend)
  • Do NOT add any JavaScript code in data
  • Do NOT omit the template_path parameter (omitting template_path will prevent charts from rendering!)
  • Do NOT return static PNG images — this tool has been fully upgraded to ECharts dynamic frontend rendering
  • Do NOT pass non-existent placeholders (the template only has the following 9 text placeholders + 1 auto-injected CHART_DATA_JSON; other names will be ignored)

Placeholder Reference (9 total, passed by LLM via data)

The placeholders you need to fill in the template are as follows:

Placeholder Type Required Description
LANG Text Yes Report language: "en" for English, "zh" for Chinese. Determines all section titles, labels, and footer text language. Detect from user's input language; default "zh"
REPORT_TITLE Text Yes Report title, e.g., "Sales Dataset Deep Analysis Report"
REPORT_SUBTITLE Text Yes Report subtitle, e.g., "Multi-dimensional Data Feature & Business Insight Mining"
EXEC_SUMMARY HTML Yes Executive summary: overview of data scale, key findings, and conclusion preview
DISTRIBUTION_INSIGHTS HTML Yes Numerical distribution feature interpretation: skewness, volatility, quantile ranges, dispersion
CORRELATION_INSIGHTS HTML Yes Relationship analysis & anomaly identification interpretation: correlations, linkages, outliers, structural relationships
CATEGORICAL_INSIGHTS HTML Yes Feature analysis & structural analysis interpretation: categorical structure, concentration, rankings, and group characteristics
TIME_SERIES_INSIGHTS HTML Yes Supplementary interpretation for the data anomaly overview section: discuss trends if time columns exist; discuss stratification differences and anomaly patterns if no time columns
CONCLUSIONS HTML Yes Root cause inference, conclusions & recommendations body; must distinguish between "data evidence" and "reasonable speculation"

Note: csv_analyzer.py includes ###CHART_DATA_JSON_START###...###CHART_DATA_JSON_END### marker data blocks in its output. The backend automatically extracts and injects these into the template — they should not be passed in data. All section titles in the template (e.g., "Distribution Analysis", "Correlation Analysis", "Conclusions & Recommendations"), insight box titles ("Insights"), and footer text are hardcoded in the HTML and are automatically translated based on the LANG placeholder — they do not need to be passed via placeholders.

Why Choose This Tool?

  1. Fast & Lightweight: No more slow Python plotting and bulk PNG generation — only core JSON data is transmitted.
  2. Modern Interactive Layout: Fully integrated with Tailwind CSS responsive layouts and Apache ECharts smooth animated interactions.
  3. Deep Business Insights: By separating machine-driven data extraction from LLM-driven logical reasoning, this tool produces highly valuable data analysis reports.

File Structure

csv-data-analysis/
├── SKILL.md                        # The skill guide you are currently reading
├── scripts/
│   └── csv_analyzer.py             # Python analysis engine (supports CSV/Excel/TSV, lightweight, no graphics dependencies)
└── templates/
    └── report_template.html        # Responsive ECharts report template (with built-in rendering logic and hardcoded titles)
该技能用于深度分析上市公司财报,通过脚本提取财务数据、计算核心比率并生成可视化图表。结合行业背景撰写多维度分析报告,最终利用HTML模板渲染专业报告卡片,辅助用户快速掌握企业经营状况与风险。
需要分析上市公司年度报告或季度报告 请求提取关键财务指标和计算财务比率 要求生成可视化的财务分析报告
skills/financial-report-analyzer/SKILL.md
npx skills add eosphoros-ai/DB-GPT --skill financial-report-analyzer -g -y
SKILL.md
Frontmatter
{
    "name": "financial-report-analyzer",
    "description": "专门用于上市公司财报(如年度报告、季度报告)的深度分析。该技能能够自动提取关键财务指标,计算核心财务比率,生成可视化图表,并结合行业背景生成专业的财务分析报告。"
}

财报分析技能 (Financial Report Analyzer)

本技能旨在帮助 DB-GPT 系统化地分析上市公司财报,通过提取核心数据、计算财务比率、生成可视化图表并结合业务背景,产出高质量的财务分析报告。

核心工作流程

  1. 数据提取与结构化

    • 使用 execute_skill_script_file 工具执行 scripts/extract_financials.py 脚本,传入财报文件路径(file_path 参数),自动提取营收、净利润、资产、负债等核心数值。
    • 脚本支持 PDF 文件(通过 pdfplumber 解析)和纯文本文件,返回 JSON 格式的结构化数据。
  2. 财务比率计算

    • 使用 execute_skill_script_file 执行 scripts/calculate_ratios.py,传入 Step 1 的 JSON 数据。
    • 自动计算毛利率、净利率、ROE、资产负债率等关键指标,输出 30 个模板占位符键值。
    • 参考 references/financial_metrics.md 确保指标定义的准确性。
    • 系统会自动保存返回的 JSON 结果react_state["ratio_data"]),后续 html_interpreter 会自动合并。
  3. 图表生成

    • 使用 execute_skill_script_file 执行 scripts/generate_charts.py,传入 Step 1 的 JSON 数据。
    • 自动生成 3 张可视化图表:
      • financial_overview.png:核心财务指标对比柱状图
      • profitability.png:盈利能力指标横向条形图
      • asset_structure.png:资产结构环形饼图
    • 系统会自动将图片复制到静态目录并记录 URL 映射react_state["image_url_map"]),后续 html_interpreter 会自动合并。
  4. 深度分析

    • 遵循 references/analysis_framework.md 提供的框架,从盈利质量、偿债风险、营运效率和现金流四个维度进行深度剖析。
    • 结合"经营情况讨论与分析"章节,解释业绩变动的核心驱动因素。
    • 撰写以下 7 段分析文本:
      • PROFITABILITY_ANALYSIS:盈利能力分析
      • SOLVENCY_ANALYSIS:偿债与风险分析
      • EFFICIENCY_ANALYSIS:营运效率分析
      • CASHFLOW_ANALYSIS:现金流与利润质量分析
      • ADVANTAGES_LIST:核心优势列表(HTML <li> 格式)
      • RISKS_LIST:主要风险列表(HTML <li> 格式)
      • OVERALL_ASSESSMENT:综合评价
  5. 渲染报告

    • 调用 html_interpreter,使用 template_path 模式:
      {
        "template_path": "financial-report-analyzer/templates/report_template.html",
        "data": {
          "PROFITABILITY_ANALYSIS": "LLM撰写的盈利能力分析...",
          "SOLVENCY_ANALYSIS": "LLM撰写的偿债分析...",
          "EFFICIENCY_ANALYSIS": "LLM撰写的营运效率分析...",
          "CASHFLOW_ANALYSIS": "LLM撰写的现金流分析...",
          "ADVANTAGES_LIST": "<li>优势1</li><li>优势2</li>",
          "RISKS_LIST": "<li>风险1</li><li>风险2</li>",
          "OVERALL_ASSESSMENT": "LLM撰写的综合评价..."
        },
        "title": "XX公司 2023年度财报分析报告"
      }
      
    • 重要data 字典中只需传入你撰写的 7 段分析文本!后端会自动合并:
      • Step 2 的 30 个数据指标(COMPANY_NAME、REVENUE、NET_PROFIT 等)
      • Step 3 的图表 URL(CHART_FINANCIAL_OVERVIEW、CHART_PROFITABILITY、CHART_ASSET_STRUCTURE)
    • 绝对不要data 中包含数据指标或图表路径,否则 JSON 过大会导致截断。
  6. 完成

    • 调用 terminate 返回 1-2 句话的简短摘要。
    • 报告会以卡片形式展示在左侧面板,用户点击卡片即可在右侧面板查看完整报告。

完整流程示例

Step 1: execute_skill_script_file(skill_name="financial-report-analyzer", script_file_name="extract_financials.py", args={"file_path": "/path/to/report.pdf"})
  → 返回 JSON: {"revenue": 10500000000, "net_profit": 1200000000, ...}  (记为 raw_data)

Step 2: execute_skill_script_file(skill_name="financial-report-analyzer", script_file_name="calculate_ratios.py", args=<raw_data>)
  → 返回 30 个模板键值,系统自动记录到 react_state["ratio_data"]

Step 3: execute_skill_script_file(skill_name="financial-report-analyzer", script_file_name="generate_charts.py", args=<raw_data>)
  → 生成图表,系统自动复制到 /images/ 并记录 URL 映射

Step 4: (LLM 自行撰写 7 段深度分析文本)

Step 5: html_interpreter(template_path="financial-report-analyzer/templates/report_template.html", data={仅包含 7 段分析文本}, title="报告标题")
  → 后端自动合并数据指标 + 图表 URL + 分析文本,渲染完整报告

Step 6: terminate(result="简短摘要")

资源使用说明

  • 脚本(均通过 execute_skill_script_file 执行):
    • scripts/extract_financials.py:接收 file_path 参数,读取财报文件(支持 PDF 和文本格式),提取核心财务数据。
    • scripts/calculate_ratios.py:计算财务比率,输出 30 个模板占位符键值。系统自动记录结果。
    • scripts/generate_charts.py:生成 3 张可视化图表(matplotlib),系统自动处理图片复制。
    • scripts/fill_template.py:(备用)接收 ratio_datachart_pathsanalysis 三个参数,读取 HTML 模板并替换所有占位符。正常情况下不需要使用此脚本,因为 html_interpreter 的 template_path 模式会自动完成模板填充。
  • 参考
    • references/financial_metrics.md:包含公式定义。
    • references/analysis_framework.md:包含分析逻辑。
  • 模板
    • templates/report_template.html:最终交付报告的 HTML 模板(必须严格遵循,不得删减章节或修改表格结构)。由 html_interpreter 的 template_path 参数自动读取并填充。
    • templates/report_template.md:Markdown 版本,仅供参考结构说明。

注意事项

  • 必须使用 execute_skill_script_file 执行脚本(不要用 shell_interpreter),因为 execute_skill_script_file 会自动处理图片复制和数据记录。
  • 脚本提取可能受排版影响,建议在计算前人工核对提取的关键数值。
  • 始终关注"非经常性损益",以评估公司核心业务的真实盈利能力。
  • 对比至少三年的历史数据,以识别趋势。
  • generate_charts.py 依赖 matplotlib,请确保环境中已安装该库。
指导用户创建或更新技能,扩展Claude能力。提供模块化技能构建指南,涵盖核心原则(简洁性、自由度控制)、目录结构及SKILL.md规范,帮助用户集成专业工作流、工具与领域知识。
用户想要创建一个新的技能 用户需要更新现有的技能
skills/skill-creator/SKILL.md
npx skills add eosphoros-ai/DB-GPT --skill skill-creator -g -y
SKILL.md
Frontmatter
{
    "name": "skill-creator",
    "license": "Complete terms in LICENSE.txt",
    "description": "Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations."
}

Skill Creator

This skill provides guidance for creating effective skills.

About Skills

Skills are modular, self-contained packages that extend Claude's capabilities by providing specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific domains or tasks—they transform Claude from a general-purpose agent into a specialized agent equipped with procedural knowledge that no model can fully possess.

What Skills Provide

  1. Specialized workflows - Multi-step procedures for specific domains
  2. Tool integrations - Instructions for working with specific file formats or APIs
  3. Domain expertise - Company-specific knowledge, schemas, business logic
  4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks

Core Principles

Concise is Key

The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.

Default assumption: Claude is already very smart. Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"

Prefer concise examples over verbose explanations.

Set Appropriate Degrees of Freedom

Match the level of specificity to the task's fragility and variability:

High freedom (text-based instructions): Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.

Medium freedom (pseudocode or scripts with parameters): Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.

Low freedom (specific scripts, few parameters): Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.

Think of Claude as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).

Anatomy of a Skill

Every skill consists of a required SKILL.md file and optional bundled resources:

skill-name/
├── SKILL.md (required)
│   ├── YAML frontmatter metadata (required)
│   │   ├── name: (required)
│   │   └── description: (required)
│   └── Markdown instructions (required)
└── Bundled Resources (optional)
    ├── scripts/          - Executable code (Python/Bash/etc.)
    ├── references/       - Documentation intended to be loaded into context as needed
    └── assets/           - Files used in output (templates, icons, fonts, etc.)

SKILL.md (required)

Every SKILL.md consists of:

  • Frontmatter (YAML): Contains name and description fields. These are the only fields that Claude reads to determine when the skill gets used, thus it is very important to be clear and comprehensive in describing what the skill is, and when it should be used.
  • Body (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).

Bundled Resources (optional)

Scripts (scripts/)

Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.

  • When to include: When the same code is being rewritten repeatedly or deterministic reliability is needed
  • Example: scripts/rotate_pdf.py for PDF rotation tasks
  • Benefits: Token efficient, deterministic, may be executed without loading into context
  • Note: Scripts may still need to be read by Claude for patching or environment-specific adjustments
References (references/)

Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.

  • When to include: For documentation that Claude should reference while working
  • Examples: references/finance.md for financial schemas, references/mnda.md for company NDA template, references/policies.md for company policies, references/api_docs.md for API specifications
  • Use cases: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
  • Benefits: Keeps SKILL.md lean, loaded only when Claude determines it's needed
  • Best practice: If files are large (>10k words), include grep search patterns in SKILL.md
  • Avoid duplication: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
Assets (assets/)

Files not intended to be loaded into context, but rather used within the output Claude produces.

  • When to include: When the skill needs files that will be used in the final output
  • Examples: assets/logo.png for brand assets, assets/slides.pptx for PowerPoint templates, assets/frontend-template/ for HTML/React boilerplate, assets/font.ttf for typography
  • Use cases: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
  • Benefits: Separates output resources from documentation, enables Claude to use files without loading them into context

What to Not Include in a Skill

A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:

  • README.md
  • INSTALLATION_GUIDE.md
  • QUICK_REFERENCE.md
  • CHANGELOG.md
  • etc.

The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxilary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.

Progressive Disclosure Design Principle

Skills use a three-level loading system to manage context efficiently:

  1. Metadata (name + description) - Always in context (~100 words)
  2. SKILL.md body - When skill triggers (<5k words)
  3. Bundled resources - As needed by Claude (Unlimited because scripts can be executed without reading into context window)

Progressive Disclosure Patterns

Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.

Key principle: When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.

Pattern 1: High-level guide with references

# PDF Processing

## Quick start

Extract text with pdfplumber:
[code example]

## Advanced features

- **Form filling**: See [FORMS.md](FORMS.md) for complete guide
- **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
- **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns

Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.

Pattern 2: Domain-specific organization

For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:

bigquery-skill/
├── SKILL.md (overview and navigation)
└── reference/
    ├── finance.md (revenue, billing metrics)
    ├── sales.md (opportunities, pipeline)
    ├── product.md (API usage, features)
    └── marketing.md (campaigns, attribution)

When a user asks about sales metrics, Claude only reads sales.md.

Similarly, for skills supporting multiple frameworks or variants, organize by variant:

cloud-deploy/
├── SKILL.md (workflow + provider selection)
└── references/
    ├── aws.md (AWS deployment patterns)
    ├── gcp.md (GCP deployment patterns)
    └── azure.md (Azure deployment patterns)

When the user chooses AWS, Claude only reads aws.md.

Pattern 3: Conditional details

Show basic content, link to advanced content:

# DOCX Processing

## Creating documents

Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).

## Editing documents

For simple edits, modify the XML directly.

**For tracked changes**: See [REDLINING.md](REDLINING.md)
**For OOXML details**: See [OOXML.md](OOXML.md)

Claude reads REDLINING.md or OOXML.md only when the user needs those features.

Important guidelines:

  • Avoid deeply nested references - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.
  • Structure longer reference files - For files longer than 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.

Skill Creation Process

Skill creation involves these steps:

  1. Understand the skill with concrete examples
  2. Plan reusable skill contents (scripts, references, assets)
  3. Initialize the skill (run init_skill.py)
  4. Edit the skill (implement resources and write SKILL.md)
  5. Package the skill (run package_skill.py)
  6. Iterate based on real usage

Follow these steps in order, skipping only if there is a clear reason why they are not applicable.

Step 1: Understanding the Skill with Concrete Examples

Default: Skip this step and proceed to Step 2 when the user's request already specifies a clear skill topic (e.g., "创建一个Excel分析技能", "Create a PDF processing skill", "生成一个数据可视化技能"). In such cases, you already have enough context to plan the skill — infer reasonable usage patterns yourself and move forward immediately.

Only pause to ask questions when the request is genuinely ambiguous and you cannot proceed without clarification — for example, "帮我创建一个技能" with no topic specified, or a domain so specialized that guessing usage patterns would likely be wrong.

When clarification IS needed, ask at most 1-2 focused questions in a single message, then proceed regardless of the detail level of the user's response. Do NOT enter a multi-turn Q&A loop. Examples of focused questions:

  • "这个技能主要处理什么类型的数据/文件?"
  • "能给一个典型的使用场景吗?"

Conclude this step as quickly as possible. The goal is to start building, not to achieve perfect understanding upfront — iteration (Step 6) exists for refinement.

Step 2: Planning the Reusable Skill Contents

To turn concrete examples into an effective skill, analyze each example by:

  1. Considering how to execute on the example from scratch
  2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly

Example: When building a pdf-editor skill to handle queries like "Help me rotate this PDF," the analysis shows:

  1. Rotating a PDF requires re-writing the same code each time
  2. A scripts/rotate_pdf.py script would be helpful to store in the skill

Example: When designing a frontend-webapp-builder skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:

  1. Writing a frontend webapp requires the same boilerplate HTML/React each time
  2. An assets/hello-world/ template containing the boilerplate HTML/React project files would be helpful to store in the skill

Example: When building a big-query skill to handle queries like "How many users have logged in today?" the analysis shows:

  1. Querying BigQuery requires re-discovering the table schemas and relationships each time
  2. A references/schema.md file documenting the table schemas would be helpful to store in the skill

To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.

Step 3: Initializing the Skill

At this point, it is time to actually create the skill.

Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.

When creating a new skill from scratch, always run the init_skill.py script using shell_interpreter. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.

Important: All script executions in the skill-creator workflow must use the shell_interpreter tool. First, use get_skill_resource to find the skill-creator's script path, then execute via shell_interpreter.

Usage (via shell_interpreter):

Action: shell_interpreter
Action Input: {"code": "python skills/skill-creator/scripts/init_skill.py <skill-name> --path skills/"}

The script:

  • Creates the skill directory at the specified path
  • Generates a SKILL.md template with proper frontmatter and TODO placeholders
  • Creates example resource directories: scripts/, references/, and assets/
  • Adds example files in each directory that can be customized or deleted

After initialization, customize or remove the generated SKILL.md and example files as needed.

Step 4: Edit the Skill

When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Include information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.

Learn Proven Design Patterns

Consult these helpful guides based on your skill's needs:

  • Multi-step processes: See references/workflows.md for sequential workflows and conditional logic
  • Specific output formats or quality standards: See references/output-patterns.md for template and example patterns

These files contain established best practices for effective skill design.

Start with Reusable Skill Contents

To begin implementation, start with the reusable resources identified above: scripts/, references/, and assets/ files. Note that this step may require user input. For example, when implementing a brand-guidelines skill, the user may need to provide brand assets or templates to store in assets/, or documentation to store in references/.

Added scripts must be tested by actually running them via shell_interpreter to ensure there are no bugs and that the output matches what is expected. For example: shell_interpreter({"code": "python skills/<new-skill>/scripts/my_script.py --arg value"}). If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.

Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in scripts/, references/, and assets/ to demonstrate structure, but most skills won't need all of them.

Update SKILL.md

Writing Guidelines: Always use imperative/infinitive form.

Frontmatter

Write the YAML frontmatter with name and description:

  • name: The skill name
  • description: This is the primary triggering mechanism for your skill, and helps Claude understand when to use the skill.
    • Include both what the Skill does and specific triggers/contexts for when to use it.
    • Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Claude.
    • Example description for a docx skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"

Do not include any other fields in YAML frontmatter.

Body

Write instructions for using the skill and its bundled resources.

Step 5: Packaging a Skill

Once development of the skill is complete, it must be packaged into a distributable .skill file that gets shared with the user. Use shell_interpreter to run the packaging script:

Action: shell_interpreter
Action Input: {"code": "python skills/skill-creator/scripts/package_skill.py <path/to/skill-folder>"}

Optional output directory specification:

Action: shell_interpreter
Action Input: {"code": "python skills/skill-creator/scripts/package_skill.py <path/to/skill-folder> ./dist"}

The packaging script will:

  1. Validate the skill automatically, checking:

    • YAML frontmatter format and required fields
    • Skill naming conventions and directory structure
    • Description completeness and quality
    • File organization and resource references
  2. Package the skill if validation passes, creating a .skill file named after the skill (e.g., my-skill.skill) that includes all files and maintains the proper directory structure for distribution. The .skill file is a zip file with a .skill extension.

If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.

Step 6: Iterate

After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.

Iteration workflow:

  1. Use the skill on real tasks
  2. Notice struggles or inefficiencies
  3. Identify how SKILL.md or bundled resources should be updated
  4. Implement changes and test again
分析沃尔玛销售数据与失业率的关系,生成相关性热力图、散点图及时间序列趋势。自动创建包含深度分析和商业建议的HTML报告,适用于探索销售数据与宏观经济因素的关联。
分析沃尔玛销售数据 探索销售额与失业率的相关性 生成销售数据分析HTML报告
skills/walmart-sales-analyzer/SKILL.md
npx skills add eosphoros-ai/DB-GPT --skill walmart-sales-analyzer -g -y
SKILL.md
Frontmatter
{
    "name": "walmart-sales-analyzer",
    "description": "Analyze Walmart sales data to explore trends between store sales and unemployment rates. Generate insightful visualizations and a beautiful HTML report with deep analysis. Suitable for quick insights into the relationship between sales data and macroeconomic factors."
}

Walmart Sales Data Deep Analyzer

This skill is designed to help users conduct in-depth analysis of Walmart sales data, particularly exploring the relationship between sales and unemployment rates across different stores. It visually presents these trends by generating visualizations with detailed interpretations and professional HTML reports.

Features

This skill provides the following analysis and visualization features:

  1. Data Correlation Heatmap: Displays the correlation between all numerical variables in the dataset and provides a detailed interpretation.
  2. Sales vs. Unemployment Scatter Plot: Visually demonstrates the relationship between weekly sales and the unemployment rate, accompanied by a regression line, and deeply analyzes consumption resilience under economic pressure.
  3. Time Series Trend of Sales and Unemployment for Specific Stores: Tracks the trends of sales and unemployment rates over time for selected stores to analyze seasonal forces and macro trends.
  4. Comparison of Average Sales and Average Unemployment Across Stores: Compares the average sales performance of different stores with local average unemployment rates to provide suggestions for regional operational strategies.
  5. HTML Deep Analysis Report Generation: Automatically integrates all charts into a beautiful, responsive HTML report that includes detailed analysis conclusions and business recommendations.

Usage

To use this skill, you need to provide a CSV file containing Walmart sales data. The file should contain at least the following columns: Store (Store ID), Date (Date), Weekly_Sales (Weekly Sales), Unemployment (Unemployment Rate).

Core Workflow

  1. Check Uploaded File: First, verify that a valid Walmart Sales CSV file was provided.
  2. Execute Analysis Script: Use the execute_skill_script_file tool to run the generate_html_report.py script. Pass the CSV file path to the input_file argument in the args parameter.
    • Example: {"skill_name": "walmart-sales-analyzer", "script_file_name": "generate_html_report.py", "args": {"input_file": "/path/to/Walmart_Sales.csv", "output_dir": "."}}
    • Note: This script automatically generates all required charts (correlation_heatmap.png, sales_vs_unemployment_scatter.png, etc.) and the base report.
  3. Present Report: To present the results to the user via the DB-GPT UI, you must use the html_interpreter tool. Provide the template_path (walmart-sales-analyzer/templates/report_template.html) and the necessary text data to render the report interactively. You MUST fill in ALL the placeholders dynamically based on your analysis (including ALL section titles, report titles, and analysis content, otherwise they will render as 'NA') and ensure they are translated to the user's language.
    • Example data payload: { "LANG": "en", "REPORT_TITLE": "Walmart Sales Deep Analysis Report", "REPORT_SUBTITLE": "Based on macroeconomic indicators and store performance", "EXEC_SUMMARY_TITLE": "Executive Summary", "EXEC_SUMMARY_CONTENT": "

      Your detailed summary...

      ", "SECTION_1_TITLE": "1. Multi-dimensional Correlation Analysis", "SECTION_1_ANALYSIS": "

      <span class="tag">Insights Variable relationships

      • ...
      ", "SECTION_2_TITLE": "2. Sales vs Unemployment Regression", "SECTION_2_ANALYSIS": "

      <span class="tag">Deep Dive Resilience under pressure

      ...

      ", "SECTION_3_TITLE": "3. Dynamic Trends Tracking", "SECTION_3_ANALYSIS": "

      <span class="tag">Trends Seasonal vs Macro

      ...

      ", "SECTION_4_TITLE": "4. Store Performance Comparison", "SECTION_4_ANALYSIS": "

      <span class="tag">Strategy Regional operations

      ...

      ", "CONCLUSION_TITLE": "Final Conclusions & Recommendations", "CONCLUSION_CONTENT": "
      1. ...
      ", "FOOTER_TEXT": "Deep Data-Driven Decisions" }
  4. Complete Task: Call terminate with a final answer summarizing your actions.

Script List

  • scripts/generate_html_report.py: Recommended, generates an HTML report containing all charts and deep analysis with one click.
  • scripts/generate_correlation_heatmap.py: Generates a data correlation heatmap.
  • scripts/generate_sales_unemployment_scatter.py: Generates a scatter plot of sales vs. unemployment rate.
  • scripts/generate_time_series_trend.py: Generates a time series trend chart for a specific store.
  • scripts/generate_store_avg_comparison.py: Generates a comparison chart of average values across stores.

Templates

  • templates/report_template.html: HTML style template used to generate the deep analysis report.

Important Notes

  • Language Requirement: You MUST ensure that your output language exactly matches the language used by the user in their input/request.
  • All charts support multi-language display.
  • The report template uses a responsive design suitable for viewing on different devices and provides detailed analysis interpretations and business suggestions.

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 20:30
浙ICP备14020137号-1 $Carte des visiteurs$