crewAIInc/crewAI · error · SystemExit

No SKILL.md found in current directory. Run this command fro

Error message

No SKILL.md found in current directory. Run this command from inside a skill directory.

What it means

`crewai skill publish` requires a `SKILL.md` in the current working directory, since frontmatter in that file supplies the skill's name, description, and version. If `Path("SKILL.md").exists()` is false the command exits with SystemExit(1) before doing anything else.

Source

Thrown at lib/cli/src/crewai_cli/skills/main.py:193

                    json.dumps(meta, indent=2), encoding="utf-8"
                )
            console.print(
                f"[green]Installed [bold]{ref}[/bold]{' (' + version + ')' if version else ''} to global cache.[/green]"
            )

    def publish(self, org: str | None = None, force: bool = False) -> None:
        """Publish the skill in the current directory to the registry.

        Skills are always scoped to the publishing organization; there is no
        public visibility option.
        """
        skill_md = Path("SKILL.md")
        if not skill_md.exists():
            console.print(
                "[red]No SKILL.md found in current directory. "
                "Run this command from inside a skill directory.[/red]"
            )
            raise SystemExit(1)

        if not force:
            try:
                repository = git.Repository(fetch=False)
            except ValueError as exc:
                if "not a Git repository" not in str(exc):
                    console.print(
                        f"[red]Unable to validate git state: {exc}\n"
                        "Fix the issue or pass --force to skip this check.[/red]"
                    )
                    raise SystemExit(1) from exc
                # Standalone skill directories may live outside any git repo;
                # there is no git state to validate in that case.
                repository = None
            if repository is not None:
                try:
                    # Refresh remote-tracking refs so is_synced() compares
                    # against the actual remote, not stale local state.

View on GitHub (pinned to 754d7323be)

Solutions

  1. `cd` into the directory containing SKILL.md and re-run `crewai skill publish`.
  2. If no SKILL.md exists yet, scaffold one first with `crewai skill create <name>` and fill in frontmatter.
  3. On case-sensitive filesystems, verify the file is exactly `SKILL.md` (rename if needed).

Example fix

# before (from repo root)
crewai skill publish   # No SKILL.md found in current directory.

# after
cd skills/my-skill
crewai skill publish
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

def in_skill_directory() -> bool:
    return (Path.cwd() / "SKILL.md").is_file()

# guard before publish
assert in_skill_directory(), "cd into the skill directory first"

Prevention

When it happens

Trigger: Running `crewai skill publish` from a project root, home directory, or any folder that is not the skill directory itself. The check is strictly CWD-relative — a SKILL.md one level up or in a subfolder does not count.

Common situations: Publishing right after `git clone` from the repo root instead of `cd skills/my-skill`; typos like `skill.md` or `Skill.md` on case-sensitive filesystems; running the command in a fresh terminal that starts in $HOME.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/cec1506bd0b21fd6. Report an issue: GitHub.