spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

Scripts should use workspace relative path not repo root

Open Ian1971 opened this issue 1 year ago • 13 comments

With vs code your workspace might not be the repo root, but currently if you init in a subfolder of the repo root one of the scripts fails. If you do it in repo root it works.

Ian1971 avatar Sep 11 '25 07:09 Ian1971

Can you please explain this issue properly. I did't get what you are saying.

Paimon2806 avatar Sep 11 '25 09:09 Paimon2806

So lets say my repo structure is something like

root - src 
   - otherfolders

We may want our vscode workspace to be the src folder, so that the otherfolders are not in the workspace. But if you do that then run uvx --from git+https://github.com/github/spec-kit.git specify init --here then one of the scripts fails because it seems to be looking in the repo root. I will try it again and get an error message

Ian1971 avatar Sep 11 '25 09:09 Ian1971

Ok, so uvx --from git+https://github.com/github/spec-kit.git specify init --here succeeds, but when you do /specify you get this error:

bash scripts/create-new-feature.sh --json "some prompt"

Switched to a new branch '001-some-prompt'
Warning: Template not found at /mnt/c/projects/myrepo/templates/spec-template.md
{"BRANCH_NAME":"001-some-prompt","SPEC_FILE":"/mnt/c/projects/myrepo/specs/001-reverse-engineer-smp/spec.md","FEATURE_NUM":"001"}

so it appears to be looking for the templates in the repo root

Ian1971 avatar Sep 11 '25 09:09 Ian1971

I just run into the same problem. We are using monorepo setup so my root repo folder is not my project folder. I want to use specify within my project folder and I can initialize it there but every script is generating path relative to repo root folder(instead of project folder) and then AI is confused because it cannot find anything and it is annoying to try to steer it back to the project folder.

docech avatar Sep 11 '25 12:09 docech

Certainly not vscode specific. The only activity in the root directory containing the repo should be repo activity, ex. branching. All other references should be in the project directory which uvx installed to, which could be the root directory or could be a some sub directory.

kenbanks-peng avatar Sep 11 '25 16:09 kenbanks-peng

I think this is the issue in create-new-feature.sh

Image

Ian1971 avatar Sep 11 '25 17:09 Ian1971

I feel that the folder names scripts and templates are too generic. If my current project already has folders with those names, it could cause conflicts.

Would it be possible to move memory, scripts, and templates under a parent folder like spec-kit to avoid naming collisions?

kd-coder2024 avatar Sep 12 '25 05:09 kd-coder2024

Would it be possible to move memory, scripts, and templates under a parent folder like spec-kit to avoid naming collisions?

That sounds sensible as I've already found it painful locating the folders.

It would also be good if we can have multiple speckit projects at the same level (because they have a shared code base) but define different features.

Ian1971 avatar Sep 12 '25 08:09 Ian1971

I believe this needs to be encapsulated in its own folder instead of the root folder. Does that sound plausible?

andre-menutole avatar Sep 17 '25 12:09 andre-menutole

+1 Would be great to be able to use this with our monorepo. When we init with --here, then just having the specs directory live there alongside .specify, rather than at $REPO_ROOT.

mapstack-chris avatar Sep 18 '25 13:09 mapstack-chris

https://github.com/github/spec-kit/issues/581

acgxv avatar Oct 23 '25 16:10 acgxv

This issue has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar Apr 03 '26 14:04 github-actions[bot]

This issue has been automatically closed due to inactivity (180 days total). If you believe this issue is still relevant, please reopen it or create a new issue.

github-actions[bot] avatar May 05 '26 00:05 github-actions[bot]