agent-skill-kit-commons
Shared assets and reference implementations consumed by every other skill in the agent-skills-kit. Holds the runtime packages (mjs + py implementations of `skills-ref`), the canonical test/audit/lint/parser fixtures consumed by both runtimes, the parity-test scripts that pin mjs ↔ py twin behavior, and the closure-walks examples that anchor SDK documentation against real CLI behavior. Use when an agent needs to invoke `skills-ref`, run a parity check, regenerate a fixture, or learn the canonical test corpus. Other skills load this one as a dependency so they can rely on a single canonical asset tree instead of duplicating fixtures.
- License 许可
- MIT
- 最近更新
- 2026-08-25
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- agent-skill-kit-commons
- tier
- org
- license
- MIT
- metadata
- { "role": "commons", "consumer-pattern": "dependency" }
- description
- Shared assets and reference implementations consumed by every other skill in the agent-skills-kit. Holds the runtime packages (mjs + py implementations of `skills-ref`), the canonical test/audit/lint/parser fixtures consumed by both runtimes, the parity-test scripts that pin mjs ↔ py twin behavior, and the closure-walks examples that anchor SDK documentation against real CLI behavior. Use when an agent needs to invoke `skills-ref`, run a parity check, regenerate a fixture, or learn the canonical test corpus. Other skills load this one as a dependency so they can rely on a single canonical asset tree instead of duplicating fixtures.
- compatibility
- requires node>=20 and uv (Python 3.11+) installed on PATH for full functionality
02 资源文件 189
- 参考文档examples/closure-walks.md4.6 KB
- 其他fixtures/deps/.gitkeep—
- 参考文档fixtures/deps/expected/cycle-2.json449 B
- 参考文档fixtures/deps/expected/cycle-3.json628 B
- 参考文档fixtures/deps/expected/deep-chain.json770 B
- 参考文档fixtures/deps/expected/diamond.json761 B
- 参考文档fixtures/deps/expected/disconnected.json100 B
- 参考文档fixtures/deps/expected/inversion-org-team.json321 B
- 参考文档fixtures/deps/expected/inversion-team-app.json320 B
- 参考文档fixtures/deps/expected/linear.json430 B
- 其他fixtures/invalid/.gitkeep—
- 其他fixtures/lint/.gitkeep—
- 参考文档fixtures/lint/descriptions.json1.8 KB
- 参考文档fixtures/lint/expected_scores.json1.5 KB
- 其他fixtures/naming/.gitkeep—
- 参考文档fixtures/naming/expected/dir-name-mismatch.json147 B
- 参考文档fixtures/naming/expected/passing-clean.json3 B
- 参考文档fixtures/optimize/expected/low-score-vague.json1.9 KB
- 其他fixtures/parsed/.gitkeep—
- 参考文档fixtures/parsed/expected/valid-minimal.json333 B
- 参考文档fixtures/parsed/expected/valid-optional.json673 B
- 其他fixtures/prompt/.gitkeep—
- 其他fixtures/prompt/expected.xml862 B
- 其他fixtures/properties/.gitkeep—
- 参考文档fixtures/properties/expected_root.json2.7 KB
- 参考文档fixtures/properties/expected_single.json531 B
- 参考文档fixtures/README.md1.2 KB
- 其他fixtures/valid/.gitkeep—
- 其他packages/mjs/.gitignore30 B
- 参考文档packages/mjs/assets/action_verbs.txt1.5 KB
- 参考文档packages/mjs/assets/injection_patterns.json619 B
- 参考文档packages/mjs/assets/negative_query_bank.txt1.3 KB
- 参考文档packages/mjs/assets/stop_words.txt622 B
- 参考文档packages/mjs/assets/vague_phrases.txt598 B
- 参考文档packages/mjs/assets/vendor_prefixes.txt63 B
- 其他packages/mjs/bin/.gitkeep—
- 脚本packages/mjs/bin/check-naming.mjs1.3 KB
- 脚本packages/mjs/bin/dump-deps.mjs1002 B
- 脚本packages/mjs/bin/dump-parsed.mjs1.0 KB
- 脚本packages/mjs/bin/dump-registry.mjs1.0 KB
- 脚本packages/mjs/bin/dump-score.mjs839 B
- 其他packages/mjs/bin/skills-ref316 B
- 脚本packages/mjs/eslint.config.mjs459 B
- 其他packages/mjs/Makefile2.3 KB
- 参考文档packages/mjs/package-lock.json81.1 KB
- 参考文档packages/mjs/package.json896 B
- 其他packages/mjs/src/.gitkeep—
- 脚本packages/mjs/src/audit/deps_origin.mjs1.2 KB
- 脚本packages/mjs/src/audit/frontmatter.mjs988 B
- 脚本packages/mjs/src/audit/path_leak.mjs3.4 KB
- 脚本packages/mjs/src/audit/printer.mjs1.0 KB
- 脚本packages/mjs/src/audit/scripts.mjs2.4 KB
- 脚本packages/mjs/src/cli/dispatch.mjs2.0 KB
- 脚本packages/mjs/src/cli/format.mjs1.2 KB
- 脚本packages/mjs/src/cli/verbs/audit.mjs2.3 KB
- 脚本packages/mjs/src/cli/verbs/deps.mjs3.0 KB
- 脚本packages/mjs/src/cli/verbs/lint.mjs4.8 KB
- 脚本packages/mjs/src/cli/verbs/optimize.mjs4.0 KB
- 脚本packages/mjs/src/cli/verbs/read-properties.mjs2.5 KB
- 脚本packages/mjs/src/cli/verbs/to-prompt.mjs2.9 KB
- 脚本packages/mjs/src/cli/verbs/validate.mjs4.6 KB
- 脚本packages/mjs/src/deps/conflict.mjs2.1 KB
- 脚本packages/mjs/src/deps/inversion.mjs1.1 KB
- 脚本packages/mjs/src/deps/range.mjs2.0 KB
- 脚本packages/mjs/src/deps/toposort.mjs2.2 KB
- 脚本packages/mjs/src/index.mjs993 B
- 脚本packages/mjs/src/lint/index.mjs1004 B
- 脚本packages/mjs/src/lint/neutrality.mjs1.2 KB
- 脚本packages/mjs/src/lint/scorer.mjs2.8 KB
- 脚本packages/mjs/src/optimize/apply.mjs1.5 KB
- 脚本packages/mjs/src/optimize/generate.mjs1.9 KB
- 脚本packages/mjs/src/optimize/index.mjs1.4 KB
- 脚本packages/mjs/src/optimize/providers/none.mjs360 B
- 脚本packages/mjs/src/optimize/rewrite.mjs3.1 KB
- 脚本packages/mjs/src/optimize/score.mjs1.2 KB
- 脚本packages/mjs/src/parser.mjs4.1 KB
- 脚本packages/mjs/src/prompt/budget.mjs660 B
- 脚本packages/mjs/src/prompt/read_properties.mjs1.6 KB
- 脚本packages/mjs/src/prompt/xml.mjs623 B
- 脚本packages/mjs/src/registry.mjs2.5 KB
- 脚本packages/mjs/src/rules/body.mjs1.0 KB
- 脚本packages/mjs/src/rules/naming.mjs2.6 KB
- 脚本packages/mjs/src/rules/optional_dirs.mjs803 B
- 脚本packages/mjs/src/rules/references.mjs1.1 KB
- 脚本packages/mjs/src/types.mjs1008 B
- 其他packages/mjs/test/.gitkeep—
- 脚本packages/mjs/test/audit.test.mjs4.9 KB
- 脚本packages/mjs/test/body.test.mjs1.3 KB
- 脚本packages/mjs/test/naming.test.mjs3.2 KB
- 脚本packages/mjs/test/neutrality.test.mjs1.9 KB
- 脚本packages/mjs/test/optimize-apply.test.mjs2.2 KB
- 脚本packages/mjs/test/optimize-generate.test.mjs1.5 KB
- 脚本packages/mjs/test/optimize-score.test.mjs1.2 KB
- 脚本packages/mjs/test/parser.test.mjs2.1 KB
- 脚本packages/mjs/test/prompt-budget.test.mjs1.4 KB
- 脚本packages/mjs/test/prompt-xml.test.mjs1.9 KB
- 脚本packages/mjs/test/range.test.mjs3.1 KB
- 脚本packages/mjs/test/read-properties.test.mjs1.9 KB
- 脚本packages/mjs/test/registry.test.mjs3.8 KB
- 脚本packages/mjs/test/scorer.test.mjs4.6 KB
- 脚本packages/mjs/test/toposort.test.mjs4.7 KB
- 脚本packages/mjs/vitest.config.mjs133 B
- 其他packages/py/.gitignore53 B
- 其他packages/py/Makefile2.4 KB
- 其他packages/py/pyproject.toml2.0 KB
- 其他packages/py/ruff.toml43 B
- 脚本packages/py/src/skills_ref/__init__.py22 B
- 其他packages/py/src/skills_ref/.gitkeep—
- 参考文档packages/py/src/skills_ref/assets/action_verbs.txt1.5 KB
- 参考文档packages/py/src/skills_ref/assets/injection_patterns.json619 B
- 参考文档packages/py/src/skills_ref/assets/negative_query_bank.txt1.3 KB
- 参考文档packages/py/src/skills_ref/assets/stop_words.txt622 B
- 参考文档packages/py/src/skills_ref/assets/vague_phrases.txt598 B
- 参考文档packages/py/src/skills_ref/assets/vendor_prefixes.txt63 B
- 脚本packages/py/src/skills_ref/audit/__init__.py—
- 脚本packages/py/src/skills_ref/audit/deps_origin.py1.3 KB
- 脚本packages/py/src/skills_ref/audit/frontmatter.py1.1 KB
- 脚本packages/py/src/skills_ref/audit/path_leak.py2.8 KB
- 脚本packages/py/src/skills_ref/audit/printer.py971 B
- 脚本packages/py/src/skills_ref/audit/scripts.py2.2 KB
- 脚本packages/py/src/skills_ref/cli_format.py1.4 KB
- 脚本packages/py/src/skills_ref/cli.py4.0 KB
- 脚本packages/py/src/skills_ref/deps/__init__.py—
- 脚本packages/py/src/skills_ref/deps/conflict.py2.1 KB
- 脚本packages/py/src/skills_ref/deps/inversion.py1.1 KB
- 脚本packages/py/src/skills_ref/deps/range.py1.8 KB
- 脚本packages/py/src/skills_ref/deps/toposort.py1.8 KB
- 脚本packages/py/src/skills_ref/lint/__init__.py1.4 KB
- 脚本packages/py/src/skills_ref/lint/neutrality.py1.3 KB
- 脚本packages/py/src/skills_ref/lint/scorer.py3.1 KB
- 脚本packages/py/src/skills_ref/optimize/__init__.py—
- 脚本packages/py/src/skills_ref/optimize/apply.py1.4 KB
- 脚本packages/py/src/skills_ref/optimize/generate.py1.7 KB
- 脚本packages/py/src/skills_ref/optimize/orchestrator.py1.3 KB
- 脚本packages/py/src/skills_ref/optimize/providers/__init__.py—
- 脚本packages/py/src/skills_ref/optimize/providers/none.py343 B
- 脚本packages/py/src/skills_ref/optimize/rewrite.py3.1 KB
- 脚本packages/py/src/skills_ref/optimize/score.py1.5 KB
- 脚本packages/py/src/skills_ref/parser.py4.5 KB
- 脚本packages/py/src/skills_ref/prompt/__init__.py—
- 脚本packages/py/src/skills_ref/prompt/budget.py697 B
- 脚本packages/py/src/skills_ref/prompt/read_properties.py1.6 KB
- 脚本packages/py/src/skills_ref/prompt/xml.py742 B
- 脚本packages/py/src/skills_ref/registry.py2.5 KB
- 脚本packages/py/src/skills_ref/rules/__init__.py—
- 脚本packages/py/src/skills_ref/rules/body.py1.1 KB
- 脚本packages/py/src/skills_ref/rules/naming.py2.9 KB
- 脚本packages/py/src/skills_ref/rules/optional_dirs.py719 B
- 脚本packages/py/src/skills_ref/rules/references.py935 B
- 脚本packages/py/src/skills_ref/scripts/__init__.py—
- 脚本packages/py/src/skills_ref/scripts/check_naming.py857 B
- 脚本packages/py/src/skills_ref/scripts/dump_deps.py1.0 KB
- 脚本packages/py/src/skills_ref/scripts/dump_parsed.py695 B
- 脚本packages/py/src/skills_ref/scripts/dump_registry.py1.4 KB
- 脚本packages/py/src/skills_ref/scripts/dump_score.py836 B
- 脚本packages/py/src/skills_ref/types.py1.8 KB
- 脚本packages/py/src/skills_ref/verbs/__init__.py—
- 脚本packages/py/src/skills_ref/verbs/audit.py1.6 KB
- 脚本packages/py/src/skills_ref/verbs/deps.py2.6 KB
- 脚本packages/py/src/skills_ref/verbs/lint.py5.2 KB
- 脚本packages/py/src/skills_ref/verbs/optimize.py3.3 KB
- 脚本packages/py/src/skills_ref/verbs/read_properties.py1.6 KB
- 脚本packages/py/src/skills_ref/verbs/to_prompt.py2.3 KB
- 脚本packages/py/src/skills_ref/verbs/validate.py3.5 KB
- 其他packages/py/tests/.gitkeep—
- 脚本packages/py/tests/test_audit.py4.5 KB
- 脚本packages/py/tests/test_body.py1.1 KB
- 脚本packages/py/tests/test_naming.py2.5 KB
- 脚本packages/py/tests/test_neutrality.py1.6 KB
- 脚本packages/py/tests/test_optimize_apply.py1.8 KB
- 脚本packages/py/tests/test_optimize_generate.py1.3 KB
- 脚本packages/py/tests/test_optimize_score.py977 B
- 脚本packages/py/tests/test_parser.py1.6 KB
- 脚本packages/py/tests/test_prompt_budget.py1.0 KB
- 脚本packages/py/tests/test_prompt_xml.py1.5 KB
- 脚本packages/py/tests/test_range.py2.7 KB
- 脚本packages/py/tests/test_read_properties.py1.5 KB
- 脚本packages/py/tests/test_registry.py3.1 KB
- 脚本packages/py/tests/test_scorer.py3.6 KB
- 脚本packages/py/tests/test_toposort.py3.5 KB
- 其他packages/py/uv.lock7.7 KB
- 脚本scripts/parity-lint.sh1.2 KB
- 脚本scripts/parity-optimize.sh1.2 KB
- 脚本scripts/parity-parser-naming.sh2.6 KB
- 脚本scripts/parity-prompt.sh1.1 KB
- 脚本scripts/parity-read-properties.sh3.5 KB
- 脚本scripts/parity-registry.sh660 B
- 脚本scripts/run-parity.sh3.5 KB
- 脚本scripts/test-workflow.sh2.4 KB
03 SKILL.md 正文
Agent-Skills Kit Commons
Purpose
This skill is the single canonical home for assets shared across every other skill in the toolkit. Before this skill existed, four sibling directories (packages/, fixtures/, scripts/, examples/) sat at the repo root and were referenced by relative paths from the Makefile, CI workflow, pre-commit hooks, parity scripts, and four other SKILL.md files. The relocation under .agents/skills/agent-skill-kit-commons/ makes the commons surface discoverable to the skills tooling itself: skills-ref deps now sees it as a dependency target, skills-ref to-prompt exports it to the LLM context, and external consumers can pull it via the planned npx skills-ref add install verb.
Contents
After phases 2–5 of the restructure land, this skill owns four sub-trees:
packages/ — runtime implementations
packages/mjs/— Node ESM implementation ofskills-ref(npm packageskills-ref-mjs). Owns the validator, linter, auditor, dependency resolver, prompt emitter, optimizer, and properties reader. Thebin/skills-refentry point is invoked asnpx --prefix <commons-skill>/packages/mjs skills-ref <verb>.packages/py/— Python twin (uv-managed, packageskills_ref). Identical surface, parity-tested against mjs. Asset files are symlinked back to../mjs/assets/so both runtimes load the same regex/keyword tables; the sibling assumption is preserved by moving both packages together.
fixtures/ — canonical test corpus
Shared between mjs vitest tests and py pytest tests. Sub-trees:
parsed/— frontmatter parser snapshots (canonical JSON pinned across runtimes).audit/— clean-suite and with-injections fixtures for the security auditor.lint/— descriptions + expected scores for the discoverability scorer.optimize/— input descriptions + expected rewrites for the deterministic optimizer.prompt/— 5-skill chain expected output forto-prompt.naming/—<slug>validation cases.deps/,invalid/,valid/,properties/— supporting cases.
Test inputs whose expected output encodes the path (fixtures/parsed/expected/valid-optional.json:1 carries _path) use the <REPO> placeholder so the fixtures are location-independent.
scripts/ — parity harness
Seven parity-*.sh scripts that pin mjs ↔ py output equality on every CI run, plus run-parity.sh (the validate/audit/deps parity driver) and test-workflow.sh (CI workflow smoke test). All scripts anchor on git rev-parse --show-toplevel for $ROOT so they don't misroute when the script directory moves; the prior $(dirname "$0")/.. pattern silently pointed at the wrong tree after relocation.
examples/ — anchored SDK documentation
examples/closure-walks.md— walks the published SDK doc procedures (validate one skill, build registry, score description, etc.) against the actual CLI behavior on this repo and reports MATCH / DRIFT per walk. The doc is regenerated when a CLI behavior shift moves a sample value.
Consumer Pattern: npx skills-ref add
The forward-looking consumer story: other repos pull this commons skill as a dependency via skills-ref add agent-skill-kit-commons (planned verb). The install mechanism:
skills-ref addreads the consumer repo's.agents/skills/<other-skill>/SKILL.mdfor adependencies:entry referencing this commons skill.- The verb fetches the commons skill tarball from npm (published as
skills-ref-commonsor pulled fromskills-ref-mjs'sassets/directory at the package level) and unpacks it under the consumer's.agents/skills/agent-skill-kit-commons/. - The consumer skill's tests then reference
../agent-skill-kit-commons/fixtures/...via the skill-tree relative path.
This pattern means: change a regex in packages/mjs/assets/injection_patterns.json, bump the commons skill version, every consumer skill pulls the new regex on next skills-ref add run. No duplicated assets in N consumer repos.
How Other Skills Reference This One
Inside the same repo, every other SKILL.md that needs commons assets references them via the canonical skill-tree path:
.agents/skills/agent-skill-kit-commons/
packages/mjs/bin/skills-ref # runtime CLI
packages/py/ # python twin
fixtures/audit/clean-suite/ # auditor input cases
scripts/parity-lint.sh # parity harness
examples/closure-walks.md # SDK doc oracle
The Makefile, .pre-commit-config.yaml, and .github/workflows/agent-skills-ci.yml invoke the runtime via node .agents/skills/agent-skill-kit-commons/packages/mjs/bin/skills-ref (or npx --prefix of the same path).
The other agent-skill-kit-* skills can declare commons as a dependency in their own frontmatter:
dependencies:
- agent-skill-kit-commons@^0.1
Dependency direction is governed by the tier: frontmatter field, not by the directory name: app-tier and project-tier skills may depend on org-tier commons, never the inverse (§3.3 spec rule).
Validation and CI
make ciruns the mjs and py test suites against the fixture tree underfixtures/.make parityruns the eight parity scripts underscripts/; every one must reportOKfor the build to pass.make validate-suiterunsskills-ref validateagainst.agents/skills/including this commons skill.
Migration Notes
Phases 1–5 of the restructure are tracked in .plan/<session-id>/plan.md. Phase 1 (this SKILL.md) creates the commons skill as a pointer documenting the intended layout; phases 2–5 physically relocate the four sub-trees and update all 50+ cross-references. The CI must remain green between every phase.
04 同仓库更多 Skills
validation_handoff
Forces the agent to conclude its response by generating a strict validation checklist and outlining pending actions, focusing heavily on defensive execution and edge-case testing.
project-ployglot-project-scafford
Scaffold a polyglot library project as TypeScript + Python twin packages under `packages/ts/` + `packages/py/`, with a shared `SPEC.md`, cross-language `tests/parity/fixtures.json`, side-by-side `examples/sdk/` + `examples/api/` documentation, per-package `Makefile`, and a root orchestrator that exposes `make ci`. Open-source friendly — no organization-specific paths or scopes baked in. Use when starting a new polyglot library, porting a single-language library to a twin, or auditing/regularizing an existing two-language repo against the canonical layout.
playwright-ui-locator
Auto-heal Playwright tests after a frontend developer changes a div's class, id, or other selector. Catches a failing Playwright test, captures the old vs new DOM tree, finds the element that drifted, derives the most stable replacement locator, and proposes the fix as a GitHub pull request (confident heals) or files a GitHub issue (ambiguous / element-removed cases) — never editing the working tree directly. Trigger when Playwright tests fail with "locator resolved to 0 elements", "Timeout waiting for selector", or after a UI refactor / class rename / Tailwind cleanup broke previously-passing tests.
org-learn-context-window
Distill the current conversation into a reusable command or skill artifact. Use when the user wants to capture a workflow they just executed (create a reusable slash command) or formalize a resolution/mistake/correction into a reusable skill so the same class of issue never recurs.
org-agent-skill-creator
Scaffold and validate scope-aware agent skills (company, enterprise, org, team, project, application). Use when the user asks to create a new agent skill, generate a SKILL.md file, scaffold a skill directory, or validate that existing skill directories meet SKILL_SPEC.md (frontmatter, naming rules, structure, scope/tier).
app-workshop-session-pdf-recap-next
Extract content from a workshop session PDF and produce a structured recap focused on (1) what was learned, (2) next steps, and (3) possible enhancements. Ingests a single PDF file path, parses session material (slides, transcripts, exercises, Q&A), and emits a Markdown report with Learning Recap, Next Steps, and Enhancement Opportunities sections with page-level traceability. Use when the user asks to "summarize a workshop", "recap a training PDF", "pull next steps from a session deck", or provides a workshop/seminar/tutorial PDF and wants a learn-and-act summary.