@olegkoval/agent-skills 1.87.2 → 1.88.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 (60) hide show
  1. package/.github/prompts/crash-course.prompt.md +1 -1
  2. package/.github/prompts/obsidian-pr-sync.prompt.md +6 -6
  3. package/.kiro/steering/crash-course.md +1 -1
  4. package/.kiro/steering/obsidian-pr-sync.md +6 -6
  5. package/.windsurf/rules/crash-course.md +1 -1
  6. package/.windsurf/rules/obsidian-pr-sync.md +6 -6
  7. package/adapters/claude/olko-github-pr/skills/lekker-review/SKILL.md +6 -2
  8. package/adapters/claude/olko-github-pr/skills/lekker-review/references/comment-voice.md +97 -0
  9. package/adapters/claude/olko-github-pr/skills/lekker-review/references/github-post.md +61 -40
  10. package/adapters/claude/olko-github-pr/skills/lekker-review/references/output-format.md +1 -1
  11. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-conventions.md +10 -10
  12. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-implementation.md +2 -2
  13. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-quality.md +2 -2
  14. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-simplification.md +2 -2
  15. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-test-quality.md +3 -3
  16. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/profile.md +19 -175
  17. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/profiles/lekker-deep.md +5 -6
  18. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/profiles/lekker-medium.md +5 -6
  19. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/comment-facts.mjs +151 -0
  20. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/fixtures/revmux-report.json +1 -1
  21. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/risk-paths.mjs +5 -14
  22. package/adapters/claude/olko-obsidian/skills/obsidian-pr-sync/SKILL.md +6 -6
  23. package/adapters/claude/olko-reflection/skills/crash-course/SKILL.md +1 -1
  24. package/adapters/cursor/olko-obsidian/skills/obsidian-pr-sync/SKILL.md +6 -6
  25. package/adapters/cursor/olko-reflection/skills/crash-course/SKILL.md +1 -1
  26. package/adapters/grok/olko-obsidian/skills/obsidian-pr-sync/SKILL.md +6 -6
  27. package/adapters/grok/olko-reflection/skills/crash-course/SKILL.md +1 -1
  28. package/docs/superpowers/specs/2026-10-27-self-critique-v2-spec.md +1 -1
  29. package/package.json +1 -1
  30. package/plugins/olko-apple-kit/.claude-plugin/plugin.json +1 -1
  31. package/plugins/olko-creative/.claude-plugin/plugin.json +1 -1
  32. package/plugins/olko-garmin-kit/.claude-plugin/plugin.json +1 -1
  33. package/plugins/olko-git-tools/.claude-plugin/plugin.json +1 -1
  34. package/plugins/olko-github-pr/.claude-plugin/plugin.json +1 -1
  35. package/plugins/olko-github-pr/skills/lekker-review/README.md +11 -0
  36. package/plugins/olko-github-pr/skills/lekker-review/SKILL.md +6 -2
  37. package/plugins/olko-github-pr/skills/lekker-review/references/comment-voice.md +97 -0
  38. package/plugins/olko-github-pr/skills/lekker-review/references/github-post.md +61 -40
  39. package/plugins/olko-github-pr/skills/lekker-review/references/output-format.md +1 -1
  40. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-conventions.md +10 -10
  41. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-implementation.md +2 -2
  42. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-quality.md +2 -2
  43. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-simplification.md +2 -2
  44. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/lenses/lekker-test-quality.md +3 -3
  45. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/profile.md +19 -175
  46. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/profiles/lekker-deep.md +5 -6
  47. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/profiles/lekker-medium.md +5 -6
  48. package/plugins/olko-github-pr/skills/lekker-review/scripts/comment-facts.mjs +151 -0
  49. package/plugins/olko-github-pr/skills/lekker-review/scripts/fixtures/revmux-report.json +1 -1
  50. package/plugins/olko-github-pr/skills/lekker-review/scripts/risk-paths.mjs +5 -14
  51. package/plugins/olko-obsidian/.claude-plugin/plugin.json +1 -1
  52. package/plugins/olko-obsidian/skills/obsidian-pr-sync/SKILL.md +6 -6
  53. package/plugins/olko-product/.claude-plugin/plugin.json +1 -1
  54. package/plugins/olko-reflection/.claude-plugin/plugin.json +1 -1
  55. package/plugins/olko-reflection/skills/crash-course/SKILL.md +1 -1
  56. package/plugins/olko-release/.claude-plugin/plugin.json +1 -1
  57. package/plugins/olko-skill-meta/.claude-plugin/plugin.json +1 -1
  58. package/plugins/olko-web-ops/.claude-plugin/plugin.json +1 -1
  59. package/adapters/claude/olko-github-pr/skills/lekker-review/references/revmux/phase4-comparison.md +0 -40
  60. package/plugins/olko-github-pr/skills/lekker-review/references/revmux/phase4-comparison.md +0 -40
@@ -1,163 +1,18 @@
1
- # Teifi project profile
1
+ # Project profile
2
2
 
3
- This is the Teifi project profile, handed to revmux as `{{PROFILE}}` for the lekker-medium
4
- and lekker-deep review profiles. It concatenates the two files lekker-review itself reads as
5
- `teifi-rules.md` (hard rules, always critical) and `teifi-conventions.md` (soft house style).
3
+ This file is handed to revmux as `{{PROFILE}}` for the lekker-medium and
4
+ lekker-deep review profiles. It ships with generic default conventions only.
5
+ Put your team's own hard rules (always Critical) in `references/house-rules.md`
6
+ and, if you use revmux, add them to the top of this file as well, each with an
7
+ ID such as `TS-1` so findings can cite it. Where this file disagrees with a
8
+ reviewer's general taste, this file wins.
6
9
 
7
10
  ---
8
11
 
9
- # Teifi rules, taxonomy, and stack context
12
+ # Default conventions (styling, naming, comments, tests, hygiene)
10
13
 
11
- ## Teifi Hard Rules (apply during review AND development)
12
-
13
- These rules are non-negotiable. Violations are always **Critical** findings regardless of depth or other filters. Apply them when developing a feature or bugfix, not only during review.
14
-
15
- ### TS-1 - Type safety (TypeScript only)
16
-
17
- - No type casting (`as X`, `<X>expr`) - ask them if they are Harry Potter for casting spells.
18
- - No `any` - except in test files where types are genuinely hard to express; even there, blatantly omitted types (e.g. `any[]` on a known shaped list) must be flagged.
19
- - Every finding: quote the cast/`any`, explain the correct type, show the fix.
20
-
21
- ### TS-2 - No JavaScript files
22
-
23
- - No `.js` files may be added to any Teifi integrations repo.
24
- - Exception: Liquid themes (Online Store 2.0 Shopify themes) may contain `.js`.
25
- - If the PR adds a `.js` file to a non-theme repo, flag it as Critical: must be converted to `.ts`.
26
-
27
- ### GQL-1 - GraphQL NodesConnection pagination
28
-
29
- - Every query that uses a nodes connection (`nodes { ... }`) **must** include `pageInfo { hasNextPage endCursor }` alongside the nodes.
30
- - All remaining pages **must** be fetched - a single-page fetch with no loop/recursion is a bug.
31
- - The page size **must** be `250` (Shopify max). If any other value is used, a code comment explaining why is required; if no comment exists, flag it.
32
-
33
- ### PR-1 - PR title must be prefixed with Linear ticket(s)
34
-
35
- - PR title must start with `[GIC-123]` (or the relevant project prefix) in square brackets.
36
- - Go through the commit history: if merged PRs or commits reference Linear tickets in square brackets (`[GIC-123]`), all of them must appear comma-separated in the current PR title (e.g. `[GIC-123,GIC-124]`).
37
- - This is a **blocking** finding: display a prominent `⛔ CANNOT MERGE` warning and recommend the correct title prefix. Confidence score is not affected - this is a process rule, not a code quality signal.
38
-
39
- ### 1g. Repo placement check (Teifi multi-repo projects only)
40
-
41
- For any PR in a `Teifi-Digital/` repo, verify that the code being changed
42
- belongs in *this* repo and not a sibling repo.
43
-
44
- **Teifi repo taxonomy:**
45
-
46
- | Repo pattern | Purpose |
47
- |---|---|
48
- | `*-live` (e.g. `gic-live`, `evi-live`) | Shopify app: customer account extensions, app blocks, storefront extensions, Polaris admin UI |
49
- | `*-integrations` (e.g. `evi-integrations`; see the GIC exception below) | Backend ERP sync: cron jobs, orchestrator, BC/Sage/Jitterbit/ROI API clients |
50
- | `teifi-digital` / shared libs | Cross-project utilities, shared types |
51
-
52
- **Note:** `gic-integrations` has an `extensions/` folder containing legacy/reference extensions (e.g. `link-account-customer`), but **new customer account extensions for GIC should target `gic-live`** per project specs. Always check the Linear/Notion ticket for explicit repo path - don't infer from existing repo contents alone.
53
-
54
- **Action:** If the diff adds a new Shopify extension and the PR targets `*-integrations`, check the Linear/Notion spec for the explicit target directory. If the spec names `*-live`, flag it as a **Critical** placement error (`## 🏠 Wrong Repo`).
55
-
56
- Include: spec quote with correct path, which repo to target, and the risk (wrong Shopify Partner app, extension not published to correct store).
57
-
58
- ## Notes for Teifi / evi-integrations
59
-
60
- ### Standing coding rules (apply during development and review)
61
-
62
- | Rule | What | When to flag |
63
- |---|---|---|
64
- | TS-1 | No type casts (`as X`), no `any` | Critical; test files lenient on genuine unknowns only |
65
- | TS-2 | No `.js` files in integrations repos | Critical; Liquid themes exempt |
66
- | GQL-1 | nodes connections need `pageInfo`, all pages fetched, size=250 | Critical if pageInfo/pagination missing; Important if size≠250 without comment |
67
- | PR-1 | PR title must start with `[TICKET-NNN]`; include all commit-referenced tickets | Blocking - ⛔ CANNOT MERGE warning |
68
- | FLAG-1 | Reflag repos only: risky change should ship behind a feature flag | Non-blocking; `important` at most, usually `observation`. Never a `rule:` tag |
69
-
70
- These apply equally when you are writing a feature or bugfix - not only in review.
71
-
72
- ### FLAG-1 - Ship behind a feature flag (Reflag repos only)
73
-
74
- Applies ONLY where a `package.json` (any depth, excluding `node_modules`) depends on
75
- `@reflag/node-sdk` or `@teifi-digital/reflag-client`. Elsewhere there is no flag client,
76
- so the finding is unactionable and must not be raised.
77
-
78
- Flag it when any of these hold:
79
- - a client should validate it before everyone sees it
80
- - it changes data shape or what gets written
81
- - it touches orders, money, or fulfilment
82
- - it cannot be verified without real client data or volume
83
-
84
- Just ship it when: pure UI/copy with no data change; a bug fix that is strictly better
85
- and obviously correct; an internal/admin-only surface; fully covered by tests and
86
- verifiable in staging.
87
-
88
- Tie-breaker: would you be comfortable being the one to fix this forward at 2am?
89
- Yes → ship it. No → flag it.
90
-
91
- Deliberately NOT blocking, unlike TS-1/GQL-1/PR-1: whether something needs a flag is a
92
- rollout judgement, not a correctness violation, and a blocking comment on every
93
- borderline diff trains people to ignore the signal. Never invent a concrete flag key -
94
- keys must be confirmed against Reflag, so say a flag is needed without naming one.
95
-
96
- Related: a diff that BOTH adds a column/table AND changes what is read or written must
97
- be split into expand / migrate / read-switch / contract PRs (`important`, name the split).
98
-
99
- ### CONS-1 — One rule, two implementations, must agree
100
-
101
- When a change enforces the same business rule in two places that can both run
102
- for the same input — a client-side guard and the server-side validator behind
103
- it, a UI filter and its query, a webhook handler and the cron that backfills the
104
- same state — the two must make the same decision for every input class.
105
-
106
- Build both decision tables and compare them row by row, including the
107
- missing/undefined input, the not-applicable actor, the flag-off case and the
108
- error path. The server-side, unbypassable layer is authoritative; the advisory
109
- layer must match it. A client layer that is STRICTER than the server is a bug,
110
- not extra safety: it blocks work the system allows.
111
-
112
- Severity: critical when the divergence blocks a legitimate action or admits one
113
- that should be blocked; major when the authoritative layer is still right and
114
- only the message is wrong. Detail and the reporting format live in the
115
- `lekker-consistency` lens.
116
-
117
- ### Stack context to inform the review:
118
-
119
- - **Backend:** TypeScript, Node.js, Express, Prisma, pgtyped, PostgreSQL
120
- - **Frontend:** React, Shopify Polaris, Vite
121
- - **Shopify:** REST Admin + GraphQL Admin, Webhooks, Shopify Functions, genql
122
- - **External APIs:** Business Central (OAuth2, rate-limited), Salesforce GraphQL, ROI
123
- - **Infra:** Docker Compose locally; environment-var–driven cron syncs via `orchestrator.ts`
124
- - **Type gen pipeline:** pgtyped (SQL→TS), genql (GraphQL→TS), json2ts (schemas→TS) -
125
- check that generated files are regenerated when their sources change
126
- - **MCPs available:** Linear, Slack, Notion, Shopify Dev docs, Harvest, Sentry
127
-
128
- ### Repo taxonomy (for Step 1g placement check)
129
-
130
- **Per-project repo structure varies - always verify before flagging.**
131
-
132
- - For **EVI project**: `evi-integrations` = backend ERP sync only; `evi-live` = Shopify app (extensions, Polaris UI).
133
- - For **GIC project**: `gic-integrations` owns the ERP backend sync and retains
134
- legacy/reference Shopify extensions. New GIC customer account extensions belong
135
- in `gic-live`; do not treat the legacy `extensions/` folder as placement precedent.
136
- - For other projects (`rsl-*`, `elmt-*`, etc.): check the repo's `extensions/` folder
137
- presence before assuming a split - do not assume the `*-integrations` pattern always
138
- means backend-only.
139
-
140
- **Step 1g action**: Before flagging a placement mismatch, run:
141
-
142
- ```bash
143
- gh api "repos/<REPO_SLUG>/git/trees/HEAD" 2>/dev/null | python3 -c "
144
- import sys,json; t=json.load(sys.stdin).get('tree',[]); print([f['path'] for f in t if f['path']=='extensions'])
145
- "
146
- ```
147
-
148
- If `extensions/` exists in the target repo, placement may be intentional, but
149
- that alone is not precedent for new GIC extensions. Flag when the repo has no
150
- `extensions/` folder, or when a GIC spec targets the new extension to `gic-live`.
151
-
152
- ---
153
-
154
- # Teifi soft conventions (styling, naming, comments, tests, hygiene)
155
-
156
- Companion to `teifi-rules.md`. Those are the four HARD rules (TS-1, TS-2,
157
- GQL-1, PR-1) - always Critical. This file is the house style the Teifi
158
- plugin skills enforce during development (`teifi-dev:code-review`,
159
- `rename-pass`, `comment-stripper`, `unit-test-best-practices`). A review that
160
- misses them lets the same nits come back from the human reviewer.
14
+ These are default house-style conventions. A review that misses them lets the
15
+ same nits come back from the human reviewer.
161
16
 
162
17
  Severity ceiling: everything here is **idiomatic** unless a row says otherwise.
163
18
  Cite a precedent from the codebase where the row asks for one, and never
@@ -165,7 +20,7 @@ inflate a style deviation into Critical.
165
20
 
166
21
  ---
167
22
 
168
- ## 1. Naming matrix (source: `teifi-dev` rename-pass agent)
23
+ ## 1. Naming matrix
169
24
 
170
25
  Flag a name the diff INTRODUCES that breaks a row. Renaming is cheap in the
171
26
  diff, expensive later - but a rename is still a cost, so leave conforming
@@ -233,7 +88,7 @@ it to a human if it matters.
233
88
 
234
89
  ---
235
90
 
236
- ## 2. Comment policy (source: `teifi-dev` comment-stripper + code-review Cat. 5)
91
+ ## 2. Comment policy
237
92
 
238
93
  **Default: a comment should not exist.** It earns its place only by saying
239
94
  something the code *cannot*, and then in as few words as possible. Flag each
@@ -250,8 +105,8 @@ Flag a comment that:
250
105
  only for a non-obvious *contract*;
251
106
  - explains obvious syntax or a well-known API;
252
107
  - repeats a rationale stated elsewhere in the diff (keep ONE canonical place);
253
- - is changelog/AI noise - ticket IDs (`EVI-123`), person names, multi-paragraph
254
- "why we chose X" essays. A single `@see EVI-123` JSDoc tag is fine;
108
+ - is changelog/AI noise - ticket IDs (`PROJ-123`), person names, multi-paragraph
109
+ "why we chose X" essays. A single `@see PROJ-123` JSDoc tag is fine;
255
110
  - **references what the reader cannot see** - a removed line or a prior
