deslop-shared-libs

Identify code extraction opportunities and recommend the best shared-library candidates.

139k|20.6k|Updated Mar 11, 2026
Ready to run
npx skills add https://github.com/garrytan/gstack --skill deslop-shared-libs-garrytan
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: deslop-shared-libs
Source: https://github.com/garrytan/gstack/tree/main/deslop-shared-libs
Command: npx skills add https://github.com/garrytan/gstack --skill deslop-shared-libs-garrytan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Finding opportunities to consolidate duplicated code into shared libraries is time-consuming and error-prone, often requiring manual inspection of codebases and careful verification of caller patterns. This Skill automates the discovery of code reuse opportunities within recent commits and pull requests. ## Core Features & Use Cases - Automated Candidate Discovery: Scans recent work across commits and PRs (default 14 days) to identify repeated code patterns and similar implementations. - Verification & Ranking: Validates that candidates have at least two real callers, evaluates extraction impact (lines removed/added/saved), and ranks candidates by reliability gains and net savings. - Implementation Guidance: For the top three recommendations, provides concrete migration paths, testing strategies, and deployment blast radius analysis. - Use Case: Your team has made fifteen small fixes to error handling across different API endpoints over the past two weeks. This Skill discovers that pattern, confirms three separate locations use the same logic, and recommends extracting a shared error handler that saves 80 lines while improving consistency. ## Quick Start Run this Skill to review your repository's recent work and get ranked recommendations for shared-code extraction opportunities.

Frequently Asked Questions about deslop-shared-libs

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

FAQPage Schema
How does this Skill find code worth sharing?▼

It scans your recent commits and pull requests (default 14 UTC days) for repeated patterns, similar implementations across files, and frequently changing code blocks. It then verifies each candidate has at least two independent callers before evaluating extraction value.

What counts as a valid shared-code candidate?▼

A candidate must have at least two verified, first-party authored code locations calling the same logic with compatible contracts. Generated code, third-party libraries, and single-use patterns do not qualify.

How does the Skill calculate lines saved?▼

It counts removed lines from callers minus new lines added to the shared helper, excluding tests, vendor code, and generated files. If adoption requires test or integration work, those costs are shown separately and included in the total impact calculation.

Does the Skill check if similar code already exists as a dependency?▼

Yes. Before recommending extraction, it inspects existing libraries and shared helpers to compare behavior, inputs, outputs, error handling, and dependencies. If a dependency already solves the problem, it will note that instead of recommending extraction.

What is the blast radius concern mentioned in recommendations?▼

Blast radius identifies the scope of failure if the shared helper introduces a bug—for example, whether a defect affects one team or multiple critical services. High blast radius candidates require stronger test coverage before extraction.

Can this Skill suggest extraction for code outside the review window?▼

It focuses on recent work within your specified timeframe (default 14 days) to prioritize active areas. Older code is only included if it is a verified caller of a recently discovered pattern.