factorial
Compute the factorial of a non-negative integer n, streaming each multiplication step. Use when asked to compute factorial, calculate n!, or demonstrate streaming math computation.
- License 许可
- MIT
- 最近更新
- 2026-05-31
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- factorial
- license
- MIT
- description
- Compute the factorial of a non-negative integer n, streaming each multiplication step. Use when asked to compute factorial, calculate n!, or demonstrate streaming math computation.
- compatibility
- Python 3.11+
02 资源文件 3
- 脚本handler.py380 B
- 脚本models.py151 B
- 其他skill.toml147 B
03 SKILL.md 正文
What this skill does
Computes n! iteratively, yielding each multiplication step as a streamed chunk so the client can observe the computation in progress.
Input
n— non-negative integer
Output
Each step is streamed as a chunk:
start: 1
2: 2
3: 6
4: 24
5: 120
Gotchas
n = 0returns0! = 1immediately (by definition).- Negative values raise
ValueError. - The handler is an async generator — each step is a separate SSE
chunkevent.
04 同仓库更多 Skills
skill_md_only
An agentskills.io skill with no handler — used to test warning behaviour.
greet
Greet someone by name. Use when asked to greet or say hello.
echo_stream
Echo words from text one at a time as a stream. Use to test streaming.
harnessapi
harnessapi best practices, skill creation, and API exposure. Use when working with harnessapi, creating or editing skill folders, converting agentskills.io skills to API endpoints, wrapping Python functions as skills, running the skill server, or connecting MCP clients. Keeps harnessapi code idiomatic and up to date.