256
111
  approach ("no longer using the old Y"). Source shows what the code *is*;
257
112
  - **documents invisible coupling** - "ordered this way because some other code
@@ -290,7 +145,7 @@ repo has a logger idiom - then cite it.
290
145
 
291
146
  ---
292
147
 
293
- ## 4. Test conventions (source: `teifi-dev:unit-test-best-practices`)
148
+ ## 4. Test conventions
294
149
 
295
150
  These are on top of the mutation/mock analysis the test-quality agent already
296
151
  does. Each is an `idiomatic` finding with the corrected code as the `fix`.
@@ -345,21 +200,10 @@ block.
345
200
 
346
201
  ## 6. Generated code - check the source, not the artifact
347
202
 
348
- The Teifi type-gen pipeline means several files must move together. When a
349
- source changes and its generated artifact does not (or vice-versa), that is an
350
- `important` finding:
351
-
352
- | Source changed | Artifact that must be regenerated |
353
- |---|---|
354
- | `services/db/queries/*.sql` | `services/db/queries/generated/` (pgtyped) |
355
- | `services/gql/queries/*.graphql` | `services/gql/queries/generated/queries.ts` (genql) |
356
- | `schemas/*.json` | `schemas/generated/` (json2ts) |
357
- | `prisma/schema.prisma` | a migration in `prisma/migrations/` + Prisma client |
203
+ When a source file changes and the artifact generated from it does not (or
204
+ vice versa), that is an `important` finding: for example a changed `.sql`,
205
+ `.graphql`, JSON schema or ORM schema without its regenerated output, or a
206
+ migration missing for a schema change.
358
207
 
359
208
  Never review the *content* of a generated file as if it were hand-written - no
360
209
  naming, comment, or complexity findings inside `generated/`. Review the source.
361
-
362
- Related hard convention (project CLAUDE.md): Shopify Admin API calls go through
363
- the genql client (`gql.<file>.<query>.run(graphql, vars)`) - a hand-rolled
364
- `fetch` to `/admin/api/…/graphql.json` is an `important` finding even for a
365
- one-off probe.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Teifi deep review: lekker-medium (incl. cross-layer consistency) plus revmux's own bugs+impl second opinion, claude-only
2
+ description: Deep review: lekker-medium (incl. cross-layer consistency) plus revmux's own bugs+impl second opinion, claude-only
3
3
  model: claude/sonnet:medium
4
4
  agents:
5
5
  - {name: quality+impl, lenses: [lekker-quality, lekker-implementation], color: cyan}
@@ -26,8 +26,8 @@ Every item below is a **path**, not the text it names. Read the file or director
26
26
  - `{{SCOPE}}`: what is under review and the command that produces the diff. Read this first and run
27
27
  that command yourself.
28
28
  - `{{GOAL}}`: what the change is trying to achieve.
29
- - `{{PROFILE}}`: Teifi's own rules and conventions. Where they disagree with your general taste,
30
- they win. This is also where the hard-rule text (TS-1, TS-2, GQL-1, PR-1) and the Teifi
29
+ - `{{PROFILE}}`: The team's own rules and conventions. Where they disagree with your general taste,
30
+ they win. This is also where any hard-rule text and the default
31
31
  conventions (naming matrix, comment policy, hygiene severities, test conventions) live in full.
32
32
  - `{{CONTEXT}}`: a directory of supporting material: ticket text, design notes, spec excerpts, CI
33
33
  status, Sentry signals, existing review comments.
@@ -51,10 +51,9 @@ a finding; leave it out.
51
51
 
52
52
  ## Hard-rule findings are policy, not a runtime question
53
53
 
54
- Findings titled `[TS-1]`, `[TS-2]`, `[GQL-1]`, or `[PR-1]` are Teifi's own policy violations,
54
+ Findings titled with a hard-rule ID from `{{PROFILE}}` are the team's own policy violations,
55
55
  defined in full in `{{PROFILE}}`. Confirm one when the quoted code shows the pattern the rule
56
- names: a cast, an `any`, a `.js` file outside a theme repo, a missing `pageInfo`/pagination, a PR
57
- title missing its ticket prefix. Never rate a hard-rule finding by its runtime impact and never mark
56
+ names. Never rate a hard-rule finding by its runtime impact and never mark
58
57
  it immaterial for lack of one: the rule itself is the standard, and violating it is always critical,
59
58
  independent of whether it happens to fail at runtime today.
60
59
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Teifi medium-depth review: five claude agents incl. cross-layer consistency, adversarial second pass, claude-only
2
+ description: Medium-depth review: five claude agents incl. cross-layer consistency, adversarial second pass, claude-only
3
3
  model: claude/sonnet:medium
4
4
  agents:
5
5
  - {name: quality+impl, lenses: [lekker-quality, lekker-implementation], color: cyan}
@@ -25,8 +25,8 @@ Every item below is a **path**, not the text it names. Read the file or director
25
25
  - `{{SCOPE}}`: what is under review and the command that produces the diff. Read this first and run
26
26
  that command yourself.
