How this skill is triggered — by the user, by Claude, or both
Slash command
/ccflow:implementThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Read the `subagent-safety` reference skill before delegating work to subagents.
Read the subagent-safety reference skill before delegating work to subagents.
Config check: Before anything else, verify .claude/config.json exists by reading it. If the file does not exist, stop immediately and tell the user:
"ccflow is not configured for this project. Run /ccflow:configure first to set up."
Read .claude/config.json.
Read the claudeMdLocation field from .claude/config.json to determine where CLAUDE.md is located (defaults to .claude/CLAUDE.md if not set).
Read .claude/rules/lessons-learned.md before any implementation.
Read .claude/rules/git-workflow.md for commit and PR conventions.
If isMonorepo is true in .claude/config.json:
projects array in config to identify which project(s) the ticket affects.<project-path>/CLAUDE.md for project-specific stack details and conventions..claude/rules/lessons-learned-<slug>.md for project-specific lessons.buildCommand and testCommand from config instead of inferring them globally.If pencil.enabled is true in .claude/config.json:
Determine design path: Read pencil.designPath from config. If the project is a monorepo with pencil.shared: false, use the per-project designPath from the affected project's entry in the projects array.
Load DESIGN.md: If <designPath>/DESIGN.md exists, read it and store as designSpec. This contains screen-to-route mappings, component-to-code mappings, design tokens, and naming conventions.
Note .pen file path: Record the .pen file path from the DESIGN.md header for planner reference. Do not read the .pen file yet — subagents cannot use Pencil tools, so .pen content must be pre-read by the main agent if needed.
Parse design structure from DESIGN.md (if loaded):
designScreenIds, designComponentMap, and designTokens for use in Phase 1 (planner) and Phase 4 (implementer)Pencil availability probe: Read pencil.mode from config (default: "editor"). Store as $PENCIL_MODE. Before any Pencil calls later in the pipeline, attempt a lightweight probe:
CLI-app mode (pencil.mode is "cli-app"):
pencil interactive -a desktop <<'EOF'
get_editor_state({ include_schema: false })
EOF
If it succeeds → set pencilAvailable = true. If it fails → set pencilAvailable = false.
Editor mode (pencil.mode is "editor"):
Call `get_editor_state()` via MCP — if it succeeds, set `pencilAvailable = true`.
If it fails or times out, set `pencilAvailable = false`.
If the probe fails, inform the user: "Pencil unavailable — proceeding with DESIGN.md text content only. Open Pencil and retry if live design reads are needed." This probe runs once during context loading. Do not auto-launch Pencil.
If pencil.enabled is not true or pencil is absent, skip this section.
Shell rules: Read the shell-rules skill before running any gh commands (covers heredoc temp-file pattern).
Parse $ARGUMENTS — Mode Detection:
Extract the first whitespace-delimited token from $ARGUMENTS and determine the mode:
If the first token matches ^\d+$ or ^#\d+$ → ticket mode
# prefix to get the numeric ticket ID.#1 focus on API → ID 1, context focus on API; 7 → ID 7, no context.If the first token ends in .md and resolves to a file in .claude/plans/ → plan file mode
--- delimiters) to extract metadata: version, mode, ticketId, ticketTitle, slug, isChild, isLastChild, parentId, planCommitSha, createdAt, status.hasPlanFile = true.ticket or ticketless) from the front matter's mode field.mode is ticket, set the ticket ID and slug from front matter. If mode is ticketless, set the slug from front matter.$ARGUMENTS after the file path is ignored.Otherwise → ticketless mode
$ARGUMENTS string is the task description.add dark mode support for the dashboard → slug add-dark-mode-support.The determined mode (ticket or ticketless) governs conditional behavior throughout the rest of this skill.
Plan file auto-detection (ticket mode only): If the first token is a ticket ID (ticket mode) and a file matching .claude/plans/<id>-*.md exists, present the user with a choice using AskUserQuestion:
hasPlanFile = true, read the plan fileIf ticket mode: Fetch the ticket:
Extract owner/repo from git remote get-url origin (e.g. [email protected]:owner/repo.git → owner/repo), then run:
gh issue view <number> --repo <owner>/<repo> --json number,title,body,labels,state,assignees,milestone,comments
If ticketless mode: Skip ticket fetching. The task description from $ARGUMENTS is the primary input.
If ticketless mode: Skip this section entirely.
If ticket mode: After fetching the ticket, detect whether this is a child ticket created by /ccflow:refine splitting:
Identify parent: Parse the ticket body for Related to #<number>. If found, this is a child ticket — extract the parent ID.
Fetch the parent ticket: Use the same fetch command as above (gh issue view). Check the parent's state — if already closed, set isChild = true, isLastChild = false, parentId = <id> and skip to Attachments (don't try to close an already-closed parent).
Find siblings: Look for a ### Child Tickets section in the parent's body. Extract sibling issue numbers from lines matching - [ ] #<number> or - [x] #<number>.
Fallback if no ### Child Tickets section exists: search for siblings via:
gh issue list --repo <owner>/<repo> --search "\"Related to #<parentId>\"" --state all --json number
Determine if last child: Check how many siblings are still open (excluding the current ticket):
gh issue list --repo <owner>/<repo> --search "\"Related to #<parentId>\"" --state open --json number
If the only open sibling is the current ticket → isLastChild = true
Store state for later use in commit, PR body, and labeling:
isChild — whether this ticket has a parentisLastChild — whether this is the last open child (triggers parent auto-close)parentId — the parent ticket number/IDEdge cases:
isLastChild = false (skip auto-close)### Child Tickets section on parent → use search fallbackIf ticketless mode: Skip the Attachments section entirely and proceed to Pre-flight Check.
If ticket mode: Read the attachments reference skill and follow its 4-step procedure to discover, present, download, and load ticket attachments. If no attachments are found or the user selects none, proceed to Pre-flight Check.
Store each attachment's file path for passing to subagents (subagents share the filesystem and can read attachments directly via Read).
Before fetching the ticket (or before proceeding in ticketless mode), read .claude/settings.json and .claude/config.json and verify the required permissions are present:
permissions.allow in .claude/settings.json contains at minimum:
Write(*)Edit(*).claude/config.json and check feature-specific permissions in permissions.allow:
mcpServers exists in config, for each server where value is true:
verify its tool permissions exist in permissions.allow
(Context7: mcp__plugin_ccflow_context7__resolve-library-id and mcp__plugin_ccflow_context7__query-docs;
project MCPs: mcp__<name>__*)context7Enabled: true exists (no mcpServers field), treat as mcpServers.context7: trueBash(gh *) existsgh auth status and verify it returns authenticatedIf any permissions are missing, offer to auto-fix by appending the missing entries:
"Missing permissions in
.claude/settings.json: [list missing items]. This will cause permission dialogs during the pipeline. I can auto-fix this by appending the missing entries to.claude/settings.json. Want me to fix it?"
If the user approves the auto-fix:
.claude/settings.jsonpermissions.allowpermissions.allow array.claude/settings.json backIf the user declines the auto-fix:
"OK, proceeding without fixing. You may see permission dialogs during the pipeline. Want to continue anyway?"
If the user says no → stop. If yes → proceed.
If ticketless mode: Skip the Ticket Readiness check entirely and proceed to the Pipeline.
If ticket mode: After fetching the ticket, inspect its labels/tags before starting the pipeline:
Check the issue's labels array.
If the ticket does not have a "Refined" label/tag, display a warning:
"This ticket hasn't been refined yet. Consider running
/ccflow:refine <ticket-id>first for better results. Do you want to proceed anyway?"
If the user says no → stop. If yes → proceed with the pipeline.
If the ticket is classified as frontend — its title, description, or acceptance criteria mention UI components, pages, views, layouts, forms, modals, visual design, styling, CSS, animations, themes, or frontend frameworks (React, Angular, Vue, Svelte, etc.) — and does not have a "Designed" label/tag and designSpec was not loaded (no DESIGN.md found), display a suggestion:
"This frontend ticket hasn't been designed yet. Consider running
/ccflow:design <ticket-id>first for a visual reference. Do you want to proceed anyway?"
If the ticket lacks the "Designed" label but a DESIGN.md exists (loaded as designSpec), skip the suggestion — the design spec is sufficient context.
If the user says no → stop. If yes → proceed with the pipeline. This is a soft-check — it never blocks implementation.
If the ticket has a ui:visual-check or Browser label, display a reminder:
"This ticket has the
ui:visual-checklabel. Ensureplaywright-cliis available for visual verification (playwright-cli screenshot,playwright-cli snapshot)."
This is informational only — it does not block the pipeline.
If ticketless mode: Skip this section.
If ticket mode: Before starting the pipeline, add the "Working" label to signal work in progress:
gh issue edit <number> --repo <owner>/<repo> --add-label "Working"
This pipeline has 9 phases. Execute them in order. Between major phases, report progress to the user. Read each phase file only when you reach that phase — do not read all files upfront.
| Phase | Title | Instructions |
|---|---|---|
| 1 | Plan | See Phase 1 section below |
| 2 | Worktree Setup | See Phase 2 section below |
| 3 | Test First (Red) | See Phase 3 section below |
| 4 | Implement (Green) | See Phase 4 section below |
| 5 | Refactor | See Phase 5 section below |
| 6 + 7 | Security + Code + Silent-Failure Review | See Phase 6 & 7 section below |
| 8 | Capture Lessons & Update Docs | See Phase 8 section below |
| 9 | Create PR & Label Ticket | See Phase 9 section below |
If hasPlanFile is true — skip Phase 1:
planCommitSha from front matter to git rev-parse HEAD. If they differ, warn the user:
"The codebase has changed since this plan was created (
planCommitShavs current HEAD). The plan may be stale. Continue anyway?" UseAskUserQuestionwith options: "Continue with existing plan", "Re-plan from scratch". If "Re-plan", delete the plan file and proceed with normal Phase 1.
## Ticket Details section. If the ticket was modified since plan creation, warn the user:
"The ticket has been modified since this plan was created. Review the changes and confirm."
If hasPlanFile is false — run Phase 1 normally:
Analyze the codebase, ask clarifying questions, produce a plan, and get explicit user approval.
CRITICAL — TWO MANDATORY STOPS IN THIS PHASE:
AskUserQuestion.AskUserQuestion.You MUST NOT proceed to Phase 2 in the same turn as either of these stops. Phase 2 can only begin in a NEW turn after the user selects "Approve".
COMMON FAILURE MODE: The model presents the plan's Risks section, calls AskUserQuestion, then immediately continues to Phase 2 in the same response. This is WRONG. Your response must END after AskUserQuestion — the user's reply starts a new turn.
Prerequisites: Ticket fetched (ticket mode) or task description parsed (ticketless mode), and pre-flight check passed.
Ownership: The planner subagent handles analysis only. The main agent handles all user interaction (questions and approval) via AskUserQuestion.
If ticket mode: Delegate to the planner agent with:
.claude/rules/lessons-learned.md.claude/rules/ filesdesignSpec was loaded): Include the full DESIGN.md content. Tell the planner: "A design spec is available. Include a Design Mapping section in the plan output that maps design components (from the Components table) to framework components that will be created or modified. Reference design tokens (CSS custom properties) where applicable.".pen file path (created by /ccflow:design), mention it to the planner so it knows a visual design exists. The planner should note this in its plan so the implementer can reference it during build./tmp/claude/attachments/mockup.png). For UI mockups/wireframes, tell the planner: "Read the attached files and ensure the implementation plan matches the visual design."If ticketless mode: Delegate to the planner agent with:
$ARGUMENTS as the primary specification.claude/rules/lessons-learned.md.claude/rules/ filesdesignSpec was loaded): Include the full DESIGN.md content. Tell the planner: "A design spec is available. Include a Design Mapping section in the plan output that maps design components to framework components. Reference design tokens where applicable."The planner reads and analyzes the codebase (existing patterns, affected files, dependencies) and returns:
## Clarifying QuestionsReference question categories the planner should evaluate (skip any already answered by the ticket):
Maximum 6 questions — only ask questions whose answers would change the plan.
After the planner returns, parse its output:
## Clarifying Questions sectionMANDATORY STOP — This step requires user interaction. Your turn MUST end with
AskUserQuestion.
If the planner returned clarifying questions:
## Clarifying Questions sectionAskUserQuestionIf the planner returned no questions, skip to Step 1D.
Re-invoke the planner agent with:
The planner produces a revised plan (and may include new clarifying questions).
If the revised plan contains new clarifying questions, loop back to Step 1B.
MANDATORY STOP — This step requires user interaction. Your turn MUST end with
AskUserQuestion.
Present the full plan text to the user as markdown output, then call AskUserQuestion. This is a gate — implementation CANNOT begin without explicit approval.
Output template — follow this structure exactly:
## Implementation Plan
<paste the planner's full plan here — files to modify, implementation steps, testing approach>
### Assumptions
<list each assumption for the user to verify>
### Open Questions
<list anything unresolved, or "None">
### Risks
<list risks for the user to accept>
If the task appears too large for a single PR, consider running `/refine` to split it first.
[Then call AskUserQuestion with Approve / Request Changes options]
WRONG — do not do this:
[present plan]
[call AskUserQuestion]
Now I'll proceed to Phase 2 and create the worktree...
git worktree add .worktrees/...
RIGHT — do this:
[present plan]
[call AskUserQuestion]
← your response ENDS here. Nothing else. No Phase 2. No worktree. No "I'll now proceed."
Explicit prohibitions after calling AskUserQuestion in this step:
Use AskUserQuestion with options:
If "Request Changes":
AskUserQuestion)Only proceed to Phase 2 after the user selects "Approve".
If the task appears too large to implement well in a single PR, recommend the user go back to /refine to split it into separate independent tickets (ticket mode) or narrow the scope of the description (ticketless mode) rather than attempting inline decomposition.
After the user approves the plan in Step 1D, persist it to disk before proceeding:
mkdir -p .claude/plans/---
version: 1
mode: ticket | ticketless
ticketId: 42
ticketTitle: "Add dark mode support"
slug: add-dark-mode
isChild: false
isLastChild: false
parentId: null
createdAt: 2026-03-04T10:30:00Z
status: approved
planCommitSha: abc123def
---
## Ticket Details
<verbatim ticket body or task description>
## User Context
<additional user context from arguments, or "None">
## Q&A from Planning
<numbered Q&A pairs from Steps 1B/1C, or "No questions asked">
## Implementation Plan
<full planner output: summary, assumptions, alternatives, files to modify/create, implementation order, risks>
## Architectural Context
<patterns, conventions, code structures discovered during planning exploration>
## Design Context
<DESIGN.md content or .pen file path if applicable, or "N/A">
## Attachment Summaries
<image/document summaries if applicable, or "None">
.claude/plans/<ticket-id>-<slug>.md.claude/plans/<slug>.mdplanCommitSha as the output of git rev-parse HEADticketId, ticketTitle, isChild, isLastChild, and parentId from the front matter..claude/plans/<filename>. You can continue now or resume in a new session."AskUserQuestion:
/ccflow:implement .claude/plans/<filename> to resume, or the SessionStart hook will remind you."If .claude/config.json contains "deepExploration": true, run an exploration step before Step 1A:
Launch 2 Explore-type subagents in parallel:
Feed their findings into the planner prompt alongside the ticket details. This produces deeper understanding for large codebases.
If deepExploration is not set or is false, skip directly to Step 1A (the default behavior).
GATE CHECK — Verify before proceeding:
If ANY of these are false, STOP. Go back to Step 1D.
After plan approval, create a git worktree for this feature.
First, verify at least one commit exists (required by git worktree add):
git rev-parse HEAD 2>/dev/null
If this fails (no commits exist), create an initial commit:
git add -A && git commit -m "chore: initial commit" --allow-empty
Use --allow-empty as a fallback in case there are no files to stage.
Then create the worktree:
git worktree add .worktrees/<ticket-id>-<description> -b feature/<ticket-id>-<description>
git worktree add .worktrees/<auto-slug> -b feature/<auto-slug>
All subsequent phases execute inside the worktree. The worktree directory is automatically within the sandbox's write scope since it's under CWD.
Delegate to the implementer agent. Tests should fail (red phase).
Prerequisites: Plan approved (or loaded from plan file), worktree created, working inside the worktree directory.
hasPlanFile is true: Source all of the above from the plan file's ## Implementation Plan and ## Architectural Context sections instead of conversation memory/tmp/claude/attachments/mockup.png) so the implementer can read them directly and write tests that reflect the expected UI structure and behaviordesignSpec was loaded, include the Components table and Design Tokens sections so tests can verify correct component structure and token usage<worktree-path>. First Bash command: cd <worktree-path>. CWD persists — do not cd again.Frontend stacks (Angular, React, Vue, Next.js, Svelte):
testing reference skill's UI Component Classification sectionBackend stacks:
Assert behavior and business rules:
Tests should be:
List of tests written with their current status (all should be failing). If any test passes before implementation, investigate — it may indicate the test isn't testing new behavior.
If tests can't be written (missing test infrastructure, unclear requirements):
Delegate to the implementer agent. Tests should pass (green phase).
Error recovery: If build or tests fail, the implementer retries up to 3 times. If still failing after 3 attempts, stop and ask the user.
Prerequisites: Tests written and failing (red phase complete).
Before delegating to the implementer, the main agent pre-reads design structure from the .pen file so the implementer subagent receives it as text context (subagents cannot use Pencil tools).
Identify relevant screens: From the ticket description and implementation plan, determine which screens (by node ID from designScreenIds) are affected by this ticket.
Read design structure and tokens:
CLI-app mode: Batch all reads into a single invocation:
pencil interactive -a desktop <<'EOF'
batch_get({ nodeIds: ["<screen-node-id-1>", "<screen-node-id-2>"], readDepth: 3 })
get_variables()
export_nodes({ nodeIds: ["<screen-node-id-1>", "<screen-node-id-2>"], outputDir: "$TMPDIR/design-screenshots", format: "png" })
EOF
Then Read each exported PNG for visual references to pass to the implementer.
Editor mode: Call each tool separately via MCP:
batch_get(nodeIds: [<screen-node-id>], readDepth: 3) per screenget_variables()get_screenshot(nodeId: <screen-node-id>) per screenStore the results as designStructure (component hierarchy), designTokenValues (tokens), and screenshot references.
If any Pencil call fails, inform the user which calls failed and what data will be missing. Proceed with DESIGN.md text content only — do not block implementation.
Pass to implementer: Include designStructure, designTokenValues, and screenshot references as text context in the implementer delegation prompt. If any data is missing due to failures, note which pieces are absent so the implementer knows the design context is partial. Tell the implementer: "Use this design structure for component hierarchy. Use design token values for spacing, colors, and typography. Compare your implementation visually against the provided screenshots."
hasPlanFile is true: Source context from the plan file's ## Implementation Plan and ## Architectural Context sections.
/tmp/claude/attachments/mockup.png) so the implementer can read them directly and match the expected visual designdesignSpec was loaded, include the full DESIGN.md content — component hierarchy, UI library mappings, CSS custom property references from design tokens. Tell the implementer: "Use the DESIGN.md component mappings and design tokens for implementation. Map design components to framework components as specified in the Components table. Use CSS custom properties from the Design Tokens section."lspServers in .claude/config.json has any enabled servers, tell the implementer: "LSP diagnostics are active — fix type errors and unused code after each edit"<worktree-path>. First Bash command: cd <worktree-path>. CWD persists — do not cd again.After all functional tests pass, if the plan's Test Strategy includes visual components:
playwright.config.* exists), write visual regression tests using toHaveScreenshot() — these run in CI and catch regressions automaticallyplaywright-cli open <url>, playwright-cli screenshot, playwright-cli snapshot for dev verification — layout inspection, CSS debugging, responsive behavior. Playwright CLI verifications are ephemeral and do NOT replace Playwright Test.See the testing skill's "Browser Testing Tools" section for the full decision framework.
After functional tests pass and standard visual verification is complete:
Screenshot comparison: Use the screenshot references captured during Design Structure Pre-Reading. If not available (pre-reading was skipped or failed):
CLI-app mode:
pencil interactive -a desktop <<'EOF'
export_nodes({ nodeIds: ["<screen-node-id>"], outputDir: "$TMPDIR/design-comparison", format: "png" })
snapshot_layout({ parentId: "<screen-node-id>", problemsOnly: true })
EOF
Then Read the exported PNG for comparison.
Editor mode: Call get_screenshot(nodeId: <screen-node-id>) and snapshot_layout(parentId: <screen-node-id>, problemsOnly: true) via MCP.
Compare side-by-side with the Playwright screenshot of the implemented page. Note any significant visual discrepancies.
Layout verification: Review the snapshot_layout output for clipping, overflow, or misalignment issues that might indicate the implementation diverges from the design.
If discrepancies are found, list them and delegate fixes to the implementer. Re-run the comparison after fixes. Only proceed to Phase 5 once comparison passes or the user explicitly accepts the remaining gaps.
If Pencil is unavailable (pencilAvailable = false), skip this section and note in the PR description that design comparison was not performed.
.claude/rules/ files.claude/rules/lessons-learned.mdAfter implementation:
If build or tests fail:
Delegate to the implementer agent. Run tests after — must still pass.
Prerequisites: All tests passing (green phase complete).
lspServers in .claude/config.json has any enabled servers, tell the implementer: "Use LSP diagnostics to identify unused code during refactoring"<worktree-path>. First Bash command: cd <worktree-path>. CWD persists — do not cd again.If tests fail after refactoring:
These phases are independent read-only operations and MUST run in parallel.
Gather shared context ONCE before launching reviewers — batch all git operations into a single Bash call to minimize round-trips:
echo "===DIFF===" && git diff && echo "===FILES===" && git diff --name-only && echo "===STAT===" && git diff --stat
Parse the output by delimiter to extract: full diff (between ===DIFF=== and ===FILES===), changed file list (between ===FILES=== and ===STAT===), and diff summary stats (after ===STAT===). Also have the original ticket requirements and the approved implementation plan ready from earlier phases — do not re-fetch them. If hasPlanFile is true: Source ticket requirements from the plan file's ## Ticket Details section and the implementation plan from ## Implementation Plan.
Launch ALL THREE reviewers as parallel Task tool calls in a SINGLE message:
All agents receive the pre-gathered diff so none need to run git diff independently.
Wait for all to complete, then process results by priority — security-critical findings first:
Delegate to the security-reviewer agent. If Critical or High findings: fix them (delegate back to implementer), re-run tests, re-review. If fix is unclear, stop and ask the user.
Prerequisites: Tests pass, refactoring complete, shared diff context gathered.
git diff again)The agent returns findings with severity levels (Critical/High/Medium/Low), plus a Passed Checks checklist.
If the security reviewer identifies an issue but the fix is unclear:
Delegate to the code-reviewer agent. Fix "Must Fix" issues (confidence >= 90). Note anything needing human decision.
Prerequisites: Tests pass, refactoring complete, shared diff context gathered.
git diff again)lspServers in .claude/config.json has any enabled servers, tell the code-reviewer: "LSP servers are active — unaddressed warnings are high-confidence findings"The agent returns issues with confidence scores, categorized as:
Plus a Passing Checks checklist and Verdict (APPROVE / APPROVE_WITH_SUGGESTIONS / REQUEST_CHANGES).
If the reviewer returns REQUEST_CHANGES:
Delegate to the silent-failure-hunter agent. This runs in parallel with the security and code reviewers.
Skip entirely if no self-corrections occurred and no doc updates are warranted.
Prerequisites: Code review and security review complete, all fixes applied.
Delegate to the lessons-collector agent. Skip if no self-corrections occurred during the session.
.claude/rules/lessons-learned.md in the target projectSkip Step 8A if no self-corrections occurred during the session.
Each lesson must be:
findOne instead of findUnique in Prisma" not "Made a mistake"If .claude/rules/lessons-learned.md doesn't exist, create it with a header.
If it exceeds 100 entries, suggest consolidating related entries into permanent rules in .claude/rules/<topic>.md.
Update when:
Do NOT update for:
lessons-learned.mdProcess:
claudeMdLocation from .claude/config.json (default: .claude/CLAUDE.md)## Critical Rules as bullet pointsUpdate when:
Do NOT update for:
Process:
README.md at project rootRebase on latest main, then handle commit, push, and PR creation.
Prerequisites: Code review complete, all Must Fix items resolved, tests pass. Network access required for git fetch.
If hasPlanFile is true: Source ticketId, slug, isChild, isLastChild, and parentId from the plan file's front matter for commit messages, branch names, and PR body references.
Fetch and rebase onto the latest main branch to catch conflicts before creating the PR:
git fetch origin main
git rebase origin/main
If rebase succeeds: Re-run the full build and test suite to verify nothing broke.
If rebase fails (conflicts): Abort the rebase, stop the pipeline, and report to the user:
git rebase --abort
Report the conflicting files and provide manual resolution steps:
git rebase origin/main manuallygit rebase --continueStage and commit all changes with conventional commit format:
git add -A
git commit -m "<type>(<scope>): <description>
<body if needed>
<ticket-ref>"
If ticket mode: Include a ticket reference in the commit message: #<id> or Fixes #<id>.
If isLastChild is true, add a second ticket reference line for the parent:
Fixes #<childId>
Fixes #<parentId>
This causes the PR to auto-close both the child and parent on merge.
If not last child, just Fixes #<childId> (unchanged).
If ticketless mode: Use a conventional commit with no ticket reference. Omit the <ticket-ref> line.
Try to push the branch:
git push -u origin feature/<ticket-id>-<description>
git push -u origin feature/<auto-slug>
If the push fails (e.g., sandbox network restriction, SSH remote), do the following:
Create the PR using gh pr create.
Write the body to a temp file first, then read it back. Do not put the body inline as a single string or use heredocs (they fail in the sandbox).
If ticket mode, include the ## Ticket section in the PR body:
isLastChild is true: The Ticket section should contain both child and parent references:
Fixes #<childId>
Fixes #<parentId> (parent — all children complete)
isChild but NOT isLastChild: The Ticket section should contain:
Fixes #<childId>
Related to #<parentId> (parent — N siblings still open)
(Use Related to instead of Fixes so the parent is NOT auto-closed.)Fixes #<id> reference.printf '%s' '## Summary
<1-2 sentences describing the change>
## Ticket
<ticket references as described above>
## Changes
- <change 1>
- <change 2>
- <change 3>
## Testing
<how it was tested — what tests were written, what was verified>
## Checklist
- [x] Tests pass
- [x] Security review done
- [ ] Documentation updated
## Notes
<any Medium/Low security findings or Should Fix items, or "None">' > /tmp/claude/pr-body.md
BODY=$(cat /tmp/claude/pr-body.md)
gh pr create --title "<type>(<scope>): <description>" --body "$BODY"
If ticketless mode, omit the ## Ticket section from the PR body. The template becomes:
printf '%s' '## Summary
<1-2 sentences describing the change>
## Changes
- <change 1>
- <change 2>
- <change 3>
## Testing
<how it was tested — what tests were written, what was verified>
## Checklist
- [x] Tests pass
- [x] Security review done
- [ ] Documentation updated
## Notes
<any Medium/Low security findings or Should Fix items, or "None">' > /tmp/claude/pr-body.md
BODY=$(cat /tmp/claude/pr-body.md)
gh pr create --title "<type>(<scope>): <description>" --body "$BODY"
If ticketless mode: Skip Step 5.
If ticket mode: After PR creation, replace the "Working" label with "Implemented" on the ticket:
gh issue edit <number> --repo <owner>/<repo> --add-label "Implemented" --remove-label "Working"
If isLastChild is true, also label the parent ticket as "Implemented":
gh issue edit <parentId> --repo <owner>/<repo> --add-label "Implemented"
(GitHub auto-closes the parent via Fixes #<parentId> in the PR body on merge.)
git rebase --abort), report conflicting files, provide manual resolution steps, stop the pipelinegh auth status, retry onceIf hasPlanFile is true: After successful PR creation (Step 4 completes), delete the consumed plan file:
rm .claude/plans/<plan-filename>.md
If the .claude/plans/ directory is now empty, remove it too:
rmdir .claude/plans/ 2>/dev/null
This prevents stale plan files from accumulating. If the pipeline fails before PR creation, the plan file is preserved so the user can retry.
npx claudepluginhub matteobortolazzo/claude-tools --plugin ccflowGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.