PHPackages                             coretsia/devtools-internal-toolkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. coretsia/devtools-internal-toolkit

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

coretsia/devtools-internal-toolkit
==================================

Tooling-only deterministic helpers for Coretsia devtools. Not for runtime packages.

v0.4.0(2w ago)01Apache-2.0PHPPHP ^8.4

Since May 9Pushed 2w agoCompare

[ Source](https://github.com/coretsia/devtools-internal-toolkit)[ Packagist](https://packagist.org/packages/coretsia/devtools-internal-toolkit)[ RSS](/packages/coretsia-devtools-internal-toolkit/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

coretsia/devtools-internal-toolkit
==================================

[](#coretsiadevtools-internal-toolkit)

`coretsia/devtools-internal-toolkit` is the tooling-only deterministic helper library for Coretsia devtools.

It provides shared deterministic primitives for Coretsia tooling, gates, generators, runners, and development-time repository automation.

This repository is a split package generated from the Coretsia monorepo package `framework/packages/devtools/internal-toolkit`.

This package MUST NOT be required by runtime packages and MUST NOT become a production runtime dependency.

Package identity
----------------

[](#package-identity)

- **Monorepo source path:** `framework/packages/devtools/internal-toolkit`
- **Split repository:** `coretsia/devtools-internal-toolkit`
- **Package id:** `devtools/internal-toolkit`
- **Composer name:** `coretsia/devtools-internal-toolkit`
- **Namespace:** `Coretsia\Devtools\InternalToolkit\*` (PSR-4: `src/`)
- **Kind:** library
- **Lifecycle:** tooling-only / devtools / internal Coretsia tooling support

Versioning is monorepo-wide.

The monorepo tag `vMAJOR.MINOR.PATCH` is the single version source of truth, and the split repository receives the same tag for the corresponding package subtree.

Per-package independent versions MUST NOT be used.

Dependency policy
-----------------

[](#dependency-policy)

This package is tooling-only and intentionally small.

- **Depends on:**
    - PHP
    - `ext-json`
- **Allowed consumers:**
    - Coretsia devtools packages
    - Coretsia repository tooling
    - Coretsia gates, generators, runners, and split/publishing automation
- **Forbidden consumers:**
    - runtime packages under `core/*`
    - runtime packages under `platform/*`
    - runtime packages under `integrations/*`
    - production skeleton/runtime code
    - consuming applications

Runtime packages MUST NOT depend on `coretsia/devtools-internal-toolkit`.

If runtime code needs deterministic serialization, ordering, path normalization, or naming helpers, the runtime owner package must provide runtime-safe primitives instead of importing this devtools package.

Owned API
---------

[](#owned-api)

This package is the canonical tooling location for the following deterministic primitives:

- `Coretsia\Devtools\InternalToolkit\Slug::toStudly(string $slug): string`
- `Coretsia\Devtools\InternalToolkit\Slug::toSnake(string $slug): string`
- `Coretsia\Devtools\InternalToolkit\Path::normalizeRelative(string $absOrRelPath, string $repoRoot): string`
- `Coretsia\Devtools\InternalToolkit\Json::encodeStable(array $value): string`

These helpers are for tooling code only.

JSON helper
-----------

[](#json-helper)

`Json::encodeStable()` provides stable JSON bytes for json-like tooling payloads.

Rules:

- maps are sorted recursively by byte-order `strcmp`;
- lists preserve declared order;
- empty arrays are encoded as JSON lists;
- allowed scalar values are `null`, `bool`, `int`, and `string`;
- floats are rejected;
- objects, resources, and callables are rejected;
- encoding uses `JSON_UNESCAPED_SLASHES`, `JSON_UNESCAPED_UNICODE`, and `JSON_THROW_ON_ERROR`.

This helper returns JSON bytes only. It does not append a final newline unless caller-owned output code does so.

Path helper
-----------

[](#path-helper)

`Path::normalizeRelative()` returns repo-relative normalized paths using forward slashes.

Rules:

- input may be absolute or repo-relative;
- output MUST be repo-relative;
- output MUST NOT contain absolute path prefixes;
- output MUST NOT escape the supplied repository root;
- output MUST NOT contain `..` segments;
- path normalization is lexical and deterministic.

This helper is intended for safe tooling diagnostics and generated tooling artifacts.

Slug helper
-----------

[](#slug-helper)

`Slug::toStudly()` and `Slug::toSnake()` provide locale-independent ASCII identifier transformations.

They are intended for package ids, class names, generated test names, gate output, and tooling artifacts.

Slug helpers MUST NOT depend on process locale, ICU collation, filesystem casing, or platform-specific title-casing behavior.

Anti-duplication contract
-------------------------

[](#anti-duplication-contract)

Coretsia tooling code under the monorepo `framework/tools/**` MUST NOT duplicate these helper implementations.

The monorepo enforces this through:

```
framework/tools/gates/internal_toolkit_no_dup_gate.php

```

That gate is not part of this split repository. The Coretsia monorepo remains the source of truth for repository-level tooling gates.

The same monorepo gate also forbids direct `json_encode(...)` usage under `framework/tools/**`, except for explicit allowlisted deliverables.

Usage
-----

[](#usage)

This package is consumed through Composer autoload only.

Path-based includes are forbidden.

```
use Coretsia\Devtools\InternalToolkit\Json;
use Coretsia\Devtools\InternalToolkit\Path;
use Coretsia\Devtools\InternalToolkit\Slug;

$slug = Slug::toSnake('CoreFoundation');
$path = Path::normalizeRelative('/repo/framework/packages/core/contracts', '/repo');
$json = Json::encodeStable([
    'path' => $path,
    'slug' => $slug,
]);
```

Determinism and safety expectations
-----------------------------------

[](#determinism-and-safety-expectations)

All operations MUST be deterministic for identical inputs.

Outputs MUST NOT include:

- timestamps;
- random values;
- absolute local paths;
- host-specific bytes;
- process-specific bytes;
- secrets;
- PII.

Any future extension MUST preserve rerun-no-diff behavior for the same repository state and inputs.

Observability
-------------

[](#observability)

This package does not emit telemetry directly.

It provides deterministic tooling helpers only.

Errors
------

[](#errors)

This package does not define runtime error codes.

Helper failures use deterministic exception messages intended for tooling diagnostics.

These errors are not runtime transport errors and MUST NOT be exposed as production error contracts.

Security / Redaction
--------------------

[](#security--redaction)

This package does not process sensitive runtime payloads directly.

Tooling callers MUST NOT pass raw secrets, credentials, tokens, cookies, authorization headers, private keys, raw env values, or private customer data into generated diagnostics.

Path helper outputs are intended to avoid absolute local path leakage.

JSON helper output is stable, but caller-owned code remains responsible for redaction.

References
----------

[](#references)

- [Coretsia monorepo](https://github.com/coretsia/monorepo)
- [Internal Toolkit package source](https://github.com/coretsia/monorepo/tree/main/framework/packages/devtools/internal-toolkit)
- [Packaging strategy](https://github.com/coretsia/monorepo/blob/main/docs/architecture/PACKAGING.md)
- [Roadmap](https://github.com/coretsia/monorepo/blob/main/docs/roadmap/ROADMAP.md)
- [Monorepo anti-duplication gate](https://github.com/coretsia/monorepo/blob/main/framework/tools/gates/internal_toolkit_no_dup_gate.php)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance96

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

2

Last Release

20d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0e13fe6d7470c325fd7c93433427cb996558c8cc18ae1195e31810a9bb65564?d=identicon)[velhbxtyrj](/maintainers/velhbxtyrj)

---

Top Contributors

[![velhbxtyrj](https://avatars.githubusercontent.com/u/21306412?v=4)](https://github.com/velhbxtyrj "velhbxtyrj (7 commits)")

---

Tags

composer-packagecoretsiadeterminismdeterministic-toolingdevtoolsinternal-toolkitpath-normalizationphpphp84slugstable-jsonstable-outputtoolingphpslugDevtoolsphp84toolingpath-normalizationcoretsiadeterminismstable-jsoninternal-toolkit

### Embed Badge

![Health badge](/badges/coretsia-devtools-internal-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/coretsia-devtools-internal-toolkit/health.svg)](https://phpackages.com/packages/coretsia-devtools-internal-toolkit)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21422.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
