Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .clinerules
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
description: Architectural decisions for Python development
globs: ["**/*.py", "**"]
---

# Global ADRs (All Files)

## ADR: Use Python For All Development Purposes

1. use python for everything, and use python 3+

# Python File ADRs (*.py)

## ADR: Git Repository Integration for Provenance Tracking

1. Use subprocess module with git commands for all Git repository operations in Python applications
2. Validate Git repository existence before performing any git operations using subprocess.run(['git', 'rev-parse', '--git-dir'])
3. Integrate gitignore patterns for file filtering using pathspec module with 'gitwildmatch' pattern type
4. Implement git blame analysis to track file provenance including author, date, and commit metadata
5. Detect repository main branch dynamically by checking for 'main', 'master', or current branch
6. Use Path.resolve() for absolute path resolution when working with Git repository paths
7. Extract git metadata (commit hash, author, email, date) for all analyzed files to support provenance tracking

## ADR: Asynchronous Programming with Asyncio for Concurrent Operations

1. Use async/await pattern for all I/O-bound operations including API calls and file processing in Python modules
2. Import asyncio module for event loop management and concurrency primitives
3. Define async functions with 'async def' for any operation that performs network requests or file I/O
4. Use 'await' keyword for all async function calls and use asyncio.sleep() instead of time.sleep() in async contexts
5. Implement async context managers for resource management in asynchronous code
6. Use asyncio.gather() or asyncio.create_task() for concurrent execution of multiple async operations
7. Call asyncio.run() at the entry point to execute async main functions from synchronous code

## ADR: Click Framework for CLI Application Architecture

1. Use Click framework (click>=8.0.0) for all command-line interface implementation in Python applications
2. Structure CLI with @click.group() decorator at the top level and @click.command() for subcommands
3. Define command-line options using @click.option() with type hints, help text, and default values
4. Use @click.argument() for required positional arguments with click.Choice() for enumerated values
5. Include colorama>=0.4.6 for cross-platform colored terminal output in all CLI applications
6. Implement --verbose/-v flag for debug output and --force/-f flag to skip confirmation prompts
7. Provide clear help text for all commands and options using the help parameter

## ADR: Anthropic Claude AI Integration for Code Analysis

1. Use Anthropic Claude API (via BAML client) for all AI-powered code analysis in Python files
2. Default to 'claude-sonnet-4-20250514' model for analysis tasks unless specific model requirements dictate otherwise
3. Store Anthropic API keys in environment variables (ANTHROPIC_API_KEY) and never hardcode credentials in Python source files
4. Validate BAML client initialization before performing any AI operations using check_baml_client() validation
5. Import AI functionality from baml_client.async_client module for all async AI operations
6. Track token usage for all Claude API calls to monitor costs and usage patterns
7. Set BAML_LOG environment variable to 'OFF' to disable verbose logging in production
16 changes: 16 additions & 0 deletions .cursor/rules/adr-001.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
globs: ["**/*.py"]
alwaysApply: false
---

# Git Repository Integration for Provenance Tracking

## Policies

1. Use subprocess module with git commands for all Git repository operations in Python applications
2. Validate Git repository existence before performing any git operations using subprocess.run(['git', 'rev-parse', '--git-dir'])
3. Integrate gitignore patterns for file filtering using pathspec module with 'gitwildmatch' pattern type
4. Implement git blame analysis to track file provenance including author, date, and commit metadata
5. Detect repository main branch dynamically by checking for 'main', 'master', or current branch
6. Use Path.resolve() for absolute path resolution when working with Git repository paths
7. Extract git metadata (commit hash, author, email, date) for all analyzed files to support provenance tracking
16 changes: 16 additions & 0 deletions .cursor/rules/adr-002.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
globs: ["**/*.py"]
alwaysApply: false
---

# Asynchronous Programming with Asyncio for Concurrent Operations

## Policies

1. Use async/await pattern for all I/O-bound operations including API calls and file processing in Python modules
2. Import asyncio module for event loop management and concurrency primitives
3. Define async functions with 'async def' for any operation that performs network requests or file I/O
4. Use 'await' keyword for all async function calls and use asyncio.sleep() instead of time.sleep() in async contexts
5. Implement async context managers for resource management in asynchronous code
6. Use asyncio.gather() or asyncio.create_task() for concurrent execution of multiple async operations
7. Call asyncio.run() at the entry point to execute async main functions from synchronous code
16 changes: 16 additions & 0 deletions .cursor/rules/adr-003.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
globs: ["**/*.py"]
alwaysApply: false
---

# Click Framework for CLI Application Architecture

## Policies

1. Use Click framework (click>=8.0.0) for all command-line interface implementation in Python applications
2. Structure CLI with @click.group() decorator at the top level and @click.command() for subcommands
3. Define command-line options using @click.option() with type hints, help text, and default values
4. Use @click.argument() for required positional arguments with click.Choice() for enumerated values
5. Include colorama>=0.4.6 for cross-platform colored terminal output in all CLI applications
6. Implement --verbose/-v flag for debug output and --force/-f flag to skip confirmation prompts
7. Provide clear help text for all commands and options using the help parameter
16 changes: 16 additions & 0 deletions .cursor/rules/adr-004.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
globs: ["**/*.py"]
alwaysApply: false
---

