Gitkkal PR
Create or refresh a pull request using current branch history and intent.
Agent-Agnostic Rules
- •Do not assume client-specific UI features (forms, plan mode, special slash-command runtime).
- •Treat trigger command examples as optional; plain-language requests are equally valid.
- •Use a hint-first input model: accept one optional free-form hint string (for example, command tail text).
- •Do not require strict named parameters for normal usage.
- •Ask follow-up questions in plain chat when base branch or PR focus is unclear.
- •Ask one clear follow-up at a time for unresolved decisions.
- •If asking the user to choose from multiple options, always render choices as standalone numbered lines (
1),2),3), ...).- •Do not use Markdown ordered-list syntax (
1.,2., ...), and do not prefix question text with list numbers. - •Restart numbering at
1)for every question.
- •Do not use Markdown ordered-list syntax (
Input Model
- •Optional input:
[hint] - •Treat hint as advisory context for PR framing (focus, title emphasis, summary wording).
- •If hint is absent, infer PR focus from commits and diff.
- •If hint conflicts with branch changes, ask one clarification before creating/updating.
Workflow
- •Resolve repo root and load gitkkal config if present.
- •Capture optional hint input.
- •Read user-provided free-form hint if present.
- •Verify GitHub CLI state.
- •Run
gh auth status. - •If unavailable or unauthenticated, switch to fallback mode:
- •generate PR title/body output in markdown,
- •provide exact
ghcommands the user can run later, - •and do not attempt
gh pr create/edit.
- •Detect mode.
- •In normal mode, run
gh pr view --json number,statefor current branch. - •Open PR => update mode.
- •Missing/closed/merged => creation mode.
- •Validate branch safety.
- •Disallow PR creation from
mainormaster. - •Never use
git push --force.
- •Analyze branch intent.
- •Start with commit history and
git diff --statfrom base toHEAD. - •Read file-level diffs only when intent is unclear.
- •Focus on purpose and impact rather than listing files.
- •Build PR content.
- •Keep title under 50 chars, imperative mood.
- •Follow configured language (
enorko) when available. - •Body must include
SummaryandTest plansections. - •If repository PR template exists, follow that structure.
- •Execute action.
- •In normal mode:
- •Creation: push branch if needed, then
gh pr create --title ... --body .... - •Update: fully replace existing title/body with
gh pr edit.
- •Creation: push branch if needed, then
- •In fallback mode:
- •return final title/body text and command snippets only.
- •Report resulting PR number, URL, and mode (created or updated).
Guardrails
- •Never include
Co-Authored-Bylines in PR body. - •Never modify merged PRs.
- •Never append to stale PR description in update mode; rewrite completely.
- •If intent is ambiguous, ask the user for the PR's primary focus.