skills/setup-new-work/SKILL.md
Use when starting work on a Jira ticket. Fetches ticket details via Atlassian MCP (for branch naming and a local story snapshot), creates an isolated git worktree with branch feature/<ticket-id>-<slug>-<platform>, and writes docs/<ticket-id>/<ticket-id>.md in the worktree.
npx skillsauth add shysssthanhtri/AI-tools setup-new-workInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Set up a clean, isolated workspace for a Jira ticket by creating a git worktree and a feature branch that includes the AI platform in the name.
You are a senior software engineer who values clean, isolated workspaces. Before writing any code you want an isolated branch and worktree. You fetch the ticket to derive a branch slug from the summary and to persist a local story snapshot next to that work. You do not create plan.md, progress.md, or other planning artefacts here—the plan-jira-ticket skill owns those.
docs/<ticket-id>/<ticket-id>.md inside the new worktree with a team-usable brief (summary, description, status, priority, type, people, labels, parent/epic, subtasks, links, timestamps, and notes). Match the intent of plan-jira-ticket Step 1b so planning can assume the file exists.CM-4873). If not provided, ask for it before proceeding../worktrees/<ticket-id>-<platform> relative to the current repository root, where <platform> is the detected or user-specified AI platform name (see Parameters).
/Users/dev/repos/bridge-keeper and platform is copilot, the worktree is at /Users/dev/repos/bridge-keeper/worktrees/CM-4873-copilot.cursor, the worktree is at /Users/dev/repos/bridge-keeper/worktrees/CM-4873-cursor.feature/<ticket-id>-<slug>-<platform> where <slug> is a 3–5 word summary derived from the Jira ticket summary, and <platform> matches the worktree folder suffix.& with and.a, an, the, to, for, of, in, on, with).-, collapse repeated dashes, trim leading/trailing dashes.work-item.plan.md or progress.md, or run a full codebase planning pass—that is plan-jira-ticket.docs/<ticket-id>/<ticket-id>.md inside the worktree (not optional).Call mcp_com_atlassian_getAccessibleAtlassianResources to obtain the cloudId.
Call mcp_com_atlassian_getJiraIssue with:
cloudId from Step 1issueIdOrKey = the ticket key provided by the userresponseContentFormat = markdownFrom the response, capture at least Summary (for the slug), Status, and enough fields to populate docs/<ticket-id>/<ticket-id>.md (e.g. description, priority, type, assignee, reporter, labels, parent, subtasks, issuelinks, components, fixVersions, created/updated). Request additional fields from the API if the default payload is thin.
If the Jira lookup fails, stop and ask the user to verify the ticket key.
Use this snippet to generate a deterministic slug from the Jira summary:
summary="<jira-summary-text>"
slug="$(
printf '%s' "$summary" \
| tr '[:upper:]' '[:lower:]' \
| sed -E 's/&/ and /g' \
| sed -E 's/[^a-z0-9 ]+/ /g' \
| tr -s ' ' \
| sed -E 's/^ +| +$//g' \
| awk '{
out_count=0;
for (i=1; i<=NF; i++) {
w=$i;
if (w=="a" || w=="an" || w=="the" || w=="to" || w=="for" || w=="of" || w=="in" || w=="on" || w=="with") {
continue;
}
out[++out_count]=w;
if (out_count==5) break;
}
for (i=1; i<=out_count; i++) {
printf "%s%s", out[i], (i<out_count?"-":"");
}
}' \
| sed -E 's/-+/-/g; s/^-+|-+$//g' \
| cut -c1-32 \
| sed -E 's/-+/-/g; s/^-+|-+$//g'
)"
if [ -z "$slug" ]; then
slug="work-item"
fi
echo "$slug"
Determine the <platform> value. If the user provided one explicitly, use it. Otherwise auto-detect:
CURSOR_TRACE_DIR or CURSOR_CHANNEL is set → cursorVSCODE_GIT_ASKPASS_NODE is set or TERM_PROGRAM contains vscode → copilotif [ -n "$CURSOR_TRACE_DIR" ] || [ -n "$CURSOR_CHANNEL" ]; then
platform="cursor"
elif [ -n "$VSCODE_GIT_ASKPASS_NODE" ] || [[ "${TERM_PROGRAM:-}" == *vscode* ]]; then
platform="copilot"
else
platform="ai" # fallback; ask user if needed
fi
echo "$platform"
Determine the repository root:
repo_root="$(git rev-parse --show-toplevel)"
Create a new branch and worktree in one command:
mkdir -p "$repo_root/worktrees"
git worktree add -b "feature/<ticket-id>-<slug>-<platform>" "$repo_root/worktrees/<ticket-id>-<platform>" HEAD
This creates the branch from the current HEAD and checks it out in the new worktree directory. The branch name includes the same <platform> suffix as the worktree folder.
Verify the worktree was created:
git worktree list
Inside the worktree (not the main repo root unless they are the same), create the ticket brief:
mkdir -p "$repo_root/worktrees/<ticket-id>-<platform>/docs/<ticket-id>"$repo_root/worktrees/<ticket-id>-<platform>/docs/<ticket-id>/<ticket-id>.md using the Jira data from Step 2. Structure it as a readable brief: title, summary, type/status/priority, people, description (or “none”), labels, parent epic, subtasks, linked issues, sprint/acceptance criteria if present in the API, Jira timestamps, and a short Notes section (e.g. regenerate if Jira changes).If a file already exists at that path, overwrite only when re-running setup for the same ticket and the user expects a refresh; otherwise skip or ask.
Print a summary to the user:
✅ Workspace ready
Ticket: <ticket-id> — <summary>
Platform: <platform>
Worktree: ./worktrees/<ticket-id>-<platform>
Branch: feature/<ticket-id>-<slug>-<platform>
Story: ./worktrees/<ticket-id>-<platform>/docs/<ticket-id>/<ticket-id>.md
| Parameter | Required | Description | Example |
|-------------|----------|-------------------------------------------------------|------------|
| ticket-id | Yes | The Jira ticket key | CM-4873 |
| platform | No | AI platform name. Auto-detected if not provided. | copilot, cursor |
| Setting | Value |
|---------------------|------------------------------------------------|
| Worktree folder | ./worktrees/<ticket-id>-<platform> |
| Branch format | feature/<ticket-id>-<slug>-<platform> |
| Max slug length | 32 characters |
| Slug word count | 3–5 meaningful words |
| Platform detection | Auto: cursor or copilot from env vars |
CM-4873, platform copilotSummary: "Add retry logic for payment webhooks"
Worktree: ./worktrees/CM-4873-copilot
Branch: feature/CM-4873-add-retry-logic-payment-webhooks-copilot
ENG-101, platform cursorSummary: "Fix the broken & flaky CI pipeline tests"
Worktree: ./worktrees/ENG-101-cursor
Branch: feature/ENG-101-fix-broken-and-flaky-ci-cursor
Before reporting completion, verify all of the following:
./worktrees/<ticket-id>-<platform>.feature/<ticket-id>-<slug>-<platform> is checked out in the worktree.docs/<ticket-id>/<ticket-id>.md exists in the worktree with story details from Jira.plan.md or progress.md was created by this skill (those belong to plan-jira-ticket).testing
Execute an existing Jira ticket implementation plan phase by phase. Use when asked to "work on ticket CM-1234", "implement the plan for CM-1234", "start working on the plan", or "execute the next phase". Reads the plan from docs/<ticket-id>/plan.md, captures a pre-implementation full test baseline in plan/progress docs, presents each phase for user approval before coding, updates progress after each phase, and operates inside the dedicated git worktree. After the last phase is committed, runs the full test suite, fixes regressions (skipping known pre-existing failures), then presents a full change summary for user review and creates a GitHub draft PR using the create-draft-pr skill.
tools
Generate a complete MCP server project in TypeScript with tools, resources, and proper configuration
documentation
Create a work plan for a Jira ticket. Use when asked to plan work, create a plan for a ticket, break down a Jira issue, or prepare implementation steps for a Jira ticket ID like CM-1234. Reads local ticket details, deeply analyzes requirements and root causes, proposes up to three optimized solutions (not workarounds) with pros and cons, asks the user to choose, then finalizes the plan with that choice under docs/<ticket-id>/.
development
Create new Agent Skills for GitHub Copilot from prompts or by duplicating this template. Use when asked to "create a skill", "make a new skill", "scaffold a skill", or when building specialized AI capabilities with bundled resources. Generates SKILL.md files with proper frontmatter, directory structure, and optional scripts/references/assets folders.