@erclx/canon 5.64.0 → 5.66.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 (47) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/claude/.claude-plugin/plugin.json +1 -1
  3. package/claude/skills/git-pr/references/labels.md +6 -2
  4. package/claude/skills/git-pr-close/REQUIREMENT.md +29 -0
  5. package/claude/skills/git-pr-close/SKILL.md +55 -0
  6. package/claude/skills/git-pr-close/references/close.md +54 -0
  7. package/claude/skills/pr-evidence/SKILL.md +2 -2
  8. package/claude/skills/pr-evidence/references/evidence.md +3 -1
  9. package/claude/skills/role-worker/SKILL.md +2 -2
  10. package/claude/skills/test-craft/references/e2e.md +1 -1
  11. package/docs/workflow/skill-map.md +1 -0
  12. package/governance/ledger/skills/codebase-layout/SKILL.md +64 -0
  13. package/governance/ledger/skills/codebase-layout/frontend.md +62 -0
  14. package/governance/ledger/skills/codebase-layout/tests.md +26 -0
  15. package/governance/ledger/skills/review-craft/SKILL.md +61 -0
  16. package/governance/ledger/skills/review-craft/security.md +34 -0
  17. package/governance/ledger/skills/teach-craft/SKILL.md +33 -0
  18. package/governance/ledger/skills/teach-craft/lesson-craft.md +47 -0
  19. package/governance/ledger/skills/teach-craft/pedagogy.md +77 -0
  20. package/governance/ledger/skills/test-craft/SKILL.md +67 -0
  21. package/governance/ledger/skills/test-craft/component.md +49 -0
  22. package/governance/ledger/skills/test-craft/e2e.md +55 -0
  23. package/governance/ledger/skills/test-craft/unit.md +54 -0
  24. package/package.json +3 -3
  25. package/src/claude/cases/git.ts +4 -0
  26. package/src/claude/skills-audit.ts +7 -0
  27. package/src/commands/labels.ts +152 -4
  28. package/src/commands/pr.ts +263 -2
  29. package/src/commands/sandbox.ts +247 -2
  30. package/src/gate/measures.ts +3 -0
  31. package/src/gate/stages.ts +25 -0
  32. package/src/labels/apply.ts +10 -5
  33. package/src/labels/sync.ts +17 -0
  34. package/src/migrate/records.ts +6 -0
  35. package/src/pr/close.ts +152 -0
  36. package/src/pr/health.ts +56 -0
  37. package/src/pr/local.ts +49 -8
  38. package/src/pr/rest.ts +10 -2
  39. package/src/sandbox/replay/expected.ts +137 -0
  40. package/src/sandbox/replay/run.ts +348 -0
  41. package/src/sandbox/replay/verdict.ts +102 -0
  42. package/src/tooling/verify-stack.ts +4 -5
  43. package/tooling/astro/configs/playwright.config.ts +2 -2
  44. package/tooling/base/reference.md +1 -0
  45. package/tooling/base/seeds/canon/config/pr-labels.toml +41 -0
  46. package/tooling/nextjs/configs/playwright.config.ts +2 -2
  47. package/tooling/vite-react/configs/playwright.config.ts +2 -2
@@ -0,0 +1,33 @@
1
+ ---
2
+ title: Teach craft skill ledger
3
+ description: Sources for claude/skills/teach-craft/SKILL.md, one row per bullet in its concern groups
4
+ ---
5
+
6
+ # Teach craft skill ledger
7
+
8
+ The field is learning science, and the papers are the ones `adopted.md` opened through PubMed. Each row links the abstract page and quotes only what that abstract carries. The house choices stand where `adopted.md` lists a rule as house judgment, and each row names the failure the rule prevents.
9
+
10
+ The closing sections and `## What this delegates` restate these rules or route, so they take no table.
11
+
12
+ ## References
13
+
14
+ | Bullet | Source | Read |
15
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------- |
16
+ | `pedagogy.md` | House choice: a session picking the next topic from the body alone skips the spacing ladder and the placement rules it carries | 2026-10-24 |
17
+ | `lesson-craft.md` | House choice: a quiz written without the construction rules leaks its answer through option length or slot | 2026-10-24 |
18
+
19
+ ## Before teaching
20
+
21
+ | Bullet | Source | Read |
22
+ | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
23
+ | Ask what the learner already knows | House choice: a lesson pitched from an assumed floor either repeats what the learner holds or skips what they lack | 2026-10-24 |
24
+ | Read the subject from sources | House choice: a claim taught from recall is confident where it is wrong, and a learner has no way to audit it | 2026-10-24 |
25
+ | Open a returning learner on retrieval | [Roediger and Karpicke 2006, Test-enhanced learning](https://pubmed.ncbi.nlm.nih.gov/16507066/): "prior testing produced substantially greater retention than studying" | 2026-10-24 |
26
+
27
+ ## While teaching
28
+
29
+ | Bullet | Source | Read |
30
+ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
31
+ | Place each step just past unaided | House choice: a step inside what the learner can already do is review, and one far past it leaves the support doing the whole task | 2026-10-24 |
32
+ | Carry a quiz and a teach-back | [Pashler et al. 2007, IES practice guide](https://ies.ed.gov/ncee/wwc/Docs/PracticeGuide/20072004.pdf): "Use quizzing with active retrieval of information at all phases of the learning process", and [Nestojko et al. 2014, Expecting to teach](https://pubmed.ncbi.nlm.nih.gov/24845756/) backs the teach-back: "Participants expecting to teach produced more complete and better organized free recall of the passage" | 2026-10-24 |
33
+ | Record the wrong answer itself | House choice: a score tells the next session that the learner missed and not what they believe, so it places them from a count rather than the misconception | 2026-10-24 |
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: Teach craft lesson craft ledger
3
+ description: Sources for claude/skills/teach-craft/references/lesson-craft.md, one row per bullet
4
+ ---
5
+
6
+ # Teach craft lesson craft ledger
7
+
8
+ The reference names Butler and Roediger 2008 for feedback, Kornell, Hays and Bjork 2009 for its timing, and Nestojko et al. 2014 for the teach-back. Each row links the PubMed abstract `adopted.md` opened and quotes only that abstract.
9
+
10
+ Restraint and what makes a lesson worth returning to are editorial calls about a page, so their rows are house choices naming the failure each prevents. `## Contents` takes no table.
11
+
12
+ ## Restraint
13
+
14
+ | Bullet | Source | Read |
15
+ | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------- |
16
+ | Cut decoration carrying nothing | House choice: an ornament competes with the material for the learner's attention and teaches nothing in return | 2026-10-24 |
17
+ | One accent color, for the action | House choice: a second accent splits what the eye goes to first, so the thing the learner acts on stops standing out | 2026-10-24 |
18
+ | No animation the learner did not trigger | House choice: motion the learner did not start pulls the eye off the line they are reading | 2026-10-24 |
19
+ | Whitespace over rules and boxes | House choice: rules and boxes add marks the reader has to skip, and stacked boxes read as nesting the material does not have | 2026-10-24 |
20
+
21
+ ## Quiz design
22
+
23
+ | Bullet | Source | Read |
24
+ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
25
+ | Every option the same length | House choice: a longer option reads as the considered one, so a learner picks it by length and the quiz measures test-taking | 2026-10-24 |
26
+ | Rotate the correct slot by number | House choice: an author varying the slot by judgment settles on the first one, and a learner who notices answers by position | 2026-10-24 |
27
+ | Each wrong option a held misconception | House choice: an option nobody believes removes itself, so a four-option question shrinks to fewer and passes a guess | 2026-10-24 |
28
+ | One feedback block per question | [Butler and Roediger 2008, Feedback and multiple-choice testing](https://pubmed.ncbi.nlm.nih.gov/18491500/): "The selection of lures can lead students to acquire false knowledge", and feedback "reduced the proportion of intrusions" | 2026-10-24 |
29
+ | Feedback after the attempt | [Kornell, Hays and Bjork 2009, Unsuccessful retrieval attempts enhance subsequent learning](https://pubmed.ncbi.nlm.nih.gov/19586265/): "participants attempted to answer the question before being shown the answer" | 2026-10-24 |
30
+
31
+ ## Teach back
32
+
33
+ | Bullet | Source | Read |
34
+ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
35
+ | Explain to a named audience | [Nestojko et al. 2014, Expecting to teach](https://pubmed.ncbi.nlm.nih.gov/24845756/): "Participants expecting to teach produced more complete and better organized free recall of the passage" | 2026-10-24 |
36
+ | Ask about what the lesson was for | House choice: a teach-back on a detail beside the point tests attention, so the learner passes it without holding the material | 2026-10-24 |
37
+ | A hidden self-check of what to cover | House choice: a learner alone cannot grade their own explanation, and a check shown beside the ask leaks what to say | 2026-10-24 |
38
+ | The self-check as coverage, not a model | House choice: a model answer is read instead of produced, which turns the teach-back back into reading | 2026-10-24 |
39
+
40
+ ## What makes a lesson worth returning to
41
+
42
+ | Bullet | Source | Read |
43
+ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------- |
44
+ | The worked example is complete | House choice: a fragment forces a returning reader to rebuild the rest from memory, which is the work they came back to avoid | 2026-10-24 |
45
+ | The lesson states what it assumes | House choice: a reader who cannot tell whether they hold the prerequisites reads on and fails at a step they were never ready for | 2026-10-24 |
46
+ | The hard part is named as hard | House choice: material flattened to one difficulty gives a returning reader nothing to navigate by, so they reread all of it | 2026-10-24 |
47
+ | Nothing depends on the session | House choice: a lesson pointing at what was discussed loses its meaning once that conversation is gone, often within a week | 2026-10-24 |
@@ -0,0 +1,77 @@
1
+ ---
2
+ title: Teach craft pedagogy ledger
3
+ description: Sources for claude/skills/teach-craft/references/pedagogy.md, one row per bullet or ordered step
4
+ ---
5
+
6
+ # Teach craft pedagogy ledger
7
+
8
+ The field is learning science. Each paper row links the PubMed abstract `adopted.md` opened and quotes only that abstract, and the IES practice guide rows quote the guide's PDF.
9
+
10
+ The reference labels the rest as house judgment, being the ladder, production over selection, the zone of proximal development, and the sourcing rules, so those rows name the failure each prevents. `## Contents` takes no table.
11
+
12
+ ## Fluency is not storage strength
13
+
14
+ | Bullet | Source | Read |
15
+ | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
16
+ | Confidence is evidence about the lesson | [Roediger and Karpicke 2006, Test-enhanced learning](https://pubmed.ncbi.nlm.nih.gov/16507066/): testing won "even though repeated studying increased students' confidence in their ability to remember the material" | 2026-10-24 |
17
+ | Advance on an unaided retrieval | [Roediger and Karpicke 2006, Test-enhanced learning](https://pubmed.ncbi.nlm.nih.gov/16507066/): "When the final test was given after 5 min, repeated studying improved recall relative to repeated testing" | 2026-10-24 |
18
+
19
+ ## Retrieval practice
20
+
21
+ | Bullet | Source | Read |
22
+ | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
23
+ | Ask before telling | [Kornell, Hays and Bjork 2009, Unsuccessful retrieval attempts](https://pubmed.ncbi.nlm.nih.gov/19586265/): "participants attempted to answer the question before being shown the answer" | 2026-10-24 |
24
+ | Production over selection | House choice: a learner picking from four options can pass on recognition alone, so the lesson reports a retrieval the learner cannot do unprompted | 2026-10-24 |
25
+ | Let the attempt fail before correcting | [Kornell, Hays and Bjork 2009, Unsuccessful retrieval attempts](https://pubmed.ncbi.nlm.nih.gov/19586265/): "Unsuccessful retrieval attempts enhanced learning with both types of materials" | 2026-10-24 |
26
+ | No cue in the question | House choice: a question restating the material can be answered by reading it, so it measures reading and reports memory | 2026-10-24 |
27
+ | Which rules rest on Kornell, Hays and Bjork | [Kornell, Hays and Bjork 2009, Unsuccessful retrieval attempts](https://pubmed.ncbi.nlm.nih.gov/19586265/): the read-only condition it beat is one where "the question and answer were presented together" | 2026-10-24 |
28
+ | A teach-back block in every lesson | [Nestojko et al. 2014, Expecting to teach](https://pubmed.ncbi.nlm.nih.gov/24845756/): "Participants expecting to teach produced more complete and better organized free recall of the passage" | 2026-10-24 |
29
+ | Name the explanation's audience | [Nestojko et al. 2014, Expecting to teach](https://pubmed.ncbi.nlm.nih.gov/24845756/): the gain came to "Participants expecting to teach", against "participants expecting a test" | 2026-10-24 |
30
+ | Record what the explanation left out | House choice: a missed production filed apart from a missed selection splits one placement input, so the next session places the learner from half of it | 2026-10-24 |
31
+
32
+ ## Spacing
33
+
34
+ | Bullet | Source | Read |
35
+ | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
36
+ | Revisit once forgetting has begun | [Pashler et al. 2007, IES practice guide](https://ies.ed.gov/ncee/wwc/Docs/PracticeGuide/20072004.pdf): key content seen on two occasions "separated by a period of several weeks to several months" | 2026-10-24 |
37
+ | Widen the gap on a hit, shorten on a miss | House choice: a fixed gap keeps reviewing what the learner holds and leaves what they keep missing to fade between sessions | 2026-10-24 |
38
+ | Name the revisit in the record | House choice: a next session with no schedule in the record picks its revisit by guess, and the spacing the ladder sets is lost | 2026-10-24 |
39
+ | Apply the ladder as written | House choice: an author told to widen a gap by judgment settles on whatever feels right, so two sessions space one topic differently | 2026-10-24 |
40
+
41
+ ## Interleaving
42
+
43
+ | Bullet | Source | Read |
44
+ | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
45
+ | Mix topics once each has a foothold | House choice, extending Kornell and Bjork's exemplars to topics: a session finishing one topic before the next never makes the learner work out which approach a problem calls for | 2026-10-24 |
46
+ | Keep a mixed set close enough to tell apart | [Kornell and Bjork 2008, Learning concepts and categories](https://pubmed.ncbi.nlm.nih.gov/18578849/): a given artist's paintings "presented consecutively (massed) or interleaved with other artists' paintings (spaced)" | 2026-10-24 |
47
+ | Never interleave an unseen topic | House choice: telling two things apart needs something on each side, so mixing in a topic never taught leaves the learner guessing rather than discriminating | 2026-10-24 |
48
+
49
+ ## The zone of proximal development
50
+
51
+ | Bullet | Source | Read |
52
+ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
53
+ | Compute the band from the records | House choice: a band taken from the subject's own order teaches the next chapter whatever the learner got wrong last time | 2026-10-24 |
54
+ | Target the first thing not done unaided | House choice: a target picked past the first miss builds on a step the learner cannot yet do, so the support carries the task | 2026-10-24 |
55
+ | Withdraw support on success, restore it on a miss | House choice: support left in place after a success carries a task the learner can now do alone, and repeating the lesson on a miss restarts what was nearly held | 2026-10-24 |
56
+ | Ask where the records show nothing | House choice: a guessed starting point misses in both directions, either reviewing what is held or skipping what is not | 2026-10-24 |
57
+
58
+ ## Where difficulty helps and where it hurts
59
+
60
+ | Bullet | Source | Read |
61
+ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
62
+ | New material in its clearest form | [Pashler et al. 2007, IES practice guide](https://ies.ed.gov/ncee/wwc/Docs/PracticeGuide/20072004.pdf): students "learn more by alternating between studying examples of worked-out problem solutions and solving similar problems on their own" | 2026-10-24 |
63
+ | Add difficulty once practicing | [Kornell, Hays and Bjork 2009, Unsuccessful retrieval attempts](https://pubmed.ncbi.nlm.nih.gov/19586265/): "Unsuccessful retrieval attempts enhanced learning with both types of materials" | 2026-10-24 |
64
+ | A hard explanation is not a hard problem | House choice: a confusing explanation adds load the learner spends decoding the teacher, so the difficulty teaches nothing about the material | 2026-10-24 |
65
+
66
+ ## Sourcing
67
+
68
+ | Bullet | Source | Read |
69
+ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
70
+ | Read the subject from sources first | House choice: parametric recall is confident where it is wrong, and a learner cannot audit a claim nobody read | 2026-10-24 |
71
+ | Mark a claim resting on recall | House choice: an unmarked recalled claim reads with the authority of a sourced one, so the learner trusts the part most likely to be wrong | 2026-10-24 |
72
+ | A source not opened is a lead | House choice: a citation to a page nobody read can say the opposite of the claim, and the link makes the claim look checked | 2026-10-24 |
73
+ | The highest rung covering the claim | House choice: a claim resting on a tutorial when the owner's docs cover it inherits the tutorial's errors and its age | 2026-10-24 |
74
+ | No personal or employer proof | House choice: one project or one employer's practice stands for a general rule only by accident, so a lesson built on it teaches a local habit as a law | 2026-10-24 |
75
+ | Owner documentation or specification | House choice: the owner's own docs track the current version, so a claim read anywhere lower drifts the first time the subject changes | 2026-10-24 |
76
+ | A canonical work | House choice: a subject nobody owns has no docs to rank first, so the standard text or primary paper is the most checked source left | 2026-10-24 |
77
+ | Other material, recorded with its reason | House choice: a third-rung source recorded without why no higher rung covers the claim cannot be rechecked when a better source appears | 2026-10-24 |
@@ -0,0 +1,67 @@
1
+ ---
2
+ title: Test craft skill ledger
3
+ description: Sources for claude/skills/test-craft/SKILL.md, one row per bullet in its concern groups
4
+ ---
5
+
6
+ # Test craft skill ledger
7
+
8
+ The field is software testing practice. Software Engineering at Google carries test sizes, clarity, and doubles, Fowler and Ham Vocke carry the pyramid, and `obra/superpowers` carries the opening question the body asks of every test. The closing sections and `## What this delegates` restate these rules or route, so they take no table.
9
+
10
+ `references/adopted.md` stays the record of what was adopted and declined at the source level.
11
+
12
+ ## Open every test with one question
13
+
14
+ | Bullet | Source | Read |
15
+ | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
16
+ | A bug is what the test is for | [obra/superpowers, Writing Good Tests](https://github.com/obra/superpowers/blob/5bf4e78/skills/test-driven-development/writing-good-tests.md): "what production change should make this test fail", then whether "that change [is] a bug or a decision" | 2026-10-24 |
17
+ | A decision makes a change detector | [obra/superpowers, Writing Good Tests](https://github.com/obra/superpowers/blob/5bf4e78/skills/test-driven-development/writing-good-tests.md): when "only intentional decisions can fail a test", such as "exact message wording", "it fires on redesign and sleeps through bugs" | 2026-10-24 |
18
+ | No answer proves nothing yet | [obra/superpowers, Writing Good Tests](https://github.com/obra/superpowers/blob/5bf4e78/skills/test-driven-development/writing-good-tests.md): "Cannot name one → redesign around an observable behavior" | 2026-10-24 |
19
+ | Cover the edges as their own cases | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): unit tests "should ensure that all your non-trivial code paths are tested (including happy path and edge cases)" | 2026-10-24 |
20
+
21
+ ## Put the test at the smallest layer that can catch the break
22
+
23
+ | Bullet | Source | Read |
24
+ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
25
+ | The row read off the behavior | [Software Engineering at Google, ch. 11](https://abseil.io/resources/swe-book/html/ch11.html): "small tests run in a single process, medium tests run on a single machine, and large tests run wherever they want", a size set by what the test touches | 2026-10-24 |
26
+ | Split a behavior that spans rows | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "Push your tests as far down the test pyramid as you can" | 2026-10-24 |
27
+ | A red higher run names a missing lower one | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "If a higher-level test spots an error and there's no lower-level test failing, you need to write a lower-level test" | 2026-10-24 |
28
+ | Real-browser component before end to end | [Vitest, Component Testing](https://vitest.dev/guide/browser/component-testing): component tests run "in real browser environments", which "provides the most accurate testing environment as your components run in real browsers with actual DOM implementations" | 2026-10-24 |
29
+
30
+ ## Spend end to end on journeys
31
+
32
+ | Bullet | Source | Read |
33
+ | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
34
+ | Journeys the product cannot lose | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "Try to come up with user journeys that define the core value of your product and translate the most important steps of these user journeys into automated end-to-end tests." | 2026-10-24 |
35
+ | No end to end for a component's state | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "UI tests don't have to be on the highest level of your pyramid - you're perfectly able to unit test your UI in all of these frameworks" | 2026-10-24 |
36
+ | Every later run pays for a new one | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "Due to their high maintenance cost you should aim to reduce the number of end-to-end tests to a bare minimum." | 2026-10-24 |
37
+ | No numeric mix | [web.dev, Pyramid or Crab?](https://web.dev/articles/ta-strategies): the strategy "should fir your architecture, your requirements, and last but not least, your users and their requirements", typo as published | 2026-10-24 |
38
+
39
+ ## Keep test code readable over clever
40
+
41
+ | Bullet | Source | Read |
42
+ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
43
+ | A repeated arrange over a shared helper | [Software Engineering at Google, ch. 12](https://abseil.io/resources/swe-book/html/ch12.html): "A little bit of duplication is OK in tests so long as that duplication makes the test simpler and clearer." | 2026-10-24 |
44
+ | Test data through a factory or builder | [Pryce, Test Data Builders](http://www.natpryce.com/articles/000714.html): "For each class you want to use in a test, create a Builder for that class", one that "Initialises its instance variables to commonly used or safe values" | 2026-10-24 |
45
+ | Assert through the public surface | [Software Engineering at Google, ch. 12](https://abseil.io/resources/swe-book/html/ch12.html): tests should "make calls against its public API rather than its implementation details" | 2026-10-24 |
46
+ | Real, then fake, then stub, mock last | [addyosmani/agent-skills, Test-Driven Development](https://github.com/addyosmani/agent-skills/blob/c004a74/skills/test-driven-development/SKILL.md): "Preference order (most to least preferred): 1. Real implementation", then fake, stub, and mock | 2026-10-24 |
47
+
48
+ ## Hold the structure floors
49
+
50
+ | Bullet | Source | Read |
51
+ | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
52
+ | Arrange, act, assert | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "There's a nice mnemonic to remember this structure: “Arrange, Act, Assert”" | 2026-10-24 |
53
+ | One behavior per test | [Software Engineering at Google, ch. 12](https://abseil.io/resources/swe-book/html/ch12.html): "Each test should cover only a single behavior" | 2026-10-24 |
54
+ | No branches or loops in a test body | [Software Engineering at Google, ch. 12](https://abseil.io/resources/swe-book/html/ch12.html): "in test code, stick to straight-line code over clever logic" | 2026-10-24 |
55
+ | No coverage percentage as a target | [Fowler, Test Coverage](https://martinfowler.com/bliki/TestCoverage.html): "If you make a certain level of coverage a target, people will try to attain it. The trouble is that high coverage numbers are too easy to reach with low quality testing." | 2026-10-24 |
56
+ | Nesting kept to two levels | [Software Engineering at Google, ch. 12](https://abseil.io/resources/swe-book/html/ch12.html) groups tests "nested within one another and named using strings". The two-level cap is a House choice: deeper nesting spreads a test's setup across hooks, which [Dodds](https://kentcdodds.com/blog/avoid-nesting-when-youre-testing) names as "the number one reason I strongly recommend against nested tests" | 2026-10-24 |
57
+ | Independent tests, state restored | [Beck, Test Desiderata](https://testdesiderata.com/): Isolated tests "should return the same results regardless of the order in which they are run." | 2026-10-24 |
58
+ | Await every async operation | [Jest, Testing Asynchronous Code](https://jestjs.io/docs/asynchronous): "if you omit the return / await statement, your test will complete before the promise returned from fetchData resolves or rejects" | 2026-10-24 |
59
+ | Assertions, never a snapshot | [Dodds, Effective Snapshot Testing](https://kentcdodds.com/blog/effective-snapshot-testing), quoting Justin Searls: "Snapshot tests lack (or at least, fail to encourage) expressing the author's intent as to what the code does (much less why)" | 2026-10-24 |
60
+
61
+ ## Read the reference for the layer
62
+
63
+ | Bullet | Source | Read |
64
+ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
65
+ | Unit and integration reference | House choice: a unit test written without `unit.md` reaches for a mock before a real collaborator or a fake, and skips the mutation check that finds its missing case | 2026-10-24 |
66
+ | Component reference | House choice: a component test written without `component.md` queries by test id and fires synthetic events, so it passes on markup a user cannot reach | 2026-10-24 |
67
+ | End to end reference | House choice: a first spec written without `e2e.md` pauses for a fixed time and runs with motion on, the two causes of the flakes its worked failures record | 2026-10-24 |
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: Component tests reference ledger
3
+ description: Sources for claude/skills/test-craft/references/component.md, one row per bullet
4
+ ---
5
+
6
+ # Component tests reference ledger
7
+
8
+ The field is UI testing, where Testing Library and Kent C. Dodds's guidance carry how a rendered component is queried, driven, and waited on. Vitest and Playwright carry the real-browser runners. Each row cites the bullet's own inline link where the reference carries one.
9
+
10
+ ## What belongs here
11
+
12
+ | Bullet | Source | Read |
13
+ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
14
+ | Every state a component shows | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): in a UI test, "data should be presented to the user, the UI state should change as expected" | 2026-10-24 |
15
+ | Every interaction that changes it | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "User input should trigger the right actions" | 2026-10-24 |
16
+ | Conditional rendering, keys, and focus | [Testing Library, user-event](https://testing-library.com/docs/user-event/intro): it "manipulates the DOM just like a user interaction in the browser would", and "wouldn't let a user click a hidden element or type in a disabled text box" | 2026-10-24 |
17
+ | Not layout, scroll, or motion | [Vitest, Why Browser Mode](https://vitest.dev/guide/browser/why): jsdom and happy-dom "only simulate a browser environment and not an actual browser, which may result in some discrepancies" | 2026-10-24 |
18
+
19
+ ## Render
20
+
21
+ | Bullet | Source | Read |
22
+ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
23
+ | Real children | [Dodds, Write tests](https://kentcdodds.com/blog/write-tests): "When you mock something you're removing all confidence in the integration between what you're testing and what's being mocked." | 2026-10-24 |
24
+ | The network doubled at its edge | [Mock Service Worker, Philosophy](https://mswjs.io/docs/philosophy): it intercepts "outgoing network traffic", which "means having zero changes to your code altogether" | 2026-10-24 |
25
+ | Props and fixtures through a factory | [Pryce, Test Data Builders](http://www.natpryce.com/articles/000714.html): a builder "Has "chainable" public methods for overriding the values in its instance variables", so a test spells only the values it depends on | 2026-10-24 |
26
+
27
+ ## Query and act like a user
28
+
29
+ | Bullet | Source | Read |
30
+ | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
31
+ | Role and name first, test id last | [Dodds, Common mistakes with React Testing Library](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library): "Which query should I use?" lists "the queries you should attempt to use in the order you should attempt to use them" | 2026-10-24 |
32
+ | User events over synthetic ones | [Dodds, Common mistakes with React Testing Library](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library): user-event "provides several methods that resemble the user interactions more closely" | 2026-10-24 |
33
+ | Assert what the user perceives | [Testing Library, Guiding Principles](https://testing-library.com/docs/guiding-principles): a test "should deal with DOM nodes rather than component instances" | 2026-10-24 |
34
+
35
+ ## Wait on one condition
36
+
37
+ | Bullet | Source | Read |
38
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
39
+ | One assertion inside each wait | [Dodds, Common mistakes with React Testing Library](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library): "Advice: only put one assertion in a callback." | 2026-10-24 |
40
+ | No side effect inside a wait | [Dodds, Common mistakes with React Testing Library](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library): the callback runs "a non-deterministic number of times", so "your side-effect could run multiple times!" | 2026-10-24 |
41
+ | The query that waits | [Dodds, Common mistakes with React Testing Library](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library): "find* queries use waitFor under the hood), but the second is simpler and the error message you get will be better" | 2026-10-24 |
42
+
43
+ ## When a simulated DOM cannot render it
44
+
45
+ | Bullet | Source | Read |
46
+ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
47
+ | Vitest browser mode | [Vitest, Browser Mode](https://vitest.dev/guide/browser/): the feature "allows you to run your tests in the browser natively, providing access to browser globals like window and document" | 2026-10-24 |
48
+ | Astro through its client module | [Astro, Testing](https://docs.astro.build/en/guides/testing/): "Use Astro’s getViteConfig() helper in your vitest.config.ts configuration file to set up Vitest with your Astro project’s settings", while [Vitest's component list](https://vitest.dev/guide/browser/component-testing) names no Astro | 2026-10-24 |
49
+ | Playwright component testing | [Playwright, Components](https://playwright.dev/docs/test-components): "It is stable. Tests import test and expect from plain @playwright/test", and a user of the removed packages should "stay on Playwright 1.62 until you have followed the migration guide" | 2026-10-24 |
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: End to end tests reference ledger
3
+ description: Sources for claude/skills/test-craft/references/e2e.md, one row per bullet
4
+ ---
5
+
6
+ # End to end tests reference ledger
7
+
8
+ The field is browser test automation. Playwright's own documentation carries the runner rules, at the version the reference states, and Ham Vocke's pyramid carries which journeys earn a browser run. Each row cites the bullet's own inline link where the reference carries one.
9
+
10
+ The two worked failures report what one project's suite did, so each of their rows is a house choice naming the failure the incident shows rather than an outside citation.
11
+
12
+ ## What earns a browser run
13
+
14
+ | Bullet | Source | Read |
15
+ | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
16
+ | A journey the product cannot lose | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "your most valuable customer journey could be a user searching for a product, putting it in the shopping basket and doing a checkout" | 2026-10-24 |
17
+ | What only a real browser computes | [Vitest, Why Browser Mode](https://vitest.dev/guide/browser/why): "To achieve the highest level of confidence in our tests, it's crucial to test in a real browser environment." | 2026-10-24 |
18
+ | Not a state a component test reaches | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): end-to-end tests "are notoriously flaky and often fail for unexpected and unforeseeable reasons" | 2026-10-24 |
19
+ | Not copy | [obra/superpowers, Writing Good Tests](https://github.com/obra/superpowers/blob/5bf4e78/skills/test-driven-development/writing-good-tests.md): a test pinning "exact message wording" "fires on redesign and sleeps through bugs" | 2026-10-24 |
20
+
21
+ ## Settle on conditions
22
+
23
+ | Bullet | Source | Read |
24
+ | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
25
+ | Web-first assertions | [Playwright, Best Practices](https://playwright.dev/docs/best-practices): "By using web first assertions Playwright will wait until the expected condition is met." | 2026-10-24 |
26
+ | Actionability waits, a read does not | [Playwright, Actionability](https://playwright.dev/docs/actionability): an element is "Stable , as in not animating or completed animation", while with "isVisible() the test won't wait a single second", per [Best Practices](https://playwright.dev/docs/best-practices) | 2026-10-24 |
27
+ | No fixed pause for a condition | [Fowler, Eradicating Non-Determinism in Tests](https://martinfowler.com/articles/nonDeterminism.html): "Never use bare sleeps to wait for asynchonous responses: use a callback or polling.", typo as published | 2026-10-24 |
28
+ | A smooth scroll settles on `scrollend` | [MDN, Element: scrollend event](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollend_event): "The scrollend event fires when element scrolling has completed." The stillness fallback is a House choice: a target already in view never scrolls, so no event comes | 2026-10-24 |
29
+
30
+ ## Motion off by default
31
+
32
+ | Bullet | Source | Read |
33
+ | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
34
+ | Reduced unless the test asserts motion | [Playwright, Browser](https://playwright.dev/docs/api/class-browser#browser-new-context): `reducedMotion` "Emulates 'prefers-reduced-motion' media feature", and a test opts back in through `page.emulateMedia()` | 2026-10-24 |
35
+ | Set once in `use.contextOptions` | [Playwright, Browser](https://playwright.dev/docs/api/class-browser#browser-new-context): `reducedMotion` "Defaults to 'no-preference'", and [TestOptions](https://playwright.dev/docs/api/class-testoptions) shows `use : { contextOptions : { reducedMotion : 'reduce' } }` | 2026-10-24 |
36
+ | A top-level `use.reducedMotion` from 1.50 | [Playwright, TestOptions](https://playwright.dev/docs/api/class-testoptions): `testOptions.reducedMotion` was added in Playwright 1.50 and "Emulates 'prefers-reduced-motion' media feature", with `use : { reducedMotion : 'reduce' }` as its usage | 2026-10-25 |
37
+
38
+ ## Isolation and speed
39
+
40
+ | Bullet | Source | Read |
41
+ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
42
+ | Every test its own state | [Playwright, Isolation](https://playwright.dev/docs/browser-contexts): "Tests written with Playwright execute in isolated clean-slate environments called browser contexts." | 2026-10-24 |
43
+ | Workers and sharding over cut waits | [Playwright, Best Practices](https://playwright.dev/docs/best-practices): "Playwright runs tests in parallel by default", and "Playwright can shard a test suite, so that it can be executed on multiple machines" | 2026-10-24 |
44
+ | A suite failing as workers rise | House choice: an assertion that passes on one worker and fails on four depends on machine load, and no settle at that layer removes the dependence | 2026-10-24 |
45
+ | A trace on the first retry | [Playwright, Best Practices](https://playwright.dev/docs/best-practices): traces "are set to run on CI on the first retry of a failed test. We don't recommend setting this to on so that traces are run on every test as it's very performance heavy." | 2026-10-24 |
46
+ | Count the cost before adding a test | House choice: a test's runtime multiplies by every engine and every push, so a suite grown one cheap-looking test at a time is what makes the gate slow | 2026-10-24 |
47
+
48
+ ## Two worked failures
49
+
50
+ | Bullet | Source | Read |
51
+ | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
52
+ | A copy edit was a decision, not a bug | House choice: an assertion on exact wording in a browser run is a change detector, failing every engine on an edit nobody would call a bug | 2026-10-24 |
53
+ | The copy belonged at unit | House choice: a copy assertion run in a browser holds a deploy on every wording change, where a unit test beside the copy fails once and fast | 2026-10-24 |
54
+ | The settle was right and the layer wrong | House choice: an assertion whose result depends on CI load keeps failing at the layer where load decides it, however correct its settle | 2026-10-24 |
55
+ | The focus behavior moves down a layer | House choice: a focus assertion on the whole-site run flakes its file and skips a deploy, where a real-browser component test observes focus without the site's load | 2026-10-24 |
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: Unit and integration tests reference ledger
3
+ description: Sources for claude/skills/test-craft/references/unit.md, one row per bullet and ordered step
4
+ ---
5
+
6
+ # Unit and integration tests reference ledger
7
+
8
+ The field is unit testing practice. `addyosmani/agent-skills` and `obra/superpowers`, the two sources the reference cites inline, carry the doubles order, DAMP, and the mutation check. Software Engineering at Google, Fowler, and the Go wiki carry the rest.
9
+
10
+ The four ordered steps under `## Doubles` and the three under `## The mutation check` each take a row, the way a bullet does.
11
+
12
+ ## Doubles
13
+
14
+ | Bullet | Source | Read |
15
+ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
16
+ | Real first | [addyosmani/agent-skills, Test-Driven Development](https://github.com/addyosmani/agent-skills/blob/c004a74/skills/test-driven-development/SKILL.md): "1. Real implementation → Highest confidence, catches real bugs" | 2026-10-24 |
17
+ | Fake second | [addyosmani/agent-skills, Test-Driven Development](https://github.com/addyosmani/agent-skills/blob/c004a74/skills/test-driven-development/SKILL.md): "2. Fake → In-memory version of a dependency (e.g., fake DB)" | 2026-10-24 |
18
+ | Stub third | [addyosmani/agent-skills, Test-Driven Development](https://github.com/addyosmani/agent-skills/blob/c004a74/skills/test-driven-development/SKILL.md): "3. Stub → Returns canned data, no behavior" | 2026-10-24 |
19
+ | Mock last, when the call is the contract | [Software Engineering at Google, ch. 13](https://abseil.io/resources/swe-book/html/ch13.html): "interaction testing is useful in certain situations but should be avoided when possible because overuse can easily result in brittle tests" | 2026-10-24 |
20
+ | Double only at an unowned boundary | [addyosmani/agent-skills, Test-Driven Development](https://github.com/addyosmani/agent-skills/blob/c004a74/skills/test-driven-development/SKILL.md): "Mock only at boundaries where real deps are slow or non-deterministic" | 2026-10-24 |
21
+ | Never assert a mock exists | [obra/superpowers, Writing Good Tests](https://github.com/obra/superpowers/blob/5bf4e78/skills/test-driven-development/writing-good-tests.md): "A mock assertion passes when the mock is present and fails when it is absent" | 2026-10-24 |
22
+ | Clock and randomness injected | [Fowler, Eradicating Non-Determinism in Tests](https://martinfowler.com/articles/nonDeterminism.html): "always wrap the system clock with routines that can be replaced with a seeded value for testing" | 2026-10-24 |
23
+
24
+ ## Descriptive over shared
25
+
26
+ | Bullet | Source | Read |
27
+ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
28
+ | DAMP over DRY | [addyosmani/agent-skills, Test-Driven Development](https://github.com/addyosmani/agent-skills/blob/c004a74/skills/test-driven-development/SKILL.md): "each test should tell a complete story without requiring the reader to trace through shared helpers" | 2026-10-24 |
29
+ | A factory with the key values shown | [Software Engineering at Google, ch. 12](https://abseil.io/resources/swe-book/html/ch12.html): a test is not complete when "important details are hidden away in helper methods that the reader can’t see" | 2026-10-24 |
30
+ | No shared mutable state | [Fowler, Eradicating Non-Determinism in Tests](https://martinfowler.com/articles/nonDeterminism.html): "If one test creates some data in the database and leaves it lying around, it can corrupt the run of another test" | 2026-10-24 |
31
+
32
+ ## Table-driven cases
33
+
34
+ | Bullet | Source | Read |
35
+ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
36
+ | One table for inputs differing by value | [Go wiki, TableDrivenTests](https://go.dev/wiki/TableDrivenTests): "Each table entry is a complete test case with inputs and expected results, and sometimes with additional information such as a test name" | 2026-10-24 |
37
+ | A row holds input and expected output | [obra/superpowers, Writing Good Tests](https://github.com/obra/superpowers/blob/5bf4e78/skills/test-driven-development/writing-good-tests.md): "table-driven tests with literal `want` values are the preferred shape" | 2026-10-24 |
38
+ | Split the table on a new assertion | [Go wiki, TableDrivenTests](https://go.dev/wiki/TableDrivenTests): "the actual test simply iterates through all table entries and for each entry performs the necessary tests", one test body every row shares | 2026-10-24 |
39
+
40
+ ## Integration at a boundary
41
+
42
+ | Bullet | Source | Read |
43
+ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
44
+ | Through the callers' interface | [Vocke, The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): "Narrow integration tests live at the boundary of your service", "triggering an action that leads to integrating with the outside part" | 2026-10-24 |
45
+ | A temporary directory or database each | [Fowler, Eradicating Non-Determinism in Tests](https://martinfowler.com/articles/nonDeterminism.html): tests need "a well-known state at the beginning of the test", and "Properly isolated tests can be run in any sequence." | 2026-10-24 |
46
+ | The failure path at the boundary | [Software Engineering at Google, ch. 11](https://abseil.io/resources/swe-book/html/ch11.html): a review is easier with "thorough tests that demonstrate code correctness, edge cases, and error conditions" | 2026-10-24 |
47
+
48
+ ## The mutation check
49
+
50
+ | Bullet | Source | Read |
51
+ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
52
+ | Name three to five breaks | [obra/superpowers, Writing Good Tests](https://github.com/obra/superpowers/blob/5bf4e78/skills/test-driven-development/writing-good-tests.md): "mentally mutate the production code", and "at least one test should fail for each realistic mutation" | 2026-10-24 |
53
+ | Say which test fails for each | [Stryker, What is mutation testing?](https://stryker-mutator.io/docs/): "If your tests fail then the mutant is killed", and "If your tests passed, the mutant survived" | 2026-10-24 |
54
+ | An uncaught break is a missing case | [obra/superpowers, Writing Good Tests](https://github.com/obra/superpowers/blob/5bf4e78/skills/test-driven-development/writing-good-tests.md): "A mutation nothing catches marks the behavior as unprotected" | 2026-10-24 |
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erclx/canon",
3
3
  "type": "module",
4
- "version": "5.64.0",
4
+ "version": "5.66.0",
5
5
  "description": "Runs your agent's work and keeps its code good, on one setup for every repo.",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -69,8 +69,8 @@
69
69
  "astro": "^6.1.9",
70
70
  "husky": "^9.1.7",
71
71
  "micromatch": "^4.0.8",
72
- "oxfmt": "0.73.0",
73
- "oxlint": "1.88.0",
72
+ "oxfmt": "0.74.0",
73
+ "oxlint": "1.89.0",
74
74
  "prettier": "^3.8.1",
75
75
  "prettier-plugin-astro": "^0.14.1",
76
76
  "prettier-plugin-tailwindcss": "^0.8.1",
@@ -22,6 +22,10 @@ export const GIT_CASES: readonly SkillCase[] = [
22
22
  prompt: 'Turn this bug into a GitHub issue and file it.',
23
23
  expect: 'git-issue',
24
24
  },
25
+ {
26
+ prompt: 'Close #42 without merging, #57 supersedes it.',
27
+ expect: 'git-pr-close',
28
+ },
25
29
  {
26
30
  prompt: 'Write the title and body for this pull request.',
27
31
  expect: 'git-pr',
@@ -113,6 +113,13 @@ export const BULLET_LEDGER_SKILLS: Readonly<Record<string, BulletLedgerScope>> =
113
113
  exempt: references('preflight', 'vocabulary'),
114
114
  body: true,
115
115
  },
116
+ [join(SHIPPED_CORPUS, 'review-craft')]: {
117
+ exempt: references('ui'),
118
+ body: true,
119
+ },
120
+ [join(SHIPPED_CORPUS, 'teach-craft')]: { exempt: [], body: true },
121
+ [join(SHIPPED_CORPUS, 'test-craft')]: { exempt: [], body: true },
122
+ [join(SHIPPED_CORPUS, 'codebase-layout')]: { exempt: [], body: true },
116
123
  }
117
124
 
118
125
  /** Where a per-bullet ledger lives, as `<skill>/<file>.md` below it. */