Fix comments

From MoonLadderStudios/MoonMind · View interactive version

Fix comments is an AI agent skill from the GitHub repository MoonLadderStudios/MoonMind. Resolve GitHub PR feedback end-to-end for the branch you are on. Use when you need to fetch all comments on the branch PR, evaluate whether each comment still applies, decide whether it should be addressed, implement fixes, run compile/tests with retry-on-failure, then commit and push the result.

How to use this skill

Skill file

Fix Comments

Run this as a full remediation workflow for the active branch PR. Do not stop after analysis.

Inputs

If no constraints are provided, default to addressing all applicable feedback.

Security

Workflow

  1. Resolve helpers exclusively from the run's immutable active bundle.

```bash

FIX_COMMENTS_SKILL_DIR="${FIX_COMMENTS_SKILL_DIR:-${MOONMIND_ACTIVE_SKILLS_DIR:+$MOONMIND_ACTIVE_SKILLS_DIR/fix-comments}}"

ACTIVE_SKILLS_DIR="${MOONMIND_ACTIVE_SKILLS_DIR:-$(dirname "$FIX_COMMENTS_SKILL_DIR")}"

test -n "$FIX_COMMENTS_SKILL_DIR" && test -f "$FIX_COMMENTS_SKILL_DIR/SKILL.md"

```

Inside MoonMind, MOONMIND_ACTIVE_SKILLS_DIR is always set and every helper

below resolves from it; a checked-in .agents/skills directory must never

shadow the selected snapshot. Outside MoonMind, set FIX_COMMENTS_SKILL_DIR

to the directory containing this SKILL.md (no MoonMind-only environment

variables required). A missing selected helper is a materialization/packaging

error: stop as blocked instead of substituting stale repository code.

  1. Resolve PR and collect all comments.

same immutable snapshot through the owning skill-materialization

boundary and re-check the helper. Never re-resolve or discover a

different skill set during execution: resolution happens once before

launch, so only the same resolved content may be repaired. Only if the

helper is still missing after that bounded recovery, stop as blocked

with reason comments_helper_missing;

do not use a stale var/pr_comments/current-branch-comments.json and do

not substitute repository-mirrored code, an ad hoc collector, a stale

artifact, or a native classifier.

recovery (re-check PR locator, credential health via targeted checks, one

helper retry), then stop as blocked with reason pr_resolution_unavailable

if still unresolved. Record the exact branch and helper output. Use an

explicit PR number/URL only when it was supplied as a scope constraint for

this run; never invent one. Do not continue from pre-fetched or stale comments unless the helper successfully refreshed var/pr_comments/current-branch-comments.json in this run.

  1. Build a feedback ledger before editing code.
  1. Decide if each comment still applies.
  1. Decide whether each applicable comment should be addressed now.
  1. Implement fixes with the smallest safe change.

while retaining a complete per-comment ledger entry and rationale for every

comment. Never discard deferred or still-applicable feedback to force a

clean result.

When a finding concerns tests broken by a production removal, compare the final

diff with the admitted task before deleting assertions. Preserve the supported

outcome unless its removal or replacement is in scope; bring an unexplained

rollback back through this same correction and review flow.

  1. Run compile/tests and retry until green.

(AGENTS.md, CONTRIBUTING.md, docs) for the touched scope. Do not assume

any engine, editor, toolchain, or platform-specific validation path.

Real tool quirks come only from the selected portable bundle's

adapters/helpers, never from hardcoded editor or engine assumptions.

  1. Finalize and push.

use unconditional git add -A and never commit unrelated pre-existing

work. Preserve configured Git identity (existing authorized configuration

only; missing identity stops as blocked with supported setup, never

invented attribution).

$ACTIVE_SKILLS_DIR/pr-resolver/bin/pr_resolve_commit.py as that Skill

describes; it records a refused commit as local_commit_failed. Standalone,

a refused git commit writes blocked evidence with

--reason local_commit_failed and reports Git's original error. Either way

a local commit failure is never publish_unavailable: nothing was pushed.

re-read the remote branch head and continue from the reconciled state

instead of pushing again blindly. Auxiliary output failures never erase a

verified primary effect and never cause another push on their own.

thread_id. Resolve a current GitHub review thread only when every

non-outdated comment in that thread has a ledger disposition of addressed or

not-applicable. If any comment in the thread is deferred, unclassified, or

still applicable, leave the entire thread unresolved. The refreshed comments

artifact exposes the GraphQL node as thread_id; resolve eligible threads with

GitHub's resolveReviewThread mutation. Never resolve an outdated thread. If a

fully handled current thread cannot be resolved, stop as blocked with reason

publish_unavailable; an unresolved current thread remains an authoritative

merge blocker.

```bash

gh api graphql \

-f threadId="$THREAD_ID" \

-f query='mutation($threadId:ID!){resolveReviewThread(input:{threadId:$threadId}){thread{isResolved}}}'

```

```bash

python3 "$ACTIVE_SKILLS_DIR/_shared/publish_evidence.py" write-pushed \

--skill-id fix-comments \

--repo "$REPO" \

--branch "$BRANCH"

```

If there was no commit to push, use:

```bash

python3 "$ACTIVE_SKILLS_DIR/_shared/publish_evidence.py" write-no-op \

--skill-id fix-comments \

--repo "$REPO" \

--branch "$BRANCH"

```

If push or remote verification is denied or unavailable, write blocked

evidence and stop as blocked with reason publish_unavailable:

```bash

python3 "$ACTIVE_SKILLS_DIR/_shared/publish_evidence.py" write-blocked \

--skill-id fix-comments \

--repo "$REPO" \

--branch "$BRANCH" \

--reason publish_unavailable

```

Do not report success.

Output

Provide a concise report with:

Notes

Comment Resolution Ledger

After classifying all comments, write the ledger to artifacts/pr_resolver_addressed_comments.json (this is the path the pr-resolver snapshot reads).

artifacts/ is ignored and holds no tracked files, so a fresh clone does not

contain it. Always create the parent directory before writing the ledger.

Write the file with whatever file-writing capability the current runtime

provides (shell redirection or file tool). Example:

mkdir -p artifacts
cat > artifacts/pr_resolver_addressed_comments.json << 'EOF'
[...]
EOF

The format is a JSON array of objects:

[
  {
    "id": 12345678,
    "disposition": "addressed",
    "rationale": "Removed unused import in commit abc1234."
  },
  {
    "id": 87654321,
    "disposition": "not-applicable",
    "rationale": "Informational summary from bot, no action needed."
  },
  {
    "id": 24681357,
    "disposition": "deferred",
    "rationale": "Needs a product decision on the retry budget; out of scope here."
  }
]

Accepted disposition values: addressed, not-applicable, deferred. The id

field must match the comment's numeric id from the comments JSON. Alternatively,

comment_id and status field names are also accepted for backwards compatibility.

Record every comment you decided not to fix in this pass as deferred. A

deferred comment is not treated as handled: pr-resolver reads the ledger,

sees that the comment is still present, and stops the merge loop for manual

review instead of repeating a remediation pass that cannot make progress. Never

downgrade a still-applicable comment to not-applicable to keep the loop

running.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.