AgentSkillsCN

project-quality-board-management

从功能视角出发,生成并管理项目质量评估报告。报告将对需求、功能、测试覆盖率,以及代码与实际状态的契合度进行评估,并通过差距分析得出结论。生成的 Markdown 报告将统一存放在 x-ipe-docs/planning 文件夹中。当用户提出“评估项目质量”“生成质量报告”“评估代码一致性”等请求时,此功能将自动触发。

SKILL.md
--- frontmatter
name: project-quality-board-management
description: Generate and manage project quality evaluation reports from feature perspective. Evaluates requirements, features, test coverage, and code alignment status with gap analysis. Generates consistent markdown reports to x-ipe-docs/planning folder. Triggers on requests like "evaluate project quality", "generate quality report", "assess code alignment".

Project Quality Board Management

Purpose

AI Agents follow this skill to generate and manage project-wide quality evaluation reports. This skill evaluates the project from a feature perspective, analyzing:

  1. Requirements Alignment - Do features match documented requirements?
  2. Feature Coverage - Are all features properly specified and implemented?
  3. Test Coverage - Is test coverage sufficient across features?
  4. Code Alignment - Does code implementation match specifications?

Operations:

  1. Generate quality evaluation report
  2. Update existing report with new evaluation
  3. Query quality status for specific features
  4. Compare quality between evaluation snapshots

Important Notes

Skill Prerequisite

  • If you HAVE NOT learned task-execution-guideline skill, please learn it first before executing this skill.
  • Learn task-type-refactoring-analysis skill to understand refactoring_suggestion and refactoring_principle data models for integration.

Important: If Agent DO NOT have skill capability, can directly go to .github/skills/ folder to learn skills. And SKILL.md file is the entry point to understand each skill.


Report Output Location

Quality evaluation report is stored in:

code
x-ipe-docs/planning/project-quality-evaluation.md

Report header includes:

  • Project Version: From pyproject.toml version field
  • Evaluated Date: Timestamp of last evaluation

Quality Evaluation Data Model

yaml
QualityEvaluation:
  # Metadata
  evaluation_id: QE-{YYYYMMDD}-{sequence}
  generated_at: <ISO timestamp>
  generated_by: <agent nickname>
  scope: project | feature | module
  
  # Summary Metrics
  overall_score: <1-10>
  health_status: healthy | attention_needed | critical
  
  # Feature-Level Evaluations
  features:
    - feature_id: FEATURE-XXX
      feature_name: "<name>"
      status: aligned | needs_attention | critical | planned | not_evaluated
      
      requirements_alignment:
        status: aligned | needs_update | not_found | planned
        requirement_docs: [<paths>]
        gaps:
          - type: undocumented | unimplemented | deviated
            description: "<gap description>"
            severity: high | medium | low
      
      specification_alignment:
        status: aligned | needs_update | not_found | planned
        spec_doc: "<path>"
        gaps:
          - type: missing | outdated | incorrect
            description: "<gap description>"
            severity: high | medium | low
      
      test_coverage:
        status: sufficient | insufficient | no_tests
        line_coverage: <XX%>
        branch_coverage: <XX%>
        critical_untested:
          - area: "<untested area>"
            risk: high | medium | low
      
      code_alignment:
        status: aligned | drifted | major_drift
        implementation_files: [<paths>]
        gaps:
          - type: structure | behavior | interface
            description: "<gap description>"
            severity: high | medium | low
  
  # Aggregated Gaps
  priority_gaps:
    high: [<gap references>]
    medium: [<gap references>]
    low: [<gap references>]
  
  # Refactoring Suggestions (from task-type-refactoring-analysis)
  refactoring_suggestions:
    has_suggestions: true | false
    source: "<evaluation_id or task_id that generated suggestions>"
    
    suggestions:
      - feature_id: FEATURE-XXX
        summary: "<high-level description>"
        goals:
          - goal: "<specific improvement goal>"
            priority: high | medium | low
            rationale: "<why this goal matters>"
        target_structure: "<description of desired structure>"
        
        principles:
          primary:
            - principle: <SOLID | DRY | KISS | YAGNI | SoC | etc.>
              rationale: "<why this principle applies>"
              applications:
                - area: "<code area>"
                  action: "<specific application>"
          secondary:
            - principle: <name>
              rationale: "<supporting rationale>"
          constraints:
            - constraint: "<what to avoid or preserve>"
              reason: "<why>"
  
  # Recommendations
  recommendations:
    - priority: <1-N>
      category: requirements | specification | testing | code | refactoring
      action: "<recommended action>"
      affected_features: [<feature_ids>]

Operations

Operation 1: Generate Quality Report

When: Need to evaluate project quality Input: Optional scope filter (all | feature_ids[] | module_paths[])

code
1. DETERMINE scope:
   - Default: all features in project
   - If feature_ids provided: filter to those features
   - If module_paths provided: find features affecting those modules

2. DISCOVER features:
   FOR project scope:
     - SCAN x-ipe-docs/requirements/FEATURE-* directories
     - BUILD feature list with metadata
   
3. FOR EACH feature:
   a. EVALUATE requirements alignment (see Evaluation Procedures)
   b. EVALUATE specification alignment
   c. EVALUATE test coverage
   d. EVALUATE code alignment
   e. COLLECT violations per category (requirements, spec, test, code)
   f. CALCULATE feature status and score

4. AGGREGATE results:
   - Calculate overall_score (weighted average, exclude planned features)
   - Determine health_status
   - Collect priority_gaps
   - Generate recommendations

5. GENERATE report following this structure:
   a. Executive Summary (scores, key findings)
   b. Evaluation Principles (thresholds/methods ONLY - no results)
   c. Feature-by-Feature Evaluation (overview table)
   d. Violation Details by Feature:
      - FOR EACH feature with violations:
        - Requirements Violations section
        - Specification Violations section
        - Test Coverage Violations section
        - Code Alignment Violations section
   e. Files Approaching Threshold
   f. Priority Gaps Summary
   g. Recommendations
   h. Appendix (detailed metrics)

6. SAVE report:
   - Save to x-ipe-docs/planning/project-quality-evaluation.md
   - Update version and evaluated date in header

7. RETURN evaluation summary

Report Structure Rules

code
RULE 1: Evaluation Principles section
  - MUST come BEFORE Feature-by-Feature Evaluation
  - MUST only explain what principles are and thresholds
  - MUST NOT contain any evaluation results or status

RULE 2: Violation Details section
  - MUST be organized by feature
  - EACH feature section MUST have 4 subsections:
    - Requirements Violations
    - Specification Violations
    - Test Coverage Violations
    - Code Alignment Violations
  - ONLY show features that have violations
  - Show "No violations" if a category is clean

RULE 3: Separation of concerns
  - Principles = WHAT we evaluate and HOW (thresholds)
  - Violations = RESULTS of evaluation per feature

Operation 2: Update Existing Report

When: Need to re-evaluate specific features Input: feature_ids to re-evaluate

code
1. LOAD latest report from quality-evaluation-latest.md
2. FOR EACH feature_id:
   - RE-EVALUATE all 4 perspectives
   - UPDATE feature entry in report
3. RE-CALCULATE aggregates (overall_score, health_status)
4. UPDATE priority_gaps and recommendations
5. SAVE as new timestamped report
6. UPDATE quality-evaluation-latest.md

Operation 3: Query Quality Status

When: Need to check quality for specific features Input: feature_ids or query criteria

code
1. LOAD latest report
2. FILTER features by criteria
3. RETURN filtered evaluation data

Operation 4: Compare Evaluations

When: Need to track quality changes over time Input: Two evaluation_ids or "latest vs previous"

code
1. LOAD both evaluation reports
2. FOR EACH feature in both:
   - COMPARE status changes
   - CALCULATE score deltas
   - IDENTIFY new/resolved gaps
3. GENERATE comparison summary:
   - Improved features
   - Degraded features
   - New gaps introduced
   - Gaps resolved
4. RETURN comparison data

Evaluation Principles

Requirements Evaluation Principles

PrincipleThresholdDescription
Completeness100%Every implemented feature must have documented requirements
TraceabilityRequiredRequirements should trace to features and code
ClarityNo ambiguityRequirements should be specific and testable
Currency< 30 daysRequirements updated within 30 days of code changes

Specification Evaluation Principles

PrincipleThresholdDescription
API DocumentationRequiredAll public APIs must be documented
Behavior SpecificationRequiredExpected behaviors clearly defined
Edge CasesDocumentedError handling and edge cases specified
Version AlignmentMatchSpec version should match implementation version

Test Coverage Evaluation Principles

PrincipleThresholdDescription
Line Coverage≥ 80%Minimum line coverage for production code
Branch Coverage≥ 70%Minimum branch/decision coverage
Critical Path Coverage100%Core business logic must be fully tested
Error Handler Coverage≥ 90%Exception and error paths tested
Test IsolationRequiredTests should not depend on external services
Mock External APIsRequiredExternal API calls must be mocked in tests

Code Alignment Evaluation Principles

PrincipleThresholdDescription
File Size≤ 800 linesSingle file should not exceed 800 lines
Function Size≤ 50 linesSingle function should not exceed 50 lines
Class Size≤ 500 linesSingle class should not exceed 500 lines
Cyclomatic Complexity≤ 10Function complexity should be manageable
SRP (Single Responsibility)1 reason to changeEach module/class has one responsibility
OCP (Open/Closed)ExtensibleOpen for extension, closed for modification
LSP (Liskov Substitution)SubstitutableSubtypes must be substitutable for base types
ISP (Interface Segregation)FocusedClients shouldn't depend on unused interfaces
DIP (Dependency Inversion)AbstractedDepend on abstractions, not concretions
DRY (Don't Repeat Yourself)No duplicationAvoid code duplication across modules
KISS (Keep It Simple)Simple solutionsPrefer simple over complex implementations
YAGNINo unused codeDon't implement features until needed
Modular DesignCohesive modulesCode organized into focused, reusable modules
Naming ConventionsConsistentFollow language-specific naming conventions
Import OrganizationGroupedImports organized by type (stdlib, external, internal)

KISS Principle Assessment

CheckThresholdDescription
Avoid Over-EngineeringNo unnecessary abstractionsDon't add layers without clear benefit
Straightforward LogicLinear flow preferredAvoid convoluted control flow
Minimal DependenciesOnly necessary importsDon't import unused libraries
Clear IntentSelf-documenting codeCode should express intent without excessive comments
Simple Data StructuresUse built-in typesAvoid custom types when built-ins suffice

Modular Design Assessment

CheckThresholdDescription
Module CohesionHigh cohesionRelated functions grouped in same module
Module CouplingLoose couplingModules minimize dependencies on each other
Single Entry PointOne public APIEach module has clear public interface
Folder StructureLogical groupingFiles organized by feature or layer
ReusabilityPortable modulesModules can be reused in different contexts
TestabilityIndependently testableEach module can be tested in isolation

Modular Design Patterns:

PatternWhen to ApplyExample
Feature ModulesLarge files > 800 linesSplit app.pyroutes/api.py, routes/views.py
Service LayerBusiness logic mixed with routesExtract to services/ folder
Component SplitUI file > 500 linesSplit into sub-components
Utility ExtractionRepeated helper functionsCreate utils/ or lib/ folder

Code Smell Detection

SmellDetection RuleSeverity
God ClassClass > 500 lines OR > 20 methodsHigh
Long MethodFunction > 50 linesMedium
Large FileFile > 800 linesMedium
Deep Nesting> 4 levels of indentationMedium
Too Many ParametersFunction > 5 parametersLow
Magic NumbersHardcoded values without constantsLow
Dead CodeUnused functions/variablesLow
Duplicate CodeSimilar code blocks > 10 linesMedium

Evaluation Procedures

Procedure: Evaluate Requirements Alignment

code
1. LOCATE requirement docs:
   - x-ipe-docs/requirements/requirement-summary.md
   - x-ipe-docs/requirements/requirement-details.md
   - Any docs referencing feature

2. FOR EACH requirement related to feature:
   a. CHECK if requirement is documented
   b. CHECK if requirement is implemented in code
   c. IDENTIFY deviations between doc and implementation

3. CLASSIFY gaps:
   - undocumented: Implemented but not in requirements
   - unimplemented: In requirements but not implemented
   - deviated: Implementation differs from requirement

4. ASSIGN severity:
   - high: Core functionality affected
   - medium: Secondary functionality affected
   - low: Minor/edge cases

Procedure: Evaluate Specification Alignment

code
1. LOCATE specification:
   - x-ipe-docs/requirements/FEATURE-XXX/specification.md

2. IF specification exists:
   a. EXTRACT expected behaviors
   b. COMPARE with actual implementation
   c. IDENTIFY gaps (missing | outdated | incorrect)
   
3. IF specification missing (empty feature folder):
   a. CHECK if any related implementation exists in codebase
   b. IF no implementation found:
      - status: planned
      - NOT a gap - just indicates future work needed
      - Do NOT count as critical or high priority gap
   c. IF implementation exists without specification:
      - status: not_found
      - Add gap: "Implementation exists but specification missing"
      - severity: medium (documentation debt)

Procedure: Evaluate Test Coverage

code
1. IDENTIFY test files for feature:
   - tests/**/test_*{feature_name}*
   - tests/**/*{feature_name}*_test.*

2. RUN coverage analysis:
   - Python: pytest --cov
   - Node.js: npm test -- --coverage
   - Go: go test -cover

3. EXTRACT metrics:
   - Line coverage %
   - Branch coverage %
   - Untested functions/areas

4. IDENTIFY critical untested areas:
   - Business logic paths
   - Error handlers
   - Edge cases

5. DETERMINE status:
   - sufficient: ≥80% line coverage, no critical gaps
   - insufficient: <80% or has critical gaps
   - no_tests: No test files found

Procedure: Evaluate Code Alignment

code
1. LOCATE technical design:
   - x-ipe-docs/requirements/FEATURE-XXX/technical-design.md

2. IF technical design exists:
   a. EXTRACT expected:
      - File structure
      - Component interfaces
      - Data models
   b. COMPARE with actual implementation
   c. IDENTIFY gaps:
      - structure: File/folder organization differs
      - behavior: Logic differs from design
      - interface: API/interface differs

3. DETERMINE status:
   - aligned: No significant gaps
   - drifted: Minor gaps exist
   - major_drift: Critical gaps exist

Procedure: Generate Refactoring Suggestions

Integrates with: task-type-refactoring-analysis skill

code
1. ANALYZE gaps from all 4 perspectives:
   - Collect all gaps with severity high/medium
   - Group gaps by feature

2. FOR EACH feature with gaps:
   a. IDENTIFY applicable principles (from task-type-refactoring-analysis):
      - Large files/classes → SRP, SOLID
      - Duplicated code → DRY
      - Complex logic → KISS
      - Unused code → YAGNI
      - Mixed concerns → SoC (Separation of Concerns)
   
   b. FORMULATE goals based on gaps:
      - requirements gaps → Suggest documentation sync or code alignment
      - specification gaps → Suggest spec update or implementation fix
      - test coverage gaps → Suggest test-first approach
      - code alignment gaps → Suggest structural refactoring
   
   c. DEFINE target structure:
      - Describe desired code organization after fixes
      - Note key structural changes needed
   
   d. IDENTIFY constraints:
      - Backward compatibility requirements
      - API stability requirements
      - Dependencies to preserve

3. COMPILE refactoring_suggestion for feature:
   summary: "<derived from gap analysis>"
   goals:
     - goal: "<specific goal from gap>"
       priority: <based on gap severity>
       rationale: "<from gap description>"
   target_structure: "<desired end state>"
   
   principles:
     primary: [<principles with applications>]
     secondary: [<supporting principles>]
     constraints: [<identified constraints>]

4. IF no gaps found for feature:
   - Set has_suggestions: false for that feature
   - Skip suggestion generation

Score Calculation

Feature Score (1-10)

code
feature_score = weighted_average(
  requirements_alignment: weight=0.25,
  specification_alignment: weight=0.25,
  test_coverage: weight=0.25,
  code_alignment: weight=0.25
)

Status to score mapping:
- aligned/sufficient: 10
- planned: N/A (exclude from scoring - future work)
- needs_update/insufficient: 5
- not_found/no_tests/major_drift: 2
- critical: 1

Note: Features with status "planned" (empty folder, no implementation) 
are EXCLUDED from overall score calculation as they represent future 
work, not quality issues.

Overall Score (1-10)

code
overall_score = average(all feature_scores WHERE status != "planned")

Health Status

code
IF overall_score >= 8: healthy
ELSE IF overall_score >= 5: attention_needed
ELSE: critical

Report Template

The skill uses template at templates/quality-report.md for consistent report generation.

Template structure:

  1. Header with metadata
  2. Executive Summary
  3. Feature-by-Feature Evaluation
  4. Priority Gaps
  5. Recommendations
  6. Appendix (detailed data)

Definition of Done (DoD)

#CheckpointRequired
1All features in scope evaluatedYes
2All 4 perspectives evaluated per featureYes
3Gaps identified and prioritizedYes
4Overall score calculatedYes
5Report generated in correct locationYes
6Latest report link updatedYes

Patterns

Pattern: First-Time Evaluation

When: No previous quality reports exist Then:

code
1. Generate full project evaluation
2. Set baseline metrics
3. Create recommendations for initial improvements
4. Flag features needing immediate attention

Pattern: Post-Refactoring Evaluation

When: After code-refactoring-stage tasks complete Then:

code
1. Load code_quality_evaluated from refactoring task
2. Use as input for targeted re-evaluation
3. Compare with pre-refactoring state
4. Generate delta report showing improvements

Anti-Patterns

Anti-PatternWhy BadDo Instead
Skip features without specsMiss coverage gapsEvaluate, mark as not_found
Assume passing tests = qualityTests may not cover allAlways check all 4 perspectives
Only evaluate after problemsReactive, not proactiveRegular scheduled evaluations
Ignore low-severity gapsThey accumulateTrack all, prioritize by severity

Integration with Code Refactoring Stage

This skill integrates with the code-refactoring-stage workflow:

  1. Before Refactoring Analysis: Generate baseline quality report
  2. After Improve Quality: Generate comparison showing documentation alignment
  3. After Code Refactor V2: Generate final quality report showing improvements
code
Quality Report (baseline)
    ↓
task-type-refactoring-analysis
    ↓
task-type-improve-code-quality-before-refactoring
    ↓
Quality Report (mid-point)
    ↓
task-type-code-refactor-v2
    ↓
Quality Report (final) + Comparison