gennady 0.7.1 → 0.8.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/ai/directives/coding/result-conventions.xml +25 -7
- package/ai/directives/sdd/audit.directive.xml +1 -1
- package/ai/directives/sdd/critic-protocol.xml +78 -0
- package/ai/directives/sdd/critic.directive.xml +158 -0
- package/ai/directives/sdd/phase-execution-protocol.xml +11 -9
- package/ai/skills/alt-opinion/SKILL.md +79 -0
- package/ai/skills/alt-opinion/opinion.prompt.md +11 -0
- package/ai/skills/alt-opinion/synth.prompt.md +8 -0
- package/ai/skills/sdd-audit/SKILL.md +13 -0
- package/ai/skills/sdd-check/SKILL.md +139 -0
- package/ai/skills/sdd-continue/SKILL.md +13 -0
- package/ai/skills/sdd-critic/SKILL.md +12 -0
- package/ai/skills/sdd-discover/SKILL.md +13 -0
- package/ai/skills/sdd-execute/SKILL.md +205 -0
- package/ai/skills/sdd-execute/scripts/README.md +84 -0
- package/ai/skills/sdd-execute/scripts/check-blockers.sh +158 -0
- package/ai/skills/sdd-execute/scripts/classify-scripts.js +111 -0
- package/ai/skills/sdd-execute/scripts/classify-scripts.ts +133 -0
- package/ai/skills/sdd-execute/scripts/extract-section.sh +219 -0
- package/ai/skills/sdd-execute/scripts/lint-artifacts.sh +143 -0
- package/ai/skills/sdd-execute/scripts/scan.sh +385 -0
- package/ai/skills/sdd-execute/scripts/sdd +114 -0
- package/ai/skills/sdd-execute/scripts/verify.sh +139 -0
- package/ai/skills/sdd-execute-batch/SKILL.md +213 -0
- package/ai/skills/sdd-fix/SKILL.md +13 -0
- package/ai/skills/sdd-infra/SKILL.md +13 -0
- package/ai/skills/sdd-module-decomposition/SKILL.md +13 -0
- package/ai/skills/sdd-scaffold/SKILL.md +13 -0
- package/ai/skills/sdd-setup/SKILL.md +13 -0
- package/dist/ai/directives/coding/result-conventions.xml +25 -7
- package/dist/ai/directives/sdd/audit.directive.xml +1 -1
- package/dist/ai/directives/sdd/critic-protocol.xml +78 -0
- package/dist/ai/directives/sdd/critic.directive.xml +158 -0
- package/dist/ai/directives/sdd/phase-execution-protocol.xml +11 -9
- package/dist/ai/skills/alt-opinion/SKILL.md +79 -0
- package/dist/ai/skills/alt-opinion/opinion.prompt.md +11 -0
- package/dist/ai/skills/alt-opinion/synth.prompt.md +8 -0
- package/dist/ai/skills/sdd-audit/SKILL.md +13 -0
- package/dist/ai/skills/sdd-check/SKILL.md +139 -0
- package/dist/ai/skills/sdd-continue/SKILL.md +13 -0
- package/dist/ai/skills/sdd-critic/SKILL.md +12 -0
- package/dist/ai/skills/sdd-discover/SKILL.md +13 -0
- package/dist/ai/skills/sdd-execute/SKILL.md +205 -0
- package/dist/ai/skills/sdd-execute/scripts/README.md +84 -0
- package/dist/ai/skills/sdd-execute/scripts/check-blockers.sh +158 -0
- package/dist/ai/skills/sdd-execute/scripts/classify-scripts.js +111 -0
- package/dist/ai/skills/sdd-execute/scripts/classify-scripts.ts +133 -0
- package/dist/ai/skills/sdd-execute/scripts/extract-section.sh +219 -0
- package/dist/ai/skills/sdd-execute/scripts/lint-artifacts.sh +143 -0
- package/dist/ai/skills/sdd-execute/scripts/scan.sh +385 -0
- package/dist/ai/skills/sdd-execute/scripts/sdd +114 -0
- package/dist/ai/skills/sdd-execute/scripts/verify.sh +139 -0
- package/dist/ai/skills/sdd-execute-batch/SKILL.md +213 -0
- package/dist/ai/skills/sdd-fix/SKILL.md +13 -0
- package/dist/ai/skills/sdd-infra/SKILL.md +13 -0
- package/dist/ai/skills/sdd-module-decomposition/SKILL.md +13 -0
- package/dist/ai/skills/sdd-scaffold/SKILL.md +13 -0
- package/dist/ai/skills/sdd-setup/SKILL.md +13 -0
- package/dist/chunks/help-5qCaicff.js +6 -0
- package/dist/chunks/help-B2ETH0j6.js +6 -0
- package/dist/chunks/help-BCDURaCQ.js +6 -0
- package/dist/chunks/help-BvgYOSyQ.js +6 -0
- package/dist/chunks/help-CSPhOoI9.js +8 -0
- package/dist/chunks/help-CV1vpwrh.js +6 -0
- package/dist/chunks/help-CaBNA6Qr.js +12 -0
- package/dist/chunks/help-CjkR6SB9.js +6 -0
- package/dist/chunks/help-Coi1l5u9.js +8 -0
- package/dist/chunks/help-CsuLpZn-.js +8 -0
- package/dist/chunks/help-DL_QBMwy.js +8 -0
- package/dist/chunks/help-DqBZ2xcp.js +6 -0
- package/dist/chunks/help-_Y_TN4DZ.js +6 -0
- package/dist/chunks/{help.cmd-B_G7EWzF.js → help.cmd-BseRtoBF.js} +10 -2
- package/dist/chunks/{index-DeYzAoxF.js → index-BU1AXJGA.js} +7 -3
- package/dist/chunks/{index-CFd_iufb.js → index-BXWDYM_9.js} +1 -1
- package/dist/chunks/index-BgKyH0dB.js +658 -0
- package/dist/chunks/{index-BCqnKvNZ.js → index-BghL1-Nk.js} +2 -2
- package/dist/chunks/{index-BLsDffzZ.js → index-BlqEQEGy.js} +1 -1
- package/dist/chunks/{index-BrSutH7l.js → index-CDM74qdR.js} +3 -3
- package/dist/chunks/{index-O5kqC9i_.js → index-CGsIRefC.js} +2 -2
- package/dist/chunks/{index-Dc44ukmL.js → index-CIvkaAQ3.js} +2 -2
- package/dist/chunks/{index-BsD-J44e.js → index-CkczJ__m.js} +10 -10
- package/dist/chunks/index-CtJKSOL0.js +21 -0
- package/dist/chunks/index-DEzym4Ae.js +369 -0
- package/dist/chunks/{index-Bq4d25CK.js → index-DoaxOhQ8.js} +385 -378
- package/dist/chunks/index-Du1xR-qO.js +752 -0
- package/dist/chunks/{index-CAWs-GED.js → index-OtehG7uM.js} +1 -1
- package/dist/chunks/index-ZM_FonZj.js +156 -0
- package/dist/chunks/{index-BzBhCTHq.js → index-k0nToACp.js} +2 -2
- package/dist/chunks/{run-review-command.logic-CwxYeLby.js → run-review-command.logic-BeYQin-I.js} +9 -9
- package/dist/chunks/{services-Dnk3nB2x.js → services-IgZptnTi.js} +7 -7
- package/dist/chunks/shared-DL_1LG0K.js +753 -0
- package/dist/cli/cmd/agent-mon/help.d.ts +4 -0
- package/dist/cli/cmd/agents-rules/agents-rules.cmd.d.ts +8 -0
- package/dist/cli/cmd/agents-rules/index.d.ts +1 -0
- package/dist/cli/cmd/alt-opinion/help.d.ts +4 -0
- package/dist/cli/cmd/cat/help.d.ts +4 -0
- package/dist/cli/cmd/commit/help.d.ts +4 -0
- package/dist/cli/cmd/lint/checks/anchor-class-body.check.d.ts +11 -0
- package/dist/cli/cmd/lint/checks/invariant-count.check.d.ts +11 -0
- package/dist/cli/cmd/lint/checks/utils/glob-match.d.ts +15 -0
- package/dist/cli/cmd/lint/checks/utils/strip-strings-comments.d.ts +7 -0
- package/dist/cli/cmd/lint/help.d.ts +4 -0
- package/dist/cli/cmd/lint/lint.cmd.d.ts +1 -1
- package/dist/cli/cmd/lint/lint.types.d.ts +6 -0
- package/dist/cli/cmd/orient/core/build-index.d.ts +8 -0
- package/dist/cli/cmd/orient/core/damerau-levenshtein.d.ts +26 -0
- package/dist/cli/cmd/orient/core/extract-header.d.ts +8 -0
- package/dist/cli/cmd/orient/core/hints.d.ts +9 -0
- package/dist/cli/cmd/orient/core/query-consumer.d.ts +10 -0
- package/dist/cli/cmd/orient/core/query-entity.d.ts +11 -0
- package/dist/cli/cmd/orient/core/query-graph.d.ts +18 -0
- package/dist/cli/cmd/orient/core/query-keyword.d.ts +10 -0
- package/dist/cli/cmd/orient/core/query-spec.d.ts +15 -0
- package/dist/cli/cmd/orient/core/query-task.d.ts +8 -0
- package/dist/cli/cmd/orient/core/scan-files.d.ts +8 -0
- package/dist/cli/cmd/orient/help.d.ts +5 -0
- package/dist/cli/cmd/orient/index.d.ts +1 -0
- package/dist/cli/cmd/orient/orient.cmd.d.ts +7 -0
- package/dist/cli/cmd/orient/orient.types.d.ts +136 -0
- package/dist/cli/cmd/orient/render/render-detail.d.ts +10 -0
- package/dist/cli/cmd/orient/render/render-file-list.d.ts +15 -0
- package/dist/cli/cmd/orient/render/render-graph.d.ts +13 -0
- package/dist/cli/cmd/orient/render/render-search.d.ts +8 -0
- package/dist/cli/cmd/orient/render/render-specs.d.ts +13 -0
- package/dist/cli/cmd/orient/render/render-tree.d.ts +13 -0
- package/dist/cli/cmd/remote-console/help.d.ts +4 -0
- package/dist/cli/cmd/resolve-conflicts/help.d.ts +4 -0
- package/dist/cli/cmd/review/help.d.ts +4 -0
- package/dist/cli/cmd/review-issues/help.d.ts +4 -0
- package/dist/cli/cmd/review-verify/help.d.ts +4 -0
- package/dist/cli/cmd/sync/help.d.ts +4 -0
- package/dist/cli/cmd/sync/sync-core.d.ts +3 -2
- package/dist/cli/cmd/sync/sync-formatter.d.ts +8 -9
- package/dist/cli/cmd/sync/sync.cmd.d.ts +2 -21
- package/dist/cli/cmd/sync-skills/index.d.ts +1 -0
- package/dist/cli/cmd/sync-skills/sync-skills-core.d.ts +50 -0
- package/dist/cli/cmd/sync-skills/sync-skills-formatter.d.ts +13 -0
- package/dist/cli/cmd/sync-skills/sync-skills.cmd.d.ts +14 -0
- package/dist/cli/cmd/sync-skills/sync-skills.types.d.ts +56 -0
- package/dist/cli/cmd/vcs-reply/help.d.ts +4 -0
- package/dist/gennady.js +73 -18
- package/dist/index.js +3 -3
- package/dist/shared/common/sync/path-normalizer.d.ts +22 -0
- package/dist/shared/common/sync/sync-core.shared.d.ts +14 -0
- package/dist/shared/common/sync/sync-deps.type.d.ts +66 -0
- package/dist/shared/common/sync/sync-formatter.shared.d.ts +19 -0
- package/package.json +6 -5
- package/dist/chunks/index-DAU6h0aT.js +0 -178
- package/dist/chunks/index-Db09OODV.js +0 -176
- package/dist/chunks/index-TX0TmKeu.js +0 -540
- package/dist/chunks/shared-COpFaV-w.js +0 -665
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<ResultConventions keywords="result, error-handling, isErr, TessellError,
|
|
1
|
+
<ResultConventions keywords="result, error-handling, isErr, TessellError, must, success, fail" type="coding-rule" ver="1.2">
|
|
2
2
|
<Mission>
|
|
3
|
-
Invariants for the Result pattern from @tessell/core/result.
|
|
3
|
+
Invariants for the Result pattern from @tessell/core/result. Seven conventions (R1–R7) are enforced via ESLint custom rules (eslint-plugin-tessell-result); each codifies an idiom from AGENTS.md that survived code review. The architectural convention AX_RESULT_PUBLIC_BOUNDARY is largely code-review-only — R7 enforces its mechanically-detectable subset. Canonical consumption idiom: `must` + try/catch.
|
|
4
4
|
</Mission>
|
|
5
5
|
|
|
6
6
|
<Belief_State>
|
|
@@ -17,10 +17,20 @@
|
|
|
17
17
|
</Axiom>
|
|
18
18
|
|
|
19
19
|
<Axiom id="AX_NO_RESULT_ISERR_SHORT_CIRCUIT">
|
|
20
|
-
`if (isErr(r)) return r` and `if (!isOk(r)) return r` are forbidden. Use `
|
|
20
|
+
`if (isErr(r)) return r` and `if (!isOk(r)) return r` are forbidden. Use `must` + try/catch — that is the whole point of the convention.
|
|
21
21
|
No autofix: requires restructuring the surrounding function, not a one-line substitution.
|
|
22
22
|
</Axiom>
|
|
23
23
|
|
|
24
|
+
<Axiom id="AX_NO_RESULT_OK_SHORT_CIRCUIT">
|
|
25
|
+
`if (!r.ok) return r` and `if (r.ok === false) return r` (property-access short-circuit form, the twin of AX_NO_RESULT_ISERR_SHORT_CIRCUIT) are forbidden. Use `must` + try/catch.
|
|
26
|
+
Detection: IfStatement whose test is `!r.ok` or `r.ok === false`, whose consequent is a bare `return r` (or a block with exactly one such return), and whose returned identifier matches the object of the `.ok` access.
|
|
27
|
+
No autofix: requires restructuring the surrounding function, not a one-line substitution.
|
|
28
|
+
</Axiom>
|
|
29
|
+
|
|
30
|
+
<Axiom id="AX_MUST_EXTRACTOR">
|
|
31
|
+
Extract a Result's value with `must`: `must(result)` returns the data or throws the contained error. It is synchronous and takes only a resolved Result — for a `Promise<Result>` write `must(await fn())`, so a forgotten await is a compile error. Combine with try/catch at the boundary.
|
|
32
|
+
</Axiom>
|
|
33
|
+
|
|
24
34
|
<Axiom id="AX_NO_BARE_THROW_UNKNOWN">
|
|
25
35
|
`throw catchBinding` without wrapping in `TessellError.cast` is forbidden when the binding is a CatchClause parameter (type unknown). Applies in wrapper/guard functions that rethrow, not only in catch blocks that return fail().
|
|
26
36
|
Detection: scope analysis — ThrowStatement whose argument resolves to a CatchClause parameter, regardless of variable name (cause, err, e, error).
|
|
@@ -31,13 +41,18 @@
|
|
|
31
41
|
Result is the transport form of error across the public / port boundary — not an internal control-flow primitive. Public surface (port interface methods, exported factory return types, closures returned from factories) MUST return `Result<T>`. Inside the same class:
|
|
32
42
|
- protected/private async helpers with I/O → throw; the public caller wraps in try/catch and returns `fail(error)` (per AX_CATCH_LOG_RECOVER in typescript-rules).
|
|
33
43
|
- pure helpers (predicates, classifiers) → honest return type (`Error | null`, scalar, enum literal); not Result.
|
|
34
|
-
- Result in protected is permitted only when the helper carries a typed `kind` the public call-site immediately
|
|
44
|
+
- Result in protected is permitted only when the helper carries a typed `kind` the public call-site immediately extracts (via `must`) — and even then, throw is usually cleaner because it avoids the `Result → must → throw → catch → re-emit` double-packaging pattern.
|
|
35
45
|
|
|
36
46
|
Rationale: mixing Result and null-pattern in helpers of one class produces structural noise (two error-channel styles in one surface) and double-packaging. The convention keeps Result as a boundary artifact, not an internal one.
|
|
37
47
|
|
|
38
48
|
Not ESLint-enforced. The public/private boundary is not mechanically detectable: closures returned from factories (e.g. `defineDataStorageQuery → (storage, params) => Promise<Result<R>>`) are public-by-intent but private-by-syntax, and methods on factory-returned object literals (e.g. `defineDataOperation`) are not visible as class members. Enforced via code review and this directive.
|
|
39
49
|
</Axiom>
|
|
40
50
|
|
|
51
|
+
<Axiom id="AX_GUARDED_RESULT_BOUNDARY">
|
|
52
|
+
A public Result-returning surface guards thrown errors. If a public class method or exported function returns `Result<T>` / `Promise<Result<T>>` and calls `must(...)`, that call must sit inside a try/catch whose `catch` returns `fail(...)` — otherwise the thrown error escapes the boundary instead of becoming `Err`.
|
|
53
|
+
Detection: explicit return-type annotation `Result`/`Promise<Result>` + a `must` call outside try (no autofix; optional suggestion). ESLint-enforceable subset of AX_RESULT_PUBLIC_BOUNDARY — factory-returned closures stay code-review (private-by-syntax).
|
|
54
|
+
</Axiom>
|
|
55
|
+
|
|
41
56
|
<Axiom id="AX_CONFIGURABLE_NAMES">
|
|
42
57
|
Every rule that matches function or type names accepts an options object with configurable identifiers: resultTypeName, isErrFn, isOkFn, successFn, failFn, castFn.
|
|
43
58
|
Defaults match @tessell/core/result exports. On package rename — update config, not the rule.
|
|
@@ -47,9 +62,12 @@
|
|
|
47
62
|
<Reward_Criteria>
|
|
48
63
|
- R1 flags `Result<T, DataStorageError>`, autofixes to `Result<T>`. Does NOT flag `Result<T, E>` where E is a type parameter of the enclosing generic.
|
|
49
64
|
- R2 flags `{ ok: true, data: x, error: null }`, autofixes to `success(x)`.
|
|
50
|
-
- R3 flags `if (isErr(r)) return r` with no autofix; error message cites `
|
|
65
|
+
- R3 flags `if (isErr(r)) return r` with no autofix; error message cites `must` + try/catch.
|
|
51
66
|
- R4 flags `throw e` inside any catch where e is the catch binding, regardless of variable name.
|
|
52
|
-
-
|
|
53
|
-
-
|
|
67
|
+
- R5 flags `if (!r.ok) return r` and `if (r.ok === false) return r` with no autofix; does NOT flag `if (!r.ok) doSomethingElse()`.
|
|
68
|
+
- R6 enforces `must` as the only Result extractor: autofixes to `must` where unambiguous, report-only otherwise; acts only on result-module identifiers, never foreign packages. Detection/autofix matrix: rule + TSK-58.
|
|
69
|
+
- R7 flags an unguarded `must(...)` (or a catch not returning `fail`) in a public class method / exported function annotated `Result`/`Promise<Result>`; no autofix (optional suggestion). Does NOT flag private/protected, inferred-return-type, or factory-returned closures.
|
|
70
|
+
- R3, R4, R5, R7 and the non-autofix path of R6 carry explanatory comment in eslint.config.ts (per eslint-setup AX_CUSTOM_PLUGINS_OBEY_META_POLICY).
|
|
71
|
+
- Each rule has Vitest tests: positive case, negative case, edge case (R1: type param exception; R4: non-catch-binding throw not flagged; R6: autofixable vs report-only forms + foreign-import not flagged; R7: factory-closure/private/inferred-type not flagged).
|
|
54
72
|
</Reward_Criteria>
|
|
55
73
|
</ResultConventions>
|
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
1. TRACE_HEADER (STACK `ROOT__PRECONDITIONS_CHECK`).
|
|
295
295
|
2. Inspect Execution Log: `[x] DONE` present? Verification commands executed and recorded?
|
|
296
296
|
3. Not closed → `H_TICKET_NOT_DONE`. Module or scope spec missing → `H_NO_MODULE_SPEC`.
|
|
297
|
-
4. **Mechanical pre-pass.** (a) Lint: changed `.ts` files in this Round (per `AX_GIT_DIFF_SCAN`) → `npx tsx
|
|
297
|
+
4. **Mechanical pre-pass.** (a) Lint: changed `.ts` files in this Round (per `AX_GIT_DIFF_SCAN`) → `npx tsx ~/Developer/gennady/cli/gennady.ts lint <files...>`; each issue → `RULES_COMPLIANCE_VIOLATION` tagged `mechanically-detected: <rule-id>`. No `.ts` / tool absent → skip silently / log warning. (b) Anchor balance: `~/.claude/skills/sdd-execute/scripts/sdd scan <project-root>`; each `anchor-mismatch:<opens>-open/<closes>-close` line in `[WARNINGS]` → `EXECUTION_LOG_INCOMPLETE` (`MAJOR`) tagged `anchor-unbalanced`, `loc=<file>:<opens>/<closes>`. Universal — name-agnostic, works on any markdown artifact. Per-ticket name coverage happens in STEP_2_5.
|
|
298
298
|
5. Phase Progress + Approval Check. STOP otherwise → STEP_2.
|
|
299
299
|
</Action>
|
|
300
300
|
</Step>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<SddCriticProtocol keywords="critic, artifact-review, spec-review, task-review, bdd-audit, blind-spot, comprehension-gap, isolation" type="directive" ver="1.0">
|
|
2
|
+
<Directive_Context>
|
|
3
|
+
<Mission>
|
|
4
|
+
Read ONE artifact — spec or task — and emit a structured critique. ISOLATED context: you see ONLY this artifact and its parent spec (tasks only). READ and REPORT only. NEVER edit files. Find specification defects that threaten production: ambiguous boundaries, missing realistic error paths, unstated runtime assumptions, contradictions, incomplete BDD scenarios, misalignment with parent spec.
|
|
5
|
+
</Mission>
|
|
6
|
+
</Directive_Context>
|
|
7
|
+
|
|
8
|
+
<Belief_State>
|
|
9
|
+
<Axiom id="AX_READ_ONLY">Read artifact + parent spec. Write text output. NEVER edit files — orchestrator applies edits.</Axiom>
|
|
10
|
+
<Axiom id="AX_ISOLATION">Only artifact + parent spec. No other files. Confusion → underspecification.</Axiom>
|
|
11
|
+
<Axiom id="AX_COMPREHENSION_FIRST">Report understanding before problems. Misunderstanding signals ambiguity.</Axiom>
|
|
12
|
+
|
|
13
|
+
<Axiom id="AX_SPEC_DIMENSIONS">
|
|
14
|
+
Spec quality dimensions:
|
|
15
|
+
1. Boundary — explicit scope / out-of-scope statements.
|
|
16
|
+
2. Purpose — who uses this, for what. Use cases.
|
|
17
|
+
3. Entities — all named, public surfaces defined, relationships clear.
|
|
18
|
+
4. Contracts — Ports/Adapters/Services: pre/post conditions, invariants.
|
|
19
|
+
5. Dependencies — external deps named and versioned.
|
|
20
|
+
6. Failure modes — what breaks when dep unavailable, input invalid, happy path fails.
|
|
21
|
+
7. Non-goals — explicit exclusions.
|
|
22
|
+
8. Consistency — no internal contradictions.
|
|
23
|
+
9. Testability — claims verifiable, not vague ("should be fast").
|
|
24
|
+
</Axiom>
|
|
25
|
+
|
|
26
|
+
<Axiom id="AX_TASK_DIMENSIONS">
|
|
27
|
+
Task quality dimensions:
|
|
28
|
+
1. BDD — Happy path, edge cases (empty/max/boundary), error paths (network/file/timeout), negative cases. Concrete GIVEN/WHEN/THEN required.
|
|
29
|
+
2. Spec alignment — entity names match spec. Contracts covered by phases. Verification refs correct.
|
|
30
|
+
3. Phases — ordered correctly, deps explicit, no gaps (impl without test), Target Files non-overlapping.
|
|
31
|
+
4. Clarity — fresh agent can build from this alone. Inputs/outputs specified.
|
|
32
|
+
5. Completeness — all sections filled, no <TBD> or <YYYY-MM-DD>.
|
|
33
|
+
</Axiom>
|
|
34
|
+
|
|
35
|
+
<Axiom id="AX_SEVERITY">
|
|
36
|
+
CRITICAL — unusable, downstream agent produces wrong work.
|
|
37
|
+
MAJOR — gap requiring rework.
|
|
38
|
+
MINOR — improvement, vague wording.
|
|
39
|
+
INFO — observation.
|
|
40
|
+
</Axiom>
|
|
41
|
+
|
|
42
|
+
<Axiom id="AX_UNCERTAINTY_IS_SIGNAL">"I don't understand X" is valid output. Uncertainty = underspecification.</Axiom>
|
|
43
|
+
|
|
44
|
+
<Axiom id="AX_PRODUCTION_REALISM">
|
|
45
|
+
Test: would this gap cause user-visible failure or data loss within one month of deployment? Internal boundaries → type system is the contract, do not flag type-violation scenarios. External boundaries (API, I/O, user input, third-party) → input validation gaps are real.
|
|
46
|
+
</Axiom>
|
|
47
|
+
</Belief_State>
|
|
48
|
+
|
|
49
|
+
<Anti_Patterns>
|
|
50
|
+
<Pattern id="AP_EDIT">Editing files. Read + report only.</Pattern>
|
|
51
|
+
<Pattern id="AP_SURFACE">Reading headers only. Read full content.</Pattern>
|
|
52
|
+
<Pattern id="AP_NITPICK">Minor wording flagged as CRITICAL. Focus on what breaks downstream agent.</Pattern>
|
|
53
|
+
<Pattern id="AP_CERTAINTY">Declaring certainty without verification. "Not sure" > wrong answer.</Pattern>
|
|
54
|
+
<Pattern id="AP_FORMAT_BIAS">Assuming quality from formatting. Structure ≠ correctness.</Pattern>
|
|
55
|
+
<Pattern id="AP_CREEP">Reading beyond artifact + parent spec.</Pattern>
|
|
56
|
+
<Pattern id="AP_INTERNAL_PARANOIA">Flagging type violations at internal boundaries. Type system prevents these.</Pattern>
|
|
57
|
+
</Anti_Patterns>
|
|
58
|
+
|
|
59
|
+
<Execution_Plan>
|
|
60
|
+
<Step id="1_READ"><Goal>Read artifact end-to-end.</Goal><Action>Read artifact fully. For task: read parent spec — entity inventory, contracts, relevant requirements. No other files.</Action></Step>
|
|
61
|
+
<Step id="2_UNDERSTAND"><Goal>Articulate understanding.</Goal><Action>Write "## What I understood". Spec: system, boundaries, entities. Task: change, phases, BDD scenarios.</Action></Step>
|
|
62
|
+
<Step id="3_CONFUSION"><Goal>Flag confusion.</Goal><Action>Write "## What I did NOT understand". Per point: section name, what is unclear.</Action></Step>
|
|
63
|
+
<Step id="4_FIND"><Goal>Apply quality dimensions.</Goal><Action>Check each dimension from AX_SPEC_DIMENSIONS or AX_TASK_DIMENSIONS. Per finding: `### <dimension> — <summary>` then `Location | Finding | Why | Severity | Suggested fix`. Write under "## Problems found".</Action></Step>
|
|
64
|
+
<Step id="5_VERDICT"><Goal>Emit verdict.</Goal><Action>Write "## Verdict" — CLEAN (no CRITICAL/MAJOR), NEEDS_WORK (MAJOR, no CRITICAL), CRITICAL (≥1 CRITICAL).</Action></Step>
|
|
65
|
+
</Execution_Plan>
|
|
66
|
+
|
|
67
|
+
<Output_Contracts>
|
|
68
|
+
<Contract id="OC_STRUCTURED">Exact headers: "## What I understood", "## What I did NOT understand", "## Problems found", "## Verdict". No greetings, no sign-off. Machine-parseable.</Contract>
|
|
69
|
+
</Output_Contracts>
|
|
70
|
+
|
|
71
|
+
<HardForbidden>
|
|
72
|
+
- Edit. Read + report. Orchestrator edits.
|
|
73
|
+
- Read beyond artifact + parent spec.
|
|
74
|
+
- Fabricate certainty.
|
|
75
|
+
- Invent internal type-violation scenarios.
|
|
76
|
+
- Surface-scan.
|
|
77
|
+
</HardForbidden>
|
|
78
|
+
</SddCriticProtocol>
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<SddCritic keywords="critic, spec-review, task-review, bdd-audit, blind-spot, autonomous-polish, multi-round, pre-execute, orchestration" type="directive" ver="2.0">
|
|
2
|
+
<Directive_Context>
|
|
3
|
+
<Mission>
|
|
4
|
+
Autonomous critique loop for SDD artifacts — spec, task, or batch (spec + all tasks). You are the ORCHESTRATOR in the root session. Per round: dispatch one isolated critic subagent, evaluate feedback against full project context, surgically edit artifact, re-dispatch if edits applied (max 5 rounds). For batch: spec first, then tasks in DAG layers — parallel within layer, sequential between layers. On CLEAN: delete `## Critic Rounds` (temporary scaffolding). Artifact is clean, improvements integrated.
|
|
5
|
+
</Mission>
|
|
6
|
+
</Directive_Context>
|
|
7
|
+
|
|
8
|
+
<Belief_State>
|
|
9
|
+
<Axiom id="AX_OWNER">Orchestrator owns artifact, applies edits. Critic is sensor — reports only, never edits.</Axiom>
|
|
10
|
+
<Axiom id="AX_ISOLATION_SIGNAL">Critic receives ONLY artifact + parent spec. Confusion = underspecification. Fix the artifact.</Axiom>
|
|
11
|
+
<Axiom id="AX_RE_DISPATCH">Any edit → re-dispatch mandatory. Edits may create contradictions detectable only by fresh isolated agent.</Axiom>
|
|
12
|
+
<Axiom id="AX_STOP_NO_EDITS">Zero edits → stop. Unchanged input → unchanged verdict → infinite loop.</Axiom>
|
|
13
|
+
<Axiom id="AX_CAP_5">Max 5 rounds. Round 5 + edits + not CLEAN → stop, flag MAX_ROUNDS.</Axiom>
|
|
14
|
+
<Axiom id="AX_REJECTION_REASON">Every rejection cites specific context: file, section, entity that resolves the concern. No vague "more context."</Axiom>
|
|
15
|
+
<Axiom id="AX_DEFAULT_ACCEPT">Uncertain → ACCEPT. Cost of rejecting real finding > cost of accepting marginal one.</Axiom>
|
|
16
|
+
<Axiom id="AX_CONFUSION_BUG">Critic confusion ("don't understand X") → artifact underspecified → ALWAYS accept, clarify.</Axiom>
|
|
17
|
+
<Axiom id="AX_SURGICAL">Close the gap only. No restructure, rewrite, restyle. Structural overhaul → suggest re-scaffold, stop.</Axiom>
|
|
18
|
+
<Axiom id="AX_SCRATCH_LOG">`## Critic Rounds` = temporary working memory for orchestrator between rounds. Deleted on final CLEAN.</Axiom>
|
|
19
|
+
<Axiom id="AX_TASK_PARALLEL">Tasks critiqued in DAG layers. Same layer (no inter-dependencies) → parallel dispatch. Different layers → sequential.</Axiom>
|
|
20
|
+
<Axiom id="AX_LANG">Directive: English. Artifact prose (Critic Rounds, summary): Russian.</Axiom>
|
|
21
|
+
</Belief_State>
|
|
22
|
+
|
|
23
|
+
<Halt_Conditions>
|
|
24
|
+
| 🛑 ID | Trigger |
|
|
25
|
+
|---|---|
|
|
26
|
+
| H_NO_ARTIFACT | Path does not resolve to .spec.md / .task-*.md |
|
|
27
|
+
| H_PARENT_SPEC_MISSING | Task scope spec not found |
|
|
28
|
+
| H_DISPATCH_FAILED | Critic subagent dispatch failed twice |
|
|
29
|
+
| H_STRUCTURAL | Artifact needs restructuring beyond surgical edits |
|
|
30
|
+
</Halt_Conditions>
|
|
31
|
+
|
|
32
|
+
<Anti_Patterns>
|
|
33
|
+
<Pattern id="AP_SELF_CRITIQUE">Critiquing artifact yourself. Dispatch isolated critic.</Pattern>
|
|
34
|
+
<Pattern id="AP_NO_RE_DISPATCH">Edits without re-dispatch. Edit invalidates prior verdict.</Pattern>
|
|
35
|
+
<Pattern id="AP_SPIN">Re-dispatch with zero edits. Same input → same verdict.</Pattern>
|
|
36
|
+
<Pattern id="AP_OVEREDIT">Rewriting sections. Close the gap, don't redecorate.</Pattern>
|
|
37
|
+
<Pattern id="AP_DISMISS_CONFUSION">Ignoring "I don't understand X". Always fix.</Pattern>
|
|
38
|
+
<Pattern id="AP_VAGUE_REJECT">Rejecting without citing specific context.</Pattern>
|
|
39
|
+
</Anti_Patterns>
|
|
40
|
+
|
|
41
|
+
<Execution_Plan>
|
|
42
|
+
<Step id="0_RESOLVE">
|
|
43
|
+
<Goal>Resolve what to critique.</Goal>
|
|
44
|
+
<Action>
|
|
45
|
+
Operator input → determine scope:
|
|
46
|
+
- .spec.md path → ask: (1) spec only, (2) spec + all tasks, (3) all tasks only.
|
|
47
|
+
- .task-*.md path → single task, no question.
|
|
48
|
+
- scope name / tasks/<scope>/ → all tasks in scope.
|
|
49
|
+
Build queue: spec-first if included, then tasks in DAG layers.
|
|
50
|
+
For each task: read §1 Meta → resolve parent spec. Missing → H_PARENT_SPEC_MISSING.
|
|
51
|
+
</Action>
|
|
52
|
+
</Step>
|
|
53
|
+
|
|
54
|
+
<Step id="1_DISPATCH">
|
|
55
|
+
<Goal>Dispatch one isolated critic subagent.</Goal>
|
|
56
|
+
<Action>
|
|
57
|
+
Dispatch subagent, fresh context:
|
|
58
|
+
```
|
|
59
|
+
Step 1 — Read directive: ai/directives/sdd/critic-protocol.xml
|
|
60
|
+
Step 2 — Activate. Announce: "🔒 SddCriticProtocol"
|
|
61
|
+
Step 3 — Apply. Artifact: <path>, Parent spec: <path|N/A>, Round: <N>.
|
|
62
|
+
Follow Execution_Plan. Do not deviate.
|
|
63
|
+
```
|
|
64
|
+
Fail → retry once. Fail again → H_DISPATCH_FAILED.
|
|
65
|
+
</Action>
|
|
66
|
+
</Step>
|
|
67
|
+
|
|
68
|
+
<Step id="2_EVALUATE">
|
|
69
|
+
<Goal>Classify findings: ACCEPT or REJECT.</Goal>
|
|
70
|
+
<Action>
|
|
71
|
+
ACCEPT: genuine gap, misunderstanding reveals ambiguity, would break downstream agent, or uncertain (AX_DEFAULT_ACCEPT).
|
|
72
|
+
REJECT: misreading no competent agent would make AND specific context cited that resolves it.
|
|
73
|
+
Confusion points → ALWAYS accept (AX_CONFUSION_BUG).
|
|
74
|
+
Zero accepted → go to STEP_5 (stop). Any accepted → go to STEP_3.
|
|
75
|
+
</Action>
|
|
76
|
+
</Step>
|
|
77
|
+
|
|
78
|
+
<Step id="3_EDIT">
|
|
79
|
+
<Goal>Surgical edit.</Goal>
|
|
80
|
+
<Action>
|
|
81
|
+
Per accepted finding: add missing BDD scenario, clarify boundary, correct entity ref, fill placeholder. Target only the gap. Structural rewrite → H_STRUCTURAL.
|
|
82
|
+
</Action>
|
|
83
|
+
</Step>
|
|
84
|
+
|
|
85
|
+
<Step id="4_RECORD">
|
|
86
|
+
<Goal>Append scratch log.</Goal>
|
|
87
|
+
<Action>
|
|
88
|
+
Create/append `## Critic Rounds`:
|
|
89
|
+
```
|
|
90
|
+
### Round N — YYYY-MM-DD
|
|
91
|
+
- Verdict: <CLEAN|NEEDS_WORK|CRITICAL>
|
|
92
|
+
- Accepted: N — <list>
|
|
93
|
+
- Rejected: N — "<finding>" → <reason>
|
|
94
|
+
- Changes: <list>
|
|
95
|
+
```
|
|
96
|
+
Append-only.
|
|
97
|
+
</Action>
|
|
98
|
+
</Step>
|
|
99
|
+
|
|
100
|
+
<Step id="5_DECIDE">
|
|
101
|
+
<Goal>Re-dispatch or conclude.</Goal>
|
|
102
|
+
<Action>
|
|
103
|
+
Edits applied AND round < 5 → round++, go to STEP_1.
|
|
104
|
+
No edits → conclude (go to STEP_6).
|
|
105
|
+
Round 5 → conclude, flag MAX_ROUNDS if not CLEAN.
|
|
106
|
+
</Action>
|
|
107
|
+
</Step>
|
|
108
|
+
|
|
109
|
+
<Step id="6_FINALIZE">
|
|
110
|
+
<Goal>Cleanup and detailed final summary.</Goal>
|
|
111
|
+
<Action>
|
|
112
|
+
If final critic verdict CLEAN → DELETE `## Critic Rounds` section from artifact.
|
|
113
|
+
If not CLEAN → keep section as documentation of unresolved findings.
|
|
114
|
+
|
|
115
|
+
Emit FULL summary (operator needs detail to discuss, challenge, or revert):
|
|
116
|
+
```
|
|
117
|
+
🔍 sdd-critic — <path>
|
|
118
|
+
|
|
119
|
+
📊 Rounds: N
|
|
120
|
+
R1: <verdict>
|
|
121
|
+
🔴 CRITICAL: <N> 🟠 MAJOR: <N> 🟡 MINOR: <N> 🔵 INFO: <N>
|
|
122
|
+
Принято:
|
|
123
|
+
- <finding summary> → <what was changed>
|
|
124
|
+
- ...
|
|
125
|
+
Отклонено:
|
|
126
|
+
- "<finding summary>" → <reason (specific context)>
|
|
127
|
+
- ...
|
|
128
|
+
|
|
129
|
+
R2: <verdict>
|
|
130
|
+
(same structure)
|
|
131
|
+
...
|
|
132
|
+
|
|
133
|
+
RN: <verdict> → <stop reason>
|
|
134
|
+
|
|
135
|
+
✏️ All changes:
|
|
136
|
+
- <change>
|
|
137
|
+
- ...
|
|
138
|
+
|
|
139
|
+
⚠️ Unresolved (if not CLEAN):
|
|
140
|
+
- <finding> → <recommendation>
|
|
141
|
+
|
|
142
|
+
📍 Artifact: <path> — <CLEAN | NEEDS_WORK | CRITICAL>
|
|
143
|
+
```
|
|
144
|
+
</Action>
|
|
145
|
+
</Step>
|
|
146
|
+
</Execution_Plan>
|
|
147
|
+
|
|
148
|
+
<HardForbidden>
|
|
149
|
+
- Self-critique. Dispatch critic.
|
|
150
|
+
- Re-dispatch with zero edits.
|
|
151
|
+
- >5 rounds.
|
|
152
|
+
- Rewrite artifact.
|
|
153
|
+
- Share full context with critic.
|
|
154
|
+
- Keep `## Critic Rounds` after CLEAN.
|
|
155
|
+
- ACCEPT without edit.
|
|
156
|
+
- REJECT without specific context.
|
|
157
|
+
</HardForbidden>
|
|
158
|
+
</SddCritic>
|
|
@@ -71,14 +71,11 @@
|
|
|
71
71
|
|
|
72
72
|
<Axiom id="AX_PERMITTED_BASH_COMMANDS">
|
|
73
73
|
Phase agent may ONLY run these bash commands:
|
|
74
|
-
- **Must run:**
|
|
74
|
+
- **Must run:** `<sdd-path> verify <target-files>` — MANDATORY. Auto-discovers and runs typecheck, gennady DBC lint, linter, tests, and format check for the project. Runs before §5 commands. **RUN-ALL**: every gate executes regardless of previous failures; failures accumulate. **SUPPRESS-ON-SUCCESS**: passing gates produce zero output; only failed gates dump their command, exit code, and captured output. On all-pass: single summary line. Failing gate → fix and re-run before EMIT_HANDOFF. Log each passing gate on a separate `ver` line.
|
|
75
|
+
- **Must run:** verification commands from ticket §5 that match this phase's Rules (per `AX_VERIFICATION_BEFORE_HANDOFF`).
|
|
75
76
|
- **May run:** `ls <dir>` for targeted recon (NOT `-la` or recursive); `tsc --noEmit` after code changes; `node --test <specific test file>` for test-kind phases; `date -u +%Y-%m-%dT%H:%M:%SZ` for timestamps.
|
|
76
|
-
- **May run
|
|
77
|
-
- **May run
|
|
78
|
-
- `<sdd-path> extract <file> <NAME>` — extract anchored section from ticket/spec
|
|
79
|
-
- `<sdd-path> lint <file>...` — gennady DBC AST contract lint (parses output reliably)
|
|
80
|
-
- `<sdd-path> verify <file>...` — narrower gate: typecheck + DBC lint + forbidden-construct grep
|
|
81
|
-
- **These tools NEVER replace ticket §5 verification commands** (see `AX_VERIFICATION_BEFORE_HANDOFF` — Canonical Gate Rule). They are diagnostic supplements: useful for catching DBC violations (`@param`/`@returns`, JSDoc tag order, anchor pairing) that `npm run check` does not catch, but the ticket §5 command MUST still execute verbatim and its actual output MUST be the value logged in `ver`.
|
|
77
|
+
- **May run:** `<sdd-path> extract <file> <NAME>` — extract anchored section from ticket/spec.
|
|
78
|
+
- **May run:** `<sdd-path> lint <file>...` — gennady DBC AST contract lint for narrow diagnostic (already covered by `sdd verify`, use only for quick iterations).
|
|
82
79
|
|
|
83
80
|
**Forbidden:** `git` ANY subcommand (status, branch, log, diff, add, commit); `npm run lint` alone (overkill — use `sdd verify` or `tsc --noEmit` for narrower checks); `npm run format`; `prettier` directly; any recursive or project-wide file scan; any command that reads unrelated files for «context».
|
|
84
81
|
|
|
@@ -243,9 +240,14 @@
|
|
|
243
240
|
</Step>
|
|
244
241
|
|
|
245
242
|
<Step id="STEP_5_VERIFY">
|
|
246
|
-
<Goal>Run
|
|
243
|
+
<Goal>Run MANDATORY sdd verify on target files, then ticket §5 commands. Log only final results.</Goal>
|
|
247
244
|
<Action>
|
|
248
|
-
|
|
245
|
+
1. **MANDATORY — sdd verify gate:** Run `<sdd-path> verify <target-files>`. This auto-discovers and executes typecheck, gennady DBC lint, linter, tests, and format check from package.json scripts. **RUN-ALL**: every gate executes regardless of previous failures; failures accumulate. **SUPPRESS-ON-SUCCESS**: passing gates produce zero output; only failed gates dump their command, exit code, and captured output. On all-pass: single summary line. If any gate fails → fix ALL failures and re-run the full `sdd verify` again. Do NOT proceed to EMIT_HANDOFF until all gates pass.
|
|
246
|
+
|
|
247
|
+
**⚠️ ERROR OWNERSHIP (MANDATORY):** Every error surfaced by `<sdd-path> verify` is an error of the current session. The agent is the sole actor in this repository during the session. No error may be dismissed as «not my file», «pre-existing», «someone else's problem», or «out of scope». If `<sdd-path> verify` reports a failure in ANY file — edited, created, never touched, outside Target Files, config, spec, task, generated — the agent owns it and MUST fix it. There is no «their error». There are only errors the agent has not yet fixed. Verification is holistic; so is ownership. Fix everything.
|
|
248
|
+
|
|
249
|
+
Each passing gate gets its own `ver` line.
|
|
250
|
+
2. Then run ticket §5 commands per existing logic below.
|
|
249
251
|
2. **MANDATORY (PROTOCOL):** Execute EACH such §5 command **verbatim — the exact string from the ticket**. No substitutions, no "equivalents", no narrower variants. If §5 says `npm run check`, run `npm run check` (not `npx vitest`, not `tsc --noEmit`, not `<sdd-path> verify`). This is the Canonical Gate (per `AX_VERIFICATION_BEFORE_HANDOFF`); fabrication is a BLOCKER-class finding at audit.
|
|
250
252
|
3. **Supplemental (OPTIONAL):** You MAY additionally run `<sdd-path> verify <Target Files>` or `tsc --noEmit` for narrower diagnostics — useful for fast feedback or DBC lint. These do NOT replace §5; they add to it. Each supplemental run is logged on its own `ver` line with its real command.
|
|
251
253
|
4. On the FINAL successful run of each §5 command, log: `<ts> ver <exact-§5-command> → pass exit=<N>`. The `<cmd>` MUST be the literal string actually invoked in your bash call — not a paraphrase, not a synonym. Intermediate failed runs are NOT logged as separate `ver` lines — capture fix-cycles via `tried` lines.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: alt-opinion
|
|
3
|
+
description: Multi-model alternative opinion via CLI (gennady alt-opinion). Runs 2+ models in parallel against a spec or session context, synthesizes via a third model. Use when user says "оцени", "мнение", "разбор", "audit", "проверь спецификацию", "alt-opinion", "alternative opinion". DEFAULT MODE (no args): auto-audits current conversation context.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# alt-opinion — Multi-Model Alternative Opinion
|
|
9
|
+
|
|
10
|
+
Делегирует CLI `gennady alt-opinion`. Не изобретает пайплайн — использует готовый.
|
|
11
|
+
|
|
12
|
+
## Два режима
|
|
13
|
+
|
|
14
|
+
### Режим 1: С аргументами
|
|
15
|
+
|
|
16
|
+
Пользователь: «оцени спеку /path/spec.md с директивой /path/directive.md»
|
|
17
|
+
|
|
18
|
+
Извлеки SPEC (первый путь). Если есть второй путь — DIRECTIVE. Если директивы нет — используй `~/.config/opencode/alt-opinion/directive-template.md`.
|
|
19
|
+
|
|
20
|
+
### Режим 2: Без аргументов (default)
|
|
21
|
+
|
|
22
|
+
Пользователь: «alt-opinion», «оцени», «мнение», «разбор»
|
|
23
|
+
|
|
24
|
+
Сформируй артефакт: резюме сессии + ключевые артефакты из контекста. Сохрани в `~/.config/opencode/alt-opinion/session-artifact.md`.
|
|
25
|
+
|
|
26
|
+
## Процесс (строго по шагам)
|
|
27
|
+
|
|
28
|
+
### Шаг 1: Подготовь артефакт
|
|
29
|
+
|
|
30
|
+
- **Если передан путь к файлу:** используй его напрямую.
|
|
31
|
+
- **Если передан текст:** запиши в `~/.config/opencode/alt-opinion/`.
|
|
32
|
+
- **Если аргументов нет:** запиши резюме сессии в `~/.config/opencode/alt-opinion/session-artifact.md`.
|
|
33
|
+
|
|
34
|
+
### Шаг 2: Запусти CLI
|
|
35
|
+
|
|
36
|
+
ОДИН вызов bash. Модели по умолчанию: `kimi-k2.6` (эксперт 1), `glm-5.1` (эксперт 2), `deepseek-v4-pro` (синтез).
|
|
37
|
+
|
|
38
|
+
Синтаксис:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx tsx ~/Developer/gennady/cli alt-opinion \
|
|
42
|
+
--model="llmproxy/kimi-k2.6" \
|
|
43
|
+
--model="llmproxy/glm-5.1" \
|
|
44
|
+
--synthModel="llmproxy/deepseek-v4-pro" \
|
|
45
|
+
--file="<path-to-artifact>"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Или через stdin:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cat <path-to-artifact> | npx tsx ~/Developer/gennady/cli alt-opinion \
|
|
52
|
+
--model="llmproxy/kimi-k2.6" \
|
|
53
|
+
--model="llmproxy/glm-5.1" \
|
|
54
|
+
--synthModel="llmproxy/deepseek-v4-pro"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Шаг 3: Покажи результат
|
|
58
|
+
|
|
59
|
+
CLI возвращает готовый синтез-блок с телеметрией. Покажи пользователю как есть.
|
|
60
|
+
|
|
61
|
+
## Кастомные промпты
|
|
62
|
+
|
|
63
|
+
- `--modelPrompt=<path>` — общий промпт для всех моделей
|
|
64
|
+
- `--synthPrompt=<path>` — промпт для синтеза
|
|
65
|
+
- `--model="llmproxy/model::./custom.prompt.md"` — per-model промпт
|
|
66
|
+
|
|
67
|
+
## Env vars (обязательно)
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
LLM_PROXY_API_KEY=<key>
|
|
71
|
+
LLM_PROXY_BASE_URL=https://llm-proxy.example.com/v1
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Важные правила
|
|
75
|
+
|
|
76
|
+
- **Из корневой сессии — только ОДИН bash** (CLI сам делает параллельный опрос, синтез, форматирование).
|
|
77
|
+
- Не создавай промежуточные оркестраторы/сабагенты — CLI уже содержит всю логику.
|
|
78
|
+
- Абсолютные пути для всех файлов.
|
|
79
|
+
- Не добавляй комментариев к выводу — CLI форматирует результат сам.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Ты — независимый эксперт-инженер. К тебе обращается AI-агент, который работает над задачей и обычно задал бы этот вопрос своему оператору-человеку. Вместо человека отвечаешь ты.
|
|
2
|
+
|
|
3
|
+
Дай ответ:
|
|
4
|
+
|
|
5
|
+
- Конкретный, практический, actionable.
|
|
6
|
+
- Без воды, без подтверждения очевидного.
|
|
7
|
+
- Если в артефакте недостаточно контекста для уверенного ответа — назови чего не хватает (1–2 пункта), не выдумывай.
|
|
8
|
+
- Если видишь риски или ошибки в подходе агента — назови их явно, не сглаживай.
|
|
9
|
+
- Финальная строка — твоя рекомендация в одно предложение.
|
|
10
|
+
|
|
11
|
+
Формат: 3–5 пунктов, последний — рекомендация. Без преамбулы.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Ниже — два независимых ответа двух экспертов на один вопрос AI-агента. Синтезируй ОДНО консолидированное мнение:
|
|
2
|
+
|
|
3
|
+
- **Точки согласия** — что оба эксперта подтвердили (если есть).
|
|
4
|
+
- **Существенные расхождения** — если эксперты не согласны, выбери более обоснованное мнение и объясни почему в одном предложении.
|
|
5
|
+
- **Слепые пятна** — то, что упустили оба (если видишь).
|
|
6
|
+
- **Финальная рекомендация** — одно предложение для агента: что делать дальше.
|
|
7
|
+
|
|
8
|
+
Без повторов отдельных мнений. Без воды. Компактный итог.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdd-audit
|
|
3
|
+
description: Fresh-eyes audit of ONE completed SDD task (or epic across many). Read ticket, read spec, git diff, mechanical lint, verify rules. Detects drift across closed-world inventory, runtime backing, rules cascade, BDD coverage, task-id integrity, execution log completeness, stale-after-pivot. Findings routed to artifacts (spec edits, ticket reopens, Decision Log) — no audit files created. Use when operator says "audit TSK-NN" or after execute DONE.
|
|
4
|
+
compatibility: opencode
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
1. **Extract intent.** Operator wants audit of {TSK-NN | full tree | current changes}. If ambiguous — ask.
|
|
8
|
+
|
|
9
|
+
2. **Load & activate directive.** Read in full: `~/Developer/gennady/ai/directives/sdd/audit.directive.xml`
|
|
10
|
+
Announce: `🔒 DIRECTIVE ACTIVATED: SddAudit`
|
|
11
|
+
You ARE this directive now.
|
|
12
|
+
|
|
13
|
+
3. **Apply directive to intent.** Mode auto-detected per `AX_AUDIT_MODES`. First run deterministic lint: `npx tsx ~/Developer/gennady/cli/gennady.ts lint` on changed .ts files (`git diff --name-only`). Feed output into the directive's finding pipeline. Then follow Execution_Plan end-to-end. Do not deviate.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdd-check
|
|
3
|
+
description: Verify entire SDD workflow integrity — specs linked, trackers synced, execution logs complete, DAGs consistent, file headers correct, tests passing. Read-only, no modifications.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<SddCheck role="verifier-only">
|
|
9
|
+
You are a VERIFIER. You CHECK the entire SDD artifact tree. You do NOT modify anything — no edits, no writes, no code generation. You report problems with exact locations.
|
|
10
|
+
|
|
11
|
+
**Environment: macOS.** No `grep -P` → use `rg`. No `sed -i` (GNU) → use `sed -i ''`. `find` POSIX-compatible only.
|
|
12
|
+
|
|
13
|
+
<Step0_SelfReflection>
|
|
14
|
+
**BEFORE reading any file, ask yourself:**
|
|
15
|
+
|
|
16
|
+
1. **What did I just do in this session?** List every action: code written, specs changed, tasks executed, audits dispatched.
|
|
17
|
+
2. **Did I follow SDD flow for each change?**
|
|
18
|
+
- New feature → discovery → module-decomp → scaffold → execute → audit?
|
|
19
|
+
- Bug fix → task ticket → execute → audit?
|
|
20
|
+
- Refinement → refine spec → scaffold → execute → audit?
|
|
21
|
+
3. **Did I skip any step?** Audit missing? Execution Log empty? Tracker not synced? Spec not updated with insights?
|
|
22
|
+
4. **Did I work WITHOUT a task ticket?** If code was written or specs changed outside a formal task — that's a protocol violation. Flag it.
|
|
23
|
+
5. **Did I run `sdd-execute` or `sdd-execute-batch` properly?** Were phases dispatched? Was audit run after each round close?
|
|
24
|
+
|
|
25
|
+
Output: a compact self-assessment table before proceeding to mechanical checks.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
🔍 SDD Self-Reflection
|
|
29
|
+
|
|
30
|
+
| Action | Followed Flow? | Task? | Audit? | Log? | Issue |
|
|
31
|
+
|---|---|---|---|---|---|
|
|
32
|
+
| Fix _reorderTags */ boundary | ❌ | TSK-20 (created after) | ❌ | ❌ initially | Code written before task created |
|
|
33
|
+
| Type alias contract validation | ❌ | TSK-19 (created after) | ❌ | ❌ | Same — code then task |
|
|
34
|
+
| ... | | | | | |
|
|
35
|
+
|
|
36
|
+
📊 Protocol violations: <N>
|
|
37
|
+
⏭️ Proceeding to mechanical checks...
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
</Step0_SelfReflection>
|
|
41
|
+
|
|
42
|
+
<ExecutionStrategy>
|
|
43
|
+
**BATCH ALL READS.** Use the SDD scan tool for one-shot snapshot, then targeted reads.
|
|
44
|
+
|
|
45
|
+
1. **One bash call** to get comprehensive snapshot:
|
|
46
|
+
`~/Developer/gennady/ai/skills/sdd-execute/scripts/sdd scan <project-root>`
|
|
47
|
+
This emits [HEADER] [TASKS] [TRACKERS] [SPECS] [WARNINGS] [SUMMARY] in a single call — replaces multiple find/grep commands.
|
|
48
|
+
|
|
49
|
+
2. **Concurrent reads** of all key files: Portal, scope specs (from SPECS list), trackers with issues (from WARNINGS). Do NOT read module specs initially — only if Check 2 needs them.
|
|
50
|
+
|
|
51
|
+
3. **Do NOT run npm test.** Check 7 only verifies test FILES exist, not that they pass. Running tests is the developer's responsibility.
|
|
52
|
+
|
|
53
|
+
4. **Do NOT scan code files.** Check 6 samples at most 3 files.
|
|
54
|
+
|
|
55
|
+
Total: ≤5 tool calls for all 8 checks. Target: <15 seconds.
|
|
56
|
+
</ExecutionStrategy>
|
|
57
|
+
|
|
58
|
+
<Checks>
|
|
59
|
+
Run these checks in order using BATCHED reads. Each check produces PASS / FAIL with location.
|
|
60
|
+
|
|
61
|
+
### Check 1 — Portal Integrity (1 read)
|
|
62
|
+
|
|
63
|
+
Read `specs/README.md`. Verify: scopes table entries match `specs/<scope>/<scope>.spec.md` existence. Graph nodes match table. Status emoji matches file presence.
|
|
64
|
+
|
|
65
|
+
### Check 2 — Spec Linking (read scope specs only)
|
|
66
|
+
|
|
67
|
+
For each scope spec 9/7: module paths resolve to files. Module spec 1 links to parent. Cross-scope references resolve.
|
|
68
|
+
|
|
69
|
+
### Check 3 — Tracker Sync (1 grep)
|
|
70
|
+
|
|
71
|
+
`grep -rn "\[x\] DONE\|\[ \] TODO\|\[~\] IN_PROGRESS\|\[!\] BLOCKED" tasks/README.md tasks/*/README.md`. Compare counts.
|
|
72
|
+
|
|
73
|
+
### Check 4 — DAG Consistency (parse from tracker)
|
|
74
|
+
|
|
75
|
+
Parse `Dependencies:` from each task ticket planning surface. Topological sort. No cycles.
|
|
76
|
+
|
|
77
|
+
### Check 5 — Execution Log Completeness
|
|
78
|
+
|
|
79
|
+
From scan [TASKS] output: check `placeholders` column for any task with >0. Flag tasks where placeholders > 0 even if status DONE. Also inspect `warnings` column for `no-execlog-section` or `anchors-mismatch`.
|
|
80
|
+
|
|
81
|
+
### Check 6 — File Headers (sample 3 files)
|
|
82
|
+
|
|
83
|
+
Pick 3 recently modified .ts files from `git diff --name-only HEAD~3`. Check for `@file:`, `@consumers:`, `@tasks:`.
|
|
84
|
+
|
|
85
|
+
### Check 7 — Test Coverage (1 find)
|
|
86
|
+
|
|
87
|
+
`find tasks -name '*.task-*.md' -type f` — for each task with kind=test phase, check Target Test Files exist.
|
|
88
|
+
|
|
89
|
+
### Check 8 — Decision Log (read scope specs only)
|
|
90
|
+
|
|
91
|
+
Parse D-NNN from all scope specs. Check uniqueness, supersedes links.</Checks>
|
|
92
|
+
|
|
93
|
+
<Output>
|
|
94
|
+
First: Self-Reflection. Then: Mechanical Checks. Use compact single-line-per-check format.
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
🔍 SDD CHECK · <N> scopes · <M> tasks
|
|
98
|
+
|
|
99
|
+
▸ SELF-REFLECTION
|
|
100
|
+
✅ discovery → execute cli (TSK-12..18)
|
|
101
|
+
✅ refine → execute dbc content option (TSK-11)
|
|
102
|
+
❌ code before task TSK-19 type alias contracts
|
|
103
|
+
❌ code before task TSK-20 _reorderTags fix
|
|
104
|
+
❌ no audit TSK-22 vcs-client
|
|
105
|
+
⚠️ audit paperwork TSK-11 (tracker/log gaps)
|
|
106
|
+
|
|
107
|
+
▸ MECHANICAL
|
|
108
|
+
✅ Portal 4 scopes, graph ↔ table
|
|
109
|
+
✅ Spec linking all modules → parent, cross-scope refs resolve
|
|
110
|
+
✅ Tracker sync dbc 13/13 cli 7/7 vcs 1/1
|
|
111
|
+
✅ DAG no cycles, all deps satisfied
|
|
112
|
+
✅ Execution Log no <YYYY-MM-DD> placeholders in tasks
|
|
113
|
+
✅ File headers 21 files scanned, all have @file: + @consumers:
|
|
114
|
+
— Test coverage not checked
|
|
115
|
+
— Decision Log not checked
|
|
116
|
+
|
|
117
|
+
▸ SUMMARY
|
|
118
|
+
Pass: 6/6 checks
|
|
119
|
+
Protocol: 3 violations, 1 audit missing
|
|
120
|
+
|
|
121
|
+
▸ VERDICT
|
|
122
|
+
❌ NOT READY — fix protocol violations before next execute
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Rules for VERDICT line:
|
|
126
|
+
|
|
127
|
+
- All 8 checks PASS AND 0 protocol violations → `✅ CLEAN — artifact tree is consistent, next pickable: TSK-NN`
|
|
128
|
+
- All 8 checks PASS AND 0 violations but some tasks deferred/TODO → `✅ CLEAN — <N> tasks remaining in queue`
|
|
129
|
+
- Any FAIL check OR protocol violations → `❌ NOT READY — <N> issue(s) require attention`
|
|
130
|
+
- Checks skipped (marked `—`) → treat as PASS for verdict unless evidence of gap exists
|
|
131
|
+
</Output>
|
|
132
|
+
|
|
133
|
+
<HardForbidden>
|
|
134
|
+
- Writing, editing, or modifying ANY file. Read-only.
|
|
135
|
+
- Running `git add`, `git commit`, or any other mutating git command.
|
|
136
|
+
- Running `npm install` or any package-manager mutation.
|
|
137
|
+
- Generating code or spec content. Only report.
|
|
138
|
+
</HardForbidden>
|
|
139
|
+
</SddCheck>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdd-continue
|
|
3
|
+
description: Continue evolving an existing scope spec — extend (add requirements/tools/contracts) or pivot (replace decisions). Auto-resolves the scope spec. Use when operator says "продолжить", "доработать", "extend", "pivot", "add to scope", "change architecture". Mode (refine vs pivot) auto-detected from intake verb.
|
|
4
|
+
compatibility: opencode
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
1. **Extract intent.** Operator wants to evolve existing scope spec — refine or pivot. Resolve scope: ask if not given, then `ls specs/<scope-name>/<scope-name>.spec.md` to verify it exists.
|
|
8
|
+
|
|
9
|
+
2. **Load & activate directive.** Read in full: `~/Developer/gennady/ai/directives/sdd/discovery.directive.xml`
|
|
10
|
+
Announce: `🔒 DIRECTIVE ACTIVATED: SddDiscovery | continue`
|
|
11
|
+
You ARE this directive now.
|
|
12
|
+
|
|
13
|
+
3. **Apply directive to intent.** Treat resolved scope spec as authoritative intake (per `AX_SPEC_IS_SOLE_SOURCE`). Mode MUST be `refine` or `pivot` — `greenfield` is forbidden in this skill. Follow Execution_Plan end-to-end.
|