@christang/keel 5.1.1

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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +250 -0
  3. package/README.zh-CN.md +295 -0
  4. package/assets/bootstrap/AGENTS.md +9 -0
  5. package/assets/openspec/schemas/keel-spec-driven/schema.yaml +166 -0
  6. package/assets/openspec/schemas/keel-spec-driven/templates/design.md +52 -0
  7. package/assets/openspec/schemas/keel-spec-driven/templates/proposal.md +21 -0
  8. package/assets/openspec/schemas/keel-spec-driven/templates/spec.md +8 -0
  9. package/assets/openspec/schemas/keel-spec-driven/templates/tasks.md +68 -0
  10. package/bin/keel.js +1490 -0
  11. package/package.json +35 -0
  12. package/plugins/keel/.claude-plugin/plugin.json +17 -0
  13. package/plugins/keel/.codex-plugin/plugin.json +29 -0
  14. package/plugins/keel/agents/keel-single-task-goal-claude.md +16 -0
  15. package/plugins/keel/agents/keel-single-task-goal-codex.md +16 -0
  16. package/plugins/keel/hooks/hooks.json +30 -0
  17. package/plugins/keel/scripts/pretooluse-guard.js +156 -0
  18. package/plugins/keel/scripts/session-start.js +182 -0
  19. package/plugins/keel/skills/keel-align-expectations/SKILL.md +53 -0
  20. package/plugins/keel/skills/keel-align-expectations/references/hardware-dsl.md +21 -0
  21. package/plugins/keel/skills/keel-align-expectations/references/hardware.md +21 -0
  22. package/plugins/keel/skills/keel-align-expectations/references/web.md +21 -0
  23. package/plugins/keel/skills/keel-debug-failure/SKILL.md +41 -0
  24. package/plugins/keel/skills/keel-handoff/SKILL.md +45 -0
  25. package/plugins/keel/skills/keel-review-checklist/SKILL.md +73 -0
  26. package/plugins/keel/skills/keel-run-single-task-goal/SKILL.md +68 -0
  27. package/plugins/keel/skills/keel-tdd-or-test-first/SKILL.md +45 -0
  28. package/scripts/install_to_repo.py +1122 -0
  29. package/scripts/run_python.js +63 -0
  30. package/scripts/validate_plugin.py +9869 -0
  31. package/src/core/capabilities.js +291 -0
  32. package/src/core/context.js +514 -0
  33. package/src/core/gates.js +643 -0
  34. package/src/core/goal.js +230 -0
  35. package/src/core/guard.js +295 -0
  36. package/src/core/helper.js +319 -0
  37. package/src/core/projection.js +195 -0
  38. package/src/core/task-contract.js +736 -0
  39. package/src/core/tasksview.js +123 -0
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: keel-handoff
3
+ description: Create, validate, or clear the optional keel-handoff/v1 pointer override when human intent cannot be inferred uniquely.
4
+ ---
5
+
6
+ # keel-handoff
7
+
8
+ ## Purpose
9
+
10
+ Use this skill only when `keel context` is ambiguous or blocked because human intent cannot be inferred, or when the user explicitly asks to set or clear an override. HANDOFF is not session state or a startup summary, and it is not a durable follow-up owner.
11
+
12
+ ## Context to read
13
+
14
+ Run `keel context --json`, then read only the returned paths and the intended durable OpenSpec owner under `openspec/changes/<change>/`.
15
+
16
+ ## Override contract
17
+
18
+ Write `keel/HANDOFF.md` with YAML front matter only:
19
+
20
+ ```yaml
21
+ ---
22
+ schema: keel-handoff/v1
23
+ owner: openspec/changes/<change>/tasks.md#<task>
24
+ action: task-start
25
+ reason: Concise reason automatic inference is insufficient
26
+ ---
27
+ ```
28
+
29
+ The only fields are `schema`, `owner`, `action`, and `reason`. The owner must be a durable OpenSpec proposal, design, or tasks pointer. Supported actions are `discuss`, `author`, `task-start`, `task-complete`, and `change-close`.
30
+
31
+ Never copy task progress, expectation state, evidence details, risks, conversation summaries, `active-backlog`, or `head=...`. Those belong to OpenSpec, archive evidence, or an explicit discard reason.
32
+
33
+ ## Legacy and clearing
34
+
35
+ Do not rewrite a pre-v1 HANDOFF heuristically. Preserve it byte-for-byte and report the explicit choices: migrate it manually to the v1 contract or run `keel context --clear-handoff`.
36
+
37
+ Clearing removes only the override; it does not modify the durable owner. Run `keel context --clear-handoff --json`, then verify normal inference resumes.
38
+
39
+ ## Lite boundary
40
+
41
+ Lite mode does not create HANDOFF for routine cross-session continuity. Use the same optional override contract only when explicit human intent must supersede inference.
42
+
43
+ ## Standalone use
44
+
45
+ Validate the intended owner first, write or clear only the override, run `keel context --json`, and report the resulting source and next action.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: keel-review-checklist
3
+ description: Run the current agent's thin semantic consistency review after shared Keel Core gates and before task completion, sync, archive, or meaningful handoff.
4
+ ---
5
+
6
+ # keel-review-checklist
7
+
8
+ ## Purpose
9
+
10
+ Use this thin Keel consistency gate only at completion gates: after a complete `/opsx:apply` task group, before `/opsx:sync` or `/opsx:archive`, before meaningful handoff, or when delivery reports risks, findings, follow-ups, or out-of-scope need.
11
+
12
+ Shared Core commands (`keel gate task-start`, `task-complete`, and `change-close`) validate deterministic structure. They do not judge product intent, behavioral test sufficiency, design quality, or risk completeness. Those judgments remain with the current agent.
13
+
14
+ ## Context to read
15
+
16
+ Read the selected OpenSpec proposal, design, specs, tasks, diff, and command evidence. Read `keel/HANDOFF.md` only when validating an optional override; it is never evidence or a durable follow-up owner.
17
+
18
+ ## Deterministic gate check
19
+
20
+ - Confirm the appropriate shared Core gate was run and its versioned result is `pass`.
21
+ - Confirm the task's Evidence `Contract` line records the task-start capsule fingerprint and that completion recompiled the same fingerprint; a drift result returns the task to authoring for explicit reauthorization instead of review.
22
+ - A behavioral task's checks must prove observable Acceptance through the public interface, not build-only or shape-only evidence.
23
+ - For a red-green strategy (`vertical-tdd`, `regression-first`), confirm concrete per-label `.red` and `.green` Evidence exists for the same check; evidence-first tasks instead name their observable proof.
24
+ - When no trustworthy explicit Git base exists, do not attribute dirty paths automatically. Review scope semantically.
25
+ - For `Coupling: required`, confirm one complete candidate reached its completion gate and generated artifacts are aligned.
26
+
27
+ ## Semantic Review
28
+
29
+ Record the current agent's judgment inside the selected task Evidence:
30
+
31
+ - `Status`: `pass` only when the task is ready to complete.
32
+ - `Acceptance check`: why the behavior evidence proves the authored Acceptance.
33
+ - `Scope check`: why the actual changes stay within Touch; identify an explicit base if deterministic comparison was used.
34
+ - `Findings`: `none`, or each unresolved finding with a durable OpenSpec task/new change, archive-evidence owner, or explicit discard rationale.
35
+
36
+ The Review remains in tasks.md. A user-facing Report summarizes delivery but is not hidden gate state. Do not let Core or this checklist write evidence automatically.
37
+
38
+ ## Domain reference
39
+
40
+ When the change's artifacts or Touch extensions signal a supported domain (web, hardware, hardware-dsl), consult the matching reference's `Execution and review checks` section under `keel-align-expectations/references/` before concluding the review — only the matching reference, never all of them. When no domain signal exists, load nothing.
41
+
42
+ ## Expectation and follow-up ownership
43
+
44
+ Each related critical expectation needs behavior evidence, a durable follow-up owner, or an explicit discard reason. Relevant `D<n>`, `F<n>`, `A<n>`, and `Q<n>` references in Covers must agree with their OpenSpec basis and resolution owner. Unresolved authority returns to OpenSpec authoring.
45
+
46
+ `keel/HANDOFF.md` is an optional pointer override and cannot own findings, critical expectation state, evidence details, or follow-ups.
47
+
48
+ ## Skill change review
49
+
50
+ For a new or materially expanded dedicated skill, confirm the authoring evidence
51
+ identifies authoritative sources, provenance and license implications, realistic
52
+ positive and negative trigger cases, and real-task evidence. Confirm detailed
53
+ conditional knowledge uses progressive references when it is not needed on
54
+ every activation.
55
+
56
+ The canonical portable `SKILL.md` must agree with every declared target
57
+ projection. Target metadata may be additive, but it must not redefine skill
58
+ behavior or make Keel the authority for target-native discovery or activation.
59
+
60
+ ## Planning artifact funnel
61
+
62
+ When the work followed an accepted native plan-mode artifact, confirm its decisions affecting scope, Acceptance, completion, or execution boundaries were recorded in proposal, design, specs, or tasks before implementation. A material decision found only in session state is missing authority and returns to OpenSpec authoring; the session plan file is never execution authority.
63
+
64
+ ## Output
65
+
66
+ Report one of:
67
+
68
+ - `pass`
69
+ - `return-to-work`
70
+ - `create-owner-first`
71
+ - `escalate`
72
+
73
+ Do not expand implementation scope during review.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: keel-run-single-task-goal
3
+ description: Use when the user explicitly authorizes automatic execution or resume of exactly one OpenSpec task on Codex or Claude. Drives the single-task native goal lifecycle through Keel gates, keeps the current agent the sole writer, and stops at the task boundary. Never activate for ordinary apply, proposal work, ambiguous or multiple tasks, or OpenCode.
4
+ license: UNLICENSED
5
+ metadata:
6
+ keel-role: single-task-goal-activation
7
+ keel-targets: codex, claude
8
+ ---
9
+
10
+ # keel-run-single-task-goal
11
+
12
+ ## Purpose
13
+
14
+ Activate a native goal or subagent runtime to execute exactly one authorized OpenSpec task end to end, while OpenSpec, Git, the task-capsule fingerprint, and deterministic Keel gates stay the only durable authority. The current agent remains the sole writer and owns Review, gate invocation, the task checkbox, and completion. A native evaluator declaring success never marks or reports the task complete.
15
+
16
+ ## Authoritative sources and provenance
17
+
18
+ These official runtime docs are linked as authoritative references, not copied. Their text and trademarks belong to their owners; Keel paraphrases only the activation semantics it needs and bundles none of their prose.
19
+
20
+ - Codex goal-following: https://learn.chatgpt.com/use-cases/follow-goals
21
+ - Codex subagents: https://developers.openai.com/codex/subagents
22
+ - Claude goal execution: https://code.claude.com/docs/en/goal
23
+ - Claude subagents: https://code.claude.com/docs/en/sub-agents
24
+
25
+ License note: this skill is distributed under the Keel package license (UNLICENSED, all rights reserved by the author). Linking the official docs does not relicense them; do not paste their content into Keel artifacts.
26
+
27
+ ## When to activate
28
+
29
+ Activate only on an explicit, unambiguous request to automatically execute or resume **one** task:
30
+
31
+ - The user names one OpenSpec change and one executable task and asks to run or continue it automatically.
32
+ - A resume request points at the same durable task whose recorded authorization fingerprint still matches the recompiled capsule.
33
+
34
+ ## When NOT to activate
35
+
36
+ - Ordinary `/opsx:apply` or manual step-by-step work the user is driving.
37
+ - Proposal, design, or spec authoring before tasks are final.
38
+ - Ambiguous selection, multiple tasks, or a whole task group or change backlog.
39
+ - An unrelated native `/goal` use that is not a Keel OpenSpec task.
40
+ - Unrequested helpers or any request to delegate implementation to another agent.
41
+ - OpenCode, which stays manual compatibility only with no v4 native activation.
42
+
43
+ If any of these hold, stop and use the normal manual Keel loop.
44
+
45
+ ## Single-task goal lifecycle
46
+
47
+ 1. `keel gate task-start --change C --task T` and record the returned fingerprint in the task Evidence `Contract` line as the durable authorization.
48
+ 2. `keel project goal --target codex|claude --change C --task T --json` to compile the disposable `keel-native-goal/v1` projection (objective, Acceptance, command labels, verification strategy, Touch, stop boundary, ownership, terminal condition). The projection is a view, never authority, and never checks the box.
49
+ 3. Implement within Touch and produce the strategy's evidence (for example red/green slices for vertical-tdd).
50
+ 4. Surface every command result and gate outcome in the transcript before any success claim.
51
+ 5. Pass the current agent's Review, then `keel gate task-complete`.
52
+ 6. The current agent durably checks the task checkbox.
53
+ 7. Stop. Continuing to another task requires a new explicit user instruction and a new start fingerprint; there is no hidden scheduler or automatic next-task selection.
54
+
55
+ Resume reconstructs the goal from OpenSpec and Git only. Fingerprint drift, checkout divergence, a completed authorization, or missing authorization hard-stops before any product write; pass `--expected-fingerprint` and `--expected-owner` to assert the recorded authorization.
56
+
57
+ ## Bounded read-only helpers
58
+
59
+ Helpers are optional, read-only evidence producers and never a second writer. Compile one with `keel project helper` for a single bounded question or one repository-byte-stable verification command; a helper never writes products, delegates, nests, or holds acceptance or completion authority. Accept a helper return only after `keel project helper --verify` proves before/after repository byte identity; a modified, added, removed, renamed, or permission-changed path rejects the evidence with exact paths and no cleanup. Helper absence never disables current-agent goal execution.
60
+
61
+ ## Manual fallback
62
+
63
+ When native activation is unavailable — no plugin, disabled hooks, managed policy, missing trust, or an unsupported surface — do not fake activation. Run the same lifecycle by hand: `keel gate task-start`, `keel project goal ... --json` for the view, implement, surface evidence, `keel gate task-complete`, then check the box. The manual loop preserves the identical single-task lifecycle and stop boundary.
64
+
65
+ ## Target activation
66
+
67
+ - Codex: where a callable goal/subagent surface exists, activate one bounded goal for the selected task and use subagents only as bounded read-only helpers. Without a callable surface, paste the exact `keel project goal` command and treat the capability as advisory.
68
+ - Claude: activate one `/goal` whose condition stays within the 4,000-character budget; the evaluator is transcript-only, so surface command and gate evidence explicitly. If hooks are disabled, policy blocks activation, or trust is missing, report the manual fallback.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: keel-tdd-or-test-first
3
+ description: Drive Keel agent test-first or evidence-first execution for a selected OpenSpec task. Use when a task needs software tests, hardware testbench, assertions, lint, new behavior proof, regression coverage, or red/green evidence before implementation.
4
+ ---
5
+
6
+ # keel-tdd-or-test-first
7
+ ## Purpose
8
+
9
+ Use this skill when Keel execution should start with evidence: software tests first, or hardware testbench, assertion, lint, or equivalent static evidence first. This skill owns the Verify strategy taxonomy, the evidence contract, and their binding to the task capsule; generic test-writing mechanics (how to loop red-green, what to mock) belong to the host runtime and are not restated here.
10
+
11
+ ## Context to read
12
+
13
+ Read the selected task's compiled capsule: resolved Acceptance, Verify strategy and M<n> checks, Mode, Read, and Touch. `keel gate task-start` returns that capsule and its fingerprint; the fingerprint belongs in the task's Evidence `Contract` line before implementation. Inspect the public interface under test and keep new tests inside the authorized Touch scope.
14
+
15
+ ## Strategy selection
16
+
17
+ `Verify` names one supported strategy chosen at authoring time as the least-cost proof of the resolved Acceptance:
18
+
19
+ - `vertical-tdd`: new independently testable deterministic behavior; one check red then green at a time.
20
+ - `regression-first`: an observable defect; reproduce it through the public interface first, then prove the fix with the same check.
21
+ - `characterization` / `snapshot-characterization`: deterministic or generated outputs kept stable by byte or snapshot comparison; not downgraded to build success.
22
+ - `rendered-behavior`: interactive surfaces exercised through the real rendered interface; strict red-green optional by cost.
23
+ - `evidence-first`: docs, configuration, or diagnosis work whose checks state the observable artifact or evidence instead of a red-green loop.
24
+
25
+ Red-green strategies (`vertical-tdd`, `regression-first`) must record concrete per-label `.red` and `.green` Evidence entries for the same check; `keel gate task-complete` rejects absent or pending entries.
26
+
27
+ ## Domain reference
28
+
29
+ When the change's proposal/design/specs or the task's Touch extensions signal a supported domain (web, hardware, hardware-dsl), consult the matching reference's `Execution and review checks` section under `keel-align-expectations/references/` before finalizing the strategy and the first check — only the matching reference, never all of them. When no domain signal exists, load nothing.
30
+
31
+ ## Coupled-task preflight
32
+
33
+ When the selected task declares `Coupling: required`, also read design.md's
34
+ Coupled Iteration Contract plus the task's Candidate Boundary, Stop Rules, and
35
+ Evidence. Before modifying files, run the task's preflight evidence command or
36
+ inspect the explicitly named evidence. If the contract is incomplete or task
37
+ and design disagree, stop and report the gap; do not infer the missing decision.
38
+
39
+ ## TASK boundary
40
+
41
+ Align every test or check with the selected OpenSpec task's acceptance criteria or verification evidence. Prove behavior through the public interface: evidence that only shows build success or internal shape does not satisfy a behavioral Acceptance, and mocking your own modules invalidates the proof — mock only at true system boundaries.
42
+
43
+ ## Standalone use
44
+
45
+ When used alone, name the public interface under test, the behavior being checked, the command used, and the red/green evidence.