npx skills add ...
npx skills add nvidia/openshell --skill build-from-issue
Given a GitHub issue number, plan and implement the work described in the issue. Supports direct user requests and unattended queue processing through the `agent:*` workflow labels. Includes tests, documentation updates, and PR creation. Trigger keywords - build from issue, implement issue, work on issue, build issue, start issue.
npx skills add nvidia/openshell --skill build-from-issue
Plan, iterate on feedback, and implement work described in a GitHub issue.
This skill operates as a stateful workflow — it can be run repeatedly against the same issue. Each invocation inspects the issue's labels, plan comment, and conversation history to determine the correct next action.
gh CLI must be authenticated (gh auth status)This skill supports two invocation modes:
agent:* request label is not required.agent:plan-requested authorizes planning and agent:implementation-requested authorizes implementation.A direct request authorizes only what it says. A request to review or plan does not authorize implementation. A request to build, implement, or work on an issue authorizes both the planning needed to perform the work and implementation unless the user asks to stop after planning.
The two request labels remain human-only queue controls. Under no circumstances should this skill or any agent apply them, ask to apply them, or suggest automating their application.
In direct mode, issue lifecycle and agent:* workflow labels are advisory rather than gates. Inspect the labels and warn the user about each expected label that is missing or any lifecycle label that indicates the normal workflow is incomplete, then continue with the requested phase. Do not ask the user to fix the labels first. A direct request does not change the issue's disposition or make the labels accurate; it only authorizes the requested work.
If direct work begins on an issue that was not already in the label-driven workflow, do not introduce agent:in-progress or agent:pr-opened solely for that invocation. If a matching request label is present, preserve the existing label transitions so unattended agents can track the workflow.
This skill uses two distinct markers to identify its comments:
The implementation plan lives in a single comment that is edited in place as the plan evolves. It is identified by this marker on its first line:
All other comments (responses to human feedback, status updates, PR announcements) use this marker:
These markers distinguish agent comments from human comments and from other skills (e.g., 🔒 security-review-agent, 🔧 security-fix-agent).
Each invocation follows this decision tree:
The user provides an issue ID (e.g., #42 or 42). Strip any leading # and fetch:
If the issue is closed, report that and stop.
If topic:security is present, stop. General build agents must not plan or implement security issues. Route planning/review to review-security-issue and authorized remediation to fix-security-issue.
In queue mode, stop before planning on state:triage-needed or state:needs-info, and stop on state:validated without roadmap placement. Require state:accepted or roadmap placement before queue work proceeds. If no plan exists, require agent:plan-requested; require agent:implementation-requested before queue-mode implementation.
In direct mode, inspect the same expected workflow state but do not stop because a lifecycle or agent-workflow label is absent or incomplete. Before continuing, warn the user with the specific discrepancy, for example:
"Issue #42 is missing
state:acceptedor roadmap placement andagent:implementation-requested. Those labels are expected in the queued workflow, but your direct request authorizes implementation, so I am continuing without changing them."
If state:triage-needed, state:needs-info, or state:validated is present, name that state in the warning and explain what it normally means. Continue unless the issue lacks information that is actually necessary to perform the requested work; in that case, report the concrete missing information rather than treating the label itself as the blocker.
Never add or remove state:accepted, either human request label, or the roadmap label.
Fetch all comments:
Classify each comment into one of:
> **🏗️ build-plan**> **🏗️ build-from-issue-agent**Record the plan comment's id (needed for editing via API) and its updatedAt timestamp.
Using the state machine above, determine what to do based on:
state:*, agent:plan-requested, agent:plan-ready, agent:implementation-requested, agent:in-progress, and agent:pr-opened) and which discrepancies require a direct-mode warningFollow the appropriate branch below.
If no plan comment exists, generate one when the user directly requested planning or implementation, or when agent:plan-requested is present. Otherwise report that no one has requested agent planning and stop.
Pass the issue title, description, labels, and any relevant code references to the principal-engineer-reviewer sub-agent. Use the Task tool:
In the prompt, instruct the reviewer to:
feat (new feature), fix (bug fix), refactor, chore, perf, docs.docs/reference/gateway-config.mdx. If the change is surfaced through Helm or a compute-driver overview, also include docs/reference/sandbox-compute-drivers.mdx or the relevant deployment docs./proc filesystem access, binary execution, or inter-process visibility, flag whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. In particular, tests that fork+exec into system binaries will fail on SELinux-enforcing hosts due to cross-label /proc/<pid>/exe access restrictions.Perform this investigation against the current branch and current product behavior. If the issue contains earlier diagnostics, verify them rather than relying on them.
Post the plan as a comment on the issue. This is the canonical plan comment that will be edited in place as the plan evolves.
If agent:plan-requested was present, replace it with agent:plan-ready. Do not add agent:plan-ready for a direct invocation that was not already using the label workflow.
If the direct request authorized implementation, continue to Branch C. Otherwise report that the plan has been posted and stop. In queue mode, a human reviews the plan and applies agent:implementation-requested before an unattended agent can build.
If a plan exists and there are human comments newer than the last agent response, address them.
For each human comment that is newer than the most recent agent comment (plan updatedAt or conversation comment createdAt):
> blockquote syntax.If any feedback requires changes to the plan, edit the existing plan comment rather than posting a new one. Use the GitHub API with the comment's node ID:
Or use the REST API:
Preserve the full revision history at the bottom so readers can track how the plan evolved.
Report to the user what feedback was addressed and whether the plan was updated. Stop.
Proceed with implementation when the plan exists and either the user directly requested implementation or agent:implementation-requested is present. An existing agent:in-progress or agent:pr-opened label still triggers the resume or existing-PR checks below.
Read the plan comment and check the Complexity and Confidence fields.
If Complexity is High or Confidence is Low, warn the user:
"This issue is rated High complexity / Low confidence. The plan includes open questions that may need human decisions during implementation. Proceeding, but flagging this for your awareness."
Continue — do not hard-stop. The user directly requested implementation or chose to apply agent:implementation-requested.
Before creating a branch, check for conflicts:
If a remote branch referencing this issue ID exists, report it and ask the user whether to continue on that branch or abort.
If an open PR already references this issue, report it and stop. Do not create a competing PR.
Determine the branch prefix from the issue type in the plan:
| Issue type | Branch prefix |
|---|---|
feat | feat/ |
fix | fix/ |
refactor | refactor/ |
chore | chore/ |
perf | perf/ |
docs | docs/ |
Get the current username and create the branch:
If agent:implementation-requested is present, replace it and agent:plan-ready with agent:in-progress. In direct mode without a request label, do not add an agent-workflow label.
Follow the implementation steps from the plan. Principles:
Read the relevant source files before making changes. Implement step by step per the plan's sequence.
Write tests as specified in the plan's Test Plan section. Follow the project's existing test conventions.
#[cfg(test)] blocks in Rust, test_*.py for Python)Use descriptive names that document intent:
test_pagination_returns_correct_page_counttest_rejects_negative_offset_parametertest_retry_succeeds_after_transient_failureVerification has two phases: unit tests + pre-commit, then E2E tests (if applicable). Run with up to 3 attempts per phase.
On each attempt:
If verification fails:
If all 3 attempts fail, stop and report to the user:
Do not proceed to Phase 2 or PR creation if Phase 1 is not green.
Trigger: Run this phase if any files under e2e/ were added or modified in this build. Check with:
If there are no changes under e2e/, skip this phase entirely.
If E2E files were modified, run the relevant E2E lane for the driver touched by the change:
Use mise run e2e:podman, mise run e2e:vm, or a Helm-backed Kubernetes E2E lane when the change targets those drivers.
E2E retry loop (up to 3 attempts):
If all 3 E2E attempts fail, stop and report to the user:
Do not proceed to PR creation if E2E verification is not green.
Review the documentation requirements in AGENTS.md and update any affected
docs as part of the implementation. Keep documentation changes scoped to the
behavior or subsystem that changed.
If the implementation changes gateway TOML parsing, [openshell.gateway]
fields, [openshell.drivers.<name>] fields, driver config defaults, or Helm
rendering of gateway.toml, update docs/reference/gateway-config.mdx in the
same branch. If the change affects user-facing compute-driver setup, also
update docs/reference/sandbox-compute-drivers.mdx or the relevant deployment
page.
Use the sync-agent-infra skill's maintenance map to identify related skill updates when the implementation changes behavior, commands, or development workflows. Run its full consistency check when the implementation adds, removes, or renames skills or crates; changes workflow relationships or skill coverage; modifies issue or PR templates; or changes agent cross-references. Fix any drift before committing.
Commit all changes using conventional commit format. The <type> comes from the issue type in the plan:
Push:
Create the PR:
Display the PR URL so it's easily clickable:
If E2E tests were run in Phase 2 of Step 10, post an attestation comment on the PR documenting that local E2E tests passed. This is necessary because E2E tests are not yet running in CI — this comment serves as the verification record for reviewers.
Collect the metadata before posting:
Post the attestation:
<paste the pytest summary line, e.g.: "12 passed, 1 skipped in 45.32s">
Include every test that ran (not just the new ones) so the reviewer can see full coverage. If any tests were skipped, note them and explain why.
If agent:in-progress is present, replace it with agent:pr-opened. Do not add agent:pr-opened for an unlabeled direct invocation:
Get the workflow run URL from the PR so the user can monitor CI:
Report the workflow run URL and suggest the user can use the watch-github-actions skill to monitor it.
If the agent:in-progress label is present, the skill was previously started but may not have completed.
agent:implementation-requested; a new direct implementation request can resume without it.| Command | Description |
|---|---|
gh issue view <id> --json number,title,body,state,labels,author | Fetch full issue metadata |
gh issue view <id> --json comments | Fetch all comments on an issue |
gh issue comment <id> --body "..." | Post a comment on an issue |
gh api repos/{owner}/{repo}/issues/comments/<id> -X PATCH -f body="..." | Edit an existing comment |
gh issue edit <id> --add-label "..." | Add labels |
gh issue edit <id> --remove-label "..." | Remove labels |
gh pr list --state open --search "..." | Search for open PRs |
gh pr create --title "..." --body "..." | Create a pull request |
gh api user --jq '.login' | Get current GitHub username |
mise run pre-commit | Run pre-commit checks (lint, format, license headers) |
mise run e2e:docker | Run smoke E2E against a standalone Docker-backed gateway |
mise run e2e:podman | Run smoke E2E against a Podman-backed gateway |
mise run e2e:vm | Run smoke E2E against the VM compute driver |
User says: "Plan issue #42"
state:accepted and agent:plan-requested are absent; warn that the issue does not match the queued workflow, then continue because the user directly requested planning🏗️ build-plan marker foundprincipal-engineer-reviewer for analysis🏗️ build-plan markeragent:* workflow labels unchangedUser says: "Check on issue #42"
User says: "Check issue #42"
User says: "Build issue #42"
state:accepted is present but agent:implementation-requested is absent; warn about the missing queue label and continue because the user directly requested implementationfeat/42-add-pagination/jmyersagent:* labels unchanged because this direct invocation was not picked up from the queuemise run pre-commit passes on first attempte2e/)Closes #42User says: "Build issue #42"
state:triage-needed; neither state:accepted nor agent:implementation-requested is presentUser says: "Build issue #42"
agent:pr-opened label presentUser says: "Build issue #99"