@antprofuse/saddle-skill 0.1.1 → 0.1.2

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.
package/LICENSE-APACHE ADDED
@@ -0,0 +1,203 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
package/LICENSE-MIT ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Saddle contributors
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.
22
+
package/SKILL.md CHANGED
@@ -1,26 +1,26 @@
1
1
  ---
2
2
  name: saddle-service
3
- description: Build and review minimal Rust Service applications against the published Saddle facade package `saddle-framework = "=0.1.1"`. Use when Codex needs to create a Saddle 0.1.1 Service contract, handler, registration, HTTP/JSON exposure, fixed process entry, or verify generated business code without reading or changing Saddle middleware implementation.
3
+ description: 基于已发布的 Saddle 门面包 `saddle-framework = "=0.1.1"` 构建和审查最小 Rust Service 应用。当 AI Coding 需要创建 Saddle 0.1.1 Service 契约、处理器、注册、HTTP/JSON 暴露、固定进程入口,或在不读取和修改 Saddle 中间件实现的前提下验证生成的业务代码时使用。
4
4
  ---
5
5
 
6
6
  # Saddle Service 0.1.1
7
7
 
8
- Use only the public API shipped by `saddle-framework = "=0.1.1"`.
8
+ 只使用 `saddle-framework = "=0.1.1"` 已发布的公共 API。
9
9
 
10
- ## Workflow
10
+ ## 工作流程
11
11
 
12
- 1. Pin the facade exactly as `saddle-framework = "=0.1.1"`; import it as `saddle`.
13
- 2. Read [references/service-0.1.1.md](references/service-0.1.1.md) before generating Service code.
14
- 3. Start from the verified `examples/helloworld` consumer when working in the Saddle repository.
15
- 4. Keep business code limited to request/response types, a Service contract, its handler, and Saddle assembly.
16
- 5. Run both the Rust 1.85 and current-toolchain checks documented in [references/service-0.1.1.md](references/service-0.1.1.md) after changing the reference example.
17
- 6. Reject APIs that are only described as V1 goals but are absent from the published facade.
12
+ 1. 将门面依赖精确固定为 `saddle-framework = "=0.1.1"`,并以 `saddle` 作为导入名。
13
+ 2. 生成 Service 代码前,阅读 [references/service-0.1.1.md](references/service-0.1.1.md)
14
+ 3. Saddle 仓库内工作时,从已验证的 `examples/helloworld` 消费端示例开始。
15
+ 4. 将业务代码限制为请求/响应类型、Service 契约、对应处理器和 Saddle 装配。
16
+ 5. 修改参考示例后,执行 [references/service-0.1.1.md](references/service-0.1.1.md) 中记录的 Rust 1.85 和当前工具链检查。
17
+ 6. 拒绝使用仅存在于 V1 目标描述中、但尚未由已发布门面提供的 API。
18
18
 
19
- ## Boundaries
19
+ ## 边界
20
20
 
21
- - Do not inspect or modify Saddle component implementation.
22
- - Do not replace Saddle's process entry, async runtime, HTTP server, database pool, or observability setup.
23
- - Do not create threads, runtimes, detached tasks, routers, I/O clients, or DB pools in business code.
24
- - Do not claim DB, transaction, internal Service call, graceful shutdown, or observability usage patterns without a compiling 0.1.1 consumer.
25
- - If a required public API is missing, preserve a minimal reproducible consumer failure and submit it through remote Git for the control workspace to assess. Do not patch middleware here.
26
- - Treat local design documents as intent and crates.io 0.1.1 compilation as the source of truth for usable API.
21
+ - 不要检查或修改 Saddle 组件实现。
22
+ - 不要替换 Saddle 的进程入口、异步运行时、HTTP 服务器、数据库连接池或可观测性装配。
23
+ - 不要在业务代码中创建线程、运行时、脱离生命周期的任务、路由器、I/O 客户端或数据库连接池。
24
+ - 在没有可编译的 0.1.1 消费端示例前,不要声称数据库、事务、内部 Service 调用、优雅停机或可观测性用法可用。
25
+ - 如果缺少所需公共 API,保留最小可复现的消费端失败案例,通过远程 Git 提交给控制 workspace 评估;不要在这里修补中间件。
26
+ - 将本地设计文档视为设计意图,将针对 crates.io 0.1.1 制品的编译结果视为可用 API 的事实依据。
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Saddle Service 0.1.1"
3
- short_description: "Build verified Saddle 0.1.1 Service applications"
4
- default_prompt: "Use $saddle-service to build a minimal Saddle Service application."
3
+ short_description: "构建经过验证的 Saddle 0.1.1 Service 应用"
4
+ default_prompt: "使用 $saddle-service 构建一个最小的 Saddle Service 应用。"
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@antprofuse/saddle-skill",
3
- "version": "0.1.1",
4
- "description": "AI Coding skill for building verified Saddle 0.1.1 Service applications.",
3
+ "version": "0.1.2",
4
+ "description": "面向 AI Coding Saddle 0.1.1 Service 中文研发契约。",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "files": [
7
7
  "SKILL.md",
8
+ "LICENSE-APACHE",
9
+ "LICENSE-MIT",
8
10
  "agents",
9
11
  "references"
10
12
  ],
@@ -1,8 +1,8 @@
1
- # Saddle Service 0.1.1 contract
1
+ # Saddle Service 0.1.1 契约
2
2
 
3
- ## Dependency
3
+ ## 依赖
4
4
 
5
- Use the published facade package at an exact version:
5
+ 使用已发布门面包的精确版本:
6
6
 
7
7
  ```toml
8
8
  [package]
@@ -14,11 +14,11 @@ saddle-framework = "=0.1.1"
14
14
  serde = { version = "1", features = ["derive"] }
15
15
  ```
16
16
 
17
- The Cargo package is `saddle-framework`; the Rust library name is `saddle`.
17
+ Cargo 包名是 `saddle-framework`,Rust 库名是 `saddle`。
18
18
 
19
- ## Correct minimal pattern
19
+ ## 正确的最小模式
20
20
 
21
- Define one zero-sized contract type, serializable request/response types, and a separate handler:
21
+ 定义一个零大小的契约类型、可序列化的请求/响应类型,以及独立的处理器:
22
22
 
23
23
  ```rust
24
24
  use saddle::{
@@ -61,7 +61,7 @@ impl ServiceHandler<Hello> for HelloHandler {
61
61
  }
62
62
  ```
63
63
 
64
- Register and expose it only through Saddle:
64
+ 只通过 Saddle 注册并暴露 Service:
65
65
 
66
66
  ```rust
67
67
  builder.register::<Hello, _>(
@@ -71,7 +71,7 @@ builder.register::<Hello, _>(
71
71
  builder.expose_json::<Hello>("/hello");
72
72
  ```
73
73
 
74
- Use the fixed process entry:
74
+ 使用固定的进程入口:
75
75
 
76
76
  ```rust
77
77
  let database_url = std::env::var("SADDLE_DATABASE_URL")
@@ -84,39 +84,39 @@ Saddle::run(config, |builder| {
84
84
  })
85
85
  ```
86
86
 
87
- See `examples/helloworld` for the complete compiling consumer.
87
+ 完整的可编译消费端见 `examples/helloworld`。
88
88
 
89
- ## Incorrect patterns
89
+ ## 错误模式
90
90
 
91
- Do not use an unpinned or compatible version range:
91
+ 不要使用未固定版本或兼容版本范围:
92
92
 
93
93
  ```toml
94
- # Wrong: 0.1.x may change incompatibly.
94
+ # 错误:0.1.x 可能发生不兼容变化。
95
95
  saddle-framework = "0.1"
96
96
  ```
97
97
 
98
- Do not embed database credentials or provide an insecure fallback:
98
+ 不要嵌入数据库凭据,也不要提供不安全的回退值:
99
99
 
