Skip to content

[deep-report] Adopt NewValidationError for duplicate-name errors in pkg/parser #54582

Description

@github-actions

Description

pkg/parser — the primary frontmatter/workflow validation surface (import_field_extractor.go, mcp.go, inline_skill_extractor.go, sub_agent_extractor.go, etc.) — has zero usages of the project's own NewValidationError(field, value, reason, suggestion string) helper (defined pkg/workflow/workflow_errors.go:81), despite the error-messages skill recommending it for *_validation.go-style logic. Two concrete duplicate-name sites verified live on main (commit f2e8122):

  • pkg/parser/inline_skill_extractor.go:118fmt.Errorf("duplicate inline skill name %q", name)
  • pkg/parser/sub_agent_extractor.go:238fmt.Errorf("duplicate inline sub-agent name %q", name)

Neither states what's expected or suggests a fix (rename/remove the duplicate).

Fix

Convert both sites to NewValidationError, providing a field (e.g. "skills" / "sub-agents"), the duplicate name as value, a reason ("duplicate name already defined"), and a suggestion showing how to rename or remove one of the duplicates. Update/add tests in pkg/parser covering the duplicate-name error. Run make fmt and go test ./pkg/parser/....

Expected Impact

First real adoption of the structured validation-error helper in pkg/parser, giving actionable errors for a common frontmatter authoring mistake (duplicate skill/sub-agent names) and setting a pattern for future validation sites in the package.

Suggested Agent

Copilot coding agent.

Estimated Effort

Medium (1-4 hours)

Data Source

DeepReport Intelligence Briefing 2026-08-21, mining discussion #54543, Task 4.

Generated by 🔬 Deep Report · agent · 106.7 AIC · ⌖ 8.62 AIC · ⊞ 12.4K ·

  • expires on Aug 23, 2026, 10:30 AM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions