code-service-defrag

Scan multi-service codebases for duplicate targets, colliding bindings, stale forks, and scattered packages.

104|31|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/jacob-dietle/context-os --skill code-service-defrag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-service-defrag
Source: https://github.com/jacob-dietle/context-os/tree/main/.claude/skills/code-service-defrag
Command: npx skills add https://github.com/jacob-dietle/context-os --skill code-service-defrag

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps maintain the integrity and visibility of a multi-app/multi-service codebase by detecting and addressing fragmentation issues.

Core Features & Use Cases

  • Automated Defragmentation: Detects code and context fragmentation, including duplicate targets, colliding bindings, stale forks, and scattered packages.
  • Detect-Only: Produces severity-ranked reports for human review and action.
  • Use Case: Ideal for monthly maintenance, before deployments, after migrations, or when source ambiguity is suspected. It prevents silent overwrites and ensures that all agents onboard from the correct context.

Quick Start

Run the defragmentation scan on your codebase with the following command:

./scripts/defrag_scan.sh

Review the generated report to identify and address fragmentation issues.

Frequently Asked Questions about code-service-defrag

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

FAQPage Schema
How do I detect duplicate targets and colliding bindings in a multi-service codebase?

Run an automated defragmentation scan to detect duplicate targets and colliding bindings in a multi-service codebase, producing a severity-ranked report for human review and action.

What is codebase defragmentation and when do I need to scan for stale forks and scattered packages?

Codebase defragmentation identifies context fragmentation like stale forks and scattered packages to maintain integrity and visibility. Scan during monthly maintenance, before deployments, or after migrations to prevent silent overwrites.

Does codebase defragmentation work with multi-platform service configurations?

Yes, codebase defragmentation applies to multi-service codebases across various platforms. The scan requires bash scripting and analyzes platform-specific configurations to detect scattered packages and colliding bindings.

How do I run a detect-only codebase fragmentation scan before deployment?

Run a detect-only codebase fragmentation scan before deployment by executing the bash defragmentation script. This generates a severity-ranked report of duplicate targets and stale forks for human review without altering code.

Why does source ambiguity cause silent overwrites in multi-app codebases?

Source ambiguity causes silent overwrites in multi-app codebases when scattered packages and stale forks fragment context. Defragmentation scanning resolves this by ensuring all agents onboard from the correct, verified context.