AgentSkillsCN

risk-assessment

致力于实现欧盟《人工智能法案》第 40 条合规的专家,涵盖统一标准、API 标准化、数据格式互操作性、防止供应商锁定以及生态系统集成等关键领域。通过 AI 辅助,开展标准合规性测试与验证工作。

SKILL.md
--- frontmatter
name: risk-assessment
description: Identifies, evaluates, and mitigates project and task-level risks during planning. Use when assessing technical risks, evaluating complexity, identifying blockers, planning contingencies, or determining project confidence levels.

Risk Assessment

Structured frameworks for identifying, evaluating, and mitigating risks in software development projects and task planning.

Quick Start

Assess project risk:

code
What are the main risks in implementing this feature? Evaluate likelihood and impact.

Identify blockers:

code
What could block or delay this work? What are the technical unknowns?

Evaluate complexity:

code
How complex is this task? What factors contribute to that complexity?

Risk Categories

Technical Risks

Risk TypeDescriptionExample
Unfamiliar TechnologyTeam has limited experienceFirst time using GraphQL subscriptions
Integration ComplexityExternal system dependenciesConnecting to legacy SOAP API
Performance UncertaintyUnknown scaling behaviorReal-time sync with 10k concurrent users
Security SensitivityData protection requirementsPCI compliance for payment handling
Architecture ImpactChanges affect system structureAdding multi-tenancy to existing app

Dependency Risks

Risk TypeDescriptionExample
External ServiceThird-party reliabilityStripe API availability
Team DependenciesWaiting on other teamsMobile team API requirements
Vendor Lock-inHard to change providersDeep AWS service integration
License IssuesLegal/compliance concernsGPL dependency in commercial product

Scope Risks

Risk TypeDescriptionExample
Unclear RequirementsAmbiguous specifications"Make it user-friendly"
Scope CreepExpanding boundaries"While we're at it, also add..."
Hidden ComplexityUnderestimated effort"Simple form" with 20 edge cases
Missing ContextUnknown constraintsUndocumented legacy behavior

Execution Risks

Risk TypeDescriptionExample
Critical Path LengthLong dependency chains8-task sequential chain
Single Point of FailureOne blocker stops all workDatabase migration blocks everything
Resource ContentionSame files/systems modifiedThree tasks editing User model
Rollback DifficultyHard to undo changesData migration without reverse

Risk Evaluation Framework

Likelihood Assessment

LevelDescriptionIndicators
LowUnlikely to occurProven technology, clear requirements, team expertise
MediumMay occurSome unknowns, moderate complexity, partial experience
HighLikely to occurNew technology, unclear requirements, external dependencies

Impact Assessment

LevelDescriptionIndicators
LowMinor inconvenienceWorkarounds available, isolated scope, easy rollback
MediumSignificant delay or reworkModerate scope impact, some downstream effects
HighMajor project impactCritical path affected, widespread changes needed
CriticalProject failure riskSecurity breach, data loss, regulatory violation

Risk Priority Matrix

code
                    IMPACT
             Low    Medium   High    Critical
         ┌────────┬────────┬────────┬────────┐
    High │ Medium │  High  │ Critical│Critical│
         ├────────┼────────┼────────┼────────┤
  Medium │  Low   │ Medium │  High  │  High  │
LIKELIHOOD├────────┼────────┼────────┼────────┤
    Low  │  Low   │  Low   │ Medium │  High  │
         └────────┴────────┴────────┴────────┘

Priority Actions:

  • Critical: Must address before proceeding, create contingency plan
  • High: Address in planning, assign mitigation owner
  • Medium: Monitor, have backup approach ready
  • Low: Accept, document for awareness

Risk Identification Techniques

Pre-Mortem Analysis

Imagine the project failed. What went wrong?

markdown
## Pre-Mortem: User Authentication Feature

Assume it's 2 weeks later and this feature failed. Possible causes:

1. OAuth provider changed their API mid-implementation
2. Session management conflicted with existing auth
3. Database migration corrupted user data
4. Security review found vulnerabilities requiring redesign
5. Mobile app couldn't integrate with new auth flow
6. Performance degraded under load testing

For each: Assess likelihood, plan mitigation

Assumption Surfacing

List all assumptions and validate them:

markdown
## Assumptions Analysis

| Assumption | Validation Method | Risk if Wrong |
|------------|-------------------|---------------|
| Users have email addresses | Check existing data | Auth flow redesign |
| API response < 200ms | Load test | Performance refactor |
| Stripe supports our region | Check documentation | Payment provider change |
| Team knows React hooks | Ask team | Training delay |
| Database handles 10k users | Capacity test | Scaling work needed |

Risk Storming Questions

For each task, ask:

Technical:

  • What technology are we least familiar with?
  • What has caused problems in similar projects?
  • What could fail at scale?
  • What security implications exist?

Dependencies:

  • What external services could fail?
  • What team coordination is required?
  • What shared resources might conflict?

Scope:

  • What requirements are vague?
  • What edge cases might we discover?
  • What could users request that would change scope?

Execution:

  • What is the longest sequential chain?
  • What would block the most work if delayed?
  • What is hardest to roll back?

Risk Documentation

Risk Register Template

markdown
## Risk Register

### R1: OAuth Provider API Changes

**Category:** External Dependency
**Likelihood:** Medium
**Impact:** High
**Priority:** High

**Description:**
Google OAuth API could change during implementation, requiring rework of authentication flow.

**Indicators:**
- Google announces deprecation
- API version we're using is old
- Authentication suddenly fails

**Mitigation:**
- Use latest stable API version
- Abstract OAuth behind interface
- Monitor Google developer blog

**Contingency:**
- Switch to Auth0 as alternative provider
- Implement email/password as fallback

**Owner:** Backend team
**Status:** Monitoring

Risk Summary Table

markdown
| ID | Risk | Category | L | I | Priority | Mitigation | Owner |
|----|------|----------|---|---|----------|------------|-------|
| R1 | OAuth API changes | External | M | H | High | Abstract interface | BE |
| R2 | Performance at scale | Technical | M | H | High | Load test early | BE |
| R3 | Unclear mobile reqs | Scope | H | M | High | Clarify with mobile | PM |
| R4 | Migration data loss | Execution | L | C | High | Test on backup first | DBA |
| R5 | UI/UX iterations | Scope | H | L | Medium | Prototype first | FE |

Complexity Assessment

Complexity Factors

FactorSimpleMediumComplex
Files Affected1-56-1516+
Agents Required1-23-45+
Dependency Depth0-2 levels3-4 levels5+ levels
New TechnologyNone1 new toolMultiple new tools
Integration Points0-12-34+
Security SensitivityPublic dataUser dataFinancial/PII
Rollback DifficultyTrivialModerateDifficult

Complexity Scoring

markdown
## Complexity Assessment

**Feature:** Multi-tenant User Management

| Factor | Rating | Notes |
|--------|--------|-------|
| Files Affected | Complex (20+) | Schema, APIs, UI, middleware |
| Agents Required | Medium (4) | BE, FE, test, devops |
| Dependency Depth | Medium (3) | Schema -> API -> UI |
| New Technology | Simple | Using existing stack |
| Integration Points | Medium (3) | DB, cache, auth service |
| Security Sensitivity | Complex | Multi-tenant data isolation |
| Rollback Difficulty | Complex | Data migration involved |

**Overall Complexity:** Complex
**Confidence Level:** Medium (familiar domain, unfamiliar multi-tenancy)

Confidence Levels

LevelDescriptionGuidance
HighClear requirements, known technology, team experienceProceed with normal planning
MediumSome unknowns, partial experience, moderate complexityAdd buffer, plan checkpoints
LowMany unknowns, new technology, unclear requirementsSpike first, reduce scope, prototype

Mitigation Strategies

By Risk Type

Risk TypeStrategyExample
Technical UnknownSpike/prototype firstBuild auth POC before full implementation
External DependencyAbstract interfaceWrap payment provider in abstraction
PerformanceTest earlyLoad test after core API done
SecurityReview earlySecurity review before merge
Scope CreepClear boundariesDocument what's NOT included
IntegrationMock/stubMock external API for parallel work

Mitigation Patterns

Defense in Depth:

code
Primary: Use established OAuth library
Secondary: Add session validation layer
Tertiary: Implement rate limiting
Fallback: Circuit breaker for auth service

Progressive Disclosure:

code
Phase 1: Core functionality only (reduced risk)
Phase 2: Add advanced features (isolated risk)
Phase 3: Optimize and harden (known risks)

Risk Transfer:

code
Internal: Assign to team with expertise
External: Use managed service (Auth0 vs. custom)
Insurance: SLA from vendor, support contract

Risk Monitoring

Risk Indicators

For each risk, define leading indicators:

markdown
## R1: OAuth Provider API Changes

**Leading Indicators:**
- Google developer blog announcements
- Deprecation warnings in API responses
- Community discussions about changes

**Trigger Points:**
- Any deprecation notice: Review abstraction layer
- Major version announced: Plan upgrade sprint
- API errors increasing: Investigate immediately

Risk Review Checkpoints

CheckpointActions
Planning CompleteAll risks identified and documented
Each Group CompleteReview for realized risks, update register
Blocker EncounteredCheck if in risk register, update likelihood
Project CompleteRetrospective on risk predictions

Integration with Workflow Planner

This skill provides the workflow-planner agent with:

  1. Risk identification frameworks for the Risk Factors table
  2. Complexity assessment methodology for the Complexity section
  3. Confidence level determination for planning output
  4. Mitigation strategies to include in risk documentation

The workflow-planner uses these techniques when generating:

  • Risk Factors table (Risk, Likelihood, Impact, Mitigation)
  • Complexity Assessment section (Overall rating, Factors, Confidence)
  • Task prioritization based on risk-first decomposition

Example: Full Risk Assessment

Feature: Real-time Collaborative Document Editing

Risk Register

IDRiskCategoryLIPriorityMitigation
R1CRDT algorithm complexityTechnicalHHCriticalSpike first, use existing library
R2WebSocket scalingTechnicalMHHighLoad test early, plan for Redis pub/sub
R3Conflict resolution edge casesScopeHMHighDefine conflict rules upfront
R4Mobile offline syncTechnicalMHHighDefer to phase 2
R5Browser compatibilityTechnicalLMMediumTest matrix, polyfills
R6Data persistence timingExecutionMMMediumDefine save strategy early

Complexity Assessment

FactorRatingNotes
Files AffectedComplexEditor, sync, presence, persistence
Agents RequiredComplex (5)FE, BE, infra, test, security
Dependency DepthComplex (5)Long chain to full functionality
New TechnologyComplexCRDTs, operational transform
Integration PointsComplex (4)WebSocket, DB, cache, presence
Security SensitivityMediumDocument access control
Rollback DifficultyMediumSeparate from core app

Overall Complexity: Complex Confidence Level: Low

Recommendation: Conduct 2-day spike on CRDT implementation before committing to full plan. Consider using established library (Yjs, Automerge) rather than custom implementation.

Pre-Mortem Summary

Top failure scenarios:

  1. CRDT implementation too complex, delivery delayed
  2. WebSocket server can't handle load, requires re-architecture
  3. Edge cases in conflict resolution frustrate users
  4. Mobile sync deferred creates feature gap

Mitigation focus: R1 (CRDT spike) and R2 (load test early) are critical path risks.