Skip to content

Commit 36c09a8

Browse files
committed
fix: add git repo check to speckit-init
1 parent 300d2a2 commit 36c09a8

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

skills/speckit-init/SKILL.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,19 @@ If `.specify/` exists:
2525
- Only create missing directories or files
2626
- Tell the user what was skipped and what was added
2727

28-
### 2. Create directory structure
28+
### 2. Check for git
29+
30+
Check if the project root has a git repository:
31+
```bash
32+
git rev-parse --git-dir 2>/dev/null
33+
```
34+
35+
If no git repo exists, warn the user:
36+
> "No git repository detected. The speckit workflow uses feature branches (e.g., `001-feature-name`) for organizing specs. Consider running `git init` before creating features."
37+
38+
Do NOT run `git init` automatically — that's the user's choice.
39+
40+
### 3. Create directory structure
2941

3042
```
3143
.specify/
@@ -41,7 +53,7 @@ mkdir -p .specify/templates
4153
mkdir -p specs
4254
```
4355

44-
### 3. Copy templates from package
56+
### 4. Copy templates from package
4557

4658
Copy all templates from the package into `.specify/templates/`. The package templates are at `../../templates/` relative to this SKILL.md.
4759

@@ -56,20 +68,20 @@ Templates to copy:
5668

5769
**Do NOT overwrite** existing templates. If a template already exists in `.specify/templates/`, skip it and note that it was preserved.
5870

59-
### 4. Create roadmap
71+
### 5. Create roadmap
6072

6173
If `.specify/roadmap.md` does not exist:
6274
- Copy `roadmap-template.md` from `.specify/templates/` to `.specify/roadmap.md`
6375
- Tell the user they can customize it with `/skill:speckit-roadmap`
6476

65-
### 5. Offer constitution setup
77+
### 6. Offer constitution setup
6678

6779
Ask the user: "Would you like to set up a project constitution now? This defines project-wide principles that guide all specs. (yes/no)"
6880

6981
- If yes: copy `constitution-template.md` to `.specify/memory/constitution.md` and then run the constitution workflow (same as `/skill:speckit-constitution`) to fill in the placeholders
7082
- If no: skip, mention they can run `/skill:speckit-constitution` later
7183

72-
### 6. Report
84+
### 7. Report
7385

7486
Summarize what was created:
7587
```

0 commit comments

Comments
 (0)