magpie-optimize-skill

Refactor SKILL.md files using security-suite restructuring patterns.

79|76|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/apache/magpie --skill magpie-optimize-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: magpie-optimize-skill
Source: https://github.com/apache/magpie/tree/main/skills/optimize-skill
Command: npx skills add https://github.com/apache/magpie --skill magpie-optimize-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires uv, git, doctoc, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps optimize existing framework skills, making them leaner without changing their core functionality.

Core Features & Use Cases

  • Restructuring Patterns: Applies restructuring patterns proven in the security-skill suite to optimize SKILL.md files.
  • Behavior-Preserving Edits: Ensures that optimization does not alter the skill's behavior, maintaining a green validator status.
  • Use Case: For example, a skill with a SKILL.md over 500 lines can be optimized into smaller, linked documents without changing its function.

Quick Start

Run the optimize-skill command with the name of the skill you want to optimize, such as: optimize-skill security-issue-import

Frequently Asked Questions about magpie-optimize-skill

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

FAQPage Schema
How do I refactor a large SKILL.md file without changing its behavior?

To refactor a large SKILL.md file without behavior changes, apply restructuring patterns that split the content into smaller, linked documents. This optimization process relies on git tools and skill validators to ensure the original functionality remains completely preserved.

What does behavior-preserving skill optimization mean for framework skills?

Behavior-preserving skill optimization means restructuring a framework skill to make it leaner while guaranteeing no functional changes occur. It achieves this by applying proven restructuring patterns and maintaining a green validator status throughout the entire refactoring process.

How to optimize skills using restructuring patterns from the security suite?

You optimize skills by running the optimize-skill command with the target skill name. The tool applies restructuring patterns proven effective in the security suite to refactor SKILL.md files and their related documents into a leaner structure.

Do I need git and validators to refactor SKILL.md files?

Yes, you need git and a skill validator to refactor SKILL.md files safely. Git tracks structural changes while the validator performs preservation checks to guarantee the skill maintains a green status and its behavior remains unaltered.

When should I optimize a framework skill that is over 500 lines long?

You should optimize a framework skill over 500 lines long when it becomes difficult to maintain. By applying restructuring patterns, you can break down the SKILL.md file into smaller, linked documents without changing its core function.