@sentry/warden 0.22.0 → 0.24.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 +427 -0
- package/README.md +4 -1
- 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 +13 -5
- 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 +12 -6
- 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/main.d.ts +41 -2
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +294 -75
- 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 +1 -1
- package/dist/cli/output/index.d.ts.map +1 -1
- package/dist/cli/output/index.js +1 -1
- 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 +64 -28
- package/dist/cli/output/ink-runner.js.map +1 -1
- package/dist/cli/output/jsonl.d.ts +37 -0
- package/dist/cli/output/jsonl.d.ts.map +1 -1
- package/dist/cli/output/jsonl.js +6 -0
- 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 +8 -5
- package/dist/cli/output/tasks.d.ts.map +1 -1
- package/dist/cli/output/tasks.js +113 -71
- 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 +147 -277
- 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 +23 -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 +40 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +11 -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/SPEC.md +112 -0
- package/skills/warden/references/cli-reference.md +2 -2
- package/skills/warden/references/config-schema.md +29 -13
- package/skills/warden/references/configuration.md +20 -8
- package/skills/warden/references/creating-skills.md +3 -0
- package/skills/warden-sweep/SPEC.md +126 -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,60 @@
|
|
|
1
|
+
# Source Discovery
|
|
2
|
+
|
|
3
|
+
Use this guide during synthesis when obvious docs are shallow, stale, incomplete, or too polished to reveal real behavior.
|
|
4
|
+
|
|
5
|
+
## Source Priority
|
|
6
|
+
|
|
7
|
+
Prefer sources in this order:
|
|
8
|
+
|
|
9
|
+
1. Local repository authority: `AGENTS.md`, `README.md`, `CONTRIBUTING.md`, manifests, validators, scripts, tests, and existing neighboring skills.
|
|
10
|
+
2. Primary upstream material: official specifications, product docs, API references, release notes, changelogs, and source code.
|
|
11
|
+
3. Operational evidence: issue threads, PR discussions, CI failures, incident notes, support patterns, and migration notes.
|
|
12
|
+
4. Historical evidence: commit logs, blame, reverted changes, and changelog diffs.
|
|
13
|
+
5. Secondary summaries: blog posts, tutorials, and community examples.
|
|
14
|
+
|
|
15
|
+
Treat secondary and generated content as leads, not authority.
|
|
16
|
+
|
|
17
|
+
## High-Signal Retrieval Passes
|
|
18
|
+
|
|
19
|
+
Run the passes that match the skill's risk:
|
|
20
|
+
|
|
21
|
+
- Core behavior: official docs, source exports, public interfaces, happy-path examples.
|
|
22
|
+
- Edge behavior: tests, fixtures, error handling, retries, permissions, validation, and cleanup paths.
|
|
23
|
+
- Negative behavior: bug fixes, reverted commits, issue reports, support threads, review comments, and skipped tests.
|
|
24
|
+
- Usage behavior: in-repo callers, downstream examples, configuration samples, and migration guides.
|
|
25
|
+
- Maintenance behavior: changelog entries, release notes, deprecations, and commits touching the same files repeatedly.
|
|
26
|
+
|
|
27
|
+
## Commit Log Mining
|
|
28
|
+
|
|
29
|
+
Use commit history when the task depends on lived behavior rather than only intended behavior.
|
|
30
|
+
|
|
31
|
+
Good candidates:
|
|
32
|
+
|
|
33
|
+
- Security, access-control, CI, deployment, or migration skills.
|
|
34
|
+
- Skills for internal systems with sparse public docs.
|
|
35
|
+
- Skills being improved after repeated failures.
|
|
36
|
+
- Areas with many regressions, reversions, or subtle edge cases.
|
|
37
|
+
|
|
38
|
+
Useful commands:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git log --oneline -- <path>
|
|
42
|
+
git log --stat -- <path>
|
|
43
|
+
git log -G '<behavior|symbol|error>' -- <path>
|
|
44
|
+
git blame <path>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Capture findings as source records with commit SHA, date, affected path, observed behavior, and whether the finding is adopted, rejected, or deferred.
|
|
48
|
+
|
|
49
|
+
Do not copy large commit messages or diffs into `SKILL.md`. Summarize the behavior and keep provenance in `SOURCES.md` or an evidence file.
|
|
50
|
+
|
|
51
|
+
## Stop Conditions
|
|
52
|
+
|
|
53
|
+
Stop collecting when:
|
|
54
|
+
|
|
55
|
+
- Required coverage dimensions are complete or have explicit next retrieval actions.
|
|
56
|
+
- New retrieval mostly repeats known facts.
|
|
57
|
+
- Remaining unknowns are low impact or require access the agent does not have.
|
|
58
|
+
- The source mix includes both intended behavior and observed behavior for high-risk workflows.
|
|
59
|
+
|
|
60
|
+
Record the stopping rationale in `SOURCES.md`.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# SPEC.md Template
|
|
2
|
+
|
|
3
|
+
Use this guide to create or update a root-level `SPEC.md`.
|
|
4
|
+
|
|
5
|
+
## Use `SPEC.md` For
|
|
6
|
+
|
|
7
|
+
- intent
|
|
8
|
+
- scope
|
|
9
|
+
- trigger context
|
|
10
|
+
- evidence model
|
|
11
|
+
- evaluation expectations
|
|
12
|
+
- limitations
|
|
13
|
+
- maintenance rules
|
|
14
|
+
|
|
15
|
+
Do not put runtime instructions or full provenance tables here.
|
|
16
|
+
|
|
17
|
+
## Update `SPEC.md` When
|
|
18
|
+
|
|
19
|
+
- intent or scope changes
|
|
20
|
+
- trigger strategy changes
|
|
21
|
+
- evidence sources or storage policy changes
|
|
22
|
+
- reference architecture changes
|
|
23
|
+
- evaluation gates change
|
|
24
|
+
- privacy, security, or data-handling assumptions change
|
|
25
|
+
|
|
26
|
+
For tiny wording-only fixes, update `SOURCES.md` changelog instead.
|
|
27
|
+
|
|
28
|
+
## Relationship To Other Files
|
|
29
|
+
|
|
30
|
+
| File | Purpose |
|
|
31
|
+
|------|---------|
|
|
32
|
+
| `SKILL.md` | runtime activation and execution |
|
|
33
|
+
| `SPEC.md` | maintenance contract |
|
|
34
|
+
| `SOURCES.md` | source inventory, decisions, gaps, changelog |
|
|
35
|
+
| `EVAL.md` | reusable eval prompts or runbooks |
|
|
36
|
+
| `references/` | runtime-loadable depth |
|
|
37
|
+
| `references/evidence/` | persistent iteration examples |
|
|
38
|
+
|
|
39
|
+
## Template
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
# <Skill Name> Specification
|
|
43
|
+
|
|
44
|
+
## Intent
|
|
45
|
+
|
|
46
|
+
<1-2 short paragraphs>
|
|
47
|
+
|
|
48
|
+
## Scope
|
|
49
|
+
|
|
50
|
+
In scope:
|
|
51
|
+
- ...
|
|
52
|
+
|
|
53
|
+
Out of scope:
|
|
54
|
+
- ...
|
|
55
|
+
|
|
56
|
+
## Users And Trigger Context
|
|
57
|
+
|
|
58
|
+
- Primary users:
|
|
59
|
+
- Common user requests:
|
|
60
|
+
- Should not trigger for:
|
|
61
|
+
|
|
62
|
+
## Runtime Contract
|
|
63
|
+
|
|
64
|
+
- Required first actions:
|
|
65
|
+
- Required outputs:
|
|
66
|
+
- Non-negotiable constraints:
|
|
67
|
+
- Expected bundled files loaded at runtime:
|
|
68
|
+
|
|
69
|
+
## Source And Evidence Model
|
|
70
|
+
|
|
71
|
+
Authoritative sources:
|
|
72
|
+
- ...
|
|
73
|
+
|
|
74
|
+
Useful improvement sources:
|
|
75
|
+
- positive examples:
|
|
76
|
+
- negative examples:
|
|
77
|
+
- commit logs/changelogs:
|
|
78
|
+
- issue or PR feedback:
|
|
79
|
+
- eval results:
|
|
80
|
+
|
|
81
|
+
Data that must not be stored:
|
|
82
|
+
- secrets
|
|
83
|
+
- customer data
|
|
84
|
+
- private URLs or identifiers not needed for reproduction
|
|
85
|
+
|
|
86
|
+
## Reference Architecture
|
|
87
|
+
|
|
88
|
+
- `SKILL.md` contains:
|
|
89
|
+
- `references/` contains:
|
|
90
|
+
- `references/evidence/` contains:
|
|
91
|
+
- `scripts/` contains:
|
|
92
|
+
- `assets/` contains:
|
|
93
|
+
|
|
94
|
+
## Evaluation
|
|
95
|
+
|
|
96
|
+
- Lightweight validation:
|
|
97
|
+
- Deeper evaluation:
|
|
98
|
+
- Holdout examples:
|
|
99
|
+
- Acceptance gates:
|
|
100
|
+
|
|
101
|
+
## Known Limitations
|
|
102
|
+
|
|
103
|
+
- ...
|
|
104
|
+
|
|
105
|
+
## Maintenance Notes
|
|
106
|
+
|
|
107
|
+
- When to update `SKILL.md`:
|
|
108
|
+
- When to update `SOURCES.md`:
|
|
109
|
+
- When to update `EVAL.md`:
|
|
110
|
+
- When to update `references/evidence/`:
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Design Rules
|
|
114
|
+
|
|
115
|
+
1. Keep `SPEC.md` concise.
|
|
116
|
+
2. Link to `SOURCES.md` or refs instead of duplicating them.
|
|
117
|
+
3. Keep raw examples in `references/evidence/`.
|
|
118
|
+
4. Keep sensitive data redacted.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Structure Troubleshooting
|
|
2
|
+
|
|
3
|
+
Load this when the skill layout is unclear, overloaded, or drifting away from focused routing.
|
|
4
|
+
|
|
5
|
+
## Over-long SKILL.md
|
|
6
|
+
|
|
7
|
+
Problem: `SKILL.md` exceeds 500 lines and becomes a second encyclopedia.
|
|
8
|
+
|
|
9
|
+
Fix: extract detailed material into focused `references/` files and keep `SKILL.md` as the router.
|
|
10
|
+
|
|
11
|
+
## Missing Trigger Keywords
|
|
12
|
+
|
|
13
|
+
Problem: the description is too vague to match user language.
|
|
14
|
+
|
|
15
|
+
Fix: include the phrases users actually say.
|
|
16
|
+
|
|
17
|
+
## Trigger Info In Body Instead Of Description
|
|
18
|
+
|
|
19
|
+
Problem: "when to use" guidance appears only in the body, after triggering has already happened.
|
|
20
|
+
|
|
21
|
+
Fix: move trigger language into `description`.
|
|
22
|
+
|
|
23
|
+
## Duplicating CLAUDE.md Or AGENTS.md
|
|
24
|
+
|
|
25
|
+
Problem: the skill repeats repo-wide conventions instead of adding net-new value.
|
|
26
|
+
|
|
27
|
+
Fix: reference existing project docs and keep the skill focused on domain-specific behavior.
|
|
28
|
+
|
|
29
|
+
## Unconditional Reference Loading
|
|
30
|
+
|
|
31
|
+
Problem: the skill tells the agent to read every reference up front.
|
|
32
|
+
|
|
33
|
+
Fix: add a decision table so references load only when needed.
|
|
34
|
+
|
|
35
|
+
## Large References Without Navigation
|
|
36
|
+
|
|
37
|
+
Problem: long reference files are hard to preview and easy to misuse.
|
|
38
|
+
|
|
39
|
+
Fix: add a table of contents or split by lookup need.
|
|
40
|
+
|
|
41
|
+
## Extraneous Files
|
|
42
|
+
|
|
43
|
+
Problem: the skill directory accumulates user-facing docs or miscellaneous notes that do not help runtime, evaluation, or maintenance.
|
|
44
|
+
|
|
45
|
+
Fix: keep only `SKILL.md`, `SPEC.md`, `SOURCES.md`, `EVAL.md`, `references/`, `scripts/`, `assets/`, and `LICENSE` when needed.
|
|
46
|
+
|
|
47
|
+
## Scripts Without Documentation
|
|
48
|
+
|
|
49
|
+
Problem: `SKILL.md` names a script but does not document arguments, output, or fallback behavior.
|
|
50
|
+
|
|
51
|
+
Fix: document the script interface and expected output shape in `SKILL.md`.
|
|
52
|
+
|
|
53
|
+
## Hardcoded Paths
|
|
54
|
+
|
|
55
|
+
Problem: the skill embeds host-specific or repo-hardcoded paths.
|
|
56
|
+
|
|
57
|
+
Fix: use skill-root-relative paths or established portable placeholders.
|
|
58
|
+
|
|
59
|
+
## First/Second Person Descriptions
|
|
60
|
+
|
|
61
|
+
Problem: the description says "I can..." or "You can use this..."
|
|
62
|
+
|
|
63
|
+
Fix: write in third person so skill discovery stays consistent.
|
|
64
|
+
|
|
65
|
+
## Time-Sensitive Information
|
|
66
|
+
|
|
67
|
+
Problem: the skill bakes in dates or transitional logic that will quietly rot.
|
|
68
|
+
|
|
69
|
+
Fix: move legacy behavior into a clearly labeled deprecated section or remove it.
|
|
70
|
+
|
|
71
|
+
## Advanced Mechanics Without Justification
|
|
72
|
+
|
|
73
|
+
Problem: the skill uses routing, `context: fork`, hooks, or evaluator loops because they seem sophisticated.
|
|
74
|
+
|
|
75
|
+
Fix: name the shape, explain why simpler shapes were rejected, and add portability/safety notes.
|
|
76
|
+
|
|
77
|
+
## Router Without Fallback
|
|
78
|
+
|
|
79
|
+
Problem: the skill has multiple downstream paths but no default route or clarification step.
|
|
80
|
+
|
|
81
|
+
Fix: add a fallback branch that asks one clarifying question or picks a documented safe default.
|
|
82
|
+
|
|
83
|
+
## Evaluator Loop Without Stop Condition
|
|
84
|
+
|
|
85
|
+
Problem: the skill says "iterate until good" with no rubric or cap.
|
|
86
|
+
|
|
87
|
+
Fix: add a rubric plus a max-loop or plateau rule.
|
|
88
|
+
|
|
89
|
+
## Passive Guidance In Forked Context
|
|
90
|
+
|
|
91
|
+
Problem: `context: fork` is used for conventions or reference material instead of a concrete delegated task.
|
|
92
|
+
|
|
93
|
+
Fix: keep passive guidance inline; use forked execution only for actionable isolated tasks.
|
|
94
|
+
|
|
95
|
+
## Hook-Backed Enforcement Without Safety Notes
|
|
96
|
+
|
|
97
|
+
Problem: the skill uses hooks but does not explain event scope, fallback behavior, or shell risk.
|
|
98
|
+
|
|
99
|
+
Fix: add hook event scope, fallback path, and explicit security notes.
|
|
100
|
+
|
|
101
|
+
## Hidden Reference File
|
|
102
|
+
|
|
103
|
+
Problem: a bundled reference exists, but `SKILL.md` never tells the agent when to open it.
|
|
104
|
+
|
|
105
|
+
Fix: add the file to the main router with a one-line "open when..." reason, or remove/split the file if no clear reason exists.
|
|
106
|
+
|
|
107
|
+
## Generic Bucket Reference
|
|
108
|
+
|
|
109
|
+
Problem: a file groups unrelated techniques under a vague name such as "patterns", "notes", or "context".
|
|
110
|
+
|
|
111
|
+
Fix: split the file by lookup need and rename each leaf so the filename predicts why it should be opened.
|
|
@@ -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
|
+
```
|