Skip to content

feat(core): team-repo-maintenance rule — governance for shared-repo changes#1

Merged
mkurak merged 4 commits intomainfrom
feat/team-repo-maintenance-rule
Apr 24, 2026
Merged

feat(core): team-repo-maintenance rule — governance for shared-repo changes#1
mkurak merged 4 commits intomainfrom
feat/team-repo-maintenance-rule

Conversation

@mkurak
Copy link
Copy Markdown
Collaborator

@mkurak mkurak commented Apr 24, 2026

Summary

  • New global rule: core/rules/team-repo-maintenance.md.
  • Codifies four mandatory steps when Claude edits a shared public repo:
    1. Bump team.json (or internal/config.Version for CLI) following semver
    2. Conventional commit format (type(scope): summary)
    3. "Discovered via" context in the commit body — audit trail for which project/session revealed the fix
    4. PR flow (default, enforced by branch protection added 2026-04-24)
  • team.json updated to register the new rule + description.
  • README.md rules table updated.

Discovered via

While pushing the fix(dst-new-ds): Q3 single-select fix to design-system-team, I realized the /save-learnings flow had no built-in discipline for semver bumping — the team repo change was prepared without a version bump, just flagged for user confirmation. Mesut caught this as a governance gap and asked for a principled workflow.

This rule is the workflow. Branch protection (also added today) refuses direct push; this rule tells Claude how to produce a PR-ready change with the right shape.

Version bump

team.json: 1.3.0 → 1.3.1 (patch — new rule, no breaking change to existing rules).

Test plan

  • On next Claude Code session, a team repo edit via /save-learnings should produce: version bump + conventional message + "Discovered via" context + PR (not direct push)
  • Verify ~/.claude/rules/ symlinks auto-create team-repo-maintenance.md after next atl update (install.sh glob pattern already covers new .md files in core/rules/)
  • Branch-protection refusal: attempting direct git push to main on any protected repo should fail with "Protected branch update failed" (no soft bypass)

🤖 Generated with Claude Code

… repo changes

Adds core/rules/team-repo-maintenance.md (new global rule). Codifies the
discipline that must accompany every change Claude makes to a shared
public repo in the agentteamland/ org.

Four mandatory steps:

1. Bump team.json (or CLI internal/config.Version) following semver
2. Conventional commit format (type(scope): summary + body)
3. "Discovered via" context in the commit body — audit trail for which
   project/session revealed the fix
4. PR flow (default; enforced by branch protection added on 2026-04-24)

The rule is the METHOD; branch protection is the SAFETY NET. Branch
protection refuses direct pushes; this rule tells Claude how to produce
a PR-ready change with the right shape.

Discovered via dst-new-ds Q3 fix (design-system-team@0.4.1→0.4.2), where
version bump was initially forgotten — surfaced the governance gap.

Bumps team.json 1.3.0 → 1.3.1 (patch: new rule, no breaking change).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ndatory assignee

Two reinforcements to the team-repo-maintenance rule based on feedback:

1. **PR merge discipline — absolute, no exceptions.** Claude never merges
   PRs, regardless of triviality, approval count, urgency, or prior user
   authorization. The previous "self-merge instantly for trivial changes"
   language was a loophole and has been removed. Explicit list of
   prohibited actions (gh pr merge, --approve, MCP browser clicks, API
   calls) so there is no interpretive wiggle room.

2. **Mandatory --assignee @me at PR creation.** Every PR Claude opens must
   have the authenticated maintainer as assignee so it surfaces on their
   dashboard for review. Both the code example in step 4 and a dedicated
   paragraph make this explicit; fallback (gh pr edit --add-assignee) is
   documented for retroactive fixing if forgotten.

Admin bypass for DIRECT PUSH remains available for genuine emergencies
(unchanged), because that's a different operation (commit on main) and
a different escape valve (user's, not Claude's). The no-auto-merge rule
specifically closes the path where Claude would merge its own PRs,
which defeats the whole review-gate purpose.

No version bump (same rule, two reinforcements within the unmerged PR).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mkurak mkurak self-assigned this Apr 24, 2026
The earlier revision added "always --assignee @me" as an absolute rule,
but that has two problems in the solo-maintainer setup where Claude
pushes under the maintainer's own GitHub account:

1. Author field ALREADY equals the maintainer. An explicit assignee is
   redundant and pollutes the "Assigned to me" dashboard queue with
   PRs the maintainer authored.
2. GitHub blocks `--add-reviewer <self>` at the API level, so the
   companion symmetric rule ("reviewer = mkurak") is unachievable
   without a separate bot account.

Revised position: Claude does NOT add --assignee or --reviewer on its
own PRs. The maintainer reaches these PRs through the normal "Created
by me" / author filters on GitHub. A note reserves --reviewer mkurak
for a future setup where Claude pushes under a distinct bot account.

The absolute no-merge rule (section above) stays unchanged — that one
didn't depend on GitHub identity at all.

Discovered via Mesut flagging the redundancy after all 6 in-flight PRs
landed with `assignees: mkurak` next to author `mkurak` — purely
noisy, no functional benefit.

No version bump (still within the unmerged core@1.3.1 PR).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mkurak mkurak removed their assignment Apr 24, 2026
The earlier description amendment in this PR pushed the string to 216
characters, exceeding the team.schema.json maxLength of 200. CI's
schema-validate job caught it:

    team.json invalid
    {
      instancePath: '/description',
      schemaPath: '#/properties/description/maxLength',
      keyword: 'maxLength',
      params: { limit: 200 },
      message: 'must NOT have more than 200 characters'
    }

Rewrote the description as a compact comma-separated list of subsystems
(memory, journal, wiki, version-check, learning-capture, docs-sync,
team-repo-maintenance, karpathy-guidelines, schemas). Dropped the prose
elaborations "inline markers + hook-driven capture" and "governance"
which were explanatory-verbose. The shorter form mirrors the rules/
skills names exactly, making it easier for a reader to cross-reference.

New length: 164 chars. All other skill/rule descriptions already under
200, so no additional edits needed.

Discovered via CI failure on PR#1 schema-validate job (core#1).

No version bump (still within the unmerged core@1.3.1 PR).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mkurak mkurak merged commit 14a7602 into main Apr 24, 2026
1 check passed
@mkurak mkurak deleted the feat/team-repo-maintenance-rule branch April 24, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant