Install
$ agentstack add skill-grasscaograss-awesomeweldoneskills-weld-plan-debug ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Weld Planning Debug Workflow
1. Prerequisite Checks
Before investigating, confirm the following are available:
- Stack trace or error log from the user (production log, simulation log, or pasted exception).
- Key source files exist in the current working tree:
src/Robim.Devices.Robot/Plan/Solver/RobotPlanSolver.cs— solver core, throwsSolvePath Failed!src/Weldone.Application/Plan/PlanManager.DualArm.cs— dual-arm transition planningsrc/Weldone.Application/Robot/ExternalRobotAppService.cs— external axis pre-planningsrc/Weldone.Domain/WorkpieceManager/WorkpieceManagerBase.cs— seam group parsingsrc/Weldone.Application/Plan/SolveStrategy/DualArmStrategy.cs— dual-arm param builder- ILogger instance is accessible in the failing class (verify
using Microsoft.Extensions.Logging;). - OpenSpec spec for the feature area exists under
openspec/specs/oropenspec/changes/(check for intended behavior).
If the user only says "planning failed" without a stack trace, ask for the log first.
2. Step-by-Step Procedure
Step 1 — Anchor on the stack trace (30 seconds)
- Read the error message the user pasted.
- Identify the topmost method name and line number in the Weldone/Robim namespace.
- Formulate a 2-sentence hypothesis about what went wrong and where.
Step 2 — Read the failing site and its caller (2 files max)
Readthe method at the line number from the stack trace.Readthe immediate caller one level up.- If the root cause is not obvious,
Grepfor the method name to find all call sites. - Stop here if unclear. Ask the user: "Hypothesis: [X]. I need to check [Y] to confirm. Proceed?"
Step 3 — Inspect planning parameters and state
Planning failures are almost always param/state mismatches. Check:
ExSearchTimesvalue and who last set it (DualArmStrategysets 50,DualArmTransitionWithAirWallPlanStrategysets 1, default is 1).LastJointPos/_armJointPosesstate — is it stale or mutated between seams?fixedIndicesandboundariesconsistency (for external axis planning).- Shared cache dictionaries (
ScanTransCaches,WeldTransCaches,ExternalCache) — are they cleared between planning runs?
Step 4 — Add diagnostic logging
Use ILogger (never Console.WriteLine). Add logs at:
- Method entry: log method name,
wsgId,armIndex, and key param values (ExSearchTimes,FixDistance,Externals). - Decision branches: log which branch was taken and why (e.g.,
skipP1={skipP1}, skipP2={skipP2}). - Validation results: log
ValidateSingle()outcome with process id/counts. - Loop iterations: log index,
ilIdx,WsgCount, and boundary values when iterating seam groups.
Keep log templates structured: "[MethodName] {WsgId} arm={ArmIndex} exSearch={ExSearchTimes}".
Step 5 — Cross-check with OpenSpec
- Search
openspec/for the method or feature name. - Compare intended behavior in the spec against the actual code.
- If code diverges from spec, prefer fixing the code to match the spec (not updating the spec).
Step 6 — Implement minimal fix
- Edit the narrowest possible scope to resolve the root cause.
- Do not refactor adjacent code unless it directly blocks the fix.
- If the fix involves param changes (e.g.,
ExSearchTimes), ensure related params (ExParam.Resolution,FixDistance,banEx) are consistent.
Step 7 — Verify without building
- Use
mcp__ide__getDiagnosticson changed files. - Do not run
dotnet buildunless the user explicitly asks. - Review the diff for accidental changes.
Step 8 — Commit
- Use Chinese conventional commit format:
fix(规划): 修复[具体症状]因[根因]. - Include the why, not just the what.
3. Common Pitfalls & Avoidance
| Pitfall | Why it happens | How to avoid | |---------|---------------|--------------| | Reading >3 files before hypothesizing | Drifts into broad exploration; wastes context window | Enforce the 2-file limit. Use an agent for broad exploration if needed. | | Changing ExSearchTimes in isolation | Dual-arm strategy sets 50 for external axis search; transition strategy sets 1. Changing one without adjusting Resolution/FixDistance breaks planning silently. | Always check the strategy builder that owns the param. Change all related fields together. | | Stale LastJointPos / _armJointPoses | Transition planning reuses previous joint state. If a prior seam failed or was skipped, the state may be wrong. | Log lastJointPos at entry. Verify it matches the expected end pose of the previous segment. | | Console.WriteLine for debug logs | Project rules require ILogger. Console output does not reach the frontend log panel and will be rejected in review. | Use logger.LogDebug/LogInformation. Inject ILogger if missing. | | IndexOutOfRange on fixedIndices | maxStartIdx/minEndIdx boundary logic assumes seam point counts match between paired weld seam groups. When WsgCount changes (dual-arm vs single), indices drift. | Log boundaries, fixedIndices, and nonFixedIndices before the solver call. Validate fixedIndices are within poseAndExternals.Count. | | Shared cache pollution | ExternalCache, ScanTransCaches are not cleared between "一键规划" runs. Old results mask new failures. | Ensure cache reset at the start of each planning batch. | | Fixing code to match buggy behavior | Developer assumes the current runtime behavior is correct and patches around it. | Always check OpenSpec first. The spec is the source of truth. |
4. Validation Criteria for Success
A welding planning debug session is complete only when:
- Root cause is identified with a specific file:line citation and a one-sentence explanation.
- Diagnostic logs are added at the failure path and at least one decision branch upstream.
- Fix aligns with OpenSpec (or a spec update is explicitly acknowledged by the user).
- LSP diagnostics are clean on all modified files.
- Commit is made with Chinese conventional commit message summarizing content and cause.
- No
dotnet buildwas run unless user explicitly requested it.
5. Scenario Simulation: "SolvePath Failed! with changed ExSearchTimes"
User report: "SolvePath Failed! 我在 PlanParamSetting.json 里把 ExSearchTimes 从 50 改成了 20。"
Skill-guided execution (autonomous):
- Parse error:
SolvePath Failed!is thrown atRobotPlanSolver.cs:507whenresult.ValidateSingle()returns false. - Read anchor file:
ReadRobotPlanSolver.cslines 490–510. Confirm the exception is thrown afterGeneratePlanData. - Hypothesis (2 sentences): The user reduced
ExSearchTimesfrom 50 to 20 inPlanParamSetting.json. In dual-arm planning,DualArmStrategy.Build()setsExSearchTimes = 50to allow broad external axis search. A lower value may cause the solver to exhaust search attempts before finding a valid path, resulting inValidateSingle()failure. - Check param ownership:
GrepforExSearchTimes =across the codebase. Find:
DualArmStrategy.cs:70→_originParam.ExSearchTimes = 50;DualArmTransitionWithAirWallPlanStrategy.cs:87→_originParam.ExSearchTimes = 1;PlanConfigUtils.cs:144→ default1.
- Inspect related params:
ReadDualArmStrategy.cslines 66–90. Notice it also setsExParam.Resolution[2] = 2000andExParam.FixDistance. These are coupled withExSearchTimes. - Add diagnostic logging: In
RobotPlanSolver.csaround line 490, add:
``csharp logger.LogDebug("[SolveProcess] ExSearchTimes={ExSearchTimes}, FixDistance={FixDistance}, ResolutionZ={ResolutionZ}", _currentParam.ExSearchTimes, _currentParam.ExParam.FixDistance, _currentParam.ExParam.Resolution[2]); ``
- Check OpenSpec:
Grepopenspec/forExSearchTimes. Finddual-arm-strategy/spec.mdspecifyingExSearchTimesshould be 1 for transition and 50 for weld external search. The user's change to 20 contradicts the spec for dual-arm external axis search. - Implement fix: Revert
PlanParamSetting.jsonto 50 for the dual-arm procedure key. If the user truly needs 20, also reduceResolution[2]proportionally and re-test. - Verify: Run
mcp__ide__getDiagnosticsonRobotPlanSolver.cs. - Commit:
git commitwith message:
``` fix(规划): 恢复 DualArmStrategy 的 ExSearchTimes 为 50 以匹配外部轴搜索规范
用户误将 PlanParamSetting.json 中的 ExSearchTimes 改为 20, 导致外部轴解算次数不足,触发 SolvePath Failed。 同时添加 ExSearchTimes/FixDistance/Resolution 的调试日志以便未来排查。 ```
Result: User receives a clean fix, diagnostic logs for next time, and no manual intervention was needed.
6. Telemetry Suggestions for Auto-Generating Skills
To automatically derive skills like this in the future, capture per-session telemetry:
- Error taxonomy: Which exception types / error messages appeared (e.g.,
RobotSolveException,IndexOutOfRangeException,ArgumentOutOfRangeException). - File touch heatmap: Which files were
ReadandEditduring debugging sessions involving planning keywords. - Tool call sequences: The ordered chain of
Grep→Read→Edit→Readthat led to successful resolution. - User corrections: Moments where the user said "不对" / "不是这里" / "先判断error再merge" — these indicate friction points.
- Hypothesis confirmation latency: Time between initial hypothesis and user confirmation (or rejection). Long latencies signal vague hypotheses.
- Log injection pattern: Which methods received new
ILoggercalls during bug fixes. - Spec reference frequency: Which OpenSpec specs were consulted and whether the fix aligned with or contradicted the spec.
- Param mutation tracing: Which planning parameters (
ExSearchTimes,FixDistance,ToolScale) were changed during the session and in which files.
Store this telemetry in ~/.claude/telemetry/weld-plan-debug-sessions.jsonl with one entry per completed debug session. A periodic script can cluster patterns and emit new skill drafts when the same sequence appears 3+ times.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: grasscaograss
- Source: grasscaograss/AwesomeWeldoneSkills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.