@sentry/warden 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.oxlintrc.json +169 -0
- package/CHANGELOG.md +390 -0
- package/README.md +4 -4
- package/dist/cli/args.d.ts +6 -2
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +175 -207
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +16 -5
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/build.d.ts +13 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +384 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +10 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/runs.d.ts.map +1 -1
- package/dist/cli/commands/runs.js +79 -15
- package/dist/cli/commands/runs.js.map +1 -1
- package/dist/cli/commands/sync.d.ts.map +1 -1
- package/dist/cli/commands/sync.js +4 -1
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/context.d.ts.map +1 -1
- package/dist/cli/context.js +8 -1
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/files.d.ts.map +1 -1
- package/dist/cli/files.js +27 -9
- package/dist/cli/files.js.map +1 -1
- package/dist/cli/help.d.ts +4 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +448 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.js +2 -13
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/input.d.ts +12 -0
- package/dist/cli/input.d.ts.map +1 -1
- package/dist/cli/input.js +60 -0
- package/dist/cli/input.js.map +1 -1
- package/dist/cli/log-cleanup.d.ts.map +1 -1
- package/dist/cli/log-cleanup.js +4 -0
- package/dist/cli/log-cleanup.js.map +1 -1
- package/dist/cli/main.d.ts +39 -2
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +482 -100
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/output/box.js +1 -1
- package/dist/cli/output/formatters.d.ts +10 -2
- package/dist/cli/output/formatters.d.ts.map +1 -1
- package/dist/cli/output/formatters.js +32 -9
- package/dist/cli/output/formatters.js.map +1 -1
- package/dist/cli/output/index.d.ts +2 -2
- package/dist/cli/output/index.d.ts.map +1 -1
- package/dist/cli/output/index.js +2 -2
- package/dist/cli/output/index.js.map +1 -1
- package/dist/cli/output/ink-runner.d.ts +3 -1
- package/dist/cli/output/ink-runner.d.ts.map +1 -1
- package/dist/cli/output/ink-runner.js +79 -25
- package/dist/cli/output/ink-runner.js.map +1 -1
- package/dist/cli/output/jsonl-schema-gen.d.ts.map +1 -1
- package/dist/cli/output/jsonl-schema-gen.js +4 -2
- package/dist/cli/output/jsonl-schema-gen.js.map +1 -1
- package/dist/cli/output/jsonl.d.ts +147 -4
- package/dist/cli/output/jsonl.d.ts.map +1 -1
- package/dist/cli/output/jsonl.js +183 -7
- package/dist/cli/output/jsonl.js.map +1 -1
- package/dist/cli/output/live-status.d.ts +48 -0
- package/dist/cli/output/live-status.d.ts.map +1 -0
- package/dist/cli/output/live-status.js +173 -0
- package/dist/cli/output/live-status.js.map +1 -0
- package/dist/cli/output/reporter.d.ts +4 -0
- package/dist/cli/output/reporter.d.ts.map +1 -1
- package/dist/cli/output/reporter.js +20 -3
- package/dist/cli/output/reporter.js.map +1 -1
- package/dist/cli/output/tasks.d.ts +11 -5
- package/dist/cli/output/tasks.d.ts.map +1 -1
- package/dist/cli/output/tasks.js +126 -68
- package/dist/cli/output/tasks.js.map +1 -1
- package/dist/cli/signals.d.ts +15 -0
- package/dist/cli/signals.d.ts.map +1 -0
- package/dist/cli/signals.js +26 -0
- package/dist/cli/signals.js.map +1 -0
- package/dist/config/loader.d.ts +48 -7
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +228 -32
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +55 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +34 -2
- package/dist/config/schema.js.map +1 -1
- package/dist/diff/context.d.ts +9 -2
- package/dist/diff/context.d.ts.map +1 -1
- package/dist/diff/context.js +65 -17
- package/dist/diff/context.js.map +1 -1
- package/dist/evals/runner.d.ts.map +1 -1
- package/dist/evals/runner.js +16 -0
- package/dist/evals/runner.js.map +1 -1
- package/dist/event/context.d.ts.map +1 -1
- package/dist/event/context.js +1 -0
- package/dist/event/context.js.map +1 -1
- package/dist/event/schedule-context.d.ts.map +1 -1
- package/dist/event/schedule-context.js +1 -0
- package/dist/event/schedule-context.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/output/dedup.d.ts +8 -11
- package/dist/output/dedup.d.ts.map +1 -1
- package/dist/output/dedup.js +39 -37
- package/dist/output/dedup.js.map +1 -1
- package/dist/output/github-checks.d.ts +1 -0
- package/dist/output/github-checks.d.ts.map +1 -1
- package/dist/output/github-checks.js +9 -7
- package/dist/output/github-checks.js.map +1 -1
- package/dist/sdk/analyze.d.ts.map +1 -1
- package/dist/sdk/analyze.js +166 -276
- package/dist/sdk/analyze.js.map +1 -1
- package/dist/sdk/circuit-breaker.d.ts +26 -0
- package/dist/sdk/circuit-breaker.d.ts.map +1 -0
- package/dist/sdk/circuit-breaker.js +53 -0
- package/dist/sdk/circuit-breaker.js.map +1 -0
- package/dist/sdk/errors.d.ts +5 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +27 -0
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/extract.d.ts +18 -9
- package/dist/sdk/extract.d.ts.map +1 -1
- package/dist/sdk/extract.js +95 -87
- package/dist/sdk/extract.js.map +1 -1
- package/dist/sdk/fix-quality.d.ts +5 -0
- package/dist/sdk/fix-quality.d.ts.map +1 -1
- package/dist/sdk/fix-quality.js +42 -23
- package/dist/sdk/fix-quality.js.map +1 -1
- package/dist/sdk/haiku.d.ts +6 -0
- package/dist/sdk/haiku.d.ts.map +1 -1
- package/dist/sdk/haiku.js +75 -49
- package/dist/sdk/haiku.js.map +1 -1
- package/dist/sdk/json-output.d.ts +31 -0
- package/dist/sdk/json-output.d.ts.map +1 -0
- package/dist/sdk/json-output.js +98 -0
- package/dist/sdk/json-output.js.map +1 -0
- package/dist/sdk/model-pricing.json +56 -16
- package/dist/sdk/post-process.d.ts +29 -0
- package/dist/sdk/post-process.d.ts.map +1 -0
- package/dist/sdk/post-process.js +65 -0
- package/dist/sdk/post-process.js.map +1 -0
- package/dist/sdk/prepare.d.ts.map +1 -1
- package/dist/sdk/prepare.js +4 -1
- package/dist/sdk/prepare.js.map +1 -1
- package/dist/sdk/pricing.d.ts +18 -0
- package/dist/sdk/pricing.d.ts.map +1 -1
- package/dist/sdk/pricing.js +108 -3
- package/dist/sdk/pricing.js.map +1 -1
- package/dist/sdk/prompt-sections.d.ts +56 -0
- package/dist/sdk/prompt-sections.d.ts.map +1 -0
- package/dist/sdk/prompt-sections.js +118 -0
- package/dist/sdk/prompt-sections.js.map +1 -0
- package/dist/sdk/prompt.d.ts +2 -17
- package/dist/sdk/prompt.d.ts.map +1 -1
- package/dist/sdk/prompt.js +15 -37
- package/dist/sdk/prompt.js.map +1 -1
- package/dist/sdk/report-files.d.ts +15 -0
- package/dist/sdk/report-files.d.ts.map +1 -0
- package/dist/sdk/report-files.js +20 -0
- package/dist/sdk/report-files.js.map +1 -0
- package/dist/sdk/runner.d.ts +9 -1
- package/dist/sdk/runner.d.ts.map +1 -1
- package/dist/sdk/runner.js +6 -0
- package/dist/sdk/runner.js.map +1 -1
- package/dist/sdk/runtimes/claude.d.ts +3 -0
- package/dist/sdk/runtimes/claude.d.ts.map +1 -0
- package/dist/sdk/runtimes/claude.js +376 -0
- package/dist/sdk/runtimes/claude.js.map +1 -0
- package/dist/sdk/runtimes/index.d.ts +12 -0
- package/dist/sdk/runtimes/index.d.ts.map +1 -0
- package/dist/sdk/runtimes/index.js +22 -0
- package/dist/sdk/runtimes/index.js.map +1 -0
- package/dist/sdk/runtimes/types.d.ts +116 -0
- package/dist/sdk/runtimes/types.d.ts.map +1 -0
- package/dist/sdk/runtimes/types.js +17 -0
- package/dist/sdk/runtimes/types.js.map +1 -0
- package/dist/sdk/types.d.ts +42 -2
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/sdk/types.js.map +1 -1
- package/dist/sdk/usage.d.ts +21 -6
- package/dist/sdk/usage.d.ts.map +1 -1
- package/dist/sdk/usage.js +36 -23
- package/dist/sdk/usage.js.map +1 -1
- package/dist/sdk/verify.d.ts +25 -0
- package/dist/sdk/verify.d.ts.map +1 -0
- package/dist/sdk/verify.js +226 -0
- package/dist/sdk/verify.js.map +1 -0
- package/dist/skill-builder/agentic.d.ts +33 -0
- package/dist/skill-builder/agentic.d.ts.map +1 -0
- package/dist/skill-builder/agentic.js +240 -0
- package/dist/skill-builder/agentic.js.map +1 -0
- package/dist/skill-builder/authoring-provider.d.ts +5 -0
- package/dist/skill-builder/authoring-provider.d.ts.map +1 -0
- package/dist/skill-builder/authoring-provider.js +70 -0
- package/dist/skill-builder/authoring-provider.js.map +1 -0
- package/dist/skill-builder/definition.d.ts +46 -0
- package/dist/skill-builder/definition.d.ts.map +1 -0
- package/dist/skill-builder/definition.js +171 -0
- package/dist/skill-builder/definition.js.map +1 -0
- package/dist/skill-builder/outline-contract.d.ts +113 -0
- package/dist/skill-builder/outline-contract.d.ts.map +1 -0
- package/dist/skill-builder/outline-contract.js +73 -0
- package/dist/skill-builder/outline-contract.js.map +1 -0
- package/dist/skill-builder/outline-state.d.ts +158 -0
- package/dist/skill-builder/outline-state.d.ts.map +1 -0
- package/dist/skill-builder/outline-state.js +87 -0
- package/dist/skill-builder/outline-state.js.map +1 -0
- package/dist/skill-builder/outline.d.ts +36 -0
- package/dist/skill-builder/outline.d.ts.map +1 -0
- package/dist/skill-builder/outline.js +345 -0
- package/dist/skill-builder/outline.js.map +1 -0
- package/dist/skill-builder/skill-contract.d.ts +97 -0
- package/dist/skill-builder/skill-contract.d.ts.map +1 -0
- package/dist/skill-builder/skill-contract.js +58 -0
- package/dist/skill-builder/skill-contract.js.map +1 -0
- package/dist/skill-builder/skill-prompts.d.ts +61 -0
- package/dist/skill-builder/skill-prompts.d.ts.map +1 -0
- package/dist/skill-builder/skill-prompts.js +285 -0
- package/dist/skill-builder/skill-prompts.js.map +1 -0
- package/dist/skill-builder/skill.d.ts +23 -0
- package/dist/skill-builder/skill.d.ts.map +1 -0
- package/dist/skill-builder/skill.js +563 -0
- package/dist/skill-builder/skill.js.map +1 -0
- package/dist/skills/index.d.ts +2 -2
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/loader.d.ts +20 -6
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +88 -141
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/remote.d.ts +11 -7
- package/dist/skills/remote.d.ts.map +1 -1
- package/dist/skills/remote.js +62 -162
- package/dist/skills/remote.js.map +1 -1
- package/dist/triggers/matcher.d.ts.map +1 -1
- package/dist/triggers/matcher.js +28 -15
- package/dist/triggers/matcher.js.map +1 -1
- package/dist/types/index.d.ts +41 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +24 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/path.d.ts +17 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +36 -0
- package/dist/utils/path.js.map +1 -0
- package/package.json +8 -8
- package/policies/README.md +22 -0
- package/policies/code-comments.md +20 -0
- package/policies/policy-template.md +14 -0
- package/skills/warden/SKILL.md +5 -5
- package/skills/warden/SOURCES.md +39 -0
- package/skills/warden/SPEC.md +112 -0
- package/skills/warden/references/cli-reference.md +11 -4
- package/skills/warden/references/config-schema.md +38 -13
- package/skills/warden/references/configuration.md +29 -8
- package/skills/warden-sweep/SKILL.md +43 -365
- package/skills/warden-sweep/SOURCES.md +43 -0
- package/skills/warden-sweep/SPEC.md +126 -0
- package/skills/warden-sweep/references/issue-phase.md +24 -0
- package/skills/warden-sweep/references/organize-phase.md +31 -0
- package/skills/warden-sweep/references/patch-phase.md +142 -0
- package/skills/warden-sweep/references/resume-and-artifacts.md +51 -0
- package/skills/warden-sweep/references/scan-phase.md +46 -0
- package/skills/warden-sweep/references/script-interfaces.md +127 -0
- package/skills/warden-sweep/references/verify-phase.md +69 -0
- package/src/builtin-skills/security-review/SKILL.md +81 -0
- package/src/builtin-skills/security-review/SPEC.md +77 -0
- package/src/builtin-skills/security-review/references/github-workflows.md +186 -0
- package/src/builtin-skills/security-review/references/javascript-typescript.md +69 -0
- package/src/builtin-skills/security-review/references/python.md +70 -0
- package/src/internal-skills/skill-writer/EVAL.md +124 -0
- package/src/internal-skills/skill-writer/SKILL.md +159 -0
- package/src/internal-skills/skill-writer/SOURCES.md +94 -0
- package/src/internal-skills/skill-writer/SPEC.md +153 -0
- package/src/internal-skills/skill-writer/references/artifact-layouts/argument-driven-skill-layout.md +32 -0
- package/src/internal-skills/skill-writer/references/artifact-layouts/asset-template-skill-layout.md +30 -0
- package/src/internal-skills/skill-writer/references/artifact-layouts/inline-skill-layout.md +28 -0
- package/src/internal-skills/skill-writer/references/artifact-layouts/reference-backed-skill-layout.md +35 -0
- package/src/internal-skills/skill-writer/references/artifact-layouts/script-backed-skill-layout.md +31 -0
- package/src/internal-skills/skill-writer/references/authoring-path.md +91 -0
- package/src/internal-skills/skill-writer/references/claude-code/argument-substitutions.md +20 -0
- package/src/internal-skills/skill-writer/references/claude-code/dynamic-context.md +16 -0
- package/src/internal-skills/skill-writer/references/claude-code/frontmatter-and-invocation.md +33 -0
- package/src/internal-skills/skill-writer/references/claude-code/hook-backed-skills.md +28 -0
- package/src/internal-skills/skill-writer/references/claude-code/subagent-fork-skills.md +22 -0
- package/src/internal-skills/skill-writer/references/description-optimization.md +28 -0
- package/src/internal-skills/skill-writer/references/design-principles.md +74 -0
- package/src/internal-skills/skill-writer/references/evaluation-path.md +73 -0
- package/src/internal-skills/skill-writer/references/examples/documentation-skill.md +70 -0
- package/src/internal-skills/skill-writer/references/examples/evaluator-loop-skill.md +38 -0
- package/src/internal-skills/skill-writer/references/examples/hook-backed-skill.md +39 -0
- package/src/internal-skills/skill-writer/references/examples/router-skill.md +41 -0
- package/src/internal-skills/skill-writer/references/examples/security-review-skill.md +69 -0
- package/src/internal-skills/skill-writer/references/examples/subagent-fork-skill.md +39 -0
- package/src/internal-skills/skill-writer/references/examples/workflow-process-skill.md +65 -0
- package/src/internal-skills/skill-writer/references/execution-shapes.md +68 -0
- package/src/internal-skills/skill-writer/references/iteration-evidence.md +82 -0
- package/src/internal-skills/skill-writer/references/iteration-path.md +40 -0
- package/src/internal-skills/skill-writer/references/mode-selection.md +67 -0
- package/src/internal-skills/skill-writer/references/output-contracts.md +68 -0
- package/src/internal-skills/skill-writer/references/reference-architecture.md +71 -0
- package/src/internal-skills/skill-writer/references/registration-validation.md +67 -0
- package/src/internal-skills/skill-writer/references/source-discovery.md +60 -0
- package/src/internal-skills/skill-writer/references/spec-template.md +118 -0
- package/src/internal-skills/skill-writer/references/structure-troubleshooting.md +111 -0
- package/src/internal-skills/skill-writer/references/synthesis-path.md +119 -0
- package/src/internal-skills/skill-writer/references/workflow-mechanics/evaluator-loops.md +25 -0
- package/src/internal-skills/skill-writer/references/workflow-mechanics/orchestrator-workers.md +25 -0
- package/src/internal-skills/skill-writer/references/workflow-mechanics/parallel-workflows.md +21 -0
- package/src/internal-skills/skill-writer/references/workflow-mechanics/plan-validate-execute.md +26 -0
- package/src/internal-skills/skill-writer/references/workflow-mechanics/prompt-chaining.md +24 -0
- package/src/internal-skills/skill-writer/references/workflow-mechanics/routing-workflows.md +28 -0
- package/src/internal-skills/skill-writer/references/workflow-mechanics/validation-loops.md +26 -0
- package/src/internal-skills/skill-writer/scripts/quick_validate.py +158 -0
- package/src/internal-skills/skill-writer/scripts/quick_validate_test.py +79 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Synthesis Path
|
|
2
|
+
|
|
3
|
+
Use this path when creating or materially changing a skill.
|
|
4
|
+
|
|
5
|
+
## Output Style
|
|
6
|
+
|
|
7
|
+
- Keep synthesis notes terse.
|
|
8
|
+
- Prefer tables, status lists, and gap lists over narrative summaries.
|
|
9
|
+
- Record decisions as `adopted`, `rejected`, or `deferred`.
|
|
10
|
+
|
|
11
|
+
## Step 0: Classify
|
|
12
|
+
|
|
13
|
+
Record:
|
|
14
|
+
|
|
15
|
+
1. skill class
|
|
16
|
+
2. primary execution shape
|
|
17
|
+
3. secondary shapes, if any
|
|
18
|
+
4. why simpler shapes were not enough
|
|
19
|
+
|
|
20
|
+
For `integration-documentation`, cover:
|
|
21
|
+
|
|
22
|
+
1. API surface and behavior contracts
|
|
23
|
+
2. config/runtime options
|
|
24
|
+
3. downstream use cases
|
|
25
|
+
4. issues/failure modes with workarounds
|
|
26
|
+
5. version or migration variance
|
|
27
|
+
|
|
28
|
+
## Step 1: Collect Sources
|
|
29
|
+
|
|
30
|
+
Collect from:
|
|
31
|
+
|
|
32
|
+
1. Agent Skills spec and best practices
|
|
33
|
+
2. similar in-repo skills
|
|
34
|
+
3. upstream implementations and orchestration docs
|
|
35
|
+
4. domain or library docs
|
|
36
|
+
5. repo conventions and validators
|
|
37
|
+
6. tests, fixtures, changelogs, and issue or PR history
|
|
38
|
+
7. commit history and blame for regressions or edge cases
|
|
39
|
+
8. prior `SPEC.md`, `SOURCES.md`, `EVAL.md`, and `references/evidence/`
|
|
40
|
+
|
|
41
|
+
If the shape uses provider-specific mechanics, include current provider docs.
|
|
42
|
+
|
|
43
|
+
## Baseline Source Pack For Skill-Authoring
|
|
44
|
+
|
|
45
|
+
Require at minimum:
|
|
46
|
+
|
|
47
|
+
1. local `skill-writer` runtime files
|
|
48
|
+
2. Agent Skills spec and repo conventions
|
|
49
|
+
3. provider docs for any provider-specific mechanic being recommended
|
|
50
|
+
|
|
51
|
+
## Step 1.5: Load Example Profiles
|
|
52
|
+
|
|
53
|
+
Load only the profiles you need from `references/examples/`.
|
|
54
|
+
|
|
55
|
+
## Step 1.6: Expand Coverage
|
|
56
|
+
|
|
57
|
+
Run targeted passes for:
|
|
58
|
+
|
|
59
|
+
| Pass | Retrieve |
|
|
60
|
+
|------|----------|
|
|
61
|
+
| core behavior | happy path and main workflow |
|
|
62
|
+
| edge behavior | failures, retries, permissions, cleanup |
|
|
63
|
+
| negative behavior | false positives, reviewer concerns, bad outputs |
|
|
64
|
+
| repair patterns | fixes and corrected outputs |
|
|
65
|
+
| version variance | platform or release differences |
|
|
66
|
+
| shape mechanics | routing, delegation, loop stops, hook constraints |
|
|
67
|
+
|
|
68
|
+
Extra retrieval for advanced shapes:
|
|
69
|
+
|
|
70
|
+
1. route or delegation criteria
|
|
71
|
+
2. worker or handoff contracts
|
|
72
|
+
3. loop stopping rules
|
|
73
|
+
4. provider-specific lifecycle or security constraints
|
|
74
|
+
|
|
75
|
+
## Step 2: Capture Provenance
|
|
76
|
+
|
|
77
|
+
For each source, record:
|
|
78
|
+
|
|
79
|
+
- source URL or path
|
|
80
|
+
- trust tier
|
|
81
|
+
- confidence
|
|
82
|
+
- contribution
|
|
83
|
+
- usage constraints
|
|
84
|
+
|
|
85
|
+
Store provenance in `SOURCES.md`, not long runtime prose.
|
|
86
|
+
|
|
87
|
+
## Step 3: Synthesize Decisions
|
|
88
|
+
|
|
89
|
+
Map each major decision to source evidence, including:
|
|
90
|
+
|
|
91
|
+
- class choice
|
|
92
|
+
- shape choice
|
|
93
|
+
- provider-specific mechanics
|
|
94
|
+
- deferred gaps
|
|
95
|
+
|
|
96
|
+
## Step 4: Enforce Depth Gates
|
|
97
|
+
|
|
98
|
+
All of these must pass:
|
|
99
|
+
|
|
100
|
+
1. no missing high-impact coverage dimensions
|
|
101
|
+
2. partial dimensions have explicit next retrieval actions
|
|
102
|
+
3. authoring or generator skills include transformed examples
|
|
103
|
+
4. selected profile requirements are satisfied
|
|
104
|
+
5. coverage passes are reflected in the coverage matrix
|
|
105
|
+
6. stopping rationale is explicit
|
|
106
|
+
7. supporting refs stay focused and directly discoverable from `SKILL.md`
|
|
107
|
+
8. `SPEC.md` exists or is updated when the contract changed
|
|
108
|
+
9. advanced mechanics include required contracts and justification
|
|
109
|
+
10. provider-specific mechanics include portability notes
|
|
110
|
+
|
|
111
|
+
## Required Output
|
|
112
|
+
|
|
113
|
+
- synthesis summary
|
|
114
|
+
- source inventory in `SOURCES.md`
|
|
115
|
+
- decisions and rationale
|
|
116
|
+
- coverage matrix
|
|
117
|
+
- gaps and next retrieval actions
|
|
118
|
+
- selected class and shape
|
|
119
|
+
- `SPEC.md` update summary when applicable
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Evaluator Loops
|
|
2
|
+
|
|
3
|
+
Use this workflow when a first draft benefits from critique and revision against a clear rubric.
|
|
4
|
+
|
|
5
|
+
## Choose this workflow when
|
|
6
|
+
|
|
7
|
+
- the skill can score output against explicit criteria
|
|
8
|
+
- revision improves quality materially
|
|
9
|
+
- the loop has a bounded stopping rule
|
|
10
|
+
|
|
11
|
+
## Required contract
|
|
12
|
+
|
|
13
|
+
1. Rubric or acceptance criteria.
|
|
14
|
+
2. Maximum loop count or plateau rule.
|
|
15
|
+
3. What evidence or diffs must be preserved between rounds.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
1. Produce a first draft
|
|
21
|
+
2. Score it against the rubric
|
|
22
|
+
3. Turn failures into concrete edits
|
|
23
|
+
4. Revise
|
|
24
|
+
5. Stop when the rubric passes or the loop plateaus
|
|
25
|
+
```
|
package/src/internal-skills/skill-writer/references/workflow-mechanics/orchestrator-workers.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Orchestrator-Workers
|
|
2
|
+
|
|
3
|
+
Use this workflow when the subtasks are not known ahead of time and must be discovered from the input.
|
|
4
|
+
|
|
5
|
+
## Choose this workflow when
|
|
6
|
+
|
|
7
|
+
- the orchestrator must discover work units dynamically
|
|
8
|
+
- each unit can be delegated to a stable worker contract
|
|
9
|
+
- a final synthesis step can merge the results
|
|
10
|
+
|
|
11
|
+
## Required contract
|
|
12
|
+
|
|
13
|
+
1. Worker-task schema.
|
|
14
|
+
2. Worker output schema.
|
|
15
|
+
3. Expansion limit or stopping rule.
|
|
16
|
+
4. Final synthesis rule.
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
1. Inspect the request and identify work units dynamically
|
|
22
|
+
2. Assign each work unit to a worker path
|
|
23
|
+
3. Collect worker summaries in a fixed schema
|
|
24
|
+
4. Synthesize the result
|
|
25
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Parallel Workflows
|
|
2
|
+
|
|
3
|
+
Use this workflow when independent subtasks can run side-by-side, or when multiple judgments improve confidence.
|
|
4
|
+
|
|
5
|
+
## Choose this workflow when
|
|
6
|
+
|
|
7
|
+
- work units are independent
|
|
8
|
+
- latency or coverage improves with parallel execution
|
|
9
|
+
- aggregation can be described clearly
|
|
10
|
+
|
|
11
|
+
## Common forms
|
|
12
|
+
|
|
13
|
+
1. `sectioning`: split a task into independent work units.
|
|
14
|
+
2. `voting`: run multiple judgments and aggregate them.
|
|
15
|
+
|
|
16
|
+
## Required contract
|
|
17
|
+
|
|
18
|
+
1. Unit of parallel work.
|
|
19
|
+
2. Merge or vote rule.
|
|
20
|
+
3. Conflict handling.
|
|
21
|
+
4. Cost or latency cap.
|
package/src/internal-skills/skill-writer/references/workflow-mechanics/plan-validate-execute.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Plan-Validate-Execute
|
|
2
|
+
|
|
3
|
+
Use this workflow when a destructive or high-stakes action should be preceded by a machine-checkable plan.
|
|
4
|
+
|
|
5
|
+
## Choose this workflow when
|
|
6
|
+
|
|
7
|
+
- validating the plan is safer than validating the final action
|
|
8
|
+
- the task changes many files or records
|
|
9
|
+
- rollback would be expensive
|
|
10
|
+
|
|
11
|
+
## Required contract
|
|
12
|
+
|
|
13
|
+
1. The plan artifact and schema.
|
|
14
|
+
2. The validation step and source of truth.
|
|
15
|
+
3. Rework rules when validation fails.
|
|
16
|
+
4. Final execution and verification steps.
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
1. Analyze the input and generate `changes.json`
|
|
22
|
+
2. Validate the plan against source of truth
|
|
23
|
+
3. Revise until validation passes
|
|
24
|
+
4. Execute the plan
|
|
25
|
+
5. Verify the result
|
|
26
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Prompt Chaining
|
|
2
|
+
|
|
3
|
+
Use this workflow when the task should move through fixed ordered steps and each step makes the next one easier.
|
|
4
|
+
|
|
5
|
+
## Choose this workflow when
|
|
6
|
+
|
|
7
|
+
- the decomposition is known in advance
|
|
8
|
+
- step order matters
|
|
9
|
+
- validation between steps improves quality
|
|
10
|
+
|
|
11
|
+
## Required contract
|
|
12
|
+
|
|
13
|
+
1. Step order.
|
|
14
|
+
2. Inputs and outputs for each step.
|
|
15
|
+
3. Validation or gate points between steps.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
1. Summarize the current state
|
|
21
|
+
2. Propose the target state
|
|
22
|
+
3. Validate the proposal against constraints
|
|
23
|
+
4. Write the final document
|
|
24
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Routing Workflows
|
|
2
|
+
|
|
3
|
+
Use this workflow when the incoming request must be classified and sent to different downstream prompts, references, scripts, or tools.
|
|
4
|
+
|
|
5
|
+
## Choose this workflow when
|
|
6
|
+
|
|
7
|
+
- distinct request classes benefit from specialized downstream handling
|
|
8
|
+
- one broad prompt would create conflicts or false positives
|
|
9
|
+
- misroutes can be detected and recovered
|
|
10
|
+
|
|
11
|
+
## Required contract
|
|
12
|
+
|
|
13
|
+
1. Route-selection criteria.
|
|
14
|
+
2. Default route or clarification fallback.
|
|
15
|
+
3. Misroute recovery.
|
|
16
|
+
4. Downstream contract for each route.
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
1. Classify the request:
|
|
22
|
+
|
|
23
|
+
**Billing question?** -> Load `references/billing.md`
|
|
24
|
+
**Refund request?** -> Run `scripts/refund_intake.py`
|
|
25
|
+
**Technical bug?** -> Load `references/triage.md`
|
|
26
|
+
|
|
27
|
+
2. If classification is uncertain, ask one clarification question before continuing.
|
|
28
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Validation Loops
|
|
2
|
+
|
|
3
|
+
Use this workflow when a validator can reliably catch mistakes before the skill should claim completion.
|
|
4
|
+
|
|
5
|
+
## Choose this workflow when
|
|
6
|
+
|
|
7
|
+
- a script, schema, test, or parser can catch important failures
|
|
8
|
+
- the agent should fix issues immediately after each change
|
|
9
|
+
- the main risk is silent drift or invalid output
|
|
10
|
+
|
|
11
|
+
## Required contract
|
|
12
|
+
|
|
13
|
+
1. The validator or check to run.
|
|
14
|
+
2. When it runs in the workflow.
|
|
15
|
+
3. What to fix before retrying.
|
|
16
|
+
4. What counts as a passing state.
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
1. Make the change
|
|
22
|
+
2. Validate immediately
|
|
23
|
+
3. If validation fails, fix the issue
|
|
24
|
+
4. Re-run validation
|
|
25
|
+
5. Only proceed when validation passes
|
|
26
|
+
```
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# /// script
|
|
2
|
+
# requires-python = ">=3.12"
|
|
3
|
+
# dependencies = ["pyyaml"]
|
|
4
|
+
# ///
|
|
5
|
+
"""
|
|
6
|
+
Quick validation script for Agent Skills.
|
|
7
|
+
|
|
8
|
+
Validates only mechanical SKILL.md frontmatter and identity requirements.
|
|
9
|
+
Qualitative content, reference depth, routing, and prose structure belong to
|
|
10
|
+
human/agent review, not this script.
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
uv run quick_validate.py <skill_directory> [--skill-class <class>] [--strict-depth]
|
|
14
|
+
|
|
15
|
+
Returns exit code 0 on success, 1 on failure. Outputs JSON with validation results.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import argparse
|
|
19
|
+
import json
|
|
20
|
+
import re
|
|
21
|
+
import sys
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
import yaml
|
|
25
|
+
|
|
26
|
+
MAX_NAME_LENGTH = 64
|
|
27
|
+
MAX_DESCRIPTION_LENGTH = 1024
|
|
28
|
+
|
|
29
|
+
SKILL_CLASSES = {
|
|
30
|
+
"auto",
|
|
31
|
+
"workflow-process",
|
|
32
|
+
"integration-documentation",
|
|
33
|
+
"security-review",
|
|
34
|
+
"skill-authoring",
|
|
35
|
+
"generic",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def parse_args(argv: list[str]) -> argparse.Namespace:
|
|
40
|
+
parser = argparse.ArgumentParser(
|
|
41
|
+
description="Validate agent skill frontmatter and identity fields.",
|
|
42
|
+
)
|
|
43
|
+
parser.add_argument("skill_directory")
|
|
44
|
+
parser.add_argument("--skill-class", choices=sorted(SKILL_CLASSES), default="auto")
|
|
45
|
+
parser.add_argument("--strict-depth", action="store_true")
|
|
46
|
+
return parser.parse_args(argv)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def validate_skill(
|
|
50
|
+
skill_path: Path,
|
|
51
|
+
selected_skill_class: str = "auto",
|
|
52
|
+
strict_depth: bool = False,
|
|
53
|
+
) -> tuple[bool, list[str], list[str], str]:
|
|
54
|
+
"""Validate a skill directory. Returns (valid, errors, warnings, resolved_skill_class)."""
|
|
55
|
+
# Keep the flag for CLI compatibility; depth/content checks belong to review.
|
|
56
|
+
_ = strict_depth
|
|
57
|
+
errors: list[str] = []
|
|
58
|
+
warnings: list[str] = []
|
|
59
|
+
|
|
60
|
+
# Check SKILL.md exists.
|
|
61
|
+
skill_md = skill_path / "SKILL.md"
|
|
62
|
+
if not skill_md.exists():
|
|
63
|
+
return False, ["SKILL.md not found"], [], "generic"
|
|
64
|
+
|
|
65
|
+
content = skill_md.read_text()
|
|
66
|
+
|
|
67
|
+
# Check frontmatter exists and is first.
|
|
68
|
+
if not content.startswith("---"):
|
|
69
|
+
errors.append("No YAML frontmatter found (file must start with ---)")
|
|
70
|
+
return False, errors, warnings, "generic"
|
|
71
|
+
|
|
72
|
+
match = re.match(r"^---\n(.*?)\n---", content, re.DOTALL)
|
|
73
|
+
if not match:
|
|
74
|
+
errors.append("Invalid frontmatter format (missing closing ---)")
|
|
75
|
+
return False, errors, warnings, "generic"
|
|
76
|
+
|
|
77
|
+
# Parse frontmatter.
|
|
78
|
+
frontmatter_text = match.group(1)
|
|
79
|
+
try:
|
|
80
|
+
frontmatter = yaml.safe_load(frontmatter_text)
|
|
81
|
+
if not isinstance(frontmatter, dict):
|
|
82
|
+
errors.append("Frontmatter must be a YAML mapping")
|
|
83
|
+
return False, errors, warnings, "generic"
|
|
84
|
+
except yaml.YAMLError as exc:
|
|
85
|
+
errors.append(f"Invalid YAML in frontmatter: {exc}")
|
|
86
|
+
return False, errors, warnings, "generic"
|
|
87
|
+
|
|
88
|
+
# Validate frontmatter keys without hardcoding provider-specific optional fields.
|
|
89
|
+
invalid_keys = [key for key in frontmatter.keys() if not isinstance(key, str) or not key.strip()]
|
|
90
|
+
if invalid_keys:
|
|
91
|
+
errors.append("Frontmatter keys must be non-empty strings")
|
|
92
|
+
|
|
93
|
+
# Validate name.
|
|
94
|
+
if "name" not in frontmatter:
|
|
95
|
+
errors.append("Missing required field: name")
|
|
96
|
+
else:
|
|
97
|
+
name = frontmatter["name"]
|
|
98
|
+
if not isinstance(name, str):
|
|
99
|
+
errors.append(f"name must be a string, got {type(name).__name__}")
|
|
100
|
+
else:
|
|
101
|
+
name = name.strip()
|
|
102
|
+
if not name:
|
|
103
|
+
errors.append("name must not be empty")
|
|
104
|
+
elif len(name) > MAX_NAME_LENGTH:
|
|
105
|
+
errors.append(f"name is too long ({len(name)} chars, max {MAX_NAME_LENGTH})")
|
|
106
|
+
elif not re.match(r"^[a-z0-9-]+$", name):
|
|
107
|
+
errors.append(f"name '{name}' must contain only lowercase letters, digits, and hyphens")
|
|
108
|
+
elif name.startswith("-") or name.endswith("-"):
|
|
109
|
+
errors.append(f"name '{name}' must not start or end with a hyphen")
|
|
110
|
+
elif "--" in name:
|
|
111
|
+
errors.append(f"name '{name}' must not contain consecutive hyphens")
|
|
112
|
+
elif name != skill_path.name:
|
|
113
|
+
errors.append(f"name '{name}' does not match directory name '{skill_path.name}'")
|
|
114
|
+
|
|
115
|
+
# Validate description.
|
|
116
|
+
if "description" not in frontmatter:
|
|
117
|
+
errors.append("Missing required field: description")
|
|
118
|
+
else:
|
|
119
|
+
description = frontmatter["description"]
|
|
120
|
+
if not isinstance(description, str):
|
|
121
|
+
errors.append(f"description must be a string, got {type(description).__name__}")
|
|
122
|
+
else:
|
|
123
|
+
description = description.strip()
|
|
124
|
+
if not description:
|
|
125
|
+
errors.append("description must not be empty")
|
|
126
|
+
elif len(description) > MAX_DESCRIPTION_LENGTH:
|
|
127
|
+
errors.append(f"description is too long ({len(description)} chars, max {MAX_DESCRIPTION_LENGTH})")
|
|
128
|
+
|
|
129
|
+
resolved_skill_class = selected_skill_class if selected_skill_class != "auto" else "generic"
|
|
130
|
+
|
|
131
|
+
return len(errors) == 0, errors, warnings, resolved_skill_class
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def main() -> None:
|
|
135
|
+
args = parse_args(sys.argv[1:])
|
|
136
|
+
skill_path = Path(args.skill_directory).resolve()
|
|
137
|
+
if not skill_path.is_dir():
|
|
138
|
+
print(json.dumps({"valid": False, "errors": [f"Not a directory: {skill_path}"]}))
|
|
139
|
+
sys.exit(1)
|
|
140
|
+
|
|
141
|
+
valid, errors, warnings, resolved_skill_class = validate_skill(
|
|
142
|
+
skill_path,
|
|
143
|
+
selected_skill_class=args.skill_class,
|
|
144
|
+
strict_depth=args.strict_depth,
|
|
145
|
+
)
|
|
146
|
+
result = {
|
|
147
|
+
"valid": valid,
|
|
148
|
+
"skill_class": resolved_skill_class,
|
|
149
|
+
"strict_depth": args.strict_depth,
|
|
150
|
+
"errors": errors,
|
|
151
|
+
"warnings": warnings,
|
|
152
|
+
}
|
|
153
|
+
print(json.dumps(result, indent=2))
|
|
154
|
+
sys.exit(0 if valid else 1)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
if __name__ == "__main__":
|
|
158
|
+
main()
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import importlib.util
|
|
2
|
+
import tempfile
|
|
3
|
+
import unittest
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
SCRIPT_PATH = Path(__file__).with_name("quick_validate.py")
|
|
8
|
+
SPEC = importlib.util.spec_from_file_location("quick_validate", SCRIPT_PATH)
|
|
9
|
+
assert SPEC is not None
|
|
10
|
+
quick_validate = importlib.util.module_from_spec(SPEC)
|
|
11
|
+
assert SPEC.loader is not None
|
|
12
|
+
SPEC.loader.exec_module(quick_validate)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class QuickValidateTest(unittest.TestCase):
|
|
16
|
+
def test_ignores_markdown_content_and_supporting_files(self) -> None:
|
|
17
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
18
|
+
skill_path = Path(temp_dir) / "example-skill"
|
|
19
|
+
skill_path.mkdir()
|
|
20
|
+
(skill_path / "SKILL.md").write_text(
|
|
21
|
+
"""---
|
|
22
|
+
name: example-skill
|
|
23
|
+
description: I can review <example> content.
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
This intentionally references missing content that review may care about:
|
|
27
|
+
|
|
28
|
+
- references/missing.md
|
|
29
|
+
- scripts/missing.py
|
|
30
|
+
- SOURCES.md
|
|
31
|
+
|
|
32
|
+
/Users/example/private/path should not be script-validated.
|
|
33
|
+
""",
|
|
34
|
+
encoding="utf-8",
|
|
35
|
+
)
|
|
36
|
+
(skill_path / "SPEC.md").write_text(
|
|
37
|
+
"""# Example Skill Spec
|
|
38
|
+
|
|
39
|
+
## Evaluation
|
|
40
|
+
|
|
41
|
+
Run the local checks for this skill.
|
|
42
|
+
""",
|
|
43
|
+
encoding="utf-8",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
valid, errors, warnings, _skill_class = quick_validate.validate_skill(
|
|
47
|
+
skill_path,
|
|
48
|
+
selected_skill_class="integration-documentation",
|
|
49
|
+
strict_depth=True,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
self.assertTrue(valid)
|
|
53
|
+
self.assertEqual(errors, [])
|
|
54
|
+
self.assertEqual(warnings, [])
|
|
55
|
+
|
|
56
|
+
def test_rejects_invalid_frontmatter_yaml(self) -> None:
|
|
57
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
58
|
+
skill_path = Path(temp_dir) / "example-skill"
|
|
59
|
+
skill_path.mkdir()
|
|
60
|
+
(skill_path / "SKILL.md").write_text(
|
|
61
|
+
"""---
|
|
62
|
+
name: [example-skill
|
|
63
|
+
description: Use when reviewing example code.
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
Review example code.
|
|
67
|
+
""",
|
|
68
|
+
encoding="utf-8",
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
valid, errors, warnings, _skill_class = quick_validate.validate_skill(skill_path)
|
|
72
|
+
|
|
73
|
+
self.assertFalse(valid)
|
|
74
|
+
self.assertEqual(warnings, [])
|
|
75
|
+
self.assertTrue(any("Invalid YAML in frontmatter" in message for message in errors), errors)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if __name__ == "__main__":
|
|
79
|
+
unittest.main()
|