skills/git-commit-scope-constitution/SKILL.md
Build and refine a constitution defining valid commit scopes for each commit type. Use when maintaining .github/git-scope-constitution.md, discovering new scopes from git history or repo structure, validating scope choices, or conducting weekly scope reviews. Scopes are repo-specific; types are universal.
npx skillsauth add arisng/github-copilot-fc git-commit-scope-constitutionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables building and maintaining a living constitution that defines the inventory and rules for commit scopes used in conventional commits. The constitution serves as the authoritative source for:
Repository-Specific Design: Each repository maintains its own scopes inventory and constitution, stored within the repository itself. This ensures scopes align with the specific project structure, domains, and modules of that repository.
Commit messages follow the pattern type(scope): subject, governed by a three-tier hierarchy:
| Tier | What it governs | Defined by | Stability |
|------|----------------|------------|-----------|
| 1. Universal | Standard Conventional Commits types (feat, fix, docs, etc.) | Industry convention | Fixed across all repos |
| 2. Author Preferences | Extended types (agent, copilot, devtool, codex) + default file-path mappings | Skill author (opinionated, portable) | Shared across author's repos; users may override |
| 3. Workspace-Specific | Scopes, additional types, file-path overrides | .github/git-scope-constitution.md per repo | Unique per repository |
This skill's primary job is to define the Tier 3 Scopes for a specific repository and map them to the appropriate Types.
Scopes Inventory: .github/git-scope-inventory.md
extract_scopes.pyConstitution Document: .github/git-scope-constitution.md
Key Distinction: The inventory shows what has been used (historical fact), while the constitution defines what should be used (governance policy). The inventory feeds into constitution updates, but the constitution governs future commits.
Template Reference: skills/git-commit-scope-constitution/references/scope-constitution.md
The commit scope constitution governs the scopes used in conventional commit messages:
<commit_type>(<scope>): <executive summary>
<optional_multi-line_description>
MANDATORY: Single Scope Only
Each commit MUST have exactly one scope. Never use multiple scopes (e.g., <type>(<scope1>)(<scope2>)). If a change affects multiple areas, choose the most significant one as the primary <scope> and explicitly mention any secondary area in the <subject> part (e.g., <type>(primary-scope): [secondary-area] actual message).
The constitution itself is stored in .github/git-scope-constitution.md and follows this structure:
# Commit Scope Constitution
Last Updated: YYYY-MM-DD
## Purpose
This constitution defines the approved scopes for atomic commits, ensuring consistency and clarity in commit history.
## Scope Naming Conventions
[Rules for creating scope names]
## Approved Scopes by Commit Type
### `commit_type`
- `scope-name`: Brief description of what this scope covers
- `another-scope`: Brief description
[Additional sections as needed]
## Scope Selection Guidelines
[Guidance for choosing appropriate scopes]
## Amendment Process
[How to propose and approve new scopes]
Start by understanding the repository from two perspectives:
Analyze git commit history to see what scopes have been used:
# Extract all historical scopes
python skills/git-commit-scope-constitution/scripts/extract_scopes.py --format markdown --output .github/git-scope-inventory.md
# Or just recent scopes (last 3 months)
python skills/git-commit-scope-constitution/scripts/extract_scopes.py --since "3 months ago" --format markdown
This generates an inventory of all scopes currently used in the repository's git history, organized by commit type.
Note: The scopes inventory shows historical usage (what has been done), while the constitution defines approved usage (what should be done). Use the inventory as input for constitution updates, but always reference the constitution for governance decisions.
CRITICAL: Scopes should align with the actual project structure, not just historical commits. Analyze the repository to understand:
Folder Structure Analysis:
services/, components/, tools/)auth/, billing/, dashboard/).docs/, docs/, README.md)Project Architecture:
scripts/, tests/, config/)agents/, skills/, prompts/)Key Questions:
Example Analysis:
Repository: github-copilot-fc
Top-level structure:
- agents/ → Custom agent definitions
- instructions/ → Copilot instructions
- prompts/ → Prompt templates
- skills/ → Claude skills
- scripts/ → Automation scripts
- tools/ → Tools inventory and VS Code runtime toolsets
- .docs/ → Documentation
Derived scope patterns:
- Artifact-based: agent, instruction, prompt, skill, toolset
- Function-based: script (for automation)
- Domain-based: issue, changelog (from .docs/ subfolders)
Combine insights from git history and repository structure:
Merge Historical and Structural Scopes:
Identify Patterns:
Check if a constitution already exists:
.github/git-scope-constitution.md if presentEvaluate the current scope landscape:
Quality Checks:
Pattern Recognition:
Based on analysis, create or update the constitution:
For New Constitutions:
For Constitution Updates:
Key Principles:
Validate the updated constitution:
Completeness Checks:
Consistency Checks:
Record constitutional amendments:
Amendment Log Format:
## Amendment History
### YYYY-MM-DD - Amendment #N
**Changes:**
- Added scope `new-scope` to `commit_type`
- Consolidated `old-scope-1` and `old-scope-2` into `unified-scope`
- Clarified definition of `ambiguous-scope`
**Rationale:**
[Why these changes were made]
**Migration Notes:**
[How to handle existing commits with old scopes]
Save the finalized constitution and inventory:
.github/git-scope-constitution.md.github/git-scope-inventory.mdRecommended Commit Message:
docs(constitution): update scope inventory with Q1 2026 scopes
- Added 5 new scopes for `agent` type commits
- Consolidated instruction scopes into 3 clear categories
- Clarified boundaries between codex and copilot scopes
Run this workflow weekly to keep the constitution current:
Before committing, validate scope choice against constitution:
When uncertain about scope naming:
extract_scopes.py --since "1 month ago"scripts/extract_scopes.pyAnalyzes git history to extract all scopes used in conventional commit messages.
Usage:
# Extract all scopes
python scripts/extract_scopes.py
# Filter by time period
python scripts/extract_scopes.py --since "1 week ago"
# Output as JSON
python scripts/extract_scopes.py --format json
# Save to file
python scripts/extract_scopes.py --output inventory.md
Output Formats:
markdown: Structured inventory with summary statistics and organized scope listsjson: Machine-readable structure for toolingInventory Structure:
# Scopes Inventory
**Repository:** [name]
**Last Updated:** [date]
**Source:** Git commit history analysis
## Summary
- Total Commit Types: N
- Total Unique Scopes: N
- Analysis Period: [timeframe]
## Scopes by Commit Type
### `type`
- scope-1
- scope-2
## Notes
[Additional context]
references/scope-constitution.md
.github/git-scope-constitution.md in target repositoryreferences/scope-inventory-template.md
.github/git-scope-constitution.md (in target repository)
.github/git-scope-inventory.md (in target repository)
extract_scopes.py scriptCategory-Level Principle (Tier 2 Extended Types):
For extended types (agent, copilot, devtool, codex), scopes must be artifact categories, not specific instances. When scanning git log --oneline, type(category) instantly conveys what kind of thing changed; the subject line says which one.
| Pattern | Example | Verdict |
|---------|---------|---------|
| Category scope | agent(skill): add table extraction to pdf | ✅ |
| Instance scope | agent(pdf): add table extraction | ❌ |
| Category scope | copilot(instruction): tighten powershell linting rules | ✅ |
| Instance scope | copilot(powershell): tighten linting rules | ❌ |
| Category scope | devtool(script): fix publish path resolution | ✅ |
| Instance scope | devtool(publish): fix path resolution | ❌ |
General Granularity (All Types):
Too Broad:
feat(code): add feature → What part of the code?fix(app): fix bug → Which component?Too Narrow:
feat(src/components/forms/UserForm.tsx): add validation → File-specificfix(line-42-in-utils): fix typo → Too granularJust Right:
feat(user-form): add email validationfix(auth): correct token expiration logicRecommended Patterns:
user-profile, api-clientskill, agent, instructionauth, billing, dashboardapi-client not calling-apiAnti-Patterns:
userProfileuser_profileuser profilemisc, other, stuffGood Reasons to Add Scope:
Bad Reasons to Add Scope:
Creation: New scope added via constitutional amendment Active Use: Scope appears regularly in commits Consolidation: Similar scopes merged into one Deprecation: Scope no longer relevant, marked deprecated Retirement: Deprecated scope removed from constitution (but remains in history)
Maintenance Schedule:
--since "1 week ago")Monthly:
Quarterly:
This skill complements the git-atomic-commit skill:
correct_type(approved_scope): clear messageWorkflow Integration:
File Changed → git-atomic-commit → Commit Type Assigned
↓
git-commit-scope-constitution → Scope Selected
↓
Final Commit Message
Scope Not Found in Constitution:
extract_scopes.pyConstitution Conflicts:
Scope Naming Violations:
# Step 1: Extract historical scopes
python skills/git-commit-scope-constitution/scripts/extract_scopes.py \
--output .github/git-scope-inventory.md
# Step 2: Analyze repository structure
# List top-level directories
Repository: my-web-app/
src/
components/ → UI components
services/ → Business logic services
utils/ → Utility functions
tests/ → Test files
scripts/ → Build/automation scripts
docs/ → Documentation
.github/ → GitHub workflows
# Step 3: Map structure to scopes
From structure analysis:
- components/ → scope: "components" or specific component names
- services/auth/ → scope: "auth"
- services/billing/ → scope: "billing"
- scripts/ → scope: "script" or "build"
- docs/ → scope: "docs"
From git history (.github/git-scope-inventory.md):
- feat(components): Used 15 times
- feat(auth): Used 8 times
- feat(billing): Used 12 times
- fix(api): Used 6 times
- chore(deps): Used 20 times
# Step 4: Create constitution
# Combine structure-based and history-based scopes
# Document in .github/git-scope-constitution.md with clear definitions
# Extract last week's scopes
python skills/git-commit-scope-constitution/scripts/extract_scopes.py \
--since "1 week ago" --format markdown
# Check for new folders/modules
# Found: New folder src/services/notifications/
# Review against constitution
# Found new scope: feat(notifications) used 3 times
# Found folder: services/notifications/ (new module)
# Update constitution
# Add to appropriate section:
# - `notifications`: Notification service and delivery system
Scenario: Modifying skills/git-atomic-commit/SKILL.md
Step 1: Check commit type mapping
→ File pattern: skills/* → Type: agent
Step 2: Consult constitution under Type: agent
→ Available scopes: skill, instruction
Step 3: Select appropriate scope
→ Change affects a skill → Use scope: `skill`
→ Specific skill name goes in the subject
Result: agent(skill): improve pre-commit validation checklist for git-atomic-commit
Scenario: Adding new authentication feature
Step 1: Analyze repository structure
→ services/auth/ exists (authentication module)
→ New files: services/auth/oauth.ts, services/auth/jwt.ts
Step 2: Check commit type
→ File pattern: services/* → feat (no project-specific type)
Step 3: Check constitution for feat scopes
→ .github/git-scope-constitution.md shows:
- auth: Authentication and authorization
- billing: Payment processing
- dashboard: Dashboard features
Step 4: Select scope based on structure
→ Files in services/auth/ → Use scope: auth
→ Aligns with both structure and constitution
Result: feat(auth): implement OAuth 2.0 authentication flow
## Amendment History
### 2026-02-04 - Amendment #12
**Changes:**
- Deprecated `ai` extended type in favor of `agent`
- Consolidated instance-level scopes (e.g., `pdf`, `diataxis`) into
category-level scope `skill` under `agent` type
- Adopted "category-level scope" principle: scopes represent artifact
categories, not specific instances
**Rationale:**
`agent(skill)` immediately tells the reader an agent skill was changed.
The subject line provides the specific skill name, enabling efficient
git log scanning without opening the diff.
**Migration Notes:**
Existing commits with old `ai(*)` scopes remain in history.
Use `agent(skill)` for all future skill-related commits.
devops
Programmatically create tldraw whiteboards and visualize them with a self-hosted tldraw instance. Create boards with shapes, text, and connectors, then deploy to a self-hosted server for collaborative editing and gallery management.
tools
Execute Google Cloud Platform operations using the gcloud CLI (and gsutil/bq where applicable). Use when the user wants to: authenticate with GCP, manage GCP resources, deploy applications, configure projects or IAM, view logs, run SQL/BigQuery, or interact with any GCP service from the command line. Triggers on phrases like "gcloud", "Google Cloud CLI", "deploy to GCP", "create a VM", "Cloud Run", "GKE cluster", "Cloud Storage bucket", "set GCP project", "service account", "Cloud Functions", "App Engine deploy", or any request to manage Google Cloud resources via command line.
testing
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
development
Session-scoped git commit orchestrator that commits only current-session changes and leaves unrelated dirty worktree edits untouched. Inherits git-atomic-commit for atomic grouping and commit message execution, and git-commit-scope-constitution for scope governance and validation. Use when asked to commit this session only or isolate commits from mixed worktree state.