@chongyan/autospec 1.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/LICENSE +21 -0
- package/README.en.md +472 -0
- package/README.md +476 -0
- package/bin/autospec.js +3 -0
- package/knowledge/README.md +144 -0
- package/knowledge/checklists/code.md +182 -0
- package/knowledge/checklists/design.md +196 -0
- package/knowledge/checklists/release.md +70 -0
- package/knowledge/checklists/requirement.md +169 -0
- package/knowledge/checklists/test.md +46 -0
- package/knowledge/config/README.en.md +44 -0
- package/knowledge/config/README.md +44 -0
- package/knowledge/config/role-composition.yaml +98 -0
- package/knowledge/config/role-extensions.yaml +140 -0
- package/knowledge/config/skill-compositions.yaml +142 -0
- package/knowledge/config/team-stage.yaml +95 -0
- package/knowledge/config/team-tasks.yaml +139 -0
- package/knowledge/config/team-triggers.yaml +198 -0
- package/knowledge/config/validation-patterns.yaml +137 -0
- package/knowledge/domain/README.md +115 -0
- package/knowledge/domain/flows/README.md +194 -0
- package/knowledge/domain/glossary.md +143 -0
- package/knowledge/domain/rules.md +138 -0
- package/knowledge/environment/README.en.md +36 -0
- package/knowledge/environment/README.md +87 -0
- package/knowledge/environment/component-knowledge.md +316 -0
- package/knowledge/environment/detection-patterns.yaml +502 -0
- package/knowledge/environment/middleware-knowledge.md +237 -0
- package/knowledge/environment/template-registry.md +321 -0
- package/knowledge/guides/domain-driven-design.md +345 -0
- package/knowledge/guides/knowledge-management.md +369 -0
- package/knowledge/guides/requirement-engineering.md +329 -0
- package/knowledge/guides/stages/ai-effect-evaluator.md +93 -0
- package/knowledge/guides/stages/code-implementer.md +205 -0
- package/knowledge/guides/stages/code-reviewer.md +111 -0
- package/knowledge/guides/stages/consistency-checker.md +177 -0
- package/knowledge/guides/stages/design-planner.md +401 -0
- package/knowledge/guides/stages/design-reviewer.md +83 -0
- package/knowledge/guides/stages/integration-test-runner.md +105 -0
- package/knowledge/guides/stages/release-checker.md +205 -0
- package/knowledge/guides/stages/requirement-analyzer.md +195 -0
- package/knowledge/guides/stages/requirement-reviewer.md +83 -0
- package/knowledge/guides/stages/security-reviewer.md +89 -0
- package/knowledge/guides/stages/test-context-analyzer.md +250 -0
- package/knowledge/guides/stages/test-generator.md +241 -0
- package/knowledge/guides/stages/test-planner.md +183 -0
- package/knowledge/guides/stages/test-reviewer.md +76 -0
- package/knowledge/guides/stages/unit-test-runner.md +83 -0
- package/knowledge/guides/support/ai-agent-analyzer.md +362 -0
- package/knowledge/guides/support/ai-anomaly-analyzer.md +213 -0
- package/knowledge/guides/support/ai-artifact-evaluator.md +192 -0
- package/knowledge/guides/support/ai-capability-analyzer.md +193 -0
- package/knowledge/guides/support/ai-component-analyzer.md +169 -0
- package/knowledge/guides/support/ai-data-validator.md +276 -0
- package/knowledge/guides/support/ai-evaluation-planner.md +374 -0
- package/knowledge/guides/support/ai-path-evaluator.md +274 -0
- package/knowledge/guides/support/ai-pipeline-evaluator.md +219 -0
- package/knowledge/guides/support/ai-rag-analyzer.md +339 -0
- package/knowledge/guides/support/ai-task-assessor.md +418 -0
- package/knowledge/guides/support/ai-test-diagnostics.md +133 -0
- package/knowledge/guides/support/complexity-assessor.md +268 -0
- package/knowledge/guides/support/component-discovery.md +183 -0
- package/knowledge/guides/support/environment-scanner.md +207 -0
- package/knowledge/guides/support/environment-validator.md +207 -0
- package/knowledge/guides/support/knowledge-generator.md +234 -0
- package/knowledge/guides/support/methodology-extractor.md +55 -0
- package/knowledge/guides/support/pipeline-protocol.md +438 -0
- package/knowledge/guides/support/practice-logger.md +359 -0
- package/knowledge/guides/support/scope-inference.md +174 -0
- package/knowledge/guides/support/skill-distiller.md +91 -0
- package/knowledge/guides/support/skill-updater.md +45 -0
- package/knowledge/guides/support/skill-validator.md +72 -0
- package/knowledge/guides/support/team-orchestrator.md +323 -0
- package/knowledge/guides/support/tech-stack-analyzer.md +139 -0
- package/knowledge/guides/support/test-runner.md +254 -0
- package/knowledge/guides/system-design.md +352 -0
- package/knowledge/organization/ai-native-team.md +318 -0
- package/knowledge/organization/team-metrics.md +228 -0
- package/knowledge/principles/constitution.md +134 -0
- package/knowledge/principles/core-principles.md +368 -0
- package/knowledge/principles/design-philosophy.md +877 -0
- package/knowledge/principles/evolution.md +553 -0
- package/knowledge/process/01-requirement.md +113 -0
- package/knowledge/process/02-design.md +123 -0
- package/knowledge/process/03-implementation.md +90 -0
- package/knowledge/process/04-review.md +80 -0
- package/knowledge/process/05-testing.md +90 -0
- package/knowledge/process/06-delivery.md +88 -0
- package/knowledge/process/README.en.md +38 -0
- package/knowledge/process/README.md +48 -0
- package/knowledge/process/ai-sdlc.md +475 -0
- package/knowledge/process/overview.md +319 -0
- package/knowledge/standards/code-review.md +876 -0
- package/knowledge/standards/coding-style.md +940 -0
- package/knowledge/standards/data-consistency.md +1085 -0
- package/knowledge/standards/document-versioning.md +210 -0
- package/knowledge/standards/risk-detection.md +186 -0
- package/knowledge/templates/ai-evaluation.md +150 -0
- package/knowledge/templates/api-design.md +117 -0
- package/knowledge/templates/database-design.md +132 -0
- package/knowledge/templates/domain-driven-design.md +321 -0
- package/knowledge/templates/product-proposal.md +201 -0
- package/knowledge/templates/system-design.md +227 -0
- package/knowledge/templates/task-breakdown.md +107 -0
- package/knowledge/templates/test-case.md +170 -0
- package/package.json +53 -0
- package/plugins/.claude-plugin/plugin.json +134 -0
- package/plugins/agents/roles/ai-engineer.md +129 -0
- package/plugins/agents/roles/backend-engineer.md +165 -0
- package/plugins/agents/roles/ceo.md +94 -0
- package/plugins/agents/roles/data-engineer.md +135 -0
- package/plugins/agents/roles/devops-engineer.md +181 -0
- package/plugins/agents/roles/frontend-engineer.md +129 -0
- package/plugins/agents/roles/product-owner.md +98 -0
- package/plugins/agents/roles/quality-engineer.md +129 -0
- package/plugins/agents/roles/security-engineer.md +180 -0
- package/plugins/agents/roles/tech-lead.md +97 -0
- package/plugins/agents/support/blind-comparator.md +88 -0
- package/plugins/agents/support/consistency-checker.md +103 -0
- package/plugins/agents/support/failure-diagnostician.md +141 -0
- package/plugins/agents/support/independent-reviewer.md +80 -0
- package/plugins/agents/support/safety-auditor.md +121 -0
- package/plugins/agents/support/skill-benchmarker.md +86 -0
- package/plugins/agents/support/skill-forger.md +105 -0
- package/plugins/agents/support/stage-gate-evaluator.md +121 -0
- package/plugins/agents/support/test-coverage-reviewer.md +73 -0
- package/plugins/benchmarks/templates/README.md +44 -0
- package/plugins/benchmarks/templates/commands/explore-template.yaml +48 -0
- package/plugins/benchmarks/templates/pipeline/agile-template.yaml +84 -0
- package/plugins/benchmarks/templates/pipeline/waterfall-template.yaml +106 -0
- package/plugins/benchmarks/templates/skills/requirement-analyzer-template.yaml +48 -0
- package/plugins/commands/README.en.md +96 -0
- package/plugins/commands/README.md +96 -0
- package/plugins/commands/apply.md +191 -0
- package/plugins/commands/archive.md +76 -0
- package/plugins/commands/env-export.md +79 -0
- package/plugins/commands/env-sync.md +640 -0
- package/plugins/commands/env-template.md +223 -0
- package/plugins/commands/env-update.md +264 -0
- package/plugins/commands/env-validate.md +176 -0
- package/plugins/commands/env.md +79 -0
- package/plugins/commands/explore.md +76 -0
- package/plugins/commands/field-evolve.md +536 -0
- package/plugins/commands/memory.md +249 -0
- package/plugins/commands/project-evolve.md +821 -0
- package/plugins/commands/propose.md +93 -0
- package/plugins/commands/review.md +140 -0
- package/plugins/commands/run.md +224 -0
- package/plugins/commands/status.md +62 -0
- package/plugins/commands/validate.md +108 -0
- package/plugins/hooks/README.en.md +56 -0
- package/plugins/hooks/README.md +56 -0
- package/plugins/hooks/ai-project-guard.js +329 -0
- package/plugins/hooks/artifact-evaluation-hook.js +237 -0
- package/plugins/hooks/constitution-guard.js +211 -0
- package/plugins/hooks/environment-autocommit.js +264 -0
- package/plugins/hooks/environment-manager.js +778 -0
- package/plugins/hooks/execution-tracker.js +354 -0
- package/plugins/hooks/frozen-zone-guard.js +140 -0
- package/plugins/hooks/layer1-validator.js +423 -0
- package/plugins/hooks/lib/artifact-evaluator.js +414 -0
- package/plugins/hooks/lib/benchmarks/change-detector.js +390 -0
- package/plugins/hooks/lib/benchmarks/evaluator.js +605 -0
- package/plugins/hooks/lib/benchmarks/integration-example.js +169 -0
- package/plugins/hooks/lib/data-and-ai-detector.js +275 -0
- package/plugins/hooks/lib/detection-pattern-loader.js +865 -0
- package/plugins/hooks/lib/directory-discovery.js +395 -0
- package/plugins/hooks/lib/environment-config-loader.js +341 -0
- package/plugins/hooks/lib/environment-detector.js +553 -0
- package/plugins/hooks/lib/environment-evolver.js +564 -0
- package/plugins/hooks/lib/environment-registry.js +813 -0
- package/plugins/hooks/lib/execution-path.js +427 -0
- package/plugins/hooks/lib/hook-error-recorder.js +245 -0
- package/plugins/hooks/lib/hook-logger.js +538 -0
- package/plugins/hooks/lib/hook-runner.js +97 -0
- package/plugins/hooks/lib/hook-runner.sh +44 -0
- package/plugins/hooks/lib/hook-state-manager.js +480 -0
- package/plugins/hooks/lib/memory-extractor.js +377 -0
- package/plugins/hooks/lib/memory-manager.js +673 -0
- package/plugins/hooks/lib/metrics-analyzer.js +489 -0
- package/plugins/hooks/lib/project-evolution/auto-fixer.js +511 -0
- package/plugins/hooks/lib/project-evolution/memory-manager.js +346 -0
- package/plugins/hooks/lib/project-evolution/pattern-detector.js +476 -0
- package/plugins/hooks/lib/project-evolution/semantic-indexer.js +480 -0
- package/plugins/hooks/lib/project-structure-detector.js +326 -0
- package/plugins/hooks/lib/rollback-tracker.js +346 -0
- package/plugins/hooks/lib/source-code-scanner.js +596 -0
- package/plugins/hooks/lib/technology-stack-detector.js +374 -0
- package/plugins/hooks/lib/test-failure-analyzer.js +375 -0
- package/plugins/hooks/lib/test-failure-fixer.js +268 -0
- package/plugins/hooks/lib/trace-context.js +277 -0
- package/plugins/hooks/lib/validation-patterns.js +415 -0
- package/plugins/hooks/memory-sync.js +171 -0
- package/plugins/hooks/pipeline-observer.js +413 -0
- package/plugins/hooks/scope-sentinel.js +204 -0
- package/plugins/hooks/trace-initialization.js +169 -0
- package/plugins/memory/templates/code-quality.yaml +149 -0
- package/plugins/memory/templates/multi-system.yaml +155 -0
- package/plugins/memory/templates/team-habits.yaml +119 -0
- package/plugins/memory/templates/testing.yaml +121 -0
- package/plugins/skills/README.en.md +47 -0
- package/plugins/skills/README.md +104 -0
- package/plugins/skills/benchmark-executor/README.md +93 -0
- package/plugins/skills/benchmark-executor/SKILL.md +647 -0
- package/plugins/skills/benchmark-generator/SKILL.md +349 -0
- package/plugins/skills/delivery-stage/SKILL.md +203 -0
- package/plugins/skills/design-stage/SKILL.md +216 -0
- package/plugins/skills/evolution-process/SKILL.md +291 -0
- package/plugins/skills/exploration-phase/SKILL.md +133 -0
- package/plugins/skills/implementation-stage/SKILL.md +179 -0
- package/plugins/skills/layer1-validation/SKILL.md +79 -0
- package/plugins/skills/pending-dashboard/SKILL.md +109 -0
- package/plugins/skills/project-evolution/SKILL.md +847 -0
- package/plugins/skills/requirement-stage/SKILL.md +183 -0
- package/plugins/skills/skill-forge/SKILL.md +223 -0
- package/plugins/skills/skill-forge/references/description-guide.md +92 -0
- package/plugins/skills/skill-forge/references/quality-rubric.md +104 -0
- package/plugins/skills/skill-forge/references/skill-template.md +106 -0
- package/plugins/skills/startup-guard/SKILL.md +38 -0
- package/plugins/skills/testing-stage/SKILL.md +195 -0
- package/scripts/cli/global-init.js +288 -0
- package/scripts/cli/global.js +324 -0
- package/scripts/cli/index.js +55 -0
- package/scripts/cli/init.js +382 -0
- package/scripts/cli/list.js +69 -0
- package/scripts/cli/org.js +340 -0
- package/scripts/cli/update.js +44 -0
- package/scripts/config/commands.config.js +145 -0
- package/scripts/config/hooks.config.js +197 -0
- package/scripts/evolution/evolution-router.js +273 -0
- package/scripts/evolution/evolution-signal-collector.js +307 -0
- package/scripts/evolution/knowledge-loader.js +346 -0
- package/scripts/evolution/marketplace.js +317 -0
- package/scripts/evolution/version-manager.js +371 -0
- package/scripts/install/agents.js +106 -0
- package/scripts/install/commands.js +133 -0
- package/scripts/install/constants.js +424 -0
- package/scripts/install/hook-logger.js +536 -0
- package/scripts/install/hooks.js +110 -0
- package/scripts/install/index.js +39 -0
- package/scripts/install/skills.js +95 -0
- package/scripts/postinstall.js +25 -0
- package/scripts/state.js +376 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# AutoSpec Memory Template - Team Habits
|
|
2
|
+
# 团队习惯学习记忆模板
|
|
3
|
+
|
|
4
|
+
version: "1.0"
|
|
5
|
+
memory:
|
|
6
|
+
id: "template-team-habits"
|
|
7
|
+
name: "团队习惯学习模板"
|
|
8
|
+
description: "学习团队编码习惯和偏好"
|
|
9
|
+
category: "team-habits"
|
|
10
|
+
|
|
11
|
+
# 此模板主要用于学习,而非硬性规则
|
|
12
|
+
type: "learning"
|
|
13
|
+
|
|
14
|
+
# 习惯维度
|
|
15
|
+
habit_dimensions:
|
|
16
|
+
# 维度1: 代码风格
|
|
17
|
+
- id: "code-style"
|
|
18
|
+
name: "代码风格偏好"
|
|
19
|
+
description: "团队代码风格习惯"
|
|
20
|
+
|
|
21
|
+
observations:
|
|
22
|
+
- aspect: "indentation"
|
|
23
|
+
options: ["2-spaces", "4-spaces", "tab"]
|
|
24
|
+
detection: "analyze-existing-code"
|
|
25
|
+
|
|
26
|
+
- aspect: "quotes"
|
|
27
|
+
options: ["single", "double"]
|
|
28
|
+
detection: "analyze-existing-code"
|
|
29
|
+
|
|
30
|
+
- aspect: "semicolons"
|
|
31
|
+
options: ["always", "never"]
|
|
32
|
+
detection: "analyze-existing-code"
|
|
33
|
+
|
|
34
|
+
- aspect: "trailing-commas"
|
|
35
|
+
options: ["always", "never", "es5"]
|
|
36
|
+
detection: "analyze-existing-code"
|
|
37
|
+
|
|
38
|
+
# 维度2: 命名偏好
|
|
39
|
+
- id: "naming"
|
|
40
|
+
name: "命名偏好"
|
|
41
|
+
description: "团队命名习惯"
|
|
42
|
+
|
|
43
|
+
observations:
|
|
44
|
+
- aspect: "boolean-prefix"
|
|
45
|
+
options: ["is-", "has-", "can-", "should-", "no-prefix"]
|
|
46
|
+
examples: ["isActive", "hasPermission"]
|
|
47
|
+
|
|
48
|
+
- aspect: "collection-suffix"
|
|
49
|
+
options: ["-list", "-array", "-collection", "plural", "no-suffix"]
|
|
50
|
+
examples: ["userList", "users"]
|
|
51
|
+
|
|
52
|
+
- aspect: "abbreviation"
|
|
53
|
+
options: ["full-words", "common-abbrev", "any-abbrev"]
|
|
54
|
+
examples: ["configuration" vs "config"]
|
|
55
|
+
|
|
56
|
+
# 维度3: 架构偏好
|
|
57
|
+
- id: "architecture"
|
|
58
|
+
name: "架构偏好"
|
|
59
|
+
description: "团队架构设计习惯"
|
|
60
|
+
|
|
61
|
+
observations:
|
|
62
|
+
- aspect: "function-style"
|
|
63
|
+
options: ["arrow-functions", "function-declaration", "mixed"]
|
|
64
|
+
|
|
65
|
+
- aspect: "class-usage"
|
|
66
|
+
options: ["classes", "functions-only", "mixed"]
|
|
67
|
+
|
|
68
|
+
- aspect: "type-strictness"
|
|
69
|
+
options: ["strict", "moderate", "loose"]
|
|
70
|
+
|
|
71
|
+
# 维度4: 自动化接受度
|
|
72
|
+
- id: "automation"
|
|
73
|
+
name: "自动化接受度"
|
|
74
|
+
description: "团队对自动化的接受程度"
|
|
75
|
+
|
|
76
|
+
observations:
|
|
77
|
+
- aspect: "auto-fix-acceptance"
|
|
78
|
+
detection: "track-suggestion-acceptance-rate"
|
|
79
|
+
|
|
80
|
+
- aspect: "preferred-notification"
|
|
81
|
+
options: ["immediate", "daily-summary", "weekly-summary", "on-demand"]
|
|
82
|
+
|
|
83
|
+
- aspect: "confirmation-threshold"
|
|
84
|
+
description: "什么级别的修改需要确认"
|
|
85
|
+
options: ["all", "non-trivial", "high-impact-only", "none"]
|
|
86
|
+
|
|
87
|
+
# 学习机制
|
|
88
|
+
learning:
|
|
89
|
+
# 观察周期
|
|
90
|
+
observation_period_days: 14
|
|
91
|
+
|
|
92
|
+
# 学习来源
|
|
93
|
+
sources:
|
|
94
|
+
- "existing-codebase"
|
|
95
|
+
- "manual-changes"
|
|
96
|
+
- "feedback-explicit"
|
|
97
|
+
- "feedback-implicit"
|
|
98
|
+
|
|
99
|
+
# 置信度阈值
|
|
100
|
+
confidence_threshold: 0.8
|
|
101
|
+
|
|
102
|
+
# 应用方式
|
|
103
|
+
application:
|
|
104
|
+
- "adjust-rule-weights"
|
|
105
|
+
- "prioritize-suggestions"
|
|
106
|
+
- "customize-auto-fixes"
|
|
107
|
+
- "filter-noise"
|
|
108
|
+
|
|
109
|
+
# 反馈收集
|
|
110
|
+
feedback:
|
|
111
|
+
explicit:
|
|
112
|
+
- "rating-suggestions"
|
|
113
|
+
- "accept-reject-tracking"
|
|
114
|
+
- "custom-rule-requests"
|
|
115
|
+
|
|
116
|
+
implicit:
|
|
117
|
+
- "suggestion-acceptance-rate"
|
|
118
|
+
- "time-to-accept"
|
|
119
|
+
- "manual-override-patterns"
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# AutoSpec Memory Template - Testing
|
|
2
|
+
# 测试体系评测记忆模板
|
|
3
|
+
|
|
4
|
+
version: "1.0"
|
|
5
|
+
memory:
|
|
6
|
+
id: "template-testing"
|
|
7
|
+
name: "测试体系评测模板"
|
|
8
|
+
description: "测试覆盖率、质量、稳定性评测"
|
|
9
|
+
category: "testing"
|
|
10
|
+
|
|
11
|
+
rules:
|
|
12
|
+
# 规则1: 测试覆盖率缺口
|
|
13
|
+
- id: "coverage-gap"
|
|
14
|
+
name: "测试覆盖率缺口"
|
|
15
|
+
description: "识别变更频繁但测试覆盖低的代码"
|
|
16
|
+
severity: "warning"
|
|
17
|
+
|
|
18
|
+
detection:
|
|
19
|
+
type: "coverage-analysis"
|
|
20
|
+
thresholds:
|
|
21
|
+
line_coverage: 80
|
|
22
|
+
branch_coverage: 70
|
|
23
|
+
function_coverage: 80
|
|
24
|
+
|
|
25
|
+
# 重点关注:变更频繁 + 覆盖低
|
|
26
|
+
hot_spot_analysis:
|
|
27
|
+
min_change_frequency: 3 # 过去30天变更次数
|
|
28
|
+
max_coverage: 60
|
|
29
|
+
|
|
30
|
+
fixes:
|
|
31
|
+
- type: "suggest"
|
|
32
|
+
description: "生成缺失测试模板"
|
|
33
|
+
action: "generate-test-template"
|
|
34
|
+
|
|
35
|
+
# 规则2: 边界测试
|
|
36
|
+
- id: "boundary-testing"
|
|
37
|
+
name: "边界条件测试"
|
|
38
|
+
description: "检查是否缺少边界条件测试"
|
|
39
|
+
severity: "warning"
|
|
40
|
+
|
|
41
|
+
detection:
|
|
42
|
+
type: "boundary-analysis"
|
|
43
|
+
patterns:
|
|
44
|
+
- "array-index-without-bound-check"
|
|
45
|
+
- "division-without-zero-check"
|
|
46
|
+
- "null-check-missing"
|
|
47
|
+
- "empty-string-not-tested"
|
|
48
|
+
|
|
49
|
+
fixes:
|
|
50
|
+
- type: "suggest"
|
|
51
|
+
description: "建议边界测试用例"
|
|
52
|
+
action: "suggest-boundary-tests"
|
|
53
|
+
|
|
54
|
+
# 规则3: Flaky Test检测
|
|
55
|
+
- id: "flaky-test"
|
|
56
|
+
name: "不稳定测试检测"
|
|
57
|
+
description: "检测执行不稳定的测试"
|
|
58
|
+
severity: "error"
|
|
59
|
+
|
|
60
|
+
detection:
|
|
61
|
+
type: "test-history"
|
|
62
|
+
criteria:
|
|
63
|
+
min_runs: 10
|
|
64
|
+
max_failure_rate: 0.1
|
|
65
|
+
max_duration_variance: 0.5
|
|
66
|
+
|
|
67
|
+
fixes:
|
|
68
|
+
- type: "suggest"
|
|
69
|
+
description: "分析不稳定原因并建议修复"
|
|
70
|
+
action: "analyze-flaky-cause"
|
|
71
|
+
|
|
72
|
+
# 规则4: Mock使用
|
|
73
|
+
- id: "mock-usage"
|
|
74
|
+
name: "Mock使用检查"
|
|
75
|
+
description: "检查Mock使用是否恰当"
|
|
76
|
+
severity: "info"
|
|
77
|
+
|
|
78
|
+
detection:
|
|
79
|
+
type: "mock-analysis"
|
|
80
|
+
checks:
|
|
81
|
+
- "mocking-internal-functions" # 不应该Mock内部函数
|
|
82
|
+
- "incomplete-mock" # Mock不完整
|
|
83
|
+
- "over-mocking" # 过度Mock
|
|
84
|
+
|
|
85
|
+
fixes:
|
|
86
|
+
- type: "suggest"
|
|
87
|
+
description: "建议Mock改进方案"
|
|
88
|
+
action: "suggest-mock-improvement"
|
|
89
|
+
|
|
90
|
+
# 规则5: 测试数据
|
|
91
|
+
- id: "test-data"
|
|
92
|
+
name: "测试数据管理"
|
|
93
|
+
description: "检查测试数据管理是否规范"
|
|
94
|
+
severity: "info"
|
|
95
|
+
|
|
96
|
+
detection:
|
|
97
|
+
type: "test-data-analysis"
|
|
98
|
+
checks:
|
|
99
|
+
- "hardcoded-test-data"
|
|
100
|
+
- "missing-test-fixtures"
|
|
101
|
+
- "inconsistent-test-data"
|
|
102
|
+
|
|
103
|
+
fixes:
|
|
104
|
+
- type: "auto"
|
|
105
|
+
description: "提取测试数据到fixtures"
|
|
106
|
+
action: "extract-test-fixtures"
|
|
107
|
+
|
|
108
|
+
execution:
|
|
109
|
+
order:
|
|
110
|
+
- "flaky-test" # 优先处理不稳定测试
|
|
111
|
+
- "coverage-gap"
|
|
112
|
+
- "boundary-testing"
|
|
113
|
+
- "mock-usage"
|
|
114
|
+
- "test-data"
|
|
115
|
+
|
|
116
|
+
conditions:
|
|
117
|
+
- "test-pass"
|
|
118
|
+
|
|
119
|
+
on_failure:
|
|
120
|
+
action: "report"
|
|
121
|
+
notify: true
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Skills Template Directory
|
|
2
|
+
|
|
3
|
+
This directory contains template definitions for all Skills, which are copied to `.claude/skills/` during `autospec init`.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
skills/
|
|
9
|
+
├── startup-guard/
|
|
10
|
+
│ └── SKILL.md # Startup gate (auto-triggered)
|
|
11
|
+
├── layer1-validation/
|
|
12
|
+
│ └── SKILL.md # Layer 1 validation (auto-triggered)
|
|
13
|
+
├── requirement-stage/
|
|
14
|
+
│ └── SKILL.md # Requirement analysis stage
|
|
15
|
+
├── design-stage/
|
|
16
|
+
│ └── SKILL.md # Design planning stage
|
|
17
|
+
├── implementation-stage/
|
|
18
|
+
│ └── SKILL.md # Code implementation stage
|
|
19
|
+
├── testing-stage/
|
|
20
|
+
│ └── SKILL.md # QA testing stage
|
|
21
|
+
├── delivery-stage/
|
|
22
|
+
│ └── SKILL.md # Delivery and deployment stage
|
|
23
|
+
├── evolution-process/
|
|
24
|
+
│ └── SKILL.md # Self-evolution (auto-triggered)
|
|
25
|
+
├── pending-dashboard/
|
|
26
|
+
│ └── SKILL.md # Pending dashboard (session startup trigger)
|
|
27
|
+
└── README.md # This file
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Skill Categories
|
|
31
|
+
|
|
32
|
+
**Auto-triggered**:
|
|
33
|
+
- `startup-guard`: Auto-triggered when development task detected
|
|
34
|
+
- `layer1-validation`: Auto-triggered after code changes
|
|
35
|
+
- `evolution-process`: Auto-triggered after pipeline completion
|
|
36
|
+
- `pending-dashboard`: Auto-triggered on session startup
|
|
37
|
+
|
|
38
|
+
**Stage-based**:
|
|
39
|
+
- `requirement-stage`: Requirement analysis stage
|
|
40
|
+
- `design-stage`: Design planning stage
|
|
41
|
+
- `implementation-stage`: Code implementation stage
|
|
42
|
+
- `testing-stage`: QA testing stage
|
|
43
|
+
- `delivery-stage`: Delivery and deployment stage
|
|
44
|
+
|
|
45
|
+
## Variable Substitution
|
|
46
|
+
|
|
47
|
+
The `${KNOWLEDGE}` variable in templates is replaced with `.autospec/knowledge` during copying.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Skills 模板目录
|
|
2
|
+
|
|
3
|
+
本目录包含所有 Skill 技能的模板定义,在 `autospec init` 时复制到 `.claude/skills/` 目录。
|
|
4
|
+
|
|
5
|
+
## 人类-[skills]-创业团队-skills-领域知识分层
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
9
|
+
│ 人类维护层 (Human-maintained) │
|
|
10
|
+
│ ../knowledge/domain/ - 业务知识(术语、规则、流程) │
|
|
11
|
+
│ 由领域专家维护,AI 读取但不修改 │
|
|
12
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
13
|
+
↓ 驱动
|
|
14
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
15
|
+
│ 创业团队 Skills (AI Agent Roles) │
|
|
16
|
+
│ ../agents/roles/ - CEO、产品负责人、技术负责人、工程师等 │
|
|
17
|
+
│ 模拟创业团队对抗审查,多视角审视产出 │
|
|
18
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
19
|
+
↓ 执行
|
|
20
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
21
|
+
│ 阶段 Skills (Stage Skills) │
|
|
22
|
+
│ 本目录 *-stage/ - 需求分析、方案设计、编码实现等阶段技能 │
|
|
23
|
+
│ 驱动各阶段执行,产出标准化产物 │
|
|
24
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
25
|
+
↓ 支撑
|
|
26
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
27
|
+
│ 领域知识/规范分层 (Knowledge & Standards) │
|
|
28
|
+
│ ../knowledge/ - 原则、流程、指南、检查清单 │
|
|
29
|
+
│ 按冻结区/受控区/自由区分层管理 │
|
|
30
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 目录结构
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
skills/
|
|
37
|
+
├── startup-guard/
|
|
38
|
+
│ └── SKILL.md # 启动门禁(自动触发)
|
|
39
|
+
├── layer1-validation/
|
|
40
|
+
│ └── SKILL.md # Layer 1 验证(自动触发)
|
|
41
|
+
├── requirement-stage/
|
|
42
|
+
│ └── SKILL.md # 需求分析阶段(含 Benchmarks 评测)
|
|
43
|
+
├── design-stage/
|
|
44
|
+
│ └── SKILL.md # 方案设计阶段(含 Benchmarks 评测)
|
|
45
|
+
├── implementation-stage/
|
|
46
|
+
│ └── SKILL.md # 编码实现阶段(含 Benchmarks 评测)
|
|
47
|
+
├── testing-stage/
|
|
48
|
+
│ └── SKILL.md # QA测试阶段(含 Benchmarks 评测)
|
|
49
|
+
├── delivery-stage/
|
|
50
|
+
│ └── SKILL.md # 交付部署阶段
|
|
51
|
+
├── evolution-process/
|
|
52
|
+
│ └── SKILL.md # 自进化(自动触发)- L2 Field-Evolve
|
|
53
|
+
├── project-evolution/
|
|
54
|
+
│ └── SKILL.md # 项目进化 - L3 Project-Evolve
|
|
55
|
+
├── benchmark-generator/
|
|
56
|
+
│ ├── SKILL.md # Benchmarks 自动生成
|
|
57
|
+
│ └── README.md # 使用文档
|
|
58
|
+
├── benchmark-executor/
|
|
59
|
+
│ ├── SKILL.md # Benchmarks 执行评测
|
|
60
|
+
│ └── README.md # 使用文档
|
|
61
|
+
├── skill-forge/
|
|
62
|
+
│ ├── SKILL.md # 技能锻造系统(蒸馏/迭代/优化)
|
|
63
|
+
│ └── references/ # 参考文档
|
|
64
|
+
├── pending-dashboard/
|
|
65
|
+
│ └── SKILL.md # 待办仪表盘(会话启动触发)
|
|
66
|
+
└── README.md # 本文件
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Skill 分类
|
|
70
|
+
|
|
71
|
+
### 按触发方式分类
|
|
72
|
+
|
|
73
|
+
**自动触发型**:
|
|
74
|
+
- `startup-guard`:检测到开发任务时自动触发
|
|
75
|
+
- `layer1-validation`:代码变更后自动触发
|
|
76
|
+
- `evolution-process`:流程完成后自动触发(L2 Field-Evolve)
|
|
77
|
+
- `pending-dashboard`:会话启动时自动触发
|
|
78
|
+
|
|
79
|
+
**阶段流程型**:
|
|
80
|
+
- `requirement-stage`:需求分析阶段(含 Layer 3 Benchmarks 评测)
|
|
81
|
+
- `design-stage`:方案设计阶段(含 Layer 3 Benchmarks 评测)
|
|
82
|
+
- `implementation-stage`:编码实现阶段(含 Layer 3 Benchmarks 评测)
|
|
83
|
+
- `testing-stage`:QA测试阶段(含 Layer 3 Benchmarks 评测)
|
|
84
|
+
- `delivery-stage`:交付部署阶段
|
|
85
|
+
|
|
86
|
+
**评测驱动型**:
|
|
87
|
+
- `benchmark-generator`:根据项目特点自动生成阶段 benchmarks
|
|
88
|
+
- `benchmark-executor`:执行 benchmarks 评测,生成改进建议
|
|
89
|
+
|
|
90
|
+
**进化支撑型**:
|
|
91
|
+
- `skill-forge`:技能锻造系统(蒸馏新建/迭代进化/Description优化)
|
|
92
|
+
- `project-evolution`:项目自我进化(L3 Project-Evolve)
|
|
93
|
+
|
|
94
|
+
### 按三层自进化体系分类
|
|
95
|
+
|
|
96
|
+
| 层级 | 命令 | Skill |
|
|
97
|
+
|------|------|-------|
|
|
98
|
+
| L1: Self-Evolve | `/self-evolve` | `self-evolve/*`(位于 `.claude/skills/`) |
|
|
99
|
+
| L2: Field-Evolve | `/autospec:field-evolve` | `evolution-process` |
|
|
100
|
+
| L3: Project-Evolve | `/autospec:project-evolve` | `project-evolution` |
|
|
101
|
+
|
|
102
|
+
## 变量替换
|
|
103
|
+
|
|
104
|
+
模板中的 `${KNOWLEDGE}` 变量在复制时会被替换为 `.autospec/knowledge`。
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Benchmarks 执行器
|
|
2
|
+
|
|
3
|
+
实战流程 AI 评测系统的核心执行组件。
|
|
4
|
+
|
|
5
|
+
## 定位
|
|
6
|
+
|
|
7
|
+
在 AutoSpec 实战流程各阶段中执行 benchmarks 评测,对比实际产出与预期标准,生成评测报告指导优化迭代。
|
|
8
|
+
|
|
9
|
+
## 核心组件
|
|
10
|
+
|
|
11
|
+
### 1. BenchmarkEvaluator
|
|
12
|
+
|
|
13
|
+
负责加载 benchmarks 配置,执行评测,计算评分,生成报告。
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
const evaluator = new BenchmarkEvaluator(projectRoot);
|
|
17
|
+
evaluator.init();
|
|
18
|
+
|
|
19
|
+
// 执行评测
|
|
20
|
+
const report = await evaluator.evaluate('design');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. ChangeDetector
|
|
24
|
+
|
|
25
|
+
负责检测阶段产出物变更,自动触发重新评测。
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
const detector = new ChangeDetector(projectRoot);
|
|
29
|
+
detector.init();
|
|
30
|
+
|
|
31
|
+
// 监听变更
|
|
32
|
+
detector.on('change', (changes) => {
|
|
33
|
+
console.log('检测到变更:', changes);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
detector.watch('design');
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 三层验证体系
|
|
40
|
+
|
|
41
|
+
| 层级 | 验证类型 | 执行方式 | 用途 |
|
|
42
|
+
|------|---------|---------|------|
|
|
43
|
+
| Layer 1 | 确定性验证 | 自动执行 | Schema校验、规则检查、编译测试 |
|
|
44
|
+
| Layer 2 | AI 审查 | Agent 执行 | 质量评估、一致性检查、深度分析 |
|
|
45
|
+
| Layer 3 | Benchmarks 评测 | 自动+AI | 综合评分、改进建议、准出门禁 |
|
|
46
|
+
|
|
47
|
+
## 与阶段技能的集成
|
|
48
|
+
|
|
49
|
+
每个阶段技能在验证部分增加 Layer 3 Benchmarks 评测:
|
|
50
|
+
|
|
51
|
+
- **requirement-stage**: REQ-001~003 需求完整性评测
|
|
52
|
+
- **design-stage**: DES-001~004 设计规范性评测
|
|
53
|
+
- **implementation-stage**: IMP-001~003 代码质量评测
|
|
54
|
+
- **testing-stage**: TST-001~003 测试充分性评测
|
|
55
|
+
|
|
56
|
+
## 触发方式
|
|
57
|
+
|
|
58
|
+
1. **自动触发**: 阶段产出物生成/变更后自动执行
|
|
59
|
+
2. **手动触发**: `/benchmark --run --stage={stage}`
|
|
60
|
+
3. **定时触发**: CI 集成,提交前/合并前自动执行
|
|
61
|
+
|
|
62
|
+
## 评测结果
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"run_id": "20240326-001",
|
|
67
|
+
"stage": "design",
|
|
68
|
+
"summary": {
|
|
69
|
+
"total": 4,
|
|
70
|
+
"passed": 3,
|
|
71
|
+
"failed": 1,
|
|
72
|
+
"overall_score": 87,
|
|
73
|
+
"grade": "B+"
|
|
74
|
+
},
|
|
75
|
+
"results": [...],
|
|
76
|
+
"recommendations": [...]
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 准出标准
|
|
81
|
+
|
|
82
|
+
- 所有 P0 benchmark 必须通过
|
|
83
|
+
- 综合得分 >= 80
|
|
84
|
+
- 无 critical 级别问题
|
|
85
|
+
|
|
86
|
+
## 改进建议
|
|
87
|
+
|
|
88
|
+
评测未通过时,自动生成:
|
|
89
|
+
- 问题描述
|
|
90
|
+
- 改进建议
|
|
91
|
+
- 参考示例
|
|
92
|
+
- 预计工作量
|
|
93
|
+
- 是否可自动修复
|