audit-type-ownership

Audit TypeScript type ownership across repository packages and output a move plan.

229|5|Updated May 25, 2026
One-click install
npx skills add https://github.com/compartmentdev/compartment --skill audit-type-ownership
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audit-type-ownership
Source: https://github.com/compartmentdev/compartment/tree/main/.codex/skills/audit-type-ownership
Command: npx skills add https://github.com/compartmentdev/compartment --skill audit-type-ownership

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Audit-type ownership in the repo to surface misplaced or duplicated types, query/service leaks, root export risks, and planned boundary moves.

Core Features & Use Cases

  • Non-mutating type ownership audits across packages to identify misplaced or duplicated types.
  • Help plan moves to align types with owning layers (contracts, query/service, apps) and reduce surface leakage.
  • Use cases include identifying root export risks, cross-package imports, and phased refactor planning.

Quick Start

Run the audit script from the repository root to inventory type declarations and cross-package imports and surface a move plan.

Frequently Asked Questions about audit-type-ownership

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

FAQPage Schema
How do I audit type ownership across a TypeScript monorepo?

You can identify duplicate type declarations and cross-package import leaks by running a non-mutating audit script that parses TypeScript imports and analyzes root exports across your repository packages.

How do I plan refactoring to fix root export risks in a monorepo?

Plan refactoring for root export risks by generating a move list and phased plan from the audit output, aligning misplaced types with their owning layers to reduce surface leakage.

When do I need a type ownership audit for cross-package imports?

You need a type ownership audit when query or service leaks appear across package boundaries, and you want a non-mutating inventory to identify potential ownership moves without altering code.

Can I use this type ownership audit on packages outside the Compartment repo?

The audit is configured for the Compartment repo structure across api, sdk, cli, and edge packages, but its logic for parsing TypeScript declarations and imports applies to similar monorepos.

What's the best way to locate misplaced or duplicate type declarations in TypeScript?

The best way to locate duplicate type declarations is to run a script that parses TypeScript declarations and analyzes root exports to surface a move list suitable for repo checks.