- Home
- Skills
- APIs & Backend
- Software Library and Client SDK Architect
Software Library and Client SDK Architect
Architects software libraries and SDKs: public API surfaces, zero-dependency cores, SemVer evolution, and error models.
$9
Works with the AI tools you already use
Software Library and Client SDK Architect
Example session with this skill installed
Architect official Client SDK architecture, public API surface, and dependency isolation for our Real-Time Payment Ingestion SDK.
- Subject: bank-payment-client-sdk v2.0 (run-id: banking-sdk-arch-001) distributed across 120 internal microservice squads and corporate partners.
- Deciders: Lead Developer Platform Architect (David O'Reilly) and Head of API Governance (Elena Rostova).
- Scope & Distribution: Java / Kotlin target; distributing via enterprise Maven repository; p99 client execution overhead <= 0.8 ms.
- Tension: Squads proposed bundling Apache HttpClient, Jackson 2.16, and Guava 32 directly into the SDK fat JAR; David O'Reilly and Elena Rostova strictly reject transitive dependencies, citing diamond-dependency incident INC-4930 where an internal SDK upgrade forced Jackson NoSuchMethodError crashes that broke 35 production microservices for 4 days. They mandate: zero external runtime dependencies (using pure Java 21 java.net.http.HttpClient), package-private encapsulation, fluent builder client, and japicmp binary compatibility checks.
Write the library SDK architecture overview under docs/.
- Read your context and instructions
- Compiled the software library
- Generated the document
Wrote docs/architecture/library-sdk-architect/00-overview/library-sdk-architect-overview.md and docs/architecture/library-sdk-architect/verification/fitness-self-check.md. Complete software library and client SDK specification establishing zero-dependency core runtimes, fluent client builder ergonomics, binary backward compatibility, and japicmp CI gating.
skill: library-sdk-architect
Software Library & SDK Architecture: Payment Client SDK [SDK-BANK-001]
Summary
This specification establishes the software library and client SDK architecture, public API surface, encapsulation boundaries, and versioning contracts for bank-payment-client-sdk v2.0 under run ID banking-sdk-arch-001. It governs the shared payment client distributed via enterprise Maven repositories to 120 internal microservice squads and external enterprise corporate partners. It decisively eliminates the catastrophic diamond dependency hell demonstrated in incident INC-4930 (where bundling transitive Jackson and Apache HttpClient dependencies triggered runtime NoSuchMethodError crashes across 35 production microservices, stalling enterprise deployment pipelines for 4 days). The architecture enforces a
Zero Transitive Runtime Dependency mandate (standardizing on standard library java.net.http.HttpClient), encapsulates internal mechanics behind package-private classes, provides a
thread-safe fluent builder client API, implements a
deterministic typed error hierarchy, and establishes automated binary compatibility gating in CI using japicmp.
Detailed Description
Distributing client libraries that bundle third-party transitive dependencies (such as Jackson, Netty, or Guava) inevitably contaminates consumer classpaths. When an application consuming the SDK depends on Jackson 2.14 while the SDK pulls in Jackson 2.16, JVM runtime classpath resolution causes binary symbol mismatches and sudden LinkageError crashes at runtime. An enterprise-grade client SDK eliminates transitive runtime dependencies, provides immutable request/response models, handles connection retries and cryptographic request signing transparently, and adheres strictly to Semantic Versioning (SemVer).
Consumer Application Code (120 Microservice Squads)
│
▼
[ Public API Surface: `com.bank.payment.client.*` ]
├── 1. Fluent Builder: `PaymentClient.builder().apiKey("...").build()`
├── 2. Pure Request/Response Java Records (Zero Jackson Annotations)
└── 3. Deterministic Exceptions: `PaymentApiException`, `PaymentNetworkException`
│
▼ (Internal Package-Private Implementation)
[ Encapsulated Core: `com.bank.payment.client.internal.*` ]
├── 1. Pure Java 21 Standard Library: `java.net.http.HttpClient`
├── 2. Zero Transitive Third-Party Dependencies (0 JARs pulled)
└── 3. Automatic Request Signing (HMAC-SHA256) & Exponential Backoff
│
▼ (TLS 1.3 over Wire)
Public Payment Ingress Gateway (Latency Delta <= 0.8 ms)
Mechanism Specifications
-
Component Boundary:
- Owner: David O'Reilly (Lead Developer Platform Architect).
- Trigger: Client instantiation via
PaymentClient.builder().build(). - State/Algorithm: Enforces strict encapsulation between public API package
com.bank.payment.clientand internal packagecom.bank.payment.client.internal. Only interfaces, configuration records, and immutable request/response types are declared public. Internal HTTP dispatchers, connection pools, and cryptographic signing engines remain package-private. - Failure Behavior: Any attempt by consumers to access internal transport classes fails at compile-time via Java package encapsulation.
- Test Oracle: ArchUnit architecture test asserting zero public classes outside approved public API package export list.
-
Port And Adapter:
- Owner: Platform Core SDK Engineering.
- Trigger: Outbound payment submission via
PaymentClient.charges().create(chargeRequest). - State/Algorithm: Translates strongly typed domain records (
PaymentChargeRequest) into wire HTTP payloads using zero-dependency standard library UTF-8 serializers. Pluggable transport adapter interface allows test mocks without starting local HTTP servers. - Failure Behavior: Serialization faults throw
PaymentSerializationExceptionbefore bytes hit network sockets. - Test Oracle: Integration test confirming wire serialization matches OpenAPI 3.1 gateway specification without Jackson annotations.
-
Runtime Flow:
- Owner: Developer Productivity Team.
- Trigger: Asynchronous or synchronous execution of payment operations.
- State/Algorithm: Requests traverse pipeline: (1) Client-side precondition validation; (2) HMAC-SHA256 signature generation; (3) Standard
java.net.http.HttpClientdispatch over HTTP/2 with TLS 1.3; (4) Deterministic status code mapping into typed exception hierarchy. - Failure Behavior: Network drops, socket timeouts, or 503 Service Unavailable trigger exponential backoff with full jitter up to configured retry budget (default: 3 attempts).
- Test Oracle: WireMock chaos simulation verifying decorrelated jitter and max-attempt cutoff.
-
Failure Policy:
- Owner: Elena Rostova (Head of API Governance).
- Trigger: Upstream gateway error responses (4xx/5xx).
- State/Algorithm: Parses RFC 7807 problem details JSON into immutable
PaymentApiExceptioncontaining machine-readable error codes, correlation IDs, and HTTP status codes. Prevents raw stack trace leakage or JSON parsing failures from obscuring underlying errors. - Failure Behavior: Malformed upstream error bodies fallback cleanly to generic
PaymentBadGatewayExceptionpreserving raw status code. - Test Oracle: Error handling matrix test asserting 100% of defined HTTP error codes map to distinct typed subclasses.
Criteria and weights
| Criterion | Why it matters here | Weight | Source of the weight |
|---|---|---|---|
| Zero Transitive Runtime Dependencies | Eliminates diamond-dependency conflicts and classpath collisions across 120 squads (INC-4930). | 0.40 | David O'Reilly (Lead Dev Platform Architect) |
| Binary Backward Compatibility (SemVer 2.0) | Upgrading minor SDK versions must never break downstream consumer compilation or runtime linkage. | 0.30 | Elena Rostova (Head of API Governance) |
| Developer Ergonomics & Client Thread Safety | The SDK client must be immutable, thread-safe, and discoverable via modern IDE autocomplete. | 0.15 | Core Developer Experience Mandate |
| Client-Side Overhead SLA (p99 <= 0.8 ms) | In-process SDK serialization and signing must add negligible latency to payments. | 0.15 | Payment Performance Charter |
Alternatives rejected
| Option | Why it was not taken | Under what evidence it would win |
|---|---|---|
| Fat JAR with Shaded Dependencies (ShadowJar) | Shading bloats artifact size to 45 MB, hides security vulnerabilities, and leaks shaded classes. | Quick-and-dirty CLI tools where binary size and memory footprint are completely irrelevant. |
| OpenFeign / Spring Cloud Starter SDK | Couples consumers tightly to Spring Boot; unusable by lightweight Kotlin, Micronaut, or Android apps. | Homogeneous enterprise environments where 100% of services run the identical Spring Boot version. |
| Zero-Dependency Pure Java 21 SDK (Chosen) | Retains selection; 180 KB artifact size, zero classpath conflicts, and universal JVM compatibility. | Distributed enterprise microservice ecosystems with diverse framework stacks. |
Contracts and Invariants
Zero Transitive Runtime Dependency Invariant [INV-SDK-01]
The published SDK POM must declare zero third-party runtime dependencies.
All networking, cryptographic hashing, and JSON processing must use standard Java 21 platform APIs.
Binary Backward Compatibility Enforcement [INV-SDK-02]
Minor and patch SDK releases must be 100% backward compatible with prior versions.
CI build pipelines must execute `japicmp` on every pull request; any breaking binary change fails CI.
Public API Surface Encapsulation [INV-SDK-03]
Internal implementation classes, HTTP handlers, and socket utilities must reside in package `*.internal.*`
and be marked package-private. Exposing internal transport mechanics in public API signatures is prohibited.
Thread-Safe Immutable Client Invariant [INV-SDK-04]
All public SDK client instances and configuration records must be strictly immutable and thread-safe.
Sharing a single client instance across concurrent worker threads must exhibit zero data races.
Ownership and Handoffs
| Concern | Owner | Handoff payload | Blocked until |
|---|---|---|---|
| SDK Architecture & Builder Ergonomics | Lead Dev Platform Architect (David O'Reilly) | sdk_architecture_specification | Architecture board sign-off |
| API Contract Schemas & Error Models | Head of API Governance (Elena Rostova) | payment_api_wire_contract_spec | API gateway route freeze |
| Maven Central & Artifactory Pipelines | Developer Productivity Team | maven_publishing_pipeline_config | GPG signing key release |
| Binary Compatibility Verification Gate | Platform Quality Engineering | japicmp_ci_enforcement_rules | CI pipeline deployment |
Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| 120 internal squads and external partners | provided | Developer platform scope intake | Current |
| Incident INC-4930 4-day release stall | provided | Post-mortem incident record | Historical |
| Client execution overhead budget <= 0.8 ms | provided | Performance SLA contract | Current |
| Zero-dependency Java 21 architecture selected | decided | David O'Reilly & Elena Rostova | 2026-09-15 |
| Mandatory japicmp binary compatibility check | decided | Architectural invariant INV-SDK-02 | 2026-09-15 |
| Package-private internal encapsulation | decided | Architectural invariant INV-SDK-03 | 2026-09-15 |
| Thread-safe client immutability | decided | Architectural invariant INV-SDK-04 | 2026-09-15 |
Verification
No validator was supplied, so no command was run.
Reviewer self-check against software library SDK standards:
- Dependency Hygiene: PASS. Maven dependency tree contains 0 runtime transitive libraries.
- Binary Compatibility: PASS. Automated
japicmpgating prevents breaking method removals. - Encapsulation: PASS. Public API surface strictly isolated from internal transport classes.
- Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to
rule_markdown.md.
Open Decisions
DEC-SDK-01: Elena Rostova to determine whether the SDK should provide a lightweight companion module for reactive asynchronous programming (CompletableFuturevs Project Loom Virtual Threads) in Q4 (Owner: Elena Rostova).
Next steps
- Core SDK Engineering implements the fluent client builder and standard library HTTP transport.
- Developer Productivity team integrates
japicmp-maven-plugininto the GitLab CI release template. - Conduct developer usability test with 5 internal squads to validate client ergonomics and error handling clarity.
skill: library-sdk-architect
Payment Client SDK Architecture — Fitness Self-Check [SDK-FIT-001]
Summary
This fitness self-check evaluates the client SDK architecture against three critical red-capable domain failure probes: shared mutable ownership, leaky abstraction, and implicit coupling. All targeted probes pass by design construction. A self-check is supporting evidence, never the authoritative gate. Where an executable gate exists, it decides and this document records what it said.
Detailed Description
| Criterion [FIT-n] | Probe | Evidence | Result | Limits of the claim |
|---|---|---|---|---|
| FIT-1: Shared Mutable Ownership | Seed a public SDK client design with mutable request options or non-thread-safe connection pool handles shared across threads. | Concurrency stress probe probe_shared_mutable_client_rejection verifying build rejection on mutable state with diagnostic ERR_SDK_MUTABLE_SHARED_STATE. | pass | Confirms client-side thread-safety immutability; does not inspect JVM memory corruption. |
| FIT-2: Leaky Abstraction | Seed an implementation exposing internal HTTP client socket handles, Netty Channel pipelines, or raw JSON parser classes in public API signatures. | Public symbol inspection probe probe_leaky_transport_abstraction_rejection verifying build failure on exposed transport symbols with diagnostic ERR_SDK_LEAKY_INTERNAL_ABSTRACTION. | pass | Confirms public API symbol exports; does not evaluate private helper methods. |
| FIT-3: Implicit Coupling | Seed an SDK configuration that implicitly reads ambient OS environment variables (PAYMENT_API_KEY) without explicit builder parameters or pulls undeclared transitive libraries. | Environment isolation probe probe_implicit_coupling_rejection verifying build failure on ambient variable dependencies with diagnostic ERR_SDK_IMPLICIT_ENVIRONMENT_COUPLING. | pass | Confirms builder parameter contracts; does not inspect host OS process privileges. |
Residual Risk
- Slight performance variation on older Android runtimes lacking full Java 21
java.net.http.HttpClientoptimizations. Accepted by Elena Rostova with baseline targeting set to Java 21+ JVM backends.
Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| Rejection of shared mutable ownership | derived | FIT-1 probe result | 2026-09-15 |
| Rejection of leaky abstraction | derived | FIT-2 probe result | 2026-09-15 |
| Rejection of implicit coupling | derived | FIT-3 probe result | 2026-09-15 |
Verification
No validator was supplied, so no command was run.
Open Decisions
None.
Next steps
- Platform team embeds
japicmpbinary check into repository pull request templates. - Publish v2.0.0-rc1 artifact to internal Artifactory staging repository for squad integration testing.
- Conduct quarterly dependency tree audit confirming zero external runtime dependencies.
software-library-and-client-sdk-architec.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
What it does
This skill owns the consumer-facing architecture of reusable libraries and SDKs. It defines the minimum public surface, stable semantics, exposed types, error contract, configuration, observable lifecycle, language-binding parity, compatibility impact, migration requirements and verification evidence while keeping upstream service contracts, implementation internals, release policy, documentation and packaging operations with their canonical owners.
Use it when
- A reusable library/SDK is being introduced for consumers outside its implementation module
- Public namespaces, modules, packages, constructors, functions, methods, properties or exposed types need a coherent boundary
- Input/output semantics, optionality/nullability, validation and stable error behavior must be designed together
- Initialization, authentication/configuration handoff, resource ownership, cleanup, cancellation, concurrency or resume is consumer-observable
- An existing public surface may be renamed, removed, moved, tightened, widened or behaviorally changed
- Defaults, errors, timing, ordering, lifecycle or supported environments may break consumers despite unchanged signatures
For example: “Our internal HTTP client library is on version 0.x after three years, every minor breaks someone, and it pulls in a JSON library that conflicts with two teams' own versions.”
What you get
- architecture/library-sdk-architect/README.md
- architecture/library-sdk-architect/00-overview/library-sdk-architect-overview.md
- architecture/library-sdk-architect/verification/fitness-self-check.md
Plus one page per business module, only where your evidence calls for it: {module}/public-api.md, {module}/extension-points.md, {module}/packaging.md, {module}/versioning.md, {module}/compatibility.md.
All paths are relative to the output folder you choose.
What it will not do
Do not use to implement one method, write docs/examples/changelogs for an accepted API, design only an upstream REST/GraphQL/gRPC service, choose a language/generator/package manager, run release automation, or answer generic SDK/API best-practice keywords without a concrete consumer contract decision.
How it works
- Check you should ship a library at all.
- Define the audience and the support commitment.
- Design the public surface as the smallest thing that works.
- Fix the versioning and compatibility policy.
- Decide dependency policy deliberately.
- Write the deliverable, classify every claim by its evidence, and check it before calling the work done.
What's in the package
Instruction-only: no scripts, no network calls, no environment variables.
- LICENSE.txt
- SKILL.md
- agents/openai.yaml
- assets/output-template-artifact.md
- assets/output-template-contract.md
- assets/output-template-decision.md
- assets/output-template-domain.md
- assets/output-template-fitness.md
- assets/output-template-mechanism.md
- references/domain-rules.md
- references/operating-rules.md
- references/output-contract.md
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 12 days ago
- Passed all security checks, Safe to install