Skills in Prime Agent are importable Python packages or markdown files managed by a built-in discovery system; the Skill type unifies both kinds (distinguished by a kind field), and the loader exports functions to find, format, and extract runtime metadata for installation. Skill discovery scans directories for SKILL.md files or loose .md files, respects gitignore patterns and hidden entries, tolerates read errors gracefully, and normalizes Python dependencies automatically — allowing skills to be organized as project, personal, or package-level workflows.
Skills in prime-agent are importable Python packages; a built-in skill creator can turn recurring workflows into project or personal skills.[1] The Skill type in packages/coding-agent/src/core/skills.ts is a discriminated union of MarkdownSkill and PythonSkill, distinguished by a kind field ("markdown" | "python"); Python skills carry a python: SkillPythonMetadata field, while markdown skills do not.[2]
packages/coding-agent/src/index.ts exports the skills system — loadSkills, loadSkillsFromDir, formatSkillsForPrompt, getPythonSkillRuntimeInfo, and related types — from ./core/skills.js.[3] getPythonSkillRuntimeInfo filters a skill list to only Python skills and returns each skill's name, importName, packagePath, and pyprojectPath — the data needed to install them into the IPython kernel.[2]
loadSkillsFromDir follows these discovery rules: a directory containing SKILL.md is treated as a skill root and recursion stops there; otherwise, direct .md children of the scan root are loaded, and subdirectories are recursed to find nested SKILL.md files.[2] During skill directory scanning, node_modules directories and hidden entries (names starting with .) are always skipped.[2] Skill discovery honors .gitignore, .ignore, and .fdignore files, applying their patterns relative to the scan root so that nested ignore files are scoped correctly.[2] Unreadable ignore files encountered during skill discovery are silently skipped rather than causing an error.[2] A scan failure of an entire skill directory is logged as a warning rather than a thrown error, allowing the agent to continue loading other skills.[2]
Skill names must match their parent directory name, consist only of lowercase a–z, digits, and hyphens, be no longer than 64 characters, and must not start, end with, or contain consecutive hyphens — all enforced by validation in packages/coding-agent/src/core/skills.ts.[2]
normalizePythonSkills in packages/coding-agent/src/core/kernel/bootstrap.ts automatically resolves sibling directory dependencies of a Python skill by scanning adjacent directories for pyproject.toml files and matching project names, ensuring transitive local packages are included.[4] Python skill deduplication uses the composite key importName + '\0' + packagePath, so the same package found at two different paths is treated as two distinct skills.[4]
The prime-agent-runtime skill.py cli() function is a console-script entry point that imports the skill module by name (matching sys.argv[0] stem), locates its run callable, and runs it via tyro; the console-script name must exactly match the skill's Python import name, using underscores instead of dashes.[5] run_cli(func, prog) in prime-agent-runtime/src/rlm/skill.py parses CLI arguments for a skill function using tyro, awaits the result if it is a coroutine, and prints a non-None result to stdout.[5]
Since v0.2.2, a bundled websearch skill (Google search via the Serper API) loads by default; a Serper key is added via /login ("Serper (web search)") and stored with other credentials. The skill can be disabled with bundledSkills.websearch: false and overridden by a same-named skill in any user, project, package, or --skill location.[6] Since v0.2.3, built-in Linear and Notion integrations ship as bundled Python skills that talk to each service's official MCP server; they are disabled by default and activate after signing in via the Services tab in /login or /mcp login, with credentials stored in the existing auth.json.[7]
Sources