QRSPI: Init
Context
Bootstrap the feature workspace. Takes a ticket source (free text, GitHub issue URL/shorthand, ClickUp task ID/URL, or a local file), creates the spec directory structure, writes the initial ticket artifact and manifest, and creates the git branch. This is the entry point for the entire QRSPI workflow (Questions → Research → Design → Structure → Plan → Worktree → Implement → PR).
Instructions
Determine the ticket source from the user's message:
- GitHub issue URL (contains
github.com and /issues/) → extract owner/repo and issue number
- GitHub issue shorthand (
#42 or org/repo#42) → extract issue number
- ClickUp task URL (contains
app.clickup.com/t/) or a bare ClickUp task ID (typically a 6-9 character alphanumeric string, e.g. 86pjqmz) → treat as ClickUp
- A path to an existing local file (ends in
.md/.txt, or otherwise resolves via view/ls to a real file on disk) → treat as a local file source
- Anything else → treat as free text description
- If the source is ambiguous or missing, ask the user for it before proceeding.
Fetch ticket content based on type:
- GitHub URL or shorthand: Run
gh issue view <number> --json title,body,labels,assignees,comments and capture the full output
- ClickUp task: Use the
clickup_get_task tool (ClickUp MCP server) with the extracted task ID to fetch title, description, status, assignees, and tags. If comments add useful context, also call clickup_get_task_comments. If the ClickUp MCP server is unavailable, ask the user to paste the ticket content instead.
- Local file: Read the file's full contents as-is (preserve any existing headers/structure). Note the original file path so it can be recorded as the source and, if this is a pre-written design/spec doc rather than a short ticket, still copy it in verbatim — do not summarize or truncate it.
- Free text: Use the provided text directly as the ticket content
Derive {feature-name} from the ticket title (or first line of free text):
- Lowercase, replace non-alphanumeric chars with hyphens, collapse multiple hyphens, trim leading/trailing hyphens
- Limit to 50 characters
- Present the proposed name to the user for confirmation or override
Wait for user confirmation of the feature name. Accept any override they provide.
Derive {repo} by running:
source ~/.copilot/scripts/qrspi-utils.sh && qrspi_repo_name
Create the spec directory:
mkdir -p .copilot-qrspi/{repo}/specs/{feature-name}
Write ticket.md to the spec directory with:
- A YAML-style header with source type, source URL (if applicable), and date
- The raw ticket content (title, body, labels, comments — whatever was fetched)
- Any metadata from the source (assignees, labels, ClickUp status, etc.)
Write manifest.json to the spec directory:
{
"feature": "{feature-name}",
"repo": "{repo}",
"branch": "{feature-name}",
"created": "ISO-8601-timestamp",
"ticket_source": "github|clickup|file|text",
"phases": {
"init": { "status": "complete", "completed_at": "ISO-8601-timestamp" },
"questions": { "status": "pending" },
"research": { "status": "pending" },
"design": { "status": "pending" },
"structure": { "status": "pending" },
"plan": { "status": "pending" },
"worktree": { "status": "pending" },
"implement": { "status": "pending" },
"pr": { "status": "pending" }
}
}
Create the .cache/ subdirectory inside the spec folder for future sub-agent scratch work:
mkdir -p .copilot-qrspi/{repo}/specs/{feature-name}/.cache
Check if the git branch {feature-name} already exists:
- If it exists locally, check it out
- If not, create and checkout:
git checkout -b {feature-name}
- Exception: Only skip this branch creation/checkout step if the user has explicitly stated they want to stay on their current branch (e.g. "use my current branch", "don't create a new branch", "I already have a branch with work on it, use this one"). In that case, record the current branch name (
git branch --show-current) as "branch" in the manifest instead, and do not run git checkout -b. Never infer this on your own from branch name or existing changes — only act on an explicit statement from the user.
Confirm to the user:
- Feature name and branch created
- Spec directory path
- Summary of the ticket content
- Prompt them to proceed with the
qrspi-questions skill when ready
Output Format
ticket.md:
---
source: github|clickup|file|text
url: <source-url-if-applicable>
path: <original-local-file-path-if-applicable>
date: YYYY-MM-DD
---
# <Ticket Title>
<Full ticket body / description>
## Metadata
- Labels: ...
- Assignees: ...
- Comments: ...
manifest.json: JSON object as specified in step 8.
Human Checkpoint
Present the derived feature name and branch name before creating them. The user must confirm or provide an override. Do not create the branch or directories until confirmed.
1---2name: qrspi-init3description: QRSPI Phase 0: Init — Bootstrap a feature workspace from a ticket, issue, or description. Use when the user wants to start the QRSPI workflow (Questions-Research-Spec-Plan-Implement) for a new feature, or explicitly says 'qrspi init' / 'start qrspi'.4---56# QRSPI: Init78## Context910Bootstrap the feature workspace. Takes a ticket source (free text, GitHub issue URL/shorthand, ClickUp task ID/URL, or a local file), creates the spec directory structure, writes the initial ticket artifact and manifest, and creates the git branch. This is the entry point for the entire QRSPI workflow (Questions → Research → Design → Structure → Plan → Worktree → Implement → PR).1112## Instructions13141. Determine the ticket source from the user's message:15 - GitHub issue URL (contains `github.com` and `/issues/`) → extract owner/repo and issue number16 - GitHub issue shorthand (`#42` or `org/repo#42`) → extract issue number17 - ClickUp task URL (contains `app.clickup.com/t/`) or a bare ClickUp task ID (typically a 6-9 character alphanumeric string, e.g. `86pjqmz`) → treat as **ClickUp**18 - A path to an existing local file (ends in `.md`/`.txt`, or otherwise resolves via `view`/`ls` to a real file on disk) → treat as a **local file** source19 - Anything else → treat as free text description20 - If the source is ambiguous or missing, ask the user for it before proceeding.21222. Fetch ticket content based on type:23 - **GitHub URL or shorthand:** Run `gh issue view <number> --json title,body,labels,assignees,comments` and capture the full output24 - **ClickUp task:** Use the `clickup_get_task` tool (ClickUp MCP server) with the extracted task ID to fetch title, description, status, assignees, and tags. If comments add useful context, also call `clickup_get_task_comments`. If the ClickUp MCP server is unavailable, ask the user to paste the ticket content instead.25 - **Local file:** Read the file's full contents as-is (preserve any existing headers/structure). Note the original file path so it can be recorded as the source and, if this is a pre-written design/spec doc rather than a short ticket, still copy it in verbatim — do not summarize or truncate it.26 - **Free text:** Use the provided text directly as the ticket content27283. Derive `{feature-name}` from the ticket title (or first line of free text):29 - Lowercase, replace non-alphanumeric chars with hyphens, collapse multiple hyphens, trim leading/trailing hyphens30 - Limit to 50 characters31 - Present the proposed name to the user for confirmation or override32334. Wait for user confirmation of the feature name. Accept any override they provide.34355. Derive `{repo}` by running:36 ```bash37 source ~/.copilot/scripts/qrspi-utils.sh && qrspi_repo_name38 ```39406. Create the spec directory:41 ```bash42 mkdir -p .copilot-qrspi/{repo}/specs/{feature-name}43 ```44457. Write `ticket.md` to the spec directory with:46 - A YAML-style header with source type, source URL (if applicable), and date47 - The raw ticket content (title, body, labels, comments — whatever was fetched)48 - Any metadata from the source (assignees, labels, ClickUp status, etc.)49508. Write `manifest.json` to the spec directory:51 ```json52 {53 "feature": "{feature-name}",54 "repo": "{repo}",55 "branch": "{feature-name}",56 "created": "ISO-8601-timestamp",57 "ticket_source": "github|clickup|file|text",58 "phases": {59 "init": { "status": "complete", "completed_at": "ISO-8601-timestamp" },60 "questions": { "status": "pending" },61 "research": { "status": "pending" },62 "design": { "status": "pending" },63 "structure": { "status": "pending" },64 "plan": { "status": "pending" },65 "worktree": { "status": "pending" },66 "implement": { "status": "pending" },67 "pr": { "status": "pending" }68 }69 }70 ```71729. Create the `.cache/` subdirectory inside the spec folder for future sub-agent scratch work:73 ```bash74 mkdir -p .copilot-qrspi/{repo}/specs/{feature-name}/.cache75 ```767710. Check if the git branch `{feature-name}` already exists:78 - If it exists locally, check it out79 - If not, create and checkout: `git checkout -b {feature-name}`80 - **Exception:** Only skip this branch creation/checkout step if the user has explicitly stated they want to stay on their current branch (e.g. "use my current branch", "don't create a new branch", "I already have a branch with work on it, use this one"). In that case, record the current branch name (`git branch --show-current`) as `"branch"` in the manifest instead, and do not run `git checkout -b`. Never infer this on your own from branch name or existing changes — only act on an explicit statement from the user.818211. Confirm to the user:83 - Feature name and branch created84 - Spec directory path85 - Summary of the ticket content86 - Prompt them to proceed with the `qrspi-questions` skill when ready8788## Output Format8990**ticket.md:**91```markdown92---93source: github|clickup|file|text94url: <source-url-if-applicable>95path: <original-local-file-path-if-applicable>96date: YYYY-MM-DD97---9899# <Ticket Title>100101<Full ticket body / description>102103## Metadata104- Labels: ...105- Assignees: ...106- Comments: ...107```108109**manifest.json:** JSON object as specified in step 8.110111## Human Checkpoint112113Present the derived feature name and branch name before creating them. The user must confirm or provide an override. Do not create the branch or directories until confirmed.