# ECC for pi — 适配指南

This guide explains how ECC (Everything Claude Code) has been adapted for [pi](https://pi.dev), a minimal terminal coding harness.

## Architecture

ECC components are mapped to pi's extensibility system:

| ECC Component | Pi Equivalent | Installation Method |
|---------------|--------------|-------------------|
| 249 Skills (SKILL.md) | Pi Skills | `settings.json` skills path reference |
| 56 Agents | Pi Skills (converted) | `~/.agents/skills/ecc-*/SKILL.md` |
| 84 Commands | Pi Prompt Templates | `~/.pi/agent/prompts/ecc-*.md` |
| 8 Rule categories | Context rules | `~/.pi/agent/AGENTS.md` |
| Hooks | Pi Extensions | Not adapted (requires TypeScript port) |
| MCP Servers | N/A | pi does not use MCP |

## Installed Components

### Skills (249)
All ECC skills from `skills/` are auto-discovered by pi via global settings.
Reference: `/root/github_projects/ECC/skills`
Access: Type `/skill:name` or let pi auto-load them.

### Agent-Skills (55)
ECC agents converted to SKILL.md format in `~/.agents/skills/`:
- `ecc-planner` — Feature implementation planning
- `ecc-architect` — System architecture design
- `ecc-code-reviewer` — Code quality review
- `ecc-security-reviewer` — Vulnerability analysis
- `ecc-tdd-guide` — Test-driven development
- `ecc-build-error-resolver` — Build error resolution
- `ecc-e2e-runner` — E2E testing (Playwright)
- `ecc-refactor-cleaner` — Dead code cleanup
- `ecc-doc-updater` — Documentation sync
- `ecc-docs-lookup` — API documentation lookup
- `ecc-code-simplifier` — Code simplification
- `ecc-code-explorer` — Codebase exploration
- `ecc-code-architect` — Code architecture restructuring
- Language reviewers: go, python, java, kotlin, rust, typescript, cpp, dart/flutter, fastapi
- Build resolvers: go, java, kotlin, rust, cpp, dart
- Domain specialists: database, mle, harmonyos

### Prompt Templates (5)
ECC commands adapted as pi `/command` templates:
- `/ecc-plan` — Implementation planning
- `/ecc-code-review` — Code quality review
- `/ecc-tdd` — TDD workflow (Red-Green-Improve)
- `/ecc-build-fix` — Build error resolution
- `/ecc-security-scan` — Security checklist

### Context Rules
ECC coding rules integrated into `~/.pi/agent/AGENTS.md`:
- Coding Style (immutability, KISS, DRY, YAGNI, naming)
- Testing Requirements (80% coverage, AAA pattern)
- Git Workflow (commit format, branch naming)
- Security Guidelines (mandatory pre-commit checks)
- Code Review Checklist (CRITICAL/HIGH/MEDIUM/LOW)

## Usage

```bash
# Skills auto-load when relevant
pi "Design a REST API for user management"

# Explicit skill invocation
/skill:ecc-planner "Add authentication feature"
/skill:ecc-code-reviewer
/skill:ecc-security-reviewer

# Prompt templates
/ecc-tdd "Create user service"
/ecc-code-review src/auth.ts
/ecc-build-fix "npm run build"

# Native ECC skills
/skill:backend-patterns
/skill:frontend-patterns
/skill:security-review
```

## Notes

- **Hooks** are not adapted. ECC's bash-based hooks would need to be ported to pi extensions (TypeScript). See `hooks/` and `scripts/hooks/` in the ECC repo.
- **MCP Servers** are not applicable. pi does not use the Model Context Protocol.
- **Test Suite**: ECC's test suite (`tests/run-all.js`) is not affected by the pi adaptation.
