MCPcopy Index your code
hub / github.com/enofex/taikai

github.com/enofex/taikai @v1.64.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.64.0 ↗ · + Follow
1,575 symbols 8,838 edges 103 files 226 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://github.com/enofex/taikai/raw/v1.64.0/docs/assets/images/taikai-logo-dark.png"
    height="150">







<img src="https://github.com/enofex/taikai/actions/workflows/maven.yml/badge.svg" />
<img src="https://img.shields.io/badge/Java%20Version-17-orange" />
<img height="20" src="https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg">

Taikai

Taikai extends the capabilities of the popular ArchUnit library by offering a comprehensive suite of predefined rules tailored for various technologies. It simplifies the enforcement of architectural constraints and best practices in your codebase, ensuring consistency and quality across your projects.

Maven Usage

Add Taikai as a dependency in your pom.xml:

<dependency>
  <groupId>com.enofex</groupId>
  <artifactId>taikai</artifactId>
  <version>${taikai.version}</version>
  <scope>test</scope>
</dependency>

Replace ${taikai.version} with the appropriate version defined in your project. Ensure that the required dependencies like ArchUnit are already declared.

Gradle Usage

Add Taikai as a dependency in your build.gradle file:

testImplementation "com.enofex:taikai:${taikaiVersion}"

Replace ${taikaiVersion} with the appropriate version defined in your project. Ensure that the required dependencies like ArchUnit are already declared.

JUnit Example Test

Here's an example demonstrating the usage of some Taikai rules with JUnit. Customize rules as needed using TaikaiRule.of().

@Test
void shouldFulfillConstraints() {
  Taikai.builder()
      .namespace("com.enofex.taikai")
      .java(java -> java
          .noUsageOfDeprecatedAPIs()
          .methodsShouldNotDeclareGenericExceptions()
          .utilityClassesShouldBeFinalAndHavePrivateConstructor()
          .imports(imports -> imports
              .shouldHaveNoCycles()
              .shouldNotImport("..internal.."))
          .naming(naming -> naming
              .classesShouldNotMatch(".*Impl")
              .methodsShouldNotMatch("^(foo$|bar$).*")
              .fieldsShouldNotMatch(".*(List|Set|Map)$")
              .fieldsShouldMatch("com.enofex.taikai.Matcher", "matcher")
              .constantsShouldFollowConventions()
              .enumConstantsShouldFollowConventions()
              .interfacesShouldNotHavePrefixI()))
      .logging(logging -> logging
          .loggersShouldFollowConventions(Logger.class, "logger", List.of(PRIVATE, FINAL)))      
      .test(test -> test
          .junit(junit -> junit
              .classesShouldNotBeAnnotatedWithDisabled()
              .methodsShouldNotBeAnnotatedWithDisabled()))
      .spring(spring -> spring
          .noAutowiredFields()
          .boot(boot -> boot
              .applicationClassShouldResideInPackage("com.enofex.taikai"))
          .configurations(configuration -> configuration
              .namesShouldEndWithConfiguration())
          .controllers(controllers -> controllers
              .shouldBeAnnotatedWithRestController()
              .namesShouldEndWithController()
              .shouldNotDependOnOtherControllers()
              .shouldBePackagePrivate())
          .services(services -> services
              .shouldBeAnnotatedWithService()
              .shouldNotDependOnControllers()
              .namesShouldEndWithService())
          .repositories(repositories -> repositories
              .shouldBeAnnotatedWithRepository()
              .shouldNotDependOnServices()
              .namesShouldEndWithRepository())
          .transactional(transactional -> transactional
              .methodsShouldBePublic()
              .shouldNotBeUsedInControllers()))      
      .addRule(TaikaiRule.of(...)) // Add custom ArchUnit rule here
      .build()
      .checkAll();
}

User Guide

Explore the complete documentation for comprehensive information on all available rules.

Contributing

Interested in contributing? Check out our Contribution Guidelines for details on how to get involved. Note, that we expect everyone to follow the Code of Conduct.

What you will need

  • Git
  • Java 17 or higher

Get the Source Code

Clone the repository

git clone git@github.com:enofex/taikai.git
cd taikai

Build the code

To compile, test, and build

./mvnw clean package -B

Backers

The Open Source Community

Website

Visit the Taikai Website for general information and documentation.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 1,111
Class 449
Interface 11
Enum 4

Languages

Java100%

Modules by API surface

src/test/java/com/enofex/taikai/java/NamingConfigurerTest.java112 symbols
src/test/java/com/enofex/taikai/java/JavaConfigurerAdditionalTest.java107 symbols
src/test/java/com/enofex/taikai/test/JUnitConfigurerTest.java61 symbols
src/test/java/com/enofex/taikai/spring/ControllersConfigurerTest.java61 symbols
src/main/java/com/enofex/taikai/java/JavaConfigurer.java45 symbols
src/test/java/com/enofex/taikai/spring/RepositoriesConfigurerTest.java40 symbols
src/test/java/com/enofex/taikai/spring/ServicesConfigurerTest.java39 symbols
src/test/java/com/enofex/taikai/java/MethodModifierTest.java39 symbols
src/test/java/com/enofex/taikai/spring/PropertiesConfigurerTest.java38 symbols
src/test/java/com/enofex/taikai/spring/TransactionalConfigurerTest.java35 symbols
src/test/java/com/enofex/taikai/quarkus/ResourcesConfigurerTest.java31 symbols
src/test/java/com/enofex/taikai/quarkus/AiConfigurerTest.java29 symbols

For agents

$ claude mcp add taikai \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page