/** * `skill-md` — parse `skills/*.md` files into "seed recipes" that the * AI driver can use as targets for Phase A discovery. * * Inspired by browser-harness's `SKILL.md` pattern: domain experts / * non-developers write **prose** instructions for what to test; the * AI compiles them into a concrete `ActionRecipe` by running with * the seed as the Goal's `objective`. * * File format — YAML-ish frontmatter + Markdown body: * * ``` * --- * name: shop/buy-tshirt * goal: completion * urlPattern: ^https?://[^/]+/?$ * success: * urlContains: /thanks * --- * # Buy a T-shirt * * 1. From the home page, click any T-shirt product card. * 2. On the product page, click "Buy". * 3. You should land on /thanks. * ``` * * `parseSkillMarkdown(text)` returns a `SkillSeed`. `seedToGoal(seed)` * builds a `Goal` from it. `seedToCandidateRecipe(seed, trace)` * combines the trace produced by an AI run with the seed metadata * into a `markdown-seed`-origin recipe. * * We do NOT ship a full YAML parser — frontmatter is restricted to a * small grammar (key: value, two-space-indented sub-keys, no anchors, * no flow). For richer schemas, consume the markdown body yourself * and call the lower-level constructors. */ import type { ActionRecipe, ActionTrace, RecipePrecondition } from "./types.js"; import type { Goal } from "./types.js"; export interface SkillSeed { /** Stable recipe name. Required. */ name: string; /** Goal name carried through to captured trace + AI prompt. */ goal?: string; /** Free-form persona override. */ persona?: string; /** Auto-derived URL precondition. */ urlPattern?: string; /** Success check expressed as an ExpectClause. */ success?: { urlContains?: string; urlNotContains?: string; hasSelector?: string; hidesSelector?: string; }; /** Extra preconditions beyond `urlPattern`. */ preconditions?: RecipePrecondition[]; /** Markdown body — fed verbatim to the AI's prompt context. */ body: string; /** Raw frontmatter, for callers who need extra fields. */ raw: Record; } /** * Parse `---\n\n---\n`. Returns the seed. * Throws on malformed frontmatter; bad files should fail loudly, * not silently produce empty seeds. */ export declare function parseSkillMarkdown(text: string): SkillSeed; /** * Build a `Goal` from the seed. `objective` is the markdown body — * the AI gets the natural-language instructions verbatim, plus the * persona override if present. */ export declare function seedToGoal(seed: SkillSeed): Goal; /** * Turn a captured trace + the seed into a candidate `ActionRecipe` * (origin: `markdown-seed`). Caller decides whether to upsert. */ export declare function seedToCandidateRecipe(seed: SkillSeed, trace: ActionTrace): ActionRecipe; //# sourceMappingURL=skill-md.d.ts.map