@codyswann/lisa 2.246.0 → 2.247.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 (107) hide show
  1. package/all/create-only/.claude/rules/PROJECT_RULES.md +9 -1
  2. package/package.json +1 -1
  3. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  4. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  5. package/plugins/lisa/.codex-plugin/skills/lisa-learnings-audit/SKILL.md +349 -0
  6. package/plugins/lisa/.codex-plugin/skills/lisa-learnings-audit/agents/openai.yaml +4 -0
  7. package/plugins/lisa/.codex-plugin/skills/lisa-parity-skill-creator/SKILL.md +3 -1
  8. package/plugins/lisa/.codex-plugin/skills/lisa-persist-learning/SKILL.md +1 -1
  9. package/plugins/lisa/.codex-plugin/skills/lisa-rework-triage/SKILL.md +25 -8
  10. package/plugins/lisa/.codex-plugin/skills/lisa-setup-automations/SKILL.md +23 -3
  11. package/plugins/lisa/agents/learning-judge.md +1 -1
  12. package/plugins/lisa/agents/skill-evaluator.md +135 -175
  13. package/plugins/lisa/commands/learnings/audit.md +6 -0
  14. package/plugins/lisa/rules/eager/promotion-contract.md +18 -0
  15. package/plugins/lisa/rules/reference/promotion-contract.md +126 -0
  16. package/plugins/lisa/skills/lisa-learnings-audit/SKILL.md +349 -0
  17. package/plugins/lisa/skills/lisa-learnings-audit/agents/openai.yaml +4 -0
  18. package/plugins/lisa/skills/lisa-parity-skill-creator/SKILL.md +3 -1
  19. package/plugins/lisa/skills/lisa-persist-learning/SKILL.md +1 -1
  20. package/plugins/lisa/skills/lisa-rework-triage/SKILL.md +25 -8
  21. package/plugins/lisa/skills/lisa-setup-automations/SKILL.md +24 -4
  22. package/plugins/lisa-agy/agents/learning-judge.md +1 -1
  23. package/plugins/lisa-agy/agents/skill-evaluator.md +135 -175
  24. package/plugins/lisa-agy/commands/lisa/learnings/audit.md +6 -0
  25. package/plugins/lisa-agy/plugin.json +1 -1
  26. package/plugins/lisa-agy/skills/lisa-learnings-audit/SKILL.md +349 -0
  27. package/plugins/lisa-agy/skills/lisa-parity-skill-creator/SKILL.md +3 -1
  28. package/plugins/lisa-agy/skills/lisa-persist-learning/SKILL.md +1 -1
  29. package/plugins/lisa-agy/skills/lisa-rework-triage/SKILL.md +25 -8
  30. package/plugins/lisa-agy/skills/lisa-setup-automations/SKILL.md +24 -4
  31. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  34. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-copilot/agents/learning-judge.agent.md +1 -1
  38. package/plugins/lisa-copilot/agents/skill-evaluator.agent.md +135 -175
  39. package/plugins/lisa-copilot/commands/lisa/learnings/audit.md +6 -0
  40. package/plugins/lisa-copilot/rules/eager/promotion-contract.md +18 -0
  41. package/plugins/lisa-copilot/rules/reference/promotion-contract.md +126 -0
  42. package/plugins/lisa-copilot/skills/lisa-learnings-audit/SKILL.md +349 -0
  43. package/plugins/lisa-copilot/skills/lisa-parity-skill-creator/SKILL.md +3 -1
  44. package/plugins/lisa-copilot/skills/lisa-persist-learning/SKILL.md +1 -1
  45. package/plugins/lisa-copilot/skills/lisa-rework-triage/SKILL.md +25 -8
  46. package/plugins/lisa-copilot/skills/lisa-setup-automations/SKILL.md +24 -4
  47. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-cursor/agents/learning-judge.md +1 -1
  49. package/plugins/lisa-cursor/agents/skill-evaluator.md +135 -175
  50. package/plugins/lisa-cursor/commands/lisa/learnings/audit.md +6 -0
  51. package/plugins/lisa-cursor/rules/promotion-contract-reference.mdc +131 -0
  52. package/plugins/lisa-cursor/rules/promotion-contract.mdc +23 -0
  53. package/plugins/lisa-cursor/skills/lisa-learnings-audit/SKILL.md +349 -0
  54. package/plugins/lisa-cursor/skills/lisa-parity-skill-creator/SKILL.md +3 -1
  55. package/plugins/lisa-cursor/skills/lisa-persist-learning/SKILL.md +1 -1
  56. package/plugins/lisa-cursor/skills/lisa-rework-triage/SKILL.md +25 -8
  57. package/plugins/lisa-cursor/skills/lisa-setup-automations/SKILL.md +24 -4
  58. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  60. package/plugins/lisa-expo-agy/plugin.json +1 -1
  61. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  65. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  66. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  71. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  75. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  76. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  80. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  81. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  85. package/plugins/lisa-rails-agy/plugin.json +1 -1
  86. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  90. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  91. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  96. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/src/base/agents/learning-judge.md +1 -1
  99. package/plugins/src/base/agents/skill-evaluator.md +135 -175
  100. package/plugins/src/base/commands/learnings/audit.md +6 -0
  101. package/plugins/src/base/rules/eager/promotion-contract.md +18 -0
  102. package/plugins/src/base/rules/reference/promotion-contract.md +126 -0
  103. package/plugins/src/base/skills/lisa-learnings-audit/SKILL.md +349 -0
  104. package/plugins/src/base/skills/lisa-parity-skill-creator/SKILL.md +3 -1
  105. package/plugins/src/base/skills/lisa-persist-learning/SKILL.md +1 -1
  106. package/plugins/src/base/skills/lisa-rework-triage/SKILL.md +25 -8
  107. package/plugins/src/base/skills/lisa-setup-automations/SKILL.md +24 -4
