使用个人访问令牌(PAT)管理自托管 Jira 实例的事务,适合 SSO/SAML 环境。Use when 需要项目管理、任务规划、进度跟踪、团队协作时使用。不适用于实际人员绩效评估。适用于独立开发者、企业团队和自动化工作流场景。支持中文交互,无需复杂配置即开即用。输出结果可直接使用,减少二次加工成本。
集成
GitHub PAT Debugging
试用排查 GitHub PAT 认证失败、401、Bad credentials、推送失败、token 看起来失效等问题。先检查命令、变量传递、路径和请求参数,再用 curl、Node、Python 或 PowerShell 交叉验证,确认后才判断权限、撤销或网络原因。适用于 GitHub API、Contents API、GitHub Pages 和 Skill 镜像推送。 Diagnose GitHub Personal Access Token failures before declaring a token expired or revoked.
它能做什么
排查 GitHub PAT 认证失败、401、Bad credentials、推送失败、token 看起来失效等问题。先检查命令、变量传递、路径和请求参数,再用 curl、Node、Python 或 PowerShell 交叉验证,确认后才判断权限、撤销或网络原因。适用于 GitHub API、Contents API、GitHub Pages 和 Skill 镜像推送。 Diagnose GitHub Personal Access Token failures before declaring a token expired or revoked.
技能文档
github-pat-debugging
When to use
- A GitHub API or Contents API request returns
401 Bad credentials. - A token is shown as active or non-expiring in GitHub, or another GitHub workflow has just succeeded.
- Different runtimes or shells are being mixed, especially Bash, Node.js, Python, PowerShell, curl, or Git.
Steps
Diagnostic skill: steps 1–3 are
[Deterministic](shell commands and file inspection); steps 4–8 mix[Deterministic]probes with[LLM]interpretation.
- [LLM] Do not conclude that the token is expired or revoked from one failed request. Record the exact endpoint, HTTP status, auth scheme, and runtime.
- [Deterministic] Inspect the token file without printing the token: byte count, prefix, suffix, and trailing newline. Do not expose the full secret.
- [Deterministic] Test the same token with an independent client. In Bash, use direct expansion for curl:
TOKEN=$(cat "$HOME/.github-token") curl -sS -D - -o /dev/null \ -H "Authorization: Bearer $TOKEN" \ -H "User-Agent: token-probe" \ -H "Accept: application/vnd.github+json" \ https://api.github.com/user - [Deterministic] When handing the token to a child process, export it explicitly. This is a critical Bash distinction:
- Wrong for a later command:
TOKEN=$(cat file) && node script.js(shell variable is not exported). - Correct:
export TOKEN="$(cat file)" && node script.js. - Also correct for one process:
TOKEN="$(cat file)" node script.js.
- Wrong for a later command:
- [Deterministic] In Node.js, check
process.env.TOKENonly as a boolean/presence signal; never print the value. Test bothBearerandtokenschemes if needed. - [LLM] Compare the results. If curl is
200withX-OAuth-Scopesand Node is401, inspect environment propagation before token state, proxy, or GitHub account hypotheses. - [LLM] Only after independent clients using the same secret both fail, investigate GitHub-side causes using the failure-mode decision tree in
references/token-failure-modes.md: manual deletion/revocation, secret-scanning revocation, third-party credential revocation, OAuth-app token limits, organization/enterprise policy, or expiration. - [Deterministic] After fixing the auth path, fetch the current remote blob SHA, update through the Contents API with the SHA, and verify the raw file contains the intended content.
Hard Rules
- Never conclude token expiry or revocation from a single failed request in a single runtime.
- Never print, commit, log, or paste a full PAT; inspect only byte count, prefix, and suffix.
- Local causes (variable propagation, wrong shell syntax, unset env) are ruled out before any GitHub-side hypothesis.
- Two independent clients must fail with the same secret before investigating revocation.
- A token exposed in logs or chat is rotated regardless of whether it still works.
Pitfalls
VAR=value commandexports the variable only to that command;VAR=value && commanddoes not export it to the later command.- A
401from Node withprocess.env.TOKENunset is a local process bug, not evidence of a revoked PAT. Never usedor a stale "last used" label is weaker evidence than a live authenticatedGET /user; use the latter for runtime validation.- Do not print, commit, or paste a full PAT. If a token has been exposed, rotate it after completing the needed deployment.
- Do not overwrite a remote file without first retrieving its current SHA.
Failure Handling
| Scenario | Action |
|---|---|
| curl succeeds but Node fails | Environment propagation bug — inspect export usage before touching the token |
| Both clients fail with 401 | Walk references/token-failure-modes.md decision tree; check security log events |
| Token file unreadable or empty | Fix file access first; an unreadable token is not a revoked token |
| Intermittent failures | Suspect proxy, rate limiting, or SSO enforcement before token state |
| Token confirmed exposed | Rotate immediately after completing the critical deployment |
Output Format
# GitHub PAT Diagnosis
## 1. Symptom (endpoint, status, runtime, exact command form)
## 2. Local-cause check (variable propagation, env, shell syntax)
## 3. Cross-validation results (curl / Node / Python, status codes)
## 4. Root cause (with evidence strength per references/token-failure-modes.md)
## 5. Fix applied (exact command correction)
## 6. Post-fix verification (GET /user 200 + write SHA + raw file check)
Verification
- Run an authenticated
GET /userwith the corrected runtime and confirm HTTP 200 plus the expected login, without printing the token. - Confirm the write response is HTTP 200/201 and record only the commit SHA.
- Read the public raw file and verify the new marker is present and stale markers are absent.
- Record the precise root cause and command correction in the project log.
相关技能
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, dra...
GitHub (github.com). Use this skill for ANY GitHub request — reading, creating, updating, and deleting data. Whenever a task involves GitHub, use this skill instead of calling the API directly.
GitHub 产品调研与机会发现 · Product research
Diagnose a tangled git situation and give the exact, safe commands to fix it. Use when asked to undo a commit, recover lost work, fix a bad merge or rebase,...
GitHub仓库管理技能,支持仓库/分支/PR/Issue的CRUD操作。Do NOT use for repository cloning.