You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: we need to add .gitkeep to every empty folder openspec creates
After initialising the openspec, it creates:
openspec/changes
openspec/changes/archive
openspec/specs
And if you try immediately commit the changes and someone fetches the repo, these folders are absent and openspec list command recommends openspec init. Even if you init once again those folders are not recreated.
Problem: Git doesn't track empty directories, so the specs/, changes/, and changes/archive/ folders created by openspec init disappear after commit, breaking the workflow for new team members.
Solution: Add .gitkeep files to these three directories to ensure Git tracks them.
Approach:
Modify src/core/init.tscreateDirectoryStructure method to create .gitkeep files
Add test cases to verify .gitkeep presence
Ensure openspec list works immediately after clone
OpenSpec Proposal: I've created a proposal following the OpenSpec framework: add-gitkeep-empty-folders
I'd like to work on this. The fix adds .gitkeep files to the specs/, changes/, and changes/archive/ directories during init so they are preserved in version control.
Reopening: this is a confirmed bug (acknowledged above) and still reproduces on main for openspec init — the empty specs/, changes/, and changes/archive/ directories are untracked, so they vanish on clone and openspec list recommends re-init. The live fix is #786 (adds .gitkeep anchors during init). Reopening so that merging #786 auto-closes this.
Activity
TabishB commentedon Nov 3, 2025
@ravshansbox Ahaha yeah I didn't think about this edge case. I'll take a look.
yha9806 commentedon Nov 5, 2025
Hi! I'd like to work on this issue.
Problem: Git doesn't track empty directories, so the
specs/,changes/, andchanges/archive/folders created byopenspec initdisappear after commit, breaking the workflow for new team members.Solution: Add
.gitkeepfiles to these three directories to ensure Git tracks them.Approach:
src/core/init.tscreateDirectoryStructuremethod to create.gitkeepfiles.gitkeeppresenceopenspec listworks immediately after cloneOpenSpec Proposal: I've created a proposal following the OpenSpec framework:
add-gitkeep-empty-foldersI'll submit a PR shortly. Thanks!
feat: add .gitkeep files to preserve empty directories (Fission-AI#269)
chore: publish fork to npm as @haoruiyyyu/openspec@0.14.1
Merge: add .gitkeep files (Fission-AI#269)
chore: publish v0.14.2 with Issue Fission-AI#269 and Fission-AI#243 f…
fix(init): add .gitkeep files to empty directories
Br1an67 commentedon Mar 1, 2026
I'd like to work on this. The fix adds
.gitkeepfiles to thespecs/,changes/, andchanges/archive/directories during init so they are preserved in version control.PR: #786
fix(init): add .gitkeep files to empty directories
fix(init): add .gitkeep files to empty directories
clay-good commentedon Aug 7, 2026
Reopening: this is a confirmed bug (acknowledged above) and still reproduces on
mainforopenspec init— the emptyspecs/,changes/, andchanges/archive/directories are untracked, so they vanish on clone andopenspec listrecommends re-init. The live fix is #786 (adds.gitkeepanchors during init). Reopening so that merging #786 auto-closes this.fix(init): add .gitkeep files to empty directories (#786)