Skip to content

feat(extension): add orchestrator extension for intelligent agent rou…#2236

Open
pragya247 wants to merge 2 commits intogithub:mainfrom
pragya247:feature/orchestrator-extension
Open

feat(extension): add orchestrator extension for intelligent agent rou…#2236
pragya247 wants to merge 2 commits intogithub:mainfrom
pragya247:feature/orchestrator-extension

Conversation

@pragya247
Copy link
Copy Markdown
Contributor

Description

Adds a new Spec Kit extension — Intelligent Agent Orchestrator — that provides cross-catalog agent discovery
and intelligent prompt-to-command routing.

Problem

Spec Kit has robust discovery (extension/preset/workflow catalogs) and dispatch (workflow engine with 10 step
types), but no intelligent matching layer that connects a user's natural-language intent to the right command.
Users need to already know what exists and where it lives.

Solution

Three new extension commands that implement a discover → index → match → route pipeline:

Command What it does
speckit.orchestrator.index Aggregates capabilities from core commands, installed extensions, workflows, and
presets into a unified JSON index
speckit.orchestrator.route Scores a user prompt against the index using keyword + description matching,
returns ranked results
speckit.orchestrator.discover Scans linked repositories for agent files (.agent.md, SKILL.md,
extension.yml, etc.) and merges into the index

