Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
humanizer/scripts/validate-package.py at main · blader/humanizer · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
blader
/
humanizer
Public
Notifications
You must be signed in to change notification settings
Fork
3.7k
Star
43.8k
Code
Issues
15
Pull requests
23
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
main
Breadcrumbs
humanizer
/
scripts
/
validate-package.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
88 lines (71 loc) · 2.92 KB
main
Breadcrumbs
humanizer
/
scripts
/
validate-package.py
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
88 lines (71 loc) · 2.92 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python3
"""Check Humanizer's package files without external dependencies."""
from
__future__
import
annotations
import
json
import
re
from
pathlib
import
Path
ROOT
=
Path
(
__file__
).
resolve
().
parent
.
parent
SKILL_PATH
=
ROOT
/
"SKILL.md"
SKILL
=
SKILL_PATH
.
read_text
(
encoding
=
"utf-8"
)
README
=
(
ROOT
/
"README.md"
).
read_text
(
encoding
=
"utf-8"
)
AGENTS
=
(
ROOT
/
"AGENTS.md"
).
read_text
(
encoding
=
"utf-8"
)
PLUGIN
=
json
.
loads
((
ROOT
/
".claude-plugin"
/
"plugin.json"
).
read_text
(
encoding
=
"utf-8"
))
def
require_match
(
match
:
re
.
Match
[
str
]
|
None
,
message
:
str
)
->
re
.
Match
[
str
]:
if
match
is
None
:
raise
SystemExit
(
message
)
return
match
yaml_metadata
=
require_match
(
re
.
match
(
r"\A---\n(.*?)\n---\n"
,
SKILL
,
re
.
DOTALL
),
"SKILL.md must begin with YAML metadata"
,
).
group
(
1
)
for
unsupported_field
in
(
"compatibility:"
,
"allowed-tools:"
):
if
re
.
search
(
rf"(?m)^
{
re
.
escape
(
unsupported_field
)
}
"
,
yaml_metadata
):
raise
SystemExit
(
f"Remove unsupported YAML field:
{
unsupported_field
[:
-
1
]
}
"
)
skill_version
=
require_match
(
re
.
search
(
r'(?m)^\s+version:\s*["\']([^"\']+)["\']\s*$'
,
yaml_metadata
),
"Add metadata.version to SKILL.md"
,
).
group
(
1
)
readme_version
=
require_match
(
re
.
search
(
r"(?m)^- \*\*([0-9]+\.[0-9]+\.[0-9]+)\*\*"
,
README
),
"Add a version entry to README.md"
,
).
group
(
1
)
package_versions
=
{
skill_version
,
readme_version
,
str
(
PLUGIN
.
get
(
"version"
,
""
))}
if
len
(
package_versions
)
!=
1
:
raise
SystemExit
(
f"Use one package version in all files:
{
sorted
(
package_versions
)
}
"
)
skill_files
=
{
path
.
relative_to
(
ROOT
)
for
path
in
ROOT
.
rglob
(
"SKILL.md"
)}
if
SKILL_PATH
.
is_symlink
()
or
skill_files
!=
{
Path
(
"SKILL.md"
)}:
raise
SystemExit
(
"Keep one regular SKILL.md at the repo root"
)
if
PLUGIN
.
get
(
"skills"
)
!=
[
"./"
]:
raise
SystemExit
(
"Point the Claude plugin skill loader at the repo root"
)
plain_language_rules
=
(
"## Writing style"
,
"Lead with the main point."
,
"Use common words and active voice."
,
"Keep sentences and paragraphs short."
,
"Use `must` for requirements."
,
"Keep the full technical meaning."
,
)
missing_plain_language_rules
=
[
rule
for
rule
in
plain_language_rules
if
rule
not
in
AGENTS
]
if
missing_plain_language_rules
:
raise
SystemExit
(
"Add the missing Plain Language rules to AGENTS.md: "
+
", "
.
join
(
missing_plain_language_rules
)
)
pattern_numbers
=
[
int
(
number
)
for
number
in
re
.
findall
(
r"(?m)^### ([0-9]+)\. "
,
SKILL
)
]
if
pattern_numbers
!=
list
(
range
(
1
,
36
)):
raise
SystemExit
(
f"Number SKILL.md patterns from 1 through 35:
{
pattern_numbers
}
"
)
readme_numbers
=
{
int
(
number
)
for
number
in
re
.
findall
(
r"(?m)^\| ([0-9]+) \|"
,
README
)
}
if
readme_numbers
!=
set
(
range
(
1
,
36
)):
raise
SystemExit
(
"List patterns 1 through 35 in the README table"
)
if
len
(
SKILL
.
splitlines
())
>
500
:
raise
SystemExit
(
"Keep SKILL.md at 500 lines or fewer"
)
print
(
f"Humanizer package v
{
skill_version
}
is valid"
)
You can’t perform that action at this time.