Skip to main content

A council of 3 AI critics that must reach consensus on code quality decisions

Project description

Code Review Council

A CLI tool that uses a council of 3 AI critics to reach consensus on code quality decisions.

Python Version License Version

Overview

Code Review Council (ttc) is a command-line tool that employs three specialized AI critics to review your code:

Critic Focus
๐Ÿ”’ Security Specialist Vulnerabilities, secrets, security best practices
โšก Performance Engineer Efficiency, resource usage, scalability
๐Ÿ“ Clean Code Advocate Maintainability, readability, code organization

The three critics must reach consensus before approving code, ensuring thorough and balanced reviews.

Exit Codes

  • 0 = โœ… Approved (all critics agree)
  • 1 = โš ๏ธ Needs Work (minor issues, some approval)
  • 2 = โŒ Rejected (significant issues)

Features

  • Multi-AI Provider Support - DeepSeek, Mistral, Kimi, MiniMax, Claude, and any provider with chat completions API
  • Consensus-Based Decisions - 3-council system requires majority approval
  • Security-First Design - Built-in secret scanning with 50+ patterns
  • Flexible Review Strategies - Hierarchical, parallel, chunked reviews
  • Customizable Critics - Default brutal prompts with extensive customization options
  • Rich Output - Color-coded terminal output with progress indicators
  • CI/CD Integration - Exit codes for automated pipelines

Quick Start

Installation

# Install from source
pip install -e .

# Or with optional async support
pip install -e ".[async]"

# Or with all features
pip install -e ".[all]"

Configuration

Create ~/.ttc/config.json with your provider configuration:

{
  "active_provider": "deepseek",
  "providers": [
    {
      "name": "deepseek",
      "model": "deepseek-chat",
      "base_url": "https://api.deepseek.com",
      "api_key": "your-deepseek-key"
    }
  ]
}

Custom Providers: You can add any AI provider with a chat completions API by specifying the base_url, model, and api_key. Works with Kimi, MiniMax, Claude, and many others. See QUICKSTART.md for details.

Basic Usage

# Review a single file
ttc review myfile.py

# Review entire project
ttc review /path/to/project

# Switch providers by editing config.json (set active_provider)
# Then run:
ttc review src/

# Streaming mode for large projects
ttc review --streaming large-project/

# Custom critics directory
ttc review --critics-dir ./my-critics src/

Documentation

How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Your Code     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  Council โ”‚
    โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚         โ”‚          โ”‚          โ”‚
โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ” โ”Œโ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚Securityโ”‚ โ”‚Perform.โ”‚ โ”‚Clean Codeโ”‚ โ”‚Consensusโ”‚
โ”‚Critic  โ”‚ โ”‚Critic  โ”‚ โ”‚Critic    โ”‚ โ”‚Builder  โ”‚
โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚        โ”‚          โ”‚          โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚ Final Decision โ”‚
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Security Features

  • Secret Scanning - 50+ patterns including AWS keys, GitHub tokens, API keys
  • SSL Validation - Certificate verification for all API calls
  • TOCTOU Prevention - Time-of-check to time-of-use attack protection
  • Secure Config - API keys stored in user directory, never committed

AI Providers

I've tested with DeepSeek, ZAI, Mistral, Claude, and OpenAI. Other providers should work as long as they have a standard chat completions API.

To add a provider, specify the base_url, model, and api_key in your config:

{
  "active_provider": "your-provider",
  "providers": [
    {
      "name": "your-provider",
      "model": "model-name",
      "base_url": "https://api.provider.com",
      "api_key": "your-api-key"
    }
  ]
}

Development

Running Tests

pytest

Project Structure

totool/
โ”œโ”€โ”€ council/                # Main Python package
โ”‚   โ”œโ”€โ”€ critics/           # AI critic configurations
โ”‚   โ”œโ”€โ”€ data/              # Configuration data
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ tests/                 # Test suite
โ”œโ”€โ”€ docs/                  # Documentation
โ””โ”€โ”€ pyproject.toml         # Package configuration

See .claude/CLAUDE.md for detailed architecture and development reference.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

totool_council-0.1.3.tar.gz (136.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

totool_council-0.1.3-py3-none-any.whl (130.4 kB view details)

Uploaded Python 3

File details

Details for the file totool_council-0.1.3.tar.gz.

File metadata

  • Download URL: totool_council-0.1.3.tar.gz
  • Upload date:
  • Size: 136.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for totool_council-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1856db139311b60948d1c4b824d2c9195803a01139110f8f24805c2611fd8cc3
MD5 a1b9974afb552a95731105eb4cf43123
BLAKE2b-256 b926ded5c663db8669d1e0cb45d623cc584f4abb7343b0b16e49c81a1cf40590

See more details on using hashes here.

File details

Details for the file totool_council-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: totool_council-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 130.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for totool_council-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d284ce94f423bc792f3c57a8f79087875387a1ba5cb2ecb9830c8e3f1112a40a
MD5 1f7861de5522359024d78dd83030361c
BLAKE2b-256 b7980acbbfcd0017bb4b3655b6ed4b1cab112e6b2a30cd204a84c6afd1c56bda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page