@atollhq/skill-codex 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,7 +12,7 @@ npx @atollhq/skill-codex --profile agent-a --key sk_atoll_... --org your-org-id
12
12
  ATOLL_API_KEY=sk_atoll_... ATOLL_ORG_ID=your-org-id npx @atollhq/skill-codex
13
13
  ```
14
14
 
15
- Optional defaults: `--profile`, `--project`, `--team`, and `--base-url` write `ATOLL_PROFILE`, `ATOLL_PROJECT`, `ATOLL_TEAM`, and `ATOLL_BASE_URL` for the agent. Use `--no-project`, `--no-team`, or `--no-base-url` to clear previously saved defaults. When `--profile` is set, the installer also creates or updates that profile in `~/.atoll/config.json`.
15
+ Optional defaults: `--project`, `--team`, and `--base-url` are stored with the selected mode. Use `--no-project`, `--no-team`, or `--no-base-url` to clear previously saved defaults. When `--profile` is set, credentials and defaults are stored only in that named Atoll CLI profile. The installer does not write global `ATOLL_*` exports to `~/.zshrc` or `~/.bashrc`. Use `atoll --profile agent-a ...` for profile-scoped commands, or omit `--profile` to use env-var mode.
16
16
 
17
17
  Get an API key from **Settings > Members > Add Agent** (or **Create API Key** for integrations) in the Atoll app.
18
18
 
@@ -21,10 +21,10 @@ This does five things:
21
21
  1. Installs the `atoll-api` skill to `~/.codex/skills/atoll-api/`
22
22
  2. Appends (or updates) an `# Atoll Integration` section in `~/.codex/AGENTS.md`
23
23
  3. Copies API reference files to `~/.codex/atoll-references/`
24
- 4. Appends Atoll env var exports to your shell profile (`~/.zshrc` or `~/.bashrc`)
25
- 5. Creates or updates the named Atoll CLI profile when `--profile` is provided
24
+ 4. Creates or updates the named Atoll CLI profile when `--profile` is provided
25
+ 5. Appends Atoll env var exports to your shell profile (`~/.zshrc` or `~/.bashrc`) only when no profile is provided
26
26
 
27
- Open a fresh shell (or `source` your profile) and Codex has the Atoll integration.
27
+ For profile mode, Codex has the Atoll skill immediately and terminal commands can use `atoll --profile agent-a ...`. For env-var mode, open a fresh shell or `source` your profile.
28
28
 
29
29
  ## Using the integration
30
30
 
@@ -45,6 +45,7 @@ For terminal-first work, see [`@atollhq/cli`](https://www.npmjs.com/package/@ato
45
45
  ```bash
46
46
  npm install -g @atollhq/cli
47
47
  atoll auth login --profile agent-a --key sk_atoll_... --org-id org-uuid --project project-id --team team-id
48
+ atoll auth login --profile agent-a --key sk_atoll_... --org-id org-uuid --project project-id --no-team --no-base-url
48
49
  atoll heartbeat
49
50
  atoll issue list --json
50
51
  atoll agent-context
package/bin/install.mjs CHANGED
@@ -30,7 +30,7 @@ Usage: npx @atollhq/skill-codex [--profile <name>] --key <api-key> --org <org-id
30
30
  or: ATOLL_API_KEY=<api-key> ATOLL_ORG_ID=<org-id> npx @atollhq/skill-codex
31
31
 
32
32
  Options:
33
- --profile Atoll CLI profile name to create/update. Defaults to ATOLL_PROFILE.
33
+ --profile Atoll CLI profile name to create/update. Profile mode does not write shell env vars.
34
34
  --key Atoll API key (sk_atoll_...). Defaults to ATOLL_API_KEY.
35
35
  --org Organization ID. Defaults to ATOLL_ORG_ID.
36
36
  --project Default project ID. Defaults to ATOLL_PROJECT.
@@ -44,12 +44,12 @@ Options:
44
44
  Installs the Atoll integration for Codex CLI:
45
45
  - Installs the atoll-api skill to ~/.codex/skills/atoll-api/
46
46
  - Writes AGENTS.md with API reference to ~/.codex/
47
- - Sets Atoll env vars
47
+ - Creates/updates an Atoll CLI profile when --profile is provided
48
+ - Otherwise writes Atoll env vars to your shell profile for env-var mode
48
49
  `)
49
50
  }
50
51
 
51
52
  const args = parseArgs(process.argv)
52
- args.profile ??= process.env.ATOLL_PROFILE
53
53
  args.key ??= process.env.ATOLL_API_KEY
