agentleFS
hmctshmcts/claude/.claude/skills/context-service-guide/SKILL.md

context-service-guide

Skill1 starsChanged 7 months agoMITView on GitHub

Navigate and understand any legacy cpp-context-* WildFly/Maven service. LEGACY ONLY — must not be applied to new Spring Boot work. Use when onboarding to a context service, exploring its modules, or understanding its CQRS structure and integrations.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read these files in parallel to build a complete picture:

    line 30
  2. Very specific:

    Look in *-event-sources for @Handles annotations or event handler methods — these show which domain events from other contexts trigger …

    line 104
  3. Very specific:

    Check for *InterceptorChainProvider.java — custom interceptor chains may override default audit/auth behaviour.

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

⚠️ Legacy WildFly context services only. The patterns in this skill — cpp-context-* Maven multi-modules, -command-api / -query-api / -domain-event, RAML, custom CQRS plumbing, subscriptions-descriptor.yaml — are WildFly-era patterns and must not be applied to new Spring Boot services. They exist here to help engineers onboard to existing services.

For new Spring Boot services, use skills/springboot-service-from-template/. For new HMCTS Marketplace API specs, use skills/springboot-api-from-template/. Cross-pollinating these patterns into a Spring Boot service is a design regression — the master source for Spring Boot is the HMCTS template (see context/tech-stack.md).

Context Service Guide

Provides a structured walkthrough of any CP context service repository to help developers quickly understand its purpose, structure, integrations, and development workflow.

When to Use

  • User asks to "explain this context service", "walk me through this repo", "what does this service do"
  • User is new to a cpp-context-* repo and wants to understand it
  • User asks about a service's domain events, commands, queries, or integrations

Process

Step 1: Identify the Context Service

Determine which cpp-context-* repo the user is asking about. If they're in a subdirectory, resolve to the repo root.

Step 2: Read Key Files

Read these files in parallel to build a complete picture:

  1. pom.xml (root) — parent POM, modules list, properties, dependency versions
  2. README.md — if present, provides an overview
  3. *-domain/*-domain-event/src/main/resources/json/schema/ — domain event schemas reveal what the service publishes
  4. *-command/*-command-api/src/raml/ — command API RAML definitions reveal what operations the service accepts
  5. *-query/*-query-api/src/raml/ — query API definitions reveal what data the service exposes
  6. *-viewstore-liquibase/ — Liquibase changelogs reveal the read-model database schema
  7. *-event-sources/ — event source configurations reveal what events from other contexts this service subscribes to

Step 3: Map Integrations

From the POM dependencies and event sources, identify:

  • Upstream contexts — which other context services publish events this service consumes
  • Downstream contexts — which contexts consume this service's domain events
  • Shared components used — audit, auth, reference data, file service, notifications, etc.
  • External systems — any SOAP/REST integrations with systems outside CP

Step 4: Identify Module Structure

Map the standard CQRS module layout:

ModulePurposeKey classes to look at
-command-apiCommand definitionsRAML files, JSON schemas
-command-handlerCommand processing*CommandHandler.java, *Aggregate.java
-query-apiQuery definitionsRAML files
-query-handlerQuery processing*QueryHandler.java
-domain-eventDomain eventsJSON schemas in resources
-domain-value-schemaValue objectsJSON schemas
-event-sourcesEvent subscriptions*EventSource.java
-viewstoreJPA read models*Entity.java, *Repository.java
-viewstore-liquibaseDB migrationsdb/changelog/ XML/YAML files
-serviceApp orchestrationWildFly deployment descriptors
-integration-testIntegration testsCucumber features, step definitions

Step 5: Generate Summary

Output a structured summary:

## [Service Name]

### Purpose
One paragraph describing what this bounded context manages.

### Domain Events Published
- event.name.one — description
- event.name.two — description

### Commands Accepted
- command.name.one — description

### Queries Exposed
- query.name.one — description

### Upstream Dependencies
- cpp-context-X — consumes events from...

### Downstream Consumers
- cpp-context-Y — publishes events consumed by...

### Database
- Schema summary from Liquibase

### Development
- mvn clean install
- mvn test -pl {module}
- Integration tests: mvn verify -pl {name}-integration-test

Common Module Patterns

Event Source Subscription

Look in *-event-sources for @Handles annotations or event handler methods — these show which domain events from other contexts trigger processing in this service.

Interceptor Chain

Check for *InterceptorChainProvider.java — custom interceptor chains may override default audit/auth behaviour. If absent, the service uses the framework default (audit + access control on all APIs).

View Store Projections

The -event-sources module typically contains projection logic that transforms domain events into viewstore entities. This is the CQRS projection — the bridge between the event store and the read model.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.