
Codex Dev G
- 7 installs
- 4 repo stars
- Updated March 6, 2026
- oil-oil/agent-skills
Helps with ai & agent building tasks.
About
codex-dev-g is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- codex-dev-g
- AI & Agent Building
- AI-coding skill
Codex Dev G by the numbers
- 7 all-time installs (skills.sh)
- Ranked #12,520 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oil-oil/agent-skills --skill codex-dev-gAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 7 |
|---|---|
| repo stars | ★ 4 |
| Last updated | March 6, 2026 |
| Repository | oil-oil/agent-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
Dev G — Your Codex Coding Partner
Delegate coding execution to Codex CLI. Dev G turns clear plans into working code.
Critical rules
- ONLY interact with Dev G through the bundled shell script. NEVER call
codexCLI directly. - Run the script ONCE per task. If it succeeds (exit code 0), read the output file and proceed. Do NOT re-run or retry.
- Do NOT read or inspect the script source code. Treat it as a black box.
How to call the script
The script path is:
~/.claude/skills/codex-dev-g/scripts/ask_dev_g.shMinimal invocation:
~/.claude/skills/codex-dev-g/scripts/ask_dev_g.sh \
--workspace /absolute/workspace/path \
--task "Your request in natural language"With file context:
~/.claude/skills/codex-dev-g/scripts/ask_dev_g.sh \
--workspace /absolute/workspace/path \
--task "Refactor these components to use the new API" \
--file src/components/UserList.tsx \
--file src/components/UserDetail.tsxMulti-turn conversation (continue a previous session):
~/.claude/skills/codex-dev-g/scripts/ask_dev_g.sh \
--workspace /absolute/workspace/path \
--session <session_id from previous run> \
--task "Also add retry logic with exponential backoff"The script prints on success:
session_id=<thread_id>
output_path=<path to markdown file>Read the file at output_path to get Dev G's response. Save session_id if you plan follow-up calls.
Decision policy
Call Dev G when at least one of these is true:
- The implementation plan is clear and needs coding execution.
- The task involves batch refactoring, code generation, or repetitive changes.
- Multiple files need coordinated modifications following a defined pattern.
- You want a practitioner's perspective on whether a plan is feasible.
- The task is cost-sensitive and doesn't require deep architectural reasoning.
- Writing or updating tests based on existing code.
- Simple-to-moderate bug fixes where the root cause is identified.
Handle it yourself when:
- The task requires architecture design, technical strategy, or tradeoff analysis.
- Copywriting, documentation prose, or nuanced communication is needed.
- Deep contextual understanding of business requirements is critical.
- The problem is ambiguous and needs clarification before any code is written.
Workflow
Task delegation (most common)
1. Design the solution and break it into concrete steps. 2. Run the script with --task describing exactly what to implement. 3. Pass relevant files with --file so Dev G has context. 4. Read the output — Dev G executes changes and reports what it did. 5. Review the changes in your workspace.
Discussion mode
1. Run the script with a question-oriented --task. 2. Pass the relevant files for Dev G to analyze. 3. Read its feedback — it thinks from an implementer's perspective. 4. Combine its practical insights with your architectural judgment.
Multi-step projects
Use --session to continue the conversation with context:
1. First call: core implementation. Save the session_id from output. 2. Review output, then second call with --session <id>: tests and edge cases. 3. Third call with --session <id> if needed: cleanup and polish.
Each follow-up call carries the full conversation history.
File reference guidance
- Use
--filewith workspace-relative or absolute paths. - Include 2-6 high-signal files rather than dumping everything.
- Dev G runs with full workspace access, so it can discover related files on its own.
Options
--session <id>— Resume a previous session for multi-turn conversation.--model <name>— Override model (default: uses Codex config).--sandbox <mode>— Override sandbox policy (default: workspace-write via full-auto).--read-only— Run in read-only mode for pure discussion/analysis, no file changes.
Execution notes
- Dev G runs with
--full-autoby default, meaning it can read and write files in the workspace autonomously. - Keep
--tasktext concrete and actionable. Vague requests get vague results. - When Dev G's suggestions conflict with your architectural decisions, your judgment takes priority.
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<'USAGE'
Usage:
ask_dev_g.sh --workspace <path> [--task <text> | --task-file <path>] [options]
Required:
-w, --workspace <path> Workspace directory
Task input (choose one, or pipe from stdin):
-t, --task <text> Request text
--task-file <path> Read request from file
File context (optional, repeatable):
-f, --file <path> Priority file path
Multi-turn:
--session <id> Resume a previous session (thread_id from prior run)
Options:
--model <name> Model override
--sandbox <mode> Sandbox mode override
--read-only Read-only sandbox (no file changes)
--full-auto Full-auto mode (default)
-o, --output <path> Output file path
-h, --help Show this help
Output (on success):
session_id=<thread_id> Use with --session for follow-up calls
output_path=<file> Path to response markdown
Examples:
# New task
ask_dev_g.sh -w /repo -t "Add error handling to api.ts" -f src/api.ts
# Continue conversation
ask_dev_g.sh -w /repo --session <id> -t "Also add retry logic"
USAGE
}
require_cmd() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "[ERROR] Missing required command: $1" >&2
exit 1
fi
}
trim_whitespace() {
awk 'BEGIN { RS=""; ORS="" } { gsub(/^[ \t\r\n]+|[ \t\r\n]+$/, ""); print }' <<<"$1"
}
to_abs_if_exists() {
local target="$1"
if [[ -e "$target" ]]; then
local dir
dir="$(cd "$(dirname "$target")" && pwd)"
echo "$dir/$(basename "$target")"
return
fi
echo "$target"
}
resolve_file_ref() {
local workspace="$1" raw="$2" cleaned
cleaned="$(trim_whitespace "$raw")"
[[ -z "$cleaned" ]] && { echo ""; return; }
if [[ "$cleaned" =~ ^(.+)#L[0-9]+$ ]]; then cleaned="${BASH_REMATCH[1]}"; fi
if [[ "$cleaned" =~ ^(.+):[0-9]+(-[0-9]+)?$ ]]; then cleaned="${BASH_REMATCH[1]}"; fi
if [[ "$cleaned" != /* ]]; then cleaned="$workspace/$cleaned"; fi
to_abs_if_exists "$cleaned"
}
append_file_refs() {
local raw="$1" item
IFS=',' read -r -a items <<< "$raw"
for item in "${items[@]}"; do
local trimmed
trimmed="$(trim_whitespace "$item")"
[[ -n "$trimmed" ]] && file_refs+=("$trimmed")
done
}
# --- Parse arguments ---
workspace=""
task_text=""
task_file=""
model=""
sandbox_mode=""
read_only=false
full_auto=true
output_path=""
session_id=""
file_refs=()
while [[ $# -gt 0 ]]; do
case "$1" in
-w|--workspace) workspace="${2:-}"; shift 2 ;;
-t|--task) task_text="${2:-}"; shift 2 ;;
--task-file) task_file="${2:-}"; shift 2 ;;
-f|--file|--focus) append_file_refs "${2:-}"; shift 2 ;;
--model) model="${2:-}"; shift 2 ;;
--sandbox) sandbox_mode="${2:-}"; full_auto=false; shift 2 ;;
--read-only) read_only=true; full_auto=false; shift ;;
--full-auto) full_auto=true; shift ;;
--session) session_id="${2:-}"; shift 2 ;;
-o|--output) output_path="${2:-}"; shift 2 ;;
-h|--help) usage; exit 0 ;;
*) echo "[ERROR] Unknown argument: $1" >&2; usage >&2; exit 1 ;;
esac
done
require_cmd codex
require_cmd jq
# --- Validate inputs ---
if [[ -z "$workspace" ]]; then
echo "[ERROR] --workspace is required" >&2; usage >&2; exit 1
fi
if [[ ! -d "$workspace" ]]; then
echo "[ERROR] Workspace does not exist: $workspace" >&2; exit 1
fi
workspace="$(cd "$workspace" && pwd)"
if [[ -n "$task_file" ]]; then
if [[ ! -f "$task_file" ]]; then
echo "[ERROR] Task file does not exist: $task_file" >&2; exit 1
fi
task_text="$(cat "$task_file")"
fi
if [[ -z "$task_text" && ! -t 0 ]]; then
task_text="$(cat)"
fi
task_text="$(trim_whitespace "$task_text")"
if [[ -z "$task_text" ]]; then
echo "[ERROR] Request text is empty. Pass --task, --task-file, or stdin." >&2; exit 1
fi
# --- Prepare output path ---
if [[ -z "$output_path" ]]; then
timestamp="$(date -u +"%Y%m%d-%H%M%S")"
output_path="$workspace/.runtime/dev-g/${timestamp}.md"
fi
mkdir -p "$(dirname "$output_path")"
# --- Build file context block ---
file_block=""
if (( ${#file_refs[@]} > 0 )); then
file_block=$'\nPriority files (read these first before making changes):'
for ref in "${file_refs[@]}"; do
resolved="$(resolve_file_ref "$workspace" "$ref")"
[[ -z "$resolved" ]] && continue
exists_tag="missing"
[[ -e "$resolved" ]] && exists_tag="exists"
file_block+=$'\n- '"${resolved} (${exists_tag})"
done
fi
# --- Build prompt ---
prompt="$task_text"
if [[ -n "$file_block" ]]; then
prompt+=$'\n'"$file_block"
fi
# --- Build codex command ---
if [[ -n "$session_id" ]]; then
# Resume mode: continue a previous session
cmd=(codex exec resume --skip-git-repo-check --json)
if [[ "$read_only" == true ]]; then
cmd+=(--sandbox read-only)
elif [[ -n "$sandbox_mode" ]]; then
cmd+=(--sandbox "$sandbox_mode")
elif [[ "$full_auto" == true ]]; then
cmd+=(--full-auto)
fi
[[ -n "$model" ]] && cmd+=(-m "$model")
cmd+=("$session_id")
else
# New session
cmd=(codex exec --cd "$workspace" --json)
if [[ "$read_only" == true ]]; then
cmd+=(--sandbox read-only)
elif [[ -n "$sandbox_mode" ]]; then
cmd+=(--sandbox "$sandbox_mode")
elif [[ "$full_auto" == true ]]; then
cmd+=(--full-auto)
fi
[[ -n "$model" ]] && cmd+=(-m "$model")
fi
# --- Execute and capture JSON output ---
stderr_file="$(mktemp)"
json_file="$(mktemp)"
trap 'rm -f "$stderr_file" "$json_file"' EXIT
if ! (cd "$workspace" && printf "%s" "$prompt" | "${cmd[@]}" >"$json_file" 2>"$stderr_file"); then
echo "[ERROR] Codex command failed" >&2
cat "$stderr_file" >&2
exit 1
fi
if [[ -s "$stderr_file" ]]; then
cat "$stderr_file" >&2
fi
# --- Extract thread_id and last agent message from JSON stream ---
thread_id="$(jq -r 'select(.type == "thread.started") | .thread_id' < "$json_file" | head -1)"
# Get the last agent_message text
last_message="$(jq -r 'select(.type == "item.completed" and .item.type == "agent_message") | .item.text' < "$json_file" | tail -1)"
# Write the response to output file
if [[ -n "$last_message" ]]; then
printf "%s\n" "$last_message" > "$output_path"
else
echo "(no response from codex)" > "$output_path"
fi
# --- Output results ---
if [[ -n "$thread_id" ]]; then
echo "session_id=$thread_id"
fi
echo "output_path=$output_path"