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/io.ts
View on GitHubimport { canonicalJson, strictJsonParse, type JsonObject } from './json';
export function objectJson(text: string, label: string): JsonObject {
const value = strictJsonParse(text);
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
throw new Error(`${label}: expected a JSON object`);
}
return value as JsonObject;
}
/** Dataset exports can feed another Play without flattening nested evidence. */
export async function* recordStream(
dataset: AsyncIterable<{ record_json: string }>,
): AsyncGenerator<JsonObject> {
let index = 0;
for await (const row of dataset) {
if (typeof row.record_json !== 'string')
throw new Error(`CSV row ${index + 1}: record_json column required`);
yield objectJson(row.record_json, `CSV row ${++index}`);
}
}
export async function readRecords(
dataset: AsyncIterable<{ record_json: string }>,
): Promise<JsonObject[]> {
const rows: JsonObject[] = [];
for await (const row of recordStream(dataset)) rows.push(row);
return rows;
}
export async function readDocument(
dataset: AsyncIterable<{ record_json: string }>,
): Promise<JsonObject> {
let result: JsonObject | undefined;
for await (const row of recordStream(dataset)) {
if (result)
throw new Error('Document CSV requires exactly one record_json row');
result = row;
}
if (!result)
throw new Error('Document CSV requires exactly one record_json row');
return result;
}
export async function* recordRows(
records: Iterable<unknown> | AsyncIterable<unknown>,
runId: string,
) {
if (typeof runId !== 'string' || !runId.trim())
throw new Error('Output rows require a nonempty run ID');
let index = 0;
for await (const record of records) {
yield { row_id: `${runId}:${index++}`, record_json: canonicalJson(record) };
}
}
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 |