Skip to content

feat(cli): expose Jira through the Orca CLI, with an orca-jira skill guide - #11986

Closed
dcieslak19973 wants to merge 3 commits into
stablyai:mainfrom
dcieslak19973:dcieslak19973/jira-cli-surface
Closed

dcieslak19973 wants to merge 3 commits into
stablyai:mainfrom
dcieslak19973:dcieslak19973/jira-cli-surface

Conversation

@dcieslak19973

@dcieslak19973 dcieslak19973 commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What: Agents can read and write Jira from the worktree CLI — 23 existing runtime RPCs exposed as orca jira commands, with a skill guide.
Risk: Purely additive CLI surface over existing RPCs; no transport or Jira-logic changes. Greptile: 5/5 "Safe to merge".
State: Rebased on main today (0 behind, 0 conflicts); all review-bot threads resolved; CLI suite green (707 tests).


Closes #11982.

Jira had 23 working runtime RPC methods and zero agent-reachable commands. A user could browse, create, and update Jira issues in the UI, but the agent in their worktree had no way to touch Jira. Every other agent-operable surface in Orca has a CLI handler — browser-*, computer, emulator, orchestration, automations, terminal, file, worktree, skills. Task providers were the only category with one provider wired and another not.

What this adds

CLI surface (src/cli/specs/jira.ts, handlers/jira.ts, jira-format.ts) — 17 commands over the existing jira.* RPC. No new transport or capability.

jira issue <key>                      jira status list <key>
jira list [--filter ...]              jira status set <key> --to <name>|--to-id <id>
jira search <jql>                     jira assignee list|set|clear <key>
jira create --project --type --title  jira priority list|set|clear <key>
jira project list|types               jira label set <key> --label <name>...
jira comment list|add <key>

Skill guide (skill-guides/orca-jira.md + stub) so agents discover the commands. Without it the CLI exists but goes unused.

Notable decisions

Calls jira.* directly rather than adding a jira.agent* layer. Linear's CLI goes through a dedicated agent-access surface (linear.agentSearchIssues, linear.issueContext). That layer is not mandatory — automation.*, browser.*, and accounts.* handlers all call plain methods. Linear's extra layer buys multi-workspace fan-out and warning aggregation, which this surface does not have yet. Happy to add one if maintainers prefer the Linear shape.

status set --to resolves transitions client-side. Jira validates transitions against the issue's current status, so --to "In Review" lists the issue's transitions and matches on either the transition name or destination status name. When nothing matches, the error enumerates what is available. --to-id skips the lookup. This is the piece that makes Jira usable in an automated loop — valid next states are enumerable rather than guessed.

ok:false bodies become CLI errors. Jira reports some write failures inside a 200 response; those raise instead of printing a success line, so a non-zero exit means the write did not land.

Vocabulary policy. Single-item read is a bare positional (jira issue <key>), matching linear issue and avoiding the get → show rule. Incremental label edits are deliberately omitted — linear label remove is grandfathered in the deletion-family allowlist, so a new jira label remove would be a fresh violation. Only label set ships.

Scope correction vs the issue

#11982 asked for jira-tickets.md and orca-jira.md. Only orca-jira is here. linear-tickets is explicitly a legacy bundled alias for orca-linear kept for existing installs, and the alias ledger in generate-bundled-skill-guides.mjs is append-only — minting jira-tickets would permanently register a legacy name that never had one.

Deliberately out of scope

Issue relations (links, subtasks, epic links) and an issue-context fan-out layer for rich agent prompts. Linear has both; Jira has neither. Those are a larger design conversation, likely tied to the generic task-source contract in #8376 / #8980.

Verification

Check Result
src/cli suite 703 passed, 28 skipped, 0 failed
New jira.test.ts 11 passed
registry-parity / handler-manifest / vocabulary-policy 22 passed
verify:bundled-skill-guides / verify:skill-bundle-manifest exit 0
tsc --noEmit (CLI project) clean
oxlint + both code-quality audits (--deny-warnings) clean
max-lines ratchet OK, no new bypasses

Cloud and Server/DC endpoint branching already exists in src/main/jira/issues.ts, so these commands should work against both without provider-specific paths. I have not exercised Server/DC.

