Perform code optimization and document cleanup (#1)
## Summary - add repository-wide quality tooling and verification scaffolding, including CI workflows, pnpm workspace setup, ESLint/Prettier/markdown checks, and generated-output verification helpers - reorganize skill sources and generation flow by introducing canonical `_source` variants, generator/manifests, reusable helper abstractions, and shared web-automation/browser utilities - clean up and expand documentation so the root README flows into docs and skill docs, with clearer development, reviewer, installer, and workflow guidance ## Notable changes - docs flow and consistency cleanup across `README.md`, `docs/README.md`, and related docs - new scripts for `check`, docs verification, generated-file verification, shell portability, and safe directory replacement - refactors in Atlassian and web-automation skill runtimes to reduce duplication and centralize reusable code - changelog, development documentation, and CI surface updates ## Test Plan - [ ] `pnpm run check` - [ ] review generated/manifests and skill sync outputs - [ ] smoke-check docs flow from `README.md` to `docs/README.md` to skill docs ## Notes - this branch currently includes tracked `skills/web-automation/shared/node_modules` content that should be reviewed carefully as potentially noisy/accidental committed artifacts Co-authored-by: Stefano Fiorini <stefano.fiorini@firsthorizon.com> Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
---
|
||||
name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
# Atlassian (Claude Code)
|
||||
|
||||
Portable Atlassian workflows for Claude Code using a shared TypeScript CLI.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 20+
|
||||
- `pnpm`
|
||||
- Atlassian Cloud account access
|
||||
- `ATLASSIAN_BASE_URL`
|
||||
- `ATLASSIAN_EMAIL`
|
||||
- `ATLASSIAN_API_TOKEN`
|
||||
|
||||
The `ATLASSIAN_*` values may come from the shell environment or a `.env` file in `~/.claude/skills/atlassian/scripts`.
|
||||
|
||||
## First-Time Setup
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.claude/skills/atlassian
|
||||
cp -R skills/atlassian/claude-code/* ~/.claude/skills/atlassian/
|
||||
cd ~/.claude/skills/atlassian/scripts
|
||||
pnpm install
|
||||
```
|
||||
|
||||
## Prerequisite Check (MANDATORY)
|
||||
|
||||
```bash
|
||||
cd ~/.claude/skills/atlassian/scripts
|
||||
node -e "require.resolve('commander');require.resolve('dotenv');console.log('OK: runtime dependencies installed')"
|
||||
node -e 'require("dotenv").config({ path: ".env" }); const required = ["ATLASSIAN_BASE_URL", "ATLASSIAN_EMAIL", "ATLASSIAN_API_TOKEN"]; const missing = required.filter((key) => !(process.env[key] || "").trim()); if (missing.length) { console.error("Missing required Atlassian config: " + missing.join(", ")); process.exit(1); } console.log("OK: Atlassian config present")'
|
||||
pnpm atlassian health
|
||||
```
|
||||
|
||||
If any check fails, stop and return:
|
||||
|
||||
`Missing dependency/config: atlassian requires installed CLI dependencies and valid Atlassian Cloud credentials. Configure ATLASSIAN_* in the shell environment or scripts/.env, then retry.`
|
||||
|
||||
## Supported Commands
|
||||
|
||||
- `pnpm atlassian health`
|
||||
- `pnpm atlassian jira-search --jql "..."`
|
||||
- `pnpm atlassian jira-get --issue ABC-123`
|
||||
- `pnpm atlassian jira-create ... [--dry-run]`
|
||||
- `pnpm atlassian jira-update ... [--dry-run]`
|
||||
- `pnpm atlassian jira-comment ... [--dry-run]`
|
||||
- `pnpm atlassian jira-transitions --issue ABC-123`
|
||||
- `pnpm atlassian jira-transition ... [--dry-run]`
|
||||
- `pnpm atlassian conf-search --query "..."`
|
||||
- `pnpm atlassian conf-get --page 12345`
|
||||
- `pnpm atlassian conf-create ... [--dry-run]`
|
||||
- `pnpm atlassian conf-update ... [--dry-run]`
|
||||
- `pnpm atlassian conf-comment ... [--dry-run]`
|
||||
- `pnpm atlassian conf-children --page 12345`
|
||||
- `pnpm atlassian raw --product jira|confluence --method GET|POST|PUT --path ...`
|
||||
|
||||
## Usage Examples
|
||||
|
||||
- `pnpm atlassian jira-search --jql "project = ENG ORDER BY updated DESC" --max-results 10`
|
||||
- `pnpm atlassian conf-comment --page 12345 --body-file comment.storage.html --dry-run`
|
||||
- `pnpm atlassian raw --product jira --method GET --path "/rest/api/3/issue/ENG-123"`
|
||||
|
||||
## Safety Rules
|
||||
|
||||
- Default output is JSON; only switch to text output when the user needs a human-readable summary.
|
||||
- Use `--dry-run` before any write unless the user clearly asked for the mutation.
|
||||
- Treat `raw` as an escape hatch, not the default API surface.
|
||||
- `--body-file` must stay inside the current workspace.
|
||||
- Confluence write bodies should be storage-format inputs in v1.
|
||||
|
||||
## Notes
|
||||
|
||||
- Atlassian Cloud is the primary supported platform in v1.
|
||||
- The portable CLI exists so the same skill works consistently across multiple agent environments.
|
||||
@@ -0,0 +1,81 @@
|
||||
---
|
||||
name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
# Atlassian (Codex)
|
||||
|
||||
Portable Atlassian workflows for Codex using a shared TypeScript CLI.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 20+
|
||||
- `pnpm`
|
||||
- Atlassian Cloud account access
|
||||
- `ATLASSIAN_BASE_URL`
|
||||
- `ATLASSIAN_EMAIL`
|
||||
- `ATLASSIAN_API_TOKEN`
|
||||
|
||||
The `ATLASSIAN_*` values may come from the shell environment or a `.env` file in `~/.codex/skills/atlassian/scripts`.
|
||||
|
||||
## First-Time Setup
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.codex/skills/atlassian
|
||||
cp -R skills/atlassian/codex/* ~/.codex/skills/atlassian/
|
||||
cd ~/.codex/skills/atlassian/scripts
|
||||
pnpm install
|
||||
```
|
||||
|
||||
## Prerequisite Check (MANDATORY)
|
||||
|
||||
Run before using the skill:
|
||||
|
||||
```bash
|
||||
cd ~/.codex/skills/atlassian/scripts
|
||||
node -e "require.resolve('commander');require.resolve('dotenv');console.log('OK: runtime dependencies installed')"
|
||||
node -e 'require("dotenv").config({ path: ".env" }); const required = ["ATLASSIAN_BASE_URL", "ATLASSIAN_EMAIL", "ATLASSIAN_API_TOKEN"]; const missing = required.filter((key) => !(process.env[key] || "").trim()); if (missing.length) { console.error("Missing required Atlassian config: " + missing.join(", ")); process.exit(1); } console.log("OK: Atlassian config present")'
|
||||
pnpm atlassian health
|
||||
```
|
||||
|
||||
If any check fails, stop and return:
|
||||
|
||||
`Missing dependency/config: atlassian requires installed CLI dependencies and valid Atlassian Cloud credentials. Configure ATLASSIAN_* in the shell environment or scripts/.env, then retry.`
|
||||
|
||||
## Supported Commands
|
||||
|
||||
- `pnpm atlassian health`
|
||||
- `pnpm atlassian jira-search --jql "..."`
|
||||
- `pnpm atlassian jira-get --issue ABC-123`
|
||||
- `pnpm atlassian jira-create ... [--dry-run]`
|
||||
- `pnpm atlassian jira-update ... [--dry-run]`
|
||||
- `pnpm atlassian jira-comment ... [--dry-run]`
|
||||
- `pnpm atlassian jira-transitions --issue ABC-123`
|
||||
- `pnpm atlassian jira-transition ... [--dry-run]`
|
||||
- `pnpm atlassian conf-search --query "..."`
|
||||
- `pnpm atlassian conf-get --page 12345`
|
||||
- `pnpm atlassian conf-create ... [--dry-run]`
|
||||
- `pnpm atlassian conf-update ... [--dry-run]`
|
||||
- `pnpm atlassian conf-comment ... [--dry-run]`
|
||||
- `pnpm atlassian conf-children --page 12345`
|
||||
- `pnpm atlassian raw --product jira|confluence --method GET|POST|PUT --path ...`
|
||||
|
||||
## Usage Examples
|
||||
|
||||
- `pnpm atlassian jira-search --jql "project = ENG ORDER BY updated DESC" --max-results 10`
|
||||
- `pnpm atlassian conf-update --page 12345 --title "Runbook" --body-file page.storage.html --dry-run`
|
||||
- `pnpm atlassian raw --product confluence --method POST --path "/wiki/api/v2/pages" --body-file page.json --dry-run`
|
||||
|
||||
## Safety Rules
|
||||
|
||||
- Default output is JSON; prefer that for agent workflows.
|
||||
- Use `--dry-run` before any mutating command unless the user clearly wants the write to happen immediately.
|
||||
- Jira long-text fields are converted to ADF locally.
|
||||
- Confluence page bodies are storage-first in v1.
|
||||
- `--body-file` must point to workspace-scoped files only; do not use arbitrary system paths.
|
||||
- `raw` is for explicit edge cases only and does not allow `DELETE`.
|
||||
|
||||
## Notes
|
||||
|
||||
- Atlassian Cloud is the only first-class target in v1.
|
||||
- This skill exists so Codex, Claude Code, Cursor Agent, and OpenCode can share the same command surface even when MCP access differs.
|
||||
@@ -0,0 +1,93 @@
|
||||
---
|
||||
name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
# Atlassian (Cursor Agent CLI)
|
||||
|
||||
Portable Atlassian workflows for Cursor Agent CLI using a shared TypeScript CLI.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Cursor Agent CLI skill discovery via `.cursor/skills/` or `~/.cursor/skills/`
|
||||
- Node.js 20+
|
||||
- `pnpm`
|
||||
- Atlassian Cloud account access
|
||||
- `ATLASSIAN_BASE_URL`
|
||||
- `ATLASSIAN_EMAIL`
|
||||
- `ATLASSIAN_API_TOKEN`
|
||||
|
||||
The `ATLASSIAN_*` values may come from the shell environment or a `.env` file in the installed `scripts/` folder.
|
||||
|
||||
## First-Time Setup
|
||||
|
||||
Repo-local install:
|
||||
|
||||
```bash
|
||||
mkdir -p .cursor/skills/atlassian
|
||||
cp -R skills/atlassian/cursor/* .cursor/skills/atlassian/
|
||||
cd .cursor/skills/atlassian/scripts
|
||||
pnpm install
|
||||
```
|
||||
|
||||
Global install:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.cursor/skills/atlassian
|
||||
cp -R skills/atlassian/cursor/* ~/.cursor/skills/atlassian/
|
||||
cd ~/.cursor/skills/atlassian/scripts
|
||||
pnpm install
|
||||
```
|
||||
|
||||
## Prerequisite Check (MANDATORY)
|
||||
|
||||
Repo-local form:
|
||||
|
||||
```bash
|
||||
cursor-agent --version
|
||||
cd .cursor/skills/atlassian/scripts
|
||||
node -e "require.resolve('commander');require.resolve('dotenv');console.log('OK: runtime dependencies installed')"
|
||||
node -e 'require("dotenv").config({ path: ".env" }); const required = ["ATLASSIAN_BASE_URL", "ATLASSIAN_EMAIL", "ATLASSIAN_API_TOKEN"]; const missing = required.filter((key) => !(process.env[key] || "").trim()); if (missing.length) { console.error("Missing required Atlassian config: " + missing.join(", ")); process.exit(1); } console.log("OK: Atlassian config present")'
|
||||
pnpm atlassian health
|
||||
```
|
||||
|
||||
If any check fails, stop and return:
|
||||
|
||||
`Missing dependency/config: atlassian requires installed CLI dependencies and valid Atlassian Cloud credentials. Configure ATLASSIAN_* in the shell environment or scripts/.env, then retry.`
|
||||
|
||||
## Supported Commands
|
||||
|
||||
- `pnpm atlassian health`
|
||||
- `pnpm atlassian jira-search --jql "..."`
|
||||
- `pnpm atlassian jira-get --issue ABC-123`
|
||||
- `pnpm atlassian jira-create ... [--dry-run]`
|
||||
- `pnpm atlassian jira-update ... [--dry-run]`
|
||||
- `pnpm atlassian jira-comment ... [--dry-run]`
|
||||
- `pnpm atlassian jira-transitions --issue ABC-123`
|
||||
- `pnpm atlassian jira-transition ... [--dry-run]`
|
||||
- `pnpm atlassian conf-search --query "..."`
|
||||
- `pnpm atlassian conf-get --page 12345`
|
||||
- `pnpm atlassian conf-create ... [--dry-run]`
|
||||
- `pnpm atlassian conf-update ... [--dry-run]`
|
||||
- `pnpm atlassian conf-comment ... [--dry-run]`
|
||||
- `pnpm atlassian conf-children --page 12345`
|
||||
- `pnpm atlassian raw --product jira|confluence --method GET|POST|PUT --path ...`
|
||||
|
||||
## Usage Examples
|
||||
|
||||
- `pnpm atlassian jira-get --issue ENG-123`
|
||||
- `pnpm atlassian conf-search --query "title ~ \\\"Runbook\\\"" --max-results 10 --start-at 0`
|
||||
- `pnpm atlassian raw --product confluence --method POST --path "/wiki/api/v2/pages" --body-file page.json --dry-run`
|
||||
|
||||
## Safety Rules
|
||||
|
||||
- Prefer JSON output for agent use.
|
||||
- Use `--dry-run` before writes unless the user explicitly wants the change applied.
|
||||
- Keep `--body-file` inputs within the current workspace.
|
||||
- Use `raw` only for user-requested unsupported endpoints.
|
||||
- `raw` does not allow `DELETE`.
|
||||
|
||||
## Notes
|
||||
|
||||
- Cursor discovers this skill from `.cursor/skills/` or `~/.cursor/skills/`.
|
||||
- Atlassian Cloud is the supported platform in v1.
|
||||
@@ -0,0 +1,78 @@
|
||||
---
|
||||
name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
# Atlassian (OpenCode)
|
||||
|
||||
Portable Atlassian workflows for OpenCode using a shared TypeScript CLI.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 20+
|
||||
- `pnpm`
|
||||
- Atlassian Cloud account access
|
||||
- `ATLASSIAN_BASE_URL`
|
||||
- `ATLASSIAN_EMAIL`
|
||||
- `ATLASSIAN_API_TOKEN`
|
||||
|
||||
The `ATLASSIAN_*` values may come from the shell environment or a `.env` file in `~/.config/opencode/skills/atlassian/scripts`.
|
||||
|
||||
## First-Time Setup
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.config/opencode/skills/atlassian
|
||||
cp -R skills/atlassian/opencode/* ~/.config/opencode/skills/atlassian/
|
||||
cd ~/.config/opencode/skills/atlassian/scripts
|
||||
pnpm install
|
||||
```
|
||||
|
||||
## Prerequisite Check (MANDATORY)
|
||||
|
||||
```bash
|
||||
cd ~/.config/opencode/skills/atlassian/scripts
|
||||
node -e "require.resolve('commander');require.resolve('dotenv');console.log('OK: runtime dependencies installed')"
|
||||
node -e 'require("dotenv").config({ path: ".env" }); const required = ["ATLASSIAN_BASE_URL", "ATLASSIAN_EMAIL", "ATLASSIAN_API_TOKEN"]; const missing = required.filter((key) => !(process.env[key] || "").trim()); if (missing.length) { console.error("Missing required Atlassian config: " + missing.join(", ")); process.exit(1); } console.log("OK: Atlassian config present")'
|
||||
pnpm atlassian health
|
||||
```
|
||||
|
||||
If any check fails, stop and return:
|
||||
|
||||
`Missing dependency/config: atlassian requires installed CLI dependencies and valid Atlassian Cloud credentials. Configure ATLASSIAN_* in the shell environment or scripts/.env, then retry.`
|
||||
|
||||
## Supported Commands
|
||||
|
||||
- `pnpm atlassian health`
|
||||
- `pnpm atlassian jira-search --jql "..."`
|
||||
- `pnpm atlassian jira-get --issue ABC-123`
|
||||
- `pnpm atlassian jira-create ... [--dry-run]`
|
||||
- `pnpm atlassian jira-update ... [--dry-run]`
|
||||
- `pnpm atlassian jira-comment ... [--dry-run]`
|
||||
- `pnpm atlassian jira-transitions --issue ABC-123`
|
||||
- `pnpm atlassian jira-transition ... [--dry-run]`
|
||||
- `pnpm atlassian conf-search --query "..."`
|
||||
- `pnpm atlassian conf-get --page 12345`
|
||||
- `pnpm atlassian conf-create ... [--dry-run]`
|
||||
- `pnpm atlassian conf-update ... [--dry-run]`
|
||||
- `pnpm atlassian conf-comment ... [--dry-run]`
|
||||
- `pnpm atlassian conf-children --page 12345`
|
||||
- `pnpm atlassian raw --product jira|confluence --method GET|POST|PUT --path ...`
|
||||
|
||||
## Usage Examples
|
||||
|
||||
- `pnpm atlassian jira-transition --issue ENG-123 --transition 31 --dry-run`
|
||||
- `pnpm atlassian conf-create --space OPS --title "Runbook" --body-file page.storage.html --dry-run`
|
||||
- `pnpm atlassian raw --product jira --method GET --path "/rest/api/3/issue/ENG-123"`
|
||||
|
||||
## Safety Rules
|
||||
|
||||
- Prefer JSON output for machine consumption.
|
||||
- Use `--dry-run` on writes unless the user explicitly asks to commit the remote mutation.
|
||||
- Restrict `--body-file` to project files.
|
||||
- Use `raw` only for unsupported edge cases.
|
||||
- `DELETE` is intentionally unsupported in raw mode.
|
||||
|
||||
## Notes
|
||||
|
||||
- Atlassian Cloud is first-class in v1; Data Center support is future work.
|
||||
- The CLI contract is shared across all agent variants so the same usage pattern works everywhere.
|
||||
@@ -0,0 +1,99 @@
|
||||
---
|
||||
name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
# Atlassian (Pi)
|
||||
|
||||
Portable Atlassian workflows for pi using the shared TypeScript CLI in `scripts/`.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 20+
|
||||
- `pnpm`
|
||||
- Atlassian Cloud account access
|
||||
- `ATLASSIAN_BASE_URL`
|
||||
- `ATLASSIAN_EMAIL`
|
||||
- `ATLASSIAN_API_TOKEN`
|
||||
|
||||
The `ATLASSIAN_*` values may come from the shell environment or a `.env` file in the installed skill's `scripts/` directory.
|
||||
|
||||
## First-Time Setup
|
||||
|
||||
Global install:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.pi/agent/skills/atlassian
|
||||
cp -R skills/atlassian/pi/* ~/.pi/agent/skills/atlassian/
|
||||
cd ~/.pi/agent/skills/atlassian/scripts
|
||||
pnpm install
|
||||
```
|
||||
|
||||
Project-local install:
|
||||
|
||||
```bash
|
||||
mkdir -p .pi/skills/atlassian
|
||||
cp -R skills/atlassian/pi/* .pi/skills/atlassian/
|
||||
cd .pi/skills/atlassian/scripts
|
||||
pnpm install
|
||||
```
|
||||
|
||||
Pi can also load this repo through settings or package installs as documented in [docs/PI.md](../../../docs/PI.md).
|
||||
|
||||
If you installed this repo from a local checkout with `./scripts/install-pi-package.sh`, the runtime stays in the checkout mirror at `pi-package/skills/atlassian/scripts`.
|
||||
|
||||
## Prerequisite Check (MANDATORY)
|
||||
|
||||
Run inside the skill runtime directory that matches your install style:
|
||||
|
||||
- local checkout package install: `pi-package/skills/atlassian/scripts`
|
||||
- project-local copied install: `.pi/skills/atlassian/scripts`
|
||||
- global copied install: `~/.pi/agent/skills/atlassian/scripts`
|
||||
|
||||
```bash
|
||||
cd pi-package/skills/atlassian/scripts
|
||||
node -e "require.resolve('commander');require.resolve('dotenv');console.log('OK: runtime dependencies installed')"
|
||||
node -e 'require("dotenv").config({ path: ".env" }); const required = ["ATLASSIAN_BASE_URL", "ATLASSIAN_EMAIL", "ATLASSIAN_API_TOKEN"]; const missing = required.filter((key) => !(process.env[key] || "").trim()); if (missing.length) { console.error("Missing required Atlassian config: " + missing.join(", ")); process.exit(1); } console.log("OK: Atlassian config present")'
|
||||
pnpm atlassian health
|
||||
```
|
||||
|
||||
If any check fails, stop and return:
|
||||
|
||||
`Missing dependency/config: atlassian requires installed CLI dependencies and valid Atlassian Cloud credentials. Configure ATLASSIAN_* in the shell environment or scripts/.env, then retry.`
|
||||
|
||||
## Supported Commands
|
||||
|
||||
- `pnpm atlassian health`
|
||||
- `pnpm atlassian jira-search --jql "..."`
|
||||
- `pnpm atlassian jira-get --issue ABC-123`
|
||||
- `pnpm atlassian jira-create ... [--dry-run]`
|
||||
- `pnpm atlassian jira-update ... [--dry-run]`
|
||||
- `pnpm atlassian jira-comment ... [--dry-run]`
|
||||
- `pnpm atlassian jira-transitions --issue ABC-123`
|
||||
- `pnpm atlassian jira-transition ... [--dry-run]`
|
||||
- `pnpm atlassian conf-search --query "..."`
|
||||
- `pnpm atlassian conf-get --page 12345`
|
||||
- `pnpm atlassian conf-create ... [--dry-run]`
|
||||
- `pnpm atlassian conf-update ... [--dry-run]`
|
||||
- `pnpm atlassian conf-comment ... [--dry-run]`
|
||||
- `pnpm atlassian conf-children --page 12345`
|
||||
- `pnpm atlassian raw --product jira|confluence --method GET|POST|PUT --path ...`
|
||||
|
||||
## Usage Examples
|
||||
|
||||
- `pnpm atlassian jira-search --jql "project = ENG ORDER BY updated DESC" --max-results 10`
|
||||
- `pnpm atlassian conf-comment --page 12345 --body-file comment.storage.html --dry-run`
|
||||
- `pnpm atlassian raw --product jira --method GET --path "/rest/api/3/issue/ENG-123"`
|
||||
|
||||
## Safety Rules
|
||||
|
||||
- Default output is JSON; prefer that for agent workflows.
|
||||
- Use `--dry-run` before any mutating command unless the user clearly wants the write to happen immediately.
|
||||
- `raw` is for explicit edge cases only and does not allow `DELETE`.
|
||||
- `--body-file` must stay inside the current workspace.
|
||||
- Confluence write bodies should be storage-format inputs in v1.
|
||||
|
||||
## Notes
|
||||
|
||||
- Atlassian Cloud is the primary supported platform in v1.
|
||||
- Package installs use the repo's `pi-package/skills/atlassian/` mirror so the installed skill directory name matches `atlassian`.
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"$schema": "https://ai-coding-skills.dev/schemas/generated-manifest/v1.json",
|
||||
"generator": "scripts/generate-skills.mjs",
|
||||
"generatedRoot": "skills/atlassian/claude-code",
|
||||
"files": [
|
||||
{
|
||||
"path": "scripts/package.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "4030a6965cd5b29674beedd2b5b1bce08b9bd8a7304dfc22d68ca9c0cdd0f6a3"
|
||||
},
|
||||
{
|
||||
"path": "scripts/pnpm-lock.yaml",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "15556a6f53e68bb8d92d2710aae0836bc80af7f29be9d63aa1b87fcbd33732c6"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/adf.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "c7c3b4a78ccd8fb5a8ab99c82e0eab67a0a0d656b3985c1f56817bda199ad20f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/cli.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "90dcc029adf0625b86c5eec44c5c1fd11bbf95ffe1185016d139c8a6982d54ff"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/command-helpers.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "aa03d8d288c8c00485ea10d3b3a60804c1b9ee23ef265004e7912f3242dbcee7"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/config.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "700dcdce96afab5294426e09f539135ae5432632370260190d6292071422eb3f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/confluence.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "28f65f280cd9b6119ce7eab583d0083231525ad6dc04b73389cb5dcbab5bf095"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/files.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "16296eaa3ae41a4d7c694773036f9bb4bd2baa2db6a9c318078532b713678dba"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/health.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "1db4b49e05b16a095b7e7ca31cdc4e22ebda19e20e05c40baaaac648eaec0d08"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/http.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "66444b777d4d9b14d9793eb051c586eb811d2b36815b1018dd9d7517666c7eb2"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/jira.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "bec0e81a0424dd412c36988cef42c01a95f044ee8346ba626e7eb8bd79379f07"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/output.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "38e99818582a4962c09a83175634cba2bfead6acf33bd5f43cdca5caed7100a0"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/raw.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "48fd54bd0cdb421badb58f9be2933a039fe3b9350bbe6191070c9f7bb0054670"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/types.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "9f92d27ab68604d5abfd0f5dc9552b96fed6d1f9fc7dc6eb30190d8b617628bf"
|
||||
},
|
||||
{
|
||||
"path": "scripts/tsconfig.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "3c2eb7ba5c95a16cada153de4787ca7a4bf179609bf3848e12ff15b1b7927a68"
|
||||
},
|
||||
{
|
||||
"path": "SKILL.md",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "96b660983b82a4060d5e3d91f916aa683f584a7b26f74c3145b3e23994030b71"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,6 +3,8 @@ name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
<!-- ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/_source/claude-code/SKILL.md and run `pnpm run sync:pi`. -->
|
||||
|
||||
# Atlassian (Claude Code)
|
||||
|
||||
Portable Atlassian workflows for Claude Code using a shared TypeScript CLI.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "atlassian-skill-scripts",
|
||||
"name": "@ai-coding-skills/atlassian-claude-code",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared runtime for the Atlassian skill",
|
||||
"type": "module",
|
||||
@@ -16,5 +16,6 @@
|
||||
"tsx": "^4.20.5",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34"
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
|
||||
"private": true
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
const TEXT_NODE = "text";
|
||||
|
||||
function textNode(text: string) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import process from "node:process";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
import { Command } from "commander";
|
||||
|
||||
import { resolveFormat } from "./command-helpers.js";
|
||||
import { createConfluenceClient } from "./confluence.js";
|
||||
import { loadConfig } from "./config.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
@@ -10,7 +12,7 @@ import { runHealthCheck } from "./health.js";
|
||||
import { createJiraClient } from "./jira.js";
|
||||
import { writeOutput } from "./output.js";
|
||||
import { runRawCommand } from "./raw.js";
|
||||
import type { FetchLike, OutputFormat, Writer } from "./types.js";
|
||||
import type { FetchLike, Writer } from "./types.js";
|
||||
|
||||
type CliContext = {
|
||||
cwd?: string;
|
||||
@@ -20,10 +22,6 @@ type CliContext = {
|
||||
stderr?: Writer;
|
||||
};
|
||||
|
||||
function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
|
||||
function createRuntime(context: CliContext) {
|
||||
const cwd = context.cwd ?? process.cwd();
|
||||
const env = context.env ?? process.env;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat } from "./types.js";
|
||||
|
||||
/**
|
||||
* Produce the standard dry-run response payload for write operations.
|
||||
*
|
||||
* Use this when `--dry-run` is passed to skip the actual API call and
|
||||
* echo the pending request back to the caller.
|
||||
*
|
||||
* @example
|
||||
* if (input.dryRun) return dryRunResponse(request);
|
||||
*/
|
||||
export function dryRunResponse<T>(data: T): CommandOutput<T> {
|
||||
return { ok: true, dryRun: true, data };
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the `--format` CLI option to a typed OutputFormat.
|
||||
*
|
||||
* Returns `"text"` only for the exact string `"text"`;
|
||||
* all other values (including `undefined`) fall back to `"json"`.
|
||||
*/
|
||||
export function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import path from "node:path";
|
||||
|
||||
import { config as loadDotEnv } from "dotenv";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
@@ -177,13 +179,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -223,13 +219,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -266,13 +256,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createJsonHeaders, createStatusError } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createBasicAuthHeader } from "./config.js";
|
||||
import type { AtlassianConfig, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { markdownToAdf } from "./adf.js";
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike, JiraIssueSummary } from "./types.js";
|
||||
|
||||
@@ -161,13 +163,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", "/rest/api/3/issue", request.body);
|
||||
return { ok: true, data: raw };
|
||||
@@ -192,13 +188,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
fields,
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("PUT", `/rest/api/3/issue/${input.issue}`, request.body);
|
||||
return {
|
||||
@@ -215,13 +205,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
body: markdownToAdf(input.body),
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", `/rest/api/3/issue/${input.issue}/comment`, request.body);
|
||||
return {
|
||||
@@ -242,13 +226,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
);
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("POST", `/rest/api/3/issue/${input.issue}/transitions`, request.body);
|
||||
return {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat, Writer } from "./types.js";
|
||||
|
||||
function renderText(payload: CommandOutput<unknown>) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
@@ -61,13 +63,7 @@ export async function runRawCommand(
|
||||
...(body === undefined ? {} : { body }),
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const data = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
export type AtlassianConfig = {
|
||||
baseUrl: string;
|
||||
jiraBaseUrl: string;
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"$schema": "https://ai-coding-skills.dev/schemas/generated-manifest/v1.json",
|
||||
"generator": "scripts/generate-skills.mjs",
|
||||
"generatedRoot": "skills/atlassian/codex",
|
||||
"files": [
|
||||
{
|
||||
"path": "scripts/package.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "2462c2f552c99460071fc60231c5d2d9eca5283bd045e6c3f845e60f351e7e73"
|
||||
},
|
||||
{
|
||||
"path": "scripts/pnpm-lock.yaml",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "15556a6f53e68bb8d92d2710aae0836bc80af7f29be9d63aa1b87fcbd33732c6"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/adf.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "c7c3b4a78ccd8fb5a8ab99c82e0eab67a0a0d656b3985c1f56817bda199ad20f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/cli.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "90dcc029adf0625b86c5eec44c5c1fd11bbf95ffe1185016d139c8a6982d54ff"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/command-helpers.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "aa03d8d288c8c00485ea10d3b3a60804c1b9ee23ef265004e7912f3242dbcee7"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/config.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "700dcdce96afab5294426e09f539135ae5432632370260190d6292071422eb3f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/confluence.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "28f65f280cd9b6119ce7eab583d0083231525ad6dc04b73389cb5dcbab5bf095"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/files.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "16296eaa3ae41a4d7c694773036f9bb4bd2baa2db6a9c318078532b713678dba"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/health.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "1db4b49e05b16a095b7e7ca31cdc4e22ebda19e20e05c40baaaac648eaec0d08"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/http.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "66444b777d4d9b14d9793eb051c586eb811d2b36815b1018dd9d7517666c7eb2"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/jira.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "bec0e81a0424dd412c36988cef42c01a95f044ee8346ba626e7eb8bd79379f07"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/output.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "38e99818582a4962c09a83175634cba2bfead6acf33bd5f43cdca5caed7100a0"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/raw.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "48fd54bd0cdb421badb58f9be2933a039fe3b9350bbe6191070c9f7bb0054670"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/types.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "9f92d27ab68604d5abfd0f5dc9552b96fed6d1f9fc7dc6eb30190d8b617628bf"
|
||||
},
|
||||
{
|
||||
"path": "scripts/tsconfig.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "3c2eb7ba5c95a16cada153de4787ca7a4bf179609bf3848e12ff15b1b7927a68"
|
||||
},
|
||||
{
|
||||
"path": "SKILL.md",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "e951cc63a6a3abf6b050b15f7316ea3675dd6aa3bc54677faa76ef5e6f1f7c16"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,6 +3,8 @@ name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
<!-- ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/_source/codex/SKILL.md and run `pnpm run sync:pi`. -->
|
||||
|
||||
# Atlassian (Codex)
|
||||
|
||||
Portable Atlassian workflows for Codex using a shared TypeScript CLI.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "atlassian-skill-scripts",
|
||||
"name": "@ai-coding-skills/atlassian-codex",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared runtime for the Atlassian skill",
|
||||
"type": "module",
|
||||
@@ -16,5 +16,6 @@
|
||||
"tsx": "^4.20.5",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34"
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
|
||||
"private": true
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
const TEXT_NODE = "text";
|
||||
|
||||
function textNode(text: string) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import process from "node:process";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
import { Command } from "commander";
|
||||
|
||||
import { resolveFormat } from "./command-helpers.js";
|
||||
import { createConfluenceClient } from "./confluence.js";
|
||||
import { loadConfig } from "./config.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
@@ -10,7 +12,7 @@ import { runHealthCheck } from "./health.js";
|
||||
import { createJiraClient } from "./jira.js";
|
||||
import { writeOutput } from "./output.js";
|
||||
import { runRawCommand } from "./raw.js";
|
||||
import type { FetchLike, OutputFormat, Writer } from "./types.js";
|
||||
import type { FetchLike, Writer } from "./types.js";
|
||||
|
||||
type CliContext = {
|
||||
cwd?: string;
|
||||
@@ -20,10 +22,6 @@ type CliContext = {
|
||||
stderr?: Writer;
|
||||
};
|
||||
|
||||
function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
|
||||
function createRuntime(context: CliContext) {
|
||||
const cwd = context.cwd ?? process.cwd();
|
||||
const env = context.env ?? process.env;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat } from "./types.js";
|
||||
|
||||
/**
|
||||
* Produce the standard dry-run response payload for write operations.
|
||||
*
|
||||
* Use this when `--dry-run` is passed to skip the actual API call and
|
||||
* echo the pending request back to the caller.
|
||||
*
|
||||
* @example
|
||||
* if (input.dryRun) return dryRunResponse(request);
|
||||
*/
|
||||
export function dryRunResponse<T>(data: T): CommandOutput<T> {
|
||||
return { ok: true, dryRun: true, data };
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the `--format` CLI option to a typed OutputFormat.
|
||||
*
|
||||
* Returns `"text"` only for the exact string `"text"`;
|
||||
* all other values (including `undefined`) fall back to `"json"`.
|
||||
*/
|
||||
export function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import path from "node:path";
|
||||
|
||||
import { config as loadDotEnv } from "dotenv";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
@@ -177,13 +179,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -223,13 +219,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -266,13 +256,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createJsonHeaders, createStatusError } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createBasicAuthHeader } from "./config.js";
|
||||
import type { AtlassianConfig, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { markdownToAdf } from "./adf.js";
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike, JiraIssueSummary } from "./types.js";
|
||||
|
||||
@@ -161,13 +163,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", "/rest/api/3/issue", request.body);
|
||||
return { ok: true, data: raw };
|
||||
@@ -192,13 +188,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
fields,
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("PUT", `/rest/api/3/issue/${input.issue}`, request.body);
|
||||
return {
|
||||
@@ -215,13 +205,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
body: markdownToAdf(input.body),
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", `/rest/api/3/issue/${input.issue}/comment`, request.body);
|
||||
return {
|
||||
@@ -242,13 +226,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
);
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("POST", `/rest/api/3/issue/${input.issue}/transitions`, request.body);
|
||||
return {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat, Writer } from "./types.js";
|
||||
|
||||
function renderText(payload: CommandOutput<unknown>) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
@@ -61,13 +63,7 @@ export async function runRawCommand(
|
||||
...(body === undefined ? {} : { body }),
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const data = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
export type AtlassianConfig = {
|
||||
baseUrl: string;
|
||||
jiraBaseUrl: string;
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"$schema": "https://ai-coding-skills.dev/schemas/generated-manifest/v1.json",
|
||||
"generator": "scripts/generate-skills.mjs",
|
||||
"generatedRoot": "skills/atlassian/cursor",
|
||||
"files": [
|
||||
{
|
||||
"path": "scripts/package.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "a48e86c0cd54ac3c9972b1d2818ee62a086ec34f1f7e88adcfc66eccc0adf04c"
|
||||
},
|
||||
{
|
||||
"path": "scripts/pnpm-lock.yaml",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "15556a6f53e68bb8d92d2710aae0836bc80af7f29be9d63aa1b87fcbd33732c6"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/adf.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "c7c3b4a78ccd8fb5a8ab99c82e0eab67a0a0d656b3985c1f56817bda199ad20f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/cli.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "90dcc029adf0625b86c5eec44c5c1fd11bbf95ffe1185016d139c8a6982d54ff"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/command-helpers.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "aa03d8d288c8c00485ea10d3b3a60804c1b9ee23ef265004e7912f3242dbcee7"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/config.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "700dcdce96afab5294426e09f539135ae5432632370260190d6292071422eb3f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/confluence.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "28f65f280cd9b6119ce7eab583d0083231525ad6dc04b73389cb5dcbab5bf095"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/files.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "16296eaa3ae41a4d7c694773036f9bb4bd2baa2db6a9c318078532b713678dba"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/health.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "1db4b49e05b16a095b7e7ca31cdc4e22ebda19e20e05c40baaaac648eaec0d08"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/http.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "66444b777d4d9b14d9793eb051c586eb811d2b36815b1018dd9d7517666c7eb2"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/jira.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "bec0e81a0424dd412c36988cef42c01a95f044ee8346ba626e7eb8bd79379f07"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/output.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "38e99818582a4962c09a83175634cba2bfead6acf33bd5f43cdca5caed7100a0"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/raw.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "48fd54bd0cdb421badb58f9be2933a039fe3b9350bbe6191070c9f7bb0054670"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/types.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "9f92d27ab68604d5abfd0f5dc9552b96fed6d1f9fc7dc6eb30190d8b617628bf"
|
||||
},
|
||||
{
|
||||
"path": "scripts/tsconfig.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "3c2eb7ba5c95a16cada153de4787ca7a4bf179609bf3848e12ff15b1b7927a68"
|
||||
},
|
||||
{
|
||||
"path": "SKILL.md",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "39cb974a328958272e0fefa21969b41fca010326dbff121be2062af3138f9a9b"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,6 +3,8 @@ name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
<!-- ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/_source/cursor/SKILL.md and run `pnpm run sync:pi`. -->
|
||||
|
||||
# Atlassian (Cursor Agent CLI)
|
||||
|
||||
Portable Atlassian workflows for Cursor Agent CLI using a shared TypeScript CLI.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "atlassian-skill-scripts",
|
||||
"name": "@ai-coding-skills/atlassian-cursor",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared runtime for the Atlassian skill",
|
||||
"type": "module",
|
||||
@@ -16,5 +16,6 @@
|
||||
"tsx": "^4.20.5",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34"
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
|
||||
"private": true
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
const TEXT_NODE = "text";
|
||||
|
||||
function textNode(text: string) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import process from "node:process";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
import { Command } from "commander";
|
||||
|
||||
import { resolveFormat } from "./command-helpers.js";
|
||||
import { createConfluenceClient } from "./confluence.js";
|
||||
import { loadConfig } from "./config.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
@@ -10,7 +12,7 @@ import { runHealthCheck } from "./health.js";
|
||||
import { createJiraClient } from "./jira.js";
|
||||
import { writeOutput } from "./output.js";
|
||||
import { runRawCommand } from "./raw.js";
|
||||
import type { FetchLike, OutputFormat, Writer } from "./types.js";
|
||||
import type { FetchLike, Writer } from "./types.js";
|
||||
|
||||
type CliContext = {
|
||||
cwd?: string;
|
||||
@@ -20,10 +22,6 @@ type CliContext = {
|
||||
stderr?: Writer;
|
||||
};
|
||||
|
||||
function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
|
||||
function createRuntime(context: CliContext) {
|
||||
const cwd = context.cwd ?? process.cwd();
|
||||
const env = context.env ?? process.env;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat } from "./types.js";
|
||||
|
||||
/**
|
||||
* Produce the standard dry-run response payload for write operations.
|
||||
*
|
||||
* Use this when `--dry-run` is passed to skip the actual API call and
|
||||
* echo the pending request back to the caller.
|
||||
*
|
||||
* @example
|
||||
* if (input.dryRun) return dryRunResponse(request);
|
||||
*/
|
||||
export function dryRunResponse<T>(data: T): CommandOutput<T> {
|
||||
return { ok: true, dryRun: true, data };
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the `--format` CLI option to a typed OutputFormat.
|
||||
*
|
||||
* Returns `"text"` only for the exact string `"text"`;
|
||||
* all other values (including `undefined`) fall back to `"json"`.
|
||||
*/
|
||||
export function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import path from "node:path";
|
||||
|
||||
import { config as loadDotEnv } from "dotenv";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
@@ -177,13 +179,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -223,13 +219,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -266,13 +256,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createJsonHeaders, createStatusError } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createBasicAuthHeader } from "./config.js";
|
||||
import type { AtlassianConfig, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { markdownToAdf } from "./adf.js";
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike, JiraIssueSummary } from "./types.js";
|
||||
|
||||
@@ -161,13 +163,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", "/rest/api/3/issue", request.body);
|
||||
return { ok: true, data: raw };
|
||||
@@ -192,13 +188,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
fields,
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("PUT", `/rest/api/3/issue/${input.issue}`, request.body);
|
||||
return {
|
||||
@@ -215,13 +205,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
body: markdownToAdf(input.body),
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", `/rest/api/3/issue/${input.issue}/comment`, request.body);
|
||||
return {
|
||||
@@ -242,13 +226,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
);
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("POST", `/rest/api/3/issue/${input.issue}/transitions`, request.body);
|
||||
return {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat, Writer } from "./types.js";
|
||||
|
||||
function renderText(payload: CommandOutput<unknown>) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
@@ -61,13 +63,7 @@ export async function runRawCommand(
|
||||
...(body === undefined ? {} : { body }),
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const data = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
export type AtlassianConfig = {
|
||||
baseUrl: string;
|
||||
jiraBaseUrl: string;
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"$schema": "https://ai-coding-skills.dev/schemas/generated-manifest/v1.json",
|
||||
"generator": "scripts/generate-skills.mjs",
|
||||
"generatedRoot": "skills/atlassian/opencode",
|
||||
"files": [
|
||||
{
|
||||
"path": "scripts/package.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "780e807a8e4c611103273ce93ed029fdad62d87bc999bd022f8cebeefd61619b"
|
||||
},
|
||||
{
|
||||
"path": "scripts/pnpm-lock.yaml",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "15556a6f53e68bb8d92d2710aae0836bc80af7f29be9d63aa1b87fcbd33732c6"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/adf.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "c7c3b4a78ccd8fb5a8ab99c82e0eab67a0a0d656b3985c1f56817bda199ad20f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/cli.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "90dcc029adf0625b86c5eec44c5c1fd11bbf95ffe1185016d139c8a6982d54ff"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/command-helpers.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "aa03d8d288c8c00485ea10d3b3a60804c1b9ee23ef265004e7912f3242dbcee7"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/config.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "700dcdce96afab5294426e09f539135ae5432632370260190d6292071422eb3f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/confluence.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "28f65f280cd9b6119ce7eab583d0083231525ad6dc04b73389cb5dcbab5bf095"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/files.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "16296eaa3ae41a4d7c694773036f9bb4bd2baa2db6a9c318078532b713678dba"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/health.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "1db4b49e05b16a095b7e7ca31cdc4e22ebda19e20e05c40baaaac648eaec0d08"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/http.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "66444b777d4d9b14d9793eb051c586eb811d2b36815b1018dd9d7517666c7eb2"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/jira.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "bec0e81a0424dd412c36988cef42c01a95f044ee8346ba626e7eb8bd79379f07"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/output.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "38e99818582a4962c09a83175634cba2bfead6acf33bd5f43cdca5caed7100a0"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/raw.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "48fd54bd0cdb421badb58f9be2933a039fe3b9350bbe6191070c9f7bb0054670"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/types.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "9f92d27ab68604d5abfd0f5dc9552b96fed6d1f9fc7dc6eb30190d8b617628bf"
|
||||
},
|
||||
{
|
||||
"path": "scripts/tsconfig.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "3c2eb7ba5c95a16cada153de4787ca7a4bf179609bf3848e12ff15b1b7927a68"
|
||||
},
|
||||
{
|
||||
"path": "SKILL.md",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "b7137d7c3ad97161cdb4603eebff6165a50baa247b61f3b8462744faa8d206d3"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,6 +3,8 @@ name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
<!-- ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/_source/opencode/SKILL.md and run `pnpm run sync:pi`. -->
|
||||
|
||||
# Atlassian (OpenCode)
|
||||
|
||||
Portable Atlassian workflows for OpenCode using a shared TypeScript CLI.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "atlassian-skill-scripts",
|
||||
"name": "@ai-coding-skills/atlassian-opencode",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared runtime for the Atlassian skill",
|
||||
"type": "module",
|
||||
@@ -16,5 +16,6 @@
|
||||
"tsx": "^4.20.5",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34"
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
|
||||
"private": true
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
const TEXT_NODE = "text";
|
||||
|
||||
function textNode(text: string) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import process from "node:process";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
import { Command } from "commander";
|
||||
|
||||
import { resolveFormat } from "./command-helpers.js";
|
||||
import { createConfluenceClient } from "./confluence.js";
|
||||
import { loadConfig } from "./config.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
@@ -10,7 +12,7 @@ import { runHealthCheck } from "./health.js";
|
||||
import { createJiraClient } from "./jira.js";
|
||||
import { writeOutput } from "./output.js";
|
||||
import { runRawCommand } from "./raw.js";
|
||||
import type { FetchLike, OutputFormat, Writer } from "./types.js";
|
||||
import type { FetchLike, Writer } from "./types.js";
|
||||
|
||||
type CliContext = {
|
||||
cwd?: string;
|
||||
@@ -20,10 +22,6 @@ type CliContext = {
|
||||
stderr?: Writer;
|
||||
};
|
||||
|
||||
function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
|
||||
function createRuntime(context: CliContext) {
|
||||
const cwd = context.cwd ?? process.cwd();
|
||||
const env = context.env ?? process.env;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat } from "./types.js";
|
||||
|
||||
/**
|
||||
* Produce the standard dry-run response payload for write operations.
|
||||
*
|
||||
* Use this when `--dry-run` is passed to skip the actual API call and
|
||||
* echo the pending request back to the caller.
|
||||
*
|
||||
* @example
|
||||
* if (input.dryRun) return dryRunResponse(request);
|
||||
*/
|
||||
export function dryRunResponse<T>(data: T): CommandOutput<T> {
|
||||
return { ok: true, dryRun: true, data };
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the `--format` CLI option to a typed OutputFormat.
|
||||
*
|
||||
* Returns `"text"` only for the exact string `"text"`;
|
||||
* all other values (including `undefined`) fall back to `"json"`.
|
||||
*/
|
||||
export function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import path from "node:path";
|
||||
|
||||
import { config as loadDotEnv } from "dotenv";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
@@ -177,13 +179,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -223,13 +219,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -266,13 +256,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createJsonHeaders, createStatusError } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createBasicAuthHeader } from "./config.js";
|
||||
import type { AtlassianConfig, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { markdownToAdf } from "./adf.js";
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike, JiraIssueSummary } from "./types.js";
|
||||
|
||||
@@ -161,13 +163,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", "/rest/api/3/issue", request.body);
|
||||
return { ok: true, data: raw };
|
||||
@@ -192,13 +188,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
fields,
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("PUT", `/rest/api/3/issue/${input.issue}`, request.body);
|
||||
return {
|
||||
@@ -215,13 +205,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
body: markdownToAdf(input.body),
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", `/rest/api/3/issue/${input.issue}/comment`, request.body);
|
||||
return {
|
||||
@@ -242,13 +226,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
);
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("POST", `/rest/api/3/issue/${input.issue}/transitions`, request.body);
|
||||
return {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat, Writer } from "./types.js";
|
||||
|
||||
function renderText(payload: CommandOutput<unknown>) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
@@ -61,13 +63,7 @@ export async function runRawCommand(
|
||||
...(body === undefined ? {} : { body }),
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const data = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
export type AtlassianConfig = {
|
||||
baseUrl: string;
|
||||
jiraBaseUrl: string;
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"$schema": "https://ai-coding-skills.dev/schemas/generated-manifest/v1.json",
|
||||
"generator": "scripts/generate-skills.mjs",
|
||||
"generatedRoot": "skills/atlassian/pi",
|
||||
"files": [
|
||||
{
|
||||
"path": "scripts/package.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "454e09224d66eb976fa27a06e9998497f628baff1bc7a8f44d70e6eb107d7106"
|
||||
},
|
||||
{
|
||||
"path": "scripts/pnpm-lock.yaml",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "15556a6f53e68bb8d92d2710aae0836bc80af7f29be9d63aa1b87fcbd33732c6"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/adf.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "c7c3b4a78ccd8fb5a8ab99c82e0eab67a0a0d656b3985c1f56817bda199ad20f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/cli.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "90dcc029adf0625b86c5eec44c5c1fd11bbf95ffe1185016d139c8a6982d54ff"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/command-helpers.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "aa03d8d288c8c00485ea10d3b3a60804c1b9ee23ef265004e7912f3242dbcee7"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/config.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "700dcdce96afab5294426e09f539135ae5432632370260190d6292071422eb3f"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/confluence.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "28f65f280cd9b6119ce7eab583d0083231525ad6dc04b73389cb5dcbab5bf095"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/files.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "16296eaa3ae41a4d7c694773036f9bb4bd2baa2db6a9c318078532b713678dba"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/health.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "1db4b49e05b16a095b7e7ca31cdc4e22ebda19e20e05c40baaaac648eaec0d08"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/http.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "66444b777d4d9b14d9793eb051c586eb811d2b36815b1018dd9d7517666c7eb2"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/jira.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "bec0e81a0424dd412c36988cef42c01a95f044ee8346ba626e7eb8bd79379f07"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/output.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "38e99818582a4962c09a83175634cba2bfead6acf33bd5f43cdca5caed7100a0"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/raw.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "48fd54bd0cdb421badb58f9be2933a039fe3b9350bbe6191070c9f7bb0054670"
|
||||
},
|
||||
{
|
||||
"path": "scripts/src/types.ts",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "9f92d27ab68604d5abfd0f5dc9552b96fed6d1f9fc7dc6eb30190d8b617628bf"
|
||||
},
|
||||
{
|
||||
"path": "scripts/tsconfig.json",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "3c2eb7ba5c95a16cada153de4787ca7a4bf179609bf3848e12ff15b1b7927a68"
|
||||
},
|
||||
{
|
||||
"path": "SKILL.md",
|
||||
"kind": "file",
|
||||
"mode": "644",
|
||||
"sha256": "69d83441799f3feada7fbf85691bda16fc30718b724871d7e37cfac574db2253"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,6 +3,8 @@ name: atlassian
|
||||
description: Interact with Atlassian Cloud Jira and Confluence through a portable task-oriented CLI for search, issue/page edits, comments, transitions, and bounded raw requests.
|
||||
---
|
||||
|
||||
<!-- ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/_source/pi/SKILL.md and run `pnpm run sync:pi`. -->
|
||||
|
||||
# Atlassian (Pi)
|
||||
|
||||
Portable Atlassian workflows for pi using the shared TypeScript CLI in `scripts/`.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "atlassian-skill-scripts",
|
||||
"name": "@ai-coding-skills/atlassian-pi",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared runtime for the Atlassian skill",
|
||||
"type": "module",
|
||||
@@ -16,5 +16,6 @@
|
||||
"tsx": "^4.20.5",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34"
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
|
||||
"private": true
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
const TEXT_NODE = "text";
|
||||
|
||||
function textNode(text: string) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import process from "node:process";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
import { Command } from "commander";
|
||||
|
||||
import { resolveFormat } from "./command-helpers.js";
|
||||
import { createConfluenceClient } from "./confluence.js";
|
||||
import { loadConfig } from "./config.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
@@ -10,7 +12,7 @@ import { runHealthCheck } from "./health.js";
|
||||
import { createJiraClient } from "./jira.js";
|
||||
import { writeOutput } from "./output.js";
|
||||
import { runRawCommand } from "./raw.js";
|
||||
import type { FetchLike, OutputFormat, Writer } from "./types.js";
|
||||
import type { FetchLike, Writer } from "./types.js";
|
||||
|
||||
type CliContext = {
|
||||
cwd?: string;
|
||||
@@ -20,10 +22,6 @@ type CliContext = {
|
||||
stderr?: Writer;
|
||||
};
|
||||
|
||||
function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
|
||||
function createRuntime(context: CliContext) {
|
||||
const cwd = context.cwd ?? process.cwd();
|
||||
const env = context.env ?? process.env;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat } from "./types.js";
|
||||
|
||||
/**
|
||||
* Produce the standard dry-run response payload for write operations.
|
||||
*
|
||||
* Use this when `--dry-run` is passed to skip the actual API call and
|
||||
* echo the pending request back to the caller.
|
||||
*
|
||||
* @example
|
||||
* if (input.dryRun) return dryRunResponse(request);
|
||||
*/
|
||||
export function dryRunResponse<T>(data: T): CommandOutput<T> {
|
||||
return { ok: true, dryRun: true, data };
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the `--format` CLI option to a typed OutputFormat.
|
||||
*
|
||||
* Returns `"text"` only for the exact string `"text"`;
|
||||
* all other values (including `undefined`) fall back to `"json"`.
|
||||
*/
|
||||
export function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import path from "node:path";
|
||||
|
||||
import { config as loadDotEnv } from "dotenv";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
@@ -177,13 +179,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -223,13 +219,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -266,13 +256,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createJsonHeaders, createStatusError } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { createBasicAuthHeader } from "./config.js";
|
||||
import type { AtlassianConfig, FetchLike } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { markdownToAdf } from "./adf.js";
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike, JiraIssueSummary } from "./types.js";
|
||||
|
||||
@@ -161,13 +163,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", "/rest/api/3/issue", request.body);
|
||||
return { ok: true, data: raw };
|
||||
@@ -192,13 +188,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
fields,
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("PUT", `/rest/api/3/issue/${input.issue}`, request.body);
|
||||
return {
|
||||
@@ -215,13 +205,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
body: markdownToAdf(input.body),
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", `/rest/api/3/issue/${input.issue}/comment`, request.body);
|
||||
return {
|
||||
@@ -242,13 +226,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
);
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("POST", `/rest/api/3/issue/${input.issue}/transitions`, request.body);
|
||||
return {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import type { CommandOutput, OutputFormat, Writer } from "./types.js";
|
||||
|
||||
function renderText(payload: CommandOutput<unknown>) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
@@ -61,13 +63,7 @@ export async function runRawCommand(
|
||||
...(body === undefined ? {} : { body }),
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const data = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ⚠️ GENERATED FILE – do not edit directly. Edit the canonical source in skills/atlassian/shared/scripts/ and run `pnpm run sync:pi`.
|
||||
export type AtlassianConfig = {
|
||||
baseUrl: string;
|
||||
jiraBaseUrl: string;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { pathToFileURL } from "node:url";
|
||||
|
||||
import { Command } from "commander";
|
||||
|
||||
import { resolveFormat } from "./command-helpers.js";
|
||||
import { createConfluenceClient } from "./confluence.js";
|
||||
import { loadConfig } from "./config.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
@@ -10,7 +11,7 @@ import { runHealthCheck } from "./health.js";
|
||||
import { createJiraClient } from "./jira.js";
|
||||
import { writeOutput } from "./output.js";
|
||||
import { runRawCommand } from "./raw.js";
|
||||
import type { FetchLike, OutputFormat, Writer } from "./types.js";
|
||||
import type { FetchLike, Writer } from "./types.js";
|
||||
|
||||
type CliContext = {
|
||||
cwd?: string;
|
||||
@@ -20,10 +21,6 @@ type CliContext = {
|
||||
stderr?: Writer;
|
||||
};
|
||||
|
||||
function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
|
||||
function createRuntime(context: CliContext) {
|
||||
const cwd = context.cwd ?? process.cwd();
|
||||
const env = context.env ?? process.env;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { CommandOutput, OutputFormat } from "./types.js";
|
||||
|
||||
/**
|
||||
* Produce the standard dry-run response payload for write operations.
|
||||
*
|
||||
* Use this when `--dry-run` is passed to skip the actual API call and
|
||||
* echo the pending request back to the caller.
|
||||
*
|
||||
* @example
|
||||
* if (input.dryRun) return dryRunResponse(request);
|
||||
*/
|
||||
export function dryRunResponse<T>(data: T): CommandOutput<T> {
|
||||
return { ok: true, dryRun: true, data };
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the `--format` CLI option to a typed OutputFormat.
|
||||
*
|
||||
* Returns `"text"` only for the exact string `"text"`;
|
||||
* all other values (including `undefined`) fall back to `"json"`.
|
||||
*/
|
||||
export function resolveFormat(format: string | undefined): OutputFormat {
|
||||
return format === "text" ? "text" : "json";
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
|
||||
@@ -177,13 +178,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -223,13 +218,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
@@ -266,13 +255,7 @@ export function createConfluenceClient(options: ConfluenceClientOptions) {
|
||||
},
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { markdownToAdf } from "./adf.js";
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike, JiraIssueSummary } from "./types.js";
|
||||
|
||||
@@ -161,13 +162,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", "/rest/api/3/issue", request.body);
|
||||
return { ok: true, data: raw };
|
||||
@@ -192,13 +187,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
fields,
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("PUT", `/rest/api/3/issue/${input.issue}`, request.body);
|
||||
return {
|
||||
@@ -215,13 +204,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
body: markdownToAdf(input.body),
|
||||
});
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const raw = await send("POST", `/rest/api/3/issue/${input.issue}/comment`, request.body);
|
||||
return {
|
||||
@@ -242,13 +225,7 @@ export function createJiraClient(options: JiraClientOptions) {
|
||||
},
|
||||
);
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
await send("POST", `/rest/api/3/issue/${input.issue}/transitions`, request.body);
|
||||
return {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { dryRunResponse } from "./command-helpers.js";
|
||||
import { readWorkspaceFile } from "./files.js";
|
||||
import { sendJsonRequest } from "./http.js";
|
||||
import type { AtlassianConfig, CommandOutput, FetchLike } from "./types.js";
|
||||
@@ -61,13 +62,7 @@ export async function runRawCommand(
|
||||
...(body === undefined ? {} : { body }),
|
||||
};
|
||||
|
||||
if (input.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
dryRun: true,
|
||||
data: request,
|
||||
};
|
||||
}
|
||||
if (input.dryRun) return dryRunResponse(request);
|
||||
|
||||
const data = await sendJsonRequest({
|
||||
config,
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
import { dryRunResponse, resolveFormat } from "../src/command-helpers.js";
|
||||
|
||||
// ── dryRunResponse ────────────────────────────────────────────────────────
|
||||
|
||||
test("dryRunResponse wraps data with ok:true and dryRun:true", () => {
|
||||
const data = { method: "POST", url: "https://example.com/api/v2/pages" };
|
||||
const result = dryRunResponse(data);
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.dryRun, true);
|
||||
assert.deepEqual(result.data, data);
|
||||
});
|
||||
|
||||
test("dryRunResponse preserves the exact data reference", () => {
|
||||
const data = { nested: { key: "value" } };
|
||||
const result = dryRunResponse(data);
|
||||
assert.strictEqual(result.data, data);
|
||||
});
|
||||
|
||||
test("dryRunResponse works with primitive data", () => {
|
||||
const result = dryRunResponse("dry-run-string");
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.dryRun, true);
|
||||
assert.equal(result.data, "dry-run-string");
|
||||
});
|
||||
|
||||
// ── resolveFormat ─────────────────────────────────────────────────────────
|
||||
|
||||
test("resolveFormat returns json by default for undefined", () => {
|
||||
assert.equal(resolveFormat(undefined), "json");
|
||||
});
|
||||
|
||||
test("resolveFormat returns json for unrecognised values", () => {
|
||||
assert.equal(resolveFormat("xml"), "json");
|
||||
assert.equal(resolveFormat(""), "json");
|
||||
assert.equal(resolveFormat("TEXT"), "json");
|
||||
});
|
||||
|
||||
test("resolveFormat returns text only for the exact string 'text'", () => {
|
||||
assert.equal(resolveFormat("text"), "text");
|
||||
});
|
||||
Reference in New Issue
Block a user