langchain-ai/deepagents · warning · SystemExit
Error: Invalid skill name: {error_msg}
Error message
Error: Invalid skill name: {error_msg} What it means
Raised inside the /skills create command when the chosen skill name violates the Agent Skills spec (lowercase alphanumeric plus hyphens). The command prints guidance and exits with SystemExit(1) rather than creating an invalid skill directory.
Source
Thrown at libs/code/deepagents_code/skills/commands.py:436
Raises:
SystemExit: If the skill name is invalid or the directory cannot be created.
"""
from rich.markup import escape as escape_markup
from deepagents_code.config import Credentials, console, get_glyphs
# Validate skill name first (per Agent Skills spec)
is_valid, error_msg = _validate_name(skill_name)
if not is_valid:
console.print(f"[bold red]Error:[/bold red] Invalid skill name: {error_msg}")
console.print(
"[dim]Per Agent Skills spec: names must be lowercase alphanumeric "
"with hyphens only.\n"
"Examples: web-research, code-review, data-analysis[/dim]",
style=theme.MUTED,
)
raise SystemExit(1)
# Determine target directory
credentials = Credentials.from_environment()
if project:
if not credentials.project_root:
console.print("[bold red]Error:[/bold red] Not in a project directory.")
console.print(
"[dim]Project skills require a .git directory "
"in the project root.[/dim]",
style=theme.MUTED,
)
raise SystemExit(1)
skills_dir = ensure_project_skills_dir(credentials.project_root)
if skills_dir is None:
console.print(
"[bold red]Error:[/bold red] Could not create project skills directory."
)
raise SystemExit(1)View on GitHub (pinned to a1af029e6e)
Solutions
- Rename the skill to lowercase alphanumeric with hyphens, e.g. code-review
- Strip/normalize the name before invoking: re.sub(r'[^a-z0-9-]', '-', name.lower()).strip('-')
- Follow the printed examples (web-research, code-review, data-analysis)
Example fix
// before skills create Code_Review // after skills create code-review
Defensive patterns
Strategy: validation
Validate before calling
import re
def valid_skill_name(name: str) -> bool:
return bool(re.fullmatch(r"[a-z0-9]+(-[a-z0-9]+)*", name))
name = re.sub(r"[^a-z0-9-]", "-", name.lower()).strip("-") Try / catch
try:
run_skills_create(name=name, ...)
except SystemExit:
console.print(f"' {name}' invalid; try {slugify(name)}") Prevention
- Slugify names: lowercase, replace spaces/underscores with hyphens
- Follow the Agent Skills naming spec (lowercase alphanumeric + hyphens)
- Prevent names starting/ending with a hyphen
- Show the naming rules in your UI before accepting input
When it happens
Trigger: Running the skills create flow (execute_skills_command -> _create) with a name containing uppercase letters, spaces, underscores, dots, or other non-conforming characters.
Common situations: Typing "My Skill" or "code_review" as a skill name; copy-pasting a display title; using CamelCase out of habit.
Related errors
- Invalid agent name: {agent_name!r} is reserved for dcode's o
- trusted_ask_user_tool must be named ask_user
- trusted_compaction_tool must be named compact_conversation
- Cannot combine 'all' with other commands in --shell-allow-li
- cli_max_retries must be >= 0, got {self.cli_max_retries}
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/ab9a5deb28674d6b.
Report an issue: GitHub.