Skip to content

Commit fea5c19

Browse files
authored
feat(skills): pf-4236 zod integration reports (#206)
* review-zod-integration, review zod release notes, audit use, propose updates * add-docs-links, minor alignment updates for skill consistency
1 parent fce59ff commit fea5c19

8 files changed

Lines changed: 387 additions & 4 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ coverage/
6161
# agent
6262
.archive
6363
.agent
64+
reports/
65+
.output.txt
66+
poc/

cspell.config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
"onsessioninitialized",
1313
"onsessionclosed",
1414
"patternfly",
15+
"prefault",
1516
"rereview",
1617
"rsort",
1718
"sparkline",
1819
"streamable",
20+
"treeify",
1921
"unrepresentable",
2022
"unsub"
2123
]

guidelines/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Agent-specific guidelines for the PatternFly MCP project, optimized for machine
1919
### Skills
2020

2121
- [Add docs links](./skills/add-docs-links/SKILL.md) - Add documentation links to `src/docs.json` in a structured way (format, duplicate check, URL confirmation, tests)
22+
- [Review Zod integration](./skills/review-zod-integration/SKILL.md) - Review Zod dependency bumps, map release notes to PF MCP, run tests, write `reports/YYYYMMDD-HHMMSS-zod-{semver}-update-report.md` (UTC)
2223

2324
**Note:** `guidelines/skills/` is the canonical location for skills. Repo symlinks point here so agents can discover them: `.agents/skills` (Cursor), `.claude/skills` (Claude). The `.agent/` directory (no “s”) is reserved for each developer’s local work and is off limits—do not use it for shared skills or guidelines.
2425

@@ -36,6 +37,7 @@ Agents should use these phrases as signals to consult specific documentation and
3637
| **"review development guide"** | Review `docs/development.md` for CLI, API, and plugin authoring. |
3738
| **"create an example tool plugin"** | Review `guidelines/agent_coding.md`, `docs/development.md`, `docs/examples/*`, and `src/*` for context, coding standards, and existing example formats. |
3839
| **"add documentation links"** / **"add doc entries"** / **"register docs"** / **"update docs.json"** / **"contribute to docs.json"** | Follow `guidelines/skills/add-docs-links/SKILL.md`: docs.json format, duplicate check, raw URL confirmation, then run unit tests and update meta. |
40+
| **"review zod"** / **"zod upgrade"** / **"zod integration review"** / **"zod update report"** | Follow `guidelines/skills/review-zod-integration/SKILL.md`: release notes vs codebase, tests, report at `reports/YYYYMMDD-HHMMSS-zod-{semver}-update-report.md` (UTC). |
3941
| **"troubleshoot server"** / **"debug server"** | Review `docs/usage.md#troubleshooting` and the PatternFly MCP server resource `patternfly://context` |
4042

4143
## Guidelines Processing Order