27
27
  - `{{GOAL}}`: what the change is trying to achieve.
28
- - `{{PROFILE}}`: Teifi's own rules and conventions. Where they disagree with your general taste,
29
- they win. This is also where the hard-rule text (TS-1, TS-2, GQL-1, PR-1) and the Teifi
28
+ - `{{PROFILE}}`: The team's own rules and conventions. Where they disagree with your general taste,
29
+ they win. This is also where any hard-rule text and the default
30
30
  conventions (naming matrix, comment policy, hygiene severities, test conventions) live in full.
31
31
  - `{{CONTEXT}}`: a directory of supporting material: ticket text, design notes, spec excerpts, CI
32
32
  status, Sentry signals, existing review comments.
@@ -50,10 +50,9 @@ a finding; leave it out.
50
50
 
51
51
  ## Hard-rule findings are policy, not a runtime question
52
52
 
53
- Findings titled `[TS-1]`, `[TS-2]`, `[GQL-1]`, or `[PR-1]` are Teifi's own policy violations,
53
+ Findings titled with a hard-rule ID from `{{PROFILE}}` are the team's own policy violations,
54
54
  defined in full in `{{PROFILE}}`. Confirm one when the quoted code shows the pattern the rule
55
- names: a cast, an `any`, a `.js` file outside a theme repo, a missing `pageInfo`/pagination, a PR
56
- title missing its ticket prefix. Never rate a hard-rule finding by its runtime impact and never mark
55
+ names. Never rate a hard-rule finding by its runtime impact and never mark
57
56
  it immaterial for lack of one: the rule itself is the standard, and violating it is always critical,
58
57
  independent of whether it happens to fail at runtime today.
59
58
 
