Skip to content

fix(skills): correct scoring-checks function signature across platforms#181

Open
xiaolai wants to merge 1 commit intocaliber-ai-org:masterfrom
xiaolai:fix/nlpm-scoring-checks-signature
Open

fix(skills): correct scoring-checks function signature across platforms#181
xiaolai wants to merge 1 commit intocaliber-ai-org:masterfrom
xiaolai:fix/nlpm-scoring-checks-signature

Conversation

@xiaolai
Copy link
Copy Markdown

@xiaolai xiaolai commented Apr 20, 2026

Automated audit: This PR was generated by NLPM, a natural language programming linter, running via claude-code-action. Please evaluate the diff on its merits.

Bug

The .agents/ and .cursor/ copies of skills/scoring-checks/SKILL.md document check function signatures that contradict every actual check function in src/scoring/checks/:

Platform Documented signature
.claude/ export function check{Category}(dir: string): Check[]
.agents/ export default function {checkName}(ctx: ScoringContext): Check[]
.cursor/ export function <checkName>(fingerprint: Fingerprint, config: ParsedConfig): Check[]

The actual functions in src/scoring/checks/ (checkExistence, checkQuality, checkGrounding, etc.) all take a single dir: string parameter. They inspect the filesystem directly via fs.existsSync, fs.readFileSync, etc.

The .cursor/ version also referenced non-existent Check fields (weight, maxScore, score, reasons) instead of the actual interface (maxPoints, earnedPoints, passed, detail).

Why it matters

An agent following the .agents/ skill will create checks expecting a ScoringContext that doesn't exist at the call site. The .cursor/ skill's (fingerprint, config) parameters aren't passed by computeLocalScore() either — it calls checkExistence(dir), not checkExistence(fingerprint, config). Either version produces TypeScript compile errors before any check can run.

Fix

Updated .agents/ and .cursor/ to document the correct (dir: string): Check[] pattern, with the correct Check interface shape, matching .claude/ and the actual src/scoring/checks/*.ts files.

The .agents/ and .cursor/ scoring-checks skills documented incompatible
check function signatures that contradict src/scoring/checks/*.ts:

.agents/ used:  export default function {checkName}(ctx: ScoringContext): Check[]
.cursor/ used:  export function <checkName>(fingerprint: Fingerprint, config: ParsedConfig): Check[]
Actual pattern: export function check{Category}(dir: string): Check[]

The actual check functions take a `dir: string` path and inspect the
filesystem directly (existsSync, readFileSync). They do not receive a
ScoringContext, Fingerprint, or ParsedConfig object.

Additional fixes:
- .cursor/ referenced non-existent fields (weight, maxScore, score, reasons)
  instead of the actual Check shape (maxPoints, earnedPoints, passed, detail)
- Both versions referenced non-existent types and patterns

Updated both platform copies to document the correct dir-based named-export
pattern matching src/scoring/checks/existence.ts and src/scoring/index.ts.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant