Skip to content

Commit 6b2a4f0

Browse files
authored
Merge pull request #1 from ryleckenby/add-github-skills
Add generic GitHub workflow skills
2 parents a6b4b80 + 91c8cb4 commit 6b2a4f0

4 files changed

Lines changed: 118 additions & 1 deletion

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: github-cli-setup
3+
description: Establish a correct, least-surprise `gh` CLI session before doing any GitHub work — confirm the right account is active, that it can actually see the target repo, and that its token carries the scopes the task needs (repo, project, workflow). Use at the start of any GitHub task, or when a `gh` command fails with "Could not resolve to a Repository", "Not Found", or "missing required scopes". Domain-agnostic — the same checks apply to any repo or project.
4+
---
5+
6+
# github-cli-setup
7+
8+
Most GitHub automation failures aren't the task — they're the *session*: the wrong account is
9+
active, that account can't see a private repo, or its token is missing a scope the command needs.
10+
This skill front-loads those checks so the real work doesn't fail halfway through. Run it before
11+
issue/milestone/project/PR work, and reach for it the moment a `gh` call returns a resolution,
12+
not-found, or scope error.
13+
14+
## Background: the three things that go wrong
15+
16+
1. **Wrong active account.** `gh` supports several logged-in accounts but only one is *active*.
17+
The active one may not be the account that owns (or can see) the repo you're targeting.
18+
2. **No access to the repo.** A private repo is invisible to any account that isn't the owner or
19+
a collaborator — the symptom is `Could not resolve to a Repository` / HTTP 404, which reads
20+
like the repo doesn't exist when really the *active account* just can't see it.
21+
3. **Missing token scopes.** A task needs specific OAuth scopes. Common ones:
22+
- `repo` — repos, issues, milestones, PRs (needed for almost everything).
23+
- `project` / `read:project` — GitHub Projects (v2) boards. **Milestones and issues do NOT
24+
need this — only the Projects board does.**
25+
- `workflow` — editing `.github/workflows/` files.
26+
Adding a scope requires an **interactive** re-auth the user must run themselves.
27+
28+
## Steps
29+
30+
1. **Check the session.** Run `gh auth status` and read every logged-in account, which is active,
31+
and each account's token scopes.
32+
2. **Identify the account that owns/can-see the target repo.** If the task names a repo under a
33+
specific owner, that owner's account (or a collaborator) is the one you need. If the active
34+
account differs, switch: `gh auth switch --user <login>`.
35+
3. **Verify visibility.** Confirm the active account can actually resolve the repo:
36+
`gh repo view <owner>/<repo> --json name,visibility,hasIssuesEnabled`. A 404 here almost
37+
always means "active account can't see it," not "doesn't exist" — switch accounts or ask the
38+
user to grant access, rather than concluding the repo is missing.
39+
4. **Check the scopes the task needs** against the active account's scopes from step 1:
40+
- issues / milestones / PRs → `repo`
41+
- Projects (v2) board → `project` (and `read:project` to list/read)
42+
- editing workflows → `workflow`
43+
5. **If a scope is missing, ask the user to add it** — this is interactive and cannot be done
44+
non-interactively. Give them the exact command to run in their session:
45+
`gh auth refresh -s <scope> --hostname github.com` (e.g. `-s project`). It shows a one-time
46+
code and opens a browser to approve on the correct account. Wait for them to confirm, then
47+
re-check `gh auth status` before proceeding.
48+
6. **Proceed only once** the active account both resolves the repo and holds the needed scopes.
49+
Note in your summary which account you're operating as, so the user isn't surprised later.
50+
51+
## Do not
52+
53+
- Do not conclude a repo "doesn't exist" on a 404 without first checking whether a *different*
54+
logged-in account can see it — private-repo visibility is account-scoped.
55+
- Do not try to add a scope non-interactively or by editing token files — `gh auth refresh` must
56+
be run by the user.
57+
- Do not assume the active account is the right one just because a previous command happened to
58+
work; a read that succeeds under `repo` scope says nothing about `project` scope.
59+
- Do not store or echo full tokens; treat the masked values from `gh auth status` as enough.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: github-project-tracking
3+
description: Turn a roadmap or plan into trackable GitHub artifacts — create milestones for phases, issues for concrete tasks under each milestone, a Projects (v2) board laid out by Status, and add every issue to it. Use when the user wants to track work on GitHub ("set up milestones and a project board", "track this roadmap on GitHub", "make issues for these tasks"), or to keep an existing board in sync. Assumes `gh` is ready — run github-cli-setup first if any command fails on account or scope.
4+
---
5+
6+
# github-project-tracking
7+
8+
Scaffolds a full tracking surface on GitHub from a plan: **milestones** for the phases,
9+
**issues** for the tasks, and a **Projects (v2) board** to work them day-to-day. Milestones and
10+
issues need only `repo` scope; the board needs `project` scope — so the skill can do the first
11+
two even if the board step is blocked waiting on a scope grant (see `github-cli-setup`).
12+
13+
## Steps
14+
15+
1. **Confirm the session** is ready for the repo (right account, `repo` scope; `project` scope if
16+
a board is wanted). If any command fails on account/scope, run `github-cli-setup` first.
17+
2. **Agree on the breakdown before creating anything.** Restate the milestones (phases) and the
18+
issues under each, in a compact list, and get a nod. Creating a wrong breakdown means cleanup
19+
across many artifacts — cheap to confirm, annoying to undo.
20+
3. **Create milestones** — one per phase. Milestones only need `repo` scope:
21+
`gh api -X POST repos/<owner>/<repo>/milestones -f title="M0 — Foundations" -f description="..."`.
22+
Keep titles short and ordered (`M0`, `M1`, …) so they sort correctly.
23+
4. **Create issues** under each milestone. The `--milestone` flag takes the milestone *title*:
24+
`gh issue create -R <owner>/<repo> --milestone "M0 — Foundations" --title "..." --body "..."`.
25+
Give each issue a body that points back at the source plan (e.g. a doc section), so an issue is
26+
self-explanatory without the surrounding chat.
27+
5. **Create the Projects (v2) board** (needs `project` scope):
28+
`gh project create --owner <owner> --title "<name>" --format json` — capture the returned
29+
project `id`, `number`, and `url`.
30+
6. **Link the board to the repo** so issues surface in the repo's Projects tab:
31+
`gh project link <number> --owner <owner> --repo <repo>`.
32+
7. **Add every issue to the board:**
33+
`gh project item-add <number> --owner <owner> --url https://github.com/<owner>/<repo>/issues/<n>`.
34+
The item count can lag a beat behind (eventual consistency) — verify with
35+
`gh project item-list <number> --owner <owner> --format json --jq '[.items[].content.number]|sort'`
36+
and re-add any genuinely missing, rather than trusting the immediate count.
37+
8. **Set a starting Status** so cards don't pile up under "No Status." New boards have a `Status`
38+
single-select (`Todo` / `In Progress` / `Done`). Fetch its field id and the `Todo` option id
39+
with `gh project field-list <number> --owner <owner> --format json`, then for each item:
40+
`gh project item-edit --project-id <PID> --id <ITEM_ID> --field-id <FIELD_ID> --single-select-option-id <TODO_ID>`.
41+
9. **Hand off the daily workflow.** Tell the user how to drive it: drag a card to **In Progress**
42+
when starting an issue and **Done** when finished; group the board by **Milestone** (board
43+
menu → Group by) to see phases as swimlanes. Offer to move cards / open issues on their behalf
44+
as work proceeds.
45+
46+
## Do not
47+
48+
- Do not create a pile of issues before the breakdown is confirmed — a wrong split is expensive to
49+
reverse across milestones, issues, and board items.
50+
- Do not block milestone/issue creation on `project` scope; only the board steps (5–8) need it.
51+
If the scope isn't granted yet, create milestones and issues, then pause for the grant.
52+
- Do not trust the immediate board item count after bulk-adding — verify by listing actual issue
53+
numbers, since the count is eventually consistent.
54+
- Do not invent a milestone breakdown the user didn't sanction; mirror their plan (or ask), don't
55+
improvise scope.

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ know before touching code.}}
2121
to reach for this vs. a plain Claude Code skill.
2222
- `knowledge/` — the shared memory loops read and write between runs (`signals/`, `notes/`,
2323
`domains/`). Read `knowledge/README.md` once; it's short.
24-
- `.claude/skills/``new-loop` (scaffold a domain) and `ship-loop-change` (verify-before-ship).
24+
- `.claude/skills/``new-loop` (scaffold a domain), `ship-loop-change` (verify-before-ship),
25+
`review-signals` (promote piled-up signals), and generic GitHub playbooks `github-cli-setup`
26+
(session/scope checks) and `github-project-tracking` (milestones + issues + Projects board).
2527
- `LOG.md` — the global activity feed. Append one line here right before you commit a bulk of
2628
work from any loop run.
2729

LOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Format: `YYYY-MM-DD HH:MM | domain | one-line summary | link(s)`
88

99
## Entries
1010

11+
- 2026-07-26 22:51 | scaffold | added github-cli-setup + github-project-tracking skills (generic GitHub playbook: gh account/scope checks, milestones/issues/Projects-v2 board) | [[.claude/skills/github-project-tracking/SKILL.md]]
1112
- 2026-06-22 16:00 | scaffold | stress-tested the orchestration/execution decision rule against opposite-shape domains (event+engine, scheduled+no-engine); rule held, fixed an implicit correlation in docs/loop-engineer-pattern.md's examples | [[docs/loop-engineer-pattern.md]]
1213
- 2026-06-22 15:00 | review-signals | added review-signals skill + skill-writing recipe; dogfooded against a synthetic signal (correctly judged "leave open," then removed) | [[.claude/skills/review-signals/SKILL.md]]
1314
- 2026-06-22 14:00 | smoke-test | dogfooded new-loop skill (scaffold verified correct, then removed — throwaway test domain) | [[.claude/skills/new-loop/SKILL.md]]

0 commit comments

Comments
 (0)