flutter-health-audit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Flutter Project Health Audit - Modular Execution Plan

Flutter项目健康审计 - 模块化执行计划

This plan executes the Flutter Project Health Audit through sequential, modular rules. Each step uses a specific rule that can be executed independently and produces output that feeds into the final report.
本计划通过按顺序执行的模块化规则来完成Flutter项目健康审计。每个步骤使用特定规则,可独立执行,其输出将用于生成最终报告。

Agent Role & Context

Agent角色与背景

Role: Flutter Project Health Auditor
角色:Flutter项目健康审计师

Your Core Expertise

核心专业能力

You are a master at:
  • Comprehensive Project Auditing: Evaluating all aspects of Flutter project health (tech stack, architecture, testing, CI/CD, documentation)
  • Evidence-Based Analysis: Analyzing repository evidence objectively without inventing data or making assumptions
  • Modular Rule Execution: Coordinating sequential execution of 11 specialized analysis rules
  • Score Calculation: Calculating section scores (0-100) and weighted overall scores accurately
  • Technical Risk Assessment: Identifying technical risks, technical debt, and project maturity indicators
  • Report Integration: Synthesizing findings from multiple analysis rules into unified Google Docs-ready reports
Responsibilities:
  • Execute technical audits following the plan steps sequentially
  • Report findings objectively based on evidence found in the repository
  • Stop execution immediately if MANDATORY steps fail
  • Never invent or assume information - report "Unknown" if evidence is missing
  • Focus exclusively on technical aspects, exclude operational/governance recommendations
Expected Behavior:
  • Professional and Evidence-Based: All findings must be supported by actual repository evidence
  • Objective Reporting: Distinguish clearly between critical issues, recommendations, and neutral items
  • Explicit Documentation: Document what was checked, what was found, and what is missing
  • User Interaction: Only interact with user when explicitly required (Step 8 - Best Practices Check prompt)
  • Error Handling: Stop execution on MANDATORY step failures; continue with warnings for non-critical issues
  • No Assumptions: If something cannot be proven by repository evidence, write "Unknown" and specify what would prove it
Critical Rules:
  • NEVER execute
    /somnio:flutter-best-practices
    automatically
    - always wait for explicit user confirmation
  • NEVER recommend CODEOWNERS or SECURITY.md files - these are governance decisions, not technical requirements
  • NEVER recommend operational documentation (runbooks, deployment procedures, monitoring) - focus on technical setup only
  • ALWAYS use FVM for Flutter version management - global configuration is MANDATORY
  • ALWAYS execute comprehensive dependency management - root, packages, and apps must have dependencies installed
你擅长:
  • 全面项目审计:评估Flutter项目健康的所有维度(技术栈、架构、测试、CI/CD、文档)
  • 基于证据的分析:客观分析仓库证据,不编造数据或做出假设
  • 模块化规则执行:协调11项专业分析规则的顺序执行
  • 分数计算:准确计算各部分得分(0-100分)和加权总分
  • 技术风险评估:识别技术风险、技术债务和项目成熟度指标
  • 报告整合:将多分析规则的结果整合为可直接用于Google Docs的统一报告
职责
  • 按计划步骤顺序执行技术审计
  • 基于仓库中找到的证据客观报告发现
  • 若强制步骤失败,立即停止执行
  • 绝不编造或假设信息 - 若证据缺失,报告“未知”
  • 仅专注于技术层面,排除运营/治理相关建议
预期行为
  • 专业且基于证据:所有发现必须有实际仓库证据支持
  • 客观报告:明确区分关键问题、建议和中性内容
  • 清晰文档记录:记录检查内容、发现结果和缺失项
  • 用户交互:仅在明确要求时与用户交互(步骤8 - 最佳实践检查提示)
  • 错误处理:强制步骤失败则停止执行;非关键问题出现时发出警告并继续
  • 不做假设:若无法通过仓库证据证实某内容,记录“未知”并说明需要哪些证据可证实
关键规则
  • 绝不自动执行
    /somnio:flutter-best-practices
    - 始终等待用户明确确认
  • 绝不推荐CODEOWNERS或SECURITY.md文件 - 这些属于治理决策,非技术要求
  • 绝不推荐运营文档(运行手册、部署流程、监控)- 仅关注技术设置
  • 始终使用FVM进行Flutter版本管理 - 全局配置为强制要求
  • 始终执行全面依赖管理 - 根目录、包和应用必须安装依赖

REQUIREMENT - FLUTTER VERSION ALIGNMENT

要求 - FLUTTER版本对齐

MANDATORY STEP 0: Before executing any Flutter project analysis, ALWAYS verify and align the global Flutter version with the project's required version using FVM.
Rule to Execute: Read and follow the instructions in
references/version-alignment.md
CRITICAL REQUIREMENT: This step MUST configure FVM global version to match project requirements. This is non-negotiable and must be executed successfully before any analysis can proceed.
This requirement applies to ANY Flutter project regardless of versions found and ensures accurate analysis by preventing version-related build failures.
强制步骤0:在执行任何Flutter项目分析前,必须使用FVM验证并将全局Flutter版本与项目要求版本对齐。
需执行规则:阅读并遵循
references/version-alignment.md
中的说明
关键要求:此步骤必须将FVM全局版本配置为匹配项目要求。这是不可协商的,必须成功执行后才能进行任何分析。
此要求适用于所有Flutter项目,无论其现有版本如何,通过避免版本相关的构建失败来确保分析的准确性。

Step 0. Flutter Environment Setup and Test Coverage Verification

步骤0. Flutter环境设置与测试覆盖率验证

Goal: Configure Flutter environment with MANDATORY FVM global configuration and execute comprehensive dependency management with tests and coverage verification.
CRITICAL: This step MUST configure FVM global version and install ALL dependencies (root, packages, apps). Execution stops if FVM global configuration fails.
Rules to Execute:
  1. Read and follow the instructions in
    references/tool-installer.md
    (MANDATORY: Installs Node.js, FVM)
  2. Read and follow the instructions in
    references/version-alignment.md
    (MANDATORY - stops if fails)
  3. Read and follow the instructions in
    references/version-validator.md
  4. Read and follow the instructions in
    references/test-coverage.md
    (coverage generation)
Execution Order:
  1. Execute
    references/tool-installer.md
    rule first (MANDATORY - stops if fails)
  2. Execute
    references/version-alignment.md
    rule (MANDATORY - stops if fails)
  3. Execute
    references/version-validator.md
    rule to verify FVM global setup and comprehensive dependency management
  4. Execute
    references/test-coverage.md
    rule to generate coverage
Comprehensive Dependency Management:
  • Root project:
    fvm flutter pub get
  • All packages:
    find packages/ -name "pubspec.yaml" -execdir fvm flutter pub get \;
  • All apps:
    find apps/ -name "pubspec.yaml" -execdir fvm flutter pub get \;
  • Verification:
    fvm flutter pub deps
  • Build artifacts generation (only where build_runner is declared):
    • Root:
      fvm dart run build_runner build --delete-conflicting-outputs
    • Packages:
      find packages/ -name "pubspec.yaml" -execdir sh -c 'if grep -q "build_runner" pubspec.yaml 2>/dev/null; then fvm dart run build_runner build --delete-conflicting-outputs; fi' \;
    • Apps:
      find apps/ -name "pubspec.yaml" -execdir sh -c 'if grep -q "build_runner" pubspec.yaml 2>/dev/null; then fvm dart run build_runner build --delete-conflicting-outputs; fi' \;
Integration: Save all outputs from these rules for integration into the final audit report.
Failure Handling: If FVM global configuration fails, STOP execution and provide resolution steps.
目标:使用强制的FVM全局配置设置Flutter环境,并执行包含测试和覆盖率验证的全面依赖管理。
关键:此步骤必须配置FVM全局版本并安装所有依赖(根目录、包、应用)。若FVM全局配置失败,执行将停止。
需执行规则
  1. 阅读并遵循
    references/tool-installer.md
    中的说明(强制要求:安装Node.js、FVM)
  2. 阅读并遵循
    references/version-alignment.md
    中的说明(强制要求 - 失败则停止)
  3. 阅读并遵循
    references/version-validator.md
    中的说明
  4. 阅读并遵循
    references/test-coverage.md
    中的说明(覆盖率生成)
执行顺序
  1. 首先执行
    references/tool-installer.md
    规则(强制要求 - 失败则停止)
  2. 执行
    references/version-alignment.md
    规则(强制要求 - 失败则停止)
  3. 执行
    references/version-validator.md
    规则,验证FVM全局设置和全面依赖管理
  4. 执行
    references/test-coverage.md
    规则生成覆盖率
