Pyramid 扩展库开发
pyramid-library
库开发者角色:开发独立的 Pyramid 扩展(拥有自己的仓库与包),并向外部使用者暴露 includeme。当用户构建可复用的 Pyramid 库、为使用者设计 includeme、注册自定义指令/tween/请求方法,或使用规范的应用程序测试库时使用。
- License 许可
- MIT
- 最近更新
- 2026-10-24
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pyramid-library
- description
- Library Developer persona: developing standalone Pyramid extensions (own repo, own package) that expose includeme for external consumers. Use when the user builds a reusable Pyramid library, designs includeme for consumers, registers custom directives/tweens/request methods, or tests a library with a proper app.
- dependencies
- [ "pyramid-core" ]
02 资源文件 4
- 参考文档.managed-skill.md239 B
- 参考文档library-patterns.md7.9 KB
- 参考文档library-testing.md6.1 KB
- 其他tools.sdn566 B
03 SKILL.md 正文
MANAGED SKILL — Do not edit this file here. It is managed from an external source repository. To make changes, update the source and run "update my skills" to sync.
Pyramid Library (Library Developer)
Skill for the Library Developer role — developing standalone Pyramid extensions that live in their own repository and are distributed as independent Python packages. These libraries expose includeme for consumers to config.include(), and must not assume anything about the host application's internals.
If you're in the App Developer role (composition root, test infrastructure, pshell snippets), see pyramid-app. If you're in the Plugin Developer role (domain modules inside the app codebase, services, REST endpoints), see pyramid-plugin. For shared Pyramid conventions (registry, models, authorization, transactions), see the pyramid-developer always-on rule.
Install Actions
1. Copy this skill directory
Copy the entire pyramid-library/ directory to the install target so that the reference guides are available at runtime.
Runtime Behavior (After Installation)
When installed, this skill acts as a router for Pyramid library development tasks. Match the user's intent to the right capability:
Capability Routing
| Intent | Delegate to |
|---|---|
Design a library's includeme, register directives, tweens, settings, request methods |
Read and follow library-patterns.md |
| Test the library with a proper Pyramid app, write test fixtures, verify consumer experience | Read and follow library-testing.md |
| Pyramid framework features (config.action, view predicates, view derivers, events, tweens, renderers, static views) | Answer using the installed pyramid-core skill |
| Pyramid conventions, architecture, patterns | Answer using the installed pyramid-developer rule's knowledge |
Trigger Phrases
- Patterns: "pyramid library", "standalone extension", "custom directive", "add_directive", "tween", "config.include for consumers", "library includeme", "settings prefix", "request method", "config.action", "conflict detection", "view predicate", "route predicate", "view deriver", "static view"
- Testing: "test the library", "library test app", "test with a real app", "consumer test", "integration test for library"
Routing Rules
- If the user asks about designing a library's public API, includeme, directives, or settings -> read and follow library-patterns.md
- If the user asks about testing the library -> read and follow library-testing.md
- If the user asks about Pyramid framework features (config.action, view predicates, view derivers, events, tweens, renderers, static views) -> answer using the installed pyramid-core skill
- If the user asks about Pyramid conventions or patterns -> answer directly from the installed rule
- If the question spans multiple areas, answer directly and mention the relevant capability for follow-up
04 同仓库更多 Skills
pytest 测试编写
write-pytest
为任何 Python 代码库编写 pytest 测试。当用户要求编写测试、创建测试、添加测试,或测试某个模块/服务/端点/函数时使用。与框架无关;当检测到相关信号时会路由到框架专用的辅助工具。遵循“先研究—再讨论—后编写”的流程。
会话质量保障检查
quality-assurance
对当前聊天会话执行质量保障检查——任务前验证、任务后清单和代码审查。在完成任务时、提交前或用户要求进行 QA 审查时使用。
Python 开发规范配置
python-developer
Python 开发者总括技能——一次性安装 Python 编码约定,并捆绑配套技能(最佳实践、测试、依赖管理)完成统一配置。当用户要求建立 Python 开发规范、安装 Python 技能,或说“搭建 Python 开发环境”时使用。
Python 编码最佳实践
python-best-practices
全面的 Python 编码约定与最佳实践。当用户询问 Python 约定、编码模式、最佳实践、代码风格、反模式,或“这段 Python 代码应该怎么写”时使用。
Pyramid 框架开发规范
pyramid-developer
Pyramid 框架开发约定——配置/注册表、基于 includeme 的模块系统、pyramid_services、模型、Cornice REST、ACL 授权以及事务处理。在为一个项目建立 Pyramid 开发规范时使用。
Pyramid 框架扩展点参考
pyramid-core
Pyramid 框架特性参考——请求方法、自定义指令、事件、补间(tween)、异常视图、视图谓词、视图派生器、回调、渲染器以及静态视图。当用户询问 Pyramid 框架的任何扩展点时使用。