zenofskills 0.1.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anuj Sadani
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: zenofskills
3
+ Version: 0.1.0
4
+ Summary: The Zen of Skills: principles for writing agent skills: packaged instructions, scripts and resources an agent loads on demand. Printed on import.
5
+ Author-email: Anuj Sadani <anuj.sadani3@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/asadani/zenofskills
8
+ Project-URL: Issues, https://github.com/asadani/zenofskills/issues
9
+ Project-URL: Changelog, https://github.com/asadani/zenofskills/blob/main/CHANGELOG.md
10
+ Keywords: agent skills,AI agents,SKILL.md,LLM,prompt engineering,Zen
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Topic :: Software Development
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # zenofskills
22
+
23
+ [![CI](https://github.com/asadani/zenofskills/actions/workflows/ci.yml/badge.svg)](https://github.com/asadani/zenofskills/actions/workflows/ci.yml)
24
+ [![PyPI](https://img.shields.io/pypi/v/zenofskills)](https://pypi.org/project/zenofskills/)
25
+
26
+ ### The Zen of Skills: principles for writing agent skills: packaged instructions, scripts and resources an agent loads on demand.
27
+
28
+ A skill is know-how an agent picks up when a task calls for it. These principles cover what to put in a skill, how it gets triggered, how to structure it, and how to trust and maintain it.
29
+
30
+ `import this` gave Python a shared mindset. `import zenofskills` does the same for this corner of AI engineering: 12 short principles you can remember, cite by number and argue about.
31
+
32
+ ```bash
33
+ pip install zenofskills # or: uv pip install zenofskills / uv add zenofskills
34
+ uvx zenofskills --random # run the CLI without installing (uv)
35
+ ```
36
+
37
+ ```python
38
+ >>> import zenofskills
39
+ The Zen of Skills, by Anuj Sadani
40
+
41
+ 1. A skill should hold what the model can't guess.
42
+ 2. One skill, one job.
43
+ ...
44
+ ```
45
+
46
+ ---
47
+
48
+ ## The principles
49
+
50
+ Numbers are stable across releases, so "see principle 3" in a review always means the same thing.
51
+
52
+ ### Purpose
53
+ 1. A skill should hold what the model can't guess.
54
+ 2. One skill, one job.
55
+ 3. Write the playbook, not the textbook.
56
+
57
+ ### Trigger
58
+ 4. The description is the trigger.
59
+ 5. Knowing when not to fire is half the skill.
60
+ 6. Overlapping skills turn every choice into a coin toss.
61
+
62
+ ### Structure
63
+ 7. Short at the top, deep on demand.
64
+ 8. Make exact steps executable; leave judgment to the model.
65
+ 9. Say what good output looks like.
66
+
67
+ ### Trust
68
+ 10. Review a skill before you trust it.
69
+ 11. Test that it fires, and that it doesn't.
70
+
71
+ ### Maintain
72
+ 12. As models improve, delete what they no longer need.
73
+
74
+ Every principle comes with an explanation and a concrete do/don't example: `zenofskills --examples`.
75
+
76
+ ---
77
+
78
+ ## Usage
79
+
80
+ ### On import
81
+
82
+ ```python
83
+ import zenofskills # prints the principles
84
+ from zenofskills import verbose # prints them with explanations
85
+ ```
86
+
87
+ Set `ZENOFSKILLS_QUIET=1` to import without printing.
88
+
89
+ ### Command line
90
+
91
+ ```bash
92
+ zenofskills # the principles
93
+ zenofskills --verbose # with explanations
94
+ zenofskills --examples # with a do/don't example for each
95
+ zenofskills --themes # grouped by theme
96
+ zenofskills -n 3 # one principle in full
97
+ zenofskills --random # one at random: a daily reminder for your shell profile
98
+ zenofskills --checklist # Markdown checklist for PRs and agent instructions
99
+ zenofskills --json # machine-readable
100
+ ```
101
+
102
+ `python -m zenofskills` works the same way.
103
+
104
+ ### As data
105
+
106
+ ```python
107
+ import os; os.environ["ZENOFSKILLS_QUIET"] = "1"
108
+ import zenofskills
109
+
110
+ zenofskills.get(3).text # "Write the playbook, not the textbook."
111
+ zenofskills.by_theme("purpose") # list of Principle objects
112
+ [p.text for p in zenofskills.PRINCIPLES]
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Putting it into your workflow
118
+
119
+ A slogan is not a process. The principles help most where decisions are made:
120
+
121
+ - **Pull requests.** Paste `zenofskills --checklist` into `.github/pull_request_template.md`. Reviewers can then point to a principle by number.
122
+ - **Coding agents.** Add the checklist (or `zenofskills --themes`) to `AGENTS.md`, `CLAUDE.md` or your editor's rules file, so your agent works by the same standard you review by.
123
+ - **Onboarding.** `zenofskills --examples` is a short read for anyone new to the team's approach.
124
+
125
+ ---
126
+
127
+ ## What this is, and isn't
128
+
129
+ - It **is** a compact, opinionated philosophy and a shared vocabulary for teams.
130
+ - It **isn't** a linter, a framework or a replacement for engineering judgment.
131
+ - It's **vendor-neutral**: no principle depends on a particular model, framework or vendor.
132
+
133
+ ---
134
+
135
+ ## Contributing
136
+
137
+ The principles should evolve through discussion, not by decree. Propose a new principle, a rewording or a better example by opening an issue. See [CONTRIBUTING.md](CONTRIBUTING.md).
138
+
139
+ ## License
140
+
141
+ [MIT](LICENSE)
@@ -0,0 +1,121 @@
1
+ # zenofskills
2
+
3
+ [![CI](https://github.com/asadani/zenofskills/actions/workflows/ci.yml/badge.svg)](https://github.com/asadani/zenofskills/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/zenofskills)](https://pypi.org/project/zenofskills/)
5
+
6
+ ### The Zen of Skills: principles for writing agent skills: packaged instructions, scripts and resources an agent loads on demand.
7
+
8
+ A skill is know-how an agent picks up when a task calls for it. These principles cover what to put in a skill, how it gets triggered, how to structure it, and how to trust and maintain it.
9
+
10
+ `import this` gave Python a shared mindset. `import zenofskills` does the same for this corner of AI engineering: 12 short principles you can remember, cite by number and argue about.
11
+
12
+ ```bash
13
+ pip install zenofskills # or: uv pip install zenofskills / uv add zenofskills
14
+ uvx zenofskills --random # run the CLI without installing (uv)
15
+ ```
16
+
17
+ ```python
18
+ >>> import zenofskills
19
+ The Zen of Skills, by Anuj Sadani
20
+
21
+ 1. A skill should hold what the model can't guess.
22
+ 2. One skill, one job.
23
+ ...
24
+ ```
25
+
26
+ ---
27
+
28
+ ## The principles
29
+
30
+ Numbers are stable across releases, so "see principle 3" in a review always means the same thing.
31
+
32
+ ### Purpose
33
+ 1. A skill should hold what the model can't guess.
34
+ 2. One skill, one job.
35
+ 3. Write the playbook, not the textbook.
36
+
37
+ ### Trigger
38
+ 4. The description is the trigger.
39
+ 5. Knowing when not to fire is half the skill.
40
+ 6. Overlapping skills turn every choice into a coin toss.
41
+
42
+ ### Structure
43
+ 7. Short at the top, deep on demand.
44
+ 8. Make exact steps executable; leave judgment to the model.
45
+ 9. Say what good output looks like.
46
+
47
+ ### Trust
48
+ 10. Review a skill before you trust it.
49
+ 11. Test that it fires, and that it doesn't.
50
+
51
+ ### Maintain
52
+ 12. As models improve, delete what they no longer need.
53
+
54
+ Every principle comes with an explanation and a concrete do/don't example: `zenofskills --examples`.
55
+
56
+ ---
57
+
58
+ ## Usage
59
+
60
+ ### On import
61
+
62
+ ```python
63
+ import zenofskills # prints the principles
64
+ from zenofskills import verbose # prints them with explanations
65
+ ```
66
+
67
+ Set `ZENOFSKILLS_QUIET=1` to import without printing.
68
+
69
+ ### Command line
70
+
71
+ ```bash
72
+ zenofskills # the principles
73
+ zenofskills --verbose # with explanations
74
+ zenofskills --examples # with a do/don't example for each
75
+ zenofskills --themes # grouped by theme
76
+ zenofskills -n 3 # one principle in full
77
+ zenofskills --random # one at random: a daily reminder for your shell profile
78
+ zenofskills --checklist # Markdown checklist for PRs and agent instructions
79
+ zenofskills --json # machine-readable
80
+ ```
81
+
82
+ `python -m zenofskills` works the same way.
83
+
84
+ ### As data
85
+
86
+ ```python
87
+ import os; os.environ["ZENOFSKILLS_QUIET"] = "1"
88
+ import zenofskills
89
+
90
+ zenofskills.get(3).text # "Write the playbook, not the textbook."
91
+ zenofskills.by_theme("purpose") # list of Principle objects
92
+ [p.text for p in zenofskills.PRINCIPLES]
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Putting it into your workflow
98
+
99
+ A slogan is not a process. The principles help most where decisions are made:
100
+
101
+ - **Pull requests.** Paste `zenofskills --checklist` into `.github/pull_request_template.md`. Reviewers can then point to a principle by number.
102
+ - **Coding agents.** Add the checklist (or `zenofskills --themes`) to `AGENTS.md`, `CLAUDE.md` or your editor's rules file, so your agent works by the same standard you review by.
103
+ - **Onboarding.** `zenofskills --examples` is a short read for anyone new to the team's approach.
104
+
105
+ ---
106
+
107
+ ## What this is, and isn't
108
+
109
+ - It **is** a compact, opinionated philosophy and a shared vocabulary for teams.
110
+ - It **isn't** a linter, a framework or a replacement for engineering judgment.
111
+ - It's **vendor-neutral**: no principle depends on a particular model, framework or vendor.
112
+
113
+ ---
114
+
115
+ ## Contributing
116
+
117
+ The principles should evolve through discussion, not by decree. Propose a new principle, a rewording or a better example by opening an issue. See [CONTRIBUTING.md](CONTRIBUTING.md).
118
+
119
+ ## License
120
+
121
+ [MIT](LICENSE)
@@ -0,0 +1,34 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "zenofskills"
7
+ version = "0.1.0"
8
+ authors = [
9
+ {name = "Anuj Sadani", email = "anuj.sadani3@gmail.com"}
10
+ ]
11
+ description = "The Zen of Skills: principles for writing agent skills: packaged instructions, scripts and resources an agent loads on demand. Printed on import."
12
+ readme = "README.md"
13
+ license = "MIT"
14
+ license-files = ["LICENSE"]
15
+ requires-python = ">=3.10"
16
+ keywords = ["agent skills", "AI agents", "SKILL.md", "LLM", "prompt engineering", "Zen"]
17
+ classifiers = [
18
+ "Development Status :: 4 - Beta",
19
+ "Intended Audience :: Developers",
20
+ "Programming Language :: Python :: 3",
21
+ "Operating System :: OS Independent",
22
+ "Topic :: Software Development",
23
+ ]
24
+
25
+ [project.urls]
26
+ Homepage = "https://github.com/asadani/zenofskills"
27
+ Issues = "https://github.com/asadani/zenofskills/issues"
28
+ Changelog = "https://github.com/asadani/zenofskills/blob/main/CHANGELOG.md"
29
+
30
+ [project.scripts]
31
+ zenofskills = "zenofskills.__main__:main"
32
+
33
+ [tool.setuptools]
34
+ packages = ["zenofskills"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,109 @@
1
+ import contextlib
2
+ import importlib
3
+ import io
4
+ import json
5
+ import os
6
+ import subprocess
7
+ import sys
8
+ import unittest
9
+
10
+ os.environ["ZENOFSKILLS_QUIET"] = "1"
11
+
12
+ import zenofskills # noqa: E402
13
+ from zenofskills import render # noqa: E402
14
+ from zenofskills.__main__ import main # noqa: E402
15
+
16
+ ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
+ N = len(zenofskills.PRINCIPLES)
18
+
19
+
20
+ def run_cli(*args):
21
+ buf = io.StringIO()
22
+ with contextlib.redirect_stdout(buf):
23
+ main(list(args))
24
+ return buf.getvalue()
25
+
26
+
27
+ def run_py(args, quiet):
28
+ env = dict(os.environ)
29
+ env.pop("ZENOFSKILLS_QUIET", None)
30
+ if quiet:
31
+ env["ZENOFSKILLS_QUIET"] = "1"
32
+ return subprocess.run(
33
+ [sys.executable] + args, cwd=ROOT, env=env,
34
+ capture_output=True, text=True, encoding="utf-8", check=True,
35
+ ).stdout
36
+
37
+
38
+ class TestData(unittest.TestCase):
39
+ def test_stable_numbers(self):
40
+ self.assertEqual([p.number for p in zenofskills.PRINCIPLES], list(range(1, N + 1)))
41
+
42
+ def test_every_principle_complete_and_themed(self):
43
+ for p in zenofskills.PRINCIPLES:
44
+ self.assertIn(p.theme, zenofskills.THEMES)
45
+ for field in (p.text, p.explanation, p.do, p.dont):
46
+ self.assertTrue(field.strip(), p.number)
47
+
48
+ def test_every_theme_used(self):
49
+ for theme in zenofskills.THEMES:
50
+ self.assertTrue(zenofskills.by_theme(theme))
51
+
52
+ def test_texts_are_unique(self):
53
+ texts = [p.text for p in zenofskills.PRINCIPLES]
54
+ self.assertEqual(len(texts), len(set(texts)))
55
+
56
+ def test_lookup(self):
57
+ self.assertEqual(zenofskills.get(1).number, 1)
58
+ with self.assertRaises(KeyError):
59
+ zenofskills.get(N + 1)
60
+ with self.assertRaises(ValueError):
61
+ zenofskills.by_theme("vibes")
62
+
63
+ def test_version_matches_pyproject(self):
64
+ with open(os.path.join(ROOT, "pyproject.toml"), encoding="utf-8") as f:
65
+ self.assertIn('version = "%s"' % zenofskills.__version__, f.read())
66
+
67
+
68
+ class TestImportSideEffect(unittest.TestCase):
69
+ def test_import_prints_like_import_this(self):
70
+ self.assertIn("1. " + zenofskills.PRINCIPLES[0].text, run_py(["-c", "import zenofskills"], quiet=False))
71
+
72
+ def test_quiet_env_silences_import(self):
73
+ self.assertEqual(run_py(["-c", "import zenofskills"], quiet=True), "")
74
+
75
+ def test_python_dash_m_prints_once(self):
76
+ out = run_py(["-m", "zenofskills", "--themes"], quiet=False)
77
+ self.assertIn("by theme", out)
78
+ self.assertNotIn("\n1. " + zenofskills.PRINCIPLES[0].text, out)
79
+
80
+ def test_verbose_module(self):
81
+ mod = importlib.import_module("zenofskills.verbose")
82
+ self.assertIn("Verbose Edition", mod.VERBOSE_ZEN)
83
+
84
+
85
+ class TestCLI(unittest.TestCase):
86
+ def test_default_is_concise(self):
87
+ self.assertEqual(run_cli().rstrip("\n"), render.concise().rstrip("\n"))
88
+
89
+ def test_examples_include_do_and_dont(self):
90
+ out = run_cli("--examples")
91
+ self.assertEqual(out.count("Do:"), N)
92
+ self.assertEqual(out.count("Don't:"), N)
93
+
94
+ def test_checklist_is_markdown(self):
95
+ self.assertEqual(run_cli("--checklist").count("- [ ]"), N)
96
+
97
+ def test_json_round_trips(self):
98
+ self.assertEqual(len(json.loads(run_cli("--json"))["principles"]), N)
99
+
100
+ def test_single_principle(self):
101
+ self.assertTrue(run_cli("-n", "1").startswith("1. "))
102
+
103
+ def test_bad_number_exits(self):
104
+ with self.assertRaises(SystemExit), contextlib.redirect_stderr(io.StringIO()):
105
+ run_cli("-n", str(N + 50))
106
+
107
+
108
+ if __name__ == "__main__":
109
+ unittest.main()
@@ -0,0 +1,32 @@
1
+ """The Zen of Skills. Like ``import this``, importing prints the principles.
2
+
3
+ Set the environment variable ZENOFSKILLS_QUIET=1 to import without printing,
4
+ e.g. when using ``zenofskills.PRINCIPLES`` as data.
5
+ """
6
+
7
+ import os
8
+ import sys
9
+
10
+ from .principles import PRINCIPLES, THEMES, Principle, by_theme, get
11
+ from .render import concise as _concise
12
+
13
+ __version__ = "0.1.0"
14
+ __author__ = "Anuj Sadani"
15
+ __all__ = ["PRINCIPLES", "THEMES", "Principle", "by_theme", "get", "ZEN_CONCISE"]
16
+
17
+ ZEN_CONCISE = _concise()
18
+
19
+
20
+ def _running_cli() -> bool:
21
+ # `zenofskills ...` console script, or `python -m zenofskills ...`: the CLI prints instead.
22
+ if os.path.basename(sys.argv[0] or "").split(".")[0] == "zenofskills":
23
+ return True
24
+ orig = sys.orig_argv
25
+ if "-m" in orig:
26
+ i = orig.index("-m")
27
+ return i + 1 < len(orig) and orig[i + 1] == "zenofskills"
28
+ return False
29
+
30
+
31
+ if not os.environ.get("ZENOFSKILLS_QUIET") and not _running_cli():
32
+ print(ZEN_CONCISE)
@@ -0,0 +1,48 @@
1
+ """Command line: ``zenofskills`` or ``python -m zenofskills``."""
2
+
3
+ import argparse
4
+ import random
5
+ import sys
6
+
7
+ from . import __version__
8
+ from . import render
9
+ from .principles import PRINCIPLES, get
10
+
11
+
12
+ def main(argv=None) -> int:
13
+ parser = argparse.ArgumentParser(prog="zenofskills", description="The Zen of Skills.")
14
+ mode = parser.add_mutually_exclusive_group()
15
+ mode.add_argument("-v", "--verbose", action="store_true", help="principles with explanations")
16
+ mode.add_argument("-e", "--examples", action="store_true", help="verbose, plus a do/don't example for each")
17
+ mode.add_argument("-t", "--themes", action="store_true", help="grouped by theme: purpose, trigger, structure, trust, maintain")
18
+ mode.add_argument("-n", "--number", type=int, metavar="N", help="show one principle in full (1-%d)" % len(PRINCIPLES))
19
+ mode.add_argument("-r", "--random", action="store_true", help="one random principle, e.g. for a daily reminder")
20
+ mode.add_argument("--checklist", action="store_true", help="Markdown checklist for PR templates or AGENTS.md")
21
+ mode.add_argument("--json", action="store_true", help="machine-readable output")
22
+ parser.add_argument("--version", action="version", version="zenofskills " + __version__)
23
+ args = parser.parse_args(argv)
24
+
25
+ if args.verbose:
26
+ out = render.verbose()
27
+ elif args.examples:
28
+ out = render.verbose(examples=True)
29
+ elif args.themes:
30
+ out = render.themed()
31
+ elif args.checklist:
32
+ out = render.checklist()
33
+ elif args.json:
34
+ out = render.as_json()
35
+ elif args.number is not None or args.random:
36
+ try:
37
+ p = random.choice(PRINCIPLES) if args.random else get(args.number)
38
+ except KeyError:
39
+ parser.error("principle number must be 1-%d" % len(PRINCIPLES))
40
+ out = "%d. %s\n %s\n Do: %s\n Don't: %s" % (p.number, p.text, p.explanation, p.do, p.dont)
41
+ else:
42
+ out = render.concise()
43
+ print(out)
44
+ return 0
45
+
46
+
47
+ if __name__ == "__main__":
48
+ sys.exit(main())
@@ -0,0 +1,125 @@
1
+ """The principles as structured data."""
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Dict, List, Tuple
5
+
6
+ THEMES: Dict[str, str] = {
7
+ 'purpose': 'Purpose',
8
+ 'trigger': 'Trigger',
9
+ 'structure': 'Structure',
10
+ 'trust': 'Trust',
11
+ 'maintain': 'Maintain',
12
+ }
13
+
14
+
15
+ @dataclass(frozen=True)
16
+ class Principle:
17
+ number: int
18
+ text: str
19
+ explanation: str
20
+ theme: str
21
+ do: str
22
+ dont: str
23
+
24
+
25
+ PRINCIPLES: Tuple[Principle, ...] = (
26
+ Principle(
27
+ 1, "A skill should hold what the model can't guess.",
28
+ "Spend a skill's words on your procedures, conventions and context, not on what the model already knows. General advice wastes context; specifics change outcomes.",
29
+ 'purpose',
30
+ do='"Release notes go in CHANGELOG.md under Unreleased, grouped as Added, Changed, Fixed."',
31
+ dont='Explain what a changelog is.',
32
+ ),
33
+ Principle(
34
+ 2, 'One skill, one job.',
35
+ 'A skill with one coherent purpose is easier to trigger correctly, test and maintain. Split skills that do unrelated things.',
36
+ 'purpose',
37
+ do='Separate "write release notes" from "publish a release".',
38
+ dont='Build one "project helper" skill for everything.',
39
+ ),
40
+ Principle(
41
+ 3, 'Write the playbook, not the textbook.',
42
+ 'A skill should say what to do, in order, with the decisions that matter—not teach the theory behind the domain.',
43
+ 'purpose',
44
+ do='Numbered steps, with the check to run at each one.',
45
+ dont='Three pages of background before the first instruction.',
46
+ ),
47
+ Principle(
48
+ 4, 'The description is the trigger.',
49
+ 'Agents often decide whether to load a skill from its name and description alone. Say what it does and when to use it, in the words users actually say.',
50
+ 'trigger',
51
+ do='"Create Word documents (.docx). Use when the user asks for a Word file or a .docx, or edits to one."',
52
+ dont='"Document utilities."',
53
+ ),
54
+ Principle(
55
+ 5, 'Knowing when not to fire is half the skill.',
56
+ 'A skill that triggers on the wrong requests does damage. Say when not to use it, especially where a neighboring skill fits better.',
57
+ 'trigger',
58
+ do='"Not for PDFs or spreadsheets."',
59
+ dont='Write a description so broad it matches any file request.',
60
+ ),
61
+ Principle(
62
+ 6, 'Overlapping skills turn every choice into a coin toss.',
63
+ 'When two skills claim the same requests, the agent picks one more or less at random. Give each a distinct territory and settle overlaps in the descriptions.',
64
+ 'trigger',
65
+ do='Merge two near-identical "write a blog post" skills, or split them by platform.',
66
+ dont='Install three skills that all say "use for writing".',
67
+ ),
68
+ Principle(
69
+ 7, 'Short at the top, deep on demand.',
70
+ 'Keep the main file brief: what the skill is for and the core steps. Put long references, examples and data in separate files the agent opens only when needed.',
71
+ 'structure',
72
+ do='A one-page main file that links to reference files.',
73
+ dont='Put a 2,000-line API reference in the main file.',
74
+ ),
75
+ Principle(
76
+ 8, 'Make exact steps executable; leave judgment to the model.',
77
+ 'Work that must be exact and repeatable—conversion, validation, formatting—belongs in scripts the agent runs. Work that needs judgment stays in the instructions.',
78
+ 'structure',
79
+ do='Ship a validation script and tell the agent to run it.',
80
+ dont='Describe a 12-step file transformation in prose.',
81
+ ),
82
+ Principle(
83
+ 9, 'Say what good output looks like.',
84
+ 'Give the skill a target: a sample of finished output, the checks it must pass, or the criteria for done.',
85
+ 'structure',
86
+ do='Include one finished example and a checklist it must meet.',
87
+ dont='End the instructions with "make it good".',
88
+ ),
89
+ Principle(
90
+ 10, 'Review a skill before you trust it.',
91
+ "Skills can contain instructions and scripts that run with the agent's access. Read someone else's skill before you enable it, as you would any code.",
92
+ 'trust',
93
+ do="Read a downloaded skill's instructions and scripts before enabling it.",
94
+ dont='Enable a popular skill unread because it has many stars.',
95
+ ),
96
+ Principle(
97
+ 11, "Test that it fires, and that it doesn't.",
98
+ "Check that the skill triggers on the requests it should and stays quiet on the ones it shouldn't—then check its output.",
99
+ 'trust',
100
+ do="Keep a list of requests that should and shouldn't trigger it, and test both.",
101
+ dont='Test only the happy path you wrote it for.',
102
+ ),
103
+ Principle(
104
+ 12, 'As models improve, delete what they no longer need.',
105
+ "Instructions that worked around a weaker model become noise for a stronger one. Revisit skills after model upgrades and cut what's no longer needed.",
106
+ 'maintain',
107
+ do="Re-run the skill's tests on a new model and remove steps it now handles unaided.",
108
+ dont='Keep piling up workarounds for problems the model no longer has.',
109
+ ),
110
+ )
111
+
112
+
113
+ def by_theme(theme: str) -> List[Principle]:
114
+ """Return the principles in one theme (purpose, trigger, structure, trust, maintain)."""
115
+ if theme not in THEMES:
116
+ raise ValueError("unknown theme %r; choose from %s" % (theme, ", ".join(THEMES)))
117
+ return [p for p in PRINCIPLES if p.theme == theme]
118
+
119
+
120
+ def get(number: int) -> Principle:
121
+ """Return a principle by its stable number."""
122
+ for p in PRINCIPLES:
123
+ if p.number == number:
124
+ return p
125
+ raise KeyError(number)
@@ -0,0 +1,53 @@
1
+ """Turn the principles into text: concise, verbose, by theme, checklist, JSON."""
2
+
3
+ import json
4
+ from dataclasses import asdict
5
+
6
+ from .principles import PRINCIPLES, THEMES, by_theme
7
+
8
+ TITLE = "The Zen of Skills, by Anuj Sadani"
9
+
10
+
11
+ def concise() -> str:
12
+ lines = [TITLE, ""]
13
+ lines += ["%d. %s" % (p.number, p.text) for p in PRINCIPLES]
14
+ return "\n".join(lines) + "\n"
15
+
16
+
17
+ def verbose(examples: bool = False) -> str:
18
+ lines = ["The Zen of Skills (Verbose Edition)", "by Anuj Sadani", ""]
19
+ for p in PRINCIPLES:
20
+ pad = " " * (len(str(p.number)) + 2)
21
+ lines.append("%d. %s" % (p.number, p.text))
22
+ lines.append("%s— %s" % (pad, p.explanation))
23
+ if examples:
24
+ lines.append("%sDo: %s" % (pad, p.do))
25
+ lines.append("%sDon't: %s" % (pad, p.dont))
26
+ lines.append("")
27
+ return "\n".join(lines)
28
+
29
+
30
+ def themed() -> str:
31
+ lines = [TITLE + " — by theme", ""]
32
+ for key, name in THEMES.items():
33
+ lines.append(name)
34
+ lines += [" %d. %s" % (p.number, p.text) for p in by_theme(key)]
35
+ lines.append("")
36
+ return "\n".join(lines)
37
+
38
+
39
+ def checklist() -> str:
40
+ """Markdown checklist for PR templates, AGENTS.md or CLAUDE.md."""
41
+ lines = ["## Agent skill review checklist (Zen of Skills)", ""]
42
+ for key, name in THEMES.items():
43
+ lines.append("### " + name)
44
+ lines += ["- [ ] %s _(#%d)_" % (p.do, p.number) for p in by_theme(key)]
45
+ lines.append("")
46
+ return "\n".join(lines)
47
+
48
+
49
+ def as_json() -> str:
50
+ return json.dumps(
51
+ {"themes": THEMES, "principles": [asdict(p) for p in PRINCIPLES]},
52
+ ensure_ascii=False, indent=2,
53
+ )
@@ -0,0 +1,10 @@
1
+ """``from zenofskills import verbose`` prints the verbose edition."""
2
+
3
+ import os
4
+
5
+ from .render import verbose as _verbose
6
+
7
+ VERBOSE_ZEN = _verbose()
8
+
9
+ if not os.environ.get("ZENOFSKILLS_QUIET"):
10
+ print(VERBOSE_ZEN)
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: zenofskills
3
+ Version: 0.1.0
4
+ Summary: The Zen of Skills: principles for writing agent skills: packaged instructions, scripts and resources an agent loads on demand. Printed on import.
5
+ Author-email: Anuj Sadani <anuj.sadani3@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/asadani/zenofskills
8
+ Project-URL: Issues, https://github.com/asadani/zenofskills/issues
9
+ Project-URL: Changelog, https://github.com/asadani/zenofskills/blob/main/CHANGELOG.md
10
+ Keywords: agent skills,AI agents,SKILL.md,LLM,prompt engineering,Zen
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Topic :: Software Development
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # zenofskills
22
+
23
+ [![CI](https://github.com/asadani/zenofskills/actions/workflows/ci.yml/badge.svg)](https://github.com/asadani/zenofskills/actions/workflows/ci.yml)
24
+ [![PyPI](https://img.shields.io/pypi/v/zenofskills)](https://pypi.org/project/zenofskills/)
25
+
26
+ ### The Zen of Skills: principles for writing agent skills: packaged instructions, scripts and resources an agent loads on demand.
27
+
28
+ A skill is know-how an agent picks up when a task calls for it. These principles cover what to put in a skill, how it gets triggered, how to structure it, and how to trust and maintain it.
29
+
30
+ `import this` gave Python a shared mindset. `import zenofskills` does the same for this corner of AI engineering: 12 short principles you can remember, cite by number and argue about.
31
+
32
+ ```bash
33
+ pip install zenofskills # or: uv pip install zenofskills / uv add zenofskills
34
+ uvx zenofskills --random # run the CLI without installing (uv)
35
+ ```
36
+
37
+ ```python
38
+ >>> import zenofskills
39
+ The Zen of Skills, by Anuj Sadani
40
+
41
+ 1. A skill should hold what the model can't guess.
42
+ 2. One skill, one job.
43
+ ...
44
+ ```
45
+
46
+ ---
47
+
48
+ ## The principles
49
+
50
+ Numbers are stable across releases, so "see principle 3" in a review always means the same thing.
51
+
52
+ ### Purpose
53
+ 1. A skill should hold what the model can't guess.
54
+ 2. One skill, one job.
55
+ 3. Write the playbook, not the textbook.
56
+
57
+ ### Trigger
58
+ 4. The description is the trigger.
59
+ 5. Knowing when not to fire is half the skill.
60
+ 6. Overlapping skills turn every choice into a coin toss.
61
+
62
+ ### Structure
63
+ 7. Short at the top, deep on demand.
64
+ 8. Make exact steps executable; leave judgment to the model.
65
+ 9. Say what good output looks like.
66
+
67
+ ### Trust
68
+ 10. Review a skill before you trust it.
69
+ 11. Test that it fires, and that it doesn't.
70
+
71
+ ### Maintain
72
+ 12. As models improve, delete what they no longer need.
73
+
74
+ Every principle comes with an explanation and a concrete do/don't example: `zenofskills --examples`.
75
+
76
+ ---
77
+
78
+ ## Usage
79
+
80
+ ### On import
81
+
82
+ ```python
83
+ import zenofskills # prints the principles
84
+ from zenofskills import verbose # prints them with explanations
85
+ ```
86
+
87
+ Set `ZENOFSKILLS_QUIET=1` to import without printing.
88
+
89
+ ### Command line
90
+
91
+ ```bash
92
+ zenofskills # the principles
93
+ zenofskills --verbose # with explanations
94
+ zenofskills --examples # with a do/don't example for each
95
+ zenofskills --themes # grouped by theme
96
+ zenofskills -n 3 # one principle in full
97
+ zenofskills --random # one at random: a daily reminder for your shell profile
98
+ zenofskills --checklist # Markdown checklist for PRs and agent instructions
99
+ zenofskills --json # machine-readable
100
+ ```
101
+
102
+ `python -m zenofskills` works the same way.
103
+
104
+ ### As data
105
+
106
+ ```python
107
+ import os; os.environ["ZENOFSKILLS_QUIET"] = "1"
108
+ import zenofskills
109
+
110
+ zenofskills.get(3).text # "Write the playbook, not the textbook."
111
+ zenofskills.by_theme("purpose") # list of Principle objects
112
+ [p.text for p in zenofskills.PRINCIPLES]
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Putting it into your workflow
118
+
119
+ A slogan is not a process. The principles help most where decisions are made:
120
+
121
+ - **Pull requests.** Paste `zenofskills --checklist` into `.github/pull_request_template.md`. Reviewers can then point to a principle by number.
122
+ - **Coding agents.** Add the checklist (or `zenofskills --themes`) to `AGENTS.md`, `CLAUDE.md` or your editor's rules file, so your agent works by the same standard you review by.
123
+ - **Onboarding.** `zenofskills --examples` is a short read for anyone new to the team's approach.
124
+
125
+ ---
126
+
127
+ ## What this is, and isn't
128
+
129
+ - It **is** a compact, opinionated philosophy and a shared vocabulary for teams.
130
+ - It **isn't** a linter, a framework or a replacement for engineering judgment.
131
+ - It's **vendor-neutral**: no principle depends on a particular model, framework or vendor.
132
+
133
+ ---
134
+
135
+ ## Contributing
136
+
137
+ The principles should evolve through discussion, not by decree. Propose a new principle, a rewording or a better example by opening an issue. See [CONTRIBUTING.md](CONTRIBUTING.md).
138
+
139
+ ## License
140
+
141
+ [MIT](LICENSE)
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ tests/test_zenofskills.py
5
+ zenofskills/__init__.py
6
+ zenofskills/__main__.py
7
+ zenofskills/principles.py
8
+ zenofskills/render.py
9
+ zenofskills/verbose.py
10
+ zenofskills.egg-info/PKG-INFO
11
+ zenofskills.egg-info/SOURCES.txt
12
+ zenofskills.egg-info/dependency_links.txt
13
+ zenofskills.egg-info/entry_points.txt
14
+ zenofskills.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ zenofskills = zenofskills.__main__:main
@@ -0,0 +1 @@
1
+ zenofskills