CommunityToolkit / CommunityToolkit/Aspire

Add repository-level code graph support for AI-assisted navigation

Open
#1,575 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
627
Forks
196
Avg merge
2d 11h
Merged PRs (30d)
35

Description

### Related to an existing integration?

No

### Existing integration

N/A

### Overview

`CommunityToolkit/Aspire` contains a growing number of integrations organized across `src/`, `tests/`, `examples/`, documentation, and repository-specific agent guidance.

AI coding assistants can navigate this today with text and code search, but they still need to repeatedly reconstruct relationships between an integration, its hosting extensions, resource types, tests, examples, documentation, and related projects.

I would like to propose adding **repository-level code graph support** so AI coding assistants can query a machine-readable representation of the repository before falling back to broad file searches.

Useful relationships could include:

- integration project → public hosting extension methods / resource types
- project → references → project / package
- implementation → related unit and integration tests
- implementation → related examples and documentation
- type / member → calls / uses / inherits → type / member

This would be repository tooling only and would not need to become a runtime dependency of any CommunityToolkit Aspire integration.

Graphify is one existing implementation that could be evaluated. The proposal is primarily about the **artifact and capability**, not a requirement to adopt this specific tool. The generated representation and tooling should remain replaceable.

The graph could be generated or refreshed in CI and then committed, published as an artifact, exposed through MCP, or generated on demand. That delivery choice could be decided separately.

I tested this approach on another .NET repository. The full source corpus was roughly 193k tokens, while graph-backed retrieval averaged roughly 4.3k tokens of relevant context per query. This is not intended as a formal benchmark, but it made repository exploration noticeably cheaper and more focused for an AI agent.

### Usage example

Before modifying an Aspire hosting integration, an AI coding assistant could query the graph rather than broadly scanning the repository:

```text
User: Update the hosting integration for a resource.

Agent:
1. Query the repository graph for the integration project.
2. Discover its public hosting extension methods and resource types.
3. Retrieve the related tests, examples, and documentation.
4. Load only those files into context.
5. Make the change and run the relevant test subset.
```

Another useful scenario is impact analysis:

```text
Agent: What could be affected if this hosting extension changes?

Graph → hosting extension → resource type → referenced packages
→ integration tests → examples → documentation
```

This could also help human contributors with onboarding and architecture exploration. An interactive visualization could be generated from the same graph, but the main motivation is efficient machine-readable navigation for coding agents.

### Breaking change?

No

### Alternatives

Current alternatives include:

- letting each coding agent repeatedly use text search, file discovery, and symbol search;
- relying on IDE or LSP indexing available only in the local development environment;
- maintaining hand-written architecture documentation;
- allowing every contributor or agent to generate its own local index independently.

Those approaches work, but they duplicate repository-discovery effort and provide no shared, versioned structural representation of the codebase.

Another alternative would be to define a small CommunityToolkit Aspire-specific graph or index format rather than use Graphify. I would prefer evaluating an existing tool first while keeping the generated representation and tooling replaceable.

### Additional context

The repository already includes guidance for AI-assisted development. A repository-level graph could complement that guidance by providing a current structural view of integrations, hosting APIs, tests, examples, documentation, and project dependencies.

The goal is not to make AI-generated changes autonomous or bypass review. It is simply to give tools a cheaper and more deterministic way to answer questions such as **where is this implemented, what is connected to it, and which tests and examples are relevant?**

### Help us help you

Yes, but only if others can assist

Contributor guide

Open the contributing guide

Research direction

Start by reading the repository’s existing AI-assisted development guidance and examining how integrations, tests, examples, documentation, and project references are organized. Evaluate Graphify or another replaceable approach against the proposed relationships and agent-navigation use cases; the issue leaves generation and delivery options open. Done should mean a usable repository-level graph capability is defined and implemented, with its format and delivery approach decided.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.