diff --git a/.specify/ai-kit.manifest.json b/.specify/ai-kit.manifest.json new file mode 100644 index 0000000..94067c3 --- /dev/null +++ b/.specify/ai-kit.manifest.json @@ -0,0 +1,44 @@ +{ + "schema_version": "1.0", + "integration": "copilot", + "version": "1.0.0", + "links": [ + { + "source": ".github/agents", + "target": ".github/agents", + "mode": "link_children", + "skip_patterns_unless_paths_exist": [ + { + "patterns": [ + "speckit.*" + ], + "paths": [ + ".speckit" + ] + } + ] + }, + { + "source": ".github/prompts", + "target": ".github/prompts", + "mode": "link_dir" + }, + { + "source": ".github/skills", + "target": ".github/skills", + "mode": "link_dir" + }, + { + "source": ".github/hooks", + "target": ".github/hooks", + "mode": "link_dir" + } + ], + "copies": [ + { + "source": ".github/copilot-instructions.md", + "target": ".github/copilot-instructions.md", + "if_missing": true + } + ] +} diff --git a/README.md b/README.md index bad7ebe..97d2107 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ Used as a git submodule (at `.copilot/`) to provide: > **Note:** `speckit.*` agents reference `.specify/templates/` which is provided by `speckit-core`. > When used without `speckit-core`, those agents are automatically skipped at bootstrap time. +> +> When paired with `speckit-core`, this repo now exposes `.specify/ai-kit.manifest.json` so the generic +> linker in `speckit-core` can attach Copilot-owned files without hardcoding `.github/*` logic in every consumer. ## Usage @@ -33,6 +36,14 @@ Set `copilot_enabled: true` in your `repos.json` entry — the bootstrap workflo bash <(curl -fsSL https://raw.githubusercontent.com/jwill824/copilot-kit/main/install.sh) ``` +If `.speckit/` is already present, the installer delegates to: + +```bash +bash .speckit/.specify/scripts/bash/link-ai-integration.sh copilot .copilot +``` + +If `speckit-core` is not present, `copilot-kit` falls back to its standalone linking behavior. + ## Spec-Kit Workflow ``` diff --git a/install.sh b/install.sh index 7d5a3a7..82ea38c 100755 --- a/install.sh +++ b/install.sh @@ -18,6 +18,38 @@ success() { echo -e " ${GREEN}✓${RESET} $*"; } warn() { echo -e " ${YELLOW}⚠${RESET} $*"; } error() { echo -e " ${RED}✗${RESET} $*" >&2; exit 1; } +write_project_tooling() { + local path=".specify/project-tooling.json" + local tmp + tmp="$(mktemp)" + + mkdir -p .specify + + if [ -f "$path" ]; then + # Merge: preserve spec_workflow and other keys, update ai_tool + ai_kit_path + python3 - "$path" "$tmp" <<'PY' +import json, sys +data = json.load(open(sys.argv[1])) +data.setdefault("spec_workflow", True) +data["ai_tool"] = "copilot" +data["ai_kit_path"] = ".copilot" +json.dump(data, open(sys.argv[2], "w"), indent=2) +open(sys.argv[2], "a").write("\n") +PY + mv "$tmp" "$path" + success "Updated $path" + else + cat > "$path" <<'JSON' +{ + "spec_workflow": true, + "ai_tool": "copilot", + "ai_kit_path": ".copilot" +} +JSON + success "Created $path" + fi +} + echo -e "\n${BOLD}🔧 copilot-kit installer${RESET}\n" cd "$TARGET_DIR" || error "Cannot cd to $TARGET_DIR" @@ -37,6 +69,18 @@ else fi success "Submodule ready at .copilot/\n" +if [ -x ".speckit/.specify/scripts/bash/link-ai-integration.sh" ] && [ -f ".copilot/.specify/ai-kit.manifest.json" ]; then + echo -e "${BOLD}Step 2: Generic integration linking${RESET}" + bash ".speckit/.specify/scripts/bash/link-ai-integration.sh" copilot .copilot + # linker writes project-tooling.json automatically + echo "" + + echo -e "${BOLD}${GREEN}✅ copilot-kit installed!${RESET}\n" + echo -e " ${BOLD}Next:${RESET} customize ${CYAN}.github/copilot-instructions.md${RESET} for your project" + echo -e " ${BOLD}Update later:${RESET} ${CYAN}git submodule update --remote .copilot${RESET}\n" + exit 0 +fi + # ── 2. Agent symlinks (individual files) ────────────────────────────────────── echo -e "${BOLD}Step 2: Agent symlinks${RESET}" if [ -L ".github/agents" ]; then @@ -117,6 +161,11 @@ STUB fi echo "" +# ── Standalone: write project-tooling.json ──────────────────────────────────── +echo -e "${BOLD}Step 5: Project tooling declaration${RESET}" +write_project_tooling +echo "" + echo -e "${BOLD}${GREEN}✅ copilot-kit installed!${RESET}\n" echo -e " ${BOLD}Next:${RESET} customize ${CYAN}.github/copilot-instructions.md${RESET} for your project" echo -e " ${BOLD}Update later:${RESET} ${CYAN}git submodule update --remote .copilot${RESET}\n"