# Anthropic Claude AI Integration for Code Analysis

## Policies

1. Use Anthropic Claude API (via BAML client) for all AI-powered code analysis in Python files
2. Default to 'claude-sonnet-4-20250514' model for analysis tasks unless specific model requirements dictate otherwise
3. Store Anthropic API keys in environment variables (ANTHROPIC_API_KEY) and never hardcode credentials in Python source files
4. Validate BAML client initialization before performing any AI operations using check_baml_client() validation
5. Import AI functionality from baml_client.async_client module for all async AI operations
6. Track token usage for all Claude API calls to monitor costs and usage patterns
7. Set BAML_LOG environment variable to 'OFF' to disable verbose logging in production
10 changes: 10 additions & 0 deletions .cursor/rules/adr-005.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
globs: ["**"]
alwaysApply: false
---

# Use Python For All Development Purposes

## Policies

1. use python for everything, and use python 3+
7 changes: 7 additions & 0 deletions .gemini/GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Development standards and architectural decision records are stored individually below and are important to development.

@adr-001.md
@adr-002.md
@adr-003.md
@adr-004.md
@adr-005.md
11 changes: 11 additions & 0 deletions .gemini/adr-001.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Git Repository Integration for Provenance Tracking

## Policies

1. Use subprocess module with git commands for all Git repository operations in Python applications
2. Validate Git repository existence before performing any git operations using subprocess.run(['git', 'rev-parse', '--git-dir'])
3. Integrate gitignore patterns for file filtering using pathspec module with 'gitwildmatch' pattern type
4. Implement git blame analysis to track file provenance including author, date, and commit metadata
5. Detect repository main branch dynamically by checking for 'main', 'master', or current branch
6. Use Path.resolve() for absolute path resolution when working with Git repository paths
7. Extract git metadata (commit hash, author, email, date) for all analyzed files to support provenance tracking
11 changes: 11 additions & 0 deletions .gemini/adr-002.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Asynchronous Programming with Asyncio for Concurrent Operations

## Policies

1. Use async/await pattern for all I/O-bound operations including API calls and file processing in Python modules
2. Import asyncio module for event loop management and concurrency primitives
3. Define async functions with 'async def' for any operation that performs network requests or file I/O
4. Use 'await' keyword for all async function calls and use asyncio.sleep() instead of time.sleep() in async contexts
5. Implement async context managers for resource management in asynchronous code
6. Use asyncio.gather() or asyncio.create_task() for concurrent execution of multiple async operations
7. Call asyncio.run() at the entry point to execute async main functions from synchronous code
11 changes: 11 additions & 0 deletions .gemini/adr-003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Click Framework for CLI Application Architecture

## Policies

1. Use Click framework (click>=8.0.0) for all command-line interface implementation in Python applications
2. Structure CLI with @click.group() decorator at the top level and @click.command() for subcommands
3. Define command-line options using @click.option() with type hints, help text, and default values
4. Use @click.argument() for required positional arguments with click.Choice() for enumerated values
5. Include colorama>=0.4.6 for cross-platform colored terminal output in all CLI applications
6. Implement --verbose/-v flag for debug output and --force/-f flag to skip confirmation prompts
7. Provide clear help text for all commands and options using the help parameter
11 changes: 11 additions & 0 deletions .gemini/adr-004.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Anthropic Claude AI Integration for Code Analysis

## Policies

1. Use Anthropic Claude API (via BAML client) for all AI-powered code analysis in Python files
2. Default to 'claude-sonnet-4-20250514' model for analysis tasks unless specific model requirements dictate otherwise
3. Store Anthropic API keys in environment variables (ANTHROPIC_API_KEY) and never hardcode credentials in Python source files
4. Validate BAML client initialization before performing any AI operations using check_baml_client() validation
5. Import AI functionality from baml_client.async_client module for all async AI operations
6. Track token usage for all Claude API calls to monitor costs and usage patterns
7. Set BAML_LOG environment variable to 'OFF' to disable verbose logging in production
5 changes: 5 additions & 0 deletions .gemini/adr-005.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Use Python For All Development Purposes

## Policies

1. use python for everything, and use python 3+
61 changes: 61 additions & 0 deletions .kiro/steering/architectural-decisions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Architectural Decisions
type: steering
inclusion: always
---

# Repository-Wide ADRs (All Files)

## ADR: Use Python For All Development Purposes

1. use python for everything, and use python 3+

---

# Python File ADRs (*.py)

## ADR: Git Repository Integration for Provenance Tracking

1. Use subprocess module with git commands for all Git repository operations in Python applications
2. Validate Git repository existence before performing any git operations using subprocess.run(['git', 'rev-parse', '--git-dir'])
3. Integrate gitignore patterns for file filtering using pathspec module with 'gitwildmatch' pattern type
4. Implement git blame analysis to track file provenance including author, date, and commit metadata
5. Detect repository main branch dynamically by checking for 'main', 'master', or current branch
6. Use Path.resolve() for absolute path resolution when working with Git repository paths
7. Extract git metadata (commit hash, author, email, date) for all analyzed files to support provenance tracking

