feat: add repo hygiene proactive agent

Merged
KH
5mo ago
+513-0

Summary

  • add a repo-hygiene proactive agent for PR-opened and PR-synchronized events
  • diagnose duplicated/dead code, divergent paths, stale skills/rules/docs, and code smells in read-only mode
  • post GitHub comments, write Notion journal pages, optionally post Slack summaries, and save memory for future runs

Validation

  • npm run typecheck
  • npx agentworkforce persona compile ./repo-hygiene/persona.ts

Notes

  • First slice is intentionally read-only; fix mode should be added later behind explicit labels such as agent-hygiene:fix.

Summary by cubic

Adds a repo-hygiene proactive agent that reviews opened/updated PRs in read-only mode to flag duplicated/dead code, divergent paths, stale docs/skills, and code smells. It posts a concise PR comment, journals the run to Notion with hardened error handling (non-blocking), optionally sends a Slack summary, and saves memory for trend tracking.

  • New Features

    • Triggers on GitHub pull_request.opened and pull_request.synchronize.
    • Runs a bounded-diff diagnosis (MAX_DIFF_CHARS).
    • Outputs: PR comment (summary, findings, follow-ups, confidence), Notion journal, optional Slack summary, and workspace memory.
    • Adds persona (persona.ts/persona.json) and handler (agent.ts) with a read-only sandbox.
  • Migration

    • Set NOTION_DATABASE_ID (required); optionally SLACK_CHANNEL; tune MAX_DIFF_CHARS.
    • Deploy the persona (launch link in repo-hygiene/README.md).
    • Read-only by design; fix mode will be gated behind labels later.