Skill: bennyzhe/openmath-rocq-theorem (version 1.0.3)

--- name: openmath-rocq-theorem description: Configures Rocq environments, runs preflight checks, and guides the proving workflow for OpenMath Rocq theorems. Use when the user wants to set up Rocq tooling, prove a downloaded OpenMath theorem in Rocq/Coq, or verify and submit a Rocq proof. version: v1.0.2 requirements: commands: - rocq or coqc - dune - opam side_effects: - Runs local Rocq, dune, and opam commands in the theorem workspace --- # OpenMath Rocq Theorem ## Instructions Set up the Rocq proving environment, validate opam switches, and prove downloaded OpenMath theorems. Assumes the theorem workspace was already created by the `openmath-open-theorem` skill. This skill package is self-contained: it consists of this `SKILL.md` plus the local `references/` files in this directory. It does not bundle or install sibling `rocq-*` companion skills. ### Workflow checklist - [ ] **Environment**: Verify `rocq` (or `coqc`), `dune`, and `opam` are installed and the active opam switch matches the project's `.opam-switch` or `opam` file. See the `rocq-setup` skill for installation and switch management. - [ ] **Companion skills**: If companion Rocq skills such as `rocq-proof`, `rocq-ssreflect`, `rocq-setup`, or `rocq-dune` are already installed in the active agent, use them. See [references/companions.md](references/companions.md) for when each one is useful. This isolated package does not include their code and does not install them for you. - [ ] **Preflight**: Confirm the environment is healthy before proving: ```bash rocq --version rocq -e 'From Stdlib Require Import Arith. Check Nat.add_comm.' dune --version opam list rocq-prover ``` - [ ] **Prove**: Follow the minimal Rocq proving loop in [references/proof_playbook.md](references/proof_playbook.md). If `rocq-proof` or `rocq-ssreflect` is already installed, use them as companion guidance; otherwise continue with the local workflow in this skill. - [ ] **Verify**: Confirm `dune build` (or `rocq compile <file>.v`) passes and no `admit` or `Admitted.` remains: ```bash dune build grep -rn 'admit\|Admitted\.' *.v ``` - [ ] **Submit**: Use the `openmath-submit-theorem` skill to hash and submit the proof. ### Scripts | Action | Command | Use when | |--------|---------|----------| | Check Rocq version | `rocq --version` | Verify the active opam switch has the expected Rocq release. | | Verify stdlib loads | `rocq -e 'From Stdlib Require Import Arith. Check Nat.add_comm.'` | Confirm the standard library is reachable before proving. | | Build project | `dune build` | After each proof attempt; must exit 0 with no errors. | | Compile single file | `rocq compile <file>.v` | Quick check on a single `.v` file without a full dune build. | | Check for admits | `grep -rn 'admit\|Admitted\.' *.v` | Before submitting; must return no matches. | | Install opam deps | `opam install . --deps-only` | After cloning or changing the project `opam` file. | ### Notes - **Rocq version**: OpenMath Rocq workspaces target Rocq 9.1.0 (current stable, September 2025) with Platform 2025.08.2. - **Companion skills**: `rocq-proof` (proving methodology, tactic reference, Ltac2), `rocq-ssreflect` (SSReflect / MathComp style), `rocq-setup` (opam, toolchain, editor), and `rocq-dune` (build system, `_CoqProject`, dune stanzas) are useful companions when already installed. Optional companions: `rocq-mwe`, `rocq-bisect`, `rocq-extraction`, `rocq-mathcomp-build`. - **Install boundary**: This isolated skill should not instruct copying unseen `rocq-*` directories into `~/.agents/skills` or any other global skills directory. If you are installing from the full repository, review the companion skill folders there and copy them only into a deliberate project-local skills directory such as `.codex/skills` or `.claude/skills`. - **Stdlib prefix**: Use `From Stdlib Require Import` for Rocq 9.x. The legacy `From Coq Require Import` still works with a deprecation warning; prefer `From Stdlib` for all new proofs. - **Verification status**: A proof is complete only when `dune build` exits 0, no `admit` or `Admitted.` remains, and the LSP panel shows no errors or warnings. ## References Load when needed (one level from this file): - **[references/companions.md](references/companions.md)** — When to use optional Rocq companion skills if they are already installed. - **[references/languages.md](references/languages.md)** — Rocq version, Stdlib prefix, libraries, and proof style. - **[references/proof_playbook.md](references/proof_playbook.md)** — Minimal standalone proving loop for downloaded OpenMath Rocq theorem workspaces.

path: references/companions.md
content: # Rocq Companion Skills

These companion skills are optional enhancements. `openmath-rocq-theorem` must still be usable when they are absent.

Use a companion skill only if it is already installed in the active agent, or if you are working from the full repository and have explicitly reviewed and installed it into a deliberate project-local skills directory such as `.codex/skills` or `.claude/skills`.

## Common Companions

- `rocq-proof`: Use when you need detailed tactic guidance, one-step-at-a-time proof discipline, or Ltac/Ltac2 help while proving the theorem itself.
- `rocq-ssreflect`: Use when the workspace depends on MathComp or the proof style is clearly SSReflect-oriented.
- `rocq-setup`: Use when the Rocq toolchain, opam switch, editor integration, or environment activation is broken or unclear.
- `rocq-dune`: Use when `dune build` fails because of project layout, dune stanzas, `_CoqProject`, or module path issues.

## Optional Companions

- `rocq-mwe`: Use when you need to shrink a failing example to a small reproducible case.
- `rocq-bisect`: Use when a theorem or build started failing after a Rocq version change and you suspect a regression.
- `rocq-extraction`: Use only if the work expands beyond proof completion into extraction workflows.
- `rocq-mathcomp-build`: Use when MathComp packages or related opam dependencies are the primary blocker.

## Decision Rule

- If the blocker is environment or switching: prefer `rocq-setup`.
- If the blocker is project build wiring: prefer `rocq-dune`.
- If the blocker is proof search or tactic choice: prefer `rocq-proof`.
- If the theorem is MathComp-heavy or SSReflect-style: add `rocq-ssreflect`.

If none of these companion skills are installed, continue with the local workflow in `openmath-rocq-theorem` and keep the task scoped to the theorem workspace.


path: references/languages.md
content: # Rocq Language Specification

*   **Version**: OpenMath Rocq workspaces target **Rocq 9.1.0** (current stable, September 2025) with Platform 2025.08.2. Legacy Coq 8.x is supported by older projects.
*   **Standard Library**: Use `From Stdlib Require Import` for Rocq 9.x. The legacy `From Coq Require Import` still works with a deprecation warning.
*   **Libraries**: Stdlib, `Mathematical Components` (MathComp) when required by the theorem.
*   **Proof Style**: SSReflect style preferred. Use the `rocq-proof` and `rocq-ssreflect` skills.
*   **Preflight**: Verify environment before proving:
    ```bash
    rocq --version
    rocq -e 'From Stdlib Require Import Arith. Check Nat.add_comm.'
    dune --version
    opam list rocq-prover
    ```
*   **Companion skills**: Rocq proof helper skills such as `rocq-proof`, `rocq-ssreflect`, `rocq-setup`, and `rocq-dune` are separate sibling skills in the full repository. They may not be present in an isolated `openmath-rocq-theorem` skill package; use them only when they are already installed or when you have explicitly reviewed and installed them from the full repo.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)