Skip to content

Repository blueprint suggestions — Reference

Terse reference for the API that powers the Suggested tab in Create project from GitHub.

Route

Method & pathBodyReturnsNotes
POST /api/blueprints/suggestSuggestBlueprintRequestSuggestBlueprintResponseAuthenticated endpoint. Recommends a catalog blueprint by analyzing a GitHub repository.

Source: apps/Agentweaver.Api/Endpoints/BlueprintEndpoints.cs:53.

Request DTO

SuggestBlueprintRequest is defined in apps/Agentweaver.Api/Blueprints/BlueprintDtos.cs:111.

FieldTypeRequiredMeaning
repositorystringyesGitHub repository as owner/repo, a GitHub URL, or a value ending in .git. Blank values return 400.

Response DTO

SuggestBlueprintResponse is defined in apps/Agentweaver.Api/Blueprints/BlueprintDtos.cs:116; the web type mirrors it at apps/web/src/api/types.ts:219.

FieldTypeMeaning
recommended_blueprintBlueprintDto | nullThe catalog blueprint to use. On fallback, this is the first catalog blueprint when one exists.
rationalestring | nullHuman-readable reason for the recommendation or fallback.
confidencenumberHeuristic confidence from 0 to 1. Fallback responses use 0.
signalsstring[]Displayable evidence: description, topics, languages, root files, and issues-enabled when present.
fallbackbooleantrue when repository analysis was unavailable or invalid and the UI should fall back to Templates.

The embedded BlueprintDto includes id, name, description, roster, workflow, workflows, review_policy, sandbox_profile, and optional bespoke_roles (BlueprintDtos.cs:11).

Status codes

CodeWhen
200 OKSuggestion returned, including graceful fallback responses.
400 Bad Requestrepository is blank (BlueprintEndpoints.cs:59).
401 UnauthorizedCaller is not authenticated by the API auth middleware.

GitHub 404, rate-limit failures, network failures, or timeouts do not surface as endpoint errors; the service logs and returns fallback: true (GitHubRepoBlueprintSuggestionService.cs:85).

Signals used

GitHubRepoBlueprintSuggestionService reads three GitHub REST resources with the caller's GitHub token scope (GitHubRepoBlueprintSuggestionService.cs:48, :51, :58, :62):

GitHub signalHow it is used
Repository metadataname, description, topics, and has_issues feed both display signals and mapping text.
LanguagesTop languages are displayed and any non-Markdown language marks the repo as code.
Root contentsUp to eight root file names are displayed and included in mapping text.

Mapping rules

Signal matchRecommended blueprint idConfidence
agent, llm, copilot, prompt, rag, ai-, openai, semantic-kernel, or langchainblueprint-ai-agent-engineering0.86
docs, documentation, blog, content, book, site, or website, and no code languagesblueprint-content-authoring0.78
prd, roadmap, product, prototype, ux, or design, and no code languagesblueprint-product-management0.74
frontend, backend, api, service, app, kubernetes, terraform, docker, or any non-Markdown languageblueprint-software-development0.82
Anything elseblueprint-software-development0.58 with signals, 0.35 without signals

Source: GitHubRepoBlueprintSuggestionService.cs:149.

Fallback

Fallback returns:

json
{
  "recommended_blueprint": { "id": "..." },
  "rationale": "Repository analysis was unavailable; choose a template instead.",
  "confidence": 0,
  "signals": [],
  "fallback": true
}

The selected fallback blueprint is the first predefined catalog entry when available (GitHubRepoBlueprintSuggestionService.cs:93). The UI treats fallback: true, a missing recommendation, or a client error the same way: show a warning and offer View all templates →, which switches to the shared Templates tab (apps/web/src/components/BlueprintPicker.tsx:323, :371).

The suggestion route is unchanged, but the GitHub project picker that feeds it uses these existing endpoints:

Method & pathReturnsNotes
GET /api/github/accountsGitHubAccountResponse[]Returns the authenticated user first with type: "user", then organizations. The web UI renders user accounts as @{login} with a You badge.
GET /api/github/repos?account={login}GitHubRepoResponse[]For the signed-in user's own login or omitted account, calls GitHub /user/repos?affiliation=owner; for org accounts, calls /orgs/{org}/repos?type=all.

Sources: apps/Agentweaver.Api/Endpoints/AuthEndpoints.cs:207, :249, :295, :333; apps/web/src/api/client.ts:263.

See also