package-principles

Analyze package organization for cohesion and coupling violations with dependency metrics.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/joleques/northstar-ai --skill package-principles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: package-principles
Source: https://github.com/joleques/northstar-ai/tree/main/.codex/skills/package-principles
Command: npx skills add https://github.com/joleques/northstar-ai --skill package-principles

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams identify when packages or modules are organized in ways that increase maintenance cost, create dependency cycles, or force consumers to depend on unrelated classes. It highlights violations of REP, CCP, CRP (cohesion) and ADP, SDP, SAP (coupling) so maintainers can prioritize targeted refactors and safer releases.

Core Features & Use Cases

  • Principle-based analysis: Evaluates packages against REP, CCP, CRP, ADP, SDP and SAP and explains trade-offs between them.
  • Dependency & metric inspection: Detects cyclic dependencies, computes Ca/Ce/Instability (I) and estimates abstraction ratio to locate "Zone of Dor" or "Zone Inútil".
  • Actionable recommendations: Produces per-package verdicts, evidence (classes/dependencies involved), and concrete reorganization or refactoring suggestions for architecture reviews and library design decisions.
  • Use cases: architecture review, pre-release cleanup, refactor planning, decision between feature-based vs layer-based organization.

Quick Start

Ask the assistant to analyze the repository's packages and return per-package veredict, Ca/Ce/I metrics, evidence of violations, and concrete refactoring recommendations.

Frequently Asked Questions about package-principles

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

FAQPage Schema
How do I detect cyclic dependencies and package coupling violations in my codebase?

Detect cyclic dependencies and coupling violations by analyzing package organization against ADP and SDP principles. The evaluation flags problematic package boundaries and computes Ca, Ce, and Instability metrics to identify unstable packages requiring targeted refactoring.

What are REP, CCP, and CRP principles in package architecture?

REP, CCP, and CRP are package cohesion principles governing class grouping. The analysis evaluates packages against these principles to highlight when consumers are forced to depend on unrelated classes, explaining trade-offs to prioritize safer library releases.

How do I calculate package instability and abstraction metrics for architecture reviews?

Calculate package instability and abstraction metrics by computing Ca, Ce, Instability, and abstraction ratios during architecture reviews. These metrics locate packages in the Zone of Dor or Zone Inútil, providing per-package evidence for concrete reorganization recommendations.

What is the best way to reorganize packages before a major release?

The best way to reorganize packages before a major release is principle-based analysis. Evaluating packages against coupling and cohesion rules produces per-package verdicts, evidence of violations, and actionable refactoring suggestions to ensure safer releases.

When should I choose feature-based versus layer-based package organization?

Choose between feature-based and layer-based package organization by evaluating cohesion and coupling violations. The analysis detects misplaced classes and problematic boundaries, providing evidence to support architecture decisions for your specific refactor planning needs.

Why does my package structure force consumers to depend on unrelated classes?

Your package structure forces unrelated class dependencies due to REP, CCP, or CRP cohesion violations. The analysis highlights these specific violations, identifies the classes involved, and provides concrete reorganization recommendations to reduce maintenance costs.