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/fidelity-state.test.ts
View on GitHubimport { describe, expect, onTestFinished, test } from "bun:test"
import { mkdtempSync, readdirSync, rmSync } from "node:fs"
import { tmpdir } from "node:os"
import { join } from "node:path"
import { failureCount, markReplaced, readState, recordFailure, sentenceKey, writeState } from "./fidelity-state.mjs"
function tempDir(): string {
const dir = mkdtempSync(join(tmpdir(), "ulw-fidelity-"))
onTestFinished(() => rmSync(dir, { recursive: true, force: true }))
return dir
}
describe("fidelity state", () => {
test("sentenceKey is order-independent on ids", () => {
expect(sentenceKey("findings", ["F3", "Q1", "F12"])).toBe(sentenceKey("findings", ["F12", "F3", "Q1"]))
expect(sentenceKey("findings", ["F2", "F1"])).toBe("findings#F1,F2")
expect(sentenceKey("findings", ["F1"])).not.toBe(sentenceKey("other", ["F1"]))
})
test("failureCount increments per key", () => {
const dir = tempDir()
const state = readState(dir)
const key = sentenceKey("findings", ["F1"])
expect(failureCount(state, key)).toBe(0)
recordFailure(state, key)
recordFailure(state, key)
expect(failureCount(state, key)).toBe(2)
expect(failureCount(state, sentenceKey("findings", ["F2"]))).toBe(0)
})
test("markReplaced records the key and survives a write/read", () => {
const dir = tempDir()
const state = readState(dir)
const key = sentenceKey("findings", ["Q1"])
recordFailure(state, key)
markReplaced(state, key)
markReplaced(state, key)
expect(state.replaced).toEqual([key])
writeState(dir, state)
expect(readdirSync(dir)).toEqual(["fidelity-state.json"])
const loaded = readState(dir)
expect(loaded).toEqual(state)
expect(failureCount(loaded, key)).toBe(1)
})
})
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 |