.claude/skills/neo4j-graph/SKILL.md
Patrones de Neo4j y Cypher para el knowledge graph de ComplianceGraph en RegWatch AI. Usar cuando se trabaje en: schema de nodos y relaciones, queries Cypher de obligaciones, onboarding engine que genera ComplianceMap, actualización del grafo cuando llegan nuevos cambios regulatorios, o el ComplianceAgent de LangChain.
npx skillsauth add centralcordoba/RAGAgentThornton neo4j-graphInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
-- Constraints (crear al inicializar)
CREATE CONSTRAINT FOR (j:Jurisdiction) REQUIRE j.id IS UNIQUE;
CREATE CONSTRAINT FOR (o:Obligation) REQUIRE o.id IS UNIQUE;
CREATE CONSTRAINT FOR (c:CompanyType) REQUIRE c.id IS UNIQUE;
CREATE CONSTRAINT FOR (r:Regulator) REQUIRE r.id IS UNIQUE;
CREATE CONSTRAINT FOR (rc:RegulatoryChange) REQUIRE rc.id IS UNIQUE;
interface JurisdictionNode {
id: string; // 'AR', 'BR', 'MX', 'ES', 'USA'
country: string;
region: string; // 'LATAM', 'EU', 'NA'
regulatoryBody: string;
language: string;
}
interface ObligationNode {
id: string;
title: string;
area: 'fiscal' | 'labor' | 'corporate' | 'securities';
frequency: 'annual' | 'quarterly' | 'monthly' | 'ad_hoc';
description: string;
nextDueDate?: string; // ISO date
}
interface CompanyTypeNode {
id: string;
name: string; // 'SA', 'SRL', 'Inc', etc.
sector: string;
requiresAudit: boolean;
}
(Jurisdiction)-[:HAS_OBLIGATION]->(Obligation)
(CompanyType)-[:SUBJECT_TO]->(Obligation)
(Obligation)-[:HAS_DEADLINE]->(Deadline)
(Obligation)-[:REGULATED_BY]->(Regulator)
(RegulatoryChange)-[:MODIFIES]->(Obligation)
(Client)-[:OPERATES_IN]->(Jurisdiction)
(Client)-[:IS_TYPE]->(CompanyType)
MATCH (j:Jurisdiction {country: $country})
-[:HAS_OBLIGATION]->(o:Obligation)
<-[:SUBJECT_TO]-(ct:CompanyType {name: $companyType})
MATCH (o)-[:HAS_DEADLINE]->(d:Deadline)
MATCH (o)-[:REGULATED_BY]->(r:Regulator)
OPTIONAL MATCH (rc:RegulatoryChange)-[:MODIFIES]->(o)
RETURN j, o, d, r, collect(rc) as recentChanges
ORDER BY d.nextDueDate ASC
MATCH (rc:RegulatoryChange {id: $changeId})-[:MODIFIES]->(o:Obligation)
MATCH (ct:CompanyType)-[:SUBJECT_TO]->(o)
MATCH (j:Jurisdiction)-[:HAS_OBLIGATION]->(o)
MATCH (client:Client)-[:IS_TYPE]->(ct)
MATCH (client)-[:OPERATES_IN]->(j)
RETURN DISTINCT client
MATCH (o:Obligation)-[:HAS_DEADLINE]->(d:Deadline)
WHERE d.nextDueDate <= date() + duration({days: $days})
MATCH (ct:CompanyType)-[:SUBJECT_TO]->(o)
MATCH (j:Jurisdiction)-[:HAS_OBLIGATION]->(o)
RETURN o, d, j, ct
ORDER BY d.nextDueDate ASC
MERGE (rc:RegulatoryChange {id: $changeId})
SET rc.title = $title,
rc.effectiveDate = $effectiveDate,
rc.impactLevel = $impactLevel,
rc.updatedAt = datetime()
WITH rc
MATCH (o:Obligation {id: $obligationId})
MERGE (rc)-[:MODIFIES]->(o)
interface ComplianceMap {
client: Client;
generatedAt: string; // ISO datetime
countries: CountryCompliance[];
executiveSummary: {
es: string; // resumen en español
en: string; // resumen en inglés
};
immediateActions: string[]; // acciones para los próximos 30 días
timeline: TimelineItem[]; // próximos 12 meses
}
interface CountryCompliance {
country: string;
riskScore: number; // 0-100
obligations: ObligationDetail[];
criticalDeadlines: Deadline[]; // vencen en < 30 días
recentChanges: RegulatoryChange[];
}
async generateComplianceMap(input: NewClientInput): Promise<ComplianceMap> {
// 1. Para cada país: query Neo4j + query AI Search en paralelo
const [graphData, ragData] = await Promise.all([
this.graphService.getClientObligations(input),
this.ragEngine.getRecentChanges(input.countries, { lastDays: 180 }),
]);
// 2. Combinar y clasificar por urgencia
const obligations = this.mergeAndClassify(graphData, ragData);
const critical = obligations.filter(o => o.daysUntilDeadline < 30);
// 3. Generar resumen con Azure OpenAI
const summary = await this.ragEngine.generateExecutiveSummary(obligations);
return { client, generatedAt, countries, executiveSummary: summary, ... };
}
const tools = [
new Tool({
name: 'searchRegulations',
description: 'Busca cambios regulatorios en Azure AI Search. Input: { query, country?, area? }',
func: (input) => ragEngine.query(input.query, input.filters),
}),
new Tool({
name: 'queryGraph',
description: 'Ejecuta queries Cypher en Neo4j. Input: { clientId?, country?, area? }',
func: (input) => graphService.getClientObligations(input),
}),
new Tool({
name: 'getClientContext',
description: 'Recupera perfil completo de un cliente. Input: { clientId }',
func: (input) => clientService.getById(input.clientId),
}),
];
// El agente responde preguntas como:
// "¿Qué obligaciones tiene Acme Corp en Brasil este trimestre?"
// "¿Hay cambios recientes en MiFID II que afecten a clientes europeos?"
// "¿Cuál es el calendario de compliance para el onboarding de XYZ?"
Ejecutar npm run seed:graph para cargar:
testing
Patrones de implementación para los connectors de ingestion regulatoria de RegWatch AI. Usar cuando se trabaje en: BaseIngestionJob, connectors específicos (SEC EDGAR, EUR-Lex, BOE España, DOF México, DOU Brasil, Infoleg Argentina, CMF Chile), detección de cambios semánticos, clasificación de impacto, o el scheduler de Azure Functions.
testing
Patrones de implementación del pipeline RAG de RegWatch AI usando Azure OpenAI y Azure AI Search. Usar cuando se trabaje en: ingestion de documentos regulatorios, generación de embeddings, hybrid search, cache Redis de embeddings o queries, sistema prompt del LLM, o cualquier parte del RAGEngine y DocumentIndexer.
development
Patrones de deploy de RegWatch AI en Azure. Usar cuando se trabaje en: Bicep templates, Azure Container Apps (api, web, ingestion-scheduler), CI/CD con GitHub Actions, Dockerfiles multi-stage, configuración de Key Vault references, Application Insights custom metrics, o cualquier infraestructura de Azure del proyecto.
development
Patrones del sistema de alertas de RegWatch AI. Usar cuando se trabaje en: AlertEngine, AlertFormatter, NotificationService, flujo HITL (Human-in-the-Loop) para alertas HIGH, canales de notificación (email Azure Communication Services, Teams Adaptive Cards, SSE in-app), deduplicación, escalamiento o rate limiting de alertas.