chore: split composer-prompting skill into references/, add tsc --checkJs to CI - #20
Conversation
…ckJs to CI - composer-prompting skill: SKILL.md keeps the always-loaded spine (when to use, repo grounding, assembly checklist); details move to references/prompt-anatomy.md (five sections + guardrails + worked example), references/model-selection.md (escalation ladder, chunking, resume-vs-fresh), and new references/composer-antipatterns.md (six bad prompt shapes with fixes, adapted from codex's anti-patterns) - npm run typecheck: tsc --checkJs --noEmit over scripts/lib/ JSDoc (tsconfig.check.json), added to CI; typescript + @types/node as devDependencies only — no build step, .mjs stays the ship artefact - fix the two annotation gaps the first run found: collectReviewContext's mode union in git.mjs, walkToolUses property access in parse.mjs - AGENTS.md: typecheck documented, skill layout updated
freema
left a comment
There was a problem hiding this comment.
CodeForge Review
Verdict: approve | Score: 9/10
Clean, low-risk PR: adds a dev-time tsc --checkJs typecheck step (tsconfig.check.json) wired into CI and npm scripts, fixes the two real JSDoc/type gaps it surfaced in git.mjs and parse.mjs, and splits the oversized composer-prompting SKILL.md into a spine plus three on-demand reference docs. AGENTS.md and CHANGELOG.md are updated consistently. No runtime behavior changes; tests, lint, and the new typecheck all pass locally.
Reviewed by CodeForge
freema
left a comment
There was a problem hiding this comment.
CodeForge Review
Verdict: approve | Score: 9/10
Clean, low-risk PR: adds a dev-time tsc --checkJs typecheck step (JS stays the ship artefact, no build step introduced), wires it into CI, fixes the two real JSDoc/type gaps it surfaced in git.mjs and parse.mjs, and splits the composer-prompting skill's SKILL.md into progressive-disclosure references. Verified locally: npm run typecheck, npm run lint, and npm test all pass (one pre-existing, unrelated flaky test in tests/jobs.test.mjs also fails identically on main, confirmed by diffing against origin/main). No behavioral/runtime code changes — the .mjs edits are type-annotation-only and preserve existing logic.
Reviewed by CodeForge
| "types": ["node"] | ||
| }, | ||
| "include": ["scripts/lib/*.mjs"] | ||
| } |
There was a problem hiding this comment.
[MINOR] The typecheck only includes scripts/lib/*.mjs, not the top-level scripts/*.mjs command entrypoints (e.g. delegate.mjs, status.mjs, cancel.mjs) or scripts/**/*.mjs recursively for any nested lib subfolders. If those files also carry JSDoc annotations, they get no CI type-safety coverage.
Suggestion: Consider broadening
includeto["scripts/**/*.mjs"]in a follow-up once the top-level command scripts are confirmed clean, so future JSDoc drift there is also caught.
| @@ -126,15 +126,16 @@ export function* walkToolUses(node) { | |||
| for (const item of node) yield* walkToolUses(item); | |||
There was a problem hiding this comment.
[SUGGESTION] Introducing the obj alias only inside walkToolUses (while pickText above still accesses item.type/item.text on values narrowed similarly) is a slightly inconsistent style — future readers may wonder why one function needs the cast and the other doesn't.
Suggestion: Optional: add a short comment noting that the cast is required here because
checkJswon't let TS index a bareobject-narrowed value, whereaspickText'sitemis already inferred asany/unknown-safe from its call context.
Summary
Last of four PRs porting patterns from
openai/codex-plugin-cc. Independent of #17/#18/#19 (branched frommain).composer-promptingnow mirrors codex'sgpt-5-4-promptinglayout: a slim always-loadedSKILL.md(when to use, repo grounding, assembly checklist) plus on-demandreferences/:prompt-anatomy.md— the five sections + guardrails, extended with a full worked example promptmodel-selection.md— escalation ladder, chunking heuristics, resume-vs-freshcomposer-antipatterns.md— new: six prompt shapes that reliably produce bad Composer runs, each with the fix (adapted from codex's anti-patterns reference)npm run typecheckin CI —tsc --checkJs --noEmitover the JSDoc annotations inscripts/lib/(tsconfig.check.json, same approach as codex'stsconfig.app-server.json). Dev-time only:typescript+@types/nodeare devDependencies, nothing compiles,.mjsremains the ship artefact — the zero-runtime-deps and no-build-step rules are untouched (AGENTS.md wording clarified).collectReviewContext'smodeinferred asstringvs the declared'working-tree'|'branch'union (git.mjs), andwalkToolUsesaccessing properties on a value narrowed only toobject(parse.mjs).Test plan
npm test: 89/89 green.npm run lint: clean.npm run typecheck: clean (after the two fixes; before them it reported 9 errors across the two files).