@hecer/yoke 0.2.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.
Files changed (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +494 -0
  3. package/canon/AGENTS.md +28 -0
  4. package/canon/context/DECISIONS.md +4 -0
  5. package/canon/context/KNOWLEDGE.md +4 -0
  6. package/canon/context/PROJECT.md +15 -0
  7. package/canon/loop/loop-spec.md +30 -0
  8. package/canon/loop/prd.schema.md +14 -0
  9. package/canon/manifest.yaml +47 -0
  10. package/canon/policy/gates.md +7 -0
  11. package/canon/policy/roles.md +9 -0
  12. package/canon/skills/ATTRIBUTION.md +71 -0
  13. package/canon/skills/authoring-prd/SKILL.md +44 -0
  14. package/canon/skills/brainstorming/SKILL.md +164 -0
  15. package/canon/skills/dispatching-parallel-agents/SKILL.md +182 -0
  16. package/canon/skills/document-release/SKILL.md +297 -0
  17. package/canon/skills/executing-plans/SKILL.md +70 -0
  18. package/canon/skills/finishing-a-development-branch/SKILL.md +200 -0
  19. package/canon/skills/health/SKILL.md +177 -0
  20. package/canon/skills/maintaining-context/SKILL.md +34 -0
  21. package/canon/skills/minimal-code/SKILL.md +21 -0
  22. package/canon/skills/plan-ceo-review/SKILL.md +541 -0
  23. package/canon/skills/plan-eng-review/SKILL.md +362 -0
  24. package/canon/skills/receiving-code-review/SKILL.md +213 -0
  25. package/canon/skills/requesting-code-review/SKILL.md +105 -0
  26. package/canon/skills/retro/SKILL.md +397 -0
  27. package/canon/skills/review/SKILL.md +246 -0
  28. package/canon/skills/ship/SKILL.md +696 -0
  29. package/canon/skills/subagent-driven-development/SKILL.md +277 -0
  30. package/canon/skills/systematic-debugging/SKILL.md +296 -0
  31. package/canon/skills/tdd/SKILL.md +371 -0
  32. package/canon/skills/unslop-ui/SKILL.md +34 -0
  33. package/canon/skills/using-git-worktrees/SKILL.md +218 -0
  34. package/canon/skills/verification-before-completion/SKILL.md +139 -0
  35. package/canon/skills/visual-verification/SKILL.md +54 -0
  36. package/canon/skills/workflow/SKILL.md +18 -0
  37. package/canon/skills/writing-plans/SKILL.md +152 -0
  38. package/canon/skills/writing-skills/SKILL.md +655 -0
  39. package/canon/skills/yoke-retrofit/SKILL.md +18 -0
  40. package/canon/tools/graphify.md +3 -0
  41. package/canon/tools/playwright-mcp.md +3 -0
  42. package/canon/tools/rtk.md +7 -0
  43. package/canon/tools/serena.md +7 -0
  44. package/dist/canon/frontmatter.js +10 -0
  45. package/dist/canon/manifest.js +26 -0
  46. package/dist/canon/validate.js +73 -0
  47. package/dist/cli.js +244 -0
  48. package/dist/context/command.js +33 -0
  49. package/dist/context/context.js +57 -0
  50. package/dist/loop/cleanup.js +42 -0
  51. package/dist/loop/gates.js +12 -0
  52. package/dist/loop/git.js +25 -0
  53. package/dist/loop/lock.js +45 -0
  54. package/dist/loop/loop.js +190 -0
  55. package/dist/loop/prd.js +29 -0
  56. package/dist/loop/reporter.js +91 -0
  57. package/dist/loop/run-command.js +134 -0
  58. package/dist/loop/runner.js +157 -0
  59. package/dist/loop/verify.js +38 -0
  60. package/dist/loop/watchdog.js +86 -0
  61. package/dist/new/command.js +53 -0
  62. package/dist/prd/command.js +129 -0
  63. package/dist/retrofit/apply.js +54 -0
  64. package/dist/retrofit/canon-dir.js +22 -0
  65. package/dist/retrofit/command.js +37 -0
  66. package/dist/retrofit/config.js +53 -0
  67. package/dist/retrofit/context-actions.js +21 -0
  68. package/dist/retrofit/detect.js +17 -0
  69. package/dist/retrofit/gitignore.js +26 -0
  70. package/dist/retrofit/gstack.js +19 -0
  71. package/dist/retrofit/merge-json.js +38 -0
  72. package/dist/retrofit/plan.js +29 -0
  73. package/dist/retrofit/planners/claude.js +67 -0
  74. package/dist/retrofit/planners/codex.js +36 -0
  75. package/dist/retrofit/planners/gemini.js +54 -0
  76. package/dist/retrofit/report.js +14 -0
  77. package/dist/retrofit/tools.js +23 -0
  78. package/dist/retrofit/wsl.js +15 -0
  79. package/dist/review/command.js +43 -0
  80. package/dist/scan/design.js +79 -0
  81. package/dist/smoke/command.js +141 -0
  82. package/package.json +61 -0
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: verification-before-completion
3
+ description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
4
+ ---
5
+
6
+ # Verification Before Completion
7
+
8
+ ## Overview
9
+
10
+ Claiming work is complete without verification is dishonesty, not efficiency.
11
+
12
+ **Core principle:** Evidence before claims, always.
13
+
14
+ **Violating the letter of this rule is violating the spirit of this rule.**
15
+
16
+ ## The Iron Law
17
+
18
+ ```
19
+ NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
20
+ ```
21
+
22
+ If you haven't run the verification command in this message, you cannot claim it passes.
23
+
24
+ ## The Gate Function
25
+
26
+ ```
27
+ BEFORE claiming any status or expressing satisfaction:
28
+
29
+ 1. IDENTIFY: What command proves this claim?
30
+ 2. RUN: Execute the FULL command (fresh, complete)
31
+ 3. READ: Full output, check exit code, count failures
32
+ 4. VERIFY: Does output confirm the claim?
33
+ - If NO: State actual status with evidence
34
+ - If YES: State claim WITH evidence
35
+ 5. ONLY THEN: Make the claim
36
+
37
+ Skip any step = lying, not verifying
38
+ ```
39
+
40
+ ## Common Failures
41
+
42
+ | Claim | Requires | Not Sufficient |
43
+ |-------|----------|----------------|
44
+ | Tests pass | Test command output: 0 failures | Previous run, "should pass" |
45
+ | Linter clean | Linter output: 0 errors | Partial check, extrapolation |
46
+ | Build succeeds | Build command: exit 0 | Linter passing, logs look good |
47
+ | Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
48
+ | Regression test works | Red-green cycle verified | Test passes once |
49
+ | Agent completed | VCS diff shows changes | Agent reports "success" |
50
+ | Requirements met | Line-by-line checklist | Tests passing |
51
+
52
+ ## Red Flags - STOP
53
+
54
+ - Using "should", "probably", "seems to"
55
+ - Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
56
+ - About to commit/push/PR without verification
57
+ - Trusting agent success reports
58
+ - Relying on partial verification
59
+ - Thinking "just this once"
60
+ - Tired and wanting work over
61
+ - **ANY wording implying success without having run verification**
62
+
63
+ ## Rationalization Prevention
64
+
65
+ | Excuse | Reality |
66
+ |--------|---------|
67
+ | "Should work now" | RUN the verification |
68
+ | "I'm confident" | Confidence ≠ evidence |
69
+ | "Just this once" | No exceptions |
70
+ | "Linter passed" | Linter ≠ compiler |
71
+ | "Agent said success" | Verify independently |
72
+ | "I'm tired" | Exhaustion ≠ excuse |
73
+ | "Partial check is enough" | Partial proves nothing |
74
+ | "Different words so rule doesn't apply" | Spirit over letter |
75
+
76
+ ## Key Patterns
77
+
78
+ **Tests:**
79
+ ```
80
+ ✅ [Run test command] [See: 34/34 pass] "All tests pass"
81
+ ❌ "Should pass now" / "Looks correct"
82
+ ```
83
+
84
+ **Regression tests (TDD Red-Green):**
85
+ ```
86
+ ✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
87
+ ❌ "I've written a regression test" (without red-green verification)
88
+ ```
89
+
90
+ **Build:**
91
+ ```
92
+ ✅ [Run build] [See: exit 0] "Build passes"
93
+ ❌ "Linter passed" (linter doesn't check compilation)
94
+ ```
95
+
96
+ **Requirements:**
97
+ ```
98
+ ✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
99
+ ❌ "Tests pass, phase complete"
100
+ ```
101
+
102
+ **Agent delegation:**
103
+ ```
104
+ ✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
105
+ ❌ Trust agent report
106
+ ```
107
+
108
+ ## Why This Matters
109
+
110
+ From 24 failure memories:
111
+ - your human partner said "I don't believe you" - trust broken
112
+ - Undefined functions shipped - would crash
113
+ - Missing requirements shipped - incomplete features
114
+ - Time wasted on false completion → redirect → rework
115
+ - Violates: "Honesty is a core value. If you lie, you'll be replaced."
116
+
117
+ ## When To Apply
118
+
119
+ **ALWAYS before:**
120
+ - ANY variation of success/completion claims
121
+ - ANY expression of satisfaction
122
+ - ANY positive statement about work state
123
+ - Committing, PR creation, task completion
124
+ - Moving to next task
125
+ - Delegating to agents
126
+
127
+ **Rule applies to:**
128
+ - Exact phrases
129
+ - Paraphrases and synonyms
130
+ - Implications of success
131
+ - ANY communication suggesting completion/correctness
132
+
133
+ ## The Bottom Line
134
+
135
+ **No shortcuts for verification.**
136
+
137
+ Run the command. Read the output. THEN claim the result.
138
+
139
+ This is non-negotiable.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: visual-verification
3
+ description: Use for any UI/web project — make the verify gate cover more than unit tests by composing a pipeline (types → unit → design-scan → flow-smoke) and running the built-in yoke flow-smoke gate (landmark + zero console errors + screenshot proof to .yoke/proof/<story>/, video kept on failure). Catches the unwired-page / runtime-crash / AI-slop bugs unit tests miss.
4
+ ---
5
+
6
+ # Visual verification
7
+
8
+ Unit tests don't see a blank page, an unwired route, a runtime console error, or AI-slop design.
9
+ Make the loop's gate catch them by widening `verify`, since the loop trusts verify as truth.
10
+
11
+ ## 1. Compose the verify pipeline
12
+
13
+ Set `verify.command` (in `.yoke/config.yaml`) to chain, fail-fast:
14
+
15
+ ```
16
+ <typecheck> && <unit tests> && yoke design-scan . && yoke flow-smoke .
17
+ ```
18
+ e.g. `tsc --noEmit && vitest run && yoke design-scan . && yoke flow-smoke .`. Any red step blocks the story.
19
+
20
+ ## 2. Flow-smoke with the built-in gate
21
+
22
+ Configure the key user flows once in `.yoke/config.yaml`:
23
+
24
+ ```yaml
25
+ smoke:
26
+ baseUrl: http://localhost:3000
27
+ flows:
28
+ - name: home
29
+ path: /
30
+ landmark: "main h1"
31
+ - name: login
32
+ path: /login
33
+ landmark: "form"
34
+ ```
35
+
36
+ With that in place, the `yoke flow-smoke .` step from the section-1 pipeline is live.
37
+ `yoke flow-smoke` loads each route against the running dev server, waits for the landmark,
38
+ fails on any console error, and **always** saves a screenshot to `.yoke/proof/<story>/`
39
+ (the loop labels the folder with the current story id via `YOKE_STORY`; standalone runs use
40
+ `latest`, or pass `--label=`). Requires Playwright in the project:
41
+ `npm i -D playwright && npx playwright install chromium`. Start the dev server before verify
42
+ (e.g. via `start-server-and-test`).
43
+
44
+ ## 3. Video only when necessary
45
+
46
+ `yoke flow-smoke` records video per flow and keeps it **only on failure**
47
+ (`.yoke/proof/<story>/<flow>.webm`). When a flow goes red: watch that clip first, then use the
48
+ wired Playwright MCP to reproduce interactively. Never record every run manually — the gate
49
+ already handles the failure case.
50
+
51
+ ## Rule
52
+
53
+ Green pipeline = types + units + no design-slop over budget + every flow renders without
54
+ console errors, with a screenshot to prove it. Only then is the story actually done.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: workflow
3
+ description: Use at the start of any non-trivial task — the default order of operations for shipping quality work, from idea to deploy.
4
+ ---
5
+
6
+ # Workflow — the default order of operations
7
+
8
+ For any non-trivial change, move through these phases in order (skip only what genuinely does not apply):
9
+
10
+ 1. **Brainstorm** the idea into a clear design — see `brainstorming`.
11
+ 2. **Plan** a concrete, testable implementation — see `writing-plans`.
12
+ 3. **Understand the code** — map the blast radius with the code-graph before changing anything.
13
+ 4. **Implement test-first** — RED → GREEN → REFACTOR, smallest steps — see `tdd` and `minimal-code`.
14
+ 5. **Verify** — run the real tests and exercise the change; never trust "it should work" — see `verification-before-completion`.
15
+ 6. **Review** — get an independent review of the diff before landing — see `review` / `requesting-code-review`.
16
+ 7. **Ship** — bump version, update changelog and docs, open the PR — see `ship` / `document-release`.
17
+
18
+ Stop-the-Line applies throughout: no implementation before acceptance criteria exist. Always prefer the least code that solves the task (`minimal-code`).
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: writing-plans
3
+ description: Use when you have a spec or requirements for a multi-step task, before touching code
4
+ ---
5
+
6
+ # Writing Plans
7
+
8
+ ## Overview
9
+
10
+ Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
11
+
12
+ Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
13
+
14
+ **Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
15
+
16
+ **Context:** This should be run in a dedicated worktree (created by brainstorming skill).
17
+
18
+ **Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
19
+ - (User preferences for plan location override this default)
20
+
21
+ ## Scope Check
22
+
23
+ If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
24
+
25
+ ## File Structure
26
+
27
+ Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
28
+
29
+ - Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
30
+ - You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
31
+ - Files that change together should live together. Split by responsibility, not by technical layer.
32
+ - In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
33
+
34
+ This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
35
+
36
+ ## Bite-Sized Task Granularity
37
+
38
+ **Each step is one action (2-5 minutes):**
39
+ - "Write the failing test" - step
40
+ - "Run it to make sure it fails" - step
41
+ - "Implement the minimal code to make the test pass" - step
42
+ - "Run the tests and make sure they pass" - step
43
+ - "Commit" - step
44
+
45
+ ## Plan Document Header
46
+
47
+ **Every plan MUST start with this header:**
48
+
49
+ ```markdown
50
+ # [Feature Name] Implementation Plan
51
+
52
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
53
+
54
+ **Goal:** [One sentence describing what this builds]
55
+
56
+ **Architecture:** [2-3 sentences about approach]
57
+
58
+ **Tech Stack:** [Key technologies/libraries]
59
+
60
+ ---
61
+ ```
62
+
63
+ ## Task Structure
64
+
65
+ ````markdown
66
+ ### Task N: [Component Name]
67
+
68
+ **Files:**
69
+ - Create: `exact/path/to/file.py`
70
+ - Modify: `exact/path/to/existing.py:123-145`
71
+ - Test: `tests/exact/path/to/test.py`
72
+
73
+ - [ ] **Step 1: Write the failing test**
74
+
75
+ ```python
76
+ def test_specific_behavior():
77
+ result = function(input)
78
+ assert result == expected
79
+ ```
80
+
81
+ - [ ] **Step 2: Run test to verify it fails**
82
+
83
+ Run: `pytest tests/path/test.py::test_name -v`
84
+ Expected: FAIL with "function not defined"
85
+
86
+ - [ ] **Step 3: Write minimal implementation**
87
+
88
+ ```python
89
+ def function(input):
90
+ return expected
91
+ ```
92
+
93
+ - [ ] **Step 4: Run test to verify it passes**
94
+
95
+ Run: `pytest tests/path/test.py::test_name -v`
96
+ Expected: PASS
97
+
98
+ - [ ] **Step 5: Commit**
99
+
100
+ ```bash
101
+ git add tests/path/test.py src/path/file.py
102
+ git commit -m "feat: add specific feature"
103
+ ```
104
+ ````
105
+
106
+ ## No Placeholders
107
+
108
+ Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
109
+ - "TBD", "TODO", "implement later", "fill in details"
110
+ - "Add appropriate error handling" / "add validation" / "handle edge cases"
111
+ - "Write tests for the above" (without actual test code)
112
+ - "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
113
+ - Steps that describe what to do without showing how (code blocks required for code steps)
114
+ - References to types, functions, or methods not defined in any task
115
+
116
+ ## Remember
117
+ - Exact file paths always
118
+ - Complete code in every step — if a step changes code, show the code
119
+ - Exact commands with expected output
120
+ - DRY, YAGNI, TDD, frequent commits
121
+
122
+ ## Self-Review
123
+
124
+ After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
125
+
126
+ **1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
127
+
128
+ **2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
129
+
130
+ **3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
131
+
132
+ If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
133
+
134
+ ## Execution Handoff
135
+
136
+ After saving the plan, offer execution choice:
137
+
138
+ **"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Two execution options:**
139
+
140
+ **1. Subagent-Driven (recommended)** - I dispatch a fresh subagent per task, review between tasks, fast iteration
141
+
142
+ **2. Inline Execution** - Execute tasks in this session using executing-plans, batch execution with checkpoints
143
+
144
+ **Which approach?"**
145
+
146
+ **If Subagent-Driven chosen:**
147
+ - **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
148
+ - Fresh subagent per task + two-stage review
149
+
150
+ **If Inline Execution chosen:**
151
+ - **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
152
+ - Batch execution with checkpoints for review