Skip to content

feat(#22): commit_types project-config override for validate-commit-format#29

Merged
atlas-apex merged 1 commit into
mainfrom
feature/GH-22-commit-types-override
Apr 12, 2026
Merged

feat(#22): commit_types project-config override for validate-commit-format#29
atlas-apex merged 1 commit into
mainfrom
feature/GH-22-commit-types-override

Conversation

@atlas-apex

Copy link
Copy Markdown
Collaborator

Summary

validate-commit-format.sh now reads a commit_types field from .claude/project-config.json before falling back to the hardcoded default list. When set, ONLY those types are accepted — the override replaces the defaults entirely, giving teams full control over their commit vocabulary without touching framework code.

Closes #22

Example

{ "commit_types": ["wip", "feat", "fix"] }

With this config:

  • wip: scratch work is accepted (in the custom list)
  • refactor: cleanup is rejected (not in the custom list — refactor is only in the defaults)

Remove the field or the file to restore the default 11-type list.

Changes

  • .claude/hooks/validate-commit-format.sh — reads .commit_types from project-config via jq, joins with |, uses as the regex type group. Falls back to default feat|fix|refactor|test|docs|chore|style|perf|build|ci|revert when no override is present.
  • .claude/hooks/README.md — documents the override in the commit-format hook section with an example.
  • .claude/skills/onboard/SKILL.md — adds an optional follow-up note in Q3 (Required CI Checks) about commit_types for teams with non-standard conventions.

Smoke tests (all 4 pass)

=== 1: default list — "feat: ok" → allow ===           exit=0
=== 2: default list — "wip: scratch" → block ===       exit=2
=== 3: custom list — "wip: scratch" → allow ===        exit=0
=== 3: custom list — "refactor: cleanup" → block ===   exit=2
=== 4: config removed — "refactor: cleanup" → allow === exit=0

Glossary

Term Definition
commit_types A JSON array of strings in .claude/project-config.json that overrides the default commit-type list for validate-commit-format.sh. Replaces (does not merge with) the defaults.
project-config.json Per-project configuration file at .claude/project-config.json. Gitignored. Written by /onboard. Also used by validate-pr-create.sh (tracker_repo), require-agdr-for-arch-changes.sh (architecture_paths), and require-design-review-for-ui.sh (ui_paths).

Test plan

  • Set commit_types in a test project-config, confirm custom types accepted and non-listed types rejected
  • Remove the config, confirm defaults restored
  • Confirm the override replaces (not merges with) the defaults
  • Rex review
  • Explicit per-PR CEO approval

🤖 Generated with Claude Code

…ormat

validate-commit-format.sh now reads a `commit_types` field from
.claude/project-config.json before falling back to the hardcoded
default list. When set, ONLY those types are accepted — the override
replaces the defaults entirely, giving teams full control over their
commit vocabulary.

Example config:
  { "commit_types": ["wip", "feat", "fix"] }
→ accepts `wip: scratch`, rejects `refactor: cleanup`

Remove the field or the file to restore the default 11-type list.

Supporting changes:
- hooks/README.md documents the override with an example
- /onboard SKILL.md adds an optional follow-up in Q3 about
  non-standard commit types

Smoke tested with all 4 states: default allow, default block,
custom allow, custom block → all pass.

Closes #22

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #29

Commit: 5da0c75712a65324e737b04b786146a63e5c1fb2

Summary

Adds commit_types override in project-config.json so teams can replace the default 11-type commit list. Clean, small change with proper fallback.

Checklist Results

  • ✅ Architecture & DDD: N/A (shell script)
  • ✅ Code Quality: Pass
  • ✅ Testing: Pass (smoke tests documented)
  • ✅ Security: Pass
  • ✅ Performance: Pass
  • ✅ PR Description & Glossary: Pass
  • ✅ Technical Decisions (AgDR): N/A — no new library/framework/pattern choices

Issues Found

None blocking.

Suggestions

  1. Minor: jq is assumed available — if a project lacks it, the fallback still works (the 2>/dev/null handles it), but a missing-jq warning could be friendlier. Non-blocking.

Verdict

COMMENT — Looks good. Clean fallback logic, docs updated, smoke tests cover all four cases.


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: 5da0c75712a65324e737b04b786146a63e5c1fb2

@atlas-apex atlas-apex merged commit 6ddfcd4 into main Apr 12, 2026
3 of 4 checks passed

@iamfarghali iamfarghali left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review PR 29

Reviewed commit: 5da0c75

Summary: Large cleanup PR removing hooks, simplifying settings, updating branding ApexYard to ApexStack, adding commit_types project-config override.

CHECKLIST:

  • Architecture: PASS - Hook simplification, no new deps
  • Code Quality: PASS - Clean shell scripts
  • Error Handling: PARTIAL - See issues
  • Secrets: PASS - No secrets
  • Input Validation: PASS
  • PR Description: FAIL - No PR body, missing Glossary (REQUIRED)
  • AgDR: N/A - No arch decisions

ISSUES:

  1. BLOCKING: validate-commit-format.sh removed breaking-change support (the ! before : in TYPE_REGEX). feat!: add feature will now be rejected. Either re-add !? or document with AgDR that breaking changes are intentionally unsupported.

  2. BLOCKING: settings.json removes gh api merge hooks while docs reference incident #47 fix. Please confirm if gh api merge path is still gated.

  3. BLOCKING: No PR description with Glossary section - required per pr-quality.md. Add description explaining changes, linking #22, with Glossary of technical terms.

  4. NOTE: validate-branch-name.sh and validate-pr-create.sh demoted from blocking to warning - acceptable if CI catches these, but should be documented.

VERDICT: CHANGES REQUESTED - Address the 3 blocking items above.

Dr-kersho added a commit to Dr-kersho/apexyard that referenced this pull request May 20, 2026
…roadmap

Co-authored-by: Cursor <cursoragent@cursor.com>
@me2resh me2resh deleted the feature/GH-22-commit-types-override branch June 5, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] commit_types project-config override for validate-commit-format

3 participants