benbrastmckie/nvim/skill-cslib-implementation-hard
Claude Code and agent skill by benbrastmckie/nvim
- community
Checking that the SKILL.md file is still in the repository.
Implement CSLib proofs with hard-mode contracts (H2 anti-analysis, H7 territory, H9 wrap-up with sorry_inventory). Invoke for --hard cslib implementation tasks.
Install
npx vskill@latest install benbrastmckie/nvim/skill-cslib-implementation-hardSKILL.md
CSLib Implementation Hard Skill
Hard-mode wrapper that delegates CSLib proof implementation to cslib-implementation-hard-agent subagent. Extends skill-cslib-implementation with:
- Single-phase dispatch context (H1): reads handoff JSON to identify next incomplete phase
- Territory parameters (H7): includes territory contract when dispatched from orchestrate-hard
- Anti-analysis contract (H2): passed in delegation context for agent enforcement
- Wrap-up discipline (H9): sorry_inventory populated in orchestrator handoff
Relationship to base skill: Structurally follows skill-cslib-implementation postflight pattern. Key difference: when orchestrator_mode=true, uses per-phase dispatch (H1) rather than whole-plan dispatch. Maintenance note: changes to skill-cslib-implementation postflight should be mirrored here.
Context References
Reference (do not load eagerly):
- Path:
.claude/context/formats/return-metadata-file.md- Metadata file schema - Path:
.claude/context/contracts/anti-analysis.md- H2 contract (loaded by agent) - Path:
.claude/context/contracts/wrap-up.md- H9 contract (loaded by agent) - Path:
.claude/context/contracts/territory.md- H7 contract (when territory params present) - Path:
.claude/context/contracts/phase-closure.md- depth-first phase closure: close one phase before opening the next (loaded by agent) - Path:
.claude/context/contracts/pre-edit-gate.md- per-item evidence before applying a mechanical-list edit (loaded by agent) - Path:
.claude/context/patterns/postflight-control.md- Marker file protocol - Path:
.claude/context/patterns/subagent-continuation-loop.md- Continuation loop pattern
Trigger Conditions
This skill activates when:
/implement N --hardis invoked and task type iscslib- Not currently routing-reachable: the routing-ladder collapse retired the skill-side
routing/
routing_hard manifest blocks and their resolver. This skill is pending migration onto hard_contracts (a separate, not-yet-dispatched follow-on); until then it is reachable only by direct invocation, not through /implement --hard dispatch
- Note:
skill-orchestrate's own hard-mode dispatch (both effort modes, one engine — the
formerly-separate hard-mode engine is deleted) resolves and dispatches the AGENT (cslib-implementation-hard-agent) directly via command-route-agent.sh, not this SKILL file; this skill's own activation is via the paths above.
Execution Flow
Stage 1: Input Validation
Stage 1.5: Hard-Mode Cost Note
Stage 2: Preflight Status Update
Source skill-base.sh once, then follow @.claude/context/patterns/skill-preflight-flow.md's Stage 2 (preflight status update):
Stage 2b: Preflight Cache Warming
Ensure Mathlib cache is warm before delegating to the agent:
This is non-blocking. Cache fetch failure does not prevent delegation. On a cache hit, this completes in ~1-2 minutes and prevents 30-45 minute Mathlib rebuilds during CI verification.
Stage 3: Create Postflight Marker
Follow @.claude/context/patterns/skill-preflight-flow.md's Stage 3 (marker creation):
Stage 3a: Calculate Artifact Number
Stage 3b: Single-Phase Dispatch Context (H1)
When orchestrator_mode=true, determine the specific phase to dispatch:
Stage 4a: Memory Retrieval (Auto)
Note: lit_flag is independent of clean_flag. Using --clean --lit suppresses memory retrieval but still injects literature briefing. Literature briefing is gated solely on lit_flag == "true".
Stage 4: Prepare Delegation Context
Pass anti-analysis contract reference and territory params (when applicable):
Forward `dispatch_seq` unchanged. If this skill's own delegation context carries a dispatch_seq field, forward it into the sub-agent's delegation context above verbatim — the same pass-through treatment already given to territory. Never invent, increment, or recompute a value at this layer; only the orchestrator mints one. If absent, omit the field. See context/patterns/dispatch-report-not-termination.md.
CRITICAL: No source reading before delegation. The subagent handles all codebase exploration.
Stage 4b: Read Format Specification
Stage 5: Invoke Subagent
- If
memory_contextis non-empty, include it as a<memory-context>block after the format specification. - If
lit_contextis non-empty, include it as a<literature-briefing>block after the memory context. - Do NOT inject empty blocks when content is empty.
Include territory parameters in prompt when territory is non-null:
Stage 5b: Self-Execution Fallback
If Agent tool not used, write .return-meta.json with status: "implemented" before postflight.
Stage 5c: Continuation Loop Init
Postflight (ALWAYS EXECUTE)
Stage 6: Parse Subagent Return
Stage 7: Update Task Status (Postflight)
Stage 7a: Propagate Memory Candidates and Completion Summary
Same as skill-cslib-implementation Stage 7a + completion summary propagation.
Stage 8: Link Artifacts
Two-step jq pattern (Issue #1132 safety):
- Filter out existing summary artifacts
- Add new summary artifact
Regenerate TODO.md after linking.
Stage 8a: Lifecycle TTS Notification
Stage 9: Cleanup
Follow @.claude/context/patterns/skill-postflight-flow.md's Stage 9 (cleanup); this skill also removes .continuation-loop-guard, which is implementer-specific and not folded into skill_cleanup:
MUST NOT (Postflight Boundary)
After the agent returns, this skill MUST NOT:
- Edit .lean files - All CSLib proof work is done by agent
- Run lake build/test/lint - Verification is done by agent
- Use lean-lsp MCP tools - Domain tools are for agent use only
- Grep for sorries - Debt analysis is agent work
- Write summary/reports - Artifact creation is agent work
PROHIBITION: If the subagent returned partial or failed status, MUST NOT attempt to continue,complete, or "fill in" the subagent's work. Report partial/failed status and let user re-run/implement --hardto resume.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagent-system/extensions/cslib/skills/skill-cslib-implementation-hard/SKILL.md
Popularity
- Repository stars
- 444
- Repository forks
- 464
- 7-day trend score
- 30
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/benbrastmckie/nvim/skill-cslib-implementation-hard)