code-yeongyu/oh-my-openagent / packages/shared-skills/skills/ulw-research
ulw-research
UnverifiedRuns maximum-saturation research with a cooperating team, claim-graph gating, and a cited, QA'd deliverable. Use when the user explicitly asks for research or a deep investigation, including any 'ulw' research wording.
scripts/polish-diff.mjs
View on GitHub// polish-diff.mjs - whole-document backstop between a pre-polish artifact and its polished result.
//
// diffPolish(beforeHtml, afterHtml, ledger) runs the polish-rules.mjs rule set (the same rules
// polish-apply runs per edit) over the whole document, as multisets, and returns at most one defect
// per code. Severity is looked up in contracts.DEFECT_CODES for every emitted code; a code missing
// there throws. polish-apply checks every edit against this same whole-document baseline (ordered,
// so stricter), so a clean polish-apply run is clean here; this catches hand edits. No IO, no model.
// Plain Node ESM.
import { DEFECT_CODES } from "./contracts.mjs"
import { POLISH_CODES, polishDefects } from "./polish-rules.mjs"
export { churnRatio, TICKER } from "./polish-rules.mjs"
/** The DEFECT_CODES entry of a polish code; refuses a code the registry does not define. */
function registryEntry(code) {
if (!Object.hasOwn(DEFECT_CODES, code)) throw new Error(`polish code ${code} is not in DEFECT_CODES`)
return DEFECT_CODES[code]
}
/**
* @param {string} beforeHtml the pre-polish artifact
* @param {string} afterHtml the polished artifact
* @param {{ rows: object[] }} ledger
* @returns {{ code: string, severity: string, message: string }[]} at most one defect per code
*/
export function diffPolish(beforeHtml, afterHtml, ledger) {
const found = new Map()
for (const { code, message } of polishDefects(beforeHtml, afterHtml, ledger))
found.set(code, [...(found.get(code) ?? []), message])
return POLISH_CODES.filter((code) => found.has(code)).map((code) => ({
code,
severity: registryEntry(code).severity,
message: found.get(code).join("; "),
}))
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |