원클릭으로
feishu-task-executor
Execute a Feishu task by dispatching it to opencode CLI for coding work. Reports results back to the task.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Execute a Feishu task by dispatching it to opencode CLI for coding work. Reports results back to the task.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Handle GitHub issue or PR comments that mention NexAgent, using the comment and repository context to decide whether to start, continue, retry, stop, report status, or ask for clarification.
Echo a task string for live SkillRuntime end-to-end verification.
Update the GitHub issue with concise execution status, blockers, or PR handoff details.
Analyze a GitHub issue, implement the fix, verify it, and hand off to PR creation.
Create a branch commit, push it, and open a GitHub pull request linked to the issue.
Review code changes with a focus on bugs, regressions, and missing tests.
SOC 직업 분류 기준
| name | feishu-task-executor |
| description | Execute a Feishu task by dispatching it to opencode CLI for coding work. Reports results back to the task. |
| user-invocable | false |
| always | false |
You received a feishu task event. Your job: dispatch it to opencode for coding work, report results back to the task.
This is not a Nex personal task management request.
Forbidden:
task tool.executor_status or executor_dispatch.Extract from the incoming message metadata:
If the visible message is only /run_feishu_task <id> or /rerun_feishu_task <id>,
use the ID from that command and fetch task details with lark-cli task tasks get.
Try in priority order:
Read the Feishu task custom field: Use bash to call lark-cli and extract the "仓库" custom field value:
bash("lark-cli task tasks get --as user --format json --params '{\"task_guid\":\"<task_id>\",\"user_id_type\":\"open_id\"}'")
If it returns a valid path or known alias, use it.
Parse @repo: from task description: Look for @repo: /path or @repo: alias-name in task_description.
Look up alias table: Read tasks/repos.json in the workspace. Match any word from the task title/description against the keys.
Ask the user: If all above fail, send a message asking "不能确定任务 <title> 对应的仓库。请回复仓库路径或别名。". When the user replies, save the alias:
bash("echo '\"<alias>\": \"<path>\"' >> tasks/repos.json")
Then re-trigger the task by changing its status from completed to in_progress.
Store the resolved repo path as REPO_PATH.
Use atomic mkdir to prevent concurrent execution on the same repo:
REPO_HASH=$(echo -n "<REPO_PATH>" | shasum -a 256 | cut -d' ' -f1)
LOCK_DIR="tasks/locks/$REPO_HASH"
mkdir "$LOCK_DIR" 2>/dev/null && echo '{"task_id":"<task_id>","started_at":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'"}' > "$LOCK_DIR/meta.json"
Execute as a single bash command:
bash("REPO_HASH=... LOCK_DIR=... mkdir ...")
If mkdir fails (lock is held):
tasks/queues/pending.jsonl: {"task_id":"<task_id>","repo":"<REPO_PATH>","enqueued_at":"<now_iso>"}bash("lark-cli task +reopen --as user --task-id <task_id>")bash("lark-cli task +comment --as user --task-id <task_id> --content '排队中,前面的任务完成后自动执行。'")Reopen the task if it is completed (unless already done in Step 3):
bash("lark-cli task +reopen --as user --task-id <task_id>")
Run opencode with the task title and description as the prompt:
bash("cd <REPO_PATH> && opencode run --dangerously-skip-permissions '<task_title>: <task_description>' 2>&1", timeout: 1800)
Capture both exit code and output:
if cd "<REPO_PATH>" && opencode run --dangerously-skip-permissions "<task_title>: <task_description>" 2>&1; then EXIT_CODE=$?; else EXIT_CODE=$?; fi
echo "EXIT_CODE=$EXIT_CODE"
Use the larger timeout (at least 1800) since coding tasks can take a while. Check the EXIT_CODE from the output — 0 means success.
If opencode succeeded (exit code 0):
bash("lark-cli task +complete --as user --task-id <task_id>")bash("lark-cli task +comment --as user --task-id <task_id> --content '执行完成。\n\n<output_summary>'")
If opencode failed (non-zero exit code):
bash("lark-cli task +comment --as user --task-id <task_id> --content '执行失败。\n\n<error_output>'")Release the lock:
bash("rm -rf tasks/locks/$REPO_HASH")
Check if there are queued tasks for the same repo:
bash("cat tasks/queues/pending.jsonl 2>/dev/null")
If entries exist for this repo:
/run_feishu_task <dequeued_task_id>_from_feishu_task: true in metadata (through the task_action mechanism)If no queued tasks, you are done.