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.4.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.4-py3-none-any.whl (130.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: totool_council-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 3000718d41bbd42fb787bbfe0c36ce49d1885fd8409a44695782c4c42d50c1d1
MD5 5eef86e11259efdceb31c6b03f738075
BLAKE2b-256 7174858ed2b3a855b4e8ccea0981e348344132b50a5f9fda85cea99881a0836b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: totool_council-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 94ecb062fb9fea8126dc8f69a54c920b3a9b0850f5d57ff887f2b6ca9bd8bfe6
MD5 48c7865ae6bfa17fd853c547d0004cb0
BLAKE2b-256 52bf4537b2389bb6d0a65983541a6c80f0cd8c08e5405d846961b265d57ec5a1

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