Skip to content

/index command is structurally shallow for all non-JS/TS ecosystems #32

@robertmclaws

Description

@robertmclaws

Problem

The /index command hardcodes ecosystem-specific hints (file names, entry points, config files) directly into the prompt body. This creates a tiered experience where some ecosystems get reasonable coverage and most get none:

Ecosystem Phase 1 (Discovery) Phase 2 (Architecture) Phase 3 (Conventions) Phase 4 (Key Files)
JS/TS package.json, tsconfig index.ts, App.tsx, API routes Import patterns Auth, DB, API clients
Rust Cargo.toml mentioned No entry points No guidance No guidance
Python pyproject.toml mentioned main.py mentioned No guidance No guidance
Go go.mod mentioned No entry points No guidance No guidance
C#/.NET Not mentioned Not mentioned Not mentioned Not mentioned
Java Not mentioned Not mentioned Not mentioned Not mentioned
Ruby Not mentioned Not mentioned Not mentioned Not mentioned
PHP Not mentioned Not mentioned Not mentioned Not mentioned

Even for the ecosystems that are partially mentioned, the guidance drops off after Phase 1. Rust, Python, and Go get a manifest file name in the discovery phase and nothing else — no entry points, no architectural patterns, no convention hints.

Concrete example: .NET/C#

A .NET repo indexed with the current command would produce a shallow, generic result because the agent wouldn't know to look for:

  • Discovery: *.sln, *.csproj, Directory.Build.props, Directory.Packages.props, global.json, nuget.config, appsettings.json, launchSettings.json
  • Architecture: Program.cs, Startup.cs, Host.CreateDefaultBuilder patterns, Controllers vs Minimal API endpoints, DbContext classes, IServiceCollection DI registrations, middleware pipelines
  • Conventions: Namespace-per-folder patterns, src//tests/ split, IOptions<T> configuration, attribute-based routing
  • Key files: ServiceCollectionExtensions, middleware classes, AutoMapper profiles, MediatR handlers, EF Core migrations

This same gap exists for Java (no pom.xml, build.gradle, Application.java, Spring annotations), Ruby (no Gemfile, config/routes.rb, Rails conventions), and every other ecosystem not explicitly listed.

Root cause

The problem is structural, not just a missing entry. Adding more file names to the existing flat list would help marginally but:

  1. The prompt would bloat with every new ecosystem
  2. Phases 2-4 would still lack ecosystem-specific architectural guidance
  3. Maintenance burden grows linearly with each language added

Recommended Solution

Restructure the single /index command with a two-phase approach:

  1. Phase 0 (new): Auto-detect the ecosystem — Glob for manifest files (*.sln, *.csproj, package.json, Cargo.toml, go.mod, pyproject.toml, Gemfile, pom.xml, build.gradle, etc.) and determine the primary stack before beginning the deep dive

  2. Phases 1-4: Ecosystem-aware guidance via reference table — Replace the hardcoded file names with a lookup table that gives the agent specific guidance for whichever ecosystem it detected:

Ecosystem Manifest Entry Points Config Key Patterns to Find
.NET/C# *.sln, *.csproj, Directory.Build.props Program.cs, Startup.cs appsettings.json, launchSettings.json DI registrations, middleware pipeline, DbContext, Controllers/MinimalAPI
JS/TS package.json index.ts, App.tsx, main.ts tsconfig.json, .eslintrc Module system, imports, component patterns
Python pyproject.toml, setup.py main.py, app.py, __main__.py pyproject.toml, .env Decorators, __init__.py, framework patterns
Rust Cargo.toml main.rs, lib.rs Cargo.toml mod.rs, traits, derive macros
Go go.mod main.go, cmd/ go.mod Interfaces, packages, error handling patterns
Java pom.xml, build.gradle Application.java, Main.java application.properties/yml Annotations, Spring beans, dependency injection
Ruby Gemfile config.ru, app/ config/ Rails conventions, gems, middleware

This keeps UX simple (one command, no arguments needed), avoids prompt bloat, and gives the agent enough context to do a thorough job for any ecosystem.

Affected File

plugin/commands/index.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions