Inferensys

Prompt

Service Granularity Evaluation Rubric Prompt

A practical prompt playbook for using the Service Granularity Evaluation Rubric Prompt to score proposed service boundaries across cognitive load, data ownership, team size, and change frequency before implementation.
Data scientist reviewing AI evaluation metrics on dashboard, comparison charts visible, casual WeWork analytics setup.
PROMPT PLAYBOOK

When to Use This Prompt

Evaluate whether a proposed service boundary is right-sized before committing to implementation.

This prompt is for engineering leads and architects who need a structured, repeatable way to evaluate a concrete service proposal before writing an Architecture Decision Record or committing engineering resources. The job-to-be-done is risk reduction: catching boundaries that are too fine (nano-services with high coordination tax), too coarse (mini-monoliths that defeat the purpose of extraction), or misaligned with team structures and data ownership. You should have a defined service scope in hand—a specific candidate with a name, a set of responsibilities, a proposed data ownership model, and a known team assignment. This is not a blank-slate decomposition exercise; use the Bounded Context Discovery Prompt or Event Storming Session Synthesis Prompt for earlier-stage boundary exploration.

The prompt produces a scored rubric across multiple dimensions: cognitive load, data autonomy, team alignment, change independence, integration surface area, and operational isolation. Each dimension receives a score and a justification grounded in the evidence you provide. The output includes threshold-based pass/fail criteria (e.g., a service scoring below 3 on data autonomy should not proceed without redesign) and concrete right-sizing recommendations—split, merge, or proceed. Use this during architecture review sessions, before writing service extraction ADRs, or when a team proposes a new service that triggers your spidey sense about granularity risk. The prompt assumes you can describe the proposal in enough detail to populate the [SERVICE_PROPOSAL] placeholder with scope, data, team, and dependency information.

Do not use this prompt when the proposal is still vague, when you are exploring greenfield decomposition from scratch, or when the real question is about team topology rather than service boundaries (use the Service Boundary Team Topology Alignment Prompt for that). Do not use it as a substitute for the Distributed Monolith Risk Detection Prompt if your primary concern is post-hoc smell detection in an existing system. After running this evaluation, the next step is typically to document the decision using the Service Boundary Decision Record Template Prompt, or to proceed to Transaction Boundary Analysis if the service spans business operations that require consistency guarantees. If the rubric returns a borderline score, escalate to a human architecture review session rather than treating the model's recommendation as a final gate.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Service Granularity Evaluation Rubric Prompt works and where it does not. Use these cards to decide if this prompt fits your current architecture review workflow.

01

Good Fit: Pre-Implementation Design Review

Use when: an engineering lead or architect is evaluating a proposed new service before any code is written. Guardrail: the rubric works best with a concrete service specification document, domain event list, or API contract draft as input. Vague ideas produce vague scores.

02

Good Fit: Monolith Decomposition Planning

Use when: a team is planning to extract services from an existing monolith and needs to validate that each candidate boundary is justified. Guardrail: pair this prompt with a dependency graph analysis tool. The rubric scores cognitive load and data ownership, but cannot see runtime coupling without additional context.

03

Bad Fit: Runtime Performance Tuning

Avoid when: the problem is latency, throughput, or resource utilization in an already-deployed system. Guardrail: this rubric evaluates design-time granularity decisions, not production performance. Use observability and profiling prompts for runtime issues.

04

Bad Fit: Team Reorganization Without Architecture Change

Avoid when: the goal is purely organizational restructuring with no change to service boundaries. Guardrail: the rubric scores service boundaries against team topology fit, but it is not a team design tool. Use the Conway's Law Boundary Validation Prompt for team-to-service alignment checks.

05

Required Input: Service Boundary Proposal Document

What to watch: the rubric cannot evaluate a service that has not been described. Guardrail: provide at minimum a service name, responsibility statement, owned data entities, expected API surface, and list of upstream/downstream dependencies. Incomplete inputs produce low-confidence scores with explicit caveats.

06

Operational Risk: Over-Reliance on Automated Scoring

What to watch: teams treating the rubric's numeric scores as objective truth rather than structured discussion starters. Guardrail: every pass/fail threshold should be reviewed by a human architect. The rubric flags risks and provides right-sizing recommendations, but the final boundary decision requires engineering judgment and context the model cannot fully possess.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt with square-bracket placeholders for evaluating service granularity across multiple dimensions.

The prompt below is designed to be pasted directly into your AI system. It evaluates a proposed service boundary against eight dimensions—cognitive load, data ownership, team alignment, change frequency, coupling isolation, transaction consistency, operational independence, and blast radius—and produces a scored rubric with pass/fail thresholds and right-sizing recommendations. Replace every square-bracket placeholder with your specific service proposal details before running the evaluation.

text
You are a service architecture evaluator. Your task is to assess the granularity of a proposed service using a structured rubric. Return only valid JSON matching the output schema.

## SERVICE PROPOSAL
- Service Name: [SERVICE_NAME]
- Description: [SERVICE_DESCRIPTION]
- Owned Data Entities: [OWNED_DATA_ENTITIES]
- Inbound Dependencies: [INBOUND_DEPENDENCIES]
- Outbound Dependencies: [OUTBOUND_DEPENDENCIES]
- Assigned Team Size: [TEAM_SIZE]
- Expected Change Frequency: [CHANGE_FREQUENCY]
- Business Criticality (Low/Medium/High): [BUSINESS_CRITICALITY]
- Transaction Boundaries Crossed: [TRANSACTION_BOUNDARIES_CROSSED]
- Current System Context: [SYSTEM_CONTEXT]

## EVALUATION DIMENSIONS
Score each dimension from 1 (problematic) to 5 (optimal). Provide a one-sentence justification for each score.

1. Cognitive Load: Can a single team understand the service's full responsibility without external context?
2. Data Ownership: Does the service own its data exclusively, with no shared databases or tables?
3. Team Alignment: Does the service map cleanly to one team with clear ownership boundaries?
4. Change Frequency Isolation: Can this service be deployed independently when its requirements change?
5. Coupling Isolation: Are inbound and outbound dependencies minimal, asynchronous, and versioned?
6. Transaction Consistency: Are atomic transaction boundaries contained within this service?
7. Operational Independence: Can this service be deployed, scaled, and monitored independently?
8. Blast Radius Containment: Does a failure in this service have a bounded, predictable impact?

## OUTPUT SCHEMA
{
  "service_name": "string",
  "evaluation_date": "YYYY-MM-DD",
  "dimension_scores": [
    {
      "dimension": "string",
      "score": 1-5,
      "justification": "string"
    }
  ],
  "overall_score": 1-5,
  "pass_fail": "PASS" | "FAIL" | "BORDERLINE",
  "pass_threshold": 3.5,
  "granularity_assessment": "TOO_FINE" | "APPROPRIATE" | "TOO_COARSE",
  "distributed_monolith_risk": "LOW" | "MEDIUM" | "HIGH",
  "right_sizing_recommendations": [
    {
      "action": "MERGE" | "SPLIT" | "EXTRACT" | "KEEP",
      "target": "string",
      "rationale": "string",
      "priority": "HIGH" | "MEDIUM" | "LOW"
    }
  ],
  "migration_sequencing_notes": "string",
  "review_gate_recommendation": "PROCEED" | "REVIEW_REQUIRED" | "BLOCKED"
}

## CONSTRAINTS
- Score conservatively. When uncertain, score lower and flag for human review.
- If [BUSINESS_CRITICALITY] is HIGH, require REVIEW_REQUIRED or BLOCKED for any FAIL result.
- If any dimension scores 1, overall_score must be FAIL regardless of average.
- If three or more dimensions score 2, set distributed_monolith_risk to HIGH.
- Justifications must reference specific evidence from the SERVICE PROPOSAL fields.
- Do not invent data. If information is missing, note it in the justification and score conservatively.

Adaptation guidance: The eight dimensions are calibrated for microservice decomposition decisions, but you can add or remove dimensions based on your architecture standards. If your organization uses fitness functions, add a ninth dimension that scores the service against your automated boundary tests. For teams using Team Topologies, expand the Team Alignment dimension to distinguish stream-aligned, enabling, and platform teams. The pass threshold of 3.5 is a starting point—adjust it based on your risk tolerance. For high-compliance environments, raise the threshold to 4.0 and require human review for any score below 3.

What to do next: After running this prompt, feed the output into your architecture decision record template. If the result is BORDERLINE or FAIL, run the Distributed Monolith Risk Detection Prompt next to get a detailed risk register before making a boundary decision. Always validate the AI's scoring against your own team's experience—this rubric accelerates judgment but does not replace it.

IMPLEMENTATION TABLE

Prompt Variables

Each variable must be populated with concrete, specific information before the prompt is executed. Incomplete or generic values produce unreliable evaluations.

PlaceholderPurposeExampleValidation Notes

[SERVICE_NAME]

Identifies the service under evaluation

OrderFulfillmentService

Must be a single service name; reject if multiple services or ambiguous identifier provided

[SERVICE_RESPONSIBILITY]

Describes what the service owns and does

Manages order lifecycle from payment confirmation to shipment handoff, including inventory reservation and fulfillment state transitions

Must be a complete sentence; reject if fewer than 10 words or contains only a noun phrase

[DATA_ENTITIES_OWNED]

Lists all data entities the service owns exclusively

Order, FulfillmentAttempt, ShipmentLabel, InventoryReservation

Must be a concrete list; reject if empty or contains entities known to be owned by other services

[DEPENDENCY_COUNT]

Number of runtime dependencies this service calls

7

Must be an integer; reject if zero without explicit justification or if count exceeds 20 without architectural review flag

[TEAM_SIZE]

Number of engineers actively maintaining this service

4

Must be an integer between 1 and 15; reject if team size exceeds Dunbar threshold without explicit team-topology documentation

[DEPLOYMENT_FREQUENCY]

How often the service is deployed to production

3 times per week

Must include a numeric frequency and time unit; reject if 'rarely' or 'as needed' without quantification

[CHANGE_COUPLING_SCORE]

Percentage of deployments that require coordinated changes in other services

65

Must be a percentage between 0 and 100; reject if value exceeds 80 without explicit distributed-monolith risk flag

[COGNITIVE_LOAD_RATING]

Team-assessed rating of how hard the service is to understand fully

High

Must be one of Low, Medium, or High; reject if self-assessed without at least two team member confirmations

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Service Granularity Evaluation Rubric prompt into an architecture review workflow with validation, retries, and human approval gates.

This prompt is designed to be called programmatically as part of an architecture review pipeline, not as a one-off chat interaction. The typical integration point is a pull request or design document review workflow where a proposed service boundary is submitted for automated evaluation before human architecture review. The harness should accept a structured input payload containing the service description, bounded context map, dependency graph, and team topology, then return a scored rubric with pass/fail thresholds and right-sizing recommendations. Because architecture decisions carry high blast radius, the harness must treat this as an advisory signal that feeds into human decision-making, not as an automated gate that blocks or approves designs.

Wire the prompt into an application by building a thin service that: (1) validates the input payload against a schema before calling the model, (2) injects the validated fields into the prompt template's placeholders, (3) calls the model with a low temperature (0.0–0.2) for scoring consistency, (4) parses the JSON output and validates it against the expected rubric schema, (5) retries once with a repair prompt if parsing fails, and (6) logs the full prompt, response, and parsed scores for auditability. The output schema should include dimensions (an array of scored criteria with name, score, threshold, pass, and evidence fields), overall_pass (boolean), risk_flags (array of strings), and right_sizing_recommendation (one of merge, split, keep, or re-evaluate). If the model returns a score within 10% of a threshold boundary, flag it for human review rather than accepting the automated pass/fail determination.

Model choice matters here. Use a model with strong reasoning and structured output capabilities—GPT-4o, Claude 3.5 Sonnet, or equivalent. Avoid smaller or faster models for this task because the evaluation requires holding multiple architectural dimensions in context simultaneously. If you are running this in a CI/CD pipeline, cache results keyed on a hash of the input to avoid re-evaluating unchanged proposals. Never use this prompt's output as the sole justification for an architecture decision. Always route the scored rubric to a human architect or architecture review board, and include the raw model response alongside the parsed scores so reviewers can audit the reasoning. The most common production failure mode is the model accepting a service boundary that looks clean on paper but ignores undocumented organizational constraints—human review is the safety net for what the prompt cannot see.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the JSON response produced by the Service Granularity Evaluation Rubric prompt. Use this contract to parse, validate, and integrate the output into downstream tooling or dashboards.

Field or ElementType or FormatRequiredValidation Rule

service_name

string

Non-empty string matching the [SERVICE_NAME] input exactly. Case-sensitive equality check required.

evaluation_date

ISO 8601 date string

Must parse as a valid date. Reject if date is in the future or unparseable.

overall_score

number (0.0-100.0)

Must be a float between 0.0 and 100.0 inclusive. Reject if outside range or non-numeric.

overall_verdict

string enum

Must be one of: 'TOO_FINE', 'TOO_COARSE', 'APPROPRIATE'. Reject on any other value.

dimensions

array of objects

Array length must be between 5 and 8. Each object must contain 'name' (string), 'score' (number 0.0-10.0), and 'rationale' (non-empty string). Reject if any dimension is missing a required field.

right_sizing_recommendations

array of strings

Array length must be >= 1 if overall_verdict is not 'APPROPRIATE'. Each string must be non-empty. Null allowed only when overall_verdict is 'APPROPRIATE'.

risk_flags

array of strings

If present, each string must be non-empty. Null allowed. Reject if array contains empty strings.

confidence_level

string enum

Must be one of: 'HIGH', 'MEDIUM', 'LOW'. Reject on any other value. If 'LOW', human review flag must be raised upstream.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when using a service granularity rubric prompt and how to guard against it.

01

Vague Dimension Definitions Produce Unscorable Outputs

What to watch: The model produces inconsistent scores or generic justifications because rubric dimensions like 'cognitive load' or 'data ownership' are left undefined. Without concrete anchors, the model defaults to plausible-sounding but uncalibrated reasoning. Guardrail: Define each dimension with a 1–5 scale description and a concrete example of what a score of 1, 3, and 5 looks like for that dimension. Include these anchors directly in the prompt template.

02

Context Window Truncation Drops Critical Architecture Details

What to watch: When evaluating large systems, the full service description, dependency graph, and data ownership map exceed the context window. The model evaluates an incomplete picture and produces confident but wrong scores. Guardrail: Implement a pre-processing step that summarizes or chunks the architecture input. Require the prompt to list explicitly which services and dependencies were included in the evaluation. If the input was truncated, the output must flag missing context rather than silently scoring partial data.

03

Model Hallucinates Dependencies That Don't Exist

What to watch: The model invents coupling relationships, shared databases, or synchronous call paths that are not present in the provided architecture description. This inflates coupling scores and produces false distributed-monolith warnings. Guardrail: Add a constraint requiring every claimed dependency to cite a specific source from the input. Include a post-generation validation step that cross-references each cited dependency against the original architecture document. Flag any uncited claims for human review.

04

Score Thresholds Are Arbitrary and Not Calibrated to Team Context

What to watch: The prompt uses fixed pass/fail thresholds that don't account for team maturity, domain complexity, or organizational constraints. A score that signals 'too fine-grained' for a small startup may be appropriate for a regulated enterprise team. Guardrail: Make thresholds configurable via input variables. Include a calibration preamble where the evaluator specifies team size, regulatory requirements, and deployment frequency expectations before scoring begins. Output should include a confidence qualifier when scores are near threshold boundaries.

05

Right-Sizing Recommendations Contradict Each Other Across Services

What to watch: When evaluating multiple services in sequence, the model recommends extracting Service A while simultaneously recommending merging Service B into Service A. The recommendations are locally coherent but globally inconsistent. Guardrail: Run a cross-recommendation consistency check after all evaluations complete. Add a post-processing rule that detects contradictory merge/extract pairs and flags them for architectural review. Consider batching related service evaluations into a single prompt to give the model global visibility.

06

Team Topology and Conway's Law Factors Are Ignored

What to watch: The rubric focuses entirely on technical dimensions and ignores organizational reality. A technically sound boundary that spans three teams with different reporting chains will fail in practice regardless of its architectural purity. Guardrail: Include a mandatory 'team alignment' dimension in the rubric that scores whether the proposed boundary maps to a single stream-aligned team. If team structure input is not provided, the output must include a caveat that organizational factors were not evaluated and the score is technical-only.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Service Granularity Evaluation Rubric Prompt before integrating it into your architecture review pipeline. Each criterion targets a specific failure mode observed when AI evaluates service boundaries.

CriterionPass StandardFailure SignalTest Method

Dimension Coverage

Output includes a score for all required dimensions: cognitive load, data ownership, team size, change frequency, and at least 2 additional dimensions from the prompt.

Output omits a core dimension or provides a score without a named dimension label.

Parse output JSON. Assert that the dimensions array contains objects with unique name fields covering all required dimensions.

Score Range Compliance

Every dimension score is an integer between 1 and 5, inclusive. The overall score is a float between 1.0 and 5.0.

A dimension score is outside the 1-5 range, is a float when an integer is expected, or the overall score is missing.

Validate each score field in the dimensions array is an integer and 1 <= score <= 5. Validate overall_score is a float and 1.0 <= overall_score <= 5.0.

Threshold-Based Verdict

Output includes a verdict field of 'PASS' when overall_score >= [PASS_THRESHOLD], 'FAIL' when overall_score < [FAIL_THRESHOLD], and 'REVIEW' otherwise.

The verdict does not match the overall_score against the provided thresholds, or the verdict field contains an unexpected string.

Calculate expected verdict from overall_score and the [PASS_THRESHOLD] and [FAIL_THRESHOLD] inputs. Assert string equality with the output verdict field.

Evidence Grounding

Each dimension's rationale field references a specific capability, module, or data entity from the provided [SERVICE_SPECIFICATION] input.

A rationale is generic (e.g., 'the service is too big') without citing a concrete element from the input specification.

For each dimension object, check that the rationale string contains at least one term or entity name present in the [SERVICE_SPECIFICATION] input text.

Right-Sizing Recommendation Specificity

The recommendation field proposes a concrete action: 'split by [BOUNDARY]', 'merge with [SERVICE_NAME]', or 'maintain'. It must not be empty or a vague suggestion.

The recommendation is missing, is an empty string, or contains only a generic statement like 'consider refactoring'.

Assert that the recommendation string is non-empty and matches one of the expected action patterns using a regex check.

Output Schema Validity

The entire model response is a single, valid JSON object matching the [OUTPUT_SCHEMA] with no additional text or markdown fences.

The response contains text before or after the JSON object, or the JSON fails to parse against the expected schema.

Attempt JSON.parse() on the trimmed response. Validate the parsed object against the [OUTPUT_SCHEMA] JSON Schema definition. Assert no parsing errors and no additional properties.

No Hallucinated Services

The output does not invent service names, data stores, or dependencies not present in the [SERVICE_SPECIFICATION] input.

The rationale or recommendation mentions a service name, database, or API endpoint not found in the provided input context.

Extract all proper nouns and technical identifiers from the output. Assert that each is a substring match within the [SERVICE_SPECIFICATION] input text.

Cognitive Load Assessment

The cognitive load dimension score is justified by referencing the number of domain concepts, state transitions, or business rules the service must manage.

The cognitive load rationale only mentions lines of code, number of endpoints, or team headcount without addressing domain complexity.

Check the rationale for the cognitive load dimension. Assert it contains at least one domain-specific term (e.g., 'state machine', 'policy', 'rule', 'workflow') from the input.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and lighter validation. Remove the strict JSON output schema requirement and accept a structured markdown table instead. Reduce the number of evaluation dimensions to 4-5 core ones (cognitive load, data ownership, change frequency, team alignment). Skip the threshold-based pass/fail criteria and ask for a qualitative recommendation instead.

Prompt modification

Replace [OUTPUT_SCHEMA] with: Return a markdown table with columns: Dimension, Score (1-5), Evidence, Risk Note. End with a one-paragraph recommendation.

Watch for

  • Missing schema checks leading to inconsistent formatting across runs
  • Overly broad instructions producing vague "it depends" recommendations
  • No quantitative scoring, making it hard to compare multiple services
  • Model hallucinating coupling metrics without source evidence
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.