Prime Backend: Load Backend Context
Objective
Build targeted understanding of the backend codebase by analyzing its structure, routes, services, and data layer. Loading only backend context keeps the context window light on complex full-stack codebases. If external task references are provided, load them first so the analysis is anchored to the actual work.
Process
Step 0: Load External Context
Run this step BEFORE the codebase analysis. It accepts optional arguments: [jira-issue-keys] [confluence-page-ids].
- Jira keys may be a single key (
ACC-2) or comma-separated (ACC-2,ACC-3).
- Confluence page ids are numeric page ids.
If Jira issue keys are provided:
- Call
mcp__atlassian__getAccessibleAtlassianResources to obtain the cloudId.
- For each Jira key, call
mcp__atlassian__getJiraIssue with that cloudId, the issue key, and responseContentFormat: "markdown".
- Treat the returned issue summary, description, and acceptance criteria as the task context for everything that follows.
If Confluence page ids are provided:
- Call
mcp__atlassian__getConfluencePage for each page id with contentFormat: "markdown" (use the cloudId from above, fetching it via mcp__atlassian__getAccessibleAtlassianResources if it was not already retrieved).
- Treat the returned page content as supporting context (specs, design docs, requirements).
If no arguments are provided: Skip this step entirely and proceed to Step 1.
Briefly summarize any external context loaded before continuing — this frames the rest of the priming.
1. Locate the Backend
List all tracked files to find the backend root:
!git ls-files
Common backend roots: backend/, server/, api/, app/ (FastAPI/Django), src/ (when project is backend-only). Identify the correct root before proceeding.
2. Read Backend Documentation
- Read CLAUDE.md or similar global rules file (for project-wide conventions)
- Read any README inside the backend root
- Read
.claude/references/backend-api-best-practices.md if it exists — it contains project-specific API conventions
3. Identify Key Backend Files
Based on the structure, read:
- Main entry point (
main.py, app.py, server.ts, index.ts, etc.)
- Route registration / router index (
routes/, api/, routers/)
- Core configuration (
pyproject.toml, package.json, tsconfig.json)
- Database configuration and ORM setup (
database.py, db.ts, alembic.ini)
- Core data models or schemas (
models/, schemas/)
- One or two representative feature slices (route + service + model) to internalize established patterns
- Middleware and dependency injection setup
Skip files outside the backend root unless they define a shared type or contract the backend exposes.
4. Understand Current Backend State
Check recent backend-relevant activity:
!git log -10 --oneline
!git status
Note any open migrations, pending schema changes, or in-progress API changes.
Output Report
Provide a concise summary covering:
External Task Context (if loaded)
- Jira issue(s): key, title, one-line goal, acceptance criteria
- Confluence page(s): title and what they specify
Backend Overview
- Framework and major libraries (FastAPI, Django, Express, NestJS, etc.)
- Language and runtime version
- Database and ORM (PostgreSQL + SQLAlchemy, MongoDB + Mongoose, etc.)
Directory Map
- Backend root and key sub-directories with one-line purpose each
Architecture Patterns
- How routes, services, and data access are layered
- Dependency injection or middleware patterns observed
- Error handling approach
Conventions
- Naming conventions, module organization
- Migration tooling and current migration state
- Testing framework and conventions observed
Current State
- Active branch, recent backend changes
- Any pending migrations or schema changes
- Any immediate concerns (missing validation, unhandled errors, etc.)
Make this summary easy to scan - use bullet points and clear headers.
1---2name: prime-backend3description: Primes the agent with focused understanding of the backend portion of the codebase — API routes, services, data models, and database layer — without loading unrelated frontend code. Use at the start of a session when the work is scoped to API endpoints, business logic, or data access. Optionally pulls external task context from Jira issues and Confluence pages first.4---56# Prime Backend: Load Backend Context78## Objective910Build targeted understanding of the backend codebase by analyzing its structure, routes, services, and data layer. Loading only backend context keeps the context window light on complex full-stack codebases. If external task references are provided, load them first so the analysis is anchored to the actual work.1112## Process1314### Step 0: Load External Context1516**Run this step BEFORE the codebase analysis.** It accepts optional arguments: `[jira-issue-keys] [confluence-page-ids]`.1718- Jira keys may be a single key (`ACC-2`) or comma-separated (`ACC-2,ACC-3`).19- Confluence page ids are numeric page ids.2021**If Jira issue keys are provided:**22231. Call `mcp__atlassian__getAccessibleAtlassianResources` to obtain the `cloudId`.242. For each Jira key, call `mcp__atlassian__getJiraIssue` with that `cloudId`, the issue key, and `responseContentFormat: "markdown"`.253. Treat the returned issue summary, description, and acceptance criteria as the task context for everything that follows.2627**If Confluence page ids are provided:**28291. Call `mcp__atlassian__getConfluencePage` for each page id with `contentFormat: "markdown"` (use the `cloudId` from above, fetching it via `mcp__atlassian__getAccessibleAtlassianResources` if it was not already retrieved).302. Treat the returned page content as supporting context (specs, design docs, requirements).3132**If no arguments are provided:** Skip this step entirely and proceed to Step 1.3334Briefly summarize any external context loaded before continuing — this frames the rest of the priming.3536### 1. Locate the Backend3738List all tracked files to find the backend root:3940!`git ls-files`4142Common backend roots: `backend/`, `server/`, `api/`, `app/` (FastAPI/Django), `src/` (when project is backend-only). Identify the correct root before proceeding.4344### 2. Read Backend Documentation4546- Read CLAUDE.md or similar global rules file (for project-wide conventions)47- Read any README inside the backend root48- Read `.claude/references/backend-api-best-practices.md` if it exists — it contains project-specific API conventions4950### 3. Identify Key Backend Files5152Based on the structure, read:5354- Main entry point (`main.py`, `app.py`, `server.ts`, `index.ts`, etc.)55- Route registration / router index (`routes/`, `api/`, `routers/`)56- Core configuration (`pyproject.toml`, `package.json`, `tsconfig.json`)57- Database configuration and ORM setup (`database.py`, `db.ts`, `alembic.ini`)58- Core data models or schemas (`models/`, `schemas/`)59- One or two representative feature slices (route + service + model) to internalize established patterns60- Middleware and dependency injection setup6162Skip files outside the backend root unless they define a shared type or contract the backend exposes.6364### 4. Understand Current Backend State6566Check recent backend-relevant activity:6768!`git log -10 --oneline`6970!`git status`7172Note any open migrations, pending schema changes, or in-progress API changes.7374## Output Report7576Provide a concise summary covering:7778### External Task Context (if loaded)79- Jira issue(s): key, title, one-line goal, acceptance criteria80- Confluence page(s): title and what they specify8182### Backend Overview83- Framework and major libraries (FastAPI, Django, Express, NestJS, etc.)84- Language and runtime version85- Database and ORM (PostgreSQL + SQLAlchemy, MongoDB + Mongoose, etc.)8687### Directory Map88- Backend root and key sub-directories with one-line purpose each8990### Architecture Patterns91- How routes, services, and data access are layered92- Dependency injection or middleware patterns observed93- Error handling approach9495### Conventions96- Naming conventions, module organization97- Migration tooling and current migration state98- Testing framework and conventions observed99100### Current State101- Active branch, recent backend changes102- Any pending migrations or schema changes103- Any immediate concerns (missing validation, unhandled errors, etc.)104105**Make this summary easy to scan - use bullet points and clear headers.**