@@ -0,0 +1,151 @@
1
+ #!/usr/bin/env node
2
+ // Fact lock for the comment polish pass (references/github-post.md Step 2b).
3
+ // A rewrite for readability must not change what a comment claims: a dropped
4
+ // line number or a softened "will" sends the author to the wrong fix. The
5
+ // polish agent is asked to keep facts; this script checks it did, and falls
6
+ // back to the draft comment for every one that drifted.
7
+ //
8
+ // node comment-facts.mjs <draft.json> <polished.json> --out <final.json>
9
+ //
10
+ // Both inputs are review payloads ({ body, comments: [{ path, line, side, body }] }).
11
+ // The final payload is the draft with each comment body replaced by its
12
+ // polished version when the facts match. The review body is never taken from
13
+ // the polished payload. Prints a one-line JSON summary on stdout.
14
+ import { readFileSync, realpathSync, renameSync, writeFileSync } from 'node:fs'
15
+ import { fileURLToPath } from 'node:url'
16
+
17
+ export const MAX_PROSE_CHARS = 1200
18
+
19
+ // CommonMark: a fence closes only on its own line with at least as many
20
+ // backticks as it opened with, and an inline code span closes on a backtick
21
+ // run of the same length, so a backtick inside the code cannot end it early.
22
+ const FENCE = /^(`{3,})[^\n]*\n[\s\S]*?^\1`*[ \t]*$/gm
23
+ const INLINE_CODE = /(?<!`)(`+)(?!`)[\s\S]*?[^`]\1(?!`)/g
24
+ const URL = /https?:\/\/[^\s)>\]]+/g
25
+ const MARKER = /<!--\s*lekker:[\w-]+\s*-->/g
26
+ const MARKER_LINE = /^<!--\s*lekker:[\w-]+\s*-->$/
27
+ // A leading minus counts as part of the number only when it is not a joiner
28
+ // ("2-4", "FO-1"), so "-1" and "1" are different facts.
29
+ const NUMBER = /(?:(?<![\w)])-)?\d+(?:[.,]\d+)*/g
30
+ // Code named in plain prose, outside backticks: file references
31
+ // (`src/cache.js:42`) and camelCase, PascalCase-with-inner-capital or
32
+ // snake_case names.
33
+ const FILE_REF = /(?:[\w.-]+\/)*[\w.-]+\.(?:ts|tsx|js|jsx|mjs|cjs|json|md|py|rb|go|rs|java|kt|swift|sql|graphql|ya?ml|sh|css|scss|html|liquid|toml)(?::\d+(?:-\d+)?)?\b/g
34
+ const IDENTIFIER = /\b(?:[a-z]+[A-Z][A-Za-z0-9]*|[A-Z][a-z0-9]+[A-Z][A-Za-z0-9]*|[A-Za-z][A-Za-z0-9]*_[A-Za-z0-9_]+)\b/g
35
+ // Claim polarity and strength: a rewrite that drops a "not" or turns "will"
36
+ // into "may" changes the finding even when every token above survives.
37
+ const NEGATION = /\b(?:not|no|never|none|nothing|cannot|without)\b|n't\b/gi
38
+ const MODAL = /\b(?:will|would|may|might|can|could|must|should|always|sometimes|often|only)\b/gi
39
+
40
+ const matches = (text, re) => text.match(re) ?? []
41
+ const sorted = values => [...values].sort()
42
+ const unique = values => sorted(new Set(values))
43
+ const stripAll = (text, patterns) => patterns.reduce((acc, re) => acc.replace(re, ' '), text)
44
+
45
+ // What a rewrite may not change. Code blocks must match one for one; inline
46
+ // code, links and prose numbers as sets, so a rewrite may repeat an identifier
47
+ // to make a sentence readable but may not drop or introduce one.
48
+ export function extractFacts(text) {
49
+ const fences = matches(text, FENCE)
50
+ const withoutFences = stripAll(text, [FENCE])
51
+ const codes = matches(withoutFences, INLINE_CODE)
52
+ const urls = matches(withoutFences, URL)
53
+ const markers = matches(text, MARKER)
54
+ const prose = stripAll(withoutFences, [INLINE_CODE, URL, MARKER])
55
+ return {
56
+ fences: sorted(fences),
57
+ codes: unique(codes),
58
+ urls: unique(urls),
59
+ markers,
60
+ numbers: unique(matches(prose, NUMBER)),
61
+ names: unique([...matches(prose, FILE_REF), ...matches(stripAll(prose, [FILE_REF]), IDENTIFIER)]),
62
+ negations: matches(prose, NEGATION).length,
63
+ modals: unique(matches(prose, MODAL).map(m => m.toLowerCase())),
64
+ proseChars: prose.trim().length,
65
+ lastLine: text.trimEnd().split('\n').at(-1).trim(),
66
+ }
67
+ }
68
+
69
+ const sameList = (a, b) => a.length === b.length && a.every((v, i) => v === b[i])
70
+ const missingFrom = (a, b) => a.filter(v => !b.includes(v))
71
+
72
+ const FACT_CHECKS = [
73
+ ['suggestion or code block changed', (d, p) => sameList(d.fences, p.fences)],
74
+ ['inline code changed', (d, p) => sameList(d.codes, p.codes)],
75
+ ['link changed', (d, p) => sameList(d.urls, p.urls)],
76
+ ['file reference or code name in prose changed', (d, p) => sameList(d.names, p.names)],
77
+ ['negation added or dropped', (d, p) => d.negations === p.negations],
78
+ ['claim strength changed (will, may, must, ...)', (d, p) => sameList(d.modals, p.modals)],
79
+ ['lekker marker changed', (d, p) => sameList(d.markers, p.markers)],
80
+ ['lekker marker not on the last line', (d, p) => d.markers.length === 0 || MARKER_LINE.test(p.lastLine)],
81
+ [`longer than ${MAX_PROSE_CHARS} characters of prose`, (_d, p) => p.proseChars <= MAX_PROSE_CHARS],
82
+ ]
83
+
84
+ export function factDrift(draftText, polishedText) {
85
+ if (typeof polishedText !== 'string' || polishedText.trim() === '') return ['polished body missing']
86
+ const d = extractFacts(draftText)
87
+ const p = extractFacts(polishedText)
88
+ const failed = FACT_CHECKS.filter(([, ok]) => !ok(d, p)).map(([reason]) => reason)
89
+ const emDash = polishedText.includes('—') && !draftText.includes('—') ? ['em dash added'] : []
90
+ const lost = missingFrom(d.numbers, p.numbers)
91
+ const added = missingFrom(p.numbers, d.numbers)
92
+ const numbers = lost.length || added.length ? [`numbers lost [${lost}] added [${added}]`] : []
93
+ return [...failed, ...emDash, ...numbers]
94
+ }
95
+
96
+ const sameAnchor = (a, b) => b && a.path === b.path && a.line === b.line && (a.side ?? 'RIGHT') === (b.side ?? 'RIGHT')
97
+
98
+ export function mergeComment(draft, polished) {
99
+ if (!sameAnchor(draft, polished)) return { comment: draft, reasons: ['anchor (path, line or side) changed'] }
100
+ const reasons = factDrift(draft.body, polished.body)
101
+ return reasons.length ? { comment: draft, reasons } : { comment: { ...draft, body: polished.body }, reasons }
102
+ }
103
+
104
+ export function mergePayload(draft, polished) {
105
+ const drafts = draft.comments ?? []
106
+ const polishedComments = polished?.comments ?? []
107
+ if (polishedComments.length !== drafts.length) {
108
+ return {
109
+ payload: draft,
110
+ summary: { comments: drafts.length, polished: 0, reverted: drafts.length, reason: 'comment count changed', details: [] },
111
+ }
112
+ }
113
+ const results = drafts.map((c, i) => ({ ...mergeComment(c, polishedComments[i]), index: i }))
114
+ const details = results
115
+ .filter(r => r.reasons.length)
116
+ .map(r => ({ index: r.index, path: r.comment.path, line: r.comment.line, reasons: r.reasons }))
117
+ return {
118
+ payload: { ...draft, comments: results.map(r => r.comment) },
119
+ summary: { comments: drafts.length, polished: drafts.length - details.length, reverted: details.length, details },
120
+ }
121
+ }
122
+
123
+ function main(argv) {
124
+ const outAt = argv.indexOf('--out')
125
+ const [draftPath, polishedPath] = argv.filter((_, i) => i !== outAt && i !== outAt + 1)
126
+ const outPath = outAt === -1 ? undefined : argv[outAt + 1]
127
+ if (!draftPath || !polishedPath || !outPath) {
128
+ console.error('usage: comment-facts.mjs <draft.json> <polished.json> --out <final.json>')
129
+ process.exit(2)
130
+ }
131
+ const draft = JSON.parse(readFileSync(draftPath, 'utf8'))
132
+ const polished = (() => {
133
+ try { return JSON.parse(readFileSync(polishedPath, 'utf8')) } catch { return null }
134
+ })()
135
+ const { payload, summary } = polished
136
+ ? mergePayload(draft, polished)
137
+ : { payload: draft, summary: { comments: (draft.comments ?? []).length, polished: 0, reverted: (draft.comments ?? []).length, reason: 'polished payload unreadable', details: [] } }
138
+ // Write then rename: a failed write must not leave a truncated payload in
139
+ // place of the one Step 3 posts.
140
+ const tmpPath = `${outPath}.tmp-${process.pid}`
141
+ writeFileSync(tmpPath, `${JSON.stringify(payload, null, 2)}\n`)
142
+ renameSync(tmpPath, outPath)
143
+ console.log(JSON.stringify(summary))
144
+ }
145
+
146
+ // Compare real paths: a skill installed through a symlinked directory runs
147
+ // with argv[1] on the link while import.meta.url holds the resolved file.
148
+ const isEntrypoint = () => {
149
+ try { return realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url)) } catch { return false }
150
+ }
151
+ if (isEntrypoint()) main(process.argv.slice(2))
@@ -36,7 +36,7 @@
36
36
  "severity": "minor",
37
37
  "confidence": 0.6,
38
38
  "title": "Log helper name does not follow the naming matrix",
39
- "body": "getLogger performs no I/O, per teifi-conventions section 1 it should not be prefixed get.",
39
+ "body": "getLogger performs no I/O, per org-conventions section 1 it should not be prefixed get.",
40
40
  "fix": "Rename to buildLogger.",
41
41
  "sources": ["simpl+conventions"],
42
42
  "lenses": ["lekker-conventions"],
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // Path-based risk for AUTO-DEPTH. Size alone misses the small PRs that matter:
3
- // a 10-line change to a workflow file, a session check or a P21 mapping.
3
+ // a 10-line change to a workflow file or a session check.
4
4
  //
5
5
  // Usage:
6
6
  // node risk-paths.mjs [--diff <pr.diff>] -- <changed-file>...
@@ -8,7 +8,7 @@
8
8
  // Use a shell-free process API for file arguments; never interpolate PR paths.
9
9
  //
10
10
  // Prints {"deep": bool, "needsHumanReview": bool, "categories": [{category, files}]}.
11
- // `--diff` also lets the identifier `p21` count when it only appears in added lines.
11
+ // `--diff` is still accepted so existing callers keep working; no rule reads it.
12
12
 
13
13
  import { readFileSync } from 'node:fs';
14
14
  import { fileURLToPath } from 'node:url';
@@ -18,25 +18,16 @@ export const RISK_RULES = [
18
18
  { category: 'auth', test: (f) => /(^|[/._-])(auth|authn|authz|authenticate|authenticated|authentication|authorize|authorized|authorization|oauth|session|sessions|permission|permissions|rbac|acl|jwt|login)([/._-]|$)/i.test(f.replace(/([a-z0-9])([A-Z])/g, '$1-$2')) },
19
19
  { category: 'billing', test: (f) => /(billing|payment|payments|invoice|invoices|checkout|stripe|subscription)/i.test(f) },
20
20
  { category: 'installer', test: (f) => /(^|\/)(install|setup|bootstrap|preinstall|postinstall)(?:[^/.]*|[^/]*\.(sh|bash|zsh|ps1|js|mjs|cjs|ts|py|bat|cmd))$/i.test(f) },
21
- { category: 'p21', test: (f) => /p21/i.test(f) },
22
21
  ];
23
22
 
24
- export function addedLinesMention(diffText, pattern) {
25
- return diffText.split('\n').some((l) => l.startsWith('+') && !l.startsWith('+++') && pattern.test(l));
26
- }
27
-
28
- export function riskPaths(files, diffText = '') {
23
+ export function riskPaths(files) {
29
24
  const categories = RISK_RULES
30
25
  .map((rule) => ({ category: rule.category, files: files.filter(rule.test) }))
31
- .map((c) => (c.category === 'p21' && c.files.length === 0 && addedLinesMention(diffText, /p21/i)
32
- ? { ...c, files: ['(identifier p21 in added lines)'] }
33
- : c))
34
26
  .filter((c) => c.files.length > 0);
35
27
  return { deep: categories.length > 0, needsHumanReview: categories.length > 0, categories };
36
28
  }
37
29
 
38
30
  function main(argv) {
39
- let diffText = '';
40
31
  let inputMode = null;
41
32
  const files = [];
42
33
  for (let i = 0; i < argv.length; i++) {
@@ -47,7 +38,7 @@ function main(argv) {
47
38
  }
48
39
  if (arg === '--diff') {
49
40
  if (!argv[i + 1] || argv[i + 1] === '--') throw new Error('--diff requires a file');
50
- diffText = readFileSync(argv[++i], 'utf8');
41
+ i++;
51
42
  } else if (arg === '--stdin' || arg === '--stdin0') {
52
43
  if (inputMode) throw new Error('Choose only one stdin mode');
53
44
  inputMode = arg;
@@ -61,7 +52,7 @@ function main(argv) {
61
52
  if (files.length) throw new Error('Do not mix stdin and file arguments');
62
53
  files.push(...readFileSync(0, 'utf8').split(inputMode === '--stdin0' ? '\0' : '\n').filter(Boolean));
63
54
  }
64
- console.log(JSON.stringify(riskPaths(files, diffText)));
55
+ console.log(JSON.stringify(riskPaths(files)));
65
56
  }
66
57
 
67
58
  if (process.argv[1] === fileURLToPath(import.meta.url)) main(process.argv.slice(2));
@@ -41,7 +41,7 @@ Before running, confirm:
41
41
  - `VAULT_PEOPLE`: derive as `${vault_path}/Lead/People`
42
42
  - `SELF_EMAIL`: the user's calendar email address, used to exclude the user from attendee processing
43
43
  - `GH_USERNAME`: GitHub login to exclude self-authored PRs (e.g. `oleg-koval`)
44
- - `ORG_PREFIX`: org name to group as "Work" (e.g. `Teifi-Digital`); everything else goes to "Personal"
44
+ - `ORG_PREFIX`: org name to group as "Work" (e.g. `acme-org`); everything else goes to "Personal"
45
45
 
46
46
  If not specified by the user, infer from context (git config, existing vault files).
47
47
 
@@ -80,9 +80,9 @@ For each unique author login, resolve a display name for the Obsidian wiki-link:
80
80
  gh api /users/<login> --jq '.name // .login'
81
81
  ```
82
82
 
83
- If the API returns a name, use it (e.g. `Rutger Klaassen`). If it returns null, fall
84
- back to the login with first letter uppercased. This gives `[[Rutger Klaassen]]` or
85
- `[[Merlijnmacgillavry]]`.
83
+ If the API returns a name, use it (e.g. `Sam Roe`). If it returns null, fall
84
+ back to the login with first letter uppercased. This gives `[[Sam Roe]]` or
85
+ `[[Alexdoe]]`.
86
86
 
87
87
  Batch these lookups: run them in parallel if possible to keep the sync fast.
88
88
 
@@ -114,7 +114,7 @@ Rules:
114
114
 
115
115
  **Example line:**
116
116
  ```
117
- - [ ] [RSL-108] Image sync from InRiver by [[Merlijn Mac Gillavry]] (12 days old ⚠️)
117
+ - [ ] [PROJ-108] Image sync from the PIM by [[Alex Doe]] (12 days old ⚠️)
118
118
  ```
119
119
 
120
120
  ## Step 6: Write to today's daily note
@@ -216,7 +216,7 @@ next-1-1:
216
216
 
217
217
  - [[Lead/Daily/<TODAY>]] - <Event title>
218
218
 
219
- <!-- Classify: teifi.com email → Peers or Reports · external email → Stakeholders -->
219
+ <!-- Classify: example.com email → Peers or Reports · external email → Stakeholders -->
220
220
  ```
221
221
 
222
222
  Do not add `## Code Review Signals`; that section is for direct reports only.
@@ -35,7 +35,7 @@ Two things make this skill better than pasting a prompt into a chat window:
35
35
  Never teach from memory alone. First pin the topic, then go read the ground truth.
36
36
 
37
37
  1. **Confirm scope in one line.** What exactly are we learning, to what depth, and
38
- why? If the request is vague ("learn the ELC project"), ask one clarifying
38
+ why? If the request is vague ("learn the Example project"), ask one clarifying
39
39
  question, then proceed. Do not over-interview.
40
40
 
41
41
  2. **Gather real sources** appropriate to the topic. Spend a few minutes here; it
@@ -41,7 +41,7 @@ Before running, confirm:
41
41
  - `VAULT_PEOPLE`: derive as `${vault_path}/Lead/People`
42
42
  - `SELF_EMAIL`: the user's calendar email address, used to exclude the user from attendee processing
43
43
  - `GH_USERNAME`: GitHub login to exclude self-authored PRs (e.g. `oleg-koval`)
44
- - `ORG_PREFIX`: org name to group as "Work" (e.g. `Teifi-Digital`); everything else goes to "Personal"
44
+ - `ORG_PREFIX`: org name to group as "Work" (e.g. `acme-org`); everything else goes to "Personal"
45
45
 
46
46
  If not specified by the user, infer from context (git config, existing vault files).
47
47
 
@@ -80,9 +80,9 @@ For each unique author login, resolve a display name for the Obsidian wiki-link:
80
80
  gh api /users/<login> --jq '.name // .login'
81
81
  ```
82
82
 
83
- If the API returns a name, use it (e.g. `Rutger Klaassen`). If it returns null, fall
84
- back to the login with first letter uppercased. This gives `[[Rutger Klaassen]]` or
85
- `[[Merlijnmacgillavry]]`.
83
+ If the API returns a name, use it (e.g. `Sam Roe`). If it returns null, fall
84
+ back to the login with first letter uppercased. This gives `[[Sam Roe]]` or
85
+ `[[Alexdoe]]`.
86
86
 
87
87
  Batch these lookups: run them in parallel if possible to keep the sync fast.
88
88
 
@@ -114,7 +114,7 @@ Rules:
114
114
 
115
115
  **Example line:**
116
116
  ```
117
- - [ ] [RSL-108] Image sync from InRiver by [[Merlijn Mac Gillavry]] (12 days old ⚠️)
117
+ - [ ] [PROJ-108] Image sync from the PIM by [[Alex Doe]] (12 days old ⚠️)
118
118
  ```
119
119
 
120
120
  ## Step 6: Write to today's daily note
@@ -216,7 +216,7 @@ next-1-1:
216
216
 
217
217
  - [[Lead/Daily/<TODAY>]] - <Event title>
218
218
 
219
- <!-- Classify: teifi.com email → Peers or Reports · external email → Stakeholders -->
219
+ <!-- Classify: example.com email → Peers or Reports · external email → Stakeholders -->
220
220
  ```
221
221
 
222
222
  Do not add `## Code Review Signals`; that section is for direct reports only.
@@ -35,7 +35,7 @@ Two things make this skill better than pasting a prompt into a chat window:
35
35
  Never teach from memory alone. First pin the topic, then go read the ground truth.
36
36
 
37
37
  1. **Confirm scope in one line.** What exactly are we learning, to what depth, and
38
- why? If the request is vague ("learn the ELC project"), ask one clarifying
38
+ why? If the request is vague ("learn the Example project"), ask one clarifying
39
39
  question, then proceed. Do not over-interview.
40
40
 
41
41
  2. **Gather real sources** appropriate to the topic. Spend a few minutes here; it