Skip to content

idd-all SKILL.md: pseudocode quality (goto bash / branch-exists no-op / stale Failure Modes table) #3

Description

@kiki830621

Problem

From verification of #1 (P2 findings 10, 11, 13 — logic+regression reviewers):
Three pseudocode quality issues in idd-all SKILL.md introduced by #1:

  1. goto Phase 6 is not valid bash — Phase 5 has:

    if [ "$PATH_AXIS" = "direct-commit" ]; then
      echo "→ direct-commit path: skipping push + PR"
      goto Phase 6
    fi

    Implementers pasting this verbatim get a syntax error.

  2. PR-mode branch-already-exists handler is a no-op — Phase 0.5 PR-mode block has:

    if git -C "$CWD" show-ref --verify --quiet "refs/heads/$BRANCH"; then
      # AskUserQuestion: checkout 繼續 or 用 idd/19-...-2?
      :
    fi
    git -C "$CWD" checkout -b "$BRANCH"

    The : is a no-op; the next line guarantees fail with fatal: branch already exists. Failure Modes table promises "AskUserQuestion(checkout / -2 suffix / abort)" but it doesn't exist.

  3. Failure Modes table stale — table still references "Phase 0.3 abort" for working-tree-dirty and not-on-default-branch rows, but those gates moved to Phase 0.5 PR-mode-only.

Type

fix

Why these are P2 not P0/P1

None of these block the conceptual contract. (1) is a paste hazard but reading code shows intent. (2) makes branch-already-exists case fall through to a hard fail, which is recoverable. (3) is doc-vs-impl drift, no behavioral consequence.

Recommendation

  1. Replace goto Phase 6 with a structural conditional:

    if [ "$PATH_AXIS" = "PR" ]; then
      # ... push + PR creation ...
    fi
    # Unconditional: continue to Phase 6
  2. Implement the AskUserQuestion handler properly, OR document that the no-op falls through to a fatal error and that's acceptable. (Pick one.)

  3. Update Failure Modes table rows: Phase 0.3 abort → Phase 0.5 abort for the working-tree and default-branch gates.

Source

Related: #1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions