@mrciphersmith/keryx 0.2.69 → 0.2.71
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/dist/cli.js +11136 -4863
- package/docs/README.md +54 -0
- package/docs/requirements/shared-agent-context/README.md +104 -0
- package/package.json +3 -2
- package/src/gdgraph/build-lang.test.ts +10 -3
- package/src/gdgraph/build.ts +54 -9
- package/src/gdgraph/import-kind.test.ts +205 -0
- package/src/gdgraph/query.ts +6 -1
- package/src/gdgraph/types.ts +34 -0
- package/src/gdskills/bundled/rules/core/model-selection.mdc +184 -31
- package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +36 -0
- package/src/gdskills/bundled/rules/core/subagent-status-protocol.md +27 -1
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/SKILL.md +159 -20
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.codex.md +28 -3
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.cursor.md +28 -3
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +28 -3
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.opencode.md +28 -3
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.zed.md +28 -3
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.codex.md +20 -2
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.cursor.md +20 -2
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +22 -3
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.opencode.md +20 -2
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.zed.md +20 -2
- package/src/gdskills/bundled/skills/planning/autodoc-analyst/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/autodoc-architect/SKILL.md +3 -1
- package/src/gdskills/bundled/skills/planning/autodoc-assembler/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/autodoc-orchestrator/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/autodoc-scanner/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/autodoc-writer/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/docpack-orchestrator/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/planning/docpack-review/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/planning/interview/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/interview/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/interview/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/planning/interviewer/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/interviewer/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/interviewer/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/planner/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/planner/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/planner/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/platform/hookify/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/platform/hookify/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/platform/hookify/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/changelog/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/changelog/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/changelog/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/commit/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/commit/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/commit/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/deploy/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/deploy/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/deploy/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/metaproject-security/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/perf-check/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/perf-check/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/perf-check/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/pr/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/pr/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/pr/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/quality/push/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/push/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/push/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/security-audit/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/security-audit/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/security-audit/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/test-gen/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/test-gen/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/test-gen/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.md +2 -1
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.codex.md +1 -1
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.cursor.md +1 -1
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.opencode.md +1 -1
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.zed.md +1 -1
- package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +37 -10
- package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +48 -14
- package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +49 -12
- package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +34 -2
- package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +33 -2
- package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +70 -29
- package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +34 -3
- package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +49 -15
- package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +39 -11
- package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +659 -64
- package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-finding.schema.json +7 -0
- package/src/gdskills/bundled/skills/review/review-orchestrator/verification-claim.schema.json +78 -0
- package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +43 -13
- package/src/gdskills/bundled/skills/review/review-pr-feedback/SKILL.md +8 -2
- package/src/gdskills/bundled/skills/review/review-regression/SKILL.md +185 -0
- package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +44 -13
- package/src/gdskills/bundled/skills/review/review-style/SKILL.md +26 -6
- package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +35 -3
- package/src/gdskills/bundled/skills/review/review-verifier/SKILL.md +276 -0
- package/src/gdskills/contracts/review-finding.schema.json +119 -1
- package/src/gdskills/contracts/subagent-dispatch.schema.json +59 -3
- package/src/gdskills/bundled/skills/review/review-strict/SKILL.md +0 -328
|
@@ -1,53 +1,206 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
2
|
+
description: "Adaptive model selection for sub-agent dispatches. Skills declare a tier; the tier is resolved against the models the active provider actually reports at runtime, without asking."
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Model Selection for Sub-Agents
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
|
-
When launching a sub-agent or skill, detect available models in the current environment and allow the user to choose.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
Match the model to the work. A reviewer scanning a twelve-line diff and a
|
|
11
|
+
regression reviewer reasoning across a forty-file blast radius should not run on
|
|
12
|
+
the same model: the cheap work pays flagship prices, and the hard work gets no
|
|
13
|
+
more capability than the trivial.
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
+
## Tiers, not model names
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
A skill declares a **tier**. It never declares a model.
|
|
18
|
+
|
|
19
|
+
A model name in a skill is wrong the day the provider changes and unusable for
|
|
20
|
+
anyone on a different provider. There are three tiers:
|
|
21
|
+
|
|
22
|
+
| Tier | For |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `light` | mechanical, verifiable work — pre-filter, `class_scope` existence checks, comment collection, formatting a reply |
|
|
25
|
+
| `standard` | ordinary reviewing and implementation — the default |
|
|
26
|
+
| `deep` | genuinely hard reasoning — regression review across the blast radius, a strategy change after a failed loop, synthesis across many findings |
|
|
27
|
+
|
|
28
|
+
Declared in SKILL.md frontmatter:
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
---
|
|
32
|
+
name: review-architecture
|
|
33
|
+
model_tier: deep
|
|
34
|
+
---
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
An undeclared skill runs at `standard`. A skill that writes a model name into
|
|
38
|
+
`model_tier` fails the guard in `src/gdskills/model-tier.test.ts`.
|
|
39
|
+
|
|
40
|
+
## Resolving a tier: discover, rank, fall back
|
|
41
|
+
|
|
42
|
+
There is **no table of models** anywhere in the resolution, and there must not
|
|
43
|
+
be. A fixed list of model ids is stale the day a provider ships anything, and it
|
|
44
|
+
is wrong for every operator whose environment differs from the one it was written
|
|
45
|
+
in. The candidate set is discovered at runtime.
|
|
46
|
+
|
|
47
|
+
`src/commands/select.ts` already detects providers and every `DetectedProvider`
|
|
48
|
+
carries `models: string[]`. That list — for the **session's own provider**, so a
|
|
49
|
+
child never resolves onto a provider the parent holds no grant for — is the whole
|
|
50
|
+
candidate set. `src/gdskills/model-tier.ts` then:
|
|
51
|
+
|
|
52
|
+
1. **discovers** the candidates (passed in, never looked up: the module reads no
|
|
53
|
+
network, no filesystem, no environment);
|
|
54
|
+
2. **ranks** them by size markers in their names — `MODEL_RANK_HINTS`;
|
|
55
|
+
3. **places the tiers relative to the session's own model**:
|
|
56
|
+
|
|
57
|
+
| Tier | Resolves to |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `standard` | the session's model, always |
|
|
60
|
+
| `deep` | the highest-ranked discovered model **strictly above** the session's, else the session's |
|
|
61
|
+
| `light` | the lowest-ranked discovered model **strictly below** the session's, else the session's |
|
|
62
|
+
|
|
63
|
+
Anchoring on the session model is what makes "never a downgrade" checkable
|
|
64
|
+
rather than hoped for: a tier can only move away from the session model in the
|
|
65
|
+
direction its own name points, and a candidate at the session's own rank is a
|
|
66
|
+
lateral move and never taken.
|
|
67
|
+
|
|
68
|
+
## What the hints are, and what they are not
|
|
69
|
+
|
|
70
|
+
Capability cannot be derived from a bare string — `haiku` is smaller than `opus`
|
|
71
|
+
and nothing about the two strings says so. `MODEL_RANK_HINTS` is that irreducible
|
|
72
|
+
residue, and it is kept in the smallest shape that works:
|
|
73
|
+
|
|
74
|
+
- it names **size words** (`mini`, `lite`, `flash`, `haiku`, `pro`, `opus`,
|
|
75
|
+
`max`, `ultra`, …), never models, so it claims nothing about what exists and
|
|
76
|
+
cannot go stale;
|
|
77
|
+
- it is applied to whatever detection reported, so an unfamiliar vendor is still
|
|
78
|
+
ranked if its names use those words;
|
|
79
|
+
- a model matching **no** hint is *unranked*, which is not the same as ranked
|
|
80
|
+
zero — it is simply not placed;
|
|
81
|
+
- it is one array, overridable per call.
|
|
82
|
+
|
|
83
|
+
A model whose name is a codename carrying no size is unrankable by design. That
|
|
84
|
+
is the honest outcome, not a gap to be patched with folklore.
|
|
85
|
+
|
|
86
|
+
## Falling back
|
|
87
|
+
|
|
88
|
+
Ranking is **refused**, and every tier keeps the session's provider and model,
|
|
89
|
+
when:
|
|
90
|
+
|
|
91
|
+
- nothing was discovered, or the session's provider is absent from the catalogue
|
|
92
|
+
(an external CLI runtime, or detection that has not run);
|
|
93
|
+
- the provider reported no models;
|
|
94
|
+
- the hints cannot place the **session's own** model — with no anchor, no
|
|
95
|
+
candidate can be called larger or smaller.
|
|
96
|
+
|
|
97
|
+
A refusal **never** fails a dispatch and **never** causes a silent downgrade.
|
|
98
|
+
Degrading capability because discovery failed is the worst of the three outcomes.
|
|
99
|
+
|
|
100
|
+
Do not "fix" a fallback by adding model ids to the code. Add a size word to the
|
|
101
|
+
hints if one genuinely applies, or leave it: running on the session's model is a
|
|
102
|
+
correct answer.
|
|
103
|
+
|
|
104
|
+
## Where this actually runs
|
|
105
|
+
|
|
106
|
+
Two places, and they are not the same shape:
|
|
107
|
+
|
|
108
|
+
- **`spawn_subagent`** (`src/harness/tool/builtin/spawn-subagent-tool.ts`) takes an
|
|
109
|
+
optional `model_tier` input and does the rest in code: it builds the tier map
|
|
110
|
+
with `buildTierMap` from its host's detection result, hands it to
|
|
111
|
+
`resolveChildModel`, and records the outcome on the dispatch's run trace.
|
|
112
|
+
Omitting `model_tier` inherits the parent's model, exactly as before the field
|
|
113
|
+
existed.
|
|
114
|
+
- **An orchestrator authoring a dispatch document** *runs a command*:
|
|
115
|
+
`keryx review tier`. It takes the signals below as flags and prints the `model`
|
|
116
|
+
block ready to paste — the tier, the ordered rule ids that produced it, the
|
|
117
|
+
resolved provider/model, `tier_resolution` and `model_discovery`. `--json`
|
|
118
|
+
prints the block alone.
|
|
119
|
+
|
|
120
|
+
That second bullet used to say the orchestrator "calls `decideDispatchModel`".
|
|
121
|
+
An orchestrator is an agent following prose and **cannot call a TypeScript
|
|
122
|
+
function**, so what actually happened was a model reading a table of signals and
|
|
123
|
+
doing the arithmetic in its head — the exact mechanical work this programme moves
|
|
124
|
+
out of skills and into the code that consumes them. `keryx review tier` is that
|
|
125
|
+
code's entry point; `decideDispatchModel` is what it calls.
|
|
126
|
+
|
|
127
|
+
Nothing reads a recorded resolution back and checks it. These fields explain a
|
|
128
|
+
finished run; they do not gate one.
|
|
129
|
+
|
|
130
|
+
## Choosing the tier
|
|
131
|
+
|
|
132
|
+
The tier is **computed, not judged**. Run:
|
|
17
133
|
|
|
18
134
|
```bash
|
|
19
|
-
|
|
135
|
+
keryx review tier --scope blast-radius --findings 12 --diff-lines 340 \
|
|
136
|
+
--verifier execution --fix-attempt 2 --security \
|
|
137
|
+
--forced-strategy-change --json
|
|
20
138
|
```
|
|
21
139
|
|
|
22
|
-
|
|
140
|
+
Every flag is a signal the orchestrator already holds before it dispatches: the
|
|
141
|
+
round's scope, its own attempt counter, the diff it computed, the findings it is
|
|
142
|
+
holding, the verification method it is about to ask for. None of them is a
|
|
143
|
+
model's self-report — no model is ever asked to rate its own difficulty.
|
|
144
|
+
|
|
145
|
+
The rules `assignTier` applies, in the order it applies them:
|
|
146
|
+
|
|
147
|
+
| Signal | Flag | Effect |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| scope is `blast-radius` | `--scope blast-radius` | at least `deep` |
|
|
150
|
+
| fix attempt >= 2 on the same finding | `--fix-attempt <n>` | raise one tier |
|
|
151
|
+
| forced strategy change after the loop cap | `--forced-strategy-change` | `deep` |
|
|
152
|
+
| finding count <= 3 **and** diff <= 50 lines | `--findings <n> --diff-lines <n>` | allow `light` |
|
|
153
|
+
| verification method is `execution` or `site-check` | `--verifier <method>` | `light` — the evidence comes from running something, not from reasoning |
|
|
154
|
+
| any security finding in scope | `--security` | never below `standard` |
|
|
155
|
+
|
|
156
|
+
Floors are applied after downgrades, so "at least `deep`" means at least: a
|
|
157
|
+
blast-radius round over a twelve-line diff is still a blast-radius round.
|
|
158
|
+
|
|
159
|
+
The session's provider/model come from the selection `keryx shell` persisted, and
|
|
160
|
+
the candidate set from live provider detection. A caller that already holds
|
|
161
|
+
either passes `--session-provider`/`--session-model` and `--catalog` instead of
|
|
162
|
+
paying for the lookup. **There is no `--tier` flag, and there will not be**:
|
|
163
|
+
accepting a hand-written tier would put the arithmetic straight back in the
|
|
164
|
+
caller's head.
|
|
23
165
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- `gpt-5.1-codex-mini` - Cheaper, faster, less capable
|
|
29
|
-
- `gpt-5.2` - Latest frontier model
|
|
166
|
+
When nothing can be worked out — no persisted session, an unrankable catalogue,
|
|
167
|
+
an unrankable session model — the block says `inherit: true` and the dispatch
|
|
168
|
+
runs on the **caller's own model**. Exit status is still 0: a fallback is an
|
|
169
|
+
answer, not a failure.
|
|
30
170
|
|
|
31
|
-
|
|
32
|
-
Uses OpenAI models (GPT-4, GPT-4o, etc.)
|
|
171
|
+
## Recording the decision
|
|
33
172
|
|
|
34
|
-
|
|
35
|
-
|
|
173
|
+
The dispatch carries the tier, the ordered rule ids that produced it, which of
|
|
174
|
+
the three outcomes occurred, and what was on the table when it did —
|
|
175
|
+
`model.tier`, `model.tier_reasons`, `model.tier_resolution` and
|
|
176
|
+
`model.model_discovery` in
|
|
177
|
+
`.metaproject/core/gdskills/contracts/subagent-dispatch.schema.json`.
|
|
36
178
|
|
|
37
|
-
|
|
38
|
-
Check configuration in `~/.config/opencode/`
|
|
179
|
+
`tier_resolution` distinguishes three facts that must not be flattened:
|
|
39
180
|
|
|
40
|
-
|
|
41
|
-
|
|
181
|
+
| Value | Means |
|
|
182
|
+
|---|---|
|
|
183
|
+
| `discovered` | a discovered model was assigned to this tier |
|
|
184
|
+
| `session-ranked` | ranking worked and placed the tier at the session's model |
|
|
185
|
+
| `session-fallback` | ranking was refused; the session's model is kept |
|
|
42
186
|
|
|
43
|
-
|
|
187
|
+
"Fell back to the session model" and "assigned the session model because it
|
|
188
|
+
ranked there" are different facts. A run that cannot be explained afterwards is
|
|
189
|
+
what these fields exist to prevent. Record them on every dispatch that resolves
|
|
190
|
+
a tier — `keryx review tier` prints all four together as one pasteable block, so
|
|
191
|
+
recording them is one copy rather than four decisions.
|
|
44
192
|
|
|
45
|
-
|
|
46
|
-
2. **Present options** - Show user available models with descriptions
|
|
47
|
-
3. **Get confirmation** - Ask user which model to use
|
|
48
|
-
4. **Launch sub-agent** - Use selected model for the sub-agent
|
|
193
|
+
## Mandatory behavior
|
|
49
194
|
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
195
|
+
- Declare a tier in the skill; resolve the model at dispatch time.
|
|
196
|
+
- **Run `keryx review tier` — do not work the tier out by hand.** Assigning it
|
|
197
|
+
from the table above by reading is the mechanical step this rule exists to
|
|
198
|
+
remove.
|
|
199
|
+
- **Do not ask the operator which model to use per dispatch.** Asking every time
|
|
200
|
+
is what made adaptive selection impossible.
|
|
201
|
+
- Never write a concrete model name into a skill, a rule, a dispatch template, or
|
|
202
|
+
the resolution code.
|
|
203
|
+
- Take the candidate set from runtime detection. Never from a literal list of
|
|
204
|
+
what exists.
|
|
205
|
+
- When the candidates cannot be ranked, keep the session model. Never substitute
|
|
206
|
+
a cheaper one.
|
|
@@ -29,6 +29,42 @@ Before creating or editing a skill, ask and confirm:
|
|
|
29
29
|
|
|
30
30
|
`SKILL.md` is always required. Platform variants are optional — if absent, `keryx update` installs `SKILL.md` as fallback.
|
|
31
31
|
|
|
32
|
+
## Frontmatter Fields (Agent Skills spec alignment)
|
|
33
|
+
|
|
34
|
+
`SKILL.md` frontmatter follows the published Agent Skills specification
|
|
35
|
+
(agentskills.io — the format Zed adopted when it dropped its own Rules
|
|
36
|
+
Library), with two deliberate additions. Flow 203 removed two accidental
|
|
37
|
+
divergences that had crept in; keep both fixes intact when authoring or
|
|
38
|
+
editing a skill:
|
|
39
|
+
|
|
40
|
+
- **`version` lives in `metadata.version` only.** The spec has no top-level
|
|
41
|
+
`version` field — its own example nests it under `metadata`. Do not
|
|
42
|
+
reintroduce a top-level `version:` key; nothing in this codebase reads one.
|
|
43
|
+
- **`compatibility` carries the spec's meaning, not ours.** The spec defines
|
|
44
|
+
`compatibility` as environment requirements written in prose (e.g. "Requires
|
|
45
|
+
git, docker, jq, and access to the internet"). Our machine-readable CSV of
|
|
46
|
+
supported harnesses (`cursor,codex,zed,opencode,claude`) lives instead at
|
|
47
|
+
`metadata.compatible_harnesses`. Do not put a harness CSV back into
|
|
48
|
+
`compatibility` — if a skill genuinely needs to declare environment
|
|
49
|
+
requirements, write them there as prose, per the spec.
|
|
50
|
+
|
|
51
|
+
Two divergences are deliberate and stay — a later pass must not "fix" them
|
|
52
|
+
back toward the spec:
|
|
53
|
+
|
|
54
|
+
- **`triggers`** — a list of trigger phrases. Not in the spec, and absent from
|
|
55
|
+
every skill collection surveyed while building this convention; the spec's
|
|
56
|
+
only discovery mechanism is semantic matching on `description`. `triggers`
|
|
57
|
+
gives the router a cheap, deterministic first-pass match before falling back
|
|
58
|
+
to semantic matching. It is additive and costs nothing as long as
|
|
59
|
+
`description` stays self-sufficient on its own — never let `triggers` carry
|
|
60
|
+
meaning `description` lacks.
|
|
61
|
+
- **Per-skill `input-contract.schema.json` / `output-contract.schema.json`**
|
|
62
|
+
(sibling files, not frontmatter keys) — genuinely unique to this codebase.
|
|
63
|
+
Nothing in the spec or any surveyed collection defines one, because the spec
|
|
64
|
+
assumes a single agent reading a single skill file. This project dispatches
|
|
65
|
+
typed payloads to subagent workers instead, which the spec does not attempt
|
|
66
|
+
to address.
|
|
67
|
+
|
|
32
68
|
## Global Sync Mapping
|
|
33
69
|
- `SKILL.cursor.md` (or `SKILL.md`) → `~/.cursor/skills/<skill-name>/SKILL.md`
|
|
34
70
|
- `SKILL.codex.md` (or `SKILL.md`) → `${CODEX_HOME:-~/.codex}/skills/<skill-name>/SKILL.md`
|
|
@@ -32,7 +32,11 @@ If the first line is not `STATUS: <STATUS>`, the orchestrator MUST treat the res
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
## The
|
|
35
|
+
## The Five Statuses
|
|
36
|
+
|
|
37
|
+
Four of them are for **skill workers** — the subagents an orchestrator dispatches
|
|
38
|
+
from `.metaproject/skills/`. The fifth, `FAILED`, belongs to a different worker
|
|
39
|
+
family and is documented at the end of this section.
|
|
36
40
|
|
|
37
41
|
### `DONE`
|
|
38
42
|
Task fully complete. All acceptance criteria met. Orchestrator can continue the pipeline.
|
|
@@ -66,6 +70,28 @@ Use when:
|
|
|
66
70
|
- The task references files or components that don't exist and no context explains them
|
|
67
71
|
- Acceptance criteria use terms not defined anywhere in the provided context
|
|
68
72
|
|
|
73
|
+
### `FAILED` — harness child workers only
|
|
74
|
+
|
|
75
|
+
**Do not emit `FAILED` as a skill worker.** A skill worker that cannot finish
|
|
76
|
+
reports `BLOCKED`; `task-implementer` maps its own internal `failed` to
|
|
77
|
+
`STATUS: BLOCKED` for exactly this reason.
|
|
78
|
+
|
|
79
|
+
`FAILED` exists in `subagent-result.schema.json` because a **different** worker
|
|
80
|
+
family uses it: external child processes launched through the harness. Their
|
|
81
|
+
`STATUS:` line is parsed by `parseChildResult` in `src/harness/child/contract.ts`
|
|
82
|
+
— which mirrors this enum as `CanonicalSubagentStatus` — and is wired into
|
|
83
|
+
production at `src/harness/extension/execute.ts`. `spawn.test.ts` pins the
|
|
84
|
+
behaviour it guarantees: a `FAILED` child disposition must reach the parent's
|
|
85
|
+
gate as a *failed* completion, **never as a false `completed`**.
|
|
86
|
+
|
|
87
|
+
So the enum has five values and this document previously described four, which
|
|
88
|
+
made `FAILED` look unreachable. It is not. It is unreachable *from a skill
|
|
89
|
+
worker*, and load-bearing for the child-process layer.
|
|
90
|
+
|
|
91
|
+
Orchestrators dispatching skill workers may therefore treat a `FAILED` reply as
|
|
92
|
+
a protocol violation and re-request. Orchestrators reading harness child results
|
|
93
|
+
must handle it as a real terminal failure.
|
|
94
|
+
|
|
69
95
|
---
|
|
70
96
|
|
|
71
97
|
## Exact Response Formats
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-verifier
|
|
3
|
+
model_tier: light
|
|
3
4
|
description: "Use when running a full quality gate after implementation — lint, type-check, tests, and import validation. Mandatory step in job-orchestrator after task-implementer and after fix iterations. Use standalone when you need a structured verification report."
|
|
4
5
|
triggers:
|
|
5
6
|
- "Run verification"
|
|
@@ -13,8 +14,8 @@ metadata:
|
|
|
13
14
|
version: "1.0.0"
|
|
14
15
|
category: "verification"
|
|
15
16
|
agent_worthy: true
|
|
17
|
+
compatible_harnesses: "cursor,codex,zed,opencode"
|
|
16
18
|
license: "MIT"
|
|
17
|
-
compatibility: "cursor,codex,zed,opencode"
|
|
18
19
|
---
|
|
19
20
|
|
|
20
21
|
# Code Verifier
|