@ohos-cpf/3rdloop 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +425 -0
- package/bin/3rdloop.mjs +48 -0
- package/lib/cli.js +741 -0
- package/lib/config.js +318 -0
- package/lib/doctor.js +114 -0
- package/lib/exit-codes.js +31 -0
- package/lib/opencode.js +156 -0
- package/lib/orch.js +427 -0
- package/lib/queries.js +264 -0
- package/lib/runner.js +979 -0
- package/lib/step.js +326 -0
- package/lib/ui.js +223 -0
- package/lib/workflow.js +291 -0
- package/lib/workflows.js +132 -0
- package/package.json +50 -0
- package/vendor/Server/Agent/SkillSelector/README.md +344 -0
- package/vendor/Server/Agent/SkillSelector/core/Agent.js +207 -0
- package/vendor/Server/Agent/SkillSelector/index.js +14 -0
- package/vendor/Server/Agent/SkillSelector/llm/llmClient.js +313 -0
- package/vendor/Server/Agent/SkillSelector/llm/prompts.js +161 -0
- package/vendor/Server/Agent/SkillSelector/llm/reactSteps.js +144 -0
- package/vendor/Server/Agent/SkillSelector/matcher/fuzzyMatcher.js +433 -0
- package/vendor/Server/Agent/SkillSelector/scanner/skillScanner.js +382 -0
- package/vendor/Server/Agent/SkillSelector/types.js +63 -0
- package/vendor/Server/Agent/SkillSelector/utils/actionWords.js +60 -0
- package/vendor/Server/Brain/AnalysisStrategies.js +422 -0
- package/vendor/Server/Brain/Brain.js +686 -0
- package/vendor/Server/Brain/DecompositionStrategies.js +621 -0
- package/vendor/Server/Brain/PlanPersistence.js +196 -0
- package/vendor/Server/Brain/SkillExecutor.js +251 -0
- package/vendor/Server/Brain/index.js +11 -0
- package/vendor/Server/CLI/cli.js +243 -0
- package/vendor/Server/CLI/opencode/index.js +804 -0
- package/vendor/Server/CLI/opencode.js +5 -0
- package/vendor/Server/DbUse/MessageArchive.js +61 -0
- package/vendor/Server/DbUse/StorageManager.js +107 -0
- package/vendor/Server/DbUse/adapters/BaseAdapter.js +94 -0
- package/vendor/Server/DbUse/adapters/FileAdapter.js +138 -0
- package/vendor/Server/DbUse/adapters/JsonAdapter.js +138 -0
- package/vendor/Server/DbUse/adapters/JsonlAdapter.js +114 -0
- package/vendor/Server/DbUse/adapters/SqliteAdapter.js +157 -0
- package/vendor/Server/DbUse/index.js +160 -0
- package/vendor/Server/DbUse/stores/SessionStore.js +279 -0
- package/vendor/Server/DbUse/stores/TaskExecutionStore.js +133 -0
- package/vendor/Server/DbUse/stores/TaskRegistryStore.js +262 -0
- package/vendor/Server/DbUse/stores/TaskStepStore.js +279 -0
- package/vendor/Server/FlexRunner/FlexRunner.js +1759 -0
- package/vendor/Server/FlexRunner/index.js +12 -0
- package/vendor/Server/Knowledge/KnowledgeImporter.js +523 -0
- package/vendor/Server/Knowledge/KnowledgeManager.js +341 -0
- package/vendor/Server/Knowledge/index.js +33 -0
- package/vendor/Server/LoopEngine/LoopEngine.js +1133 -0
- package/vendor/Server/LoopEngine/index.js +11 -0
- package/vendor/Server/Orchestrator/Orchestrator.js +1425 -0
- package/vendor/Server/Orchestrator/StepNode.js +312 -0
- package/vendor/Server/Orchestrator/index.js +13 -0
- package/vendor/Server/Routes/controllers/BrainController.js +241 -0
- package/vendor/Server/Routes/controllers/FlexRunnerController.js +1125 -0
- package/vendor/Server/Routes/controllers/HealthController.js +44 -0
- package/vendor/Server/Routes/controllers/KnowledgeImportController.js +355 -0
- package/vendor/Server/Routes/controllers/LoopEngineController.js +788 -0
- package/vendor/Server/Routes/controllers/OrchestratorController.js +911 -0
- package/vendor/Server/Routes/controllers/StatsController.js +57 -0
- package/vendor/Server/Routes/controllers/StreamController.js +67 -0
- package/vendor/Server/Routes/library/logger.js +179 -0
- package/vendor/Server/Routes/library/zipArchive.js +172 -0
- package/vendor/Server/Routes/router/Router.js +204 -0
- package/vendor/Server/Routes/routes/brain.js +47 -0
- package/vendor/Server/Routes/routes/flexrunner.js +72 -0
- package/vendor/Server/Routes/routes/health.js +28 -0
- package/vendor/Server/Routes/routes/index.js +57 -0
- package/vendor/Server/Routes/routes/knowledge.js +55 -0
- package/vendor/Server/Routes/routes/loopengine.js +58 -0
- package/vendor/Server/Routes/routes/orchestrator.js +61 -0
- package/vendor/Server/Routes/routes/registry.js +98 -0
- package/vendor/Server/Routes/routes/stats.js +23 -0
- package/vendor/Server/Routes/routes/stream.js +30 -0
- package/vendor/Server/Routes/server.js +202 -0
- package/vendor/Server/Routes/sse/SseHub.js +308 -0
- package/vendor/Server/Skills/acceptance-check/SKILL.md +174 -0
- package/vendor/Server/Skills/acceptance-check/references/PHASE1_ARTIFACT_COLLECTION.md +52 -0
- package/vendor/Server/Skills/acceptance-check/references/PHASE2_CRITERIA_EVALUATION.md +77 -0
- package/vendor/Server/Skills/arkts-code-check/SKILL.md +314 -0
- package/vendor/Server/Skills/arkts-code-check/references/CODE_CHECK_GUIDE.md +160 -0
- package/vendor/Server/Skills/arkts-code-check/references/FILE_TYPE_GUIDE.md +29 -0
- package/vendor/Server/Skills/arkts-code-check/references/PHASE1_INFO_COLLECTION.md +222 -0
- package/vendor/Server/Skills/arkts-code-check/references/REPORT_TEMPLATE.md +220 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/SKILL.md +329 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-demo-code/SKILL.md +291 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/API_SIGNATURE_CHECKS.md +68 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/BUILD_VALIDATION.md +184 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/CODE_STANDARDS.md +337 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/EXAMPLES.md +400 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/SYSTEM_API_LOOKUP.md +99 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/TEMPLATE.md +544 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-demo-coverage/SKILL.md +174 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/SKILL.md +321 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/references/EXAMPLES.md +100 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/references/TEMPLATE.md +185 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/SKILL.md +234 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +103 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/CHECK_DIMENSIONS.md +89 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/COMPLIANCE_CHECKLIST.md +62 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/KB_QUERY_GUIDE.md +108 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/MCP_TOOL_DISCOVERY.md +124 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/REPORT_TEMPLATE.md +90 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/SCORING_FORMULA.md +57 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/arkts-library-interface-spec/SKILL.md +97 -0
- package/vendor/Server/Skills/arkts-library-memory-leak-check/SKILL.md +392 -0
- package/vendor/Server/Skills/arkts-library-source-clone/SKILL.md +113 -0
- package/vendor/Server/Skills/arkts-library-stability-check/SKILL.md +313 -0
- package/vendor/Server/Skills/arkts-library-stability-check/assets/REPORT_TEMPLATE.md +154 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/CHECKLIST.md +166 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/CODE_EXAMPLES.md +309 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/SCORING_RULES.md +90 -0
- package/vendor/Server/Skills/arkts-library-stability-check/scripts/validate-skill.cjs +282 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/SKILL.md +361 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/assets/REPORT_TEMPLATE.md +146 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/CHECKLIST.md +253 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/MCP_TOOL_USAGE.md +115 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/scripts/validate-skill.cjs +263 -0
- package/vendor/Server/Skills/arkts-library-xts-code/SKILL.md +455 -0
- package/vendor/Server/Skills/arkts-library-xts-code/assets/report-template.md +60 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/ACCESS_MODIFIER_PRECHECK.md +76 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/BUILD_VERIFICATION.md +200 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/CODE_STANDARDS.md +519 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/SUBAGENT_PROMPT_TEMPLATE.md +276 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/SYSTEM_API_LOOKUP.md +93 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/XTS_TEMPLATE.md +767 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/precheck-access-modifiers.cjs +221 -0
- package/vendor/Server/Skills/arkts-library-xts-code-fix/SKILL.md +229 -0
- package/vendor/Server/Skills/arkts-library-xts-coverage/SKILL.md +97 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/SKILL.md +194 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/EXAMPLES.md +576 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/TEMPLATE.md +575 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/TESTABILITY_GUIDE.md +182 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/SKILL.md +491 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/references/error-fixing-examples.md +217 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/flutter-code-check/SKILL.md +299 -0
- package/vendor/Server/Skills/flutter-code-check/assets/OUTPUT_TEMPLATE.md +312 -0
- package/vendor/Server/Skills/flutter-code-check/references/CHECKLIST.md +190 -0
- package/vendor/Server/Skills/flutter-code-check/references/PLATFORMS.md +134 -0
- package/vendor/Server/Skills/flutter-code-check/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/flutter-interface/README.md +75 -0
- package/vendor/Server/Skills/flutter-interface/SKILL.md +291 -0
- package/vendor/Server/Skills/flutter-interface/references/EXAMPLES.md +336 -0
- package/vendor/Server/Skills/flutter-interface/references/GIT_CLONE_GUIDE.md +190 -0
- package/vendor/Server/Skills/flutter-interface/references/SCRIPT_REFERENCE.md +258 -0
- package/vendor/Server/Skills/flutter-interface/references/TEMPLATE.md +254 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/SKILL.md +518 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/CHECKLIST.md +382 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +342 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/PLATFORM_LIMITATION_GUIDE.md +71 -0
- package/vendor/Server/Skills/flutter-library-documentation-quality-check/SKILL.md +519 -0
- package/vendor/Server/Skills/flutter-library-documentation-quality-check/references/CHECKLIST.md +407 -0
- package/vendor/Server/Skills/flutter-library-memory-leak-check/SKILL.md +653 -0
- package/vendor/Server/Skills/flutter-library-memory-leak-check/references/CHECKLIST.md +397 -0
- package/vendor/Server/Skills/flutter-library-stability-check/SKILL.md +745 -0
- package/vendor/Server/Skills/flutter-library-stability-check/references/CHECKLIST.md +721 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/SKILL.md +414 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/assets/REPORT_TEMPLATE.md +150 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/CHECKLIST.md +304 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCORING_RULES.md +265 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCRIPT_USAGE.md +286 -0
- package/vendor/Server/Skills/knowledge-import/SKILL.md +383 -0
- package/vendor/Server/Skills/knowledge-import/references/MCP_TOOL_USAGE.md +165 -0
- package/vendor/Server/Skills/knowledge-import/references/SKILL_LOCATOR_GUIDE.md +91 -0
- package/vendor/Server/Skills/knowledge-import/references/SKILL_OPTIMIZATION_GUIDE.md +127 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/SKILL.md +301 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/assets/PR_ISSUE_TEMPLATE.md +105 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/references/GITCODE_API.md +127 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/scripts/gitcode-api.cjs +208 -0
- package/vendor/Server/Skills/rn-code-check/SKILL.md +321 -0
- package/vendor/Server/Skills/rn-code-check/references/API-GUIDE.md +235 -0
- package/vendor/Server/Skills/rn-code-check/references/CHECKLIST.md +189 -0
- package/vendor/Server/Skills/rn-code-check/references/REPORT-TEMPLATE.md +247 -0
- package/vendor/Server/Skills/rn-lib-add-example/SKILL.md +198 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/APP_RENAME_GUIDE.md +40 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/SHELL_ADAPTATION_CHECKLIST.md +78 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/TEMPLATE_REPO_GUIDE.md +70 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/VERIFICATION_GUIDE.md +47 -0
- package/vendor/Server/Skills/rn-lib-add-example/scripts/create-example.cjs +252 -0
- package/vendor/Server/Skills/rn-lib-update-doc/SKILL.md +176 -0
- package/vendor/Server/Skills/rn-lib-update-doc/config.json +5 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/changelog-template.md +35 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/format-diff.md +137 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/link-registry.json +33 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2-overview.md +40 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2.md +429 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/detect-readme-format.cjs +105 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/find-usage-doc.cjs +90 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/link-verify.cjs +213 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-changelog.cjs +73 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-package-meta.cjs +258 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-readme-links.cjs +341 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/resolve-usage-docs.cjs +67 -0
- package/vendor/Server/Skills/rn-library-consistency-check/SKILL.md +299 -0
- package/vendor/Server/Skills/rn-library-consistency-check/assets/REPORT_TEMPLATE.md +293 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_COMPONENT_CHECK_GUIDE.md +857 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_TURBOMODULE_CHECK_GUIDE.md +856 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CHECKLIST.md +157 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_COMPONENT_CHECK_GUIDE.md +801 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_TURBOMODULE_CHECK_GUIDE.md +684 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +233 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/NATIVE_COMPONENT_IDENTIFICATION.md +1373 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/SCORING_STANDARD.md +220 -0
- package/vendor/Server/Skills/rn-library-consistency-check/scripts/validate-skill.py +245 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/SKILL.md +263 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL.md +414 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL_en.md +413 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +311 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CHECK_CHECKLIST.md +355 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CROSS_VALIDATION_GUIDE.md +115 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/DOC_COLLECTION_GUIDE.md +139 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/EXAMPLES.md +586 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/GOTCHAS.md +57 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/scripts/validate-skill.py +259 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/SKILL.md +301 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/assets/REPORT_TEMPLATE.md +148 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/DOC_ANNOTATION_GUIDE.md +118 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/SCRIPT_USAGE_GUIDE.md +168 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/URL_PARSING_RULES.md +176 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/SKILL.md +274 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/assets/case-template.md +45 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/assets/rule-template.md +25 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/references/PR_FETCH_GUIDE.md +61 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/references/RULE_TEMPLATE_GUIDE.md +165 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/scripts/fetch-pr-info.py +239 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/SKILL.md +263 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/assets/REPORT_TEMPLATE.md +96 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/COMPLIANCE_CHECKLIST.md +58 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/INSPECTION_GUIDE.md +99 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/PRESCREEN_GUIDE.md +64 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/SOURCE_PREP_GUIDE.md +75 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/scripts/validate-known-issue-report.py +164 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/SKILL.md +339 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/assets/REPORT_TEMPLATE.md +83 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/references/CHECKLIST.md +859 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/references/HARMONY_CODE_PATTERNS.md +122 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/scripts/scan_harmony_code.py +279 -0
- package/vendor/Server/Skills/rn-library-stability-check/SKILL.md +273 -0
- package/vendor/Server/Skills/rn-library-stability-check/assets/REPORT_TEMPLATE.md +129 -0
- package/vendor/Server/Skills/rn-library-stability-check/references/CHECKLIST.md +581 -0
- package/vendor/Server/Skills/rn-library-stability-check/references/SCORING_RULES.md +138 -0
- package/vendor/Server/Skills/rn-library-stability-check/scripts/scan-harmony-code.py +168 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/SKILL.md +506 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/CHECKLIST.md +280 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/DEMO_LOCATION.md +221 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/REPORT_TEMPLATE.md +209 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/SCRIPT_USAGE.md +325 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/SKILL.md +279 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/assets/TEST_FILE_TEMPLATES.md +404 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_TROUBLESHOOTING.md +185 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_WORKFLOW.md +265 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/COMMON_CONFIG.md +189 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/CONFIG_GUIDE.md +203 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/COVERAGE_ANALYZER.md +147 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/DESIGN_DOC_GUIDE.md +148 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_FLOW.md +165 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_STRATEGY.md +195 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/HARMONY_SCANNER.md +249 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/JEST_FRAMEWORK.md +235 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/PLATFORM_COMPAT.md +161 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/RN_TEST_PATTERNS.md +413 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/SOURCE_PARSER.md +235 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/TEST_CONVENTIONS.md +245 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/TROUBLESHOOTING.md +282 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/USAGE_GUIDE.md +251 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/SKILL.md +469 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/assets/CPTF_TEST_TEMPLATE.md +310 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/assets/DEMO_PAGE_TEMPLATE.md +303 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/CPTF_TEST_GENERATION_GUIDE.md +421 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/DEMO_GENERATION_GUIDE.md +358 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/QUALITY_CHECKLIST.md +114 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/SPEC_PARSING_GUIDE.md +274 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/scripts/validate-rnoh-cptf-api-test.sh +185 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/SKILL.md +191 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/assets/TEST_TEMPLATE.md +216 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/references/CPTF_SETUP.md +107 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/references/DEMO_ANALYSIS.md +120 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/scripts/validate-rnoh-cptf-test.sh +108 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/SKILL.md +237 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/references/DEBUG_PLAYBOOK.md +261 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/scripts/validate-run-env.sh +112 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/SKILL.md +498 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/adapt-checklist.md +270 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/api-migration-checklist.md +164 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/common-compile-errors.md +556 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/deveco-cli-tools.md +459 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/edge-cases.md +65 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/har-tgz-build.md +512 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/version-compat-matrix.md +132 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/scripts/auto-integrate.sh +424 -0
- package/vendor/Server/Skills/rnoh-lib-demo-coverage/SKILL.md +137 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/SKILL.md +306 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/assets/DEMO_PAGE_TEMPLATE.md +485 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/assets/INDEX_TEMPLATE.md +172 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/DEMO_CODE_RULES.md +422 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/QUALITY_CHECKLIST.md +95 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/SOURCE_EXPLORATION.md +169 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/SKILL.md +554 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/assets/DEMO_DOC_TEMPLATE.md +106 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/COVERAGE_INCREMENTAL.md +216 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/DEMO_DESIGN_RULES.md +413 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/OUTPUT_FORMAT.md +269 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/QUALITY_CHECKLIST.md +98 -0
- package/vendor/Server/Skills/rnoh-lib-func-test/SKILL.md +337 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/SKILL.md +722 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/assets/PORT_REPORT_TEMPLATE.md +219 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/DEMO_PORTING_GUIDE.md +345 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/PORT_VERIFICATION.md +269 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/RNT_PROJECT_STRUCTURE.md +173 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/analyze-demo-deps.cjs +267 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/detect-rnoh-version.cjs +174 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/find-rnt-demo.sh +111 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/port-demo.sh +186 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/read-lib-meta.cjs +150 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/SKILL.md +296 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/jest-troubleshooting.md +371 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/port-test-demo-guide.md +212 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/runtime-troubleshooting.md +345 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/unit-test-template.md +223 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/scripts/port-test-demo.sh +1053 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/SKILL.md +255 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_ADAPTATION.md +77 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_API_LOOKUP.md +224 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/script-reference.md +174 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/detect-upstream-version.js +967 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/generate-diff.js +1798 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/package.json +5 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/templates/report-template.md +137 -0
- package/vendor/Server/Skills/rnoh-lib-xts-coverage/SKILL.md +145 -0
- package/vendor/Server/Skills/skill-generator/SKILL.md +365 -0
- package/vendor/Server/Skills/skill-generator/assets/SKILL_TEMPLATE.md +183 -0
- package/vendor/Server/Skills/skill-generator/references/COMPLIANCE_CHECKLIST.md +82 -0
- package/vendor/Server/Skills/skill-generator/references/KB_QUERY_GUIDE.md +110 -0
- package/vendor/Server/Skills/skill-generator/references/MCP_TOOL_DISCOVERY.md +122 -0
- package/vendor/Server/Skills/skill-generator/references/SKILL_SPEC.md +121 -0
- package/vendor/Server/Skills/skill-generator/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/task-analysis/SKILL.md +234 -0
- package/vendor/Server/Skills/task-analysis/assets/OUTPUT_EXAMPLES.md +160 -0
- package/vendor/Server/Skills/task-analysis/references/ACCEPTANCE_CRITERIA_GUIDE.md +190 -0
- package/vendor/Server/Skills/task-analysis/references/ANALYSIS_SCHEMA.md +224 -0
- package/vendor/Server/Skills/task-analysis/references/INTEGRATION_CONTEXT.md +162 -0
- package/vendor/Server/Skills/task-analysis/references/LESSONS_LEARNED.md +55 -0
- package/vendor/Server/Skills/task-analysis/references/REPLAN_CONTEXT_GUIDE.md +126 -0
- package/vendor/Server/Skills/task-analysis/scripts/validate-analysis-output.sh +256 -0
- package/vendor/Server/Skills/task-decomposition/SKILL.md +529 -0
- package/vendor/Server/Skills/task-decomposition/assets/OUTPUT_EXAMPLES.md +451 -0
- package/vendor/Server/Skills/task-decomposition/references/ACCEPTANCE_CRITERIA_GUIDE.md +179 -0
- package/vendor/Server/Skills/task-decomposition/references/DEPENDENCY_GRAPH_GUIDE.md +152 -0
- package/vendor/Server/Skills/task-decomposition/references/INTEGRATION_CONTEXT.md +175 -0
- package/vendor/Server/Skills/task-decomposition/references/REPLAN_CONTEXT_GUIDE.md +195 -0
- package/vendor/Server/Skills/task-decomposition/references/TASK_DECOMPOSITION_TEMPLATES.md +226 -0
- package/vendor/Server/Skills/task-decomposition/scripts/list-available-skills.cjs +263 -0
- package/vendor/Server/Skills/task-decomposition/scripts/skill-blacklist.json +29 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-decomposition-output.cjs +376 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-param-consistency.cjs +259 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-specified-skills.cjs +216 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-step-graph.cjs +425 -0
- package/vendor/Server/Skills/tpc-cpp-check/SKILL.md +427 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/CHECKLIST.md +214 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/HPKBUILD_GUIDE.md +235 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/REPORT_TEMPLATE.md +250 -0
- package/vendor/Server/TestCheck/TestCheck.js +775 -0
- package/vendor/Server/TestCheck/index.js +11 -0
- package/vendor/Server/library/McpToolGuide.js +280 -0
- package/vendor/Server/library/StatsService.js +127 -0
- package/vendor/Server/library/cstTime.js +16 -0
- package/vendor/Server/package.json +17 -0
- package/vendor/VERSION +3 -0
- package/workflows/pr-check.mjs +106 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flutter-interface
|
|
3
|
+
description: 分析 Flutter 三方库的对外接口能力,使用 flutter-extract-interfaces.cjs 脚本自动提取 Dart 源码中的类/枚举/mixin/extension/函数/变量公开接口,生成结构化的接口规格说明文档。当需要理解 Flutter 三方库 API、生成接口规格文档、进行覆盖率分析前置提取时使用。支持 Git 仓库克隆、monorepo 多子包、export 链追踪。
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: 需要 Node.js 运行环境(执行 .cjs 脚本),需要 git(克隆远程仓库时)
|
|
6
|
+
metadata:
|
|
7
|
+
version: "1.1.0"
|
|
8
|
+
category: interface-analysis
|
|
9
|
+
language-support: "Dart/Flutter(完整支持,基于正则解析引擎)"
|
|
10
|
+
script-powered: "flutter-extract-interfaces.cjs + flutter-render-spec-doc.cjs"
|
|
11
|
+
git-support: "支持 git clone 从远程仓库克隆代码,支持 Sparse Checkout 稀疏检出"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Flutter Interface Analyzer
|
|
15
|
+
|
|
16
|
+
本技能用于**分析 Flutter 三方库的对外接口能力**,自动生成标准化的接口规格说明文档。核心接口提取由 `MCP/scripts/` 下的共享脚本 `flutter-extract-interfaces.cjs` 完成(本 SKILL 通过相对路径引用,不保存脚本副本),AI 负责审查补充和文档整合。
|
|
17
|
+
|
|
18
|
+
> ⚠️ **核心原则:只分析对外公开导出的接口,不关注内部实现细节。接口提取由脚本自动完成,AI 不手动逐文件读取源码提取接口。**
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 任务参数
|
|
23
|
+
|
|
24
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
25
|
+
|------|------|------|------|
|
|
26
|
+
| `input` | string | ✅ | Git 仓库 URL 或本地库源码目录路径 |
|
|
27
|
+
| `outputDir` | string | ✅ | 输出目录绝对路径 |
|
|
28
|
+
| `repoName` | string | ❌ | 仓库名称(从 URL 解析或用户提供) |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 输入依赖
|
|
33
|
+
|
|
34
|
+
无前置 SKILL。可作为独立任务调用。
|
|
35
|
+
|
|
36
|
+
## 脚本依赖
|
|
37
|
+
|
|
38
|
+
本 SKILL **不保存脚本副本**,直接调用 `MCP/scripts/` 目录下的两个共享 Node.js 脚本:
|
|
39
|
+
|
|
40
|
+
| 脚本 | 功能 | 输出 |
|
|
41
|
+
|------|------|------|
|
|
42
|
+
| `flutter-extract-interfaces.cjs` | 从 Dart 源码提取接口规格 JSON | `interface-spec.json` |
|
|
43
|
+
| `flutter-render-spec-doc.cjs` | 将 JSON 渲染为 Markdown 接口文档 | `接口规格说明.md` |
|
|
44
|
+
|
|
45
|
+
**派生变量**:
|
|
46
|
+
- `skillDir`:本 SKILL 所在目录(任务 prompt 中“SKILL 目录”下发的绝对路径)
|
|
47
|
+
- `mcpScriptsDir`:共享脚本目录 = `{{skillDir}}/../../../MCP/scripts`(即 `3rdLibraryLoop/MCP/scripts`)
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 工作流程概览
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Phase 1: 输入解析与代码获取(Git Clone / 本地路径)
|
|
55
|
+
↓
|
|
56
|
+
Phase 2: 脚本自动提取接口(核心 — flutter-extract-interfaces.cjs)
|
|
57
|
+
↓
|
|
58
|
+
Phase 3: 脚本渲染接口文档(flutter-render-spec-doc.cjs)
|
|
59
|
+
↓
|
|
60
|
+
Phase 4: AI 审查与补充(README 概述、注意事项等脚本无法提取的内容)
|
|
61
|
+
↓
|
|
62
|
+
Phase 5: 最终文档输出
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Phase 1:输入解析与代码获取
|
|
68
|
+
|
|
69
|
+
### 1.1 判断输入类型
|
|
70
|
+
|
|
71
|
+
| 输入形式 | 判断依据 | 处理方式 |
|
|
72
|
+
|----------|----------|----------|
|
|
73
|
+
| Git 仓库 URL | 以 `http://`、`https://` 开头,含 `.git` 或 `/tree/` | 执行 Git Clone(步骤 1.2) |
|
|
74
|
+
| 本地路径 | 以 `/` 或 `~` 开头,目录存在 | 直接使用,跳到 Phase 2 |
|
|
75
|
+
|
|
76
|
+
### 1.2 Git Clone(仅远程仓库输入)
|
|
77
|
+
|
|
78
|
+
从 URL 解析仓库地址、分支、子路径,执行克隆:
|
|
79
|
+
|
|
80
|
+
- **无子路径**:完整克隆 `git clone <baseUrl> <outputDir>/source`
|
|
81
|
+
- **有子路径**:稀疏检出(Sparse Checkout),只下载指定文件夹
|
|
82
|
+
|
|
83
|
+
> **仓库迁移探测(按序尝试,避免浪费轮次)**:Gitee `openharmony-tpc` 组织下的 Flutter 仓库已大规模迁移到 GitCode。克隆 404 时按以下顺序快速探测,**不要**盲目尝试随机组织名:
|
|
84
|
+
> 1. `https://gitcode.com/CPF-Flutter/{原仓库名}`(鸿蒙化 Flutter 仓库主要迁移目的地,仓库名可能带 `fluttertpc_` 前缀)
|
|
85
|
+
> 2. `https://gitcode.com/openharmony-tpc/{原仓库名}`
|
|
86
|
+
> 3. GitCode 站内搜索仓库名(一次搜索定位实际组织)
|
|
87
|
+
>
|
|
88
|
+
> 找到迁移仓库后,在报告中标注原地址 → 实际地址的映射关系。
|
|
89
|
+
|
|
90
|
+
> 详细的 URL 解析规则和克隆命令参见 [Git Clone 指南](references/GIT_CLONE_GUIDE.md)
|
|
91
|
+
|
|
92
|
+
### 1.3 确定分析路径
|
|
93
|
+
|
|
94
|
+
克隆完成后确定 `analysisRoot`:
|
|
95
|
+
- 完整克隆(无子路径):`analysisRoot = <outputDir>/source`
|
|
96
|
+
- 稀疏检出(有子路径):`analysisRoot = <outputDir>/source/<subpath>`
|
|
97
|
+
- 本地路径输入:`analysisRoot = 用户提供的路径`
|
|
98
|
+
|
|
99
|
+
> 后续所有分析基于 `analysisRoot` 目录进行。
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Phase 2:脚本自动提取接口
|
|
104
|
+
|
|
105
|
+
> ⚠️ **这是本 SKILL 的核心优化点:接口提取由脚本自动完成,AI 不手动逐文件读取源码。**
|
|
106
|
+
|
|
107
|
+
### 2.1 运行提取脚本
|
|
108
|
+
|
|
109
|
+
使用共享脚本从 Dart 源码自动提取全部公开接口:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-extract-interfaces.cjs" --repoDir <analysisRoot> --output <outputDir>/interface-spec.json
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**脚本自动完成的工作**:
|
|
116
|
+
1. 解析 `pubspec.yaml` 获取包名,定位 `lib/<package>.dart` 入口文件
|
|
117
|
+
2. 递归追踪 export 链(`export 'src/xxx.dart'`、`package:xxx/yyy.dart`),收集所有可达源文件
|
|
118
|
+
3. 支持 monorepo 多子包(如 `flutter_inappwebview` 含多个子包)
|
|
119
|
+
4. 预处理源码:移除字符串/注释(保留行号),保留 `///` 文档注释
|
|
120
|
+
5. 正则解析提取:类(含 abstract/mixin class)、枚举(含 Dart 3 增强枚举)、mixin、extension 的成员(方法/属性/字段/构造函数/常量)+ 顶层函数/变量/typedef
|
|
121
|
+
6. 过滤私有成员(`_` 前缀)、export hide/show 过滤
|
|
122
|
+
7. 提取 `///` 文档注释作为功能描述
|
|
123
|
+
8. 输出结构化 JSON(`interface-spec.json`)
|
|
124
|
+
|
|
125
|
+
> ⚠️ **monorepo 主包定位(重要)**:脚本对仓库根执行时,可能误把 `example` 子包(如 `packages/xxx_example`)识别为多子包一并提取,导致结果混入示例代码。**monorepo 仓库(含 `packages/` 目录)应把 `--repoDir` 指向主包目录**(如 `source/packages/flutter_blue_plus`),而不是仓库根目录。判断依据:`packages/` 下有多个子包时,选取含 `lib/<包名>.dart` 且 `pubspec.yaml` 与仓库名对应的主包。
|
|
126
|
+
|
|
127
|
+
**输出 JSON 结构**:
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"libraryName": "包名",
|
|
131
|
+
"entryFile": "./lib/xxx.dart",
|
|
132
|
+
"extractedAt": "ISO时间戳",
|
|
133
|
+
"summary": { "S": 类数, "N": 接口总数, "methods": N, "properties": N, "fields": N, "constants": N },
|
|
134
|
+
"sources": ["./lib/xxx.dart", ...],
|
|
135
|
+
"interfaces": [
|
|
136
|
+
{
|
|
137
|
+
"className": "ClassName",
|
|
138
|
+
"memberName": "methodName",
|
|
139
|
+
"fullName": "ClassName.methodName",
|
|
140
|
+
"kind": "method|property|field|constant|constructor|enumValue|function|variable|type",
|
|
141
|
+
"isStatic": false,
|
|
142
|
+
"signature": "ReturnType methodName(params)",
|
|
143
|
+
"params": [{ "name": "param", "type": "String", "optional": false }],
|
|
144
|
+
"returnType": "void",
|
|
145
|
+
"description": "/// 文档注释内容",
|
|
146
|
+
"source": "./lib/src/xxx.dart",
|
|
147
|
+
"startLine": 42
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
> 脚本的详细参数说明、输出字段含义、常见问题排查参见 [脚本使用参考](references/SCRIPT_REFERENCE.md)
|
|
154
|
+
|
|
155
|
+
### 2.2 验证提取结果
|
|
156
|
+
|
|
157
|
+
检查脚本输出的 JSON:
|
|
158
|
+
- 确认 `libraryName` 正确(来自 `pubspec.yaml` 的 `name` 字段)
|
|
159
|
+
- 确认 `sources` 列表非空(至少包含入口文件)
|
|
160
|
+
- 确认 `interfaces` 数组非空(至少有 1 个接口)
|
|
161
|
+
- 若 `interfaces` 为空,检查入口文件是否正确定位(参见 [脚本使用参考](references/SCRIPT_REFERENCE.md) 的故障排查章节)
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Phase 3:脚本渲染接口文档
|
|
166
|
+
|
|
167
|
+
### 3.1 运行渲染脚本
|
|
168
|
+
|
|
169
|
+
使用共享脚本将 JSON 渲染为 Markdown 文档:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-render-spec-doc.cjs" --spec <outputDir>/interface-spec.json --output <outputDir>/接口规格说明.md
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**也可以一步到位**(跳过 Phase 2 的 JSON 输出,直接从源码生成文档):
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-render-spec-doc.cjs" --libroot <analysisRoot> --output <outputDir>/接口规格说明.md
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
> 推荐使用两步方式(先提取 JSON 再渲染),JSON 中间件可复用于下游覆盖率分析。
|
|
182
|
+
|
|
183
|
+
### 3.2 渲染脚本生成的文档结构
|
|
184
|
+
|
|
185
|
+
脚本自动生成以下章节:
|
|
186
|
+
- **基本信息**:库名、入口文件、生成时间、源文件数
|
|
187
|
+
- **接口统计**:类/接口/枚举总数、方法/属性/字段/常量数量
|
|
188
|
+
- **按类分组的接口详情**:每个类/枚举/mixin/extension一个章节,含构造函数、方法、属性、字段、常量、枚举值、函数、变量、类型别名、事件方法汇总等子表格
|
|
189
|
+
- **源文件列表**:所有被分析的源文件路径
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Phase 4:AI 审查与补充
|
|
194
|
+
|
|
195
|
+
> 脚本已自动完成接口提取和文档渲染,AI 在此阶段负责补充脚本无法提取的内容。
|
|
196
|
+
|
|
197
|
+
### 4.1 读取 README 补充概述
|
|
198
|
+
|
|
199
|
+
读取库的 `README.md`,提取:
|
|
200
|
+
- 库的功能描述和主要特性
|
|
201
|
+
- 适用场景和使用限制
|
|
202
|
+
|
|
203
|
+
将概述信息补充到文档开头(脚本生成的"基本信息"表格之后)。
|
|
204
|
+
|
|
205
|
+
### 4.2 补充注意事项
|
|
206
|
+
|
|
207
|
+
从 README 和代码注释中提取:
|
|
208
|
+
- 使用限制和兼容性说明
|
|
209
|
+
- 已知问题和注意事项
|
|
210
|
+
- 平台支持情况(特别是鸿蒙 `ohos` 平台适配状态)
|
|
211
|
+
|
|
212
|
+
### 4.3 审查接口完整性
|
|
213
|
+
|
|
214
|
+
对比脚本输出的接口列表与 README 中提到的 API:
|
|
215
|
+
- 确认主要 API 均已被脚本提取
|
|
216
|
+
- 若发现遗漏(如脚本正则无法覆盖的特殊语法),手动补充到文档中
|
|
217
|
+
|
|
218
|
+
### 4.4 人工可读性优化
|
|
219
|
+
|
|
220
|
+
- 为缺少 `///` 文档注释的接口补充功能描述(根据方法名推断,标注"待确认")
|
|
221
|
+
- 合并或调整表格顺序,提升可读性
|
|
222
|
+
|
|
223
|
+
> 文档输出格式模板参见 [文档模板](references/TEMPLATE.md)
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Phase 5:最终文档输出
|
|
228
|
+
|
|
229
|
+
### 5.1 合并最终文档
|
|
230
|
+
|
|
231
|
+
将脚本生成的接口规格文档(Phase 3)与 AI 补充内容(Phase 4)合并为最终文档。
|
|
232
|
+
|
|
233
|
+
最终文档结构:
|
|
234
|
+
```markdown
|
|
235
|
+
# [库名] 接口规格说明书
|
|
236
|
+
|
|
237
|
+
## 基本信息 ← 脚本生成
|
|
238
|
+
## 三方库概述 ← AI 从 README 补充
|
|
239
|
+
## 接口统计 ← 脚本生成
|
|
240
|
+
## [类名] 接口详情 ← 脚本生成(每个类一个章节)
|
|
241
|
+
### 构造函数
|
|
242
|
+
### 方法
|
|
243
|
+
### 属性
|
|
244
|
+
### 字段
|
|
245
|
+
### 常量
|
|
246
|
+
### 枚举值
|
|
247
|
+
...
|
|
248
|
+
## 源文件列表 ← 脚本生成
|
|
249
|
+
## 注意事项 ← AI 补充
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### 5.2 保存文档
|
|
253
|
+
|
|
254
|
+
将最终文档保存为:`<outputDir>/接口规格说明.md`
|
|
255
|
+
|
|
256
|
+
**禁止**将文档放置在 source 目录或其他子目录,必须放在输出目录根目录。
|
|
257
|
+
|
|
258
|
+
### 5.3 保留中间件
|
|
259
|
+
|
|
260
|
+
保留 `<outputDir>/interface-spec.json` 中间件,可供下游覆盖率分析(Demo 覆盖率、XTS 测试覆盖率)复用。
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 工具支持
|
|
265
|
+
|
|
266
|
+
### 核心脚本
|
|
267
|
+
|
|
268
|
+
| 脚本 | 用途 | 调用方式 |
|
|
269
|
+
|------|------|----------|
|
|
270
|
+
| `flutter-extract-interfaces.cjs` | 从 Dart 源码提取接口规格 JSON | `node "{{skillDir}}/../../../MCP/scripts/flutter-extract-interfaces.cjs" --repoDir <路径> --output <json路径>` |
|
|
271
|
+
| `flutter-render-spec-doc.cjs` | 将 JSON 渲染为 Markdown 文档 | `node "{{skillDir}}/../../../MCP/scripts/flutter-render-spec-doc.cjs" --spec <json路径> --output <md路径>` |
|
|
272
|
+
|
|
273
|
+
> 脚本位于 `MCP/scripts/`(本 SKILL 不保存副本),详细参数、输出格式、故障排查参见 [脚本使用参考](references/SCRIPT_REFERENCE.md)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 分析示例
|
|
278
|
+
|
|
279
|
+
详细的分析示例(含脚本输出演示)请参考 [分析示例](references/EXAMPLES.md)。
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## 注意事项
|
|
284
|
+
|
|
285
|
+
1. **脚本优先**:接口提取由 `flutter-extract-interfaces.cjs` 自动完成,AI 不手动逐文件读取源码提取接口
|
|
286
|
+
2. **只分析公开接口**:脚本自动过滤 `_` 前缀私有成员和 export hide/show,确保只输出对外公开的接口
|
|
287
|
+
3. **忠实于源码**:所有接口信息来自脚本解析实际源码,不允许推断或捏造;`description` 字段为空时使用 `-` 表示
|
|
288
|
+
4. **monorepo 支持**:脚本自动检测 monorepo 结构(如 `flutter_inappwebview` 含多个子包),无需手动指定主包
|
|
289
|
+
5. **export 链追踪**:脚本递归追踪 `export` 语句,支持 `src/` 相对路径和 `package:` 跨包路径,支持 hide/show 过滤
|
|
290
|
+
6. **JSON 中间件复用**:`interface-spec.json` 可供下游覆盖率分析脚本复用,避免重复解析源码
|
|
291
|
+
7. **文档输出位置**:最终文档必须保存在 `<outputDir>/接口规格说明.md`,不得放在 source 目录内
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# 分析示例
|
|
2
|
+
|
|
3
|
+
本文档包含两部分:**Dart 导出语法速查**,以及**基于脚本的分析示例**。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 附录:Dart 导出语法速查
|
|
8
|
+
|
|
9
|
+
### Dart / Flutter
|
|
10
|
+
|
|
11
|
+
```dart
|
|
12
|
+
// 库声明
|
|
13
|
+
library my_package;
|
|
14
|
+
|
|
15
|
+
// 导出其他文件
|
|
16
|
+
export 'src/my_class.dart';
|
|
17
|
+
export 'src/utils.dart' show usefulFunction; // 只导出指定名称
|
|
18
|
+
export 'src/internal.dart' hide internalHelper; // 导出除指定名称外的所有
|
|
19
|
+
export 'package:other_lib/api.dart'; // 跨包导出
|
|
20
|
+
|
|
21
|
+
// 直接在文件中定义的导出
|
|
22
|
+
class ClassName { ... }
|
|
23
|
+
enum EnumName { value1, value2 }
|
|
24
|
+
mixin MixinName { ... }
|
|
25
|
+
extension StringExtension on String { ... }
|
|
26
|
+
typedef Callback = void Function(int);
|
|
27
|
+
|
|
28
|
+
// 顶层函数和变量
|
|
29
|
+
ReturnType functionName(ParamType param) { ... }
|
|
30
|
+
const int MAX_VALUE = 100;
|
|
31
|
+
final String defaultName = 'unknown';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 私有成员(脚本自动过滤)
|
|
35
|
+
|
|
36
|
+
```dart
|
|
37
|
+
// 以下成员以 _ 开头,被视为私有,脚本自动排除
|
|
38
|
+
class _InternalClass { ... }
|
|
39
|
+
void _privateFunction() { ... }
|
|
40
|
+
String _privateField;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 示例 1: 分析 Flutter 三方库(脚本驱动)
|
|
46
|
+
|
|
47
|
+
### 库结构
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
advertising_id/
|
|
51
|
+
├── pubspec.yaml
|
|
52
|
+
├── README.md
|
|
53
|
+
└── lib/
|
|
54
|
+
├── advertising_id.dart ← 入口文件
|
|
55
|
+
└── src/
|
|
56
|
+
└── advertising_id.dart
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### pubspec.yaml
|
|
60
|
+
```yaml
|
|
61
|
+
name: advertising_id
|
|
62
|
+
description: A Flutter plugin for accessing advertising ID.
|
|
63
|
+
version: 1.0.0
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### lib/advertising_id.dart
|
|
67
|
+
```dart
|
|
68
|
+
/// 获取广告标识符的 Flutter 插件
|
|
69
|
+
library advertising_id;
|
|
70
|
+
|
|
71
|
+
export 'src/advertising_id.dart';
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### lib/src/advertising_id.dart
|
|
75
|
+
```dart
|
|
76
|
+
/// 广告标识符工具类
|
|
77
|
+
class AdvertisingId {
|
|
78
|
+
/// 获取广告标识符
|
|
79
|
+
static Future<String?> getAdvertisingId() async {
|
|
80
|
+
// implementation
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// 检查广告追踪是否受限
|
|
85
|
+
static Future<bool> isLimitAdTrackingEnabled() async {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 执行步骤
|
|
92
|
+
|
|
93
|
+
#### Phase 2: 运行提取脚本
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-extract-interfaces.cjs" \
|
|
97
|
+
--repoDir /path/to/advertising_id \
|
|
98
|
+
--output /tmp/analysis/advertising_id/interface-spec.json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
脚本输出:
|
|
102
|
+
```
|
|
103
|
+
库源码目录: /path/to/advertising_id
|
|
104
|
+
解析完成: 2 个接口
|
|
105
|
+
库名: advertising_id
|
|
106
|
+
入口文件: ./lib/advertising_id.dart
|
|
107
|
+
源文件数: 2
|
|
108
|
+
类级: 1 | 方法: 2 | 属性: 0 | 字段: 0 | 常量: 0
|
|
109
|
+
输出: /tmp/analysis/advertising_id/interface-spec.json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### 生成的 interface-spec.json(摘要)
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"libraryName": "advertising_id",
|
|
117
|
+
"entryFile": "./lib/advertising_id.dart",
|
|
118
|
+
"summary": {
|
|
119
|
+
"S": 1,
|
|
120
|
+
"N": 2,
|
|
121
|
+
"methods": 2
|
|
122
|
+
},
|
|
123
|
+
"sources": [
|
|
124
|
+
"./lib/advertising_id.dart",
|
|
125
|
+
"./lib/src/advertising_id.dart"
|
|
126
|
+
],
|
|
127
|
+
"interfaces": [
|
|
128
|
+
{
|
|
129
|
+
"className": "AdvertisingId",
|
|
130
|
+
"memberName": "getAdvertisingId",
|
|
131
|
+
"fullName": "AdvertisingId.getAdvertisingId",
|
|
132
|
+
"kind": "method",
|
|
133
|
+
"isStatic": true,
|
|
134
|
+
"signature": "static Future<String?> getAdvertisingId()",
|
|
135
|
+
"params": [],
|
|
136
|
+
"returnType": "Future<String?>",
|
|
137
|
+
"description": "获取广告标识符",
|
|
138
|
+
"source": "./lib/src/advertising_id.dart",
|
|
139
|
+
"startLine": 5
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"className": "AdvertisingId",
|
|
143
|
+
"memberName": "isLimitAdTrackingEnabled",
|
|
144
|
+
"fullName": "AdvertisingId.isLimitAdTrackingEnabled",
|
|
145
|
+
"kind": "method",
|
|
146
|
+
"isStatic": true,
|
|
147
|
+
"signature": "static Future<bool> isLimitAdTrackingEnabled()",
|
|
148
|
+
"params": [],
|
|
149
|
+
"returnType": "Future<bool>",
|
|
150
|
+
"description": "检查广告追踪是否受限",
|
|
151
|
+
"source": "./lib/src/advertising_id.dart",
|
|
152
|
+
"startLine": 10
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### Phase 3: 运行渲染脚本
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-render-spec-doc.cjs" \
|
|
162
|
+
--spec /tmp/analysis/advertising_id/interface-spec.json \
|
|
163
|
+
--output /tmp/analysis/advertising_id/接口规格说明.md
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### Phase 4: AI 补充
|
|
167
|
+
|
|
168
|
+
AI 从 README 提取概述,补充到文档开头,并添加注意事项。
|
|
169
|
+
|
|
170
|
+
### 最终文档
|
|
171
|
+
|
|
172
|
+
```markdown
|
|
173
|
+
# advertising_id 接口规格说明书
|
|
174
|
+
|
|
175
|
+
> 本文档由 `flutter-extract-interfaces.cjs` 自动生成,基于 Dart 正则解析引擎。
|
|
176
|
+
|
|
177
|
+
## 基本信息
|
|
178
|
+
|
|
179
|
+
| 属性 | 值 |
|
|
180
|
+
|------|----|
|
|
181
|
+
| 库名 | `advertising_id` |
|
|
182
|
+
| 入口文件 | `./lib/advertising_id.dart` |
|
|
183
|
+
| 源文件数 | 2 |
|
|
184
|
+
|
|
185
|
+
## 三方库概述
|
|
186
|
+
|
|
187
|
+
A Flutter plugin for accessing advertising ID. 提供获取设备广告标识符和检查广告追踪限制状态的能力。
|
|
188
|
+
|
|
189
|
+
## 接口统计
|
|
190
|
+
|
|
191
|
+
| 统计项 | 数量 |
|
|
192
|
+
|--------|------|
|
|
193
|
+
| 类/接口/枚举总数 (S) | 1 |
|
|
194
|
+
| 方法/属性/字段总数 (N) | 2 |
|
|
195
|
+
| 方法数 | 2 |
|
|
196
|
+
|
|
197
|
+
## 1. AdvertisingId
|
|
198
|
+
|
|
199
|
+
> 类型: 类 (class)
|
|
200
|
+
|
|
201
|
+
### 方法
|
|
202
|
+
|
|
203
|
+
| # | 方法名 | 事件 | 静态 | 参数 | 返回类型 | 说明 |
|
|
204
|
+
|---|--------|------|------|------|----------|------|
|
|
205
|
+
| 1 | `getAdvertisingId` | 否 | 是 | | `Future<String?>` | 获取广告标识符 |
|
|
206
|
+
| 2 | `isLimitAdTrackingEnabled` | 否 | 是 | | `Future<bool>` | 检查广告追踪是否受限 |
|
|
207
|
+
|
|
208
|
+
## 源文件列表
|
|
209
|
+
|
|
210
|
+
| # | 文件路径 |
|
|
211
|
+
|---|----------|
|
|
212
|
+
| 1 | `./lib/advertising_id.dart` |
|
|
213
|
+
| 2 | `./lib/src/advertising_id.dart` |
|
|
214
|
+
|
|
215
|
+
## 注意事项
|
|
216
|
+
|
|
217
|
+
- 广告标识符的可用性取决于用户隐私设置和平台支持
|
|
218
|
+
- iOS 上受 ATT(App Tracking Transparency)框架影响
|
|
219
|
+
- 返回 null 表示标识符不可用
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 示例 2: 分析 monorepo 库(flutter_inappwebview)
|
|
225
|
+
|
|
226
|
+
### 库结构
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
flutter_inappwebview/
|
|
230
|
+
├── flutter_inappwebview/ ← 主包
|
|
231
|
+
│ ├── pubspec.yaml
|
|
232
|
+
│ └── lib/
|
|
233
|
+
│ ├── flutter_inappwebview.dart
|
|
234
|
+
│ └── src/
|
|
235
|
+
├── flutter_inappwebview_platform_interface/ ← 子包
|
|
236
|
+
│ ├── pubspec.yaml
|
|
237
|
+
│ └── lib/
|
|
238
|
+
└── flutter_inappwebview_android/
|
|
239
|
+
└── lib/
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 执行命令
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# 脚本自动检测 monorepo 主包
|
|
246
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-extract-interfaces.cjs" \
|
|
247
|
+
--repoDir /path/to/flutter_inappwebview \
|
|
248
|
+
--output /tmp/analysis/inappwebview/interface-spec.json
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
脚本自动完成:
|
|
252
|
+
1. 检测 monorepo 结构,定位主包 `flutter_inappwebview/`
|
|
253
|
+
2. 从入口文件追踪 `export 'package:flutter_inappwebview_platform_interface/...'` 跨包导出
|
|
254
|
+
3. 递归收集主包和 `flutter_inappwebview_platform_interface` 子包的所有源文件
|
|
255
|
+
4. 排除 `_android`/`_ios` 等平台辅助包
|
|
256
|
+
|
|
257
|
+
### 一步到位模式
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# 直接从源码提取并渲染文档(不保留 JSON 中间件)
|
|
261
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-render-spec-doc.cjs" \
|
|
262
|
+
--libroot /path/to/flutter_inappwebview \
|
|
263
|
+
--output /tmp/analysis/inappwebview/接口规格说明.md
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 示例 3: 从 Git 仓库克隆并分析
|
|
269
|
+
|
|
270
|
+
### 输入
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
https://gitcode.com/openharmony-sig/flutter_inappwebview/tree/br_v6.1.5_ohos_dev
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Phase 1: 解析 URL 并克隆
|
|
277
|
+
|
|
278
|
+
- 仓库地址:`https://gitcode.com/openharmony-sig/flutter_inappwebview.git`
|
|
279
|
+
- 分支:`br_v6.1.5_ohos_dev`
|
|
280
|
+
- 子路径:无
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
git clone https://gitcode.com/openharmony-sig/flutter_inappwebview.git /tmp/analysis/inappwebview/source
|
|
284
|
+
cd /tmp/analysis/inappwebview/source
|
|
285
|
+
git checkout br_v6.1.5_ohos_dev
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
`analysisRoot = /tmp/analysis/inappwebview/source`
|
|
289
|
+
|
|
290
|
+
### Phase 2: 提取接口
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-extract-interfaces.cjs" \
|
|
294
|
+
--repoDir /tmp/analysis/inappwebview/source \
|
|
295
|
+
--output /tmp/analysis/inappwebview/interface-spec.json
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Phase 3: 渲染文档
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
node "{{skillDir}}/../../../MCP/scripts/flutter-render-spec-doc.cjs" \
|
|
302
|
+
--spec /tmp/analysis/inappwebview/interface-spec.json \
|
|
303
|
+
--output /tmp/analysis/inappwebview/接口规格说明.md
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Phase 4: AI 补充
|
|
307
|
+
|
|
308
|
+
读取 README.md 补充概述和注意事项。
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 最佳实践总结
|
|
313
|
+
|
|
314
|
+
### 1. 脚本优先
|
|
315
|
+
|
|
316
|
+
- 接口提取由 `flutter-extract-interfaces.cjs` 自动完成
|
|
317
|
+
- AI 只负责审查补充和文档整合,不手动逐文件读取源码
|
|
318
|
+
- 保留 `interface-spec.json` 中间件供下游覆盖率分析复用
|
|
319
|
+
|
|
320
|
+
### 2. 两步法优于一步法
|
|
321
|
+
|
|
322
|
+
- 先提取 JSON(`flutter-extract-interfaces.cjs`),再渲染文档(`flutter-render-spec-doc.cjs`)
|
|
323
|
+
- JSON 中间件可复用于 Demo 覆盖率分析、XTS 测试覆盖率分析
|
|
324
|
+
- 一步法(`--libroot` 直接渲染)适合快速预览,不适合正式分析
|
|
325
|
+
|
|
326
|
+
### 3. monorepo 处理
|
|
327
|
+
|
|
328
|
+
- 脚本自动检测 monorepo 结构,无需手动指定主包
|
|
329
|
+
- 若自动检测定位错误,直接传入主包路径:`--repoDir /path/to/monorepo/main_package`
|
|
330
|
+
|
|
331
|
+
### 4. AI 补充内容
|
|
332
|
+
|
|
333
|
+
脚本无法提取以下内容,需 AI 补充:
|
|
334
|
+
- README 中的功能概述和使用场景
|
|
335
|
+
- 注意事项、使用限制、兼容性说明
|
|
336
|
+
- 缺少 `///` 文档注释的接口的功能描述(根据方法名推断,标注"待确认")
|