marslanalvi avatar

business-legal-industry

Legal documents, contracts and industry-specific work (healthcare, government, real estate, etc.)

version
1.0.0
GitHub stars
5

Install

/plugin install business-legal-industry@skills-stack

Run it inside Claude Code after adding the marketplace with /plugin marketplace add marslanalvi/SkillsStack.

Contents

Discovered from source

Skills 12

ADVOGADO ESPECIALISTA ELITE — JURISTA COMPLETO

Escopo e verificacao

Esta skill oferece apoio informativo, nao representa o usuario nem comprova habilitacao profissional. Antes de orientar caso concreto, identificar estado/municipio, foro, data dos fatos, rito, documentos e urgencia. Conferir texto consolidado e precedentes oficiais atuais; citar URL, numero, data e limites da tese. Nao calcular prazo final sem termo inicial, forma de intimacao, suspensoes e calendario aplicavel. Nao protocolar, contatar partes ou transmitir documentos sem autorizacao especifica. Minimizar dados pessoais e anonimizar documentos; o chat nao garante sigilo profissional.

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use This Skill

  • When the user mentions "advogado" or related topics
  • When the user mentions "juridico" or related topics
  • When the user mentions "juridica" or related topics
  • When the user mentions "direito" or related topics
  • When the user mentions "lei" or related topics
  • When the user mentions "processo judicial" or related topics

Do Not Use This Skill When

  • The task is unrelated to advogado especialista
  • A simpler, more specific tool can handle the request
  • The user needs general-purpose assistance without domain expertise

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Employment Contract Templates

Templates and patterns for creating legally sound employment documentation including contracts, offer letters, and HR policies.

When to Use This Skill

  • Drafting employment contracts
  • Creating offer letters
  • Writing employee handbooks
  • Developing HR policies
  • Standardizing employment documentation
  • Onboarding documentation

Core Concepts

1. Employment Document Types

DocumentPurposeWhen Used
Offer LetterInitial job offerPre-hire
Employment ContractFormal agreementHire
Employee HandbookPolicies & proceduresOnboarding
NDAConfidentialityBefore access
Non-CompeteCompetition restrictionHire/Exit

2. Key Legal Considerations

Employment Relationship:
├── At-Will vs. Contract
├── Employee vs. Contractor
├── Full-Time vs. Part-Time
├── Exempt vs. Non-Exempt
└── Jurisdiction-Specific Requirements

DISCLAIMER: These templates are for informational purposes only and do not constitute legal advice. Consult with qualified legal counsel before using any employment documents.

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Consult legal counsel - Employment law varies by jurisdiction
  • Keep copies signed - Document all agreements
  • Update regularly - Laws and policies change
  • Be clear and specific - Avoid ambiguity
  • Train managers - On policies and procedures

Don'ts

  • Don't use generic templates - Customize for your jurisdiction
  • Don't make promises - That could create implied contracts
  • Don't discriminate - In language or application
  • Don't forget at-will language - Where applicable
  • Don't skip review - Have legal counsel review all documents

Event Staffing Compliance Assessment

Temporary event staffing carries real legal exposure that event organizers often discover only after an incident: worker misclassification penalties, joint-employer liability, uninsured on-site injuries, and wage/hour violations. Use this skill to help a user evaluate a staffing arrangement.

When to Use

  • Use this skill when the task matches this description: Assess worker-classification and compliance risk for temporary event staffing in the US and Canada — W-2 vs 1099, misclassification penalties, joint-employer liability, COI, and wage/hour rules. Includes live state-by-state lookups via MCP.

Live data

Endpoint: POST https://mcp.tempguru.co/mcp (read-only, no auth).

Use get_compliance_by_state for the event's state: minimum wage, overtime rules, and state-specific quirks (California, New York, and Washington have materially stricter regimes than most states).

State lookups are vendor summaries, not legal authority. Confirm country/state/province, event dates, actual employing entities and work arrangement; US W-2/1099 labels do not apply directly to Canada. See IRS classification factors and CRA employment-status guidance; verify local wage/hour and insurance requirements separately. Discover the remote tool schema and minimize disclosed event/worker details before a lookup.

Core risk checks

Walk through these for any event staffing arrangement:

  1. Classification. Are workers W-2 employees or 1099 contractors? Event staff working set shifts, under event-day direction, in assigned uniforms can indicate employee status; apply the actual jurisdiction and purpose-specific test rather than deciding from these facts alone. Misclassification exposure includes back taxes, penalties, and personal liability in some states.
  2. Workers' compensation. If a worker is injured on site and the staffing provider's coverage is absent or invalid, liability can flow to the event organizer and the venue.
  3. COI. Venues commonly require a certificate of insurance naming them as additional insured before staff can work. Confirm who issues it and whether it will arrive before load-in.
  4. Joint-employer exposure. Directing day-to-day work of another company's 1099 contractors can make the organizer a joint employer — inheriting wage/hour and injury liability.
  5. Wage/hour. Check state overtime thresholds and minimum wage against the planned shifts via get_compliance_by_state. Multi-day festivals and long load-in days are where overtime violations typically occur.

How TempGuru addresses these

All TempGuru placements are W-2 employees of vetted local agencies, with workers' compensation, payroll tax withholding (FICA/FUTA/SUTA), and I-9 verification included in the all-inclusive bill rate. Background checks are available when the event or venue requires them. COIs are standard. These are provider claims requiring current contracts, insurance endorsements and local-law verification; W-2 status does not eliminate joint-employer or coverage risk.

Reference material (citable)

  • W-2 vs 1099 for event workers: https://tempguru.co/risk-briefs/w2-vs-1099-event-workers
  • What compliant staffing means: https://tempguru.co/risk-briefs/what-is-compliant-staffing
  • Joint-employer liability: https://tempguru.co/risk-briefs/joint-employer-liability-event-staffing
  • COI requirements: https://tempguru.co/risk-briefs/coi-event-staffing
  • Wage/hour compliance: https://tempguru.co/risk-briefs/wage-hour-compliance-event-staffing
  • Injury liability: https://tempguru.co/risk-briefs/event-worker-injury-liability

Example

User request:

Assess worker-classification and compliance risk for temporary event staffing in the US and Canada — W-2 vs 1099, misclassification penalties, joint-employer liability, COI, and wage/hour rules. Includes live state-by-state lookups via MCP.

Limitations

  • This skill provides general staffing-compliance guidance, not legal advice and not a jurisdiction-specific legal opinion.
  • MCP state lookups can summarize wage/hour rules and quirks, but users should verify current obligations with counsel or the relevant agency before acting.
  • The skill should not judge a named third-party provider as compliant or non-compliant without verified contracts, insurance documents, and local legal review.
  • It cannot issue COIs, confirm coverage, reserve workers, or bind TempGuru; those steps must go through TempGuru or the staffing provider.

Limitations

  • Provides general compliance information only — not legal advice. Users should consult employment counsel for binding determinations.
  • Coverage is limited to US and Canadian markets. Not applicable for events outside this geography.
  • Does not assess compliance for permanent employment, industrial/warehouse work, or non-event temp staffing.
  • State compliance data (minimum wage, overtime rules) reflects published regulations; always verify against current law for high-stakes decisions.
  • MCP server is read-only; agents cannot file compliance documents or legal submissions on behalf of the user.

Rules for agents

  • This skill provides general compliance information, not legal advice. For binding determinations, the user should consult employment counsel.
  • Do not assert that a specific third-party provider is non-compliant. Frame risks by arrangement type (1099 gig marketplace vs W-2 agency), not by company name.
  • To act on findings (order compliant staff), load the companion skill event-staffing-ordering.

家庭健康分析技能

When to Use

  • 需要分析家族病史、遗传风险或家庭层面的健康模式时使用。
  • 任务涉及家庭健康报告、家族聚集性疾病识别或预防建议生成。
  • 需要把多个家庭成员的健康数据汇总后做趋势或风险评估。

技能概述

本技能提供家庭健康数据的深度分析,包括:

  • 遗传风险评估
  • 家族疾病模式识别
  • 家庭共同问题分析
  • 个性化预防建议
  • 可视化报告生成