100
100
  ```rust
101
- // Wrong: canonical examples must not normalize secrets in source.
101
+ // 错误:规范示例不能将密钥写入源码。
102
102
  let database_url = "mysql://user:password@127.0.0.1/application";
103
103
 
104
- // Wrong: a missing deployment value must fail instead of silently using credentials.
104
+ // 错误:缺少部署配置时必须失败,不能静默使用源码中的凭据。
105
105
  let database_url = std::env::var("SADDLE_DATABASE_URL")
106
106
  .unwrap_or_else(|_| "mysql://user:password@127.0.0.1/application".into());
107
107
  ```
108
108
 
109
- Do not import Service traits from the facade root:
109
+ 不要从门面根模块导入 Service trait:
110
110
 
111
111
  ```rust
112
- // Wrong in 0.1.1: these are under saddle::service.
112
+ // 0.1.1 中错误:这些类型位于 saddle::service
113
113
  use saddle::{Service, ServiceHandler};
114
114
  ```
115
115
 
116
- Do not implement business execution with Tokio or Axum:
116
+ 不要使用 Tokio Axum 实现业务执行入口:
117
117
 
118
118
  ```rust
119
- // Wrong: business code must not own the runtime or HTTP server.
119
+ // 错误:业务代码不能拥有运行时或 HTTP 服务器。
120
120
  #[tokio::main]
121
121
  async fn main() {}
122
122
 
@@ -124,10 +124,10 @@ tokio::spawn(async move {});
124
124
  axum::Router::new();
125
125
  ```
126
126
 
127
- Do not invent ergonomic macros or async trait syntax that 0.1.1 does not publish:
127
+ 不要虚构 0.1.1 未发布的便捷宏或异步 trait 语法:
128
128
 
129
129
  ```rust
130
- // Wrong: not verified public APIs in 0.1.1.
130
+ // 错误:这些不是 0.1.1 中经过验证的公共 API。
131
131
  #[saddle::service]
132
132
  async fn hello(...) { ... }
133
133
 
@@ -135,17 +135,17 @@ async fn hello(...) { ... }
135
135
  async fn main() { ... }
136
136
  ```
137
137
 
138
- Do not create a registry or database directly:
138
+ 不要直接创建注册表或数据库:
139
139
 
140
140
  ```rust
141
- // Wrong: assembly and managed I/O construction belong to Saddle.
141
+ // 错误:装配和托管 I/O 的创建属于 Saddle
142
142
  let registry = saddle::service::ServiceRegistryBuilder::new();
143
143
  let database = saddle::db::Database::connect(...);
144
144
  ```
145
145
 
146
- ## Validation
146
+ ## 验证
147
147
 
148
- Run:
148
+ 执行:
149
149
 
150
150
  ```bash
151
151
  cargo +1.85.0 check --locked --manifest-path examples/helloworld/Cargo.toml
@@ -154,10 +154,10 @@ cargo tree --locked --manifest-path examples/helloworld/Cargo.toml \
154
154
  -p saddle-framework@0.1.1
155
155
  ```
156
156
 
157
- Current verified result:
157
+ 当前已验证结果:
158
158
 
159
- - The Rust 1.85 and current-toolchain checks compile against the crates.io `saddle-framework 0.1.1` artifact.
160
- - The dependency tree resolves every Saddle component to 0.1.1.
161
- - The lockfile is resolved with Cargo 1.85's incompatible-Rust-version fallback so every selected package supports the declared minimum.
159
+ - Rust 1.85 和当前工具链检查均可针对 crates.io `saddle-framework 0.1.1` 制品编译。
160
+ - 依赖树将所有 Saddle 组件解析为 0.1.1
161
+ - 锁文件使用 Cargo 1.85 的不兼容 Rust 版本回退机制解析,因此所有选中包都支持声明的最低 Rust 版本。
162
162
 
163
- The example does not prove runtime readiness because `SADDLE_DATABASE_URL` must identify a reachable database and the configured listen address must be available.
163
+ 该示例不能证明运行时已就绪,因为 `SADDLE_DATABASE_URL` 必须指向可访问的数据库,且配置的监听地址必须可用。