spec-workflow-init

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

spec-workflow-init — Development Workflow Generator

spec-workflow-init — 开发工作流生成器

Generate a project-specific
issue-to-pr-workflow.md
through interactive dialogue. The workflow serves as a playbook for spec-implement and development agents.
通过交互式对话生成项目专属的
issue-to-pr-workflow.md
文件。该工作流可作为spec-implement和开发Agent的操作手册。

Language Rules

语言规则

  1. Auto-detect input language → output in the same language
  2. Japanese input → Japanese output, use
    references/workflow-template.ja.md
  3. English input → English output, use
    references/workflow-template.md
  4. Explicit override takes priority (e.g., "in English", "日本語で")
Sub-agent template selection (when generating agent definitions):
  • English →
    references/agents/claude/workflow-*.md
  • Japanese →
    references/agents/claude/workflow-*.ja.md
  • Codex templates: English →
    references/agents/codex/workflow-*.toml
    , Japanese →
    references/agents/codex/workflow-*.ja.toml
  1. 自动检测输入语言 → 输出与输入语言保持一致
  2. 输入日语→输出日语,使用
    references/workflow-template.ja.md
    模板
  3. 输入英语→输出英语,使用
    references/workflow-template.md
    模板
  4. 显式语言指定优先级更高(例如:"in English"、"日本語で")
子Agent模板选择(生成Agent定义时):
  • English →
    references/agents/claude/workflow-*.md
  • Japanese →
    references/agents/claude/workflow-*.ja.md
  • Codex模板:英语→
    references/agents/codex/workflow-*.toml
    ,日语→
    references/agents/codex/workflow-*.ja.toml

Execution Flow

执行流程

Step 1: Initial Checks

步骤1:初始检查

  1. Verify Git repository:
    bash
    git rev-parse --is-inside-work-tree 2>/dev/null
    If not a Git repo, warn and skip branch detection. Continue with other checks.
  2. Check current directory:
    bash
    pwd
    ls -la
  3. Detect existing workflow file:
    bash
    find . -name "issue-to-pr-workflow.md" -maxdepth 3 2>/dev/null
    If found and
    --force
    is not set, show the existing file path and proceed to Step 7 (idempotency handling).
  1. 验证Git仓库:
    bash
    git rev-parse --is-inside-work-tree 2>/dev/null
    如果不是Git仓库,发出警告并跳过分支检测,继续执行其他检查。
  2. 检查当前目录:
    bash
    pwd
    ls -la
  3. 检测已存在的工作流文件:
    bash
    find . -name "issue-to-pr-workflow.md" -maxdepth 3 2>/dev/null
    如果检测到文件且未设置
    --force
    参数,显示已存在文件的路径并进入步骤7(幂等性处理)。

Step 2: Environment Detection

步骤2:环境检测

Run the following checks to auto-detect the project environment:
Package manager:
bash
ls pnpm-lock.yaml yarn.lock package-lock.json bun.lockb 2>/dev/null
Container usage:
bash
ls docker-compose.yml docker-compose.yaml Dockerfile 2>/dev/null
CI/CD service:
bash
ls -d .github/workflows .gitlab-ci.yml .circleci 2>/dev/null
Branch information:
bash
git branch -r 2>/dev/null | head -10
Language, framework, and scripts:
bash
cat package.json 2>/dev/null | grep -A 50 '"scripts"'
cat package.json 2>/dev/null | grep -A 30 '"dependencies"'
ls go.mod requirements.txt pyproject.toml 2>/dev/null
Database:
bash
ls prisma/schema.prisma 2>/dev/null
grep -l "postgres\|mysql\|mongo" docker-compose.yml 2>/dev/null
Lint tools:
bash
ls .eslintrc* biome.json 2>/dev/null
Coding rules file:
bash
find . -name "coding-rules.md" -maxdepth 3 2>/dev/null
Present the detection results to the user in a summary table:
Detected project environment:
  Language/FW:       {detected}
  Package Manager:   {detected}
  Container:         {detected}
  Test:              {detected}
  CI/CD:             {detected}
  Branch:            {detected}
  Database:          {detected}
  Lint:              {detected}
  Coding Rules:      {detected or "Not found"}
Ask the user to confirm or correct the detection results before proceeding.
执行以下检查以自动检测项目环境:
包管理器:
bash
ls pnpm-lock.yaml yarn.lock package-lock.json bun.lockb 2>/dev/null
容器使用情况:
bash
ls docker-compose.yml docker-compose.yaml Dockerfile 2>/dev/null
CI/CD服务:
bash
ls -d .github/workflows .gitlab-ci.yml .circleci 2>/dev/null
分支信息:
bash
git branch -r 2>/dev/null | head -10
语言、框架与脚本:
bash
cat package.json 2>/dev/null | grep -A 50 '"scripts"'
cat package.json 2>/dev/null | grep -A 30 '"dependencies"'
ls go.mod requirements.txt pyproject.toml 2>/dev/null
数据库:
bash
ls prisma/schema.prisma 2>/dev/null
grep -l "postgres\|mysql\|mongo" docker-compose.yml 2>/dev/null
代码检查工具:
bash
ls .eslintrc* biome.json 2>/dev/null
编码规范文件:
bash
find . -name "coding-rules.md" -maxdepth 3 2>/dev/null
以汇总表格形式向用户展示检测结果:
Detected project environment:
  Language/FW:       {detected}
  Package Manager:   {detected}
  Container:         {detected}
  Test:              {detected}
  CI/CD:             {detected}
  Branch:            {detected}
  Database:          {detected}
  Lint:              {detected}
  Coding Rules:      {detected or "Not found"}
在继续执行前,请求用户确认或修正检测结果。

Step 3: Interactive Dialogue

步骤3:交互式对话

Gather workflow configuration through AskUserQuestion rounds.
Round 1: Output Path
question: "Where to save issue-to-pr-workflow.md?" / "issue-to-pr-workflow.md の出力先は?"
header: "Output"
options:
  - "docs/issue-to-pr-workflow.md (Recommended)" / "docs ディレクトリ直下(推奨)"
  - "docs/development/issue-to-pr-workflow.md" / "docs/development 配下"
Round 2: Branch Strategy
Q1:
question: "Base branch (PR target)?" / "ベースブランチ(PRターゲット)は?"
header: "Branch"
options:
  - "develop (Recommended)" / "feature → develop → main(Git Flow)"
  - "main" / "feature → main(GitHub Flow)"
  - "trunk" / "Short-lived branches → main(Trunk-based)"

Q2:
question: "Feature branch naming convention?" / "featureブランチの命名規則は?"
header: "Naming"
options:
  - "feature/{issue}-{slug} (Recommended)" / "e.g. feature/42-add-auth"
  - "{issue}-{slug}" / "e.g. 42-add-auth"
  - "{type}/{issue}-{slug}" / "e.g. fix/42-login-bug, feat/43-dashboard"
Round 3: Quality Gates
question: "Quality gates before PR creation?" / "PR作成前の品質ゲートは?"
header: "Gates"
multiSelect: true
options:
  - "All tests must pass (Recommended)" / "テスト全パス(推奨)"
  - "Lint and type check must pass" / "Lint / Typecheckパス"
  - "Coverage threshold" / "カバレッジ基準"
Round 4: Development Style
question: "Select your development style" / "開発スタイルを選択してください"
header: "Style"
options:
  - "Implementation First (Recommended)" / "実装 → レビュー → テスト → テストレビュー → 品質ゲート → PR"
  - "TDD" / "テスト(RED) → 実装(GREEN) → リファクタ → レビュー → 品質ゲート → PR"
  - "BDD" / "E2Eシナリオ → テスト(RED) → 実装(GREEN) → レビュー → 品質ゲート → PR"
Round 5: E2E Test Level
question: "E2E test scope?" / "E2Eテストの範囲は?"
header: "E2E"
options:
  - "API level only (Recommended)" / "supertest等でリクエスト→レスポンスを検証"
  - "API + Browser E2E" / "上記 + Playwrightでクリティカルパスを検証"
