[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FEPA8NHJSYB6Q1W81RCQH9":3,"skill-same:01M7FEPA8NHJSYB6Q1W81RCQH9":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":55},"01M7FEPA8NHJSYB6Q1W81RCQH9","flow-spec",null,"NLSpec authoring — use when you need a structured specification from multi-AI research and consensus","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fflow-spec\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: flow-spec\ndisable-model-invocation: true\neffort: high\naliases:\n  - spec\n  - nlspec\n  - specification\ndescription: NLSpec authoring — use when you need a structured specification from multi-AI research and consensus\nexecution_mode: enforced\nvalidation_gates:\n  - orchestrate_sh_executed\n  - synthesis_file_exists\n  - nlspec_completeness_validated\n---\n\n# STOP - SKILL ALREADY LOADED\n\n**DO NOT call Skill() again. DO NOT load any more skills. Execute directly.**\n\n---\n\n## EXECUTION CONTRACT (MANDATORY - CANNOT SKIP)\n\nThis skill uses **ENFORCED execution mode**. You MUST follow this exact 8-step sequence.\n\n---\n\n### STEP 1: Clarifying Questions (MANDATORY)\n\n**Ask via AskUserQuestion BEFORE any other action.**\n\nYou MUST gather these inputs from the user — spec quality depends on knowing actors, constraints, and complexity upfront; without these the research query is too broad and the spec will have gaps:\n\n```\nAskUserQuestion with these questions:\n\n1. **What to specify**: Project or feature name + brief description\n   - \"What system\u002Ffeature should I specify?\"\n\n2. **Actors**: Who interacts with this system?\n   - Options: End Users, Developers, Admins, External Services, Other\n\n3. **Key constraints**: What matters most?\n   - Options: Performance, Security, Compatibility, Scale\n   - (multiSelect: true)\n\n4. **Complexity class**: How complex is this?\n   - Clear (well-understood, straightforward)\n   - Complicated (multiple parts, but knowable)\n   - Complex (emergent behavior, unknowns)\n```\n\nIf user provided a description inline with the command (e.g., `\u002Focto:spec user authentication system`), use that as the project description but STILL ask remaining questions (actors, constraints, complexity).\n\nIf user says \"skip\" for any question, note assumptions and proceed.\n\n**DO NOT PROCEED TO STEP 2 until questions answered.**\n\n---\n\n### STEP 2: Display Visual Indicators (MANDATORY - BLOCKING)\n\n**Check provider availability:**\n\n```bash\nprovider_status=$(bash \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fhelpers\u002Fcheck-providers.sh\")\ncodex_status=$(echo \"$provider_status\" | grep -q '^codex:available' && echo \"Available\" || echo \"Not installed\")\nagy_status=$(echo \"$provider_status\" | grep -q '^agy:available' && echo \"Available\" || echo \"Not installed\")\n```\n\n**Display this banner BEFORE orchestrate.sh execution:**\n\n```\n🐙 CLAUDE OCTOPUS ACTIVATED - NLSpec Authoring Mode\nSpec Phase: Generating structured specification for [project name]\n\nProvider Availability:\nCodex CLI: ${codex_status}\nAntigravity CLI: ${agy_status}\nClaude: Available (Synthesis & NLSpec generation)\n\nEstimated Cost: $0.01-0.05\nEstimated Time: 3-7 minutes\n```\n\n**Validation:**\n- If no external providers are available -> STOP, suggest: `\u002Focto:setup`\n- If one or more external providers are available -> Continue with available provider(s)\n\n**DO NOT PROCEED TO STEP 3 until banner displayed.**\n\n---\n\n### STEP 3: Read Prior State (MANDATORY - State Management)\n\n**Before executing the workflow, read any prior context:**\n\n```bash\n# Initialize state if needed\n\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" init_state\n\n# Set current workflow\n\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" set_current_workflow \"flow-spec\" \"spec\"\n\n# Get prior decisions (if any)\nprior_decisions=$(\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" get_decisions \"all\")\n\n# Get context from previous phases (e.g., discover)\nprior_context=$(\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" read_state | jq -r '.context')\n\n# Display what you found (if any)\nif [[ \"$prior_decisions\" != \"[]\" && \"$prior_decisions\" != \"null\" ]]; then\n  echo \"Building on prior decisions:\"\n  echo \"$prior_decisions\" | jq -r '.[] | \"  - \\(.decision) (\\(.phase)): \\(.rationale)\"'\nfi\n```\n\n**This provides context from:**\n- Prior discover phases (if user ran `\u002Focto:discover` first)\n- Architectural decisions already made\n- User vision captured in earlier phases\n\n**DO NOT PROCEED TO STEP 4 until state read.**\n\n---\n\n### STEP 4: Execute orchestrate.sh probe (MANDATORY - Use Bash Tool)\n\n**You MUST execute this command via the Bash tool:**\n\n```bash\n${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Forchestrate.sh probe \"specification research for: \u003Cproject description>. Key areas: actors (\u003Cactors>), constraints (\u003Cconstraints>), complexity (\u003Ccomplexity class>)\"\n```\n\nIncorporate the user's answers from Step 1 into the probe query to focus the research.\n\n**CRITICAL: You are PROHIBITED from:**\n- Researching directly without calling orchestrate.sh — direct spec writing skips the multi-AI research that surfaces edge cases, alternative architectures, and constraint interactions\n- Using web search instead of orchestrate.sh\n- Claiming you're \"simulating\" the workflow\n- Proceeding to Step 5 without running this command\n- Substituting with direct Claude analysis\n\n**You MUST use the Bash tool to invoke orchestrate.sh.**\n\n---\n\n### STEP 5: Verify Probe Synthesis (MANDATORY - Validation Gate)\n\n**After orchestrate.sh completes, verify it succeeded:**\n\n```bash\n# Find the latest synthesis file (created within last 10 minutes)\nSYNTHESIS_FILE=$(find ~\u002F.claude-octopus\u002Fresults -name \"probe-synthesis-*.md\" -mmin -10 2>\u002Fdev\u002Fnull | head -n1)\n\nif [[ -z \"$SYNTHESIS_FILE\" ]]; then\n  echo \"VALIDATION FAILED: No synthesis file found\"\n  echo \"orchestrate.sh did not execute properly\"\n  exit 1\nfi\n\necho \"VALIDATION PASSED: $SYNTHESIS_FILE\"\ncat \"$SYNTHESIS_FILE\"\n```\n\n**If validation fails:**\n1. Report error to user\n2. Show logs from `~\u002F.claude-octopus\u002Flogs\u002F`\n3. DO NOT proceed with generating NLSpec\n4. DO NOT substitute with direct research — fallback to single-model analysis skips the multi-provider synthesis that surfaces edge cases and alternative approaches\n\n---\n\n### STEP 6: Synthesize into NLSpec Format (MANDATORY)\n\n**Read the probe synthesis file from Step 5 and the user's answers from Step 1.**\n\nSynthesize into the NLSpec template below. This is YOUR (Claude's) synthesis role - you read the multi-AI research and structure it into the specification format.\n\n**NLSpec Template:**\n\n```markdown\n# NLSpec: [Project Name]\n\n## Meta\n- Version: 1.0.0\n- Author: [human author from user context, or \"TBD\"]\n- Created: [today's date]\n- Complexity: [clear | complicated | complex - from Step 1]\n\n## Purpose\n[1-3 sentences: what this software does and for whom. Derived from user description + probe research.]\n\n## Actors\n- **[Actor 1]**: [Role description and capabilities]\n- **[Actor 2]**: [Role description and capabilities]\n[Include all actors from Step 1 answers + any discovered in research]\n\n## Behaviors\n\n### B1: [Behavior Name]\n- **Trigger**: [What initiates this behavior]\n- **Preconditions**: [What must be true before execution]\n- **Steps**:\n  1. [Step 1]\n  2. [Step 2]\n- **Postconditions**: [What must be true after execution]\n- **Edge Cases**:\n  - [Edge case]: [Expected handling]\n\n### B2: [Behavior Name]\n- **Trigger**: [What initiates this behavior]\n- **Preconditions**: [What must be true before execution]\n- **Steps**:\n  1. [Step 1]\n- **Postconditions**: [What must be true after execution]\n- **Edge Cases**:\n  - [Edge case]: [Expected handling]\n\n[Add as many behaviors as the research and scope warrant. Aim for 3-7 core behaviors.]\n\n## Constraints\n- **Performance**: [Latency, throughput requirements]\n- **Security**: [Authentication, authorization, data handling]\n- **Compatibility**: [APIs, platforms, browsers, versions]\n- **Scale**: [Expected load, data volume, growth projections]\n[Populate from Step 1 constraint answers + probe research findings]\n\n## Dependencies\n- **External Services**: [APIs, databases, third-party services]\n- **Libraries\u002FFrameworks**: [Required packages, minimum versions]\n\n## Acceptance Definition\n- **Satisfaction Target**: [0.0-1.0, e.g., 0.90 - based on complexity class]\n- **Critical Behaviors**: [Which behaviors must achieve 1.0 satisfaction]\n```\n\n**Guidelines for synthesis:**\n- Use research findings to fill in realistic, specific values (not placeholders)\n- Behaviors should be concrete and testable, not vague\n- Constraints should have measurable targets where possible\n- For \"clear\" complexity: aim for 0.95 satisfaction target\n- For \"complicated\" complexity: aim for 0.90 satisfaction target\n- For \"complex\" complexity: aim for 0.85 satisfaction target\n\n---\n\n### STEP 6.5: Adversarial Completeness Challenge (RECOMMENDED)\n\n**After generating the NLSpec draft but BEFORE validation, challenge its completeness using a different provider.** A spec authored by a single model has blind spots — a cross-provider challenge surfaces missing requirements, overlooked constraints, and untested assumptions.\n\n**Dispatch the NLSpec draft through Octopus routing to a different provider:**\n\n```bash\nreview_provider=\"\"\ncommand -v codex >\u002Fdev\u002Fnull 2>&1 && review_provider=\"codex\"\n[[ -z \"$review_provider\" ]] && command -v agy >\u002Fdev\u002Fnull 2>&1 && review_provider=\"agy\"\n\nif [[ -n \"$review_provider\" ]]; then\n  \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Forchestrate.sh\" spawn \"$review_provider\" \\\n    \"Challenge this specification. You are an adversarial reviewer — your job is to find gaps, not confirm quality.\n\n1. What requirements are MISSING that users will need on day one?\n2. What constraints are overlooked that will cause production failures?\n3. What edge cases would break this system?\n4. What assumptions are wrong or unstated?\n5. Which behaviors have vague postconditions that can't be tested?\n\nSPECIFICATION:\n\u003Cpaste NLSpec content here>\"\nfi\n```\n\nIf neither external provider is available, launch a Sonnet challenge instead:\n```\nAgent(\n  model: \"sonnet\",\n  description: \"Adversarial spec review\",\n  prompt: \"Challenge this specification. Your job is to find gaps, not confirm quality. What requirements are missing? What constraints are overlooked? What edge cases would break this? What assumptions are wrong?\n\nSPECIFICATION:\n\u003CNLSpec content>\"\n)\n```\n\n**After receiving the challenge response:**\n- Review each challenge point\n- Revise the NLSpec to address valid challenges (add missing behaviors, tighten constraints, add edge cases)\n- Dismiss challenges that are out of scope — but note WHY in the spec's Non-Goals or Constraints section\n- Track changes: note in the spec's Meta section `Adversarial review: applied (N challenges addressed, M dismissed)`\n\n**Skip with `--fast` or when user requests speed over thoroughness.**\n\n---\n\n### STEP 7: Validate Completeness (MANDATORY - Validation Gate)\n\n**Check the generated NLSpec for completeness:**\n\nVerify each section:\n1. **Purpose** section exists and is non-empty (not placeholder text)\n2. **Actors** section has at least 1 actor with description\n3. **Behaviors** section has at least 1 behavior with trigger + postconditions\n4. **Constraints** section exists with at least 1 constraint category filled\n5. **Dependencies** section exists\n6. **Acceptance Definition** has a satisfaction target between 0.0 and 1.0\n\n**Calculate completeness score:**\n- Total sections: 6 (Purpose, Actors, Behaviors, Constraints, Dependencies, Acceptance)\n- Score = sections adequately filled \u002F 6\n- Report: \"Completeness: X\u002F6 sections (XX%)\"\n\n**Flag any issues:**\n- Missing sections -> \"WARNING: [Section] is missing\"\n- Weak sections (placeholder text, single word) -> \"NOTE: [Section] could be strengthened\"\n- No edge cases defined -> \"NOTE: Consider adding edge cases to behaviors\"\n\n**Display validation report to user.**\n\n---\n\n### STEP 7.5: Native Plan View Integration (OPTIONAL — CC v2.1.70+)\n\n**If VSCode is active and Claude Code supports plan view (v2.1.70+):**\n\nUse `EnterPlanMode` to present the generated NLSpec as a structured plan that the user\ncan review, comment on, and approve through the native plan UI. This provides a richer\nreview experience than plain markdown output.\n\n```\nEnterPlanMode with the NLSpec content as the plan body\n```\n\n**If plan mode is not available or the user is in terminal mode:**\nSkip this step and proceed to Step 8 (file save).\n\nThis aligns the spec workflow with Claude Code's native structured planning features\nwhen they are available, while falling back gracefully to file-based output.\n\n---\n\n### STEP 8: Save & Update State (MANDATORY)\n\n**Save the NLSpec:**\n\nDefault filename: `spec.md` in the current working directory.\nIf user specified a different filename, use that instead.\n\n```bash\n# Write the NLSpec to file (use Write tool, not Bash)\n```\n\n**Update state with spec context:**\n\n```bash\n# Extract summary for state\nspec_summary=\"NLSpec generated for [project name] with [N] behaviors, complexity: [class]\"\n\n# Update spec phase context\n\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" update_context \\\n  \"spec\" \\\n  \"$spec_summary\"\n\n# Update metrics\n\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" update_metrics \"phases_completed\" \"1\"\n# Track actual providers used (dynamic — not hardcoded)\nfor _provider in $(bash \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fhelpers\u002Fcheck-providers.sh\" | grep \":available\" | cut -d: -f1) claude; do\n  \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" update_metrics \"provider\" \"$_provider\"\ndone\n```\n\n**Present final summary to user:**\n\n```\nNLSpec saved to: [filename]\nCompleteness: X\u002F6 sections (XX%)\nBehaviors defined: N\nComplexity class: [clear|complicated|complex]\nSatisfaction target: [0.XX]\n\nNext steps:\n- Review and refine the spec manually\n- Use \u002Focto:develop to implement from this spec\n- Use \u002Focto:embrace for full lifecycle from spec\n```\n\n**Include attribution:**\n```\n---\nMulti-AI Research powered by Claude Octopus\nProviders: Codex | Antigravity | Claude\n```\n\n---\n\n## Error Handling\n\nIf any step fails:\n- **Step 1 (Questions)**: If user declines all questions, proceed with best-effort assumptions and note them\n- **Step 2 (Providers)**: If all external providers are unavailable, suggest `\u002Focto:setup` and STOP\n- **Step 3 (State)**: If state-manager.sh fails, continue without prior state (warn user)\n- **Step 4 (orchestrate.sh)**: Show bash error, check logs, report to user. DO NOT substitute with direct research\n- **Step 5 (Validation)**: If synthesis missing, show orchestrate.sh logs, DO NOT proceed\n- **Step 6 (Synthesis)**: If research is thin, generate NLSpec with what's available and flag weak sections\n- **Step 7 (Completeness)**: Always report score, even if low\n- **Step 8 (Save)**: If write fails, output NLSpec to chat so user can copy it\n\n---\n\n## Prohibited Actions\n\n- CANNOT skip orchestrate.sh probe execution\n- CANNOT simulate or fake multi-AI research\n- CANNOT substitute direct Claude analysis for probe results\n- CANNOT skip completeness validation — an incomplete spec (missing actors, behaviors, or constraints) produces ambiguous implementation targets that cause rework\n- CANNOT proceed past a failed validation gate — gates exist to catch missing sections before the spec reaches implementers\n- CANNOT create working\u002Fprogress files in plugin directory\n\n---\n\n**START WITH STEP 1 CLARIFYING QUESTIONS NOW.**\n","# STOP - SKILL ALREADY LOADED\n\n**DO NOT call Skill() again. DO NOT load any more skills. Execute directly.**\n\n---\n\n## EXECUTION CONTRACT (MANDATORY - CANNOT SKIP)\n\nThis skill uses **ENFORCED execution mode**. You MUST follow this exact 8-step sequence.\n\n---\n\n### STEP 1: Clarifying Questions (MANDATORY)\n\n**Ask via AskUserQuestion BEFORE any other action.**\n\nYou MUST gather these inputs from the user — spec quality depends on knowing actors, constraints, and complexity upfront; without these the research query is too broad and the spec will have gaps:\n\n```\nAskUserQuestion with these questions:\n\n1. **What to specify**: Project or feature name + brief description\n   - \"What system\u002Ffeature should I specify?\"\n\n2. **Actors**: Who interacts with this system?\n   - Options: End Users, Developers, Admins, External Services, Other\n\n3. **Key constraints**: What matters most?\n   - Options: Performance, Security, Compatibility, Scale\n   - (multiSelect: true)\n\n4. **Complexity class**: How complex is this?\n   - Clear (well-understood, straightforward)\n   - Complicated (multiple parts, but knowable)\n   - Complex (emergent behavior, unknowns)\n```\n\nIf user provided a description inline with the command (e.g., `\u002Focto:spec user authentication system`), use that as the project description but STILL ask remaining questions (actors, constraints, complexity).\n\nIf user says \"skip\" for any question, note assumptions and proceed.\n\n**DO NOT PROCEED TO STEP 2 until questions answered.**\n\n---\n\n### STEP 2: Display Visual Indicators (MANDATORY - BLOCKING)\n\n**Check provider availability:**\n\n```bash\nprovider_status=$(bash \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fhelpers\u002Fcheck-providers.sh\")\ncodex_status=$(echo \"$provider_status\" | grep -q '^codex:available' && echo \"Available\" || echo \"Not installed\")\nagy_status=$(echo \"$provider_status\" | grep -q '^agy:available' && echo \"Available\" || echo \"Not installed\")\n```\n\n**Display this banner BEFORE orchestrate.sh execution:**\n\n```\n🐙 CLAUDE OCTOPUS ACTIVATED - NLSpec Authoring Mode\nSpec Phase: Generating structured specification for [project name]\n\nProvider Availability:\nCodex CLI: ${codex_status}\nAntigravity CLI: ${agy_status}\nClaude: Available (Synthesis & NLSpec generation)\n\nEstimated Cost: $0.01-0.05\nEstimated Time: 3-7 minutes\n```\n\n**Validation:**\n- If no external providers are available -> STOP, suggest: `\u002Focto:setup`\n- If one or more external providers are available -> Continue with available provider(s)\n\n**DO NOT PROCEED TO STEP 3 until banner displayed.**\n\n---\n\n### STEP 3: Read Prior State (MANDATORY - State Management)\n\n**Before executing the workflow, read any prior context:**\n\n```bash\n# Initialize state if needed\n\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" init_state\n\n# Set current workflow\n\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" set_current_workflow \"flow-spec\" \"spec\"\n\n# Get prior decisions (if any)\nprior_decisions=$(\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" get_decisions \"all\")\n\n# Get context from previous phases (e.g., discover)\nprior_context=$(\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" read_state | jq -r '.context')\n\n# Display what you found (if any)\nif [[ \"$prior_decisions\" != \"[]\" && \"$prior_decisions\" != \"null\" ]]; then\n  echo \"Building on prior decisions:\"\n  echo \"$prior_decisions\" | jq -r '.[] | \"  - \\(.decision) (\\(.phase)): \\(.rationale)\"'\nfi\n```\n\n**This provides context from:**\n- Prior discover phases (if user ran `\u002Focto:discover` first)\n- Architectural decisions already made\n- User vision captured in earlier phases\n\n**DO NOT PROCEED TO STEP 4 until state read.**\n\n---\n\n### STEP 4: Execute orchestrate.sh probe (MANDATORY - Use Bash Tool)\n\n**You MUST execute this command via the Bash tool:**\n\n```bash\n${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Forchestrate.sh probe \"specification research for: \u003Cproject description>. Key areas: actors (\u003Cactors>), constraints (\u003Cconstraints>), complexity (\u003Ccomplexity class>)\"\n```\n\nIncorporate the user's answers from Step 1 into the probe query to focus the research.\n\n**CRITICAL: You are PROHIBITED from:**\n- Researching directly without calling orchestrate.sh — direct spec writing skips the multi-AI research that surfaces edge cases, alternative architectures, and constraint interactions\n- Using web search instead of orchestrate.sh\n- Claiming you're \"simulating\" the workflow\n- Proceeding to Step 5 without running this command\n- Substituting with direct Claude analysis\n\n**You MUST use the Bash tool to invoke orchestrate.sh.**\n\n---\n\n### STEP 5: Verify Probe Synthesis (MANDATORY - Validation Gate)\n\n**After orchestrate.sh completes, verify it succeeded:**\n\n```bash\n# Find the latest synthesis file (created within last 10 minutes)\nSYNTHESIS_FILE=$(find ~\u002F.claude-octopus\u002Fresults -name \"probe-synthesis-*.md\" -mmin -10 2>\u002Fdev\u002Fnull | head -n1)\n\nif [[ -z \"$SYNTHESIS_FILE\" ]]; then\n  echo \"VALIDATION FAILED: No synthesis file found\"\n  echo \"orchestrate.sh did not execute properly\"\n  exit 1\nfi\n\necho \"VALIDATION PASSED: $SYNTHESIS_FILE\"\ncat \"$SYNTHESIS_FILE\"\n```\n\n**If validation fails:**\n1. Report error to user\n2. Show logs from `~\u002F.claude-octopus\u002Flogs\u002F`\n3. DO NOT proceed with generating NLSpec\n4. DO NOT substitute with direct research — fallback to single-model analysis skips the multi-provider synthesis that surfaces edge cases and alternative approaches\n\n---\n\n### STEP 6: Synthesize into NLSpec Format (MANDATORY)\n\n**Read the probe synthesis file from Step 5 and the user's answers from Step 1.**\n\nSynthesize into the NLSpec template below. This is YOUR (Claude's) synthesis role - you read the multi-AI research and structure it into the specification format.\n\n**NLSpec Template:**\n\n```markdown\n# NLSpec: [Project Name]\n\n## Meta\n- Version: 1.0.0\n- Author: [human author from user context, or \"TBD\"]\n- Created: [today's date]\n- Complexity: [clear | complicated | complex - from Step 1]\n\n## Purpose\n[1-3 sentences: what this software does and for whom. Derived from user description + probe research.]\n\n## Actors\n- **[Actor 1]**: [Role description and capabilities]\n- **[Actor 2]**: [Role description and capabilities]\n[Include all actors from Step 1 answers + any discovered in research]\n\n## Behaviors\n\n### B1: [Behavior Name]\n- **Trigger**: [What initiates this behavior]\n- **Preconditions**: [What must be true before execution]\n- **Steps**:\n  1. [Step 1]\n  2. [Step 2]\n- **Postconditions**: [What must be true after execution]\n- **Edge Cases**:\n  - [Edge case]: [Expected handling]\n\n### B2: [Behavior Name]\n- **Trigger**: [What initiates this behavior]\n- **Preconditions**: [What must be true before execution]\n- **Steps**:\n  1. [Step 1]\n- **Postconditions**: [What must be true after execution]\n- **Edge Cases**:\n  - [Edge case]: [Expected handling]\n\n[Add as many behaviors as the research and scope warrant. Aim for 3-7 core behaviors.]\n\n## Constraints\n- **Performance**: [Latency, throughput requirements]\n- **Security**: [Authentication, authorization, data handling]\n- **Compatibility**: [APIs, platforms, browsers, versions]\n- **Scale**: [Expected load, data volume, growth projections]\n[Populate from Step 1 constraint answers + probe research findings]\n\n## Dependencies\n- **External Services**: [APIs, databases, third-party services]\n- **Libraries\u002FFrameworks**: [Required packages, minimum versions]\n\n## Acceptance Definition\n- **Satisfaction Target**: [0.0-1.0, e.g., 0.90 - based on complexity class]\n- **Critical Behaviors**: [Which behaviors must achieve 1.0 satisfaction]\n```\n\n**Guidelines for synthesis:**\n- Use research findings to fill in realistic, specific values (not placeholders)\n- Behaviors should be concrete and testable, not vague\n- Constraints should have measurable targets where possible\n- For \"clear\" complexity: aim for 0.95 satisfaction target\n- For \"complicated\" complexity: aim for 0.90 satisfaction target\n- For \"complex\" complexity: aim for 0.85 satisfaction target\n\n---\n\n### STEP 6.5: Adversarial Completeness Challenge (RECOMMENDED)\n\n**After generating the NLSpec draft but BEFORE validation, challenge its completeness using a different provider.** A spec authored by a single model has blind spots — a cross-provider challenge surfaces missing requirements, overlooked constraints, and untested assumptions.\n\n**Dispatch the NLSpec draft through Octopus routing to a different provider:**\n\n```bash\nreview_provider=\"\"\ncommand -v codex >\u002Fdev\u002Fnull 2>&1 && review_provider=\"codex\"\n[[ -z \"$review_provider\" ]] && command -v agy >\u002Fdev\u002Fnull 2>&1 && review_provider=\"agy\"\n\nif [[ -n \"$review_provider\" ]]; then\n  \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Forchestrate.sh\" spawn \"$review_provider\" \\\n    \"Challenge this specification. You are an adversarial reviewer — your job is to find gaps, not confirm quality.\n\n1. What requirements are MISSING that users will need on day one?\n2. What constraints are overlooked that will cause production failures?\n3. What edge cases would break this system?\n4. What assumptions are wrong or unstated?\n5. Which behaviors have vague postconditions that can't be tested?\n\nSPECIFICATION:\n\u003Cpaste NLSpec content here>\"\nfi\n```\n\nIf neither external provider is available, launch a Sonnet challenge instead:\n```\nAgent(\n  model: \"sonnet\",\n  description: \"Adversarial spec review\",\n  prompt: \"Challenge this specification. Your job is to find gaps, not confirm quality. What requirements are missing? What constraints are overlooked? What edge cases would break this? What assumptions are wrong?\n\nSPECIFICATION:\n\u003CNLSpec content>\"\n)\n```\n\n**After receiving the challenge response:**\n- Review each challenge point\n- Revise the NLSpec to address valid challenges (add missing behaviors, tighten constraints, add edge cases)\n- Dismiss challenges that are out of scope — but note WHY in the spec's Non-Goals or Constraints section\n- Track changes: note in the spec's Meta section `Adversarial review: applied (N challenges addressed, M dismissed)`\n\n**Skip with `--fast` or when user requests speed over thoroughness.**\n\n---\n\n### STEP 7: Validate Completeness (MANDATORY - Validation Gate)\n\n**Check the generated NLSpec for completeness:**\n\nVerify each section:\n1. **Purpose** section exists and is non-empty (not placeholder text)\n2. **Actors** section has at least 1 actor with description\n3. **Behaviors** section has at least 1 behavior with trigger + postconditions\n4. **Constraints** section exists with at least 1 constraint category filled\n5. **Dependencies** section exists\n6. **Acceptance Definition** has a satisfaction target between 0.0 and 1.0\n\n**Calculate completeness score:**\n- Total sections: 6 (Purpose, Actors, Behaviors, Constraints, Dependencies, Acceptance)\n- Score = sections adequately filled \u002F 6\n- Report: \"Completeness: X\u002F6 sections (XX%)\"\n\n**Flag any issues:**\n- Missing sections -> \"WARNING: [Section] is missing\"\n- Weak sections (placeholder text, single word) -> \"NOTE: [Section] could be strengthened\"\n- No edge cases defined -> \"NOTE: Consider adding edge cases to behaviors\"\n\n**Display validation report to user.**\n\n---\n\n### STEP 7.5: Native Plan View Integration (OPTIONAL — CC v2.1.70+)\n\n**If VSCode is active and Claude Code supports plan view (v2.1.70+):**\n\nUse `EnterPlanMode` to present the generated NLSpec as a structured plan that the user\ncan review, comment on, and approve through the native plan UI. This provides a richer\nreview experience than plain markdown output.\n\n```\nEnterPlanMode with the NLSpec content as the plan body\n```\n\n**If plan mode is not available or the user is in terminal mode:**\nSkip this step and proceed to Step 8 (file save).\n\nThis aligns the spec workflow with Claude Code's native structured planning features\nwhen they are available, while falling back gracefully to file-based output.\n\n---\n\n### STEP 8: Save & Update State (MANDATORY)\n\n**Save the NLSpec:**\n\nDefault filename: `spec.md` in the current working directory.\nIf user specified a different filename, use that instead.\n\n```bash\n# Write the NLSpec to file (use Write tool, not Bash)\n```\n\n**Update state with spec context:**\n\n```bash\n# Extract summary for state\nspec_summary=\"NLSpec generated for [project name] with [N] behaviors, complexity: [class]\"\n\n# Update spec phase context\n\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" update_context \\\n  \"spec\" \\\n  \"$spec_summary\"\n\n# Update metrics\n\"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" update_metrics \"phases_completed\" \"1\"\n# Track actual providers used (dynamic — not hardcoded)\nfor _provider in $(bash \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fhelpers\u002Fcheck-providers.sh\" | grep \":available\" | cut -d: -f1) claude; do\n  \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fscripts\u002Fstate-manager.sh\" update_metrics \"provider\" \"$_provider\"\ndone\n```\n\n**Present final summary to user:**\n\n```\nNLSpec saved to: [filename]\nCompleteness: X\u002F6 sections (XX%)\nBehaviors defined: N\nComplexity class: [clear|complicated|complex]\nSatisfaction target: [0.XX]\n\nNext steps:\n- Review and refine the spec manually\n- Use \u002Focto:develop to implement from this spec\n- Use \u002Focto:embrace for full lifecycle from spec\n```\n\n**Include attribution:**\n```\n---\nMulti-AI Research powered by Claude Octopus\nProviders: Codex | Antigravity | Claude\n```\n\n---\n\n## Error Handling\n\nIf any step fails:\n- **Step 1 (Questions)**: If user declines all questions, proceed with best-effort assumptions and note them\n- **Step 2 (Providers)**: If all external providers are unavailable, suggest `\u002Focto:setup` and STOP\n- **Step 3 (State)**: If state-manager.sh fails, continue without prior state (warn user)\n- **Step 4 (orchestrate.sh)**: Show bash error, check logs, report to user. DO NOT substitute with direct research\n- **Step 5 (Validation)**: If synthesis missing, show orchestrate.sh logs, DO NOT proceed\n- **Step 6 (Synthesis)**: If research is thin, generate NLSpec with what's available and flag weak sections\n- **Step 7 (Completeness)**: Always report score, even if low\n- **Step 8 (Save)**: If write fails, output NLSpec to chat so user can copy it\n\n---\n\n## Prohibited Actions\n\n- CANNOT skip orchestrate.sh probe execution\n- CANNOT simulate or fake multi-AI research\n- CANNOT substitute direct Claude analysis for probe results\n- CANNOT skip completeness validation — an incomplete spec (missing actors, behaviors, or constraints) produces ambiguous implementation targets that cause rework\n- CANNOT proceed past a failed validation gate — gates exist to catch missing sections before the spec reaches implementers\n- CANNOT create working\u002Fprogress files in plugin directory\n\n---\n\n**START WITH STEP 1 CLARIFYING QUESTIONS NOW.**\n",{"name":5,"effort":24,"aliases":25,"description":7,"execution_mode":29,"validation_gates":30,"disable-model-invocation":34},"high",[26,27,28],"spec","nlspec","specification","enforced",[31,32,33],"orchestrate_sh_executed","synthesis_file_exists","nlspec_completeness_validated",true,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","07-后端与架构\u002Fflow-spec",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":34},[45,48,51],{"tool":46,"command":47},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill flow-spec",{"tool":49,"command":50},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill flow-spec",{"tool":52,"command":53},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill flow-spec","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fflow-spec\u002FSKILL.md",[],[57,64,69,76,83,90],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":65,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]