Toposort python script
Skill sangjinsu/skill-execution-bench/skills/toposort-python-script
Local-first benchmark comparing four Skill packaging patterns — doc-only, inline-code, Python script, and Go binary — to find which is most reliable when an LLM coding agent executes a Skill.From the repository description
npx -y skills add sangjinsu/skill-execution-bench --skill toposort-python-scriptAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.5 KB, 342 tokens by cl100k_base, as published. Nobody here has run it
Dependency Topological Sort (Python Script)
When to use
Use this Skill when you need a topological order of dependency records and a reusable Python script is the preferred execution path. Run the bundled script rather than re-deriving the algorithm.
Inputs
- A JSON array of records on stdin, each
{"id": "<integer>", "deps": ["<id>", ...]}. depslists ids that must come before this task (valid DAG, unique integer ids).
Expected output
- A JSON array of ids on stdout (compact), in topological order; ties broken by smallest numeric id. Deterministic.
- Exit code
0on success, non-zero on invalid input or a cycle.
Procedure
Run the bundled script, piping the input JSON to stdin and capturing stdout:
python skills/toposort-python-script/scripts/toposort.py < input.json > output.json
echo '[{"id":"3","deps":["1","2"]},{"id":"1","deps":[]},{"id":"2","deps":["1"]}]' \
| python skills/toposort-python-script/scripts/toposort.py
# -> ["1","2","3"]
Do not reimplement the algorithm inline — invoke the script so behavior stays consistent and testable.
Validation
- Output parses as a JSON array containing every id exactly once.
- Every node's dependencies precede it in the output.
- Ties are broken by smallest numeric id.
- A cyclic or malformed input causes a non-zero exit code.
What ships with it: 1 file
2.5 KB alongside SKILL.md, 1 of them executable
scripts/
- toposort.pyruns2.5 KB