Round 6: Parallel Execution
question: "Use parallel execution for implementation and tests?" / "実装とテストの並列実行を使いますか?"
header: "Parallel"
options:
  - "Sequential (Recommended)" / "メインエージェントが全工程を順番に実行(安全・シンプル)"
  - "Parallel" / "実装とテストコード生成を並行して実行(高速・要エージェント分離)"
Round 7: Agent Targets (only if Parallel selected)
Ask which agent definitions to generate. Do NOT decide targets based on
.claude/
/
.codex/
directory detection.
question: "Which agent definitions should be generated?" / "どのエージェント定義を生成しますか?"
header: "Agents"
options:
  - "Both Claude + Codex (Recommended)" / "Claude と Codex の両方を生成"
  - "Claude only" / "Claude のみ生成"
  - "Codex only" / "Codex のみ生成"
  - "Skip generation" / "生成しない"
Additional Questions (project-type specific):
  • Docker project: "Run all commands inside Docker?" / "Docker内で全コマンドを実行しますか?"
  • Next.js project: "Include build check in workflow?" / "ビルド確認をワークフローに含めますか?"
通过多轮用户提问收集工作流配置信息。
第一轮:输出路径
question: "Where to save issue-to-pr-workflow.md?" / "issue-to-pr-workflow.md の出力先は?"
header: "Output"
options:
  - "docs/issue-to-pr-workflow.md (Recommended)" / "docs ディレクトリ直下(推奨)"
  - "docs/development/issue-to-pr-workflow.md" / "docs/development 配下"
第二轮:分支策略
Q1:
question: "Base branch (PR target)?" / "ベースブランチ(PRターゲット)は?"
header: "Branch"
options:
  - "develop (Recommended)" / "feature → develop → main(Git Flow)"
  - "main" / "feature → main(GitHub Flow)"
  - "trunk" / "Short-lived branches → main(Trunk-based)"

Q2:
question: "Feature branch naming convention?" / "featureブランチの命名規則は?"
header: "Naming"
options:
  - "feature/{issue}-{slug} (Recommended)" / "e.g. feature/42-add-auth"
  - "{issue}-{slug}" / "e.g. 42-add-auth"
  - "{type}/{issue}-{slug}" / "e.g. fix/42-login-bug, feat/43-dashboard"
第三轮:质量门禁
question: "Quality gates before PR creation?" / "PR作成前の品質ゲートは?"
header: "Gates"
multiSelect: true
options:
  - "All tests must pass (Recommended)" / "テスト全パス(推奨)"
  - "Lint and type check must pass" / "Lint / Typecheckパス"
  - "Coverage threshold" / "カバレッジ基準"
第四轮:开发风格
question: "Select your development style" / "開発スタイルを選択してください"
header: "Style"
options:
  - "Implementation First (Recommended)" / "実装 → レビュー → テスト → テストレビュー → 品質ゲート → PR"
  - "TDD" / "テスト(RED) → 実装(GREEN) → リファクタ → レビュー → 品質ゲート → PR"
  - "BDD" / "E2Eシナリオ → テスト(RED) → 実装(GREEN) → レビュー → 品質ゲート → PR"
第五轮:E2E测试级别
question: "E2E test scope?" / "E2Eテストの範囲は?"
header: "E2E"
options:
  - "API level only (Recommended)" / "supertest等でリクエスト→レスポンスを検証"
  - "API + Browser E2E" / "上記 + Playwrightでクリティカルパスを検証"
第六轮:并行执行
question: "Use parallel execution for implementation and tests?" / "実装とテストの並列実行を使いますか?"
header: "Parallel"
options:
  - "Sequential (Recommended)" / "メインエージェントが全工程を順番に実行(安全・シンプル)"
  - "Parallel" / "実装とテストコード生成を並行して実行(高速・要エージェント分離)"
