restructure-solutions

Reorganize Lean files with multiple solution variants into numbered self-contained sections.

30|9|Updated Apr 30, 2025
One-click install
npx skills add https://github.com/leanprover/human-eval-lean --skill restructure-solutions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: restructure-solutions
Source: https://github.com/leanprover/human-eval-lean/tree/main/.claude/skills/restructure-solutions
Command: npx skills add https://github.com/leanprover/human-eval-lean --skill restructure-solutions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill restructures a Lean file of a human-eval problem that contains multiple solution variants, ensuring each solution becomes self-contained with its own Implementation, Tests, and Verification sections, while preserving the original Prompt section at the end for reference.

Core Features & Use Cases

  • Isolates each solution variant into a dedicated section group containing Implementation, Tests, and Verification.
  • Maintains the original Prompt section at the end.
  • Automatically numbers sections when there are multiple solutions to improve readability and maintainability.
  • Preserves existing imports, opens, and options at the top of the file; keeps helper lemmas in the first Verification section where they are first needed.

Quick Start

Restructure a Lean file with multiple solutions so that each solution is self-contained with Implementation, Tests, and Verification sections.

Frequently Asked Questions about restructure-solutions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restructure a Lean file with multiple solution variants into separate sections?

Restructuring a Lean file with multiple solution variants isolates each solution into a self-contained group with Implementation, Tests, and Verification sections. The tool automatically numbers these sections when multiple solutions exist, while preserving top-of-file imports, opens, and options for easier maintenance.

How do I keep imports and helper lemmas intact when organizing Lean4 code for testing?

Organizing Lean4 code for testing preserves existing imports, opens, and options at the top of the file. Helper lemmas are kept in the first Verification section where they are initially needed, ensuring each restructured solution group remains valid and self-contained for verification.

What is the best way to separate multiple Lean solutions in a single file for independent verification?

Separating multiple Lean solutions in a single file for independent verification involves breaking down a single problem's variants (e.g., solution, solution') into dedicated section groups. Each group receives its own Implementation, Tests, and Verification blocks, maintaining the original Prompt section at the end for reference.

Can I use this refactoring tool on Lean files with only a single solution variant?

This refactoring tool can process single-solution Lean files, but its core numbering and grouping logic is designed for files with multiple variants. It will reorganize the file structure while preserving imports, options, and the final Prompt section, though automatic section numbering primarily targets multiple solution sets.

Why does my Lean code reorganization keep the Prompt section at the end of the file?

Lean code reorganization keeps the Prompt section at the end of the file to preserve the original problem context for reference. This ensures the restructured solution variants, now separated into Implementation, Tests, and Verification groups, remain connected to their original problem statement.

When do I need to restructure Lean solution files for code organization?

You need to restructure Lean solution files for code organization when a single human-eval problem contains multiple solution variants that are difficult to test or maintain. Restructuring isolates each variant into self-contained section groups, enabling easier independent verification and cleaner code organization.