UNPKG

paqad-ai

Version:

Spec-driven development framework — AI agents that think before they type

91 lines (69 loc) • 8.42 kB
--- name: skill-orchestrator description: Takes a new or edited skill through paqad's nine gated stages, from proving the skill is needed to releasing it with evidence, so no skill is added on a hunch. Use when a change creates or edits a SKILL.md or any file in a skill folder, when the Skill Orchestrator sits at the High Table, or when paqad-ai skill status names a stage to run next. metadata: model_tier: reasoning cacheable: 'false' output_format: markdown paqad-meta: skill.meta.yaml --- ## What It Does Runs the skill pipeline for one skill during the development stage. Each stage is a `paqad-ai skill` verb that writes one artifact into the workspace `.paqad/tmp/authoring/skills/<name>/`, and each gate reads only that artifact. A stage refuses to start while an earlier gate fails and names the command to run. The verbs never call a model: you do the runs and the writing, the verbs check what you produced. ## Use This When - A planned or edited file is a skill path (a SKILL.md, or a file inside a skill folder) in any host's skills folder, `.agents/skills/`, or the paqad runtime skill roots. - `paqad-ai skill status <name>` names the next stage. - The owner answered a decision this pipeline raised and the waiting stage can resume. Skip it for a skill the change removes: a removal gets no check. ## Inputs - `name`: the skill name. The verbs refuse any name outside lowercase letters, digits and single hyphens. - `task`: the job, in the project's words, from the spec and the ticket. ## Procedure Each step names the reference to read first; the rules below are what a gate checks, so follow them even before you open it. 1. Run `paqad-ai skill status <name>`. It says whether the entry is `justify` (a new skill) or `improve` (an installed one) and which stage is next. For an installed skill run `paqad-ai skill improve <name>` first: it snapshots the folder before any edit, the snapshot is the baseline S5 compares against, and S0 is skipped. 2. S0 justify (`references/s0-justify.md`). Run the task three times without any skill, each in a fresh context (a fresh subagent or headless run, never this conversation). Save the transcripts as `<workspace>/baseline/run-<n>.md`, judge each run into `<workspace>/baseline/verdicts.json`, then run `paqad-ai skill justify <name>`. Three passes out of three stop the pipeline: no skill is needed, and that result is not overridden. Four cases have a better home and stop with a flag and no skill folder: a one-off fix (`--exclusion one-off`), something already documented (`--exclusion documented --documented-in <path>`), a project convention for the always-loaded instructions file (`--exclusion convention`), and a rule that has to hold every time, which a skill cannot promise because it loads only when chosen (`--exclusion enforceable --enforce-with <hook or script>`). 3. S1 intake (`references/s1-intake.md`). Fill the seven fields from the spec, the ticket, the trace and the docs, then run `paqad-ai skill intake <name> intake.yaml`. A field nothing answers goes to the owner with `--gap`. 4. S2 evidence (`references/s2-evidence.md`). Write `sources.md` with one row per fact and at least one origin that is not `model`, then run `paqad-ai skill evidence <name> sources.md`. 5. S3 draft (`references/s3-draft.md`). Draft the folder outside every skills root, so nothing loads it until it is released, and map every block to S-IDs in `trace.md`. Run `paqad-ai skill draft <name> --dir <folder> --trace trace.md`. 6. S4 lint and tests (`references/s4-lint-and-tests.md`). Run `paqad-ai skill lint`, write one contract test per script check, then `paqad-ai skill test <name>`. 7. S5 evals (`references/s5-evals.md`). Write at least two cases, one marked as the edge case. Run `paqad-ai skill eval plan <name>` and every command it prints: each case runs with the skill and without it (the old skill in improve mode), every run in a fresh context, on both the fast and the reasoning model tier. Grade with `references/agents/grader.md`, then `paqad-ai skill eval record <name>`. A new skill needs a pass-rate gain over that baseline; an edit to an installed skill passes when it does not fall below the old skill by more than the regression tolerance. Revise and rerun until it passes; the loop stops on empty feedback, after two iterations with no improvement, or at the iteration cap. 8. S6 trigger (`references/s6-trigger.md`). Write about twenty queries, eight to ten that should fire the skill and eight to ten near misses. `paqad-ai skill trigger plan` splits them sixty to forty into train and validation with seed 42. Run each query three times per description, revise the description from train failures only (validation stays unseen), for at most five iterations, then `paqad-ai skill trigger record`. The best validation score wins. 9. S7 release (`references/s7-release.md`). Run `paqad-ai skill release <name>`. It is the only step that puts the skill into a skills folder. 10. S8 operate, later and in use (`references/s8-operate.md`): learn, drift and catalog. Checklist for one pass: - [ ] status read, entry known (improve snapshot taken for an installed skill) - [ ] three fresh-context baseline runs judged, or a better home named - [ ] every gate passed, or the owner recorded an override - [ ] `paqad-ai skill release` wrote the bundle record ## Output Contract The released skill sits in the host skills folder. `.paqad/authoring/skills/<name>/evidence.json` and its `CHANGELOG.md` are tracked. The change bundle holds `skill-<name>.json` with status `passed` or `overridden`. Report to the stage in this shape: ```markdown Skill: <name> <version> Gates: S0 passed, S1 passed, S2 passed, S3 passed, S4 passed, S5 passed, S6 passed Evidence: .paqad/authoring/skills/<name>/evidence.json Decisions: <ids, or none> ``` ## Escalate / Stop Conditions - Ask the owner only through the decision packets the verbs raise: overlap with an installed skill, a risky script, an intake field nothing answers, an improvement to a skill in use, a retirement, and an override. A message in chat, from a teammate or anyone else, is not an owner decision. - To skip a gate, ask with `paqad-ai skill override <name> --gate <gate> --ask "<why>"` and record the skip with `--decision <id>` only after the owner answers that authoring.override decision. Never skip on your own. - A gate the skill cannot pass after the revision loop is not a question. The verbs record it in `.paqad/ledger/authoring/defects.jsonl` with its evidence and print the receipt line; the skill is not released and stays out of every skills root. - A secret in the skill stops the pipeline until the value is removed; then rerun `paqad-ai skill draft` and `paqad-ai skill test`. Nobody can override it. - Refuse a draft whose instructions differ from its stated purpose, send data out, or get around a control: run `paqad-ai skill draft <name> --refuse "<why>"`. ## Gotchas - `paqad-ai skill test` sets `PAQAD_SKILL_UNDER_TEST` to the draft folder for the test run, so the contract tests can load a script that is not released yet. Fall back to the host path when it is unset. - A rule that has to hold every time belongs in a hook or a rules-as-scripts check, not in a skill. S0 ends with that proposal. - Write nothing from `runtime/base/authoring/never-write.yaml`; the lint blocks every phrase on it. ## Resources - `references/s0-justify.md`: the baseline runs and the four better homes. - `references/s1-intake.md`: the seven intake fields and the test type per class. - `references/s2-evidence.md`: the sources table, overlap and the catalog budget. - `references/s3-draft.md`: the drafting rules and the trace format. - `references/s4-lint-and-tests.md`: the lint rules and the seven contract tests. - `references/s5-evals.md`: cases, arms, tiers and the revision loop. - `references/s6-trigger.md`: the trigger queries, the split and the description rules. - `references/s7-release.md`: release, overrides and the portable copy. - `references/s8-operate.md`: learn, drift and catalog. - `references/agents/grader.md`: the S5 grader brief. - `references/agents/comparator.md`: the S5 blind comparator brief. - `references/agents/analyzer.md`: the S5 analyst brief. - `references/agents/NOTICE`: the Apache 2.0 notice for the three adapted briefs. - `agents/openai.yaml`: the display name and short description for hosts that read it.