mit einem Klick
writing-file-emitter
// Implement a FileEmitter for boost-core to emit a custom file (e.g. .mcp.json, .editorconfig) into the host project during boost:sync.
// Implement a FileEmitter for boost-core to emit a custom file (e.g. .mcp.json, .editorconfig) into the host project during boost:sync.
MUST USE when creating, updating, or managing AI skills and guidelines. Activates when: creating a new skill, editing existing skills, updating coding guidelines, modifying AI instructions, working with .ai/ directory, or when user mentions: skill, CLAUDE.md, guidelines, AI configuration.
Author a boost.php config file. Covers all five with* methods, when each matters, and what NOT to put in there.
Test-driven bug fixing workflow. Activates when: fixing bugs, debugging issues, resolving defects, investigating errors, or when user mentions: bug, fix, broken, not working, error, issue, defect, regression.
Requests an independent code review from OpenAI Codex CLI, critically evaluates its findings, and applies warranted fixes. Activates when: the user says /codex-review, asks for a Codex review, or wants an external AI review of changes.
Applies PR review feedback with critical evaluation. Activates when: applying review comments, addressing PR feedback, responding to code review, or when user mentions: review feedback, PR comments, apply feedback, address comments, reviewer feedback.
Pre-push / pre-release checklist. Runs Rector, Pint, full test suite, PHPStan, and audits README + `.ai/` docs for staleness. Activate before: pushing to remote, tagging a release, writing release notes, or when user mentions: pre-release, pre-push, release checklist, ship, cut release, release notes.
| name | writing-file-emitter |
| description | Implement a FileEmitter for boost-core to emit a custom file (e.g. .mcp.json, .editorconfig) into the host project during boost:sync. |
A FileEmitter is a single-method interface in SanderMuller\BoostCore\Contracts\FileEmitter:
public function emit(SyncContext $ctx): ?EmittedFile;
Return EmittedFile to write a file. Return null to skip (e.g. an
optional dependency isn't installed). Throwing is recorded as errored
and sync continues with other emitters.
The contract is @experimental — the shape may change before v1.0
stable. Pin to an exact boost-core version if you build against this.
namespace YourVendor\YourPackage\Emitters;
use SanderMuller\BoostCore\Contracts\FileEmitter;
use SanderMuller\BoostCore\Sync\EmittedFile;
use SanderMuller\BoostCore\Sync\SyncContext;
final class YourEmitter implements FileEmitter
{
public function emit(SyncContext $ctx): ?EmittedFile
{
if (! $ctx->packages->has('some/required-dep')) {
return null;
}
return new EmittedFile(
relativePath: '.your-config.json',
content: json_encode(['key' => 'value']) . "\n",
);
}
}
In your package's composer.json:
{
"extra": {
"boost": {
"emitters": [
"YourVendor\\YourPackage\\Emitters\\YourEmitter"
]
}
}
}
Emitters are only loaded from allowlisted vendors (per the host's
boost.php withAllowedVendors([]) declaration). Untrusted vendors'
emitters never instantiate.
shouldEmit check. Keep
constructors parameterless and side-effect-free.../,
absolute paths) is rejected by FileWriter. Always emit a relative
path under the project root.$ctx->packages->has(...) results — call them each time. The
SyncContext is read-only and consistent within a single sync.errored result. Either pick distinct paths or use
one emitter that branches internally.SanderMuller\BoostCore\Sync\SyncContext for what's available on $ctxpackage-boost-laravel's McpJsonEmitter for a real working example