54
54
  args.org ??= process.env.ATOLL_ORG_ID
55
55
  if (args.clearProject) delete args.project
@@ -83,7 +83,7 @@ function readJson(path) {
83
83
  }
84
84
 
85
85
  function writeAtollProfile() {
86
- if (!args.profile) return
86
+ if (!args.profile) return null
87
87
 
88
88
  const atollDir = join(homedir(), '.atoll')
89
89
  const configPath = join(atollDir, 'config.json')
@@ -106,6 +106,7 @@ function writeAtollProfile() {
106
106
  mkdirSync(atollDir, { recursive: true })
107
107
  writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n')
108
108
  console.log(`Configured Atoll CLI profile "${args.profile}" in ${configPath}`)
109
+ return configPath
109
110
  }
110
111
 
111
112
  // 1. Install the Codex skill to ~/.codex/skills/atoll-api/
@@ -122,7 +123,13 @@ console.log(`Installed Atoll skill to ${skillDest}`)
122
123
  const skillMd = readFileSync(join(skillDir, 'SKILL.md'), 'utf-8')
123
124
  // Strip YAML frontmatter for AGENTS.md
124
125
  const body = skillMd.replace(/^---[\s\S]*?---\n*/, '')
126
+ const profileModeInstructions = args.profile ? `## Profile-scoped CLI configuration
127
+
128
+ This Codex install is scoped to Atoll CLI profile \`${args.profile}\`. No global \`ATOLL_API_KEY\`, \`ATOLL_ORG_ID\`, \`ATOLL_PROJECT\`, \`ATOLL_TEAM\`, or \`ATOLL_BASE_URL\` shell exports were written. Use \`atoll --profile ${args.profile} ...\` for direct Atoll CLI commands. Direct API snippets below use \`ATOLL_API_KEY\` / \`ATOLL_ORG_ID\` only when you intentionally choose env-var mode.
129
+
130
+ ` : ''
125
131
  const optionalCredentialLines = [
132
+ args.profile ? `- Atoll CLI profile: ${args.profile}` : null,
126
133
  args.project ? `- Default project ID: ${args.project}` : null,
127
134
  args.team ? `- Default team: ${args.team}` : null,
128
135
  args.baseUrl ? `- Base URL: ${args.baseUrl}` : null,
@@ -130,11 +137,12 @@ const optionalCredentialLines = [
130
137
 
131
138
  const agentsMd = `# Atoll Integration
132
139
 
140
+ ${profileModeInstructions}
133
141
  ${body}
134
142
 
135
143
  ## Credentials
136
144
 
137
- - API Key: set as ATOLL_API_KEY environment variable
145
+ - API Key: ${args.profile ? `stored in Atoll CLI profile \`${args.profile}\`` : 'set as ATOLL_API_KEY environment variable'}
138
146
  - Org ID: ${args.org}${optionalCredentialLines ? `\n${optionalCredentialLines}` : ''}
139
147
  `
140
148
 
@@ -162,7 +170,16 @@ for (const file of ['api-endpoints.md', 'api-fields.md']) {
162
170
  }
163
171
  console.log(`Copied API references to ${refsDir}`)
164
172
 
165
- // 4. Set env vars in shell profile
173
+ // 4. In profile mode, keep credentials scoped to the Atoll CLI profile.
174
+ if (args.profile) {
175
+ writeAtollProfile()
176
+ console.log('No Atoll shell exports were written.')
177
+ console.log(`Run profile-scoped commands with: atoll --profile ${args.profile} ...`)
178
+ console.log(`\nDone! Codex has the Atoll skill installed, and the Atoll CLI profile "${args.profile}" is active.`)
179
+ process.exit(0)
180
+ }
181
+
182
+ // 4. Set env vars in shell profile for env-var mode.
166
183
  const shell = process.env.SHELL || '/bin/bash'
167
184
  const profilePath = shell.includes('zsh')
168
185
  ? join(homedir(), '.zshrc')
@@ -185,7 +202,7 @@ if (existsSync(profilePath)) {
185
202
  if (!profile.includes('# Atoll (added by @atollhq/skill-codex)')) {
186
203
  profile = `${profile.trimEnd()}\n\n# Atoll (added by @atollhq/skill-codex)\n`
187
204
  }
188
- if (args.profile) profile = upsertExport(profile, 'ATOLL_PROFILE', args.profile)
205
+ profile = removeExport(profile, 'ATOLL_PROFILE')
189
206
  profile = upsertExport(profile, 'ATOLL_API_KEY', args.key)
190
207
  profile = upsertExport(profile, 'ATOLL_ORG_ID', args.org)
191
208
  if (args.project) profile = upsertExport(profile, 'ATOLL_PROJECT', args.project)
@@ -195,10 +212,8 @@ if (existsSync(profilePath)) {
195
212
  if (args.baseUrl) profile = upsertExport(profile, 'ATOLL_BASE_URL', args.baseUrl)
196
213
  else profile = removeExport(profile, 'ATOLL_BASE_URL')
197
214
  writeFileSync(profilePath, profile)
198
- writeAtollProfile()
199
215
 
200
216
  const configuredVars = []
201
- if (args.profile) configuredVars.push('ATOLL_PROFILE')
202
217
  configuredVars.push('ATOLL_API_KEY', 'ATOLL_ORG_ID')
203
218
  if (args.project) configuredVars.push('ATOLL_PROJECT')
204
219
  if (args.team) configuredVars.push('ATOLL_TEAM')
@@ -207,7 +222,6 @@ if (existsSync(profilePath)) {
207
222
  } else {
208
223
  const envLines = [
209
224
  '# Atoll (added by @atollhq/skill-codex)',
210
- args.profile ? `export ATOLL_PROFILE="${args.profile}"` : null,
211
225
  `export ATOLL_API_KEY="${args.key}"`,
212
226
  `export ATOLL_ORG_ID="${args.org}"`,
213
227
  args.project ? `export ATOLL_PROJECT="${args.project}"` : null,
@@ -216,7 +230,6 @@ if (existsSync(profilePath)) {
216
230
  ].filter(Boolean)
217
231
  const envBlock = `\n${envLines.join('\n')}\n`
218
232
  writeFileSync(profilePath, envBlock)
219
- writeAtollProfile()
220
233
  console.log(`Created ${profilePath} with Atoll env vars`)
221
234
  }
222
235
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atollhq/skill-codex",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Install the Atoll project management integration for Codex CLI",
5
5
  "bin": {
6
6
  "skill-codex": "bin/install.mjs"
package/skill/SKILL.md CHANGED
@@ -149,12 +149,14 @@ atoll feedback "The status error should list custom board statuses"
149
149
 
150
150
  # Projects & milestones
151
151
  atoll project list
152
+ atoll project delete <project-id> --confirm DELETE
152
153
  atoll milestone list --project <project-id>
153
154
  atoll milestone upsert --project <project-id> --name "v1.0" --date 2026-06-01
154
155
 
155
156
  # Goals, KPIs, and initiatives
156
157
  atoll goal create --title "Reach 100 paying customers by Q2" --target-date 2026-06-30
157
158
  atoll kpi create --name paying_customers --goal "Reach 100 paying customers by Q2" --unit count --target 100 --current 34
159
+ atoll kpi create --name mvp_tasks_done --goal "Launch MVP" --internal-task-completion
158
160
  atoll initiative create --title "Content pipeline" --goal "Reach 100 paying customers by Q2" --status active
159
161
  atoll initiative kpi link "Content pipeline" paying_customers --impact "+30 customers/mo"
160
162
  atoll kpi snapshot add paying_customers --value 42 --initiative "Content pipeline" --note "End-of-week Stripe check"
@@ -171,9 +173,32 @@ CLI JSON conventions:
171
173
  - Use `--json` for machine-readable output.
172
174
  - List commands return `{ resource, items, total, limit, offset, nextOffset, truncated, hint }`.
173
175
  - Diagnostics and errors go to stderr.
174
- - `atoll agent-context` returns a versioned command/flag manifest and available profile context.
176
+ - Interactive CLI update notices also go to stderr and are suppressed for JSON/non-TTY/CI/completion flows.
177
+ - `atoll agent-context` returns a versioned command/flag manifest, available profile context, and structured `cli.update_available` metadata.
178
+ - `atoll heartbeat --json` includes the same structured `cli` update metadata for agents.
175
179
  - `atoll plan validate/apply` consumes `schemaVersion: "atoll.plan.v1"` files with `milestones`, `issues`, `dependencies`, `initiativeLinks`, and `milestoneLinks`; local `key` values can be referenced by `milestoneKey`, `issueKey`, `dependsOn`, `blockedBy`, or `blocks`.
176
180
 
181
+ ## KPI HTTP Sync Drafts
182
+
183
+ When a human asks you to help automate a KPI from a third-party API, use this Atoll skill. If the current agent environment does not have the `atoll-api` skill installed, tell the user to install it before continuing or use the Atoll CLI/MCP tools directly if they are available.
184
+
185
+ Agents may create draft syncs and validate proposed configs only after a human admin has allowlisted the exact destination host in Atoll. Human admins must review the draft in Atoll, enter secrets, dry-run, publish, disable, or run-now with snapshot writing.
186
+
187
+ ```bash
188
+ atoll kpi sync validate <kpi-id> \
189
+ --name "PostHog visitors" \
190
+ --schedule daily \
191
+ --url https://us.posthog.com/api/projects/123/query/ \
192
+ --pointer /results/0/value \
193
+ --auth-secret-ref posthog_api_key
194
+
195
+ atoll kpi sync draft <kpi-id> --file sync-draft.json
196
+ ```
197
+
198
+ Draft configs must be `GET` only, `https` only, JSON only, no redirects, no request bodies, no inline query strings, no secret values, and an already-allowlisted exact destination host. Use secret reference names only for `Authorization: Bearer <secretRef>` or `X-API-Key: <secretRef>`.
199
+
200
+ Never include API keys, bearer tokens, cookies, raw third-party response bodies, or secret values in prompts, draft files, comments, or issue descriptions. If a human pasted a secret into chat, stop and ask them to rotate it and enter the replacement directly in Atoll.
201
+
177
202
  ## Remote MCP Server
178
203
 
179
204
  Use `@atollhq/mcp-server` when an agent or ChatGPT-style client needs Atoll access but cannot run a local CLI command or read local auth profiles.
@@ -321,7 +346,7 @@ atoll issue update ATOLL-42 --status done # complete
321
346
  ### Set up the strategy chain
322
347
 
323
348
  1. `POST /api/orgs/{id}/goals` -- create goal with `target_date`
324
- 2. `POST /api/orgs/{id}/kpis` -- attach KPI with `goal_id`, `target_value`, `target_direction`
349
+ 2. `POST /api/orgs/{id}/kpis` -- attach KPI with `goal_id`, `target_value`, `target_direction`; for launch-style goals you can use `source_type: "formula"` with `source_config.formula: "goal_linked_issue_completion"` to calculate done directly linked and milestone-linked tasks over total linked tasks
325
350
  3. `POST /api/orgs/{id}/kpis/{kpiId}/snapshots` -- record measurement (auto-updates `current_value`)
326
351
  4. `POST /api/orgs/{id}/initiatives` -- create initiative linked to goal
327
352
  5. `POST /api/orgs/{id}/initiatives/{id}/kpi-impacts` -- declare expected KPI impact
@@ -64,7 +64,7 @@ All endpoints require `Authorization: Bearer sk_atoll_...` header.
64
64
  | POST | `/api/orgs/{id}/projects` | Create project (`{ name, description?, visibility?, color?, icon?, github_repo? }`) |
65
65
  | GET | `/api/orgs/{id}/projects/{projectId}` | Get project with issues |
66
66
  | PATCH | `/api/orgs/{id}/projects/{projectId}` | Update project (`{ name?, description?, status?, visibility?, color?, icon? }`) |
67
- | DELETE | `/api/orgs/{id}/projects/{projectId}` | Delete project (owner/admin) |
67
+ | DELETE | `/api/orgs/{id}/projects/{projectId}` | Permanently delete project and all tasks in it (owner/admin; body must include `{ "confirmation": "DELETE" }`) |
68
68
 
69
69
  Guest users only see projects they are assigned to.
70
70
 
@@ -201,6 +201,21 @@ Roles: `owner`, `admin`, `member`, `guest`.
201
201
  | DELETE | `/api/orgs/{id}/kpis/{kpiId}` | Delete KPI (admin/owner only) |
202
202
  | GET | `/api/orgs/{id}/kpis/{kpiId}/snapshots` | List snapshots (optional `?limit=50`) |
203
203
  | POST | `/api/orgs/{id}/kpis/{kpiId}/snapshots` | Record a snapshot |
204
+ | GET | `/api/orgs/{id}/kpi-http-sync-policy` | List exact-host KPI HTTP sync allowlist policy |
205
+ | POST | `/api/orgs/{id}/kpi-http-sync-policy` | Add an allowed exact host (human admin only) |
206
+ | GET | `/api/orgs/{id}/kpis/{kpiId}/http-syncs` | List KPI HTTP syncs |
207
+ | POST | `/api/orgs/{id}/kpis/{kpiId}/http-syncs` | Create a draft KPI HTTP sync |
208
+ | PUT | `/api/orgs/{id}/kpis/{kpiId}/http-syncs` | Validate a proposed KPI HTTP sync config without storing or running it |
209
+ | GET | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}` | Get a KPI HTTP sync |
210
+ | PATCH | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}` | Update a KPI HTTP sync draft (human admin only) |
211
+ | POST | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}/validate` | Validate a stored sync (human admin only) |
212
+ | GET | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}/secrets` | List sanitized secret metadata (human admin only) |
213
+ | PUT | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}/secrets` | Add or replace a sync secret value (human admin only) |
214
+ | POST | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}/dry-run` | Execute a sanitized dry run without writing a snapshot (human admin only) |
215
+ | POST | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}/publish` | Publish a validated, dry-run sync (human admin only) |
216
+ | POST | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}/disable` | Disable a sync (human admin only) |
217
+ | POST | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}/run-now` | Preview by default; write a snapshot only with explicit admin confirmation |
218
+ | GET | `/api/orgs/{id}/kpis/{kpiId}/http-syncs/{syncId}/runs` | List sanitized sync run history (human admin only) |
204
219
 
205
220
  ## Initiatives
206
221
 
@@ -100,6 +100,22 @@ Creation endpoints may return `402` when an org reaches its billing plan limit:
100
100
  }
101
101
  ```
102
102
 
103
+ Calculated task-completion KPIs use `source_type: "formula"` and are calculated from linked work instead of snapshots:
104
+
105
+ ```json
106
+ {
107
+ "name": "mvp_tasks_done",
108
+ "goal_id": "goal-uuid",
109
+ "source_type": "formula",
110
+ "source_config": {
111
+ "formula": "goal_linked_issue_completion",
112
+ "done_statuses": ["done"]
113
+ }
114
+ }
115
+ ```
116
+
117
+ For `goal_linked_issue_completion`, `current_value` is the count of non-archived directly linked issues and milestone-linked issues in `done` status and `target_value` is the total non-archived directly linked issue and milestone-linked issue count under initiatives for the goal.
118
+
103
119
  ## KPI Snapshots
104
120
 
105
121
  ```json
@@ -114,6 +130,40 @@ Creation endpoints may return `402` when an org reaches its billing plan limit:
114
130
 
115
131
  Recording a snapshot auto-updates the KPI's `current_value`.
116
132
 
133
+ Calculated KPIs do not accept manual snapshots.
134
+
135
+ `api_poll` snapshots are written by published KPI HTTP Syncs and include provenance: `source_sync_id`, `source_sync_run_id`, `source_config_hash`, `source_recorded_for`, `observed_at`, and optional `provider_recorded_at`.
136
+
137
+ ## KPI HTTP Syncs
138
+
139
+ ```json
140
+ {
141
+ "name": "PostHog visitors",
142
+ "schedule": "daily",
143
+ "request_config": {
144
+ "method": "GET",
145
+ "url": "https://us.posthog.com/api/projects/123/query/",
146
+ "headers": {
147
+ "Authorization": {
148
+ "secretRef": "posthog_api_key",
149
+ "format": "Bearer {value}"
150
+ }
151
+ }
152
+ },
153
+ "extraction_config": {
154
+ "contentType": "json",
155
+ "pointer": "/results/0/value",
156
+ "numeric": {
157
+ "mode": "number",
158
+ "percentageScale": null
159
+ }
160
+ },
161
+ "freshness_config": {}
162
+ }
163
+ ```
164
+
165
+ V1 syncs are `GET` only, `https` only, JSON only, exact-host allowlisted, no redirects, no request bodies, no inline query strings, and no secret values. Machine actors can create drafts and validate configs only after the host is allowlisted. Human admins manage allowlists, secrets, dry-runs, publishing, disabling, and snapshot-writing run-now actions in Atoll.
166
+
117
167
  ## Initiative Fields
118
168
 
119
169
  ```json
@@ -295,6 +345,9 @@ Each finding carries whichever entity ids apply: `goal_id`, `kpi_id`, `initiativ
295
345
  | KPI | `target_direction` | `increase`, `decrease`, `maintain` |
296
346
  | KPI | `source_type` | `manual`, `webhook`, `api_poll`, `formula` |
297
347
  | KPI snapshot | `source` | `manual`, `webhook`, `api_poll`, `formula`, `agent` |
348
+ | KPI HTTP sync | `status` | `draft`, `published`, `disabled` |
349
+ | KPI HTTP sync secret | `placement` | `authorization_bearer`, `x_api_key` |
350
+ | KPI HTTP sync run | `status` | `queued`, `running`, `success`, `error` |
298
351
  | Initiative | `status` | `proposed`, `active`, `completed`, `paused`, `cancelled` |
299
352
  | Status update | `status` | `on_track`, `at_risk`, `off_track` |
300
353
  | Member | `role` | `owner`, `admin`, `member`, `guest` |