---

## ADR: Asynchronous Programming with Asyncio for Concurrent Operations

1. Use async/await pattern for all I/O-bound operations including API calls and file processing in Python modules
2. Import asyncio module for event loop management and concurrency primitives
3. Define async functions with 'async def' for any operation that performs network requests or file I/O
4. Use 'await' keyword for all async function calls and use asyncio.sleep() instead of time.sleep() in async contexts
5. Implement async context managers for resource management in asynchronous code
6. Use asyncio.gather() or asyncio.create_task() for concurrent execution of multiple async operations
7. Call asyncio.run() at the entry point to execute async main functions from synchronous code

---

## ADR: Click Framework for CLI Application Architecture

1. Use Click framework (click>=8.0.0) for all command-line interface implementation in Python applications
2. Structure CLI with @click.group() decorator at the top level and @click.command() for subcommands
3. Define command-line options using @click.option() with type hints, help text, and default values
4. Use @click.argument() for required positional arguments with click.Choice() for enumerated values
5. Include colorama>=0.4.6 for cross-platform colored terminal output in all CLI applications
6. Implement --verbose/-v flag for debug output and --force/-f flag to skip confirmation prompts
7. Provide clear help text for all commands and options using the help parameter

---

## ADR: Anthropic Claude AI Integration for Code Analysis

1. Use Anthropic Claude API (via BAML client) for all AI-powered code analysis in Python files
2. Default to 'claude-sonnet-4-20250514' model for analysis tasks unless specific model requirements dictate otherwise
3. Store Anthropic API keys in environment variables (ANTHROPIC_API_KEY) and never hardcode credentials in Python source files
4. Validate BAML client initialization before performing any AI operations using check_baml_client() validation
5. Import AI functionality from baml_client.async_client module for all async AI operations
6. Track token usage for all Claude API calls to monitor costs and usage patterns
7. Set BAML_LOG environment variable to 'OFF' to disable verbose logging in production
70 changes: 70 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Development Guidelines

This document provides comprehensive development guidelines and policies for the rulectl repository.

## Project Structure & Module Organization

The repository follows Python best practices for project organization.

## Build, Test, and Development Commands

Standard Python development commands apply for building, testing, and running the application.

## Coding Style & Naming Conventions

### Python Programming

1. use python for everything, and use python 3+

### Git Repository Integration

1. Use subprocess module with git commands for all Git repository operations in Python applications
2. Validate Git repository existence before performing any git operations using subprocess.run(['git', 'rev-parse', '--git-dir'])
3. Integrate gitignore patterns for file filtering using pathspec module with 'gitwildmatch' pattern type
4. Implement git blame analysis to track file provenance including author, date, and commit metadata
5. Detect repository main branch dynamically by checking for 'main', 'master', or current branch
6. Use Path.resolve() for absolute path resolution when working with Git repository paths
7. Extract git metadata (commit hash, author, email, date) for all analyzed files to support provenance tracking

### Asynchronous Programming

1. Use async/await pattern for all I/O-bound operations including API calls and file processing in Python modules
2. Import asyncio module for event loop management and concurrency primitives
3. Define async functions with 'async def' for any operation that performs network requests or file I/O
4. Use 'await' keyword for all async function calls and use asyncio.sleep() instead of time.sleep() in async contexts
5. Implement async context managers for resource management in asynchronous code
6. Use asyncio.gather() or asyncio.create_task() for concurrent execution of multiple async operations
7. Call asyncio.run() at the entry point to execute async main functions from synchronous code

### CLI Architecture

1. Use Click framework (click>=8.0.0) for all command-line interface implementation in Python applications
2. Structure CLI with @click.group() decorator at the top level and @click.command() for subcommands
3. Define command-line options using @click.option() with type hints, help text, and default values
4. Use @click.argument() for required positional arguments with click.Choice() for enumerated values
5. Include colorama>=0.4.6 for cross-platform colored terminal output in all CLI applications
6. Implement --verbose/-v flag for debug output and --force/-f flag to skip confirmation prompts
7. Provide clear help text for all commands and options using the help parameter

### AI Integration

1. Use Anthropic Claude API (via BAML client) for all AI-powered code analysis in Python files
2. Default to 'claude-sonnet-4-20250514' model for analysis tasks unless specific model requirements dictate otherwise
3. Store Anthropic API keys in environment variables (ANTHROPIC_API_KEY) and never hardcode credentials in Python source files
4. Validate BAML client initialization before performing any AI operations using check_baml_client() validation
5. Import AI functionality from baml_client.async_client module for all async AI operations
6. Track token usage for all Claude API calls to monitor costs and usage patterns
7. Set BAML_LOG environment variable to 'OFF' to disable verbose logging in production

## Testing Guidelines

Follow Python testing best practices for unit and integration testing.

## Commit & Pull Request Guidelines

Follow standard Git workflow practices for commits and pull requests.

## Security & Configuration Tips

1. Store API keys and sensitive credentials in environment variables, never hardcode in source files
2. Validate all external inputs and Git repository operations before execution
Loading
Loading