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.0.tar.gz (132.0 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.0-py3-none-any.whl (125.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: totool_council-0.1.0.tar.gz
  • Upload date:
  • Size: 132.0 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.0.tar.gz
Algorithm Hash digest
SHA256 449f828bb6301ca13c80e279f505596c9efaad34e2ac31886f01a1676a0913c7
MD5 4d8fcfadfa0ba35235ecbe7b06f67ff4
BLAKE2b-256 3ea8d70c7eb3bb5d6567925b8e79eb1770917f9ff3a2476aeff942b7a49b24d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: totool_council-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 125.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f3fe33efb9e97d4c46403bbfccb263860e846244338e659a2e9ea37af4393a4
MD5 64f3da47d5eb7ef82db9972fc9d1da5d
BLAKE2b-256 a579b8c7c3002ab4e1e8e7f6eeb24f744e0572dcbddb537c4985b965d31fbe40

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