Skip to content

[Bug]: agent-context extension ignores scoped/nested spec directories (SPECIFY_FEATURE_DIRECTORY), so plan auto-discovery finds nothing #3024

@athemelis

Description

@athemelis

Bug Description

The agent-context extension's plan auto-discovery uses a one-level glob (specs/*/plan.md). Repos that organize specs in nested/scoped directories via SPECIFY_FEATURE_DIRECTORY (e.g. specs///plan.md) never match, so the SPECKIT block is refreshed without a plan path even when a plan exists. The command doc states the one-level assumption.

Steps to Reproduce

  1. Set SPECIFY_FEATURE_DIRECTORY=specs// and run speckit.specify / speckit.plan so a plan lands at specs///plan.md.
  2. Let the agent-context after_specify/after_plan hook fire (or run speckit.agent-context.update directly).
  3. Inspect the updated SPECKIT block.

Expected Behavior

The extension finds the most-recent plan anywhere under specs/ (including nested specs///plan.md) and includes its path.

Actual Behavior

The one-level glob specs/*/plan.md matches nothing in scoped layouts; the block updates with no plan path.

Specify CLI Version

0.11.0

AI Agent

GitHub Copilot

Operating System

macOS Tahoe 26.5.1

Python Version

3.11.15 (uv-managed standalone CPython, cpython-3.11-macos-aarch64-none — uv installs specify under its own Python, not the system CLT 3.9.6 or Homebrew 3.13/3.14)

Error Logs

none (silent; no error raised, plan path simply absent)

Additional Context

Files: .specify/extensions/agent-context/scripts/bash/update-agent-context.sh (glob specs.glob("*/plan.md")), .../powershell/update-agent-context.ps1, .../commands/speckit.agent-context.update.md (docs). Suggested fix: recurse (specs/**/plan.md) and pick the most-recently-modified match. Related to two sibling issues filed alongside (feature.json write side-effect; empty CURRENT_BRANCH).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions