agent-skill-doctor 0.1.0
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/CHANGELOG.md +33 -0
- package/LICENSE +21 -0
- package/NOTICE.md +9 -0
- package/README.en.md +275 -0
- package/README.md +275 -0
- package/bin/agent-skill-doctor-phase2.js +250 -0
- package/bin/agent-skill-doctor-phase3.js +215 -0
- package/bin/agent-skill-doctor-risk.js +147 -0
- package/bin/agent-skill-doctor.js +1834 -0
- package/examples/basic-usage.js +113 -0
- package/examples/readme-demo-skills/dangerous-deploy/SKILL.md +14 -0
- package/examples/readme-demo-skills/markdown-reporter-a/SKILL.md +8 -0
- package/examples/readme-demo-skills/markdown-reporter-b/SKILL.md +8 -0
- package/examples/readme-demo-skills/npm-installer/SKILL.md +10 -0
- package/examples/readme-demo-skills/pnpm-installer/SKILL.md +10 -0
- package/package.json +58 -0
- package/rules/default/credential-risk.json +19 -0
- package/rules/default/destructive-risk.json +17 -0
- package/rules/default/shell-network-risk.json +31 -0
- package/src/doctor/conflict.js +139 -0
- package/src/doctor/i18n.js +572 -0
- package/src/doctor/index.js +50 -0
- package/src/doctor/phase2.js +261 -0
- package/src/doctor/risk-lite.js +124 -0
- package/src/doctor/rules.js +57 -0
- package/src/doctor/zombie.js +178 -0
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const en = {
|
|
4
|
+
// CLI messages
|
|
5
|
+
'cli.scanned': 'Scanned %s skills. Phase 1 findings: %s. DB: %s',
|
|
6
|
+
'cli.skills': 'Skills: %s',
|
|
7
|
+
'cli.findings': 'Findings: %s',
|
|
8
|
+
'cli.riskFindings': 'Risk findings: %s',
|
|
9
|
+
'cli.conflictFindings': 'Conflict findings: %s',
|
|
10
|
+
'cli.zombieCandidates': 'Zombie candidates: %s',
|
|
11
|
+
'cli.reportWritten': 'Report written: %s',
|
|
12
|
+
'cli.noFindings': 'No %s findings.',
|
|
13
|
+
'cli.noDuplicateGroups': 'No duplicate groups. Run: agent-skill-doctor diagnose',
|
|
14
|
+
'cli.ignoredFinding': '%s finding: %s',
|
|
15
|
+
'cli.unignoredFinding': '%s finding: %s',
|
|
16
|
+
'cli.noIgnored': 'No ignored findings.',
|
|
17
|
+
'cli.applyRequiresPlan': 'apply requires <plan.json>',
|
|
18
|
+
'cli.dryRunOnly': 'MVP apply only supports --dry-run.',
|
|
19
|
+
'cli.ignoreRequiresId': '%s requires <finding-id>',
|
|
20
|
+
'cli.findingNotFound': 'Finding not found: %s',
|
|
21
|
+
'cli.ignoredListUsage': 'Usage: agent-skill-doctor ignored list',
|
|
22
|
+
|
|
23
|
+
// Report labels
|
|
24
|
+
'report.title': 'Agent Skill Doctor Report',
|
|
25
|
+
'report.summary': 'Summary',
|
|
26
|
+
'report.totalSkills': 'Skill directories',
|
|
27
|
+
'report.scanDirs': 'Scan directories',
|
|
28
|
+
'report.scanSkills': 'Scan skills',
|
|
29
|
+
'report.totalFindings': 'Total issues',
|
|
30
|
+
'report.duplicateGroups': 'Duplicate groups',
|
|
31
|
+
'report.versionDriftFindings': 'Version drift',
|
|
32
|
+
'report.riskFindings': 'Risk findings',
|
|
33
|
+
'report.conflictFindings': 'Conflict findings',
|
|
34
|
+
'report.zombieCandidates': 'Zombie candidates',
|
|
35
|
+
'report.descriptionQualityFindings': 'Description issues',
|
|
36
|
+
'report.duplicateFindings': 'Duplicate findings',
|
|
37
|
+
'report.ignoredFindings': 'Ignored',
|
|
38
|
+
'report.bySeverity': 'By severity',
|
|
39
|
+
'report.byType': 'By type',
|
|
40
|
+
'report.criticalRisks': 'Critical Risks',
|
|
41
|
+
'report.noCriticalRisks': 'No critical risks.',
|
|
42
|
+
'report.duplicateGroupsSection': 'Duplicate Groups',
|
|
43
|
+
'report.noDuplicateGroups': 'No duplicate groups.',
|
|
44
|
+
'report.findings': 'Risk List',
|
|
45
|
+
'report.noFindings': 'No risks found.',
|
|
46
|
+
'report.skills': 'Skills',
|
|
47
|
+
'report.recommendation': 'Recommendation',
|
|
48
|
+
'report.severity': 'Severity',
|
|
49
|
+
'report.type': 'Type',
|
|
50
|
+
'report.name': 'Name',
|
|
51
|
+
'report.description': 'Description',
|
|
52
|
+
'report.id': 'ID',
|
|
53
|
+
'report.detector': 'Detector',
|
|
54
|
+
'report.status': 'Status',
|
|
55
|
+
'report.evidence': 'Evidence',
|
|
56
|
+
|
|
57
|
+
// HTML-specific
|
|
58
|
+
'html.scanOverview': 'Scan Overview',
|
|
59
|
+
'html.scannedDirs': 'Scanned directories',
|
|
60
|
+
'html.skillList': 'Skill List',
|
|
61
|
+
'html.official': 'Official',
|
|
62
|
+
'html.plugin': 'Plugin',
|
|
63
|
+
'html.local': 'Local',
|
|
64
|
+
'html.standalone': 'Standalone',
|
|
65
|
+
'html.thirdParty': 'Third-party',
|
|
66
|
+
'html.unknown': 'Unknown',
|
|
67
|
+
'html.source': 'Source',
|
|
68
|
+
'html.path': 'Path',
|
|
69
|
+
'html.agent': 'Agent',
|
|
70
|
+
'html.noSkills': 'No skills found.',
|
|
71
|
+
'html.emptyRoot': 'No skills found in this directory',
|
|
72
|
+
'html.rootType.global': 'Global',
|
|
73
|
+
'html.rootType.project': 'Project',
|
|
74
|
+
'html.rootType.central': 'Central',
|
|
75
|
+
'agent.claude': 'Claude',
|
|
76
|
+
'agent.codex': 'Codex',
|
|
77
|
+
'agent.cursor': 'Cursor',
|
|
78
|
+
'agent.opencode': 'OpenCode',
|
|
79
|
+
'agent.agent': 'Agent',
|
|
80
|
+
'agent.windsurf': 'Windsurf',
|
|
81
|
+
'agent.aider': 'Aider',
|
|
82
|
+
'agent.continue': 'Continue',
|
|
83
|
+
'agent.cody': 'Cody',
|
|
84
|
+
'agent.copilot': 'Copilot',
|
|
85
|
+
'agent.agents': 'Agents',
|
|
86
|
+
'html.dashboard': 'Dashboard',
|
|
87
|
+
'html.severityChart': 'Severity Distribution',
|
|
88
|
+
'html.typeChart': 'Type Distribution',
|
|
89
|
+
'html.remediationGuide': 'Remediation Guide',
|
|
90
|
+
'html.toggleLang': '中文',
|
|
91
|
+
'html.ignored': 'Ignored',
|
|
92
|
+
'html.generatedAt': 'Generated at',
|
|
93
|
+
'html.copyPrompt': 'Copy',
|
|
94
|
+
'html.copied': 'Copied!',
|
|
95
|
+
'html.viewGuide': 'View fix guide',
|
|
96
|
+
'html.skillsInvolved': 'Skills involved',
|
|
97
|
+
'html.expandDetails': 'Click to expand details',
|
|
98
|
+
'html.collapseDetails': 'Click to collapse',
|
|
99
|
+
|
|
100
|
+
// Guide section headings
|
|
101
|
+
'guide.heading.definition': 'Definition',
|
|
102
|
+
'guide.heading.causes': 'Common Causes',
|
|
103
|
+
'guide.heading.severity': 'Severity',
|
|
104
|
+
'guide.heading.steps': 'Fix Steps',
|
|
105
|
+
'guide.heading.agentPrompt': 'Agent Prompt',
|
|
106
|
+
'guide.heading.agentExample': 'Agent Example',
|
|
107
|
+
'guide.heading.humanSteps': 'Manual Steps',
|
|
108
|
+
'guide.heading.agentOps': 'Agent Operations',
|
|
109
|
+
|
|
110
|
+
// Tooltips - detection criteria
|
|
111
|
+
'tooltip.risk.title': 'Risk Detection (Informational)',
|
|
112
|
+
'tooltip.risk.text': 'Scans skill text for dangerous patterns. These are inherent permissions required by the skill to function — NOT bugs to fix. For example, a file-generation skill naturally needs "overwrite" capability. No remediation needed, only for awareness.',
|
|
113
|
+
'tooltip.duplicate.title': 'Duplicate Detection Criteria',
|
|
114
|
+
'tooltip.duplicate.text': 'Three strategies: 1) Exact duplicate (confidence 1.0): identical content hash. 2) Same source (confidence 0.95): same source URL + subdir + slug. 3) Same name (confidence 0.7): same slug but different content. Groups with 2+ skills are reported.',
|
|
115
|
+
'tooltip.zombie.title': 'Zombie Detection Criteria',
|
|
116
|
+
'tooltip.zombie.text': 'Zombie score (0.0-1.0) based on 6 weighted factors. Score >= 0.4 triggers a finding. Protected: pinned/keep/core/system tags (score 0), official sources like anthropics/openai (score 0), plugin sources like obra/superpowers (score *0.5). Third-party sources get score *0.75.',
|
|
117
|
+
'tooltip.zombie.formula': 'Zombie Score Formula',
|
|
118
|
+
'tooltip.zombie.formulaText': 'Score = presetCount==0 (0.25) + noAgents (0.20) + noProjects (0.20) + noModification (0.15) + noActivityLog (0.15) + lowDescriptionQuality (0.05). Then: official (*0), plugin (*0.5), thirdParty (*0.75). Max = 1.0.',
|
|
119
|
+
'tooltip.conflict.title': 'Conflict Detection Criteria',
|
|
120
|
+
'tooltip.conflict.text': 'Checks if 2+ skills match different alternatives within the same conflict rule. Built-in rules: package manager conflict (npm vs pnpm vs yarn), output format conflict (JSON vs Markdown). Binary detection: conflict exists or not.',
|
|
121
|
+
'tooltip.descriptionQuality.title': 'Description Quality (Informational)',
|
|
122
|
+
'tooltip.descriptionQuality.text': 'Evaluates skill descriptions on 4 dimensions: length, risk mention, usage guidance, and structure. Low scores indicate poor documentation, but this does not affect skill functionality. Can be improved by Agent at low priority.',
|
|
123
|
+
'tooltip.versionDrift.title': 'Version Drift Detection',
|
|
124
|
+
'tooltip.versionDrift.text': 'Groups skills by source URL or slug name. If multiple copies exist with different content hashes or source refs (git tag/commit), a drift is reported. Unlike duplicates (identical content), drift means the same skill has diverged versions that need reconciliation.',
|
|
125
|
+
|
|
126
|
+
// Fix section labels
|
|
127
|
+
'fix.perFinding': 'Per-Risk Fixes',
|
|
128
|
+
'fix.byType': 'Fixes by Type',
|
|
129
|
+
'fix.agentVersion': 'Agent Operations',
|
|
130
|
+
'fix.humanVersion': 'Manual Steps',
|
|
131
|
+
'fix.copyAgentPrompt': 'Copy Agent Prompt',
|
|
132
|
+
'fix.noRisks': 'No risks to fix.',
|
|
133
|
+
|
|
134
|
+
// Severity labels
|
|
135
|
+
'severity.critical': 'Critical',
|
|
136
|
+
'severity.high': 'High',
|
|
137
|
+
'severity.medium': 'Medium',
|
|
138
|
+
'severity.low': 'Low',
|
|
139
|
+
'severity.info': 'Info',
|
|
140
|
+
|
|
141
|
+
// Type labels
|
|
142
|
+
'type.risk': 'Risk',
|
|
143
|
+
'type.conflict': 'Conflict',
|
|
144
|
+
'type.zombie': 'Zombie',
|
|
145
|
+
'type.duplicate': 'Duplicate',
|
|
146
|
+
'type.version_drift': 'Version Drift',
|
|
147
|
+
'type.description_quality': 'Description Quality',
|
|
148
|
+
'type.scan_warning': 'Scan Warning',
|
|
149
|
+
|
|
150
|
+
// Guide entries
|
|
151
|
+
'guide.risk.title': 'Risk Findings',
|
|
152
|
+
'guide.risk.definition': 'Risk findings indicate that a skill contains code patterns or instructions that could potentially harm the system.',
|
|
153
|
+
'guide.risk.cause': 'Common causes:\n• Skill contains shell command execution (bash, powershell)\n• Skill contains file deletion operations (rm, rmdir, del)\n• Skill accesses credentials or secrets (API keys, passwords)\n• Skill downloads or executes remote code\n• Skill modifies system configurations',
|
|
154
|
+
'guide.risk.severity': 'Severity explanation:\n• Critical: May cause data loss or system damage\n• High: May leak sensitive info or execute dangerous operations\n• Medium: Potential risk, requires user confirmation',
|
|
155
|
+
'guide.risk.meaning': 'The skill contains potentially dangerous patterns such as shell commands, file deletion, or credential access that could cause unintended damage.',
|
|
156
|
+
'guide.risk.steps': 'Fix steps:\n1. Open the skill\'s SKILL.md file\n2. Locate the risky code lines indicated in the report\n3. Add safety measures:\n - Add user confirmation before dangerous operations\n - Add --dry-run mode\n - Limit operation scope (e.g., only specific file types)\n4. Document known risks in the skill description\n5. Re-run diagnosis to verify the fix',
|
|
157
|
+
'guide.risk.prompt': 'Please review the skill at "%s" and add safety guardrails. Specifically: add confirmation before destructive operations, document risks in the description, and consider adding a --dry-run flag.',
|
|
158
|
+
'guide.risk.agentExample': 'Agent interaction example:\nUser: Please fix the security risks in the storage-analyzer skill\nAgent: I\'ll check the SKILL.md file, find the shell command execution parts, and add user confirmation prompts...',
|
|
159
|
+
|
|
160
|
+
'guide.zombie.title': 'Zombie Skills',
|
|
161
|
+
'guide.zombie.definition': 'Zombie skills are skills that have not been used for a long time and may be forgotten or abandoned.',
|
|
162
|
+
'guide.zombie.cause': 'Common causes:\n• Skill was installed but never triggered\n• Skill description is missing, so agent can\'t determine when to use it\n• Skill functionality has been replaced by another skill\n• Skill author stopped maintaining it\n• Skill is incompatible with current agent version',
|
|
163
|
+
'guide.zombie.severity': 'Severity explanation:\n• Medium: Zombie score >= 0.8, strongly recommended to clean up\n• Low: Zombie score 0.4-0.8, recommended to check if needed',
|
|
164
|
+
'guide.zombie.meaning': 'The skill appears unused or abandoned — it has low activity, may lack a description, and shows signs of being forgotten.',
|
|
165
|
+
'guide.zombie.steps': 'Fix steps:\n1. Check if the skill is referenced in any project config\n2. Test if the skill still works properly\n3. If not needed:\n - Delete the skill directory\n - Update related configurations\n4. If needed:\n - Update the skill description\n - Test compatibility with current agent\n - Add trigger condition documentation',
|
|
166
|
+
'guide.zombie.prompt': 'Please evaluate the skill at "%s". Check if it is still referenced in any project. If unused, remove it. If needed, update its description and verify compatibility.',
|
|
167
|
+
'guide.zombie.agentExample': 'Agent interaction example:\nUser: Please help me clean up zombie skills\nAgent: I\'ll check your skill list and find the ones that haven\'t been used for a long time...',
|
|
168
|
+
|
|
169
|
+
'guide.duplicate.title': 'Duplicate Skills',
|
|
170
|
+
'guide.duplicate.definition': 'Duplicate skills are multiple skills with identical or highly similar functionality, causing resource waste and selection confusion.',
|
|
171
|
+
'guide.duplicate.cause': 'Common causes:\n• Installed different versions of the same skill from different sources\n• Manually copied skill directories\n• Different skill names but same content\n• Multiple branch versions of the same skill',
|
|
172
|
+
'guide.duplicate.severity': 'Severity explanation:\n• Medium: Exact duplicate (exact_duplicate)\n• Low: Same source or same name duplicate',
|
|
173
|
+
'guide.duplicate.meaning': 'Multiple skills with very similar content or purpose were detected. This causes confusion during skill selection and wastes maintenance effort.',
|
|
174
|
+
'guide.duplicate.steps': 'Fix steps:\n1. Compare content differences between duplicate skills\n2. Choose the best-maintained version as canonical\n3. Delete other duplicate versions\n4. Update project configs to reference the correct skill\n5. If presets reference deleted skills, update presets',
|
|
175
|
+
'guide.duplicate.prompt': 'Please review the duplicate skill group and keep only the canonical version. Remove duplicates and update any preset references.',
|
|
176
|
+
'guide.duplicate.agentExample': 'Agent interaction example:\nUser: Please help me merge duplicate skills\nAgent: I\'ll compare the content of these skills and find the best version...',
|
|
177
|
+
|
|
178
|
+
'guide.conflict.title': 'Conflict Findings',
|
|
179
|
+
'guide.conflict.definition': 'Conflict findings indicate that two or more skills give contradictory instructions, causing uncertain agent behavior.',
|
|
180
|
+
'guide.conflict.cause': 'Common causes:\n• One skill requires npm, another requires yarn\n• One skill requires JSON output, another requires YAML\n• One skill requires TypeScript, another requires JavaScript\n• Unclear skill scope definitions',
|
|
181
|
+
'guide.conflict.severity': 'Severity explanation:\n• Medium: Clear instruction conflict exists',
|
|
182
|
+
'guide.conflict.meaning': 'Two or more skills give contradictory instructions (e.g., conflicting package managers or output formats). This confuses the agent at runtime.',
|
|
183
|
+
'guide.conflict.steps': 'Fix steps:\n1. Determine which instruction takes priority in your workflow\n2. Modify the lower-priority skill to narrow its scope\n3. Or delete the lower-priority skill\n4. If both are needed, consider:\n - Create different presets for different projects\n - Clarify applicable scenarios in skill descriptions',
|
|
184
|
+
'guide.conflict.prompt': 'Please resolve the conflict between skills at "%s". Decide which instruction takes priority and remove or scope-limit the other.',
|
|
185
|
+
'guide.conflict.agentExample': 'Agent interaction example:\nUser: Please help me resolve skill conflicts\nAgent: I\'ll check the conflicting skills and analyze their instruction differences...',
|
|
186
|
+
|
|
187
|
+
'guide.version_drift.title': 'Version Drift',
|
|
188
|
+
'guide.version_drift.definition': 'Version drift occurs when the same skill is installed at different versions in different locations, causing inconsistent behavior.',
|
|
189
|
+
'guide.version_drift.cause': 'Common causes:\n• Installed the same skill in multiple directories\n• Manually updated some installations\n• Used different installation sources\n• Skill updated but not synced across all installations',
|
|
190
|
+
'guide.version_drift.severity': 'Severity explanation:\n• Medium: Version inconsistency exists',
|
|
191
|
+
'guide.version_drift.meaning': 'The same upstream skill is installed at different versions or commits across your skill directories. This can cause inconsistent agent behavior.',
|
|
192
|
+
'guide.version_drift.steps': 'Fix steps:\n1. Identify which version is the latest or desired one\n2. Delete old version installations\n3. Reinstall the latest version\n4. Consider using a single installation location to prevent future drift\n5. If multiple versions are needed, use version management tools',
|
|
193
|
+
'guide.version_drift.prompt': 'Please update all installations of skill "%s" to the latest version and consolidate to a single install location if possible.',
|
|
194
|
+
'guide.version_drift.agentExample': 'Agent interaction example:\nUser: Please help me unify skill versions\nAgent: I\'ll check all installation locations and find the latest version...',
|
|
195
|
+
|
|
196
|
+
'guide.description_quality.title': 'Description Quality',
|
|
197
|
+
'guide.description_quality.definition': 'Description quality issues indicate that the skill\'s SKILL.md file is missing necessary information or has unclear descriptions.',
|
|
198
|
+
'guide.description_quality.cause': 'Common causes:\n• Skill author didn\'t provide complete description\n• Description is too brief, missing key information\n• No trigger conditions specified\n• No input/output documented\n• Known risks not recorded',
|
|
199
|
+
'guide.description_quality.severity': 'Severity explanation:\n• Medium: Description missing or severely insufficient\n• Low: Description can be improved',
|
|
200
|
+
'guide.description_quality.meaning': 'The skill description is missing, too short, or lacks important information like trigger conditions, inputs/outputs, or risk warnings.',
|
|
201
|
+
'guide.description_quality.steps': 'Fix steps:\n1. Open the skill\'s SKILL.md file\n2. Add or improve the description section:\n - One-sentence skill purpose\n - Trigger conditions (when to use)\n - Input parameter descriptions\n - Output result descriptions\n - Known risks and limitations\n3. Keep description concise (recommended under 300 words)\n4. Use clear formatting (headings, lists)',
|
|
202
|
+
'guide.description_quality.prompt': 'Please improve the description for the skill at "%s". Add trigger conditions, input/output descriptions, and any risk warnings. Keep it concise but complete.',
|
|
203
|
+
'guide.description_quality.agentExample': 'Agent interaction example:\nUser: Please help me improve the skill description\nAgent: I\'ll check the SKILL.md file and add missing information...',
|
|
204
|
+
|
|
205
|
+
'guide.scan_warning.title': 'Scan Warnings',
|
|
206
|
+
'guide.scan_warning.definition': 'Scan warnings indicate that the skill directory has structural or file issues that affect normal skill loading.',
|
|
207
|
+
'guide.scan_warning.cause': 'Common causes:\n• Skill directory missing SKILL.md file\n• SKILL.md YAML frontmatter format errors\n• Frontmatter missing required fields (name, description)\n• File encoding issues',
|
|
208
|
+
'guide.scan_warning.severity': 'Severity explanation:\n• Medium: Missing SKILL.md or severe frontmatter errors\n• Low: Minor frontmatter issues',
|
|
209
|
+
'guide.scan_warning.meaning': 'The skill directory has structural issues such as a missing SKILL.md file or malformed frontmatter metadata.',
|
|
210
|
+
'guide.scan_warning.steps': 'Fix steps:\n1. Ensure SKILL.md exists in the skill directory\n2. Check YAML frontmatter format:\n - Must start and end with ---\n - Use valid key: value pairs\n - Required fields: name, description\n3. Add clear title and description\n4. Ensure file encoding is UTF-8',
|
|
211
|
+
'guide.scan_warning.prompt': 'Please fix the structural issues with the skill at "%s". Add a proper SKILL.md with valid YAML frontmatter including name, description, and source fields.',
|
|
212
|
+
'guide.scan_warning.agentExample': 'Agent interaction example:\nUser: Please help me fix skill structure issues\nAgent: I\'ll check the skill directory and create or fix the SKILL.md file...',
|
|
213
|
+
|
|
214
|
+
'guide.default.title': 'General Findings',
|
|
215
|
+
'guide.default.definition': 'General findings are other types of issues that require manual review.',
|
|
216
|
+
'guide.default.cause': 'Common causes:\n• Issues that don\'t fit into the specific categories above\n• Special cases requiring manual judgment',
|
|
217
|
+
'guide.default.severity': 'Severity explanation:\n• Depends on the specific issue',
|
|
218
|
+
'guide.default.meaning': 'A diagnostic finding was detected that requires review.',
|
|
219
|
+
'guide.default.steps': 'Fix steps:\n1. Review finding details and evidence\n2. Follow the provided recommendations\n3. Re-run diagnosis to verify the fix',
|
|
220
|
+
'guide.default.prompt': 'Please review and fix the finding "%s" as described in the diagnostic report.',
|
|
221
|
+
'guide.default.agentExample': 'Agent interaction example:\nUser: Please help me fix this issue\nAgent: I\'ll check the issue details and fix it according to the recommendations...',
|
|
222
|
+
|
|
223
|
+
// Severity explanations
|
|
224
|
+
'severity.explanation.title': 'Severity Explanation',
|
|
225
|
+
'severity.explanation.critical': 'Critical: May cause data loss, system damage, or security vulnerabilities. Requires immediate fix.',
|
|
226
|
+
'severity.explanation.high': 'High: May leak sensitive info or execute dangerous operations. Recommended to fix soon.',
|
|
227
|
+
'severity.explanation.medium': 'Medium: Potential risk or quality issue. Recommended to fix during next maintenance.',
|
|
228
|
+
'severity.explanation.low': 'Low: Minor issue or improvement suggestion. Can be fixed at convenience.',
|
|
229
|
+
'severity.explanation.info': 'Info: For reference only, does not affect functionality or security.',
|
|
230
|
+
|
|
231
|
+
// Dashboard explanations
|
|
232
|
+
'dashboard.totalSkills.desc': 'Scanned skill directories',
|
|
233
|
+
'dashboard.totalFindings.desc': 'Total findings across all skills',
|
|
234
|
+
'dashboard.duplicateGroups.desc': 'Groups of skills with identical or similar content',
|
|
235
|
+
'dashboard.riskFindings.desc': 'Inherent permissions, not actionable',
|
|
236
|
+
'dashboard.zombieCandidates.desc': 'Unused or abandoned skills (score >= 0.4)',
|
|
237
|
+
'dashboard.conflictFindings.desc': 'Skills with contradictory instructions',
|
|
238
|
+
'dashboard.descriptionQualityFindings.desc': 'Documentation quality, low priority',
|
|
239
|
+
'dashboard.duplicateFindings.desc': 'Findings related to duplicate skill content',
|
|
240
|
+
'dashboard.versionDriftFindings.desc': 'Skills with outdated versions compared to source',
|
|
241
|
+
'dashboard.scanDirs.desc': 'Directories scanned for skills',
|
|
242
|
+
'dashboard.scanSkills.desc': 'Total skills discovered',
|
|
243
|
+
|
|
244
|
+
// Finding title translations
|
|
245
|
+
'finding.Possible destructive filesystem operation': 'Possible destructive filesystem operation',
|
|
246
|
+
'finding.Possible credential access': 'Possible credential access',
|
|
247
|
+
'finding.Possible shell execution': 'Possible shell execution',
|
|
248
|
+
'finding.Possible remote download or installer execution': 'Possible remote download or installer execution',
|
|
249
|
+
'finding.Risk pattern detected': 'Risk pattern detected',
|
|
250
|
+
'finding.Version drift detected': 'Version drift detected',
|
|
251
|
+
'finding.SKILL.md is missing': 'SKILL.md is missing',
|
|
252
|
+
'finding.Frontmatter parse warning': 'Frontmatter parse warning',
|
|
253
|
+
'finding.Description is missing': 'Description is missing',
|
|
254
|
+
'finding.Description is too short': 'Description is too short',
|
|
255
|
+
'finding.No trigger condition in description': 'No trigger condition in description',
|
|
256
|
+
'finding.No input/output description': 'No input/output description',
|
|
257
|
+
'finding.High-risk actions without risk description': 'High-risk actions without risk description',
|
|
258
|
+
'finding.Conflicting package manager instructions': 'Conflicting package manager instructions',
|
|
259
|
+
'finding.Conflicting output format instructions': 'Conflicting output format instructions',
|
|
260
|
+
'finding.exact duplicate detected': 'Exact duplicate detected',
|
|
261
|
+
'finding.same source duplicate detected': 'Same source duplicate detected',
|
|
262
|
+
'finding.same name duplicate detected': 'Same name duplicate detected',
|
|
263
|
+
'finding.Zombie candidate': 'Zombie candidate',
|
|
264
|
+
'finding.Conflict': 'Conflict',
|
|
265
|
+
|
|
266
|
+
// Fix command
|
|
267
|
+
'fix.title': 'Fix Guide',
|
|
268
|
+
'fix.selectType': 'Select issue type to fix:',
|
|
269
|
+
'fix.selectSeverity': 'Select severity filter:',
|
|
270
|
+
'fix.generating': 'Generating fix prompt...',
|
|
271
|
+
'fix.promptGenerated': 'Fix prompt generated, please copy to Agent:',
|
|
272
|
+
'fix.noFindings': 'No matching issues found.',
|
|
273
|
+
'fix.copyPrompt': 'Copy Prompt',
|
|
274
|
+
'fix.copied': 'Copied!',
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const zh = {
|
|
278
|
+
'cli.scanned': '已扫描 %s 个技能。阶段1发现: %s。数据库: %s',
|
|
279
|
+
'cli.skills': '技能数: %s',
|
|
280
|
+
'cli.findings': '发现数: %s',
|
|
281
|
+
'cli.riskFindings': '风险发现: %s',
|
|
282
|
+
'cli.conflictFindings': '冲突发现: %s',
|
|
283
|
+
'cli.zombieCandidates': '僵尸技能: %s',
|
|
284
|
+
'cli.reportWritten': '报告已写入: %s',
|
|
285
|
+
'cli.noFindings': '没有 %s 类型的发现。',
|
|
286
|
+
'cli.noDuplicateGroups': '没有重复组。运行: agent-skill-doctor diagnose',
|
|
287
|
+
'cli.ignoredFinding': '%s 发现: %s',
|
|
288
|
+
'cli.unignoredFinding': '%s 发现: %s',
|
|
289
|
+
'cli.noIgnored': '没有被忽略的发现。',
|
|
290
|
+
'cli.applyRequiresPlan': 'apply 命令需要 <plan.json> 参数',
|
|
291
|
+
'cli.dryRunOnly': 'MVP 版本的 apply 仅支持 --dry-run 模式。',
|
|
292
|
+
'cli.ignoreRequiresId': '%s 命令需要 <finding-id> 参数',
|
|
293
|
+
'cli.findingNotFound': '未找到该发现: %s',
|
|
294
|
+
'cli.ignoredListUsage': '用法: agent-skill-doctor ignored list',
|
|
295
|
+
|
|
296
|
+
'report.title': 'Agent 技能诊断报告',
|
|
297
|
+
'report.summary': '概要',
|
|
298
|
+
'report.totalSkills': '技能目录数',
|
|
299
|
+
'report.scanDirs': '扫描目录数',
|
|
300
|
+
'report.scanSkills': '扫描技能数',
|
|
301
|
+
'report.totalFindings': '问题总数',
|
|
302
|
+
'report.duplicateGroups': '重复组',
|
|
303
|
+
'report.versionDriftFindings': '版本漂移',
|
|
304
|
+
'report.riskFindings': '风险发现',
|
|
305
|
+
'report.conflictFindings': '冲突发现',
|
|
306
|
+
'report.zombieCandidates': '僵尸技能',
|
|
307
|
+
'report.descriptionQualityFindings': '描述问题',
|
|
308
|
+
'report.duplicateFindings': '重复发现',
|
|
309
|
+
'report.ignoredFindings': '已忽略',
|
|
310
|
+
'report.bySeverity': '按严重性',
|
|
311
|
+
'report.byType': '按类型',
|
|
312
|
+
'report.criticalRisks': '严重风险',
|
|
313
|
+
'report.noCriticalRisks': '没有严重风险。',
|
|
314
|
+
'report.duplicateGroupsSection': '重复组',
|
|
315
|
+
'report.noDuplicateGroups': '没有重复组。',
|
|
316
|
+
'report.findings': '风险列表',
|
|
317
|
+
'report.noFindings': '暂无风险。',
|
|
318
|
+
'report.skills': '技能列表',
|
|
319
|
+
'report.recommendation': '建议',
|
|
320
|
+
'report.severity': '严重性',
|
|
321
|
+
'report.type': '类型',
|
|
322
|
+
'report.name': '名称',
|
|
323
|
+
'report.description': '描述',
|
|
324
|
+
'report.id': 'ID',
|
|
325
|
+
'report.detector': '检测器',
|
|
326
|
+
'report.status': '状态',
|
|
327
|
+
'report.evidence': '证据',
|
|
328
|
+
|
|
329
|
+
'html.scanOverview': '扫描概览',
|
|
330
|
+
'html.scannedDirs': '扫描目录',
|
|
331
|
+
'html.skillList': '技能清单',
|
|
332
|
+
'html.official': '官方',
|
|
333
|
+
'html.plugin': '插件',
|
|
334
|
+
'html.local': '本地',
|
|
335
|
+
'html.standalone': '独立',
|
|
336
|
+
'html.thirdParty': '三方',
|
|
337
|
+
'html.unknown': '未知',
|
|
338
|
+
'html.source': '来源',
|
|
339
|
+
'html.path': '路径',
|
|
340
|
+
'html.agent': 'Agent',
|
|
341
|
+
'html.noSkills': '未发现技能。',
|
|
342
|
+
'html.emptyRoot': '该目录下未发现技能',
|
|
343
|
+
'html.rootType.global': '全局',
|
|
344
|
+
'html.rootType.project': '项目',
|
|
345
|
+
'html.rootType.central': '中心库',
|
|
346
|
+
'agent.claude': 'Claude',
|
|
347
|
+
'agent.codex': 'Codex',
|
|
348
|
+
'agent.cursor': 'Cursor',
|
|
349
|
+
'agent.opencode': 'OpenCode',
|
|
350
|
+
'agent.agent': 'Agent',
|
|
351
|
+
'agent.windsurf': 'Windsurf',
|
|
352
|
+
'agent.aider': 'Aider',
|
|
353
|
+
'agent.continue': 'Continue',
|
|
354
|
+
'agent.cody': 'Cody',
|
|
355
|
+
'agent.copilot': 'Copilot',
|
|
356
|
+
'agent.agents': 'Agents',
|
|
357
|
+
'html.dashboard': '仪表盘',
|
|
358
|
+
'html.severityChart': '严重性分布',
|
|
359
|
+
'html.typeChart': '类型分布',
|
|
360
|
+
'html.remediationGuide': '修复建议',
|
|
361
|
+
'html.toggleLang': 'EN',
|
|
362
|
+
'html.ignored': '已忽略',
|
|
363
|
+
'html.generatedAt': '生成时间',
|
|
364
|
+
'html.copyPrompt': '复制',
|
|
365
|
+
'html.copied': '已复制!',
|
|
366
|
+
'html.viewGuide': '查看修复指南',
|
|
367
|
+
'html.skillsInvolved': '涉及技能',
|
|
368
|
+
'html.expandDetails': '点击展开详情',
|
|
369
|
+
'html.collapseDetails': '点击收起',
|
|
370
|
+
|
|
371
|
+
// Guide section headings
|
|
372
|
+
'guide.heading.definition': '定义',
|
|
373
|
+
'guide.heading.causes': '常见成因',
|
|
374
|
+
'guide.heading.severity': '严重程度',
|
|
375
|
+
'guide.heading.steps': '修复步骤',
|
|
376
|
+
'guide.heading.agentPrompt': 'Agent 提示词',
|
|
377
|
+
'guide.heading.agentExample': 'Agent 示例',
|
|
378
|
+
'guide.heading.humanSteps': '人工操作步骤',
|
|
379
|
+
'guide.heading.agentOps': 'Agent 操作',
|
|
380
|
+
|
|
381
|
+
// Tooltips - detection criteria
|
|
382
|
+
'tooltip.risk.title': '风险检测(仅供参考)',
|
|
383
|
+
'tooltip.risk.text': '扫描技能文本中的危险模式。这些是技能正常运行所需的固有权限,不是需要修复的缺陷。例如,文件生成类技能天然需要"覆写"能力。无需修复,仅供了解。',
|
|
384
|
+
'tooltip.duplicate.title': '重复检测标准',
|
|
385
|
+
'tooltip.duplicate.text': '三种策略:1)完全重复(置信度 1.0):内容哈希相同。2)同源重复(置信度 0.95):来源 URL + 子目录 + slug 相同。3)同名重复(置信度 0.7):slug 相同但内容不同。包含 2+ 技能的组会被报告。',
|
|
386
|
+
'tooltip.zombie.title': '僵尸检测标准',
|
|
387
|
+
'tooltip.zombie.text': '僵尸分数(0.0-1.0)基于 6 个加权因子。分数 >= 0.4 触发发现。受保护:pinned/keep/core/system 标签(分数 0)、官方来源如 anthropics/openai(分数 0)、插件来源如 obra/superpowers(分数 *0.5)。第三方来源分数 *0.75。',
|
|
388
|
+
'tooltip.zombie.formula': '僵尸分数计算公式',
|
|
389
|
+
'tooltip.zombie.formulaText': '分数 = 未被预设引用(0.25) + 未安装到Agent(0.20) + 未安装到项目(0.20) + 无近期修改(0.15) + 无活动日志(0.15) + 描述质量低(0.05)。然后:官方(*0)、插件(*0.5)、第三方(*0.75)。最大值 = 1.0。',
|
|
390
|
+
'tooltip.conflict.title': '冲突检测标准',
|
|
391
|
+
'tooltip.conflict.text': '检查 2+ 个技能是否在同一冲突规则中匹配了不同的备选项。内置规则:包管理器冲突(npm vs pnpm vs yarn)、输出格式冲突(JSON vs Markdown)。二元检测:存在或不存在。',
|
|
392
|
+
'tooltip.descriptionQuality.title': '描述质量(仅供参考)',
|
|
393
|
+
'tooltip.descriptionQuality.text': '从 4 个维度评估技能描述:长度、风险提示、使用指导、结构化。低分说明文档质量差,但不影响技能功能。可由 Agent 低优先级补充完善。',
|
|
394
|
+
'tooltip.versionDrift.title': '版本漂移检测标准',
|
|
395
|
+
'tooltip.versionDrift.text': '按来源 URL 或 slug 名称分组,如果同一技能存在多个副本且内容哈希或版本引用(git tag/commit)不同,则报告漂移。与重复(内容完全相同)不同,漂移意味着同一技能出现了版本分叉,需要对齐。',
|
|
396
|
+
|
|
397
|
+
// Fix section labels
|
|
398
|
+
'fix.perFinding': '逐项修复',
|
|
399
|
+
'fix.byType': '按类型修复',
|
|
400
|
+
'fix.agentVersion': 'Agent 操作',
|
|
401
|
+
'fix.humanVersion': '人工操作',
|
|
402
|
+
'fix.copyAgentPrompt': '复制 Agent 提示词',
|
|
403
|
+
'fix.noRisks': '暂无风险需要修复。',
|
|
404
|
+
|
|
405
|
+
'severity.critical': '严重',
|
|
406
|
+
'severity.high': '高',
|
|
407
|
+
'severity.medium': '中',
|
|
408
|
+
'severity.low': '低',
|
|
409
|
+
'severity.info': '信息',
|
|
410
|
+
|
|
411
|
+
'type.risk': '风险',
|
|
412
|
+
'type.conflict': '冲突',
|
|
413
|
+
'type.zombie': '僵尸',
|
|
414
|
+
'type.duplicate': '重复',
|
|
415
|
+
'type.version_drift': '版本漂移',
|
|
416
|
+
'type.description_quality': '描述质量',
|
|
417
|
+
'type.scan_warning': '扫描警告',
|
|
418
|
+
|
|
419
|
+
'guide.risk.title': '风险发现',
|
|
420
|
+
'guide.risk.definition': '风险发现是指技能中包含可能对系统造成损害的代码模式或指令。',
|
|
421
|
+
'guide.risk.cause': '常见成因:\n• 技能包含 shell 命令执行(如 bash、powershell)\n• 技能包含文件删除操作(如 rm、rmdir、del)\n• 技能访问凭证或密钥(如 API key、password)\n• 技能下载或执行远程代码\n• 技能修改系统配置',
|
|
422
|
+
'guide.risk.severity': '严重程度说明:\n• Critical(严重):可能导致数据丢失或系统损坏\n• High(高):可能泄露敏感信息或执行危险操作\n• Medium(中):存在潜在风险,需要用户确认',
|
|
423
|
+
'guide.risk.meaning': '该技能包含潜在危险模式,如 shell 命令、文件删除或凭证访问,可能造成意外损害。',
|
|
424
|
+
'guide.risk.steps': '修复步骤:\n1. 打开技能的 SKILL.md 文件\n2. 找到报告中指出的风险代码行\n3. 添加安全防护措施:\n - 在危险操作前添加用户确认提示\n - 添加 --dry-run 试运行模式\n - 限制操作范围(如只处理特定文件类型)\n4. 在技能描述中记录已知风险\n5. 重新运行诊断验证修复',
|
|
425
|
+
'guide.risk.prompt': '请审查技能 "%s" 并添加安全防护。具体包括:在破坏性操作前添加确认、在描述中记录风险,并考虑添加 --dry-run 标志。',
|
|
426
|
+
'guide.risk.agentExample': 'Agent 交互示例:\n用户:请帮我修复 storage-analyzer 技能的安全风险\nAgent:我来检查该技能的 SKILL.md 文件,找到 shell 命令执行的部分,添加用户确认提示...',
|
|
427
|
+
|
|
428
|
+
'guide.zombie.title': '僵尸技能',
|
|
429
|
+
'guide.zombie.definition': '僵尸技能是指长期未使用、可能已被遗忘或废弃的技能。',
|
|
430
|
+
'guide.zombie.cause': '常见成因:\n• 技能安装后从未被触发过\n• 技能描述缺失,agent 无法判断何时使用\n• 技能功能已被其他技能替代\n• 技能作者停止维护\n• 技能与当前 agent 版本不兼容',
|
|
431
|
+
'guide.zombie.severity': '严重程度说明:\n• Medium(中):僵尸分数 >= 0.8,强烈建议清理\n• Low(低):僵尸分数 0.4-0.8,建议检查是否需要',
|
|
432
|
+
'guide.zombie.meaning': '该技能似乎未使用或已被遗忘——活跃度低、可能缺少描述,并显示出被遗弃的迹象。',
|
|
433
|
+
'guide.zombie.steps': '修复步骤:\n1. 检查技能是否在任何项目配置中被引用\n2. 测试技能是否还能正常工作\n3. 如果不需要:\n - 删除技能目录\n - 更新相关配置\n4. 如果需要保留:\n - 更新技能描述\n - 测试与当前 agent 的兼容性\n - 添加触发条件说明',
|
|
434
|
+
'guide.zombie.prompt': '请评估技能 "%s"。检查是否仍有项目引用。如未使用则移除;如需要则更新描述并验证兼容性。',
|
|
435
|
+
'guide.zombie.agentExample': 'Agent 交互示例:\n用户:请帮我清理僵尸技能\nAgent:我来检查你的技能列表,找出长期未使用的技能...',
|
|
436
|
+
|
|
437
|
+
'guide.duplicate.title': '重复技能',
|
|
438
|
+
'guide.duplicate.definition': '重复技能是指多个技能功能相同或高度相似,造成资源浪费和选择困惑。',
|
|
439
|
+
'guide.duplicate.cause': '常见成因:\n• 从不同来源安装了同一技能的不同版本\n• 手动复制了技能目录\n• 技能名称不同但内容相同\n• 同一技能的多个分支版本',
|
|
440
|
+
'guide.duplicate.severity': '严重程度说明:\n• Medium(中):完全重复(exact_duplicate)\n• Low(低):来源相同或名称相同的重复',
|
|
441
|
+
'guide.duplicate.meaning': '检测到多个内容或用途非常相似的技能。这会在技能选择时造成困惑并浪费维护精力。',
|
|
442
|
+
'guide.duplicate.steps': '修复步骤:\n1. 比较重复技能的内容差异\n2. 选择维护最好的版本作为规范版本\n3. 删除其他重复版本\n4. 更新项目配置,确保引用正确的技能\n5. 如果有预设引用了被删除的技能,更新预设',
|
|
443
|
+
'guide.duplicate.prompt': '请审查重复技能组,仅保留规范版本。移除重复项并更新预设引用。',
|
|
444
|
+
'guide.duplicate.agentExample': 'Agent 交互示例:\n用户:请帮我合并重复的技能\nAgent:我来比较这些技能的内容,找出最佳版本...',
|
|
445
|
+
|
|
446
|
+
'guide.conflict.title': '冲突发现',
|
|
447
|
+
'guide.conflict.definition': '冲突发现是指两个或多个技能给出了相互矛盾的指令,导致 agent 行为不确定。',
|
|
448
|
+
'guide.conflict.cause': '常见成因:\n• 一个技能要求使用 npm,另一个要求使用 yarn\n• 一个技能要求输出 JSON,另一个要求输出 YAML\n• 一个技能要求使用 TypeScript,另一个要求使用 JavaScript\n• 技能的作用域定义不清晰',
|
|
449
|
+
'guide.conflict.severity': '严重程度说明:\n• Medium(中):存在明确的指令冲突',
|
|
450
|
+
'guide.conflict.meaning': '两个或多个技能给出了矛盾的指令(如冲突的包管理器或输出格式)。这会在运行时使 agent 困惑。',
|
|
451
|
+
'guide.conflict.steps': '修复步骤:\n1. 确定哪个指令在你的工作流中优先\n2. 修改低优先级技能,缩小其作用范围\n3. 或者删除低优先级技能\n4. 如果两者都需要,考虑:\n - 为不同项目创建不同预设\n - 在技能描述中明确适用场景',
|
|
452
|
+
'guide.conflict.prompt': '请解决技能 "%s" 之间的冲突。确定优先指令并移除或限制另一个的范围。',
|
|
453
|
+
'guide.conflict.agentExample': 'Agent 交互示例:\n用户:请帮我解决技能冲突\nAgent:我来检查冲突的技能,分析它们的指令差异...',
|
|
454
|
+
|
|
455
|
+
'guide.version_drift.title': '版本漂移',
|
|
456
|
+
'guide.version_drift.definition': '版本漂移是指同一技能在不同位置安装了不同版本,导致行为不一致。',
|
|
457
|
+
'guide.version_drift.cause': '常见成因:\n• 在多个目录安装了同一技能\n• 手动更新了部分安装\n• 使用了不同的安装源\n• 技能更新后未同步所有安装',
|
|
458
|
+
'guide.version_drift.severity': '严重程度说明:\n• Medium(中):存在版本不一致',
|
|
459
|
+
'guide.version_drift.meaning': '同一上游技能在不同技能目录中安装了不同版本或提交。这会导致 agent 行为不一致。',
|
|
460
|
+
'guide.version_drift.steps': '修复步骤:\n1. 确定哪个版本是最新的或期望的版本\n2. 删除旧版本的安装\n3. 重新安装最新版本\n4. 考虑使用单一安装位置防止未来漂移\n5. 如果需要多版本,使用版本管理工具',
|
|
461
|
+
'guide.version_drift.prompt': '请将技能 "%s" 的所有安装更新到最新版本,如可能请合并到单一安装位置。',
|
|
462
|
+
'guide.version_drift.agentExample': 'Agent 交互示例:\n用户:请帮我统一技能版本\nAgent:我来检查所有安装位置,找出最新版本...',
|
|
463
|
+
|
|
464
|
+
'guide.description_quality.title': '描述质量',
|
|
465
|
+
'guide.description_quality.definition': '描述质量问题是指标技能的 SKILL.md 文件缺少必要信息或描述不清晰。',
|
|
466
|
+
'guide.description_quality.cause': '常见成因:\n• 技能作者未提供完整描述\n• 描述过于简短,缺少关键信息\n• 未说明触发条件\n• 未说明输入输出\n• 未记录已知风险',
|
|
467
|
+
'guide.description_quality.severity': '严重程度说明:\n• Medium(中):描述缺失或严重不足\n• Low(低):描述可以改进',
|
|
468
|
+
'guide.description_quality.meaning': '技能描述缺失、过短或缺少重要信息,如触发条件、输入/输出或风险警告。',
|
|
469
|
+
'guide.description_quality.steps': '修复步骤:\n1. 打开技能的 SKILL.md 文件\n2. 添加或完善描述部分:\n - 一句话说明技能用途\n - 触发条件(何时使用)\n - 输入参数说明\n - 输出结果说明\n - 已知风险和限制\n3. 保持描述简洁(建议 300 字以内)\n4. 使用清晰的格式(标题、列表)',
|
|
470
|
+
'guide.description_quality.prompt': '请改进技能 "%s" 的描述。添加触发条件、输入/输出描述和风险警告。保持简洁但完整。',
|
|
471
|
+
'guide.description_quality.agentExample': 'Agent 交互示例:\n用户:请帮我完善技能描述\nAgent:我来检查 SKILL.md 文件,添加缺失的信息...',
|
|
472
|
+
|
|
473
|
+
'guide.scan_warning.title': '扫描警告',
|
|
474
|
+
'guide.scan_warning.definition': '扫描警告是指技能目录的结构或文件存在问题,影响技能的正常加载。',
|
|
475
|
+
'guide.scan_warning.cause': '常见成因:\n• 技能目录缺少 SKILL.md 文件\n• SKILL.md 的 YAML frontmatter 格式错误\n• frontmatter 缺少必要字段(如 name、description)\n• 文件编码问题',
|
|
476
|
+
'guide.scan_warning.severity': '严重程度说明:\n• Medium(中):缺少 SKILL.md 或 frontmatter 严重错误\n• Low(低):frontmatter 有小问题',
|
|
477
|
+
'guide.scan_warning.meaning': '技能目录存在结构问题,如缺少 SKILL.md 文件或 frontmatter 元数据格式错误。',
|
|
478
|
+
'guide.scan_warning.steps': '修复步骤:\n1. 确保技能目录中存在 SKILL.md 文件\n2. 检查 YAML frontmatter 格式:\n - 必须以 --- 开头和结尾\n - 使用有效的 key: value 对\n - 必需字段:name、description\n3. 添加清晰的标题和描述\n4. 确保文件编码为 UTF-8',
|
|
479
|
+
'guide.scan_warning.prompt': '请修复技能 "%s" 的结构问题。添加带有有效 YAML frontmatter 的 SKILL.md,包括 name、description 和 source 字段。',
|
|
480
|
+
'guide.scan_warning.agentExample': 'Agent 交互示例:\n用户:请帮我修复技能结构问题\nAgent:我来检查技能目录,创建或修复 SKILL.md 文件...',
|
|
481
|
+
|
|
482
|
+
'guide.default.title': '通用发现',
|
|
483
|
+
'guide.default.definition': '通用发现是指需要人工审查的其他类型问题。',
|
|
484
|
+
'guide.default.cause': '常见成因:\n• 不属于上述特定类别的问题\n• 需要人工判断的特殊情况',
|
|
485
|
+
'guide.default.severity': '严重程度说明:\n• 根据具体问题而定',
|
|
486
|
+
'guide.default.meaning': '检测到需要审查的诊断发现。',
|
|
487
|
+
'guide.default.steps': '修复步骤:\n1. 审查发现详情和证据\n2. 按照提供的建议操作\n3. 重新运行诊断以验证修复',
|
|
488
|
+
'guide.default.prompt': '请按照诊断报告中的描述审查并修复发现 "%s"。',
|
|
489
|
+
'guide.default.agentExample': 'Agent 交互示例:\n用户:请帮我修复这个问题\nAgent:我来查看问题详情,按照建议进行修复...',
|
|
490
|
+
|
|
491
|
+
// Severity explanations
|
|
492
|
+
'severity.explanation.title': '严重程度说明',
|
|
493
|
+
'severity.explanation.critical': '严重(Critical):可能导致数据丢失、系统损坏或安全漏洞。需要立即修复。',
|
|
494
|
+
'severity.explanation.high': '高(High):可能泄露敏感信息或执行危险操作。建议尽快修复。',
|
|
495
|
+
'severity.explanation.medium': '中(Medium):存在潜在风险或质量问题。建议在下次维护时修复。',
|
|
496
|
+
'severity.explanation.low': '低(Low):小问题或改进建议。可以择机修复。',
|
|
497
|
+
'severity.explanation.info': '信息(Info):仅供参考,不影响功能或安全。',
|
|
498
|
+
|
|
499
|
+
// Dashboard explanations
|
|
500
|
+
'dashboard.totalSkills.desc': '已扫描的技能目录数',
|
|
501
|
+
'dashboard.totalFindings.desc': '所有技能中检测到的问题总数',
|
|
502
|
+
'dashboard.duplicateGroups.desc': '内容相同或相似的技能组数',
|
|
503
|
+
'dashboard.riskFindings.desc': '固有权限,无需修复',
|
|
504
|
+
'dashboard.zombieCandidates.desc': '疑似废弃的技能数(分数 >= 0.4)',
|
|
505
|
+
'dashboard.conflictFindings.desc': '指令相互矛盾的技能数',
|
|
506
|
+
'dashboard.descriptionQualityFindings.desc': '文档质量问题,低优先级',
|
|
507
|
+
'dashboard.duplicateFindings.desc': '与重复内容相关的发现数',
|
|
508
|
+
'dashboard.versionDriftFindings.desc': '与源版本不一致的技能数',
|
|
509
|
+
'dashboard.scanDirs.desc': '已扫描的目录数',
|
|
510
|
+
'dashboard.scanSkills.desc': '发现的技能总数',
|
|
511
|
+
|
|
512
|
+
// Finding title translations
|
|
513
|
+
'finding.Possible destructive filesystem operation': '可能存在破坏性文件系统操作',
|
|
514
|
+
'finding.Possible credential access': '可能存在凭证访问',
|
|
515
|
+
'finding.Possible shell execution': '可能存在 shell 命令执行',
|
|
516
|
+
'finding.Possible remote download or installer execution': '可能存在远程下载或安装程序执行',
|
|
517
|
+
'finding.Risk pattern detected': '检测到风险模式',
|
|
518
|
+
'finding.Version drift detected': '检测到版本漂移',
|
|
519
|
+
'finding.SKILL.md is missing': 'SKILL.md 文件缺失',
|
|
520
|
+
'finding.Frontmatter parse warning': 'Frontmatter 解析警告',
|
|
521
|
+
'finding.Description is missing': '描述缺失',
|
|
522
|
+
'finding.Description is too short': '描述过短',
|
|
523
|
+
'finding.No trigger condition in description': '描述中缺少触发条件',
|
|
524
|
+
'finding.No input/output description': '缺少输入/输出说明',
|
|
525
|
+
'finding.High-risk actions without risk description': '高风险操作缺少风险说明',
|
|
526
|
+
'finding.Conflicting package manager instructions': '包管理器指令冲突',
|
|
527
|
+
'finding.Conflicting output format instructions': '输出格式指令冲突',
|
|
528
|
+
'finding.exact duplicate detected': '检测到完全重复',
|
|
529
|
+
'finding.same source duplicate detected': '检测到同源重复',
|
|
530
|
+
'finding.same name duplicate detected': '检测到同名重复',
|
|
531
|
+
'finding.Zombie candidate': '僵尸技能候选',
|
|
532
|
+
'finding.Conflict': '指令冲突',
|
|
533
|
+
|
|
534
|
+
// Fix command
|
|
535
|
+
'fix.title': '修复指南',
|
|
536
|
+
'fix.selectType': '请选择要修复的问题类型:',
|
|
537
|
+
'fix.selectSeverity': '请选择严重程度筛选:',
|
|
538
|
+
'fix.generating': '正在生成修复提示词...',
|
|
539
|
+
'fix.promptGenerated': '修复提示词已生成,请复制给 Agent:',
|
|
540
|
+
'fix.noFindings': '没有找到符合条件的问题。',
|
|
541
|
+
'fix.copyPrompt': '复制提示词',
|
|
542
|
+
'fix.copied': '已复制!',
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
const dictionaries = { en, zh };
|
|
546
|
+
const _missingKeys = new Set();
|
|
547
|
+
|
|
548
|
+
// Development-time parity check: warn if en/zh dictionaries are out of sync
|
|
549
|
+
if (typeof process !== 'undefined' && process.env && process.env.ASD_DEBUG) {
|
|
550
|
+
const enKeys = new Set(Object.keys(en));
|
|
551
|
+
const zhKeys = new Set(Object.keys(zh));
|
|
552
|
+
for (const k of enKeys) { if (!zhKeys.has(k)) process.stderr.write(`[i18n] key in en but missing in zh: ${k}\n`); }
|
|
553
|
+
for (const k of zhKeys) { if (!enKeys.has(k)) process.stderr.write(`[i18n] key in zh but missing in en: ${k}\n`); }
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
function t(key, lang, ...args) {
|
|
557
|
+
const dict = dictionaries[lang] || dictionaries.en;
|
|
558
|
+
const hasKey = key in dict || key in dictionaries.en;
|
|
559
|
+
if (!hasKey && !_missingKeys.has(key)) {
|
|
560
|
+
_missingKeys.add(key);
|
|
561
|
+
if (typeof process !== 'undefined' && process.env && process.env.ASD_DEBUG) {
|
|
562
|
+
process.stderr.write(`[i18n] missing key: ${key}\n`);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
let template = dict[key] || dictionaries.en[key] || key;
|
|
566
|
+
for (const arg of args) {
|
|
567
|
+
template = template.replace('%s', String(arg));
|
|
568
|
+
}
|
|
569
|
+
return template;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
module.exports = { t, en, zh, dictionaries };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const phase2 = require('./phase2');
|
|
4
|
+
const conflict = require('./conflict');
|
|
5
|
+
const zombie = require('./zombie');
|
|
6
|
+
const riskLite = require('./risk-lite');
|
|
7
|
+
const rules = require('./rules');
|
|
8
|
+
const i18n = require('./i18n');
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
// Phase 2 - Duplicate and drift detection
|
|
12
|
+
buildSkillIdentityKey: phase2.buildSkillIdentityKey,
|
|
13
|
+
buildParticipantIdentityKey: phase2.buildParticipantIdentityKey,
|
|
14
|
+
chooseCanonical: phase2.chooseCanonical,
|
|
15
|
+
detectDuplicateGroups: phase2.detectDuplicateGroups,
|
|
16
|
+
detectVersionDrift: phase2.detectVersionDrift,
|
|
17
|
+
normalizeSourceUrl: phase2.normalizeSourceUrl,
|
|
18
|
+
sourceTrustScore: phase2.sourceTrustScore,
|
|
19
|
+
sourceKey: phase2.sourceKey,
|
|
20
|
+
|
|
21
|
+
// Conflict detection
|
|
22
|
+
detectConflicts: conflict.detectConflicts,
|
|
23
|
+
matchAlternative: conflict.matchAlternative,
|
|
24
|
+
skillTextContent: conflict.skillTextContent,
|
|
25
|
+
|
|
26
|
+
// Zombie detection
|
|
27
|
+
computeZombieScore: zombie.computeZombieScore,
|
|
28
|
+
zombieLevel: zombie.zombieLevel,
|
|
29
|
+
zombieLevelDescription: zombie.zombieLevelDescription,
|
|
30
|
+
detectZombies: zombie.detectZombies,
|
|
31
|
+
descriptionQuality: zombie.descriptionQuality,
|
|
32
|
+
|
|
33
|
+
// Risk scanning
|
|
34
|
+
getMatchedPatternId: riskLite.getMatchedPatternId,
|
|
35
|
+
loadJsonRules: riskLite.loadJsonRules,
|
|
36
|
+
scanSkillForRisks: riskLite.scanSkillForRisks,
|
|
37
|
+
|
|
38
|
+
// Rules and utilities
|
|
39
|
+
DEFAULT_RISK_RULES: rules.DEFAULT_RISK_RULES,
|
|
40
|
+
DEFAULT_CONFLICT_RULES: rules.DEFAULT_CONFLICT_RULES,
|
|
41
|
+
matchedPatternId: rules.matchedPatternId,
|
|
42
|
+
normalizeAnchor: rules.normalizeAnchor,
|
|
43
|
+
normalizeText: rules.normalizeText,
|
|
44
|
+
sha256: rules.sha256,
|
|
45
|
+
validPatternId: rules.validPatternId,
|
|
46
|
+
|
|
47
|
+
// i18n
|
|
48
|
+
t: i18n.t,
|
|
49
|
+
dictionaries: i18n.dictionaries
|
|
50
|
+
};
|