Metadata-Version: 2.4
Name: csharp-repomap
Version: 0.1.0
Summary: Generate layered code maps for C# projects, optimized for AI assistants like Claude
Author-email: Yoji <yoji@example.com>
License: MIT
Project-URL: Homepage, https://github.com/user/csharp-repomap
Project-URL: Repository, https://github.com/user/csharp-repomap
Project-URL: Issues, https://github.com/user/csharp-repomap/issues
Keywords: csharp,unity,code-analysis,repomap,claude,ai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tree-sitter>=0.20.0
Requires-Dist: tree-sitter-c-sharp>=0.20.0
Requires-Dist: networkx>=2.6
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Provides-Extra: tiktoken
Requires-Dist: tiktoken>=0.5.0; extra == "tiktoken"
Dynamic: license-file

# csharp-repomap

Generate layered code maps for C# projects, optimized for AI assistants like Claude.

## What is it?

**csharp-repomap** creates structured code maps that help AI assistants understand your C# codebase. It generates three levels of detail:

- **L1 Skeleton** (~1k tokens): Module overview and core entry classes
- **L2 Signatures** (~2k tokens): Class and method signatures
- **L3 Relations** (~3k tokens): Reference graph between classes

The tool uses **tree-sitter** for accurate C# parsing and **PageRank** algorithm to identify the most important classes in your codebase.

## Features

- **Tree-sitter parsing**: Accurate C# syntax analysis
- **PageRank ranking**: Identify important classes by reference count
- **Token-limited output**: Fits within AI context windows
- **Git hooks**: Auto-update on pull/merge/checkout
- **Windows notifications**: Toast notifications when updates complete
- **Unity preset**: Pre-configured for Unity projects

## Installation

```bash
pip install csharp-repomap
```

For token counting (optional):
```bash
pip install csharp-repomap[tiktoken]
```

## Quick Start

```bash
# Initialize in your project (choose preset)
cd your-csharp-project
repomap init --preset unity    # For Unity projects
repomap init --preset generic  # For other C# projects

# Generate repo map
repomap generate --verbose

# Check status
repomap status

# Install Git hooks for auto-update
repomap hooks --install
```

## Configuration

After `repomap init`, edit `.repomap/config.yaml`:

```yaml
project_name: "My Project"

source:
  root_path: "Assets/Scripts"  # Path to your C# source
  exclude_patterns:
    - "**/Editor/**"
    - "**/Tests/**"

tokens:
  l1_skeleton: 1000
  l2_signatures: 2000
  l3_relations: 3000

importance_boost:
  patterns:
    - prefix: "S"           # SPlayerService
      boost: 2.0
    - suffix: "Manager"     # GameManager
      boost: 1.5
```

## Output Files

Generated in `.repomap/output/`:

| File | Description |
|------|-------------|
| `repomap-L1-skeleton.md` | Module overview, categories, core classes |
| `repomap-L2-signatures.md` | Top classes with method signatures |
| `repomap-L3-relations.md` | Reference graph (who calls whom) |
| `repomap-meta.json` | Git info, statistics, timestamps |

## Git Hooks

Auto-update repo map when code changes:

```bash
# Install hooks
repomap hooks --install

# Uninstall hooks
repomap hooks --uninstall
```

Hooks trigger on:
- `git pull`
- `git merge`
- `git checkout` (branch switch)

## Usage with Claude Code

1. Add `.repomap/output/` to your project context
2. Claude will see the L1/L2/L3 files and understand your codebase structure
3. The maps auto-update as you pull new code

Example prompt:
> "Look at the repo map to understand the module structure, then implement..."

## Presets

### Unity Preset
- Configured for `Assets/Scripts`
- Boosts `SXxx` service classes
- Categories: Core, Game, UI, Data, Network, Audio

### Generic Preset
- Configured for `src` directory
- Boosts `Service`, `Repository`, `Controller` patterns
- Categories: Core, Domain, Application, API, Data

## Requirements

- Python 3.8+
- Git (for hooks and commit info)
- Windows 10+ (for Toast notifications)

## License

MIT License - see [LICENSE](LICENSE)
