Skip to content

Argument Parsing

Standardized rules for how all GHS skills parse $ARGUMENTS --- the raw string passed when a user invokes a skill.

Invocation Example

/ghs-backlog-fix owner/repo --item tier-1--license --dry-run

Repo Detection

Skills auto-detect the target repository using this priority:

PrioritySourcePattern
1First positional argowner/repo
2Full GitHub URLhttps://github.com/owner/repo --- extract owner/repo
3Auto-detectgh repo view --json nameWithOwner -q .nameWithOwner
4PromptAsk user if detection fails

URL normalization:

  • Strip https://github.com/ prefix
  • Strip trailing /, .git, /issues/..., /pulls/...
  • Result must match ^[^/]+/[^/]+$

Flag Extraction

All flags use -- prefix. No short flags (e.g., -d) are supported.

Boolean Flags

FlagBehavior
--dry-runShow what would happen without executing
--allProcess all eligible items instead of prompting to select
--autoSkip interactive confirmations
--resumeResume from last persisted state

Value Flags

FlagValue TypeExample
--item <slug>string--item tier-1--license
--tier <N>integer (1--3)--tier 2
--pr <number>integer--pr 42
--budget <N>integer--budget 5
--bump <level>major|minor|patch--bump minor
--stages <list>comma-separated--stages pull,scan,fix

Issue/PR Number Parsing

Input FormatResult
#42issue/PR number 42
bare 42 (after repo arg)issue/PR number 42
owner/repo#42repo = owner/repo, number = 42
https://github.com/owner/repo/issues/42repo = owner/repo, number = 42
https://github.com/owner/repo/pull/42repo = owner/repo, number = 42

Disambiguation: If a bare integer appears without explicit --pr or --item, treat as an issue/PR number only when the skill context expects one (e.g., ghs-issue-implement, ghs-review-pr).

Item Slug Normalization

Project item slugs use kebab-case with double-dash tier prefix: tier-1--license, ci-workflow-health.

InputNormalized Match
tier-1--licenseexact match
licensepartial match --- tier-1--license (first match wins)
ci-workflowpartial match --- ci-workflow-health
TIER-1--LICENSEcase-insensitive match

Partial match rule: Match any slug that contains the input as a substring (case-insensitive). If multiple slugs match, prefer the one with the shortest total length.

Defaults When No Arguments

ScenarioBehavior
No args at allAuto-detect repo from gh repo view; use skill defaults for all flags
Repo not detectablePrompt: "Which repo? (owner/repo)"
Flag omittedUse skill-defined default (documented per skill)
Ambiguous partial slugList matches and prompt user to select

Common Flag Patterns

Universally available flags across skills:

FlagTypeSkills That Use ItBehavior
--dry-runbooleanbacklog-fix, backlog-sync, merge-prs, orchestrate, releaseShow what would happen without executing
--allbooleanbacklog-fix, issue-triage, merge-prsProcess all items instead of selecting
--autobooleanissue-triage, orchestrateSkip interactive confirmations
--resumebooleanorchestrateResume from last persisted state

Parsing Order

Recommended parse order from $ARGUMENTS:

1. Extract owner/repo   --- first positional token matching owner/repo or full URL
2. Extract issue/PR #   --- token matching #N, bare N (context-dependent), or URL
3. Extract flags        --- all --prefixed tokens and their values
4. Remaining tokens     --- free-form identifiers: slugs, descriptions, search terms

Priority conflicts: Explicit --pr or --item flags override positional detection.

Released under the MIT License.