fix(scripts): standardize timestamp in Validate-SkillStructure.ps1 to use Get-StandardTimestamp#1280
fix(scripts): standardize timestamp in Validate-SkillStructure.ps1 to use Get-StandardTimestamp#1280chaosdinosaur wants to merge 3 commits intomainfrom
Conversation
… use Get-StandardTimestamp Replace Get-Date -Format "o" with Get-StandardTimestamp from CIHelpers.psm1 for consistent UTC ISO 8601 timestamps. Add format assertion to Pester test. Fixes #996
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1280 +/- ##
==========================================
- Coverage 87.72% 87.71% -0.02%
==========================================
Files 61 61
Lines 9320 9320
==========================================
- Hits 8176 8175 -1
- Misses 1144 1145 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Automated Quality Review
Overall, this is a clean, focused fix that correctly addresses issue #996. The main production change is a straightforward one-line swap and the PR description is thorough.
✅ Issue Alignment
PR fully addresses issue #996:
- Replaces
Get-Date -Format 'o'(local-offset) withGet-StandardTimestamp(UTC, ending inZ) inValidate-SkillStructure.ps1. CIHelpers.psm1was already imported — no additional import needed, as the PR notes.- A format assertion was added to the existing Pester test.
No scope creep or missing requirements detected.
✅ PR Template Compliance
All required sections are filled in accurately:
- Description is clear and specific.
Fixes #996is present.- Bug fix and Script/automation checkboxes are checked and match the diff.
- Testing section documents the manual verification and automated checks run.
- All checklist items are appropriately checked or marked N/A.
✅ Code Quality
The production change at scripts/linting/Validate-SkillStructure.ps1 line 475 is correct. The unnecessary parentheses wrapping the old expression are also naturally removed. No other logic was altered.
⚠️ Coding Standards — Test Assertion
One inline comment was left on the test file (line 828). The .ToString('o') call on $json.timestamp is semantically a no-op because Get-StandardTimestamp already returns a [string], and String.ToString(IFormatProvider) ignores the format argument. The suggested fix simplifies the assertion to $json.timestamp | Should -Match '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.*Z$' for clarity and robustness.
Action Items
- Remove the
.ToString('o')call from the test assertion (see inline comment on line 828 ofValidate-SkillStructure.Tests.ps1).
Use raw JSON string matching instead of ConvertFrom-Json with property access, avoiding PowerShell 7 DateTime coercion that makes direct regex matching unreliable. Pattern follows the established approach from Test-CopyrightHeaders.Tests.ps1 (#1278).
7d76b5e to
c376780
Compare
Pull Request
Description
Replaced
Get-Date -Format 'o'(local-offset timestamp) inValidate-SkillStructure.ps1withGet-StandardTimestampfromCIHelpers.psm1. The script already importsCIHelpers.psm1at line 29, so no additional import was needed. This produces genuine UTC timestamps ending inZinstead of local-offset timestamps.Added a format assertion to the existing Pester test verifying the timestamp field is a UTC ISO 8601 string ending in
Z.Related Issue(s)
Fixes #996
Type of Change
Select all that apply:
Code & Documentation:
Infrastructure & Configuration:
AI Artifacts:
prompt-builderagent and addressed all feedback.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/agents/*.agent.md).github/skills/*/SKILL.md)Other:
.ps1,.sh,.py)Testing
Get-Date -Format 'o'replaced withGet-StandardTimestampat line 478.npm run lint:pspassed.npm run test:pspassed (75 tests for this file).Checklist
Required Checks
Required Automated Checks
The following validation commands must pass before merging:
npm run lint:mdnpm run spell-checknpm run lint:frontmatternpm run validate:skillsnpm run lint:md-linksnpm run lint:psnpm run plugin:generateSecurity Considerations
Additional Notes
This is part of the timestamp standardization series (issues #994-#1002). The prerequisite
Get-StandardTimestampfunction was merged in #993.CIHelpers.psm1was already imported by this script, so the change is a direct expression swap with no import changes required.