{"id":50055960,"url":"https://github.com/code-yeongyu/pi-comment-checker","last_synced_at":"2026-05-21T13:13:58.862Z","repository":{"id":358036476,"uuid":"1239316913","full_name":"code-yeongyu/pi-comment-checker","owner":"code-yeongyu","description":"Comment checker hook extension for pi/senpi with write/edit/multiedit/apply_patch support and TUI warnings.","archived":false,"fork":false,"pushed_at":"2026-05-15T10:00:43.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-15T12:05:25.170Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-yeongyu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-15T01:22:59.000Z","updated_at":"2026-05-15T10:00:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/code-yeongyu/pi-comment-checker","commit_stats":null,"previous_names":["code-yeongyu/pi-comment-checker"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/code-yeongyu/pi-comment-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-yeongyu%2Fpi-comment-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-yeongyu%2Fpi-comment-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-yeongyu%2Fpi-comment-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-yeongyu%2Fpi-comment-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-yeongyu","download_url":"https://codeload.github.com/code-yeongyu/pi-comment-checker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-yeongyu%2Fpi-comment-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33301805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"ssl_error","status_checked_at":"2026-05-21T12:22:11.673Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-21T13:13:55.058Z","updated_at":"2026-05-21T13:13:58.852Z","avatar_url":"https://github.com/code-yeongyu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pi-comment-checker\n\n[![ci](https://github.com/code-yeongyu/pi-comment-checker/actions/workflows/ci.yml/badge.svg)](https://github.com/code-yeongyu/pi-comment-checker/actions/workflows/ci.yml) [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nComment checker hook for the [pi coding agent](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) and `senpi`. It runs [`@code-yeongyu/comment-checker`](https://github.com/code-yeongyu/go-claude-code-comment-checker) after mutation tools and appends the checker warning back into the tool result so the agent must react.\n\nThis package is the standalone pi extension version of the `oh-my-openagent` / `../omo` comment-checker hook.\n\n## Behavior\n\n| Case | Result |\n|------|--------|\n| `write` succeeds | checks the written `content` |\n| `edit` succeeds | checks `old_string` / `new_string` |\n| `multiedit` succeeds | checks the complete `edits` payload |\n| `apply_patch` succeeds with OMO metadata | checks each metadata file using `before` / `after`, skips deletes |\n| `apply_patch` succeeds without metadata | falls back to raw Codex patch parsing |\n| checker exits `2` | appends the warning message to the tool result and leaves the TUI hidden |\n| checker binary missing | leaves the TUI hidden and leaves tool output unchanged |\n| checker exits unexpectedly | leaves the TUI hidden and leaves tool output unchanged |\n\n## apply_patch support\n\n`apply_patch` is handled in two layers:\n\n1. OMO-compatible metadata/details:\n\n```json\n{\n  \"files\": [\n    {\n      \"filePath\": \"src/old.ts\",\n      \"movePath\": \"src/new.ts\",\n      \"before\": \"const before = 1;\\n\",\n      \"after\": \"// explain next value\\nconst after = 2;\\n\",\n      \"type\": \"update\"\n    }\n  ]\n}\n```\n\n2. Raw Codex patch fallback:\n\n```text\n*** Begin Patch\n*** Update File: src/example.ts\n@@\n-const before = 1;\n+// explain value\n+const after = 2;\n*** End Patch\n```\n\nDeletes are ignored because they cannot introduce new comments.\n\n## TUI\n\nThe extension uses an above-editor widget with key `pi-comment-checker`.\n\n| State | Widget |\n|---|---|\n| Loading | hidden |\n| Missing binary | hidden |\n| Warning | hidden |\n| Clean | widget hidden |\n\nIt does not set or modify the footer.\n\n## Installation\n\nThe package targets the `pi` / `senpi` extension package system.\n\n```bash\n# 1. From npm (once published)\npi install npm:pi-comment-checker\n\n# 2. From git\npi install git:github.com/code-yeongyu/pi-comment-checker\n\n# 3. senpi settings.json\n{\n  \"packages\": [\n    \"git:github.com/code-yeongyu/pi-comment-checker\"\n  ]\n}\n\n# 4. Dev / one-shot test\npi -e /path/to/pi-comment-checker/src/index.ts\nsenpi -e /path/to/pi-comment-checker/src/index.ts\n```\n\nAfter installation, restart pi/senpi or run `/reload` inside an interactive session.\n\n## Command\n\n### `/comment-checker`\n\nShows binary availability and setup guidance.\n\n## Development\n\n```bash\nnpm install\nnpm test\nnpm run typecheck\nnpm run check\nnpm pack --dry-run\npi -e ./src/index.ts\n```\n\n## Branch rules and releases\n\n- `main` is protected by `.github/branch-ruleset.json`.\n- CI runs Node 20 and 22 on Ubuntu and macOS.\n- Releases are GitHub Releases tagged as `v\u003csemver\u003e`.\n- Publishing runs from the `publish` workflow after a GitHub Release is published.\n\n## Origin\n\nPorted from `../omo/src/hooks/comment-checker` and adapted to the public pi-coding-agent extension API.\n\n## License\n\n[MIT](LICENSE).\n\n## Related\n\n- [senpi](https://github.com/code-yeongyu/senpi) — the fork/runtime these extensions are extracted for.\n- [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent) — original OpenCode plugin hook source.\n- [comment-checker](https://github.com/code-yeongyu/go-claude-code-comment-checker) — native checker binary.\n\n## Acknowledgements\n\n- **Mario Zechner** ([@badlogic](https://github.com/badlogic)) — author of [pi-mono](https://github.com/badlogic/pi-mono) and the pi-coding-agent extension API this package targets.\n- **Yeongyu Kim** ([@code-yeongyu](https://github.com/code-yeongyu)) — maintainer of senpi, oh-my-openagent, and comment-checker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-yeongyu%2Fpi-comment-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-yeongyu%2Fpi-comment-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-yeongyu%2Fpi-comment-checker/lists"}