{
  "markdown": "# CHP - Code Highway Patrol\n\nA static analysis framework for enforcing rules, standards, and best practices across your codebase.\n\n## Overview\n\nCHP provides a flexible, rule-based system for analyzing code and enforcing organizational standards. Think of it as a programmable linting and analysis framework that can be extended to enforce any rule or \"law\" your team needs.\n\n## Features\n\n- **Rule Engine** - Define custom rules for code quality, security, and style\n- **Multi-Language Support** - Analyze code across different programming languages\n- **Agent-Based Analysis** - Deploy specialized agents for different analysis tasks\n- **Extensible Skills** - Add new analysis capabilities through a modular skill system\n- **Integration Ready** - Works with CI/CD pipelines and existing development workflows\n\n## Project Structure\n\n```\nchp/\n├── agents/           # Analysis agents (rule enforcers)\n├── skills/           # Reusable analysis skills and detectors\n├── scripts/          # Setup and utility scripts\n├── docs/             # Rule documentation and guides\n├── assets/           # Configuration files and rule definitions\n├── tests/            # Test cases and rule validation\n├── .claude-plugin/   # Claude Code integration\n├── .codex-plugin/    # Codex integration\n├── .cursor-plugin/   # Cursor integration\n├── .windsurf-plugin/ # Windsurf IDE integration\n└── .opencode/        # OpenCode integration\n```\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/chp.git\ncd chp\n\n# Install dependencies\nnpm install\n```\n\n## Usage\n\n### Run a Full Analysis\n\n```bash\nnpm run analyze\n```\n\n### Run Specific Rules\n\n```bash\nnpm run analyze -- --rule security --rule style\n```\n\n### Create a Custom Rule\n\n```typescript\n// Define your rule in the rules directory\nexport const myRule = {\n  name: 'my-custom-rule',\n  check: (node, context) => {\n    // Your analysis logic here\n    return { pass: true, message: '' };\n  }\n};\n```\n\n## Configuration\n\nRules are configured in your project's `.chprc` or `chp.config.js`:\n\n```javascript\nmodule.exports = {\n  rules: {\n    'no-console': 'error',\n    'max-line-length': ['warn', 120],\n    'enforce-async-await': 'error'\n  },\n  ignore: ['node_modules/**', 'dist/**']\n};\n```\n\n## Development\n\n```bash\n# Run tests\nnpm test\n\n# Watch mode during development\nnpm run dev\n\n# Lint the codebase\nnpm run lint\n```\n\n## Contributing\n\nContributions are welcome!\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new rules\n5. Submit a pull request\n\n## Documentation\n\n- [CLAUDE.md](CLAUDE.md) - Claude-specific setup\n- [AGENTS.md](AGENTS.md) - Agent development guide\n- [docs/](docs/) - Detailed documentation\n\n## Law Enforcement System\n\nCHP includes a two-layer law enforcement system:\n\n### Quick Start\n\n```bash\n# Create a new law\n./commands/chp-law create my-law --hooks=pre-commit\n\n# List all laws\n./commands/chp-law list\n\n# Check system status\n./commands/chp-status\n```\n\n### How It Works\n\n1. **Suggestive Layer** - Context files in `docs/chp/` guide agents to follow rules\n2. **Verification Layer** - Scripts in `docs/chp/laws/` check for violations\n3. **Auto-Tightening** - Failed verifications strengthen guidance automatically\n\n### Creating Laws\n\nSee the [chp:write-laws](skills/write-laws/skill.md) skill for detailed guidance.\n\n```bash\n# Create a law\n./commands/chp-law create no-secrets --hooks=pre-commit,pre-push\n\n# Edit the verification script\nvim docs/chp/laws/no-secrets/verify.sh\n\n# Edit the guidance\nvim docs/chp/no-secrets.md\n\n# Test it\n./commands/chp-law test no-secrets\n```\n\n### Example Laws\n\n- **no-console-log** - Prevents console.log commits (included)\n- **no-api-keys** - Detects API key patterns (create with chp-law)\n\n## Universal Hook System\n\nCHP now supports 25+ hook types across Git, AI/Agent, and CI/CD operations:\n\n### Quick Start\n\n```bash\n# Detect available hooks\n./commands/chp-hooks detect\n\n# Create a law for multiple hook types\n./commands/chp-law create no-secrets --hooks=pre-commit,pre-push,pre-tool\n\n# Manage hooks\n./commands/chp-hooks list\n./commands/chp-hooks enable pre-commit\n./commands/chp-hooks install pre-commit\n```\n\n### Hook Types\n\n- **Git Hooks (15):** pre-commit, post-commit, pre-push, post-merge, commit-msg, prepare-commit-msg, pre-rebase, post-checkout, post-rewrite, applypatch-msg, pre-applypatch, post-applypatch, update, pre-auto-gc, post-update\n- **AI/Agent Hooks (6):** pre-prompt, post-prompt, pre-tool, post-tool, pre-response, post-response\n- **CI/CD Hooks (4):** pre-build, post-build, pre-deploy, post-deploy\n\n### Documentation\n\nSee [docs/chp/HOOKS.md](docs/chp/HOOKS.md) for complete hook system documentation.\n\n## License\n\nMIT - See [LICENSE](LICENSE) for details.\n# Test change\n",
  "bytes": 4738,
  "sha": "216ec4467f5a608681804423b406c37fe41b0d15f259230e3300937729495cba",
  "repo_slug": "code-highway-patrol/chp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_code_highway_patrol_chp_4281e292/readme"
}