konsist

Enforce Kotlin architecture and code-quality rules with Konsist scope APIs.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ClankerGuru/opsx --skill konsist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: konsist
Source: https://github.com/ClankerGuru/opsx/tree/main/cli/src/main/resources/content/skills/konsist
Command: npx skills add https://github.com/ClankerGuru/opsx --skill konsist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Konsist helps Kotlin teams enforce architectural constraints and code-quality rules by providing a PSI-aware testing DSL to write scope-based checks across the codebase.

Core Features & Use Cases

  • Scope creation with Konsist.scopeFromProject(), Konsist.scopeFromProduction(), and related APIs to define the code surface under test.
  • Declaration queries to locate classes, functions, properties, and other declarations, with rich filtering capabilities.
  • Flexible assertions to enforce architecture boundaries, naming conventions, packaging layouts, and annotations.
  • Architecture verification via reusable layers and cross-module checks, supporting end-to-end governance of code structure.
  • Seamless Kotest/JUnit integration for embedding architecture checks in your test suite.

Quick Start

Create a Konsist scope in your test and start asserting architecture rules with Kotest or JUnit.

Frequently Asked Questions about konsist

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

FAQPage Schema
How do I enforce layered architecture constraints in a multi-module Kotlin project?

To enforce Kotlin architecture rules, create a scope using Konsist.scopeFromProject() or scopeFromProduction(), query declarations like classes and functions, and apply assertions to validate naming, packaging, and layered boundaries within your test suite.

Can I check Kotlin naming conventions and packaging rules using Kotest?

Yes, Konsist integrates with Kotest to verify Kotlin naming conventions and packaging layouts. You define a scope, query declarations, and use flexible assertions to enforce code-quality rules directly within your test suite.

What is Konsist scope and how does it work for architecture testing?

Konsist scope defines the code surface under test for architecture verification. You create a scope using Konsist.scopeFromProject() or scopeFromProduction() to isolate declarations, then query and filter classes or functions to apply assertions that govern code structure.

Does this architecture testing approach require any specific Kotlin project setup?

Yes, enforcing Kotlin architecture rules with Konsist requires an existing Kotlin project. It leverages PSI-aware APIs to query declarations across multi-module codebases, using Kotest or JUnit as the test execution framework to validate constraints during test runs.

How do I validate cross-module dependencies and architecture boundaries in Kotlin?

You validate cross-module dependencies in Kotlin by defining reusable layers and writing scope-based assertions. Konsist automates this by querying declarations across the project scope and verifying that architectural boundaries and code-quality constraints are maintained during test runs.