autonomous-skill
0
总安装量
17
周安装量
安装命令
npx skills add https://github.com/feiskyer/codex-settings --skill autonomous-skill
Agent 安装分布
claude-code
16
gemini-cli
15
codex
15
opencode
15
antigravity
14
windsurf
14
Skill 文档
Autonomous Skill – Long-Running Task Execution
Execute complex, long-running tasks across multiple sessions using a dual-agent pattern (Initializer + Executor) with automatic session continuation via Codex non-interactive mode.
Quick Start
Use the run-session.sh script to manage autonomous tasks:
# Start a new autonomous task
~/.codex/skills/autonomous-skill/scripts/run-session.sh "Build a REST API for todo app"
# Continue an existing task
~/.codex/skills/autonomous-skill/scripts/run-session.sh --task-name build-rest-api-todo --continue
# List all tasks and their progress
~/.codex/skills/autonomous-skill/scripts/run-session.sh --list
# Show help
~/.codex/skills/autonomous-skill/scripts/run-session.sh --help
Directory Structure
All task data is stored in .autonomous/<task-name>/ under the project root:
project-root/
âââ .autonomous/
âââ build-rest-api/
â âââ task_list.md # Master task checklist
â âââ progress.md # Session-by-session notes
â âââ session.id # Last Codex session ID for resumption
â âââ session.log # JSON Lines output from sessions
âââ refactor-auth/
â âââ task_list.md
â âââ progress.md
â âââ session.id
âââ ...
This allows multiple autonomous tasks to run in parallel without conflicts.
Script Options
Usage:
run-session.sh "task description" Start new task (auto-generates name)
run-session.sh --task-name <name> --continue Continue specific task
run-session.sh --list List all tasks
run-session.sh --help Show help
Options:
--task-name <name> Specify task name explicitly
--continue, -c Continue existing task
--no-auto-continue Don't auto-continue after session
--max-sessions N Limit to N sessions
--list List all existing tasks
--resume-last Resume the most recent Codex session
--network Enable network access (uses danger-full-access sandbox)
Workflow Overview
User Request â Generate Task Name â Create .autonomous/<task-name>/ â Execute Codex Sessions
â
âââââââââââââââââ
â task_list.md â
â exists? â
âââââââââ¬ââââââââ
â
âââââââââââââââââââââââââ´ââââââââââââââââââââââââ
â NO YES â
â¼ â¼
âââââââââââââââââ âââââââââââââââââ
â INITIALIZER â â EXECUTOR â
â - Analyze â â - Read state â
â - Break down â â - Next task â
â - Create â â - Implement â
â task_list â â - Mark done â
âââââââââââââââââ âââââââââââââââââ
â
â¼
âââââââââââââââââ
â All complete? â
âââââââââ¬ââââââââ
â
âââââââââââââââââ´ââââââââââââââââ
â NO YES â
â¼ â¼
Auto-continue Exit with success
(3 sec delay)
Usage Examples
Example 1: Start New Task
~/.codex/skills/autonomous-skill/scripts/run-session.sh "Build a REST API for todo app"
Output:
â¹ Generated task name: build-rest-api-todo
==========================================
SESSION 1 - build-rest-api-todo
==========================================
==========================================
INITIALIZER SESSION
==========================================
Task: Build a REST API for todo app
Task Name: build-rest-api-todo
Task Directory: .autonomous/build-rest-api-todo
[Codex creates task_list.md with 25 tasks...]
â Initializer session complete
â¹ Session ID saved: 550e8400-e29b-41d4-a716-446655440000
=== Progress: 0/25 ===
Continuing in 3 seconds... (Press Ctrl+C to pause)
Example 2: Continue Existing Task
~/.codex/skills/autonomous-skill/scripts/run-session.sh --task-name build-rest-api-todo --continue
Example 3: Resume with Session Context
# Resume the Codex session (preserves conversation context)
~/.codex/skills/autonomous-skill/scripts/run-session.sh --task-name build-rest-api-todo --continue --resume-last
Example 4: List All Tasks
~/.codex/skills/autonomous-skill/scripts/run-session.sh --list
Output:
==========================================
AUTONOMOUS TASKS
==========================================
â build-rest-api-todo (25/25 - 100% complete) [session: 550e8400...]
â refactor-auth (12/30 - 40%) [session: 661f9511...]
? incomplete-task (no task_list.md)
Example 5: With Network Access
# Enable network access for tasks that need API calls
~/.codex/skills/autonomous-skill/scripts/run-session.sh --network "Fetch data from GitHub API and analyze"
Key Files
For each task in .autonomous/<task-name>/:
| File | Purpose |
|---|---|
task_list.md |
Master task list with checkbox progress |
progress.md |
Session-by-session progress notes |
session.id |
Last Codex session ID for resumption |
session.log |
JSON Lines output from Codex sessions |
Important Notes
- Task Isolation: Each task has its own directory, no conflicts
- Task Naming: Auto-generated from description (lowercase, hyphens, max 30 chars)
- Task List is Sacred: Never delete or modify task descriptions, only mark
[x] - One Task at a Time per Session: Focus on completing tasks thoroughly
- Auto-Continue: Sessions auto-continue with 3s delay; Ctrl+C to pause
- Session Resumption: Use
--resume-lastto preserve Codex conversation context - Network Mode:
--networkuses--dangerously-bypass-approvals-and-sandbox; only use in an isolated environment - Git Hygiene: Consider adding
.autonomous/to.gitignoreto avoid committing logs
Codex CLI Reference
The script uses these Codex commands internally:
# Non-interactive execution with file edits (fully autonomous)
# --full-auto: autonomous execution with workspace-write sandbox
codex exec --full-auto --json "prompt"
# Resume previous session
codex exec --full-auto --json resume <SESSION_ID> "prompt"
# Full access (file edits + network) - use with caution!
codex exec --dangerously-bypass-approvals-and-sandbox --json "prompt"
Troubleshooting
| Issue | Solution |
|---|---|
| Task not found | Run --list to see existing tasks |
| Multiple tasks | Specify task name with --task-name |
| Session stuck | Check session.log in task directory |
| Need to restart | Delete task directory and start fresh |
| Resume failed | Remove session.id to start fresh session |
| Codex not found | Install Codex CLI: npm install -g @openai/codex |