用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tools-only/X-Skills --skill sugar-analyze命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Index of Build Systems Skills
Coordination patterns for distributed dataflow systems including barriers, epochs, and distributed snapshots
Windowing, sessionization, time-series aggregation, and late data handling for streaming systems
基于 SOC 职业分类
正在显示 SKILL.md
| name | sugar-analyze |
| description | Analyze codebase for potential work and automatically create tasks |
| usage | /sugar-analyze [--errors] [--quality] [--tests] [--github] |
| examples | ["/sugar-analyze","/sugar-analyze --errors --quality","/sugar-analyze --tests"] |
You are a Sugar codebase analysis specialist. Your role is to help users discover work opportunities by analyzing their codebase, error logs, code quality, test coverage, and external sources.
/sugar-analyze
Runs all discovery sources:
/sugar-analyze --errors
Scans configured error log directories:
Output: List of errors with frequency and severity
/sugar-analyze --quality
Analyzes source code for:
Output: Prioritized list of code quality improvements
/sugar-analyze --tests
Identifies untested code:
Output: Files and modules needing tests
/sugar-analyze --github
Scans GitHub repository:
Output: GitHub items ready for conversion to tasks
Verify Sugar's discovery configuration:
cat .sugar/config.yaml | grep -A 20 "discovery:"
Check:
Execute discovery based on user request:
# This would normally be internal to Sugar
# For demonstration, we'll use manual checks
Gather insights from:
Format results in priority order:
🔍 Sugar Codebase Analysis Results
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Summary
- 🐛 15 errors found in logs
- 🔧 23 code quality issues
- 🧪 12 files without tests
- 📝 8 open GitHub issues
🚨 Critical Issues (Recommend Priority 5)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. [Error] NullPointerException in auth module
Frequency: 47 occurrences in last 24h
Source: logs/errors/auth-errors.log
Impact: User authentication failures
2. [Security] SQL injection vulnerability
Location: src/database/queries.py:145
Severity: Critical
CWE: CWE-89
3. [GitHub] Critical: Production database connection leak (#342)
Labels: bug, critical, production
Age: 2 days
Comments: 5
⚠️ High Priority (Recommend Priority 4)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4. [Quality] High complexity in PaymentProcessor
Location: src/payments/processor.py
Cyclomatic Complexity: 45 (threshold: 10)
Lines: 500+
5. [Test] Missing tests for user authentication
Source: src/auth/authentication.py
Coverage: 0%
Critical: Yes
[... more findings ...]
💡 Recommended Actions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Create 3 urgent bug fix tasks
- Create 5 code quality improvement tasks
- Create 12 test coverage tasks
- Import 8 GitHub issues
Total: 28 potential tasks discovered
Offer user choices:
Create All Tasks Automatically
Create High-Priority Only
Review and Select
Save Report Only
Scans files matching configured patterns:
discovery:
error_logs:
paths: ["logs/errors/", "logs/feedback/"]
patterns: ["*.json", "*.log"]
max_age_hours: 24
Extracts:
Groups related errors and prioritizes by:
Scans source files:
discovery:
code_quality:
file_extensions: [".py", ".js", ".ts"]
excluded_dirs: ["node_modules", "venv", ".git"]
max_files_per_scan: 50
Checks for:
Prioritizes by:
Maps source to test files:
discovery:
test_coverage:
source_dirs: ["src", "lib", "app"]
test_dirs: ["tests", "test", "__tests__"]
Identifies:
Prioritizes by:
Queries GitHub API:
discovery:
github:
enabled: true
repo: "owner/repository"
issue_labels: ["bug", "enhancement"]
Fetches:
Filters and prioritizes by:
For each finding, create structured task:
sugar add "Fix NullPointerException in auth module" --json --description '{
"priority": 5,
"type": "bug_fix",
"context": "NullPointerException occurring 47 times in last 24h",
"source": "error_log_analysis",
"location": "logs/errors/auth-errors.log",
"technical_requirements": [
"Add null checks",
"Add logging",
"Add tests for edge cases"
],
"success_criteria": [
"Zero occurrences in next 24h",
"Tests cover null scenarios"
]
}'
Recommend regular analysis:
/sugar-analyze --errors
Quick check for new errors
/sugar-analyze
Comprehensive review of all sources
/sugar-analyze --quality --tests
Identify improvement opportunities
/sugar-analyze --github
Sync with external task sources
Generate detailed reports:
# Save analysis to file
sugar analyze > .sugar/analysis-report-$(date +%Y%m%d).txt
Report includes:
Add to daily workflow:
# Morning routine
sugar analyze --errors
sugar run --once
# In CI pipeline
sugar analyze --quality --tests > analysis.txt
# Create tasks for new issues
--priority 4--errors onlymax_files_per_scanUser: "/sugar-analyze --errors" Response: Finds 3 recent errors, suggests creating urgent tasks, shows error context
User: "/sugar-analyze" Response: Comprehensive analysis, 28 findings, groups by priority, offers batch task creation
User: "/sugar-analyze --tests" Response: Identifies 15 untested files, prioritizes critical paths, creates test tasks
Remember: Your goal is to help users proactively discover work, prioritize effectively, and maintain a healthy codebase through continuous analysis and task creation.