Skip to content

Commit d7b142b

Browse files
committed
feat: Add a new prompt for system design overview
1 parent c02f5ca commit d7b142b

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

server/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ def main() -> None:
6666
from server.tools.admin import register_admin_tools
6767
from server.tools.history import register_history_tools
6868
from server.prompts.service import register_service_prompts
69+
from server.prompts.system import register_system_prompts
6970
from server.routes.reindex import register_http_routes
7071

7172
register_search_tools(mcp)
7273
register_index_tools(mcp)
7374
register_admin_tools(mcp)
7475
register_history_tools(mcp)
7576
register_service_prompts(mcp)
77+
register_system_prompts(mcp)
7678
register_http_routes(mcp)
7779

7880
mcp.run(transport=settings.mcp_transport)

server/prompts/system.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
from __future__ import annotations
2+
3+
from mcp.server.fastmcp import FastMCP
4+
5+
6+
def register_system_prompts(mcp: FastMCP) -> None:
7+
@mcp.prompt(
8+
name="system_design_overview",
9+
description="Produce a complete architectural overview of the whole system: service inventory,"
10+
" communication topology, shared data stores, and cross-cutting concerns.",
11+
)
12+
def system_design_overview() -> str:
13+
"""Complete system design overview across all indexed services."""
14+
return (
15+
"Produce a complete system design overview using the semcode MCP tools. "
16+
"Work through these steps:\n"
17+
"\n"
18+
"1. **Discover the service inventory.** Call `list_indexed_services` to get "
19+
"the full list. If nothing is indexed, stop and tell the user.\n"
20+
"\n"
21+
"2. **Profile each service.** For every service, invoke the `service_overview` "
22+
"prompt — it will identify entry points, domain types, and framework "
23+
"conventions for that service. Collect those summaries before proceeding.\n"
24+
"\n"
25+
"3. **Map inter-service communication.** Search across all services for "
26+
"outbound call patterns using queries like: "
27+
'`"http client"`, `"feign client"`, `"rest template"`, '
28+
'`"grpc stub"`, `"kafka producer"`, `"message publisher"`, '
29+
'`"event emitter"`, `"amqp"`. '
30+
"Build a dependency list noting which services are callers and which are "
31+
"called, and whether communication is synchronous or asynchronous.\n"
32+
"\n"
33+
"4. **Identify shared infrastructure.** Search for terms like "
34+
'`"datasource"`, `"redis"`, `"kafka"`, `"rabbitmq"`, `"s3"`, '
35+
'`"mongo"`, `"postgres"`, `"elasticsearch"` to surface data stores, '
36+
"caches, and message brokers. Note which services own vs. share each resource.\n"
37+
"\n"
38+
"5. **Find cross-cutting concerns.** Search for `\"authentication\"`, `\"jwt\"`, "
39+
'`"oauth"`, `"tracing"`, `"opentelemetry"`, `"metrics"`, '
40+
'`"circuit breaker"`, `"retry"`, `"rate limit"` to understand '
41+
"system-wide conventions.\n"
42+
"\n"
43+
"Then write the overview with these sections:\n"
44+
"\n"
45+
"- **System Purpose** — 2-3 sentences on what problem this collection of "
46+
"services solves as a whole.\n"
47+
"- **Service Inventory** — a table: Service | Purpose | Tech Stack | Entry Style.\n"
48+
"- **Communication Topology** — synchronous (REST/gRPC) vs asynchronous "
49+
"(events/queues) interactions. Include a dependency list: "
50+
"`ServiceA → ServiceB (REST)`, `ServiceC → broker → ServiceD (async)`, etc.\n"
51+
"- **Data Architecture** — data stores, caches, and message brokers with "
52+
"ownership notes (owned by one service vs. shared).\n"
53+
"- **Cross-cutting Concerns** — how authentication, observability (tracing, "
54+
"metrics, logging), and resilience (retries, circuit breakers) are handled "
55+
"across the system.\n"
56+
"- **Key Architectural Patterns** — flag patterns you have evidence for: "
57+
"event-driven, CQRS, saga, API gateway, BFF, strangler fig, etc.\n"
58+
"\n"
59+
"Skip any section you have no evidence for. Do not invent details."
60+
)

0 commit comments

Comments
 (0)