.claude/skills/step-03-analyze-comment/SKILL.md
# step-03-analyze-comment ## What it does Goes to the discussion URL, verifies the comment matches the body field, reviews the diff in depth, and optionally browses the repo for additional context. Produces a thorough understanding of what the comment is pointing out and whether its claims are correct. ## Prerequisites - Step 02 completed (PR analyzed, diff saved) ## Context > See `docs/steps/step2.md`, `docs/steps/step3.md`, `docs/steps/step4.md`, and `docs/steps/step5.md` for reference. ##
npx skillsauth add Pepe39/chameleon-pr .claude/skills/step-03-analyze-commentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Goes to the discussion URL, verifies the comment matches the body field, reviews the diff in depth, and optionally browses the repo for additional context. Produces a thorough understanding of what the comment is pointing out and whether its claims are correct.
See
docs/steps/step2.md,docs/steps/step3.md,docs/steps/step4.md, anddocs/steps/step5.mdfor reference.
id (required): Task IDRead task_info.md to get: body, discussion_url, repo_url, file_path, diff_line, PR context.
Read work/pr_diff.txt for the full diff.
Update progress.md: step 03 status = "in-progress", Started = {timestamp ISO 8601}.
Open the discussion_url using browser tools or gh CLI to verify that the comment shown on GitHub matches the body field in the input data.
If the comment is not visible in Files Changed (common for Outdated comments), use these methods:
original_commit_id to see the comment in context with the code as it was.# Fetch the review comment by ID
gh api repos/{nwo}/pulls/comments/{comment_id} --jq '.body'
If the comment does NOT match the body field: Report to the user and STOP. Do not continue labeling with mismatched data.
Determine the comment's state: Active, Outdated, Resolved, or Outdated & Resolved.
Detect Outdated: Compare the code at comment_commit around diff_line in file_path with the code at head_sha at the same location. If the lines changed, the comment is Outdated.
Detect Resolved: Use GraphQL to check if the review thread is resolved:
gh api graphql -f query='query {
repository(owner:"{owner}", name:"{repo}") {
pullRequest(number:{pr_number}) {
reviewThreads(first:100) {
nodes { isResolved comments(first:1) { nodes { databaseId } } }
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.comments.nodes[0].databaseId == {comment_id}) | .isResolved'
If the GraphQL call fails, default to "unknown" and note in task_info.md.
Classify:
Update task_info.md Input Data: set **Comment State:** to the classified value.
Evaluation rules by state:
comment_commit (the original code), not HEAD. Note in the analysis what changed afterwards.If step-02 flagged orphan = true (original commit removed by force push):
**Orphan Comment:** Original commit removed by force push. Evaluation based on comment body only.Read the full diff from work/pr_diff.txt. Focus on:
file_path at diff_line. Understand what code was changed and why.Document your understanding:
diff_line?Determine if the comment requires context beyond the diff. Indicators:
If additional context is needed:
Primary method (local clone):
If work/repo/ exists in the task directory (cloned in step 02), browse files directly.
Important: Check the Repo Clone field in task_info.md first. If it says SHA MISMATCH, cross-check any file content you read against the diff in work/pr_diff.txt to detect inconsistencies. If the local file content contradicts the diff, fall back to the gh api contents method for that file.
# Read the target file in full
cat "tasks/{date}/{id}/work/repo/{file_path}"
# Search for function definitions, usages, patterns
grep -rn "function_name" "tasks/{date}/{id}/work/repo/src/"
# Explore directory structure
ls "tasks/{date}/{id}/work/repo/{directory}/"
# Find related files (imports, base classes, configs)
grep -rn "import.*ModuleName" "tasks/{date}/{id}/work/repo/"
Fallback (if clone failed or work/repo/ does not exist):
Use comment_commit from the task_info.md "Comment Commit" field. If that field is missing or says "(populated after step 02)", fall back to head_sha with a warning in task_info.md that the file content may not reflect the exact code state when the comment was made.
gh api repos/{nwo}/contents/{file_path}?ref={comment_commit} --jq '.content' | base64 -d
Document what files you consulted and why.
Re-read the body field with full context. Answer these questions and record them:
What specific issue is the comment pointing out?
Is the comment factually correct?
What context was needed to make this comment?
How impactful is the underlying issue (if real)?
Does the comment require knowledge beyond the diff?
Before updating task_info.md, verify that the task inputs are internally consistent. This catches mismatched data early, before labeling begins.
6a. Verify the PR matches the comment
6b. Verify the comment_commit contains the problem
Use comment_commit from task_info.md (the exact commit the reviewer commented on). If comment_commit is not available and the comment is not orphaned, fall back to head_sha as last resort.
comment_commit, does the code exhibit the issue described in the comment?If Comment State is Outdated or Outdated & Resolved, also compare the code at comment_commit vs head_sha and classify the outcome:
comment_commit but was resolved in a later commit. Record "Problem fixed in subsequent commit. Comment was valid at the time it was made."In all Outdated cases, evaluate Quality based on whether the comment was correct at the time it was made (at comment_commit), not based on the current state of the code.
Common error to avoid: Evaluating against the final code (HEAD) and concluding "the comment does not make sense" when it was actually valid for the original code at comment_commit.
6c. Verify the PR resolves what it claims
6d. Record findings
Add a consistency section to the analysis:
### Data Consistency
- **PR matches comment:** Yes/No - {brief explanation}
- **Problem at comment_commit:** Confirmed/Not found/Already fixed - {brief explanation}
- **PR resolves its claims:** Yes/Partially/No - {brief explanation}
If any check reveals a critical mismatch (e.g., the file does not exist in the PR, the head_sha points to a completely different state), report to the user and STOP. Minor discrepancies should be recorded and factored into labeling.
Add to the Analysis section:
### Comment State
- **State:** {Active | Outdated | Resolved | Outdated & Resolved}
- **Outdated Analysis:** {only if Outdated: fixed afterwards | still persists | different problem introduced}
### Comment Analysis
- **Comment Verified:** Yes/No (matches body field)
- **Issue Identified:** {1-2 sentence summary of what the comment points out}
- **Factually Correct:** Yes/No/Partially — {brief explanation}
- **Context Consulted (verification):**
- {file_path}:{lines} — {why you read this to verify the comment}
- {other_file}:{lines} — {why} (if applicable)
- **Context Needed (reviewer):**
- {file_path}:{lines} — {why the reviewer needed this to make the comment}
- (Only list what the reviewer minimally needed, not everything you read)
- **Impact Assessment:** {brief assessment of the issue's real-world impact}
- **Beyond Diff:** Yes/No — {brief explanation of what the reviewer needed, not what you consulted}
### Data Consistency
- **PR matches comment:** Yes/No — {brief explanation}
- **Problem at comment_commit:** Confirmed/Not found/Already fixed — {brief explanation}
- **PR resolves its claims:** Yes/Partially/No — {brief explanation}
Update progress.md: step 03 status = "done", Completed = {timestamp ISO 8601}, Current Step = 04 - Label Quality.
testing
step-09-recheck
development
# step-08-generate-output ## What it does Compiles all four axis labels into the final JSON output, validates consistency, and generates the deliverable file ready for submission. ## Prerequisites - Steps 04-07 completed (all four axes labeled) ## Context > See `docs/steps/step10.md` for the submission checklist. ## Arguments - `id` (required): Task ID ## Instructions ### 1. Recover context Read `task_info.md` — extract all four labels and their reasoning from the Labels section. Update
testing
# step-07-label-advanced ## What it does Labels Axis 4 — Advanced. Derives the Advanced label from Context Scope using a deterministic mapping. ## Prerequisites - Step 06 completed (Context Scope labeled) ## Context > See `docs/axis-4-advanced.md` for the mapping rule and definitions. > See `DOCUMENTATION.md` section 7 (Axis 4) for the rationale. ## Arguments - `id` (required): Task ID ## Instructions ### 1. Recover context Read `task_info.md` — specifically the Context Scope label from s
documentation
# step-06-label-context-scope ## What it does Labels Axis 3 — Context Scope. Determines what level of context a reviewer would need to confidently make this comment and documents all evidence used. ## Prerequisites - Step 05 completed (Severity labeled) ## Context > See `docs/axis-3-context-scope.md` for definitions, evaluation criteria, and examples. > See `docs/steps/step8.md` for the step-by-step process. > See `DOCUMENTATION.md` sections 8 (FAQ), 9 (Common Mistakes), and 10 (Tips) for edg