feat: add conservative skill repairs #292
MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 7 commits into
fix/maintainer-release-hardening fromrefs/pull/292/headmerged by LadyBluenotes(GitHub profile, opens in a new tab) LadyBluenotes(GitHub profile, opens in a new tab) changed the title
- packages/intent/src/validate/repairs.ts line 99OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +79,21 @@79+ const expectedMetadata = {80+ ...(metadata as Record<string, unknown> | undefined),81+ }82+ for (const key of metadataKeys) {83+ if (typeof fm[key] !== 'string') continue84+ if (document.hasIn(['metadata', key])) {85+ changes.push(86+ `remove duplicate top-level "${key}"; metadata.${key} has the same value`,87+ )88+ } else {89+ document.setIn(['metadata', key], document.get(key, true))90+ changes.push(`move top-level "${key}" under metadata.${key}`)91+ }92+ document.delete(key)93+ expectedMetadata[key] = fm[key]94+ expected.metadata = expectedMetadata95+ delete expected[key]96+ }97+ }98+ if (!changes.length) return { fields: fm, changes, problems }99+ next = document.toString().replace(/\r?\n$/, '')
schiller-manuel(GitHub profile, opens in a new tab) approved these changes
Sign in to join this conversation.
Warning
Review limit reached#
Next included review available in 26 minutes.
Check out review usage here.
View limit details
Limit details: You’ve used all 2 included reviews currently available.
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Learn how review limits work.
Review configuration:
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
0159379c-87df-4814-8878-3cde17549820📥 Commits
Reviewing files that changed from the base of the PR and between a7d15359ca9e215dcfbe3371206cf1d7dff42ba1 and 80ed89d173f722563f5da1174c845f267def795a.
📒 Files selected for processing (4)
packages/intent/src/shared/patch.tspackages/intent/src/validate/repairs.tspackages/intent/tests/integration/packed-release.test.tspackages/intent/tests/repair.test.ts📝 Walkthrough
Walkthrough#
The PR adds
intent repairwith safe frontmatter migrations, patch-only example suggestions, JSON output, and controlled writes. Validation now shares repair planning and repository-safe write operations. Tests cover conflicts, malformed metadata, path safety, patches, CRLF preservation, and idempotence.Changes#
Repair workflow
packages/intent/src/validate/repairs.ts,packages/intent/src/validate/blocks.ts,packages/intent/src/commands/validate.tsmetadata, preserves line endings, and validates round trips. LabeledBEFOREandAFTERexamples can produce validated split suggestions. Validation uses these shared plans.packages/intent/src/cli.ts,packages/intent/src/commands/repair.ts,packages/intent/src/shared/patch.tsrepair [dir]with--write,--json, and--patch. The command scans skill files, reports problems and suggestions, applies safe changes, or renders binary-capable Git patches.packages/intent/src/commands/validate.tspackages/intent/tests/repair.test.ts,packages/intent/tests/cli.test.ts,packages/intent/tests/integration/packed-release.test.ts,packages/intent/meta/generate-skill/references/maintainer-commands.md,.changeset/maintainer-repair-patches.mdPriority: ⬇️ Low
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)#
Merge Risk: 🔵 Low · up to
a7d15Mechanical repairs can unexpectedly reformat long frontmatter values, and packed patch generation lacks a decisive regression assertion. Both are localized fixes before merge.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 9 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share