/** * Materialization of skill entries as real dsh skills: renders the dsh * SKILL.md bundle format (YAML frontmatter + markdown body) and reconciles a * skills directory against the effective (merged) skill entries touched by a * refinement commit, so dsh's filesystem skill provider discovers generated * skills live. * @module dsh-continual-harness */ import type { HarnessEntry } from './types.ts'; /** Length cap for the single-line frontmatter description. */ export declare const MAX_DESCRIPTION_CHARS = 200; /** Soft cap on the skill id length: short, memorable, easy to type (L2). */ export declare const MAX_SKILL_ID_CHARS = 30; /** Soft cap on the kebab-case id segment count: no long descriptive phrases (L2). */ export declare const MAX_SKILL_ID_SEGMENTS = 3; /** Soft cap on the SKILL.md body line count (L2). */ export declare const MAX_SKILL_BODY_LINES = 500; /** Provenance marker: this plugin authored the materialized skill. */ export declare const SKILL_AUTHOR = "dsh-continual-harness"; /** Provenance marker: the skill came out of the experience-solidification loop. */ export declare const SKILL_SOURCE = "esp"; /** Skill bundle size/number limits (spec §7.4/§7.10). */ export interface SkillBundleLimits { maxSkillFiles: number; maxSkillFileBytes: number; maxSkillBundleBytes: number; } /** Default bundle limits: 20 files, 256 KiB per file, 1 MiB total (UTF-8 bytes). */ export declare const DEFAULT_SKILL_BUNDLE_LIMITS: SkillBundleLimits; /** * L1 hard validation of a skill bundle `files` map (spec §7.4): returns the * failure reason or undefined when every key passes. Runs before any write. */ export declare function validateBundleFiles(files: Record, limits?: SkillBundleLimits): string | undefined; /** Skill entries may carry the optional one-line description. */ export type SkillEntryLike = HarnessEntry & { description?: string; files?: Record; }; /** * Render one skill entry as a `/SKILL.md` bundle body: YAML frontmatter * with the dsh-required `name` and `description` keys, a `metadata` provenance * block marking the author and source, plus the markdown body verbatim. The * description falls back to the first line of the body and is emitted as a * double-quoted YAML scalar so `: `, `#`, quotes, or leading special * characters can never invalidate the frontmatter. */ export declare function renderSkillMarkdown(entry: SkillEntryLike): string; /** First non-empty line of a body, trimmed (frontmatter description fallback). */ export declare function firstLine(content: string): string; /** Path of a skill's SKILL.md bundle inside a skills directory. */ export declare function skillBundleDir(dir: string, id: string): string; /** A discovered relative path is only processable when it stays inside the bundle root. */ export declare function isSafeBundleRelative(rel: string): boolean; /** * Why a materialization target is unwritable, or undefined when it is safe: * the path must stay inside the bundle root AND live under scripts/ or * references/ (the same prefix rule `validateBundleFiles` enforces on the * edit path — the write loop re-checks because store state may predate it). */ export declare function unsafeBundleTargetReason(rel: string): string | undefined; /** One L2 structural-quality finding for a skill entry. Advisory: never blocks a write (L0/L1 are the hard gates). */ export interface SkillValidationIssue { severity: 'error' | 'warning'; code: string; message: string; } /** Parse the `name:` field out of a rendered SKILL.md frontmatter block; undefined when unparseable. */ export declare function parseFrontmatterName(markdown: string): string | undefined; /** Parse the provenance fields out of a rendered SKILL.md frontmatter block; undefined when unparseable. */ export declare function parseFrontmatterProvenance(markdown: string): { author?: string; source?: string; } | undefined; /** * True only when the bundle carries the full hard-coded harness provenance * (spec §7.4): both author and source must match the constants. LLMs never * participate in this decision. */ export declare function isHarnessOwnedBundle(markdown: string): boolean; /** Every `scripts/` or `references/` path mentioned in a skill body. */ export declare function referencedFilePaths(content: string): string[]; /** * L2 structural-quality validation (design §7): id brevity, trigger-word * description, frontmatter name consistency, referenced-path coverage * against the entry's `files` map, and body length. All findings are * advisory — callers surface them as a post-creation self-check report; * they never reject a write. */ export declare function validateSkillBundle(entry: SkillEntryLike): SkillValidationIssue[]; //# sourceMappingURL=skills.d.ts.map