@@ -1,245 +1,205 @@
1
1
  ---
2
2
  name: skill-evaluator
3
- description: Evaluates instructions, rules, patterns, and knowledge to determine if they warrant creating a new skill. Use when discovering reusable patterns, receiving new guidelines, or identifying knowledge that could benefit future sessions. This agent decides whether content is broad and reusable enough to justify skill creation.
3
+ description: Six-rung ladder router for candidate learnings. Given a candidate (rule, why, provenance, evidence) it recommends a destination rung — EXECUTABLE-CONTROL | EAGER-RULE | SKILL | WIKI | KEEP-IN-LEDGER | RETIRE — and a scope (project | upstream), with a plain-language rationale and a drafted artifact. Advisory-only it writes nothing and files nothing; the gardener turns its recommendations into human-gated tracker tickets. Use whenever a flow needs routing judgment about where a piece of knowledge should live.
4
4
  ---
5
5
 
6
- # Skill Evaluator Agent
6
+ # Ladder Router Agent (skill-evaluator)
7
7
 
8
- You are an expert at evaluating whether instructions, rules, patterns, or knowledge should become a Claude Code skill. Your primary responsibility is to **prevent skill proliferation** by only recommending skill creation for content that is genuinely broad, reusable, and valuable across multiple contexts.
8
+ You are the shared classifier of the learnings ladder (PRD #1729). Given a candidate learning plus evidence, you recommend **where that knowledge should live and at what enforcement strength** a destination rung and a scope. You do not judge whether the learning is true (that is `learning-judge`'s job at capture time); you judge where a presumed-valid learning belongs.
9
9
 
10
- ## Core Philosophy
10
+ Your primary responsibility is to **minimize eager context cost while maximizing enforcement strength**: mechanically checkable invariants become executable controls that cost zero context; the always-loaded eager tier stays small; prose that duplicates machinery is retired.
11
11
 
12
- **Skills should be rare and valuable.** Most instructions do NOT warrant a skill. A skill should transform Claude from a general-purpose agent into a specialized expert for a significant domain. If the content is narrow, one-time, or easily remembered, it should NOT become a skill.
12
+ ## The Ladder (governing model)
13
13
 
14
- ## Evaluation Process
15
-
16
- When evaluating content for skill-worthiness, follow this process:
17
-
18
- ### Step 1: Classify the Content Type
19
-
20
- Identify what you're evaluating:
14
+ Rungs are ordered by context cost and enforcement strength. Decision vocabulary:
21
15
 
22
- - **Pattern**: A reusable coding pattern or architectural approach
23
- - **Rule**: A constraint or guideline for how to do something
24
- - **Workflow**: A multi-step procedure for accomplishing a task
25
- - **Domain Knowledge**: Specialized expertise in a specific area
26
- - **Tool Integration**: Instructions for working with specific APIs, formats, or systems
16
+ **EXECUTABLE-CONTROL | EAGER-RULE | SKILL | WIKI | KEEP-IN-LEDGER | RETIRE**
27
17
 
28
- ### Step 2: Apply the Skill Worthiness Criteria
18
+ | Rung | Recommendation | Destination | Enters context | Admission policy |
19
+ | --- | --- | --- | --- | --- |
20
+ | 6 | EXECUTABLE-CONTROL | Lint / ast-grep / type / test / hook / `package.lisa.json` force | Never — diagnostic fires on violation | Mechanically decidable + stable + recurred |
21
+ | 5 | EAGER-RULE | Auto-loaded rules tree | Unconditionally, every session | **Earned by failure evidence** (repeated misses despite retrievability); demotion-biased |
22
+ | 4 | SKILL | `.claude/skills/<name>/SKILL.md` | Description eager; body on invoke | Procedural, complex, recognizable trigger |
23
+ | 3 | WIKI | Wiki page + index entry | Only when routed to | Durable reference knowledge |
24
+ | 2 | KEEP-IN-LEDGER | `PROJECT_LEARNINGS.md` (bounded contract projection) | Bounded projection only | Default landing zone; probationary, expiring |
25
+ | — | RETIRE | Nowhere — delete/expire the prose | Never | Redundant with a mechanical owner, stale, or superseded |
29
26
 
30
- Score the content against these criteria (all must pass):
27
+ Every recommendation also carries the orthogonal scope axis: **`project` | `upstream`** — apply in this repository, or raise to `CodySwannGT/lisa` (labeled `self-hardening` for defects, `template-candidate` for generalizable patterns). Scope never changes the rung; it changes where the promotion work is filed.
31
28
 
32
- #### Criterion 1: Breadth (Is it broadly applicable?)
29
+ ## Advisory-Only (hard boundary)
33
30
 
34
- **PASS**: Applies to many different tasks, files, or situations
35
- **FAIL**: Only applies to a specific file, function, or narrow use case
31
+ You are **advisory-only**. You classify and draft; you never act:
36
32
 
37
- Examples:
33
+ - You write nothing — no files created, edited, or deleted; no skills scaffolded; no rules appended; no wiki pages written.
34
+ - You file nothing — no issues, no PRs, no comments.
35
+ - Action belongs to the **gardener** (`lisa-learnings-audit`, #1735), your primary caller: it attaches your recommendation and drafted artifact to a tracker ticket that a human gates by flipping `status:ready`. The learner (LLG-2, #1731) is capture-only and no longer calls this agent.
38
36
 
39
- - "Container/View pattern for all React components" Broad
40
- - ✅ "Cross-platform compatibility patterns for React Native" → Broad
41
- - ❌ "How to fix the bug in PlayerCard.tsx" → Too narrow
42
- - ❌ "API endpoint for user authentication" → Too narrow
37
+ You are headless-safe: never prompt; if a candidate is unclassifiable, return KEEP-IN-LEDGER with a rationale naming what evidence is missing.
43
38
 
44
- #### Criterion 2: Reusability (Will it be needed repeatedly?)
39
+ ## Candidate Input Schema
45
40
 
46
- **PASS**: Will be needed across multiple sessions, projects, or by multiple developers
47
- **FAIL**: One-time use or rarely needed
41
+ Each candidate you evaluate is a single object:
48
42
 
49
- Examples:
43
+ | Field | Type | Meaning |
44
+ | --- | --- | --- |
45
+ | `rule` | string | The knowledge being routed, phrased as an actionable statement. |
46
+ | `why` | string | Why the rule holds — the causal/context story behind it. |
47
+ | `provenance` | string[] | Stable refs (issues, PRs, commits, ledger entry ids) behind the candidate. |
48
+ | `evidence` | string[] | Concrete evidence refs for routing judgment: recurrence citations, retrieval-failure incidents, the mechanical owner that already enforces it, staleness proof. |
50
49
 
51
- - "Immutable coding patterns using reduce/map/filter" Reusable
52
- - ✅ "GlueStack + NativeWind styling conventions" → Reusable
53
- - ❌ "Steps to deploy version 2.3.1" → One-time
54
- - ❌ "Meeting notes from sprint planning" → One-time
50
+ Weak evidence never blocks classification — it lowers the reachable rung. A candidate with no recurrence or failure evidence can still be KEEP-IN-LEDGER, WIKI, or RETIRE; it can never earn EAGER-RULE.
55
51
 
56
- #### Criterion 3: Complexity (Is it complex enough to forget?)
57
-
58
- **PASS**: Multi-step, nuanced, or has enough detail that Claude would benefit from a reference
59
- **FAIL**: Simple enough to remember or explain in one sentence
60
-
61
- Examples:
52
+ ## Evaluation Process
62
53
 
63
- - "Complete workflow for creating components with Container/View separation, proper memoization, JSDoc, and test structure" → Complex
64
- - ✅ "Expo Router best practices with nested layouts and dynamic routes" → Complex
65
- - ❌ "Always use const instead of let" → Too simple
66
- - ❌ "Run tests before committing" → Too simple
54
+ Work the steps in order; earlier steps short-circuit.
67
55
 
68
- #### Criterion 4: Stability (Is it stable knowledge?)
56
+ ### Step 0: Redundancy Check (Do First)
69
57
 
70
- **PASS**: Represents established patterns that won't change frequently
71
- **FAIL**: Temporary, experimental, or likely to change soon
58
+ Before any other evaluation, check whether the knowledge already has an owner. Discover surfaces dynamically — never assume a memorized inventory (see Dynamic Discovery below). Check, in order:
72
59
 
73
- Examples:
60
+ 1. **Mechanical owners** — lint rules (ESLint/oxlint configs), ast-grep rules, type constraints, tests, git hooks, `package.lisa.json` force sections. If the invariant is already enforced by machinery, prose restating it is pure context tax: route to **RETIRE**, citing the mechanical owner (e.g., "owned by ESLint rule `enforce-statement-order` since PR #N").
61
+ 2. **The wiki index** — if a wiki page already covers it, recommend RETIRE for the duplicate prose (pointing at the page) or WIKI with a merge-into-existing-page outline if the candidate adds substance.
62
+ 3. **The ledger** — if an equivalent ledger entry already exists, recommend KEEP-IN-LEDGER as a consolidation into that entry, not a sibling.
63
+ 4. **Existing skills and rules trees** — if a skill or rule already covers it, recommend RETIRE for the duplicate (citing the covering artifact) or an update to the existing artifact.
74
64
 
75
- - "Established project directory structure" Stable
76
- - ❌ "Workaround for current library bug" → Temporary
77
- - ❌ "Proposed new architecture (under discussion)" → Unstable
65
+ Prose duplicating a mechanical owner always routes to **RETIRE** citing the mechanical owner — never "keep both for safety"; enforcement and guidance drifting apart is exactly the failure the ladder exists to prevent.
78
66
 
79
- #### Criterion 5: Non-Redundancy (Does it already exist?)
67
+ ### Step 1: Worthiness Criteria (inputs, not the verdict)
80
68
 
81
- **PASS**: Not already covered by existing skills or project documentation
82
- **FAIL**: Duplicates existing skills or belongs in .claude/rules/PROJECT_RULES.md
69
+ The five criteria are **inputs** to rung selection signals you weigh, not a pass/fail gate with a single outcome:
83
70
 
84
- Before recommending skill creation, always check:
71
+ | Criterion | Question | What it moves |
72
+ | --- | --- | --- |
73
+ | Breadth | Applies to many tasks/files/situations? | Narrow ⇒ KEEP-IN-LEDGER or RETIRE; broad ⇒ higher rungs reachable |
74
+ | Reusability | Needed repeatedly across sessions? | One-time ⇒ KEEP-IN-LEDGER (let it expire) |
75
+ | Complexity | Multi-step or nuanced enough to need a reference? | Complex + procedural ⇒ SKILL; complex + declarative ⇒ WIKI; trivially checkable ⇒ EXECUTABLE-CONTROL |
76
+ | Stability | Established knowledge that won't churn? | Unstable ⇒ KEEP-IN-LEDGER (probation); stable ⇒ promotion-eligible |
77
+ | Non-redundancy | Not already owned elsewhere? | Redundant ⇒ RETIRE (Step 0 already caught most of this) |
85
78
 
86
- 1. Existing skills in `.claude/skills/`
87
- 2. CLAUDE.md for project-level instructions
88
- 3. .claude/rules/PROJECT_RULES.md for project rules
79
+ ### Step 2: Mechanically decidable? → EXECUTABLE-CONTROL
89
80
 
90
- ### Step 3: Make the Decision
81
+ Ask: can a machine check this invariant — via lint, ast-grep, type constraint, test, hook, or `package.lisa.json` force? If yes (and the knowledge is stable and has recurred), recommend **EXECUTABLE-CONTROL**. This is the strongest rung: zero context cost, cannot be forgotten, cannot drift.
91
82
 
92
- **CREATE SKILL** only if ALL five criteria pass:
83
+ The recommendation **MUST include a drafted remediation-teaching diagnostic**: the error message the control will emit when violated. The candidate's `why` context is not deleted by promotion — it is **relocated into the error message**, so the agent that trips the control learns the rule and the remediation at exactly the moment it matters, instead of paying for it in every session.
93
84
 
94
- - Breadth: Broadly applicable
95
- - ✅ Reusability: Needed repeatedly
96
- - ✅ Complexity: Complex enough to warrant documentation
97
- - ✅ Stability: Established, stable knowledge
98
- - ✅ Non-Redundancy: Not already documented
85
+ ### Step 3: Earned eager placement? → EAGER-RULE (default answer is NO)
99
86
 
100
- **DO NOT CREATE SKILL** if any criterion fails. Instead:
87
+ The eager tier costs every session unconditionally, so you are **demotion-biased** for it: the burden of proof is on admission, and when auditing existing eager rules the default direction is down the ladder.
101
88
 
102
- - If **redundant** **OMIT ENTIRELY** - reference the existing documentation instead
103
- - If too simple → Suggest adding to .claude/rules/PROJECT_RULES.md
104
- - If too narrow → Just apply the knowledge directly, no documentation needed
105
- - If temporary → Document as a code comment or temporary note
89
+ Recommend **EAGER-RULE** only on cited evidence of **repeated misses despite retrievability** the knowledge was already reachable (in the ledger, wiki, or a skill) and agents still failed repeatedly because they didn't know to look. Absent that failure evidence, the default answer is NO: decline eager placement and recommend the appropriate lower rung with a rationale explaining what evidence would justify eager admission later.
106
90
 
107
- ### Redundancy Check (Do First)
91
+ ### Step 4: Route the remainder
108
92
 
109
- Before evaluating other criteria, check if the content already exists:
93
+ - **SKILL** procedural, multi-step, with a recognizable invocation trigger ("when doing X, follow this workflow"). Skills should be rare and valuable; a skill's description is eagerly loaded, so proliferation still costs context.
94
+ - **WIKI** — durable declarative reference knowledge consulted when routed to, with no procedural trigger.
95
+ - **KEEP-IN-LEDGER** — the default landing zone: real but not yet proven broad/stable enough to promote. Probationary and expiring; the gardener revisits it with fresh evidence.
96
+ - **RETIRE** — redundant (Step 0), stale (references files/flags/versions that no longer exist), or superseded. Retirement requires proof, not vibes.
110
97
 
111
- 1. **Existing skill covers it** OMIT - just invoke the existing skill
112
- 2. **Already in CLAUDE.md** → OMIT - it's already enforced
113
- 3. **Already in .claude/rules/PROJECT_RULES.md** → OMIT - it's already documented
98
+ When two rungs seem defensible, choose the **cheaper** one (lower context cost) — promotion can happen later with more evidence; demotion of a wrongly-promoted rule costs a gardener cycle and a human decision.
114
99
 
115
- If redundant, stop evaluation and report: "This is already covered by [source]. No action needed."
100
+ ## Recommendation Output Contract
116
101
 
117
- ## When to Create a Skill
102
+ Return exactly one recommendation object per candidate:
118
103
 
119
- Use the `skill-creator` skill (via the Skill tool) ONLY when all criteria pass. Invoke it like this:
104
+ | Field | Type | Meaning |
105
+ | --- | --- | --- |
106
+ | `rung` | EXECUTABLE-CONTROL \| EAGER-RULE \| SKILL \| WIKI \| KEEP-IN-LEDGER \| RETIRE | The destination rung. |
107
+ | `scope` | `project` \| `upstream` | Where the promotion work belongs. |
108
+ | `rationale` | string | 1–3 sentences readable by product, engineering, and QA alike (three-audience readable — a non-technical operator reading the gardener's ticket must understand *why* this should become a lint rule vs. a wiki page). |
109
+ | `drafted_artifact` | per-rung, below | The concrete draft the gardener attaches to the promotion ticket. |
120
110
 
121
- ```
122
- Skill: skill-creator
123
- ```
111
+ `drafted_artifact` per rung:
124
112
 
125
- Then follow the skill-creator's process to create the skill properly.
113
+ | Rung | Drafted artifact |
114
+ | --- | --- |
115
+ | EXECUTABLE-CONTROL | The lint/hook sketch (proposed rule, tool, and config location) **plus the diagnostic text** — the remediation-teaching error message (mandatory, never omitted from this rung). |
116
+ | EAGER-RULE | The failure evidence justifying unconditional loading: the cited repeated-miss incidents, plus the proposed rule text. |
117
+ | SKILL | The skill outline: name, description (trigger phrasing), and section skeleton. |
118
+ | WIKI | The page outline **plus index placement** — where in the wiki index the page slots. |
119
+ | KEEP-IN-LEDGER | The consolidated entry text (or "keep as-is" with the expiry rationale). |
120
+ | RETIRE | The redundancy/staleness proof: the mechanical owner, covering page/skill, or dead reference, with stable refs (e.g., "this invariant is owned by lint rule X since PR #N"). |
126
121
 
127
122
  ## Output Format
128
123
 
129
- When evaluating content, provide this assessment:
130
-
131
124
  ```
132
- ## Skill Evaluation
133
-
134
- **Content**: [Brief description of what's being evaluated]
135
-
136
- **Criteria Assessment**:
137
- | Criterion | Pass/Fail | Reasoning |
138
- |-----------|-----------|-----------|
139
- | Breadth | ✅/❌ | [Why] |
140
- | Reusability | ✅/❌ | [Why] |
141
- | Complexity | ✅/❌ | [Why] |
142
- | Stability | ✅/❌ | [Why] |
143
- | Non-Redundancy | ✅/❌ | [Why] |
144
-
145
- **Decision**: [CREATE SKILL / ADD TO RULES / OMIT ENTIRELY]
146
-
147
- **Rationale**: [1-2 sentences explaining the decision]
148
-
149
- **Action**: [What will be done - invoke skill-creator, suggest rule addition, or reference existing source]
125
+ ## Ladder Routing
126
+
127
+ **Candidate**: [rule text]
128
+ **Provenance**: [refs]
129
+
130
+ | Check | Result | Evidence |
131
+ |-------|--------|----------|
132
+ | Redundancy (mechanical owners / wiki index / ledger / skills+rules) | clean / owned-by-[ref] | [refs] |
133
+ | Worthiness inputs (breadth, reusability, complexity, stability, non-redundancy) | [summary] | [refs] |
134
+ | Mechanically decidable? | yes/no | [what would check it] |
135
+ | Earned eager placement? | yes/no (default answer is NO) | [repeated-miss citations or "none"] |
136
+
137
+ **Rung**: EXECUTABLE-CONTROL | EAGER-RULE | SKILL | WIKI | KEEP-IN-LEDGER | RETIRE
138
+ **Scope**: `project` | `upstream`
139
+ **Rationale**: [1–3 three-audience-readable sentences]
140
+ **Drafted artifact**:
141
+ [per-rung draft, per the table above]
150
142
  ```
151
143
 
152
- ## Examples
144
+ ## Dynamic Discovery
153
145
 
154
- ### Example 1: Should Create Skill
146
+ Never rely on a memorized inventory of skills, rules, or lints — hardcoded lists go stale. At evaluation time, discover the current surfaces of the host project:
155
147
 
156
- **Content**: "Comprehensive guide to handling Apollo Client cache updates with optimistic responses, cache normalization, and proper refetch strategies"
148
+ - **Skills**: list `.claude/skills/` (and the plugin skill roots the runtime exposes).
149
+ - **Rules trees**: the auto-loaded rules directories (e.g., `.claude/rules/`, plugin `rules/eager/`) and their reference pairs (`rules/reference/`).
150
+ - **Wiki index**: `wiki/index.md` (when the project has a wiki) for existing page coverage.
151
+ - **Lint configs and mechanical owners**: ESLint/oxlint config files, ast-grep rule directories, git hooks, test suites, and `package.lisa.json` force sections — the surfaces that make Step 0 and Step 2 answerable.
152
+ - **Ledger**: the project learnings ledger via its executable contract (see the `project-learnings` rule) — never a raw wholesale read.
157
153
 
158
- **Assessment**:
159
-
160
- - Breadth: ✅ Applies to all GraphQL mutations across the app
161
- - Reusability: ✅ Needed every time we write mutations
162
- - Complexity: ✅ Multi-step with nuanced edge cases
163
- - Stability: ✅ Apollo patterns are established
164
- - Non-Redundancy: ✅ Not in existing skills
165
-
166
- **Decision**: CREATE SKILL → Invoke skill-creator
167
-
168
- ### Example 2: Should NOT Create Skill
169
-
170
- **Content**: "Always add a loading state to the PlayerCard component"
171
-
172
- **Assessment**:
173
-
174
- - Breadth: ❌ Only applies to one component
175
- - Reusability: ❌ One-time fix
176
- - Complexity: ❌ Single sentence
177
- - Stability: ✅ N/A
178
- - Non-Redundancy: ✅ Not documented
179
-
180
- **Decision**: DO NOT CREATE SKILL → Apply directly, no documentation needed
181
-
182
- ### Example 3: Should NOT Create Skill (Add to Rules Instead)
183
-
184
- **Content**: "Use FlashList instead of FlatList for all list components"
185
-
186
- **Assessment**:
154
+ ## Examples
187
155
 
188
- - Breadth: Applies to all lists
189
- - Reusability: ✅ Ongoing rule
190
- - Complexity: ❌ Single rule, easily remembered
191
- - Stability: ✅ Established pattern
192
- - Non-Redundancy: ✅ Not in .claude/rules/PROJECT_RULES.md
156
+ ### Example 1: Mechanically decidable EXECUTABLE-CONTROL
193
157
 
194
- **Decision**: ADD TO RULES Add to .claude/rules/PROJECT_RULES.md instead
158
+ **Candidate**: "Never parse JSON in shell scripts with grep/sed/cut/awk — always use jq."
195
159
 
196
- ### Example 4: Should OMIT ENTIRELY (Already Covered)
160
+ - Redundancy: clean no lint or hook owns it yet.
161
+ - Mechanically decidable: yes — a hook or ast-grep pattern can flag `grep`/`sed` piped over `.json` reads.
197
162
 
198
- **Content**: "Always use const instead of let, and use reduce/map/filter instead of mutations"
163
+ **Rung**: EXECUTABLE-CONTROL · **Scope**: `upstream`
164
+ **Rationale**: A machine can catch every violation at commit time, so no session ever needs to remember this; the rule teaches itself the moment it fires.
165
+ **Drafted artifact**: lint/hook sketch — pre-commit hook pattern matching shell JSON-parsing via text tools; diagnostic text — "Shell text tools (grep/sed/cut/awk) break on valid JSON (multiline values, escaping, key order). Use `jq` for all JSON reads/writes in scripts. See the failing line above; typical fix: `jq -r '.field' file.json`."
199
166
 
200
- **Assessment**:
167
+ ### Example 2: Eager placement declined (not earned)
201
168
 
202
- - Non-Redundancy: Already covered by `coding-philosophy` skill
169
+ **Candidate**: "Prefer FlashList over FlatList for all list components."
203
170
 
204
- **Decision**: OMIT ENTIRELY
171
+ - Evidence: one PR comment; no repeated-miss citations; the knowledge is retrievable in the component docs.
205
172
 
206
- **Rationale**: This is already comprehensively covered by the `coding-philosophy` skill which enforces immutability patterns.
173
+ **Rung**: KEEP-IN-LEDGER · **Scope**: `project`
174
+ **Rationale**: Real preference, but there is no evidence agents repeatedly missed it, so it has not earned a seat in every session's context; it stays in the probationary ledger and can return with failure evidence.
175
+ **Drafted artifact**: consolidated entry text with provenance; note that two further recurrence citations would justify re-evaluation for EAGER-RULE.
207
176
 
208
- **Action**: No action needed. Invoke `/coding-philosophy` when this guidance is needed.
177
+ ### Example 3: Redundant prose RETIRE
209
178
 
210
- ### Example 5: Should OMIT ENTIRELY (In CLAUDE.md)
179
+ **Candidate**: "Call validation as inline `if` guard clauses, not helper calls before const definitions."
211
180
 
212
- **Content**: "Run test:unit and test:integration after each task"
181
+ - Redundancy: owned by ESLint rule `enforce-statement-order` (mechanical owner).
213
182
 
214
- **Assessment**:
183
+ **Rung**: RETIRE · **Scope**: `project`
184
+ **Rationale**: The lint already blocks every violation and its message explains the fix, so keeping the prose makes every session pay for knowledge the machine already enforces.
185
+ **Drafted artifact**: redundancy/staleness proof — "this invariant is owned by lint rule `enforce-statement-order` (custom ESLint plugin) since it was enabled; the prose section duplicates its diagnostic and can be deleted in the same PR that confirms the lint's error message teaches the remediation."
215
186
 
216
- - Non-Redundancy: Already in CLAUDE.md
187
+ ### Example 4: Procedural workflow SKILL
217
188
 
218
- **Decision**: OMIT ENTIRELY
189
+ **Candidate**: "Complete workflow for creating components with Container/View separation, memoization, JSDoc, and test structure."
219
190
 
220
- **Rationale**: This exact instruction is already in CLAUDE.md under the "Always" rules.
191
+ - Complexity: multi-step, procedural, recognizable trigger ("creating a component").
192
+ - Mechanically decidable: only partially — structure lints exist, but the workflow itself is procedure.
221
193
 
222
- **Action**: No action needed. CLAUDE.md is automatically loaded.
194
+ **Rung**: SKILL · **Scope**: `project`
195
+ **Rationale**: This is a repeatable procedure agents follow on a clear trigger, too long for a rule and wasted as always-loaded context; a skill loads it exactly when a component is being created.
196
+ **Drafted artifact**: skill outline — name, trigger-phrased description, and section skeleton (structure, memoization, docs, tests).
223
197
 
224
198
  ## Important Reminders
225
199
 
226
- 1. **Check for redundancy FIRST** - Before any other evaluation, verify it's not already covered
227
- 2. **Default to NOT creating skills** - Skills should be rare
228
- 3. **OMIT is a valid decision** - If it exists elsewhere, don't duplicate it
229
- 4. **Simple rules go in .claude/rules/PROJECT_RULES.md** - Not every rule needs a skill
230
- 5. **When in doubt, don't create a skill** - It's better to have fewer, high-quality skills
231
- 6. **Skills are for Claude, not humans** - Focus on what would help another Claude instance
232
-
233
- ## Existing Skills Reference
234
-
235
- Before creating a new skill, check these existing project skills:
236
-
237
- - `skill-creator` - Meta-skill for creating skills
238
- - `container-view-pattern` - React Container/View separation
239
- - `coding-philosophy` - Immutability and functional patterns
240
- - `cross-platform-compatibility` - React Native cross-platform patterns
241
- - `directory-structure` - Project organization
242
- - `expo-router-best-practices` - Routing patterns
243
- - `gluestack-nativewind` - UI component and styling patterns
244
-
245
- If the content overlaps with any of these, consider updating the existing skill instead of creating a new one.
200
+ 1. **Redundancy check (do first)** a candidate with an existing mechanical owner routes to RETIRE citing that mechanical owner, before any other evaluation.
201
+ 2. **Advisory-only, always** you recommend; the gardener (#1735) files tickets; humans gate; the factory executes. You never touch a file or tracker.
202
+ 3. **EXECUTABLE-CONTROL beats prose** — whenever a machine can check it, route it there, and always draft the remediation-teaching diagnostic (the context is relocated into the error message, not deleted).
203
+ 4. **The eager tier is earned, not defaulted** — demotion-biased; the default answer is NO without repeated-miss evidence.
204
+ 5. **When in doubt, route cheaper** KEEP-IN-LEDGER is the honest default; promotion can come back with evidence.
205
+ 6. **Rationales are for the gate-standing human** — three-audience readable, no jargon-only justifications.
@@ -0,0 +1,6 @@
1
+ ---
2
+ description: "Run one gardener cycle over this project's knowledge surfaces (the learnings ladder, PRD #1729): inventory ledger/rules/skills/wiki/mechanical controls, gather evidence, classify via the ladder router, and file human-gated tracker tickets — per-item PROMOTE/DEMOTE tickets, one CONFIRM/RETIRE batch ticket per run, upstream Lisa issues for upstream-scoped patterns. Everything is human-gated; the run only files marker-deduped tickets. Terminal states: nothing-needed | candidates-proposed | blocked."
3
+ argument-hint: "[max_candidates=10] [surface=ledger|rules|skills|wiki|all] [dry_run=true]"
4
+ ---
5
+
6
+ Use the /lisa-learnings-audit skill (the gardener) to run one audit cycle: inventory the knowledge surfaces, gather per-item evidence, classify candidates through the ladder router, and emit human-gated, marker-deduped tracker tickets, reporting the terminal state. $ARGUMENTS
@@ -0,0 +1,18 @@
1
+ # Promotion Contract (load-bearing)
2
+
3
+ When implementing a learnings-ladder **promotion ticket** — turning prose
4
+ knowledge into an executable control (lint / ast-grep / type / test / hook /
5
+ `package.lisa.json` force) — the change must be **atomic**: one PR that
6
+ **enables the control**, **fixes the existing violation population**, **ships a
7
+ remediation-teaching diagnostic** (violated invariant + why + concrete fix),
8
+ and **deletes the superseded prose**. A PR missing any of the four is
9
+ **rejected by rule** — promote-without-remove double-pays forever;
10
+ remove-without-diagnostic strands agents.
11
+
12
+ Eager-tier admission is **demotion-biased** and earned only by repeated-miss
13
+ evidence; the gardener audits the eager tier every run, including Lisa's own
14
+ shipped eager rules.
15
+
16
+ Full contract, diagnostic-quality bar, and the AC template the gardener embeds
17
+ in EXECUTABLE-CONTROL promotion tickets:
18
+ [reference/promotion-contract.md](../reference/promotion-contract.md).
@@ -0,0 +1,126 @@
1
+ # Promotion Contract
2
+
3
+ When a learnings-ladder promotion ticket (PRD #1729) is implemented — turning a
4
+ prose learning, rule section, or ledger entry into an **executable control**
5
+ (lint, ast-grep, type constraint, test, hook, or `package.lisa.json` force) —
6
+ the implementing PR is governed by this contract. The gardener
7
+ (`lisa-learnings-audit`) files the tickets; a human gates them by flipping
8
+ `status:ready`; the factory implements them like any other work item. This rule
9
+ is what makes the resulting PR reviewable **by rule, not by reviewer taste**.
10
+
11
+ ## The atomic promote-and-delete contract
12
+
13
+ A promotion PR must do **all four** of the following, in **one atomic PR**:
14
+
15
+ 1. **Enable the control.** The lint rule, ast-grep pattern, type constraint,
16
+ test, hook, or `package.lisa.json` force entry is active and blocking (CI
17
+ and/or local gates), not merely added in a warn-only or disabled state.
18
+ 2. **Fix the existing violation population.** Every current violation of the
19
+ new control in the repository is migrated in the same PR, so the control
20
+ lands green. Enabling a control against a red population either blocks all
21
+ unrelated work or forces a blanket ignore — both defeat the promotion.
22
+ 3. **Ship a remediation-teaching diagnostic.** The control's failure message
23
+ meets the diagnostic-quality bar below. The prose being deleted is not
24
+ lost — its content is **relocated into the error message**, so the agent
25
+ that trips the control learns the rule at exactly the moment it matters.
26
+ 4. **Delete the superseded prose.** The ledger entry, rules-file section,
27
+ memory note, or wiki duplication that the control replaces is removed in
28
+ the same PR. Keeping both means every session keeps paying context tax for
29
+ knowledge the machine already enforces.
30
+
31
+ **A PR missing any of the four is rejected by rule.** Reviewers (human, bot,
32
+ or verification lifecycle) cite this contract and reject — no case-by-case
33
+ judgment call is needed. The failure modes are structural, not stylistic:
34
+
35
+ - **Promote-without-remove double-pays forever**: the control enforces the
36
+ invariant while the prose keeps taxing every session, and the two drift
37
+ apart over time.
38
+ - **Remove-without-diagnostic strands agents**: the prose is gone, the control
39
+ fires, and the violator has no idea what invariant it tripped or how to
40
+ repair it.
41
+ - **Enable-without-population-fix** reds the build for everyone or breeds
42
+ blanket ignores that hollow the control out.
43
+
44
+ The same atomicity applies in reverse to **retirements** the gardener batches:
45
+ a prose deletion whose invariant is claimed to be mechanically owned must cite
46
+ the owning control (rule name, config location) in the deleting PR.
47
+
48
+ ## The diagnostic-quality bar
49
+
50
+ The error message must **teach the repair**, because it is the only surface
51
+ the violating agent will see. Every promoted control's diagnostic states:
52
+
53
+ 1. **The violated invariant** — what rule was broken, named precisely.
54
+ 2. **Why the invariant holds** — the causal story that used to live in the
55
+ prose (the incident, the failure class, the platform behavior).
56
+ 3. **The concrete fix** — what to change, ideally with the typical corrected
57
+ form inline.
58
+
59
+ Example shape (from this repo's own lint conventions):
60
+
61
+ > "Direct `process.env` access is forbidden. Config values bypass validation
62
+ > and typing when read ad hoc (past incidents: silent `undefined` in Lambda
63
+ > cold starts). Use the config module: `getStandaloneConfig().myValue`."
64
+
65
+ A diagnostic that merely restates the rule name ("no-direct-env: direct env
66
+ access is not allowed") fails the bar and fails the promotion PR with it.
67
+
68
+ ## Eager-tier admission policy (demotion-biased)
69
+
70
+ The eager rules tier (auto-loaded rules trees) charges **every session,
71
+ unconditionally**. Admission is therefore **earned, never defaulted**:
72
+
73
+ - A rule enters (or stays in) the eager tier only on cited **repeated-miss
74
+ evidence** — the knowledge was already retrievable (ledger, wiki, skill,
75
+ reference body) and agents still failed repeatedly because they did not
76
+ know to look. Absent that evidence, the content belongs on a cheaper rung.
77
+ - The policy is **demotion-biased**: when in doubt, move down the ladder.
78
+ A wrongly demoted rule earns its way back with fresh failure evidence; a
79
+ wrongly admitted rule taxes every session until someone notices.
80
+ - The gardener audits the eager tier **every run** — and that audit includes
81
+ **Lisa's own shipped eager rules**, not just host-project additions. No
82
+ rule is grandfathered; kernel rules demonstrating no repeated-miss evidence
83
+ get demotion tickets like any other candidate, filed upstream
84
+ (`template-candidate` or `self-hardening` lane as applicable).
85
+
86
+ ## AC template for EXECUTABLE-CONTROL promotion tickets
87
+
88
+ The gardener embeds the following snippet **verbatim** (markers included) into
89
+ the acceptance criteria of every EXECUTABLE-CONTROL promotion ticket, so
90
+ implementing agents receive the contract inside the work item itself:
91
+
92
+ <!-- promotion-contract-ac-template:start -->
93
+ ### Acceptance Criteria (promotion-to-control contract)
94
+
95
+ One atomic PR that satisfies all four legs — a PR missing any of the four is
96
+ rejected by rule (see the `promotion-contract` rule):
97
+
98
+ - [ ] **Enables the control** — the lint / ast-grep / type constraint / test /
99
+ hook / `package.lisa.json` force entry is active and blocking.
100
+ - [ ] **Fixes the existing violation population** — every current violation is
101
+ migrated in this same PR, so the control lands green with no blanket
102
+ ignores.
103
+ - [ ] **Ships a remediation-teaching diagnostic** — the failure message states
104
+ the violated invariant, why it holds, and the concrete fix.
105
+ - [ ] **Deletes the superseded prose** — the ledger entry / rules section this
106
+ control replaces is removed in this same PR, citing the new mechanical
107
+ owner.
108
+ <!-- promotion-contract-ac-template:end -->
109
+
110
+ Do not paraphrase, reorder, or partially quote the snippet when embedding it —
111
+ verbatim embedding is what keeps the contract identical across every ticket
112
+ and lets reviewers diff against a single source of truth.
113
+
114
+ ## Who consumes this rule
115
+
116
+ - **Implementing agents** working a promotion ticket: structure the PR around
117
+ the four legs before writing code.
118
+ - **Review flows** (human, CodeRabbit, `lisa-pull-request-review`,
119
+ verification lifecycle): reject a promotion PR missing any leg, citing this
120
+ rule.
121
+ - **The gardener** (`lisa-learnings-audit`): embeds the AC template above into
122
+ EXECUTABLE-CONTROL promotion tickets and applies the eager-tier admission
123
+ policy when auditing.
124
+ - **PROJECT_RULES.md owners**: that file is human-authored only; machine
125
+ writes go to the learnings ledger, and promotions out of it arrive as
126
+ gardener tickets governed by this contract.