用户输入 在继续之前,您 必须 考虑用户输入(如果不为空)。 大纲 1. 设置 : 从仓库根目录运行 并解析 JSON 以获取 FEATURE SPEC、IMPL PLAN、SPECS DIR、BRANCH。对于参数中的单引号,如 "I'm Groot",请使用转义语法:例如 'I'\''m Groot'(或者如果可能的话使用双引号:"I'm Groot")。 2. 加载上下文 : 读取 FEATURE SPEC 和 。加载 IMPL PLAN 模板(已复制)。 3. 执行计划工作流程 : 遵循 IMPL PLAN 模板中的结构来: - 填写技术上下文(将未知项标记为"需要澄清") - 从章程中填写章程检查部分 - 评估门禁(如果有未正当化的违规则报错) - 阶段 0: 生成 research.md(解决所有"需要澄清") - 阶段 1: 生成 data-model.md、contracts/、quickstart.md - 阶段 1: 通过运行代理脚本更新代理上下文 - 设计后重新评估章程检查 4. 停止并报告 : 命令在阶段 2 规划后结束。报告分支、IMPL PLAN 路径和生成的工件。 阶段 阶段 0: 大纲与研究 1. 从上述技术上下文中提取未知项 : - 对于每个"需要澄清" → 研究任务 - 对于每个依赖项 → 最佳实践任务 - 对于每个集成 → 模式任务 2. 生…

| head -3 | tr '\\n' '-' | sed 's/-$//'\n fi\n}\n\n# Generate branch name\nif [ -n \"$SHORT_NAME\" ]; then\n # Use provided short name, just clean it up\n BRANCH_SUFFIX=$(echo \"$SHORT_NAME\" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/-\\+/-/g' | sed 's/^-//' | sed 's/-$//')\nelse\n # Generate from description with smart filtering\n BRANCH_SUFFIX=$(generate_branch_name \"$FEATURE_DESCRIPTION\")\nfi\n\n# Determine branch number\nif [ -z \"$BRANCH_NUMBER\" ]; then\n if [ \"$HAS_GIT\" = true ]; then\n # Check existing branches on remotes\n BRANCH_NUMBER=$(check_existing_branches \"$BRANCH_SUFFIX\")\n else\n # Fall back to local directory check\n HIGHEST=0\n if [ -d \"$SPECS_DIR\" ]; then\n for dir in \"$SPECS_DIR\"/*; do\n [ -d \"$dir\" ] || continue\n dirname=$(basename \"$dir\")\n number=$(echo \"$dirname\" | grep -o '^[0-9]\\+' || echo \"0\")\n number=$((10#$number))\n if [ \"$number\" -gt \"$HIGHEST\" ]; then HIGHEST=$number; fi\n done\n fi\n BRANCH_NUMBER=$((HIGHEST + 1))\n fi\nfi\n\nFEATURE_NUM=$(printf \"%03d\" \"$BRANCH_NUMBER\")\nBRANCH_NAME=\"${FEATURE_NUM}-${BRANCH_SUFFIX}\"\n\n# GitHub enforces a 244-byte limit on branch names\n# Validate and truncate if necessary\nMAX_BRANCH_LENGTH=244\nif [ ${#BRANCH_NAME} -gt $MAX_BRANCH_LENGTH ]; then\n # Calculate how much we need to trim from suffix\n # Account for: feature number (3) + hyphen (1) = 4 chars\n MAX_SUFFIX_LENGTH=$((MAX_BRANCH_LENGTH - 4))\n \n # Truncate suffix at word boundary if possible\n TRUNCATED_SUFFIX=$(echo \"$BRANCH_SUFFIX\" | cut -c1-$MAX_SUFFIX_LENGTH)\n # Remove trailing hyphen if truncation created one\n TRUNCATED_SUFFIX=$(echo \"$TRUNCATED_SUFFIX\" | sed 's/-$//')\n \n ORIGINAL_BRANCH_NAME=\"$BRANCH_NAME\"\n BRANCH_NAME=\"${FEATURE_NUM}-${TRUNCATED_SUFFIX}\"\n \n >&2 echo \"[specify] Warning: Branch name exceeded GitHub's 244-byte limit\"\n >&2 echo \"[specify] Original: $ORIGINAL_BRANCH_NAME (${#ORIGINAL_BRANCH_NAME} bytes)\"\n >&2 echo \"[specify] Truncated to: $BRANCH_NAME (${#BRANCH_NAME} bytes)\"\nfi\n\nif [ \"$HAS_GIT\" = true ]; then\n git checkout -b \"$BRANCH_NAME\"\nelse\n >&2 echo \"[specify] Warning: Git repository not detected; skipped branch creation for $BRANCH_NAME\"\nfi\n\nFEATURE_DIR=\"$SPECS_DIR/$BRANCH_NAME\"\nmkdir -p \"$FEATURE_DIR\"\n\nTEMPLATE=\"$REPO_ROOT/.specify/templates/spec-template.md\"\nSPEC_FILE=\"$FEATURE_DIR/spec.md\"\nif [ -f \"$TEMPLATE\" ]; then cp \"$TEMPLATE\" \"$SPEC_FILE\"; else touch \"$SPEC_FILE\"; fi\n\n# Set the SPECIFY_FEATURE environment variable for the current session\nexport SPECIFY_FEATURE=\"$BRANCH_NAME\"\n\nif $JSON_MODE; then\n printf '{\"BRANCH_NAME\":\"%s\",\"SPEC_FILE\":\"%s\",\"FEATURE_NUM\":\"%s\"}\\n' \"$BRANCH_NAME\" \"$SPEC_FILE\" \"$FEATURE_NUM\"\nelse\n echo \"BRANCH_NAME: $BRANCH_NAME\"\n echo \"SPEC_FILE: $SPEC_FILE\"\n echo \"FEATURE_NUM: $FEATURE_NUM\"\n echo \"SPECIFY_FEATURE environment variable set to: $BRANCH_NAME\"\nfi\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":9420,"content_sha256":"ab6eaa8d4f6ab74dd46ddb7f783084cb0ea71a9bdf858d5cade5f7e13a5f3570"},{"filename":"scripts/bash/setup-plan.sh","content":"#!/usr/bin/env bash\n\nset -e\n\n# Parse command line arguments\nJSON_MODE=false\nARGS=()\n\nfor arg in \"$@\"; do\n case \"$arg\" in\n --json) \n JSON_MODE=true \n ;;\n --help|-h) \n echo \"Usage: $0 [--json]\"\n echo \" --json Output results in JSON format\"\n echo \" --help Show this help message\"\n exit 0 \n ;;\n *) \n ARGS+=(\"$arg\") \n ;;\n esac\ndone\n\n# Get script directory and load common functions\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nsource \"$SCRIPT_DIR/common.sh\"\n\n# Get all paths and variables from common functions\neval $(get_feature_paths)\n\n# Check if we're on a proper feature branch (only for git repos)\ncheck_feature_branch \"$CURRENT_BRANCH\" \"$HAS_GIT\" || exit 1\n\n# Ensure the feature directory exists\nmkdir -p \"$FEATURE_DIR\"\n\n# Copy plan template if it exists\nTEMPLATE=\"$REPO_ROOT/.specify/templates/plan-template.md\"\nif [[ -f \"$TEMPLATE\" ]]; then\n cp \"$TEMPLATE\" \"$IMPL_PLAN\"\n echo \"Copied plan template to $IMPL_PLAN\"\nelse\n echo \"Warning: Plan template not found at $TEMPLATE\"\n # Create a basic plan file if template doesn't exist\n touch \"$IMPL_PLAN\"\nfi\n\n# Output results\nif $JSON_MODE; then\n printf '{\"FEATURE_SPEC\":\"%s\",\"IMPL_PLAN\":\"%s\",\"SPECS_DIR\":\"%s\",\"BRANCH\":\"%s\",\"HAS_GIT\":\"%s\"}\\n' \\\n \"$FEATURE_SPEC\" \"$IMPL_PLAN\" \"$FEATURE_DIR\" \"$CURRENT_BRANCH\" \"$HAS_GIT\"\nelse\n echo \"FEATURE_SPEC: $FEATURE_SPEC\"\n echo \"IMPL_PLAN: $IMPL_PLAN\" \n echo \"SPECS_DIR: $FEATURE_DIR\"\n echo \"BRANCH: $CURRENT_BRANCH\"\n echo \"HAS_GIT: $HAS_GIT\"\nfi\n\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":1617,"content_sha256":"48a1285e616f94f2a706bff036682c7f4e88b7d3e9cd6ea54a6313246ecb076d"},{"filename":"scripts/bash/update-agent-context.sh","content":"#!/usr/bin/env bash\n\n# Update agent context files with information from plan.md\n#\n# This script maintains AI agent context files by parsing feature specifications \n# and updating agent-specific configuration files with project information.\n#\n# MAIN FUNCTIONS:\n# 1. Environment Validation\n# - Verifies git repository structure and branch information\n# - Checks for required plan.md files and templates\n# - Validates file permissions and accessibility\n#\n# 2. Plan Data Extraction\n# - Parses plan.md files to extract project metadata\n# - Identifies language/version, frameworks, databases, and project types\n# - Handles missing or incomplete specification data gracefully\n#\n# 3. Agent File Management\n# - Creates new agent context files from templates when needed\n# - Updates existing agent files with new project information\n# - Preserves manual additions and custom configurations\n# - Supports multiple AI agent formats and directory structures\n#\n# 4. Content Generation\n# - Generates language-specific build/test commands\n# - Creates appropriate project directory structures\n# - Updates technology stacks and recent changes sections\n# - Maintains consistent formatting and timestamps\n#\n# 5. Multi-Agent Support\n# - Handles agent-specific file paths and naming conventions\n# - Supports: Claude, Gemini, Copilot, Cursor, Qwen, opencode, Codex, Windsurf, Kilo Code, Auggie CLI, Roo Code, CodeBuddy CLI, Amp, or Amazon Q Developer CLI\n# - Can update single agents or all existing agent files\n# - Creates default Claude file if no agent files exist\n#\n# Usage: ./update-agent-context.sh [agent_type]\n# Agent types: claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|q\n# Leave empty to update all existing agent files\n\nset -e\n\n# Enable strict error handling\nset -u\nset -o pipefail\n\n#==============================================================================\n# Configuration and Global Variables\n#==============================================================================\n\n# Get script directory and load common functions\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nsource \"$SCRIPT_DIR/common.sh\"\n\n# Get all paths and variables from common functions\neval $(get_feature_paths)\n\nNEW_PLAN=\"$IMPL_PLAN\" # Alias for compatibility with existing code\nAGENT_TYPE=\"${1:-}\"\n\n# Agent-specific file paths \nCLAUDE_FILE=\"$REPO_ROOT/CLAUDE.md\"\nGEMINI_FILE=\"$REPO_ROOT/GEMINI.md\"\nCOPILOT_FILE=\"$REPO_ROOT/.github/copilot-instructions.md\"\nCURSOR_FILE=\"$REPO_ROOT/.cursor/rules/specify-rules.mdc\"\nQWEN_FILE=\"$REPO_ROOT/QWEN.md\"\nAGENTS_FILE=\"$REPO_ROOT/AGENTS.md\"\nWINDSURF_FILE=\"$REPO_ROOT/.windsurf/rules/specify-rules.md\"\nKILOCODE_FILE=\"$REPO_ROOT/.kilocode/rules/specify-rules.md\"\nAUGGIE_FILE=\"$REPO_ROOT/.augment/rules/specify-rules.md\"\nROO_FILE=\"$REPO_ROOT/.roo/rules/specify-rules.md\"\nCODEBUDDY_FILE=\"$REPO_ROOT/CODEBUDDY.md\"\nAMP_FILE=\"$REPO_ROOT/AGENTS.md\"\nQ_FILE=\"$REPO_ROOT/AGENTS.md\"\n\n# Template file\nTEMPLATE_FILE=\"$REPO_ROOT/.specify/templates/agent-file-template.md\"\n\n# Global variables for parsed plan data\nNEW_LANG=\"\"\nNEW_FRAMEWORK=\"\"\nNEW_DB=\"\"\nNEW_PROJECT_TYPE=\"\"\n\n#==============================================================================\n# Utility Functions\n#==============================================================================\n\nlog_info() {\n echo \"INFO: $1\"\n}\n\nlog_success() {\n echo \"✓ $1\"\n}\n\nlog_error() {\n echo \"ERROR: $1\" >&2\n}\n\nlog_warning() {\n echo \"WARNING: $1\" >&2\n}\n\n# Cleanup function for temporary files\ncleanup() {\n local exit_code=$?\n rm -f /tmp/agent_update_*_$\n rm -f /tmp/manual_additions_$\n exit $exit_code\n}\n\n# Set up cleanup trap\ntrap cleanup EXIT INT TERM\n\n#==============================================================================\n# Validation Functions\n#==============================================================================\n\nvalidate_environment() {\n # Check if we have a current branch/feature (git or non-git)\n if [[ -z \"$CURRENT_BRANCH\" ]]; then\n log_error \"Unable to determine current feature\"\n if [[ \"$HAS_GIT\" == \"true\" ]]; then\n log_info \"Make sure you're on a feature branch\"\n else\n log_info \"Set SPECIFY_FEATURE environment variable or create a feature first\"\n fi\n exit 1\n fi\n \n # Check if plan.md exists\n if [[ ! -f \"$NEW_PLAN\" ]]; then\n log_error \"No plan.md found at $NEW_PLAN\"\n log_info \"Make sure you're working on a feature with a corresponding spec directory\"\n if [[ \"$HAS_GIT\" != \"true\" ]]; then\n log_info \"Use: export SPECIFY_FEATURE=your-feature-name or create a new feature first\"\n fi\n exit 1\n fi\n \n # Check if template exists (needed for new files)\n if [[ ! -f \"$TEMPLATE_FILE\" ]]; then\n log_warning \"Template file not found at $TEMPLATE_FILE\"\n log_warning \"Creating new agent files will fail\"\n fi\n}\n\n#==============================================================================\n# Plan Parsing Functions\n#==============================================================================\n\nextract_plan_field() {\n local field_pattern=\"$1\"\n local plan_file=\"$2\"\n \n grep \"^\\*\\*${field_pattern}\\*\\*: \" \"$plan_file\" 2>/dev/null | \\\n head -1 | \\\n sed \"s|^\\*\\*${field_pattern}\\*\\*: ||\" | \\\n sed 's/^[ \\t]*//;s/[ \\t]*$//' | \\\n grep -v \"NEEDS CLARIFICATION\" | \\\n grep -v \"^N/A$\" || echo \"\"\n}\n\nparse_plan_data() {\n local plan_file=\"$1\"\n \n if [[ ! -f \"$plan_file\" ]]; then\n log_error \"Plan file not found: $plan_file\"\n return 1\n fi\n \n if [[ ! -r \"$plan_file\" ]]; then\n log_error \"Plan file is not readable: $plan_file\"\n return 1\n fi\n \n log_info \"Parsing plan data from $plan_file\"\n \n NEW_LANG=$(extract_plan_field \"Language/Version\" \"$plan_file\")\n NEW_FRAMEWORK=$(extract_plan_field \"Primary Dependencies\" \"$plan_file\")\n NEW_DB=$(extract_plan_field \"Storage\" \"$plan_file\")\n NEW_PROJECT_TYPE=$(extract_plan_field \"Project Type\" \"$plan_file\")\n \n # Log what we found\n if [[ -n \"$NEW_LANG\" ]]; then\n log_info \"Found language: $NEW_LANG\"\n else\n log_warning \"No language information found in plan\"\n fi\n \n if [[ -n \"$NEW_FRAMEWORK\" ]]; then\n log_info \"Found framework: $NEW_FRAMEWORK\"\n fi\n \n if [[ -n \"$NEW_DB\" ]] && [[ \"$NEW_DB\" != \"N/A\" ]]; then\n log_info \"Found database: $NEW_DB\"\n fi\n \n if [[ -n \"$NEW_PROJECT_TYPE\" ]]; then\n log_info \"Found project type: $NEW_PROJECT_TYPE\"\n fi\n}\n\nformat_technology_stack() {\n local lang=\"$1\"\n local framework=\"$2\"\n local parts=()\n \n # Add non-empty parts\n [[ -n \"$lang\" && \"$lang\" != \"NEEDS CLARIFICATION\" ]] && parts+=(\"$lang\")\n [[ -n \"$framework\" && \"$framework\" != \"NEEDS CLARIFICATION\" && \"$framework\" != \"N/A\" ]] && parts+=(\"$framework\")\n \n # Join with proper formatting\n if [[ ${#parts[@]} -eq 0 ]]; then\n echo \"\"\n elif [[ ${#parts[@]} -eq 1 ]]; then\n echo \"${parts[0]}\"\n else\n # Join multiple parts with \" + \"\n local result=\"${parts[0]}\"\n for ((i=1; i\u003c${#parts[@]}; i++)); do\n result=\"$result + ${parts[i]}\"\n done\n echo \"$result\"\n fi\n}\n\n#==============================================================================\n# Template and Content Generation Functions\n#==============================================================================\n\nget_project_structure() {\n local project_type=\"$1\"\n \n if [[ \"$project_type\" == *\"web\"* ]]; then\n echo \"backend/\\\\nfrontend/\\\\ntests/\"\n else\n echo \"src/\\\\ntests/\"\n fi\n}\n\nget_commands_for_language() {\n local lang=\"$1\"\n \n case \"$lang\" in\n *\"Python\"*)\n echo \"cd src && pytest && ruff check .\"\n ;;\n *\"Rust\"*)\n echo \"cargo test && cargo clippy\"\n ;;\n *\"JavaScript\"*|*\"TypeScript\"*)\n echo \"npm test \\\\&\\\\& npm run lint\"\n ;;\n *)\n echo \"# Add commands for $lang\"\n ;;\n esac\n}\n\nget_language_conventions() {\n local lang=\"$1\"\n echo \"$lang: Follow standard conventions\"\n}\n\ncreate_new_agent_file() {\n local target_file=\"$1\"\n local temp_file=\"$2\"\n local project_name=\"$3\"\n local current_date=\"$4\"\n \n if [[ ! -f \"$TEMPLATE_FILE\" ]]; then\n log_error \"Template not found at $TEMPLATE_FILE\"\n return 1\n fi\n \n if [[ ! -r \"$TEMPLATE_FILE\" ]]; then\n log_error \"Template file is not readable: $TEMPLATE_FILE\"\n return 1\n fi\n \n log_info \"Creating new agent context file from template...\"\n \n if ! cp \"$TEMPLATE_FILE\" \"$temp_file\"; then\n log_error \"Failed to copy template file\"\n return 1\n fi\n \n # Replace template placeholders\n local project_structure\n project_structure=$(get_project_structure \"$NEW_PROJECT_TYPE\")\n \n local commands\n commands=$(get_commands_for_language \"$NEW_LANG\")\n \n local language_conventions\n language_conventions=$(get_language_conventions \"$NEW_LANG\")\n \n # Perform substitutions with error checking using safer approach\n # Escape special characters for sed by using a different delimiter or escaping\n local escaped_lang=$(printf '%s\\n' \"$NEW_LANG\" | sed 's/[\\[\\.*^$()+{}|]/\\\\&/g')\n local escaped_framework=$(printf '%s\\n' \"$NEW_FRAMEWORK\" | sed 's/[\\[\\.*^$()+{}|]/\\\\&/g')\n local escaped_branch=$(printf '%s\\n' \"$CURRENT_BRANCH\" | sed 's/[\\[\\.*^$()+{}|]/\\\\&/g')\n \n # Build technology stack and recent change strings conditionally\n local tech_stack\n if [[ -n \"$escaped_lang\" && -n \"$escaped_framework\" ]]; then\n tech_stack=\"- $escaped_lang + $escaped_framework ($escaped_branch)\"\n elif [[ -n \"$escaped_lang\" ]]; then\n tech_stack=\"- $escaped_lang ($escaped_branch)\"\n elif [[ -n \"$escaped_framework\" ]]; then\n tech_stack=\"- $escaped_framework ($escaped_branch)\"\n else\n tech_stack=\"- ($escaped_branch)\"\n fi\n\n local recent_change\n if [[ -n \"$escaped_lang\" && -n \"$escaped_framework\" ]]; then\n recent_change=\"- $escaped_branch: Added $escaped_lang + $escaped_framework\"\n elif [[ -n \"$escaped_lang\" ]]; then\n recent_change=\"- $escaped_branch: Added $escaped_lang\"\n elif [[ -n \"$escaped_framework\" ]]; then\n recent_change=\"- $escaped_branch: Added $escaped_framework\"\n else\n recent_change=\"- $escaped_branch: Added\"\n fi\n\n local substitutions=(\n \"s|\\[PROJECT NAME\\]|$project_name|\"\n \"s|\\[DATE\\]|$current_date|\"\n \"s|\\[EXTRACTED FROM ALL PLAN.MD FILES\\]|$tech_stack|\"\n \"s|\\[ACTUAL STRUCTURE FROM PLANS\\]|$project_structure|g\"\n \"s|\\[ONLY COMMANDS FOR ACTIVE TECHNOLOGIES\\]|$commands|\"\n \"s|\\[LANGUAGE-SPECIFIC, ONLY FOR LANGUAGES IN USE\\]|$language_conventions|\"\n \"s|\\[LAST 3 FEATURES AND WHAT THEY ADDED\\]|$recent_change|\"\n )\n \n for substitution in \"${substitutions[@]}\"; do\n if ! sed -i.bak -e \"$substitution\" \"$temp_file\"; then\n log_error \"Failed to perform substitution: $substitution\"\n rm -f \"$temp_file\" \"$temp_file.bak\"\n return 1\n fi\n done\n \n # Convert \\n sequences to actual newlines\n newline=$(printf '\\n')\n sed -i.bak2 \"s/\\\\\\\\n/${newline}/g\" \"$temp_file\"\n \n # Clean up backup files\n rm -f \"$temp_file.bak\" \"$temp_file.bak2\"\n \n return 0\n}\n\n\n\n\nupdate_existing_agent_file() {\n local target_file=\"$1\"\n local current_date=\"$2\"\n \n log_info \"Updating existing agent context file...\"\n \n # Use a single temporary file for atomic update\n local temp_file\n temp_file=$(mktemp) || {\n log_error \"Failed to create temporary file\"\n return 1\n }\n \n # Process the file in one pass\n local tech_stack=$(format_technology_stack \"$NEW_LANG\" \"$NEW_FRAMEWORK\")\n local new_tech_entries=()\n local new_change_entry=\"\"\n \n # Prepare new technology entries\n if [[ -n \"$tech_stack\" ]] && ! grep -q \"$tech_stack\" \"$target_file\"; then\n new_tech_entries+=(\"- $tech_stack ($CURRENT_BRANCH)\")\n fi\n \n if [[ -n \"$NEW_DB\" ]] && [[ \"$NEW_DB\" != \"N/A\" ]] && [[ \"$NEW_DB\" != \"NEEDS CLARIFICATION\" ]] && ! grep -q \"$NEW_DB\" \"$target_file\"; then\n new_tech_entries+=(\"- $NEW_DB ($CURRENT_BRANCH)\")\n fi\n \n # Prepare new change entry\n if [[ -n \"$tech_stack\" ]]; then\n new_change_entry=\"- $CURRENT_BRANCH: Added $tech_stack\"\n elif [[ -n \"$NEW_DB\" ]] && [[ \"$NEW_DB\" != \"N/A\" ]] && [[ \"$NEW_DB\" != \"NEEDS CLARIFICATION\" ]]; then\n new_change_entry=\"- $CURRENT_BRANCH: Added $NEW_DB\"\n fi\n \n # Check if sections exist in the file\n local has_active_technologies=0\n local has_recent_changes=0\n \n if grep -q \"^## Active Technologies\" \"$target_file\" 2>/dev/null; then\n has_active_technologies=1\n fi\n \n if grep -q \"^## Recent Changes\" \"$target_file\" 2>/dev/null; then\n has_recent_changes=1\n fi\n \n # Process file line by line\n local in_tech_section=false\n local in_changes_section=false\n local tech_entries_added=false\n local changes_entries_added=false\n local existing_changes_count=0\n local file_ended=false\n \n while IFS= read -r line || [[ -n \"$line\" ]]; do\n # Handle Active Technologies section\n if [[ \"$line\" == \"## Active Technologies\" ]]; then\n echo \"$line\" >> \"$temp_file\"\n in_tech_section=true\n continue\n elif [[ $in_tech_section == true ]] && [[ \"$line\" =~ ^##[[:space:]] ]]; then\n # Add new tech entries before closing the section\n if [[ $tech_entries_added == false ]] && [[ ${#new_tech_entries[@]} -gt 0 ]]; then\n printf '%s\\n' \"${new_tech_entries[@]}\" >> \"$temp_file\"\n tech_entries_added=true\n fi\n echo \"$line\" >> \"$temp_file\"\n in_tech_section=false\n continue\n elif [[ $in_tech_section == true ]] && [[ -z \"$line\" ]]; then\n # Add new tech entries before empty line in tech section\n if [[ $tech_entries_added == false ]] && [[ ${#new_tech_entries[@]} -gt 0 ]]; then\n printf '%s\\n' \"${new_tech_entries[@]}\" >> \"$temp_file\"\n tech_entries_added=true\n fi\n echo \"$line\" >> \"$temp_file\"\n continue\n fi\n \n # Handle Recent Changes section\n if [[ \"$line\" == \"## Recent Changes\" ]]; then\n echo \"$line\" >> \"$temp_file\"\n # Add new change entry right after the heading\n if [[ -n \"$new_change_entry\" ]]; then\n echo \"$new_change_entry\" >> \"$temp_file\"\n fi\n in_changes_section=true\n changes_entries_added=true\n continue\n elif [[ $in_changes_section == true ]] && [[ \"$line\" =~ ^##[[:space:]] ]]; then\n echo \"$line\" >> \"$temp_file\"\n in_changes_section=false\n continue\n elif [[ $in_changes_section == true ]] && [[ \"$line\" == \"- \"* ]]; then\n # Keep only first 2 existing changes\n if [[ $existing_changes_count -lt 2 ]]; then\n echo \"$line\" >> \"$temp_file\"\n ((existing_changes_count++))\n fi\n continue\n fi\n \n # Update timestamp\n if [[ \"$line\" =~ \\*\\*Last\\ updated\\*\\*:.*[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] ]]; then\n echo \"$line\" | sed \"s/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/$current_date/\" >> \"$temp_file\"\n else\n echo \"$line\" >> \"$temp_file\"\n fi\n done \u003c \"$target_file\"\n \n # Post-loop check: if we're still in the Active Technologies section and haven't added new entries\n if [[ $in_tech_section == true ]] && [[ $tech_entries_added == false ]] && [[ ${#new_tech_entries[@]} -gt 0 ]]; then\n printf '%s\\n' \"${new_tech_entries[@]}\" >> \"$temp_file\"\n tech_entries_added=true\n fi\n \n # If sections don't exist, add them at the end of the file\n if [[ $has_active_technologies -eq 0 ]] && [[ ${#new_tech_entries[@]} -gt 0 ]]; then\n echo \"\" >> \"$temp_file\"\n echo \"## Active Technologies\" >> \"$temp_file\"\n printf '%s\\n' \"${new_tech_entries[@]}\" >> \"$temp_file\"\n tech_entries_added=true\n fi\n \n if [[ $has_recent_changes -eq 0 ]] && [[ -n \"$new_change_entry\" ]]; then\n echo \"\" >> \"$temp_file\"\n echo \"## Recent Changes\" >> \"$temp_file\"\n echo \"$new_change_entry\" >> \"$temp_file\"\n changes_entries_added=true\n fi\n \n # Move temp file to target atomically\n if ! mv \"$temp_file\" \"$target_file\"; then\n log_error \"Failed to update target file\"\n rm -f \"$temp_file\"\n return 1\n fi\n \n return 0\n}\n#==============================================================================\n# Main Agent File Update Function\n#==============================================================================\n\nupdate_agent_file() {\n local target_file=\"$1\"\n local agent_name=\"$2\"\n \n if [[ -z \"$target_file\" ]] || [[ -z \"$agent_name\" ]]; then\n log_error \"update_agent_file requires target_file and agent_name parameters\"\n return 1\n fi\n \n log_info \"Updating $agent_name context file: $target_file\"\n \n local project_name\n project_name=$(basename \"$REPO_ROOT\")\n local current_date\n current_date=$(date +%Y-%m-%d)\n \n # Create directory if it doesn't exist\n local target_dir\n target_dir=$(dirname \"$target_file\")\n if [[ ! -d \"$target_dir\" ]]; then\n if ! mkdir -p \"$target_dir\"; then\n log_error \"Failed to create directory: $target_dir\"\n return 1\n fi\n fi\n \n if [[ ! -f \"$target_file\" ]]; then\n # Create new file from template\n local temp_file\n temp_file=$(mktemp) || {\n log_error \"Failed to create temporary file\"\n return 1\n }\n \n if create_new_agent_file \"$target_file\" \"$temp_file\" \"$project_name\" \"$current_date\"; then\n if mv \"$temp_file\" \"$target_file\"; then\n log_success \"Created new $agent_name context file\"\n else\n log_error \"Failed to move temporary file to $target_file\"\n rm -f \"$temp_file\"\n return 1\n fi\n else\n log_error \"Failed to create new agent file\"\n rm -f \"$temp_file\"\n return 1\n fi\n else\n # Update existing file\n if [[ ! -r \"$target_file\" ]]; then\n log_error \"Cannot read existing file: $target_file\"\n return 1\n fi\n \n if [[ ! -w \"$target_file\" ]]; then\n log_error \"Cannot write to existing file: $target_file\"\n return 1\n fi\n \n if update_existing_agent_file \"$target_file\" \"$current_date\"; then\n log_success \"Updated existing $agent_name context file\"\n else\n log_error \"Failed to update existing agent file\"\n return 1\n fi\n fi\n \n return 0\n}\n\n#==============================================================================\n# Agent Selection and Processing\n#==============================================================================\n\nupdate_specific_agent() {\n local agent_type=\"$1\"\n \n case \"$agent_type\" in\n claude)\n update_agent_file \"$CLAUDE_FILE\" \"Claude Code\"\n ;;\n gemini)\n update_agent_file \"$GEMINI_FILE\" \"Gemini CLI\"\n ;;\n copilot)\n update_agent_file \"$COPILOT_FILE\" \"GitHub Copilot\"\n ;;\n cursor-agent)\n update_agent_file \"$CURSOR_FILE\" \"Cursor IDE\"\n ;;\n qwen)\n update_agent_file \"$QWEN_FILE\" \"Qwen Code\"\n ;;\n opencode)\n update_agent_file \"$AGENTS_FILE\" \"opencode\"\n ;;\n codex)\n update_agent_file \"$AGENTS_FILE\" \"Codex CLI\"\n ;;\n windsurf)\n update_agent_file \"$WINDSURF_FILE\" \"Windsurf\"\n ;;\n kilocode)\n update_agent_file \"$KILOCODE_FILE\" \"Kilo Code\"\n ;;\n auggie)\n update_agent_file \"$AUGGIE_FILE\" \"Auggie CLI\"\n ;;\n roo)\n update_agent_file \"$ROO_FILE\" \"Roo Code\"\n ;;\n codebuddy)\n update_agent_file \"$CODEBUDDY_FILE\" \"CodeBuddy CLI\"\n ;;\n amp)\n update_agent_file \"$AMP_FILE\" \"Amp\"\n ;;\n q)\n update_agent_file \"$Q_FILE\" \"Amazon Q Developer CLI\"\n ;;\n *)\n log_error \"Unknown agent type '$agent_type'\"\n log_error \"Expected: claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|roo|amp|q\"\n exit 1\n ;;\n esac\n}\n\nupdate_all_existing_agents() {\n local found_agent=false\n \n # Check each possible agent file and update if it exists\n if [[ -f \"$CLAUDE_FILE\" ]]; then\n update_agent_file \"$CLAUDE_FILE\" \"Claude Code\"\n found_agent=true\n fi\n \n if [[ -f \"$GEMINI_FILE\" ]]; then\n update_agent_file \"$GEMINI_FILE\" \"Gemini CLI\"\n found_agent=true\n fi\n \n if [[ -f \"$COPILOT_FILE\" ]]; then\n update_agent_file \"$COPILOT_FILE\" \"GitHub Copilot\"\n found_agent=true\n fi\n \n if [[ -f \"$CURSOR_FILE\" ]]; then\n update_agent_file \"$CURSOR_FILE\" \"Cursor IDE\"\n found_agent=true\n fi\n \n if [[ -f \"$QWEN_FILE\" ]]; then\n update_agent_file \"$QWEN_FILE\" \"Qwen Code\"\n found_agent=true\n fi\n \n if [[ -f \"$AGENTS_FILE\" ]]; then\n update_agent_file \"$AGENTS_FILE\" \"Codex/opencode\"\n found_agent=true\n fi\n \n if [[ -f \"$WINDSURF_FILE\" ]]; then\n update_agent_file \"$WINDSURF_FILE\" \"Windsurf\"\n found_agent=true\n fi\n \n if [[ -f \"$KILOCODE_FILE\" ]]; then\n update_agent_file \"$KILOCODE_FILE\" \"Kilo Code\"\n found_agent=true\n fi\n\n if [[ -f \"$AUGGIE_FILE\" ]]; then\n update_agent_file \"$AUGGIE_FILE\" \"Auggie CLI\"\n found_agent=true\n fi\n \n if [[ -f \"$ROO_FILE\" ]]; then\n update_agent_file \"$ROO_FILE\" \"Roo Code\"\n found_agent=true\n fi\n\n if [[ -f \"$CODEBUDDY_FILE\" ]]; then\n update_agent_file \"$CODEBUDDY_FILE\" \"CodeBuddy CLI\"\n found_agent=true\n fi\n\n if [[ -f \"$Q_FILE\" ]]; then\n update_agent_file \"$Q_FILE\" \"Amazon Q Developer CLI\"\n found_agent=true\n fi\n \n # If no agent files exist, create a default Claude file\n if [[ \"$found_agent\" == false ]]; then\n log_info \"No existing agent files found, creating default Claude file...\"\n update_agent_file \"$CLAUDE_FILE\" \"Claude Code\"\n fi\n}\nprint_summary() {\n echo\n log_info \"Summary of changes:\"\n \n if [[ -n \"$NEW_LANG\" ]]; then\n echo \" - Added language: $NEW_LANG\"\n fi\n \n if [[ -n \"$NEW_FRAMEWORK\" ]]; then\n echo \" - Added framework: $NEW_FRAMEWORK\"\n fi\n \n if [[ -n \"$NEW_DB\" ]] && [[ \"$NEW_DB\" != \"N/A\" ]]; then\n echo \" - Added database: $NEW_DB\"\n fi\n \n echo\n\n log_info \"Usage: $0 [claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|codebuddy|q]\"\n}\n\n#==============================================================================\n# Main Execution\n#==============================================================================\n\nmain() {\n # Validate environment before proceeding\n validate_environment\n \n log_info \"=== Updating agent context files for feature $CURRENT_BRANCH ===\"\n \n # Parse the plan file to extract project information\n if ! parse_plan_data \"$NEW_PLAN\"; then\n log_error \"Failed to parse plan data\"\n exit 1\n fi\n \n # Process based on agent type argument\n local success=true\n \n if [[ -z \"$AGENT_TYPE\" ]]; then\n # No specific agent provided - update all existing agent files\n log_info \"No agent specified, updating all existing agent files...\"\n if ! update_all_existing_agents; then\n success=false\n fi\n else\n # Specific agent provided - update only that agent\n log_info \"Updating specific agent: $AGENT_TYPE\"\n if ! update_specific_agent \"$AGENT_TYPE\"; then\n success=false\n fi\n fi\n \n # Print summary\n print_summary\n \n if [[ \"$success\" == true ]]; then\n log_success \"Agent context update completed successfully\"\n exit 0\n else\n log_error \"Agent context update completed with errors\"\n exit 1\n fi\n}\n\n# Execute main function if script is run directly\nif [[ \"${BASH_SOURCE[0]}\" == \"${0}\" ]]; then\n main \"$@\"\nfi\n\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":24782,"content_sha256":"924517ff340d757af9d7dcb5203dccf8138fe46c6a6f0c555e5f98a1d8330693"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":2},"content":[{"text":"用户输入","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"text"},"content":[{"text":"$ARGUMENTS","type":"text"}]},{"type":"paragraph","content":[{"text":"在继续之前,您","type":"text"},{"text":"必须","type":"text","marks":[{"type":"strong"}]},{"text":"考虑用户输入(如果不为空)。","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"大纲","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"设置","type":"text","marks":[{"type":"strong"}]},{"text":": 从仓库根目录运行 ","type":"text"},{"text":".specify/scripts/powershell/setup-plan.ps1 -Json","type":"text","marks":[{"type":"code_inline"}]},{"text":" 并解析 JSON 以获取 FEATURE_SPEC、IMPL_PLAN、SPECS_DIR、BRANCH。对于参数中的单引号,如 \"I'm Groot\",请使用转义语法:例如 'I'''m Groot'(或者如果可能的话使用双引号:\"I'm Groot\")。","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"加载上下文","type":"text","marks":[{"type":"strong"}]},{"text":": 读取 FEATURE_SPEC 和 ","type":"text"},{"text":".specify/memory/constitution.md","type":"text","marks":[{"type":"code_inline"}]},{"text":"。加载 IMPL_PLAN 模板(已复制)。","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"执行计划工作流程","type":"text","marks":[{"type":"strong"}]},{"text":": 遵循 IMPL_PLAN 模板中的结构来:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"填写技术上下文(将未知项标记为\"需要澄清\")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"从章程中填写章程检查部分","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"评估门禁(如果有未正当化的违规则报错)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"阶段 0: 生成 research.md(解决所有\"需要澄清\")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"阶段 1: 生成 data-model.md、contracts/、quickstart.md","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"阶段 1: 通过运行代理脚本更新代理上下文","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"设计后重新评估章程检查","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"停止并报告","type":"text","marks":[{"type":"strong"}]},{"text":": 命令在阶段 2 规划后结束。报告分支、IMPL_PLAN 路径和生成的工件。","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"阶段","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"阶段 0: 大纲与研究","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"从上述技术上下文中提取未知项","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"对于每个\"需要澄清\" → 研究任务","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"对于每个依赖项 → 最佳实践任务","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"对于每个集成 → 模式任务","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"生成并分发研究代理","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"text"},"content":[{"text":"对于技术上下文中的每个未知项:\n 任务: \"研究 {未知项} 用于 {功能上下文}\"\n对于每个技术选择:\n 任务: \"查找 {技术} 在 {领域} 中的最佳实践\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"在 ","type":"text","marks":[{"type":"strong"}]},{"text":"research.md","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" 中整合发现结果","type":"text","marks":[{"type":"strong"}]},{"text":",使用格式:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"决策: [选择了什么]","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"理由: [为什么选择]","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"考虑的替代方案: [还评估了什么]","type":"text"}]}]}]}]}]},{"type":"paragraph","content":[{"text":"输出","type":"text","marks":[{"type":"strong"}]},{"text":": 解决了所有\"需要澄清\"的 research.md","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"阶段 1: 设计与契约","type":"text"}]},{"type":"paragraph","content":[{"text":"前提条件:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"research.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" 完成","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"从功能规格中提取实体","type":"text","marks":[{"type":"strong"}]},{"text":" → ","type":"text"},{"text":"data-model.md","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"实体名称、字段、关系","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"来自需求的验证规则","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"如适用的状态转换","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"从功能需求生成 API 契约","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"对于每个用户操作 → 端点","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"使用标准的 REST/GraphQL 模式","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"将 OpenAPI/GraphQL 模式输出到 ","type":"text"},{"text":"/contracts/","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"代理上下文更新","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"运行 ","type":"text"},{"text":".specify/scripts/powershell/update-agent-context.ps1 -AgentType claude","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"这些脚本检测正在使用的 AI 代理","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"更新相应的代理特定上下文文件","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"仅添加当前计划中的新技术","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"保留标记之间的手动添加内容","type":"text"}]}]}]}]}]},{"type":"paragraph","content":[{"text":"输出","type":"text","marks":[{"type":"strong"}]},{"text":": data-model.md、/contracts/*、quickstart.md、代理特定文件","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"关键规则","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"使用绝对路径","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"如果检查点失败或存在未解决的澄清项,则报 ERROR","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"speckit-plan-zh","author":"@skillopedia","source":{"stars":9,"repo_name":"open-skilled-sdd","origin_url":"https://github.com/forztf/open-skilled-sdd/blob/HEAD/skills/speckit-plan-zh/SKILL.md","repo_owner":"forztf","body_sha256":"c1ceab593b8b03534baffb04a0587bff1b8fbea00f8224e9672f9013fc29d0eb","cluster_key":"2cf7b0b8cdd12eec1195643932456801641f1828eeaa7369cb97bbfca853557c","clean_bundle":{"format":"clean-skill-bundle-v1","source":"forztf/open-skilled-sdd/skills/speckit-plan-zh/SKILL.md","attachments":[{"id":"f41da605-de07-5926-9903-a0fabe275b27","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f41da605-de07-5926-9903-a0fabe275b27/attachment.md","path":"assets/key-rules.md","size":206,"sha256":"0dc7e6c1e96cdae72dafbf6e5db3e67e33276b2c1abab06158ac3bc9bab8a752","contentType":"text/markdown; charset=utf-8"},{"id":"17918707-d44f-509e-a0d5-6b3569013d39","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/17918707-d44f-509e-a0d5-6b3569013d39/attachment.md","path":"assets/phase0-research.md","size":712,"sha256":"cdf85b525267141a394604d4930e6f791e58518afd5c0e1507501a5bcace8efc","contentType":"text/markdown; charset=utf-8"},{"id":"68258a65-7d0e-5fa9-b2b8-48955c4c0ace","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/68258a65-7d0e-5fa9-b2b8-48955c4c0ace/attachment.md","path":"assets/phase1-design.md","size":816,"sha256":"bd328dc043d5a451a4e6c830b2586c5f1f8c4c98fffb5ac21ab170b998b72fc9","contentType":"text/markdown; charset=utf-8"},{"id":"eb649290-372b-5e4a-9585-aa33588da4a5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/eb649290-372b-5e4a-9585-aa33588da4a5/attachment.md","path":"assets/plan-template.md","size":3579,"sha256":"4e86cc6b346c5a2c72e30abcf796214159a063eb4aa6f74ab88bddf84d281a4c","contentType":"text/markdown; charset=utf-8"},{"id":"457e6a60-3528-5f43-858e-4818da50f2cc","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/457e6a60-3528-5f43-858e-4818da50f2cc/attachment.md","path":"assets/setup-workflow.md","size":544,"sha256":"68ad3e9551aea4ed88560cedb0ef34b9fbede9a871878aeff682f8908126135b","contentType":"text/markdown; charset=utf-8"},{"id":"be8e8cc2-75c2-5212-8511-170a17efe4a1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/be8e8cc2-75c2-5212-8511-170a17efe4a1/attachment.md","path":"references/technical-context.md","size":1613,"sha256":"908f1a41d28e53d63bb4707ddaa118aae2106d941e54a510c9f83c021c8f4472","contentType":"text/markdown; charset=utf-8"},{"id":"6171ee97-d26f-5ea2-8ef8-e782d6f8aa3b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6171ee97-d26f-5ea2-8ef8-e782d6f8aa3b/attachment.sh","path":"scripts/bash/check-prerequisites.sh","size":4975,"sha256":"714946a50c93464750845ed2bcf569e740e3d54a731261e02e6ee838e3fee1c2","contentType":"application/x-sh; charset=utf-8"},{"id":"004bcd14-9550-581e-bf76-e2df32aa355d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/004bcd14-9550-581e-bf76-e2df32aa355d/attachment.sh","path":"scripts/bash/common.sh","size":4909,"sha256":"738501643e7271a5a91213089ccec1b5d1bff1c69ca12dbff5877e51502d0468","contentType":"application/x-sh; charset=utf-8"},{"id":"f8124a2d-8074-5616-84a6-eeca6827c733","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f8124a2d-8074-5616-84a6-eeca6827c733/attachment.sh","path":"scripts/bash/create-new-feature.sh","size":9420,"sha256":"ab6eaa8d4f6ab74dd46ddb7f783084cb0ea71a9bdf858d5cade5f7e13a5f3570","contentType":"application/x-sh; charset=utf-8"},{"id":"adaa752f-18d4-54dc-85f8-1aff86051765","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/adaa752f-18d4-54dc-85f8-1aff86051765/attachment.sh","path":"scripts/bash/setup-plan.sh","size":1617,"sha256":"48a1285e616f94f2a706bff036682c7f4e88b7d3e9cd6ea54a6313246ecb076d","contentType":"application/x-sh; charset=utf-8"},{"id":"9e589a3d-41e9-50ad-84c6-eb2e6c05c262","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9e589a3d-41e9-50ad-84c6-eb2e6c05c262/attachment.sh","path":"scripts/bash/update-agent-context.sh","size":24782,"sha256":"924517ff340d757af9d7dcb5203dccf8138fe46c6a6f0c555e5f98a1d8330693","contentType":"application/x-sh; charset=utf-8"},{"id":"1cbc7faf-0238-5138-b615-266c3bb801e0","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1cbc7faf-0238-5138-b615-266c3bb801e0/attachment.ps1","path":"scripts/execute-workflow.ps1","size":5621,"sha256":"a7a547b77e28fd1ba8eba7f3ce4cc8697cce44ed1d18b2a08a53d1182908ae03","contentType":"application/octet-stream"},{"id":"6bc299d3-77e8-58ef-a03d-23f0a4d4b19f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6bc299d3-77e8-58ef-a03d-23f0a4d4b19f/attachment.ps1","path":"scripts/powershell/check-prerequisites.ps1","size":4805,"sha256":"bcb37804b0757c37799b65a9321c1d3fb7b7ddcab6703c55c5b9a142c9166bf1","contentType":"text/plain; charset=utf-8"},{"id":"eceb682d-4e00-5992-8ee0-94ef1ba8a1f7","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/eceb682d-4e00-5992-8ee0-94ef1ba8a1f7/attachment.ps1","path":"scripts/powershell/common.ps1","size":3849,"sha256":"f17e2c63b17bf4f96ec0613910601dd42a123e91cf2c58c38111eb0a65f4f410","contentType":"text/plain; charset=utf-8"},{"id":"54d665ca-a07d-5d0f-9880-5f0a4c7360cc","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/54d665ca-a07d-5d0f-9880-5f0a4c7360cc/attachment.ps1","path":"scripts/powershell/create-new-feature.ps1","size":9839,"sha256":"8bc740bec13b7d4b4210b83c5406af73bb0bceabb8789c7905e3098fa14709aa","contentType":"text/plain; charset=utf-8"},{"id":"75f778bf-3db5-5b9b-8c01-76f595d768ea","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/75f778bf-3db5-5b9b-8c01-76f595d768ea/attachment.ps1","path":"scripts/powershell/setup-plan.ps1","size":1854,"sha256":"627455d090a9ea8d91cecec2d24dbf2fa7acda778e65abf7f7529a84668bcbf7","contentType":"text/plain; charset=utf-8"},{"id":"f9e15233-a89d-5840-961b-24f2a2794079","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f9e15233-a89d-5840-961b-24f2a2794079/attachment.ps1","path":"scripts/powershell/update-agent-context.ps1","size":19246,"sha256":"8ed483828b434c675c73556936b0d62ebd52d2886de2f4129fcdf31bfb9d8588","contentType":"text/plain; charset=utf-8"},{"id":"3d5b869c-a02a-5b28-b377-13e62b5a59fa","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3d5b869c-a02a-5b28-b377-13e62b5a59fa/attachment.ps1","path":"scripts/setup-plan.ps1","size":1940,"sha256":"b297f708410c3564ffcb157bfbb073ce7e90e2af5bd0efa6815d430169a658ed","contentType":"text/plain; charset=utf-8"},{"id":"e302c17b-5ffd-506f-88bb-f1e9a5ba9925","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e302c17b-5ffd-506f-88bb-f1e9a5ba9925/attachment.ps1","path":"scripts/update-agent-context.ps1","size":3151,"sha256":"38680e8138fb5f87bcc9a3649dbe39b3efd67c7f609df2e8acbc3f2028bfe7d4","contentType":"text/plain; charset=utf-8"}],"bundle_sha256":"a3b7adcc5ea59300b41c81fdb17fd47e65af992809eb7fa521c44a4cfe053a29","attachment_count":19,"text_attachments":11,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":8,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/speckit-plan-zh/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"general","category_label":"General"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"general","import_tag":"clean-skills-v1","description":"执行实施规划工作流程,使用计划模板生成设计工件。触发词包括:\"speckit计划\"。"}},"renderedAt":1782981034178}

用户输入 在继续之前,您 必须 考虑用户输入(如果不为空)。 大纲 1. 设置 : 从仓库根目录运行 并解析 JSON 以获取 FEATURE SPEC、IMPL PLAN、SPECS DIR、BRANCH。对于参数中的单引号,如 "I'm Groot",请使用转义语法:例如 'I'\''m Groot'(或者如果可能的话使用双引号:"I'm Groot")。 2. 加载上下文 : 读取 FEATURE SPEC 和 。加载 IMPL PLAN 模板(已复制)。 3. 执行计划工作流程 : 遵循 IMPL PLAN 模板中的结构来: - 填写技术上下文(将未知项标记为"需要澄清") - 从章程中填写章程检查部分 - 评估门禁(如果有未正当化的违规则报错) - 阶段 0: 生成 research.md(解决所有"需要澄清") - 阶段 1: 生成 data-model.md、contracts/、quickstart.md - 阶段 1: 通过运行代理脚本更新代理上下文 - 设计后重新评估章程检查 4. 停止并报告 : 命令在阶段 2 规划后结束。报告分支、IMPL PLAN 路径和生成的工件。 阶段 阶段 0: 大纲与研究 1. 从上述技术上下文中提取未知项 : - 对于每个"需要澄清" → 研究任务 - 对于每个依赖项 → 最佳实践任务 - 对于每个集成 → 模式任务 2. 生…