AgentSkillsCN

agentic:quick-spec-and-implement

当您从创意或需求出发,开启新功能的研发工作时,此技能能够将产品构想转化为 PR——通过产品经理的规格说明、架构师的背景与规划、安全威胁模型、编辑端的实现细节,以及持续的评审循环,最终形成完整的 PR。

SKILL.md
--- frontmatter
name: agentic:quick-spec-and-implement
description: Use when starting new feature work from idea/requirements. Transforms product idea into PR via PM spec, architect context/plan, security threat model, editor implementation, and review loop.
argument-hint: "[--auto] [file.md | #issue | URL]"

/quick-spec-and-implement - Spec to PR Workflow

Usage: /quick-spec-and-implement [--auto] [<input>]

Transform a product idea into a merged PR through structured agent collaboration.

Arguments

  • No args: Interactive mode, prompt for spec
  • --auto: Autonomous mode with decision logging
  • path/to/spec.md: Use existing spec file
  • #123 or https://github.com/.../issues/123: Fetch GitHub issue

Workflow Overview

code
1. Input Detection -> 2. PM Spec -> 3. Architect Context -> 4. Security Context
-> 5. Technical Plan -> 6. Editor Implement -> 6b. Test Engineer -> 7. Review Loop -> 8. Create PR

MANDATORY DELEGATION RULE

You MUST delegate agent work using the Task tool. You MUST NOT perform agent work yourself.

This is non-negotiable. When a step says "delegate to PM/Architect/Security/Editor/QA agent", you:

  1. Use the Task tool to spawn a subagent
  2. Pass the subagent prompt (which tells the subagent to read its own instructions)
  3. Wait for the subagent result
  4. Validate the output exists
  5. Update workflow state

You NEVER:

  • Write specs yourself (delegate to PM subagent)
  • Explore the codebase yourself (delegate to Architect subagent)
  • Create threat models yourself (delegate to Security subagent)
  • Write technical plans yourself (delegate to Architect subagent)
  • Write or edit code yourself (delegate to Editor subagent)
  • Write tests yourself (delegate to Test Engineer subagent)
  • Review code yourself (delegate to QA/Test QA/Security QA subagent)

If you catch yourself doing agent work instead of delegating, STOP and use the Task tool.

Subagent Invocation Pattern

Subagent instructions live in {ide-folder}/agents/. Each subagent reads its own file.

Always use {subagentTypeGeneralPurpose} subagent type:

code
Task(subagent_type="{subagentTypeGeneralPurpose}", prompt="You are the {Agent} agent. {ide-invoke-prefix}{ide-folder}/agents/{agent}.md for your full instructions. {task-specific context}")

Available agents: pm, architect, security, editor, test-engineer, qa, test-qa, security-qa


MODE-SPECIFIC BEHAVIOR

Interactive Mode (default)

  • Ask user for clarification on unclear points
  • Present decisions for approval before proceeding
  • Pause at review loop for human judgment

Auto Mode (--auto)

  • Make autonomous decisions with 90%+ confidence
  • Log ALL decisions in decision-log.md
  • Document open questions and chosen resolutions
  • Continue without human input unless blocked
  • If confidence < 90%, log as LOW_CONFIDENCE and proceed

EXECUTION STEPS

Execute each step in order by reading the corresponding step file.

StepFileDescription
1steps/step-01-input-detection.mdParse args, initialize workflow state
2steps/step-02-pm-spec.mdDelegate spec creation to PM
3steps/step-03-architect-context.mdDelegate context gathering to Architect
4steps/step-04-security-context.mdDelegate threat model to Security
5steps/step-05-architect-plan.mdDelegate technical plan to Architect
6steps/step-06-editor-implement.mdDelegate implementation to Editor
6bsteps/step-06b-test-engineer.mdDelegate test writing to Test Engineer
7steps/step-07-review-loop.mdQA/Test QA/Security review loop
8steps/step-08-create-pr.mdCreate PR from artifacts

Start by reading steps/step-01-input-detection.md and follow the NEXT STEP instructions at the end of each file.


TEMPLATES

TemplatePurpose
templates/workflow-state.yamlWorkflow state tracking schema
templates/decision-log.mdDecision logging template (auto mode)

ARTIFACTS

All outputs go to: {ide-folder}/{outputFolder}/task/{epic_id}-EPIC-{epic_name}/US-{story_id}/

ArtifactDescription
workflow-state.yamlWorkflow state tracking
decision-log.mdDecisions (auto mode only)
spec.mdProduct specification
technical-context.mdTechnical context analysis
security-addendum.mdSecurity requirements
technical-plan.mdImplementation plan
implementation-log.mdWhat was implemented
test-log.mdTest implementation log
qa-{n}.mdQA code review(s)
test-qa-{n}.mdTest QA review(s)
security-{n}.mdSecurity review(s)

ERROR HANDLING

Confidence Below Threshold (Auto Mode)

If agent confidence < 90% on a decision:

  1. Log the uncertainty in decision-log.md
  2. Mark decision as "LOW_CONFIDENCE"
  3. Add to "Open Questions" section
  4. Proceed with best-guess but flag for human review

Max Review Iterations Reached

If review loop hits 3 iterations with unresolved blockers:

  1. Log current state
  2. Create PR as draft
  3. List unresolved issues in PR description
  4. Interactive: Halt and ask user
  5. Auto: Complete with warnings, flag for human review

Step Failure

If any step fails:

  1. Log error in workflow-state.yaml
  2. Set status: "failed"
  3. Interactive: Present error, ask how to proceed
  4. Auto: Attempt recovery once, then halt with detailed error log

DECISION LOGGING PROTOCOL (Auto Mode)

When making autonomous decisions, append to decision-log.md:

markdown
### DEC-{number}: {Brief Title}

**Step**: {current_step_name}
**Agent**: {deciding_agent}
**Timestamp**: {ISO timestamp}

**Context**:
{What question or ambiguity arose}

**Options Considered**:
1. {Option A} - {pros/cons}
2. {Option B} - {pros/cons}

**Decision**: {Chosen option}

**Confidence**: {percentage}%

**Rationale**:
{Why this choice was made}

**Trade-offs Accepted**:
- {What was sacrificed or risked}

**Reversibility**: {Easy | Medium | Hard}

---

Confidence Levels Guide

ConfidenceMeaningAction
95-100%High certaintyProceed confidently
90-94%Reasonable certaintyProceed, note for review
80-89%Moderate confidenceAdd to Open Questions
<80%Low confidenceEscalate to human

STATE UPDATE PROTOCOL

After each step completion, update workflow-state.yaml:

yaml
steps_completed:
  - step: {n}
    name: "{step-name}"
    completed_at: {ISO timestamp}
    output: {artifact path if any}

current_step: {n+1}
updated_at: {ISO timestamp}