ethanplusai/codex-on-crack / plugins/codex-on-crack/skills/crack
crack
UnverifiedLead substantial Codex builds with one configured implementation worker and lead acceptance. Use when the user requests codex-on-crack, names a model to delegate work to, asks to run subagents through Claude, or requests a lead/worker split. Keep host-only work direct; honor explicit external model choices. Workers must not invoke this orchestrator.
scripts/select.mjs
View on GitHub#!/usr/bin/env node
// Deterministic advisory selection. Never dispatches or changes configuration.
import { parseArgs } from 'node:util';
import { CrackError, run } from './lib/io.mjs';
import { doctor } from './lib/readiness.mjs';
import { TASK_CATEGORIES, ROLE_NAME } from './lib/roles.mjs';
const USAGE = 'Usage: select.mjs --task CATEGORY [--role NAME] [--vision] [--min-context N] [--home dir] [--codex-home dir] [--profile name]';
run((argv) => {
let values;
try { ({ values } = parseArgs({ args: argv, strict: true, options: {
task: { type: 'string' }, role: { type: 'string' }, vision: { type: 'boolean' },
'min-context': { type: 'string' }, home: { type: 'string' }, 'codex-home': { type: 'string' }, profile: { type: 'string' },
} })); } catch { throw new CrackError('usage', 'Invalid selection arguments.', USAGE); }
if (!TASK_CATEGORIES.includes(values.task) || (values.role !== undefined && !ROLE_NAME.test(values.role))) {
throw new CrackError('usage', 'Supply a supported task category and valid role name.', USAGE);
}
const minimum = values['min-context'] === undefined ? null : Number(values['min-context']);
if (minimum !== null && (!/^[1-9][0-9]*$/.test(values['min-context']) || !Number.isSafeInteger(minimum))) {
throw new CrackError('usage', '--min-context must be a positive safe integer.', USAGE);
}
const readiness = doctor(values);
const excluded = [];
const candidates = readiness.rungs.filter((rung) => rung.kind === 'primary').filter((rung) => {
const reasons = [];
if (values.role && rung.role !== values.role) return false;
const tasks = rung.tasks ?? (rung.role === 'builder' ? ['implementation'] : []);
if (!values.role && !tasks.includes(values.task)) reasons.push('Task category is not mapped to this role.');
const needsWrites = ['implementation', 'ui', 'tests'].includes(values.task);
if (rung.writes !== needsWrites) reasons.push(needsWrites ? 'Task requires a role allowed to write.' : 'Task requires a read-only role.');
if (values.vision && !rung.vision) reasons.push('Image input capability is not advertised by the catalog.');
if (minimum !== null && (rung.context_window === null || rung.context_window < minimum)) reasons.push('Catalog context window is unknown or below the requested minimum.');
if (reasons.length) { excluded.push({ role: rung.role, reasons }); return false; }
return true;
}).map((rung) => ({ ...rung, reasons: [values.role ? 'Explicit configured role requested.' : 'Configured task mapping matched.',
'Role write permission matches the task category.', ...(values.vision ? ['Catalog advertises image input.'] : []),
...(minimum === null ? [] : ['Catalog context window meets the requested minimum.'])] }));
const ready = readiness.delegation.ready;
return {
ok: ready, status: !ready ? 'not-ready' : candidates.length === 1 ? 'selected' : 'needs-choice',
task: values.task, selected: ready && candidates.length === 1 ? candidates[0] : null, candidates, excluded,
reasons: !ready ? ['Static readiness must pass before a role can be recommended.'] : candidates.length === 0
? ['No configured primary role satisfies the request; configure a compatible role or revise the request.']
: candidates.length > 1 ? ['Multiple user-configured roles qualify; the lead must ask for a choice.'] : ['Exactly one configured primary role qualifies.'],
readiness: readiness.status, problems: readiness.problems,
runtime_verified: false, inference_request_made: false,
unknown: ['Live inference and serving identity', 'Task quality, latency, and cost', 'Active project, UI, CLI, and managed overrides', 'Whether a fresh client session loaded these roles'],
limitations: [...readiness.warnings, 'Advisory only: no dispatch, fallback selection, model ranking, or root/session/configuration change.',
'Catalog capabilities are local metadata; absent capabilities do not establish support.'],
};
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |