{"record":{"id":"cec1506bd0b21fd6","repo":"crewAIInc/crewAI","slug":"no-skill-md-found-in-current-directory-run-this-c","errorCode":null,"errorMessage":"No SKILL.md found in current directory. Run this command from inside a skill directory.","messagePattern":"No SKILL\\.md found in current directory\\. Run this command from inside a skill directory\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/skills/main.py","lineNumber":193,"sourceCode":"                    json.dumps(meta, indent=2), encoding=\"utf-8\"\n                )\n            console.print(\n                f\"[green]Installed [bold]{ref}[/bold]{' (' + version + ')' if version else ''} to global cache.[/green]\"\n            )\n\n    def publish(self, org: str | None = None, force: bool = False) -> None:\n        \"\"\"Publish the skill in the current directory to the registry.\n\n        Skills are always scoped to the publishing organization; there is no\n        public visibility option.\n        \"\"\"\n        skill_md = Path(\"SKILL.md\")\n        if not skill_md.exists():\n            console.print(\n                \"[red]No SKILL.md found in current directory. \"\n                \"Run this command from inside a skill directory.[/red]\"\n            )\n            raise SystemExit(1)\n\n        if not force:\n            try:\n                repository = git.Repository(fetch=False)\n            except ValueError as exc:\n                if \"not a Git repository\" not in str(exc):\n                    console.print(\n                        f\"[red]Unable to validate git state: {exc}\\n\"\n                        \"Fix the issue or pass --force to skip this check.[/red]\"\n                    )\n                    raise SystemExit(1) from exc\n                # Standalone skill directories may live outside any git repo;\n                # there is no git state to validate in that case.\n                repository = None\n            if repository is not None:\n                try:\n                    # Refresh remote-tracking refs so is_synced() compares\n                    # against the actual remote, not stale local state.","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/skills/main.py#L175-L211","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["`cd` into the directory containing SKILL.md and re-run `crewai skill publish`.","If no SKILL.md exists yet, scaffold one first with `crewai skill create <name>` and fill in frontmatter.","On case-sensitive filesystems, verify the file is exactly `SKILL.md` (rename if needed)."],"exampleFix":"# before (from repo root)\ncrewai skill publish   # No SKILL.md found in current directory.\n\n# after\ncd skills/my-skill\ncrewai skill publish","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef in_skill_directory() -> bool:\n    return (Path.cwd() / \"SKILL.md\").is_file()\n\n# guard before publish\nassert in_skill_directory(), \"cd into the skill directory first\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always `cd <skill-dir>` before `crewai skill publish`.","Name the file exactly `SKILL.md` (case matters on Linux).","Automate publishes with a script that locates SKILL.md and cds to its parent."],"tags":["cli","filesystem","publish","skill"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}