package-structure

Enforce Kotlin Gradle plugin package layout with one-way dependency direction.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ClankerGuru/opsx --skill package-structure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: package-structure
Source: https://github.com/ClankerGuru/opsx/tree/main/cli/src/main/resources/content/skills/package-structure
Command: npx skills add https://github.com/ClankerGuru/opsx --skill package-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a reference guide for Kotlin package design, focusing on cohesion, acyclic dependencies, feature vs layer, and this project's Gradle settings plugin layout under {group}.{plugin} with model/task/workflow/scan/report/parse/analysis/skill sub-packages and enforced dependency direction. Activates when creating plugins, adding packages, or placing new classes.

Core Features & Use Cases

  • Package-by-feature layout guidance: structures plugins into cohesive, maintainable packages.
  • Gradle plugin layout standards: describes the standard folder/module arrangement under {group}.{plugin} with the eight sub-packages.
  • Best practices enforcement: helps avoid circular dependencies and enforces dependency direction.

Quick Start

Follow this guide when creating plugins, adding packages, or placing new classes.

Frequently Asked Questions about package-structure

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

FAQPage Schema
How do I structure a Kotlin Gradle plugin to avoid circular dependencies?

To structure a Kotlin Gradle plugin, organize code into a package-by-feature layout under {group}.{plugin} with model, task, workflow, scan, report, parse, analysis, and skill sub-packages. This enforces a one-way dependency direction to prevent cycles.

What is the best way to organize Kotlin packages for maintainability?

The best way to organize Kotlin packages for maintainability is using a package-by-feature layout that groups related classes into cohesive modules. This enforces a one-way dependency direction to prevent cycles.

How do I organize files when adding new classes to a Gradle plugin?

When adding new classes to a Gradle plugin, place files into one of the eight prescribed sub-packages under {group}.{plugin} based on their feature. This ensures module boundaries and dependency direction are maintained.

What is the standard sub-package layout for a Kotlin plugin?

The standard sub-package layout for a Kotlin plugin includes model, task, workflow, scan, report, parse, analysis, and skill packages under the {group}.{plugin} root. These sub-packages organize code by feature.

Can I use package-by-layer instead of package-by-feature for my Kotlin project?

Package-by-layer is discouraged in favor of package-by-feature for this Kotlin project. Package-by-feature structures plugins into cohesive, maintainable packages and enforces module boundaries to prevent circular dependencies.