ms-foundation-constitution

Check source code for size, complexity, and modularity compliance.

Updated Oct 16, 2025
One-click install
npx skills add https://github.com/beomeodev/specter --skill ms-foundation-constitution
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ms-foundation-constitution
Source: https://github.com/beomeodev/specter/tree/main/.claude/skills/ms-foundation-constitution
Command: npx skills add https://github.com/beomeodev/specter --skill ms-foundation-constitution

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Constitution Section II compliance validator for Simplicity-First Architecture that checks file size limits (≤500 SLOC excluding comments), function complexity using McCabe metrics (≤10 cyclomatic complexity), function length constraints (≤100 LOC), and provides actionable refactoring suggestions with split strategies when violations detected. Use when validating code quality, checking file size limits, analyzing function complexity, reviewing Constitution compliance, implementing new features, or running quality gate checks

Core Features & Use Cases

  • Validates file size, function complexity, and function length against Constitution thresholds
  • Suggests refactoring strategies and split plans to restore compliance
  • Integrates into CI gates and code reviews to enforce architecture rules

Quick Start

Run the constitution validator on your codebase to enforce size, complexity, and refactoring guidance.

Frequently Asked Questions about ms-foundation-constitution

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

FAQPage Schema
How do I check my source code against file size and cyclomatic complexity limits?

You can validate source code by checking file size limits of ≤500 SLOC and cyclomatic complexity thresholds of ≤10 per function. This validator analyzes your codebase to detect violations and provides actionable refactoring suggestions with split strategies.

What is McCabe cyclomatic complexity and when should I enforce it in code reviews?

McCabe cyclomatic complexity measures the number of independent paths through a function's code. You should enforce a threshold of ≤10 during code reviews or CI quality gates to identify overly complex functions that require refactoring and splitting.

How do I automate code quality gate checks for function length and SLOC limits?

Automate code quality gate checks by integrating this validator into your CI pipeline to enforce function length limits of ≤100 LOC and file sizes of ≤500 SLOC. It detects violations automatically and outputs actionable split strategies to guide refactoring.

What is the best way to refactor a file that exceeds 500 SLOC and violates modularity rules?

The best way to refactor large files is to use this validator to identify specific SLOC and complexity violations, then apply the generated split strategies. It targets files exceeding 500 SLOC and provides actionable plans to restore modularity and compliance.

Does this code quality validator exclude comments when measuring source lines of code?

Yes, the code quality validator excludes comments when measuring source lines of code. It enforces a strict limit of ≤500 SLOC per file by only counting executable lines, ensuring accurate complexity and size metrics for your quality gates.

Why does my CI build fail when my function exceeds 100 lines of code?

Your CI build fails because the validation enforces a strict limit of ≤100 LOC per function to maintain Simplicity-First Architecture. Run the validator locally to identify the offending functions and apply the suggested split strategies before pushing.