@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,177 @@
1
+ ---
2
+ name: health
3
+ description: |
4
+ Code Quality Dashboard. Runs the project's type-checker, linter, test runner, and
5
+ dead-code detector, scores each category 0-10, and presents a dashboard with trends.
6
+ Use when asked for a "health check", "code quality report", or "quality dashboard".
7
+ triggers:
8
+ - health check
9
+ - code quality
10
+ - quality dashboard
11
+ ---
12
+
13
+ # Code Quality Dashboard
14
+
15
+ You are running the `health` skill. Detect and run the project's quality tools, score each category, and present a dashboard.
16
+
17
+ ---
18
+
19
+ ## Step 1: Detect the health stack
20
+
21
+ Read `CLAUDE.md` and look for a `## Health Stack` section that lists the project's tools. If found, use those tools. If not found, auto-detect:
22
+
23
+ ```bash
24
+ # Runtime detection
25
+ [ -f Gemfile ] && echo "RUNTIME:ruby"
26
+ [ -f package.json ] && echo "RUNTIME:node"
27
+ [ -f requirements.txt ] || [ -f pyproject.toml ] && echo "RUNTIME:python"
28
+ [ -f go.mod ] && echo "RUNTIME:go"
29
+ [ -f Cargo.toml ] && echo "RUNTIME:rust"
30
+
31
+ # Type checker
32
+ [ -f tsconfig.json ] && echo "TYPECHECK:tsc"
33
+ [ -f pyproject.toml ] && command -v mypy >/dev/null 2>&1 && echo "TYPECHECK:mypy"
34
+ [ -f Gemfile ] && grep -q "sorbet" Gemfile 2>/dev/null && echo "TYPECHECK:sorbet"
35
+
36
+ # Linter
37
+ [ -f .eslintrc* ] || [ -f eslint.config* ] && echo "LINT:eslint"
38
+ [ -f .rubocop.yml ] && echo "LINT:rubocop"
39
+ [ -f pyproject.toml ] && grep -qE "ruff|flake8" pyproject.toml 2>/dev/null && echo "LINT:ruff"
40
+ [ -f go.mod ] && echo "LINT:staticcheck"
41
+ [ -f Cargo.toml ] && echo "LINT:clippy"
42
+
43
+ # Test runner
44
+ [ -f jest.config* ] || [ -f vitest.config* ] && echo "TESTS:npm run test"
45
+ [ -f .rspec ] && echo "TESTS:bundle exec rspec"
46
+ [ -f pytest.ini ] || [ -f conftest.py ] && echo "TESTS:pytest"
47
+ [ -f go.mod ] && echo "TESTS:go test ./..."
48
+ [ -f Cargo.toml ] && echo "TESTS:cargo test"
49
+
50
+ # Dead code detector
51
+ command -v ts-prune >/dev/null 2>&1 && echo "DEADCODE:ts-prune"
52
+ command -v knip >/dev/null 2>&1 && echo "DEADCODE:knip"
53
+ [ -f go.mod ] && echo "DEADCODE:deadcode (go-deadcode)"
54
+ [ -f Cargo.toml ] && echo "DEADCODE:cargo udeps"
55
+ ```
56
+
57
+ Print the detected stack. If nothing is detected, ask the user what tools to run.
58
+
59
+ ---
60
+
61
+ ## Step 2: Run the tools
62
+
63
+ Run each detected tool and capture output. Run them in parallel where possible.
64
+
65
+ **Type checker** (run the project's own type-checker, e.g. `tsc --noEmit`, `mypy .`, `srb tc`):
66
+ ```bash
67
+ # Example for TypeScript:
68
+ npx tsc --noEmit 2>&1 | tail -20
69
+ ```
70
+
71
+ **Linter** (run the project's own linter, e.g. `eslint`, `rubocop`, `ruff`):
72
+ ```bash
73
+ # Example for ESLint:
74
+ npx eslint . --max-warnings 0 2>&1 | tail -30
75
+ ```
76
+
77
+ **Test runner** (run the project's own test suite):
78
+ ```bash
79
+ # Example for npm:
80
+ npm test -- --passWithNoTests 2>&1 | tail -40
81
+ ```
82
+
83
+ **Dead-code detector** (run the project's own dead-code tool, e.g. `knip`, `ts-prune`):
84
+ ```bash
85
+ # Example:
86
+ npx knip 2>&1 | tail -20
87
+ ```
88
+
89
+ Capture raw counts: errors, warnings, test pass/fail/skip counts, dead-code count.
90
+
91
+ ---
92
+
93
+ ## Step 3: Score each category (0–10)
94
+
95
+ Score rules (apply for each category):
96
+
97
+ | Score | Meaning |
98
+ |-------|---------|
99
+ | 10 | Zero issues |
100
+ | 8-9 | 1-5 minor warnings, no errors |
101
+ | 6-7 | <20 warnings, zero errors |
102
+ | 4-5 | 20-50 warnings, or 1-5 errors |
103
+ | 2-3 | 50-100 warnings, or 6-20 errors |
104
+ | 0-1 | 100+ warnings, or 20+ errors, or tool fails to run |
105
+
106
+ For tests, also consider pass rate:
107
+ - 10 = 100% pass
108
+ - 8 = 95-99%
109
+ - 6 = 80-94%
110
+ - 4 = 50-79%
111
+ - 0-2 = <50%
112
+
113
+ ---
114
+
115
+ ## Step 4: Present the dashboard
116
+
117
+ ```
118
+ +=====================================================================+
119
+ | CODE QUALITY DASHBOARD |
120
+ | {date} — {branch} |
121
+ +=====================================================================+
122
+ | Category | Score | Status | Details |
123
+ |-----------------|-------|---------|--------------------------------|
124
+ | Type Safety | 8/10 | WARN | 3 warnings, 0 errors |
125
+ | Lint | 10/10 | PASS | 0 issues |
126
+ | Tests | 9/10 | PASS | 142/147 pass, 5 skip |
127
+ | Dead Code | 7/10 | WARN | 12 unused exports |
128
+ +---------------------------------------------------------------------+
129
+ | OVERALL | 8.5 | HEALTHY | |
130
+ +=====================================================================+
131
+
132
+ Top issues (if any):
133
+ [TYPECHECK] src/api/users.ts:42 — Parameter 'id' implicitly has type 'any'
134
+ [DEADCODE] src/utils/legacy.ts — 4 exports never imported
135
+ ```
136
+
137
+ Overall score = average of category scores. Verdict:
138
+ - 9-10: EXCELLENT
139
+ - 7-8: HEALTHY
140
+ - 5-6: FAIR — address warnings before adding more features
141
+ - 3-4: POOR — address errors before shipping
142
+ - 0-2: CRITICAL — stop and fix now
143
+
144
+ ---
145
+
146
+ ## Step 5: Trend analysis (optional)
147
+
148
+ Check if previous health snapshots exist in `.context/health/` (or similar local store in the project). If prior data exists, show trends:
149
+
150
+ ```
151
+ Trends vs last check:
152
+ Type Safety: 8/10 → 8/10 (=)
153
+ Lint: 9/10 → 10/10 (↑ +1)
154
+ Tests: 7/10 → 9/10 (↑ +2) — 12 new tests added
155
+ Dead Code: 5/10 → 7/10 (↑ +2) — cleaned up 8 exports
156
+ ```
157
+
158
+ Save a snapshot to `.context/health/{date}.json` for future trend comparison:
159
+ ```bash
160
+ mkdir -p .context/health
161
+ ```
162
+
163
+ Use the Write tool to save `{date}.json` with the scores, counts, and branch name.
164
+
165
+ ---
166
+
167
+ ## Step 6: Recommendations
168
+
169
+ For each category scoring below 8, provide one concrete action:
170
+ - Type Safety: "Run the type-checker and fix the N errors — prioritize the ones in `{hottest file}`"
171
+ - Lint: "Run the linter with `--fix` to auto-fix {N} of the warnings"
172
+ - Tests: "Add tests for the {N} skipped/failing cases in {file}"
173
+ - Dead Code: "Delete the {N} unused exports in {files} — they add maintenance surface"
174
+
175
+ ## Completion Status
176
+
177
+ Report **DONE** with the dashboard, or **DONE_WITH_CONCERNS** if any category is below 6.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: maintaining-context
3
+ description: Use at the start of any substantial task and whenever you make a non-obvious decision or learn a reusable fact — keeps .yoke/context/ (PROJECT, DECISIONS, KNOWLEDGE) the durable source of truth so fresh-context work never drifts.
4
+ ---
5
+
6
+ # Maintaining Project Context
7
+
8
+ Yoke keeps durable, cross-session context in `.yoke/context/`. These files are the
9
+ project's memory — they survive between sessions and loop iterations, so an agent
10
+ starting with a fresh context window is never blind.
11
+
12
+ ## Before substantial work
13
+
14
+ 1. Read `.yoke/context/PROJECT.md` — the north star (goal, constraints, **non-goals**, success criteria). Align your work to it. If the task contradicts a non-goal, stop and flag it.
15
+ 2. Skim `.yoke/context/KNOWLEDGE.md` for gotchas that affect what you are about to do.
16
+
17
+ ## While working
18
+
19
+ - When you make a **non-obvious decision** (a trade-off, an architectural choice, a rejected alternative), append it to `.yoke/context/DECISIONS.md`:
20
+
21
+ ```
22
+ ## <YYYY-MM-DD> — <area-or-story>: <short title>
23
+ What you chose and why, in one or two lines.
24
+ ```
25
+
26
+ (This mirrors the heading the loop writes for completed stories, so loop-authored and hand-authored entries share one shape.)
27
+
28
+ - When you learn a **reusable fact or gotcha** (a non-obvious build step, an API quirk, a convention), append a bullet to `.yoke/context/KNOWLEDGE.md`.
29
+
30
+ ## Rules
31
+
32
+ - Never rewrite history in `DECISIONS.md` — only append.
33
+ - Keep `PROJECT.md` curated and short; it is read into every loop prompt.
34
+ - Inside the autonomous loop, the loop appends a decision per completed story for you — you still add the *why* and any learnings.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: minimal-code
3
+ description: Use before writing any code — write the least code that fully solves the task (YAGNI, stdlib-first, no unrequested abstractions) to save tokens and reduce maintenance.
4
+ ---
5
+
6
+ # Minimal Code (lazy senior dev)
7
+
8
+ The best code is the code you never wrote. Before writing anything, walk this ladder and stop at the first rung that solves the task:
9
+
10
+ 1. **Does it already exist?** Reuse an existing function, file, or builtin before writing new code.
11
+ 2. **Can the language/stdlib do it?** Prefer the standard library and built-in platform features over a dependency or a hand-rolled version.
12
+ 3. **Is the abstraction requested?** Do not add layers, config, interfaces, or generality nobody asked for. Solve the concrete case.
13
+ 4. **Is it the shortest correct version?** Prefer deletion over addition, boring over clever, one obvious path over branching flexibility.
14
+ 5. **Did the task actually ask for this?** Build only what was requested — no speculative features (YAGNI).
15
+
16
+ Rules:
17
+ - Deletion over addition. Boring over clever. No abstractions that were not requested.
18
+ - Prefer the standard library and existing code over new code or new dependencies.
19
+ - Mark an intentional simplification with a short `minimal-code:` comment so reviewers see it was deliberate.
20
+
21
+ This saves tokens (less generated code), shrinks the review surface, and lowers maintenance — complementary to rtk, which compresses command output. Adapted from the MIT-licensed "ponytail" ruleset (github.com/DietrichGebert/ponytail).