第七轮:Agent目标(仅当选择并行执行时)
询问需要生成哪些Agent定义,请勿根据
.claude/
.codex/
目录的检测结果决定目标。
question: "Which agent definitions should be generated?" / "どのエージェント定義を生成しますか?"
header: "Agents"
options:
  - "Both Claude + Codex (Recommended)" / "Claude と Codex の両方を生成"
  - "Claude only" / "Claudeのみ生成"
  - "Codex only" / "Codexのみ生成"
  - "Skip generation" / "生成しない"
附加问题(根据项目类型):
  • Docker项目: "是否在Docker内执行所有命令?" / "Docker内で全コマンドを実行しますか?"
  • Next.js项目: "是否在工作流中包含构建检查?" / "ビルド確認をワークフローに含めますか?"

Step 4: Workflow Generation

步骤4:工作流生成

  1. Select template based on Language Rules:
    • English →
      references/workflow-template.md
    • Japanese →
      references/workflow-template.ja.md
  2. Read the template and replace placeholders with collected values:
    • {package_manager}
      ,
      {container_tool}
      ,
      {database}
      ,
      {test_framework}
      , etc.
    • {pr_target}
      ,
      {branch_naming}
      ,
      {dev_style}
    • {test_command}
      ,
      {lint_command}
      ,
      {typecheck_command}
      ,
      {build_command}
    • {e2e_test_command}
      ,
      {browser_e2e_command}
      ,
      {coverage_command}
    • {timestamp}
      → current date/time
  3. Select development style sections:
    • Implementation First → keep
      {if_implementation_first}...{end_implementation_first}
      , remove TDD/BDD blocks
    • TDD → keep
      {if_tdd}...{end_tdd}
      , remove others
    • BDD → keep
      {if_bdd}...{end_bdd}
      , remove others
  4. Handle conditional sections:
    • Browser E2E not selected → remove
      {if_browser_e2e}...{end_browser_e2e}
      blocks
    • Parallel not selected → remove
      {if_parallel}...{end_parallel}
      blocks
    • If agent targets include Claude → keep
      {if_claude_agents}...{end_claude_agents}
      , otherwise remove
    • If agent targets include Codex → keep
      {if_codex_agents}...{end_codex_agents}
      , otherwise remove
    • If agent generation is skipped → keep
      {if_no_agent_files}...{end_no_agent_files}
      , otherwise remove
    • No typecheck command → remove
      {if_typecheck}...{end_typecheck}
    • No build command → remove
      {if_build}...{end_build}
  5. Clean up remaining placeholders and conditional markers
  6. Create output directory if needed:
    bash
    mkdir -p {output_directory}
  7. Write the file to the specified output path
  1. 根据语言规则选择模板:
    • English →
      references/workflow-template.md
    • Japanese →
      references/workflow-template.ja.md
  2. 读取模板并将占位符替换为收集到的值:
    • {package_manager}
      ,
      {container_tool}
      ,
      {database}
      ,
      {test_framework}
      , etc.
    • {pr_target}
      ,
      {branch_naming}
      ,
      {dev_style}
    • {test_command}
      ,
      {lint_command}
      ,
      {typecheck_command}
      ,
      {build_command}
    • {e2e_test_command}
      ,
      {browser_e2e_command}
      ,
      {coverage_command}
    • {timestamp}
      → 当前日期/时间
  3. 选择开发风格对应的章节:
    • 先实现(Implementation First)→ 保留
      {if_implementation_first}...{end_implementation_first}
      块,移除TDD/BDD相关块
    • TDD → 保留
      {if_tdd}...{end_tdd}
      块,移除其他块
    • BDD → 保留
      {if_bdd}...{end_bdd}
      块,移除其他块
  4. 处理条件章节:
    • 未选择浏览器端E2E测试 → 移除
      {if_browser_e2e}...{end_browser_e2e}
    • 未选择并行执行 → 移除
      {if_parallel}...{end_parallel}
    • 如果Agent目标包含Claude → 保留
      {if_claude_agents}...{end_claude_agents}
      块,否则移除
    • 如果Agent目标包含Codex → 保留
      {if_codex_agents}...{end_codex_agents}
      块,否则移除
    • 如果跳过Agent生成 → 保留
      {if_no_agent_files}...{end_no_agent_files}
      块,否则移除
    • 无类型检查命令 → 移除
      {if_typecheck}...{end_typecheck}
    • 无构建命令 → 移除
      {if_build}...{end_build}
  5. 清理剩余的占位符和条件标记
  6. 如果需要,创建输出目录:
    bash
    mkdir -p {output_directory}
  7. 将文件写入指定的输出路径

