SuperAPI AI Directory

kstack-bot-driven-development

Coding & development

View repository

Updated 11-23 16:27

About this skill

kstack-bot-driven-development

A development flow for the bot to carry a request through to the end by itself. For how to carve out phases, implement, and run the review subagent, follow steps 1, 3, 4, and 5 of skill://kstack-root-driven-development , and this SKILL replaces the following 3 points. The user sees only the PRs, and the bot does not stop to wait for the user's reply.

root-driven-development This SKILL
Step 2: Agree on requirements with the user one question at a time Step 1: The root decides from the request, notifies, and proceeds
Get approval before writing an implementation that deviates from existing patterns Step 2: Write with a plan that follows existing patterns, and leave deviating plans in the PR's 未解決事項 leave in
Step 6: Stop at the user review gate in Crit until approved Step 3: Submit as a gh stack PR and proceed to the next phase without waiting for approval

In this SKILL, the instructions in steps 3, 4, and 5 of root-driven-development — "carve out the next phase only after the previous phase is approved," "stop and ask about scope changes or open items," "seek the user's approval before writing," and "ask the user at the gate" — are also carried out without stopping, and what was decided and what the user should decide are written in that phase's PR's 未解決事項 . Stop and ask only in the cases of steps 1 and 2 below.kstack-review-request(Crit) is not used. For how to write commits and PRs, follow skill://kstack-git .

Workflow

  1. Decide the purpose and notify — The root decides 目的 / 対象 / 完了条件 / 対象外 from the request, notifies the requester, and proceeds without waiting for approval. Only when the purpose or completion criteria cannot be determined from the request, ask one question with background and decision materials and stop. The phase notification in step 3 of root-driven-development likewise does not wait for approval
  2. If it seems to deviate from existing patterns, follow existing patterns — Do not write plans that correspond to "implementations that deviate from existing patterns" in root-driven-development; implement with a plan that follows existing patterns. Write the deviating plan and its cost in one line in that phase's PR's 未解決事項 . Only when there is no plan that follows existing patterns, present both plans and stop to ask
  3. Submit the phase as a PR and proceed — After fixing in the review of step 5 of root-driven-development, submit the PR with "Stack the phase on the stack" below and notify the requester of the PR URL. Return to step 3 (root-driven-development) without waiting for approval and carve out the next phase. If nothing remains in the list, finish by listing the URLs of all PRs in order from the bottom layer
Bad: フェーズの PR を出した後、user の approve を待って止まる / 依頼の解釈を user に確認してから始める
Good: 目的と完了条件を通知して始め、フェーズごとに PR を出して URL を伝え、そのまま次のフェーズを実装する

Why: the bot's requester does not reply on the spot, so waiting for confirmation or approval stops the work there. If what was decided is left in notifications and PRs, the user can later overturn the decision in the PR.

Stack the phase on the stack

  1. Before starting the implementation of a phase, create a branch. The first phase is from the default branch, gh stack init <topic>, and from the second one onward, gh stack add <topic>(-m・-A is not added). Name the branch in kebab-case to represent the outcome of the phase. When starting from a branch that already has a PR, gh stack init --base <default branch> <その branch> to bring it in, then gh stack add it
  2. Stage only the changes of the current phase, and commit withkstack-git "How to write commits"
  3. gh stack submit --auto push with, and create a draft PR. The PR from--auto has the branch name as its title, an empty body, and no assignee, so make it the title and body of steps 3 and 4 of "How to create a PR" ingh pr edit <URL> で kstack-git , and add--add-assignee @me . In the body's 確認方法 , write what was fixed by the review subagent, and for the remaining decisions, add a 未解決事項 section at the end and write them
  4. kstack-git In steps 6 and 7 of "How to create a PR", have the subagent check the PR's appearance. Also have it check whether the base is the branch of the phase one level below (the default branch for the first phase)
  5. Monitor the CI of the pushed commit with kstack-git "Monitor the CI of the pushed commit until it completes". Make the monitoring a background job and proceed to the next phase without waiting for it to finish
Bad: 全フェーズを 1 つの branch に積み、最後に 1 つの PR にする / gh stack submit の自動の title・空の body のまま通知する
Good: フェーズごとに gh stack add した branch で commit し、submit 後に kstack-git の title・body・assignee に直してから URL を通知する

Why: With a PR per phase, the user can review only that phase's diff in each PR and merge from the bottom layer up. The automatic values of submit differ from the kstack-git form, and the user cannot read the contents from the PR list.

Fix PR comments and CI failures

Fix review comments and CI failures of your own PR on that phase's branch without waiting for instructions (kstack-git "Do not fix and re-push without instructions on failure" is replaced for PRs in this SKILL). Do not switch branches while holding the diff of the phase in progress; respond after submitting that phase's PR.

  1. gh stack checkout <PR URL> to move to the target branch, fix it, and commit with kstack-git "How to write commits"
  2. gh stack rebase --upstack to propagate to the upper branch, and push withgh stack push . Resolve conflicts in the upper layer and continue withgh stack rebase --continue continue with
  3. Reply to the commented PR with what was fixed, and monitor the CI of the pushed commit. If the description of the upper-layer PR becomes outdated, append to the body
Bad: 指摘を最上段の branch で直す / 直した branch だけ push し、上の層を古い base のままにする
Good: 指摘された PR の branch で直し、--upstack で上の層に伝えてから gh stack push する

Why: If you fix outside the commented phase, the fix does not appear in that PR's diff, and the user cannot verify the fix in the PR. If you do not propagate to the upper layer, the old diff gets mixed into the upper PR.

merge

Merge only when there is an explicit instruction from the user. For the instructed PR and all PRs in the layers below it, after checking steps 1–3 of "Merge a PR" in kstack-git (gh pr ready, CI, and the state where approve and merge are possible), merge them together from the bottom layer withgh stack merge <指示された PR 番号> --squash --yes(or the method allowed if the repo does not allow squash). Do not treat approve or resolution of comments as permission to merge.

Why: gh stack merge only verifies in advance that it is not a draft, and merges all layers below the specified PR at once. If executed without verification, even the lower layers whose CI or approval has not been verified will enter the default branch.