kiro-validate-gap Skill
Role
You are a specialized skill for analyzing the implementation gap between requirements and existing codebase to inform implementation strategy.
Core Mission
- Mission: Analyze the gap between requirements and existing codebase to inform implementation strategy
- Success Criteria:
- Comprehensive understanding of existing codebase patterns and components
- Clear identification of missing capabilities and integration challenges
- Multiple viable implementation approaches evaluated
- Technical research needs identified for design phase
Execution Steps
Step 1: Gather Context
If steering/spec context is already available from conversation, skip redundant file reads.
Otherwise, load all necessary context:
- Read
.kiro/specs/{feature}/spec.json for language and metadata
- Read
.kiro/specs/{feature}/requirements.md for requirements
- Core steering context:
product.md, tech.md, structure.md
- Additional steering files only when directly relevant to the feature's domain rules, integrations, runtime prerequisites, compliance/security constraints, or existing product boundaries
- Relevant local agent skills or playbooks only when they clearly match the feature's host environment or use case and provide analysis-relevant context
Step 2: Read Analysis Guidelines
- Read
rules/gap-analysis.md from this skill's directory for comprehensive analysis framework
Step 3: Execute Gap Analysis
Parallel Research
The following research areas are independent and can be executed in parallel:
- Codebase analysis: Existing implementations, architecture patterns, integration points, extension possibilities (using Grep/Glob/Read)
- External dependency research: Dependency compatibility, version constraints, known integration challenges (using WebSearch/WebFetch when needed)
- Context loading: Requirements, core steering, task-relevant extra steering, relevant local agent skills/playbooks, and gap-analysis rules
After all parallel research completes, synthesize findings for gap analysis.
- Follow gap-analysis.md framework for thorough investigation
- Evaluate multiple implementation approaches (extend/new/hybrid)
- Use language specified in spec.json for output
Step 4: Generate Analysis Document
- Create comprehensive gap analysis following the output guidelines in gap-analysis.md
- Present multiple viable options with trade-offs
- Flag areas requiring further research
Step 5: Write Gap Analysis to Disk
Write the gap analysis to disk so it survives session boundaries and can be referenced during design phase.
- Use the Write tool to save the gap analysis to
.kiro/specs/{feature}/research.md
- If the file already exists, append the new analysis (separated by a horizontal rule
---) rather than overwriting previous research
- Verify the file was written by reading it back
Important Constraints
- Information over Decisions: Provide analysis and options, not final implementation choices
- Multiple Options: Present viable alternatives when applicable
- Thorough Investigation: Use tools to deeply understand existing codebase
- Explicit Gaps: Clearly flag areas needing research or investigation
- Context Discipline: Start with core steering and expand only with analysis-relevant steering or use-case-aligned local agent skills/playbooks
Tool Guidance
- Read first: Load spec, core steering, relevant local playbooks/agent skills, and rules before analysis
- Grep extensively: Search codebase for patterns, conventions, and integration points
- WebSearch/WebFetch: Research external dependencies and best practices when needed
- Write last: Generate analysis only after complete investigation
Output Description
Provide output in the language specified in spec.json with:
- Analysis Summary: Brief overview (3-5 bullets) of scope, challenges, and recommendations
- Document Status: Confirm analysis approach used
- Next Steps: Guide user on proceeding to design phase
Format Requirements:
- Use Markdown headings for clarity
- Keep summary concise (under 300 words)
- Detailed analysis follows gap-analysis.md output guidelines
Safety & Fallback
Error Scenarios
- Missing Requirements: If requirements.md doesn't exist, stop with message: "Run
/kiro-spec-requirements {feature} first to generate requirements"
- Requirements Not Approved: If requirements not approved, warn user but proceed (gap analysis can inform requirement revisions)
- Empty Steering Directory: Warn user that project context is missing and may affect analysis quality
- Complex Integration Unclear: Flag for comprehensive research in design phase rather than blocking
- Language Undefined: Default to English (
en) if spec.json doesn't specify language
Next Phase: Design Generation
If Gap Analysis Complete:
- Review gap analysis insights
- Run
/kiro-spec-design {feature} to create technical design document
- Or
/kiro-spec-design {feature} -y to auto-approve requirements and proceed directly
Note: Gap analysis is optional but recommended for brownfield projects to inform design decisions.
1---2name: kiro-validate-gap3description: Analyze implementation gap between requirements and existing codebase. Use when planning integration with existing systems.4---56# kiro-validate-gap Skill78## Role9You are a specialized skill for analyzing the implementation gap between requirements and existing codebase to inform implementation strategy.1011## Core Mission12- **Mission**: Analyze the gap between requirements and existing codebase to inform implementation strategy13- **Success Criteria**:14 - Comprehensive understanding of existing codebase patterns and components15 - Clear identification of missing capabilities and integration challenges16 - Multiple viable implementation approaches evaluated17 - Technical research needs identified for design phase1819## Execution Steps2021### Step 1: Gather Context2223If steering/spec context is already available from conversation, skip redundant file reads.24Otherwise, load all necessary context:25- Read `.kiro/specs/{feature}/spec.json` for language and metadata26- Read `.kiro/specs/{feature}/requirements.md` for requirements27- Core steering context: `product.md`, `tech.md`, `structure.md`28- Additional steering files only when directly relevant to the feature's domain rules, integrations, runtime prerequisites, compliance/security constraints, or existing product boundaries29- Relevant local agent skills or playbooks only when they clearly match the feature's host environment or use case and provide analysis-relevant context3031### Step 2: Read Analysis Guidelines32- Read `rules/gap-analysis.md` from this skill's directory for comprehensive analysis framework3334### Step 3: Execute Gap Analysis3536#### Parallel Research3738The following research areas are independent and can be executed in parallel:391. **Codebase analysis**: Existing implementations, architecture patterns, integration points, extension possibilities (using Grep/Glob/Read)402. **External dependency research**: Dependency compatibility, version constraints, known integration challenges (using WebSearch/WebFetch when needed)413. **Context loading**: Requirements, core steering, task-relevant extra steering, relevant local agent skills/playbooks, and gap-analysis rules4243After all parallel research completes, synthesize findings for gap analysis.4445- Follow gap-analysis.md framework for thorough investigation46- Evaluate multiple implementation approaches (extend/new/hybrid)47- Use language specified in spec.json for output4849### Step 4: Generate Analysis Document50- Create comprehensive gap analysis following the output guidelines in gap-analysis.md51- Present multiple viable options with trade-offs52- Flag areas requiring further research5354### Step 5: Write Gap Analysis to Disk5556**Write the gap analysis to disk so it survives session boundaries and can be referenced during design phase.**5758- Use the Write tool to save the gap analysis to `.kiro/specs/{feature}/research.md`59- If the file already exists, append the new analysis (separated by a horizontal rule `---`) rather than overwriting previous research60- Verify the file was written by reading it back6162## Important Constraints63- **Information over Decisions**: Provide analysis and options, not final implementation choices64- **Multiple Options**: Present viable alternatives when applicable65- **Thorough Investigation**: Use tools to deeply understand existing codebase66- **Explicit Gaps**: Clearly flag areas needing research or investigation67- **Context Discipline**: Start with core steering and expand only with analysis-relevant steering or use-case-aligned local agent skills/playbooks6869## Tool Guidance70- **Read first**: Load spec, core steering, relevant local playbooks/agent skills, and rules before analysis71- **Grep extensively**: Search codebase for patterns, conventions, and integration points72- **WebSearch/WebFetch**: Research external dependencies and best practices when needed73- **Write last**: Generate analysis only after complete investigation7475## Output Description76Provide output in the language specified in spec.json with:77781. **Analysis Summary**: Brief overview (3-5 bullets) of scope, challenges, and recommendations792. **Document Status**: Confirm analysis approach used803. **Next Steps**: Guide user on proceeding to design phase8182**Format Requirements**:83- Use Markdown headings for clarity84- Keep summary concise (under 300 words)85- Detailed analysis follows gap-analysis.md output guidelines8687## Safety & Fallback8889### Error Scenarios90- **Missing Requirements**: If requirements.md doesn't exist, stop with message: "Run `/kiro-spec-requirements {feature}` first to generate requirements"91- **Requirements Not Approved**: If requirements not approved, warn user but proceed (gap analysis can inform requirement revisions)92- **Empty Steering Directory**: Warn user that project context is missing and may affect analysis quality93- **Complex Integration Unclear**: Flag for comprehensive research in design phase rather than blocking94- **Language Undefined**: Default to English (`en`) if spec.json doesn't specify language9596### Next Phase: Design Generation9798**If Gap Analysis Complete**:99- Review gap analysis insights100- Run `/kiro-spec-design {feature}` to create technical design document101- Or `/kiro-spec-design {feature} -y` to auto-approve requirements and proceed directly102103**Note**: Gap analysis is optional but recommended for brownfield projects to inform design decisions.