Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions skills/stackone-connection/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ If this session has no connector-profile or account-linking tools (such as `stac
Find the thing before you touch it, and stop if it is already right.

- A profile: `stackone_get_connector_profiles {connector_key: ["<provider>"]}`, or `stackone_get_connector_profiles {id}` for one profile. `connector_key` is a list.
- An account: `stackone_list_linked_accounts {providers}` or `stackone_get_account {id}`.
- An account: `stackone_get_accounts {connector_key: ["<provider>"], expand: "connector,connector_profile"}`, or
`stackone_get_accounts {id, expand: "connector,connector_profile"}` for one account.

If the account is already linked and authenticated, or the profile already enables the action, say
so and change nothing.
Expand Down Expand Up @@ -47,28 +48,30 @@ user finishes in the browser. There is no status-poll tool.
`{ auth_link_url, expires_at, provider, connector_profile_id, next_steps }`. Give the user the
`auth_link_url` to open and relay `next_steps`.
2. When the user says they are done, confirm the account exists with a read:
`stackone_list_linked_accounts` or `stackone_get_account` returns the new account. Confirm
`stackone_get_accounts {connector_key: ["<provider>"]}` returns the new account. Confirm

@cubic-dev-ai cubic-dev-ai Bot Nov 30, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This list read does not reliably confirm the newly linked account when another account already exists for the provider, especially because the fallback preserves the broken account. Snapshot the account IDs before linking and confirm a newly added account by ID (not merely any returned account) after the user completes the flow.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At skills/stackone-connection/SKILL.md, line 51:

<comment>This list read does not reliably confirm the newly linked account when another account already exists for the provider, especially because the fallback preserves the broken account. Snapshot the account IDs before linking and confirm a newly added account by ID (not merely any returned account) after the user completes the flow.</comment>

<file context>
@@ -47,28 +48,29 @@ user finishes in the browser. There is no status-poll tool.
    `auth_link_url` to open and relay `next_steps`.
 2. When the user says they are done, confirm the account exists with a read:
-   `stackone_list_linked_accounts` or `stackone_get_account` returns the new account. Confirm
+   `stackone_get_accounts {connector_key: ["<provider>"]}` returns the new account. Confirm
    success from that read, never from the fact that you started the link.
 
</file context>
Fix with cubic

success from that read, never from the fact that you started the link.

## Reconnect a broken account; do not replace it

`stackone_link_account` has no `account_id` input, and this surface has no separate repair or
edit-mode tool. You reconnect an expired or deauthorized account by starting a fresh link through
the same connector profile the account already uses, then confirming by re-reading the account.
How you reconnect an expired or deauthorized account depends on the tools this session has. A
repair tool brings the same account back; a fresh link adds a new account beside the broken one.

- Read the broken account with `stackone_get_account {id}`. Its output names the provider and the
profile (`integration_config_labels`), but not the profile id.
- Look the profile up with `stackone_get_connector_profiles {connector_key: ["<the account's
provider>"]}` and match it by name to get its `id`.
- Relink through that profile:
- Read the broken account with `stackone_get_accounts {id, expand: "connector,connector_profile"}`.
Its `connector_profile_id` is the profile it links through. When that is null, choose the profile
as in "Pick the profile deliberately" above.
- If the session has a tool that reconnects or repairs an existing account by its id (for example
`stackone_relink_account`), use it on the broken account's `id`.
- Only when no such tool exists, start a fresh link through the profile the account already uses.
`stackone_link_account` has no `account_id` input, so it creates a new account through that
profile and leaves the broken one as it is:

```
stackone_link_account { connector_profile_id: "<the broken account's profile id>" }
```

Do not delete the old account first, and do not start a bare `provider` link when more than one
profile exists for the connector. Confirm the repair by re-reading the account and checking its
status.
profile exists for the connector. Confirm the repair by re-reading the account (after a fresh link,
the new one) and checking its status.

## Diagnose a new or suspect link from evidence

Expand Down