一键导入
add-stdlib-module
Scaffold a new Sharpy.Stdlib module (spy-sourced or handwritten C#) with all required files, conventions, docs, and tests
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new Sharpy.Stdlib module (spy-sourced or handwritten C#) with all required files, conventions, docs, and tests
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Suggest and apply a semver version bump based on commits since the last tag
Push current branch to remote origin
Implement a plan with a coordinated agent team
Run compiler or cross-language benchmarks and compare results
Regenerate C# snapshot tests and spy stdlib after intentional codegen changes
Stress-test property tests across many rounds to find rare bugs. Each round uses fresh random seeds.
| name | add-stdlib-module |
| description | Scaffold a new Sharpy.Stdlib module (spy-sourced or handwritten C#) with all required files, conventions, docs, and tests |
Scaffold a new standard library module in src/Sharpy.Stdlib/. Reference example: Zoneinfo (spy-sourced).
spy/<name>_module.spy, C# is generated.<Module>/.Check python3 -c "import <name>; help(<name>)" and verify Python behavior first before designing the API.
| File | Content |
|---|---|
src/Sharpy.Stdlib/<Module>/__Init__.cs | [SharpyModule("<name>")] public static partial class <Module> { } in namespace Sharpy |
src/Sharpy.Stdlib/modules/Sharpy.Stdlib.<Module>.csproj | <AssemblyName> + <Compile Include="../<Module>/**/*.cs" /> + ProjectReferences to other module csprojs it depends on |
No compiler registration needed — ModuleRegistry.LoadReference() discovers modules at runtime via the [SharpyModule] attribute.
src/Sharpy.Stdlib/spy/<name>_module.spy (auto-included by spy/stdlib.spyproj glob)MODULES array in build_tools/regenerate_spy_stdlib.sh:
"<name>_module:<Module>/<Module>.cs"
bash build_tools/regenerate_spy_stdlib.shcheck_spy_staleness.sh if it drifts from the .spy source| Scenario | Return |
|---|---|
| Absence | T? nullable — NOT Optional<T> |
| Expected failure | Result<T, E> with a typed error class |
| Bugs | throw Python-named exception |
Sharpy.List<T> / Dict<K,V> / Set<T>, never raw System.Collections.GenericT? = null (C#) / T | None = None() (.spy — use T | None, not T?, per #804)netstandard2.1 target (#if NET10_0_OR_GREATER for newer paths)python -m build_tools stdlib generate --force
src/Sharpy.Stdlib.Tests//add-test-fixture: stdlib_<name>_*.spy + .expected in src/Sharpy.Compiler.Tests/Integration/TestFixtures/.claude/scripts/dotnet-serialized build sharpy.sln
.claude/scripts/dotnet-serialized test --filter "FullyQualifiedName~<Module>" --no-build
bash build_tools/regenerate_spy_stdlib.sh --check # spy-sourced only
Read output from .claude/tmp/dotnet-serialized-latest.log. Finally, update the module count/list in CLAUDE.md (Architecture table + Sharpy.Stdlib section).