| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Invoke | /zenhub:init-workspace |
| Category | dev-cycle-workflow |
| Complexity | simple |
| MCP Servers | zenhub |
/zenhub:init-workspace โ ์์ ๋ณด๋ ์ด๊ธฐ ์ธํ #
ํ๋ง๋๋ก#
์ ํ๋ก์ ํธ๋ฅผ ์์ํ ๋ ZenHub ์์ ๋ณด๋(์นธ๋ฐ)์ ์นธ๋ค์ ํ์ค ํํ๋ก ํ ๋ฒ์ ์ ๋ฆฌํด ์ฃผ๋ ๋ช ๋ น์ ๋๋ค. ์ด์ฌ ๋ค์ด๊ฐ๊ธฐ ์ ์ ๋น ๋ฐฉ์ ๋๊ฐ์ ๊ท๊ฒฉ์ ์ ๋ฆฌ ์ ๋ฐ์ ๋ฏธ๋ฆฌ ์ง ๋ฃ์ด ๋๋ ๊ฒ๊ณผ ๊ฐ์์.
๋๊ฐยท์ธ์ ์ฐ๋์#
- ZenHub ์์ ๊ณต๊ฐ์ ์ GitHub ์ ์ฅ์๋ฅผ ๋ง ์ฐ๊ฒฐํ ์งํ
- ํ๋ง๋ค ์ ๊ฐ๊ฐ์ธ ๋ณด๋ ์นธ ๊ตฌ์กฐ๋ฅผ ํ์ค ํํ๋ก ํต์ผํ๊ณ ์ถ์ ๋
/dev:run๊ฐ์ ๊ฐ๋ฐ ์๋ํ ํ๋ฆ์ ๋ณธ๊ฒฉ์ ์ผ๋ก ์์ํ๊ธฐ ์ ์ด๊ธฐ ์ธํ ์ผ๋ก
๋ฌด์์ ํด์ฃผ๋์#
-
์์
๋ณด๋๋ฅผ ํ์ค 6์นธ ๊ตฌ์กฐ๋ก ์ ๋ฆฌํฉ๋๋ค:
New Issues โ Icebox โ Product Backlog โ Sprint Backlog โ In Progress โ Review/QA - ๋ ์ด์ ์ฐ์ง ์๋ Done ์นธ์ ๋น์๋๋ค โ ๊ทธ ์์ ๋จ์ ์๋ ์ผ๊ฐ์ ๋ชจ๋ ์๋์ผ๋ก ์๋ฃ(Closed) ์ฒ๋ฆฌํฉ๋๋ค. (์๋ฃ๋ ์ด์ PR์ด ํฉ์ณ์ง ๋ ์๋์ผ๋ก ์ฒ๋ฆฌ๋๋ฏ๋ก Done ์นธ์ด ํ์ ์์ต๋๋ค.)
-
์ ์ฅ์ยท์กฐ์งยท์ผ๊ฐ ์ข
๋ฅยท๊ฐ ์นธ์ ID๋ฅผ ํ๊ณณ์ ๋ชจ์ ๋ ์ค์ ํ์ผ
.claude/config/bmad/zenhub-conventions.yaml์ ์๋์ผ๋ก ๋ง๋ค์ด ์ค๋๋ค. (๋ค์ ๋ช ๋ น๋ค์ด ๋งค๋ฒ ๋ค์ ์กฐํํ์ง ์๊ณ ๋น ๋ฅด๊ฒ ์ธ ์ ์๊ฒ ํด ์ฃผ๋ ์ผ์ข ์ ์ฃผ์๋ก์ ๋๋ค.) - ํ๋ก์ ํธ์
.mcp.json์ ZenHub ์ฐ๊ฒฐ ์ค์ ์ด ์ ๋๋ก ๋ค์ด ์๋์ง ํ์ธํด ์ค๋๋ค. - ๋ง์ง๋ง์ "๋ฌด์์ด ๋๋ฌ๊ณ , ๋ฌด์์ ์์ผ๋ก ๋ ํด์ผ ํ๋์ง" ์ ๋ฆฌํ ๋ณด๊ณ ์๋ฅผ ๋ณด์ฌ ์ค๋๋ค.
์ฐธ๊ณ : ZenHub์ ๊ธฐ์ ์ ์ ์ฝ ๋๋ฌธ์ ์นธ์ ์ง์ ์ง์ฐ๊ฑฐ๋ ์๋ก ์ถ๊ฐํ๋ ์์ ์ ์ฌ๋์ด ์์ผ๋ก ํด์ผ ํฉ๋๋ค. ๋ช ๋ น์ ์ด๋์ ๋ฌด์์ ๋๋ฌ์ผ ํ๋์ง ๋งํฌ์ ํจ๊ป ์๋ด๋ง ํด ์ค๋๋ค.
์ด๋ป๊ฒ ์ฐ๋์#
# ๊ธฐ๋ณธ โ ์์
๊ณต๊ฐ ID๋ฅผ .mcp.json์์ ์๋์ผ๋ก ์ฝ์ด ์ต๋๋ค
/zenhub:init-workspace
# ์์
๊ณต๊ฐ ID๋ฅผ ์ง์ ์ง์ ํ ๋
/zenhub:init-workspace --workspace-id 69c4c110fc3a90000f3387d9
--workspace-id ๋ ์๋ตํด๋ ๋ฉ๋๋ค. ์๋ตํ๋ฉด ํ๋ก์ ํธ์ .mcp.json ํ์ผ์์ ID๋ฅผ ์์์ ์ฐพ์ต๋๋ค.
์์์ ๋ฌด์จ ์ผ์ด ๋ฒ์ด์ง๋์#
- ํํฉ ์กฐํ โ ์ง๊ธ ์์ ๋ณด๋์ ์ด๋ค ์นธ๋ค์ด ์๊ณ , ์ด๋ค ์ ์ฅ์๊ฐ ์ฐ๊ฒฐ๋ผ ์๋์ง ์ฝ์ด ์ต๋๋ค.
- ํ์ค๊ณผ ๋น๊ต โ ํ์ฌ ์นธ ๋ชฉ๋ก์ ํ์ค 6์นธ๊ณผ ๊ฒฌ์ค์ ๋น ์ง ์นธ, ์ง์์ผ ํ Done ์นธ, ํ์ค์ ์๋ ๋ณ๋ ์นธ์ ๊ฐ๋ ค๋ ๋๋ค.
- ๋ถ์ ๋ณด๊ณ โ "ํ์ฌ ์ํ / ์ถ๊ฐ๊ฐ ํ์ํ ์์ "์ ํ๋ก ๋ณด์ฌ ์ค๋๋ค.
- Done ์นธ ์ ๋ฆฌ โ Done ์นธ์ ๋จ์ ์ผ๊ฐ์ ๋ชจ๋ ์๋ฃ(Closed) ์ฒ๋ฆฌํ๊ณ , Done ์นธ ์์ฒด๋ฅผ ์ง์ฐ๋ ๋ฐฉ๋ฒ(์ฃผ์์ ํด๋ฆญ ์์น)์ ์๋ดํฉ๋๋ค.
- ์ผ๊ฐ ์ข ๋ฅ ์กฐํ โ EpicยทFeatureยทTaskยทBug ๊ฐ์ ์ผ๊ฐ ์ ํ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
- ์ค์ ํ์ผ ์์ฑ โ ์์์ ๋ชจ์ ID๋ค์
zenhub-conventions.yamlํ์ผ๋ก ์ ์ฅํฉ๋๋ค. - ์ฐ๊ฒฐ ์ค์ ํ์ธ โ
.mcp.json์ ZenHub ์ค์ ์ด ์๋์ง ์ ๊ฒํฉ๋๋ค. -
์๋ฃ ๋ณด๊ณ โ ๋๋ ์ผ๊ณผ ์ฌ๋์ด ์์ผ๋ก ํด์ผ ํ ๋ค์ ๋จ๊ณ(๋น ์ง ์นธ ์ถ๊ฐ, Done ์นธ ์ญ์ ,
/dev:run์์)๋ฅผ ์ ๋ฆฌํด ๋ณด์ฌ ์ค๋๋ค.
โ๏ธ ์์ธ ์ต์ ยท์คํ ๋ช ์ธ (๊ฐ๋ฐ์ / AI ์์ด์ ํธ์ฉ)
Triggers#
- Right after adding a new GitHub repo to a ZenHub workspace
- When you want to standardize workspace pipeline structure
- Initial setup before starting development workflows like
/dev:run
Context Trigger Pattern#
/zenhub:init-workspace [--workspace-id < id > ]Parameters#
| Parameter | Required | Description | Example |
|---|---|---|---|
--workspace-id | Optional | Workspace ID (reads from .mcp.json if omitted) | 69c4c110fc3a90000f3387d9 |
Standard Pipeline Structure#
After initialization, the workspace should contain only these pipelines:
New Issues โ Icebox โ Product Backlog โ Sprint Backlog โ In Progress โ Review/QA| Pipeline | Purpose | Notes |
|---|---|---|
| New Issues | Newly created issues | Auto-placement |
| Icebox | On hold/low priority | Optional |
| Product Backlog | Approved backlog | After triage |
| Sprint Backlog | Assigned to current sprint | During sprint planning |
| In Progress | Work in progress | On branch creation |
| Review/QA | Code review/QA | On PR creation |
Done pipeline is not used. Issues auto-close via GitHub
Closes #keyword on PR merge.
Execution Flow#
Step 1: Query Workspace Info#
const workspace = await mcp__zenhub__getWorkspacePipelinesAndRepositories();Extract from query results:
workspace.pipelinesโ Current pipeline listworkspace.githubRepositoriesโ Connected repo list (ํ๋๋ช :githubRepositories,repositories์๋)workspace.zenhubOrganization.idโ Organization ID (setDatesForIssue์zenhubOrganizationId)
Step 2: Analyze Current Pipelines#
Compare current pipeline list with the standard structure:
const STANDARD_PIPELINES = [
" New Issues " ,
" Icebox " ,
" Product Backlog " ,
" Sprint Backlog " ,
" In Progress " ,
" Review/QA "
];
const PIPELINES_TO_REMOVE = [ " Done " ];
const currentNames = workspace.pipelines.map(p = > p.name);
const missing = STANDARD_PIPELINES.filter(name = > !currentNames.includes(name));
const toRemove = workspace.pipelines.filter(p = > PIPELINES_TO_REMOVE.includes(p.name));
const extra = currentNames.filter(name = >
!STANDARD_PIPELINES.includes(name) & & !PIPELINES_TO_REMOVE.includes(name)
);Step 3: Analysis Report#
Report current state and required actions to the user:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ZenHub Workspace Pipeline Analysis โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ Workspace: {workspace_id} โ
โ Repositories: {repo_names} โ
โ โ
โ Current Pipelines: โ
โ โ
New Issues โ
โ โ
Product Backlog โ
โ โ
In Progress โ
โ โ
Review/QA โ
โ โ ๏ธ Done (needs removal) โ
โ โ Icebox (missing) โ
โ โ Sprint Backlog (missing) โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโStep 4: Handle Done Pipeline#
When the Done pipeline exists:
- Check issues in the Done pipeline:
const doneIssues = await mcp__zenhub__getIssuesInPipeline({
pipelineId: donePipeline.id
});- Close issues if any exist (๋๋ฌธ์
"CLOSED"โ ์๋ฌธ์"closed"๋ enum ๊ฑฐ๋ถ๋ก false-success):
for (const issue of doneIssues) {
// GitHub ๊ฐ source of truth โ ์ง์ ๋ซ๊ณ ZenHub state ๋๊ธฐํ
await Bash(`gh issue close ${issue.number} --reason completed`);
await mcp__zenhub__updateIssue({ issueId: issue.id, state: " CLOSED " });
}
// โ ๏ธ ํ์ดํ๋ผ์ธ ์ญ์ ์๋ด(์๋) ์ ์ ์ ๋ถ CLOSED ์ธ์ง ์ฌํ์ธ โ ๋ฏธ์ ์ด์๊ฐ ์ปฌ๋ผ ์ ๊ฑฐ์ ํจ๊ป ์๋๋์ง ์๋๋ก.
for (const issue of doneIssues) {
const st = (await Bash(`gh issue view ${issue.number} --json state -q .state`)).trim();
if (st !== " CLOSED " ) throw new Error(`Done ์ด์ #${issue.number} ๋ฏธ์ข
๋ฃ โ ํ์ดํ๋ผ์ธ ์ญ์ ๋ณด๋ฅ`);
}- Guide Done pipeline removal (๋ชจ๋ Done ์ด์๊ฐ CLOSED ๊ฒ์ฆ๋ ๋ค์๋ง):
The ZenHub MCP API does not support pipeline deletion. Please manually remove the Done pipeline at the following URL:
https://app.zenhub.com/workspaces/{workspace_id}/board
โ Done pipeline header (...) โ Delete pipelineStep 5: Query and Cache Issue Types#
const issueTypes = await mcp__zenhub__getIssueTypes();Step 6: Generate zenhub-conventions.yaml#
Generate a .claude/config/bmad/zenhub-conventions.yaml file at the project root to cache IDs:
Note:
cc-product's BMAD Method workflow (/product:workflow-init) generates an analogous cache atbmad/zenhub-conventions.yaml(no.claude/config/prefix) with a different schema (seeplugins/cc-product/references/templates/zenhub-conventions-template.md). The two caches are independent โ this command does not read or write thecc-productpath, and vice versa.
# Auto-generated by /zenhub:init-workspace
# Date: {current_date}
repository:
id: " {repo.id} "
owner: " {repo_owner} "
name: " {repo_name} "
organization:
id: " {workspace.organizationId} "
issue_types:
epic: " {epicType.id} "
feature: " {featureType.id} "
task: " {taskType.id} "
bug: " {bugType.id} "
pipelines:
new_issues: " {newIssuesPipeline.id} "
icebox: " {iceboxPipeline.id} "
product_backlog: " {backlogPipeline.id} "
sprint_backlog: " {sprintBacklogPipeline.id} "
in_progress: " {inProgressPipeline.id} "
review_qa: " {reviewQAPipeline.id} "
# Done pipeline not used โ Closed on PR merge
sprints:
active:
id: " "
name: " "
upcoming:
id: " "
name: " "
issue_creation:
method: " github "
title_prefixes:
epic: " "
story: " "
sub_task: " "
bug: " [Bug] "
last_updated: " {ISO_8601_timestamp} "Step 7: Verify .mcp.json#
Verify that ZenHub MCP configuration exists in the project root's .mcp.json:
// Read .mcp.json file
const mcpConfig = readFile( " .mcp.json " );
// Check zenhub server configuration
if (!mcpConfig.mcpServers?.zenhub) {
// Need to create .mcp.json or add zenhub configuration
}Step 8: Completion Report#
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Workspace Initialization Complete โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ โ
Pipeline analysis complete โ
โ โ
Done issues ({N}) โ Closed โ
โ โ ๏ธ Done pipeline manual removal needed (URL guided) โ
โ โ
zenhub-conventions.yaml generated โ
โ โ
.mcp.json verification complete โ
โ โ
โ ๐ Missing Pipelines: โ
โ โ Manual addition needed in ZenHub Board: {missing_names} โ
โ โ
โ ๐ Next Steps: โ
โ 1. Manually remove Done pipeline โ
โ 2. Manually add missing pipelines โ
โ 3. Start development with /dev:run โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโCompletion Rules#
- All issues in Done pipeline are Closed (automatic)
- Done pipeline deletion is manual (MCP API limitation)
- Missing pipeline addition is manual (MCP API limitation)
- zenhub-conventions.yaml is auto-generated (ID caching)
- Re-run after pipeline changes to refresh cache
Related Commands#
| Command | Description |
|---|---|
/zenhub:manage | PR linking and pipeline state management |
/zenhub:epic | Epic & Story creation |
/dev:run | Full development cycle automation |