fix: hooks command type conversion + org-level labels #114

Merged
lmiranda merged 10 commits from fix/hooks-and-labels-v3.2.0 into development 2026-01-23 17:24:08 +00:00
Owner

Summary

  • Convert ALL hooks from prompt type to command type (prompt hooks unreliable - model ignores instructions)
  • Add organization-level label creation (create_org_label, create_label_smart)
  • All hook output now guaranteed to have [plugin-name] prefix

Hooks Fixed

Plugin Hook Script Prefix
doc-guardian PostToolUse notify.sh [doc-guardian]
code-sentinel PreToolUse security-check.sh [code-sentinel]
projman SessionStart startup-check.sh [projman]
pr-review SessionStart startup-check.sh [pr-review]
project-hygiene PostToolUse cleanup.sh [project-hygiene]

Labels Fixed

  • Added create_org_label(org, name, color) for organization-level labels
  • Added create_label_smart(name, color, repo) that auto-detects correct level
  • Organization: Type/, Priority/, Complexity/, Effort/, Risk/, Source/, Agent/*
  • Repository: Component/, Tech/

Issues Addressed

  • Fixes #110 (doc-guardian blocking)
  • Fixes #113 (hooks lack plugin prefix)
  • Fixes labels not being created at organization level

Test Plan

  • Restart Claude Code after merge
  • Verify hooks output with proper prefix
  • Test /labels-sync creates labels at correct level
## Summary - Convert ALL hooks from prompt type to command type (prompt hooks unreliable - model ignores instructions) - Add organization-level label creation (`create_org_label`, `create_label_smart`) - All hook output now guaranteed to have `[plugin-name]` prefix ## Hooks Fixed | Plugin | Hook | Script | Prefix | |--------|------|--------|--------| | doc-guardian | PostToolUse | notify.sh | `[doc-guardian]` | | code-sentinel | PreToolUse | security-check.sh | `[code-sentinel]` | | projman | SessionStart | startup-check.sh | `[projman]` | | pr-review | SessionStart | startup-check.sh | `[pr-review]` | | project-hygiene | PostToolUse | cleanup.sh | `[project-hygiene]` | ## Labels Fixed - Added `create_org_label(org, name, color)` for organization-level labels - Added `create_label_smart(name, color, repo)` that auto-detects correct level - Organization: Type/*, Priority/*, Complexity/*, Effort/*, Risk/*, Source/*, Agent/* - Repository: Component/*, Tech/* ## Issues Addressed - Fixes #110 (doc-guardian blocking) - Fixes #113 (hooks lack plugin prefix) - Fixes labels not being created at organization level ## Test Plan - [ ] Restart Claude Code after merge - [ ] Verify hooks output with proper prefix - [ ] Test `/labels-sync` creates labels at correct level
lmiranda added 10 commits 2026-01-23 17:23:37 +00:00
Reviewed-on: #104
Reviewed-on: #106
Reviewed-on: #108
Reviewed-on: #112
- CLAUDE.md: Update version 3.0.1 → 3.1.2, projman 3.0.0 → 3.1.0, command count 12 → 13
- README.md: Add debug-report/debug-review to projman commands, add DEBUGGING-CHECKLIST.md to docs table
- CANONICAL-PATHS.md: Update version, remove non-existent docs/workflows/, add COMMANDS-CHEATSHEET.md
- projman/README.md: Fix "Three-Agent" → "Four-Agent", update architecture to show symlink
- pr-review/README.md: Add missing setup commands (initial-setup, project-init, project-sync)
- cmdb-assistant/README.md: Add initial-setup.md to architecture
- project-hygiene/README.md: Fix invalid hook event name (task-completed → PostToolUse)
- doc-guardian/plugin.json: Add missing commands field
- code-sentinel/plugin.json: Add missing commands field

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Prompt hooks are unreliable - Claude ignores instructions and generates
verbose analysis despite explicit FORBIDDEN rules. Command hooks guarantee
the exact output we want.

- Add notify.sh script that only outputs for config file changes
- Change hooks.json from prompt type to command type
- Script exits silently for non-config files (no blocking)

Fixes #110

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Prompt hook approach didn't work - Claude ignores instructions.
Real fix was switching to command hook type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add create_org_label() method to gitea_client.py for org-level labels
- Add create_label_smart() to labels.py that auto-detects correct level
- Register both tools in server.py
- Update labels-sync.md to use create_label_smart

Label level detection:
- Organization: Type/*, Priority/*, Complexity/*, Effort/*, Risk/*, Source/*, Agent/*
- Repository: Component/*, Tech/*

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Same fix as doc-guardian - prompt hooks unreliable.
Command hook guarantees exact behavior.

- Add security-check.sh that skips config/doc files silently
- Only checks code files for hardcoded secrets
- Outputs with [code-sentinel] prefix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ALL hooks now use command type (bash scripts) instead of prompt type.
Prompt hooks are unreliable - model ignores instructions.

Changes:
- projman: SessionStart → startup-check.sh with [projman] prefix
- pr-review: SessionStart → startup-check.sh with [pr-review] prefix
- project-hygiene: cleanup.sh now has [project-hygiene] prefix
- doc-guardian: already fixed (notify.sh with [doc-guardian] prefix)
- code-sentinel: already fixed (security-check.sh with [code-sentinel] prefix)

All hook output now guaranteed to have plugin name prefix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lmiranda merged commit 8a75203251 into development 2026-01-23 17:24:08 +00:00
lmiranda deleted branch fix/hooks-and-labels-v3.2.0 2026-01-23 17:24:08 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#114