export type SkillScope = "project" | "user"; export type ConventionSkillHost = "claude" | "codex"; export interface SkillManagementPolicy { enabled?: boolean; trustProjectSkills?: boolean; trustUserSkills?: boolean; ignoredSkills?: string[]; includeSkills?: string[]; disabledExtensions?: string[]; } export type SkillDisabledReason = "protected" | "scope-trust" | "ignored" | "include" | "disabled-extension"; /** A discovered native skill with provenance and enablement state. */ export interface ManagedSkillRecord { name: string; description: string; path: string; scope: SkillScope; /** Canonical source label, e.g. "project .gjc/skills" or "user ~/.gjc/agent/skills". */ source: string; hidden: boolean; enabled: boolean; disabledReason?: SkillDisabledReason; } /** A Claude Code / Codex skill enumerated as an explicit import source into `.gjc`. */ export interface ConventionSkillImportSource { host: ConventionSkillHost; scope: SkillScope; name: string; description: string; path: string; } export interface WriteNativeSkillInput { cwd: string; home?: string; scope: SkillScope; name: string; content: string; } export interface WriteNativeSkillReceipt { name: string; scope: SkillScope; directory: string; path: string; } /** Raised when a write targets one of the four bundled workflow skill names. */ export declare class SkillNameProtectedError extends Error { readonly code = "SKILL_NAME_PROTECTED"; constructor(name: string); } /** Raised when skill content has no parseable frontmatter or lacks a description. */ export declare class SkillFrontmatterError extends Error { readonly code = "SKILL_FRONTMATTER_INVALID"; constructor(message: string); } /** * Canonical project skill directories in precedence order: `.gjc/skills` in * every ancestor from `cwd` up to the repo root (closest first). */ export declare function getProjectSkillDirs(cwd: string, home: string): Promise<{ dirs: string[]; repoRoot: string | null; }>; /** Canonical user skill directories in precedence order (same resolution as runtime discovery). */ export declare function getUserSkillDirs(home: string): string[]; /** * The canonical directory a write targets for a scope: the repo root (or `cwd`) * `.gjc/skills` for project scope, the canonical `/agent/skills` user * root for user scope (honoring `GJC_CONFIG_DIR` / `PI_CONFIG_DIR`). */ export declare function resolveNativeSkillScopeDir(cwd: string, scope: SkillScope, home?: string): Promise; /** * Authoritative discovery of native skills with provenance and enablement * state. Unlike runtime session discovery, this lists every scanned skill — * including disabled, shadowed, and protected ones — so `/extensions` and SDK * consumers can show and toggle the full catalog. */ export declare function listNativeSkillsForManagement(options: { cwd: string; home?: string; policy?: SkillManagementPolicy; }): Promise; /** * Write a native skill into the canonical `.gjc` scope directory. The content * must parse as frontmatter with a non-empty `description`; the effective name * comes from `frontmatter.name` when present, else the requested `name`. Bundled * workflow skill names are rejected. */ export declare function writeNativeSkill(input: WriteNativeSkillInput): Promise; /** Whether a skill is enabled under the current policy (disabledExtensions/ignored/scope trust). */ export declare function isNativeSkillEnabled(name: string, policy: SkillManagementPolicy | undefined): boolean; /** * Toggle per-skill enablement by adding/removing the `skill:` entry in * `disabledExtensions`. Returns the updated list; the caller persists it through * Settings. Bundled workflow skill names cannot be disabled. */ export declare function setNativeSkillEnabled(name: string, enabled: boolean, disabledExtensions: string[]): string[]; /** * Enumerate Claude Code / Codex skills (project and user scope) as explicit * import sources into `.gjc`. This only reads the foreign layouts for * inspection/import; nothing is loaded into sessions and user-home content is * never used without an explicit import action (#4291). */ export declare function listConventionSkillImportSources(options: { cwd: string; home?: string; host?: ConventionSkillHost | "all"; }): Promise;