Step 5: Idempotency Handling

步骤5:幂等性处理

If an existing workflow file is detected (from Step 1 or during generation):
  1. Without
    --force
    : Show a warning with the existing file path
    question: "Existing workflow found at {path}. Overwrite?" / "既存のワークフローが {path} に見つかりました。上書きしますか?"
    header: "Overwrite"
    options:
      - "Yes, overwrite" / "はい、上書きする"
      - "No, cancel" / "いいえ、キャンセル"
  2. With
    --force
    : Overwrite without confirmation
如果检测到已存在的工作流文件(来自步骤1或生成过程中):
  1. 未设置
    --force
    参数时
    : 显示包含已存在文件路径的警告
    question: "Existing workflow found at {path}. Overwrite?" / "既存のワークフローが {path} に見つかりました。上書きしますか?"
    header: "Overwrite"
    options:
      - "Yes, overwrite" / "はい、上書きする"
      - "No, cancel" / "いいえ、キャンセル"
  2. 设置
    --force
    参数时
    : 无需确认直接覆盖

Step 6: Sub-Agent Generation

步骤6:子Agent生成

Skip this step if the user did not select parallel execution or selected "Skip generation" in Round 7.
Step 6a: Claude Code agents (when Round 7 selection includes Claude):
  1. Select template language based on Language Rules:
    • English →
      references/agents/claude/workflow-*.md
    • Japanese →
      references/agents/claude/workflow-*.ja.md
  2. Read each template and replace placeholders:
    • {coding_rules_path}
      → detected path (e.g.,
      docs/coding-rules.md
      )
    • {workflow_path}
      → output path from Step 3 (e.g.,
      docs/issue-to-pr-workflow.md
      )
    • {test_command}
      ,
      {lint_command}
      ,
      {typecheck_command}
      ,
      {build_command}
    • {e2e_test_command}
      ,
      {browser_e2e_command}
      ,
      {coverage_command}
    • {dev_style}
      → selected development style
    • {branch_naming}
      → selected naming convention
  3. Create directory and write files:
    bash
    mkdir -p .claude/agents
    • .claude/agents/workflow-implementer.md
    • .claude/agents/workflow-reviewer.md
    • .claude/agents/workflow-tester.md
  4. If files already exist, ask for overwrite confirmation (same as Step 5)
Step 6b: Codex agents (when Round 7 selection includes Codex):
  1. Select template language based on Language Rules:
    • English →
      references/agents/codex/workflow-*.toml
    • Japanese →
      references/agents/codex/workflow-*.ja.toml
  2. Read each TOML template and replace placeholders in
    developer_instructions
    :
    • Same variables as Claude Code agents
  3. Create directory and write files:
    bash
    mkdir -p .codex/agents
    • .codex/agents/workflow-implementer.toml
    • .codex/agents/workflow-reviewer.toml
    • .codex/agents/workflow-tester.toml
  4. Update
    .codex/config.toml
    :
    • Create file if it doesn't exist
    • Add or update agent sections in config.toml:
      toml
      [agents.workflow-implementer]
      config_file = "agents/workflow-implementer.toml"
      
      [agents.workflow-reviewer]
      config_file = "agents/workflow-reviewer.toml"
      
      [agents.workflow-tester]
      config_file = "agents/workflow-tester.toml"
    • Add
      [features] multi_agent = true
      if not present
  5. If files already exist, ask for overwrite confirmation
如果用户未选择并行执行或在第七轮选择了"Skip generation",则跳过此步骤
步骤6a:Claude代码Agent(当第七轮选择包含Claude时):
  1. 根据语言规则选择模板语言:
    • English →
      references/agents/claude/workflow-*.md
    • Japanese →
      references/agents/claude/workflow-*.ja.md
  2. 读取每个模板并替换占位符:
    • {coding_rules_path}
      → detected path (e.g.,
      docs/coding-rules.md
      )
    • {workflow_path}
      → output path from Step 3 (e.g.,
      docs/issue-to-pr-workflow.md
      )
    • {test_command}
      ,
      {lint_command}
      ,
      {typecheck_command}
      ,
      {build_command}
    • {e2e_test_command}
      ,
      {browser_e2e_command}
      ,
      {coverage_command}
    • {dev_style}
      → selected development style
    • {branch_naming}
      → selected naming convention
  3. 创建目录并写入文件:
    bash
    mkdir -p .claude/agents
    • .claude/agents/workflow-implementer.md
    • .claude/agents/workflow-reviewer.md
    • .claude/agents/workflow-tester.md
  4. 如果文件已存在,请求用户确认是否覆盖(与步骤5相同)
步骤6b:Codex Agent(当第七轮选择包含Codex时):
  1. 根据语言规则选择模板语言:
    • English →
      references/agents/codex/workflow-*.toml
    • Japanese →
      references/agents/codex/workflow-*.ja.toml
  2. 读取每个TOML模板并替换
    developer_instructions
    中的占位符:
    • 与Claude代码Agent使用相同的变量
  3. 创建目录并写入文件:
    bash
    mkdir -p .codex/agents
    • .codex/agents/workflow-implementer.toml
    • .codex/agents/workflow-reviewer.toml
    • .codex/agents/workflow-tester.toml
  4. 更新
    .codex/config.toml
    文件:
    • 如果文件不存在则创建
    • 在config.toml中添加或更新Agent章节:
      toml
      [agents.workflow-implementer]
      config_file = "agents/workflow-implementer.toml"
      
      [agents.workflow-reviewer]
      config_file = "agents/workflow-reviewer.toml"
      
      [agents.workflow-tester]
      config_file = "agents/workflow-tester.toml"
    • 如果不存在,则添加
      [features] multi_agent = true
  5. 如果文件已存在,请求用户确认是否覆盖

Step 7: AGENTS.md / CLAUDE.md Reference Update

步骤7:更新AGENTS.md / CLAUDE.md中的引用

  1. Check for convention files:
    bash
    ls AGENTS.md CLAUDE.md 2>/dev/null
  2. If CLAUDE.md is a symlink to AGENTS.md, update only AGENTS.md:
    bash
    readlink CLAUDE.md 2>/dev/null
  3. If at least one file exists, ask for confirmation:
    question: "Add workflow reference to AGENTS.md / CLAUDE.md?" / "AGENTS.md / CLAUDE.md にワークフローの参照を追記しますか?"
    header: "Update"
    options:
      - "Yes, add reference (Recommended)" / "はい、参照を追記する(推奨)"
      - "No, skip" / "いいえ、スキップ"
  4. If approved, append the following section (adapt language to match output):
    English:
    markdown
    ## Development Workflow
    
    Follow the development workflow for Issue → Implementation → PR:
    - [{workflow_path}]({workflow_path}) — Development workflow generated by spec-workflow-init
    Japanese:
    markdown
    ## Development Workflow
    
    開発フロー(Issue → 実装 → PR)は以下のファイルに従ってください:
    - [{workflow_path}]({workflow_path}) — spec-workflow-init で生成された開発ワークフロー
  5. If neither file exists, output a warning:
    "Warning: Neither AGENTS.md nor CLAUDE.md found. Skipping reference update."
    / "警告: AGENTS.md も CLAUDE.md も見つかりません。参照追記をスキップします。"
  1. 检查是否存在规范文件:
    bash
    ls AGENTS.md CLAUDE.md 2>/dev/null
  2. 如果CLAUDE.md是AGENTS.md的符号链接,则仅更新AGENTS.md:
    bash
    readlink CLAUDE.md 2>/dev/null
  3. 如果至少存在一个文件,请求用户确认:
    question: "Add workflow reference to AGENTS.md / CLAUDE.md?" / "AGENTS.md / CLAUDE.md にワークフローの参照を追記しますか?"
    header: "Update"
    options:
      - "Yes, add reference (Recommended)" / "はい、参照を追記する(推奨)"
      - "No, skip" / "いいえ、スキップ"
  4. 如果获得批准,追加以下章节(语言与输出保持一致):
    English:
    markdown
    ## Development Workflow
    
    Follow the development workflow for Issue → Implementation → PR:
    - [{workflow_path}]({workflow_path}) — Development workflow generated by spec-workflow-init
    Japanese:
    markdown
    ## Development Workflow
    
    開発フロー(Issue → 実装 → PR)は以下のファイルに従ってください:
    - [{workflow_path}]({workflow_path}) — spec-workflow-init で生成された開発ワークフロー
  5. 如果两个文件都不存在,输出警告:
    "Warning: Neither AGENTS.md nor CLAUDE.md found. Skipping reference update."
    / "警告: AGENTS.md も CLAUDE.md も見つかりません。参照追記をスキップします。"

Options

选项

OptionDescription
--force
Overwrite existing files without confirmation
选项描述
--force
无需确认直接覆盖已存在的文件

Error Handling

错误处理

ErrorDetectionResponse
Not a Git repository
git rev-parse
fails
Warn and skip branch detection. Continue with other checks
No package.json
ls package.json
fails
Skip package manager / test / lint detection. Gather via dialogue
Write permission error
mkdir -p
or file write fails
Show error and re-ask output path via AskUserQuestion
Network error (git branch -r)Command timeout or non-zero exitSkip remote branches. Use local branches only. Gather via dialogue
Existing file conflictFile found at output pathWithout
--force
: show warning and ask to overwrite. With
--force
: overwrite
错误类型检测方式处理方式
非Git仓库
git rev-parse
命令执行失败
发出警告并跳过分支检测,继续执行其他检查
无package.json文件
ls package.json
命令执行失败
跳过包管理器/测试/代码检查工具的检测,通过对话收集相关信息
写入权限错误
mkdir -p
或文件写入失败
显示错误信息并通过重新提问获取输出路径
网络错误(git branch -r)命令超时或执行失败跳过远程分支检测,仅使用本地分支信息,通过对话收集相关信息
已存在文件冲突在输出路径检测到文件未设置
--force
:显示警告并询问是否覆盖;设置
--force
:直接覆盖

Usage Examples

使用示例

undefined
undefined

Generate workflow with dialogue

Generate workflow with dialogue

"Generate development workflow" 「開発ワークフローを生成」
"Generate development workflow" 「開発ワークフローを生成」

Generate with force overwrite

Generate with force overwrite

"Create workflow --force" 「ワークフロー生成 --force」
"Create workflow --force" 「ワークフロー生成 --force」

After spec-rules-init

After spec-rules-init

"Now create the development workflow" 「次に開発フローを作って」
undefined
"Now create the development workflow" 「次に開発フローを作って」
undefined

Post-Completion Actions

完成后操作

After generating the workflow:
question: "Workflow generated. What's next?" / "ワークフローを生成しました。次のアクションは?"
options:
  - "Run spec-implement" / "spec-implement を実行する"
    description: "Start implementing with the generated workflow" / "生成したワークフローで実装を開始"
  - "Review and customize" / "レビューしてカスタマイズ"
    description: "Open the generated file and make adjustments" / "生成されたファイルを開いて調整"
  - "Done for now" / "完了"
    description: "Finish without further action" / "追加アクションなしで完了"
生成工作流后:
question: "Workflow generated. What's next?" / "ワークフローを生成しました。次のアクションは?"
options:
  - "Run spec-implement" / "spec-implement を実行する"
    description: "Start implementing with the generated workflow" / "生成したワークフローで実装を開始"
  - "Review and customize" / "レビューしてカスタマイズ"
    description: "Open the generated file and make adjustments" / "生成されたファイルを開いて調整"
  - "Done for now" / "完了"
    description: "Finish without further action" / "追加アクションなしで完了"