Query the catalog for unindexed foreign keys, create a migration per missing index, and verify each with a full test run until all FKs are covered or 6 turns complete.
/goal every foreign key in the schema has a covering index — query the catalog (pg_catalog or information_schema) to list FKs with no matching index, add one migration per missing index, and re-run the catalog check until it returns zero rows. After each index, apply the migration on a scratch database and run the full test suite to verify nothing regresses; stop after 6 turns. Only add indexes — never change constraints or table definitions — and propose the final migration set as a PR for review.
/schedule every night at 3am, dump the live database schema (`pg_dump --schema-only`) and diff it against the schema produced by applying all committed migrations to a fresh scratch database. Verify the scratch build reports `migrate status` clean before comparing. Any drift — columns, indexes, or constraints present in prod but missing from migrations, or vice versa — gets an issue filed with the exact diff attached and a proposed corrective migration for human review. Read-only against production; never modify the live schema. Stop after 1 pass per run.
Pull the slowest PostgreSQL statement, optimize its query plan with an index or rewrite, verify the improvement, and repeat until all captured queries run under 100ms or hit eight iterations.
/loop pull the 10 slowest statements from pg_stat_statements, take the single worst one, and EXPLAIN ANALYZE it. Fix only that query this iteration — add the missing index, rewrite the predicate, or batch the N+1 — then re-run EXPLAIN ANALYZE to verify the plan improved and run the test suite to prove behavior is unchanged. Only touch indexes and query shape, never application behavior. Continue until every statement in the captured set runs under its 100ms budget — stop after 8 turns, then propose the accumulated index changes as a single PR for review and report any remaining offenders.
# SkillFoundry Framework — Agent Instructions for OpenAI Codex Version 5.22.1 | Hexa-Platform: Claude Code · Cursor · Copilot · Codex · Gemini · Grok Build | 107 Skills | 20 MCP Tool Agents --- ## What This Is SkillFoundry (Agents & Skills) is a production-ready AI development framework with 60 specialized agents covering the full software development lifecycle. This file provides always-on context for OpenAI Codex CLI. ## Philosophy - Cold-blooded logic over flattery — Honest, structured, production-ready evaluations only - ONLY REAL LOGIC — No placeholders, TODOs, mocks, or stubs. Every feature works end-to-end - Three-Layer Completeness — Every feature verified across DATABASE → BACKEND → FRONTEND - PRD-First Development — Non-trivial features start with a Product Requirements Document - Implement Test Iterate — Every feature tested before considered done ## How to Use Skills Each SkillFoundry agent is available as a Codex Skill in .agents/skills/ . Invoke explicitly or let Codex auto-select based on your prompt. Explicit invocation: $go # Execute all PRDs from genesis/ $coder
# CLAUDE.md — Project Constitution Claude Code reads this file automatically at the start of every run. In a Ralph loop each iteration is a FRESH context, so this file is the only memory that survives. Treat every rule here as non-negotiable. ## What we are building An audit-grade verification gate : an inline API an AI agent calls before it commits a high-stakes output. It returns a verdict AND a signed, tamper- evident audit receipt that a compliance officer can hand to a regulator. The receipt — not the detection — is the product. Full spec: specs/verification-gate.md . ## The Ten Golden Rules (violating any is a failed iteration) 1. One task per loop. Read fix plan.md , pick the single highest-priority unchecked [ ] item, do ONLY that. Do not batch. 2. Tests are law. Never mark a task done unless the full test suite is green. Run it; do not assume. 3. Never weaken a test to pass it. Deleting, skipping, or loosening an assertion to get green is a critical failure. If a test is genuinely wrong, record why in the progress log and stop. 4. Small diffs. If your change touches more than ~3 files or ~150 lines, you have taken too much Cap the run at 25 iterations; leave remaining work for the next session.
/ralph-loop "Read the brief at /redesign/briefs/clients-brief.md. Compare the current implementation to the brief's requirements (every section of the brief, including Recipe Context and Implementation Notes). Apply one focused improvement. Re-check against the brief. If all brief requirements are met, output <promise PAGE-POLISH-COMPLETE</promise ." --max-iterations 8 --completion-promise "PAGE-POLISH-COMPLETE
/loop 20m /review-pr 1234 , to re-run that skill each iteration. {/ min-version: 2.1.196 /}As of v2.1.196, a scheduled fire only runs skills that Claude is [allowed to invoke on its own](/en/skills#control-who-invokes-a-skill). The following reach Claude as plain text instead of executing
/goal records docs/reports/ baselines/2026-06-02-foundations-after.md + specs/047-foundations-programme-closeout/contracts/after-baseline.md ; no public product .fsi /surface/package/runtime impact; Principle IV (Elmish/MVU) is not applicable (pure validation refactor, IO confined to the existing read-file wrapper); required real evidence = prose-size accounting, the rewording-passes / drift-fails red→green, the enumerated contract-token set, and the restated-goal record Cap the run at 20 turns.
Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.
/goal Complete GOALS.md phases 1-13 in order. For each phase, implement the deliverables, add/update tests, run the common validation plus that phase's Automated QA, commit after the phase passes, and push after stable milestones. Preserve unrelated user changes. Stop only if blocked by missing credentials, external service access, or an explicit product decision that cannot be safely inferred Cap the run at 20 turns.
Research and document all major world religions from 5000 BC to 2026, generating a complete lineage map with bibliography and coverage matrix until finished.
/goal Complete the Global Religious Lineages, Sects, Faiths, and Offshoots Mapping Project in the workspace under project root /home/ndsadmin/dev/research/ folder. Treat @GOAL.md as the authoritative task contract. Create ./global-religious-lineages-5000bc-2026.md plus the required research-log, bibliography, coverage matrix, and uncertainty/disputed-claims files. Work chronologically from approximately 5000 BC/BCE through 2026 AD/CE, and do not stop after an outline, sample, summary, or representative survey Cap the run at 20 turns.
/goal ./scripts/verify.sh exits 0, .ai/spec-tdd/state.json phase is done, frozen tests and acceptance gates are unchanged, no tests are skipped/weakened, and no TODO/stub/hardcoded test-only implementation remains; or stop after 20 turns with a clear blocked report
/goal CONDITION directive evaluated by a dedicated Claude Haiku judge each turn. The orchestrator stops parsing model output entirely: it spawns one long-lived claude -p "/goal CONDITION" session, the /goal evaluator reads the running transcript and answers "is the condition satisfied yet?" turn by turn, and the Stop hook blocks termination until the evaluator says yes. ralph.sh has been reduced to a one-line deprecation shim that exec s goal.sh . Decision moved from a shell-level grep into an explicit model call with a schema-validated yes/no — the textbook ZFC move Cap the run at 20 turns.
/loop 20m Continue autoresearch. Read research-state.yaml and findings.md. Re-read the autoresearch SKILL.md occasionally to stay aligned. Step back and reflect holistically — is the research making real progress? Are you deepening understanding or just running experiments? If stalling, pivot or search literature for new ideas. Keep making research progress — never idle, never stop. Update findings.md, research-log.md, and research-state.yaml when there's new progress. Git commit periodically and clean up the repo if needed. Show the human your research progress with key plots and findings by preparing a report in to human/ and opening the HTML/PDF. Only when you believe the research is truly complete, invoke the ml-paper-writing skill to write the paper
Guardrails: Stop when the goal is verifiably met, or stop after 15 iterations, whichever comes first. Verify each pass by running the relevant tests or checks — self-reported success does not count.
A Claude Code plugin that pressure-tests a plan before any code is written: Claude writes PLAN.md, Codex adversarially reviews it from three different reviewer angles in rotation, and a Stop hook drives the draft-critique-revise cycle autonomously in one terminal window until the plan survives review or a round cap is reached.
/claudex:plan <feature> — Claude drafts PLAN.md from a one-line feature description. A Claude Code Stop hook blocks the turn and runs Codex (via `codex exec`) against the plan using a rotating reviewer persona: round 1 senior engineer, round 2 security/data-integrity, round 3+ ops/SRE. Claude reads Codex's findings and either revises PLAN.md or calls mark-done. The hook re-fires each turn, incrementing the round and rotating the persona, until Codex reports no material findings or the max-rounds cap (default 3, configurable via --rounds) is hit. Cap the run at 25 iterations; leave remaining work for the next session.
Framework-agnostic (Claude Code, Codex, OpenClaw, or any LLM agent), markdown-only skill bundle (79+ skills) for running ML research unattended overnight: literature search, idea generation, experiment execution, and cross-model paper review, with a silent-death watchdog and a stall/pivot mechanism so a stuck loop changes approach instead of looping forever on minor variants.
Install the ARIS markdown-only skills, then run the overnight research loop: the agent reviews relevant literature, proposes and critiques experiment ideas, runs GPU experiments, updates a persistent Research Wiki, and has a second model cross-review the draft paper each round. A watchdog checks the state file's modification time and flags the run STALE/MISSING/COMPLETED if it goes silent. An iteration log counts new findings per round; at 2 consecutive stale rounds it forces a structural pivot (reframe and try a new direction), and at 4 it escalates to a human instead of continuing to retry near-identical variants. Cap the run at 25 iterations; leave remaining work for the next session.
Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.
Runs Claude Code/Codex as an autonomous multi-role dev team — planner → reviewer ↔ fixer → worker — across all of a user's GitHub repos, entirely driven by issue labels. Each loop runs in its own git worktree so multiple repos/issues proceed in parallel without collisions.
Register a repo with looper, then label an issue `looper:plan` and assign it to yourself. The planner reads the issue, explores the repo, drafts a spec, critiques and revises it, and opens a spec PR labeled `looper:spec-reviewing`. A reviewer re-reads the PR on every commit and posts inline review threads; a fixer pulls those threads, addresses them in its own worktree, and pushes, ping-ponging with the reviewer until every thread is resolved. Once labeled `looper:spec-ready`, a worker implements the spec, runs checks, and iterates on its own output until checks pass and the PR is ready for human review and merge. Every phase transition is gated on a GitHub label via `looperd`, so a human can pause or take over at any boundary.
/loop /leader-tick ) that triages, reviews, runs CI checks, and merges PRs. See docs/team-orchestration.md for the full lifecycle and docs/leader-runbook.md for operator notes Cap the run at 15 passes.
Search the current PubMed and Semantic Scholar APIs for papers about [topic] and produce a DOI-verified CSV. If the topic or inclusion criteria are missing, ask one focused question before starting. Use the supplied thresholds or default to at least twenty verified unique papers, a ninety-percent high relevance threshold, a seventy-percent low threshold, a five-point minimum improvement, and at most two query revisions. Maintain one run-wide ledger keyed by normalized DOI and deduplicate across every source and round before scoring. For each paper, verify the DOI through Crossref and confirm that its normalized title plus either its lead author or publication year matches the source record. Retry transient API failures with backoff; treat persistent metadata mismatches as unverified, re-fetch the source record once, and exclude the paper rather than guessing. Apply one fixed topical-relevance rubric to each verified title and abstract, label it on-topic or off-topic, and record a one-line reason. Never change the rubric during the run. Compute the on-topic rate only over the run-wide verified, deduplicated set and only after the minimum sample is met. Succeed when the set reaches the high threshold. Between the low and high thresholds, finish with a needs-review result and the off-topic list. Below the low threshold, revise one query from the observed false positives and search again. Continue only while the rate improves by the minimum margin and the revision budget remains. Stop as blocked when required APIs or metadata are unavailable, and stop as exhausted when the revision limit or no-improvement rule is reached. Never invent, infer, or autocomplete paper metadata. Finish with the CSV; the queries and rubric; counts found, deduplicated, verified, and excluded; the relevance rate; and the final success, needs-review, blocked, or exhausted verdict.
Refactor [target] toward [measurable goal] in [repository]. If the target or goal is missing, ask and stop. Record current behavior and affected dependencies; select representative tests for boundaries and failure modes, then make one atomic change without altering public contracts unless authorized. Run the same tests, type and lint checks, and affected-consumer checks, keeping only regression-free improvements. Repeat for at most five rounds. Stop on success, blocked architecture, approval required, exhaustion, or no progress. Preserve unrelated work and finish with the diff, impact map, evidence, rejected attempts, and remaining debt.
Implement one bounded feature slice in [repository]. Read project instructions, the current implementation, relevant services, types, UI, tests, and architecture notes before editing. Report the evidence, risks, affected files, persistence impact, and validation plan; stop for approval if inspection materially changes scope or reveals destructive, production, or silent-persistence behavior. Make the smallest change, preserve unknown data and unrelated work, run relevant checks, and manually verify user-facing states. Stop after this slice and return evidence, limitations, and the next recommended slice.
Bring every production React app in [repository] to a freshly verified React Doctor score of 100/100. Inventory app roots, record a full `npx react-doctor@latest --verbose` baseline, fix one root cause at a time, and rerun the full scan plus relevant typecheck, lint, tests, and builds. Never hide findings with exclusions, ignores, suppressions, deleted behavior, or relaxed rules. Stop at 100/100 for every app, blocked, approval-required, or no measurable progress; preserve unrelated work and report exact proof.
Run `pnpm exec react-doctor . --verbose --yes --offline --fail-on none` to record the baseline, then rerun with `--fail-on error`. Fix at most five genuine findings, run the same scan and relevant project checks, and keep only verified improvements. Clear errors before high-confidence warnings. Stop when clean, blocked, approval is required, a finding is false-positive, or another pass makes no measurable progress. Finish with baseline and final results, retained fixes, reverted attempts, checks, and remaining findings.
Review every Dependabot pull request currently open in [repository]. Take a fixed snapshot of that set and process each pull request once. Read its diff, release notes, advisories, dependency role, current base revision, and exact-head CI results. Run the repository’s relevant tests in an isolated worktree and classify the update by version change, breaking behavior, security exposure, and regression risk. For failing checks, identify the root cause and prepare the smallest verified repair. Process merges serially: before each merge, refetch the base and pull-request head and require passing exact-head checks. Merge only low-risk patch or minor updates when explicit merge authority has already been granted. Request approval for major, breaking, security-sensitive, uncertain, or externally visible actions. Never push changes, merge, comment, or send messages without the corresponding authority. Stop successfully when the original snapshot is fully processed; stop without changes when none are open; stop as blocked when verification is unavailable. Finish with reviewed, repaired, merged, deferred, and blocked pull requests plus supporting evidence.
Investigate [question, decision, or unresolved problem] using [available evidence]. Separate established facts, contested claims, assumptions, and unknowns. Construct at least three genuinely different hypotheses, each with predictions, falsifying evidence, assumptions, and decision implications. Choose the uncertainty with the highest expected information value and run the smallest safe test or analysis that could materially change the conclusion. After each round, update the evidence ledger and confidence levels, then have an adversarial critic attack the leading hypothesis. Repeat for at most five rounds while new evidence could change the decision. Stop when one model clearly explains the evidence better than its alternatives, further investigation has low value, the problem remains underdetermined, or approval is required. Never fabricate evidence or hide uncertainty. Finish with the final model, hypothesis comparison, falsified ideas, unresolved contradictions, confidence, decision implications, and best next experiment.
Before publishing [draft], inventory every factual, statistical, quoted, or attributed claim a reader could verify. Find the best current primary source for each and label it supported, outdated, misattributed, unsupported, or unverifiable. Fix the riskiest mismatch, then recheck that claim and anything depending on it. Repeat until no high-risk unsupported claim remains or five rounds are exhausted. Never invent a source, cite evidence that does not support the claim, or alter a quotation. Ask before changing a named person’s quote or a legal, medical, or financial statement. Stop without changes if there are no checkable claims; stop as blocked when adequate evidence is unavailable. Finish with the claim-to-source table, corrections made, unresolved claims, and decisions requiring an editor.
Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.