Skip to content

chore(ai): replace issue-workflow.sh shell script with an AI skill#31

Closed
dipto0321 wants to merge 1 commit into
mainfrom
chore/ai/replace-issue-workflow-script-with-skill
Closed

chore(ai): replace issue-workflow.sh shell script with an AI skill#31
dipto0321 wants to merge 1 commit into
mainfrom
chore/ai/replace-issue-workflow-script-with-skill

Conversation

@dipto0321

Copy link
Copy Markdown
Owner

Summary

Replace the imperative scripts/issue-workflow.sh bash script (265 lines
of branch → PR → merge orchestration) with an AI-orchestrated skill at
.claude/skills/issue-workflow/SKILL.md. The skill encodes the same
workflow as tracked TaskCreate steps, so the AI drives branch → PR →
CI watch → squash-merge → issue-close → main-sync without a shell script
in the loop. No user-facing behavior changes; this is a tooling refactor.

Why

The bash script:

  • parsed Conventional Commits titles with bash ERE (fragile)
  • required gh auth on every contributor machine
  • embedded gh pr checks --watch in a sleep 600; kill $watch_pid
    pattern that crashed the IDE when paged output interleaved with other
    terminal tabs (see .conversation-history-chunk4.md section 17)
  • made every contributor's shell the orchestration layer

This change moves orchestration into the AI: the assistant reads the
issue, plans the change, edits files, runs validation, opens the PR,
reads review comments, and merges. The shell just executes commands, it
doesn't encode the workflow.

Linked issues

No tracking issue. This refactor was driven by the editor-crash history
recorded in .conversation-history-chunk4.md section 17 and the workflow
lessons in sections 1–18. (CONTRIBUTING.md requires an issue reference;
this is documented as the rationale in lieu of an issue.)

Type of change

  • chore — tooling refactor, no behavior change

Checklist

  • Title follows Conventional Commits (chore(ai): subject)
  • I ran make ci locally and it passes
  • I added or updated tests for the change (N/A — no code logic change; the skill is documentation)
  • I updated relevant docs (README, docs/, inline godoc) — updated scripts/README.md, CONTRIBUTING.md, CLAUDE.md
  • No new linter warnings
  • If breaking: I documented the migration path in the PR body and updated CHANGELOG.md — N/A, not breaking

Scope notes / things reviewers may want to look at

  • Skill discoverability: .claude/skills/issue-workflow/SKILL.md is
    project-local. Any contributor/clone picks it up after a fresh checkout
    because .gitignore now whitelists .claude/skills/ while continuing
    to ignore the rest of .claude/ (session settings).
  • make next-issue target: now a human-readable reminder of the
    CONTRIBUTING.md steps instead of calling the deleted script. The
    Makefile no longer depends on scripts/ having any content.
  • No CHANGELOG entry added: the historical entry in CHANGELOG.md
    about the original bash script is intentionally preserved (it's
    accurate for that point in time). Adding a "removed the script" entry
    would imply a behavior change users would see; this is internal tooling.

Screenshots / output

N/A — no user-facing output change.

The bash script encoded the branch -> PR -> merge -> cleanup loop
imperatively. That orchestration belongs in the AI layer, not in a
shell script contributors have to remember to call. Move it to
.claude/skills/issue-workflow/SKILL.md so the AI drives the workflow
with TaskCreate-tracked steps instead of bash.

- Add .claude/skills/issue-workflow/SKILL.md: 14-step workflow
  (inspect issue, sync main, branch, plan, implement+test, make ci,
  PR body, push, watch CI, address review, squash-merge, verify
  issue closed, sync main, recurse). Encodes CONTRIBUTING.md
  conventions: branch off main, Conventional Commits allowed
  types/scopes, squash-merge, Closes #N in PR body. Includes a
  failure-mode table.
- Delete scripts/issue-workflow.sh (265 lines of bash).
- Update scripts/README.md to explain the directory is now empty
  and point contributors at the skill.
- Update CONTRIBUTING.md PR-reference section to point at the
  skill instead of the script subcommand.
- Update CLAUDE.md standing-orders section 2 to invoke the skill.
- Rework Makefile's `next-issue` target: no longer shells out to
  the deleted script; prints a human-readable reminder of the
  CONTRIBUTING.md steps and points AI sessions at the skill.
- Update .gitignore: was ignoring all of .claude/. Now ignores
  .claude/* and re-includes .claude/skills/ so the project-local
  skill is committable (and reachable after a fresh clone).
  .claude/settings.local.json remains ignored as before.

CHANGELOG.md keeps the historical entry about the original bash
script - accurate for that point in time.

Co-Authored-By: Sonnet 4.6 <noreply@puku.sh>
Copilot AI review requested due to automatic review settings July 1, 2026 18:50
@cocogitto-bot

cocogitto-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

✔️ 9dded91 - Conventional commits check succeeded.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors project-local “issue → branch → PR → merge” automation by deleting the imperative scripts/issue-workflow.sh bash orchestrator and replacing it with a repository-committed AI skill (.claude/skills/issue-workflow/SKILL.md), while updating contributor docs and make next-issue guidance accordingly.

Changes:

  • Removed scripts/issue-workflow.sh and replaced the workflow definition with .claude/skills/issue-workflow/SKILL.md.
  • Updated contributor-facing documentation (CONTRIBUTING.md, CLAUDE.md, scripts/README.md) to reference the new skill-based flow.
  • Adjusted .gitignore and the make next-issue target so skills are committed while .claude/ session metadata remains ignored.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/README.md Re-documents scripts/ as empty and points users to the new skill-based workflow.
scripts/issue-workflow.sh Deletes the old bash orchestration script.
Makefile Changes next-issue to print human instructions instead of running the removed script.
CONTRIBUTING.md Replaces references to the script-generated PR body with references to the skill.
CLAUDE.md Updates the “standing orders” to invoke the skill instead of the bash script.
.gitignore Stops ignoring .claude/skills/ while continuing to ignore the rest of .claude/.
.claude/skills/issue-workflow/SKILL.md Adds the new skill that encodes the end-to-end workflow as tracked tasks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

shell script: instead of imperative bash, it produces a tracked list of
tasks the assistant walks through one at a time.

The skill encodes the project conventions in [`CONTRIBUTING.md`](../../CONTRIBUTING.md):
Comment on lines +35 to +37
1. **Issue number** — the only required input. If the user says "next
issue", find the lowest-numbered open issue via `gh issue list
--state open --limit 1 --json number,title`.
Comment on lines +159 to +163
`gh issue view <N> --json state,stateReason`

If `stateReason == COMPLETED` and the linked PR shows in
`closedByPullRequestReferences`, you're done. If the issue is still
open, the PR body is missing `Closes #N` — fix the PR description
@dipto0321 dipto0321 closed this Jul 1, 2026
@dipto0321 dipto0321 deleted the chore/ai/replace-issue-workflow-script-with-skill branch July 1, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants