All docs

Product features: what belongs in a skill (allow-list)

Purpose: when generating or updating a skill, keep only what execution needs; drop everything else.

Source help/en/product-features/skill-content-rules.md

Purpose: when generating or updating a skill, keep only what execution needs; drop everything else. Applies: chat “generate / update skill”, Skills Center “Describe to create / Improve”, hand edits, and import. How it lands: writing injection prefers this article; publish checks catch leaked thinking blocks, duplicate H2s, and contradictory delivery rules.

A skill is a step-by-step how-to for the agent plus optional executables — not a writing-process scratchpad, and not a chat-log archive.


1. Principles

  1. Allow-list: only items under Allowed below may enter the skill pack; anything not listed stays out by default.
  2. One thing, one use: every file and body section must answer “what does execution rely on this for”; if you cannot answer, delete it.
  3. Single source of truth: each rule in one place; no “forbidden above, allowed below” soft conflicts.
  4. Reproducible: body states steps and delivery; long templates, scripts, sample HTML go in attached files, cited by path — do not dump a whole debug trail into the body.

2. Allow-list: what a skill must / may have

2.1 Metadata (required)

ContentWhyRequirement
Name (display)Skills Center list title; user recognizes “which capability”Short, scene-recognizable, e.g. “Rilong department-level chart”
Id (slug)Export-pack directory name, interop with external toolsLowercase hyphenated; usually system-generated
Trigger notesWhether chat recalls itMust include When to use / When not; When to use starts with trigger phrases
Capability typeList filter tag2–8 characters, e.g. “Data report”; system may infer

2.2 Skill body (required)

Editor Markdown / SKILL.md body after frontmatter.

SectionWhen requiredWhy
# Display name (optional one-line title)RecommendedMatches the list name, easier to read
## How to useRequiredWhich class of work repeats, prerequisites, required inputs, recommended call order; ask if input is missing
## Done whenRequiredVisible delivery on success (file link, report, receipt copy)
## Failure signalsRequiredMust stop and explain to the user
## APIs and callsWhen there is HTTPMethod, URL, auth placeholder, parameter highlights
## ProcedureNo HTTP, pure stepsHow to do it step by step
## Script executionWhen using run_scriptWhich script, I/O, relation to business steps
## Chart spec / delivery shapeCharts or a fixed HTML reportChart types, field mapping; or the one delivery-template convention
## Troubleshooting and iterationKnown pitfallsSymptom → handling; keep only still-valid items
## CautionsPermission/secret boundariesDo not hard-code secrets, credential names, host scope

The body may include classification tables, placeholder notes, forced paths (e.g. local ECharts), and relative-path cites of attached files.

2.3 Attached files (as needed; do not create empty directories)

DirectoryWhyPutDo not put
references/Long material loaded on demand so the body stays shortAPI notes, query-definition JSON, complete reusable HTML/report templates, field mapsChat excerpts, one-off run results, expired drafts
scripts/Deterministic compute/assemble (sandbox)Clean after fetch, aggregate, fill a template to generate HTML/OfficeRetired scripts, empty NotImplemented shells, matplotlib-then-PNG scripts that contradict a body red line
assets/Static assets, layout shellsEmpty HTML, CSS, icons, sample structure (no business secrets)One-run PNG screenshots as “gold answers”, files with real tokens

Conventions:

  • If the user-accepted “standard delivery” is a whole HTML, it should land in references/ (or assets/) as a complete template; the body only says “this file is authoritative + how to replace data” — not a half skeleton in the body.
  • If the body says “no Python plotting”, scripts/ must not keep plotting scripts; keep only assemble/fill-template scripts (if needed).
  • One-run headcounts (e.g. 93, 1745) may only be marked example, do not copy, or omitted; execution uses this run’s fetch.

2.4 Optional: permission declaration (frontmatter)

permissions:
  tools: [data_source_invoke, file_write]
  secrets: [CredentialName]

Declares which tools and connection-credential names this skill depends on (not secret values). Skip if there is no external dependency.


3. Forbidden list: never on generate / update

Do not write the following into the skill body, trigger notes, or attached files:

ForbiddenWhy extra / harmful
<think> / <thinking> / <redacted_thinking> thinking blocksModel writing draft, not execution steps; wastes context, misleads execution
“I plan to read the skill then change…” process narrativeSame — chat process, not a skill
Duplicate same-named ## titles (delivery shape twice)Patch misalignment, stacked rules
Retired path plus a current red line (“no PNG” then “PNG may be the default preview”)The agent still takes the old path
Real API keys, Bearer tokens, passwordsSecurity risk
Invented URLs, fields, numbers that never appeared in the materialsExecution fails or fake data
Vague trigger sentences (“auto-generated from a conversation”, “helps improve efficiency”, “user message involves APIs this skill inferred”)Recall useless
Changelog-style long text (“v1 used a script / v2 switched to HTML…” as steps)Keep only current valid steps; history belongs in version records
Uncited retired scripts / empty template filesRaises mis-call chance
CDN external scripts (when local vendor is required)Preview unavailable or against platform rules
Whole chat logs, tool_trace dumps in the bodyShould be tidied into steps; raw excerpts are not a skill

4. Minimum viable pack (check)

Notes only (no scripts, no template files):

  • Metadata + body (How to use / Done when / Failure signals + optional sections)

Fetch + fixed HTML report (e.g. department-level stats):

  • Metadata + body (delivery red lines, classification rules, cite paths)
  • Body must include a parseable Markdown classification table (department rollup, level keywords) + placeholder list (if the template uses __TOTAL__ etc.)
  • One complete HTML template under references/ (may include __placeholders__, or a full layout skeleton with sample numbers)
  • Recommended: scripts/ with a build_report(...) aggregate/fill-template script (no plotting) — copied as-is when creating an app
  • Chat finished stats, skill has no script (body classification notes + HTML template only): creating an app, the model generates in-app build_report.py from “skill body + how this conversation produced the report”, freezing equivalent compute into the app
  • Still recommend classification table and placeholders in the body for model compile and human check
  • Do not: old plotting scripts, half table bodies, think, PNGs that contradict the red line; do not assume a platform-resident universal report calculator
  • Flow: produce the report with a skill in chat first → then say “generate an app”

Fetch + map / structure HTML (store pins, org tree):

  • Same “fixed HTML” requirements; template scripts use platform Leaflet or Mermaid (see /static/vendor/)
  • Repo skeletons: examples/html-vendor-skills/dept-level-charts/, store-locations-map/, org-structure-diagram/
  • Do not: Google/Baidu SDKs, CDN, unregistered charting libs; do not replace platform ECharts with matplotlib / homemade SVG for statistical charts

API-call type:

  • Metadata + body (including ## APIs and calls) + {{CredentialName}}
  • Long API notes may go in references/

5. Self-check after generate and update (must pass)

  1. Does the body start with a title or ## How to use, with no think / planning fluff at the start?
  2. Is there only one current delivery path, old paths wiped?
  3. Is every attached file cited by the body? Uncited: delete.
  4. Are example numbers marked “do not copy” or removed?
  5. Do trigger notes include concrete trigger phrases + When not?
  6. Any real secrets or CDN (when forbidden)?

If any item fails: fix until it passes before publish — do not bump a version with extras.


6. Related docs