From d2df7e8408c68d1a305f1a9a05704413047235cc Mon Sep 17 00:00:00 2001 From: Kevin Kaminski MVP Date: Thu, 9 Apr 2026 13:06:18 -0600 Subject: [PATCH 01/11] Add OPSX OpenSpec workflows, specs, and handlers Introduce OPSX experimental workflow support and a large set of OpenSpec change artifacts. Adds command docs and skills for opsx (apply, archive, explore, propose) and corresponding SKILL.md files and prompts; bulk-imports many openspec change proposals, designs, specs and tasks; and adds openspec config. Implements numerous new feature handlers/types (agents, attachments, cycles, portfolio, subscriptions, webhooks, etc.), updates auth/GraphQL/client code, and augments tests. Also adds release/verify scripts, updates package.json, README and architecture, and adds CLAUDE.md and copilotapireview.md. These changes scaffold the OpenSpec-driven workflow and wire up server-side handlers and tests for the new capabilities. --- .claude/commands/opsx/apply.md | 152 ++ .claude/commands/opsx/archive.md | 157 ++ .claude/commands/opsx/explore.md | 173 ++ .claude/commands/opsx/propose.md | 106 + .claude/skills/openspec-apply-change/SKILL.md | 156 ++ .../skills/openspec-archive-change/SKILL.md | 114 ++ .claude/skills/openspec-explore/SKILL.md | 288 +++ .claude/skills/openspec-propose/SKILL.md | 110 ++ .codex/skills/openspec-apply-change/SKILL.md | 156 ++ .../skills/openspec-archive-change/SKILL.md | 114 ++ .codex/skills/openspec-explore/SKILL.md | 288 +++ .codex/skills/openspec-propose/SKILL.md | 110 ++ .crush/commands/opsx/apply.md | 152 ++ .crush/commands/opsx/archive.md | 157 ++ .crush/commands/opsx/explore.md | 173 ++ .crush/commands/opsx/propose.md | 106 + .crush/skills/openspec-apply-change/SKILL.md | 156 ++ .../skills/openspec-archive-change/SKILL.md | 114 ++ .crush/skills/openspec-explore/SKILL.md | 288 +++ .crush/skills/openspec-propose/SKILL.md | 110 ++ .github/prompts/opsx-apply.prompt.md | 149 ++ .github/prompts/opsx-archive.prompt.md | 154 ++ .github/prompts/opsx-explore.prompt.md | 170 ++ .github/prompts/opsx-propose.prompt.md | 103 + .github/skills/openspec-apply-change/SKILL.md | 156 ++ .../skills/openspec-archive-change/SKILL.md | 114 ++ .github/skills/openspec-explore/SKILL.md | 288 +++ .github/skills/openspec-propose/SKILL.md | 110 ++ CLAUDE.md | 61 + README.md | 409 ++-- architecture.md | 401 +--- copilotapireview.md | 558 ++++++ .../.openspec.yaml | 2 + .../add-comment-management-parity/design.md | 70 + .../add-comment-management-parity/proposal.md | 33 + .../comment-lifecycle-management/spec.md | 34 + .../specs/comment-thread-loading/spec.md | 27 + .../add-comment-management-parity/tasks.md | 16 + .../add-issue-workflow-parity/.openspec.yaml | 2 + .../add-issue-workflow-parity/design.md | 61 + .../add-issue-workflow-parity/proposal.md | 32 + .../specs/cycle-management/spec.md | 23 + .../issue-detail-and-mutation-parity/spec.md | 26 + .../specs/issue-relation-management/spec.md | 19 + .../spec.md | 19 + .../add-issue-workflow-parity/tasks.md | 17 + .../.openspec.yaml | 2 + .../design.md | 61 + .../proposal.md | 30 + .../specs/agent-api-alignment/spec.md | 19 + .../specs/portfolio-entity-support/spec.md | 12 + .../subscription-runtime-support/spec.md | 15 + .../specs/webhook-management/spec.md | 19 + .../tasks.md | 17 + .../.openspec.yaml | 2 + .../design.md | 61 + .../proposal.md | 33 + .../specs/attachment-management/spec.md | 26 + .../project-lifecycle-management/spec.md | 23 + .../specs/project-update-management/spec.md | 12 + .../specs/user-and-team-discovery/spec.md | 23 + .../tasks.md | 17 + .../.openspec.yaml | 2 + .../fix-17-expose-issue-hierarchy/design.md | 47 + .../fix-17-expose-issue-hierarchy/proposal.md | 23 + .../specs/issue-hierarchy-support/spec.md | 19 + .../fix-17-expose-issue-hierarchy/tasks.md | 14 + .../.openspec.yaml | 2 + .../design.md | 47 + .../proposal.md | 23 + .../issue-project-assignment-updates/spec.md | 19 + .../tasks.md | 14 + .../.openspec.yaml | 2 + .../design.md | 51 + .../proposal.md | 24 + .../remote-stream-transport-support/spec.md | 22 + .../tasks.md | 14 + .../.openspec.yaml | 2 + .../fix-23-add-initiative-support/design.md | 47 + .../fix-23-add-initiative-support/proposal.md | 25 + .../initiative-project-association/spec.md | 19 + .../fix-23-add-initiative-support/tasks.md | 14 + .../.openspec.yaml | 2 + .../design.md | 47 + .../proposal.md | 24 + .../linear-oauth-flow-correctness/spec.md | 22 + .../fix-24-correct-linear-oauth-flow/tasks.md | 14 + .../.openspec.yaml | 2 + .../design.md | 47 + .../proposal.md | 24 + .../specs/query-backed-issue-search/spec.md | 15 + .../tasks.md | 14 + .../.openspec.yaml | 2 + .../design.md | 47 + .../proposal.md | 25 + .../advertised-tool-surface-parity/spec.md | 15 + .../tasks.md | 14 + .../.openspec.yaml | 2 + .../design.md | 47 + .../proposal.md | 24 + .../spec.md | 15 + .../tasks.md | 14 + .../.openspec.yaml | 2 + .../stabilize-platform-fidelity/design.md | 77 + .../stabilize-platform-fidelity/proposal.md | 37 + .../specs/auth-session-lifecycle/spec.md | 33 + .../specs/graphql-response-fidelity/spec.md | 26 + .../specs/search-and-list-semantics/spec.md | 30 + .../specs/tool-contract-fidelity/spec.md | 26 + .../stabilize-platform-fidelity/tasks.md | 17 + openspec/config.yaml | 20 + package.json | 22 +- scripts/release-utils.mjs | 70 + scripts/verify-packaged-install.mjs | 77 + scripts/verify-tool-catalog.mjs | 55 + src/__tests__/auth-handler.test.ts | 23 + src/__tests__/auth.integration.test.ts | 10 +- src/__tests__/auth.test.ts | 59 +- src/__tests__/capabilities.test.ts | 48 + src/__tests__/comment-handler.test.ts | 401 ++++ src/__tests__/graphql-client.test.ts | 560 ++++-- src/__tests__/issue-handler.test.ts | 341 ++++ src/__tests__/project-handler.test.ts | 110 ++ src/__tests__/runtime-server.test.ts | 122 ++ src/__tests__/tool-contracts.test.ts | 104 + src/auth.ts | 244 ++- src/core/capabilities.ts | 95 + src/core/handlers/base.handler.ts | 206 +- src/core/handlers/handler.factory.ts | 123 +- src/core/interfaces/tool-handler.interface.ts | 47 +- src/core/types/tool.types.ts | 1707 ++++++++++------- src/features/agents/handlers/agent.handler.ts | 269 +++ src/features/agents/types/agent.types.ts | 29 + .../handlers/attachment.handler.ts | 186 ++ .../attachments/types/attachment.types.ts | 18 + src/features/auth/handlers/auth.handler.ts | 30 +- src/features/comments/comment.mapper.ts | 97 + .../comments/handlers/comment.handler.ts | 265 ++- src/features/comments/types/comment.types.ts | 164 +- src/features/cycles/handlers/cycle.handler.ts | 137 ++ src/features/cycles/types/cycle.types.ts | 15 + src/features/issues/handlers/issue.handler.ts | 632 ++++-- src/features/issues/types/issue.types.ts | 118 +- .../milestones/handlers/milestone.handler.ts | 134 +- .../portfolio/handlers/portfolio.handler.ts | 288 +++ .../portfolio/types/portfolio.types.ts | 33 + .../projects/handlers/project.handler.ts | 545 ++++-- src/features/projects/types/project.types.ts | 154 +- .../handlers/subscription.handler.ts | 86 + .../subscriptions/types/subscription.types.ts | 8 + src/features/teams/handlers/team.handler.ts | 285 ++- src/features/teams/types/team.types.ts | 79 +- src/features/users/handlers/user.handler.ts | 129 +- src/features/users/types/user.types.ts | 25 +- .../webhooks/handlers/webhook.handler.ts | 154 ++ src/features/webhooks/types/webhook.types.ts | 13 + src/graphql/client.ts | 440 ++++- src/graphql/mutations.ts | 116 +- src/graphql/queries.ts | 135 +- src/index.ts | 188 +- src/types/sdk.utils.ts | 105 + 161 files changed, 14741 insertions(+), 2280 deletions(-) create mode 100644 .claude/commands/opsx/apply.md create mode 100644 .claude/commands/opsx/archive.md create mode 100644 .claude/commands/opsx/explore.md create mode 100644 .claude/commands/opsx/propose.md create mode 100644 .claude/skills/openspec-apply-change/SKILL.md create mode 100644 .claude/skills/openspec-archive-change/SKILL.md create mode 100644 .claude/skills/openspec-explore/SKILL.md create mode 100644 .claude/skills/openspec-propose/SKILL.md create mode 100644 .codex/skills/openspec-apply-change/SKILL.md create mode 100644 .codex/skills/openspec-archive-change/SKILL.md create mode 100644 .codex/skills/openspec-explore/SKILL.md create mode 100644 .codex/skills/openspec-propose/SKILL.md create mode 100644 .crush/commands/opsx/apply.md create mode 100644 .crush/commands/opsx/archive.md create mode 100644 .crush/commands/opsx/explore.md create mode 100644 .crush/commands/opsx/propose.md create mode 100644 .crush/skills/openspec-apply-change/SKILL.md create mode 100644 .crush/skills/openspec-archive-change/SKILL.md create mode 100644 .crush/skills/openspec-explore/SKILL.md create mode 100644 .crush/skills/openspec-propose/SKILL.md create mode 100644 .github/prompts/opsx-apply.prompt.md create mode 100644 .github/prompts/opsx-archive.prompt.md create mode 100644 .github/prompts/opsx-explore.prompt.md create mode 100644 .github/prompts/opsx-propose.prompt.md create mode 100644 .github/skills/openspec-apply-change/SKILL.md create mode 100644 .github/skills/openspec-archive-change/SKILL.md create mode 100644 .github/skills/openspec-explore/SKILL.md create mode 100644 .github/skills/openspec-propose/SKILL.md create mode 100644 CLAUDE.md create mode 100644 copilotapireview.md create mode 100644 openspec/changes/add-comment-management-parity/.openspec.yaml create mode 100644 openspec/changes/add-comment-management-parity/design.md create mode 100644 openspec/changes/add-comment-management-parity/proposal.md create mode 100644 openspec/changes/add-comment-management-parity/specs/comment-lifecycle-management/spec.md create mode 100644 openspec/changes/add-comment-management-parity/specs/comment-thread-loading/spec.md create mode 100644 openspec/changes/add-comment-management-parity/tasks.md create mode 100644 openspec/changes/add-issue-workflow-parity/.openspec.yaml create mode 100644 openspec/changes/add-issue-workflow-parity/design.md create mode 100644 openspec/changes/add-issue-workflow-parity/proposal.md create mode 100644 openspec/changes/add-issue-workflow-parity/specs/cycle-management/spec.md create mode 100644 openspec/changes/add-issue-workflow-parity/specs/issue-detail-and-mutation-parity/spec.md create mode 100644 openspec/changes/add-issue-workflow-parity/specs/issue-relation-management/spec.md create mode 100644 openspec/changes/add-issue-workflow-parity/specs/workflow-state-and-label-management/spec.md create mode 100644 openspec/changes/add-issue-workflow-parity/tasks.md create mode 100644 openspec/changes/design-advanced-linear-integrations/.openspec.yaml create mode 100644 openspec/changes/design-advanced-linear-integrations/design.md create mode 100644 openspec/changes/design-advanced-linear-integrations/proposal.md create mode 100644 openspec/changes/design-advanced-linear-integrations/specs/agent-api-alignment/spec.md create mode 100644 openspec/changes/design-advanced-linear-integrations/specs/portfolio-entity-support/spec.md create mode 100644 openspec/changes/design-advanced-linear-integrations/specs/subscription-runtime-support/spec.md create mode 100644 openspec/changes/design-advanced-linear-integrations/specs/webhook-management/spec.md create mode 100644 openspec/changes/design-advanced-linear-integrations/tasks.md create mode 100644 openspec/changes/expand-project-collaboration-parity/.openspec.yaml create mode 100644 openspec/changes/expand-project-collaboration-parity/design.md create mode 100644 openspec/changes/expand-project-collaboration-parity/proposal.md create mode 100644 openspec/changes/expand-project-collaboration-parity/specs/attachment-management/spec.md create mode 100644 openspec/changes/expand-project-collaboration-parity/specs/project-lifecycle-management/spec.md create mode 100644 openspec/changes/expand-project-collaboration-parity/specs/project-update-management/spec.md create mode 100644 openspec/changes/expand-project-collaboration-parity/specs/user-and-team-discovery/spec.md create mode 100644 openspec/changes/expand-project-collaboration-parity/tasks.md create mode 100644 openspec/changes/fix-17-expose-issue-hierarchy/.openspec.yaml create mode 100644 openspec/changes/fix-17-expose-issue-hierarchy/design.md create mode 100644 openspec/changes/fix-17-expose-issue-hierarchy/proposal.md create mode 100644 openspec/changes/fix-17-expose-issue-hierarchy/specs/issue-hierarchy-support/spec.md create mode 100644 openspec/changes/fix-17-expose-issue-hierarchy/tasks.md create mode 100644 openspec/changes/fix-19-support-project-assignment-updates/.openspec.yaml create mode 100644 openspec/changes/fix-19-support-project-assignment-updates/design.md create mode 100644 openspec/changes/fix-19-support-project-assignment-updates/proposal.md create mode 100644 openspec/changes/fix-19-support-project-assignment-updates/specs/issue-project-assignment-updates/spec.md create mode 100644 openspec/changes/fix-19-support-project-assignment-updates/tasks.md create mode 100644 openspec/changes/fix-20-clarify-stream-transport-support/.openspec.yaml create mode 100644 openspec/changes/fix-20-clarify-stream-transport-support/design.md create mode 100644 openspec/changes/fix-20-clarify-stream-transport-support/proposal.md create mode 100644 openspec/changes/fix-20-clarify-stream-transport-support/specs/remote-stream-transport-support/spec.md create mode 100644 openspec/changes/fix-20-clarify-stream-transport-support/tasks.md create mode 100644 openspec/changes/fix-23-add-initiative-support/.openspec.yaml create mode 100644 openspec/changes/fix-23-add-initiative-support/design.md create mode 100644 openspec/changes/fix-23-add-initiative-support/proposal.md create mode 100644 openspec/changes/fix-23-add-initiative-support/specs/initiative-project-association/spec.md create mode 100644 openspec/changes/fix-23-add-initiative-support/tasks.md create mode 100644 openspec/changes/fix-24-correct-linear-oauth-flow/.openspec.yaml create mode 100644 openspec/changes/fix-24-correct-linear-oauth-flow/design.md create mode 100644 openspec/changes/fix-24-correct-linear-oauth-flow/proposal.md create mode 100644 openspec/changes/fix-24-correct-linear-oauth-flow/specs/linear-oauth-flow-correctness/spec.md create mode 100644 openspec/changes/fix-24-correct-linear-oauth-flow/tasks.md create mode 100644 openspec/changes/fix-30-repair-query-backed-issue-search/.openspec.yaml create mode 100644 openspec/changes/fix-30-repair-query-backed-issue-search/design.md create mode 100644 openspec/changes/fix-30-repair-query-backed-issue-search/proposal.md create mode 100644 openspec/changes/fix-30-repair-query-backed-issue-search/specs/query-backed-issue-search/spec.md create mode 100644 openspec/changes/fix-30-repair-query-backed-issue-search/tasks.md create mode 100644 openspec/changes/fix-31-sync-advertised-tool-surface/.openspec.yaml create mode 100644 openspec/changes/fix-31-sync-advertised-tool-surface/design.md create mode 100644 openspec/changes/fix-31-sync-advertised-tool-surface/proposal.md create mode 100644 openspec/changes/fix-31-sync-advertised-tool-surface/specs/advertised-tool-surface-parity/spec.md create mode 100644 openspec/changes/fix-31-sync-advertised-tool-surface/tasks.md create mode 100644 openspec/changes/fix-4-harden-marketplace-installation/.openspec.yaml create mode 100644 openspec/changes/fix-4-harden-marketplace-installation/design.md create mode 100644 openspec/changes/fix-4-harden-marketplace-installation/proposal.md create mode 100644 openspec/changes/fix-4-harden-marketplace-installation/specs/marketplace-installation-compatibility/spec.md create mode 100644 openspec/changes/fix-4-harden-marketplace-installation/tasks.md create mode 100644 openspec/changes/stabilize-platform-fidelity/.openspec.yaml create mode 100644 openspec/changes/stabilize-platform-fidelity/design.md create mode 100644 openspec/changes/stabilize-platform-fidelity/proposal.md create mode 100644 openspec/changes/stabilize-platform-fidelity/specs/auth-session-lifecycle/spec.md create mode 100644 openspec/changes/stabilize-platform-fidelity/specs/graphql-response-fidelity/spec.md create mode 100644 openspec/changes/stabilize-platform-fidelity/specs/search-and-list-semantics/spec.md create mode 100644 openspec/changes/stabilize-platform-fidelity/specs/tool-contract-fidelity/spec.md create mode 100644 openspec/changes/stabilize-platform-fidelity/tasks.md create mode 100644 openspec/config.yaml create mode 100644 scripts/release-utils.mjs create mode 100644 scripts/verify-packaged-install.mjs create mode 100644 scripts/verify-tool-catalog.mjs create mode 100644 src/__tests__/auth-handler.test.ts create mode 100644 src/__tests__/capabilities.test.ts create mode 100644 src/__tests__/comment-handler.test.ts create mode 100644 src/__tests__/issue-handler.test.ts create mode 100644 src/__tests__/project-handler.test.ts create mode 100644 src/__tests__/runtime-server.test.ts create mode 100644 src/__tests__/tool-contracts.test.ts create mode 100644 src/core/capabilities.ts create mode 100644 src/features/agents/handlers/agent.handler.ts create mode 100644 src/features/agents/types/agent.types.ts create mode 100644 src/features/attachments/handlers/attachment.handler.ts create mode 100644 src/features/attachments/types/attachment.types.ts create mode 100644 src/features/comments/comment.mapper.ts create mode 100644 src/features/cycles/handlers/cycle.handler.ts create mode 100644 src/features/cycles/types/cycle.types.ts create mode 100644 src/features/portfolio/handlers/portfolio.handler.ts create mode 100644 src/features/portfolio/types/portfolio.types.ts create mode 100644 src/features/subscriptions/handlers/subscription.handler.ts create mode 100644 src/features/subscriptions/types/subscription.types.ts create mode 100644 src/features/webhooks/handlers/webhook.handler.ts create mode 100644 src/features/webhooks/types/webhook.types.ts create mode 100644 src/types/sdk.utils.ts diff --git a/.claude/commands/opsx/apply.md b/.claude/commands/opsx/apply.md new file mode 100644 index 0000000..bf23721 --- /dev/null +++ b/.claude/commands/opsx/apply.md @@ -0,0 +1,152 @@ +--- +name: "OPSX: Apply" +description: Implement tasks from an OpenSpec change (Experimental) +category: Workflow +tags: [workflow, artifacts, experimental] +--- + +Implement tasks from an OpenSpec change. + +**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. + +**Steps** + +1. **Select the change** + + If a name is provided, use it. Otherwise: + - Infer from conversation context if the user mentioned a change + - Auto-select if only one active change exists + - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select + + Always announce: "Using change: " and how to override (e.g., `/opsx:apply `). + +2. **Check status to understand the schema** + ```bash + openspec status --change "" --json + ``` + Parse the JSON to understand: + - `schemaName`: The workflow being used (e.g., "spec-driven") + - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others) + +3. **Get apply instructions** + + ```bash + openspec instructions apply --change "" --json + ``` + + This returns: + - Context file paths (varies by schema) + - Progress (total, complete, remaining) + - Task list with status + - Dynamic instruction based on current state + + **Handle states:** + - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue` + - If `state: "all_done"`: congratulate, suggest archive + - Otherwise: proceed to implementation + +4. **Read context files** + + Read the files listed in `contextFiles` from the apply instructions output. + The files depend on the schema being used: + - **spec-driven**: proposal, specs, design, tasks + - Other schemas: follow the contextFiles from CLI output + +5. **Show current progress** + + Display: + - Schema being used + - Progress: "N/M tasks complete" + - Remaining tasks overview + - Dynamic instruction from CLI + +6. **Implement tasks (loop until done or blocked)** + + For each pending task: + - Show which task is being worked on + - Make the code changes required + - Keep changes minimal and focused + - Mark task complete in the tasks file: `- [ ]` → `- [x]` + - Continue to next task + + **Pause if:** + - Task is unclear → ask for clarification + - Implementation reveals a design issue → suggest updating artifacts + - Error or blocker encountered → report and wait for guidance + - User interrupts + +7. **On completion or pause, show status** + + Display: + - Tasks completed this session + - Overall progress: "N/M tasks complete" + - If all done: suggest archive + - If paused: explain why and wait for guidance + +**Output During Implementation** + +``` +## Implementing: (schema: ) + +Working on task 3/7: +[...implementation happening...] +✓ Task complete + +Working on task 4/7: +[...implementation happening...] +✓ Task complete +``` + +**Output On Completion** + +``` +## Implementation Complete + +**Change:** +**Schema:** +**Progress:** 7/7 tasks complete ✓ + +### Completed This Session +- [x] Task 1 +- [x] Task 2 +... + +All tasks complete! You can archive this change with `/opsx:archive`. +``` + +**Output On Pause (Issue Encountered)** + +``` +## Implementation Paused + +**Change:** +**Schema:** +**Progress:** 4/7 tasks complete + +### Issue Encountered + + +**Options:** +1.