skillchecker 0.2.0__tar.gz
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.
- skillchecker-0.2.0/LICENSE +202 -0
- skillchecker-0.2.0/PKG-INFO +380 -0
- skillchecker-0.2.0/README.md +352 -0
- skillchecker-0.2.0/pyproject.toml +46 -0
- skillchecker-0.2.0/setup.cfg +4 -0
- skillchecker-0.2.0/src/skillchecker/__init__.py +1 -0
- skillchecker-0.2.0/src/skillchecker/__main__.py +5 -0
- skillchecker-0.2.0/src/skillchecker/baseline.py +43 -0
- skillchecker-0.2.0/src/skillchecker/cli.py +102 -0
- skillchecker-0.2.0/src/skillchecker/config.py +274 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/claude-code/profile.yaml +20 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/claude-code/skill.schema.json +28 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/codex/profile.yaml +54 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/codex/skill.schema.json +49 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/copilot/agent.schema.json +40 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/copilot/profile.yaml +33 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/hermes/profile.yaml +61 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/hermes/skill.schema.json +10 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/spec/profile.yaml +90 -0
- skillchecker-0.2.0/src/skillchecker/data/hosts/spec/skill.schema.json +64 -0
- skillchecker-0.2.0/src/skillchecker/data/kinds.yaml +9 -0
- skillchecker-0.2.0/src/skillchecker/data/meta.schema.json +129 -0
- skillchecker-0.2.0/src/skillchecker/emit.py +125 -0
- skillchecker-0.2.0/src/skillchecker/engine.py +434 -0
- skillchecker-0.2.0/src/skillchecker/files.py +79 -0
- skillchecker-0.2.0/src/skillchecker/frontmatter.py +265 -0
- skillchecker-0.2.0/src/skillchecker/model.py +83 -0
- skillchecker-0.2.0/src/skillchecker.egg-info/PKG-INFO +380 -0
- skillchecker-0.2.0/src/skillchecker.egg-info/SOURCES.txt +41 -0
- skillchecker-0.2.0/src/skillchecker.egg-info/dependency_links.txt +1 -0
- skillchecker-0.2.0/src/skillchecker.egg-info/entry_points.txt +2 -0
- skillchecker-0.2.0/src/skillchecker.egg-info/requires.txt +5 -0
- skillchecker-0.2.0/src/skillchecker.egg-info/top_level.txt +1 -0
- skillchecker-0.2.0/tests/test_action.py +193 -0
- skillchecker-0.2.0/tests/test_baseline.py +90 -0
- skillchecker-0.2.0/tests/test_cli.py +127 -0
- skillchecker-0.2.0/tests/test_config.py +248 -0
- skillchecker-0.2.0/tests/test_discovery.py +179 -0
- skillchecker-0.2.0/tests/test_emit.py +71 -0
- skillchecker-0.2.0/tests/test_fixture_tree.py +37 -0
- skillchecker-0.2.0/tests/test_frontmatter.py +150 -0
- skillchecker-0.2.0/tests/test_hosts.py +248 -0
- skillchecker-0.2.0/tests/test_rules.py +278 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: skillchecker
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A data-driven linter for agent skill files (SKILL.md) and agent context files.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/yaooqinn/skillchecker
|
|
7
|
+
Project-URL: Issues, https://github.com/yaooqinn/skillchecker/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/yaooqinn/skillchecker/blob/main/CHANGELOG.md
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: PyYAML>=6.0
|
|
24
|
+
Requires-Dist: jsonschema>=4.18
|
|
25
|
+
Provides-Extra: test
|
|
26
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# skillchecker
|
|
30
|
+
|
|
31
|
+
A linter for agent skill files (`SKILL.md`) and agent context files. It checks each file
|
|
32
|
+
against the open [Agent Skills specification](https://agentskills.io/specification) and against
|
|
33
|
+
the rules of the hosts you target, such as Claude Code, GitHub Copilot and Codex. You can add
|
|
34
|
+
rules for your own repository.
|
|
35
|
+
|
|
36
|
+
All rules are data. Every rule has an id, a severity, a message and a `source` that links to
|
|
37
|
+
the document or code line it comes from. The tool does not read your home directory or any
|
|
38
|
+
environment variable, so the same tree gives the same findings on every machine. (File kinds
|
|
39
|
+
and location rules also look at the names of the directories above the lint root, up to the
|
|
40
|
+
nearest one that holds `.git`, but read nothing there.)
|
|
41
|
+
|
|
42
|
+
It runs on your machine, as a GitHub Action, and in Azure Pipelines.
|
|
43
|
+
|
|
44
|
+
Status: preview. Install with `pip install skillchecker` or use the GitHub Action.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install git+https://github.com/yaooqinn/skillchecker
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
It needs Python 3.10 or later on Linux or macOS. Windows is not supported yet. It depends on
|
|
53
|
+
PyYAML and jsonschema.
|
|
54
|
+
|
|
55
|
+
## Command line
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
skillchecker lint . --hosts spec,claude-code
|
|
59
|
+
skillchecker lint plugins/a plugins/b --format json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Each `PATH` is a root. Files are found under it, and its own `.skillchecker.yaml` applies.
|
|
63
|
+
Finding paths start with the `PATH` you gave, so they point at the right file in CI. Roots
|
|
64
|
+
must not overlap: the same directory twice, or one root inside another, exits with code `2`,
|
|
65
|
+
whatever names reach it (a link, or `pkg` and `PKG` on a case-insensitive volume).
|
|
66
|
+
|
|
67
|
+
| Option | Meaning |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `--hosts` | Comma-separated host profiles. Default: `hosts` in the config. |
|
|
70
|
+
| `--format` | `text` (default), `json`, `sarif` (SARIF 2.1.0), `github` (workflow commands), `azure` (Azure Pipelines logging commands). |
|
|
71
|
+
| `--config` | A config file to use for every `PATH`. Default: `PATH/.skillchecker.yaml` if it exists. |
|
|
72
|
+
| `--fail-on` | `error` (default), `warning`, `info` or `never`. |
|
|
73
|
+
|
|
74
|
+
Exit codes: `0` no finding at or above `--fail-on`; `1` at least one; `2` bad input, such as
|
|
75
|
+
an unknown host, a malformed config or a path that is not a directory.
|
|
76
|
+
|
|
77
|
+
A JSON finding looks like this (source shortened):
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"id": "spec.unknown-key",
|
|
82
|
+
"path": ".agents/skills/a/SKILL.md",
|
|
83
|
+
"line": 4,
|
|
84
|
+
"host": "spec",
|
|
85
|
+
"severity": "error",
|
|
86
|
+
"source": "https://github.com/agentskills/agentskills/blob/83021e2.../docs/specification.mdx#L25-L32 (field table); ...",
|
|
87
|
+
"message": "key not in the specification field table: 'platforms'",
|
|
88
|
+
"fingerprint": "c2c6b2fea0204d5c"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`line` is `null` when the finding is about the file as a whole, such as a skill in a
|
|
93
|
+
directory the host does not load.
|
|
94
|
+
|
|
95
|
+
File names and frontmatter text come from the checkout, so text output keeps each finding on
|
|
96
|
+
one line: unprintable characters, such as a newline, print as escapes, and so does a
|
|
97
|
+
CI runner command marker (`##[`, `##vso[`, or `::` at the start of a line). With
|
|
98
|
+
`--format github` or `azure`, a config error is printed as an error command with its text
|
|
99
|
+
escaped.
|
|
100
|
+
|
|
101
|
+
## GitHub Action
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
- uses: actions/checkout@v7
|
|
105
|
+
- uses: yaooqinn/skillchecker@v0.2.0
|
|
106
|
+
with:
|
|
107
|
+
paths: .
|
|
108
|
+
hosts: spec,claude-code,copilot
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Pin a release tag or, for a stronger guarantee, the commit SHA of one.
|
|
112
|
+
|
|
113
|
+
Findings show as annotations on the pull request. The step fails when a finding reaches
|
|
114
|
+
`fail-on`. The action runs on Linux and macOS runners; on a Windows runner it stops with an
|
|
115
|
+
error.
|
|
116
|
+
|
|
117
|
+
| Input | Default | Meaning |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| `paths` | `.` | Directories to lint, separated by spaces or newlines. A name with a space cannot be given. |
|
|
120
|
+
| `hosts` | empty | Comma-separated host profiles. Empty means the hosts in the config. |
|
|
121
|
+
| `format` | `github` | Any `--format` value. `github` prints annotations. |
|
|
122
|
+
| `config` | empty | A config file for every path. |
|
|
123
|
+
| `fail-on` | `error` | `error`, `warning`, `info` or `never`. |
|
|
124
|
+
| `setup-python` | `true` | Run `actions/setup-python` first. Set `false` if the job already has Python 3.10 or later as `python` or `python3`. |
|
|
125
|
+
| `python-version` | `3.13` | The version `actions/setup-python` installs. |
|
|
126
|
+
|
|
127
|
+
With a format other than `github`, the action stops workflow commands while the output prints
|
|
128
|
+
(`::stop-commands::` with a random token), so no line of a JSON or SARIF report runs as a
|
|
129
|
+
command.
|
|
130
|
+
|
|
131
|
+
The step output `exit-code` holds the command line's exit code (`0`, `1` or `2`), or `2` if
|
|
132
|
+
setting up Python or installation fails, so a later step can tell findings from errors.
|
|
133
|
+
|
|
134
|
+
The action installs itself into a fresh private virtual environment, so it does not change the
|
|
135
|
+
job's Python packages. It runs Python in isolated mode, so modules in your checkout cannot
|
|
136
|
+
replace the ones it imports.
|
|
137
|
+
|
|
138
|
+
In Azure Pipelines, run the command line with `--format azure`.
|
|
139
|
+
|
|
140
|
+
## Hosts
|
|
141
|
+
|
|
142
|
+
| Host id | Checks against |
|
|
143
|
+
|---|---|
|
|
144
|
+
| `spec` | The [Agent Skills specification](https://agentskills.io/specification) at agentskills/agentskills@83021e2: required fields, field types and lengths, name format, name equal to the directory, known fields only, under 500 lines. Like the reference parser (strictyaml), it reads every YAML scalar as a string and rejects flow style, anchors, aliases, tags and a BOM before the frontmatter. |
|
|
145
|
+
| `claude-code` | The [Claude Code skills docs](https://code.claude.com/docs/en/skills): the `.claude/skills` root, plugin skills and the frontmatter reference. |
|
|
146
|
+
| `copilot` | [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-skills) 1.0.121: skill roots, and custom agent roots and fields. |
|
|
147
|
+
| `codex` | OpenAI Codex CLI 0.166.0, as recorded in the [NVIDIA SkillEvaluator](https://github.com/NVIDIA/SkillEvaluator) v1.3.1 Codex profile: roots, BOM, repeated keys, description rules, ignored fields. |
|
|
148
|
+
| `hermes` | [Hermes Agent](https://github.com/NousResearch/hermes-agent) at caafe5389a: roots, the write-path validator and the advisory linter. |
|
|
149
|
+
|
|
150
|
+
Read the `source` of a finding to see where its rule comes from. The rule files are in
|
|
151
|
+
[`src/skillchecker/data/hosts`](src/skillchecker/data/hosts).
|
|
152
|
+
|
|
153
|
+
## Files it checks
|
|
154
|
+
|
|
155
|
+
Each file gets one kind: the first kind whose glob matches its path from the root or, as for
|
|
156
|
+
location rules, from a directory above the root. So linting `.github/agents` itself finds its
|
|
157
|
+
plain `*.md` agents. The defaults:
|
|
158
|
+
|
|
159
|
+
| Kind | Glob |
|
|
160
|
+
|---|---|
|
|
161
|
+
| `skill` | `**/SKILL.md` (any `SKILL.md`; each host's location rule says whether it loads from there) |
|
|
162
|
+
| `skill-file` | `**/skills/*/**` (other files in a skill directory) |
|
|
163
|
+
| `agents-md` | `**/AGENTS.md` |
|
|
164
|
+
| `agent` | `**/*.agent.md`, and any `*.md` under `.github/agents` or `.claude/agents` |
|
|
165
|
+
|
|
166
|
+
A non-empty `kinds` map in the config replaces this list. `**/` matches any number of directories,
|
|
167
|
+
`**` matches anything, and `*` matches within one path segment.
|
|
168
|
+
|
|
169
|
+
A file is opened only if a selected host or repository rule applies to its kind. Only regular
|
|
170
|
+
files inside the root are read, up to 1 MiB. Directory links inside the root are followed, as
|
|
171
|
+
hosts follow them. Anything else is reported as `repo.not-checked` (an error) and not read: a
|
|
172
|
+
link to a file or directory outside the root, a broken link, a special file such as a FIFO, a
|
|
173
|
+
file over 1 MiB, or a directory that cannot be listed.
|
|
174
|
+
|
|
175
|
+
A file that is not UTF-8 text, or holds a NUL byte, is treated as binary: text rules skip it,
|
|
176
|
+
and a file whose frontmatter rules apply gets a parse error.
|
|
177
|
+
|
|
178
|
+
## Frontmatter that does not parse
|
|
179
|
+
|
|
180
|
+
When a file's frontmatter is not closed or is not a YAML mapping, the schema checks of every
|
|
181
|
+
host cannot run. A host rule reports this where the host has one, such as
|
|
182
|
+
`spec.frontmatter-yaml` or `host.hermes.unclosed-frontmatter`. If none of the selected hosts
|
|
183
|
+
has such a rule, `repo.frontmatter-unchecked` (an error) reports it once for the file and names
|
|
184
|
+
the hosts whose checks did not run, so the file cannot pass unchecked.
|
|
185
|
+
|
|
186
|
+
Like the reference parser, the frontmatter ends at the first later line that is `---`, even
|
|
187
|
+
when that line was meant as a thematic break in the body.
|
|
188
|
+
|
|
189
|
+
## Configure a repository
|
|
190
|
+
|
|
191
|
+
Put `.skillchecker.yaml` at the root you lint. Every key except `version` is optional.
|
|
192
|
+
|
|
193
|
+
```yaml
|
|
194
|
+
version: 1
|
|
195
|
+
hosts: [spec, claude-code, copilot]
|
|
196
|
+
allowed-keys: # extra keys the hosts' unknown-key rules accept
|
|
197
|
+
skill: [owner]
|
|
198
|
+
host-dirs: [lint/hosts] # more host profiles, see "Add a host"
|
|
199
|
+
baseline: lint/baseline.yaml
|
|
200
|
+
rules: [] # repository rules, see below
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`allowed-keys` only silences unknown-key findings (a host schema's `propertyNames`). It does
|
|
204
|
+
not silence a rule about a known key, such as a host ignoring `allowed-tools`; use the baseline
|
|
205
|
+
for that.
|
|
206
|
+
|
|
207
|
+
## Add a repository rule
|
|
208
|
+
|
|
209
|
+
Add an entry to `rules`. The id starts with `repo.`. Each rule names the kinds it applies
|
|
210
|
+
to, a severity (`error`, `warning` or `info`), a message, a source and a check.
|
|
211
|
+
|
|
212
|
+
```yaml
|
|
213
|
+
rules:
|
|
214
|
+
- id: repo.description-trigger
|
|
215
|
+
kinds: [skill]
|
|
216
|
+
severity: warning
|
|
217
|
+
message: description has no 'Use when' trigger
|
|
218
|
+
source: https://example.com/our-skill-guide#descriptions
|
|
219
|
+
check:
|
|
220
|
+
type: schema
|
|
221
|
+
schema: {properties: {description: {type: string, pattern: "Use when"}}}
|
|
222
|
+
- id: repo.no-home-path
|
|
223
|
+
kinds: [skill, skill-file, agents-md]
|
|
224
|
+
severity: warning
|
|
225
|
+
message: home directory path in the text
|
|
226
|
+
source: https://example.com/our-skill-guide#paths
|
|
227
|
+
check: {type: text-absent, pattern: "/(home|Users)/[^/\\s]+/"}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Check types:
|
|
231
|
+
|
|
232
|
+
| Type | Finds |
|
|
233
|
+
|---|---|
|
|
234
|
+
| `schema` | Frontmatter that fails an inline JSON Schema (draft 2020-12). |
|
|
235
|
+
| `text-absent` | Lines that match a regular expression. |
|
|
236
|
+
| `max-lines` | Files longer than `max` lines. |
|
|
237
|
+
| `in-root` | Files whose path matches none of the `roots` globs. The globs are matched against the path from the root and from each directory above it, up to the nearest directory that holds `.git` (the root included), so linting `.agents/skills` or a single skill directory keeps the location, and a checkout inside another tree's folder does not count as inside it. An optional `plugin-roots` also accepts a file at one of those globs below a directory of the lint root that holds a Claude Code plugin manifest, `.claude-plugin/plugin.json`, as a regular file inside the root (of any size: it is not read). |
|
|
238
|
+
| `name-matches-dir` | A `field` (default `name`) not equal to the parent directory (the root's name for a file at the root). An empty value is skipped. |
|
|
239
|
+
| `field-pattern` | A `field` that does not match `pattern` (a Python regular expression, searched). |
|
|
240
|
+
| `field-max-length` | A `field` longer than `max` characters. |
|
|
241
|
+
| `field-true` | A `field` that is `true` or the string `true`, unless the YAML file `unless.file` next to the file holds `unless.equals` at `unless.path`. |
|
|
242
|
+
| `frontmatter-present` | A file whose first line is not `---`. With `allow-bom: false`, also a UTF-8 BOM before the `---`. |
|
|
243
|
+
| `frontmatter-closed` | Frontmatter with no closing `---`. |
|
|
244
|
+
| `frontmatter-parses` | Frontmatter that is not a valid YAML mapping. |
|
|
245
|
+
| `duplicate-keys` | A frontmatter key that appears twice in one mapping. |
|
|
246
|
+
| `links-exist` | Relative Markdown links in the body, outside fenced code and inline code, whose target does not exist. |
|
|
247
|
+
| `bom` | A file that starts with a UTF-8 byte order mark. |
|
|
248
|
+
| `symlink` | A file that is itself a symbolic link (a linked folder on its path does not count). |
|
|
249
|
+
| `body-present` | Closed frontmatter with nothing but whitespace after it. |
|
|
250
|
+
|
|
251
|
+
The `name-matches-dir` and `field-*` checks take an optional `coerce`, which reads the field the
|
|
252
|
+
way a host's Python code does: `none` (default; a non-string value is skipped), `str`
|
|
253
|
+
(`str(value)`), `str-strip` (`str(value).strip()`), `str-strip-quotes` (also strips quotes) or
|
|
254
|
+
`strip-nfkc` (a string stripped, then NFKC-normalized, as the Agent Skills reference validator
|
|
255
|
+
reads a name; a non-string value is skipped). With `strip-nfkc`, `name-matches-dir` also
|
|
256
|
+
NFKC-normalizes the directory name.
|
|
257
|
+
|
|
258
|
+
The config is checked before any file is read. A rule without a source, or with an unknown
|
|
259
|
+
kind or check type, stops the run with exit code 2.
|
|
260
|
+
|
|
261
|
+
A new check type is code: one function in `CHECKS` in
|
|
262
|
+
[`engine.py`](src/skillchecker/engine.py) and its shape in
|
|
263
|
+
[`meta.schema.json`](src/skillchecker/data/meta.schema.json). A new file kind is data: a
|
|
264
|
+
glob in `kinds` and rules that name the kind.
|
|
265
|
+
|
|
266
|
+
## Add a host
|
|
267
|
+
|
|
268
|
+
A host is a directory named after the host id. It holds `profile.yaml` and one JSON Schema
|
|
269
|
+
per file kind it checks. Put it in a directory listed in `host-dirs`, or under
|
|
270
|
+
`src/skillchecker/data/hosts` to ship it with the tool.
|
|
271
|
+
|
|
272
|
+
```yaml
|
|
273
|
+
# lint/hosts/acme/profile.yaml
|
|
274
|
+
host: acme
|
|
275
|
+
title: Acme agent 2.0
|
|
276
|
+
kinds:
|
|
277
|
+
skill:
|
|
278
|
+
schema: skill.schema.json
|
|
279
|
+
rules:
|
|
280
|
+
- id: host.acme.no-license
|
|
281
|
+
severity: error
|
|
282
|
+
message: license is not supported
|
|
283
|
+
source: https://acme.example/docs/skills#fields
|
|
284
|
+
- id: host.acme.not-in-root
|
|
285
|
+
severity: warning
|
|
286
|
+
message: Acme does not load a skill outside .acme/skills
|
|
287
|
+
source: https://acme.example/docs/skills#locations
|
|
288
|
+
check: {type: in-root, roots: [".acme/skills/*/SKILL.md"]}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{"properties": {"license": {"not": {}, "x-rule": "host.acme.no-license"}}}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
A profile's `yaml` names the YAML parser the host uses. The default, `pyyaml`, builds YAML 1.1
|
|
296
|
+
values as PyYAML's `safe_load` does. `strictyaml` keeps every scalar a string and rejects flow
|
|
297
|
+
style, anchors, aliases and tags, as a schema-less strictyaml load does.
|
|
298
|
+
|
|
299
|
+
Rule ids start with `host.<host>.`. A rule with a `check` runs that check. A rule without one
|
|
300
|
+
is raised by the schema: the `x-rule` next to a schema keyword names the rule it raises. Use
|
|
301
|
+
a string for one rule, or a map from keyword to rule id, such as
|
|
302
|
+
`{"type": "host.acme.name-type", "maxLength": "host.acme.name-length"}`.
|
|
303
|
+
|
|
304
|
+
The profile does not load if the `x-rule` ids in the schema differ from the rules without a
|
|
305
|
+
check, or if a keyword that can fail, such as `type` or `required`, has no `x-rule`. So every
|
|
306
|
+
schema error has an id, a severity and a source, and no rule is dead. A host schema or a
|
|
307
|
+
repository `schema` rule, inline or in a file, cannot use `$ref` or `$dynamicRef`: each schema
|
|
308
|
+
is self-contained, so a lint run never fetches a file or a URL. Schemas use JSON Schema draft
|
|
309
|
+
2020-12; a `$schema` anywhere in a schema, `$defs` included, that names another dialect is a
|
|
310
|
+
config error. A `false` subschema is a config error too; write `{"not": {}}` instead.
|
|
311
|
+
|
|
312
|
+
Data files (config, baseline, profiles, schemas) are read as UTF-8 on every platform; one that
|
|
313
|
+
is not UTF-8 stops the run with exit code 2.
|
|
314
|
+
|
|
315
|
+
Then select the host with `--hosts acme` or `hosts: [acme]`.
|
|
316
|
+
|
|
317
|
+
## Baseline
|
|
318
|
+
|
|
319
|
+
A baseline hides findings you have reviewed. Each entry needs a reason.
|
|
320
|
+
|
|
321
|
+
```yaml
|
|
322
|
+
# lint/baseline.yaml
|
|
323
|
+
entries:
|
|
324
|
+
- fingerprint: c2c6b2fea0204d5c
|
|
325
|
+
reason: the legacy skill keeps this key until the next release
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
An entry may also hold `id` and `path` as notes for readers; only the fingerprint is matched,
|
|
329
|
+
and it already covers the rule id and the path.
|
|
330
|
+
|
|
331
|
+
Take the fingerprint from the JSON or SARIF output. It hashes the rule id, the path, the host,
|
|
332
|
+
the text of the line and the finding's detail, such as the missing key, but not the line
|
|
333
|
+
number. So an entry still matches after edits above it, and does not hide a different finding
|
|
334
|
+
on the same line. A line-limit finding hashes neither, so it survives edits to the file. An
|
|
335
|
+
entry without a reason is an error (`repo.baseline-reason`) and hides nothing.
|
|
336
|
+
|
|
337
|
+
## Limitations
|
|
338
|
+
|
|
339
|
+
- Azure Pipelines output is tested for format only. Azure has no info issue type, so info
|
|
340
|
+
findings print as plain log lines.
|
|
341
|
+
- There is no command to write a baseline, and no report of baseline entries that no longer
|
|
342
|
+
match.
|
|
343
|
+
- Each host profile covers one version of the host.
|
|
344
|
+
- Outside a Git checkout (no `.git` at or above the lint root), kinds and location rules match
|
|
345
|
+
the directory names above the lint root up to the file system root.
|
|
346
|
+
- The `strictyaml` parser mode rejects what strictyaml rejects for flow style, anchors,
|
|
347
|
+
aliases and tags, but not its other checks, such as sibling mappings indented differently.
|
|
348
|
+
- The `in-root` globs do not model that Codex skips hidden folders, or that Hermes skips a
|
|
349
|
+
`SKILL.md` inside another skill's `references/`, `templates/`, `scripts/` or `assets/`.
|
|
350
|
+
- A Claude Code plugin is recognised by its `.claude-plugin/plugin.json`, at or below the lint
|
|
351
|
+
root. Skills of a plugin without one, in folders its manifest's `skills` key adds, or in a
|
|
352
|
+
`SKILL.md` at the plugin root (loaded only when the plugin has no `skills/` folder and no
|
|
353
|
+
`skills` key), get a location warning.
|
|
354
|
+
- `links-exist` skips fenced code and inline code, but still reads indented code blocks and
|
|
355
|
+
HTML. It misses links whose text holds brackets or whose target nests parentheses more than
|
|
356
|
+
one level deep, reads an inline code span that spans lines, and reads fences inside block
|
|
357
|
+
quotes and list items as prose.
|
|
358
|
+
- Hermes keeps a legacy description over 60 characters when an edit leaves it unchanged. The
|
|
359
|
+
linter cannot tell a legacy description from a new one, so it reports both; put a legacy
|
|
360
|
+
one in the baseline.
|
|
361
|
+
- A rule's `source` must not be empty, but is not checked to be a link.
|
|
362
|
+
- Windows is not supported. CI runs on Linux and macOS.
|
|
363
|
+
- Not covered yet: Claude Code subagents, Copilot in VS Code and in the cloud agent, host
|
|
364
|
+
rules for `AGENTS.md`, Copilot rules for `SKILL.md` fields, and skills in user home
|
|
365
|
+
directories.
|
|
366
|
+
|
|
367
|
+
## Development
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
python -m venv .venv
|
|
371
|
+
.venv/bin/pip install -e ".[test]"
|
|
372
|
+
.venv/bin/python -m pytest -q
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
`tests/fixtures/repo` is a sample tree. `tests/fixtures/repo.expected.json` lists every
|
|
376
|
+
finding it must produce, and nothing else.
|
|
377
|
+
|
|
378
|
+
## License
|
|
379
|
+
|
|
380
|
+
Apache License 2.0. See [LICENSE](LICENSE).
|