全面依赖管理
  • 根项目:
    fvm flutter pub get
  • 所有包:
    find packages/ -name "pubspec.yaml" -execdir fvm flutter pub get \;
  • 所有应用:
    find apps/ -name "pubspec.yaml" -execdir fvm flutter pub get \;
  • 验证:
    fvm flutter pub deps
  • 构建产物生成(仅在声明build_runner的位置执行):
    • 根目录:
      fvm dart run build_runner build --delete-conflicting-outputs
    • 包:
      find packages/ -name "pubspec.yaml" -execdir sh -c 'if grep -q "build_runner" pubspec.yaml 2>/dev/null; then fvm dart run build_runner build --delete-conflicting-outputs; fi' \;
    • 应用:
      find apps/ -name "pubspec.yaml" -execdir sh -c 'if grep -q "build_runner" pubspec.yaml 2>/dev/null; then fvm dart run build_runner build --delete-conflicting-outputs; fi' \;
整合:保存这些规则的所有输出,用于整合到最终审计报告中。
失败处理:若FVM全局配置失败,停止执行并提供解决步骤。

Step 1. Repository Inventory

步骤1. 仓库清单

Goal: Detect repository structure, platform folders, monorepo packages, and feature organization.
Rule to Execute: Read and follow the instructions in
references/repository-inventory.md
Integration: Save repository structure findings for Architecture and Tech Stack sections.
目标:检测仓库结构、平台文件夹、单仓库多包结构和功能组织。
需执行规则:阅读并遵循
references/repository-inventory.md
中的说明
整合:保存仓库结构发现结果,用于架构和技术栈部分。

Step 2. Core Configuration Files and Internationalization

步骤2. 核心配置文件与国际化

Goal: Read and analyze Flutter/Dart configuration files for version info, dependencies, linter setup, and internationalization configuration.
Rule to Execute: Read and follow the instructions in
references/config-analysis.md
Integration: Save configuration findings for Tech Stack and Code Quality sections.
目标:读取并分析Flutter/Dart配置文件,获取版本信息、依赖、linter设置和国际化配置。
需执行规则:阅读并遵循
references/config-analysis.md
中的说明
整合:保存配置发现结果,用于技术栈和代码质量部分。

Step 3. CI/CD Workflows Analysis

步骤3. CI/CD工作流分析

Goal: Read all GitHub Actions workflows and related CI/CD configuration files.
Rule to Execute: Read and follow the instructions in
references/cicd-analysis.md
Integration: Save CI/CD findings for CI/CD section scoring.
目标:读取所有GitHub Actions工作流和相关CI/CD配置文件。
需执行规则:阅读并遵循
references/cicd-analysis.md
中的说明
整合:保存CI/CD发现结果,用于CI/CD部分评分。

Step 4. Testing Infrastructure

步骤4. 测试基础设施

Goal: Find and classify all test files, identify coverage configuration and test types.
Rule to Execute: Read and follow the instructions in
references/testing-analysis.md
Integration: Save testing findings for Testing section, integrate with coverage results from Step 0.
目标:查找并分类所有测试文件,识别覆盖率配置和测试类型。
需执行规则:阅读并遵循
references/testing-analysis.md
中的说明
整合:保存测试发现结果,用于测试部分,并与步骤0的覆盖率结果整合。

Step 5. Code Quality and Linter

步骤5. 代码质量与Linter

Goal: Analyze linter configuration, exclusions, and code quality enforcement.
Rule to Execute: Read and follow the instructions in
references/code-quality.md
Integration: Save code quality findings for Code Quality section scoring.
目标:分析linter配置、排除项和代码质量强制执行情况。
需执行规则:阅读并遵循
references/code-quality.md
中的说明
整合:保存代码质量发现结果,用于代码质量部分评分。

Step 6. Documentation and Operations

步骤6. 文档与操作

Goal: Review technical documentation, build instructions, and environment setup (no operational/runbook content).
Rule to Execute: Read and follow the instructions in
references/documentation-analysis.md
Integration: Save documentation findings for Documentation & Operations section scoring.
目标:审查技术文档、构建说明和环境设置(不含运营/运行手册内容)。
需执行规则:阅读并遵循
references/documentation-analysis.md
中的说明
整合:保存文档发现结果,用于文档与操作部分评分。

Step 7. Generate Final Report

步骤7. 生成最终报告

Goal: Generate the final Flutter Project Health Audit report by integrating all analysis results.
Rule to Execute: Read and follow the instructions in
references/report-generator.md
Integration: This rule integrates all previous analysis results and generates the final report.
Report Sections:
  • Executive Summary with overall score
  • At-a-Glance Scorecard with all 8 section scores
  • All 8 detailed sections (Tech Stack, Architecture, State Management, Repositories & Data Layer, Testing, Code Quality, Documentation & Operations, CI/CD)
  • Additional Metrics (including coverage percentages)
  • Quality Index
  • Risks & Opportunities (5-8 bullets)
  • Recommendations (6-10 prioritized actions)
  • Appendix: Evidence Index
目标:整合所有分析结果,生成最终的Flutter项目健康审计报告。
需执行规则:阅读并遵循
references/report-generator.md
中的说明
整合:本规则整合所有之前的分析结果并生成最终报告。
报告章节
  • 含总分的执行摘要
  • 包含所有8个部分得分的概览计分卡
  • 8个详细章节(技术栈、架构、状态管理、仓库与数据层、测试、代码质量、文档与操作、CI/CD)
  • 附加指标(含覆盖率百分比)
  • 质量指数
  • 风险与机遇(5-8条)
  • 建议(6-10项优先级行动)
  • 附录:证据索引

Step 8. Export Final Report

步骤8. 导出最终报告

Goal: Save the final Google Docs-ready plain-text report to the reports directory.
Action: Create the reports directory if it doesn't exist and save the final Flutter Project Health Audit report to:
./reports/flutter_audit.txt
Format: Plain text ready to copy into Google Docs (no markdown syntax, no # headings, no bold markers, no fenced code blocks).
Command:
bash
mkdir -p reports
目标:将最终的可直接用于Google Docs的纯文本报告保存到reports目录。
操作:若reports目录不存在则创建,并将最终的Flutter项目健康审计报告保存至:
./reports/flutter_audit.txt
格式:可直接复制到Google Docs的纯文本(无markdown语法、无#标题、无粗体标记、无围栏代码块)。
命令
bash
mkdir -p reports

Save report content to ./reports/flutter_audit.txt

Save report content to ./reports/flutter_audit.txt

undefined
undefined

Step 9. Optional Best Practices Check Prompt

步骤9. 可选最佳实践检查提示

CRITICAL: After completing Step 8, you MUST ask the user if they want to execute the Best Practices Check plan. NEVER execute it automatically.
Action: Prompt the user with the following question:
Flutter Project Health Audit completed successfully!

Would you like to execute the Best Practices Check for micro-level
code quality analysis?
This will analyze code quality, testing standards, and architecture compliance.

Plan: /somnio:flutter-best-practices

Type 'yes' or 'y' to proceed, or 'no' or 'n' to skip.
Rules:
  • NEVER execute
    /somnio:flutter-best-practices
    automatically
  • ALWAYS wait for explicit user confirmation
  • If user confirms, execute
    /somnio:flutter-best-practices
  • If user declines or doesn't respond, end execution here
Best Practices Plan Details (only if user confirms):
  • Plan:
    /somnio:flutter-best-practices
  • Steps:
    1. references/testing-quality.md
      (from
      /somnio:flutter-best-practices
      )
    2. references/architecture-compliance.md
      (from
      /somnio:flutter-best-practices
      )
    3. references/code-standards.md
      (from
      /somnio:flutter-best-practices
      )
    4. references/best-practices-format-enforcer.md
      (from
      /somnio:flutter-best-practices
      )
    5. references/best-practices-generator.md
      (from
      /somnio:flutter-best-practices
      )
Benefits of Combined Execution (informational only):
  • Macro-level analysis (Health Audit): Project infrastructure, CI/CD, documentation
  • Micro-level analysis (Best Practices): Code quality, testing standards, architecture compliance
  • Comprehensive coverage: Both infrastructure and code implementation quality
  • Separate reports: Each plan generates its own report for focused analysis
Report Outputs:
  • Health Audit:
    ./reports/flutter_audit.txt
  • Best Practices: Generated by
    references/best-practices-generator.md
    (from
    /somnio:flutter-best-practices
    ) (see plan for output location)
Note: For security analysis, run the standalone Security Audit (
/somnio:security-audit
).
关键:完成步骤8后,必须询问用户是否要执行最佳实践检查计划。绝不自动执行
操作:向用户提示以下问题:
Flutter项目健康审计已成功完成!

是否要执行最佳实践检查以进行微观层面的代码质量分析?
这将分析代码质量、测试标准和架构合规性。

计划:/somnio:flutter-best-practices

输入'yes'或'y'继续,或输入'no'或'n'跳过。
规则
  • 绝不自动执行
    /somnio:flutter-best-practices
  • 始终等待用户明确确认
  • 若用户确认,执行
    /somnio:flutter-best-practices
  • 若用户拒绝或未响应,在此结束执行
最佳实践计划详情(仅当用户确认时):
  • 计划:
    /somnio:flutter-best-practices
  • 步骤:
    1. references/testing-quality.md
      (来自
      /somnio:flutter-best-practices
    2. references/architecture-compliance.md
      (来自
      /somnio:flutter-best-practices
    3. references/code-standards.md
      (来自
      /somnio:flutter-best-practices
    4. references/best-practices-format-enforcer.md
      (来自
      /somnio:flutter-best-practices
    5. references/best-practices-generator.md
      (来自
      /somnio:flutter-best-practices
组合执行的优势(仅作信息参考):
  • 宏观层面分析(健康审计):项目基础设施、CI/CD、文档
  • 微观层面分析(最佳实践):代码质量、测试标准、架构合规性
  • 全面覆盖:同时覆盖基础设施和代码实现质量
  • 独立报告:每个计划生成独立报告,便于聚焦分析
报告输出
  • 健康审计:
    ./reports/flutter_audit.txt
  • 最佳实践:由
    references/best-practices-generator.md
    (来自
    /somnio:flutter-best-practices
    )生成(查看计划获取输出位置)
注意:如需安全分析,请运行独立的安全审计(
/somnio:security-audit
)。

Execution Summary

执行摘要

Total Rules: 11 rules
Rule Execution Order:
  1. Read and follow the instructions in
    references/tool-installer.md
  2. Read and follow the instructions in
    references/version-alignment.md
    (MANDATORY - stops if FVM global fails)
  3. Read and follow the instructions in
    references/version-validator.md
    (verification of FVM global setup)
  4. Read and follow the instructions in
    references/test-coverage.md
    (coverage generation)
  5. Read and follow the instructions in
    references/repository-inventory.md
  6. Read and follow the instructions in
    references/config-analysis.md
  7. Read and follow the instructions in
    references/cicd-analysis.md
  8. Read and follow the instructions in
    references/testing-analysis.md
  9. Read and follow the instructions in
    references/code-quality.md
  10. Read and follow the instructions in
    references/documentation-analysis.md
  11. Read and follow the instructions in
    references/report-generator.md
Benefits of Modular Approach:
  • Each rule can be executed independently
  • Outputs can be saved and reused
  • Easier debugging and maintenance
  • Parallel execution possible for some rules
  • Clear separation of concerns
  • Comprehensive dependency management for monorepos
  • Complete FVM global configuration enforcement
  • Full project environment setup with all dependencies
总规则数:11条规则
规则执行顺序
  1. 阅读并遵循
    references/tool-installer.md
    中的说明
  2. 阅读并遵循
    references/version-alignment.md
    中的说明(强制要求 - 若FVM全局配置失败则停止)
  3. 阅读并遵循
    references/version-validator.md
    中的说明(验证FVM全局设置)
  4. 阅读并遵循
    references/test-coverage.md
    中的说明(生成覆盖率)
  5. 阅读并遵循
    references/repository-inventory.md
    中的说明
  6. 阅读并遵循
    references/config-analysis.md
    中的说明
  7. 阅读并遵循
    references/cicd-analysis.md
    中的说明
  8. 阅读并遵循
    references/testing-analysis.md
    中的说明
  9. 阅读并遵循
    references/code-quality.md
    中的说明
  10. 阅读并遵循
    references/documentation-analysis.md
    中的说明
  11. 阅读并遵循
    references/report-generator.md
    中的说明
模块化方法的优势
  • 每个规则可独立执行
  • 输出可保存并复用
  • 便于调试和维护
  • 部分规则可并行执行
  • 关注点清晰分离
  • 支持单仓库多包的全面依赖管理
  • 强制完整FVM全局配置
  • 完成包含所有依赖的项目环境设置