Mcp attribution worktree

From TencentCloudBase/CloudBase-AI-Toolkit · View interactive version

Mcp attribution worktree is an AI agent skill from the GitHub repository TencentCloudBase/CloudBase-AI-Toolkit. Triage, repair, and close MCP attribution issues from the local report API with evidence-driven decisions and isolated Worktrunk worktrees. Use this skill when Codex needs to process `tool` attribution issues and skills-related attribution issues, inspect related runs, decide whether the issue is ac

How to use this skill

Skill file

MCP Attribution Worktree

Process MCP and skills-related attribution issues as an auditable maintenance workflow instead of ad-hoc debugging.

What this skill does

Use this skill to:

Do not use this skill for

Workflow

  1. Start with focused tool and skill backlog queries.
  2. Process one issue at a time. Never mix evidence, notes, or worktrees across issues.
  3. Run the existing-artifact preflight before choosing the representative run: read issue detail, current notes, existing externalUrl, and the state of any linked GitHub issue or PR. If a GitHub issue or PR already exists, treat it as part of the current state, not a finished endpoint.
  4. Read at least one run's result and trace. Prefer to also read evaluation-trace.
  5. Check the relevant implementation in mcp/src or config/source/skills before deciding whether the issue is actionable.
  6. When the failure is caused by model misunderstanding, prefer repairs that translate repo-specific behavior into concepts the model already knows well. Reuse familiar abstractions, canonical API names, and one safe example instead of adding long product-specific explanations.
  7. If the issue is actionable in repo code or skills content, do not stop at attribution triage. Open or link the matching GitHub issue, create a dedicated Worktrunk worktree, implement the fix, validate it, and prepare a PR.
  8. If review comments, review decisions, or later evidence show the direction is wrong, start another focused iteration from the existing GitHub issue or PR context and continue improving instead of treating the first PR as final.
  9. Update attribution fields through the report API after you have the right evidence, and update them again when the GitHub issue, PR, or evaluation result becomes available.
  10. Before changing an attribution to resolved, run a closure preflight on the linked GitHub artifact again: reread the latest PR comments, review comments, review decisions, and issue comments after the most recent code push or evaluation result.
  11. When a real evaluation interface exists, run a post-PR evaluation and use the result plus the closure preflight to decide whether to continue iterating or mark the issue closed.
  12. Only stop after the issue is either clearly non-actionable or has been carried through the repair loop as far as the current environment allows.

Common requests

Routing

| Task | Read |

| --- | --- |

| Run the report API triage flow and update attribution fields across tool and skills-related issues | references/report-api-workflow.md |

| Decide whether an issue is valuable and map it to mcp/src or config/source/skills | references/value-triage.md |

| Create GitHub issues, use Worktrunk, and repair the repo in isolation | references/worktree-repair.md |

| Continue from review feedback or real evaluation results after a PR already exists | references/iteration-loop.md |

| Trigger real evaluation runs and interpret the result | references/evaluation-verification.md |

| Dispatch one issue per worker and enforce closure-sweep rules in sub-agent prompts | references/subagent-orchestration.md |

Model-oriented repair heuristic

When attribution evidence shows the model is failing because a tool or skill exposes repo-specific semantics in an unfamiliar way, prefer repairs that reduce translation work for the model.

Operating rules

Required preflight

Before starting a fresh diagnosis or code iteration for an attribution issue, complete this checklist in order:

  1. Read the attribution detail plus the latest notes.
  2. Read externalUrl if present.
  3. If externalUrl points to a GitHub issue, check whether it is open or closed and whether later comments changed the fix direction.
  4. If externalUrl points to a PR, check whether it is open, merged, closed, or superseded.
  5. Read PR comments, review comments, and review decisions before deciding whether to continue the same branch or start a new iteration.
  6. Only after that, pick the representative run and continue into result, trace, and evaluation-trace.

Required closure preflight

Before changing an attribution to resolved, complete this checklist in order even if you already did the normal preflight earlier:

  1. Reopen the linked GitHub issue or PR.
  2. Re-read the latest top-level comments, review comments, and review decisions.
  3. Confirm whether any comment arrived after the latest code push, PR update, or evaluation result.
  4. If new feedback exists, keep the attribution in_progress and continue the loop.
  5. Only if there is no newer unresolved feedback, evaluate whether closure evidence is now strong enough.

Quick commands

curl -s 'http://127.0.0.1:5174/api/attributions?category=tool&resolutionStatus=todo&limit=50'
curl -s 'http://127.0.0.1:5174/api/attributions?category=skill&resolutionStatus=todo&limit=50'
curl -s "http://127.0.0.1:5174/api/attributions/<issueId>"
curl -s "http://127.0.0.1:5174/api/runs/<caseId>/<runId>/result"
curl -s "http://127.0.0.1:5174/api/runs/<caseId>/<runId>/trace"
curl -s "http://127.0.0.1:5174/api/runs/<caseId>/<runId>/evaluation-trace"
wt switch --create feature/attribution-<slug>
gh issue create --repo TencentCloudBase/CloudBase-MCP
gh pr view <number> --comments --repo TencentCloudBase/CloudBase-MCP
gh pr create --repo TencentCloudBase/CloudBase-MCP
curl -s -X POST http://127.0.0.1:5174/api/evaluations

Minimum self-check

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.