Install
$ agentstack add skill-jackchuka-ghpm-ghpm-init ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
ghpm-init
> PREREQUISITE: Read ../ghpm-shared/SKILL.md for prerequisites and error handling.
Initialize a GitHub Projects v2 project for use with ghpm skills. Auto-discovers schema and generates config files.
Arguments
- Project URL (e.g.,
https://github.com/orgs//projects/) - If no arguments, ask the user for the project URL or owner + number.
Workflow
Phase 1: Validate Access
- Parse arguments to extract owner and project number from URL or positional args.
- Run
gh auth statusto verify authentication. If this fails, tell the user to rungh auth loginand stop. - Run
gh project view --owner --format jsonto verify access and get project metadata (id, title). If this fails with 403/404, tell the user to check token scopes (read:project,project) and project access. - Determine the owner type from the project view output. This matters for Phase 3: use
organization(login: "")for org-owned projects oruser(login: "")for user-owned projects.
Phase 2: Discover Schema
- Run
gh project field-list --owner --format jsonto get all fields with IDs, types, and options. - Identify the workflow field: find the
ProjectV2SingleSelectFieldnamed "Status". If multiple candidates or none found, ask the user which field drives the kanban workflow. - Separate the workflow field from other fields.
Phase 3: Discover Views
- Run GraphQL query to fetch all views. Use the owner type determined in Phase 1 to choose the correct root field:
gh api graphql -f query='
{
organization(login: "") {
projectV2(number: ) {
views(first: 50) {
nodes {
id
name
number
layout
filter
groupByFields(first: 5) {
nodes {
... on ProjectV2Field { name }
... on ProjectV2SingleSelectField { name }
... on ProjectV2IterationField { name }
}
}
sortByFields(first: 5) {
nodes {
field {
... on ProjectV2Field { name }
... on ProjectV2SingleSelectField { name }
... on ProjectV2IterationField { name }
}
direction
}
}
}
}
}
}
}'
- Transform view data into config format: lowercase layout names (TABLELAYOUT -> table, BOARDLAYOUT -> board, ROADMAP_LAYOUT -> roadmap), preserve filter strings as-is.
Phase 4: Discover Items and Repos
- Run
gh project item-list --owner --format json --limit 1000to fetch all items. The--limitflag controls the total count returned (no cursor pagination available), so use a high value. Note: items beyond the limit are silently truncated — see cache reference for details. - Extract unique repository URLs from items to build the repos list.
- Store all items in cache.
Phase 5: Write Config Files
- Assemble
.ghpm/config.jsonwith this structure:
{
"version": 1,
"project": {
"owner": "",
"number": "",
"id": "",
"title": ""
},
"workflow": {
"field": "",
"field_id": "",
"columns": [{ "id": "", "name": "" }]
},
"fields": [
{
"name": "",
"id": "",
"type": "",
"options": [{ "id": "", "name": "" }]
}
],
"views": [
{
"name": "",
"number": "",
"id": "",
"layout": "",
"filter": "",
"sort": [{ "field": "", "direction": "" }],
"group_by": [""]
}
],
"cache": {
"ttl_minutes": 30
},
"conventions": {
"branch": "{type}/{issue-number}/{slug}. Detect type from issue labels and title: bug→fix, enhancement/feature→feat, documentation→docs, test→test, refactor→refactor, default→chore",
"status_sync": "On start, set to InProgress if currently Planned or ReadyForDev. On session end with merged PR, set to Done.",
"decisions": "When a design decision is detected, nudge before recording. Post as issue comment."
},
"repos": ["/"]
}
- Only include
sortkey on views that have sort fields. - Only include
group_bykey on views that have groupBy fields. - Only include
optionson fields that aresingle_selectoriterationtype. - Strip the full URL from repos, keep just
owner/repo.
- Write
.ghpm/cache.jsonper../ghpm-shared/references/cache.md.
- Run
mkdir -p .ghpm/sessions. Check if.gitignoreexists. If it does, check if.ghpm/is already listed. If not, ensure the file ends with a newline before appending.ghpm/on its own line. If.gitignoredoesn't exist, create it with.ghpm/\n.
Phase 6: Install Agent Integration (optional)
- Detect the current agent environment and offer to install hooks/rules for enhanced
ghpm-worksessions. See../ghpm-shared/references/integrations.mdfor available integrations.
Claude Code detection: Check if .claude/ directory exists or if the current process is running inside Claude Code.
If detected, ask the user: `` Detected Claude Code. Install session hooks for ghpm-work? (y/n) Hooks add: auto session context injection, stale session detection. Without hooks, ghpm-work still works via explicit commands. ``
If confirmed:
- Add the hooks from
../ghpm-shared/references/integrations.mdinto.claude/settings.local.jsonunder the"hooks"key. - If
.claude/settings.local.jsonalready exists, merge the"hooks"key into the existing structure (preserve existing settings and hooks, add new ones).
If declined or agent not detected, skip.
Phase 7: Report
- Print summary:
ghpm initialized for (/projects/)
Fields: ()
Views: ()
Repos:
Items: cached
Config: .ghpm/config.json (gitignored)
Cache: .ghpm/cache.json (gitignored)
Hooks:
Run /ghpm-status for project overview.
See Also
- [ghpm-shared](../ghpm-shared/SKILL.md) — Prerequisites and error handling
- [ghpm-status](../ghpm-status/SKILL.md) — Project health dashboard
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: jackchuka
- Source: jackchuka/ghpm
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.