

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Stack67- **PHP 8.2+** / **Laravel 12** (framework), **Laravel Mix** (webpack) for frontend assets8- **AdminLTE 2** / **Bootstrap 3** UI — Blade views. Mostly server-rendered; a handful of newer admin-settings screens use **Livewire** components (`app/Livewire/`, e.g. `LdapSettings`, `CustomFieldEditor`, `Importer`) — no Inertia.9- **Chart.js v2.9.4** — bundled at `public/js/dist/Chart.min.js`; use `horizontalBar` type (v2 API, not v3)10- Snipe-IT is a FOSS IT asset management system (assets, licenses, accessories, consumables, components, kits) — see README.md for product context.1112## Common Commands1314```bash15# Run all tests16php artisan test17# or18vendor/bin/phpunit1920# Run a single test file21php artisan test tests/Feature/Assets/AssetsTest.php2223# Run a specific test method24php artisan test --filter testSomeMethod2526# Run/exclude tests by group (e.g. LDAP tests, which need the LDAP extension)27php artisan test --group=ldap28php artisan test --exclude-group=ldap2930# Lint / static analysis31vendor/bin/pint # code style (Laravel preset, see pint.json)32vendor/bin/phpstan analyse # static analysis via Larastan, level 4 (phpstan.neon.dist)3334# Build frontend assets (dev)35npm run dev3637# Build for production38npm run prod3940# Laravel Mix watch41npm run watch4243# Tinker / REPL44php artisan tinker4546# Clear caches after config/route changes47php artisan optimize:clear48```4950Dev server is served via **Laravel Herd** (`herd coverage vendor/bin/phpunit --coverage-html tests/coverage/html` for coverage reports — see `composer.json` scripts).5152Before running tests locally, copy `.env.testing.example` to `.env.testing`. Default test config uses in-memory SQLite (`DB_CONNECTION=sqlite_testing`); MySQL is also supported by setting the `DB_*` vars. See TESTING.md for details.5354## Architecture5556### Controllers5758Two parallel controller trees:59- `app/Http/Controllers/` — web/UI controllers (Blade views)60- `app/Http/Controllers/Api/` — REST API controllers (JSON, used by datatables + select2)6162Subdirectory groupings: `Assets/`, `Licenses/`, `Users/`, `Accessories/`, `Consumables/`, `Components/`, `Kits/`, `Account/`, `Auth/`6364### API Pattern6566Every API controller returns data via a **Transformer** (`app/Http/Transformers/`). Never return raw model attributes from API controllers — always pass through the transformer. `DatatablesTransformer` wraps paginated results.6768```php69return (new AssetsTransformer)->transformAssets($assets, $assets->count());70```7172### Authorization7374All authorization goes through **Policies** (`app/Policies/`). `CheckoutablePermissionsPolicy` is the base for assets/licenses/accessories/consumables — its `checkout()` / `checkin()` methods accept `$item = null` so you can use `@can('checkout', \App\Models\Asset::class)` without an instance.7576### FMCS (Full Multiple Company Support)7778`Setting::getSettings()->full_multiple_companies_support == '1'` gates company-scoped filtering. The select2 API endpoints (`selectlist()` methods) accept a `companyId` query param — apply it like this:7980```php81if ((Setting::getSettings()->full_multiple_companies_support == '1') && ($request->filled('companyId'))) {82 $query->where('table.company_id', $request->input('companyId'));83}84```8586Pass `data-company-id="{{ $user->company_id }}"` in Blade to wire it to select2.8788### Select2 AJAX Dropdowns8990Use `class="js-data-ajax"` with `data-endpoint="hardware|licenses|consumables|..."`. `snipeit.js` auto-initializes these, forwarding `data-company-id` as `companyId` and `data-asset-status-type` as `statusType` to the API.9192### Routes9394All routes are in `routes/web.php` (UI) and `routes/api.php` (API). Breadcrumbs are defined inline using `->breadcrumbs(fn (Trail $trail) => ...)` from `tabuna/breadcrumbs`. Every UI route should have a breadcrumb.9596Note: the `reports/unaccepted_assets` route is named with slashes, not dots — use `route('reports/unaccepted_assets')`.9798### Translations99100String keys live in `resources/lang/en-US/general.php` (and other files in that directory). Always add new UI strings as translation keys rather than hard-coding English.101102### Checkout Redirect Flow103104After checkout, `Helper::getRedirectOption()` reads `$request->redirect_option`. For redirecting back to the assigned user after checkout:105- Set `redirect_option=target` in the form106- Set `checkout_to_type=user` in the form107- Set `assigned_user={{ $user->id }}` in the form108109### Key Helper Methods (`app/Helpers/Helper.php`)110111- `Helper::deployableStatusLabelList()` — status labels for checkout forms112- `Helper::defaultChartColors()` — 10-color palette used in charts113- `Helper::getRedirectOption($request, $id, $table)` — post-checkout redirect logic114115### Global View Variables116117`$snipeSettings` is injected into all views via a service provider — no need to pass `Setting::getSettings()` from every controller. Use it directly in Blade.118119### CSV Importing120121`app/Importer/` holds per-entity importers (`AssetImporter`, `LicenseImporter`, `AccessoryImporter`, `ComponentImporter`, `ConsumableImporter`, `AssetModelImporter`, `CategoryImporter`, `UserImporter`, etc.), all extending `Importer.php`. The `Importer` Livewire component (`app/Livewire/Importer.php`) drives the UI for CSV import.122123### Presenters124125`app/Presenters/` (e.g. `AssetPresenter`, `AssetModelPresenter`, `AccessoryPresenter`) define the column/field configuration consumed by the Bootstrap Table datatables on index views — check these when adding or changing a column shown in a listing.126127## Testing128129Tests live in `tests/Feature/` (organized by entity) and `tests/Unit/`. Feature tests hit the database; the test environment uses `array` cache/session/mail drivers. Tests use factories for data setup. Use PHPUnit `#[Group('name')]` attributes to tag tests that need optional extensions/services (e.g. `LdapTest` is tagged `ldap`) so they can be excluded via `--exclude-group`.130131## Contribution Policy132133Per README.md / the project's AI Contribution Policy: PRs and issues generated by fully-automated tools without human review are not accepted upstream. If producing a PR for the upstream project (not an internal fork), treat Claude's output as a draft for human review, not a submission-ready artifact.134
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| tphakala/birdnet-goCLAUDE.md · 1.6k | CLAUDE.md | buildtestlint-formatstyle+8 | 100/100 | today | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 46 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 14 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 7 days ago | |
| livewire/livewireCLAUDE.md · 24k | CLAUDE.md | setupbuildteststyle+4 | 100/100 | 14 days ago | |
| lepinkainen/network-monitorCLAUDE.md · 0 | CLAUDE.md | buildtestlint-formatstyle+11 | 97/100 | 14 days ago | |
| ruvnet/rufloruflo/src/ruvocal/CLAUDE.md · 68k | CLAUDE.md | setupbuildtestlint-format+6 | 97/100 | 14 days ago | |
| jeecgboot/JeecgBootjeecgboot-vue3/CLAUDE.md · 47k | CLAUDE.md | setupbuildtestlint-format+10 | 97/100 | 14 days ago | |
| nullclaw/nullclawCLAUDE.md · 8.0k | CLAUDE.md | buildteststylearch+5 | 97/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/grokability-snipe-it-claude)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.