Load focused context for a Jira ticket before building. Reads only the relevant doc sections instead of everything.
Load focused context for: $ARGUMENTS
Do NOT start coding yet. Your job is to gather and present the right context so the next prompt can build efficiently.
Use the Jira MCP tools to get the issue for $ARGUMENTS. Extract:
From the summary, extract the story ID prefix (e.g., INFRA-, DATA-, CHAT-, API-, FE-, AUTH-, MEM-, SEC-, DEPLOY-, CICD-, DEMO-). This is used for doc routing in later steps.
For each blocking/linked issue from Step 1:
git branch --list "*<blocker-CUAI-key>*"
git fetch origin
git branch -r --list "*<blocker-CUAI-key>*"
git log --oneline main..<branch> | head -10
Using the story ID from the Jira summary, grep docs/jira-epics-and-stories.md for it. Extract:
Use the routing table in story-routing.md to determine which sections of docs/architecture.md are relevant based on the story ID prefix.
Read ONLY those sections from architecture.md. Do not read the entire file.
To extract a section, grep for the header and read from there to the next same-level header:
grep -n "^## " docs/architecture.md
Then use sed to extract the line range for each relevant section.
Read the relevant phase and person section from docs/implementation-guide.md:
If the story references an ADR (e.g., "See ADR-6"), read just that ADR from docs/decisions.md.
Output a focused brief:
## $ARGUMENTS: <summary>
<description + acceptance criteria from docs>
## Blockers
<for each dependency:>
- <CUAI key>: <summary> — <status>
<if branch exists: "Branch: <name>, <N> commits — <summary of work done>">
<if In Progress: "Remaining: <what acceptance criteria are not yet done>">
<if any are not Done: "⚠️ BLOCKED — the following dependencies are not complete:">
<if all Done: "✅ All dependencies complete">
## Architecture context
<relevant sections, summarized to key specs the implementation needs>
## Implementation notes
<relevant guidance from the implementation guide>
## Key files to create/modify
<list the files this story touches based on the architecture doc>
Run git branch --show-current. Check if a branch for this ticket exists:
git branch --list "*$ARGUMENTS*"
git branch -r --list "*$ARGUMENTS*"
If any blockers are not Done AND no branch exists anywhere: Review the acceptance criteria, the blocker descriptions, and the progress on each blocker. Determine if any acceptance criteria can be worked on independently without the blockers being complete (e.g., writing parsing logic before the DB is ready, building UI components against mock data before the API exists). Also consider blocker progress — if a blocker is nearly done, work that depends on it may be safe to start.
If nothing can be started independently: Say: "This story is blocked and no work can begin until the dependencies above are resolved." and stop.
If some work can begin:
git checkout -b feat/$ARGUMENTS-<short-description>If any blockers are not Done BUT a branch exists: Switch to the branch (checkout local, or checkout from remote if only there). Then:
git log --oneline main..<branch> | head -20 to show work already done<branch>. Here's what's done so far and what's still waiting on dependencies. You may be able to work on the unblocked parts."If all blockers are Done:
If on main or a different story's branch:
feat/$ARGUMENTS-<short-description>git checkout -b <branch> origin/<branch>git checkout <branch>git checkout -b <branch>Then say: **"Context loaded, on branch <branch-name>. Ready to build — describe what you want to start with or say 'go' to follow the implementation guide."**38:["$","$L3f",null,{"content":"$40","frontMatter":{"name":"start-work","description":"Load focused context for a Jira ticket before building. Reads only the relevant doc sections instead of everything.","argument-hint":"<jira-key e.g. CUAI-20>","disable-model-invocation":true,"allowed-tools":"Read Grep Glob Bash"}}]