Skip to content

Commit c27075e

Browse files
authored
Merge pull request #974 from opsmill/develop
Merge develop into infrahub-develop
2 parents 3805e4d + 54ba648 commit c27075e

77 files changed

Lines changed: 4651 additions & 425 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../dev/skills

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,11 @@ jobs:
113113
**/*.{md,mdx}
114114
!changelog/*.md
115115
!.claude/commands/**
116+
!.claude/skills/**
116117
!dev/commands/**
118+
!dev/skills/**
117119
!.specify/templates/**
120+
!.specify/extensions/**
118121
119122
action-lint:
120123
if: needs.files-changed.outputs.github_workflows == 'true'

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@ dist/*
3030

3131
# Generated files
3232
generated/
33-
sandbox/
33+
sandbox/
34+
35+
# SpecKit internal cache
36+
.specify/**/.cache/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313

1414
- repo: https://github.com/astral-sh/ruff-pre-commit
1515
# Ruff version.
16-
rev: v0.15.0
16+
rev: v0.15.12
1717
hooks:
1818
# Run the linter.
1919
- id: ruff

.specify/extensions.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
installed:
2+
- id: infrahub
3+
path: .specify/extensions/infrahub
4+
settings:
5+
auto_execute_hooks: true
6+
hooks:
7+
before_constitution:
8+
- extension: git
9+
command: speckit.git.initialize
10+
enabled: true
11+
optional: false
12+
prompt: Execute speckit.git.initialize?
13+
description: Initialize Git repository before constitution setup
14+
condition: null
15+
before_specify:
16+
- extension: infrahub
17+
command: speckit.infrahub.feature
18+
enabled: true
19+
optional: false
20+
prompt: Execute speckit.infrahub.feature?
21+
description: Validate Jira/JPD reference and create feature branch
22+
condition: null
23+
before_clarify:
24+
- extension: git
25+
command: speckit.git.commit
26+
enabled: true
27+
optional: true
28+
prompt: Commit outstanding changes before clarification?
29+
description: Auto-commit before spec clarification
30+
condition: null
31+
before_plan:
32+
- extension: git
33+
command: speckit.git.commit
34+
enabled: true
35+
optional: true
36+
prompt: Commit outstanding changes before planning?
37+
description: Auto-commit before implementation planning
38+
condition: null
39+
before_tasks:
40+
- extension: git
41+
command: speckit.git.commit
42+
enabled: true
43+
optional: true
44+
prompt: Commit outstanding changes before task generation?
45+
description: Auto-commit before task generation
46+
condition: null
47+
before_implement:
48+
- extension: git
49+
command: speckit.git.commit
50+
enabled: true
51+
optional: true
52+
prompt: Commit outstanding changes before implementation?
53+
description: Auto-commit before implementation
54+
condition: null
55+
before_checklist:
56+
- extension: git
57+
command: speckit.git.commit
58+
enabled: true
59+
optional: true
60+
prompt: Commit outstanding changes before checklist?
61+
description: Auto-commit before checklist generation
62+
condition: null
63+
before_analyze:
64+
- extension: git
65+
command: speckit.git.commit
66+
enabled: true
67+
optional: true
68+
prompt: Commit outstanding changes before analysis?
69+
description: Auto-commit before analysis
70+
condition: null
71+
before_taskstoissues:
72+
- extension: git
73+
command: speckit.git.commit
74+
enabled: true
75+
optional: true
76+
prompt: Commit outstanding changes before issue sync?
77+
description: Auto-commit before tasks-to-issues conversion
78+
condition: null
79+
after_constitution:
80+
- extension: git
81+
command: speckit.git.commit
82+
enabled: true
83+
optional: true
84+
prompt: Commit constitution changes?
85+
description: Auto-commit after constitution update
86+
condition: null
87+
after_specify:
88+
- extension: git
89+
command: speckit.git.commit
90+
enabled: true
91+
optional: true
92+
prompt: Commit specification changes?
93+
description: Auto-commit after specification
94+
condition: null
95+
after_clarify:
96+
- extension: git
97+
command: speckit.git.commit
98+
enabled: true
99+
optional: true
100+
prompt: Commit clarification changes?
101+
description: Auto-commit after spec clarification
102+
condition: null
103+
after_plan:
104+
- extension: git
105+
command: speckit.git.commit
106+
enabled: true
107+
optional: true
108+
prompt: Commit plan changes?
109+
description: Auto-commit after implementation planning
110+
condition: null
111+
after_tasks:
112+
- extension: git
113+
command: speckit.git.commit
114+
enabled: true
115+
optional: true
116+
prompt: Commit task changes?
117+
description: Auto-commit after task generation
118+
condition: null
119+
after_implement:
120+
- extension: git
121+
command: speckit.git.commit
122+
enabled: true
123+
optional: true
124+
prompt: Commit implementation changes?
125+
description: Auto-commit after implementation
126+
condition: null
127+
after_checklist:
128+
- extension: git
129+
command: speckit.git.commit
130+
enabled: true
131+
optional: true
132+
prompt: Commit checklist changes?
133+
description: Auto-commit after checklist generation
134+
condition: null
135+
after_analyze:
136+
- extension: git
137+
command: speckit.git.commit
138+
enabled: true
139+
optional: true
140+
prompt: Commit analysis results?
141+
description: Auto-commit after analysis
142+
condition: null
143+
after_taskstoissues:
144+
- extension: git
145+
command: speckit.git.commit
146+
enabled: true
147+
optional: true
148+
prompt: Commit after syncing issues?
149+
description: Auto-commit after tasks-to-issues conversion
150+
condition: null

.specify/extensions/.registry

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"schema_version": "1.0",
3+
"extensions": {
4+
"git": {
5+
"version": "1.0.0",
6+
"source": "local",
7+
"manifest_hash": "sha256:9731aa8143a72fbebfdb440f155038ab42642517c2b2bdbbf67c8fdbe076ed79",
8+
"enabled": true,
9+
"priority": 10,
10+
"registered_commands": {
11+
"claude": [
12+
"speckit.git.feature",
13+
"speckit.git.validate",
14+
"speckit.git.remote",
15+
"speckit.git.initialize",
16+
"speckit.git.commit"
17+
]
18+
},
19+
"registered_skills": [],
20+
"installed_at": "2026-04-28T07:55:49.511501+00:00"
21+
}
22+
}
23+
}

.specify/extensions/git/README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Git Branching Workflow Extension
2+
3+
Git repository initialization, feature branch creation, numbering (sequential/timestamp), validation, remote detection, and auto-commit for Spec Kit.
4+
5+
## Overview
6+
7+
This extension provides Git operations as an optional, self-contained module. It manages:
8+
9+
- **Repository initialization** with configurable commit messages
10+
- **Feature branch creation** with sequential (`001-feature-name`) or timestamp (`20260319-143022-feature-name`) numbering
11+
- **Branch validation** to ensure branches follow naming conventions
12+
- **Git remote detection** for GitHub integration (e.g., issue creation)
13+
- **Auto-commit** after core commands (configurable per-command with custom messages)
14+
15+
## Commands
16+
17+
| Command | Description |
18+
|---------|-------------|
19+
| `speckit.git.initialize` | Initialize a Git repository with a configurable commit message |
20+
| `speckit.git.feature` | Create a feature branch with sequential or timestamp numbering |
21+
| `speckit.git.validate` | Validate current branch follows feature branch naming conventions |
22+
| `speckit.git.remote` | Detect Git remote URL for GitHub integration |
23+
| `speckit.git.commit` | Auto-commit changes (configurable per-command enable/disable and messages) |
24+
25+
## Hooks
26+
27+
| Event | Command | Optional | Description |
28+
|-------|---------|----------|-------------|
29+
| `before_constitution` | `speckit.git.initialize` | No | Init git repo before constitution |
30+
| `before_specify` | `speckit.git.feature` | No | Create feature branch before specification |
31+
| `before_clarify` | `speckit.git.commit` | Yes | Commit outstanding changes before clarification |
32+
| `before_plan` | `speckit.git.commit` | Yes | Commit outstanding changes before planning |
33+
| `before_tasks` | `speckit.git.commit` | Yes | Commit outstanding changes before task generation |
34+
| `before_implement` | `speckit.git.commit` | Yes | Commit outstanding changes before implementation |
35+
| `before_checklist` | `speckit.git.commit` | Yes | Commit outstanding changes before checklist |
36+
| `before_analyze` | `speckit.git.commit` | Yes | Commit outstanding changes before analysis |
37+
| `before_taskstoissues` | `speckit.git.commit` | Yes | Commit outstanding changes before issue sync |
38+
| `after_constitution` | `speckit.git.commit` | Yes | Auto-commit after constitution update |
39+
| `after_specify` | `speckit.git.commit` | Yes | Auto-commit after specification |
40+
| `after_clarify` | `speckit.git.commit` | Yes | Auto-commit after clarification |
41+
| `after_plan` | `speckit.git.commit` | Yes | Auto-commit after planning |
42+
| `after_tasks` | `speckit.git.commit` | Yes | Auto-commit after task generation |
43+
| `after_implement` | `speckit.git.commit` | Yes | Auto-commit after implementation |
44+
| `after_checklist` | `speckit.git.commit` | Yes | Auto-commit after checklist |
45+
| `after_analyze` | `speckit.git.commit` | Yes | Auto-commit after analysis |
46+
| `after_taskstoissues` | `speckit.git.commit` | Yes | Auto-commit after issue sync |
47+
48+
## Configuration
49+
50+
Configuration is stored in `.specify/extensions/git/git-config.yml`:
51+
52+
```yaml
53+
# Branch numbering strategy: "sequential" or "timestamp"
54+
branch_numbering: sequential
55+
56+
# Custom commit message for git init
57+
init_commit_message: "[Spec Kit] Initial commit"
58+
59+
# Auto-commit per command (all disabled by default)
60+
# Example: enable auto-commit after specify
61+
auto_commit:
62+
default: false
63+
after_specify:
64+
enabled: true
65+
message: "[Spec Kit] Add specification"
66+
```
67+
68+
## Installation
69+
70+
```bash
71+
# Install the bundled git extension (no network required)
72+
specify extension add git
73+
```
74+
75+
## Disabling
76+
77+
```bash
78+
# Disable the git extension (spec creation continues without branching)
79+
specify extension disable git
80+
81+
# Re-enable it
82+
specify extension enable git
83+
```
84+
85+
## Graceful Degradation
86+
87+
When Git is not installed or the directory is not a Git repository:
88+
- Spec directories are still created under `specs/`
89+
- Branch creation is skipped with a warning
90+
- Branch validation is skipped with a warning
91+
- Remote detection returns empty results
92+
93+
## Scripts
94+
95+
The extension bundles cross-platform scripts:
96+
97+
- `scripts/bash/create-new-feature.sh` — Bash implementation
98+
- `scripts/bash/git-common.sh` — Shared Git utilities (Bash)
99+
- `scripts/powershell/create-new-feature.ps1` — PowerShell implementation
100+
- `scripts/powershell/git-common.ps1` — Shared Git utilities (PowerShell)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
description: "Auto-commit changes after a Spec Kit command completes"
3+
---
4+
5+
# Auto-Commit Changes
6+
7+
Automatically stage and commit all changes after a Spec Kit command completes.
8+
9+
## Behavior
10+
11+
This command is invoked as a hook after (or before) core commands. It:
12+
13+
1. Determines the event name from the hook context (e.g., if invoked as an `after_specify` hook, the event is `after_specify`; if `before_plan`, the event is `before_plan`)
14+
2. Checks `.specify/extensions/git/git-config.yml` for the `auto_commit` section
15+
3. Looks up the specific event key to see if auto-commit is enabled
16+
4. Falls back to `auto_commit.default` if no event-specific key exists
17+
5. Uses the per-command `message` if configured, otherwise a default message
18+
6. If enabled and there are uncommitted changes, runs `git add .` + `git commit`
19+
20+
## Execution
21+
22+
Determine the event name from the hook that triggered this command, then run the script:
23+
24+
- **Bash**: `.specify/extensions/git/scripts/bash/auto-commit.sh <event_name>`
25+
- **PowerShell**: `.specify/extensions/git/scripts/powershell/auto-commit.ps1 <event_name>`
26+
27+
Replace `<event_name>` with the actual hook event (e.g., `after_specify`, `before_plan`, `after_implement`).
28+
29+
## Configuration
30+
31+
In `.specify/extensions/git/git-config.yml`:
32+
33+
```yaml
34+
auto_commit:
35+
default: false # Global toggle — set true to enable for all commands
36+
after_specify:
37+
enabled: true # Override per-command
38+
message: "[Spec Kit] Add specification"
39+
after_plan:
40+
enabled: false
41+
message: "[Spec Kit] Add implementation plan"
42+
```
43+
44+
## Graceful Degradation
45+
46+
- If Git is not available or the current directory is not a repository: skips with a warning
47+
- If no config file exists: skips (disabled by default)
48+
- If no changes to commit: skips with a message

0 commit comments

Comments
 (0)