Conform library to tiny-blocks standards.#29
Merged
Conversation
Aligns the library with the .claude rules and the tiny-blocks-create skill: prefix-less public getters, consumer-facing exceptions moved to the public Exceptions namespace, public-API-only tests, plus the canonical config, tooling, CI, and required repository files. Bumps tiny-blocks/encoder to ^4.0. The public API changes, so the next release is 2.0.0.
There was a problem hiding this comment.
Pull request overview
This pull request aligns the ksuid library with tiny-blocks ecosystem standards by updating the public API naming, consolidating tests around the public surface, and adopting the canonical tooling/CI/documentation scaffolding expected across tiny-blocks PHP libraries.
Changes:
- Refactors
Ksuidpublic API to shorter accessors (value(),bytes(),payload(),unixTime(),timestamp()) and moves exceptions tosrc/Exceptions/. - Reworks tests to focus on public API behavior and adds stricter tooling baselines (phpunit/phpstan/phpcs, mutation testing paths under
reports/). - Adds the tiny-blocks
.claude/rule/skill scaffolding and standard repo templates (SECURITY policy, issue/PR templates, CI workflow).
Reviewed changes
Copilot reviewed 54 out of 55 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/KsuidTest.php | Updates tests for the new public API and moves coverage from internal classes to public behavior. |
| tests/Internal/TimestampTest.php | Removes internal timestamp tests (shifts coverage to public API). |
| tests/Internal/PayloadTest.php | Removes internal payload tests (shifts coverage to public API). |
| src/Ksuid.php | Refactors the public API and adds PHPDoc for public methods. |
| src/Internal/Timestamp.php | Minor decode/unpack refactor in Base62 timestamp decoding. |
| src/Internal/Payload.php | Adjusts factory method ordering and exception namespace import. |
| src/Exceptions/InvalidPayloadSize.php | Moves exception into public Exceptions namespace and documents it. |
| src/Exceptions/InvalidKsuidForInspection.php | Moves exception into public Exceptions namespace and documents it. |
| SECURITY.md | Adds a standard security policy document. |
| README.md | Updates examples to reflect the new API and tiny-blocks README conventions. |
| phpunit.xml | Tightens PHPUnit configuration and normalizes report output paths to reports/. |
| phpstan.neon.dist | Raises PHPStan strictness (level: max), includes tests, and scopes ignore rules. |
| phpcs.xml | Adds a standard PSR-12 phpcs ruleset for src/ and tests/. |
| Makefile | Updates dev workflow targets to match tiny-blocks conventions and reports/ paths. |
| infection.json.dist | Normalizes Infection output paths and standardizes mutator config. |
| composer.json | Updates dependency versions and standardizes scripts + autoload-dev namespace. |
| CLAUDE.md | Adds contributor guidance and pointers to .claude/rules/ and skills. |
| .gitignore | Replaces ad-hoc ignores with standard tiny-blocks ignores for tooling outputs. |
| .github/workflows/ci.yml | Updates CI to resolve PHP version dynamically and match tiny-blocks job structure. |
| .github/PULL_REQUEST_TEMPLATE.md | Adds the standard tiny-blocks PR template. |
| .github/ISSUE_TEMPLATE/feature_request.md | Adds the standard tiny-blocks feature request template. |
| .github/ISSUE_TEMPLATE/bug_report.md | Adds the standard tiny-blocks bug report template. |
| .gitattributes | Normalizes line ending handling and Packagist export-ignore list. |
| .editorconfig | Adds tiny-blocks defaults including max_line_length = 120. |
| .claude/skills/tiny-blocks-create/SKILL.md | Adds the scaffolding/restoration skill documentation. |
| .claude/skills/tiny-blocks-create/assets/github/workflows/ci.yml | Adds canonical CI workflow asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/github/PULL_REQUEST_TEMPLATE.md | Adds canonical PR template asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/feature_request.md | Adds canonical feature request template asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/bug_report.md | Adds canonical bug report template asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/docs/SECURITY.md | Adds canonical security policy asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/phpunit.xml | Adds canonical phpunit.xml asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/phpstan.neon.dist | Adds canonical phpstan.neon.dist asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/phpcs.xml | Adds canonical phpcs.xml asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/Makefile | Adds canonical Makefile asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/infection.json.dist | Adds canonical infection.json.dist asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/composer.json | Adds canonical composer.json asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/.gitignore | Adds canonical .gitignore asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/.gitattributes | Adds canonical .gitattributes asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/config/.editorconfig | Adds canonical .editorconfig asset for scaffolding. |
| .claude/skills/tiny-blocks-consume/SKILL.md | Adds dependency-discovery/reuse skill documentation. |
| .claude/skills/tiny-blocks-consume/scripts/refresh-catalog.py | Adds catalog refresh script for tiny-blocks package discovery. |
| .claude/skills/tiny-blocks-consume/references/catalog.md | Adds an initial tiny-blocks package catalog reference. |
| .claude/skills/commit-message/SKILL.md | Adds Conventional Commits formatting skill documentation. |
| .claude/settings.json | Adds Claude agent permissions and post-tool hooks configuration. |
| .claude/rules/php-library-tooling.md | Adds canonical tooling invariants for tiny-blocks PHP libraries. |
| .claude/rules/php-library-testing.md | Adds canonical PHPUnit/testing conventions and mutation discipline. |
| .claude/rules/php-library-modeling.md | Adds canonical modeling rules (exceptions, value objects, naming). |
| .claude/rules/php-library-github-workflows.md | Adds canonical workflow conventions for tiny-blocks libraries. |
| .claude/rules/php-library-documentation.md | Adds canonical README/docs conventions for tiny-blocks libraries. |
| .claude/rules/php-library-code-style.md | Expands/enforces code-style conventions used across the ecosystem. |
| .claude/rules/php-library-architecture.md | Adds canonical src/tests layout and public-vs-internal API boundary rules. |
| .claude/rules/github-workflows.md | Removes superseded workflow rules file (replaced by php-library-github-workflows.md). |
| .claude/hooks/php-prose-punctuation-conformance.py | Adds hook enforcing prose punctuation conventions. |
| .claude/hooks/php-ordering-conformance.py | Adds hook enforcing deterministic member/parameter ordering conventions. |
| .claude/CLAUDE.md | Removes legacy Claude instructions (replaced by new CLAUDE.md + .claude/ rules). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.