From b31ca199629989c2623e5c114f218372403f305d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Den=20Delimarsky=20=F0=9F=8C=BA?= <53200638+localden@users.noreply.github.com> Date: Thu, 11 Sep 2025 22:46:21 -0700 Subject: [PATCH] Update how Copilot prompts are created --- .github/workflows/release.yml | 23 ++++++----------------- docs/local-development.md | 25 ++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1ebfbc7a..efa13f316 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,27 +96,16 @@ jobs: name=$(basename "$template" .md) description=$(awk '/^description:/ {gsub(/^description: *"?/, ""); gsub(/"$/, ""); print; exit}' "$template" | tr -d '\r') content=$(awk '/^---$/{if(++count==2) start=1; next} start' "$template" | sed "s/{ARGS}/$arg_format/g") - case $ext in "toml") - { - echo "description = \"$description\"" - echo "" - echo "prompt = \"\"\"" - echo "$content" - echo "\"\"\"" - } > "$output_dir/$name.$ext" - ;; + { echo "description = \"$description\""; echo ""; echo "prompt = \"\"\""; echo "$content"; echo "\"\"\""; } > "$output_dir/$name.$ext" ;; "md") - echo "$content" > "$output_dir/$name.$ext" - ;; + echo "$content" > "$output_dir/$name.$ext" ;; "prompt.md") - { - echo "# $(echo "$description" | sed 's/\. .*//')" - echo "" - echo "$content" - } > "$output_dir/$name.$ext" - ;; + # Preserve original front matter + body with argument substitution for Copilot + # Simply copy the entire template, replacing {ARGS} + # This keeps YAML so tooling can parse metadata + sed "s/{ARGS}/$arg_format/g" "$template" > "$output_dir/$name.$ext" ;; esac fi done diff --git a/docs/local-development.md b/docs/local-development.md index 2a12ac150..20a3d9e2f 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -61,6 +61,28 @@ git push origin your-feature-branch uvx --from git+https://github.com/github/spec-kit.git@your-feature-branch specify init demo-branch-test ``` +### 4a. Absolute Path uvx (Run From Anywhere) + +If you're in another directory, use an absolute path instead of `.`: + +```bash +uvx --from /mnt/c/GitHub/spec-kit specify --help +uvx --from /mnt/c/GitHub/spec-kit specify init demo-anywhere --ai copilot --ignore-agent-tools +``` + +Set an environment variable for convenience: +```bash +export SPEC_KIT_SRC=/mnt/c/GitHub/spec-kit +uvx --from "$SPEC_KIT_SRC" specify init demo-env --ai copilot --ignore-agent-tools +``` + +(Optional) Define a shell function: +```bash +specify-dev() { uvx --from /mnt/c/GitHub/spec-kit specify "$@"; } +# Then +specify-dev --help +``` + ## 5. Testing Script Permission Logic After running an `init`, check that shell scripts are executable on POSIX systems: @@ -114,7 +136,8 @@ specify init demo --skip-tls --ai gemini --ignore-agent-tools |--------|---------| | Run CLI directly | `python -m src.specify_cli --help` | | Editable install | `uv pip install -e .` then `specify ...` | -| Local uvx run | `uvx --from . specify ...` | +| Local uvx run (repo root) | `uvx --from . specify ...` | +| Local uvx run (abs path) | `uvx --from /mnt/c/GitHub/spec-kit specify ...` | | Git branch uvx | `uvx --from git+URL@branch specify ...` | | Build wheel | `uv build` |