From 1c30925103174d5af4ae4033c56c24f74ae72389 Mon Sep 17 00:00:00 2001 From: Alice Thomas <2721182+AXington@users.noreply.github.com> Date: Wed, 20 May 2026 12:33:31 -0400 Subject: [PATCH 1/2] feat(copilot-skills): add skill-conductor orchestrator with sub-skills Add a three-layer skill conductor that routes AI agents to the correct framework (gstack for decisions, GSD for context, Superpowers for execution) based on signal detection. Components: - skill-conductor: main router with registry and conflict resolution - skill-conductor-decision: decision layer (office-hours, brainstorming, etc.) - skill-conductor-context: context layer (GSD workflow guidance) - skill-conductor-execution: execution layer (Superpowers routing) Also adds GSD core profile installation (Copilot + Claude Code) to section_copilot_skills() and verify checks for GSD presence and conductor registry drift detection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sections/copilot_skills.sh | 57 ++++++++++ skills/skill-conductor-context/SKILL.md | 87 +++++++++++++++ skills/skill-conductor-decision/SKILL.md | 81 ++++++++++++++ skills/skill-conductor-execution/SKILL.md | 110 +++++++++++++++++++ skills/skill-conductor/SKILL.md | 128 ++++++++++++++++++++++ 5 files changed, 463 insertions(+) create mode 100644 skills/skill-conductor-context/SKILL.md create mode 100644 skills/skill-conductor-decision/SKILL.md create mode 100644 skills/skill-conductor-execution/SKILL.md create mode 100644 skills/skill-conductor/SKILL.md diff --git a/sections/copilot_skills.sh b/sections/copilot_skills.sh index c804c39..8c05454 100644 --- a/sections/copilot_skills.sh +++ b/sections/copilot_skills.sh @@ -32,6 +32,10 @@ SKILLS_SHARED=( SKILLS_LOCAL=( code-audit hunk-reviewer + skill-conductor + skill-conductor-decision + skill-conductor-context + skill-conductor-execution ) section_copilot_skills() { @@ -81,6 +85,33 @@ section_copilot_skills() { done ok "Copilot skills installation complete." + + # Install GSD (Get Shit Done) context engineering skills + _copilot_skills_install_gsd +} + +_copilot_skills_install_gsd() { + if [[ -f "${HOME}/.copilot/skills/gsd-new-project/SKILL.md" ]]; then + ok "GSD core skills already installed (Copilot)" + else + if command_exists npx; then + run npx get-shit-done-cc@latest --copilot --global --profile=core + ok "Installed GSD core skills (Copilot)" + else + warn "npx not found; skipping GSD installation. Install Node.js first." + fi + fi + + if [[ -f "${HOME}/.claude/skills/gsd-new-project/SKILL.md" ]]; then + ok "GSD core skills already installed (Claude Code)" + else + if command_exists npx; then + run npx get-shit-done-cc@latest --claude --global --profile=core + ok "Installed GSD core skills (Claude Code)" + else + warn "npx not found; skipping GSD installation for Claude Code." + fi + fi } # -- Verification (--verify mode) --------------------------------------------- @@ -124,4 +155,30 @@ verify_copilot_skills() { || fail "Skill missing: ${skill}" done fi + + # Verify GSD core skills are installed + local gsd_core_skills=(gsd-new-project gsd-plan-phase gsd-discuss-phase gsd-execute-phase) + for skill in "${gsd_core_skills[@]}"; do + [[ -f "${skills_dir}/${skill}/SKILL.md" ]] \ + && pass "GSD skill installed: ${skill}" \ + || fail "GSD skill missing: ${skill} (run: npx get-shit-done-cc@latest --copilot --global --profile=core)" + done + + # Verify conductor registry is not stale (warn if installed skills exist outside registry) + if [[ -f "${skills_dir}/skill-conductor/SKILL.md" ]]; then + local registry_file="${skills_dir}/skill-conductor/SKILL.md" + local unregistered=0 + for dir in "${skills_dir}"/gstack-*/; do + [[ -d "$dir" ]] || continue + local skill_name + skill_name="$(basename "$dir" | sed 's/^gstack-//')" + if ! grep -q "$skill_name" "$registry_file" 2>/dev/null; then + warn "Unregistered skill in conductor: $(basename "$dir")" + unregistered=$((unregistered + 1)) + fi + done + [[ $unregistered -eq 0 ]] \ + && pass "Conductor registry covers all installed gstack skills" \ + || warn "Conductor registry has ${unregistered} unregistered gstack skill(s)" + fi } diff --git a/skills/skill-conductor-context/SKILL.md b/skills/skill-conductor-context/SKILL.md new file mode 100644 index 0000000..37c8aba --- /dev/null +++ b/skills/skill-conductor-context/SKILL.md @@ -0,0 +1,87 @@ +--- +name: skill-conductor-context +description: Context layer guidance for the skill conductor. Helps establish and maintain project context using GSD artifacts to prevent context rot. +--- + +# Context Layer: Anchoring Project Context with GSD + +You were routed here because the project needs context anchoring before work +can proceed effectively. Context rot (quality degradation as context windows +fill) is the problem GSD solves. + +## When Context Work Is Needed + +- **New project:** No PROJECT.md, REQUIREMENTS.md, or ROADMAP.md exists +- **Stale context:** STATE.md not updated in 7+ days +- **Session boundary:** Starting a new session on existing work +- **Scope shift:** Requirements changed, need to re-anchor +- **Long chain:** Multiple sessions of work, context drifting + +## Decision Tree + +``` +Does the project have GSD artifacts (PROJECT.md, REQUIREMENTS.md, ROADMAP.md)? + NO --> Is there existing code? + YES --> invoke gsd-map-codebase, then gsd-new-project + NO --> invoke gsd-new-project + YES --> Is there a specific phase being worked on? + YES --> Is the phase planned? + NO --> invoke gsd-discuss-phase, then gsd-plan-phase + YES --> invoke gsd-execute-phase + NO --> Are decisions needed before planning? + YES --> invoke gsd-discuss-phase + NO --> invoke gsd-plan-phase +``` + +## GSD Core Skills + +### gsd-new-project +**When:** Starting fresh. No GSD artifacts exist yet. +**What it does:** Questions you about the project, researches context, produces +REQUIREMENTS.md and ROADMAP.md. You approve, then you are ready to build. +**Prerequisite:** If code exists, run gsd-map-codebase first. +**Output:** PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md + +### gsd-discuss-phase [N] +**When:** A phase exists in the roadmap but implementation details are unclear. +**What it does:** Captures your decisions about layouts, API shapes, error handling, +data structures. Feeds directly into planning. +**Output:** CONTEXT.md (per-phase implementation decisions) + +### gsd-plan-phase [N] +**When:** Phase is discussed, ready to be planned for execution. +**What it does:** Research, plan, and verify in a loop until plans pass. +Each plan is small enough to execute in a fresh context window. +**Output:** Phase plan files + +### gsd-execute-phase [N] +**When:** Phase is planned, ready to build. +**What it does:** Executes plans in parallel waves. Each executor gets fresh context. +Each task gets its own atomic commit. +**Output:** Implemented code with clean git history + +### gsd-phase +**When:** Need to manage phase state (advance, check status). +**What it does:** Phase lifecycle management. + +## Context Artifacts (what GSD maintains) + +| File | Purpose | Created by | +|------|---------|-----------| +| PROJECT.md | What the project is (vision, goals) | gsd-new-project | +| REQUIREMENTS.md | Scope (what to build, what not to) | gsd-new-project | +| ROADMAP.md | Where you are going (phased plan) | gsd-new-project | +| STATE.md | Current position, active decisions | Updated continuously | +| CONTEXT.md | Per-phase implementation decisions | gsd-discuss-phase | + +## Integration with Other Layers + +After context is anchored: +- **If requirements are clear:** Route to execution layer (Superpowers) +- **If approach needs validation:** Route to decision layer (gstack reviews) +- **If both:** Decision first (validate approach), then execution + +## After Choosing + +Invoke the chosen GSD skill. Let it run its own flow. GSD skills are +self-contained and will guide the conversation from here. diff --git a/skills/skill-conductor-decision/SKILL.md b/skills/skill-conductor-decision/SKILL.md new file mode 100644 index 0000000..e51f674 --- /dev/null +++ b/skills/skill-conductor-decision/SKILL.md @@ -0,0 +1,81 @@ +--- +name: skill-conductor-decision +description: Decision layer guidance for the skill conductor. Helps choose the right gstack decision skill based on what kind of thinking is needed. +--- + +# Decision Layer: Choosing the Right Thinking Tool + +You were routed here because the user needs to DECIDE something before building. +Your job: pick the right decision skill and invoke it. + +## Decision Tree + +``` +Is this a brand new idea or feature? + YES --> Is it a startup/product idea? + YES --> invoke office-hours + NO --> invoke brainstorming + NO --> Is there an existing plan/design doc to review? + YES --> What kind of review? + Scope/strategy --> invoke plan-ceo-review + Architecture/code --> invoke plan-eng-review + UI/UX/visual --> invoke plan-design-review + Security --> invoke cso + All of the above --> invoke autoplan + NO --> Is the user unsure what to build? + YES --> invoke office-hours + NO --> invoke brainstorming +``` + +## Skill Descriptions + +### office-hours +**When:** New ideas, unclear requirements, need to stress-test assumptions. +**What it does:** YC-style questioning (6 forcing questions for startups, generative +questions for builders). Produces a design doc with premises, approaches, and +recommended path. +**Token cost:** High (~2000+ tokens loaded, multi-turn conversation) +**Output:** Design doc in ~/.gstack/projects/ + +### brainstorming (Superpowers) +**When:** Lighter ideation, refining an existing concept, exploring options. +**What it does:** Explores intent, proposes approaches, presents design for approval. +**Token cost:** Medium (~800 tokens) +**Output:** Design spec in docs/superpowers/specs/ + +### plan-ceo-review +**When:** Existing plan needs scope/strategy validation. "Is this ambitious enough?" +**What it does:** Challenges premises, proposes scope expansion or reduction, +finds the 10-star product version. +**Token cost:** High (~1500 tokens) +**Output:** Review log, plan file updates + +### plan-eng-review +**When:** Existing plan needs architecture, test coverage, performance review. +**What it does:** Reviews architecture, code quality, test gaps, performance. +Interactive: one issue at a time with recommendations. +**Token cost:** High (~2000 tokens) +**Output:** Review log, test plan, coverage diagram + +### plan-design-review +**When:** Plan has UI/UX components that need visual/interaction review. +**What it does:** Rates design dimensions, proposes improvements. +**Token cost:** Medium (~1000 tokens) +**Output:** Review log, design scores + +### autoplan +**When:** Want the full review gauntlet without answering 15-30 intermediate questions. +**What it does:** Runs CEO, eng, and design reviews sequentially with auto-decisions. +**Token cost:** Very high (sum of all above) +**Output:** All review logs, unified report + +### cso +**When:** Security-focused review needed (secrets, supply chain, OWASP, STRIDE). +**What it does:** Infrastructure-first security audit with active verification. +**Token cost:** High (~1500 tokens) +**Output:** Security report with findings + +## After Choosing + +Invoke the chosen skill using the Skill tool. The skill will take over from here. +Do not provide additional routing guidance; let the skill run its own flow. diff --git a/skills/skill-conductor-execution/SKILL.md b/skills/skill-conductor-execution/SKILL.md new file mode 100644 index 0000000..fff45b2 --- /dev/null +++ b/skills/skill-conductor-execution/SKILL.md @@ -0,0 +1,110 @@ +--- +name: skill-conductor-execution +description: Execution layer guidance for the skill conductor. Helps choose the right Superpowers execution skill for the current phase of implementation work. +--- + +# Execution Layer: Building with Superpowers + +You were routed here because requirements are clear and it is time to build. +Superpowers provides a disciplined execution loop: plan, implement (TDD), +verify, ship. + +## Decision Tree + +``` +What phase of execution are you in? + PLANNING (need implementation plan) + --> invoke writing-plans + IMPLEMENTING (plan exists, building features) + --> Is TDD appropriate (new behavior, not config/docs)? + YES --> invoke test-driven-development + NO --> invoke executing-plans + --> Are there 2+ independent tasks? + YES --> invoke dispatching-parallel-agents + --> Is it complex multi-step with shared state? + YES --> invoke subagent-driven-development + DEBUGGING (something is broken) + --> invoke systematic-debugging + REVIEWING (code is written, needs review) + --> invoke requesting-code-review (for others to review you) + --> invoke receiving-code-review (responding to review feedback) + VERIFYING (think you are done) + --> invoke verification-before-completion + SHIPPING (verified, ready to merge) + --> invoke finishing-a-development-branch +``` + +## Skill Descriptions + +### writing-plans +**When:** Requirements are clear, need a step-by-step implementation plan. +**What it does:** Creates a detailed plan with phases, dependencies, and +acceptance criteria. Saves to plan.md. +**Follows:** Decision layer (office-hours/brainstorming produced a design) +**Output:** plan.md with numbered steps + +### executing-plans +**When:** Plan exists, time to build step by step. +**What it does:** Executes plan with review checkpoints. Marks steps complete. +**Prerequisite:** plan.md must exist +**Output:** Implemented code, updated plan status + +### test-driven-development +**When:** Building new behavior where tests should drive the design. +**What it does:** RED (write failing test) -> GREEN (make it pass) -> REFACTOR. +Strict cycle enforcement. +**Best for:** New functions, services, APIs, business logic +**Not for:** Config changes, documentation, scaffolding + +### dispatching-parallel-agents +**When:** 2+ independent tasks that can run simultaneously. +**What it does:** Launches multiple agents in parallel, each with a focused task. +Collects results. +**Best for:** Multiple file edits, independent modules, research threads + +### subagent-driven-development +**When:** Complex multi-step work requiring coordination. +**What it does:** Manages a team of subagents with shared context and handoffs. +**Best for:** Large features spanning many files/modules + +### systematic-debugging +**When:** Something is broken and the cause is not obvious. +**What it does:** Four phases: investigate, analyze, hypothesize, implement. +Iron rule: no fixes without root cause. +**Best for:** Intermittent bugs, mysterious failures, regression hunting + +### requesting-code-review +**When:** Code is written, want feedback before merging. +**What it does:** Prepares a structured review request with context. + +### receiving-code-review +**When:** Review feedback received, need to address it. +**What it does:** Guides systematic response to each review comment. + +### verification-before-completion +**When:** Implementation seems done, need to confirm. +**What it does:** Checks that all acceptance criteria are met, tests pass, +no regressions introduced. +**Output:** Verification report + +### finishing-a-development-branch +**When:** Verified, ready to merge/ship. +**What it does:** Guides PR creation, merge strategy, cleanup. +**Output:** Merged branch, cleaned up + +## Choosing Between Similar Skills + +| Situation | Choose | +|-----------|--------| +| Simple sequential steps | executing-plans | +| New behavior needs tests | test-driven-development | +| Many independent pieces | dispatching-parallel-agents | +| Complex coordinated work | subagent-driven-development | +| Bug fix | systematic-debugging | +| "Am I done?" | verification-before-completion | +| "Ship it" | finishing-a-development-branch | + +## After Choosing + +Invoke the chosen skill. Let it run its own flow. Each Superpowers skill is +self-contained with its own process and checkpoints. diff --git a/skills/skill-conductor/SKILL.md b/skills/skill-conductor/SKILL.md new file mode 100644 index 0000000..8be30dd --- /dev/null +++ b/skills/skill-conductor/SKILL.md @@ -0,0 +1,128 @@ +--- +name: skill-conductor +description: Three-layer workflow orchestrator. Routes tasks to the right framework (gstack for decisions, GSD for context, Superpowers for execution) based on signal detection. Invoke before any multi-step task. +--- + +# Skill Conductor + +You are a workflow router. Your job is to detect what phase of work the user is in +and delegate to the appropriate layer sub-skill. You do NOT do the work yourself; +you route to the skill that does. + +**This skill supersedes `using-superpowers`.** You absorb its "check if a skill +applies" responsibility. Do not also invoke using-superpowers. + +## When to Skip (do NOT route) + +- Single-file edits, quick lookups, one-line fixes: just do them directly. +- User explicitly names a skill ("run /office-hours", "use code-audit"): invoke + that skill directly, bypass the conductor. +- You were dispatched as a subagent: skip this skill entirely. + +## Signal Detection + +Read the user's message and check the environment. Match against these signals +in priority order: + +### Priority 1: Context Layer (no foundation exists) + +Route to `skill-conductor-context` if ANY of these are true: + +- No PROJECT.md or REQUIREMENTS.md in the repo root +- User says "spec", "requirements", "scope", "context", "plan the project" +- GSD state files exist but are stale (STATE.md not modified in 7+ days) +- User is starting a brand new project from scratch + +### Priority 2: Decision Layer (idea is unclear or needs validation) + +Route to `skill-conductor-decision` if ANY of these are true: + +- User says "idea", "what if", "should I", "brainstorm", "review this approach" +- User says "is this right", "audit", "security review", "design review" +- The request is ambiguous (multiple valid interpretations exist) +- User is questioning scope, direction, or architecture + +### Priority 3: Execution Layer (requirements are clear, build it) + +Route to `skill-conductor-execution` if ANY of these are true: + +- User says "build", "implement", "code", "fix", "ship", "deploy", "test" +- A plan.md, spec, or design doc already exists for this work +- User says "merge", "PR", "commit", "finish" +- Default: if no other layer matches, assume execution + +## Conflict Resolution + +When multiple layers match: + +1. Context wins if no artifacts exist (you cannot decide or execute without context) +2. Decision wins if the request is ambiguous (better to clarify than build wrong) +3. Execution wins if a plan/spec already exists (do not re-decide what is decided) +4. If genuinely ambiguous after these rules: ask the user one question: + "Are you exploring an idea, anchoring context, or ready to build?" + +## Anti-Recursion + +If you were invoked BY a sub-skill or by another routing skill, do NOT re-invoke +the caller. Complete your routing decision and stop. + +## Fallback Behavior + +- If a referenced skill is not installed: skip it, suggest the next-best + alternative from the same layer. +- If no signals match: default to execution layer. +- User explicit override always wins (they name a skill directly). + +## Skill Registry + +### Decision Layer (invoke `skill-conductor-decision` for guidance) + +| Skill | Purpose | +|-------|---------| +| office-hours | New ideas, requirements gathering, premise challenge | +| plan-ceo-review | Scope and strategy validation | +| plan-eng-review | Architecture, tests, performance review | +| plan-design-review | UI/UX review | +| autoplan | Full review pipeline (all above, automated) | +| brainstorming | Quick ideation (lighter than office-hours) | +| cso | Security-focused review | + +### Context Layer (invoke `skill-conductor-context` for guidance) + +| Skill | Purpose | +|-------|---------| +| gsd-new-project | Initialize context artifacts (PROJECT.md, REQUIREMENTS.md, ROADMAP.md) | +| gsd-discuss-phase | Capture implementation decisions before planning | +| gsd-plan-phase | Research and plan a specific phase | +| gsd-phase | Phase management | +| gsd-execute-phase | Execute plans in parallel waves | + +### Execution Layer (invoke `skill-conductor-execution` for guidance) + +| Skill | Purpose | +|-------|---------| +| writing-plans | Create detailed implementation plan | +| executing-plans | Execute plan with review checkpoints | +| test-driven-development | TDD cycle (red-green-refactor) | +| verification-before-completion | Verify before declaring done | +| dispatching-parallel-agents | Parallel independent tasks | +| subagent-driven-development | Complex multi-agent work | +| systematic-debugging | Root cause investigation | +| finishing-a-development-branch | Merge/cleanup/PR | + +### Custom Skills (layer-independent, invoke directly) + +| Skill | Purpose | +|-------|---------| +| code-audit | Full repo audit with multiple tools and models | +| hunk-reviewer | Hunk-by-hunk code review with subagent dispatch | +| incident-response | PagerDuty incident handling | +| devops-rollout-plan | Deployment planning with rollback procedures | +| conventional-commit | Structured commit message generation | + +## After Routing + +Once you determine the layer: +1. State which layer you detected and why (one sentence) +2. Invoke the appropriate sub-skill (`skill-conductor-decision`, `skill-conductor-context`, or `skill-conductor-execution`) +3. Follow that sub-skill's instructions From 01d84e05e7d33fc8bcc5b354cf3b0297c95c105d Mon Sep 17 00:00:00 2001 From: Alice Thomas <2721182+AXington@users.noreply.github.com> Date: Thu, 21 May 2026 13:37:44 -0400 Subject: [PATCH 2/2] fix(copilot-skills): upgrade GSD to full profile and add tests Eng review findings: - Switch GSD install from --profile=core to --profile=full to include gsd-map-codebase (referenced in conductor context sub-skill) - Add gsd-map-codebase to conductor registry for completeness - Add 5 bats tests covering GSD install paths and registry drift verify Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sections/copilot_skills.sh | 16 ++++----- skills/skill-conductor/SKILL.md | 1 + tests/section-behavior.bats | 60 +++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 8 deletions(-) diff --git a/sections/copilot_skills.sh b/sections/copilot_skills.sh index 8c05454..2c891ca 100644 --- a/sections/copilot_skills.sh +++ b/sections/copilot_skills.sh @@ -92,22 +92,22 @@ section_copilot_skills() { _copilot_skills_install_gsd() { if [[ -f "${HOME}/.copilot/skills/gsd-new-project/SKILL.md" ]]; then - ok "GSD core skills already installed (Copilot)" + ok "GSD skills already installed (Copilot)" else if command_exists npx; then - run npx get-shit-done-cc@latest --copilot --global --profile=core - ok "Installed GSD core skills (Copilot)" + run npx get-shit-done-cc@latest --copilot --global --profile=full + ok "Installed GSD skills (Copilot)" else warn "npx not found; skipping GSD installation. Install Node.js first." fi fi if [[ -f "${HOME}/.claude/skills/gsd-new-project/SKILL.md" ]]; then - ok "GSD core skills already installed (Claude Code)" + ok "GSD skills already installed (Claude Code)" else if command_exists npx; then - run npx get-shit-done-cc@latest --claude --global --profile=core - ok "Installed GSD core skills (Claude Code)" + run npx get-shit-done-cc@latest --claude --global --profile=full + ok "Installed GSD skills (Claude Code)" else warn "npx not found; skipping GSD installation for Claude Code." fi @@ -157,11 +157,11 @@ verify_copilot_skills() { fi # Verify GSD core skills are installed - local gsd_core_skills=(gsd-new-project gsd-plan-phase gsd-discuss-phase gsd-execute-phase) + local gsd_core_skills=(gsd-new-project gsd-plan-phase gsd-discuss-phase gsd-execute-phase gsd-map-codebase) for skill in "${gsd_core_skills[@]}"; do [[ -f "${skills_dir}/${skill}/SKILL.md" ]] \ && pass "GSD skill installed: ${skill}" \ - || fail "GSD skill missing: ${skill} (run: npx get-shit-done-cc@latest --copilot --global --profile=core)" + || fail "GSD skill missing: ${skill} (run: npx get-shit-done-cc@latest --copilot --global --profile=full)" done # Verify conductor registry is not stale (warn if installed skills exist outside registry) diff --git a/skills/skill-conductor/SKILL.md b/skills/skill-conductor/SKILL.md index 8be30dd..27b38c8 100644 --- a/skills/skill-conductor/SKILL.md +++ b/skills/skill-conductor/SKILL.md @@ -92,6 +92,7 @@ the caller. Complete your routing decision and stop. | Skill | Purpose | |-------|---------| | gsd-new-project | Initialize context artifacts (PROJECT.md, REQUIREMENTS.md, ROADMAP.md) | +| gsd-map-codebase | Discover and document existing code before project setup | | gsd-discuss-phase | Capture implementation decisions before planning | | gsd-plan-phase | Research and plan a specific phase | | gsd-phase | Phase management | diff --git a/tests/section-behavior.bats b/tests/section-behavior.bats index 25da597..8a6372f 100644 --- a/tests/section-behavior.bats +++ b/tests/section-behavior.bats @@ -104,3 +104,63 @@ setup() { [[ "$status" -eq 0 ]] } + +# -- copilot_skills section tests -- + +@test "copilot_skills: GSD helper exists and is callable" { + source "$SCRIPT_DIR/sections/copilot_skills.sh" + declare -A SKILLS_PROFILE=([work]=false [home]=false) + + declare -F _copilot_skills_install_gsd >/dev/null +} + +@test "copilot_skills: GSD install skips when npx not found" { + source "$SCRIPT_DIR/sections/copilot_skills.sh" + declare -A SKILLS_PROFILE=([work]=false [home]=false) + + run _copilot_skills_install_gsd + + [[ "$status" -eq 0 ]] + [[ "$output" == *"npx not found"* ]] +} + +@test "copilot_skills: GSD install skips when already installed" { + mkdir -p "$HOME/.copilot/skills/gsd-new-project" + echo "---" > "$HOME/.copilot/skills/gsd-new-project/SKILL.md" + mkdir -p "$HOME/.claude/skills/gsd-new-project" + echo "---" > "$HOME/.claude/skills/gsd-new-project/SKILL.md" + + source "$SCRIPT_DIR/sections/copilot_skills.sh" + declare -A SKILLS_PROFILE=([work]=false [home]=false) + + run _copilot_skills_install_gsd + + [[ "$status" -eq 0 ]] + [[ "$output" == *"already installed"* ]] + [[ "$output" != *"npx not found"* ]] +} + +@test "copilot_skills: verify detects missing GSD skills" { + mkdir -p "$HOME/.copilot/skills" + + source "$SCRIPT_DIR/sections/copilot_skills.sh" + declare -A SKILLS_PROFILE=([work]=false [home]=false) + + run verify_copilot_skills + + [[ "$output" == *"GSD skill missing"* ]] +} + +@test "copilot_skills: verify registry drift warns on unregistered gstack skill" { + mkdir -p "$HOME/.copilot/skills/skill-conductor" + cp "$SCRIPT_DIR/skills/skill-conductor/SKILL.md" "$HOME/.copilot/skills/skill-conductor/" + mkdir -p "$HOME/.copilot/skills/gstack-fake-nonexistent-skill" + echo "---" > "$HOME/.copilot/skills/gstack-fake-nonexistent-skill/SKILL.md" + + source "$SCRIPT_DIR/sections/copilot_skills.sh" + declare -A SKILLS_PROFILE=([work]=false [home]=false) + + run verify_copilot_skills + + [[ "$output" == *"Unregistered skill in conductor"* ]] +}