Files
awoooi/.pre-commit-config.yaml
OG T 7478dc0254 feat(phase6-9): Complete modular architecture and Agent Teams
Phase 6.4 - Modular Architecture:
- Add lewooogo-brain adapters for LLM providers
- Add lewooogo-data dual memory (Redis + PostgreSQL)
- Implement consensus engine for multi-agent decisions
- Add incident memory service for historical context

Phase 9 - Agent Teams (Claude Agent SDK):
- Add base agent class with Claude Sonnet 4 integration
- Implement action planner, blast radius, and security agents
- Add agent API endpoints and proposal workflow
- Integrate ADR-009 OpenClaw Agent Teams architecture

DevOps & CI/CD:
- Add GitHub Actions CI/CD workflows (ci.yaml, cd.yaml)
- Add pre-commit hooks and secrets baseline
- Add docker-compose for local development
- Update Kubernetes network policies

Frontend Improvements:
- Add auto-healing error boundary component
- Update i18n messages for agent features
- Enhance dual-state incident card with execution feedback

Documentation:
- Add 7 ADRs covering MCP, design system, architecture decisions
- Update ARCHITECTURE_MEMORY.md with modular design
- Add GLOBAL_RULES.md and SOUL.md for project identity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 18:40:36 +08:00

106 lines
3.2 KiB
YAML

# AWOOOI Pre-commit Configuration
# =================================
# Phase 5: 全自動防禦網
#
# Install: pre-commit install
# Run: pre-commit run --all-files
#
# Exit Codes:
# 0 = All checks passed
# 1 = Check failed (commit blocked)
default_language_version:
python: python3.11
repos:
# ==========================================================================
# Python Linting (Ruff)
# ==========================================================================
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
hooks:
- id: ruff
name: 🐍 Ruff Lint (Python)
args: [--fix, --exit-non-zero-on-fix]
files: ^apps/api/
types: [python]
- id: ruff-format
name: 🐍 Ruff Format (Python)
files: ^apps/api/
types: [python]
# ==========================================================================
# TypeScript Linting (ESLint)
# ==========================================================================
- repo: local
hooks:
- id: eslint
name: 🟦 ESLint (TypeScript)
entry: pnpm --filter @awoooi/web exec eslint --fix
language: system
files: ^apps/web/.*\.(ts|tsx)$
pass_filenames: false
- id: tsc-typecheck
name: 🔷 TypeScript Type Check
entry: pnpm --filter @awoooi/web exec tsc --noEmit
language: system
files: ^apps/web/.*\.(ts|tsx)$
pass_filenames: false
# ==========================================================================
# General Checks
# ==========================================================================
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
name: 🧹 Trailing Whitespace
exclude: ^(.*\.md|.*\.diff)$
- id: end-of-file-fixer
name: 📄 End of File Fixer
exclude: ^(.*\.md)$
- id: check-yaml
name: 📋 YAML Syntax Check
- id: check-json
name: 📋 JSON Syntax Check
- id: check-added-large-files
name: 📦 Large File Check
args: ['--maxkb=1000']
- id: detect-private-key
name: 🔐 Private Key Detection
# ==========================================================================
# Secrets Detection
# ==========================================================================
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
name: 🔒 Secrets Detection
args: ['--baseline', '.secrets.baseline']
exclude: (pnpm-lock.yaml|package-lock.json)
# ==========================================================================
# AI Code Review (Ollama)
# ==========================================================================
- repo: local
hooks:
- id: ai-code-reviewer
name: 🤖 AI Code Reviewer (Ollama)
entry: python scripts/ai_code_reviewer.py
language: python
pass_filenames: false
additional_dependencies: [httpx]
stages: [commit]
# 僅在有 Python 或 TypeScript 變更時執行
files: \.(py|ts|tsx)$
# fail-open: AI 審查失敗不阻止 commit
verbose: true