detect-hidden-contracts

Detect implicit assumptions in code that may cause runtime errors.

1|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/quangphu1912/codebase-analyzer --skill detect-hidden-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detect-hidden-contracts
Source: https://github.com/quangphu1912/codebase-analyzer/tree/main/skills/detect-hidden-contracts
Command: npx skills add https://github.com/quangphu1912/codebase-analyzer --skill detect-hidden-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill finds implicit assumptions in code that can lead to runtime bugs, such as unvalidated environment variables, assumed object shapes, or temporal state requirements.

Core Features & Use Cases

  • Detect Environment Variable Contracts: Identify code that assumes environment variables will always be set, potentially leading to silent errors or crashes.
  • Detect Ordering Contracts: Detect code that relies on the correct execution order of functions, often through shared mutable state.
  • Detect Shape Contracts: Find code that assumes certain object shapes without validation, leading to errors when these assumptions are violated.
  • Detect Temporal Contracts: Identify code that relies on certain states being present at specific times, potentially causing subtle bugs.
  • Detect Error Contracts: Find code that expects specific error types but may not handle other errors, leading to silent failures.
  • Use Case: For a financial application, this Skill can help identify unvalidated environment variables used for critical operations, such as database connection strings.

Quick Start

Run the detect-hidden-contracts skill to analyze the codebase for hidden contracts in the current project.

Frequently Asked Questions about detect-hidden-contracts

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

FAQPage Schema
How do I find hidden assumptions in code that cause runtime errors?

You can detect undocummented code assumptions by scanning for implicit contracts related to environment variables, function ordering, object shapes, and error handling. Identifying these hidden assumptions prevents runtime bugs and silent failures in critical applications.

What are code ordering contracts and how do they affect application reliability?

Ordering contracts are implicit dependencies on the correct execution sequence of functions, often through shared mutable state. Violating these hidden assumptions affects application reliability by introducing subtle temporal bugs and runtime errors.

How do I check my codebase for unvalidated environment variables?

To check your codebase for unvalidated environment variables, run an analysis that detects code assuming environment variables will always be set. This identifies missing validation for critical operations like database connection strings, preventing silent errors and crashes.

Can I use code analysis to detect assumed object shapes without validation?

Yes, you can use code analysis to detect assumed object shapes without validation. By scanning the codebase for implicit shape contracts, you find code that expects specific object structures, preventing runtime errors when these shape assumptions are violated.

What is the best way to identify temporal contracts in a financial application codebase?

The best way to identify temporal contracts in a financial application codebase is to analyze the code for temporal state requirements. This detects code relying on certain states being present at specific times, preventing subtle bugs in critical operations.

Why does my code silently fail when it expects specific error types?

Your code silently fails because of hidden error contracts where the code expects specific error types but lacks handling for other errors. Detecting these implicit assumptions ensures robust error handling and prevents silent failures during runtime.