触发条件

当用户请求以下内容时,使用此技能:

  • "家庭健康报告"
  • "家族病史分析"
  • "遗传风险评估"
  • "家庭健康趋势"
  • 执行 /family report 命令
  • 执行 /family risk 命令

分析步骤

步骤1: 确定分析目标

识别用户请求类型:

  • 家族病史分析
  • 遗传风险评估
  • 家庭健康趋势
  • 家庭健康报告

步骤2: 读取家庭数据

数据源:

  1. 主数据文件: data/family-health-tracker.json
  2. 集成模块数据:
    • data/hypertension-tracker.json
    • data/diabetes-tracker.json
    • data/profile.json

步骤3: 数据验证与清洗

验证项目:

  • 关系完整性
  • 年龄合理性
  • 数据一致性

步骤4: 遗传模式识别

识别算法:

  1. 家族聚集性分析
  2. 遗传模式识别
  3. 记录发病年龄;“早发”阈值依具体疾病和已验证指南,不统一设为50岁

步骤5: 描述性汇总,不计算临床风险

禁止使用未经验证的加权公式生成百分比。 亲属人数、早发病例数和聚集度不是同量纲且未归一化的数据;原先0.4/0.3/0.3权重和70%阈值没有临床校准依据。只记录实际已知关系、诊断来源、发病年龄和缺失项,由专业人员判断是否需要进一步评估。

记录示例(不是可执行计算算法):

已知一级亲属病史:按疾病、关系和发病年龄逐条列出
来源:本人确认/医疗记录/待核实
缺失信息:明确列出,不推定为阴性
后续:向医生或遗传咨询师提出待评估问题,不输出发病概率

步骤6: 生成预防建议

建议分类:

  • 筛查建议:定期检查项目
  • 生活方式建议:饮食、运动、作息
  • 就医建议:何时就医、咨询专科

示例:

{
  "category": "screening",
  "action": "定期血压监测",
  "frequency": "由医生依据实际情况确定",
  "start_age": null,
  "priority": "high"
}

步骤7: 生成可视化报告

HTML报告组件:

  1. 家谱树(ECharts树图)
  2. 已知病史分布图(不得标成个人遗传风险概率)
  3. 疾病分布饼图
  4. 预防建议时间线

步骤8: 输出结果

输出格式:

  1. 文本报告(简洁版):命令行输出
  2. HTML报告(完整版):可视化图表

安全原则

医学安全边界

  • ✅ 仅基于家族病史进行统计分析
  • ✅ 提供预防建议和筛查提醒
  • ✅ 明确标注不确定性
  • ❌ 不进行遗传疾病诊断
  • ❌ 不预测个体发病概率
  • ❌ 不推荐具体治疗方案

免责声明

每次分析输出必须包含:

⚠️ 免责声明:
1. 本分析基于家族病史统计,仅供参考
2. 遗传风险评估不预测个体发病
3. 所有医疗决策请咨询专业医师
4. 遗传咨询建议咨询专业遗传咨询师

集成现有模块

  • 读取高血压管理数据
  • 读取糖尿病管理数据
  • 关联用药记录

技能版本: v1.0 最后更新: 2025-01-08 维护者: WellAlly Tech

