packwise-skills 1.0.0 → 1.2.0

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 (53) hide show
  1. package/.cursorrules +23 -23
  2. package/CLAUDE.md +25 -25
  3. package/LICENSE +21 -0
  4. package/README.md +404 -295
  5. package/audit.md +224 -224
  6. package/bin/packwise.js +322 -155
  7. package/install.sh +123 -0
  8. package/package.json +32 -31
  9. package/skill.md +944 -719
  10. package/sub-skills/ai/local-llm.md +183 -183
  11. package/sub-skills/ai/python-ml.md +164 -164
  12. package/sub-skills/backend/go-server.md +184 -184
  13. package/sub-skills/backend/java-spring.md +241 -241
  14. package/sub-skills/backend/node-server.md +164 -164
  15. package/sub-skills/backend/php-laravel.md +175 -175
  16. package/sub-skills/backend/python-server.md +164 -164
  17. package/sub-skills/backend/rust-backend.md +118 -118
  18. package/sub-skills/cli/python-cli.md +236 -236
  19. package/sub-skills/cli/sdk-library.md +497 -497
  20. package/sub-skills/cloud/ci-cd-pipelines.md +350 -350
  21. package/sub-skills/cloud/docker.md +191 -191
  22. package/sub-skills/cloud/kubernetes.md +277 -277
  23. package/sub-skills/cloud/payment-integration.md +307 -307
  24. package/sub-skills/cross-platform/multiplatform.md +252 -252
  25. package/sub-skills/desktop/electron.md +783 -783
  26. package/sub-skills/desktop/game-dev.md +443 -443
  27. package/sub-skills/desktop/native-app.md +123 -123
  28. package/sub-skills/desktop/scenarios.md +443 -443
  29. package/sub-skills/desktop/smart-platforms.md +324 -324
  30. package/sub-skills/desktop/tauri.md +428 -428
  31. package/sub-skills/desktop/vr-ar.md +252 -252
  32. package/sub-skills/desktop/web-to-desktop.md +153 -153
  33. package/sub-skills/embedded/car-infotainment.md +129 -129
  34. package/sub-skills/embedded/esp32.md +184 -184
  35. package/sub-skills/embedded/ros.md +150 -150
  36. package/sub-skills/embedded/stm32.md +160 -160
  37. package/sub-skills/mobile/android.md +322 -322
  38. package/sub-skills/mobile/capacitor.md +232 -232
  39. package/sub-skills/mobile/flutter-mobile.md +138 -138
  40. package/sub-skills/mobile/harmonyos.md +150 -150
  41. package/sub-skills/mobile/ios.md +245 -245
  42. package/sub-skills/mobile/react-native.md +443 -443
  43. package/sub-skills/mobile/wearables.md +230 -230
  44. package/sub-skills/plugins/browser-extension.md +308 -308
  45. package/sub-skills/plugins/jetbrains-plugin.md +226 -226
  46. package/sub-skills/plugins/vscode-extension.md +204 -204
  47. package/sub-skills/security/security-tools.md +174 -174
  48. package/sub-skills/web/monorepo.md +274 -274
  49. package/sub-skills/web/pwa.md +220 -220
  50. package/sub-skills/web/serverless-edge.md +295 -295
  51. package/sub-skills/web/spa.md +266 -266
  52. package/sub-skills/web/ssr.md +228 -228
  53. package/sub-skills/web/wasm.md +243 -243
@@ -1,497 +1,497 @@
1
- # SDK & Library Build Sub-Skill
2
-
3
- Build, package, and distribute software development kits (SDKs) and reusable libraries for other developers to consume.
4
-
5
- **Current versions**: npm 10 / PyPI / Maven Central / crates.io / Go modules / NuGet (2025-2026)
6
-
7
- ## When to Use
8
-
9
- - Building a library/SDK for other developers to use
10
- - Publishing to package registries (npm, PyPI, crates.io, Maven, NuGet)
11
- - Creating developer toolkits, client libraries, utility packages
12
- - Open-source library distribution
13
- - Internal enterprise library sharing
14
-
15
- ---
16
-
17
- ## JavaScript/TypeScript (npm)
18
-
19
- ### Project Setup
20
-
21
- ```json
22
- {
23
- "name": "@myorg/sdk",
24
- "version": "1.0.0",
25
- "description": "My awesome SDK",
26
- "type": "module",
27
- "main": "./dist/index.cjs",
28
- "module": "./dist/index.js",
29
- "types": "./dist/index.d.ts",
30
- "exports": {
31
- ".": {
32
- "import": "./dist/index.js",
33
- "require": "./dist/index.cjs",
34
- "types": "./dist/index.d.ts"
35
- },
36
- "./utils": {
37
- "import": "./dist/utils.js",
38
- "require": "./dist/utils.cjs",
39
- "types": "./dist/utils.d.ts"
40
- }
41
- },
42
- "files": ["dist"],
43
- "scripts": {
44
- "build": "tsup src/index.ts src/utils.ts --format cjs,esm --dts",
45
- "test": "vitest",
46
- "lint": "eslint src/",
47
- "prepublishOnly": "npm run build && npm run test"
48
- },
49
- "devDependencies": {
50
- "tsup": "^8.0.0",
51
- "typescript": "^5.7.0",
52
- "vitest": "^2.0.0"
53
- },
54
- "peerDependencies": {
55
- "react": ">=18"
56
- },
57
- "engines": {
58
- "node": ">=20"
59
- },
60
- "license": "MIT",
61
- "repository": {
62
- "type": "git",
63
- "url": "https://github.com/myorg/sdk"
64
- }
65
- }
66
- ```
67
-
68
- ### Build
69
-
70
- ```bash
71
- # Build CJS + ESM + TypeScript declarations
72
- npx tsup src/index.ts --format cjs,esm --dts
73
- # Output:
74
- # dist/index.js (ESM)
75
- # dist/index.cjs (CJS)
76
- # dist/index.d.ts (TypeScript declarations)
77
-
78
- # OR with Rollup
79
- npx rollup -c rollup.config.js
80
-
81
- # OR with plain TypeScript
82
- npx tsc -p tsconfig.build.json
83
- ```
84
-
85
- ### Publish
86
-
87
- ```bash
88
- # Login
89
- npm login
90
-
91
- # Publish public package
92
- npm publish --access public
93
-
94
- # Publish scoped package
95
- npm publish --access public # @myorg/sdk
96
-
97
- # Publish pre-release
98
- npm publish --tag beta
99
-
100
- # Dry run (see what would be published)
101
- npm pack --dry-run
102
- ```
103
-
104
- ### Versioning
105
-
106
- ```bash
107
- npm version patch # 1.0.0 → 1.0.1 (bug fixes)
108
- npm version minor # 1.0.0 → 1.1.0 (new features, backward compatible)
109
- npm version major # 1.0.0 → 2.0.0 (breaking changes)
110
- npm publish
111
- git push --tags
112
- ```
113
-
114
- ### Common Pitfalls (npm)
115
-
116
- | Issue | Fix |
117
- |-------|-----|
118
- | `files` too large | Use `"files": ["dist"]` to whitelist; check with `npm pack --dry-run` |
119
- | Types not found | Ensure `"types": "./dist/index.d.ts"` in package.json |
120
- | CJS/ESM dual package hazard | Use `exports` field with separate `import`/`require` paths |
121
- | `peerDependencies` not installed | Document required peer deps; don't bundle them |
122
- | Scoped package publish fails | Use `--access public` for public scoped packages |
123
- | Version bump not triggering CI | Push tags: `git push --tags`; use `release-please` or `changesets` |
124
-
125
- ---
126
-
127
- ## Python (PyPI)
128
-
129
- ### Project Setup
130
-
131
- ```toml
132
- # pyproject.toml
133
- [build-system]
134
- requires = ["setuptools>=75.0", "wheel"]
135
- build-backend = "setuptools.backends._legacy:_Backend"
136
-
137
- [project]
138
- name = "my-sdk"
139
- version = "1.0.0"
140
- description = "My awesome SDK"
141
- readme = "README.md"
142
- license = "MIT"
143
- requires-python = ">=3.10"
144
- dependencies = [
145
- "httpx>=0.27",
146
- "pydantic>=2.0",
147
- ]
148
-
149
- [project.optional-dependencies]
150
- dev = ["pytest>=8.0", "ruff>=0.8"]
151
-
152
- [project.urls]
153
- Homepage = "https://github.com/myorg/my-sdk"
154
- Documentation = "https://my-sdk.readthedocs.io"
155
- Repository = "https://github.com/myorg/my-sdk"
156
-
157
- [project.scripts]
158
- my-sdk = "my_sdk.cli:main" # CLI entry point
159
-
160
- [tool.setuptools.packages.find]
161
- where = ["src"]
162
- ```
163
-
164
- ### Project Structure
165
-
166
- ```
167
- my-sdk/
168
- ├── src/
169
- │ └── my_sdk/
170
- │ ├── __init__.py ← Public API exports
171
- │ ├── client.py ← Main SDK client
172
- │ ├── models.py ← Data models
173
- │ └── utils.py
174
- ├── tests/
175
- ├── pyproject.toml
176
- ├── README.md
177
- └── LICENSE
178
- ```
179
-
180
- ### Build
181
-
182
- ```bash
183
- # Build
184
- python -m build
185
- # Output:
186
- # dist/my_sdk-1.0.0-py3-none-any.whl (wheel, preferred)
187
- # dist/my_sdk-1.0.0.tar.gz (source distribution)
188
-
189
- # Verify package
190
- twine check dist/*
191
-
192
- # Test install locally
193
- pip install dist/my_sdk-1.0.0-py3-none-any.whl
194
- ```
195
-
196
- ### Publish to PyPI
197
-
198
- ```bash
199
- # Install tools
200
- pip install build twine
201
-
202
- # Publish to TestPyPI first
203
- twine upload --repository testpypi dist/*
204
-
205
- # Publish to PyPI
206
- twine upload dist/*
207
-
208
- # OR: Trusted publishing (recommended, no API token needed)
209
- # Configure on pypi.org → project → publishing → add GitHub Actions
210
- ```
211
-
212
- ### GitHub Actions (Trusted Publishing)
213
-
214
- ```yaml
215
- name: Publish to PyPI
216
- on:
217
- push:
218
- tags: ['v*']
219
- jobs:
220
- publish:
221
- runs-on: ubuntu-latest
222
- permissions:
223
- id-token: write # Required for trusted publishing
224
- steps:
225
- - uses: actions/checkout@v4
226
- - uses: actions/setup-python@v5
227
- with:
228
- python-version: '3.13'
229
- - run: pip install build
230
- - run: python -m build
231
- - uses: pypa/gh-action-pypi-publish@release/v1
232
- ```
233
-
234
- ### Common Pitfalls (PyPI)
235
-
236
- | Issue | Fix |
237
- |-------|-----|
238
- | `name already taken` | Choose unique name; check PyPI first |
239
- | `twine upload` auth error | Use trusted publishing or API token |
240
- | Wheel missing files | Check `[tool.setuptools.packages.find]` config |
241
- | Import errors after install | Use `src/` layout; check `__init__.py` exports |
242
- | Dependencies not installed | List all in `[project.dependencies]`; not just `requirements.txt` |
243
-
244
- ---
245
-
246
- ## Rust (crates.io)
247
-
248
- ### Cargo.toml
249
-
250
- ```toml
251
- [package]
252
- name = "my-sdk"
253
- version = "0.1.0"
254
- edition = "2021"
255
- description = "My awesome Rust SDK"
256
- license = "MIT OR Apache-2.0"
257
- repository = "https://github.com/myorg/my-sdk"
258
- documentation = "https://docs.rs/my-sdk"
259
- readme = "README.md"
260
- keywords = ["sdk", "api", "client"]
261
- categories = ["api-bindings", "web-programming"]
262
-
263
- [dependencies]
264
- reqwest = { version = "0.12", features = ["json"] }
265
- serde = { version = "1", features = ["derive"] }
266
- serde_json = "1"
267
- tokio = { version = "1", features = ["full"] }
268
- thiserror = "2"
269
- ```
270
-
271
- ### Build & Publish
272
-
273
- ```bash
274
- # Build library
275
- cargo build --release
276
-
277
- # Run tests
278
- cargo test
279
-
280
- # Publish to crates.io
281
- cargo login
282
- cargo publish
283
-
284
- # Dry run
285
- cargo publish --dry-run
286
-
287
- # Yank (unpublish) a version
288
- cargo yank --vers 0.1.0
289
- ```
290
-
291
- ### Common Pitfalls (crates.io)
292
-
293
- | Issue | Fix |
294
- |-------|-----|
295
- | `crate name taken` | Search crates.io first; use unique name |
296
- | Docs.rs build fails | Ensure docs build locally: `cargo doc --no-deps` |
297
- | Feature flags not documented | Document all features in README |
298
- | MSRV (minimum Rust version) | Set `rust-version` in Cargo.toml |
299
-
300
- ---
301
-
302
- ## Go (Go Modules)
303
-
304
- ### Module Setup
305
-
306
- ```go
307
- // go.mod
308
- module github.com/myorg/my-sdk
309
-
310
- go 1.23
311
-
312
- require (
313
- github.com/some/dependency v1.2.3
314
- )
315
- ```
316
-
317
- ### Project Structure
318
-
319
- ```
320
- my-sdk/
321
- ├── client.go ← Main SDK client
322
- ├── client_test.go ← Tests
323
- ├── models.go ← Data types
324
- ├── errors.go ← Error types
325
- ├── go.mod
326
- ├── go.sum
327
- ├── README.md
328
- └── LICENSE
329
- ```
330
-
331
- ### Publish (Git-based)
332
-
333
- Go modules are published via Git tags — no registry needed.
334
-
335
- ```bash
336
- # Tag and push
337
- git tag v1.0.0
338
- git push origin v1.0.0
339
-
340
- # Users install with:
341
- # go get github.com/myorg/my-sdk@v1.0.0
342
-
343
- # Update to latest:
344
- # go get github.com/myorg/my-sdk@latest
345
- ```
346
-
347
- ### Common Pitfalls (Go)
348
-
349
- | Issue | Fix |
350
- |-------|-----|
351
- | `go.sum` mismatch | Run `go mod tidy`; commit both files |
352
- | Breaking change without major version | Use `/v2` import path for major versions |
353
- | pkg.go.dev not showing | Push tag; `go get` triggers indexing |
354
- | API surface too large | Export only what users need; keep internals in `internal/` |
355
-
356
- ---
357
-
358
- ## Java/Kotlin (Maven Central)
359
-
360
- ### Gradle Setup
361
-
362
- ```kotlin
363
- // build.gradle.kts
364
- plugins {
365
- `java-library`
366
- `maven-publish`
367
- signing
368
- }
369
-
370
- group = "com.example"
371
- version = "1.0.0"
372
-
373
- java {
374
- withSourcesJar()
375
- withJavadocJar()
376
- }
377
-
378
- publishing {
379
- publications {
380
- create<MavenPublication>("mavenJava") {
381
- from(components["java"])
382
- pom {
383
- name.set("My SDK")
384
- description.set("My awesome Java SDK")
385
- url.set("https://github.com/myorg/my-sdk")
386
- licenses {
387
- license {
388
- name.set("The MIT License")
389
- url.set("https://opensource.org/licenses/MIT")
390
- }
391
- }
392
- }
393
- }
394
- }
395
- repositories {
396
- maven {
397
- url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
398
- credentials {
399
- username = System.getenv("OSSRH_USERNAME")
400
- password = System.getenv("OSSRH_PASSWORD")
401
- }
402
- }
403
- }
404
- }
405
-
406
- signing {
407
- sign(publishing.publications["mavenJava"])
408
- }
409
- ```
410
-
411
- ### Publish
412
-
413
- ```bash
414
- ./gradlew publishToMavenLocal # Local testing
415
- ./gradlew publish # Publish to Maven Central
416
-
417
- # Requirements for Maven Central:
418
- # 1. Sonatype OSSRH account (central.sonatype.com)
419
- # 2. GPG signing key
420
- # 3. POM with name, description, URL, license, developers, SCM
421
- ```
422
-
423
- ---
424
-
425
- ## .NET (NuGet)
426
-
427
- ### Project Setup
428
-
429
- ```xml
430
- <!-- MySdk.csproj -->
431
- <Project Sdk="Microsoft.NET.Sdk">
432
- <PropertyGroup>
433
- <TargetFramework>net8.0</TargetFramework>
434
- <PackageId>MyOrg.MySdk</PackageId>
435
- <Version>1.0.0</Version>
436
- <Description>My awesome .NET SDK</Description>
437
- <Authors>My Name</Authors>
438
- <PackageLicenseExpression>MIT</PackageLicenseExpression>
439
- <RepositoryUrl>https://github.com/myorg/my-sdk</RepositoryUrl>
440
- <GenerateDocumentationFile>true</GenerateDocumentationFile>
441
- </PropertyGroup>
442
- </Project>
443
- ```
444
-
445
- ### Build & Publish
446
-
447
- ```bash
448
- # Build
449
- dotnet build -c Release
450
-
451
- # Pack as .nupkg
452
- dotnet pack -c Release
453
- # Output: bin/Release/MyOrg.MySdk.1.0.0.nupkg
454
-
455
- # Publish to NuGet.org
456
- dotnet nuget push bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
457
- ```
458
-
459
- ---
460
-
461
- ## SDK Publishing Checklist
462
-
463
- | Item | Why |
464
- |------|-----|
465
- | **Semantic Versioning** | Users need to understand the impact of upgrading |
466
- | **CHANGELOG** | Document what changed in each version |
467
- | **README with examples** | Users need quick-start code snippets |
468
- | **Type definitions** | TypeScript (.d.ts), Python (py.typed), Rust (docs.rs) |
469
- | **License** | MIT/Apache-2.0 for permissive; must be present |
470
- | **Tests** | > 80% coverage; CI must pass before publish |
471
- | **Documentation** | API reference + usage guide |
472
- | **Min version pinning** | Set `engines` (npm), `requires-python` (PyPI), `rust-version` (Cargo) |
473
- | **CI/CD publish pipeline** | Tag → build → test → publish (automated) |
474
- | **Deprecation notices** | Use `@deprecated` / `warnings.warn` before removing APIs |
475
- | **Security policy** | SECURITY.md for vulnerability reporting |
476
-
477
- ## Versioning Strategy
478
-
479
- | Change Type | Version Bump | Example |
480
- |-------------|-------------|---------|
481
- | Bug fix | Patch (1.0.0 → 1.0.1) | Fix null pointer in client |
482
- | New feature (backward compatible) | Minor (1.0.0 → 1.1.0) | Add `listUsers()` method |
483
- | Breaking change | Major (1.0.0 → 2.0.0) | Rename `fetch()` to `get()` |
484
- | Pre-release | Tag (1.0.0-beta.1) | Testing before stable |
485
-
486
- ## Common Pitfalls (All Languages)
487
-
488
- | Issue | Fix |
489
- |-------|-----|
490
- | Breaking change in minor version | Follow SemVer strictly; use deprecation warnings first |
491
- | No changelog | Use `conventional-commits` + automated changelog tools |
492
- | Missing type definitions | TypeScript: emit .d.ts; Python: add py.typed marker |
493
- | API surface too large | Export only what users need; keep internals private |
494
- | Version not bumping in CI | Use `changesets`, `semantic-release`, or `release-please` |
495
- | Dependencies too heavy | Minimize dependencies; use optional/peer dependencies |
496
- | No migration guide | Write MIGRATION.md for major version changes |
497
- | Published test/dev code | Use `.npmignore`, `MANIFEST.in`, `.gitignore` properly |
1
+ # SDK & Library Build Sub-Skill
2
+
3
+ Build, package, and distribute software development kits (SDKs) and reusable libraries for other developers to consume.
4
+
5
+ **Current versions**: npm 10 / PyPI / Maven Central / crates.io / Go modules / NuGet (2025-2026)
6
+
7
+ ## When to Use
8
+
9
+ - Building a library/SDK for other developers to use
10
+ - Publishing to package registries (npm, PyPI, crates.io, Maven, NuGet)
11
+ - Creating developer toolkits, client libraries, utility packages
12
+ - Open-source library distribution
13
+ - Internal enterprise library sharing
14
+
15
+ ---
16
+
17
+ ## JavaScript/TypeScript (npm)
18
+
19
+ ### Project Setup
20
+
21
+ ```json
22
+ {
23
+ "name": "@myorg/sdk",
24
+ "version": "1.0.0",
25
+ "description": "My awesome SDK",
26
+ "type": "module",
27
+ "main": "./dist/index.cjs",
28
+ "module": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "import": "./dist/index.js",
33
+ "require": "./dist/index.cjs",
34
+ "types": "./dist/index.d.ts"
35
+ },
36
+ "./utils": {
37
+ "import": "./dist/utils.js",
38
+ "require": "./dist/utils.cjs",
39
+ "types": "./dist/utils.d.ts"
40
+ }
41
+ },
42
+ "files": ["dist"],
43
+ "scripts": {
44
+ "build": "tsup src/index.ts src/utils.ts --format cjs,esm --dts",
45
+ "test": "vitest",
46
+ "lint": "eslint src/",
47
+ "prepublishOnly": "npm run build && npm run test"
48
+ },
49
+ "devDependencies": {
50
+ "tsup": "^8.0.0",
51
+ "typescript": "^5.7.0",
52
+ "vitest": "^2.0.0"
53
+ },
54
+ "peerDependencies": {
55
+ "react": ">=18"
56
+ },
57
+ "engines": {
58
+ "node": ">=20"
59
+ },
60
+ "license": "MIT",
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "https://github.com/myorg/sdk"
64
+ }
65
+ }
66
+ ```
67
+
68
+ ### Build
69
+
70
+ ```bash
71
+ # Build CJS + ESM + TypeScript declarations
72
+ npx tsup src/index.ts --format cjs,esm --dts
73
+ # Output:
74
+ # dist/index.js (ESM)
75
+ # dist/index.cjs (CJS)
76
+ # dist/index.d.ts (TypeScript declarations)
77
+
78
+ # OR with Rollup
79
+ npx rollup -c rollup.config.js
80
+
81
+ # OR with plain TypeScript
82
+ npx tsc -p tsconfig.build.json
83
+ ```
84
+
85
+ ### Publish
86
+
87
+ ```bash
88
+ # Login
89
+ npm login
90
+
91
+ # Publish public package
92
+ npm publish --access public
93
+
94
+ # Publish scoped package
95
+ npm publish --access public # @myorg/sdk
96
+
97
+ # Publish pre-release
98
+ npm publish --tag beta
99
+
100
+ # Dry run (see what would be published)
101
+ npm pack --dry-run
102
+ ```
103
+
104
+ ### Versioning
105
+
106
+ ```bash
107
+ npm version patch # 1.0.0 → 1.0.1 (bug fixes)
108
+ npm version minor # 1.0.0 → 1.1.0 (new features, backward compatible)
109
+ npm version major # 1.0.0 → 2.0.0 (breaking changes)
110
+ npm publish
111
+ git push --tags
112
+ ```
113
+
114
+ ### Common Pitfalls (npm)
115
+
116
+ | Issue | Fix |
117
+ |-------|-----|
118
+ | `files` too large | Use `"files": ["dist"]` to whitelist; check with `npm pack --dry-run` |
119
+ | Types not found | Ensure `"types": "./dist/index.d.ts"` in package.json |
120
+ | CJS/ESM dual package hazard | Use `exports` field with separate `import`/`require` paths |
121
+ | `peerDependencies` not installed | Document required peer deps; don't bundle them |
122
+ | Scoped package publish fails | Use `--access public` for public scoped packages |
123
+ | Version bump not triggering CI | Push tags: `git push --tags`; use `release-please` or `changesets` |
124
+
125
+ ---
126
+
127
+ ## Python (PyPI)
128
+
129
+ ### Project Setup
130
+
131
+ ```toml
132
+ # pyproject.toml
133
+ [build-system]
134
+ requires = ["setuptools>=75.0", "wheel"]
135
+ build-backend = "setuptools.backends._legacy:_Backend"
136
+
137
+ [project]
138
+ name = "my-sdk"
139
+ version = "1.0.0"
140
+ description = "My awesome SDK"
141
+ readme = "README.md"
142
+ license = "MIT"
143
+ requires-python = ">=3.10"
144
+ dependencies = [
145
+ "httpx>=0.27",
146
+ "pydantic>=2.0",
147
+ ]
148
+
149
+ [project.optional-dependencies]
150
+ dev = ["pytest>=8.0", "ruff>=0.8"]
151
+
152
+ [project.urls]
153
+ Homepage = "https://github.com/myorg/my-sdk"
154
+ Documentation = "https://my-sdk.readthedocs.io"
155
+ Repository = "https://github.com/myorg/my-sdk"
156
+
157
+ [project.scripts]
158
+ my-sdk = "my_sdk.cli:main" # CLI entry point
159
+
160
+ [tool.setuptools.packages.find]
161
+ where = ["src"]
162
+ ```
163
+
164
+ ### Project Structure
165
+
166
+ ```
167
+ my-sdk/
168
+ ├── src/
169
+ │ └── my_sdk/
170
+ │ ├── __init__.py ← Public API exports
171
+ │ ├── client.py ← Main SDK client
172
+ │ ├── models.py ← Data models
173
+ │ └── utils.py
174
+ ├── tests/
175
+ ├── pyproject.toml
176
+ ├── README.md
177
+ └── LICENSE
178
+ ```
179
+
180
+ ### Build
181
+
182
+ ```bash
183
+ # Build
184
+ python -m build
185
+ # Output:
186
+ # dist/my_sdk-1.0.0-py3-none-any.whl (wheel, preferred)
187
+ # dist/my_sdk-1.0.0.tar.gz (source distribution)
188
+
189
+ # Verify package
190
+ twine check dist/*
191
+
192
+ # Test install locally
193
+ pip install dist/my_sdk-1.0.0-py3-none-any.whl
194
+ ```
195
+
196
+ ### Publish to PyPI
197
+
198
+ ```bash
199
+ # Install tools
200
+ pip install build twine
201
+
202
+ # Publish to TestPyPI first
203
+ twine upload --repository testpypi dist/*
204
+
205
+ # Publish to PyPI
206
+ twine upload dist/*
207
+
208
+ # OR: Trusted publishing (recommended, no API token needed)
209
+ # Configure on pypi.org → project → publishing → add GitHub Actions
210
+ ```
211
+
212
+ ### GitHub Actions (Trusted Publishing)
213
+
214
+ ```yaml
215
+ name: Publish to PyPI
216
+ on:
217
+ push:
218
+ tags: ['v*']
219
+ jobs:
220
+ publish:
221
+ runs-on: ubuntu-latest
222
+ permissions:
223
+ id-token: write # Required for trusted publishing
224
+ steps:
225
+ - uses: actions/checkout@v4
226
+ - uses: actions/setup-python@v5
227
+ with:
228
+ python-version: '3.13'
229
+ - run: pip install build
230
+ - run: python -m build
231
+ - uses: pypa/gh-action-pypi-publish@release/v1
232
+ ```
233
+
234
+ ### Common Pitfalls (PyPI)
235
+
236
+ | Issue | Fix |
237
+ |-------|-----|
238
+ | `name already taken` | Choose unique name; check PyPI first |
239
+ | `twine upload` auth error | Use trusted publishing or API token |
240
+ | Wheel missing files | Check `[tool.setuptools.packages.find]` config |
241
+ | Import errors after install | Use `src/` layout; check `__init__.py` exports |
242
+ | Dependencies not installed | List all in `[project.dependencies]`; not just `requirements.txt` |
243
+
244
+ ---
245
+
246
+ ## Rust (crates.io)
247
+
248
+ ### Cargo.toml
249
+
250
+ ```toml
251
+ [package]
252
+ name = "my-sdk"
253
+ version = "0.1.0"
254
+ edition = "2021"
255
+ description = "My awesome Rust SDK"
256
+ license = "MIT OR Apache-2.0"
257
+ repository = "https://github.com/myorg/my-sdk"
258
+ documentation = "https://docs.rs/my-sdk"
259
+ readme = "README.md"
260
+ keywords = ["sdk", "api", "client"]
261
+ categories = ["api-bindings", "web-programming"]
262
+
263
+ [dependencies]
264
+ reqwest = { version = "0.12", features = ["json"] }
265
+ serde = { version = "1", features = ["derive"] }
266
+ serde_json = "1"
267
+ tokio = { version = "1", features = ["full"] }
268
+ thiserror = "2"
269
+ ```
270
+
271
+ ### Build & Publish
272
+
273
+ ```bash
274
+ # Build library
275
+ cargo build --release
276
+
277
+ # Run tests
278
+ cargo test
279
+
280
+ # Publish to crates.io
281
+ cargo login
282
+ cargo publish
283
+
284
+ # Dry run
285
+ cargo publish --dry-run
286
+
287
+ # Yank (unpublish) a version
288
+ cargo yank --vers 0.1.0
289
+ ```
290
+
291
+ ### Common Pitfalls (crates.io)
292
+
293
+ | Issue | Fix |
294
+ |-------|-----|
295
+ | `crate name taken` | Search crates.io first; use unique name |
296
+ | Docs.rs build fails | Ensure docs build locally: `cargo doc --no-deps` |
297
+ | Feature flags not documented | Document all features in README |
298
+ | MSRV (minimum Rust version) | Set `rust-version` in Cargo.toml |
299
+
300
+ ---
301
+
302
+ ## Go (Go Modules)
303
+
304
+ ### Module Setup
305
+
306
+ ```go
307
+ // go.mod
308
+ module github.com/myorg/my-sdk
309
+
310
+ go 1.23
311
+
312
+ require (
313
+ github.com/some/dependency v1.2.3
314
+ )
315
+ ```
316
+
317
+ ### Project Structure
318
+
319
+ ```
320
+ my-sdk/
321
+ ├── client.go ← Main SDK client
322
+ ├── client_test.go ← Tests
323
+ ├── models.go ← Data types
324
+ ├── errors.go ← Error types
325
+ ├── go.mod
326
+ ├── go.sum
327
+ ├── README.md
328
+ └── LICENSE
329
+ ```
330
+
331
+ ### Publish (Git-based)
332
+
333
+ Go modules are published via Git tags — no registry needed.
334
+
335
+ ```bash
336
+ # Tag and push
337
+ git tag v1.0.0
338
+ git push origin v1.0.0
339
+
340
+ # Users install with:
341
+ # go get github.com/myorg/my-sdk@v1.0.0
342
+
343
+ # Update to latest:
344
+ # go get github.com/myorg/my-sdk@latest
345
+ ```
346
+
347
+ ### Common Pitfalls (Go)
348
+
349
+ | Issue | Fix |
350
+ |-------|-----|
351
+ | `go.sum` mismatch | Run `go mod tidy`; commit both files |
352
+ | Breaking change without major version | Use `/v2` import path for major versions |
353
+ | pkg.go.dev not showing | Push tag; `go get` triggers indexing |
354
+ | API surface too large | Export only what users need; keep internals in `internal/` |
355
+
356
+ ---
357
+
358
+ ## Java/Kotlin (Maven Central)
359
+
360
+ ### Gradle Setup
361
+
362
+ ```kotlin
363
+ // build.gradle.kts
364
+ plugins {
365
+ `java-library`
366
+ `maven-publish`
367
+ signing
368
+ }
369
+
370
+ group = "com.example"
371
+ version = "1.0.0"
372
+
373
+ java {
374
+ withSourcesJar()
375
+ withJavadocJar()
376
+ }
377
+
378
+ publishing {
379
+ publications {
380
+ create<MavenPublication>("mavenJava") {
381
+ from(components["java"])
382
+ pom {
383
+ name.set("My SDK")
384
+ description.set("My awesome Java SDK")
385
+ url.set("https://github.com/myorg/my-sdk")
386
+ licenses {
387
+ license {
388
+ name.set("The MIT License")
389
+ url.set("https://opensource.org/licenses/MIT")
390
+ }
391
+ }
392
+ }
393
+ }
394
+ }
395
+ repositories {
396
+ maven {
397
+ url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
398
+ credentials {
399
+ username = System.getenv("OSSRH_USERNAME")
400
+ password = System.getenv("OSSRH_PASSWORD")
401
+ }
402
+ }
403
+ }
404
+ }
405
+
406
+ signing {
407
+ sign(publishing.publications["mavenJava"])
408
+ }
409
+ ```
410
+
411
+ ### Publish
412
+
413
+ ```bash
414
+ ./gradlew publishToMavenLocal # Local testing
415
+ ./gradlew publish # Publish to Maven Central
416
+
417
+ # Requirements for Maven Central:
418
+ # 1. Sonatype OSSRH account (central.sonatype.com)
419
+ # 2. GPG signing key
420
+ # 3. POM with name, description, URL, license, developers, SCM
421
+ ```
422
+
423
+ ---
424
+
425
+ ## .NET (NuGet)
426
+
427
+ ### Project Setup
428
+
429
+ ```xml
430
+ <!-- MySdk.csproj -->
431
+ <Project Sdk="Microsoft.NET.Sdk">
432
+ <PropertyGroup>
433
+ <TargetFramework>net8.0</TargetFramework>
434
+ <PackageId>MyOrg.MySdk</PackageId>
435
+ <Version>1.0.0</Version>
436
+ <Description>My awesome .NET SDK</Description>
437
+ <Authors>My Name</Authors>
438
+ <PackageLicenseExpression>MIT</PackageLicenseExpression>
439
+ <RepositoryUrl>https://github.com/myorg/my-sdk</RepositoryUrl>
440
+ <GenerateDocumentationFile>true</GenerateDocumentationFile>
441
+ </PropertyGroup>
442
+ </Project>
443
+ ```
444
+
445
+ ### Build & Publish
446
+
447
+ ```bash
448
+ # Build
449
+ dotnet build -c Release
450
+
451
+ # Pack as .nupkg
452
+ dotnet pack -c Release
453
+ # Output: bin/Release/MyOrg.MySdk.1.0.0.nupkg
454
+
455
+ # Publish to NuGet.org
456
+ dotnet nuget push bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
457
+ ```
458
+
459
+ ---
460
+
461
+ ## SDK Publishing Checklist
462
+
463
+ | Item | Why |
464
+ |------|-----|
465
+ | **Semantic Versioning** | Users need to understand the impact of upgrading |
466
+ | **CHANGELOG** | Document what changed in each version |
467
+ | **README with examples** | Users need quick-start code snippets |
468
+ | **Type definitions** | TypeScript (.d.ts), Python (py.typed), Rust (docs.rs) |
469
+ | **License** | MIT/Apache-2.0 for permissive; must be present |
470
+ | **Tests** | > 80% coverage; CI must pass before publish |
471
+ | **Documentation** | API reference + usage guide |
472
+ | **Min version pinning** | Set `engines` (npm), `requires-python` (PyPI), `rust-version` (Cargo) |
473
+ | **CI/CD publish pipeline** | Tag → build → test → publish (automated) |
474
+ | **Deprecation notices** | Use `@deprecated` / `warnings.warn` before removing APIs |
475
+ | **Security policy** | SECURITY.md for vulnerability reporting |
476
+
477
+ ## Versioning Strategy
478
+
479
+ | Change Type | Version Bump | Example |
480
+ |-------------|-------------|---------|
481
+ | Bug fix | Patch (1.0.0 → 1.0.1) | Fix null pointer in client |
482
+ | New feature (backward compatible) | Minor (1.0.0 → 1.1.0) | Add `listUsers()` method |
483
+ | Breaking change | Major (1.0.0 → 2.0.0) | Rename `fetch()` to `get()` |
484
+ | Pre-release | Tag (1.0.0-beta.1) | Testing before stable |
485
+
486
+ ## Common Pitfalls (All Languages)
487
+
488
+ | Issue | Fix |
489
+ |-------|-----|
490
+ | Breaking change in minor version | Follow SemVer strictly; use deprecation warnings first |
491
+ | No changelog | Use `conventional-commits` + automated changelog tools |
492
+ | Missing type definitions | TypeScript: emit .d.ts; Python: add py.typed marker |
493
+ | API surface too large | Export only what users need; keep internals private |
494
+ | Version not bumping in CI | Use `changesets`, `semantic-release`, or `release-please` |
495
+ | Dependencies too heavy | Minimize dependencies; use optional/peer dependencies |
496
+ | No migration guide | Write MIGRATION.md for major version changes |
497
+ | Published test/dev code | Use `.npmignore`, `MANIFEST.in`, `.gitignore` properly |