Repository navigation
feat(author): H5P.Row's widths and empty columns, the skill changes a package, the read in SECURITY.md #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
2f3d23f
feat(author): H5P.Row's widths and empty columns, the skill changes a…
alekswebnet 47038c2
fix(author): the skill's front matter parses again; route 3 reads a p…
alekswebnet 20ca2aa
test: the bundle command's test gets 20 s; a skill's name is held to …
alekswebnet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { readdir, readFile } from 'node:fs/promises' | ||
| import { resolve } from 'node:path' | ||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| /* | ||
| * Each skill's front matter as a YAML parser reads it: skills.sh, a chat that takes the skill as a | ||
| * zip and an agent's skill loader parse it, and one that does not parse is a skill they do not list | ||
| * (#242's description broke it with a colon). No YAML parser is in the workspace, so each line is | ||
| * held to the form the skills write, `key: value` with a plain value, which YAML ends at a colon | ||
| * followed by a space and cuts at a space followed by `#`; and the name and description to the | ||
| * Agent Skills specification's limits. | ||
| */ | ||
| const skills = resolve(import.meta.dirname, '../../../skills') | ||
| const names = (await readdir(skills, { withFileTypes: true })).filter((entry) => entry.isDirectory()).map((entry) => entry.name) | ||
|
|
||
| describe("the skills' front matter", () => { | ||
| it.each(names)('%s parses, its name its folder and its description under 1024 characters', async (name) => { | ||
| const text = await readFile(resolve(skills, name, 'SKILL.md'), 'utf8') | ||
| const front = /^---\n([\s\S]*?)\n---\n/.exec(text)?.[1] | ||
| expect(front, 'front matter between two --- lines').toBeDefined() | ||
| const fields = new Map<string, string>() | ||
| for (const line of front!.split('\n')) { | ||
| const [, key, value] = /^([a-z-]+): (.+)$/.exec(line) ?? [] | ||
| expect(key, `"${line.slice(0, 40)}" is a key and a value`).toBeDefined() | ||
| expect(value, `${key}: a colon followed by a space or the line's end ends a plain value`).not.toMatch(/:(?: |$)/) | ||
| expect(value, `${key}: a space followed by # starts a comment`).not.toMatch(/ #/) | ||
| expect(value, `${key}: a plain value cannot start with an indicator`).not.toMatch(/^[-?:,[\]{}#&*!|>'"%@`]/) | ||
| fields.set(key, value) | ||
| } | ||
| expect(fields.get('name')).toBe(name) | ||
| expect(name).toMatch(/^[a-z0-9]+(?:-[a-z0-9]+)*$/) | ||
| expect(name.length).toBeLessThanOrEqual(64) | ||
| expect(fields.get('description')?.length).toBeGreaterThan(0) | ||
| expect(fields.get('description')!.length).toBeLessThanOrEqual(1024) | ||
| }) | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.