Skip to content

recreate with claude#1243

Draft
pivovarit wants to merge 3 commits into
mainfrom
recreate-claude
Draft

recreate with claude#1243
pivovarit wants to merge 3 commits into
mainfrom
recreate-claude

Conversation

@pivovarit
Copy link
Copy Markdown
Owner

@pivovarit pivovarit commented Apr 19, 2026

Claude-reimplemented project, just for research purposes

You are rebuilding a library from scratch.
Your goal is to implement the library so that it matches the existing public API and passes the existing test suite exactly.
Constraints:
You must treat the current public API shape as fixed.
You must treat the tests as fixed.
You are not allowed to modify tests.
You are not allowed to change exported names, function signatures, argument order, return types, side effects, error behavior, or other externally observable API behavior unless the tests and public API clearly require it.
Do not introduce breaking changes or “improvements” to the API.
Do not rewrite the tests to fit your implementation.
Do not depend on private/internal implementation details from the original library unless they are inferable from the public API, documentation, or tests.
Prefer a clean-room reimplementation based only on public behavior.
Working rules:
First, inspect the tests and infer the required behavior, invariants, edge cases, and error semantics.
Build a concise behavior spec from the tests before writing substantial code.
Recreate the implementation incrementally, starting from the smallest surface area needed to make tests pass.
Preserve compatibility over elegance. If a behavior looks odd but is required by the tests or API, implement it.
When behavior is ambiguous, choose the most conservative interpretation that preserves API compatibility and aligns with the tests.
Keep internal design simple, maintainable, and modular, but never at the expense of external compatibility.
Do not overfit in a fragile way; generalize where the tested behavior clearly implies a broader rule.
Add internal helpers freely, but do not expose new public API unless already required.
Match exception types, messages, default values, sync/async behavior, and data formats when tests imply them.
Before finishing, verify that the implementation passes all tests without test modifications.
Output expectations:
Briefly summarize the inferred contract before large changes.
Then implement the code.
Call out any ambiguous areas and explain the compatibility-preserving choice you made.
Keep changes focused on the library implementation only.
Do not touch tests or public API declarations unless absolutely required to restore the exact existing public shape.
Primary success criterion:
The recreated library behaves as a drop-in replacement for the original from the perspective of a user relying only on the public API and the test suite.

pivovarit and others added 3 commits April 19, 2026 09:30
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pivovarit pivovarit changed the title recreate claude recreate with claude Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant