Metadata-Version: 2.4
Name: high-taste
Version: 0.1.0
Summary: MCP server that enforces coding style decisions based on taste and convention
Author-email: Alex Dong <alex@example.com>
License: # Functional Source License, Version 1.1, Apache 2.0 Future License
        
        ## Abbreviation
        
        FSL-1.1-Apache-2.0
        
        ## Notice
        
        Copyright 2024 Alex Dong
        
        ## Terms and Conditions
        
        ### Licensor ("We")
        
        The party offering the Software under these Terms and Conditions.
        
        ### The Software
        
        The "Software" is each version of the software that we make available under
        these Terms and Conditions, as indicated by our inclusion of these Terms and
        Conditions with the Software.
        
        ### License Grant
        
        Subject to your compliance with this License Grant and the Patents,
        Redistribution and Trademark clauses below, we hereby grant you the right to
        use, copy, modify, create derivative works, publicly perform, publicly display
        and redistribute the Software for any Permitted Purpose identified below.
        
        ### Permitted Purpose
        
        A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
        means making the Software available to others in a commercial product or
        service that:
        
        1. substitutes for the Software;
        
        2. substitutes for any other product or service we offer using the Software
           that exists as of the date we make the Software available; or
        
        3. offers the same or substantially similar functionality as the Software.
        
        Permitted Purposes specifically include using the Software:
        
        1. for your internal use and access;
        
        2. for non-commercial education;
        
        3. for non-commercial research; and
        
        4. in connection with professional services that you provide to a licensee
           using the Software in accordance with these Terms and Conditions.
        
        ### Patents
        
        To the extent your use for a Permitted Purpose would necessarily infringe our
        patents, the license grant above includes a license under our patents. If you
        make a claim against any party that the Software infringes or contributes to
        the infringement of any patent, then your patent license to the Software ends
        immediately.
        
        ### Redistribution
        
        The Terms and Conditions apply to all copies, modifications and derivatives of
        the Software.
        
        If you redistribute any copies, modifications or derivatives of the Software,
        you must include a copy of these Terms and Conditions and make clear that the
        Terms and Conditions apply to those copies, modifications or derivatives.
        
        ### Disclaimer
        
        THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS
        OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF TITLE,
        NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. YOU
        ASSUME THE ENTIRE RISK ASSOCIATED WITH YOUR USE OF THE SOFTWARE. SOME
        JURISDICTIONS MAY NOT ALLOW THE FOREGOING DISCLAIMERS, SO SOME OF THESE
        DISCLAIMERS MAY NOT APPLY TO YOU.
        
        ### Limitation of Liability
        
        TO THE EXTENT PERMITTED BY LAW, IN NO EVENT WILL WE BE LIABLE FOR ANY INDIRECT,
        SPECIAL, INCIDENTAL, CONSEQUENTIAL OR PUNITIVE DAMAGES (INCLUDING WITHOUT
        LIMITATION DAMAGES FOR LOSS OF BUSINESS, LOSS OF PROFITS, BUSINESS
        INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) WHETHER
        BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY, OR OTHERWISE, EVEN IF
        WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. OUR LIABILITY FOR
        DAMAGES OF ANY KIND WHATSOEVER ARISING OUT OF THIS AGREEMENT SHALL BE LIMITED
        TO $100 USD. SOME JURISDICTIONS MAY NOT ALLOW THE FOREGOING LIMITATIONS, SO
        SOME OF THESE LIMITATIONS MAY NOT APPLY TO YOU.
        
        ### Term and Termination
        
        This License Grant will continue unless and until terminated by us or you as
        set forth below.
        
        Your license and any rights under this License Grant will terminate
        immediately without notice if you violate any of the terms and conditions of
        this License Grant. Upon termination, you agree to immediately cease using and
        distributing the Software.
        
        We may terminate this License Grant, without cause, by providing 30 days
        written notice.
        
        Upon any termination of this License Grant, the Disclaimer and Limitation of
        Liability clauses will survive such termination.
        
        ### Future License
        
        On the second anniversary of our first making the Software available under
        these Terms and Conditions, the Software will be made available under the
        terms of the Apache License, Version 2.0.
        
        ### Miscellaneous
        
        This License Grant is the entire agreement between you and us concerning the
        Software. It may only be modified by written agreement signed by both you and
        us.
        
        If any provision of this License Grant is held to be unenforceable, such
        provision shall be reformed only to the extent necessary to make it
        enforceable.
        
        The failure of either you or us to enforce any provision of this License Grant
        shall not constitute a waiver of future enforcement of that or any other
        provision.
Project-URL: Homepage, https://github.com/alexdong/high-taste
Project-URL: Repository, https://github.com/alexdong/high-taste
Project-URL: Issues, https://github.com/alexdong/high-taste/issues
Keywords: mcp,linter,code-style,taste,python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0.0
Requires-Dist: click>=8.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: loguru>=0.7.0
Requires-Dist: importlib_resources>=5.0.0; python_version < "3.9"
Dynamic: license-file

# High-Taste

An MCP (Model Context Protocol) server that enforces coding style decisions based on high-taste and convention rather than semantic correctness. Following the "Effective C++" tradition, High-Taste provides rules with examples and rationale to maintain consistent, readable code.

## Overview

High-Taste helps development teams maintain code quality by:
- **Checking new code** against established high-taste rules (like a linter for style preferences)
- **Learning from expert refactoring** by analyzing before/after diffs to create new rules
- **Integrating seamlessly** with Claude Code and VS Code via MCP

Unlike traditional linters that focus on syntax and semantics, High-Taste enforces subjective but important style decisions that make code more maintainable, readable, and consistent with team preferences.

## Core Functions

### `taste_check`
Analyzes Python files against existing high-taste rules and reports violations with specific line numbers and rule references.

**Input**: List of file contents (Python code)
**Output**: Linting-style errors with rule numbers and descriptions

### `taste_acquire` 
Learns new high-taste rules by analyzing diffs where experienced programmers have refactored code originally written by junior developers or AI.

**Input**: Set of git diffs showing before/after code changes
**Output**: New rules created or confirmation that existing rules already cover the patterns

## Implementation Plan

### Phase 1: Core Architecture
1. **Rule System Design**
   - Create `rules/` directory with markdown files (one rule per file)
   - Implement rule parser to extract patterns, examples, and metadata
   - Design rule matching engine using AST analysis for semantic patterns
   - Create rule numbering/ID system for references

2. **MCP Server Foundation**
   - Set up MCP server infrastructure with proper protocol handling
   - Implement `high-taste_check` function with file content analysis
   - Implement `taste_acquire` function with diff analysis
   - Create standardized JSON output formats for both functions

### Phase 2: Pattern Recognition
3. **high-taste_check Implementation**
   - Build AST-based pattern matcher for Python code structures
   - Implement rule violation detection with line number reporting
   - Create rule severity system (error, warning, suggestion)
   - Add support for incremental checking (only changed lines)

4. **taste_acquire Implementation**
   - Develop diff parser to extract before/after code patterns
   - Create pattern generalization algorithm (specific → general rules)
   - Implement rule conflict detection and resolution
   - Build automatic rule description generation

### Phase 3: Integration
5. **IDE Integration**
   - Configure MCP server for Claude Code integration
   - Set up VS Code MCP client configuration
   - Create configuration files for both environments
   - Test end-to-end workflow in both IDEs

6. **Rule Management**
   - Implement rule CRUD operations (create, read, update, disable)
   - Add rule versioning and change tracking
   - Create rule validation and testing framework
   - Build rule export/import functionality

### Phase 4: Advanced Features
7. **Intelligence Enhancements**
   - Add machine learning for better pattern recognition
   - Implement context-aware rule application
   - Create rule recommendation system
   - Add support for custom rule templates

8. **Monitoring and Metrics**
   - Track rule violation frequency and trends
   - Measure rule effectiveness and adoption
   - Create dashboard for team rule compliance
   - Add automated rule quality assessment

## Installation

### Install from PyPI

```bash
# Install using pip
pip install high-taste

# Or install using uv
uv pip install high-taste

# Or run directly with uvx (no installation needed)
uvx high-taste --help
```

### Install from source

```bash
git clone https://github.com/alexdong/high-taste.git
cd high-taste
uv pip install -e .
```

## Usage

### Command Line Interface

High-Taste provides a CLI for standalone usage and testing:

```bash
# List all available taste rules
high-taste rules

# Check Python files for taste violations
high-taste check file1.py file2.py

# Start the MCP server
high-taste serve

# Enable debug logging
high-taste --debug check file.py
```

### Using with uvx

You can run High-Taste directly without installation using uvx:

```bash
# Run any command with uvx
uvx high-taste rules
uvx high-taste check mycode.py
uvx high-taste serve
```

### MCP Integration

To use High-Taste as an MCP server with Claude Code or VS Code:

1. **For Claude Code**: Copy `configs/claude-code.json` to your Claude Code configuration directory
2. **For VS Code**: Copy `configs/vscode.json` to your VS Code configuration directory

Then the `taste_check` and `taste_acquire` tools will be available in your IDE.

## Project Structure

```
./
├── src/
│   ├── high_taste/         # Main MCP server code
│   │   ├── server.py       # MCP server implementation
│   │   ├── rules/          # Rule management and matching
│   │   ├── parsers/        # AST and diff parsing
│   │   └── utils/          # Helper functions
├── rules/                  # High-Taste rules (markdown files)
│   ├── 001-assertions-over-exceptions.md
│   ├── 002-load-resources-once.md
│   ├── 003-eliminate-deep-nesting.md
│   ├── 004-dynamic-data-discovery.md
│   ├── 005-structured-return-types.md
│   ├── 006-database-transaction-safety.md
│   └── ...
├── tests/                  # Test files
├── examples/               # Example configurations
├── docs/                   # Documentation
└── configs/                # MCP client configurations
    ├── claude-code.json
    └── vscode.json
```
