Role & Goal You are an expert DevEx engineer researching best-practice change-management and task-management workflows using Claude Code (CLI & SDK) in real engineering teams as of Sept 22, 2025. Produce actionable guidance I can adopt in a repo that already uses a YAML task plan and a Prefect 3 flow to orchestrate phases/tasks 1:1 (think
.claude/tasks.yaml→flows/golden_testset_flow.py).What to cover (prioritize authoritative sources):
- MCP configuration & scopes — current, documented best practice for using project-scoped
.mcp.jsonin VCS vs user-scoped/global config; precedence with.claude/settings.jsonand managed policy files; environment-variable expansion and approval prompts for project MCP. Cite docs.- Claude Code settings for governance — permission model (
allow/ask/deny), enabling/approving.mcp.jsonservers, “includeCoAuthoredBy” in commits, relevant env vars (MCP_TIMEOUT,MAX_MCP_OUTPUT_TOKENS), and how Desktop Extensions factor in (install/approval flows, import from Desktop). Cite docs.- Task management patterns — representing work as versioned tasks/phases in a YAML plan that a flow maps 1:1 (pre/post checks, quality gates, perf budgets, artifacts), and driving CI with that plan. Provide examples that align with typical
tasks.yaml→ Prefect execution and GitHub Actions matrix.- Change-management controls — GitHub/GitLab branch protection, CODEOWNERS, required reviews, required status checks, rulesets, PR templates, Conventional Commits, auto-merge policies, and how they interplay with Claude Code’s Git tools and CI. Cite official docs.
- Security & safety — MCP trust boundaries, prompt-injection risks for 3rd-party servers, secret handling (env/managed policy), permission prompts, and least-privilege patterns. Cite docs or reputable advisories.
- Operator UX — daily commands (
claude mcp add/list/get/remove,/mcp), importing Desktop MCP, debugging failures, and practical examples for ticket systems (Linear/Jira), docs (Notion), and error monitoring (Sentry).Deliverables:
- A 1-page set of recommendations (≤12 bullets) with inline citations to Anthropic Claude Docs, Model Context Protocol (modelcontextprotocol.io), and GitHub/GitLab docs. Prefer official docs over blogs; include dates where possible.
- A step-by-step change-management process (feature branch → PR → status checks → merge) showing exactly where Claude Code and MCP are used.
- A task-management template (minimal
tasks.yamlslice) showing phases/tasks withrun/verify/perf_budget_ms/artifactsand how CI maps matrix to phases.- Minimal
.mcp.json(project-scoped) +.claude/settings.jsonexamples for permissions and server approvals, with notes on approval prompts and precedence.- A PR checklist purpose-built for Claude-assisted changes (permissions evidence, MCP server list, status checks, artifacts).
Style constraints:
- Be concise; use bullet points, small code blocks; no marketing copy.
- Cite 5–8 “load-bearing” facts with links and dates (e.g., MCP spec revs, Anthropic docs pages, GitHub branch-protection pages).
- Prefer examples that will run in CI and on macOS/WSL2.
Repo assumptions to align with:
.claude/tasks.yamlis the source of truth for phases/tasks; CI fans out across phases; a Prefect 3 flow maps YAML → flows/tasks 1:1 and enforces perf budgets & artifacts.- CI has development vs enterprise modes; status checks must pass.
Output: Provide the recommendations, process, templates, and checklist. Then include a short “why these practices” note.
- Use project-scoped MCP via
.mcp.jsonin the repo (checked into VCS) when collaborating; Claude Code documents the structure, scope flags, precedence, and env-var expansion for commands/args/headers/urls. (Claude Docs) - Settings precedence today: enterprise managed policy → CLI args →
.claude/settings.local.json→.claude/settings.json→~/.claude/settings.json; usepermissions.{allow,ask,deny}and options likeenableAllProjectMcpServers,includeCoAuthoredBy. (Claude Docs) - Desktop Extensions (Claude Desktop) provide one-click MCP install and you can import Desktop MCP servers into Claude Code via
claude mcp add-from-claude-desktop. (Anthropic) - MCP is JSON-RPC-based; hosts (Claude Code/Desktop) connect to servers exposing tools/resources/prompts; official spec + architecture explain participants & transports (stdio/SSE/HTTP). (Model Context Protocol)
- Branch protection + CODEOWNERS remain the canonical way to enforce PR review & checks before merge. Use “Require review from Code Owners”, required approvals, and required status checks. (GitHub Docs)
- Your repo’s pattern already matches best practice: a flow reads
tasks.yamland maps phases/tasks 1:1; CI runs a matrix over phases and consumes.claude/tasks.yaml.
-
Plan & open branch
- Use Claude Code with MCP servers for your tracker (e.g., Linear/Jira) to pull acceptance criteria and generate a task slice for this change. Keep work on a feature branch; main is protected. (Claude Docs)
-
Author changes with permissions on
- In
.claude/settings.json, deny secret reads; ask for risky Bash; enableincludeCoAuthoredByfor transparency. (Claude Docs)
- In
-
Encode tasks in
.claude/tasks.yamlfor repeatability- Add/modify a phase task (
run/verify/perf_budget_ms/artifacts). The Prefect 3 flow will enforce perf budgets and run verifies.
- Add/modify a phase task (
-
Local rehearsal via flow
python flows/golden_testset_flow.py --only-phase <phase>(dev mode) and fix failures before PR.
-
Open PR
- PR template requires: updated tasks, artifacts attached, status checks passing, links to Claude Code session notes (
/mcpoutput), and MCP server list from.mcp.json.
- PR template requires: updated tasks, artifacts attached, status checks passing, links to Claude Code session notes (
-
CI runs
- Matrix executes each phase using the YAML; required status checks (lint, security, perf, integration) must pass.
-
Review gates
- CODEOWNERS + protected branches enforce owner review; rules require PR approvals & passing checks before merge. (GitHub Docs)
-
Merge & label
- Use Conventional Commits; CI tags release and archives phase reports.
-
Post-merge
- Dashboards (Phoenix/metrics) and artifacts provide evidence; incidents create follow-up tasks.
# .claude/tasks.yaml (slice)
schema: "ai-tasks/v0.3"
version: "2.2"
project: "rag-eval-foundations"
phases:
- id: phaseX
name: "Implement <feature>"
depends_on: [phase1]
tasks:
- id: px.impl
name: "Code & unit tests"
perf_budget_ms: 180000 # 3 minutes
run:
- "ruff check src/ --fix"
- "pytest -q"
verify:
- "python scripts/verify_quality_gates.py --all"
artifacts:
- "reports/unit-test-report.xml"CI should fan out by
phasein a matrix and call the flow with--only-phase ${{ matrix.phase }}; your current workflow already does this against.claude/tasks.yaml.
.mcp.json (project-scoped, VCS-checked):
(approved structure & env expansion per Claude Docs) (Claude Docs)
{
"mcpServers": {
"linear": { "type": "sse", "url": "https://mcp.linear.app/sse", "headers": { "Authorization": "Bearer ${LINEAR_API_KEY}" } },
"notion": { "type": "http", "url": "https://mcp.notion.com/mcp", "headers": { "Authorization": "Bearer ${NOTION_API_KEY}" } },
"sentry": { "type": "http", "url": "https://mcp.sentry.dev/mcp" }
}
}.claude/settings.json (project-shared): (Claude Docs)
{
"enableAllProjectMcpServers": true,
"includeCoAuthoredBy": true,
"permissions": {
"deny": ["Read(./.env)", "Read(./secrets/**)", "Bash(curl:*)"],
"ask": ["Bash(git push:*)", "Bash(pnpm i:*)"],
"allow": ["Bash(npx ruff:*)", "Bash(pytest:*)"]
},
"env": {
"MCP_TIMEOUT": "15000",
"MAX_MCP_OUTPUT_TOKENS": "50000"
}
}Add or import servers via CLI (
claude mcp add …,claude mcp add-from-claude-desktop) and inspect with/mcpin the REPL. (Claude Docs)
- Task plan updated (
.claude/tasks.yaml) withrun/verify/perf_budget_ms/artifacts. - Local flow run passed for target phase(s) (
--only-phase). - CI status checks passing (lint, security, performance, integration).
- MCP inventory included (servers from
.mcp.json+ justification/least privilege). (Claude Docs) - Permissions evidence: paste
/configrelevant snippets; secrets not exposed;.claude/settings.jsondenies sensitive file reads. (Claude Docs) - Branch protection & CODEOWNERS approvals satisfied; required reviews met. (GitHub Docs)
- Artifacts attached (reports/logs) and links to Phoenix/metrics dashboards.
- Conventional Commit message + PR description includes rationale & risk.
- 3rd-party MCP servers can expand attack surface (prompt-injection, data exfil). Use project scope only for vetted servers; prefer OAuth where available; keep dangerous tools in
ask/deny. (Claude Docs) - Overscoped permissions in Claude Code. Enforce deny-by-default on secrets; enable enterprise managed policy if available. (Claude Docs)
- Flaky governance without branch protection. Require status checks and CODEOWNERS reviews on
main. (GitHub Docs)
- Your flow parses YAML and runs phases/tasks 1:1, enforcing perf budgets and artifacts; CI already executes phases from
.claude/tasks.yaml— the templates above plug straight in.
If you want, I can drop these snippets into PR-ready files (.mcp.json, .claude/settings.json, and a minimal .github/PULL_REQUEST_TEMPLATE.md) next.