Two notes on my Windows dev box, both confirmed pre-existing on an unrelated branch: src/main/skills has 3 failures (symlink elevation, git write-tree CRLF), and check-changed-code-quality.mjs dies with spawnSync pnpm.cmd EINVAL under Node 24 — I ran the two oxlint audits it wraps directly instead.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR wires Jira into the Orca CLI via 17 new commands (jira issue, jira search, jira create, jira status set, etc.) backed by the existing jira.* RPC surface, and ships the matching orca-jira skill guide so agents can discover and use the commands. No new transport or capability is introduced — the CLI is the only new layer.

  • CLI surface (specs/jira.ts, handlers/jira.ts, jira-format.ts): All 17 handlers call existing jira.* RPC methods; ok:false mutation bodies are promoted to CLI errors; the status set transition resolver correctly handles exact-match, ambiguous, and no-match cases; the label set guard rejects an empty --label list before any RPC call.
  • Skill guide (skill-guides/orca-jira.md, skill-stubs/orca-jira.md): Covers preconditions, untrusted-input policy, transition semantics, site scoping, completion flow, and error recovery; registered in the skill manifest and bundled-guide scripts.
  • Registry wiring (current-manifest.json, snapshot-registry.json, generate-bundled-skill-guides.mjs, bundled-skill-guides.ts, handler-group-manifest.ts): All consistency checks (handler-manifest, registry-parity, vocabulary-policy) pass per the PR's verification table.

Confidence Score: 5/5

Safe to merge; all write paths guard ok:false responses, the label-set regression is fixed, and the transition resolver handles ambiguity and no-match correctly.

The change is additive CLI surface over an existing RPC layer with no schema or transport modifications. The label-set guard, transition disambiguation logic, and ok:false promotion are all exercised by the test suite. The one gap — no test for comment add with an ok:false response — is isolated and does not affect correctness of other commands.

Files Needing Attention: No files require special attention; the comment add ok:false path in handlers/jira.ts is the only untested branch.

Important Files Changed

Filename Overview
src/cli/handlers/jira.ts 17 Jira command handlers over existing jira.* RPC; label-set guard, ok:false promotion to errors, and ambiguous-transition handling all correct. comment add ok:false path has no dedicated test.
src/cli/handlers/jira.test.ts 14 tests covering transition resolution, label-set guard, ok:false errors, and create success/failure; missing coverage for comment add ok:false and status set with neither --to nor --to-id.
src/cli/jira-format.ts Formatters for all 7 result shapes; formatJiraCreate correctly accepts only the ok:true branch, matching the handler's invariant.
src/cli/specs/jira.ts 17 command specs; allowedFlags, positionalArgs, and usage strings are consistent with handlers and skill guide.
src/cli/handler-group-manifest.ts Jira handler group added with all 17 keys matching the exported JIRA_HANDLERS record; drift detection is CI-enforced.
skill-guides/orca-jira.md Comprehensive agent-facing guide covering preconditions, untrusted-input warnings, transition semantics, completion flow, and error recovery.
src/cli/specs/index.ts JIRA_COMMAND_SPECS correctly wired into the main COMMAND_SPECS array.

Sequence Diagram

sequenceDiagram
    participant Agent
    participant CLI as orca jira CLI
    participant Dispatch as Handler Dispatch
    participant RPC as jira.* RPC

    Agent->>CLI: orca jira status set ENG-1 --to "In Review"
    CLI->>Dispatch: route → jira status set handler
    Dispatch->>RPC: "jira.listTransitions {key, siteId}"
    RPC-->>Dispatch: "[{id, name, to.name}, ...]"
    Note over Dispatch: match --to against name/to.name<br/>ambiguous → error, none → error
    Dispatch->>RPC: "jira.updateIssue {key, siteId, updates:{transitionId}}"
    RPC-->>Dispatch: "{ok: true} | {ok: false, error}"
    Note over Dispatch: ok:false → RuntimeClientError
    Dispatch-->>Agent: Updated ENG-1 (exit 0)

    Agent->>CLI: orca jira label set ENG-1 --label backend
    CLI->>Dispatch: route → jira label set handler
    Note over Dispatch: labels.length === 0 → throw before RPC
    Dispatch->>RPC: "jira.updateIssue {key, siteId, updates:{labels}}"
    RPC-->>Dispatch: "{ok: true}"
    Dispatch-->>Agent: Updated ENG-1 (exit 0)
Loading

Reviews (4): Last reviewed commit: "refactor(cli): drop unreachable failure ..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added Jira CLI specifications, lazy handler registration, issue and metadata operations, transition handling, mutation support, output formatting, and automated tests. Added the orca-jira guide and bundled guide registration. Added discovery stubs with executable resolution, version-matched guide loading, JSON guidance, restricted fallback behavior, and manifest and snapshot registry entries.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the change and testing, but it omits the required Security Audit section and does not fully document the required cross-platform AI review. Add the required template sections, especially Security Audit, and document explicit macOS, Linux, and Windows compatibility checks covering paths, shell behavior, labels, shortcuts, and Electron differences.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR adds the requested Jira CLI coverage and canonical skill guide over existing RPC methods, while preserving the stated exclusions.
Out of Scope Changes check ✅ Passed The code, tests, registries, formatters, command specifications, and skill documentation all support the Jira CLI objective.
Title check ✅ Passed The title clearly and concisely describes the new Jira CLI surface and accompanying skill guide.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/cli/handlers/jira.ts (1)

177-181: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Drop the unnecessary type cast in the comment-add handler.

applyUpdate handles the same JiraMutationResult with the same if (!response.result.ok) throw guard and passes response directly to printResult. This handler does the same, so remove the misleading assertion.

♻️ Proposed fix to remove the cast
-    printResult(
-      response as { result: { ok: true } } & typeof response,
-      ctx.json,
-      () => `Commented on ${key}`
-    )
+    printResult(response, ctx.json, () => `Commented on ${key}`)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 753b132a-7232-4c79-9b97-604991c168ea

📥 Commits

Reviewing files that changed from the base of the PR and between 16c5526 and fdd97459453d8c7cf92b009ff1a0daf02c47e7c4.

📒 Files selected for processing (13)
  • config/scripts/generate-bundled-skill-guides.mjs
  • resources/skills/current-manifest.json
  • resources/skills/snapshot-registry.json
  • skill-guides/orca-jira.md
  • skill-stubs/orca-jira.md
  • skills/orca-jira/SKILL.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/handler-group-manifest.ts
  • src/cli/handlers/jira.test.ts
  • src/cli/handlers/jira.ts
  • src/cli/jira-format.ts
  • src/cli/specs/index.ts
  • src/cli/specs/jira.ts

Comment thread src/cli/handlers/jira.ts Resolved
Comment thread src/cli/handlers/jira.ts Resolved
@dcieslak19973
dcieslak19973 force-pushed the dcieslak19973/jira-cli-surface branch 2 times, most recently from f66ad45 to 79872d6 Compare August 3, 2026 15:16
@dcieslak19973
dcieslak19973 force-pushed the dcieslak19973/jira-cli-surface branch 5 times, most recently from 9386301 to c3a285e Compare August 7, 2026 02:32
@dcieslak19973
dcieslak19973 force-pushed the dcieslak19973/jira-cli-surface branch from fdacfd5 to 7cb08d5 Compare August 19, 2026 01:39
@nwparker nwparker removed the P2 label Aug 19, 2026
@dcieslak19973
dcieslak19973 force-pushed the dcieslak19973/jira-cli-surface branch from 7cb08d5 to a0315a0 Compare August 22, 2026 21:43
@dcieslak19973
dcieslak19973 force-pushed the dcieslak19973/jira-cli-surface branch 2 times, most recently from 8c9c6bf to 36a930c Compare September 11, 2026 13:37
- Register 'jira' in CLI_COMMAND_NAMES so the launch redirect matches
  COMMAND_SPECS (cli-command-name-parity.test.ts).
- Trim the orca-jira skill description below the angle-bracket
  placeholder rule and move the detailed command examples into the
  guide body (skill-description-length.test.mjs).
- Rewrite skill-guides/orca-jira.md to use the ORCA placeholder and
  state the shared-resolver sentence, mirroring orca-linear.md
  (generate-bundled-skill-guides.test.mjs).
- Regenerate skills/orca-jira/SKILL.md, src/cli/bundled-skill-guides.ts
  (generate-bundled-skill-guides.mjs --write) and
  resources/skills/{current-manifest,snapshot-registry}.json
  (generate-skill-bundle-manifest.mjs --write) so the registered
  gitTreeSha matches the observed skill tree
  (skill-git-tree-identity.test.ts).
@dcieslak19973
dcieslak19973 force-pushed the dcieslak19973/jira-cli-surface branch from 36a930c to ce3ec54 Compare September 26, 2026 15:14
nwparker added a commit that referenced this pull request Oct 14, 2026
Expose host-owned verified Jira reads and single-attempt writes through the CLI. Preserve site ambiguity checks, old-host capability refusal, atomic label changes, and uncertainty after failed writes.

Refs #11986 and #26055.

Co-authored-by: Dan Cieslak <[email protected]>
Co-authored-by: kokbee <[email protected]>
@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#11982) has been resolved on main by #28592 (7ac2dcc7d4), #28619 (6d04aea3f1). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Jira has no CLI surface — agents can't read or write Jira issues

4 participants