基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Jessinra/Lorekeeper --skill github-app-bot-auth命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Lorekeeper-specific BLOCKER patterns, severity tiers, and review checklist — used when reviewing any PR touching src/lorekeeper/
Marketing workflow for Lorekeeper — README copy, manifesto, positioning, and multi-agent A/B testing of copy variations. Load this when working on any user-facing content: README, docs/manifesto.md, positioning, comparison tables, or launch copy.
UI/UX design intelligence. 67 styles, 96 palettes, 57 font pairings, 25 charts, 13 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.
| name | github-app-bot-auth |
| description | GitHub App bot authentication — setup, token rotation, and cron refresh for jessinra-megumi-dev[bot] |
| version | 1.1.0 |
| author | Megumi Akane |
| platforms | ["macos"] |
jessinra-megumi-dev[bot]The Lorekeeper ecosystem uses a GitHub App (jessinra-megumi-dev) for bot-authorized gh operations — PR creation, code pushes, API calls. The bot identity is separate from Jason's personal account, giving cleaner audit trails on PRs.
| Item | Value |
|---|---|
| App ID | 3823074 |
| Installation ID | 134866394 |
| Account | Jessinra (User, selected repos) |
| Bot display name | jessinra-megumi-dev[bot] |
| Private key | ~/.hermes/keys/jessinra-megumi-dev.private-key.pem |
| Auth file | ~/.config/gh/hosts.yml |
| Token prefix | ghs_ (installation token) |
Private Key (.pem)
→ Sign JWT (RS256, App ID 3823074, 10min expiry)
→ POST /app/installations/134866394/access_tokens
→ Installation token (ghs_..., 1hr expiry)
→ Written to ~/.config/gh/hosts.yml
Installation tokens expire in 1 hour. A cron job refreshes them automatically:
~/.hermes/scripts/gh-token-refresh.py*/45 * * * *)no_agent=True (pure script, no LLM cost)local (silent — no Telegram spam)The script:
~/.hermes/keys/jessinra-megumi-dev.private-key.pemopenssl dgst -sha256 -sign)~/.config/gh/hosts.yml with the fresh token inlinegh auth login --with-token (with GH_TOKEN/GITHUB_TOKEN unset)gh auth token resolves a valid ghs_ tokenWhy step 5 matters (the critical fix): on macOS, gh stores credentials in the Keychain and prefers the keyring over hosts.yml. Writing hosts.yml alone (the old behaviour) left gh authenticating with a stale keyring token — the recurring The token in default is invalid failure. The --with-token step keeps the keyring in sync so gh and git self-heal on every cron tick. No manual logout/login dance is needed anymore.
Output behaviour: SILENT on success (empty stdout — the no_agent cron delivers nothing, so no Telegram spam). LOUD on failure only (one actionable line + exit 1, surfaced by the cron watchdog). The openssl fallback captures the signature with subprocess — no binary ever leaks to stdout.
Paths are hardcoded to /Users/jessinra, not Path.home() — profile crons (e.g. diana) remap HOME to ~/.hermes/profiles/<name>/home/, so Path.home() would resolve wrong. The GitHub App key + gh config are user-level shared resources.
python3 ~/.hermes/scripts/gh-token-refresh.py
gh auth status
# Should show: ✓ Logged in to github.com account jessinra-megumi-dev[bot] (keyring)
gh api repos/Jessinra/Lorekeeper --jq '.full_name'
# Should return: Jessinra/Lorekeeper
If the bot token expires and the cron job didn't run (e.g. machine was off), gh has two accounts configured:
✓ Logged in to github.com account jessinra-megumi-dev[bot] (keyring) ← active
✓ Logged in to github.com account Jessinra (keyring) ← fallback
The active account is jessinra-megumi-dev[bot]. If the token is invalid, gh will still try and fail for that specific call, but the Jessinra account is still available as a fallback. To switch back to personal:
gh auth switch --user Jessinra
All agents share the same user-level ~/.config/gh/hosts.yml and gh keyring, so one cron job system-wide is sufficient in principle. In practice there are two: the default profile job (6183c59abea6) is the source of truth, and a diana profile job (f0f841b4e394) runs the same logic.
Profile crons can't reach user-level scripts directly — the runner blocks any script path that resolves outside the profile's own scripts/ dir (and symlinks are rejected too). For the diana job, ~/.hermes/profiles/diana/scripts/gh-token-refresh.py is a thin wrapper that os.execv's the canonical user-level script, so all real logic stays single-source at ~/.hermes/scripts/gh-token-refresh.py.
If setting up per-profile:
hermes cron create \
--name gh-bot-token-refresh \
--script gh-token-refresh.py \
--schedule "*/45 * * * *" \
--profile <profile_name> \
--no-agent \
--deliver local
Auth, PR lifecycle, API calls, and repo commands live in references/gh-cli-reference.md. Load it for the full command reference.
First thing to try — just run the refresh script. It re-syncs the keyring, fixing the token in default is invalid error:
python3 ~/.hermes/scripts/gh-token-refresh.py
gh auth status
gh api repos/Jessinra/Lorekeeper --jq '.full_name'
If gh auth status still shows invalid after refresh, the keyring write failed — run the script directly to see stderr. Legacy fallback:
gh auth switch --user Jessinra
unset GH_TOKEN
gh auth logout -h github.com -u "jessinra-megumi-dev[bot]"
python3 ~/.hermes/scripts/gh-token-refresh.py