AGENT SKILL

resources

Uploads a custom skill from a local directory and keeps it current. The directory must contain a SKILL.md with name and description frontmatter; its basename becomes the skill's top-level directory. The provider hashes the files on every plan: when the content changes it uploads a new skill version and latest_version_id moves. Skills have no update endpoint and the API returns no content hash, so changes made outside Terraform are not detected. terraform destroy deletes the skill and every version. Set delete_on_destroy = false to leave it in place. Deleting a version that an agent or deployment pins breaks them at run time. ~> The Managed Agents API is in beta. This resource needs api_key (a regular workspace API key, not an Admin key) and workspace_id when the key can reach more than one workspace.

License 许可
MPL-2.0
最近更新
2026-11-09
Stars
★ 0
Forks
0

01 前言 Front Matter

page_title
anthropic_skill Resource - Anthropic Enterprise
description
Uploads a custom skill from a local directory and keeps it current. The directory must contain a SKILL.md with name and description frontmatter; its basename becomes the skill's top-level directory. The provider hashes the files on every plan: when the content changes it uploads a new skill version and latest_version_id moves. Skills have no update endpoint and the API returns no content hash, so changes made outside Terraform are not detected. terraform destroy deletes the skill and every version. Set delete_on_destroy = false to leave it in place. Deleting a version that an agent or deployment pins breaks them at run time. ~> The Managed Agents API is in beta. This resource needs api_key (a regular workspace API key, not an Admin key) and workspace_id when the key can reach more than one workspace.
subcategory
Skills

02 资源文件 22

03 SKILL.md 正文

anthropic_skill (Resource)

Uploads a custom skill from a local directory and keeps it current. The directory must contain a SKILL.md with name and description frontmatter; its basename becomes the skill's top-level directory. The provider hashes the files on every plan: when the content changes it uploads a new skill version and latest_version_id moves. Skills have no update endpoint and the API returns no content hash, so changes made outside Terraform are not detected.

terraform destroy deletes the skill and every version. Set delete_on_destroy = false to leave it in place. Deleting a version that an agent or deployment pins breaks them at run time.

~> The Managed Agents API is in beta. This resource needs api_key (a regular workspace API key, not an Admin key) and workspace_id when the key can reach more than one workspace.

Example Usage

# The directory must contain SKILL.md; its basename becomes the skill folder.
resource "anthropic_skill" "release_notes" {
  source_dir = "${path.module}/skills/example-skill"
}

resource "anthropic_agent" "writer" {
  name  = "release-writer"
  model = "claude-sonnet-5"

  skills = [
    { type = "custom", skill_id = anthropic_skill.release_notes.id, version = anthropic_skill.release_notes.latest_version_id },
  ]
}

<!-- schema generated by tfplugindocs -->

Schema

Required

  • source_dir (String) Local directory holding SKILL.md and up to 20 files (30 MB total). Changing the path forces a new skill.

Optional

  • delete_on_destroy (Boolean) Delete the skill (all versions) on destroy. Defaults to true. Imported resources start with false, so removing one from configuration cannot destroy it until you opt in.
  • display_name (String) Display label, up to 255 characters. Defaults to the SKILL.md name. Cannot be changed after creation.

Read-Only

  • content_hash (String) SHA-256 over the sorted file paths and contents of source_dir, computed locally on every plan.
  • created_at (String) Creation timestamp (RFC 3339).
  • id (String) Skill id (skill_...).
  • latest_version_id (String) Id of the newest version; pin agents to it with skills[].version.
  • name (String) Slug from the SKILL.md frontmatter; every version must keep it.
  • source_type (String) Always custom for uploaded skills.
  • updated_at (String) Last update timestamp (RFC 3339).

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import anthropic_skill.release_notes skill_01ExampleSkillId000000000

04 同仓库更多 Skills