fix(agents): convert YAML frontmatter arrays to block-style for Windows compatibility#895
Conversation
…ws compatibility Convert inline array syntax `tools: ['a', 'b']` to block-style format across all agent templates and generated files to fix Windows YAML parsing errors. Changes: - Update 18 template files to use block-style arrays - Regenerate 54 agent files for VS Code and Copilot CLI - Update parser to handle block-style arrays in input - Update formatter to output block-style arrays - Add 8 new tests for array parsing and formatting - Fix silent failure paths with proper warnings - Update ADR-040 with YAML array format requirements - Update documentation examples Fixes: Windows "Unexpected scalar at node end" errors during agent installation Closes #893 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR Validation ReportNote ✅ Status: PASS Description Validation
QA Validation
⚡ Warnings
Powered by PR Validation workflow |
AI Quality Gate ReviewTip ✅ Final Verdict: PASS WalkthroughThis PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:
Review Summary
💡 Quick Access: Click on individual agent jobs (e.g., "🔒 security Review", "🧪 qa Review") in the workflow run to see detailed findings and step summaries. Security Review DetailsBased on my review of the changed files, I can now provide the security assessment. Security Review: PR #895PR Type Detection
Primary Category: DOCS with supporting CODE changes. Analysis1. PowerShell Code Review (
|
| Severity | Category | Finding | Location | CWE |
|---|---|---|---|---|
| None | - | No security issues identified | - | - |
Recommendations
None required. The code maintains existing security controls and introduces no new attack surface.
Verdict
VERDICT: PASS
MESSAGE: PR contains YAML formatting changes and documentation updates. PowerShell code maintains path traversal protection. No credentials or security-sensitive patterns detected.
QA Review Details
Based on my analysis, I can now provide the QA verdict:
QA Review Verdict
VERDICT: PASS
MESSAGE: Tests pass, block-style arrays correctly implemented, defensive code paths present.
PR TYPE: MIXED
FILES:
- CODE: build/Generate-Agents.Common.psm1, tests/Generate-Agents.Tests.ps1
- DOCS: .agents/*, templates/README.md, scripts/README.md, .serena/memories/*
- CONFIG: .gitignore
- GENERATED: src/vs-code-agents/*.agent.md, src/copilot-cli/*.agent.md, .github/agents/*.agent.md
Test Coverage Assessment
| Area | Status | Evidence | Files Checked |
|---|---|---|---|
| Unit tests | Adequate | 32 tests in tests/Generate-Agents.Tests.ps1 | build/Generate-Agents.Common.psm1 |
| Edge cases | Covered | Block-style arrays (L176-225), quoted items (L188-198), mixed arrays (L213-224) | Tests file |
| Error paths | Tested | Orphaned array warning (L118), null handling (L270-273), parse fallback (L301-304) | Common module |
| Assertions | Present | All tests use Should assertions |
Tests file |
Quality Concerns
| Severity | Issue | Location | Evidence | Required Fix |
|---|---|---|---|---|
| LOW | Untested defensive paths | Generate-Agents.Common.psm1:118, 270-278 | Orphaned array warning, null/type handling not exercised | Follow-up PR |
Regression Risk Assessment
- Risk Level: Low - Changes are additive (new parsing capability), not breaking existing behavior
- Affected Components: build/Generate-Agents.Common.psm1 (parser/formatter), templates/*.shared.md, generated agent files
- Breaking Changes: None - inline arrays still supported for backwards compatibility
- Required Testing: Block-style array parsing/output (covered by 8 new tests)
Evidence
Tests found: 32 tests for 7 exported functions
New tests added: 8 tests specifically for block-style array handling:
ConvertFrom-SimpleFrontmatterblock-style tests (L176-225): 4 testsFormat-FrontmatterYamlblock-style tests (L341-383): 4 tests
Edge cases verified:
- Block-style with hyphens (L176-186)
- Quoted items in block arrays (L188-198)
- Array followed by other fields (L200-211)
- Mixed inline/block arrays (L213-224)
Error handling confirmed:
- Input validation:
[ValidateNotNullOrEmpty()]at L84 - Orphaned array warning: L117-119
- Null value handling: L270-273
- Type coercion: L275-278
- Parse failure fallback: L301-304
Generated output validated:
- VS Code agents (L1-24): Block-style tools array
- Copilot CLI agents (L1-22): Block-style tools array
- GitHub agents (L1-13): Block-style tools array
Pre-existing QA validation: .agents/qa/pre-pr-validation-frontmatter-block-style.md shows 32/32 tests passed with APPROVED verdict.
Analyst Review Details
Let me view the PR diff and key changed files to complete the analysis.
I have sufficient information to complete the analysis.
PR #895 Analysis: YAML Frontmatter Array Format Conversion
Code Quality Score
| Criterion | Score (1-5) | Notes |
|---|---|---|
| Readability | 5 | Clear variable names, well-documented functions |
| Maintainability | 5 | Single responsibility functions, proper module structure |
| Consistency | 5 | Follows existing PowerShell patterns, maintains field ordering |
| Simplicity | 4 | Regex parsing is appropriate for simple YAML; avoids full YAML library dependency |
Overall: 4.75/5
Impact Assessment
- Scope: System-wide (54 generated files + 18 templates + parser module)
- Risk Level: Low
- Affected Components: Agent template system, YAML frontmatter parser, all platform-specific agent files
Findings
| Priority | Category | Finding | Location |
|---|---|---|---|
| Low | Documentation | ADR-040 amendment correctly documents rationale and cross-platform compatibility | ADR-040:388-406 |
| Low | Testing | 8 new tests added covering block-style array parsing and output | Generate-Agents.Tests.ps1:176-225, 341-383 |
| Low | Code Quality | Fixed potential variable shadowing ($matches to $itemMatches) |
Generate-Agents.Common.psm1:289 |
| Low | Robustness | Added input validation with [ValidateNotNullOrEmpty()] |
Generate-Agents.Common.psm1:84 |
| Low | Robustness | Added warning for orphaned array items (prevents silent data loss) | Generate-Agents.Common.psm1:118 |
| Low | Robustness | Added parse failure detection with fallback | Generate-Agents.Common.psm1:303-305 |
Recommendations
- None. The implementation is solid, addresses a real Windows compatibility issue, and includes appropriate test coverage.
Analysis Summary
Problem Addressed: Windows YAML parsers fail on inline array syntax ['item1', 'item2'] with "Unexpected scalar at node end" errors.
Solution Quality:
- Parser (
ConvertFrom-SimpleFrontmatter) correctly handles both inline and block-style input - Formatter (
Format-FrontmatterYaml) outputs block-style arrays universally - Backward compatible: existing inline arrays in source files still parse correctly
- Forward compatible: all output uses cross-platform block-style format
Test Coverage: 8 new tests verify:
- Block-style array parsing (4 tests)
- Block-style array output formatting (4 tests)
Documentation: ADR-040 amendment documents the decision with rationale.
Verdict
VERDICT: PASS
MESSAGE: Well-structured fix for Windows YAML compatibility with proper test coverage and documentation. Parser improvements add robustness without breaking existing functionality.
Architect Review Details
Based on my review of the PR changes, ADR documentation, and existing design review, I can provide my architectural assessment.
Design Quality Assessment
| Aspect | Rating (1-5) | Notes |
|---|---|---|
| Pattern Adherence | 5 | SOLID principles maintained, DRY with shared module, KISS with layered parsing |
| Boundary Respect | 5 | Clear separation: parsing/transformation/formatting layers |
| Coupling | 5 | Module has 2 consumers, 0 external dependencies |
| Cohesion | 5 | Each function has single, clear purpose (functional cohesion) |
| Extensibility | 4 | Extension points exist but regex-based parsing limits YAML complexity |
Overall Design Score: 4.8/5
Architectural Concerns
| Severity | Concern | Location | Recommendation |
|---|---|---|---|
| Low | Empty array edge case not tested | tests/Generate-Agents.Tests.ps1 | Add test for tools: with no items |
| Low | Inline arrays in template README example | templates/README.md:199-200 | Update to block-style format |
Breaking Change Assessment
- Breaking Changes: No
- Impact Scope: None
- Migration Required: No
- Migration Path: N/A
Technical Debt Analysis
- Debt Added: Low (regex complexity for YAML parsing)
- Debt Reduced: Medium (Windows compatibility gap closed, array format documented)
- Net Impact: Improved
ADR Assessment
- ADR Required: No (amendment to existing ADR-040 is appropriate)
- Decisions Identified: Block-style YAML arrays for cross-platform compatibility
- Existing ADR: ADR-040-skill-frontmatter-standardization.md (amended)
- Recommendation: N/A - amendment properly documents the decision with rationale
Recommendations
- Update
templates/README.mdlines 199-200 to use block-style arrays in the example (consistency with new standard)
Verdict
VERDICT: PASS
MESSAGE: Well-designed, well-tested change that solves Windows YAML parsing compatibility while maintaining architectural integrity. Follows ADR-005 (PowerShell-only), ADR-006 (testable modules), and ADR-036 (two-source architecture). ADR-040 amendment properly documents the decision.
DevOps Review Details
Based on my analysis, I can now provide the DevOps review.
PR Scope Detection
| Category | Detected |
|---|---|
| WORKFLOW | No - no .github/workflows/ changes |
| ACTION | No - no .github/actions/ changes |
| SCRIPT | No - no scripts/*.sh or scripts/*.ps1 changes |
| TEMPLATE | Yes - .github/agents/*.prompt.md files |
| CODE | Yes - build/Generate-Agents.Common.psm1, tests/Generate-Agents.Tests.ps1 |
| DOCS | Yes - documentation and analysis files |
| CONFIG | No |
This PR primarily changes PowerShell build modules, test files, and agent template/generated files. No CI/CD workflow changes.
Pipeline Impact Assessment
| Area | Impact | Notes |
|---|---|---|
| Build | Low | Generate-Agents.Common.psm1 module updated with improved parsing |
| Test | Low | New tests added (8 new tests for block-style arrays) |
| Deploy | None | No deployment configuration changes |
| Cost | None | No runner or execution changes |
CI/CD Quality Checks
| Check | Status | Location |
|---|---|---|
| YAML syntax valid | N/A | No workflow files changed |
| Actions pinned | N/A | No workflow files changed |
| Secrets secure | N/A | No secrets handling changed |
| Permissions minimal | N/A | No workflow files changed |
| Shell scripts robust | ✅ | build/Generate-Agents.Common.psm1 |
PowerShell Module Quality Review
| Check | Status | Location |
|---|---|---|
| Input validation | ✅ | Line 84-85: [ValidateNotNullOrEmpty()] added |
| Error handling | ✅ | Line 118: Warning for orphaned array items |
| Type handling | ✅ | Lines 272-278: Non-string type coercion with verbose logging |
| Parse failure handling | ✅ | Lines 303-305: Fallback for parse failures |
| Variable shadowing fix | ✅ | Line 289: $matches → $itemMatches |
Findings
| Severity | Category | Finding | Location | Fix |
|---|---|---|---|---|
| None | - | No DevOps issues detected | - | - |
Template Assessment
- PR Template: N/A - not modified
- Issue Templates: N/A - not modified
- Agent Templates: Block-style YAML arrays correctly formatted across all 18 template files and 55 generated files
Automation Opportunities
| Opportunity | Type | Benefit | Effort |
|---|---|---|---|
| None identified | - | - | - |
The changes improve Windows compatibility for YAML parsing without impacting CI/CD infrastructure.
Recommendations
- No CI/CD changes needed - module improvements are correctly scoped to build tooling
VERDICT: PASS
MESSAGE: Build module improvements add input validation and error handling. No workflow or pipeline changes. PowerShell code follows best practices with proper validation and type handling.
Roadmap Review Details
Based on my review of the PR, ADR-040, and product roadmap, I can now provide the strategic alignment assessment.
Strategic Alignment Assessment
| Criterion | Rating | Notes |
|---|---|---|
| Aligns with project goals | High | Fixes Windows compatibility bug blocking adoption; supports Master Product Objective of "minimal friction" installation |
| Priority appropriate | High | Bug fix addressing user-reported issue #893; enables cross-platform deployment |
| User value clear | High | Unblocks Windows users who cannot parse agent files with inline YAML arrays |
| Investment justified | High | Parser improvements prevent future parsing errors; 8 new tests increase regression protection |
Feature Completeness
- Scope Assessment: Right-sized
- Ship Ready: Yes
- MVP Complete: Yes
- Enhancement Opportunities: None identified; comprehensive fix covering templates, parser, generated files, and documentation
Impact Analysis
| Dimension | Assessment | Notes |
|---|---|---|
| User Value | High | Removes installation blocker for Windows users |
| Business Impact | Medium | Prevents adoption friction on Windows; 30-40% of developers use Windows |
| Technical Leverage | High | Parser improvements (input validation, orphan detection, fallback handling) benefit all future frontmatter parsing |
| Competitive Position | Improved | Cross-platform compatibility is table stakes for developer tooling |
Concerns
| Priority | Concern | Recommendation |
|---|---|---|
| Low | Large file count (54 generated files) inflates PR size | Acceptable: auto-generated from 18 templates; one-time cleanup |
Recommendations
- Merge without delay - Bug fixes that unblock users should ship immediately
- ADR-040 amendment is appropriate - Documents the rationale for block-style arrays as architectural guidance
Verdict
VERDICT: PASS
MESSAGE: Fix aligns with Master Product Objective (minimal friction installation). Removes Windows adoption blocker. Parser improvements add defensive robustness. Investment proportionate to impact.
Run Details
| Property | Value |
|---|---|
| Run ID | 20976027956 |
| Triggered by | pull_request on 895/merge |
| Commit | d88cf9c69fd5ea5b6b0d2f00ae909041fa3e0bb3 |
Powered by AI Quality Gate workflow
There was a problem hiding this comment.
Pull request overview
This PR standardizes YAML frontmatter arrays to block-style format across all agent templates and generated files, resolving Windows YAML parser compatibility issues while maintaining backward compatibility.
Changes:
- Converted 78 files from inline array syntax
['item1', 'item2']to block-style format with hyphen-bulleted items - Updated PowerShell parser to handle both inline and block-style arrays on input, always output block-style format
- Added 8 comprehensive test cases covering block-style parsing, mixed formats, and edge cases
- Amended ADR-040 with YAML Array Format standardization and rationale
Reviewed changes
Copilot reviewed 83 out of 83 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| build/Generate-Agents.Common.psm1 | Updated parser to handle block-style arrays and formatter to output block-style format |
| build/tests/Generate-Agents.Tests.ps1 | Added 8 new tests for block-style array parsing and formatting |
| templates/agents/*.shared.md (18 files) | Converted tools_vscode and tools_copilot arrays from inline to block-style |
| src/vs-code-agents/*.agent.md (18 files) | Generated files now use block-style tools arrays |
| src/copilot-cli/*.agent.md (18 files) | Generated files now use block-style tools arrays |
| .github/agents/*.agent.md (18 files) | Generated files now use block-style tools arrays |
| .github/agents/pr-comment-responder.prompt.md | Converted tools array to block-style for consistency |
| .agents/architecture/ADR-040-skill-frontmatter-standardization.md | Added YAML Array Format section documenting block-style requirement and rationale |
| templates/README.md | Updated frontmatter examples to use block-style arrays |
| scripts/README.md | Fixed duplicate Validate-SessionJson.ps1 section |
| .agents/qa/pre-pr-validation-frontmatter-block-style.md | Pre-PR QA validation report (APPROVED) |
| .agents/devops/ci-validation-2026-01-13.md | DevOps review report (PASS) |
| .agents/architecture/DESIGN-REVIEW-frontmatter-array-conversion.md | Architecture review report (PASS) |
| .agents/analysis/NNN-frontmatter-block-arrays-analysis.md | Analyst investigation report |
| .agents/.hook-state/memory-first-counter.txt | Hook state tracking file |
There was a problem hiding this comment.
Code Review
This pull request updates numerous agent definition files to use a block-style YAML array format for the tools list, intended to improve Windows compatibility. The core logic changes are in build/Generate-Agents.Common.psm1, which is updated to parse and generate this new format. While the changes are generally good and include new tests, I've identified a significant maintainability and correctness issue in the Format-FrontmatterYaml function. The regex-based parser for inline arrays is brittle. I've suggested replacing it with a more robust implementation using PowerShell's ConvertFrom-Json cmdlet and also proposed a larger refactoring to improve the overall design by using native arrays instead of string representations for frontmatter values.
Multi-agent debate review for retroactive ADR-040 amendment validation. Result: 5 ACCEPT, 1 DISAGREE AND COMMIT (consensus achieved) Key findings: - Amendment correctly addresses Windows YAML parsing errors - Block-style arrays are universally compatible - P0 deferred: CRLF line endings investigation (separate concern) Debate participants: architect, critic, independent-thinker, security, analyst, high-level-advisor Co-Authored-By: Claude <noreply@anthropic.com>
Session 826: Fix Windows YAML parsing errors (issue #893) Artifacts: - .agents/critique/ADR-040-amendment-2026-01-13-debate-log.md Co-Authored-By: Claude <noreply@anthropic.com>
Resolved conflict in scripts/README.md by keeping consolidated documentation (removed duplicate Validate-SessionJson.ps1 sections). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Retrospective analysis of fix/tools-frontmatter branch work: - 6 atomic learnings extracted (85-95% atomicity) - 10 success patterns identified - 4 near misses documented - 87.5% success rate Memory files created: - learnings-2026-01.md: Session 826 learning extraction - patterns-yaml-compatibility.md: Block-style arrays for cross-platform - patterns-powershell-pitfalls.md: Variable shadowing detection - patterns-multi-agent-consensus.md: DISAGREE AND COMMIT pattern Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Relocate test file from build/tests/ to root tests/ directory per project convention (all Pester tests in tests/). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add .gitattributes rules for *.agent.md, *.prompt.md, *.shared.md - Enforce LF for all markdown in .claude/ and .github/agents/ directories - Enforce LF for YAML files (*.yml, *.yaml) - sensitive to line endings - Enforce LF for XML templates in .claude/ directory - Prevents YAML frontmatter parsing errors on Windows (Copilot CLI issues #694, #673) - Supports multiple agent platforms: Copilot, Codex, Droid, Claude Code - Follows precedent from *.skill files (ADR-019) This is a comprehensive fix beyond the original scope to ensure all agent-related files work correctly on Windows. Addresses feedback from @rjmurillo that PR #895 is experiencing line ending issues. Note: Normalization of existing files (git add --renormalize .) should be done in a separate PR after reviewing these attribute changes. Fixes #896 Related: #895, #897 Co-authored-by: Richard Murillo <rjmurillo@users.noreply.github.com>
Resolved 56 conflicts by keeping block-style YAML arrays from our branch (the fix for Windows YAML parsing - issue #893). Main had regenerated agents with inline arrays, our branch has the corrected block-style format per ADR-040 amendment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(agents): convert YAML frontmatter arrays to block-style for Windows compatibility Convert inline array syntax `tools: ['a', 'b']` to block-style format across all agent templates and generated files to fix Windows YAML parsing errors. Changes: - Update 18 template files to use block-style arrays - Regenerate 54 agent files for VS Code and Copilot CLI - Update parser to handle block-style arrays in input - Update formatter to output block-style arrays - Add 8 new tests for array parsing and formatting - Fix silent failure paths with proper warnings - Update ADR-040 with YAML array format requirements - Update documentation examples Fixes: Windows "Unexpected scalar at node end" errors during agent installation Closes #893 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(adr): add debate log for ADR-040 YAML array format amendment Multi-agent debate review for retroactive ADR-040 amendment validation. Result: 5 ACCEPT, 1 DISAGREE AND COMMIT (consensus achieved) Key findings: - Amendment correctly addresses Windows YAML parsing errors - Block-style arrays are universally compatible - P0 deferred: CRLF line endings investigation (separate concern) Debate participants: architect, critic, independent-thinker, security, analyst, high-level-advisor Co-Authored-By: Claude <noreply@anthropic.com> * docs(session): add session log for YAML array format standardization Session 826: Fix Windows YAML parsing errors (issue #893) Artifacts: - .agents/critique/ADR-040-amendment-2026-01-13-debate-log.md Co-Authored-By: Claude <noreply@anthropic.com> * fix(pr-review): address PR #895 review comments - Remove .agents/.hook-state/ from tracking and add to .gitignore - Rename analysis file from NNN to 826 (correct session number) - Fix ADR-040 file count: 18 templates + 54 generated files (not 18+18) - Fix ADR-040 session reference: 826 (not 825) - Add comment about regex comma limitation in array parsing Also adds analysis artifacts from ADR-040 review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(session): update session log with PR review work - Added work log entries for PR #895 review comment resolution - Updated ending commit to bce23f0 - Updated next steps to reflect completed PR review Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(retrospective): add session 826 retrospective and memory files Retrospective analysis of fix/tools-frontmatter branch work: - 6 atomic learnings extracted (85-95% atomicity) - 10 success patterns identified - 4 near misses documented - 87.5% success rate Memory files created: - learnings-2026-01.md: Session 826 learning extraction - patterns-yaml-compatibility.md: Block-style arrays for cross-platform - patterns-powershell-pitfalls.md: Variable shadowing detection - patterns-multi-agent-consensus.md: DISAGREE AND COMMIT pattern Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor(tests): move Generate-Agents.Tests.ps1 to tests/ directory Relocate test file from build/tests/ to root tests/ directory per project convention (all Pester tests in tests/). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(memory): add session 826 retrospective learnings and memory index updates Adds six new atomic memory files extracted from session 826 retrospective: - adr-artifact-count-verification: Verify git diff stats match ADR text - adr-retroactive-amendment-criteria: Emergency concurrent ADR documentation criteria - consensus-disagree-and-commit-pattern: Multi-agent debate resolution with follow-up issues - powershell-variable-shadowing-detection: Grep for automatic variables before testing - pr-review-batch-response-pattern: Single commit for all review comments - retrospective-artifact-efficiency-pattern: Create artifacts during execution (60-70% time savings) Updates memory index files to reference new patterns with improved keyword mappings. Includes markdown formatting fix for direct-reports-extraction-prompt.md (code fence language identifier). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Pull Request
Summary
Convert YAML frontmatter arrays from inline syntax to block-style format across all agent files to fix Windows YAML parsing errors ("Unexpected scalar at node end").
Specification References
.agents/architecture/ADR-040-skill-frontmatter-standardization.mdChanges
Parser/Formatter Improvements
$matches→$itemMatches)[ValidateNotNullOrEmpty()]Test Coverage
Template Updates
Generated Files
ADR Amendment
Type of Change
Testing
Test Results: All 32 Pester tests pass
Agent Review
Security Review
Other Agent Reviews
Full Quality Gate Results:
Checklist
Related Issues
Fixes #893
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com