AgentStack
SKILL verified MIT Self-run

Ghpm Init

skill-jackchuka-ghpm-ghpm-init · by jackchuka

Initialize GitHub Project Management config. Auto-discovers project schema (fields, views, repos) and generates .ghpm/config.json + .ghpm/cache.json.

No reviews yet
0 installs
9 views
0.0% view→install

Install

$ agentstack add skill-jackchuka-ghpm-ghpm-init

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No 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.

Are you the author of Ghpm Init? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

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

  1. Parse arguments to extract owner and project number from URL or positional args.
  2. Run gh auth status to verify authentication. If this fails, tell the user to run gh auth login and stop.
  3. Run gh project view --owner --format json to 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.
  4. Determine the owner type from the project view output. This matters for Phase 3: use organization(login: "") for org-owned projects or user(login: "") for user-owned projects.

Phase 2: Discover Schema

  1. Run gh project field-list --owner --format json to get all fields with IDs, types, and options.
  2. Identify the workflow field: find the ProjectV2SingleSelectField named "Status". If multiple candidates or none found, ask the user which field drives the kanban workflow.
  3. Separate the workflow field from other fields.

Phase 3: Discover Views

  1. 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
            }
          }
        }
      }
    }
  }
}'
  1. 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

  1. Run gh project item-list --owner --format json --limit 1000 to fetch all items. The --limit flag 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.
  2. Extract unique repository URLs from items to build the repos list.
  3. Store all items in cache.

Phase 5: Write Config Files

  1. Assemble .ghpm/config.json with 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 sort key on views that have sort fields.
  • Only include group_by key on views that have groupBy fields.
  • Only include options on fields that are single_select or iteration type.
  • Strip the full URL from repos, keep just owner/repo.
  1. Write .ghpm/cache.json per ../ghpm-shared/references/cache.md.
  1. Run mkdir -p .ghpm/sessions. Check if .gitignore exists. 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 .gitignore doesn't exist, create it with .ghpm/\n.

Phase 6: Install Agent Integration (optional)

  1. Detect the current agent environment and offer to install hooks/rules for enhanced ghpm-work sessions. See ../ghpm-shared/references/integrations.md for 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.md into .claude/settings.local.json under the "hooks" key.
  • If .claude/settings.local.json already 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

  1. 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.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.