/** * Project skills: the SpecWeave skills a project has turned on (the core ones * plus any enabled or detected optional ones, see ./catalog.ts), namespaced as * `sw-`, in both places AI tools look for them: * * .claude/skills/sw-/ Claude Code, including cloud sessions where * plugins do not load * .agents/skills/sw-/ Codex, Grok and every tool that reads the * shared skills folder * * Both come from the same source, the plugin copies generated from * `skills/sw-/` (scripts/build/generate-skills.mjs), so switching tools * mid-work needs no reinstall. The only change from the plugin copy is the * frontmatter `name:` (tools that require it get `sw-`) and the removal * of the "generated" marker line. * * `installProjectSkills` also removes the copies of optional skills that are now * off. `removeLegacySkillCopies` deletes the unnamespaced copies (`do`, `review`, * ...) that SpecWeave 2.x put into those folders and the retired `sw-` * folders, only when their content identifies them as SpecWeave's own. * * @module core/skills/project-skills */ import { LEGACY_SKILL_HASHES } from './legacy-skill-hashes.js'; import { type SkillCatalog, type SkillState } from './catalog.js'; /** Where the project copies go, relative to the project root. */ export declare const PROJECT_SKILL_DIRS: readonly [".claude/skills", ".agents/skills"]; /** * Unnamespaced skill folders SpecWeave 2.x copied into `.claude/skills/` (and the * generic adapter into `.agents/skills/`). Removed only when the content is ours. */ export declare const LEGACY_SKILL_NAMES: readonly ["auto", "brainstorm", "do", "done", "handoff", "increment", "jev", "project", "qa", "review", "sync", "team"]; /** * Skills SpecWeave once installed as `sw-` and no longer ships; the same * list as the catalog's `retired` (a test keeps them equal). Only these names are * candidates; any other `sw-*` folder belongs to the user. * qa 2.x Codex adapter wrote every plugin skill as `.agents/skills/sw-`; qa was dropped in 3.0 * task standalone `skills/sw-task` (vskill-installable, 2.0.0 to 2.3.0), folded into sw-do in 3.0 * brainstorm its Decide step became sw-increment's and sw-grill-me's (3.1) * team folded into sw-do's "Parallel lanes" (3.1) */ export declare const RETIRED_SKILL_NAMES: readonly ["qa", "task", "brainstorm", "team"]; export declare function projectSkillName(name: string): string; /** Project copy of a plugin SKILL.md: `name: sw-` first, no generated marker. */ export declare function toProjectSkill(pluginContent: string, name: string): string; /** The catalog shipped next to a plugin skills folder (`plugins/specweave/skills-catalog.json`). */ export declare function catalogFor(sourceDir: string): SkillCatalog; /** Every catalog skill and whether this project has it on. */ export declare function projectSkillStates(projectRoot: string, options?: { sourceDir?: string; }): SkillState[]; /** The plugin skills folder shipped with this package (`plugins/specweave/skills`). */ export declare function defaultPluginSkillsDir(): string; export interface InstallProjectSkillsOptions { /** Plugin skills folder to install from (default: the one shipped with this package). */ sourceDir?: string; /** Report what would change without writing. */ dryRun?: boolean; } export interface InstallProjectSkillsResult { /** Project-relative files written (or that would be, in a dry run). */ written: string[]; /** Project-relative files already up to date. */ unchanged: string[]; /** Project-relative files removed from an `sw-` folder because the skill no longer ships them. */ removed: string[]; /** Skills installed (short names, catalog order). */ installed: string[]; /** Project-relative `sw-` folders removed because that optional skill is now off. */ removedSkills: string[]; /** Folders of optional skills that are off but were left alone: changed by hand, or not SpecWeave's copy. */ keptSkills: string[]; } /** File SpecWeave writes into every `sw-` folder it installs: the skill and each file's SHA-256. */ export declare const INSTALL_MANIFEST = ".specweave-install.json"; /** * Who a `sw-` folder belongs to. * absent nothing there * pristine SpecWeave's copy, unchanged: every file matches its install manifest, * or (3.0.x wrote no manifest) is a file some 3.0.x release installed * edited SpecWeave's manifest is there but a file was changed, added or removed * foreign anything else: the user's own skill, a vskill install, a symlink */ export type SkillFolderOwner = 'absent' | 'pristine' | 'edited' | 'foreign'; export declare function skillFolderOwner(dir: string, name: string, legacy?: Readonly>>>): SkillFolderOwner; export declare function installProjectSkills(projectRoot: string, options?: InstallProjectSkillsOptions): InstallProjectSkillsResult; /** * True when a legacy skill folder is a copy SpecWeave installed: only SKILL.md * (plus team's old agents/*.md and brainstorm's references/credits.md), and the * SKILL.md drives the specweave CLI or names a `sw:` skill. A user's own * `review` skill is left alone. */ export declare function isSpecweaveOwnedCopy(dir: string, name: string): boolean; /** * Remove SpecWeave's own stale skill copies from `.claude/skills/` and * `.agents/skills/`: the unnamespaced 2.x folders and the `sw-` folders * of RETIRED_SKILL_NAMES. A retired skill 3.0 shipped (team, brainstorm) is * removed only when every file is one a 3.0.x release installed; 2.x leftovers * (qa, task) are recognised by their content. Skips a symlinked skills folder. */ export declare function removeLegacySkillCopies(projectRoot: string, options?: { dryRun?: boolean; legacyHashes?: typeof LEGACY_SKILL_HASHES; }): string[]; //# sourceMappingURL=project-skills.d.ts.map