guidelines/agent_coding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Centralized utilities in `server.helpers.ts`, `server.schema.ts`, and `server.ge
155155
- **Helpers**: Use `stringJoin.newline()`, `freezeObject()`, `timeoutFunction()`, and `mergeObjects()`.
156156
- **Schemas**: Use `normalizeInputSchema(schema)` to convert JSON Schema or Zod shapes into valid Zod instances.
157157
- **Type Guards**: Use `isPlainObject()`, `isZodSchema()`, and `isErrorLike()` for runtime narrowing.
158-
- **Zod Detection**: Robustly detect Zod schemas by checking for internal brands: `_def` for Zod v3 and `_zod` for Zod v4. Avoid relying solely on `parse()` or `safeParse()` methods.
158+
- **Zod Detection**: Robustly detect Zod schemas by checking for the public `.def` property (Zod v4+) or internal brands: `_zod` (v4) and `_def` (v3). Avoid relying solely on `parse()` or `safeParse()` methods.
159159
- **Immutability**: Options and Session objects are **frozen**; use `structuredClone()` before modification.
160160

161161
### 3.5 Validation and Sanitization

guidelines/skills/add-docs-links/SKILL.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ description: Maintains the PatternFly MCP documentation catalog in src/docs.json
77

88
## When to use
99

10-
User wants to **add**, **change**, or **remove** rows in `src/docs.json`, or fix broken / unreachable catalog links. They may paste **any GitHub URL** (blob or raw); you convert blob → raw, pick refs, verify reachability, shape entries, update `meta` and `generated`, and run tests.
10+
- User wants to **add**, **change**, or **remove** rows in `src/docs.json`, or fix broken / unreachable catalog links
11+
- User provides a GitHub URL (blob or raw) to register in the catalog — convert blob → raw, pick refs, verify reachability, shape entries, update `meta` and `generated`, and run tests
12+
- User asks to update or fix `docs.json` entries, contribute to the docs catalog, or align with docs.json tests and CI audit
1113

1214
For **edits or removals**: find the row by `path` and/or its `docs` key; update `meta` / `generated`; run tests. Same rules as adds: whitelist, unique `path`, and `src/__tests__/docs.json.test.ts` (including `baseHashes`).
1315

@@ -20,7 +22,7 @@ For **edits or removals**: find the row by `path` and/or its `docs` key; update
2022
- New ref for an existing repo: resolve SHA (e.g. commits API) or use a stable tag.
2123

2224
2. **Whitelist**
23-
- `path` must match `patternflyOptions.urlWhitelist` in `src/options.defaults.ts`. See [reference.md](reference.md#url-whitelist-allowed-domains). Use **https** only. Do not widen the whitelist in a catalog-only PR.
25+
- `path` must match `patternflyOptions.urlWhitelist` in `src/options.defaults.ts`. See [reference.md — URL whitelist](reference.md#url-whitelist-allowed-domains). Use **https** only. Do not widen the whitelist in a catalog-only PR.
2426

2527
3. **Reachability**
2628
- Response must be 2xx (e.g. `curl -sI -o /dev/null -w "%{http_code}" "<url>"`). If not, fix ref or path; do not add a dead link.
@@ -47,6 +49,10 @@ For **edits or removals**: find the row by `path` and/or its `docs` key; update
4749

4850
**CI:** `.github/workflows/audit.yml` on PRs that touch `src/docs.json` or `tests/audit/**`.
4951

52+
## Additional resources
53+
54+
- [reference.md](reference.md) — entry format, top-level structure, URL whitelist, duplicate check, ref lookup, unit test constraints, example entry
55+
5056
## Quick checks
5157

5258
- [ ] Blob → raw; ref reused per repo when possible.

guidelines/skills/add-docs-links/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# docs.json Reference
1+
# Add docs links — Reference (PatternFly MCP)
22

33
## File location
44

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: review-zod-integration
3+
description: Reviews Zod dependency upgrades for PatternFly MCP—maps release notes to codebase usage, runs tests, and writes a dated update report with impact tables and prioritized fixes. Use when bumping zod, on review zod, zod upgrade, zod integration review, assessing Zod breaking changes, generating a zod update report, or reviewing Dependabot/Renovate zod PRs.
4+
---
5+
6+
# Review Zod Integration (PatternFly MCP)
7+
8+
## When to use
9+
10+
- User bumps or proposes bumping **`zod`** in `package.json`
11+
- User asks for a **Zod upgrade review**, **integration review**, or **impact analysis**
12+
- Dependabot/Renovate PR for `zod`
13+
- User wants a report comparing **Zod release notes** to this codebase
14+
15+
## Workflow
16+
17+
1. **Versions and release notes**
18+
- Read `package.json`, `package-lock.json`, and `node_modules/zod/package.json` if installed.
19+
- Note **previous** version from `git log -1 -- package.json` or the bump PR/commit.
20+
- Fetch release notes for the target minor/major (release page, GitHub API, packaged changelog, or any fetch tool): `https://github.com/colinhacks/zod/releases/tag/v{VERSION}`.
21+
- For patch bumps within the same minor (e.g. 4.4.1 → 4.4.3), use the **minor** release notes (e.g. v4.4.0) plus patch-specific notes when present.
22+
- **Offline fallback:** If release notes cannot be retrieved, state that limitation and continue from `package.json`, lockfile, and the inventory/audit steps only.
23+
- Extract **potentially breaking**, **other fixes**, **performance**, and **locales** sections.
24+
- If notes are ambiguous or the bump is minor/major, follow [reference.md — Audit depth policy](reference.md#audit-depth-policy) (prefer `node_modules/zod/src/` when shipped; otherwise published entry points from `package.json` `exports`).
25+
26+
2. **Repo guidelines**
27+
- Read (do not paste into the report): `CONTRIBUTING.md`, `guidelines/agent_coding.md`, `guidelines/agent_testing.md`, `docs/development.md`.
28+
29+
3. **Codebase inventory**
30+
- Run all commands in [reference.md — Grep patterns](reference.md#grep-patterns). Read [reference.md — Key files](reference.md#key-files).
31+
- Record **used** vs **not used** per release-note item.
32+
- Apply [reference.md — Compatibility policy (Zod detection)](reference.md#compatibility-policy-zod-detection): new detection must be **additive**; do not remove `_def` or v3 paths unless release notes show a concrete conflict.
33+
34+
4. **Impact matrix**
35+
- For **every** release-note bullet (breaking, fixes, performance, locales), add one row to the report tables. Columns: **Release note**, **Used in PF MCP?** (Yes / No / Indirect — cite file or grep), **Impact** (None / Low / Medium / High), **Priority**, **Recommended fix** (or `None`). Priority rules: [reference.md — Priority rules](reference.md#priority-rules-pf-mcp).
36+
- Always include [reference.md — Updated P2 recommendations (Recurring)](reference.md#updated-p2-recommendations-recurring) in the report **Recommended fixes** section, even when tests pass.
37+
- Row patterns: [reference.md — Example impact rows](reference.md#example-impact-rows-pf-mcp).
38+
39+
5. **Tests**
40+
From repo root:
41+
42+
```bash
43+
npm run test:types
44+
npx jest --selectProjects unit
45+
npm run test:integration
46+
npm run test:audit
47+
```
48+
49+
- Record pass/fail counts. Full `npm test` may fail on `auditor/` ESLint—treat as pre-existing unless the bump touched `auditor/`.
50+
- **P0 (tests/types/runtime break):** Document failures in the report. Apply only minimal fixes needed to verify bump safety, re-run tests, and note any changes. Update snapshots only when output change is correct (`jest -u` scoped to affected files).
51+
- **P1 / P2:** Do not change code during this review—list fixes in the report only.
52+
53+
6. **Write the report**
54+
- **Directory:** `reports/` at repository root (gitignored). Run `mkdir -p reports` if needed; do not delete prior reports.
55+
- **Filename:** `YYYYMMDD-HHMMSS-zod-{semver}-update-report.md` (`YYYYMMDD-HHMMSS` = report timestamp in **UTC**, 24-hour, no separators in the time part; `{semver}` = target version without `v`, e.g. `reports/20260522-143045-zod-4.4.3-update-report.md`).
56+
- Use [reference.md — Report template](reference.md#report-template). Do not commit unless the user asks.
57+
58+
7. **User summary**
59+
- Report path; **executive summary verdict table** from the report (code changes required, documentation updates required, risk level—do not collapse to a single line); P0/P1/P2 counts; link to release notes.
60+
- Ask: *"Would you like me to proceed with the recommended P1/P2 fixes listed in the report?"*
61+
- Do not modify the codebase further until the user explicitly grants permission (except minimal P0 fixes from step 5).
62+
63+
Domain context (SDK routing, schema pipeline, peer range): [reference.md — Quick PF MCP facts](reference.md#quick-pf-mcp-facts).
64+
65+
## Additional resources
66+
67+
- [reference.md](reference.md) — grep patterns, key files, priority rules, compatibility policy, report template, example impact rows, architecture notes
68+
69+
## Quick checks
70+
71+
- [ ] Versions (from → to) and release notes captured (or offline limitation noted)
72+
- [ ] Guidelines read; inventory grep run; compatibility policy applied
73+
- [ ] Every release-note bullet mapped with priority
74+
- [ ] Recurring P2s in report consolidated fixes
75+
- [ ] `test:types`, unit, `test:integration`, `test:audit` recorded
76+
- [ ] Report at `reports/YYYYMMDD-HHMMSS-zod-{semver}-update-report.md` (UTC)
77+
- [ ] User asked before any P1/P2 code changes

0 commit comments

Comments
 (0)