@ai-content-space/loopx 0.2.9 → 0.2.10

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.
Files changed (99) hide show
  1. package/README.md +10 -6
  2. package/README.zh-CN.md +10 -6
  3. package/docs/loopx/design/loopx-skill-suite-v1-design.md +12 -0
  4. package/docs/loopx/plans/2026-06-15-support-lens-skills-migration.md +1153 -0
  5. package/package.json +6 -1
  6. package/plugins/loopx/.codex-plugin/plugin.json +1 -1
  7. package/plugins/loopx/skills/api-designer/SKILL.md +232 -0
  8. package/plugins/loopx/skills/api-designer/references/error-handling.md +541 -0
  9. package/plugins/loopx/skills/api-designer/references/openapi.md +824 -0
  10. package/plugins/loopx/skills/api-designer/references/pagination.md +494 -0
  11. package/plugins/loopx/skills/api-designer/references/rest-patterns.md +335 -0
  12. package/plugins/loopx/skills/api-designer/references/versioning.md +391 -0
  13. package/plugins/loopx/skills/architecture-designer/SKILL.md +117 -0
  14. package/plugins/loopx/skills/architecture-designer/references/adr-template.md +116 -0
  15. package/plugins/loopx/skills/architecture-designer/references/architecture-patterns.md +346 -0
  16. package/plugins/loopx/skills/architecture-designer/references/database-selection.md +102 -0
  17. package/plugins/loopx/skills/architecture-designer/references/nfr-checklist.md +212 -0
  18. package/plugins/loopx/skills/architecture-designer/references/system-design.md +313 -0
  19. package/plugins/loopx/skills/clarify/SKILL.md +1 -1
  20. package/plugins/loopx/skills/cli-developer/SKILL.md +124 -0
  21. package/plugins/loopx/skills/cli-developer/references/design-patterns.md +221 -0
  22. package/plugins/loopx/skills/cli-developer/references/go-cli.md +540 -0
  23. package/plugins/loopx/skills/cli-developer/references/node-cli.md +383 -0
  24. package/plugins/loopx/skills/cli-developer/references/python-cli.md +422 -0
  25. package/plugins/loopx/skills/cli-developer/references/ux-patterns.md +448 -0
  26. package/plugins/loopx/skills/debug/SKILL.md +1 -1
  27. package/plugins/loopx/skills/doc-readability/SKILL.md +1 -1
  28. package/plugins/loopx/skills/exec/SKILL.md +1 -1
  29. package/plugins/loopx/skills/final-review/SKILL.md +1 -1
  30. package/plugins/loopx/skills/finish/SKILL.md +1 -1
  31. package/plugins/loopx/skills/fix-review/SKILL.md +1 -1
  32. package/plugins/loopx/skills/go-style/SKILL.md +1 -1
  33. package/plugins/loopx/skills/kratos/SKILL.md +2 -1
  34. package/plugins/loopx/skills/plan-to-exec/SKILL.md +1 -1
  35. package/plugins/loopx/skills/refactor-plan/SKILL.md +1 -1
  36. package/plugins/loopx/skills/requirement-analyzer/SKILL.md +161 -0
  37. package/plugins/loopx/skills/requirement-analyzer/references/example-reports.md +170 -0
  38. package/plugins/loopx/skills/requirement-analyzer/references/prd-gap-checklist.md +167 -0
  39. package/plugins/loopx/skills/requirement-analyzer/references/readiness-rubric.md +70 -0
  40. package/plugins/loopx/skills/requirement-analyzer/references/report-template.md +83 -0
  41. package/plugins/loopx/skills/review/SKILL.md +1 -1
  42. package/plugins/loopx/skills/spec/SKILL.md +1 -1
  43. package/plugins/loopx/skills/sql-style/SKILL.md +108 -0
  44. package/plugins/loopx/skills/sql-style/references/database-design.md +402 -0
  45. package/plugins/loopx/skills/sql-style/references/dialect-differences.md +419 -0
  46. package/plugins/loopx/skills/sql-style/references/optimization.md +384 -0
  47. package/plugins/loopx/skills/sql-style/references/query-patterns.md +285 -0
  48. package/plugins/loopx/skills/sql-style/references/window-functions.md +328 -0
  49. package/plugins/loopx/skills/subagent-exec/SKILL.md +1 -1
  50. package/plugins/loopx/skills/tdd/SKILL.md +1 -1
  51. package/plugins/loopx/skills/verify/SKILL.md +1 -1
  52. package/scripts/verify-skills.mjs +0 -2
  53. package/skills/RESOLVER.md +8 -1
  54. package/skills/api-designer/SKILL.md +232 -0
  55. package/skills/api-designer/references/error-handling.md +541 -0
  56. package/skills/api-designer/references/openapi.md +824 -0
  57. package/skills/api-designer/references/pagination.md +494 -0
  58. package/skills/api-designer/references/rest-patterns.md +335 -0
  59. package/skills/api-designer/references/versioning.md +391 -0
  60. package/skills/architecture-designer/SKILL.md +117 -0
  61. package/skills/architecture-designer/references/adr-template.md +116 -0
  62. package/skills/architecture-designer/references/architecture-patterns.md +346 -0
  63. package/skills/architecture-designer/references/database-selection.md +102 -0
  64. package/skills/architecture-designer/references/nfr-checklist.md +212 -0
  65. package/skills/architecture-designer/references/system-design.md +313 -0
  66. package/skills/clarify/SKILL.md +1 -1
  67. package/skills/cli-developer/SKILL.md +124 -0
  68. package/skills/cli-developer/references/design-patterns.md +221 -0
  69. package/skills/cli-developer/references/go-cli.md +540 -0
  70. package/skills/cli-developer/references/node-cli.md +383 -0
  71. package/skills/cli-developer/references/python-cli.md +422 -0
  72. package/skills/cli-developer/references/ux-patterns.md +448 -0
  73. package/skills/debug/SKILL.md +1 -1
  74. package/skills/doc-readability/SKILL.md +1 -1
  75. package/skills/exec/SKILL.md +1 -1
  76. package/skills/final-review/SKILL.md +1 -1
  77. package/skills/finish/SKILL.md +1 -1
  78. package/skills/fix-review/SKILL.md +1 -1
  79. package/skills/go-style/SKILL.md +1 -1
  80. package/skills/kratos/SKILL.md +2 -1
  81. package/skills/plan-to-exec/SKILL.md +1 -1
  82. package/skills/refactor-plan/SKILL.md +1 -1
  83. package/skills/requirement-analyzer/SKILL.md +161 -0
  84. package/skills/requirement-analyzer/references/example-reports.md +170 -0
  85. package/skills/requirement-analyzer/references/prd-gap-checklist.md +167 -0
  86. package/skills/requirement-analyzer/references/readiness-rubric.md +70 -0
  87. package/skills/requirement-analyzer/references/report-template.md +83 -0
  88. package/skills/review/SKILL.md +1 -1
  89. package/skills/spec/SKILL.md +1 -1
  90. package/skills/sql-style/SKILL.md +108 -0
  91. package/skills/sql-style/references/database-design.md +402 -0
  92. package/skills/sql-style/references/dialect-differences.md +419 -0
  93. package/skills/sql-style/references/optimization.md +384 -0
  94. package/skills/sql-style/references/query-patterns.md +285 -0
  95. package/skills/sql-style/references/window-functions.md +328 -0
  96. package/skills/subagent-exec/SKILL.md +1 -1
  97. package/skills/tdd/SKILL.md +1 -1
  98. package/skills/verify/SKILL.md +1 -1
  99. package/src/install-discovery.mjs +5 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ai-content-space/loopx",