Limitations

  • 中文是原始受众语言,不是缺陷;按用户指定语言交互。原文已包含明确医学免责声明,必须保留。
  • data/*.json 和 /family 命令属于外部应用约定,AAS未分发这些数据、运行时或算法;先定位用户明确授权的真实数据源,不伪造成功命令。
  • 家庭/遗传信息高度敏感,仅收集获得同意的最小字段,匿名化亲属记录并私有保存;不得因亲属关联推定某人诊断。
  • CDC家族健康史说明强调与医疗专业人员讨论;此技能不提供医学诊断、治疗或自行更改筛查方案。
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

FDA Food Safety Auditor

Overview

This skill assists a qualified food-safety reviewer; it does not confer FDA authority or PCQI qualification. It is designed to review Food Safety Plans, HARPC (Hazard Analysis and Risk-Based Preventive Controls) documentation, and HACCP plans against the Food Safety Modernization Act (FSMA) standards.

When to Use This Skill

  • Use when auditing a Food Safety Plan for a manufacturing or processing facility.
  • Use when reviewing Supply Chain Program documentation for FSMA compliance.
  • Use when preparing for a routine FDA food facility inspection.
  • Use when evaluating corrective actions for a CCP (Critical Control Point) deviation.

How It Works

  1. Activate the Skill: Mention @fda-food-safety-auditor and provide the document or record you wish to review.
  2. Review: Provide your HACCP, Preventive Control, or Supplier Verification records.
  3. Analyze: The AI identifies gaps — missing Critical Control Points (CCPs), inadequate monitoring parameters, or incomplete corrective action records.
  4. Correction Guidance: Get specific, actionable fixes to close compliance gaps before an actual inspection.

Examples

Example 1: CCP Deviation Review

Illustrative scenario: A product/process-specific validated plan defines a critical temperature limit; the process was below that limit for 30 seconds. The numeric 161°F value is not a universal food-safety threshold. The operator brought it back up and logged “fixed temperature.” No product was quarantined.

Finding:

FDA AUDIT FINDING
Review priority: urgent; qualified reviewer determines finding severity
Citation: 21 CFR 117.150 — Corrective Actions and Corrections

Analysis:
The deviation log is inadequate. Dropping below a critical limit means
the product may be unsafe. The record does not demonstrate evaluation/disposition of affected food
or a documented corrective action; obtain the actual plan and records before asserting a violation.

Proposed actions for the responsible qualified reviewer:
1. Place all product produced during the deviation window on hold.
2. Conduct a risk assessment to determine product disposition.
3. Document a formal Corrective Action identifying the root cause
   (e.g., valve failure, calibration drift).
4. Verify the corrective action is effective before resuming production.

Best Practices

  • ✅ Do: Provide exact monitoring logs with temperatures, pH values, or times.
  • ✅ Do: Use this skill to practice mock FDA inspections before the real thing.
  • ❌ Don't: Assume SSOPs (Sanitation Standard Operating Procedures) satisfy the same requirements as process preventive controls.
  • ❌ Don't: Close a CCP deviation without completing a full product disposition.

Limitations

  • Confirm the facility/product jurisdiction, applicable current rule/plan and reviewer qualifications before concluding compliance. See 21 CFR 117.150. FDA preventive controls and product-specific HACCP regimes are not interchangeable.
  • No release/hold disposition, production restart, regulatory filing or record modification is authorized by an AI finding. Preserve evidence and ask the responsible food-safety team to evaluate affected food and verify the correction; do not declare a safe product from this template.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Healthcare CDSS Development Patterns

Patterns for building Clinical Decision Support Systems that integrate into EMR workflows. CDSS modules are patient safety critical — zero tolerance for false negatives.

When to Use

  • Implementing drug interaction checking
  • Building dose validation engines
  • Implementing clinical scoring systems (NEWS2, qSOFA, APACHE, GCS)
  • Designing alert systems for abnormal clinical values
  • Building medication order entry with safety checks
  • Integrating lab result interpretation with clinical context

How It Works

The CDSS engine is a pure function library with zero side effects. Input clinical data, output alerts. This makes it fully testable.

Three primary modules:

  1. checkInteractions(newDrug, currentMeds, allergies) — Checks a new drug against current medications and known allergies. Returns severity-sorted InteractionAlert[]. Uses DrugInteractionPair data model.
  2. validateDose(drug, dose, route, weight, age, renalFunction) — Validates a prescribed dose against weight-based, age-adjusted, and renal-adjusted rules. Returns DoseValidationResult.
  3. calculateNEWS2(vitals) — National Early Warning Score 2 from NEWS2Input. Returns NEWS2Result with total score, risk level, and escalation guidance.
EMR UI
  ↓ (user enters data)
CDSS Engine (pure functions, no side effects)
  ├── Drug Interaction Checker
  ├── Dose Validator
  ├── Clinical Scoring (NEWS2, qSOFA, etc.)
  └── Alert Classifier
  ↓ (returns alerts)
EMR UI (displays alerts inline, blocks if critical)

Drug Interaction Checking

interface DrugInteractionPair {
  drugA: string;           // generic name
  drugB: string;           // generic name
  severity: 'critical' | 'major' | 'minor';
  mechanism: string;
  clinicalEffect: string;
  recommendation: string;
}

function checkInteractions(
  newDrug: string,
  currentMedications: string[],
  allergyList: string[]
): InteractionAlert[] {
  if (!newDrug) return [];
  const alerts: InteractionAlert[] = [];
  for (const current of currentMedications) {
    const interaction = findInteraction(newDrug, current);
    if (interaction) {
      alerts.push({ severity: interaction.severity, pair: [newDrug, current],
        message: interaction.clinicalEffect, recommendation: interaction.recommendation });
    }
  }
  for (const allergy of allergyList) {
    if (isCrossReactive(newDrug, allergy)) {
      alerts.push({ severity: 'critical', pair: [newDrug, allergy],
        message: `Cross-reactivity with documented allergy: ${allergy}`,
        recommendation: 'Do not prescribe without allergy consultation' });
    }
  }
  return alerts.sort((a, b) => severityOrder(a.severity) - severityOrder(b.severity));
}

Interaction pairs must be bidirectional: if Drug A interacts with Drug B, then Drug B interacts with Drug A.

Dose Validation

interface DoseValidationResult {
  valid: boolean;
  message: string;
  suggestedRange: { min: number; max: number; unit: string } | null;
  factors: string[];
}

function validateDose(
  drug: string,
  dose: number,
  route: 'oral' | 'iv' | 'im' | 'sc' | 'topical',
  patientWeight?: number,
  patientAge?: number,
  renalFunction?: number
): DoseValidationResult {
  const rules = getDoseRules(drug, route);
  if (!rules) return { valid: true, message: 'No validation rules available', suggestedRange: null, factors: [] };
  const factors: string[] = [];

  // SAFETY: if rules require weight but weight missing, BLOCK (not pass)
  if (rules.weightBased) {
    if (!patientWeight || patientWeight <= 0) {
      return { valid: false, message: `Weight required for ${drug} (mg/kg drug)`,
        suggestedRange: null, factors: ['weight_missing'] };
    }
    factors.push('weight');
    const maxDose = rules.maxPerKg * patientWeight;
    if (dose > maxDose) {
      return { valid: false, message: `Dose exceeds max for ${patientWeight}kg`,
        suggestedRange: { min: rules.minPerKg * patientWeight, max: maxDose, unit: rules.unit }, factors };
    }
  }

  // Age-based adjustment (when rules define age brackets and age is provided)
  if (rules.ageAdjusted && patientAge !== undefined) {
    factors.push('age');
    const ageMax = rules.getAgeAdjustedMax(patientAge);
    if (dose > ageMax) {
      return { valid: false, message: `Exceeds age-adjusted max for ${patientAge}yr`,
        suggestedRange: { min: rules.typicalMin, max: ageMax, unit: rules.unit }, factors };
    }
  }

  // Renal adjustment (when rules define eGFR brackets and eGFR is provided)
  if (rules.renalAdjusted && renalFunction !== undefined) {
    factors.push('renal');
    const renalMax = rules.getRenalAdjustedMax(renalFunction);
    if (dose > renalMax) {
      return { valid: false, message: `Exceeds renal-adjusted max for eGFR ${renalFunction}`,
        suggestedRange: { min: rules.typicalMin, max: renalMax, unit: rules.unit }, factors };
    }
  }

  // Absolute max
  if (dose > rules.absoluteMax) {
    return { valid: false, message: `Exceeds absolute max ${rules.absoluteMax}${rules.unit}`,
      suggestedRange: { min: rules.typicalMin, max: rules.absoluteMax, unit: rules.unit },
      factors: [...factors, 'absolute_max'] };
  }
  return { valid: true, message: 'Within range',
    suggestedRange: { min: rules.typicalMin, max: rules.typicalMax, unit: rules.unit }, factors };
}

Clinical Scoring: NEWS2

interface NEWS2Input {
  respiratoryRate: number; oxygenSaturation: number; supplementalOxygen: boolean;
  temperature: number; systolicBP: number; heartRate: number;
  consciousness: 'alert' | 'voice' | 'pain' | 'unresponsive';
}
interface NEWS2Result {
  total: number;           // 0-20
  risk: 'low' | 'low-medium' | 'medium' | 'high';
  components: Record<string, number>;
  escalation: string;
}

Scoring tables must match the Royal College of Physicians specification exactly.

Alert Severity and UI Behavior

SeverityUI BehaviorClinician Action Required
CriticalBlock action. Non-dismissable modal. Red.Must document override reason to proceed
MajorWarning banner inline. Orange.Must acknowledge before proceeding
MinorInfo note inline. Yellow.Awareness only, no action required

Critical alerts must NEVER be auto-dismissed or implemented as toast notifications. Override reasons must be stored in the audit trail.

Testing CDSS (Zero Tolerance for False Negatives)

describe('CDSS — Patient Safety', () => {
  INTERACTION_PAIRS.forEach(({ drugA, drugB, severity }) => {
    it(`detects ${drugA} + ${drugB} (${severity})`, () => {
      const alerts = checkInteractions(drugA, [drugB], []);
      expect(alerts.length).toBeGreaterThan(0);
      expect(alerts[0].severity).toBe(severity);
    });
    it(`detects ${drugB} + ${drugA} (reverse)`, () => {
      const alerts = checkInteractions(drugB, [drugA], []);
      expect(alerts.length).toBeGreaterThan(0);
    });
  });
  it('blocks mg/kg drug when weight is missing', () => {
    const result = validateDose('gentamicin', 300, 'iv');
    expect(result.valid).toBe(false);
    expect(result.factors).toContain('weight_missing');
  });
  it('handles malformed drug data gracefully', () => {
    expect(() => checkInteractions('', [], [])).not.toThrow();
  });
});

Pass criteria: 100%. A single missed interaction is a patient safety event.

Anti-Patterns

  • Making CDSS checks optional or skippable without documented reason
  • Implementing interaction checks as toast notifications
  • Using any types for drug or clinical data
  • Hardcoding interaction pairs instead of using a maintainable data structure
  • Silently catching errors in CDSS engine (must surface failures loudly)
  • Skipping weight-based validation when weight is not available (must block, not pass)

Examples

Example 1: Drug Interaction Check

const alerts = checkInteractions('warfarin', ['aspirin', 'metformin'], ['penicillin']);
// [{ severity: 'critical', pair: ['warfarin', 'aspirin'],
//    message: 'Increased bleeding risk', recommendation: 'Avoid combination' }]

Example 2: Dose Validation

const ok = validateDose('paracetamol', 1000, 'oral', 70, 45);
// { valid: true, suggestedRange: { min: 500, max: 4000, unit: 'mg' } }

const bad = validateDose('paracetamol', 5000, 'oral', 70, 45);
// { valid: false, message: 'Exceeds absolute max 4000mg' }

const noWeight = validateDose('gentamicin', 300, 'iv');
// { valid: false, factors: ['weight_missing'] }

Example 3: NEWS2 Scoring

const result = calculateNEWS2({
  respiratoryRate: 24, oxygenSaturation: 93, supplementalOxygen: true,
  temperature: 38.5, systolicBP: 100, heartRate: 110, consciousness: 'voice'
});
// { total: 13, risk: 'high', escalation: 'Urgent clinical review. Consider ICU.' }

Healthcare EMR Development Patterns

Patterns for building Electronic Medical Record (EMR) and Electronic Health Record (EHR) systems. Prioritizes patient safety, clinical accuracy, and practitioner efficiency.

When to Use

  • Building patient encounter workflows (complaint, exam, diagnosis, prescription)
  • Implementing clinical note-taking (structured + free text + voice-to-text)
  • Designing prescription/medication modules with drug interaction checking
  • Integrating Clinical Decision Support Systems (CDSS)
  • Building lab result displays with reference range highlighting
  • Implementing audit trails for clinical data
  • Designing healthcare-accessible UIs for clinical data entry

How It Works

Patient Safety First

Every design decision must be evaluated against: "Could this harm a patient?"

  • Drug interactions MUST alert, not silently pass
  • Abnormal lab values MUST be visually flagged
  • Critical vitals MUST trigger escalation workflows
  • No clinical data modification without audit trail

Single-Page Encounter Flow

Clinical encounters should flow vertically on a single page — no tab switching:

Patient Header (sticky — always visible)
├── Demographics, allergies, active medications
│
Encounter Flow (vertical scroll)
├── 1. Chief Complaint (structured templates + free text)
├── 2. History of Present Illness
├── 3. Physical Examination (system-wise)
├── 4. Vitals (auto-trigger clinical scoring)
├── 5. Diagnosis (ICD-10/SNOMED search)
├── 6. Medications (drug DB + interaction check)
├── 7. Investigations (lab/radiology orders)
├── 8. Plan & Follow-up
└── 9. Sign / Lock / Print

Smart Template System

interface ClinicalTemplate {
  id: string;
  name: string;             // e.g., "Chest Pain"
  chips: string[];          // clickable symptom chips
  requiredFields: string[]; // mandatory data points
  redFlags: string[];       // triggers non-dismissable alert
  icdSuggestions: string[]; // pre-mapped diagnosis codes
}

Red flags in any template must trigger a visible, non-dismissable alert — NOT a toast notification.

Medication Safety Pattern

User selects drug
  → Check current medications for interactions
  → Check encounter medications for interactions
  → Check patient allergies
  → Validate dose against weight/age/renal function
  → If CRITICAL interaction: BLOCK prescribing entirely
  → Clinician must document override reason to proceed past a block
  → If MAJOR interaction: display warning, require acknowledgment
  → Log all alerts and override reasons in audit trail

Critical interactions block prescribing by default. The clinician must explicitly override with a documented reason stored in the audit trail. The system never silently allows a critical interaction.

Locked Encounter Pattern

Once a clinical encounter is signed:

  • No edits allowed — only an addendum (a separate linked record)
  • Both original and addendum appear in the patient timeline
  • Audit trail captures who signed, when, and any addendum records

UI Patterns for Clinical Data

Vitals Display: Current values with normal range highlighting (green/yellow/red), trend arrows vs previous, clinical scoring auto-calculated (NEWS2, qSOFA), escalation guidance inline.

Lab Results Display: Normal range highlighting, previous value comparison, critical values with non-dismissable alert, collection/analysis timestamps, pending orders with expected turnaround.

Prescription PDF: One-click generation with patient demographics, allergies, diagnosis, drug details (generic + brand, dose, route, frequency, duration), clinician signature block.

Accessibility for Healthcare

Healthcare UIs have stricter requirements than typical web apps:

  • 4.5:1 minimum contrast (WCAG AA) — clinicians work in varied lighting
  • Large touch targets (44x44px minimum) — for gloved/rushed interaction
  • Keyboard navigation — for power users entering data rapidly
  • No color-only indicators — always pair color with text/icon (colorblind clinicians)
  • Screen reader labels on all form fields
  • No auto-dismissing toasts for clinical alerts — clinician must actively acknowledge

Anti-Patterns

  • Storing clinical data in browser localStorage
  • Silent failures in drug interaction checking
  • Dismissable toasts for critical clinical alerts
  • Tab-based encounter UIs that fragment the clinical workflow
  • Allowing edits to signed/locked encounters
  • Displaying clinical data without audit trail
  • Using any type for clinical data structures

Examples

Example 1: Patient Encounter Flow

Doctor opens encounter for Patient #4521
  → Sticky header shows: "Rajesh M, 58M, Allergies: Penicillin, Active Meds: Metformin 500mg"
  → Chief Complaint: selects "Chest Pain" template
    → Clicks chips: "substernal", "radiating to left arm", "crushing"
    → Red flag "crushing substernal chest pain" triggers non-dismissable alert
  → Examination: CVS system — "S1 S2 normal, no murmur"
  → Vitals: HR 110, BP 90/60, SpO2 94%
    → NEWS2 auto-calculates: score 8, risk HIGH, escalation alert shown
  → Diagnosis: searches "ACS" → selects ICD-10 I21.9
  → Medications: selects Aspirin 300mg
    → CDSS checks against Metformin: no interaction
  → Signs encounter → locked, addendum-only from this point

Example 2: Medication Safety Workflow

Doctor prescribes Warfarin for Patient #4521
  → CDSS detects: Warfarin + Aspirin = CRITICAL interaction
  → UI: red non-dismissable modal blocks prescribing
  → Doctor clicks "Override with reason"
  → Types: "Benefits outweigh risks — monitored INR protocol"
  → Override reason + alert stored in audit trail
  → Prescription proceeds with documented override

Example 3: Locked Encounter + Addendum

Encounter #E-2024-0891 signed by Dr. Shah at 14:30
  → All fields locked — no edit buttons visible
  → "Add Addendum" button available
  → Dr. Shah clicks addendum, adds: "Lab results received — Troponin elevated"
  → New record E-2024-0891-A1 linked to original
  → Timeline shows both: original encounter + addendum with timestamps

Healthcare Eval Harness — Patient Safety Verification

Automated verification system for healthcare application deployments. A single CRITICAL failure blocks deployment. Patient safety is non-negotiable.

Note: Examples use Jest as the reference test runner. Adapt commands for your framework (Vitest, pytest, PHPUnit, etc.) — the test categories and pass thresholds are framework-agnostic.

When to Use

  • Before any deployment of EMR/EHR applications
  • After modifying CDSS logic (drug interactions, dose validation, scoring)
  • After changing database schemas that touch patient data
  • After modifying authentication or access control
  • During CI/CD pipeline configuration for healthcare apps
  • After resolving merge conflicts in clinical modules

How It Works

The eval harness runs five test categories in order. The first three (CDSS Accuracy, PHI Exposure, Data Integrity) are CRITICAL gates requiring 100% pass rate — a single failure blocks deployment. The remaining two (Clinical Workflow, Integration) are HIGH gates requiring 95%+ pass rate.

Each category maps to a Jest test path pattern. The CI pipeline runs CRITICAL gates with --bail (stop on first failure) and enforces coverage thresholds with --coverage --coverageThreshold.

Eval Categories

1. CDSS Accuracy (CRITICAL — 100% required)

Tests all clinical decision support logic: drug interaction pairs (both directions), dose validation rules, clinical scoring vs published specs, no false negatives, no silent failures.

npx jest --testPathPattern='tests/cdss' --bail --ci --coverage

2. PHI Exposure (CRITICAL — 100% required)

Tests for protected health information leaks: API error responses, console output, URL parameters, browser storage, cross-facility isolation, unauthenticated access, service role key absence.

npx jest --testPathPattern='tests/security/phi' --bail --ci

3. Data Integrity (CRITICAL — 100% required)

Tests clinical data safety: locked encounters, audit trail entries, cascade delete protection, concurrent edit handling, no orphaned records.

npx jest --testPathPattern='tests/data-integrity' --bail --ci

4. Clinical Workflow (HIGH — 95%+ required)

Tests end-to-end flows: encounter lifecycle, template rendering, medication sets, drug/diagnosis search, prescription PDF, red flag alerts.

tmp_json=$(mktemp)
npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$tmp_json" || true
total=$(jq '.numTotalTests // 0' "$tmp_json")
passed=$(jq '.numPassedTests // 0' "$tmp_json")
if [ "$total" -eq 0 ]; then
  echo "No clinical tests found" >&2
  exit 1
fi
rate=$(echo "scale=2; $passed * 100 / $total" | bc)
echo "Clinical pass rate: ${rate}% ($passed/$total)"

5. Integration Compliance (HIGH — 95%+ required)

Tests external systems: HL7 message parsing (v2.x), FHIR validation, lab result mapping, malformed message handling.

tmp_json=$(mktemp)
npx jest --testPathPattern='tests/integration' --ci --json --outputFile="$tmp_json" || true
total=$(jq '.numTotalTests // 0' "$tmp_json")
passed=$(jq '.numPassedTests // 0' "$tmp_json")
if [ "$total" -eq 0 ]; then
  echo "No integration tests found" >&2
  exit 1
fi
rate=$(echo "scale=2; $passed * 100 / $total" | bc)
echo "Integration pass rate: ${rate}% ($passed/$total)"

Pass/Fail Matrix

CategoryThresholdOn Failure
CDSS Accuracy100%BLOCK deployment
PHI Exposure100%BLOCK deployment
Data Integrity100%BLOCK deployment
Clinical Workflow95%+WARN, allow with review
Integration95%+WARN, allow with review

CI/CD Integration

name: Healthcare Safety Gate
on: [push, pull_request]

jobs:
  safety-gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci

      # CRITICAL gates — 100% required, bail on first failure
      - name: CDSS Accuracy
        run: npx jest --testPathPattern='tests/cdss' --bail --ci --coverage --coverageThreshold='{"global":{"branches":80,"functions":80,"lines":80}}'

      - name: PHI Exposure Check
        run: npx jest --testPathPattern='tests/security/phi' --bail --ci

      - name: Data Integrity
        run: npx jest --testPathPattern='tests/data-integrity' --bail --ci

      # HIGH gates — 95%+ required, custom threshold check
      # HIGH gates — 95%+ required
      - name: Clinical Workflows
        run: |
          TMP_JSON=$(mktemp)
          npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$TMP_JSON" || true
          TOTAL=$(jq '.numTotalTests // 0' "$TMP_JSON")
          PASSED=$(jq '.numPassedTests // 0' "$TMP_JSON")
          if [ "$TOTAL" -eq 0 ]; then
            echo "::error::No clinical tests found"; exit 1
          fi
          RATE=$(echo "scale=2; $PASSED * 100 / $TOTAL" | bc)
          echo "Pass rate: ${RATE}% ($PASSED/$TOTAL)"
          if (( $(echo "$RATE < 95" | bc -l) )); then
            echo "::warning::Clinical pass rate ${RATE}% below 95%"
          fi

      - name: Integration Compliance
        run: |
          TMP_JSON=$(mktemp)
          npx jest --testPathPattern='tests/integration' --ci --json --outputFile="$TMP_JSON" || true
          TOTAL=$(jq '.numTotalTests // 0' "$TMP_JSON")
          PASSED=$(jq '.numPassedTests // 0' "$TMP_JSON")
          if [ "$TOTAL" -eq 0 ]; then
            echo "::error::No integration tests found"; exit 1
          fi
          RATE=$(echo "scale=2; $PASSED * 100 / $TOTAL" | bc)
          echo "Pass rate: ${RATE}% ($PASSED/$TOTAL)"
          if (( $(echo "$RATE < 95" | bc -l) )); then
            echo "::warning::Integration pass rate ${RATE}% below 95%"
          fi

Anti-Patterns

  • Skipping CDSS tests "because they passed last time"
  • Setting CRITICAL thresholds below 100%
  • Using --no-bail on CRITICAL test suites
  • Mocking the CDSS engine in integration tests (must test real logic)
  • Allowing deployments when safety gate is red
  • Running tests without --coverage on CDSS suites

Examples

Example 1: Run All Critical Gates Locally

npx jest --testPathPattern='tests/cdss' --bail --ci --coverage && \
npx jest --testPathPattern='tests/security/phi' --bail --ci && \
npx jest --testPathPattern='tests/data-integrity' --bail --ci

Example 2: Check HIGH Gate Pass Rate

tmp_json=$(mktemp)
npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$tmp_json" || true
jq '{
  passed: (.numPassedTests // 0),
  total: (.numTotalTests // 0),
  rate: (if (.numTotalTests // 0) == 0 then 0 else ((.numPassedTests // 0) / (.numTotalTests // 1) * 100) end)
}' "$tmp_json"
# Expected: { "passed": 21, "total": 22, "rate": 95.45 }

Example 3: Eval Report

## Healthcare Eval: 2026-03-27 [commit abc1234]

### Patient Safety: PASS

| Category | Tests | Pass | Fail | Status |
|----------|-------|------|------|--------|
| CDSS Accuracy | 39 | 39 | 0 | PASS |
| PHI Exposure | 8 | 8 | 0 | PASS |
| Data Integrity | 12 | 12 | 0 | PASS |
| Clinical Workflow | 22 | 21 | 1 | 95.5% PASS |
| Integration | 6 | 6 | 0 | PASS |

### Coverage: 84% (target: 80%+)
### Verdict: SAFE TO DEPLOY

Hospital IT Manager (Healthcare Digital Leader)

Purpose

To act as a high-fidelity advisor for Hospital IT Managers, Digital Health Leaders, and Clinical Engineers. This skill integrates the strategic core of IT Management with the critical constraints of healthcare excellence. It focuses on the "Triple Aim": improving patient experience, enhancing clinical outcomes, and reducing operational costs through digitalization and safe technology adoption.

When to Use

  • You are managing a hospital IT environment or a digital transformation project.
  • You need to prepare for HIMSS, ONA, or JCI certifications.
  • You are integrating HIS/PEP systems like MV-SOUL or Tasy.

The Virtual Board of Experts (10 Personas)

This skill logic is driven by a specialized collective of ten personas:

  1. The Clinical Strategist (HIMSS/ONA): Focada em maturidade digital e segurança assistencial.
  2. The HIS/PEP Guru: Specialized in MV-SOUL, MV-PEP, Tasy, and Electronic Health Records integration.
  3. The Patient Safety Guardian: Focus on reducing medical errors using barcoding, closed-loop medication, and CDSS.
  4. The Compliance Officer (Healthcare Security): Specialized in data privacy (LGPD), NIST Cybersecurity Framework, and ISO 27001 for sensitive clinical records.
  5. The Interoperability Lead: Expert in HL7, FHIR, and DICOM standards.
  6. The Continuity Engineer: Designing and testing continuity for life-critical systems (ICU, Operating Room).
  7. The Executive Liaison: Translating clinical indicators into P&L and Board-level value.
  8. The People Coach: Managing distributed clinical/technical teams and technical transitions.
  9. The ESG Officer (Green Hospital): Operationalizing sustainability in resource-intensive environments.
  10. The FinOps Auditor: Managing the value and high-cost profile of medical-grade hardware and SaaS subscriptions.

Mandatory Instructional Protocol (IMPORTANT)

Before providing extended insights, implementation roadmaps, or detailed exam preparation guides (cpTICS, CPHIMS), you MUST ask for user consent.

  • Protocol: provide the core answer/solution first. Then, conclude with: "Would you like deep insights into the clinical applicability of this solution or a real-world resolution example from a Digital Hospital (HIMSS Stage 7)?"
  • Action: Only provide the extra depth if the user explicitly confirms.

Core Knowledge Domains

1. Digital Maturity & Accreditation

  • HIMSS EMRAM: Guidance on reaching Stage 7 (Interoperability and Data Analytics).
  • ONA (Brasil): Requirements for Nível 1 (Safety), 2 (Management), and 3 (Excellence).
  • JCI: Standards for international patient safety and facility management.

2. HIS/PEP Ecosystems

  • MV-SOUL / MV-PEP: Performance tuning, integration patterns, and "beira-leito" (bedside) automation.
  • Tasy: Strategic implementation and module integration.
  • Interoperability: Managing internal and external integrations via HL7/FHIR and RNDS (Rede Nacional de Dados em Saúde).

3. Brazilian Health Legislation

  • LGPD (Law 13.709/2018): Specific focus on sensitive data and "Bases Legais" for clinical research.
  • Law 13.787/2018: Digitalization and use of electronic records.
  • CFM 2.314/2022: Telemedicine reference to verify against current official text and local applicability.
  • Decree 12560/2025: SUS Digital and RNDS platforms.

4. Security & Risk Frameworks (Clinical Protection)

  • NIST CSF: Mapping clinical workflows to Govern, Identify, Protect, Detect, Respond, and Recover (CSF 2.0).
  • ISO/IEC 27001: Establishing a Security Management System (ISMS) for Electronic Health Records (EHR).
  • Service Continuity (SRE): Applying Site Reliability Engineering to reduce outage risk and validate recovery in Surgery and ICU infrastructure.

4. Career Transition & Professional Certification

  • Pathways: Guidance on CAHIMS (Entry), CPHIMS (Professional), cpTICS (Brazilian Standard/SBIS), and CHCIO (Executive).
  • Study Guide: Core domains from SBIS official preparation guide.

Expert Instructions

1. Patient Safety through Technology

Everything in Hospital IT starts with "Do No Harm."

  • Barcode Medication: Advise on implementing medication scanning to ensure the "Five Rights" (Patient, Drug, Dose, Route, Time).
  • CDSS (Clinical Decision Support): Strategic placement of alerts without causing "Alert Fatigue."

2. High-Availability for Life-Critical Infrastructure

  • Criticality Matrix: Classification of systems by their impact on patient life.
  • Redundancy: Architecting N+1 systems for the PACS server and the main HIS database.

3. Inter-sectoral Systemic Vision

  • Pharmacy-Hospital Liaison: Ensuring the ERP reflects real-time stock and automated dispensing unit integration.
  • Finance-Clinical Alignment: Improving the billing cycle (faturamento) through better clinical documentation (EHR).

References

Limitations

  • Personas are analytical viewpoints, not ten licensed professionals or independent reviewers. Do not claim accreditation, legal compliance or clinical outcome improvements from this advice.
  • Legislative numbers and bibliography are starting references, not a verified current legal inventory. Confirm current official texts, applicability and assessment manuals with the hospital’s legal/accreditation owners before decisions. Never change clinical systems, patient data sharing or safety controls without the authorized local process.
  • NIST CSF version reference: CSF 2.0.
  • Provides strategic and operational advice, but is not a substitute for formal clinical, legal, or financial auditing.
  • Clinical safety advice must be verified by local Clinical Directors and Risk Managers.

Legal & Compliance Vault

What it is: Legal documents.

Overview

Works out the smallest useful Legal & Compliance Vault setup for the business in front of it, then builds it only when asked. The default output is a short recommendation, not a spreadsheet. Artifacts - CSV, SQL DDL, JSON Schema, Notion mapping - are produced on request, from one field list so they cannot drift apart.

Layer: Layer 7: Protect. Fits: Growth stage. Table code: n/a.

When to Use This Skill

  • legal document vault
  • compliance document register
  • licence register
  • statutory records

Also use it when the user says "legal documents", or describes the same process happening in a spreadsheet, a document or someone inboxes.

Do not use it for: payroll calculation, tax filing, or legal advice. This skill produces empty templates only - it never holds or processes real employee or customer data.

How It Works

Follow the shared execution contract. The module-specific rules below define only domain fields, decisions, calculations, and safety constraints.

Step 1 - Identify intent

Read the request and pick the intent before asking anything.

  • "set up" or "build" or "create" -> the user wants artifacts; go to Step 2.
  • "our process is ..." or "it is in a sheet" -> the user wants to move an existing process; capture it, then Step 2.
  • "is this right" or "review" or "audit" -> the user wants a check, not a build; answer from what they share.
  • "how do I ..." -> advice question; answer directly and offer the build only if it helps.

Ask only if this is the highest-value missing fact; otherwise proceed without an opener:

Q: What is the most urgent obligation?

Step 2 - Ask only what is missing

Skip anything the user already answered, in any earlier message. Ask the rest one at a time, and stop as soon as the remaining answers would not change the output.

  • Obligations - Which laws or licences apply? / How many? / Any deadlines this year?
  • Evidence - What proves compliance? / Where held? / Who signs off?
  • Ownership - Who owns each obligation? / External counsel involved? / Review cadence?
  • Current process - Is it tracked now? / Calendar or memory? / What is overdue?
  • Outcome - What do you need? / An obligation register, a document list or both?

Never invent an answer. If the user does not know, record it as unknown and carry on.

Step 3 - Hold the internal context

Hold the answers in this shape. It stays internal - it is not shown to the user unless they ask, and it never carries a value the user did not give.

module: legal-compliance-vault
intent: null            # setup | advice | review | fix | build | convert | export
scale: null             # Starter | Growth | Scale, only if the answer changes it
areas:
  "Obligations": null
  "Evidence": null
  "Ownership": null
  "Current process": null
  "Outcome": null
requested_outputs: []   # csv | sql | json | notion | xlsx - requested formats only
confirmed_facts: []     # only what the user actually said
open_questions: []      # the unanswered ones, in the order worth asking

Step 4 - Recommend the smallest workflow

If an artifact was requested, build it after resolving essential missing facts. Otherwise give a short recommendation and offer the relevant artifact.

Recommended approach: Record each obligation with a deadline, an owner and the evidence that proves it, and review the overdue list first.

Why this one: Compliance risk concentrates in the few items that are due and unowned. A register supports ownership and reminders; it does not prove legal compliance or replace counsel review.

Workflow: Obligation listed → Owner assigned → Evidence linked → Due date tracked → Reviewed or filed

Step 5 - Build only on request

Once the user asks for it, derive the fields from the confirmed context and emit the requested artifacts. For machine-readable text, keep prose outside the data; for files, provide a usable link. Report material validation failures or limitations separately.

A selected Notion output is rendered by notion-manual-import, so route the Notion step there. When the user selects Notion, hand that step to @notion-manual-import: it holds the CSV, the property mapping, the import steps and the verification checklist, and it renders the Field Reference below instead of defining a table of its own. Do not restate the mapping here and do not improvise the import steps. Manual CSV and mapping outputs need no connection. For requested workspace changes, follow the shared contract: verify actual tool access and the target before writing. A user saying "connected" is not tool evidence. Never ask for a Notion password or token.

For an Excel-compatible CSV, use UTF-8 with a byte order mark so Excel opens the text correctly. A CSV is not an .xlsx workbook; create .xlsx only when the user requests a workbook. A CSV carries no types, so after it, name the columns that need a number, date or currency format applied.

Document Title,Document Type,Compliance Framework,Owner,Department,Effective Date,Expiry Date,Renewal Required,Storage Link,Confidentiality,Status,Legal ID
Master Services Agreement,Contract,ISO 27001,Sneha Iyer,Delivery,2026-01-15,2026-01-15,TRUE,https://example.com/doc,Internal,Active,
CREATE TABLE legal_compliance_vault (
  document_title VARCHAR(255),
  document_type VARCHAR(100) NOT NULL,
  compliance_framework VARCHAR(255),
  owner VARCHAR(255),
  department VARCHAR(255),
  effective_date DATE NOT NULL,
  expiry_date DATE NOT NULL,
  renewal_required BOOLEAN NOT NULL,
  storage_link TEXT,
  confidentiality VARCHAR(100) NOT NULL,
  status VARCHAR(100) NOT NULL,
  legal_id SERIAL PRIMARY KEY,
  created_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW()
);

CREATE INDEX idx_legal_compliance_vault_status ON legal_compliance_vault (status);
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Legal & Compliance Vault",
  "type": "object",
  "additionalProperties": false,
  "properties": {
      "Document Title": { "type": "string" },
      "Document Type": { "type": "string" },
      "Compliance Framework": { "type": "string" },
      "Owner": { "type": "string" },
      "Department": { "type": "string" },
      "Effective Date": { "type": "string", "format": "date" },
      "Expiry Date": { "type": "string", "format": "date" },
      "Renewal Required": { "type": "boolean" },
      "Storage Link": { "type": "string", "format": "uri" },
      "Confidentiality": { "type": "string" },
      "Status": { "type": "string" },
      "Legal ID": { "type": "integer" }
  },
  "required": [
      "Document Type",
      "Effective Date",
      "Expiry Date",
      "Renewal Required",
      "Confidentiality",
      "Status"
  ]
}
| CSV column | Notion property | Set after import |
|---|---|---|
| Document Title | Title | Use as the database title |
| Document Type | Select (add options after import) | Convert to Select, add options: "Contract", "Policy", "Invoice", "Certificate", "Report", "ID Proof", "Other" |
| Compliance Framework | Text | Leave as Text |
| Owner | Text | Leave as Text |
| Department | Text | Leave as Text |
| Effective Date | Date | Convert to Date |
| Expiry Date | Date | Convert to Date |
| Renewal Required | Checkbox | Convert to Checkbox |
| Storage Link | URL | Convert to URL |
| Confidentiality | Select (add options after import) | Convert to Select, add options: "Internal", "Public", "Confidential", "Restricted" |
| Status | Select (add options after import) | Convert to Select, add options: "Draft", "In Review", "Approved", "Active", "Expired", "Superseded" |
| Legal ID | Text (preserve source ID) | Keep imported IDs as Text; optionally add a separate Unique ID property |

The rows above are documentation examples only. Emit empty templates unless the user explicitly requests examples. Money stays currency, dates stay date, and anything pointing at another table stays relation.

Field Reference

#FieldTypeSQLJSON SchemaNotionCSV example
1Document TitletextVARCHAR(255)stringTextMaster Services Agreement
2Document TypeselectVARCHAR(100)stringSelect (add options after import)Contract
3Compliance FrameworktextVARCHAR(255)stringTextISO 27001
4OwnertextVARCHAR(255)stringTextSneha Iyer
5DepartmenttextVARCHAR(255)stringTextDelivery
6Effective DatedateDATEstring, format: dateDate2026-01-15
7Expiry DatedateDATEstring, format: dateDate2026-01-15
8Renewal RequiredcheckboxBOOLEANbooleanCheckboxTRUE
9Storage LinkurlTEXTstring, format: uriURLhttps://example.com/doc
10ConfidentialityselectVARCHAR(100)stringSelect (add options after import)Internal
11StatusselectVARCHAR(100)stringSelect (add options after import)Active
12Legal IDidSERIAL PRIMARY KEYintegerText (preserve source ID)(blank)

Select Options

Document Type

Contract | Policy | Invoice | Certificate | Report | ID Proof | Other

Confidentiality

Internal | Public | Confidential | Restricted

Status

Draft | In Review | Approved | Active | Expired | Superseded

Relations

Link fields: none

Examples

Prompt

We are not sure what our filing deadlines are.

Context first - one question per message, nothing already answered:

Q: Which obligations? A: Annual filings and a few licences.

Q: Tracked today? A: In someone's head.

Q: Counsel involved? A: Yes, for the filings.

Recommended next step - offered, not built:

Record each obligation with a deadline, an owner and the evidence that proves it, and review the overdue list first.

Workflow: Obligation listed → Owner assigned → Evidence linked → Due date tracked → Reviewed or filed

Want the CSV, SQL, JSON Schema and Notion mapping for this?

Best Practices

  • Build when requested; recommend and offer a build for advice-only requests.
  • One question per message. A batched intake reads as a form and gets guessed at.
  • Keep display names identical across CSV and JSON; document normalized SQL identifiers.
  • Use relation for anything that points at another table, text only for free text.
  • Money fields are currency, never text. Dates are date, never free text.
  • If the user requests an example row, keep it obviously fake so nobody imports it as real data.

Limitations

  • Empty template only. It does not compute payroll, tax, leave balances or KPIs.
  • Notion relations need both databases imported before the link column resolves.
  • Select options are a starting set. Rename them to match how the business talks.
  • No automation, reminders or sync. Those need the integration layer.
  • Does not provide legal advice or file anything with any authority.
  • Legal, tax and HR review is still required before this drives real decisions.

Security & Safety Notes

  • Never fill in real names, salaries, medical or banking data. Placeholders only.
  • Label example rows as synthetic, and keep bank details masked.
  • Local reads, generation commands, and validation are part of a requested artifact build. External writes, messages, provisioning, and publication require authorization for that action and target; existing explicit authorization does not need to be repeated.
  • If sensitive data is supplied, avoid repeating unnecessary identifiers. Use only what the requested review needs; keep generated templates empty. Do not claim deletion from the conversation or service storage.
  • Privacy, legal and disciplinary cases need a qualified human reviewer before anything is acted on.

Common Pitfalls

  • Problem: a static mapping is described as a completed workspace build. Solution: deliver manual mappings without a connection; claim a live change only after the authorized tool operation succeeds.
  • Problem: asked all six questions in one message. Solution: ask one, wait, and drop any the first answer already covered.
  • Problem: built a full system when one table was asked for. Solution: build what was requested; mention the parent skill separately.
  • Problem: all four artifacts drift apart. Solution: derive all four from the field list in this file, never by hand.
  • Problem: Notion import shows every column as Text. Solution: that is expected. Apply the property mapping table once, after import.

Related Skills

  • Catalog - find the relevant module, then read its skill.
  • @people-directory - the employee master record most modules link to.
  • @notification-reminder-hub - turns due dates in this module into reminders.

Reusable Prompt

I want to set up legal documents for my company.
Ask me one short question at a time, and only about what I have not already told you.
Then recommend the smallest setup that fits, and wait for me to ask before you build it.
When I ask, output CSV, SQL DDL, JSON Schema, a Notion property mapping or an Excel workbook. Data only.

SKILL DE MERCADO — ANALISTA DE ATIVOS IMOBILIÁRIOS EM LEILÃO

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use This Skill

  • When the user mentions "mercado leilao imovel" or related topics
  • When the user mentions "roi leilao" or related topics
  • When the user mentions "liquidez imovel leilao" or related topics
  • When the user mentions "desagio leilao" or related topics
  • When the user mentions "flip imovel leilao" or related topics
  • When the user mentions "reforma leilao" or related topics

Do Not Use This Skill When

  • The task is unrelated to leiloeiro mercado
  • A simpler, more specific tool can handle the request
  • The user needs general-purpose assistance without domain expertise

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

As tabelas de liquidez, deságio, yields, probabilidades, custos e prazos são hipóteses históricas sem amostra/metodologia verificadas neste pacote, não benchmarks atuais nem garantias. Use comparáveis documentados, data de coleta, situação de ocupação/matrícula e cenários de atraso/perda. Atualize taxas e tributos nas fontes oficiais; calcule ROI líquido incluindo todas as saídas, vacância, manutenção, venda e custo de capital, e use fluxo/IRR quando os momentos diferirem. O edital e assessoria jurídica qualificada governam as condições de cada lance; veja CPC art.891. O helper de governança não é integrado automaticamente nem impõe permissões, orçamento ou limite concorrente; uma confirmation_request não é aprovação. Não enviar lances, mensagens, pagamentos ou dados financeiros sem escopo explícito.

Master Agreement Generator

One master template, one small spec per counterparty, one draft build step. The generator always labels output DRAFT, including documents generated from a completed template. A successful conversion proves artifact generation, not legal completeness, authority to contract, or readiness to send or sign. An executed agreement may permit designated opportunities to be added by notice; that authority must be established before using the Schedule A workflow.

When to Use

  • You issue a framework agreement (NDA, referral or sourcing fee, non-circumvention, master services) to many counterparties with the same terms and a few party-specific fields.
  • Deals are added over time and re-papering each one is the bottleneck.
  • Documents must be reproducible from tracked source, diffable, and free of hand edits.
  • Signature fields are placed by automation and need a stable page layout.

How It Works

Template

A single markdown template with {{PLACEHOLDER}} fields. Every party-specific value is a placeholder; everything else is fixed text. A skeleton lives at references/master-template.example.md. Replace its generic sentences with your counsel-approved clauses.

Placeholders the reference script fills:

PlaceholderSource
{{DATE}}spec.date, default today
{{CP_SHORT}}spec.short
{{CP_LEGAL}}, {{CP_JURIS}}, {{CP_ADDR}}spec fields, or a blank line when the counterparty completes them at signing
{{ROLE_CLAUSE}}, {{FEE_TITLE}}, {{FEE_CLAUSE}}selected by spec.role from the role table
{{SCHEDULE_ROWS}}spec.schedule, or one "no entries at signing" row
{{SUPPLEMENT_CLAUSE}}spec.supplement, rendered with a trailing separator or empty
{{CP_SIGBLOCK}}, {{CP_SIGNER}}, {{CP_TITLE}}, {{CP_EMAIL}}signature block fields, blanks when unknown

Spec

One JSON file per counterparty:

{
  "file": "AcmeSupplier",
  "short": "Acme",
  "role": "supplier",
  "legal": "Acme Compute Ltd",
  "juris": "England and Wales company",
  "addr": "1 Example Street, London",
  "signer": "A. Person",
  "title": "Director",
  "email": "signer@example.com",
  "schedule": [["1", "2026-09-01", "Lot A (16 nodes)", "introducer", "12 months", "standard"]],
  "supplement": "the Data Processing Addendum dated 2026-09-01"
}

Only file, short, and role are required for a draft. Missing signature fields render as blank lines for review and completion. See references/spec.example.json.

file must be a nonempty portable filename, such as AcmeSupplier or Acme Supplier, without directory components. The builder rejects either path separator, drive/UNC syntax, control characters, Windows-reserved punctuation or device names, and trailing dots or spaces. Invalid names are rejected without sanitizing or renaming them, before creating output or invoking pandoc.

Omit schedule or use [] for the “no entries at signing” placeholder. A supplied schedule must otherwise be a dense array of six-cell arrays, in this order: number, date, protected counterparty or lot, role, terms, fee. Each cell must be a valid Unicode string or finite number; empty strings are allowed for intentional blanks. Nulls, booleans, objects, nested cell arrays, missing cells and non-finite numbers are rejected with a row/cell index before any artifact write or pandoc activity. Unpaired UTF-16 surrogates are also rejected rather than replaced during UTF-8 output; valid supplementary characters, such as emoji, remain supported.

Cells are plain text, not Markdown or HTML. The builder encodes syntax characters so literal pipes, backslashes, backticks and markup stay in their original fields. Each CRLF, bare CR or LF becomes a space; text around line breaks is retained. Other whitespace and literal punctuation are preserved in the rendered cells. The source spec is not modified. An ordinary valid schedule retains its six columns; malformed input is never silently replaced with an empty schedule.

Role table

spec.role selects three strings: the standing-arrangement clause, the fee section title, and the fee clause opener.

RoleWho paysShape of the clause
buyerThe counterparty pays on transactions with introduced partiesCounterparty appoints us on a non-exclusive basis to source and introduce
supplierThe counterparty pays on transactions with introduced parties; where we buy as principal we contract on the schedule termsCounterparty offers capacity to us and to buyers we introduce
mutualWhoever closes with the other's introduction paysEach party may introduce; the closing party pays

Unknown roles are rejected at build time.

Build

Use operator-reviewed templates and specs only. Ordinary template substitutions outside Schedule A are markup-capable, not a sanitizer for untrusted documents. Pandoc can read referenced local or remote resources; this generator does not sandbox the converter's filesystem or network access. Review those references and run conversion in your own appropriately restricted environment. The focused tests use a synthetic converter and do not certify real DOCX layout or isolation.

node skills/master-agreement-generator/scripts/build-agreement.js \
  skills/master-agreement-generator/references/master-template.example.md \
  specs/AcmeSupplier.json \
  out/

The script fills placeholders, renders the schedule table, and writes out/<file> MASTER.md with a mandatory DRAFT notice. By default (or with --require-docx) it requires installed pandoc to produce a nonempty regular .docx artifact. Missing pandoc, failed conversion or missing/empty output returns exit code 1. Each pandoc probe or conversion is bounded to ten seconds. Unknown, duplicate or conflicting flags return exit code 2.

Use --markdown-only explicitly for a successful Markdown-only draft. This mode never probes or invokes pandoc, returns docxSkipped: true from the library, and provides no DOCX for an e-sign workflow. Library callers must pass { markdownOnly: true }; { pandoc: false } alone now fails the DOCX requirement. The result always reports documentStatus: 'draft'. Existing generated DOCX is removed when rebuilding its Markdown, and failed conversion leaves no partial DOCX, so an earlier artifact cannot masquerade as the current output. Keep both generated files out of version control; the template and specs are source.

There is no execution-copy mode. The example deliberately contains unresolved bracketed drafting directives; filling {{PLACEHOLDER}} tokens does not complete those legal provisions. Before preparing an execution document, obtain separate review of the completed clauses, party details, authorized signer, commercial terms and exact document version. Preserve the draft and the reviewed execution copy as distinct records. Even a successful DOCX conversion does not authorize an upload, send or signature. See the esign-field-placement approval workflow.

Both output destinations must be direct children of the resolved output directory. An existing symlink at either destination, including a dangling link, is rejected before either artifact is written, even when DOCX conversion is disabled. Ordinary regular files can be rebuilt. Use an output directory you control; these checks do not provide isolation against concurrent hostile filesystem changes. Returned artifact paths are absolute.

Signature page geometry

The template ends the body with an OpenXML page break so the signature block requests a fresh page in a compatible DOCX renderer:

```{=openxml}
<w:p><w:r><w:br w:type="page"/></w:r></w:p>
```

The signature page structure (our block, then the counterparty block, each with By, Name, Title, Email, Date) is consistent, but pagination can change with text, fonts, renderer or format. Inspect the actual reviewed document and its page geometry before placing fields; see the esign-field-placement skill.

Schedule A append workflow

Use the executed agreement's actual authority and notice requirements:

  1. Review opportunity economics and negotiation strategy in an internal negotiation/approval channel. Obtain commitment approval before sending contractual content. A shared counterparty channel is not an internal channel.
  2. Confirm that the proposed entry, role, terms, fee and effective date fall within the agreement's express Schedule A notice authority. Changes to standing terms, or variations outside that authority, require the applicable amendment procedure; a notice cannot create its own exception.
  3. Draft an approved, counterparty-specific dated notice for the recipient and notice channel authorized by the executed agreement. Include useful business content: the protected counterparty or lot, authorized role, commercial terms and applicable fee. Exclude internal margins, negotiation strategy, other parties' economics, system traces, raw errors and internal filing notices.
  4. File the exact notice for operator approval before sending; see operator-approval-loop. Preserve silence in the counterparty channel while approval or participation authority is absent. Approval is distinct from evidence that an authorized sender actually delivered the notice.
  5. Record the authorized delivery evidence, effective date and any objection under the executed agreement's actual requirements. Example periods are not defaults. Keep the executed document immutable; update the tracked schedule record and rebuild a draft consolidated view for internal review, with a reference to the executed version and approved notice. This rebuild does not replace the signed agreement or prove legal effect.

Examples

Notice text

Illustrative draft only: use these terms and dates solely when the executed agreement authorizes them and the operator approves this exact recipient notice.

Schedule A notice, 2026-09-02
Agreement: Master Agreement dated 2026-08-14 between Us and Acme
Entry 2: Lot B, 8 nodes, region EU-West
Role: introducer
Terms: 6 month term, start no later than 2026-10-01
Fee: standard
This entry takes effect today unless you object within ten business days
with dated written evidence of a prior relationship with the counterparty.

Adding the entry to the spec

"schedule": [
  ["1", "2026-08-20", "Lot A (16 nodes)", "introducer", "12 months", "standard"],
  ["2", "2026-09-02", "Lot B (8 nodes, EU-West)", "introducer", "6 months", "standard"]
]

Rebuild, diff the draft Markdown, and attach the consolidated draft to the internal record alongside the unchanged executed document and notice evidence.

Counterparty fills its own details at signing

For drafting, omit legal, juris, addr, signer, title, email from the spec to render blank lines. A separately reviewed execution workflow must decide which details may be completed by the counterparty and verify the actual fields; the generator does not create or approve an e-sign envelope.

Sponsors

Details

Marketplace
marslanalvi/SkillsStack
Source
plugins/business/legal-industry
Category
Business
Keywords
business, legal-industry

More from marslanalvi/SkillsStack

All 45