Install
openclaw skills install dateguardDate/time anti-pattern scanner -- detects timezone bugs, naive datetime usage, hardcoded timestamps, non-ISO formats, incorrect epoch handling, DST-unsafe co...
openclaw skills install dateguardDateGuard scans codebases for date/time anti-patterns, timezone bugs, naive datetime usage, hardcoded timestamps, non-ISO formats, incorrect epoch handling, DST-unsafe comparisons, locale-dependent parsing, and temporal storage issues. It uses regex-based pattern matching against 90 date/time-specific patterns across 6 categories, lefthook for git hook integration, and produces markdown reports with actionable remediation guidance. 100% local. Zero telemetry.
dateguard scan [file|directory]One-shot date/time quality scan of files or directories.
How to execute:
bash "<SKILL_DIR>/scripts/dispatcher.sh" --path [target]
What it does:
Example usage scenarios:
dateguard scan .dateguard scan src/server.tsdateguard scan src/dateguard scan .dateguard scan .dateguard scan --tier pro [file|directory]Extended scan with 60 patterns covering timezone, formatting, epoch precision, and date arithmetic.
How to execute:
bash "<SKILL_DIR>/scripts/dispatcher.sh" --path [target] --tier pro
What it does:
dateguard scan --format json [directory]Generate JSON output for CI/CD integration.
bash "<SKILL_DIR>/scripts/dispatcher.sh" --path [directory] --format json
dateguard scan --format html [directory]Generate HTML report for browser viewing.
bash "<SKILL_DIR>/scripts/dispatcher.sh" --path [directory] --format html
dateguard scan --category EP [directory]Filter scan to a specific check category (TZ, NF, EP, DA, CP, ST).
bash "<SKILL_DIR>/scripts/dispatcher.sh" --path [directory] --category EP
dateguard scan --tier team [directory]Full scan with all 90 patterns across all 6 categories including comparison/parsing and storage/serialization.
How to execute:
bash "<SKILL_DIR>/scripts/dispatcher.sh" --path [directory] --tier team
What it does:
dateguard scan --verbose [directory]Verbose output showing every matched line and pattern details.
bash "<SKILL_DIR>/scripts/dispatcher.sh" --path [directory] --verbose
dateguard statusShow license and configuration information.
bash "<SKILL_DIR>/scripts/dispatcher.sh" status
DateGuard detects 90 date/time anti-patterns across 6 categories:
| Category | Code | Patterns | Description | Severity Range |
|---|---|---|---|---|
| Timezone Handling | TZ | 15 | Missing timezone in datetime creation, implicit local timezone, hardcoded offsets, timezone conversion without DST handling | medium -- high |
| Naive Formatting | NF | 15 | Non-ISO date formats in APIs, locale-dependent parsing, ambiguous MM/DD vs DD/MM, toString() on dates | low -- high |
| Epoch & Precision | EP | 15 | Millisecond vs second confusion, Y2038 risk, timestamps as strings, floating point timestamps, epoch 0 sentinels | low -- medium |
| Date Arithmetic | DA | 15 | Manual +86400 day math, month arithmetic ignoring varying lengths, leap year bugs, DST-crossing calculations | medium -- high |
| Comparison & Parsing | CP | 15 | Lexicographic date string comparison, Date == comparison, unparsed user input, timezone-unaware comparisons | medium -- high |
| Storage & Serialization | ST | 15 | VARCHAR for timestamps in SQL, missing timezone in stored dates, JSON.stringify on Date, hardcoded date strings | low -- high |
| Tier | Patterns | Categories |
|---|---|---|
| Free | 30 | TZ, NF |
| Pro | 60 | TZ, NF, EP, DA |
| Team | 90 | TZ, NF, EP, DA, CP, ST |
| Enterprise | 90 | TZ, NF, EP, DA, CP, ST + priority support |
DateGuard uses a deductive scoring system starting at 100 (perfect):
| Severity | Point Deduction | Description |
|---|---|---|
| Critical | -25 per finding | Severe temporal bug (Y2038, data loss from timezone) |
| High | -15 per finding | Significant quality problem (naive datetime, DST math) |
| Medium | -8 per finding | Moderate concern (ambiguous formats, missing timezone) |
| Low | -3 per finding | Informational / best practice suggestion |
| Grade | Score Range | Meaning |
|---|---|---|
| A | 90-100 | Excellent date/time handling |
| B | 80-89 | Good handling with minor issues |
| C | 70-79 | Acceptable but needs improvement |
| D | 60-69 | Poor date/time quality |
| F | Below 60 | Critical temporal problems |
Users can configure DateGuard in ~/.openclaw/openclaw.json:
{
"skills": {
"entries": {
"dateguard": {
"enabled": true,
"apiKey": "YOUR_LICENSE_KEY_HERE",
"config": {
"severityThreshold": "medium",
"ignorePatterns": ["**/test/**", "**/fixtures/**", "**/*.test.*"],
"ignoreChecks": [],
"reportFormat": "text"
}
}
}
}
}
The user might say things like:
brew install lefthook