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.1.tar.gz (135.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.1-py3-none-any.whl (128.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: totool_council-0.1.1.tar.gz
  • Upload date:
  • Size: 135.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.1.tar.gz
Algorithm Hash digest
SHA256 0e1e7c5744ab57f3fb48480551d0dfd2d4c129e3678f7a099b2d9d994cfd3dc4
MD5 89df6bde9435dd0f50326be5e3acf6f2
BLAKE2b-256 6514bd07c7d788e7749b56813a9f4388693598d03c93ed98bc5ab05a28724160

See more details on using hashes here.

File details

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

File metadata

  • Download URL: totool_council-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 128.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d82f1b2266b5f239b3423ff601c0e0227b91f7b6c4f0b213e17e092de189341
MD5 b3a336c6c6e7ec8b7a048d976dfc3c01
BLAKE2b-256 5e2652f38ee71ebb0b511eafa2387a2a2e4aec0ae07d32c3bc01d870668b5443

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