Skip to content

Fix consecutive-hyphen Skill name validation - #13

Merged
zwliJay merged 1 commit into
Tencent:mainfrom
Yong-yuan-X:fix/static-check-double-hyphen
Sep 19, 2026
Merged

zwliJay merged 1 commit into
Tencent:mainfrom
Yong-yuan-X:fix/static-check-double-hyphen

Conversation

@Yong-yuan-X

@Yong-yuan-X Yong-yuan-X commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #12

修复 Skill 名称静态检查遗漏连续连字符(--)的问题。
此前,pdf--processing 这样的名称能够通过检查,但 Agent Skills specification 明确规定 Skill 名称不能包含连续连字符。

What changed

  • 更新 skills/skillhone/scripts/quality/static_check.py 中的名称正则表达式,拒绝包含 -- 的名称。
  • 新增 .test/test_static_check_name.py 回归测试:
    • 验证 pdf--processing 会报告 invalid_name
    • 验证合法名称 pdf-processing 仍然可以通过检查。
  • 将该回归测试加入 GitHub Actions CI。

Reproduction

使用名称和目录均为 pdf--processing 的最小 Skill fixture 运行静态检查。

修复前:

  • pdf--processing 没有产生 invalid_name
  • 静态检查以退出码 0 结束。

运行回归测试:

python .test/test_static_check_name.py

修复后,包含连续连字符的名称会被拒绝,单连字符名称仍然有效。

Validation and results

  • Command: python .test/test_static_check_name.py

  • Result: 2/2 passed

  • Before → after: pdf--processing 从未报告错误变为报告 invalid_name

  • Commands:

    python skills/skillhone/scripts/quality/static_check.py skills/skillhone
    python skills/skillhone/scripts/quality/static_check.py skills/skillhone-auto-optimization
    python skills/skillhone/scripts/quality/static_check.py skills/skillhone-benchmark-optimization
  • Result: 3/3 Skill directories passed

  • Command: git diff --check

  • Result: passed

  • Command: pnpm test

  • Result: 受 Windows 环境差异影响,完整测试结果待维护者批准 GitHub Actions 后由 Ubuntu CI 进一步验证;本次修改相关的回归测试已 2/2 passed

  • Command: gitleaks dir . --no-banner --redact

  • Result: current PR contents passed with 0 findings

  • Command: gitleaks git . --no-banner --redact

  • Result: 21 commits scanned, 0 findings

Effect and limits

现在包含连续连字符的 Skill 名称会被静态检查拒绝,校验行为与 Agent Skills specification 保持一致。

本次修改仅收紧名称格式校验,没有改变其他 frontmatter 规则;合法的单连字符名称继续通过检查。

Review checklist

  • The linked Issue and reproduction are clear.
  • Focused repository tests pass, with counts reported above.
  • The diff contains only files needed for this fix.
  • I ran git diff --check.
  • I ran gitleaks or an equivalent credential scan.
  • This change contains no API keys, private prompts, private traces, or generated local state.
  • No generated repair was pushed or merged automatically.
  • A user has reviewed the Issue, tests, commits, and changed files before merge.

@Yong-yuan-X
Yong-yuan-X marked this pull request as ready for review September 18, 2026 15:05
@zwliJay
zwliJay merged commit c613aa9 into Tencent:main Sep 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 静态检查错误接受包含连续连字符(--)的 Skill 名称

2 participants