- Home
- Skills
- Code Quality & Review
- API Contract Planner — Know What You Can Deprecate
Works with the AI Agents you already use
API Contract Planner — Know What You Can Deprecate
Map exported surfaces, find hidden deep-import consumers, and identify third-party type leaks for safe deprecation.
$12
API Contract Planner — Know What You Can Deprecate
Example session with this skill installed
Map the public contract for the 'ui-components' package in this repo. I need to know what is safe to deprecate before the v2 release.
- Read your context and instructions
- Compiled the api contract planner
I have analyzed the ui-components package surface and mapped all consumers within the repository. The analysis found 12 exports, 4 of which are "hidden" (not in the barrel file) and 2 that leak types from the axios package.
API Contract Map: ui-components
| Category | Count | Status |
|---|---|---|
| Published Surface | 8 | Symbols re-exported in src/index.ts |
| Hidden Surface | 4 | Reachable via deep import; 1 is actively used |
| Unused Candidates | 3 | Confirmed zero usages in this repository |
| External Leaks | 2 | Public types depending on axios |
The Retirement Order
LegacyButton(High Priority): Exported fromsrc/atoms/Button.ts. 0 consumers found. Safe to remove.
OldThemeConfig (Medium Priority): Hidden export in src/theme/types.ts. 0 consumers found. Recommend internalizing.
3.
DataFetcher (Low Priority): Published export. 2 consumers found. Deprecation warning required as it leaks AxiosRequestConfig.
Third-Party Exposure
FetchOptionsinsrc/api.tsleaksAxiosResponse. Upgradingaxioswill break consumers of this package.ClientInstanceinsrc/client.tsleaksAxiosInstance.
Hidden Surface Details
InternalStateis exported fromsrc/state.tsbut not in the barrel.services-pkgis deep-importing this symbol. Do not remove without refactoringservices-pkg.
Next steps
- Review the
LegacyButtonremoval to ensure no external apps rely on it. - Move
InternalStateinto the barrel file or refactor the consumer to use the public API. - Wrap the
axiostypes in internal interfaces to plug the external leaks.
Connects securely to your tools. The creator never sees your data.
About this skill
Managing a growing library or SDK often leads to "barrel file" blindness. You think you know your public API because you checked index.ts, but consumers might be deep-importing internal files or relying on leaked third-party types. This creates a maintenance nightmare where you cannot deprecate code for fear of breaking invisible dependencies.
This skill maps the actual exported surface of a package, identifying what is published, what is hidden, and what is safely removable. It identifies every exported symbol, traces it to its specific file, and calculates usage counts across the repository. The result is a prioritized retirement plan that lets you prune your codebase with confidence.
What it does
- Surface mapping identifies every exported symbol and its originating file beyond just the barrel exports.
- Consumer tracing locates every internal usage of a symbol, including deep imports that bypass official entry points.
- Leak detection flags public types that expose third-party package dependencies, preventing accidental breaking changes during upgrades.
- Hidden contract identification highlights internal modules reachable by consumers but not explicitly published.
- Retirement planning generates an ordered list of unused exports ready for deprecation or removal.
How it works
- Frame the package by identifying the source directory, manifest, and entry points.
- Scan the surface using
agent-contextor manual file inspection to list allpublicApisymbols and internal dependencies. - Map consumers via
git grepto find every symbol usage and deep import within the workspace. - Assess exposure by checking if exported signatures depend on external types like
Pool,Request, orClient. - Generate the map using a structured template that ranks exports by risk and usage.
Frameworks & tools
The skill is optimized for TypeScript and JavaScript monorepos or libraries. It uses git for consumer mapping and integrates with the ai-agent-context CLI for deep static analysis of exports and external dependency leaks.
Why this beats prompting it yourself
Generic prompts often stop at the barrel file or miss deep imports that lead to breaking changes. This skill follows a rigorous multi-phase method to verify the "hidden" contract and identify third-party type leaks that standard grep-based analysis ignores.
Use cases
- Deprecating code by finding exports that have zero consumers across the entire repository.
- Library auditing to see which internal types are leaking into the public API signature.
- Refactoring preparation to determine the blast radius of changing a specific exported symbol.
- Monorepo cleanup to find internal packages that are deep-importing from restricted modules.
Known limitations
Analysis is strictly read-only and limited to the current repository. It cannot detect usages in external private repositories or published packages consumed by third parties.
Analysis is read-only and limited to the local repository. It cannot detect consumers in external codebases or third-party applications. CLI-driven deep analysis requires ai-agent-context.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 28 days ago
Requires