Skip to content

Codex workflow

Start in the affected repository; use the workspace root for cross-repository work. Read its AGENTS.md and only task-relevant references. Codex stops automatic instruction discovery at the child Git root. Local instructions explicitly request ../AGENTS.md once; CLAUDE.md imports the adjacent AGENTS.md.

MamNajem skill profile

On this workstation, start with codex --profile mamnajem. The profile disables automatic planning/approval/worktree/delegation workflows and duplicate compression entries; debugging, testing, verification, and project skills remain available. The user's concrete task authorizes ordinary reversible implementation. Use a brief plan when useful; do not create task documents or spawn reviewers by default.

Install/update the tracked profile without touching base credentials or other profiles:

install -m 0644 /home/szymek/pro/mamnajem/docs/operations/mamnajem.config.toml \
  /home/szymek/.codex/mamnajem.config.toml

The profile's skill paths refer to this workstation's installed catalog. Restart Codex to load it. An already-running session retains its original skill catalog. Existing profiles remain available: quick lowers reasoning/planning; deep raises them and the tool-output limit; mobile, design, and full enable their respective MCP tools. Select a named profile for the task; profiles do not stack. Versions and settings are owned by codex --help, ~/.codex/config.toml, and ~/.codex/<name>.config.toml, not a duplicated version table here.

Focused checks and compact evidence

Repository During iteration Delivery for code changes
Backend mvn '-Dtest=Class#method' test mvn verify
Architecture npm test -- --runInBand <test-path> npm run build; npm test -- --runInBand
Mobile pnpm exec jest <test-path> --runInBand pnpm check and affected regressions
Mobile native pnpm android-e2e:test:class <fully-qualified-class> Required Espresso proof; runner changes also need pnpm android-e2e:static
Customer web pnpm exec vitest run <test-path> pnpm check; pnpm build
Admin pnpm exec vitest run <test-path> pnpm check; pnpm build
Docs templates python3 -m unittest scripts/test_mamnajem_workspace_template.py Relevant docs checks and ./scripts/build-docs-site.sh

Instruction-only changes need reference/template checks, not unrelated application suites. Published docs need verification of the changed page. For compile failures, fix a coherent root cause and its callers before recompiling; do not compile once per cascading error. Keep full logs outside model context; report exit status, counts, and relevant failures. Read more diagnostics when needed. Never hide failures with a fixed tail, weaken coverage, or treat partial checks as the delivery gate.

Searches

Inventory with git ls-files; use git ls-files -z when processing filenames. Search explicit authored paths instead of the workspace, installed dependencies, worktrees, or historical reports:

# From mobile-frontend: normal application-code search
rg -n -g '*.ts' -g '*.tsx' -g '!types-generated.ts' \
  '<symbol>' app components screens hooks utils stores api
# Generated API contract: inspect only the named type/route
rg -n '<type-or-route>' api/types-generated.ts

Search design/, generated contracts, fixtures, and historical plans only when relevant. Git tracks some generated/vendor files: the index is a scope inventory, not proof that every file is authored. For Git state, use git status --short --branch and git rev-list --left-right --count HEAD...origin/integration; fetch when remote freshness matters. Read pipeline/job summaries first, then the relevant failed trace.

Credentials

New Relic: use ~/.config/mamnajem/newrelic.env (owner-only, mode 0600) through privateCredentials() in architecture scripts/configure-newrelic-discord.cjs. The helper validates account 8573192, EU region and the User API key. Read live configuration through NerdGraph at https://api.eu.newrelic.com/graphql; use application names scoped to integration or production. Never print, commit or copy credential values. Ingest license keys are for telemetry delivery, not configuration API authentication.

AWS: first verify workstation/default credentials with aws sts get-caller-identity, account 550435500873 and region eu-west-1. Never substitute unrelated coditio credentials. Report exact denied actions. Use /mamnajem/integration/application and /mamnajem/production/application for backend CloudWatch logs.

Alert investigations use New Relic dashboards, metrics, conditions, issue history and notification records plus CloudWatch logs. Do not call other diagnostic providers or request browser login. All operational paging is routed by the mamnajem-integration-discord and mamnajem-production-discord workflows. Firebase remains optional product analytics.

Guarded delivery

Only integration and production are long-lived environments; mobile may also use develop. Push completed authorized work to integration unless the task is local-only. Fetch all/prune, update source and target with pull --ff-only, then promote with merge --ff-only. Stop on divergence; no plain merge, cherry-pick, reset, force-push, or history rewrite without explicit authorization.

Every agent/CI push uses the architecture wrapper. From the repository being pushed:

GIT_DIR="$(git rev-parse --absolute-git-dir)" GIT_WORK_TREE="$PWD" \
  npm --prefix ../architecture run push:mamnajem -- \
  mamnajem/backend origin integration:integration

Replace mamnajem/backend with the exact source project. From architecture: npm run push:mamnajem -- mamnajem/architecture origin integration:integration. Only exact approved active-head refspecs are allowed; tags, notes, production, force, wildcard, and deletion refspecs are forbidden. Historical tag recovery is Owner-only. Monitor every push to terminal CI; classify failures as application, test, contract, or infrastructure. Verify the affected integration workflow after deployment.

Production remains manual and may only fast-forward to verified integration. Before rollout, require git rev-list --count origin/integration..origin/production to be zero and git merge-base --is-ancestor origin/production origin/integration to succeed. Stop on production-only commits; do not reconcile them automatically.