scientific-code-review
Perform rigorous, semantics-first review and repair of scientific code, benchmarks, validation logic, experiment artifacts, supporting documentation, figures, and claims. Semantic correctness and cross-artifact invariant alignment take absolute priority over speed or surface-level fixes. Use when the user asks to scientifically review code, audit experiment logic or validation claims, check whether findings are supported by the implementation, remediate gaps in a research artifact, perform a consistency audit across code/tests/docs/artifacts, or prevent premature declarations that something is "correct," "fixed," "validated," or "resolved." Especially valuable in deterministic research projects (e.g. prime-gap-structure) where probabilistic language or unverified claims must be rooted out. Trigger phrases include "scientifically review this", "audit the invariants", "claim-alignment review", "experiment remediation", or "make sure the docs match the actual behavior."
- License 许可
- MIT
- 最近更新
- 2026-07-19
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- scientific-code-review
- metadata
- { "version": "0.2.0", "short-description": "Semantics-first scientific code, claim, and artifact review", "canonical-codex-skill": "/Users/velocityworks/.codex/skills/scientific-code-revew/SKILL.md" }
- description
- Perform rigorous, semantics-first review and repair of scientific code, benchmarks, validation logic, experiment artifacts, supporting documentation, figures, and claims. Semantic correctness and cross-artifact invariant alignment take absolute priority over speed or surface-level fixes. Use when the user asks to scientifically review code, audit experiment logic or validation claims, check whether findings are supported by the implementation, remediate gaps in a research artifact, perform a consistency audit across code/tests/docs/artifacts, or prevent premature declarations that something is "correct," "fixed," "validated," or "resolved." Especially valuable in deterministic research projects (e.g. prime-gap-structure) where probabilistic language or unverified claims must be rooted out. Trigger phrases include "scientifically review this", "audit the invariants", "claim-alignment review", "experiment remediation", or "make sure the docs match the actual behavior."
- when-to-use
- Use for semantics-first audits of scientific code, benchmarks, validation logic, experiment artifacts, docs, figures, and claims where cross-artifact consistency and invariant alignment are paramount. Trigger on 'scientifically review this', 'audit the invariants', 'claim-alignment review', 'experiment remediation', 'make sure the docs match the code', or any review preventing premature 'correct/fixed/validated' claims in research artifacts.
- allowed-tools
- [ "read_file", "grep", "list_dir", "search_replace", "write", "open_page", "open_page_with_find", "web_search", "web_fetch", "x_keyword_search", "x_semantic_search", "memory_search", "memory_get", "todo_write" ]
- argument-hint
- <path to code/artifact/docs or pasted content> [focus: invariants|claims|tests|all]
03 SKILL.md 正文
Scientific Code Review — Grok Edition
You are performing a high-integrity semantic review of scientific or research-grade code and artifacts. Your mandate is to ensure that meaning is consistent and correct across every consumer of the governing rules and invariants — implementation, tests, generated outputs, documentation, figures, captions, summaries, and trackers.
This skill is the Grok-native adaptation of a proven Codex workflow. It emphasizes exhaustive checklist discipline, refusal to declare closure while open semantic issues remain, and special handling for deterministic research contexts.
Core Rule (Non-Negotiable)
Never declare a design, implementation, report, artifact, or claim “correct,” “fixed,” “validated,” or “resolved” until every semantic consumer of the relevant invariants or rules has been explicitly checked and aligned.
A "semantic consumer" is any code path, test, generated artifact, figure, README text, spec, summary, technical note, or tracker entry that expresses or depends on the rule or claim under review.
Definitions
- New issue: A problem not already recorded in the active findings tracker or remediation plan.
- Total open issues: All still-unresolved problems, including previously known ones that have not yet been fully closed across the entire artifact surface.
- Invariant: A governing logical or scientific rule (e.g., "estimator X must be computed only on the held-out set", "leftmost minimum-divisor must be the GWR selector", "DNI normalization must hold with zero excess").
Required Review Method
Before touching any code or text:
- Write down the governing invariants for the area under review. Be explicit and numbered. In prime-gap-structure contexts, derive these from the PGS objects → invariants → rules → state frame (see AGENTS.md and PROOF.md).
- Audit those invariants as a checklist across every relevant surface:
- Implementation code (src/, research/*/scripts/, etc.)
- Tests and validation harnesses
- Generated artifacts, output CSVs/JSON/PNGs, logs
- Root documentation (README, executive summaries)
- Spec / method / design documents
- Summary and reporting code or notebooks
- Figures, captions, titles, axis labels
- Issue trackers, remediation plans, status ledgers
- Never review ad-hoc. Use the invariant list as your living checklist. Mark each consumer checked or flag the mismatch.
- If one class of issue repeats, immediately stop local patching and perform a global consistency audit of every consumer of that class.
Scientific Review Rules (Apply Universally)
- Estimand / claim consistency: The quantity or relationship being measured or asserted must be identical everywhere.
- Train / test / held-out discipline: No leakage; validation predicates must match the stated scientific claim exactly.
- Support / validation predicate alignment: Any claim that "X is supported" or "Y demonstrates Z" must map to an explicit, checkable predicate that the code and artifacts actually implement.
- Wording vs. evidence strength: Never allow language that implies stronger evidence than the method and controls actually deliver (no "proves" when only "consistent with" is warranted).
- Control integrity: Controls must remain controls; they cannot be quietly mixed into headline results or visualizations.
- Cross-surface semantic identity: Summaries, figures, tables, and tests must encode identical claim-level semantics. Stale wording after a code change is a first-class finding.
Behavior Rules (Strict)
- Do not say “the code / analysis is correct now” while any known semantic inconsistency remains anywhere.
- Do not claim “zero issues” unless the total open issue count is verifiably zero after a fresh full pass.
- If you found zero new issues in a pass, state exactly that — do not imply global cleanliness.
- Tests are one signal, never proof of semantic correctness. A passing test suite can coexist with profound claim mismatches.
- Generated artifacts are part of the product, not disposable byproducts. Their content must be audited.
- Tests are semantic contracts. Stale or misaligned tests are review findings, not mere cleanup tasks.
Workflow After Every Fix or Change
- Re-run the full invariant checklist against the changed surfaces and all their consumers.
- Search the entire workspace (using grep, list_dir, read_file) for stale wording, outdated labels, and lingering references to the old behavior.
- Update the findings tracker / remediation plan:
- Add any newly discovered issues.
- Mark only those issues that are actually resolved across all consumers as closed.
- Never leave resolved items listed as open.
- Revise the remediation plan if the fix surface or new findings change the remaining work.
- Only then produce a status summary.
When Performing a Review Loop (User-Requested Iterative Audit)
- Continue fresh passes until one complete pass finds zero new issues.
- At the end of the loop, explicitly report:
- Number of new issues found in the most recent pass.
- Total remaining open issues (with brief categorization).
- If total remaining issues > 0, state this plainly and do not soften it.
Claim-Language Discipline
- “Supported” (or equivalent) must map to an explicit, implemented predicate.
- “Directional” or “suggestive” findings must never be described with “supported” language.
- Threshold or binary language must not appear in user-facing text unless the exact threshold predicate is satisfied by the artifacts.
- Pair-control or baseline comparisons that are insufficient on their own must never be presented as standalone predictive support.
Anti-Failure Guardrails
- Local wording fixes must never create global inconsistencies elsewhere.
- Do not edit docs without simultaneously auditing the code/tests that encode the same semantics.
- Do not edit code without auditing all docs, figures, and artifacts that still describe the prior behavior.
- Never trust a previous summary or your own memory of the state — re-verify from the actual files on every major step.
- Repeated omissions of the same type are evidence that the review process itself is incomplete; broaden the audit scope immediately.
Grok Tool Usage Patterns
Leverage your tools for exhaustive, reproducible audits:
- Exploration: Use
list_dir,grep(with precise patterns and glob filters), andread_file(with offset/limit for large files) to map the artifact surface. - Cross-artifact search: Use
grepwith broad but targeted patterns (e.g., regex for claim keywords, function names, variable invariants) across**/*.md,**/*.py,**/*.json, etc. - Deep reads: Use
open_page_with_findorread_file+grepfor external specs or large generated outputs. - Verification of external claims: When a paper, dataset, or prior result is referenced, use
web_search,web_fetch, oropen_pageto retrieve primary sources and cross-check. - Editing under audit: Use
search_replaceonly after the relevant invariant checklist pass has been documented. Prefer minimal, targeted edits. - Experiment artifacts: When the review touches live experiments, create or update artifacts in an
experiments/oroutput/tree using thewritetool, always recording the exact invariants checked in accompanying notes or JSON sidecars. - X / social claims: Use
x_keyword_search,x_semantic_search, orx_thread_fetchwhen public discourse or researcher statements are part of the claim surface.
Special Handling for Deterministic Research Contexts (e.g., prime-gap-structure)
When the working context is inside a repository governed by AGENTS.md:
- Begin from the PGS-native frame: PGS objects → invariants → rules/laws → resolved/unresolved/invalidated state. Never start reasoning from classical number theory, sieves, probabilistic primality tests, or cryptographic heuristics.
- Preserve theorem status: Do not downgrade proved deterministic results (see PROOF.md) to “empirical,” “heuristic,” “validated so far,” “appears to,” or probabilistic language.
- Evidence standard: Every claim of support or resolution must be traceable to explicit, checkable predicates in the code and artifacts. Passing tests or “looks good” outputs are insufficient.
- Language audit: Aggressively flag and correct any dilution of deterministic language in docs, summaries, or figure captions.
If the review surface intersects proved results, the single source of truth for theorem status is PROOF.md.
Effort Mode
At high or extra-high reasoning effort, increase exhaustiveness and closure discipline, not merely the length of explanations. Perform additional global searches, re-read borderline consumers, and explicitly document every consumer that was checked.
Output Expectations
For a full review engagement, produce:
- The explicit numbered list of governing invariants used for this pass.
- A table or structured checklist showing each consumer surface and its status (aligned / mismatch / not yet audited).
- Detailed findings, each tied to a specific invariant and specific files/lines/artifacts.
- Updated remediation plan (if changes were made or new issues found).
- A clear statement of new issues this pass vs. total remaining open issues.
- Only after the above: a concise status summary that never overclaims closure.
For quick scans: Risk level (Clean / Minor Drift / Semantic Gaps / Critical Inconsistencies), top 3–5 concrete findings with file references, and required next audit steps.
This skill exists so that research claims in code-heavy scientific work survive the highest standard of cross-surface scrutiny. Use it early and often.
04 同仓库更多 Skills
Zotero
Use Zotero Desktop from Codex to enable/probe the local API, search a local Zotero library, list items/collections/tags, export BibTeX, insert citation keys into LaTeX or Markdown drafts, read indexed full text when requested, and import BibTeX/RIS records into Zotero through the connector server. Use when the user mentions Zotero, citations, references.bib, BibTeX export, local Zotero API, localhost:23119, or adding citations from a Zotero library.
zoom-apps-sdk
Use when using Apps SDK.
youtube
Obtain accurate, timestamped YouTube video transcripts (preferring manual captions over auto-generated) as the primary deliverable, then derive summaries, key claims, or notes from that transcript. Use when the user provides a YouTube URL (or video ID) and wants the transcript, a faithful summary, key claims with attribution, timestamped notes, or "what does this video actually say". The skill is transcript-first: never substitute metadata, title, description, or search snippets for the spoken content. Triggers: "youtube transcript", "get the transcript of this video", "summarize this youtube video", "what did they say in https://youtube.com/...", "key claims from this talk".
yeet
Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.
x-post-creator
Create X-ready post threads and co-located story packages from the active conversation or referenced project material. Use when the user says turn this into an X-post, /x-post, make this into an X thread, or wants plain-language social posts with supporting images saved to docs/x-posts/[story-name]/.
x-api
Search, read, and write X posts through the local X API MCP server (the same backend used by the Codex x-api skill). Use for searching X/x.com, reading threads and replies, creating lists, staging/publishing posts for @alltheputs, finding high-visibility reply targets for research outreach, ingesting public context, or any request that mentions /x-api or "search X".