This file is the primary instruction document for AI agents working on the KissRequests repository.
Every AI agent must read this file before making any changes to the codebase.
Agents should read CAVEMAN.md first for a compact project summary, then read the detailed authoritative files:
AGENTS.mddocs/PRODUCT_SPEC.md.github/architecture/index.mddocs/IMPLEMENTATION_PLAN.md
CAVEMAN.md is a summary only. If it conflicts with detailed docs, the detailed docs win.
KissRequests is a tiny, KISS-oriented Java 17+ HTTP library built on the native JDK java.net.http.HttpClient.
The library makes HTTP requests easy to write, memorize, debug, and execute — without requiring users to read long documentation or depend on external HTTP libraries.
The library is NOT a framework.
- The public API must be memorable and obvious.
- Zero mandatory external dependencies in the core library.
- Java 17+ compatibility must be preserved at all times.
- Use native
java.net.http.HttpClientexclusively for HTTP transport. - Do not hide HTTP behind a large DSL.
- Do not create annotations.
- Do not create a REST framework.
- Do not add JSON serialization to the core.
- Do not add XML serialization to the core.
- Do not add secret masking, credential management, OAuth helpers, token refresh, OpenTelemetry, circuit breaker, service discovery, cache, or framework integrations in v1.
- The user passes method, URL, headers, and body.
- The library prepares the request, renders it as curl, executes it, and returns a result or throws a rich exception.
- Text requests
- Binary file upload
- Download response directly to file
- Stream response as
InputStream - Multipart/form-data
toCurl()for debuggingexecute()for execution- Rich errors
- Retry configured in the singleton
- Timeout configured in the singleton
- Max concurrent requests configured in the singleton
- Optional
Executorconfigured in the singleton - Maven project
- Unit tests
- Documentation
- GitHub Actions CI
- GitHub Pages documentation
- Maven Central publishing configuration
- JSON or XML serialization
- Annotation-driven API
- REST framework features
- Secret masking or credential management
- OAuth or token refresh
- Observability integrations (OpenTelemetry, Micrometer)
- Circuit breaker or resilience patterns
- Service discovery
- Cache layer
- Spring, Quarkus, or any framework integration
- Virtual threads as a required feature (may be used via user-provided Executor)
- Java 17 source and target compatibility.
- No production dependencies. Zero.
- Use
java.net.http.HttpClientfor all HTTP transport. - Prefer simple records and classes over complex hierarchies.
- Prefer explicit names over clever abstractions.
- All public API classes must be in
io.github.arthurhoch.kissrequestsor a sub-package. - Internal implementation must be in
io.github.arthurhoch.kissrequests.internalor equivalent, with clear separation. - No Lombok, no annotation processing, no code generation.
- No reflection-based magic.
- Thread safety must be documented for all public singletons.
Http.create()must return a usable default instance with no required configuration.http.request(...)must return a preparedHttpCall, not execute immediately..execute()onHttpCalltriggers the actual network call..toCurl()onHttpCallreturns the curl representation without executing.- Errors must be rich: include method, URL, curl, attempts, duration, status code, response body, and root cause.
- Interrupted threads must restore the interrupt flag.
- All tests must use JUnit 5.
- Tests must not require internet access.
- Tests must not require external services.
- Tests must be deterministic.
- Use a local HTTP test server built with JDK APIs.
- Every public method must have at least one test.
- Tests must cover: text requests, upload, download, stream, multipart, toCurl, retry, timeout, rich exceptions, concurrency limit, invalid inputs.
- Test failures must produce clear messages.
- All public API changes must be reflected in documentation.
- All public API changes must be reflected in examples.
- Documentation must be updated when public behavior changes.
- Every public API must have at least one copyable example.
- README.md is the quick start.
- docs/ contains detailed documentation.
- GitHub Pages serves the documentation site.
- Documentation must prioritize "can use without reading a manual."
- Code examples in documentation must use English names.
- All documentation must be in English.
- GitHub Pages is served from the
docs/directory on themainbranch. - Jekyll with a minimal theme is used.
- No heavy frontend frameworks.
- Markdown-first documentation.
- docs/index.md is the entry point.
- Maven coordinates:
io.github.arthurhoch:kiss-requests. - Publishing uses Sonatype Central Publisher Portal.
- Source JAR and Javadoc JAR are required.
- GPG signing is required.
- All required metadata (name, description, url, licenses, developers, scm) must be present in pom.xml.
- Publishing only happens under the
releaseMaven profile. - Publishing only happens via the release GitHub Actions workflow triggered by version tags.
- CI must never require signing or publishing secrets.
- Semantic versioning: MAJOR.MINOR.PATCH.
- Releases are triggered by tags matching
v*(e.g.,v0.1.0). - CHANGELOG.md must be updated before release.
- The release workflow must run tests before publishing.
- Do not release without updating documentation.
- Read
AGENTS.md,docs/PRODUCT_SPEC.md, and.github/architecture/index.mdbefore implementing code. - Do not invent features outside v1 scope.
- Do not add dependencies unless explicitly approved by a human.
- Do not create a framework.
- Do not over-engineer.
- Do not remove public API without documenting why.
- Do not silently change behavior.
- Always update docs and tests alongside code changes.
- Prefer simple records/classes over complex hierarchies.
- Prefer explicit names.
- Preserve Java 17 compatibility.
- When in doubt, choose the simpler solution.
- Read this file first.
- Read the relevant architecture documents for the area you are changing.
- Read the product specification.
- Make changes incrementally.
- Run tests after every change.
- Update documentation for every public behavior change.
- Do not commit unless explicitly asked.
- Do not push unless explicitly asked.
- Report what you changed and what remains.
- Security tooling must not add production dependencies.
- Normal CI (
mvn -B verify) must stay fast. Security scans run in separate profiles or workflows. - Security scans and findings must be documented in
docs/SECURITY_SCANNING.md. - Any vulnerability fix must include tests when applicable.
- Do not suppress scanner findings without documenting the reason.
- Do not commit secrets, tokens, or credentials.
- If public behavior changes for security reasons, update docs and examples.
- OWASP Dependency-Check runs via
mvn -Psecurity verifyonly, not during normal builds.
Before implementing any code, an AI agent must read:
AGENTS.md(this file)docs/PRODUCT_SPEC.md.github/architecture/index.md
These three files define the contract. Implementation must follow them.
- Add external dependencies without explicit justification and human approval.
- Add framework patterns or integrations.
- Break Java 17 compatibility.
- Change the
http.request(...).execute()mental model. - Remove
.toCurl()from prepared calls. - Make errors vague or unhelpful.
- Skip tests for public behavior.
- Skip documentation updates.