用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill json-report-generation命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Handles reading, populating, and saving .docx files using the python-docx library. Use this skill for any tasks involving template filling or modifying Word documents.
Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
This skill includes search capability in 13F, such as fuzzy search a fund information using possibly inaccurate name, or fuzzy search a stock cusip info using its name.
基于 SOC 职业分类
正在显示 SKILL.md
| name | json-report-generation |
| description | Generate and write structured JSON reports with proper formatting and validation. |
Create, validate, and write JSON reports with proper formatting and schema verification.
{
"pr": {
"total": 0,
"merged": 0,
"closed": 0,
"avg_merge_days": 0.0,
"top_contributor": "username"
},
"issue": {
"total": 0,
"bug": 0,
"resolved_bugs": 0
}
}
pr.total: Integer count of all PRs created during periodpr.merged: Integer count of merged PRs (as of report date)pr.closed: Integer count of closed (non-merged) PRspr.avg_merge_days: Float rounded to 1 decimal placepr.top_contributor: String username of author with most PRsissue.total: Integer count of all issues created during periodissue.bug: Integer count of issues with 'bug' in any labelissue.resolved_bugs: Integer count of bug issues that were closedimport json
report = {
"pr": {
"total": 125,
"merged": 95,
"closed": 20,
"avg_merge_days": 3.2,
"top_contributor": "alice"
},
"issue": {
"total": 45,
"bug": 18,
"resolved_bugs": 12
}
}
with open('/app/report.json', 'w') as f:
json.dump(report, f, indent=2)
import json
def validate_report(report):
"""Validate report structure and types"""
required_keys = {'pr', 'issue'}
pr_keys = {'total', 'merged', 'closed', 'avg_merge_days', 'top_contributor'}
issue_keys = {'total', 'bug', 'resolved_bugs'}
assert set(report.keys()) == required_keys, "Missing top-level keys"
assert set(report['pr'].keys()) == pr_keys, "Missing PR keys"
assert set(report['issue'].keys()) == issue_keys, "Missing issue keys"
assert isinstance(report['pr']['total'], int), "PR total must be int"
assert isinstance(report['pr']['merged'], int), "PR merged must be int"
assert isinstance(report['pr']['closed'], int), "PR closed must be int"
assert isinstance(report['pr']['avg_merge_days'], (int, float)),
(report[][], ),
(report[][], ),
(report[][], ),
(report[][], ),
():
validate_report(report)
(filepath, ) f:
json.dump(report, f, indent=)
()
import json
def print_report(report):
"""Pretty print report for verification"""
print("=" * 60)
print("DECEMBER 2024 - CLI/CLI REPOSITORY PULSE")
print("=" * 60)
print("\nPull Requests:")
print(f" Total Created: {report['pr']['total']}")
print(f" Merged: {report['pr']['merged']}")
print(f" Closed (unmerged):{report['pr']['closed']}")
print(f" Avg Merge Time: {report['pr']['avg_merge_days']} days")
print(f" Top Contributor: {report['pr']['top_contributor']}")
print("\nIssues:")
print(f" Total Created: {report['issue']['total']}")
print(f" Bug Reports: {report['issue']['bug']}")
print()
( * )
indent=2 for readable JSON formatting# Using jq to construct JSON (complex and error-prone)
jq -n \
--arg total "125" \
--arg merged "95" \
--arg closed "20" \
--arg avg "3.2" \
--arg contributor "alice" \
'{
pr: {total: ($total | tonumber), merged: ($merged | tonumber), closed: ($closed | tonumber), avg_merge_days: ($avg | tonumber), top_contributor: $contributor},
issue: {total: 45, bug: 18, resolved_bugs: 12}
}'