agentleFS
INo-xiousINo-xious/stockbit-mcp/skills/stockbit-auth/SKILL.md

stockbit-auth

Skill58 starsChanged 3 months agoMITView on GitHub

Log in to Stockbit and capture the session for this server — opens the browser login flow and verifies the token was stored. Use when the user asks to log in or re-authenticate to Stockbit, or after a status check reports the session expired, HTTP 401, or logged out.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never ask for the user's Stockbit password and never type credentials on their behalf — the browser session is theirs.

    line 33
  2. Very specific:

    Read the redirected logs (success prints Session captured and a passing test refresh), then confirm the stored token independently:

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Stockbit login

Launch the browser login and confirm the refresh token was captured.

Step 1 — launch it detached

stockbit-auth login

(or node dist/bin/stockbit-auth.js login from the repo root; add --fresh-profile if a saved browser profile is stuck.)

If you are an agent running this through a tool harness, do not run it as a foreground or backgrounded shell call. Harnesses that reap the process tree when a turn ends will kill node mid-login, and node's cleanup closes the browser with it — the login never completes and the failure looks like a browser problem. Launch it as a detached process instead, so it outlives the turn. On Windows:

Start-Process -FilePath "node" -ArgumentList "dist\bin\stockbit-auth.js", "login" `
  -WorkingDirectory <repo-root> -WindowStyle Hidden `
  -RedirectStandardOutput "$env:TEMP\stockbit-login.out.log" `
  -RedirectStandardError  "$env:TEMP\stockbit-login.err.log"

On macOS/Linux, detach with nohup ... & or an equivalent that survives the caller.

Step 2 — hand the browser to the user

A browser window opens on the Stockbit login page. The user logs in there themselves. The session is captured automatically the moment login completes, and the window may close itself. The flow allows up to 15 minutes.

Never ask for the user's Stockbit password and never type credentials on their behalf — the browser session is theirs. Then wait for them to say they are done; do not poll in a loop.

Step 3 — verify

Read the redirected logs (success prints Session captured and a passing test refresh), then confirm the stored token independently:

stockbit-auth status

Expect Validity: OK. Note that status can print correctly and then crash on a libuv assertion on Windows — judge by the text, not the exit code. Remind the user that ordinary use keeps the window sliding, and only a long idle gap forces another login.

If the browser flow fails

Offer the fallbacks in this order:

  1. stockbit-auth doctor — diagnoses browsers, the token store, and the capture path.
  2. stockbit-auth import-har — the user logs in with any browser, exports a DevTools HAR, and imports it.
  3. stockbit-auth bootstrap — paste a refresh token manually.

Two things that cause confusing failures: the capture only watches the browser it launched, so logging in through a normal window is invisible to it; and the stored token is encrypted against this machine and user, so it cannot be copied to another host — every machine logs in once for itself.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.