getaero-io/gtm-eng-skills / skills/deepline-crm-cleaning
deepline-crm-cleaning
VerifiedUse for CRM audits, duplicate detection, missing or stale fields, job changes, domain checks, acquisitions, parent-child relationships, repair plans, prevention, monitoring, and evaluation. Supports HubSpot, Salesforce, Attio, and mapped exports. Start with read-only analysis. Skip outreach writing, CRM interface design, and unrelated analysis.
plays/shared/time.ts
View on GitHub/** Receipt timestamps: microsecond precision; local and UTC years 1 through 9999. */
export function timestamp(value: unknown): bigint {
if (typeof value !== 'string')
throw new Error('timestamp with timezone required');
const parts =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,6}))?(Z|[+-]\d\d:?\d\d)$/.exec(
value,
);
if (!parts) throw new Error('invalid timestamp with timezone');
const year = +parts[1],
month = +parts[2],
leapYear = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0),
monthDays = [
31,
leapYear ? 29 : 28,
31,
30,
31,
30,
31,
31,
30,
31,
30,
31,
],
zone = parts[8].replace(':', '');
if (
year === 0 ||
month < 1 ||
month > 12 ||
+parts[3] < 1 ||
+parts[3] > monthDays[month - 1] ||
+parts[4] > 23 ||
+parts[5] > 59 ||
+parts[6] > 59 ||
(zone !== 'Z' && (+zone.slice(1, 3) > 23 || +zone.slice(3) > 59))
)
throw new Error('invalid timestamp with timezone');
const normalizedZone =
zone === 'Z' ? 'Z' : `${zone.slice(0, 3)}:${zone.slice(3)}`;
const ms = Date.parse(value.slice(0, -parts[8].length) + normalizedZone);
const utcYear = new Date(ms).getUTCFullYear();
if (!Number.isFinite(ms) || utcYear < 1 || utcYear > 9999)
throw new Error('invalid timestamp: UTC year must be from 1 through 9999');
return BigInt(ms) * 1000n + BigInt((parts[7] ?? '').padEnd(6, '0').slice(3));
}
export function normalized_timestamp(value: unknown): string {
const micros = timestamp(value),
seconds = micros >= 0n ? micros / 1000000n : (micros - 999999n) / 1000000n;
const fraction = micros - seconds * 1000000n;
return new Date(Number(seconds * 1000n))
.toISOString()
.replace(
'.000Z',
(fraction ? '.' + fraction.toString().padStart(6, '0') : '') + '+00:00',
);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |