extract-feature

Extract a software feature into a standalone Composer package.

2|Updated Oct 25, 2025
One-click install
npx skills add https://github.com/calevans/staticforge --skill extract-feature
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract-feature
Source: https://github.com/calevans/staticforge/tree/main/.opencode/skills/extract-feature
Command: npx skills add https://github.com/calevans/staticforge --skill extract-feature

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the process of isolating and packaging internal software features into independent, distributable libraries, facilitating open-source contributions and modular development.

Core Features & Use Cases

  • Feature Isolation: Extracts a specified feature from the src/Features/ directory.
  • Package Generation: Creates a new, standalone Composer package directory with necessary boilerplate.
  • Namespace Management: Updates code to reflect the new package's namespace.
  • Use Case: You've developed a robust authentication module within your main project and now want to release it as a separate, reusable package for others to use.

Quick Start

Use the extract-feature skill to export the 'SocialMetadata' feature as a new package.

Frequently Asked Questions about extract-feature

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

FAQPage Schema
How do I extract a PHP feature into a standalone Composer package?

To extract a PHP feature into a standalone Composer package, specify the target directory and define custom vendor, package, and namespace details to generate a new library with updated namespaces and test harnesses.

What is the best way to modularize code from a src/Features/ directory for open source publishing?

Modularizing code from a src/Features/ directory involves isolating the target feature, generating standalone Composer package boilerplate, and updating the code's namespace to prepare it for open source publishing.

Can I define a custom namespace when exporting an internal PHP feature?

Yes, you can define a custom namespace when exporting an internal PHP feature. The extraction process updates the code to reflect the newly specified namespace for the standalone library.

How does code modularization work for PHP projects using Composer?

Code modularization for PHP projects using Composer works by extracting internal features from a specified directory into independent, distributable libraries, preparing the feature code and generating necessary package boilerplate.

Do I need existing tests to extract a feature into a standalone package?

No, you do not need existing tests to extract a feature into a standalone package. The extraction process facilitates modular development by generating a test harness alongside the new standalone library.

What are the limitations of extracting internal features to standalone packages?

A limitation of extracting internal features to standalone packages is that the target code must reside in a specified directory like src/Features/, and the process focuses on Composer package generation rather than full dependency resolution.