skilld 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +45 -21
  2. package/dist/_chunks/agent.mjs +8 -7
  3. package/dist/_chunks/agent.mjs.map +1 -1
  4. package/dist/_chunks/assemble.mjs +134 -0
  5. package/dist/_chunks/assemble.mjs.map +1 -0
  6. package/dist/_chunks/cache2.mjs +1 -1
  7. package/dist/_chunks/detect.mjs +737 -0
  8. package/dist/_chunks/detect.mjs.map +1 -0
  9. package/dist/_chunks/embedding-cache.mjs +1 -1
  10. package/dist/_chunks/formatting.mjs +25 -294
  11. package/dist/_chunks/formatting.mjs.map +1 -1
  12. package/dist/_chunks/install.mjs +38 -12
  13. package/dist/_chunks/install.mjs.map +1 -1
  14. package/dist/_chunks/list.mjs +3 -1
  15. package/dist/_chunks/list.mjs.map +1 -1
  16. package/dist/_chunks/pool.mjs +113 -167
  17. package/dist/_chunks/pool.mjs.map +1 -1
  18. package/dist/_chunks/prompts.mjs +64 -735
  19. package/dist/_chunks/prompts.mjs.map +1 -1
  20. package/dist/_chunks/sanitize.mjs +2 -2
  21. package/dist/_chunks/sanitize.mjs.map +1 -1
  22. package/dist/_chunks/search-interactive.mjs +14 -3
  23. package/dist/_chunks/search-interactive.mjs.map +1 -1
  24. package/dist/_chunks/search.mjs +3 -1
  25. package/dist/_chunks/search2.mjs +180 -0
  26. package/dist/_chunks/search2.mjs.map +1 -0
  27. package/dist/_chunks/skills.mjs +292 -0
  28. package/dist/_chunks/skills.mjs.map +1 -0
  29. package/dist/_chunks/sync.mjs +313 -35
  30. package/dist/_chunks/sync.mjs.map +1 -1
  31. package/dist/_chunks/sync2.mjs +4 -2
  32. package/dist/_chunks/uninstall.mjs +6 -4
  33. package/dist/_chunks/uninstall.mjs.map +1 -1
  34. package/dist/_chunks/validate.mjs +2 -1
  35. package/dist/_chunks/validate.mjs.map +1 -1
  36. package/dist/agent/index.d.mts +29 -6
  37. package/dist/agent/index.d.mts.map +1 -1
  38. package/dist/agent/index.mjs +4 -3
  39. package/dist/cli.mjs +24 -13
  40. package/dist/cli.mjs.map +1 -1
  41. package/dist/retriv/index.d.mts +4 -1
  42. package/dist/retriv/index.d.mts.map +1 -1
  43. package/dist/retriv/index.mjs +25 -10
  44. package/dist/retriv/index.mjs.map +1 -1
  45. package/dist/retriv/worker.d.mts.map +1 -1
  46. package/dist/retriv/worker.mjs +2 -16
  47. package/dist/retriv/worker.mjs.map +1 -1
  48. package/package.json +2 -2
  49. package/dist/_chunks/pool2.mjs +0 -115
  50. package/dist/_chunks/pool2.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.mjs","names":["configHome","home","home","home","home","home","configHome","home","agents"],"sources":["../../src/agent/targets/base.ts","../../src/agent/targets/amp.ts","../../src/agent/targets/antigravity.ts","../../src/agent/targets/claude-code.ts","../../src/agent/targets/cline.ts","../../src/agent/targets/codex.ts","../../src/agent/targets/cursor.ts","../../src/agent/targets/gemini-cli.ts","../../src/agent/targets/github-copilot.ts","../../src/agent/targets/goose.ts","../../src/agent/targets/opencode.ts","../../src/agent/targets/roo.ts","../../src/agent/targets/windsurf.ts","../../src/agent/targets/registry.ts","../../src/agent/detect.ts"],"sourcesContent":["/**\n * Shared defaults and factory for agent target definitions.\n * All targets share identical skillFilename, nameMatchesDir, namePattern,\n * and common frontmatter fields from the agentskills.io spec.\n */\n\nimport type { AgentTarget, FrontmatterField } from './types.ts'\n\n/** Common frontmatter fields from agentskills.io spec */\nexport const SPEC_FRONTMATTER: Record<string, FrontmatterField> = {\n 'name': { name: 'name', required: true, description: 'Skill identifier. Must match parent directory name.', constraints: '1-64 chars, lowercase alphanumeric + hyphens' },\n 'description': { name: 'description', required: true, description: 'What the skill does and when to use it.', constraints: '1-1024 chars' },\n 'license': { name: 'license', required: false, description: 'License reference' },\n 'compatibility': { name: 'compatibility', required: false, description: 'Environment requirements', constraints: 'max 500 chars' },\n 'metadata': { name: 'metadata', required: false, description: 'Arbitrary key-value pairs' },\n 'allowed-tools': { name: 'allowed-tools', required: false, description: 'Space-delimited pre-approved tools (experimental)' },\n}\n\n/** Shared defaults for all agent targets */\nconst BASE_DEFAULTS = {\n skillFilename: 'SKILL.md' as const,\n nameMatchesDir: true,\n namePattern: '^[a-z0-9]+(-[a-z0-9]+)*$',\n additionalSkillsDirs: [] as string[],\n extensions: [] as string[],\n notes: [] as string[],\n} satisfies Partial<AgentTarget>\n\ntype DefaultedFields = 'skillFilename' | 'nameMatchesDir' | 'namePattern' | 'additionalSkillsDirs' | 'extensions' | 'notes'\n\n/** Define an agent target with shared defaults applied */\nexport function defineTarget(\n target: Omit<AgentTarget, DefaultedFields> & Partial<Pick<AgentTarget, DefaultedFields>>,\n): AgentTarget {\n return { ...BASE_DEFAULTS, ...target }\n}\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst configHome = process.env.XDG_CONFIG_HOME || join(homedir(), '.config')\n\n/**\n * Amp (Sourcegraph)\n *\n * Uses .agents/skills/ as primary project path. Also reads .claude/skills/.\n * Skills can bundle MCP servers via mcp.json in the skill directory.\n *\n * AGENTS.md (or AGENT.md / CLAUDE.md fallback) for general instructions,\n * supports @-mentions to reference other files and glob-based conditional includes.\n *\n * @see https://ampcode.com/news/agent-skills\n * @see https://ampcode.com/manual\n */\nexport const amp = defineTarget({\n agent: 'amp',\n displayName: 'Amp',\n detectInstalled: () => existsSync(join(configHome, 'amp')),\n detectEnv: () => !!process.env.AMP_SESSION,\n detectProject: cwd => existsSync(join(cwd, '.agents', 'AGENTS.md')),\n instructionFile: 'AGENTS.md',\n\n skillsDir: '.agents/skills',\n globalSkillsDir: join(configHome, 'agents/skills'),\n additionalSkillsDirs: [\n '.claude/skills',\n '~/.config/amp/skills',\n '~/.claude/skills',\n ],\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, description: 'Unique identifier. Project skills override user-wide ones with same name.' },\n { ...SPEC_FRONTMATTER.description!, description: 'Always visible to the model; determines when skill is invoked.' },\n ],\n\n discoveryStrategy: 'lazy',\n discoveryNotes: 'Names + descriptions visible at startup. Full SKILL.md body loads only when agent decides to invoke based on description match.',\n\n agentSkillsSpec: false,\n extensions: [\n 'mcp.json for bundling MCP server configurations',\n ],\n\n docs: 'https://ampcode.com/news/agent-skills',\n notes: [\n 'Reads .claude/skills/ natively — emitting there covers Claude Code, Cursor, Cline, Copilot, AND Amp.',\n 'Skills can bundle MCP servers via mcp.json in the skill directory.',\n 'AGENTS.md supports @-mentions to reference files (e.g. @doc/style.md, @doc/*.md globs).',\n 'AGENTS.md files with globs frontmatter are conditionally included only when Amp reads matching files.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst home = homedir()\n\n/**\n * Antigravity (Google)\n *\n * Agent-first IDE (VS Code fork) powered by Gemini. Skills live in\n * .agent/skills/ (workspace) or ~/.gemini/antigravity/skills/ (global).\n * Uses semantic matching on description to auto-invoke skills.\n *\n * Adopted the Agent Skills open standard (agentskills.io) in Jan 2026.\n * Only `name` and `description` are used for routing; body loads on demand.\n *\n * @see https://antigravity.google/docs/skills\n * @see https://codelabs.developers.google.com/getting-started-with-antigravity-skills\n */\nexport const antigravity = defineTarget({\n agent: 'antigravity',\n displayName: 'Antigravity',\n detectInstalled: () => existsSync(join(home, '.gemini/antigravity')),\n detectEnv: () => !!process.env.ANTIGRAVITY_CLI_ALIAS,\n detectProject: cwd => existsSync(join(cwd, '.agent')),\n instructionFile: 'GEMINI.md',\n\n skillsDir: '.agent/skills',\n globalSkillsDir: join(home, '.gemini/antigravity/skills'),\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, description: 'Skill identifier. Defaults to directory name if omitted.' },\n { ...SPEC_FRONTMATTER.description!, description: 'Semantic trigger for agent routing. Must be descriptive enough for LLM matching.' },\n ],\n\n discoveryStrategy: 'lazy',\n discoveryNotes: 'Indexes name + description at startup. Full SKILL.md body loads on demand when agent semantic-matches description against user prompt.',\n\n agentSkillsSpec: true,\n\n docs: 'https://antigravity.google/docs/skills',\n notes: [\n 'Only `name` and `description` are used for routing; other frontmatter fields are accepted but not used for matching.',\n 'Skill directories can include scripts/, resources/, and assets/ subdirectories for supporting files.',\n 'GEMINI.md instruction file is shared with Gemini CLI. .agent/rules/*.md for always-on workspace rules.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst claudeHome = process.env.CLAUDE_CONFIG_DIR || join(homedir(), '.claude')\n\n/**\n * Claude Code (Anthropic CLI)\n *\n * Follows the Agent Skills open standard (agentskills.io) plus Claude-specific\n * extensions like `disable-model-invocation`, `user-invocable`, `context`, etc.\n *\n * Skills are discovered at startup — only `name` + `description` are read initially.\n * Full SKILL.md body loads when the agent invokes the skill (via Skill tool or auto-match).\n *\n * @see https://code.claude.com/docs/en/skills\n * @see https://agentskills.io/specification\n */\nexport const claudeCode = defineTarget({\n agent: 'claude-code',\n displayName: 'Claude Code',\n detectInstalled: () => existsSync(claudeHome),\n detectEnv: () => !!(process.env.CLAUDE_CODE || process.env.CLAUDECODE || process.env.CLAUDE_CODE_ENTRYPOINT || process.env.CLAUDE_CONFIG_DIR),\n detectProject: cwd => existsSync(join(cwd, '.claude')) || existsSync(join(cwd, 'CLAUDE.md')),\n cli: 'claude',\n instructionFile: 'CLAUDE.md',\n\n skillsDir: '.claude/skills',\n globalSkillsDir: join(claudeHome, 'skills'),\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, required: false, description: 'Skill identifier, becomes /slash-command. Defaults to directory name if omitted.', constraints: '1-64 chars, ^[a-z0-9]+(-[a-z0-9]+)*$' },\n { ...SPEC_FRONTMATTER.description!, description: 'What the skill does and when to use it. Used for auto-discovery matching.' },\n SPEC_FRONTMATTER.license!,\n SPEC_FRONTMATTER.compatibility!,\n SPEC_FRONTMATTER.metadata!,\n SPEC_FRONTMATTER['allowed-tools']!,\n { name: 'disable-model-invocation', required: false, description: 'When true, skill only loads via explicit /name invocation' },\n { name: 'user-invocable', required: false, description: 'When false, hides from / menu but still auto-loads' },\n { name: 'argument-hint', required: false, description: 'Hint shown during autocomplete, e.g. [issue-number]' },\n { name: 'model', required: false, description: 'Model to use when skill is active' },\n { name: 'context', required: false, description: 'Set to \"fork\" to run in a forked subagent context' },\n { name: 'agent', required: false, description: 'Subagent type when context: fork (e.g. Explore, Plan)' },\n ],\n\n discoveryStrategy: 'eager',\n discoveryNotes: 'Scans skill dirs at startup, reads name + description only. Full body loads on invocation. Budget: 2% of context window for all skill descriptions.',\n\n agentSkillsSpec: true,\n extensions: [\n 'disable-model-invocation',\n 'user-invocable',\n 'argument-hint',\n 'model',\n 'context',\n 'agent',\n 'hooks',\n '$ARGUMENTS substitution',\n '!`command` dynamic context',\n ],\n\n docs: 'https://code.claude.com/docs/en/skills',\n notes: [\n '`globs` is NOT a valid frontmatter field for skills (only for rules). Unknown fields are silently ignored.',\n '`version` and `generated_by` should go under `metadata` map, not as top-level fields.',\n 'Skill descriptions have a char budget of 2% of context window (~16k chars fallback). Override with SLASH_COMMAND_TOOL_CHAR_BUDGET env var.',\n 'Keep SKILL.md under 500 lines. Move detailed reference to separate files.',\n 'Supports monorepo auto-discovery: nested .claude/skills/ dirs in subdirectories.',\n 'Supporting dirs: scripts/, references/, assets/ alongside SKILL.md.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst home = homedir()\n\n/**\n * Cline (VS Code extension)\n *\n * Has TWO systems: Rules (.clinerules/) and Skills (.cline/skills/).\n * We target Skills. Cline also reads .claude/skills/ as a fallback,\n * so emitting to .claude/skills/ covers both Claude Code and Cline.\n *\n * Only `name` and `description` are parsed from frontmatter.\n * All other fields are stripped/ignored.\n *\n * @see https://docs.cline.bot/features/skills\n * @see https://docs.cline.bot/features/cline-rules\n */\nexport const cline = defineTarget({\n agent: 'cline',\n displayName: 'Cline',\n detectInstalled: () => existsSync(join(home, '.cline')),\n detectEnv: () => !!process.env.CLINE_TASK_ID,\n detectProject: cwd => existsSync(join(cwd, '.cline')),\n instructionFile: '.clinerules',\n\n skillsDir: '.cline/skills',\n globalSkillsDir: join(home, '.cline/skills'),\n additionalSkillsDirs: [\n '.clinerules/skills',\n '.claude/skills',\n ],\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, description: 'Must exactly match the directory name.' },\n { ...SPEC_FRONTMATTER.description!, description: 'When to activate. Used for matching.' },\n ],\n\n discoveryStrategy: 'eager',\n discoveryNotes: 'At startup reads name + description from each skill. Full content loads on-demand via use_skill tool. Dozens of skills have near-zero context cost.',\n\n agentSkillsSpec: false,\n\n docs: 'https://docs.cline.bot/features/skills',\n notes: [\n 'Only `name` and `description` are parsed. `version`, `globs`, etc. are silently ignored.',\n 'Cline reads .claude/skills/ as a fallback — emitting there covers both Claude Code and Cline.',\n 'Rules system (.clinerules/) is separate: always-on behavioral constraints with globs/tags frontmatter.',\n 'Global skills override project skills when names conflict.',\n 'Supporting dirs: docs/, scripts/, templates/ alongside SKILL.md.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst codexHome = process.env.CODEX_HOME || join(homedir(), '.codex')\n\n/**\n * OpenAI Codex CLI\n *\n * IMPORTANT: Codex uses `.agents/skills/` for project-level skills,\n * NOT `.codex/skills/`. The `.codex/` directory is for config (config.toml).\n * `~/.codex/skills/` works only as a legacy user-global path.\n *\n * Codex also has AGENTS.md (or AGENTS.override.md) for general instructions,\n * which walks from git root to CWD concatenating found files.\n *\n * @see https://developers.openai.com/codex/skills\n * @see https://developers.openai.com/codex/guides/agents-md/\n */\nexport const codex = defineTarget({\n agent: 'codex',\n displayName: 'Codex',\n detectInstalled: () => existsSync(codexHome),\n detectEnv: () => !!(process.env.CODEX_HOME || process.env.CODEX_SESSION),\n detectProject: cwd => existsSync(join(cwd, '.codex')),\n cli: 'codex',\n instructionFile: 'AGENTS.md',\n\n skillsDir: '.agents/skills',\n globalSkillsDir: join(homedir(), '.agents/skills'),\n additionalSkillsDirs: [\n '~/.codex/skills',\n '/etc/codex/skills',\n ],\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, description: 'Skill identifier.', constraints: '1-64 chars, ^[a-z0-9-]+$, no leading/trailing/consecutive hyphens' },\n { ...SPEC_FRONTMATTER.description!, description: 'Must include when-to-use criteria. Primary triggering mechanism.', constraints: '1-1024 chars, no angle brackets (< or >)' },\n SPEC_FRONTMATTER.license!,\n SPEC_FRONTMATTER['allowed-tools']!,\n SPEC_FRONTMATTER.metadata!,\n ],\n\n discoveryStrategy: 'lazy',\n discoveryNotes: 'Startup scan reads name + description + optional agents/openai.yaml. Full body loads only on invocation. Supports $1-$9 and $ARGUMENTS placeholders.',\n\n agentSkillsSpec: true,\n extensions: [\n 'agents/openai.yaml (UI metadata + MCP dependencies)',\n '$1-$9 positional argument placeholders',\n 'AGENTS.override.md for temporary overrides',\n ],\n\n docs: 'https://developers.openai.com/codex/skills',\n notes: [\n 'BUG IN CURRENT CODE: skillsDir is .codex/skills/ but should be .agents/skills/. The .codex/ directory is for config, not skills.',\n 'Description field cannot contain angle brackets (< or >).',\n 'Optional agents/openai.yaml provides UI metadata: display_name, icon, brand_color, default_prompt.',\n 'AGENTS.md walks from git root to CWD, concatenating all found files.',\n 'Live reload: detects skill file changes without restart (v0.95.0+).',\n 'Size limit: 32 KiB default (project_doc_max_bytes), configurable in ~/.codex/config.toml.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst home = homedir()\n\n/**\n * Cursor (AI code editor)\n *\n * Has TWO systems: Rules (.cursor/rules/*.mdc) and Skills (.cursor/skills/).\n * We target the Skills system which follows the Agent Skills spec.\n *\n * Cursor natively scans .claude/skills/ and .codex/skills/ in addition to\n * its own .cursor/skills/ — so .claude/skills/ output works for both\n * Claude Code and Cursor with zero duplication.\n *\n * @see https://cursor.com/docs/context/skills\n * @see https://cursor.com/docs/context/rules\n */\nexport const cursor = defineTarget({\n agent: 'cursor',\n displayName: 'Cursor',\n detectInstalled: () => existsSync(join(home, '.cursor')),\n detectEnv: () => !!(process.env.CURSOR_SESSION || process.env.CURSOR_TRACE_ID),\n detectProject: cwd => existsSync(join(cwd, '.cursor')) || existsSync(join(cwd, '.cursorrules')),\n instructionFile: '.cursorrules',\n\n skillsDir: '.cursor/skills',\n globalSkillsDir: join(home, '.cursor/skills'),\n additionalSkillsDirs: [\n '.claude/skills',\n '.codex/skills',\n '~/.claude/skills',\n '~/.codex/skills',\n ],\n\n frontmatter: [\n SPEC_FRONTMATTER.name!,\n { ...SPEC_FRONTMATTER.description!, description: 'Agent uses this to decide relevance for auto-invocation.' },\n SPEC_FRONTMATTER.license!,\n SPEC_FRONTMATTER.compatibility!,\n SPEC_FRONTMATTER.metadata!,\n { name: 'disable-model-invocation', required: false, description: 'When true, only loads via explicit /skill-name' },\n ],\n\n discoveryStrategy: 'lazy',\n discoveryNotes: 'Reads name + description at conversation start. Full SKILL.md body loads only when agent determines relevance. Users can also invoke via /skill-name.',\n\n agentSkillsSpec: true,\n extensions: [\n 'disable-model-invocation',\n ],\n\n docs: 'https://cursor.com/docs/context/skills',\n notes: [\n 'Cursor scans .claude/skills/ and .codex/skills/ natively — emitting to .claude/skills/ covers both Claude Code and Cursor.',\n 'The Rules system (.cursor/rules/*.mdc) is separate and uses different frontmatter (trigger, globs, alwaysApply).',\n 'Skills appear in Settings > Rules > Agent Decides section.',\n 'Supporting dirs: scripts/, references/, assets/ alongside SKILL.md.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst home = homedir()\n\n/**\n * Google Gemini CLI\n *\n * Follows the Agent Skills open standard (agentskills.io).\n * Skills are activated via `activate_skill` tool with user confirmation.\n *\n * Also has GEMINI.md context files (analogous to CLAUDE.md) which support\n * @file.md import syntax for modular composition.\n *\n * @see https://geminicli.com/docs/cli/skills/\n * @see https://geminicli.com/docs/cli/creating-skills/\n */\nexport const geminiCli = defineTarget({\n agent: 'gemini-cli',\n displayName: 'Gemini CLI',\n detectInstalled: () => existsSync(join(home, '.gemini')),\n detectEnv: () => !!(process.env.GEMINI_API_KEY && process.env.GEMINI_SESSION),\n detectProject: cwd => existsSync(join(cwd, '.gemini')) || existsSync(join(cwd, 'AGENTS.md')),\n cli: 'gemini',\n instructionFile: 'GEMINI.md',\n\n skillsDir: '.gemini/skills',\n globalSkillsDir: join(home, '.gemini/skills'),\n\n frontmatter: [\n SPEC_FRONTMATTER.name!,\n { ...SPEC_FRONTMATTER.description!, description: 'Primary trigger — agent uses this to match tasks.' },\n SPEC_FRONTMATTER.license!,\n SPEC_FRONTMATTER.compatibility!,\n SPEC_FRONTMATTER.metadata!,\n SPEC_FRONTMATTER['allowed-tools']!,\n ],\n\n discoveryStrategy: 'eager',\n discoveryNotes: 'Scans at session start, injects ~100 tokens per skill (name+description). Activation via activate_skill tool requires user confirmation. Skill stays active for session duration.',\n\n agentSkillsSpec: true,\n\n docs: 'https://geminicli.com/docs/cli/skills/',\n notes: [\n 'Management commands: /skills list, /skills enable <name>, /skills disable <name>, /skills reload.',\n 'GEMINI.md context files are separate from skills — support @file.md import syntax.',\n 'settings.json can configure additional context filenames: [\"AGENTS.md\", \"CONTEXT.md\", \"GEMINI.md\"].',\n 'scripts/, references/, assets/ directories are defined by spec but implementation is still incomplete (issue #15895).',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst home = homedir()\n\n/**\n * GitHub Copilot\n *\n * Has TWO systems: Instructions (.github/instructions/*.instructions.md)\n * and Skills (.github/skills/). We target Skills.\n *\n * Copilot also auto-detects .claude/skills/ as a legacy path,\n * so .claude/skills/ output works for Claude Code, Cursor, Cline, AND Copilot.\n *\n * @see https://docs.github.com/en/copilot/concepts/agents/about-agent-skills\n * @see https://docs.github.com/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot\n */\nexport const githubCopilot = defineTarget({\n agent: 'github-copilot',\n displayName: 'GitHub Copilot',\n detectInstalled: () => existsSync(join(home, '.copilot')),\n detectEnv: () => !!process.env.GITHUB_COPILOT_SESSION,\n detectProject: cwd => existsSync(join(cwd, '.github', 'copilot-instructions.md')),\n instructionFile: '.github/copilot-instructions.md',\n\n skillsDir: '.github/skills',\n globalSkillsDir: join(home, '.copilot/skills'),\n additionalSkillsDirs: [\n '.claude/skills',\n '~/.claude/skills',\n ],\n\n frontmatter: [\n SPEC_FRONTMATTER.name!,\n { ...SPEC_FRONTMATTER.description!, description: 'What the skill does AND when to use it.' },\n SPEC_FRONTMATTER.license!,\n SPEC_FRONTMATTER.compatibility!,\n { ...SPEC_FRONTMATTER.metadata!, description: 'Arbitrary key-value pairs (e.g. version, author)' },\n SPEC_FRONTMATTER['allowed-tools']!,\n ],\n\n discoveryStrategy: 'lazy',\n discoveryNotes: '3-level progressive disclosure: (1) ~100 tokens for name+description, (2) full SKILL.md body <5000 tokens on activation, (3) resources from scripts/references/assets/ on demand.',\n\n agentSkillsSpec: true,\n\n docs: 'https://docs.github.com/en/copilot/concepts/agents/about-agent-skills',\n notes: [\n 'Copilot auto-detects .claude/skills/ as a legacy path — emitting there covers multiple agents.',\n 'Instructions system (.github/instructions/*.instructions.md) is separate, uses applyTo globs.',\n 'copilot-instructions.md at .github/ root is always applied (repo-wide).',\n 'AGENTS.md also recognized as of Aug 2025.',\n 'excludeAgent property in instructions can hide from code-review or coding-agent.',\n 'Keep SKILL.md under 500 lines / 5000 tokens for optimal loading.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst configHome = process.env.XDG_CONFIG_HOME || join(homedir(), '.config')\n\n/**\n * Goose (Block)\n *\n * Scans 6 directories for skills, including .claude/skills/ and .agents/skills/\n * for cross-agent compatibility. Later directories override earlier ones on\n * name conflict.\n *\n * @see https://block.github.io/goose/docs/guides/context-engineering/using-skills/\n */\nexport const goose = defineTarget({\n agent: 'goose',\n displayName: 'Goose',\n detectInstalled: () => existsSync(join(configHome, 'goose')),\n detectEnv: () => !!process.env.GOOSE_SESSION,\n detectProject: cwd => existsSync(join(cwd, '.goose')),\n cli: 'goose',\n instructionFile: '.goosehints',\n\n skillsDir: '.goose/skills',\n globalSkillsDir: join(configHome, 'goose/skills'),\n additionalSkillsDirs: [\n '.claude/skills',\n '.agents/skills',\n '~/.claude/skills',\n '~/.config/agents/skills',\n ],\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, description: 'Skill identifier.' },\n { ...SPEC_FRONTMATTER.description!, description: 'Brief purpose statement; used for matching.' },\n ],\n\n discoveryStrategy: 'eager',\n discoveryNotes: 'Scans all 6 directories at startup, merges discovered skills. Later directories override earlier ones on name conflict.',\n\n agentSkillsSpec: false,\n\n docs: 'https://block.github.io/goose/docs/guides/context-engineering/using-skills/',\n notes: [\n 'Reads .claude/skills/ natively — emitting there covers both Claude Code and Goose.',\n 'Also supports .goosehints / .goosehints.local for general project instructions (separate from skills).',\n 'Supporting files alongside SKILL.md (scripts, templates, configs) are accessible.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst configHome = process.env.XDG_CONFIG_HOME || join(homedir(), '.config')\n\n/**\n * OpenCode (SST)\n *\n * Walks from CWD up to git worktree root searching for skill dirs.\n * Reads .claude/skills/ and .agents/skills/ in addition to .opencode/skills/.\n *\n * Has a rich agent system: .opencode/agents/ with per-agent model/tool configuration.\n * Skills can be permission-controlled per-agent with allow/deny/ask + glob patterns.\n *\n * @see https://opencode.ai/docs/skills/\n * @see https://opencode.ai/docs/rules/\n */\nexport const opencode = defineTarget({\n agent: 'opencode',\n displayName: 'OpenCode',\n detectInstalled: () => existsSync(join(configHome, 'opencode')),\n detectEnv: () => !!process.env.OPENCODE_SESSION,\n detectProject: cwd => existsSync(join(cwd, '.opencode')),\n instructionFile: 'AGENTS.md',\n\n skillsDir: '.opencode/skills',\n globalSkillsDir: join(configHome, 'opencode/skills'),\n additionalSkillsDirs: [\n '.claude/skills',\n '.agents/skills',\n '~/.claude/skills',\n '~/.agents/skills',\n ],\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, description: 'Must match directory name.' },\n { ...SPEC_FRONTMATTER.description!, description: 'Used for matching.' },\n SPEC_FRONTMATTER.license!,\n SPEC_FRONTMATTER.compatibility!,\n SPEC_FRONTMATTER.metadata!,\n ],\n\n discoveryStrategy: 'eager',\n discoveryNotes: 'Walks from CWD to git worktree root, then loads global definitions. Agents access skills via native skill tool. Skills can be permission-controlled per-agent.',\n\n agentSkillsSpec: true,\n extensions: [\n 'Per-agent skill permissions (allow/deny/ask with glob patterns)',\n ],\n\n docs: 'https://opencode.ai/docs/skills/',\n notes: [\n 'Reads .claude/skills/ and .agents/skills/ natively — emitting to .claude/skills/ covers multiple agents.',\n 'Custom agents in .opencode/agents/ have rich config: model, temperature, tools, permission, color.',\n 'opencode.json supports an instructions field with glob patterns pointing to instruction files.',\n 'AGENTS.md (or CLAUDE.md fallback) for general instructions.',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst home = homedir()\n\n/**\n * Roo Code (VS Code extension)\n *\n * IMPORTANT: Roo does NOT read .claude/skills/ or .agents/skills/.\n * It requires its own .roo/skills/ directory — no cross-compat shortcuts.\n *\n * Unique feature: mode-specific skill directories (.roo/skills-{modeSlug}/)\n * allow targeting skills to specific modes (code, architect, etc.).\n *\n * @see https://docs.roocode.com/features/skills\n * @see https://docs.roocode.com/features/custom-instructions\n */\nexport const roo = defineTarget({\n agent: 'roo',\n displayName: 'Roo Code',\n detectInstalled: () => existsSync(join(home, '.roo')),\n detectEnv: () => !!process.env.ROO_SESSION,\n detectProject: cwd => existsSync(join(cwd, '.roo')),\n instructionFile: '.roorules',\n\n skillsDir: '.roo/skills',\n globalSkillsDir: join(home, '.roo/skills'),\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, description: 'Must exactly match the directory name.' },\n { ...SPEC_FRONTMATTER.description!, description: 'When to activate.' },\n ],\n\n discoveryStrategy: 'eager',\n discoveryNotes: 'Reads all SKILL.md files at startup. File watchers detect changes during session. Uses read_file to load full content on activation.',\n\n agentSkillsSpec: false,\n extensions: [\n 'Mode-specific skill directories: .roo/skills-{modeSlug}/',\n ],\n\n docs: 'https://docs.roocode.com/features/skills',\n notes: [\n 'Does NOT read .claude/skills/ or .agents/skills/ — requires its own .roo/skills/ directory.',\n 'Mode-specific dirs: .roo/skills-code/, .roo/skills-architect/ etc. target specific modes.',\n 'Override priority: project mode-specific > project generic > global mode-specific > global generic.',\n 'Supports symlinks for shared skill libraries across projects.',\n 'Rules system (.roo/rules/) is separate — .md/.txt files loaded alphabetically into system prompt.',\n 'Legacy fallback: .roorules file if .roo/rules/ is empty.',\n 'Skills manageable from Settings panel (v3.46.0+).',\n ],\n})\n","import { existsSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { defineTarget, SPEC_FRONTMATTER } from './base.ts'\n\nconst home = homedir()\n\n/**\n * Windsurf (Codeium editor)\n *\n * Has TWO systems: Rules (.windsurf/rules/*.md) and Skills (.windsurf/skills/).\n * We target Skills. Rules have a separate frontmatter schema with trigger/globs.\n *\n * Skills only document `name` and `description` as frontmatter fields.\n * Cascade uses \"progressive disclosure\" for supporting files.\n *\n * @see https://docs.windsurf.com/windsurf/cascade/skills\n * @see https://docs.windsurf.com/windsurf/cascade/memories\n */\nexport const windsurf = defineTarget({\n agent: 'windsurf',\n displayName: 'Windsurf',\n detectInstalled: () => existsSync(join(home, '.codeium/windsurf')),\n detectEnv: () => !!process.env.WINDSURF_SESSION,\n detectProject: cwd => existsSync(join(cwd, '.windsurf')) || existsSync(join(cwd, '.windsurfrules')),\n instructionFile: '.windsurfrules',\n\n skillsDir: '.windsurf/skills',\n globalSkillsDir: join(home, '.codeium/windsurf/skills'),\n\n frontmatter: [\n { ...SPEC_FRONTMATTER.name!, description: 'Skill identifier.', constraints: 'Lowercase, numbers, hyphens only' },\n { ...SPEC_FRONTMATTER.description!, description: 'Used by Cascade for automatic invocation matching.' },\n ],\n\n discoveryStrategy: 'eager',\n discoveryNotes: 'Cascade matches description against user requests for auto-invocation. Manual invocation via @skill-name.',\n\n agentSkillsSpec: false,\n\n docs: 'https://docs.windsurf.com/windsurf/cascade/skills',\n notes: [\n 'Only `name` and `description` are documented as frontmatter fields. Other fields may be silently ignored.',\n 'Rules system is separate: .windsurf/rules/*.md with trigger/globs/alwaysApply frontmatter.',\n 'Rules have a 6,000 char per-file limit and 12,000 char total limit. Skills have no documented limit.',\n 'Legacy .windsurfrules at project root still supported but deprecated.',\n 'Supporting files alongside SKILL.md are loaded via progressive disclosure.',\n ],\n})\n","/**\n * Agent targets registry — all supported agents and their skill conventions\n */\n\nimport type { AgentType } from '../types.ts'\nimport type { AgentTarget } from './types.ts'\nimport { amp } from './amp.ts'\nimport { antigravity } from './antigravity.ts'\nimport { claudeCode } from './claude-code.ts'\nimport { cline } from './cline.ts'\nimport { codex } from './codex.ts'\nimport { cursor } from './cursor.ts'\nimport { geminiCli } from './gemini-cli.ts'\nimport { githubCopilot } from './github-copilot.ts'\nimport { goose } from './goose.ts'\nimport { opencode } from './opencode.ts'\nimport { roo } from './roo.ts'\nimport { windsurf } from './windsurf.ts'\n\nexport const targets: Record<AgentType, AgentTarget> = {\n 'claude-code': claudeCode,\n 'cursor': cursor,\n 'windsurf': windsurf,\n 'cline': cline,\n 'codex': codex,\n 'github-copilot': githubCopilot,\n 'gemini-cli': geminiCli,\n 'goose': goose,\n 'amp': amp,\n 'opencode': opencode,\n 'roo': roo,\n 'antigravity': antigravity,\n}\n","/**\n * Agent detection - identify installed and active agents\n */\n\nimport type { AgentType } from './types.ts'\nimport { spawnSync } from 'node:child_process'\nimport { isWindows } from 'std-env'\nimport { agents } from './registry.ts'\n\n/**\n * Detect which agents are installed on the system\n */\nexport function detectInstalledAgents(): AgentType[] {\n return Object.entries(agents)\n .filter(([_, config]) => config.detectInstalled())\n .map(([type]) => type as AgentType)\n}\n\n/**\n * Detect the target agent (where skills are installed) from env vars and cwd.\n * This is NOT the generator LLM — it determines the skills directory.\n *\n * Priority: env vars first (running inside agent), then project dirs.\n * Iteration order of the agents record determines priority.\n */\nexport function detectTargetAgent(): AgentType | null {\n for (const [type, target] of Object.entries(agents)) {\n if (target.detectEnv())\n return type as AgentType\n }\n\n const cwd = process.cwd()\n for (const [type, target] of Object.entries(agents)) {\n if (target.detectProject(cwd))\n return type as AgentType\n }\n\n return null\n}\n\n/**\n * Get the version of an agent's CLI (if available)\n */\nexport function getAgentVersion(agentType: AgentType): string | null {\n const agent = agents[agentType]\n if (!agent.cli)\n return null\n\n try {\n const result = spawnSync(agent.cli, ['--version'], {\n encoding: 'utf-8',\n timeout: 3000,\n stdio: ['pipe', 'pipe', 'pipe'],\n shell: isWindows,\n })\n if (result.status !== 0)\n return null\n const output = (result.stdout || '').trim()\n\n // Extract version number from output\n // Common formats: \"v1.2.3\", \"1.2.3\", \"cli 1.2.3\", \"name v1.2.3\"\n const match = output.match(/v?(\\d+\\.\\d+\\.\\d+(?:-[a-z0-9.]+)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AAO;CAGX,MAAM,MAAM,QAAQ,KAAK;AACzB,MAAK,MAAM,CAAC,MAAM,WAAW,OAAO,QAAQA,QAAO,CACjD,KAAI,OAAO,cAAc,IAAI,CAC3B,QAAO;AAGX,QAAO;;;;;AAMT,SAAgB,gBAAgB,WAAqC;CACnE,MAAM,QAAQA,QAAO;AACrB,KAAI,CAAC,MAAM,IACT,QAAO;AAET,KAAI;EACF,MAAM,SAAS,UAAU,MAAM,KAAK,CAAC,YAAY,EAAE;GACjD,UAAU;GACV,SAAS;GACT,OAAO;IAAC;IAAQ;IAAQ;IAAO;GAC/B,OAAO;GACR,CAAC;AACF,MAAI,OAAO,WAAW,EACpB,QAAO;EACT,MAAM,UAAU,OAAO,UAAU,IAAI,MAAM;EAI3C,MAAM,QAAQ,OAAO,MAAM,oCAAoC;AAC/D,SAAO,QAAQ,MAAM,KAAK,OAAO,MAAM,KAAK,CAAC;SAEzC;AACJ,SAAO"}
@@ -49,6 +49,6 @@ async function cachedEmbeddings(config) {
49
49
  function clearEmbeddingCache() {
50
50
  rmSync(EMBEDDINGS_DB_PATH, { force: true });
51
51
  }
52
- export { clearEmbeddingCache as n, embedding_cache_exports as r, cachedEmbeddings as t };
52
+ export { embedding_cache_exports as n, clearEmbeddingCache as t };
53
53
 
54
54
  //# sourceMappingURL=embedding-cache.mjs.map
@@ -1,12 +1,9 @@
1
1
  import { n as yamlParseKV, r as yamlUnescape, t as yamlEscape } from "./yaml.mjs";
2
- import { i as parseFrontmatter } from "./markdown.mjs";
3
- import { a as semverGt, n as getSharedSkillsDir } from "./shared.mjs";
4
- import { s as readLocalDependencies } from "./sources.mjs";
5
- import { _ as targets, g as getAgentVersion, h as detectTargetAgent, m as detectInstalledAgents } from "./prompts.mjs";
6
- import { a as getModelName } from "./agent.mjs";
2
+ import { a as targets, i as getAgentVersion, n as detectTargetAgent, t as detectInstalledAgents } from "./detect.mjs";
3
+ import { o as getModelName } from "./agent.mjs";
7
4
  import { homedir } from "node:os";
8
5
  import { join } from "pathe";
9
- import { existsSync, mkdirSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "node:fs";
6
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
10
7
  import { fileURLToPath } from "node:url";
11
8
  import * as p from "@clack/prompts";
12
9
  import { detectCurrentAgent } from "unagent/env";
@@ -185,31 +182,47 @@ function requireInteractive(command) {
185
182
  }
186
183
  /** Resolve agent from flags/cwd/config. cwd is source of truth over config. */
187
184
  function resolveAgent(agentFlag) {
185
+ if (process.env.SKILLD_NO_AGENT) return null;
188
186
  return agentFlag ?? detectTargetAgent() ?? readConfig().agent ?? null;
189
187
  }
188
+ let _warnedNoAgent = false;
189
+ function warnNoAgent() {
190
+ if (_warnedNoAgent) return;
191
+ _warnedNoAgent = true;
192
+ p.log.warn("No coding agent detected — falling back to prompt-only mode.\n Use --agent <name> to specify, or run `skilld config` to set a default.");
193
+ }
190
194
  /** Prompt user to pick an agent when auto-detection fails */
191
195
  async function promptForAgent() {
192
- const installed = detectInstalledAgents();
196
+ const installed = !!process.env.SKILLD_NO_AGENT ? [] : detectInstalledAgents();
193
197
  if (!isInteractive()) {
194
198
  if (installed.length === 1) {
195
199
  updateConfig({ agent: installed[0] });
196
200
  return installed[0];
197
201
  }
198
- console.error("Error: could not auto-detect agent. Pass --agent <name> to specify.");
199
- process.exit(1);
202
+ warnNoAgent();
203
+ return "none";
200
204
  }
201
205
  const options = (installed.length ? installed : Object.keys(targets)).map((id) => ({
202
206
  label: targets[id].displayName,
203
207
  value: id,
204
208
  hint: targets[id].skillsDir
205
209
  }));
206
- const hint = installed.length ? `Detected ${installed.map((t) => targets[t].displayName).join(", ")} but couldn't determine which to use` : "No agents auto-detected";
207
- p.log.warn(`Could not detect which coding agent to install skills for.\n ${hint}`);
210
+ options.push({
211
+ label: "No agent",
212
+ value: "none",
213
+ hint: "Export portable prompts for any LLM"
214
+ });
215
+ if (!_warnedNoAgent) {
216
+ _warnedNoAgent = true;
217
+ const hint = installed.length ? `Detected ${installed.map((t) => targets[t].displayName).join(", ")} but couldn't determine which to use` : "No agents auto-detected";
218
+ p.log.warn(`Could not detect which coding agent to install skills for.\n ${hint}`);
219
+ }
208
220
  const choice = await p.select({
209
221
  message: "Which coding agent should skills be installed for?",
210
222
  options
211
223
  });
212
224
  if (p.isCancel(choice)) return null;
225
+ if (choice === "none") return "none";
213
226
  updateConfig({ agent: choice });
214
227
  p.log.success(`Default agent set to ${targets[choice].displayName}`);
215
228
  return choice;
@@ -265,288 +278,6 @@ function getRepoHint(name, cwd) {
265
278
  if (!url) return void 0;
266
279
  return url.replace(/^git\+/, "").replace(/\.git$/, "").replace(/^git:\/\//, "https://").replace(/^ssh:\/\/git@github\.com/, "https://github.com").replace(/^https?:\/\/(www\.)?github\.com\//, "");
267
280
  }
268
- function parsePackages(packages) {
269
- if (!packages) return [];
270
- return packages.split(",").map((s) => {
271
- const trimmed = s.trim();
272
- const atIdx = trimmed.lastIndexOf("@");
273
- if (atIdx <= 0) return {
274
- name: trimmed,
275
- version: ""
276
- };
277
- return {
278
- name: trimmed.slice(0, atIdx),
279
- version: trimmed.slice(atIdx + 1)
280
- };
281
- }).filter((p) => p.name);
282
- }
283
- function serializePackages(pkgs) {
284
- return pkgs.map((p) => `${p.name}@${p.version}`).join(", ");
285
- }
286
- const SKILL_FM_KEYS = [
287
- "packageName",
288
- "version",
289
- "packages",
290
- "repo",
291
- "source",
292
- "syncedAt",
293
- "generator",
294
- "path",
295
- "ref",
296
- "commit"
297
- ];
298
- function parseSkillFrontmatter(skillPath) {
299
- if (!existsSync(skillPath)) return null;
300
- const fm = parseFrontmatter(readFileSync(skillPath, "utf-8"));
301
- if (Object.keys(fm).length === 0) return null;
302
- const info = {};
303
- for (const key of SKILL_FM_KEYS) if (fm[key]) info[key] = fm[key];
304
- return info;
305
- }
306
- function readLock(skillsDir) {
307
- const lockPath = join(skillsDir, "skilld-lock.yaml");
308
- if (!existsSync(lockPath)) return null;
309
- const content = readFileSync(lockPath, "utf-8");
310
- const skills = {};
311
- let currentSkill = null;
312
- for (const line of content.split("\n")) {
313
- const skillMatch = line.match(/^ {2}(\S+):$/);
314
- if (skillMatch) {
315
- currentSkill = skillMatch[1];
316
- skills[currentSkill] = {};
317
- continue;
318
- }
319
- if (currentSkill && line.startsWith(" ")) {
320
- const kv = yamlParseKV(line);
321
- if (kv) skills[currentSkill][kv[0]] = kv[1];
322
- }
323
- }
324
- return { skills };
325
- }
326
- function serializeLock(lock) {
327
- let yaml = "skills:\n";
328
- for (const [name, skill] of Object.entries(lock.skills)) {
329
- yaml += ` ${name}:\n`;
330
- if (skill.packageName) yaml += ` packageName: ${yamlEscape(skill.packageName)}\n`;
331
- if (skill.version) yaml += ` version: ${yamlEscape(skill.version)}\n`;
332
- if (skill.packages) yaml += ` packages: ${yamlEscape(skill.packages)}\n`;
333
- if (skill.repo) yaml += ` repo: ${yamlEscape(skill.repo)}\n`;
334
- if (skill.source) yaml += ` source: ${yamlEscape(skill.source)}\n`;
335
- if (skill.syncedAt) yaml += ` syncedAt: ${yamlEscape(skill.syncedAt)}\n`;
336
- if (skill.generator) yaml += ` generator: ${yamlEscape(skill.generator)}\n`;
337
- if (skill.path) yaml += ` path: ${yamlEscape(skill.path)}\n`;
338
- if (skill.ref) yaml += ` ref: ${yamlEscape(skill.ref)}\n`;
339
- if (skill.commit) yaml += ` commit: ${yamlEscape(skill.commit)}\n`;
340
- }
341
- return yaml;
342
- }
343
- function writeLock(skillsDir, skillName, info) {
344
- const lockPath = join(skillsDir, "skilld-lock.yaml");
345
- let lock = { skills: {} };
346
- if (existsSync(lockPath)) lock = readLock(skillsDir) || { skills: {} };
347
- const existing = lock.skills[skillName];
348
- if (existing && info.packageName) {
349
- const existingPkgs = parsePackages(existing.packages);
350
- if (existing.packageName && !existingPkgs.some((p) => p.name === existing.packageName)) existingPkgs.unshift({
351
- name: existing.packageName,
352
- version: existing.version || ""
353
- });
354
- const idx = existingPkgs.findIndex((p) => p.name === info.packageName);
355
- if (idx >= 0) existingPkgs[idx].version = info.version || "";
356
- else existingPkgs.push({
357
- name: info.packageName,
358
- version: info.version || ""
359
- });
360
- info.packages = serializePackages(existingPkgs);
361
- info.packageName = existingPkgs[0].name;
362
- info.version = existingPkgs[0].version;
363
- if (!info.repo && existing.repo) info.repo = existing.repo;
364
- if (!info.source && existing.source) info.source = existing.source;
365
- if (!info.generator && existing.generator) info.generator = existing.generator;
366
- }
367
- lock.skills[skillName] = info;
368
- writeFileSync(lockPath, serializeLock(lock));
369
- }
370
- /**
371
- * Merge multiple lockfiles, preferring the most recently synced entry per skill.
372
- */
373
- function mergeLocks(locks) {
374
- const merged = {};
375
- for (const lock of locks) for (const [name, info] of Object.entries(lock.skills)) {
376
- const existing = merged[name];
377
- if (!existing || info.syncedAt && (!existing.syncedAt || info.syncedAt > existing.syncedAt)) merged[name] = info;
378
- }
379
- return { skills: merged };
380
- }
381
- /**
382
- * Sync a lockfile to all other dirs that already have a skilld-lock.yaml.
383
- * Only updates existing lockfiles — does not create new ones.
384
- */
385
- function syncLockfilesToDirs(sourceLock, dirs) {
386
- for (const dir of dirs) {
387
- const lockPath = join(dir, "skilld-lock.yaml");
388
- if (!existsSync(lockPath)) continue;
389
- const existing = readLock(dir);
390
- if (!existing) continue;
391
- writeFileSync(lockPath, serializeLock(mergeLocks([existing, sourceLock])));
392
- }
393
- }
394
- function removeLockEntry(skillsDir, skillName) {
395
- const lockPath = join(skillsDir, "skilld-lock.yaml");
396
- const lock = readLock(skillsDir);
397
- if (!lock) return;
398
- delete lock.skills[skillName];
399
- if (Object.keys(lock.skills).length === 0) {
400
- unlinkSync(lockPath);
401
- return;
402
- }
403
- writeFileSync(lockPath, serializeLock(lock));
404
- }
405
- function* iterateSkills(opts = {}) {
406
- const { scope = "all", cwd = process.cwd() } = opts;
407
- const agentTypes = opts.agents ?? Object.keys(targets);
408
- const sharedDir = getSharedSkillsDir(cwd);
409
- let yieldedLocal = false;
410
- if (sharedDir && (scope === "local" || scope === "all")) {
411
- yieldedLocal = true;
412
- const lock = readLock(sharedDir);
413
- const entries = readdirSync(sharedDir).filter((f) => !f.startsWith(".") && f !== "skilld-lock.yaml");
414
- const firstAgent = agentTypes[0] ?? Object.keys(targets)[0];
415
- for (const name of entries) {
416
- const dir = join(sharedDir, name);
417
- if (lock?.skills[name]) yield {
418
- name,
419
- dir,
420
- agent: firstAgent,
421
- info: lock.skills[name],
422
- scope: "local"
423
- };
424
- else {
425
- const info = parseSkillFrontmatter(join(dir, ".skilld", "_SKILL.md"));
426
- if (info?.generator === "skilld") yield {
427
- name,
428
- dir,
429
- agent: firstAgent,
430
- info,
431
- scope: "local"
432
- };
433
- }
434
- }
435
- }
436
- for (const agentType of agentTypes) {
437
- const agent = targets[agentType];
438
- if (!yieldedLocal && (scope === "local" || scope === "all")) {
439
- const localDir = join(cwd, agent.skillsDir);
440
- if (existsSync(localDir)) {
441
- const lock = readLock(localDir);
442
- const entries = readdirSync(localDir).filter((f) => !f.startsWith(".") && f !== "skilld-lock.yaml");
443
- for (const name of entries) {
444
- const dir = join(localDir, name);
445
- if (lock?.skills[name]) yield {
446
- name,
447
- dir,
448
- agent: agentType,
449
- info: lock.skills[name],
450
- scope: "local"
451
- };
452
- else {
453
- const info = parseSkillFrontmatter(join(dir, ".skilld", "_SKILL.md"));
454
- if (info?.generator === "skilld") yield {
455
- name,
456
- dir,
457
- agent: agentType,
458
- info,
459
- scope: "local"
460
- };
461
- }
462
- }
463
- }
464
- }
465
- if ((scope === "global" || scope === "all") && agent.globalSkillsDir) {
466
- const globalDir = agent.globalSkillsDir;
467
- if (existsSync(globalDir)) {
468
- const lock = readLock(globalDir);
469
- const entries = readdirSync(globalDir).filter((f) => !f.startsWith(".") && f !== "skilld-lock.yaml");
470
- for (const name of entries) {
471
- const dir = join(globalDir, name);
472
- if (lock?.skills[name]) yield {
473
- name,
474
- dir,
475
- agent: agentType,
476
- info: lock.skills[name],
477
- scope: "global"
478
- };
479
- else {
480
- const info = parseSkillFrontmatter(join(dir, ".skilld", "_SKILL.md"));
481
- if (info?.generator === "skilld") yield {
482
- name,
483
- dir,
484
- agent: agentType,
485
- info,
486
- scope: "global"
487
- };
488
- }
489
- }
490
- }
491
- }
492
- }
493
- }
494
- function isOutdated(skill, depVersion) {
495
- if (!skill.info?.version) return true;
496
- return semverGt(depVersion.replace(/^[\^~]/, ""), skill.info.version);
497
- }
498
- async function getProjectState(cwd = process.cwd()) {
499
- const skills = [...iterateSkills({
500
- scope: "local",
501
- cwd
502
- })];
503
- const localDeps = await readLocalDependencies(cwd).catch(() => []);
504
- const deps = new Map(localDeps.map((d) => [d.name, d.version]));
505
- const skillByName = new Map(skills.map((s) => [s.name, s]));
506
- const skillByPkgName = /* @__PURE__ */ new Map();
507
- for (const s of skills) {
508
- if (s.info?.packageName) skillByPkgName.set(s.info.packageName, s);
509
- for (const pkg of parsePackages(s.info?.packages)) skillByPkgName.set(pkg.name, s);
510
- }
511
- const missing = [];
512
- const outdated = [];
513
- const synced = [];
514
- const matchedSkillNames = /* @__PURE__ */ new Set();
515
- for (const [pkgName, version] of deps) {
516
- const normalizedName = pkgName.replace(/^@/, "").replace(/\//g, "-");
517
- const skill = skillByName.get(`${normalizedName}-skilld`) || skillByName.get(normalizedName) || skillByName.get(pkgName) || skillByPkgName.get(pkgName);
518
- if (!skill) missing.push(pkgName);
519
- else {
520
- matchedSkillNames.add(skill.name);
521
- if (isOutdated(skill, version)) outdated.push({
522
- ...skill,
523
- packageName: pkgName,
524
- latestVersion: version
525
- });
526
- else synced.push({
527
- ...skill,
528
- packageName: pkgName,
529
- latestVersion: version
530
- });
531
- }
532
- }
533
- return {
534
- skills,
535
- deps,
536
- missing,
537
- outdated,
538
- synced,
539
- unmatched: skills.filter((s) => !matchedSkillNames.has(s.name))
540
- };
541
- }
542
- function getSkillsDir(agent, scope, cwd = process.cwd()) {
543
- const agentConfig = targets[agent];
544
- if (scope === "global") {
545
- if (!agentConfig.globalSkillsDir) throw new Error(`Agent ${agent} does not support global skills`);
546
- return agentConfig.globalSkillsDir;
547
- }
548
- return getSharedSkillsDir(cwd) || join(cwd, agentConfig.skillsDir);
549
- }
550
281
  function timeAgo(iso) {
551
282
  if (!iso) return "";
552
283
  const diff = Date.now() - new Date(iso).getTime();
@@ -629,6 +360,6 @@ function formatCompactSnippet(r, cols) {
629
360
  preview: firstLine.length > maxPreview ? `${firstLine.slice(0, maxPreview - 1)}…` : firstLine
630
361
  };
631
362
  }
632
- export { version as A, introLine as C, requireInteractive as D, relativeTime as E, readConfig as F, registerProject as I, unregisterProject as L, getRegisteredProjects as M, hasCompletedWizard as N, resolveAgent as O, hasConfig as P, updateConfig as R, getRepoHint as S, promptForAgent as T, removeLockEntry as _, highlightTerms as a, formatStatus as b, timeAgo as c, getSkillsDir as d, isOutdated as f, readLock as g, parsePackages as h, formatSource as i, defaultFeatures as j, sharedArgs as k, timedSpinner as l, mergeLocks as m, formatDuration as n, normalizeScores as o, iterateSkills as p, formatSnippet as r, scoreLabel as s, formatCompactSnippet as t, getProjectState as u, syncLockfilesToDirs as v, isInteractive as w, getInstalledGenerators as x, writeLock as y };
363
+ export { hasCompletedWizard as C, unregisterProject as D, registerProject as E, updateConfig as O, getRegisteredProjects as S, readConfig as T, requireInteractive as _, highlightTerms as a, version as b, timeAgo as c, getInstalledGenerators as d, getRepoHint as f, relativeTime as g, promptForAgent as h, formatSource as i, timedSpinner as l, isInteractive as m, formatDuration as n, normalizeScores as o, introLine as p, formatSnippet as r, scoreLabel as s, formatCompactSnippet as t, formatStatus as u, resolveAgent as v, hasConfig as w, defaultFeatures as x, sharedArgs as y };
633
364
 
634
365
  //# sourceMappingURL=formatting.mjs.map