Context
sync-community-health.yml currently syncs only 2 Claude Code files to org repos:
.claude/hooks/lint-on-edit.sh
.claude/agents/plan-issues.md
This leaves the PR-gate hooks and the corresponding fix agents unsynced. Org repos can run gh pr create without any lint or policy check firing, defeating the entire gate system.
What's missing from the sync:
| Source (meta-repo) |
Destination (target repos) |
Purpose |
.claude/hooks/lint-gate.sh |
.claude/hooks/lint-gate.sh |
Blocks gh pr create if lint fails |
.claude/hooks/policy-gate.sh |
.claude/hooks/policy-gate.sh |
Blocks gh pr create if policy patterns detected |
.claude/agents/lint-review.md |
.claude/agents/lint-review.md |
Auto-fix agent for lint failures |
.claude/agents/policy-compliance.md |
.claude/agents/policy-compliance.md |
Auto-fix agent for policy violations |
community-health/CODE_OF_CONDUCT.md |
CODE_OF_CONDUCT.md |
(after issue #79) |
community-health/CONTRIBUTING.md |
CONTRIBUTING.md |
(after issue #80) |
community-health/SUPPORT.md |
SUPPORT.md |
(after issue #81) |
Also missing: PreToolUse hook sync
The settings.json merge in sync-community-health.yml currently only merges the PostToolUse block (the lint-on-edit hook). It does not merge PreToolUse (the lint-gate and policy-gate hooks). The merge logic must be extended to include PreToolUse.
Implementation
1. Add to FILE_MAP in sync-community-health.yml
- src: .claude/hooks/lint-gate.sh
dst: .claude/hooks/lint-gate.sh
mode: "0755"
- src: .claude/hooks/policy-gate.sh
dst: .claude/hooks/policy-gate.sh
mode: "0755"
- src: .claude/agents/lint-review.md
dst: .claude/agents/lint-review.md
- src: .claude/agents/policy-compliance.md
dst: .claude/agents/policy-compliance.md
- src: community-health/CODE_OF_CONDUCT.md
dst: CODE_OF_CONDUCT.md
- src: community-health/CONTRIBUTING.md
dst: CONTRIBUTING.md
- src: community-health/SUPPORT.md
dst: SUPPORT.md
2. Extend settings.json merge to include PreToolUse
The current merge logic reads the target repo's settings.json, merges in PostToolUse hooks from the meta-repo template, and writes back. Extend this to also merge the PreToolUse block:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/lint-gate.sh"
}
]
}
],
"PostToolUse": [ ... existing lint-on-edit logic ... ]
}
}
3. Update PR body string
Update the PR body generated by the sync workflow to list all newly synced files.
Acceptance Criteria
Dependencies
None for the hook/agent sync — can be done immediately.
Community health FILE_MAP entries require #79, #80, #81 to be merged first.
Issue #84 (make repo private) is blocked until this issue is complete.
Part of Epic
#77
Context
sync-community-health.ymlcurrently syncs only 2 Claude Code files to org repos:.claude/hooks/lint-on-edit.sh.claude/agents/plan-issues.mdThis leaves the PR-gate hooks and the corresponding fix agents unsynced. Org repos can run
gh pr createwithout any lint or policy check firing, defeating the entire gate system.What's missing from the sync:
.claude/hooks/lint-gate.sh.claude/hooks/lint-gate.shgh pr createif lint fails.claude/hooks/policy-gate.sh.claude/hooks/policy-gate.shgh pr createif policy patterns detected.claude/agents/lint-review.md.claude/agents/lint-review.md.claude/agents/policy-compliance.md.claude/agents/policy-compliance.mdcommunity-health/CODE_OF_CONDUCT.mdCODE_OF_CONDUCT.mdcommunity-health/CONTRIBUTING.mdCONTRIBUTING.mdcommunity-health/SUPPORT.mdSUPPORT.mdAlso missing: PreToolUse hook sync
The
settings.jsonmerge insync-community-health.ymlcurrently only merges thePostToolUseblock (thelint-on-edithook). It does not mergePreToolUse(thelint-gateandpolicy-gatehooks). The merge logic must be extended to includePreToolUse.Implementation
1. Add to FILE_MAP in
sync-community-health.yml2. Extend settings.json merge to include PreToolUse
The current merge logic reads the target repo's
settings.json, merges inPostToolUsehooks from the meta-repo template, and writes back. Extend this to also merge thePreToolUseblock:{ "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": ".claude/hooks/lint-gate.sh" } ] } ], "PostToolUse": [ ... existing lint-on-edit logic ... ] } }3. Update PR body string
Update the PR body generated by the sync workflow to list all newly synced files.
Acceptance Criteria
sync-community-health.ymlincludes all 4 Claude Code files listed above.sh) are synced with0755permissions (executable)settings.jsonmerge logic extended to includePreToolUseblock withlint-gate.shhookworkflow_dispatchruns successfully (dry run or withforce: true)gh pr createin a target repo (e.g.gaming_app) triggers bothlint-gate.shandpolicy-gate.shDependencies
None for the hook/agent sync — can be done immediately.
Community health FILE_MAP entries require #79, #80, #81 to be merged first.
Issue #84 (make repo private) is blocked until this issue is complete.
Part of Epic
#77