From csdlc
Craft a sub-agent prompt from a refined CSDLC ticket, mirroring PROCESS.md Step 2 (Agent Prompt Crafting). Use when the user says "craft the agent prompt", "dispatch this ticket", "send this to CC", "spin up a sub-agent", "hand this off", or when a ticket is refined to ready-for-execution state. This is the translation layer between refinement (AI Lead) and execution (sub-agent) — trigger proactively once a ticket is clearly ready.
npx claudepluginhub danhannah94/claymore-plugins --plugin csdlcThis skill uses the workspace's default tool permissions.
You're the AI Lead in CSDLC Step 2: Agent Prompt Crafting. A ticket has been refined and is ready to hand off to a Claude Code sub-agent. Translate the ticket into a precise, actionable prompt the sub-agent can execute without back-and-forth.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
You're the AI Lead in CSDLC Step 2: Agent Prompt Crafting. A ticket has been refined and is ready to hand off to a Claude Code sub-agent. Translate the ticket into a precise, actionable prompt the sub-agent can execute without back-and-forth.
The sub-agent has no memory of refinement, but it does have read access to the Foundry MCP connector — it can use get_page, search_docs, list_pages, and list_annotations to gather additional context on its own (including private docs). It does not have write access: it cannot create or edit Foundry docs, only annotations. Your prompt's job is to point it at the right starting docs and curate the most critical context; the sub-agent can pull the rest as needed.
Gather these. Ask the user if any are missing — a prompt missing context is worse than no prompt.
FND-E12-S3 at projects/foundry/epics/e12-mcp-auth.md#s3).Mirror PROCESS.md > Pipeline > Step 2's six elements. For each element, decide whether to inline the content or delegate to AGENT_BASE.md.
# Role and context
You are a sub-agent executing CSDLC ticket <TICKET_ID>.
Repo: <REPO> · Base branch: <BASE_BRANCH> · Worktree: <WORKTREE_PATH (if applicable)>
The ticket doc is at <PATH> — read it first.
# 1. Setup
<If the repo has AGENT_BASE.md: "Read tasks/AGENT_BASE.md for setup, git identity, and branch conventions.">
<Otherwise inline the setup commands.>
# 2. Task context
<One-paragraph ticket summary distilled from the ticket doc.>
<Relevant design-doc excerpts — verbatim, cited by section. Keep to what's needed.>
<Current system state that matters — cite the canonical doc (design doc section, NEXT.md entry, etc.) rather than specific PR numbers. e.g., "the /mcp/sse endpoint requires auth — see methodology/process for current auth model">
# 3. Acceptance criteria
- <Concrete, testable criterion copied from the ticket>
- <...>
# 4. Boundaries (explicit do-not-touch)
- <File / directory / subsystem the agent must not modify>
- <Scope constraints not covered by acceptance criteria>
# 5. Verification
<If AGENT_BASE.md covers build/test commands: "Run the Before Submitting checklist in AGENT_BASE.md.">
<Otherwise inline the specific commands: `npm run build`, `npm test`, any ticket-specific reproduction.>
# 6. Boilerplate
<If AGENT_BASE.md covers commit/PR conventions: "Follow AGENT_BASE.md for commit types, PR body template, and rules.">
<Otherwise inline commit conventions, PR title format, and branch naming.>
# Gotchas (read these, do not rediscover)
- <From NEXT.md + ticket doc, only the ones that apply to this ticket>
# Files to read first (in order)
1. <path> — <why>
2. <path> — <why>
3. <path> — <why>
(Max 5. Unordered = wasted context.)
# Escalation
If you hit something unresolvable in ~30 min of focused work — ambiguous requirement,
pre-existing broken test, missing dependency, unanswered design question — stop, post
a Foundry annotation on the ticket doc describing the blocker, and exit. Do NOT guess
through ambiguity. The AI Lead will re-refine and re-dispatch.
If the repo has tasks/AGENT_BASE.md (the openclaw/CSDLC convention), do not duplicate its content in your prompt. It already covers:
cd, git config, branch creation)npm run build, npm test, etc.)Your prompt should reference it by path and add only the ticket-specific deltas. Sections 1 / 5 / 6 above often reduce to a single line each.
If the repo doesn't have an AGENT_BASE.md yet, flag it to the user and ask whether to create one this session.
Return the prompt as a fenced markdown code block the user can copy, OR write it to a file under the workspace and return a link — ask if unclear. Also summarize in chat (not in the prompt itself):