Instructions for OpenAI Codex when working in the Core ecosystem.
You have access to core-agent MCP tools. Use them:
brain_recall— Search OpenBrain for context about any package, pattern, or decisionbrain_remember— Store what you learn for other agents (Claude, Gemini, future LEM)agentic_dispatch— Dispatch tasks to other agentsagentic_status— Check agent workspace status
ALWAYS brain_remember significant findings — your deep analysis of package internals, error patterns, security observations. This builds the shared knowledge base.
-
Error handling:
coreerr.E("pkg.Method", "what failed", err)fromgo-log. NEVERfmt.Errorforerrors.New.- Import as:
coreerr "forge.lthn.ai/core/go-log" - Always 3 args: operation, message, cause (use
nilif no cause) coreerr.Ereturns*log.Errwhich implementserrorandUnwrap()
- Import as:
-
File I/O:
coreio.Local.Read/Write/Delete/EnsureDirfromgo-io. NEVERos.ReadFile/WriteFile/MkdirAll.- Import as:
coreio "forge.lthn.ai/core/go-io" - Security: go-io validates paths, prevents traversal
- Import as:
-
Process management:
go-processfor spawning external commands. Supports Timeout, GracePeriod, KillGroup. -
UK English: colour, organisation, centre, initialise (never American spellings)
-
Test naming:
TestFoo_Good(happy path),TestFoo_Bad(expected errors),TestFoo_Ugly(panics/edge cases) -
Commits:
type(scope): descriptionwithCo-Authored-By: Virgil <[email protected]>
- Actions pattern: Single-purpose classes with
use Actiontrait, static::run()helper - Tenant isolation:
BelongsToWorkspacetrait on ALL models with tenant data - Strict types:
declare(strict_types=1)in every file - Testing: Pest syntax, not PHPUnit
When reviewing code, prioritise:
- Security: Path traversal, injection, hardcoded secrets, unsafe input
- Error handling: coreerr.E() convention compliance
- File I/O: go-io usage, no raw os.* calls
- Tenant isolation: BelongsToWorkspace on all tenant models (PHP)
- Test coverage: Are critical paths tested?
Your reviews generate training data for LEM (our fine-tuned model). Be thorough and structured in your findings — every observation helps improve the next generation of reviews.