Package Audit & Release Certification Skill
[!IMPORTANT] AUDIT ACTIVATION CONTRACT & TOKEN CONSERVATION RULE: This skill is an expensive, high-rigor governance procedure reserved strictly for formal release certification.
- DO NOT INVOKE OR EXECUTE THIS SKILL during routine feature development, bugfixing, refactoring, or patch updates (
1.2.0->1.2.1).- For everyday quality checks, use
php artisan package:check <pkg> --quickorcomposer testinstead.- Execute this procedure ONLY when the human user explicitly instructs: "проведи полный аудит", "подготовь релизную сертификацию", "certify package for release".
Directory Structure & Resources
- Master Orchestrator Guide: Lifecycle coordination, 3-section reporting protocol, and remediation rules.
- 7 Specialized Audit Contracts:
01_architecture_api.md— Public API surface, "Laravel First" abstractions, Octane safety, BC safety.02_code_quality.md— Strict types, PHPStan Level 8+/max, Pint formatting.03_database.md— Migrations, table prefixes, multi-DB compatibility.04_security_isolation.md— Container hijacking prevention, secret leaks, injection protection.05_composer_supply_chain.md—composer validate --strict, export-ignore, lockfile hygiene.06_testing_compatibility.md— PHPUnit/Pest coverage, test isolation, Testbench.07_consumer_release.md— Fresh sandbox smoke test, README quickstart,AUDIT.json.
- Templates:
- Manifest Template:
resources/templates/audit-manifest.template.json
- Manifest Template:
- Local Run Artifacts: Stored in target package
.audit/<timestamp>/(gitignored).
Operational Workflow
Phase 0: Tooling Verification & Self-Bootstrapping
When explicitly invoked by the human user, check if php artisan package:audit is available:
php artisan list package:audit- If available: Proceed directly to Phase 1.
- If missing (Self-Bootstrapping):
Install the audit engine into
require-dev:composer require --dev alex-kassel/laravel-package-audit - Direct CLI Fallback: If the environment prevents installing composer packages, directly execute the underlying tools (
vendor/bin/pint --test,vendor/bin/phpstan,vendor/bin/phpunit,composer validate --strict).
Phase 1: Cognitive Audit & Mandatory Human Gate (Read-Only)
- Mechanical Baseline Diagnosis:
Run the package audit in inspect mode (no certification issued):
php artisan package:audit <path/to/package> --json --no-commit - Cognitive Domain Evaluation:
Inspect the package code against the 7 specialized contracts in
references/contracts/. - Compile Local Review Artifacts:
Store diagnostic details in
.audit/<timestamp>/:01_baseline_inspection.md02_remediation_plan.md
- Compile Structured 3-Section Report for the Human:
- Section 1: Baseline Findings & Risk Assessment
- Section 2: Planned Automated Fixes
- Section 3: Architectural Decisions Requiring Explicit Choice
- 🛑 MANDATORY STOP (Human Gate): DO NOT PROCEED. DO NOT MODIFY CODE. DO NOT GENERATE CERTIFICATE. Present the report to the user and wait for explicit confirmation.
Phase 2: Remediation, Commit & Cryptographic Certification
Once the human user confirms and approves the plan:
- Apply Atomic Remediation: Execute the approved fixes in logical order (Code Quality -> Architecture -> Tests -> Docs).
- Create Release Commit:
Stage changes and create a clean git commit representing the audited release milestone:
git add . git commit -m "release: prepare audited release v{version}" - Mechanical Verification & Cryptographic Certification:
Execute final certification against the committed state:
This issues the tamper-proofphp artisan package:audit <path/to/package> --target-version={version}AUDIT.jsonanchored to the immutable Gittree_hashand commit. - Archive Run Artifacts:
Save
FINAL-REPORT.mdinto.audit/<timestamp>/for local audit trail.