generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "anthropic_skill Resource - terraform-provider-anthropic" subcategory: "" description: |- Manages a custom Anthropic Skill. A skill consists of a SKILL.md file (with YAML frontmatter name and description) and optionally additional files (scripts, references, etc.) under the same folder. Use either content for a single-file SKILL.md, or source_dir to point at a directory that contains SKILL.md plus any companion files. When content or source_dir changes, a new skill version is uploaded — the skill keeps its ID, so attached agents do not need to be re-attached.
anthropic_skill (Resource)
Manages a custom Anthropic Skill.
A skill consists of a SKILL.md file (with YAML frontmatter name and description) and optionally additional files (scripts, references, etc.) under the same folder.
Use either content for a single-file SKILL.md, or source_dir to point at a directory that contains SKILL.md plus any companion files.
When content or source_dir changes, a new skill version is uploaded — the skill keeps its ID, so attached agents do not need to be re-attached.
Example Usage
# Create a custom skill with inline SKILL.md content
resource "anthropic_skill" "code_reviewer" {
display_title = "Code Reviewer"
skill_name = "code-reviewer"
content = <<-EOT
---
name: code-reviewer
description: Reviews code for quality issues, security vulnerabilities, and best practices
---
# Code Review Skill
## Instructions
When asked to review code:
1. Check for security vulnerabilities (SQL injection, XSS, etc.)
2. Verify error handling is comprehensive
3. Look for performance issues
4. Ensure code follows project conventions
5. Suggest improvements with examples
## Output Format
Provide findings as a numbered list with severity (HIGH/MEDIUM/LOW).
EOT
}
# Use the skill with an agent
resource "anthropic_agent" "reviewer" {
name = "code-review-agent"
model = "claude-sonnet-4-5"
skills {
skill_id = anthropic_skill.code_reviewer.id
type = "custom"
version = "latest"
}
}
<!-- schema generated by tfplugindocs -->
Schema
Required
display_title(String) Display title for the Skill. Must be globally unique within the workspace.skill_name(String) Name of the skill (must match thenamefield in SKILL.md frontmatter). Max 64 chars, lowercase letters/numbers/hyphens only.
Optional
content(String) Full content of SKILL.md including YAML frontmatter and markdown body. Mutually exclusive withsource_dir. Updating this attribute uploads a new skill version in place (skill ID is preserved).
Example:
---
name: my-skill
description: What this skill does
---
# Instructions
...
source_dir(String) Path to a directory containingSKILL.mdand any additional files (scripts, references, etc.) that should be packaged into the skill. The directory's contents are zipped under the skill's folder. Mutually exclusive withcontent. Updating this attribute (or any file beneath it) uploads a new skill version in place (skill ID is preserved).
Read-Only
created_at(String) RFC 3339 datetime when the skill was created.id(String) ID of the Skill.latest_version(String) Latest version identifier of the skill.source(String) Source of the skill (customoranthropic).source_hash(String) SHA-256 of the packaged skill contents. Computed automatically; used to detect changes whensource_diris in use (since file contents are not stored in the state otherwise).updated_at(String) RFC 3339 datetime when the skill was last updated.