Design Decisions

  • Zero core changes — self-contained extension following existing patterns
  • Deterministic matching — keyword-based scoring, no external AI API calls needed
  • after_init hook — auto-indexes capabilities on project initialization
  • Cross-repo scanning — configurable via linked_repos in orchestrator-config.yml
  • Designed as Phase 1 toward a potential native route workflow step type (per discussion in Workflow Engine with Catalog System #2142)

Files

extensions/orchestrator/ ├── extension.yml # Manifest ├── README.md # Usage docs ├── config-template.yml # Matching
strategy & scan settings └── commands/ ├── speckit.orchestrator.route.md # Prompt → command matching ├──
speckit.orchestrator.index.md # Capability indexer └── speckit.orchestrator.discover.md # Cross-repo agent scanner

Ref: #2142

Testing

  • Reviewed extension manifest against extensions/template/extension.yml and extensions/git/extension.yml
    for structural correctness
  • Verified command naming follows speckit.{extension-id}.{command-name} pattern
  • Validated extension.yml schema fields (schema_version, requires, provides, hooks, tags)
  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

Note: This is an extension scaffold (command markdown + manifest). Runtime behavior depends on AI agent
interpretation of the command files. Integration testing would require installing the extension via specify extension add orchestrator and invoking commands through a configured agent.

AI Disclosure

  • I did use AI assistance (describe below)

GitHub Copilot CLI (Claude) was used to:

  • Explore the spec-kit codebase to understand extension architecture, catalog system, and workflow engine
  • Scaffold the extension files (extension.yml, command markdown files, config template, README)
  • Draft the PR description

All design decisions (routing algorithm, phased approach, integration points) were authored by me based on my
existing Agent Orchestrator implementations (Agency plugin + VS Code extension). I reviewed and understand all
generated content.

Copilot AI review requested due to automatic review settings April 16, 2026 04:19
@pragya247 pragya247 requested a review from mnriem as a code owner April 16, 2026 04:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new built-in Spec Kit extension (“Intelligent Agent Orchestrator”) that scaffolds a discover → index → match → route workflow via extension manifest, config template, and command markdown instructions.

Changes:

  • Introduces the orchestrator extension manifest with commands + hook + default config.
  • Adds a config template for routing/discovery behavior.
  • Adds three new command markdown files (index, route, discover) plus extension README documentation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
extensions/orchestrator/extension.yml Defines the extension (commands, config template, hooks, tags, defaults).
extensions/orchestrator/config-template.yml Provides user-editable routing + discovery configuration template.
extensions/orchestrator/commands/speckit.orchestrator.route.md Documents prompt-to-command routing behavior and expected output.
extensions/orchestrator/commands/speckit.orchestrator.index.md Documents building a unified capability index across sources.
extensions/orchestrator/commands/speckit.orchestrator.discover.md Documents cross-repo scanning for agent/capability sources.
extensions/orchestrator/README.md User-facing overview, install steps, configuration, and roadmap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread extensions/orchestrator/extension.yml Outdated
Comment thread extensions/orchestrator/extension.yml Outdated
Comment thread extensions/orchestrator/commands/speckit.orchestrator.route.md Outdated
Comment thread extensions/orchestrator/commands/speckit.orchestrator.index.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new orchestrator Spec Kit extension scaffold intended to provide cross-catalog capability indexing, prompt-to-command routing, and cross-repo agent discovery via new extension commands.

Changes:

  • Adds extensions/orchestrator/extension.yml manifest with three new speckit.orchestrator.* commands and a proposed init-time hook.
  • Adds orchestrator configuration template (config-template.yml) and user-facing docs (README.md).
  • Adds three command instruction markdown files implementing the discover → index → route workflow as agent-executable specs.
Show a summary per file
File Description
extensions/orchestrator/extension.yml Declares the new extension, its commands, config file, hook, tags, and default settings.
extensions/orchestrator/config-template.yml Provides a user-editable config template for routing strategy and cross-repo scanning settings.
extensions/orchestrator/commands/speckit.orchestrator.route.md Defines the agent instructions for scoring and routing user prompts to commands/workflows.
extensions/orchestrator/commands/speckit.orchestrator.index.md Defines the agent instructions for building a unified JSON capability index.
extensions/orchestrator/commands/speckit.orchestrator.discover.md Defines the agent instructions for scanning linked repos/submodules for agent/capability files.
extensions/orchestrator/README.md Documents the extension’s purpose, usage, commands, and configuration.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (2)

extensions/orchestrator/extension.yml:61

  • The manifest schema/documentation uses a top-level defaults: key for default configuration values, not config: { defaults: ... }. As written, these defaults are likely to be ignored/misread by tooling and are inconsistent with extensions/template/extension.yml and extensions/EXTENSION-API-REFERENCE.md. Move these values under a top-level defaults: key.
config:
  defaults:
    matching_strategy: "keyword"
    confidence_threshold: 0.5
    cross_repo_scan: true
    scan_patterns:
      - ".agent.md"
      - "SKILL.md"
      - "AGENTS.md"
      - "extension.yml"
      - "workflow.yml"
      - "preset.yml"

extensions/orchestrator/commands/speckit.orchestrator.route.md:71

  • This command describes a fixed weighted scoring algorithm, but the extension config exposes matching_strategy: "keyword" | "weighted". As written, the config setting has no effect and the docs are internally inconsistent. Update the routing steps so keyword uses only keyword matching (or document that weights are always applied) and ensure the implementation reads matching_strategy.
## Step 2: Score Each Capability Against the Prompt

For each capability in the index, compute a relevance score:

1. **Keyword match** (weight: 0.4) — Count how many of the capability's keywords appear in the user prompt
2. **Description match** (weight: 0.3) — Check if words from the user prompt appear in the capability description
3. **Name match** (weight: 0.2) — Check if the capability name is mentioned or closely related
4. **Type bonus** (weight: 0.1) — Prefer workflows > extension commands > core commands for complex prompts; prefer core commands for simple ones

  • Files reviewed: 6/6 changed files
  • Comments generated: 3

Comment thread extensions/orchestrator/README.md Outdated
Comment thread extensions/orchestrator/config-template.yml Outdated
Comment thread extensions/orchestrator/commands/speckit.orchestrator.route.md Outdated
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented Apr 16, 2026

Please create it as a community extension as per https://github.com/github/spec-kit/tree/main/extensions

- Extension ID: orchestrator
- Version: 0.1.0
- Author: pragya247
- Description: Cross-catalog agent discovery and intelligent prompt-to-command routing
- Repository: https://github.com/pragya247/spec-kit-orchestrator

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pragya247 pragya247 force-pushed the feature/orchestrator-extension branch from 8c289b1 to 19ce6a7 Compare April 20, 2026 06:27
@mnriem mnriem requested a review from Copilot April 20, 2026 14:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread extensions/catalog.community.json Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 15:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants