ratios

Measure code composition ratios in Python and TypeScript files.

Updated May 23, 2026
One-click install
npx skills add https://github.com/The-Interdependency/skill-lib --skill ratios
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ratios
Source: https://github.com/The-Interdependency/skill-lib/tree/main/ratios
Command: npx skills add https://github.com/The-Interdependency/skill-lib --skill ratios

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ratios_check.py, and includes scripts (resource) and references (resource) components.

What problem does it solve?

The ratios Skill helps developers ensure code quality and composition ratios are in check by analyzing and measuring specific attributes such as lines of code, comments, imports, and public symbols in code files.

Core Features & Use Cases

  • Ratio Measurement: Automatically measures loc_comments, imports_exports, and calls_definitions in code files.
  • Drift Detection: Identifies any discrepancies between declared and actual ratios.
  • Integration with CI/CD: Can be integrated into the CI/CD pipeline to enforce codebase standards.
  • Use Case: Before merging a feature branch, ensure all ratios within your Python modules meet the required benchmarks for code density and structure.

Quick Start

To compute the ratios for all Python files in the current directory, use: 'ratios check --root .'

Frequently Asked Questions about ratios

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

FAQPage Schema
How do I measure code composition ratios in Python or TypeScript files?

Measuring code composition ratios involves calculating the density of lines of code versus comments, the utility of import statements versus public exports, and the graph position of call sites to definitions. This analysis applies to Python and TypeScript source files.

What is the best way to check code density and structure before merging a feature branch?

Checking code density and structure before a merge requires analyzing specific codebase composition ratios. You measure loc_comments, imports_exports, and calls_definitions to ensure the modules meet required structural benchmarks and quality standards.

Can I integrate code metrics analysis into my CI/CD pipeline?

Yes, you can integrate code metrics analysis into your CI/CD pipeline to enforce codebase standards. This integration automatically measures composition ratios and identifies discrepancies between declared and actual code metrics during the build process.

Does the codebase composition analysis support both Python and TypeScript extensions?

Yes, codebase composition analysis supports Python and TypeScript file extensions. It measures source code files in these languages to identify internal density, surface utility, and graph position ratios for development best practices.

How do I detect drift between declared and actual code metrics?

To detect drift between declared and actual code metrics, you analyze codebase composition ratios within your source files. This drift detection identifies discrepancies in loc_comments, imports_exports, and calls_definitions measurements.