adrai-org / adrai-org/adr-ai-tools-py

[FEATURE] Single ADR × Single File LLM Compliance Check

Đang mở
#25 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
4
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## ✨ Feature Request Template

### **Feature Description**
Implement a basic LLM-powered compliance check that validates whether a single code file adheres to a specific ADR (Architecture Decision Record).

### **Use Case**
As a developer, I want to verify that my code changes comply with specific architectural decisions documented in ADRs. This helps maintain consistency and prevents architectural drift by providing automated feedback on code compliance.

### **Proposed Solution**
Add a new `check` command with the following interface:
```bash
adr-ai-tools check --adr docs/adr/0015-service-layer-architecture.md --file src/services/adr_initializer.py
```

The command should:
1. Read and parse the specified ADR file
2. Read the specified code file
3. Send both to an LLM with a prompt asking for compliance analysis
4. Display the LLM's assessment (compliant/non-compliant with reasoning)

### **Alternatives Considered**
- Rule-based static analysis: Too rigid and requires manual rule definition for each ADR
- Full codebase analysis: Too complex for initial implementation
- Multiple file analysis: Adds complexity that can be addressed in future phases

### **Acceptance Criteria**
- [ ] CLI accepts `--adr` and `--file` parameters
- [ ] ADR file is successfully read and parsed
- [ ] Code file is successfully read
- [ ] LLM integration provides compliance assessment
- [ ] Results are displayed in a user-friendly format
- [ ] Error handling for missing files or LLM failures
- [ ] Unit tests cover the core functionality
- [ ] E2E tests verify CLI behavior

### **Additional Context**
This is Phase 1 of a larger compliance checking system. Future phases will expand scope and capabilities including directory-based checking, git integration for diff analysis, smart ADR selection, and automated rule generation with caching for improved performance.

The implementation should follow existing architectural patterns (service layer, dependency injection) established in the codebase.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.