3
3
  "type": "module",
4
- "version": "0.2.9",
4
+ "version": "0.2.10",
5
5
  "description": "Skill-first workflow suite for agentic coding assistants",
6
6
  "repository": {
7
7
  "type": "git",
@@ -31,7 +31,10 @@
31
31
  "assets/logo.svg",
32
32
  "src/",
33
33
  "skills/RESOLVER.md",
34
+ "skills/api-designer/",
35
+ "skills/architecture-designer/",
34
36
  "skills/clarify/",
37
+ "skills/cli-developer/",
35
38
  "skills/debug/",
36
39
  "skills/doc-readability/",
37
40
  "skills/exec/",
@@ -42,7 +45,9 @@
42
45
  "skills/kratos/",
43
46
  "skills/plan-to-exec/",
44
47
  "skills/refactor-plan/",
48
+ "skills/requirement-analyzer/",
45
49
  "skills/review/",
50
+ "skills/sql-style/",
46
51
  "skills/spec/",
47
52
  "skills/subagent-exec/",
48
53
  "skills/tdd/",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopx",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Skill-first workflow suite for agentic coding assistants",
5
5
  "skills": "./skills/",
6
6
  "interface": {
@@ -0,0 +1,232 @@
1
+ ---
2
+ name: api-designer
3
+ description: "Applies loopx API design discipline for REST, GraphQL, OpenAPI, resource modeling, pagination, versioning, compatibility, and error models. Not for replacing clarify, spec, implementation planning, code review, or workflow state transitions."
4
+ when_to_use: "api-designer, API design, REST, GraphQL, OpenAPI, resource modeling, pagination, versioning, API errors, compatibility, 接口设计"
5
+ license: MIT
6
+ metadata:
7
+ version: "0.2.10"
8
+ forked_from: https://github.com/Jeffallan/claude-skills/tree/main/skills/api-designer
9
+ maintained_by: loopx
10
+ ---
11
+
12
+ # API Designer
13
+
14
+ API design discipline for REST, GraphQL, and OpenAPI 3.1 contracts.
15
+
16
+ ## loopx Boundary
17
+
18
+ `api-designer` is a support lens, not a workflow state. Use it directly when the user asks for API design help, and use it from `spec`, `exec`, `review`, or `final-review` when work touches API contracts.
19
+
20
+ This skill does not replace `clarify`, `spec`, `plan-to-exec`, `review`, or `final-review`. If product behavior, permissions, compatibility, migration, or client contract decisions are unresolved, route those decisions through `clarify` or `spec` instead of deciding them inside this skill.
21
+
22
+ ## Core Workflow
23
+
24
+ 1. **Analyze domain** — Understand business requirements, data models, and client needs
25
+ 2. **Choose API style** — State whether the contract is REST, GraphQL, or mixed, and why that style fits the client and evolution needs
26
+ 3. **Model contract surface** — For REST, identify resources, relationships, URI patterns, HTTP methods, and request/response schemas. For GraphQL, identify object types, operations, inputs, resolver boundaries, and schema evolution rules.
27
+ 4. **Specify contract** — For REST, create OpenAPI 3.1 and validate with `npx @redocly/cli lint openapi.yaml`. For GraphQL, define the schema and run the project's schema validation or code generation checks.
28
+ 5. **Mock and verify** — For REST, use a mock server such as `npx @stoplight/prism-cli mock openapi.yaml`. For GraphQL, exercise representative operations against the project schema or a local GraphQL test server.
29
+ 6. **Plan evolution** — Design versioning, deprecation, and backward-compatibility strategy
30
+
31
+ ## Reference Guide
32
+
33
+ Load detailed guidance based on context:
34
+
35
+ | Topic | Reference | Load When |
36
+ |-------|-----------|-----------|
37
+ | REST Patterns | `references/rest-patterns.md` | Resource design, HTTP methods, HATEOAS |
38
+ | Versioning | `references/versioning.md` | API versions, deprecation, breaking changes |
39
+ | Pagination | `references/pagination.md` | Cursor, offset, keyset pagination |
40
+ | Error Handling | `references/error-handling.md` | Error responses, RFC 7807, status codes |
41
+ | OpenAPI | `references/openapi.md` | OpenAPI 3.1, documentation, code generation |
42
+
43
+ ## Constraints
44
+
45
+ ### MUST DO
46
+ - For REST contracts, follow REST principles: resource-oriented URIs, proper HTTP methods, and HTTP status semantics.
47
+ - For REST contracts, include a comprehensive OpenAPI 3.1 specification.
48
+ - For GraphQL contracts, include schema definitions, resolver boundaries, operation examples, and validation or code generation checks.
49
+ - Use consistent naming conventions within each contract style.
50
+ - Design proper error responses with actionable messages: RFC 7807 for REST, and explicit GraphQL error shape and partial-success rules for GraphQL.
51
+ - Implement pagination for all collection endpoints or collection fields.
52
+ - Version APIs with clear deprecation policies
53
+ - Document authentication and authorization
54
+ - Provide request/response examples
55
+
56
+ ### MUST NOT DO
57
+ - For REST contracts, use verb-style resource URIs (use `/users/{id}`, not `/getUser/{id}`)
58
+ - Return inconsistent response structures
59
+ - Skip error code documentation
60
+ - For REST contracts, ignore HTTP status code semantics.
61
+ - Design APIs without a versioning strategy
62
+ - Expose implementation details in the API surface
63
+ - Create breaking changes without a migration path
64
+ - Omit rate limiting considerations
65
+
66
+ ## GraphQL Discipline
67
+
68
+ When designing GraphQL APIs, provide the same contract rigor as REST:
69
+
70
+ - Model object types, input types, mutations, queries, and subscriptions around client use cases, not database tables.
71
+ - Define nullability, pagination, filtering, sorting, and authorization rules explicitly in the schema.
72
+ - Use stable node identifiers and connection-style pagination when clients need cursor traversal.
73
+ - Avoid unbounded nested queries; plan depth, complexity, batching, and caching controls.
74
+ - Version by additive schema evolution and documented deprecation, not parallel endpoint versions unless the product contract requires it.
75
+ - Specify error shape, partial-success behavior, and resolver-level authorization failures.
76
+
77
+ ## Templates
78
+
79
+ ### OpenAPI 3.1 Resource Endpoint (copy-paste starter)
80
+
81
+ ```yaml
82
+ openapi: "3.1.0"
83
+ info:
84
+ title: Example API
85
+ version: "1.1.0"
86
+ paths:
87
+ /users:
88
+ get:
89
+ summary: List users
90
+ operationId: listUsers
91
+ tags: [Users]
92
+ parameters:
93
+ - name: cursor
94
+ in: query
95
+ schema: { type: string }
96
+ description: Opaque cursor for pagination
97
+ - name: limit
98
+ in: query
99
+ schema: { type: integer, default: 20, maximum: 100 }
100
+ responses:
101
+ "200":
102
+ description: Paginated list of users
103
+ content:
104
+ application/json:
105
+ schema:
106
+ type: object
107
+ required: [data, pagination]
108
+ properties:
109
+ data:
110
+ type: array
111
+ items: { $ref: "#/components/schemas/User" }
112
+ pagination:
113
+ $ref: "#/components/schemas/CursorPage"
114
+ "400": { $ref: "#/components/responses/BadRequest" }
115
+ "401": { $ref: "#/components/responses/Unauthorized" }
116
+ "429": { $ref: "#/components/responses/TooManyRequests" }
117
+ /users/{id}:
118
+ get:
119
+ summary: Get a user
120
+ operationId: getUser
121
+ tags: [Users]
122
+ parameters:
123
+ - name: id
124
+ in: path
125
+ required: true
126
+ schema: { type: string, format: uuid }
127
+ responses:
128
+ "200":
129
+ description: User found
130
+ content:
131
+ application/json:
132
+ schema: { $ref: "#/components/schemas/User" }
133
+ "404": { $ref: "#/components/responses/NotFound" }
134
+
135
+ components:
136
+ schemas:
137
+ User:
138
+ type: object
139
+ required: [id, email, created_at]
140
+ properties:
141
+ id: { type: string, format: uuid, readOnly: true }
142
+ email: { type: string, format: email }
143
+ name: { type: string }
144
+ created_at: { type: string, format: date-time, readOnly: true }
145
+
146
+ CursorPage:
147
+ type: object
148
+ required: [next_cursor, has_more]
149
+ properties:
150
+ next_cursor: { type: string, nullable: true }
151
+ has_more: { type: boolean }
152
+
153
+ Problem: # RFC 7807 Problem Details
154
+ type: object
155
+ required: [type, title, status]
156
+ properties:
157
+ type: { type: string, format: uri, example: "https://api.example.com/errors/validation-error" }
158
+ title: { type: string, example: "Validation Error" }
159
+ status: { type: integer, example: 400 }
160
+ detail: { type: string, example: "The 'email' field must be a valid email address." }
161
+ instance: { type: string, format: uri, example: "/users/req-abc123" }
162
+
163
+ responses:
164
+ BadRequest:
165
+ description: Invalid request parameters
166
+ content:
167
+ application/problem+json:
168
+ schema: { $ref: "#/components/schemas/Problem" }
169
+ Unauthorized:
170
+ description: Missing or invalid authentication
171
+ content:
172
+ application/problem+json:
173
+ schema: { $ref: "#/components/schemas/Problem" }
174
+ NotFound:
175
+ description: Resource not found
176
+ content:
177
+ application/problem+json:
178
+ schema: { $ref: "#/components/schemas/Problem" }
179
+ TooManyRequests:
180
+ description: Rate limit exceeded
181
+ headers:
182
+ Retry-After: { schema: { type: integer } }
183
+ content:
184
+ application/problem+json:
185
+ schema: { $ref: "#/components/schemas/Problem" }
186
+
187
+ securitySchemes:
188
+ BearerAuth:
189
+ type: http
190
+ scheme: bearer
191
+ bearerFormat: JWT
192
+
193
+ security:
194
+ - BearerAuth: []
195
+ ```
196
+
197
+ ### RFC 7807 Error Response (copy-paste)
198
+
199
+ ```json
200
+ {
201
+ "type": "https://api.example.com/errors/validation-error",
202
+ "title": "Validation Error",
203
+ "status": 422,
204
+ "detail": "The 'email' field must be a valid email address.",
205
+ "instance": "/users/req-abc123",
206
+ "errors": [
207
+ { "field": "email", "message": "Must be a valid email address." }
208
+ ]
209
+ }
210
+ ```
211
+
212
+ - Always use `Content-Type: application/problem+json` for error responses.
213
+ - `type` must be a stable, documented URI — never a generic string.
214
+ - `detail` must be human-readable and actionable.
215
+ - Extend with `errors[]` for field-level validation failures.
216
+
217
+ ## Output Checklist
218
+
219
+ When delivering an API design, provide:
220
+ 1. Resource model and relationships (diagram or table)
221
+ 2. API style decision: REST, GraphQL, or mixed
222
+ 3. For REST, endpoint specifications with URIs, HTTP methods, and OpenAPI 3.1 YAML
223
+ 4. For GraphQL, schema types, operations, resolver boundaries, authorization rules, query limits, and deprecation policy
224
+ 5. Authentication and authorization flows
225
+ 6. Error response catalog: 4xx/5xx responses with stable `type` URIs for REST, or GraphQL error shape, partial-success behavior, and resolver authorization failures
226
+ 7. Pagination and filtering patterns
227
+ 8. Versioning and deprecation strategy
228
+ 9. Validation result: `npx @redocly/cli lint openapi.yaml` passes with no errors for OpenAPI contracts, or project GraphQL schema validation passes for GraphQL contracts
229
+
230
+ ## Knowledge Reference
231
+
232
+ REST architecture, OpenAPI 3.1, GraphQL, HTTP semantics, JSON:API, HATEOAS, OAuth 2.0, JWT, RFC 7807 Problem Details, API versioning patterns, pagination strategies, rate limiting, webhook design, SDK generation