From fa21ac8fd73b1e102edd0a5567daf238e191d88a Mon Sep 17 00:00:00 2001 From: willchen96 Date: Mon, 20 Jul 2026 03:04:47 +0800 Subject: [PATCH] feat: refresh workflows and workflow editor UI --- CONTRIBUTING.md | 11 +- README.md | 6 + backend/src/lib/systemWorkflows.ts | 377 ++++++------ frontend/public/icons/app-sidebar/library.svg | 11 +- .../assistant/message/MarkdownContent.tsx | 13 +- .../assistant/message/useSmoothedReveal.ts | 7 +- .../components/workflows/NewWorkflowModal.tsx | 111 +++- .../workflows/WorkflowDetailPage.tsx | 563 +++++++++--------- .../workflows/WorkflowPromptEditor.tsx | 13 +- frontend/src/app/hooks/useAssistantChat.ts | 15 +- scripts/build-workflows.js | 203 ++++--- 11 files changed, 745 insertions(+), 585 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18bfb6f..47e61fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,9 +22,12 @@ Thanks for helping improve Mike. Please keep contributions small, focused, and e ## System Workflows -System workflows live in `mike-workflows/system/`. Put structured metadata in -the YAML frontmatter at the top of `SKILL.md`, put workflow instructions in the -body of `SKILL.md`, and use `table-config.yaml` for tabular review columns. +System workflows live in the sibling +[`Open-Legal-Products/mike-workflows`](https://github.com/Open-Legal-Products/mike-workflows) +repository under `assistant-workflows/` and `tabular-review-workflows/`. Put +structured metadata in the YAML frontmatter at the top of `SKILL.md`, set +`metadata.mike-availability` to `system`, put workflow instructions in the body +of `SKILL.md`, and use `table-columns.yaml` for tabular review columns. After changing system workflows, regenerate the app files: @@ -34,7 +37,7 @@ node scripts/build-workflows.js ## Security -Do not open a public issue for security vulnerabilities. Use [GitHub's private vulnerability reporting](https://github.com/willchen96/mike/security/advisories/new) instead. +Do not open a public issue for security vulnerabilities. Use [GitHub's private vulnerability reporting](https://github.com/Open-Legal-Products/mike/security/advisories/new) instead. We will aim to respond promptly and coordinate a disclosure timeline with you. diff --git a/README.md b/README.md index e5312b5..66bdc7b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ Website: [mikeoss.com](https://mikeoss.com) - `backend/schema.sql` - Supabase schema for fresh databases - `backend/migrations/` - dated, incremental schema migrations; on an existing database, apply the files dated after the Mike version you deployed +## System Workflows + +Mike's system assistant and tabular review workflows are maintained in the +[`Open-Legal-Products/mike-workflows`](https://github.com/Open-Legal-Products/mike-workflows) +repository. + ## Prerequisites - Node.js 20 or newer diff --git a/backend/src/lib/systemWorkflows.ts b/backend/src/lib/systemWorkflows.ts index d1d8dc1..6bd2d76 100644 --- a/backend/src/lib/systemWorkflows.ts +++ b/backend/src/lib/systemWorkflows.ts @@ -33,17 +33,17 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "user_id": null, "is_system": true, "created_at": "", - "id": "builtin-coc-dd-tabular-review", + "id": "builtin-change-of-control-tabular-review", "metadata": { "title": "Change of Control Tabular Review", "description": "This workflow performs a change of control due diligence review across the selected documents.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -53,7 +53,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Change of Control Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents for change of control provisions and extract structured diligence findings into the columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, notice periods, party names, and defined terms where available.\n- For change of control triggers, capture the exact triggering language and summarize the practical effect in plain English.\n- For consent, termination, option, and financial consequence columns, identify who holds the right or obligation, when it is triggered, and any timing or procedural requirements.\n- If a document does not contain responsive change of control language, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context for legal diligence review.\n- Do not infer a change of control restriction from general assignment, transfer, merger, or affiliate provisions unless the document text supports that connection.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.", + "skill_md": "# Change of Control Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents for change of control provisions and extract structured diligence findings into the columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.\n## Change of Control Guidance\n\n- Capture the exact triggering language and summarize its practical effect in plain English.\n- For consent, termination, option, and financial-consequence provisions, identify who holds the right or obligation, when it is triggered, and any timing or procedural requirements.\n- Do not infer a change-of-control restriction from general assignment, transfer, merger, or affiliate provisions unless the document text supports that connection.", "columns_config": [ { "index": 0, @@ -76,26 +76,31 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ { "index": 3, "name": "Change of Control Clause", + "format": "text", "prompt": "Identify and summarize the change of control clause(s) in this document. Quote the exact triggering language and specify what constitutes a 'change of control'." }, { "index": 4, "name": "Consent Required", + "format": "text", "prompt": "Does a change of control require prior consent from any party? Identify who must consent, the notice period, and any conditions." }, { "index": 5, "name": "Termination Rights", + "format": "text", "prompt": "What termination rights arise upon a change of control? Who can terminate, and what are the notice requirements?" }, { "index": 6, "name": "Put/Call Options", + "format": "text", "prompt": "Are there any put or call options triggered by a change of control? Summarize the terms, pricing, and exercise period." }, { "index": 7, "name": "Financial Implications", + "format": "text", "prompt": "What are the financial implications of a change of control? Include any fees, payments, accelerated obligations, or pricing adjustments." } ] @@ -107,14 +112,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-commercial-agreement-tabular-review", "metadata": { "title": "Commercial Agreement Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -124,7 +129,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Commercial Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# Commercial Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -141,7 +146,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ { "index": 2, "name": "Amends Earlier Agreement", - "format": "yes_no", + "format": "text", "prompt": "Does this agreement amend, restate, supplement, or replace an earlier agreement? If yes, identify the earlier agreement by name and date." }, { @@ -183,7 +188,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ { "index": 9, "name": "Estimated Contract Value", - "format": "monetary_amount", + "format": "text", "prompt": "What is the total estimated or stated contract value? If no single figure is given, calculate or estimate based on stated rates and term. State the currency and any assumptions made." }, { @@ -247,10 +252,10 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -260,7 +265,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Commercial Lease Review\n\n## Instructions\n\nReview the uploaded commercial lease and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — reinstatement obligation is uncapped\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Break Rights | High — Clause [x] imposes vacant possession as a break condition with no cure period. The lessee-specific checklist point indicates the break is fragile and may be lost on a technicality. | For the lessee, remove vacant possession as a break condition or add a cure period and express the condition narrowly. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the premises. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, premises description, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Lessor or Lessee).\n\n| Issue | General | Lessor | Lessee |\n| --- | --- | --- | --- |\n| Parties and Premises | Identify landlord, tenant, guarantor, property, premises, title references, and included or excluded areas. Flag incorrect entities, missing plans, or premises description inconsistent with title. | | |\n| Term | State commencement, expiry, rent commencement, and any conditions precedent. | Flag renewal rights or holding-over provisions that limit the landlord's ability to recover the premises. | Flag uncertain commencement mechanics, no renewal clarity, or landlord-only discretion over start conditions. |\n| Rent and Payments | Confirm rent quantum, payment dates, and deposit mechanics. | Flag unclear payment mechanics, weak late-payment provisions, or rent-free periods exceeding what was agreed. | Flag unclear payment obligations, high default interest, or missing rent-free mechanics. |\n| Rent Review | Identify review dates, mechanism, assumptions, disregards, and dispute process. | Flag review mechanics too favorable to the tenant, downward review provisions, or no upward adjustment. | Flag upward-only review, no cap, aggressive assumptions, or tenant-unfriendly dispute process. |\n| Service Charge and Operating Costs | Identify tenant contribution scope, cap mechanics, audit rights, and reconciliation process. | Flag cost exclusions too broad, caps too low, or audit rights creating undue operational burden. | Flag broad pass-throughs, no cap, capital expenditure exposure, or weak audit rights. |\n| Use | State permitted use, prohibited uses, trading obligations, and change-of-use restrictions. | Flag permitted use too broad or absence of continuous trading obligation. | Flag narrow use restriction, continuous trading obligations, or restrictions inconsistent with operations. |\n| Repairs and Maintenance | Identify landlord and tenant repair obligations, condition standard, and schedule of condition. | Flag limited tenant repairing obligations, repair gaps, or yielding-up conditions below acceptable standard. | Flag full repairing obligation extending to pre-existing defects or structural issues outside tenant control. |\n| Alterations and Fit-Out | Identify consent requirements and reinstatement obligations. | Flag broad alteration rights without landlord consent or no reinstatement obligation. | Flag absolute consent rights, broad reinstatement obligations, or unclear fit-out approval timing. |\n| Assignment, Underletting, and Sharing Occupation | Identify transfer restrictions, consent tests, and group sharing rights. | Flag broad permitted transfer rights allowing assignment to unsuitable tenants without approval. | Flag absolute assignment bans, excessive consent conditions, or no group sharing rights. |\n| Insurance and Damage | Identify who insures, insured risks, rent suspension, and termination rights on damage. | Flag tenant insurance obligations too narrow or absence of rent suspension protection. | Flag no rent suspension on damage, uninsured risk exposure, or no termination right after prolonged damage. |\n| Break Rights | Identify break dates, notice periods, and conditions. | Flag broadly exercisable break conditions allowing tenant exit without adequate penalty. | Flag fragile break conditions, strict vacant possession tests, or excessive preconditions. |\n| Default and Remedies | Identify default events, cure periods, and enforcement rights. | Flag long cure periods, high default thresholds, or limited remedies that delay enforcement. | Flag short cure periods, broad default triggers, or landlord self-help without adequate notice. |\n| Compliance Obligations | Identify which party bears responsibility for regulatory compliance. | Flag compliance gaps exposing the landlord to regulatory liability. | Flag tenant responsibility for landlord works, historic contamination, or compliance beyond the demised premises. |\n| Security Package | Identify security type, quantum, and release conditions. | Flag security inadequate for the tenant's covenant strength or release mechanics too easy to trigger. | Flag excessive security requirements, no step-down on release, or unclear deposit return mechanics. |\n| Rights Reserved and Easements | Identify reserved landlord rights, access arrangements, and tenant rights over common parts. | Flag insufficient reserved rights limiting the landlord's ability to manage the building. | Flag broad landlord entry or disruption rights, or missing rights needed for the tenant's permitted use. |\n| End of Term | Identify yielding-up condition, reinstatement obligations, and dilapidations process. | Flag inadequate reinstatement obligations, unclear yielding-up conditions, or weak dilapidations recovery. | Flag overly broad reinstatement obligations or handback conditions requiring a better standard than at commencement. |\n| Governing Law and Dispute Resolution | State governing law, court forum, expert determination process, and mandatory dispute procedures. Flag ambiguous forum, missing expert determination terms, or inadequate dispute mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", + "skill_md": "# Commercial Lease Review\n\n## Instructions\n\nReview the uploaded commercial lease and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — reinstatement obligation is uncapped\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Break Rights | High — Clause [x] imposes vacant possession as a break condition with no cure period. The lessee-specific checklist point indicates the break is fragile and may be lost on a technicality. | For the lessee, remove vacant possession as a break condition or add a cure period and express the condition narrowly. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the premises. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, premises description, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Lessor or Lessee).\n\n| Issue | General | Lessor | Lessee |\n| --- | --- | --- | --- |\n| Parties and Premises | Identify landlord, tenant, guarantor, property, premises, title references, and included or excluded areas. Flag incorrect entities, missing plans, or premises description inconsistent with title. | | |\n| Term | State commencement, expiry, rent commencement, and any conditions precedent. | Flag renewal rights or holding-over provisions that limit the landlord's ability to recover the premises. | Flag uncertain commencement mechanics, no renewal clarity, or landlord-only discretion over start conditions. |\n| Rent and Payments | Confirm rent quantum, payment dates, and deposit mechanics. | Flag unclear payment mechanics, weak late-payment provisions, or rent-free periods exceeding what was agreed. | Flag unclear payment obligations, high default interest, or missing rent-free mechanics. |\n| Rent Review | Identify review dates, mechanism, assumptions, disregards, and dispute process. | Flag review mechanics too favorable to the tenant, downward review provisions, or no upward adjustment. | Flag upward-only review, no cap, aggressive assumptions, or tenant-unfriendly dispute process. |\n| Service Charge and Operating Costs | Identify tenant contribution scope, cap mechanics, audit rights, and reconciliation process. | Flag cost exclusions too broad, caps too low, or audit rights creating undue operational burden. | Flag broad pass-throughs, no cap, capital expenditure exposure, or weak audit rights. |\n| Use | State permitted use, prohibited uses, trading obligations, and change-of-use restrictions. | Flag permitted use too broad or absence of continuous trading obligation. | Flag narrow use restriction, continuous trading obligations, or restrictions inconsistent with operations. |\n| Repairs and Maintenance | Identify landlord and tenant repair obligations, condition standard, and schedule of condition. | Flag limited tenant repairing obligations, repair gaps, or yielding-up conditions below acceptable standard. | Flag full repairing obligation extending to pre-existing defects or structural issues outside tenant control. |\n| Alterations and Fit-Out | Identify consent requirements and reinstatement obligations. | Flag broad alteration rights without landlord consent or no reinstatement obligation. | Flag absolute consent rights, broad reinstatement obligations, or unclear fit-out approval timing. |\n| Assignment, Underletting, and Sharing Occupation | Identify transfer restrictions, consent tests, and group sharing rights. | Flag broad permitted transfer rights allowing assignment to unsuitable tenants without approval. | Flag absolute assignment bans, excessive consent conditions, or no group sharing rights. |\n| Insurance and Damage | Identify who insures, insured risks, rent suspension, and termination rights on damage. | Flag tenant insurance obligations too narrow or absence of rent suspension protection. | Flag no rent suspension on damage, uninsured risk exposure, or no termination right after prolonged damage. |\n| Break Rights | Identify break dates, notice periods, and conditions. | Flag broadly exercisable break conditions allowing tenant exit without adequate penalty. | Flag fragile break conditions, strict vacant possession tests, or excessive preconditions. |\n| Default and Remedies | Identify default events, cure periods, and enforcement rights. | Flag long cure periods, high default thresholds, or limited remedies that delay enforcement. | Flag short cure periods, broad default triggers, or landlord self-help without adequate notice. |\n| Compliance Obligations | Identify which party bears responsibility for regulatory compliance. | Flag compliance gaps exposing the landlord to regulatory liability. | Flag tenant responsibility for landlord works, historic contamination, or compliance beyond the demised premises. |\n| Security Package | Identify security type, quantum, and release conditions. | Flag security inadequate for the tenant's covenant strength or release mechanics too easy to trigger. | Flag excessive security requirements, no step-down on release, or unclear deposit return mechanics. |\n| Rights Reserved and Easements | Identify reserved landlord rights, access arrangements, and tenant rights over common parts. | Flag insufficient reserved rights limiting the landlord's ability to manage the building. | Flag broad landlord entry or disruption rights, or missing rights needed for the tenant's permitted use. |\n| End of Term | Identify yielding-up condition, reinstatement obligations, and dilapidations process. | Flag inadequate reinstatement obligations, unclear yielding-up conditions, or weak dilapidations recovery. | Flag overly broad reinstatement obligations or handback conditions requiring a better standard than at commencement. |\n| Governing Law and Dispute Resolution | State governing law, court forum, expert determination process, and mandatory dispute procedures. Flag ambiguous forum, missing expert determination terms, or inadequate dispute mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", "columns_config": null }, { @@ -270,14 +275,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-commercial-lease-tabular-review", "metadata": { "title": "Commercial Lease Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -287,7 +292,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Commercial Lease Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# Commercial Lease Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -382,7 +387,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ { "index": 15, "name": "Security of Tenure", - "format": "yes_no", + "format": "text", "prompt": "Does the tenant have statutory security of tenure (e.g. under the Landlord and Tenant Act 1954 in England and Wales, or equivalent legislation in another jurisdiction)? Answer Yes if the lease is contracted in or benefits from security of tenure. Answer No if the lease has been contracted out or if security of tenure does not apply. State the basis for your answer." }, { @@ -394,7 +399,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ { "index": 17, "name": "Rent Deposit", - "format": "monetary_amount", + "format": "text", "prompt": "Is a rent deposit required? If so, state the amount, the period for which it is held, the conditions under which the landlord may draw on it, and the circumstances in which it is returned to the tenant." }, { @@ -422,10 +427,10 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -445,14 +450,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-corporate-approvals-review", "metadata": { "title": "Corporate Approvals Review", - "description": "Review the uploaded transaction document, resolution, authority package, or corporate action to determine whether the relevant company approvals appear complete, internally cons...", + "description": "Review transaction documents, resolutions, authority materials, and corporate records to assess whether the relevant company approvals appear complete and internally consistent.", "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -469,44 +474,17 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "user_id": null, "is_system": true, "created_at": "", - "id": "builtin-cp-checklist", + "id": "builtin-credit-agreement-review", "metadata": { - "title": "Draft CP Checklist", - "description": "Review the uploaded credit agreement or financing document and generate a comprehensive Conditions Precedent (CP) checklist.", + "title": "Credit Agreement Review", + "description": "Review the uploaded credit agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client.", "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" - } - ], - "language": "English", - "version": "1.0.0", - "practice": "General Transactions", - "jurisdictions": [ - "General" - ] - }, - "skill_md": "# Draft Conditions Precedent Checklist\n\nReview the uploaded credit agreement or financing document and generate a comprehensive Conditions Precedent (CP) checklist.\n\nYou MUST use the generate_docx tool to produce the checklist as a downloadable Word document. You MUST pass landscape: true to the generate_docx tool — the document must be in landscape orientation. Do not display the checklist inline — generate the .docx file and provide the download link.\n\nStructure the document as follows:\n- For each category of conditions (e.g. Corporate, Financial, Legal, Security), add a section with a heading\n- Under each category heading, include a table with exactly these four columns in this order:\n 1. Index — sequential number within the category (1, 2, 3…)\n 2. Clause Number — the clause or schedule reference from the agreement\n 3. Clause — a concise description of the condition precedent\n 4. Status — leave blank (empty string) for the user to fill in\n\nUse the table field in the section object (not content) for each category's rows.\n\n## Result Table Format\n\nThe document contains one section per category, each with a table in this format:\n\n### Corporate\n\n| Index | Clause Number | Clause | Status |\n| --- | --- | --- | --- |\n| 1 | Cl. 4.1(a)(i) | Certificate of incorporation and constitutional documents of the borrower |   |\n| 2 | Cl. 4.1(a)(ii) | Board resolution authorising execution of the finance documents and approving the terms of the transaction |   |\n| 3 | Cl. 4.1(a)(iii) | Specimen signatures of all authorised signatories |   |\n\n### Legal\n\n| Index | Clause Number | Clause | Status |\n| --- | --- | --- | --- |\n| 1 | Cl. 4.1(c)(i) | Legal opinion from counsel to the borrower in form and substance satisfactory to the agent |   |\n| 2 | Cl. 4.1(c)(ii) | Legal opinion from counsel to the arrangers as to the laws of the relevant jurisdiction |   |\n\nBefore finalizing, double-check that every table is formatted correctly: each table must have exactly the four columns above in the same order, headers must match exactly (Index, Clause Number, Clause, Status), every row must have the same number of cells as the headers, the Index column must be sequential starting from 1 within each category, and no cells should contain stray markdown, newlines, or placeholder text (use an empty string for Status).", - "columns_config": null - }, - { - "user_id": null, - "is_system": true, - "created_at": "", - "id": "builtin-credit-agreement-tabular-review", - "metadata": { - "title": "Credit Agreement Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", - "type": "tabular", - "contributors": [ - { - "name": "Mike", - "organisation": "Open Legal Products", - "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -516,7 +494,34 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Credit Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# Credit Agreement Review\n\n## Instructions\n\nReview the uploaded credit agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — covenant headroom is tight\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause or schedule references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Financial Covenants | High — Clause [x] sets the leverage covenant at [x]x with quarterly testing and no equity cure right. The borrower-specific checklist point indicates limited headroom and no remedy for a technical breach. | For the borrower, widen the covenant threshold, add an equity cure right, and reduce testing frequency to semi-annual. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the facility amount. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, amounts, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Borrower or Lender).\n\n| Issue | General | Borrower | Lender |\n| --- | --- | --- | --- |\n| Parties | Identify all lenders, borrowers, guarantors, agents, and other finance parties with full legal names, roles, and jurisdictions. Flag missing or incorrect entities, unclear agent roles, missing authority confirmations, or transfer mechanics that could result in unknown lenders. | | |\n| Guarantors | Identify guarantors, guarantee scope, limits, and coverage requirements. | Flag uncapped guarantees, missing limits, or upstream guarantee concerns exposing the borrower group. | Flag weak guarantor coverage, missing entities, or guarantees not covering the full facility. |\n| Other Parties | Identify facility agent, security agent, arrangers, issuing banks, and other material parties. | Flag unclear agent roles or mechanics creating additional obligations on the borrower. | Flag inconsistent secured party mechanics or missing parties affecting security validity. |\n| Date of Agreement | State signing date, effective date, and conditions to effectiveness. Flag inconsistent or unclear dates or effectiveness conditions. | | |\n| Facilities | List each facility, type, tranche, availability, and key structural features. | Flag excessive lender discretion, unclear facility purpose, or mismatched terms restricting drawdown. | Flag unclear facility structure or purpose creating enforcement ambiguity. |\n| Amount | State total commitments, currencies, tranche amounts, and accordion or incremental facilities. | Flag unclear currency exposure, uncapped accordion provisions without borrower consent, or inconsistent commitment figures. | Flag uncapped increase mechanics or dilutive accordion provisions not agreed at signing. |\n| Purpose | Summarize permitted use of proceeds and restrictions. | Flag vague purpose wording restricting flexibility or creating sanctions risk. | Flag broad purpose language permitting restricted payment leakage or unapproved use of proceeds. |\n| Interest | Identify reference rate, margin, floors, fallback rates, interest periods, and default interest. | Flag high margins, aggressive floors, benchmark fallback gaps, or high default interest. | Flag unclear fallback rate mechanics or interest calculation ambiguities. |\n| Commitment Fee | State commitment, utilisation, ticking, arrangement, agency, and other fees. | Flag hidden fees, fees payable after cancellation, or unclear calculation basis. | Flag missing fee provisions or fee timing delaying recovery. |\n| Repayment Schedule | Summarize amortisation, scheduled repayments, bullet payments, and cash sweep. | Flag aggressive amortisation, unclear prepayment application, or cash sweep uncertainty. | Flag bullet repayments without adequate covenant or security protection. |\n| Maturity | State final maturity date and any extension options. | Flag short maturity, lender-only extension discretion, or mismatch with the business plan. | Flag unclear extension conditions or borrower-controlled extension mechanics. |\n| Security | Identify security package, assets, entities, perfection steps, and post-closing obligations. | Flag all-asset security beyond deal scope, onerous post-closing steps, or missing release mechanics on disposal. | Flag gaps in the security package, missing perfection steps, or inadequate post-closing obligations. |\n| Guarantees | Summarize guarantee obligations, guarantors, limitations, and release triggers. | Flag broad all-monies language, unlimited guarantees, or no release mechanics after repayment or disposal. | Flag guarantee gaps, weak limitations, or no coverage test requirements. |\n| Financial Covenants | Identify covenant metrics, thresholds, testing frequency, cure rights, and reporting. | Flag tight headroom, frequent testing, no equity cure, or ambiguous EBITDA adjustments. | Flag loose covenant thresholds or wide EBITDA adjustments obscuring true financial performance. |\n| Events of Default | Summarize default triggers, grace periods, materiality thresholds, cross-default, and MAE. | Flag low materiality thresholds, no cure periods, broad cross-default, or subjective MAE defaults. | Flag weak default triggers, long cure periods, or materiality thresholds delaying enforcement. |\n| Assignment | Summarize lender transfer rights, borrower consent mechanics, and disqualified institutions. | Flag free transfers to competitors, distressed investors, or lenders on a borrower blacklist. | Flag consent mechanics giving the borrower excessive veto over lender transfers. |\n| Change of Control | Identify triggers and resulting prepayment, cancellation, or default consequences. | Flag broad triggers, no cure period, or definitions catching ordinary-course ownership changes. | Flag narrow change of control definitions missing material ownership shifts. |\n| Prepayment Fee | Identify make-whole, soft-call, premium periods, and exceptions. | Flag excessive fees, long premium periods, or unclear exceptions for mandatory prepayments. | Flag exceptions allowing free prepayment during premium periods. |\n| Governing Law and Dispute Resolution | State governing law, jurisdiction, forum, and service of process. Flag unclear or ambiguous governing law, jurisdiction, or service mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", + "columns_config": null + }, + { + "user_id": null, + "is_system": true, + "created_at": "", + "id": "builtin-credit-agreement-tabular-review", + "metadata": { + "title": "Credit Agreement Tabular Review", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", + "type": "tabular", + "contributors": [ + { + "name": "Open Legal Products", + "organisation": null, + "role": null, + "linkedin": null + } + ], + "language": "English", + "version": "1.0.0", + "practice": "Finance", + "jurisdictions": [ + "General" + ] + }, + "skill_md": "# Credit Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -650,44 +655,17 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "user_id": null, "is_system": true, "created_at": "", - "id": "builtin-credit-summary", + "id": "builtin-draft-cp-checklist", "metadata": { - "title": "Credit Agreement Review", - "description": "Review the uploaded credit agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client.", + "title": "Draft CP Checklist", + "description": "Review the uploaded credit agreement or financing document and generate a comprehensive Conditions Precedent (CP) checklist.", "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" - } - ], - "language": "English", - "version": "1.0.0", - "practice": "Finance", - "jurisdictions": [ - "General" - ] - }, - "skill_md": "# Credit Agreement Review\n\n## Instructions\n\nReview the uploaded credit agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — covenant headroom is tight\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause or schedule references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Financial Covenants | High — Clause [x] sets the leverage covenant at [x]x with quarterly testing and no equity cure right. The borrower-specific checklist point indicates limited headroom and no remedy for a technical breach. | For the borrower, widen the covenant threshold, add an equity cure right, and reduce testing frequency to semi-annual. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the facility amount. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, amounts, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Borrower or Lender).\n\n| Issue | General | Borrower | Lender |\n| --- | --- | --- | --- |\n| Parties | Identify all lenders, borrowers, guarantors, agents, and other finance parties with full legal names, roles, and jurisdictions. Flag missing or incorrect entities, unclear agent roles, missing authority confirmations, or transfer mechanics that could result in unknown lenders. | | |\n| Guarantors | Identify guarantors, guarantee scope, limits, and coverage requirements. | Flag uncapped guarantees, missing limits, or upstream guarantee concerns exposing the borrower group. | Flag weak guarantor coverage, missing entities, or guarantees not covering the full facility. |\n| Other Parties | Identify facility agent, security agent, arrangers, issuing banks, and other material parties. | Flag unclear agent roles or mechanics creating additional obligations on the borrower. | Flag inconsistent secured party mechanics or missing parties affecting security validity. |\n| Date of Agreement | State signing date, effective date, and conditions to effectiveness. Flag inconsistent or unclear dates or effectiveness conditions. | | |\n| Facilities | List each facility, type, tranche, availability, and key structural features. | Flag excessive lender discretion, unclear facility purpose, or mismatched terms restricting drawdown. | Flag unclear facility structure or purpose creating enforcement ambiguity. |\n| Amount | State total commitments, currencies, tranche amounts, and accordion or incremental facilities. | Flag unclear currency exposure, uncapped accordion provisions without borrower consent, or inconsistent commitment figures. | Flag uncapped increase mechanics or dilutive accordion provisions not agreed at signing. |\n| Purpose | Summarize permitted use of proceeds and restrictions. | Flag vague purpose wording restricting flexibility or creating sanctions risk. | Flag broad purpose language permitting restricted payment leakage or unapproved use of proceeds. |\n| Interest | Identify reference rate, margin, floors, fallback rates, interest periods, and default interest. | Flag high margins, aggressive floors, benchmark fallback gaps, or high default interest. | Flag unclear fallback rate mechanics or interest calculation ambiguities. |\n| Commitment Fee | State commitment, utilisation, ticking, arrangement, agency, and other fees. | Flag hidden fees, fees payable after cancellation, or unclear calculation basis. | Flag missing fee provisions or fee timing delaying recovery. |\n| Repayment Schedule | Summarize amortisation, scheduled repayments, bullet payments, and cash sweep. | Flag aggressive amortisation, unclear prepayment application, or cash sweep uncertainty. | Flag bullet repayments without adequate covenant or security protection. |\n| Maturity | State final maturity date and any extension options. | Flag short maturity, lender-only extension discretion, or mismatch with the business plan. | Flag unclear extension conditions or borrower-controlled extension mechanics. |\n| Security | Identify security package, assets, entities, perfection steps, and post-closing obligations. | Flag all-asset security beyond deal scope, onerous post-closing steps, or missing release mechanics on disposal. | Flag gaps in the security package, missing perfection steps, or inadequate post-closing obligations. |\n| Guarantees | Summarize guarantee obligations, guarantors, limitations, and release triggers. | Flag broad all-monies language, unlimited guarantees, or no release mechanics after repayment or disposal. | Flag guarantee gaps, weak limitations, or no coverage test requirements. |\n| Financial Covenants | Identify covenant metrics, thresholds, testing frequency, cure rights, and reporting. | Flag tight headroom, frequent testing, no equity cure, or ambiguous EBITDA adjustments. | Flag loose covenant thresholds or wide EBITDA adjustments obscuring true financial performance. |\n| Events of Default | Summarize default triggers, grace periods, materiality thresholds, cross-default, and MAE. | Flag low materiality thresholds, no cure periods, broad cross-default, or subjective MAE defaults. | Flag weak default triggers, long cure periods, or materiality thresholds delaying enforcement. |\n| Assignment | Summarize lender transfer rights, borrower consent mechanics, and disqualified institutions. | Flag free transfers to competitors, distressed investors, or lenders on a borrower blacklist. | Flag consent mechanics giving the borrower excessive veto over lender transfers. |\n| Change of Control | Identify triggers and resulting prepayment, cancellation, or default consequences. | Flag broad triggers, no cure period, or definitions catching ordinary-course ownership changes. | Flag narrow change of control definitions missing material ownership shifts. |\n| Prepayment Fee | Identify make-whole, soft-call, premium periods, and exceptions. | Flag excessive fees, long premium periods, or unclear exceptions for mandatory prepayments. | Flag exceptions allowing free prepayment during premium periods. |\n| Governing Law and Dispute Resolution | State governing law, jurisdiction, forum, and service of process. Flag unclear or ambiguous governing law, jurisdiction, or service mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", - "columns_config": null - }, - { - "user_id": null, - "is_system": true, - "created_at": "", - "id": "builtin-draft-from-template", - "metadata": { - "title": "Draft from Template", - "description": "Use an uploaded template to draft a new document tailored to the user instructions and source materials.", - "type": "assistant", - "contributors": [ - { - "name": "Mike", - "organisation": "Open Legal Products", - "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -697,7 +675,34 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Draft from Template\n\n## Instructions\n\nUse the uploaded template as the drafting structure for a new document. Treat the template as the primary source for document style, section order, clause structure, defined-term conventions, placeholders, and formatting cues.\n\nBefore drafting, identify whether the user has provided enough instructions and source information to complete the draft. If key information is missing, ask concise follow-up questions instead of inventing facts.\n\nWhen drafting:\n\n- Preserve the template structure unless the user asks for changes.\n- Replace placeholders, bracketed fields, blanks, and example text with the user-provided facts where available.\n- Keep definitions, cross-references, numbering, party names, dates, schedules, and exhibits internally consistent.\n- Do not remove protective clauses, boilerplate, signatures, schedules, or annexes unless the user asks you to do so.\n- If the user provides supporting documents, use them only for facts and context that are relevant to completing the template.\n- Flag any assumptions, missing inputs, unresolved placeholders, or provisions that require legal or commercial confirmation.\n\nIf the user asks for a downloadable draft, use the document generation tools available to produce the drafted document. Otherwise, provide the drafted text or the most relevant sections inline, matching the template as closely as possible.\n\nDo not invent parties, dates, amounts, governing law, notice details, commercial terms, or factual background. If information is unavailable, leave a clear placeholder and list it in an **Open Points** section.", + "skill_md": "# Draft Conditions Precedent Checklist\n\nReview the uploaded credit agreement or financing document and generate a comprehensive Conditions Precedent (CP) checklist.\n\nProduce the checklist as an exportable Word (`.docx`) document in landscape\norientation. Return the completed document as a file rather than displaying the\nchecklist inline.\n\nStructure the document as follows:\n- For each category of conditions (e.g. Corporate, Financial, Legal, Security), add a section with a heading\n- Under each category heading, include a table with exactly these four columns in this order:\n 1. Index — sequential number within the category (1, 2, 3…)\n 2. Clause Number — the clause or schedule reference from the agreement\n 3. Clause — a concise description of the condition precedent\n 4. Status — leave blank (empty string) for the user to fill in\n\nPlace each category's rows in a table under the relevant category heading.\n\n## Result Table Format\n\nThe document contains one section per category, each with a table in this format:\n\n### Corporate\n\n| Index | Clause Number | Clause | Status |\n| --- | --- | --- | --- |\n| 1 | Cl. 4.1(a)(i) | Certificate of incorporation and constitutional documents of the borrower | |\n| 2 | Cl. 4.1(a)(ii) | Board resolution authorising execution of the finance documents and approving the terms of the transaction | |\n| 3 | Cl. 4.1(a)(iii) | Specimen signatures of all authorised signatories | |\n\n### Legal\n\n| Index | Clause Number | Clause | Status |\n| --- | --- | --- | --- |\n| 1 | Cl. 4.1(c)(i) | Legal opinion from counsel to the borrower in form and substance satisfactory to the agent | |\n| 2 | Cl. 4.1(c)(ii) | Legal opinion from counsel to the arrangers as to the laws of the relevant jurisdiction | |\n\nBefore finalizing, double-check that every table is formatted correctly: each table must have exactly the four columns above in the same order, headers must match exactly (Index, Clause Number, Clause, Status), every row must have the same number of cells as the headers, the Index column must be sequential starting from 1 within each category, and no cells should contain stray markdown, newlines, or placeholder text (use an empty string for Status).", + "columns_config": null + }, + { + "user_id": null, + "is_system": true, + "created_at": "", + "id": "builtin-draft-from-template", + "metadata": { + "title": "Draft from Template", + "description": "Edit a copy of an uploaded template using the user's instructions and source materials while preserving the original file.", + "type": "assistant", + "contributors": [ + { + "name": "Open Legal Products", + "organisation": null, + "role": null, + "linkedin": null + } + ], + "language": "English", + "version": "1.0.0", + "practice": "General Transactions", + "jurisdictions": [ + "General" + ] + }, + "skill_md": "# Draft from Template\n\n## Instructions\n\nIf the user has not provided a template file, ask them to upload one.\n\nUse an available file-copy tool call to create a copy of the uploaded template,\nthen edit that copy directly. Do not recreate the file from its extracted text,\nand never modify the original template. Preserve the copied file's format,\nlayout, styles, numbering, section order, clause structure, and other content\nunless the user asks for a change.\n\nReplace placeholders and template text using the user's instructions and any\nsupporting materials. Keep definitions, cross-references, names, dates,\nschedules, and exhibits internally consistent. Do not invent missing facts; ask\nfor essential information or leave a clear placeholder where appropriate.\n\nReturn the completed copy in the same file format as the uploaded template.", "columns_config": null }, { @@ -711,10 +716,10 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -724,24 +729,24 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Draft Issues List\n\n## Instructions\n\nReview the uploaded agreement and draft a comprehensive issues list from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before drafting the issues list.\n\nAn issues list identifies open, unresolved, or contentious points in the current draft that require negotiation or resolution before signing. Focus on points that are material to the represented party's commercial and legal position.\n\nOnce the represented party is clear, use the generate_docx tool to produce the issues list as a downloadable Word document. Do not display the issues list inline — generate the .docx file and provide the download link.\n\nThe Word document must contain exactly one result table. List each open issue in order from highest to lowest priority and add a final row called **Overall Negotiation Position**. The result table must have exactly these columns:\n\n- Issue\n- Current Position\n- Proposed Change\n\nUse these priority ratings at the start of the **Current Position** column: Critical means a blocking issue that must be resolved before signing; High means a material point requiring negotiation; Medium means a negotiation concern but manageable; Low means a minor point for consideration only. Include relevant clause references in the **Current Position** column. The **Proposed Change** column must state the specific amendment or position the represented party should seek, drafted from that party's perspective. Keep the response concise and focused on actionable negotiation points.\n\n## Result Table Format\n\nThe Word document must use this result table structure. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Current Position | Proposed Change |\n| --- | --- | --- |\n| Liability Cap | High — Clause [x] contains no monetary cap on the represented party's total liability under the agreement. | Add a liability cap equal to [amount] or a multiple of fees paid, with carve-outs limited to fraud and wilful misconduct. |\n| Governing Law | Medium — Clause [x] specifies [jurisdiction] law, which is inconvenient for the represented party's operations and legal advisers. | Change governing law to [preferred jurisdiction] and amend the dispute resolution clause accordingly. |\n\nUse the table field in the document section object, not prose content, for the issues list rows.\n\nBefore finalizing, double-check that the table is formatted correctly: it must have exactly the three columns above in the same order, headers must match exactly (Issue, Current Position, Proposed Change), every row must have the same number of cells as the headers, issues must be ordered from highest to lowest priority, and no cells should contain stray markdown, newlines, or placeholder text unless the source document requires a placeholder.", + "skill_md": "# Draft Issues List\n\n## Instructions\n\nReview the uploaded agreement and draft a comprehensive issues list from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before drafting the issues list.\n\nAn issues list identifies open, unresolved, or contentious points in the current draft that require negotiation or resolution before signing. Focus on points that are material to the represented party's commercial and legal position.\n\nOnce the represented party is clear, produce the issues list as an exportable\nWord (`.docx`) document in landscape orientation. Return the completed document\nas a file rather than displaying the issues list inline.\n\nThe Word document must contain exactly one result table. List each open issue in order from highest to lowest priority and add a final row called **Overall Negotiation Position**. The result table must have exactly these columns:\n\n- Issue\n- Current Position\n- Proposed Change\n\nUse these priority ratings at the start of the **Current Position** column: Critical means a blocking issue that must be resolved before signing; High means a material point requiring negotiation; Medium means a negotiation concern but manageable; Low means a minor point for consideration only. Include relevant clause references in the **Current Position** column. The **Proposed Change** column must state the specific amendment or position the represented party should seek, drafted from that party's perspective. Keep the response concise and focused on actionable negotiation points.\n\n## Result Table Format\n\nThe Word document must use this result table structure. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Current Position | Proposed Change |\n| --- | --- | --- |\n| Liability Cap | High — Clause [x] contains no monetary cap on the represented party's total liability under the agreement. | Add a liability cap equal to [amount] or a multiple of fees paid, with carve-outs limited to fraud and wilful misconduct. |\n| Governing Law | Medium — Clause [x] specifies [jurisdiction] law, which is inconvenient for the represented party's operations and legal advisers. | Change governing law to [preferred jurisdiction] and amend the dispute resolution clause accordingly. |\n\nPlace the issues list rows in the result table rather than presenting them as\nprose.\n\nBefore finalizing, double-check that the table is formatted correctly: it must have exactly the three columns above in the same order, headers must match exactly (Issue, Current Position, Proposed Change), every row must have the same number of cells as the headers, issues must be ordered from highest to lowest priority, and no cells should contain stray markdown, newlines, or placeholder text unless the source document requires a placeholder.", "columns_config": null }, { "user_id": null, "is_system": true, "created_at": "", - "id": "builtin-ediscovery-tabular-review", + "id": "builtin-e-discovery-tabular-review", "metadata": { "title": "E-Discovery Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -751,7 +756,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# E-Discovery Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# E-Discovery Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -792,7 +797,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ { "index": 6, "name": "Privileged?", - "format": "yes_no", + "format": "text", "prompt": "Does this document appear to be legally privileged? Answer Yes if it appears to be a communication between a lawyer and client made for the dominant purpose of obtaining or giving legal advice, or created for the dominant purpose of litigation. Answer No otherwise. If uncertain, note the basis for uncertainty." } ] @@ -808,10 +813,10 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -821,7 +826,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Employment Agreement Review\n\n## Instructions\n\nReview the uploaded employment agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - restrictive covenant scope is excessive\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Restrictive Covenants | High - Clause [x] imposes a long non-compete with broad geographic scope. The general covenant position and the employee-specific checklist point indicate enforceability and mobility risk for the employee. | For the employee, reduce the duration, territory, and restricted activities to what is necessary for legitimate business protection. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Employer or Employee).\n\n| Issue | General | Employer | Employee |\n| --- | --- | --- | --- |\n| Parties and Role | Identify employer and employee with correct legal names. Confirm job title, reporting line, work location, and employment type. Flag incorrect entities, unclear role scope, or terms creating unintended employment relationships. | | |\n| Start Date and Term | State commencement date, probation period, fixed term, renewal mechanics, and conditions precedent. | Flag unclear commencement mechanics or terms that limit employer flexibility during the probation period. | Flag long probation periods, unclear renewal mechanics, or employer-only extension rights. |\n| Duties | Summarize duties, working hours, exclusivity, travel requirements, and flexibility clauses. | Flag overly narrow duties that restrict operational flexibility or the employer's ability to change the role. | Flag open-ended duties, excessive hours, broad travel requirements, or unilateral employer change rights. |\n| Compensation | Identify salary, payment frequency, reviews, bonus, commission, allowances, and discretion. | Flag discretionary compensation arrangements that may create enforceable entitlement expectations. | Flag fully discretionary compensation, unclear bonus criteria, or missing payment timing. |\n| Benefits | Summarize pension, insurance, leave, expenses, equity incentives, and employer discretion. | Flag benefit commitments that may be difficult to modify or withdraw without breach. | Flag benefits that can be withdrawn without notice or that conflict with the offer letter. |\n| Holiday and Leave | State annual leave, sickness absence, statutory leave, notice requirements, and carry-over rules. | Flag carry-over obligations or leave accrual that creates significant financial liability. | Flag entitlements below statutory minimums, unclear carry-over rules, or inadequate sick pay. |\n| Policies and Handbook | Identify incorporated policies, contractual status, and amendment rights. | Flag policies incorporated as contractual that cannot be changed unilaterally without employee consent. | Flag policies incorporated as contractual while the employer retains unilateral amendment rights. |\n| Confidentiality | Summarize confidentiality obligations during and after employment. | Flag confidentiality obligations too narrow to protect business-critical information. | Flag overbroad confidential information definitions or indefinite restrictions beyond legitimate business interests. |\n| Intellectual Property | Identify ownership, assignment, inventions, works, moral rights waivers, and assistance obligations. | Flag gaps in IP assignment covering inventions or works made during employment or using company resources. | Flag assignment of unrelated personal inventions, works outside employment scope, or unpaid post-employment assistance obligations. |\n| Data Protection and Monitoring | Summarize monitoring, privacy, processing, and consent provisions. | Flag monitoring arrangements that may expose the employer to data protection liability. | Flag intrusive monitoring, blanket consent provisions, or missing privacy notice references. |\n| Conflicts and Outside Activities | Identify restrictions on outside work, directorships, investments, conflicts, and disclosure duties. | Flag insufficient restrictions on outside activities or conflicts that could harm business interests. | Flag broad bans on passive investments, restrictions on unrelated outside work, or disclosure obligations for non-conflicting activities. |\n| Termination | State notice periods, payment in lieu, garden leave, summary dismissal, severance, and survival terms. | Flag notice periods or severance obligations that unduly limit employer termination flexibility. | Flag one-sided notice rights, broad summary dismissal triggers, or unclear payment in lieu treatment. |\n| Restrictive Covenants | Summarize non-compete, non-solicit, non-dealing, non-poach, and confidentiality covenants. | Flag covenants too narrow in scope, too short in duration, or likely to be unenforceable. | Flag excessive duration, broad geographic scope, wide covered customers, or covenants that may be unenforceable restraints. |\n| Return of Property | Identify obligations to return devices, documents, data, confidential information, and property. | Flag unclear scope of return obligations or no mechanism to enforce retrieval of business property. | Flag no carve-out for personal materials or obligations that require returning statutory record retention copies. |\n| Governing Law and Dispute Resolution | State governing law, courts, tribunal forum, arbitration, and mandatory procedures. Flag unfamiliar law, unclear mandatory procedures, or arbitration clauses that may limit statutory rights. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", + "skill_md": "# Employment Agreement Review\n\n## Instructions\n\nReview the uploaded employment agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - restrictive covenant scope is excessive\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Restrictive Covenants | High - Clause [x] imposes a long non-compete with broad geographic scope. The general covenant position and the employee-specific checklist point indicate enforceability and mobility risk for the employee. | For the employee, reduce the duration, territory, and restricted activities to what is necessary for legitimate business protection. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Employer or Employee).\n\n| Issue | General | Employer | Employee |\n| --- | --- | --- | --- |\n| Parties and Role | Identify employer and employee with correct legal names. Confirm job title, reporting line, work location, and employment type. Flag incorrect entities, unclear role scope, or terms creating unintended employment relationships. | | |\n| Start Date and Term | State commencement date, probation period, fixed term, renewal mechanics, and conditions precedent. | Flag unclear commencement mechanics or terms that limit employer flexibility during the probation period. | Flag long probation periods, unclear renewal mechanics, or employer-only extension rights. |\n| Duties | Summarize duties, working hours, exclusivity, travel requirements, and flexibility clauses. | Flag overly narrow duties that restrict operational flexibility or the employer's ability to change the role. | Flag open-ended duties, excessive hours, broad travel requirements, or unilateral employer change rights. |\n| Compensation | Identify salary, payment frequency, reviews, bonus, commission, allowances, and discretion. | Flag discretionary compensation arrangements that may create enforceable entitlement expectations. | Flag fully discretionary compensation, unclear bonus criteria, or missing payment timing. |\n| Benefits | Summarize pension, insurance, leave, expenses, equity incentives, and employer discretion. | Flag benefit commitments that may be difficult to modify or withdraw without breach. | Flag benefits that can be withdrawn without notice or that conflict with the offer letter. |\n| Holiday and Leave | State annual leave, sickness absence, statutory leave, notice requirements, and carry-over rules. | Flag carry-over obligations or leave accrual that creates significant financial liability. | Flag entitlements below statutory minimums, unclear carry-over rules, or inadequate sick pay. |\n| Policies and Handbook | Identify incorporated policies, contractual status, and amendment rights. | Flag policies incorporated as contractual that cannot be changed unilaterally without employee consent. | Flag policies incorporated as contractual while the employer retains unilateral amendment rights. |\n| Confidentiality | Summarize confidentiality obligations during and after employment. | Flag confidentiality obligations too narrow to protect business-critical information. | Flag overbroad confidential information definitions or indefinite restrictions beyond legitimate business interests. |\n| Intellectual Property | Identify ownership, assignment, inventions, works, moral rights waivers, and assistance obligations. | Flag gaps in IP assignment covering inventions or works made during employment or using company resources. | Flag assignment of unrelated personal inventions, works outside employment scope, or unpaid post-employment assistance obligations. |\n| Data Protection and Monitoring | Summarize monitoring, privacy, processing, and consent provisions. | Flag monitoring arrangements that may expose the employer to data protection liability. | Flag intrusive monitoring, blanket consent provisions, or missing privacy notice references. |\n| Conflicts and Outside Activities | Identify restrictions on outside work, directorships, investments, conflicts, and disclosure duties. | Flag insufficient restrictions on outside activities or conflicts that could harm business interests. | Flag broad bans on passive investments, restrictions on unrelated outside work, or disclosure obligations for non-conflicting activities. |\n| Termination | State notice periods, payment in lieu, garden leave, summary dismissal, severance, and survival terms. | Flag notice periods or severance obligations that unduly limit employer termination flexibility. | Flag one-sided notice rights, broad summary dismissal triggers, or unclear payment in lieu treatment. |\n| Restrictive Covenants | Summarize non-compete, non-solicit, non-dealing, non-poach, and confidentiality covenants. | Flag covenants too narrow in scope, too short in duration, or likely to be unenforceable. | Flag excessive duration, broad geographic scope, wide covered customers, or covenants that may be unenforceable restraints. |\n| Return of Property | Identify obligations to return devices, documents, data, confidential information, and property. | Flag unclear scope of return obligations or no mechanism to enforce retrieval of business property. | Flag no carve-out for personal materials or obligations that require returning statutory record retention copies. |\n| Governing Law and Dispute Resolution | State governing law, courts, tribunal forum, arbitration, and mandatory procedures. Flag unfamiliar law, unclear mandatory procedures, or arbitration clauses that may limit statutory rights. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", "columns_config": null }, { @@ -831,14 +836,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-employment-agreement-tabular-review", "metadata": { "title": "Employment Agreement Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -848,7 +853,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Employment Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# Employment Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -883,17 +888,13 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ { "index": 5, "name": "Full Time / Part Time", - "format": "tag", - "tags": [ - "Full Time", - "Part Time" - ], + "format": "text", "prompt": "Is this a full-time or part-time position? If part-time, state the number of days or hours per week where specified." }, { "index": 6, "name": "Independent Contractor?", - "format": "yes_no", + "format": "text", "prompt": "Does the agreement characterise the worker as an independent contractor rather than an employee? Answer Yes if the agreement uses contractor, consultant, or self-employed language. Note any provisions that address the nature of the relationship." }, { @@ -963,10 +964,10 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -986,14 +987,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-guarantee-agreement-review", "metadata": { "title": "Guarantee Agreement Review", - "description": "Review the uploaded guarantee, guaranty, or guarantee-and-indemnity agreement and produce a comprehensive table-based legal review from the perspective of the party represented...", + "description": "Review an uploaded guarantee, guaranty, or guarantee-and-indemnity agreement from the perspective of the party represented by the user.", "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1003,24 +1004,24 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Guarantee Agreement Review\n\n## Instructions\n\nReview the uploaded guarantee, guaranty, or guarantee-and-indemnity agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - guarantee is uncapped\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Cap and Limits | High - Clause [x] does not include a monetary cap or time limit. The general exposure point and the guarantor-specific checklist point indicate uncapped liability risk for the guarantor. | For the guarantor, add a monetary cap, currency limit, time limit, and exclusions for obligations outside the agreed transaction. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Guarantor or Guarantee Holder).\n\n| Issue | General | Guarantor | Guarantee Holder |\n| --- | --- | --- | --- |\n| Parties | Identify all parties with full legal names and roles, including guarantor, principal obligor, agent, and security trustee. Flag incorrect entities, missing capacity details, or unclear party or agent structure. | | |\n| Guaranteed Obligations | Summarize payment, performance, indemnity, costs, interest, fees, future advances, and all-monies coverage. | Flag broad all-monies coverage, obligations beyond the intended transaction, or future advances not agreed at outset. | Flag gaps in guaranteed obligations or exclusions of fees, interest, or enforcement costs. |\n| Nature of Liability | State whether liability is primary, secondary, joint and several, continuing, independent, on-demand, or principal debtor liability. | Flag primary, on-demand, or principal debtor liability where only secondary guarantee risk was intended. | Flag secondary-only liability or absence of principal debtor language that weakens enforcement. |\n| Guarantee vs Indemnity | Identify any separate indemnity or principal debtor language and explain practical effect. | Flag separate indemnity language that expands exposure beyond the underlying obligation or bypasses guarantor defences. | Flag absence of indemnity or principal debtor language that could allow defences to defeat enforcement. |\n| Cap and Limits | State monetary cap, currency, interest cap, time limit, excluded obligations, and other limits. | Flag uncapped exposure, unclear currency, or no temporal limit on guaranteed obligations. | Flag caps too low to cover the full facility, or caps that exclude interest, fees, and enforcement costs. |\n| Continuing Security | Summarize future, contingent, amended, refinanced, reinstated, or continuing obligations. | Flag coverage of unknown future obligations or amendments to the underlying facility without guarantor consent. | Flag gaps in continuing security coverage or restrictions on amendments that limit lender flexibility. |\n| Demand Mechanics | Explain demand triggers, notice, payment timing, evidence, and conclusiveness. | Flag immediate payment without adequate evidence, conclusive certificates, or no notice period before demand. | Flag demand mechanics too cumbersome or conditions that allow the guarantor to delay payment. |\n| Defences and Waivers | Identify waivers of suretyship defences, diligence, presentment, set-off, marshalling, subrogation, contribution, and notice. | Flag broad waivers of fundamental defences, excessive restriction of set-off, or waiver of subrogation rights. | Flag incomplete waiver of suretyship defences that could allow the guarantor to avoid payment. |\n| Variations and Releases | Summarize effect of amendments, waivers, releases, insolvency events, or underlying document changes. | Flag guarantee surviving material changes to the underlying facility without guarantor consent. | Flag restrictions on amendments or waivers requiring guarantor consent that limit lender flexibility. |\n| Reinstatement | Identify clawback, preference, invalid payment, or reinstatement provisions. | Flag indefinite reinstatement obligations or reinstatement beyond reasonable insolvency clawback risk. | Flag absence of reinstatement provisions that could leave the guarantee holder exposed after a clawback. |\n| Subordination | Summarize restrictions on guarantor claims, subrogation, contribution, or proof in insolvency. | Flag indefinite blockage of guarantor recovery or subrogation rights after the guarantee holder is paid in full. | Flag absence of subordination provisions that could allow the guarantor to compete with the guarantee holder in insolvency. |\n| Representations and Covenants | Identify capacity, authority, solvency, consents, sanctions, and compliance covenants. | Flag repeating representations, broad compliance obligations, or solvency statements that may be difficult to give. | Flag weak representations or covenants that do not adequately confirm guarantor capacity and authority. |\n| Termination and Release | State how the guarantee may be terminated, released, discharged, or reduced. | Flag no release mechanism after repayment or facility termination, or unclear discharge conditions. | Flag release mechanics too easy to trigger or that do not require full repayment and discharge. |\n| Costs, Expenses, and Taxes | Summarize reimbursement, gross-up, tax indemnities, and enforcement costs. | Flag unlimited costs, gross-up for avoidable taxes, or broad indemnities beyond reasonable enforcement costs. | Flag cost recovery gaps that leave enforcement costs unrecoverable from the guarantor. |\n| Assignment and Transfer | Identify whether the guarantee holder may assign or transfer benefit and whether guarantor consent is required. | Flag free transfer of benefit to unknown creditors, distressed debt purchasers, or competitors without consent. | Flag consent mechanics that give the guarantor excessive control over assignment of the guarantee benefit. |\n| Governing Law and Dispute Resolution | State governing law, jurisdiction, arbitration, service of process, and immunity waiver provisions. Flag unfamiliar law, inconvenient forum, broad immunity waiver, unclear service mechanics, or inadequate interim relief provisions. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", + "skill_md": "# Guarantee Agreement Review\n\n## Instructions\n\nReview the uploaded guarantee, guaranty, or guarantee-and-indemnity agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - guarantee is uncapped\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Cap and Limits | High - Clause [x] does not include a monetary cap or time limit. The general exposure point and the guarantor-specific checklist point indicate uncapped liability risk for the guarantor. | For the guarantor, add a monetary cap, currency limit, time limit, and exclusions for obligations outside the agreed transaction. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Guarantor or Guarantee Holder).\n\n| Issue | General | Guarantor | Guarantee Holder |\n| --- | --- | --- | --- |\n| Parties | Identify all parties with full legal names and roles, including guarantor, principal obligor, agent, and security trustee. Flag incorrect entities, missing capacity details, or unclear party or agent structure. | | |\n| Guaranteed Obligations | Summarize payment, performance, indemnity, costs, interest, fees, future advances, and all-monies coverage. | Flag broad all-monies coverage, obligations beyond the intended transaction, or future advances not agreed at outset. | Flag gaps in guaranteed obligations or exclusions of fees, interest, or enforcement costs. |\n| Nature of Liability | State whether liability is primary, secondary, joint and several, continuing, independent, on-demand, or principal debtor liability. | Flag primary, on-demand, or principal debtor liability where only secondary guarantee risk was intended. | Flag secondary-only liability or absence of principal debtor language that weakens enforcement. |\n| Guarantee vs Indemnity | Identify any separate indemnity or principal debtor language and explain practical effect. | Flag separate indemnity language that expands exposure beyond the underlying obligation or bypasses guarantor defences. | Flag absence of indemnity or principal debtor language that could allow defences to defeat enforcement. |\n| Cap and Limits | State monetary cap, currency, interest cap, time limit, excluded obligations, and other limits. | Flag uncapped exposure, unclear currency, or no temporal limit on guaranteed obligations. | Flag caps too low to cover the full facility, or caps that exclude interest, fees, and enforcement costs. |\n| Continuing Security | Summarize future, contingent, amended, refinanced, reinstated, or continuing obligations. | Flag coverage of unknown future obligations or amendments to the underlying facility without guarantor consent. | Flag gaps in continuing security coverage or restrictions on amendments that limit lender flexibility. |\n| Demand Mechanics | Explain demand triggers, notice, payment timing, evidence, and conclusiveness. | Flag immediate payment without adequate evidence, conclusive certificates, or no notice period before demand. | Flag demand mechanics too cumbersome or conditions that allow the guarantor to delay payment. |\n| Defences and Waivers | Identify waivers of suretyship defences, diligence, presentment, set-off, marshalling, subrogation, contribution, and notice. | Flag broad waivers of fundamental defences, excessive restriction of set-off, or waiver of subrogation rights. | Flag incomplete waiver of suretyship defences that could allow the guarantor to avoid payment. |\n| Variations and Releases | Summarize effect of amendments, waivers, releases, insolvency events, or underlying document changes. | Flag guarantee surviving material changes to the underlying facility without guarantor consent. | Flag restrictions on amendments or waivers requiring guarantor consent that limit lender flexibility. |\n| Reinstatement | Identify clawback, preference, invalid payment, or reinstatement provisions. | Flag indefinite reinstatement obligations or reinstatement beyond reasonable insolvency clawback risk. | Flag absence of reinstatement provisions that could leave the guarantee holder exposed after a clawback. |\n| Subordination | Summarize restrictions on guarantor claims, subrogation, contribution, or proof in insolvency. | Flag indefinite blockage of guarantor recovery or subrogation rights after the guarantee holder is paid in full. | Flag absence of subordination provisions that could allow the guarantor to compete with the guarantee holder in insolvency. |\n| Representations and Covenants | Identify capacity, authority, solvency, consents, sanctions, and compliance covenants. | Flag repeating representations, broad compliance obligations, or solvency statements that may be difficult to give. | Flag weak representations or covenants that do not adequately confirm guarantor capacity and authority. |\n| Termination and Release | State how the guarantee may be terminated, released, discharged, or reduced. | Flag no release mechanism after repayment or facility termination, or unclear discharge conditions. | Flag release mechanics too easy to trigger or that do not require full repayment and discharge. |\n| Costs, Expenses, and Taxes | Summarize reimbursement, gross-up, tax indemnities, and enforcement costs. | Flag unlimited costs, gross-up for avoidable taxes, or broad indemnities beyond reasonable enforcement costs. | Flag cost recovery gaps that leave enforcement costs unrecoverable from the guarantor. |\n| Assignment and Transfer | Identify whether the guarantee holder may assign or transfer benefit and whether guarantor consent is required. | Flag free transfer of benefit to unknown creditors, distressed debt purchasers, or competitors without consent. | Flag consent mechanics that give the guarantor excessive control over assignment of the guarantee benefit. |\n| Governing Law and Dispute Resolution | State governing law, jurisdiction, arbitration, service of process, and immunity waiver provisions. Flag unfamiliar law, inconvenient forum, broad immunity waiver, unclear service mechanics, or inadequate interim relief provisions. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", "columns_config": null }, { "user_id": null, "is_system": true, "created_at": "", - "id": "builtin-lpa-tabular-review", + "id": "builtin-limited-partnership-agreement-tabular-review", "metadata": { "title": "Limited Partnership Agreement Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1030,7 +1031,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Limited Partnership Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# Limited Partnership Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -1165,10 +1166,10 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1178,7 +1179,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# NDA Review\n\n## Instructions\n\nReview the uploaded non-disclosure agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - confidential information definition is too narrow\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Definition of Confidential Information | Medium - Clause [x] covers broad categories of information but does not clearly address oral disclosures. The general definition point and the disclosing-party checklist point indicate a protection gap. | For the disclosing party, add oral and visual disclosures and require written confirmation within a defined period. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Disclosing Party or Receiving Party).\n\n| Issue | General | Disclosing Party | Receiving Party |\n| --- | --- | --- | --- |\n| Parties | Identify each party and their role. Confirm whether the NDA is mutual or one-way and that obligations are correctly allocated. Flag missing affiliates, mismatched roles, or obligations inconsistent with the agreed structure. | | |\n| Purpose | Summarize the permitted purpose for which confidential information may be used. | Flag overly broad purpose language that permits use beyond the intended transaction. | Flag unclear or narrow purpose that prevents legitimate use of information in connection with the transaction. |\n| Definition of Confidential Information | Explain what information is protected, including oral, visual, derived, or pre-existing information. | Flag definitions too narrow to protect all disclosed information, or no protection for oral or unmarked information. | Flag definitions overbroad, capturing publicly available information or information not actually sensitive. |\n| Exclusions | Identify standard exclusions such as public domain, independently developed, already known, or third-party received information. | Flag missing standard exclusions that would allow the receiving party to escape obligations too easily. | Flag missing standard exclusions (public domain, independently developed, already known) or exclusions that are too difficult to prove. |\n| Disclosure Obligations | Summarize confidentiality obligations, standard of care, and use or disclosure restrictions. | Flag standards of care too weak to adequately protect the information. | Flag strict liability, vague standards, or obligations higher than own-information standards that expose the receiving party disproportionately. |\n| Permitted Recipients | Identify who may receive confidential information, including affiliates, representatives, advisers, financing sources, or investors. | Flag recipient categories too broad, or no requirement for recipients to be bound by equivalent obligations. | Flag missing adviser, affiliate, or financing source access rights needed to evaluate the transaction. |\n| Recipient Liability | State whether the receiving party is responsible for breaches by permitted recipients. | Flag absence of receiving party responsibility for breaches by permitted recipients. | Flag uncapped liability for actions of recipients outside the party's direct control. |\n| Compelled Disclosure | Summarize disclosure required by law, regulation, court order, stock exchange, or governmental authority. | Flag no notice right, no cooperation obligation, or overly broad compelled disclosure permissions. | Flag overly burdensome notice requirements or obligations to resist disclosure beyond what is practicable. |\n| Term | State the agreement term and the duration of confidentiality obligations. | Flag obligations that expire too soon or unclear continuation of obligations after agreement end. | Flag indefinite obligations or unusually long terms for non-trade-secret information. |\n| Return or Destruction | Summarize return, destruction, retention, and archival copy obligations. | Flag no return obligation or inadequate destruction mechanics. | Flag no carve-out for archival, compliance, backup, or legal retention copies. |\n| Residual Knowledge | Identify whether unaided memory or residual knowledge may be used. | Flag broad residual knowledge rights that could undermine confidentiality protections. | Flag absence of a residual knowledge carve-out that prevents legitimate use of unaided memory. |\n| Non-Solicit / Standstill | Identify non-solicitation, non-circumvention, standstill, exclusivity, or similar restrictions. | Flag absence of non-solicitation or standstill protections where commercially expected. | Flag hidden restrictive covenants, long durations, broad covered persons, or restrictions unrelated to confidentiality. |\n| No Warranty / No Obligation | Summarize disclaimers about accuracy, completeness, warranties, or obligation to proceed. | Flag missing disclaimers that could create liability for the accuracy or completeness of disclosed information. | Flag disclaimers that conflict with fraud or intentional misrepresentation, or that expressly exclude reliance. |\n| Remedies | Identify injunctive relief, equitable remedies, indemnities, liquidated damages, or enforcement provisions. | Flag absence of injunctive relief or inadequate remedies for breach. | Flag automatic injunction language, broad indemnities, or liquidated damages without adequate safeguards. |\n| Assignment | Summarize restrictions on assignment or transfer. | Flag free assignment rights that could transfer obligations to unknown parties. | Flag restrictions that block legitimate affiliate transfers needed for the deal process. |\n| Governing Law and Dispute Resolution | State governing law, forum, arbitration provisions, and submission to jurisdiction. Flag unfamiliar law, asymmetric process, inconvenient forum, or missing service provisions. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", + "skill_md": "# NDA Review\n\n## Instructions\n\nReview the uploaded non-disclosure agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - confidential information definition is too narrow\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Definition of Confidential Information | Medium - Clause [x] covers broad categories of information but does not clearly address oral disclosures. The general definition point and the disclosing-party checklist point indicate a protection gap. | For the disclosing party, add oral and visual disclosures and require written confirmation within a defined period. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Disclosing Party or Receiving Party).\n\n| Issue | General | Disclosing Party | Receiving Party |\n| --- | --- | --- | --- |\n| Parties | Identify each party and their role. Confirm whether the NDA is mutual or one-way and that obligations are correctly allocated. Flag missing affiliates, mismatched roles, or obligations inconsistent with the agreed structure. | | |\n| Purpose | Summarize the permitted purpose for which confidential information may be used. | Flag overly broad purpose language that permits use beyond the intended transaction. | Flag unclear or narrow purpose that prevents legitimate use of information in connection with the transaction. |\n| Definition of Confidential Information | Explain what information is protected, including oral, visual, derived, or pre-existing information. | Flag definitions too narrow to protect all disclosed information, or no protection for oral or unmarked information. | Flag definitions overbroad, capturing publicly available information or information not actually sensitive. |\n| Exclusions | Identify standard exclusions such as public domain, independently developed, already known, or third-party received information. | Flag missing standard exclusions that would allow the receiving party to escape obligations too easily. | Flag missing standard exclusions (public domain, independently developed, already known) or exclusions that are too difficult to prove. |\n| Disclosure Obligations | Summarize confidentiality obligations, standard of care, and use or disclosure restrictions. | Flag standards of care too weak to adequately protect the information. | Flag strict liability, vague standards, or obligations higher than own-information standards that expose the receiving party disproportionately. |\n| Permitted Recipients | Identify who may receive confidential information, including affiliates, representatives, advisers, financing sources, or investors. | Flag recipient categories too broad, or no requirement for recipients to be bound by equivalent obligations. | Flag missing adviser, affiliate, or financing source access rights needed to evaluate the transaction. |\n| Recipient Liability | State whether the receiving party is responsible for breaches by permitted recipients. | Flag absence of receiving party responsibility for breaches by permitted recipients. | Flag uncapped liability for actions of recipients outside the party's direct control. |\n| Compelled Disclosure | Summarize disclosure required by law, regulation, court order, stock exchange, or governmental authority. | Flag no notice right, no cooperation obligation, or overly broad compelled disclosure permissions. | Flag overly burdensome notice requirements or obligations to resist disclosure beyond what is practicable. |\n| Term | State the agreement term and the duration of confidentiality obligations. | Flag obligations that expire too soon or unclear continuation of obligations after agreement end. | Flag indefinite obligations or unusually long terms for non-trade-secret information. |\n| Return or Destruction | Summarize return, destruction, retention, and archival copy obligations. | Flag no return obligation or inadequate destruction mechanics. | Flag no carve-out for archival, compliance, backup, or legal retention copies. |\n| Residual Knowledge | Identify whether unaided memory or residual knowledge may be used. | Flag broad residual knowledge rights that could undermine confidentiality protections. | Flag absence of a residual knowledge carve-out that prevents legitimate use of unaided memory. |\n| Non-Solicit / Standstill | Identify non-solicitation, non-circumvention, standstill, exclusivity, or similar restrictions. | Flag absence of non-solicitation or standstill protections where commercially expected. | Flag hidden restrictive covenants, long durations, broad covered persons, or restrictions unrelated to confidentiality. |\n| No Warranty / No Obligation | Summarize disclaimers about accuracy, completeness, warranties, or obligation to proceed. | Flag missing disclaimers that could create liability for the accuracy or completeness of disclosed information. | Flag disclaimers that conflict with fraud or intentional misrepresentation, or that expressly exclude reliance. |\n| Remedies | Identify injunctive relief, equitable remedies, indemnities, liquidated damages, or enforcement provisions. | Flag absence of injunctive relief or inadequate remedies for breach. | Flag automatic injunction language, broad indemnities, or liquidated damages without adequate safeguards. |\n| Assignment | Summarize restrictions on assignment or transfer. | Flag free assignment rights that could transfer obligations to unknown parties. | Flag restrictions that block legitimate affiliate transfers needed for the deal process. |\n| Governing Law and Dispute Resolution | State governing law, forum, arbitration provisions, and submission to jurisdiction. Flag unfamiliar law, asymmetric process, inconvenient forum, or missing service provisions. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", "columns_config": null }, { @@ -1188,14 +1189,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-nda-tabular-review", "metadata": { "title": "NDA Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1205,16 +1206,12 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# NDA Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# NDA Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, "name": "Direction", - "format": "tag", - "tags": [ - "Mutual", - "Unilateral" - ], + "format": "text", "prompt": "Is this NDA mutual (both parties owe confidentiality obligations to each other) or unilateral (only one party owes confidentiality obligations)? Identify the direction and name the disclosing and receiving party or parties." }, { @@ -1232,7 +1229,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ { "index": 3, "name": "Standard Carveouts Present?", - "format": "yes_no", + "format": "text", "prompt": "Does the agreement include the standard carveouts to confidentiality obligations? Answer Yes if the agreement excludes information that: (a) is or becomes publicly available without breach; (b) was already known to the receiving party; (c) is independently developed; and (d) is received from a third party without restriction. Note any carveouts that are missing or are drafted differently from the standard formulation." }, { @@ -1278,10 +1275,10 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1298,17 +1295,17 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "user_id": null, "is_system": true, "created_at": "", - "id": "builtin-sha-summary", + "id": "builtin-shareholder-agreement-review", "metadata": { "title": "Shareholder Agreement Review", "description": "Review the uploaded shareholder agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client.", "type": "assistant", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1318,7 +1315,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Shareholder Agreement Review\n\n## Instructions\n\nReview the uploaded shareholder agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — drag threshold is too low\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Drag-Along Rights | High — Clause [x] sets the drag threshold at [x]% and does not include a minimum price protection. The minority-specific checklist point indicates the minority can be forced to sell at an unfavorable price. | For the minority, raise the drag threshold, add a minimum price equal to fair market value, and limit warranties to proceeds received. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the share classes. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, share class definitions, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Majority or Minority).\n\n| Issue | General | Majority | Minority |\n| --- | --- | --- | --- |\n| Parties and Shareholdings | Identify each shareholder, role, share class, percentage holding, and fully diluted position. Flag inconsistent cap table information, missing parties, or unclear beneficial ownership. | | |\n| Share Classes and Rights | Summarize voting rights, dividend rights, liquidation preferences, conversion rights, redemption rights, and class consents. | Flag class consents or voting requirements that effectively give minority approval rights over ordinary decisions. | Flag hidden preference rights, disproportionate majority voting rights, or unfavorable class economics. |\n| Board Composition and Governance | Identify board size, appointment rights, observer rights, quorum, chair, and casting vote. | Flag quorum or deadlock provisions giving minority an effective veto over governance. | Flag entrenched majority appointment rights, casting vote held by a majority nominee, or no observer rights for minority. |\n| Reserved Matters | List matters requiring special majority, unanimity, investor consent, or board consent. | Flag reserved matters requiring minority consent that constrain ordinary business decisions. | Flag absence of meaningful minority veto rights or low-dollar thresholds allowing majority to structure around them. |\n| Pre-emption on New Shares | Summarize pre-emption rights, offer process, timing, exclusions, and carve-outs. | Flag mechanics slowing fundraising or requiring minority consent to issue new shares. | Flag broad carve-outs, short exercise periods, or mechanics permitting dilution without proper notice. |\n| Transfer Restrictions | Summarize lock-ups, prohibited transfers, permitted transfers, and consent requirements. | Flag restrictions preventing majority exit or group reorganisation without minority consent. | Flag absence of lock-up on majority transfers or mechanics allowing majority to exit leaving minority trapped. |\n| Right of First Refusal / Pre-emption on Transfer | Identify trigger, process, pricing, matching rights, and exceptions. | Flag long ROFR processes or pricing mechanics delaying majority exit. | Flag unclear matching rights, long processes excluding minority participation, or exceptions removing minority protections. |\n| Drag-Along Rights | Identify drag threshold, sale conditions, minority protections, and power of attorney. | Flag high drag threshold or conditions preventing majority from executing a sale. | Flag low drag threshold, no minimum price protection, forced warranties beyond proceeds received, or broad power of attorney. |\n| Tag-Along Rights | Identify triggering transfers, eligible holders, and sale terms. | Flag broad tag triggers complicating majority exit. | Flag missing or narrow tag rights, or mechanics allowing majority to exclude minority from exit proceeds. |\n| Anti-Dilution Protections | Identify anti-dilution mechanics, carve-outs, and adjustment triggers. | Flag mechanics punishing founders or majority holders on down-rounds. | Flag absence of anti-dilution protection, full ratchet terms, or unclear carve-outs from adjustment. |\n| Dividend Policy | Summarize dividend rights, preferential dividends, restrictions, and discretion. | Flag mandatory dividend obligations impairing business cash flow or restricting majority discretion. | Flag unclear preferential dividend rights or majority discretion over dividends without minority consent. |\n| Exit and Liquidity | Identify IPO, trade sale, redemption, put/call rights, timelines, and liquidation preferences. | Flag forced exit timelines or investor put rights constraining majority exit strategy. | Flag unclear waterfall on exit, exit rights not applying equally, or no minority participation in liquidity events. |\n| Deadlock | Summarize deadlock definition, escalation, expert determination, shoot-out, and liquidation mechanics. | Flag deadlock provisions giving minority disproportionate leverage or effective veto. | Flag shoot-out rights triggered at low thresholds or mechanics structurally favoring majority. |\n| Non-Compete and Non-Solicitation | Identify who is bound, restricted activities, geography, duration, and carve-outs. | Flag restraints binding the majority entity or overly broad scope applied to the majority group. | Flag broad non-competes restricting the minority's ability to operate independently after exit. |\n| Information Rights | Identify reporting, inspection, management accounts, and confidentiality obligations. | Flag extensive information rights giving minority commercially sensitive operational visibility. | Flag absence of reporting or inspection rights, or inadequate confidentiality obligations on recipients. |\n| Related Party Transactions | Identify approval requirements, disclosure duties, and arm's-length standards. | Flag overly strict conflict controls restricting legitimate majority-group transactions. | Flag weak conflict controls, broad permitted related-party dealings, or no arm's-length enforcement. |\n| Governing Law and Dispute Resolution | State governing law, forum, arbitration, escalation, and interim relief rights. Flag unclear or ambiguous forum or dispute mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", + "skill_md": "# Shareholder Agreement Review\n\n## Instructions\n\nReview the uploaded shareholder agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — drag threshold is too low\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Drag-Along Rights | High — Clause [x] sets the drag threshold at [x]% and does not include a minimum price protection. The minority-specific checklist point indicates the minority can be forced to sell at an unfavorable price. | For the minority, raise the drag threshold, add a minimum price equal to fair market value, and limit warranties to proceeds received. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the share classes. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, share class definitions, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Majority or Minority).\n\n| Issue | General | Majority | Minority |\n| --- | --- | --- | --- |\n| Parties and Shareholdings | Identify each shareholder, role, share class, percentage holding, and fully diluted position. Flag inconsistent cap table information, missing parties, or unclear beneficial ownership. | | |\n| Share Classes and Rights | Summarize voting rights, dividend rights, liquidation preferences, conversion rights, redemption rights, and class consents. | Flag class consents or voting requirements that effectively give minority approval rights over ordinary decisions. | Flag hidden preference rights, disproportionate majority voting rights, or unfavorable class economics. |\n| Board Composition and Governance | Identify board size, appointment rights, observer rights, quorum, chair, and casting vote. | Flag quorum or deadlock provisions giving minority an effective veto over governance. | Flag entrenched majority appointment rights, casting vote held by a majority nominee, or no observer rights for minority. |\n| Reserved Matters | List matters requiring special majority, unanimity, investor consent, or board consent. | Flag reserved matters requiring minority consent that constrain ordinary business decisions. | Flag absence of meaningful minority veto rights or low-dollar thresholds allowing majority to structure around them. |\n| Pre-emption on New Shares | Summarize pre-emption rights, offer process, timing, exclusions, and carve-outs. | Flag mechanics slowing fundraising or requiring minority consent to issue new shares. | Flag broad carve-outs, short exercise periods, or mechanics permitting dilution without proper notice. |\n| Transfer Restrictions | Summarize lock-ups, prohibited transfers, permitted transfers, and consent requirements. | Flag restrictions preventing majority exit or group reorganisation without minority consent. | Flag absence of lock-up on majority transfers or mechanics allowing majority to exit leaving minority trapped. |\n| Right of First Refusal / Pre-emption on Transfer | Identify trigger, process, pricing, matching rights, and exceptions. | Flag long ROFR processes or pricing mechanics delaying majority exit. | Flag unclear matching rights, long processes excluding minority participation, or exceptions removing minority protections. |\n| Drag-Along Rights | Identify drag threshold, sale conditions, minority protections, and power of attorney. | Flag high drag threshold or conditions preventing majority from executing a sale. | Flag low drag threshold, no minimum price protection, forced warranties beyond proceeds received, or broad power of attorney. |\n| Tag-Along Rights | Identify triggering transfers, eligible holders, and sale terms. | Flag broad tag triggers complicating majority exit. | Flag missing or narrow tag rights, or mechanics allowing majority to exclude minority from exit proceeds. |\n| Anti-Dilution Protections | Identify anti-dilution mechanics, carve-outs, and adjustment triggers. | Flag mechanics punishing founders or majority holders on down-rounds. | Flag absence of anti-dilution protection, full ratchet terms, or unclear carve-outs from adjustment. |\n| Dividend Policy | Summarize dividend rights, preferential dividends, restrictions, and discretion. | Flag mandatory dividend obligations impairing business cash flow or restricting majority discretion. | Flag unclear preferential dividend rights or majority discretion over dividends without minority consent. |\n| Exit and Liquidity | Identify IPO, trade sale, redemption, put/call rights, timelines, and liquidation preferences. | Flag forced exit timelines or investor put rights constraining majority exit strategy. | Flag unclear waterfall on exit, exit rights not applying equally, or no minority participation in liquidity events. |\n| Deadlock | Summarize deadlock definition, escalation, expert determination, shoot-out, and liquidation mechanics. | Flag deadlock provisions giving minority disproportionate leverage or effective veto. | Flag shoot-out rights triggered at low thresholds or mechanics structurally favoring majority. |\n| Non-Compete and Non-Solicitation | Identify who is bound, restricted activities, geography, duration, and carve-outs. | Flag restraints binding the majority entity or overly broad scope applied to the majority group. | Flag broad non-competes restricting the minority's ability to operate independently after exit. |\n| Information Rights | Identify reporting, inspection, management accounts, and confidentiality obligations. | Flag extensive information rights giving minority commercially sensitive operational visibility. | Flag absence of reporting or inspection rights, or inadequate confidentiality obligations on recipients. |\n| Related Party Transactions | Identify approval requirements, disclosure duties, and arm's-length standards. | Flag overly strict conflict controls restricting legitimate majority-group transactions. | Flag weak conflict controls, broad permitted related-party dealings, or no arm's-length enforcement. |\n| Governing Law and Dispute Resolution | State governing law, forum, arbitration, escalation, and interim relief rights. Flag unclear or ambiguous forum or dispute mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one.", "columns_config": null }, { @@ -1328,14 +1325,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-shareholder-agreement-tabular-review", "metadata": { "title": "Shareholder Agreement Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1345,7 +1342,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Shareholder Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# Shareholder Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -1476,14 +1473,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-spa-tabular-review", "metadata": { "title": "SPA Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1493,7 +1490,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# SPA Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# SPA Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -1582,14 +1579,14 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "id": "builtin-supply-agreement-tabular-review", "metadata": { "title": "Supply Agreement Tabular Review", - "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-config.yaml.", + "description": "Use this workflow to review uploaded documents and extract structured information into the tabular review columns defined in table-columns.yaml.", "type": "tabular", "contributors": [ { - "name": "Mike", - "organisation": "Open Legal Products", + "name": "Open Legal Products", + "organisation": null, "role": null, - "linkedin": "https://www.linkedin.com/company/mike-oss/" + "linkedin": null } ], "language": "English", @@ -1599,7 +1596,7 @@ export const SYSTEM_WORKFLOWS: SystemWorkflow[] = [ "General" ] }, - "skill_md": "# Supply Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-config.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-config.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Use clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response according to the host system's expected format.\n- Keep cell outputs concise, but include enough context to make the extracted value useful.\n- Do not invent citations, facts, parties, dates, or obligations.", + "skill_md": "# Supply Agreement Tabular Review\n\n## Purpose\n\nUse this workflow to review uploaded documents and extract structured information into the tabular review columns defined in `table-columns.yaml`.\n\n## Instructions\n\n- Apply each column prompt in `table-columns.yaml` to each document independently.\n- Extract only information supported by the document text.\n- Include clause references, section names, dates, amounts, party names, and defined terms where available.\n- If responsive information is not found, return an empty value or a concise \"Not found\" response.\n- Keep cell outputs concise while including enough context to make each extracted value useful.\n- Do not invent citations, facts, parties, dates, rights, obligations, or financial consequences.\n- Render the completed results as an exportable Excel (`.xlsx`) file. If Excel output is not possible, render the results as a Markdown table.", "columns_config": [ { "index": 0, @@ -1695,7 +1692,7 @@ export const SYSTEM_ASSISTANT_WORKFLOWS: { id: string; title: string; skill_md: { "id": "builtin-commercial-lease-review", "title": "Commercial Lease Review", - "skill_md": "# Commercial Lease Review\n\n## Instructions\n\nReview the uploaded commercial lease and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — reinstatement obligation is uncapped\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Break Rights | High — Clause [x] imposes vacant possession as a break condition with no cure period. The lessee-specific checklist point indicates the break is fragile and may be lost on a technicality. | For the lessee, remove vacant possession as a break condition or add a cure period and express the condition narrowly. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the premises. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, premises description, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Lessor or Lessee).\n\n| Issue | General | Lessor | Lessee |\n| --- | --- | --- | --- |\n| Parties and Premises | Identify landlord, tenant, guarantor, property, premises, title references, and included or excluded areas. Flag incorrect entities, missing plans, or premises description inconsistent with title. | | |\n| Term | State commencement, expiry, rent commencement, and any conditions precedent. | Flag renewal rights or holding-over provisions that limit the landlord's ability to recover the premises. | Flag uncertain commencement mechanics, no renewal clarity, or landlord-only discretion over start conditions. |\n| Rent and Payments | Confirm rent quantum, payment dates, and deposit mechanics. | Flag unclear payment mechanics, weak late-payment provisions, or rent-free periods exceeding what was agreed. | Flag unclear payment obligations, high default interest, or missing rent-free mechanics. |\n| Rent Review | Identify review dates, mechanism, assumptions, disregards, and dispute process. | Flag review mechanics too favorable to the tenant, downward review provisions, or no upward adjustment. | Flag upward-only review, no cap, aggressive assumptions, or tenant-unfriendly dispute process. |\n| Service Charge and Operating Costs | Identify tenant contribution scope, cap mechanics, audit rights, and reconciliation process. | Flag cost exclusions too broad, caps too low, or audit rights creating undue operational burden. | Flag broad pass-throughs, no cap, capital expenditure exposure, or weak audit rights. |\n| Use | State permitted use, prohibited uses, trading obligations, and change-of-use restrictions. | Flag permitted use too broad or absence of continuous trading obligation. | Flag narrow use restriction, continuous trading obligations, or restrictions inconsistent with operations. |\n| Repairs and Maintenance | Identify landlord and tenant repair obligations, condition standard, and schedule of condition. | Flag limited tenant repairing obligations, repair gaps, or yielding-up conditions below acceptable standard. | Flag full repairing obligation extending to pre-existing defects or structural issues outside tenant control. |\n| Alterations and Fit-Out | Identify consent requirements and reinstatement obligations. | Flag broad alteration rights without landlord consent or no reinstatement obligation. | Flag absolute consent rights, broad reinstatement obligations, or unclear fit-out approval timing. |\n| Assignment, Underletting, and Sharing Occupation | Identify transfer restrictions, consent tests, and group sharing rights. | Flag broad permitted transfer rights allowing assignment to unsuitable tenants without approval. | Flag absolute assignment bans, excessive consent conditions, or no group sharing rights. |\n| Insurance and Damage | Identify who insures, insured risks, rent suspension, and termination rights on damage. | Flag tenant insurance obligations too narrow or absence of rent suspension protection. | Flag no rent suspension on damage, uninsured risk exposure, or no termination right after prolonged damage. |\n| Break Rights | Identify break dates, notice periods, and conditions. | Flag broadly exercisable break conditions allowing tenant exit without adequate penalty. | Flag fragile break conditions, strict vacant possession tests, or excessive preconditions. |\n| Default and Remedies | Identify default events, cure periods, and enforcement rights. | Flag long cure periods, high default thresholds, or limited remedies that delay enforcement. | Flag short cure periods, broad default triggers, or landlord self-help without adequate notice. |\n| Compliance Obligations | Identify which party bears responsibility for regulatory compliance. | Flag compliance gaps exposing the landlord to regulatory liability. | Flag tenant responsibility for landlord works, historic contamination, or compliance beyond the demised premises. |\n| Security Package | Identify security type, quantum, and release conditions. | Flag security inadequate for the tenant's covenant strength or release mechanics too easy to trigger. | Flag excessive security requirements, no step-down on release, or unclear deposit return mechanics. |\n| Rights Reserved and Easements | Identify reserved landlord rights, access arrangements, and tenant rights over common parts. | Flag insufficient reserved rights limiting the landlord's ability to manage the building. | Flag broad landlord entry or disruption rights, or missing rights needed for the tenant's permitted use. |\n| End of Term | Identify yielding-up condition, reinstatement obligations, and dilapidations process. | Flag inadequate reinstatement obligations, unclear yielding-up conditions, or weak dilapidations recovery. | Flag overly broad reinstatement obligations or handback conditions requiring a better standard than at commencement. |\n| Governing Law and Dispute Resolution | State governing law, court forum, expert determination process, and mandatory dispute procedures. Flag ambiguous forum, missing expert determination terms, or inadequate dispute mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." + "skill_md": "# Commercial Lease Review\n\n## Instructions\n\nReview the uploaded commercial lease and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — reinstatement obligation is uncapped\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Break Rights | High — Clause [x] imposes vacant possession as a break condition with no cure period. The lessee-specific checklist point indicates the break is fragile and may be lost on a technicality. | For the lessee, remove vacant possession as a break condition or add a cure period and express the condition narrowly. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the premises. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, premises description, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Lessor or Lessee).\n\n| Issue | General | Lessor | Lessee |\n| --- | --- | --- | --- |\n| Parties and Premises | Identify landlord, tenant, guarantor, property, premises, title references, and included or excluded areas. Flag incorrect entities, missing plans, or premises description inconsistent with title. | | |\n| Term | State commencement, expiry, rent commencement, and any conditions precedent. | Flag renewal rights or holding-over provisions that limit the landlord's ability to recover the premises. | Flag uncertain commencement mechanics, no renewal clarity, or landlord-only discretion over start conditions. |\n| Rent and Payments | Confirm rent quantum, payment dates, and deposit mechanics. | Flag unclear payment mechanics, weak late-payment provisions, or rent-free periods exceeding what was agreed. | Flag unclear payment obligations, high default interest, or missing rent-free mechanics. |\n| Rent Review | Identify review dates, mechanism, assumptions, disregards, and dispute process. | Flag review mechanics too favorable to the tenant, downward review provisions, or no upward adjustment. | Flag upward-only review, no cap, aggressive assumptions, or tenant-unfriendly dispute process. |\n| Service Charge and Operating Costs | Identify tenant contribution scope, cap mechanics, audit rights, and reconciliation process. | Flag cost exclusions too broad, caps too low, or audit rights creating undue operational burden. | Flag broad pass-throughs, no cap, capital expenditure exposure, or weak audit rights. |\n| Use | State permitted use, prohibited uses, trading obligations, and change-of-use restrictions. | Flag permitted use too broad or absence of continuous trading obligation. | Flag narrow use restriction, continuous trading obligations, or restrictions inconsistent with operations. |\n| Repairs and Maintenance | Identify landlord and tenant repair obligations, condition standard, and schedule of condition. | Flag limited tenant repairing obligations, repair gaps, or yielding-up conditions below acceptable standard. | Flag full repairing obligation extending to pre-existing defects or structural issues outside tenant control. |\n| Alterations and Fit-Out | Identify consent requirements and reinstatement obligations. | Flag broad alteration rights without landlord consent or no reinstatement obligation. | Flag absolute consent rights, broad reinstatement obligations, or unclear fit-out approval timing. |\n| Assignment, Underletting, and Sharing Occupation | Identify transfer restrictions, consent tests, and group sharing rights. | Flag broad permitted transfer rights allowing assignment to unsuitable tenants without approval. | Flag absolute assignment bans, excessive consent conditions, or no group sharing rights. |\n| Insurance and Damage | Identify who insures, insured risks, rent suspension, and termination rights on damage. | Flag tenant insurance obligations too narrow or absence of rent suspension protection. | Flag no rent suspension on damage, uninsured risk exposure, or no termination right after prolonged damage. |\n| Break Rights | Identify break dates, notice periods, and conditions. | Flag broadly exercisable break conditions allowing tenant exit without adequate penalty. | Flag fragile break conditions, strict vacant possession tests, or excessive preconditions. |\n| Default and Remedies | Identify default events, cure periods, and enforcement rights. | Flag long cure periods, high default thresholds, or limited remedies that delay enforcement. | Flag short cure periods, broad default triggers, or landlord self-help without adequate notice. |\n| Compliance Obligations | Identify which party bears responsibility for regulatory compliance. | Flag compliance gaps exposing the landlord to regulatory liability. | Flag tenant responsibility for landlord works, historic contamination, or compliance beyond the demised premises. |\n| Security Package | Identify security type, quantum, and release conditions. | Flag security inadequate for the tenant's covenant strength or release mechanics too easy to trigger. | Flag excessive security requirements, no step-down on release, or unclear deposit return mechanics. |\n| Rights Reserved and Easements | Identify reserved landlord rights, access arrangements, and tenant rights over common parts. | Flag insufficient reserved rights limiting the landlord's ability to manage the building. | Flag broad landlord entry or disruption rights, or missing rights needed for the tenant's permitted use. |\n| End of Term | Identify yielding-up condition, reinstatement obligations, and dilapidations process. | Flag inadequate reinstatement obligations, unclear yielding-up conditions, or weak dilapidations recovery. | Flag overly broad reinstatement obligations or handback conditions requiring a better standard than at commencement. |\n| Governing Law and Dispute Resolution | State governing law, court forum, expert determination process, and mandatory dispute procedures. Flag ambiguous forum, missing expert determination terms, or inadequate dispute mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." }, { "id": "builtin-compare-documents", @@ -1708,29 +1705,29 @@ export const SYSTEM_ASSISTANT_WORKFLOWS: { id: string; title: string; skill_md: "skill_md": "# Corporate Approvals Review\n\n## Instructions\n\nReview the uploaded transaction document, resolution, authority package, or corporate action to determine whether the relevant company approvals appear complete, internally consistent, and supported by the company's corporate records.\n\nBefore producing the review, ask the user to upload or identify the available corporate records to check against. Request the relevant records, including as applicable:\n\n- certificate of incorporation, certificate of formation, or equivalent constitutional filing\n- memorandum and articles, articles of association, bylaws, operating agreement, constitution, or equivalent governing document\n- register of directors, board register, officer register, or equivalent management records\n- register of shareholders, register of members, stock ledger, cap table, or equivalent ownership records\n- board minutes, written resolutions, consents, committee resolutions, shareholder resolutions, or member approvals\n- shareholder agreement, investors' rights agreement, voting agreement, operating agreement, or other approval-rights document\n- incumbency certificate, secretary's certificate, specimen signatures, powers of attorney, delegated authority matrix, or signing authority evidence\n- relevant filings, good standing certificates, prior approvals, or transaction-specific authority documents\n\nIf records are missing, do not assume they exist. Identify what is missing and explain how that limits the review.\n\nProduce a concise Markdown table with exactly these columns:\n\n- Issue\n- Records Checked\n- Finding\n- Risk\n- Recommended Action\n\nUse these risk ratings in the **Risk** column:\n\n- Low: approval position appears standard or no material issue was identified from the records provided.\n- Medium: a gap, ambiguity, or missing supporting record should be clarified before completion.\n- High: a material approval, authority, capacity, or consistency issue may affect execution, validity, enforceability, or closing.\n- Critical: an apparent absence of required approval or authority may block signing or completion unless resolved.\n\nReview the uploaded materials for these categories:\n\n| Category | What to Check |\n| --- | --- |\n| Company Identity and Capacity | Check that the company's legal name, registration number, jurisdiction, entity type, capacity, and status match the corporate records and transaction documents. |\n| Constitutional Authority | Check whether the governing documents permit the transaction, execution of documents, borrowing, guarantees, security, share actions, asset disposals, or other relevant corporate action. |\n| Board Composition and Authority | Check current directors or managers against the board register, appointment records, quorum requirements, conflicts rules, voting thresholds, and authority to approve the transaction. |\n| Shareholder or Member Approvals | Check whether shareholder, member, class, investor, reserved matter, or special approval is required by law, governing documents, shareholder agreements, or other approval-rights documents. |\n| Signing Authority | Check signatories against incumbency records, delegated authority, resolutions, powers of attorney, secretary's certificates, and execution blocks. |\n| Approval Documents | Check board minutes, written resolutions, consents, certificates, and approval packs for correct parties, dates, quorum, votes, conflicts, recitals, authorized documents, and authorized signatories. |\n| Registers and Ownership Records | Check shareholder/member registers, cap tables, stock ledgers, and transfer records for consistency with approvals, voting thresholds, class rights, and parties entitled to approve. |\n| Transaction Document Consistency | Check that the documents approved match the documents being signed, including names, dates, document titles, parties, transaction description, limits, conditions, and schedules. |\n| Reserved Matters and Consent Rights | Check shareholder agreements, investor rights documents, financing documents, or other contracts for veto rights, consent rights, notice requirements, or approval thresholds. |\n| Filings and Ancillary Steps | Check whether filings, good standing certificates, registers, notices, public records updates, share certificates, or post-completion corporate records are required. |\n| Drafting and Record Inconsistencies | Flag inconsistent entity names, officer or director names, dates, document titles, approval thresholds, defined terms, numbering, cross-references, and conflicts between records. |\n\nFor each issue, cite the relevant corporate record or transaction document in the **Records Checked** column. In the **Finding** column, state what the records show and whether they support the proposed action. In the **Recommended Action** column, provide a specific cure, confirmation, document request, approval step, or drafting correction.\n\nIf no material approval issues are found, include a row stating that no material approval issue was identified based on the records provided, and separately identify any records that were not provided or assumptions that remain open.\n\nKeep the response focused on approval, authority, capacity, signing authority, and record consistency. Do not provide a broad commercial contract review unless the user asks for one." }, { - "id": "builtin-cp-checklist", - "title": "Draft CP Checklist", - "skill_md": "# Draft Conditions Precedent Checklist\n\nReview the uploaded credit agreement or financing document and generate a comprehensive Conditions Precedent (CP) checklist.\n\nYou MUST use the generate_docx tool to produce the checklist as a downloadable Word document. You MUST pass landscape: true to the generate_docx tool — the document must be in landscape orientation. Do not display the checklist inline — generate the .docx file and provide the download link.\n\nStructure the document as follows:\n- For each category of conditions (e.g. Corporate, Financial, Legal, Security), add a section with a heading\n- Under each category heading, include a table with exactly these four columns in this order:\n 1. Index — sequential number within the category (1, 2, 3…)\n 2. Clause Number — the clause or schedule reference from the agreement\n 3. Clause — a concise description of the condition precedent\n 4. Status — leave blank (empty string) for the user to fill in\n\nUse the table field in the section object (not content) for each category's rows.\n\n## Result Table Format\n\nThe document contains one section per category, each with a table in this format:\n\n### Corporate\n\n| Index | Clause Number | Clause | Status |\n| --- | --- | --- | --- |\n| 1 | Cl. 4.1(a)(i) | Certificate of incorporation and constitutional documents of the borrower |   |\n| 2 | Cl. 4.1(a)(ii) | Board resolution authorising execution of the finance documents and approving the terms of the transaction |   |\n| 3 | Cl. 4.1(a)(iii) | Specimen signatures of all authorised signatories |   |\n\n### Legal\n\n| Index | Clause Number | Clause | Status |\n| --- | --- | --- | --- |\n| 1 | Cl. 4.1(c)(i) | Legal opinion from counsel to the borrower in form and substance satisfactory to the agent |   |\n| 2 | Cl. 4.1(c)(ii) | Legal opinion from counsel to the arrangers as to the laws of the relevant jurisdiction |   |\n\nBefore finalizing, double-check that every table is formatted correctly: each table must have exactly the four columns above in the same order, headers must match exactly (Index, Clause Number, Clause, Status), every row must have the same number of cells as the headers, the Index column must be sequential starting from 1 within each category, and no cells should contain stray markdown, newlines, or placeholder text (use an empty string for Status)." + "id": "builtin-credit-agreement-review", + "title": "Credit Agreement Review", + "skill_md": "# Credit Agreement Review\n\n## Instructions\n\nReview the uploaded credit agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — covenant headroom is tight\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause or schedule references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Financial Covenants | High — Clause [x] sets the leverage covenant at [x]x with quarterly testing and no equity cure right. The borrower-specific checklist point indicates limited headroom and no remedy for a technical breach. | For the borrower, widen the covenant threshold, add an equity cure right, and reduce testing frequency to semi-annual. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the facility amount. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, amounts, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Borrower or Lender).\n\n| Issue | General | Borrower | Lender |\n| --- | --- | --- | --- |\n| Parties | Identify all lenders, borrowers, guarantors, agents, and other finance parties with full legal names, roles, and jurisdictions. Flag missing or incorrect entities, unclear agent roles, missing authority confirmations, or transfer mechanics that could result in unknown lenders. | | |\n| Guarantors | Identify guarantors, guarantee scope, limits, and coverage requirements. | Flag uncapped guarantees, missing limits, or upstream guarantee concerns exposing the borrower group. | Flag weak guarantor coverage, missing entities, or guarantees not covering the full facility. |\n| Other Parties | Identify facility agent, security agent, arrangers, issuing banks, and other material parties. | Flag unclear agent roles or mechanics creating additional obligations on the borrower. | Flag inconsistent secured party mechanics or missing parties affecting security validity. |\n| Date of Agreement | State signing date, effective date, and conditions to effectiveness. Flag inconsistent or unclear dates or effectiveness conditions. | | |\n| Facilities | List each facility, type, tranche, availability, and key structural features. | Flag excessive lender discretion, unclear facility purpose, or mismatched terms restricting drawdown. | Flag unclear facility structure or purpose creating enforcement ambiguity. |\n| Amount | State total commitments, currencies, tranche amounts, and accordion or incremental facilities. | Flag unclear currency exposure, uncapped accordion provisions without borrower consent, or inconsistent commitment figures. | Flag uncapped increase mechanics or dilutive accordion provisions not agreed at signing. |\n| Purpose | Summarize permitted use of proceeds and restrictions. | Flag vague purpose wording restricting flexibility or creating sanctions risk. | Flag broad purpose language permitting restricted payment leakage or unapproved use of proceeds. |\n| Interest | Identify reference rate, margin, floors, fallback rates, interest periods, and default interest. | Flag high margins, aggressive floors, benchmark fallback gaps, or high default interest. | Flag unclear fallback rate mechanics or interest calculation ambiguities. |\n| Commitment Fee | State commitment, utilisation, ticking, arrangement, agency, and other fees. | Flag hidden fees, fees payable after cancellation, or unclear calculation basis. | Flag missing fee provisions or fee timing delaying recovery. |\n| Repayment Schedule | Summarize amortisation, scheduled repayments, bullet payments, and cash sweep. | Flag aggressive amortisation, unclear prepayment application, or cash sweep uncertainty. | Flag bullet repayments without adequate covenant or security protection. |\n| Maturity | State final maturity date and any extension options. | Flag short maturity, lender-only extension discretion, or mismatch with the business plan. | Flag unclear extension conditions or borrower-controlled extension mechanics. |\n| Security | Identify security package, assets, entities, perfection steps, and post-closing obligations. | Flag all-asset security beyond deal scope, onerous post-closing steps, or missing release mechanics on disposal. | Flag gaps in the security package, missing perfection steps, or inadequate post-closing obligations. |\n| Guarantees | Summarize guarantee obligations, guarantors, limitations, and release triggers. | Flag broad all-monies language, unlimited guarantees, or no release mechanics after repayment or disposal. | Flag guarantee gaps, weak limitations, or no coverage test requirements. |\n| Financial Covenants | Identify covenant metrics, thresholds, testing frequency, cure rights, and reporting. | Flag tight headroom, frequent testing, no equity cure, or ambiguous EBITDA adjustments. | Flag loose covenant thresholds or wide EBITDA adjustments obscuring true financial performance. |\n| Events of Default | Summarize default triggers, grace periods, materiality thresholds, cross-default, and MAE. | Flag low materiality thresholds, no cure periods, broad cross-default, or subjective MAE defaults. | Flag weak default triggers, long cure periods, or materiality thresholds delaying enforcement. |\n| Assignment | Summarize lender transfer rights, borrower consent mechanics, and disqualified institutions. | Flag free transfers to competitors, distressed investors, or lenders on a borrower blacklist. | Flag consent mechanics giving the borrower excessive veto over lender transfers. |\n| Change of Control | Identify triggers and resulting prepayment, cancellation, or default consequences. | Flag broad triggers, no cure period, or definitions catching ordinary-course ownership changes. | Flag narrow change of control definitions missing material ownership shifts. |\n| Prepayment Fee | Identify make-whole, soft-call, premium periods, and exceptions. | Flag excessive fees, long premium periods, or unclear exceptions for mandatory prepayments. | Flag exceptions allowing free prepayment during premium periods. |\n| Governing Law and Dispute Resolution | State governing law, jurisdiction, forum, and service of process. Flag unclear or ambiguous governing law, jurisdiction, or service mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." }, { - "id": "builtin-credit-summary", - "title": "Credit Agreement Review", - "skill_md": "# Credit Agreement Review\n\n## Instructions\n\nReview the uploaded credit agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — covenant headroom is tight\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause or schedule references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Financial Covenants | High — Clause [x] sets the leverage covenant at [x]x with quarterly testing and no equity cure right. The borrower-specific checklist point indicates limited headroom and no remedy for a technical breach. | For the borrower, widen the covenant threshold, add an equity cure right, and reduce testing frequency to semi-annual. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the facility amount. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, amounts, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Borrower or Lender).\n\n| Issue | General | Borrower | Lender |\n| --- | --- | --- | --- |\n| Parties | Identify all lenders, borrowers, guarantors, agents, and other finance parties with full legal names, roles, and jurisdictions. Flag missing or incorrect entities, unclear agent roles, missing authority confirmations, or transfer mechanics that could result in unknown lenders. | | |\n| Guarantors | Identify guarantors, guarantee scope, limits, and coverage requirements. | Flag uncapped guarantees, missing limits, or upstream guarantee concerns exposing the borrower group. | Flag weak guarantor coverage, missing entities, or guarantees not covering the full facility. |\n| Other Parties | Identify facility agent, security agent, arrangers, issuing banks, and other material parties. | Flag unclear agent roles or mechanics creating additional obligations on the borrower. | Flag inconsistent secured party mechanics or missing parties affecting security validity. |\n| Date of Agreement | State signing date, effective date, and conditions to effectiveness. Flag inconsistent or unclear dates or effectiveness conditions. | | |\n| Facilities | List each facility, type, tranche, availability, and key structural features. | Flag excessive lender discretion, unclear facility purpose, or mismatched terms restricting drawdown. | Flag unclear facility structure or purpose creating enforcement ambiguity. |\n| Amount | State total commitments, currencies, tranche amounts, and accordion or incremental facilities. | Flag unclear currency exposure, uncapped accordion provisions without borrower consent, or inconsistent commitment figures. | Flag uncapped increase mechanics or dilutive accordion provisions not agreed at signing. |\n| Purpose | Summarize permitted use of proceeds and restrictions. | Flag vague purpose wording restricting flexibility or creating sanctions risk. | Flag broad purpose language permitting restricted payment leakage or unapproved use of proceeds. |\n| Interest | Identify reference rate, margin, floors, fallback rates, interest periods, and default interest. | Flag high margins, aggressive floors, benchmark fallback gaps, or high default interest. | Flag unclear fallback rate mechanics or interest calculation ambiguities. |\n| Commitment Fee | State commitment, utilisation, ticking, arrangement, agency, and other fees. | Flag hidden fees, fees payable after cancellation, or unclear calculation basis. | Flag missing fee provisions or fee timing delaying recovery. |\n| Repayment Schedule | Summarize amortisation, scheduled repayments, bullet payments, and cash sweep. | Flag aggressive amortisation, unclear prepayment application, or cash sweep uncertainty. | Flag bullet repayments without adequate covenant or security protection. |\n| Maturity | State final maturity date and any extension options. | Flag short maturity, lender-only extension discretion, or mismatch with the business plan. | Flag unclear extension conditions or borrower-controlled extension mechanics. |\n| Security | Identify security package, assets, entities, perfection steps, and post-closing obligations. | Flag all-asset security beyond deal scope, onerous post-closing steps, or missing release mechanics on disposal. | Flag gaps in the security package, missing perfection steps, or inadequate post-closing obligations. |\n| Guarantees | Summarize guarantee obligations, guarantors, limitations, and release triggers. | Flag broad all-monies language, unlimited guarantees, or no release mechanics after repayment or disposal. | Flag guarantee gaps, weak limitations, or no coverage test requirements. |\n| Financial Covenants | Identify covenant metrics, thresholds, testing frequency, cure rights, and reporting. | Flag tight headroom, frequent testing, no equity cure, or ambiguous EBITDA adjustments. | Flag loose covenant thresholds or wide EBITDA adjustments obscuring true financial performance. |\n| Events of Default | Summarize default triggers, grace periods, materiality thresholds, cross-default, and MAE. | Flag low materiality thresholds, no cure periods, broad cross-default, or subjective MAE defaults. | Flag weak default triggers, long cure periods, or materiality thresholds delaying enforcement. |\n| Assignment | Summarize lender transfer rights, borrower consent mechanics, and disqualified institutions. | Flag free transfers to competitors, distressed investors, or lenders on a borrower blacklist. | Flag consent mechanics giving the borrower excessive veto over lender transfers. |\n| Change of Control | Identify triggers and resulting prepayment, cancellation, or default consequences. | Flag broad triggers, no cure period, or definitions catching ordinary-course ownership changes. | Flag narrow change of control definitions missing material ownership shifts. |\n| Prepayment Fee | Identify make-whole, soft-call, premium periods, and exceptions. | Flag excessive fees, long premium periods, or unclear exceptions for mandatory prepayments. | Flag exceptions allowing free prepayment during premium periods. |\n| Governing Law and Dispute Resolution | State governing law, jurisdiction, forum, and service of process. Flag unclear or ambiguous governing law, jurisdiction, or service mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." + "id": "builtin-draft-cp-checklist", + "title": "Draft CP Checklist", + "skill_md": "# Draft Conditions Precedent Checklist\n\nReview the uploaded credit agreement or financing document and generate a comprehensive Conditions Precedent (CP) checklist.\n\nProduce the checklist as an exportable Word (`.docx`) document in landscape\norientation. Return the completed document as a file rather than displaying the\nchecklist inline.\n\nStructure the document as follows:\n- For each category of conditions (e.g. Corporate, Financial, Legal, Security), add a section with a heading\n- Under each category heading, include a table with exactly these four columns in this order:\n 1. Index — sequential number within the category (1, 2, 3…)\n 2. Clause Number — the clause or schedule reference from the agreement\n 3. Clause — a concise description of the condition precedent\n 4. Status — leave blank (empty string) for the user to fill in\n\nPlace each category's rows in a table under the relevant category heading.\n\n## Result Table Format\n\nThe document contains one section per category, each with a table in this format:\n\n### Corporate\n\n| Index | Clause Number | Clause | Status |\n| --- | --- | --- | --- |\n| 1 | Cl. 4.1(a)(i) | Certificate of incorporation and constitutional documents of the borrower | |\n| 2 | Cl. 4.1(a)(ii) | Board resolution authorising execution of the finance documents and approving the terms of the transaction | |\n| 3 | Cl. 4.1(a)(iii) | Specimen signatures of all authorised signatories | |\n\n### Legal\n\n| Index | Clause Number | Clause | Status |\n| --- | --- | --- | --- |\n| 1 | Cl. 4.1(c)(i) | Legal opinion from counsel to the borrower in form and substance satisfactory to the agent | |\n| 2 | Cl. 4.1(c)(ii) | Legal opinion from counsel to the arrangers as to the laws of the relevant jurisdiction | |\n\nBefore finalizing, double-check that every table is formatted correctly: each table must have exactly the four columns above in the same order, headers must match exactly (Index, Clause Number, Clause, Status), every row must have the same number of cells as the headers, the Index column must be sequential starting from 1 within each category, and no cells should contain stray markdown, newlines, or placeholder text (use an empty string for Status)." }, { "id": "builtin-draft-from-template", "title": "Draft from Template", - "skill_md": "# Draft from Template\n\n## Instructions\n\nUse the uploaded template as the drafting structure for a new document. Treat the template as the primary source for document style, section order, clause structure, defined-term conventions, placeholders, and formatting cues.\n\nBefore drafting, identify whether the user has provided enough instructions and source information to complete the draft. If key information is missing, ask concise follow-up questions instead of inventing facts.\n\nWhen drafting:\n\n- Preserve the template structure unless the user asks for changes.\n- Replace placeholders, bracketed fields, blanks, and example text with the user-provided facts where available.\n- Keep definitions, cross-references, numbering, party names, dates, schedules, and exhibits internally consistent.\n- Do not remove protective clauses, boilerplate, signatures, schedules, or annexes unless the user asks you to do so.\n- If the user provides supporting documents, use them only for facts and context that are relevant to completing the template.\n- Flag any assumptions, missing inputs, unresolved placeholders, or provisions that require legal or commercial confirmation.\n\nIf the user asks for a downloadable draft, use the document generation tools available to produce the drafted document. Otherwise, provide the drafted text or the most relevant sections inline, matching the template as closely as possible.\n\nDo not invent parties, dates, amounts, governing law, notice details, commercial terms, or factual background. If information is unavailable, leave a clear placeholder and list it in an **Open Points** section." + "skill_md": "# Draft from Template\n\n## Instructions\n\nIf the user has not provided a template file, ask them to upload one.\n\nUse an available file-copy tool call to create a copy of the uploaded template,\nthen edit that copy directly. Do not recreate the file from its extracted text,\nand never modify the original template. Preserve the copied file's format,\nlayout, styles, numbering, section order, clause structure, and other content\nunless the user asks for a change.\n\nReplace placeholders and template text using the user's instructions and any\nsupporting materials. Keep definitions, cross-references, names, dates,\nschedules, and exhibits internally consistent. Do not invent missing facts; ask\nfor essential information or leave a clear placeholder where appropriate.\n\nReturn the completed copy in the same file format as the uploaded template." }, { "id": "builtin-draft-issues-list", "title": "Draft Issues List", - "skill_md": "# Draft Issues List\n\n## Instructions\n\nReview the uploaded agreement and draft a comprehensive issues list from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before drafting the issues list.\n\nAn issues list identifies open, unresolved, or contentious points in the current draft that require negotiation or resolution before signing. Focus on points that are material to the represented party's commercial and legal position.\n\nOnce the represented party is clear, use the generate_docx tool to produce the issues list as a downloadable Word document. Do not display the issues list inline — generate the .docx file and provide the download link.\n\nThe Word document must contain exactly one result table. List each open issue in order from highest to lowest priority and add a final row called **Overall Negotiation Position**. The result table must have exactly these columns:\n\n- Issue\n- Current Position\n- Proposed Change\n\nUse these priority ratings at the start of the **Current Position** column: Critical means a blocking issue that must be resolved before signing; High means a material point requiring negotiation; Medium means a negotiation concern but manageable; Low means a minor point for consideration only. Include relevant clause references in the **Current Position** column. The **Proposed Change** column must state the specific amendment or position the represented party should seek, drafted from that party's perspective. Keep the response concise and focused on actionable negotiation points.\n\n## Result Table Format\n\nThe Word document must use this result table structure. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Current Position | Proposed Change |\n| --- | --- | --- |\n| Liability Cap | High — Clause [x] contains no monetary cap on the represented party's total liability under the agreement. | Add a liability cap equal to [amount] or a multiple of fees paid, with carve-outs limited to fraud and wilful misconduct. |\n| Governing Law | Medium — Clause [x] specifies [jurisdiction] law, which is inconvenient for the represented party's operations and legal advisers. | Change governing law to [preferred jurisdiction] and amend the dispute resolution clause accordingly. |\n\nUse the table field in the document section object, not prose content, for the issues list rows.\n\nBefore finalizing, double-check that the table is formatted correctly: it must have exactly the three columns above in the same order, headers must match exactly (Issue, Current Position, Proposed Change), every row must have the same number of cells as the headers, issues must be ordered from highest to lowest priority, and no cells should contain stray markdown, newlines, or placeholder text unless the source document requires a placeholder." + "skill_md": "# Draft Issues List\n\n## Instructions\n\nReview the uploaded agreement and draft a comprehensive issues list from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before drafting the issues list.\n\nAn issues list identifies open, unresolved, or contentious points in the current draft that require negotiation or resolution before signing. Focus on points that are material to the represented party's commercial and legal position.\n\nOnce the represented party is clear, produce the issues list as an exportable\nWord (`.docx`) document in landscape orientation. Return the completed document\nas a file rather than displaying the issues list inline.\n\nThe Word document must contain exactly one result table. List each open issue in order from highest to lowest priority and add a final row called **Overall Negotiation Position**. The result table must have exactly these columns:\n\n- Issue\n- Current Position\n- Proposed Change\n\nUse these priority ratings at the start of the **Current Position** column: Critical means a blocking issue that must be resolved before signing; High means a material point requiring negotiation; Medium means a negotiation concern but manageable; Low means a minor point for consideration only. Include relevant clause references in the **Current Position** column. The **Proposed Change** column must state the specific amendment or position the represented party should seek, drafted from that party's perspective. Keep the response concise and focused on actionable negotiation points.\n\n## Result Table Format\n\nThe Word document must use this result table structure. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Current Position | Proposed Change |\n| --- | --- | --- |\n| Liability Cap | High — Clause [x] contains no monetary cap on the represented party's total liability under the agreement. | Add a liability cap equal to [amount] or a multiple of fees paid, with carve-outs limited to fraud and wilful misconduct. |\n| Governing Law | Medium — Clause [x] specifies [jurisdiction] law, which is inconvenient for the represented party's operations and legal advisers. | Change governing law to [preferred jurisdiction] and amend the dispute resolution clause accordingly. |\n\nPlace the issues list rows in the result table rather than presenting them as\nprose.\n\nBefore finalizing, double-check that the table is formatted correctly: it must have exactly the three columns above in the same order, headers must match exactly (Issue, Current Position, Proposed Change), every row must have the same number of cells as the headers, issues must be ordered from highest to lowest priority, and no cells should contain stray markdown, newlines, or placeholder text unless the source document requires a placeholder." }, { "id": "builtin-employment-agreement-review", "title": "Employment Agreement Review", - "skill_md": "# Employment Agreement Review\n\n## Instructions\n\nReview the uploaded employment agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - restrictive covenant scope is excessive\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Restrictive Covenants | High - Clause [x] imposes a long non-compete with broad geographic scope. The general covenant position and the employee-specific checklist point indicate enforceability and mobility risk for the employee. | For the employee, reduce the duration, territory, and restricted activities to what is necessary for legitimate business protection. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Employer or Employee).\n\n| Issue | General | Employer | Employee |\n| --- | --- | --- | --- |\n| Parties and Role | Identify employer and employee with correct legal names. Confirm job title, reporting line, work location, and employment type. Flag incorrect entities, unclear role scope, or terms creating unintended employment relationships. | | |\n| Start Date and Term | State commencement date, probation period, fixed term, renewal mechanics, and conditions precedent. | Flag unclear commencement mechanics or terms that limit employer flexibility during the probation period. | Flag long probation periods, unclear renewal mechanics, or employer-only extension rights. |\n| Duties | Summarize duties, working hours, exclusivity, travel requirements, and flexibility clauses. | Flag overly narrow duties that restrict operational flexibility or the employer's ability to change the role. | Flag open-ended duties, excessive hours, broad travel requirements, or unilateral employer change rights. |\n| Compensation | Identify salary, payment frequency, reviews, bonus, commission, allowances, and discretion. | Flag discretionary compensation arrangements that may create enforceable entitlement expectations. | Flag fully discretionary compensation, unclear bonus criteria, or missing payment timing. |\n| Benefits | Summarize pension, insurance, leave, expenses, equity incentives, and employer discretion. | Flag benefit commitments that may be difficult to modify or withdraw without breach. | Flag benefits that can be withdrawn without notice or that conflict with the offer letter. |\n| Holiday and Leave | State annual leave, sickness absence, statutory leave, notice requirements, and carry-over rules. | Flag carry-over obligations or leave accrual that creates significant financial liability. | Flag entitlements below statutory minimums, unclear carry-over rules, or inadequate sick pay. |\n| Policies and Handbook | Identify incorporated policies, contractual status, and amendment rights. | Flag policies incorporated as contractual that cannot be changed unilaterally without employee consent. | Flag policies incorporated as contractual while the employer retains unilateral amendment rights. |\n| Confidentiality | Summarize confidentiality obligations during and after employment. | Flag confidentiality obligations too narrow to protect business-critical information. | Flag overbroad confidential information definitions or indefinite restrictions beyond legitimate business interests. |\n| Intellectual Property | Identify ownership, assignment, inventions, works, moral rights waivers, and assistance obligations. | Flag gaps in IP assignment covering inventions or works made during employment or using company resources. | Flag assignment of unrelated personal inventions, works outside employment scope, or unpaid post-employment assistance obligations. |\n| Data Protection and Monitoring | Summarize monitoring, privacy, processing, and consent provisions. | Flag monitoring arrangements that may expose the employer to data protection liability. | Flag intrusive monitoring, blanket consent provisions, or missing privacy notice references. |\n| Conflicts and Outside Activities | Identify restrictions on outside work, directorships, investments, conflicts, and disclosure duties. | Flag insufficient restrictions on outside activities or conflicts that could harm business interests. | Flag broad bans on passive investments, restrictions on unrelated outside work, or disclosure obligations for non-conflicting activities. |\n| Termination | State notice periods, payment in lieu, garden leave, summary dismissal, severance, and survival terms. | Flag notice periods or severance obligations that unduly limit employer termination flexibility. | Flag one-sided notice rights, broad summary dismissal triggers, or unclear payment in lieu treatment. |\n| Restrictive Covenants | Summarize non-compete, non-solicit, non-dealing, non-poach, and confidentiality covenants. | Flag covenants too narrow in scope, too short in duration, or likely to be unenforceable. | Flag excessive duration, broad geographic scope, wide covered customers, or covenants that may be unenforceable restraints. |\n| Return of Property | Identify obligations to return devices, documents, data, confidential information, and property. | Flag unclear scope of return obligations or no mechanism to enforce retrieval of business property. | Flag no carve-out for personal materials or obligations that require returning statutory record retention copies. |\n| Governing Law and Dispute Resolution | State governing law, courts, tribunal forum, arbitration, and mandatory procedures. Flag unfamiliar law, unclear mandatory procedures, or arbitration clauses that may limit statutory rights. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." + "skill_md": "# Employment Agreement Review\n\n## Instructions\n\nReview the uploaded employment agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - restrictive covenant scope is excessive\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Restrictive Covenants | High - Clause [x] imposes a long non-compete with broad geographic scope. The general covenant position and the employee-specific checklist point indicate enforceability and mobility risk for the employee. | For the employee, reduce the duration, territory, and restricted activities to what is necessary for legitimate business protection. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Employer or Employee).\n\n| Issue | General | Employer | Employee |\n| --- | --- | --- | --- |\n| Parties and Role | Identify employer and employee with correct legal names. Confirm job title, reporting line, work location, and employment type. Flag incorrect entities, unclear role scope, or terms creating unintended employment relationships. | | |\n| Start Date and Term | State commencement date, probation period, fixed term, renewal mechanics, and conditions precedent. | Flag unclear commencement mechanics or terms that limit employer flexibility during the probation period. | Flag long probation periods, unclear renewal mechanics, or employer-only extension rights. |\n| Duties | Summarize duties, working hours, exclusivity, travel requirements, and flexibility clauses. | Flag overly narrow duties that restrict operational flexibility or the employer's ability to change the role. | Flag open-ended duties, excessive hours, broad travel requirements, or unilateral employer change rights. |\n| Compensation | Identify salary, payment frequency, reviews, bonus, commission, allowances, and discretion. | Flag discretionary compensation arrangements that may create enforceable entitlement expectations. | Flag fully discretionary compensation, unclear bonus criteria, or missing payment timing. |\n| Benefits | Summarize pension, insurance, leave, expenses, equity incentives, and employer discretion. | Flag benefit commitments that may be difficult to modify or withdraw without breach. | Flag benefits that can be withdrawn without notice or that conflict with the offer letter. |\n| Holiday and Leave | State annual leave, sickness absence, statutory leave, notice requirements, and carry-over rules. | Flag carry-over obligations or leave accrual that creates significant financial liability. | Flag entitlements below statutory minimums, unclear carry-over rules, or inadequate sick pay. |\n| Policies and Handbook | Identify incorporated policies, contractual status, and amendment rights. | Flag policies incorporated as contractual that cannot be changed unilaterally without employee consent. | Flag policies incorporated as contractual while the employer retains unilateral amendment rights. |\n| Confidentiality | Summarize confidentiality obligations during and after employment. | Flag confidentiality obligations too narrow to protect business-critical information. | Flag overbroad confidential information definitions or indefinite restrictions beyond legitimate business interests. |\n| Intellectual Property | Identify ownership, assignment, inventions, works, moral rights waivers, and assistance obligations. | Flag gaps in IP assignment covering inventions or works made during employment or using company resources. | Flag assignment of unrelated personal inventions, works outside employment scope, or unpaid post-employment assistance obligations. |\n| Data Protection and Monitoring | Summarize monitoring, privacy, processing, and consent provisions. | Flag monitoring arrangements that may expose the employer to data protection liability. | Flag intrusive monitoring, blanket consent provisions, or missing privacy notice references. |\n| Conflicts and Outside Activities | Identify restrictions on outside work, directorships, investments, conflicts, and disclosure duties. | Flag insufficient restrictions on outside activities or conflicts that could harm business interests. | Flag broad bans on passive investments, restrictions on unrelated outside work, or disclosure obligations for non-conflicting activities. |\n| Termination | State notice periods, payment in lieu, garden leave, summary dismissal, severance, and survival terms. | Flag notice periods or severance obligations that unduly limit employer termination flexibility. | Flag one-sided notice rights, broad summary dismissal triggers, or unclear payment in lieu treatment. |\n| Restrictive Covenants | Summarize non-compete, non-solicit, non-dealing, non-poach, and confidentiality covenants. | Flag covenants too narrow in scope, too short in duration, or likely to be unenforceable. | Flag excessive duration, broad geographic scope, wide covered customers, or covenants that may be unenforceable restraints. |\n| Return of Property | Identify obligations to return devices, documents, data, confidential information, and property. | Flag unclear scope of return obligations or no mechanism to enforce retrieval of business property. | Flag no carve-out for personal materials or obligations that require returning statutory record retention copies. |\n| Governing Law and Dispute Resolution | State governing law, courts, tribunal forum, arbitration, and mandatory procedures. Flag unfamiliar law, unclear mandatory procedures, or arbitration clauses that may limit statutory rights. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." }, { "id": "builtin-extract-key-terms", @@ -1740,12 +1737,12 @@ export const SYSTEM_ASSISTANT_WORKFLOWS: { id: string; title: string; skill_md: { "id": "builtin-guarantee-agreement-review", "title": "Guarantee Agreement Review", - "skill_md": "# Guarantee Agreement Review\n\n## Instructions\n\nReview the uploaded guarantee, guaranty, or guarantee-and-indemnity agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - guarantee is uncapped\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Cap and Limits | High - Clause [x] does not include a monetary cap or time limit. The general exposure point and the guarantor-specific checklist point indicate uncapped liability risk for the guarantor. | For the guarantor, add a monetary cap, currency limit, time limit, and exclusions for obligations outside the agreed transaction. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Guarantor or Guarantee Holder).\n\n| Issue | General | Guarantor | Guarantee Holder |\n| --- | --- | --- | --- |\n| Parties | Identify all parties with full legal names and roles, including guarantor, principal obligor, agent, and security trustee. Flag incorrect entities, missing capacity details, or unclear party or agent structure. | | |\n| Guaranteed Obligations | Summarize payment, performance, indemnity, costs, interest, fees, future advances, and all-monies coverage. | Flag broad all-monies coverage, obligations beyond the intended transaction, or future advances not agreed at outset. | Flag gaps in guaranteed obligations or exclusions of fees, interest, or enforcement costs. |\n| Nature of Liability | State whether liability is primary, secondary, joint and several, continuing, independent, on-demand, or principal debtor liability. | Flag primary, on-demand, or principal debtor liability where only secondary guarantee risk was intended. | Flag secondary-only liability or absence of principal debtor language that weakens enforcement. |\n| Guarantee vs Indemnity | Identify any separate indemnity or principal debtor language and explain practical effect. | Flag separate indemnity language that expands exposure beyond the underlying obligation or bypasses guarantor defences. | Flag absence of indemnity or principal debtor language that could allow defences to defeat enforcement. |\n| Cap and Limits | State monetary cap, currency, interest cap, time limit, excluded obligations, and other limits. | Flag uncapped exposure, unclear currency, or no temporal limit on guaranteed obligations. | Flag caps too low to cover the full facility, or caps that exclude interest, fees, and enforcement costs. |\n| Continuing Security | Summarize future, contingent, amended, refinanced, reinstated, or continuing obligations. | Flag coverage of unknown future obligations or amendments to the underlying facility without guarantor consent. | Flag gaps in continuing security coverage or restrictions on amendments that limit lender flexibility. |\n| Demand Mechanics | Explain demand triggers, notice, payment timing, evidence, and conclusiveness. | Flag immediate payment without adequate evidence, conclusive certificates, or no notice period before demand. | Flag demand mechanics too cumbersome or conditions that allow the guarantor to delay payment. |\n| Defences and Waivers | Identify waivers of suretyship defences, diligence, presentment, set-off, marshalling, subrogation, contribution, and notice. | Flag broad waivers of fundamental defences, excessive restriction of set-off, or waiver of subrogation rights. | Flag incomplete waiver of suretyship defences that could allow the guarantor to avoid payment. |\n| Variations and Releases | Summarize effect of amendments, waivers, releases, insolvency events, or underlying document changes. | Flag guarantee surviving material changes to the underlying facility without guarantor consent. | Flag restrictions on amendments or waivers requiring guarantor consent that limit lender flexibility. |\n| Reinstatement | Identify clawback, preference, invalid payment, or reinstatement provisions. | Flag indefinite reinstatement obligations or reinstatement beyond reasonable insolvency clawback risk. | Flag absence of reinstatement provisions that could leave the guarantee holder exposed after a clawback. |\n| Subordination | Summarize restrictions on guarantor claims, subrogation, contribution, or proof in insolvency. | Flag indefinite blockage of guarantor recovery or subrogation rights after the guarantee holder is paid in full. | Flag absence of subordination provisions that could allow the guarantor to compete with the guarantee holder in insolvency. |\n| Representations and Covenants | Identify capacity, authority, solvency, consents, sanctions, and compliance covenants. | Flag repeating representations, broad compliance obligations, or solvency statements that may be difficult to give. | Flag weak representations or covenants that do not adequately confirm guarantor capacity and authority. |\n| Termination and Release | State how the guarantee may be terminated, released, discharged, or reduced. | Flag no release mechanism after repayment or facility termination, or unclear discharge conditions. | Flag release mechanics too easy to trigger or that do not require full repayment and discharge. |\n| Costs, Expenses, and Taxes | Summarize reimbursement, gross-up, tax indemnities, and enforcement costs. | Flag unlimited costs, gross-up for avoidable taxes, or broad indemnities beyond reasonable enforcement costs. | Flag cost recovery gaps that leave enforcement costs unrecoverable from the guarantor. |\n| Assignment and Transfer | Identify whether the guarantee holder may assign or transfer benefit and whether guarantor consent is required. | Flag free transfer of benefit to unknown creditors, distressed debt purchasers, or competitors without consent. | Flag consent mechanics that give the guarantor excessive control over assignment of the guarantee benefit. |\n| Governing Law and Dispute Resolution | State governing law, jurisdiction, arbitration, service of process, and immunity waiver provisions. Flag unfamiliar law, inconvenient forum, broad immunity waiver, unclear service mechanics, or inadequate interim relief provisions. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." + "skill_md": "# Guarantee Agreement Review\n\n## Instructions\n\nReview the uploaded guarantee, guaranty, or guarantee-and-indemnity agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - guarantee is uncapped\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Cap and Limits | High - Clause [x] does not include a monetary cap or time limit. The general exposure point and the guarantor-specific checklist point indicate uncapped liability risk for the guarantor. | For the guarantor, add a monetary cap, currency limit, time limit, and exclusions for obligations outside the agreed transaction. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Guarantor or Guarantee Holder).\n\n| Issue | General | Guarantor | Guarantee Holder |\n| --- | --- | --- | --- |\n| Parties | Identify all parties with full legal names and roles, including guarantor, principal obligor, agent, and security trustee. Flag incorrect entities, missing capacity details, or unclear party or agent structure. | | |\n| Guaranteed Obligations | Summarize payment, performance, indemnity, costs, interest, fees, future advances, and all-monies coverage. | Flag broad all-monies coverage, obligations beyond the intended transaction, or future advances not agreed at outset. | Flag gaps in guaranteed obligations or exclusions of fees, interest, or enforcement costs. |\n| Nature of Liability | State whether liability is primary, secondary, joint and several, continuing, independent, on-demand, or principal debtor liability. | Flag primary, on-demand, or principal debtor liability where only secondary guarantee risk was intended. | Flag secondary-only liability or absence of principal debtor language that weakens enforcement. |\n| Guarantee vs Indemnity | Identify any separate indemnity or principal debtor language and explain practical effect. | Flag separate indemnity language that expands exposure beyond the underlying obligation or bypasses guarantor defences. | Flag absence of indemnity or principal debtor language that could allow defences to defeat enforcement. |\n| Cap and Limits | State monetary cap, currency, interest cap, time limit, excluded obligations, and other limits. | Flag uncapped exposure, unclear currency, or no temporal limit on guaranteed obligations. | Flag caps too low to cover the full facility, or caps that exclude interest, fees, and enforcement costs. |\n| Continuing Security | Summarize future, contingent, amended, refinanced, reinstated, or continuing obligations. | Flag coverage of unknown future obligations or amendments to the underlying facility without guarantor consent. | Flag gaps in continuing security coverage or restrictions on amendments that limit lender flexibility. |\n| Demand Mechanics | Explain demand triggers, notice, payment timing, evidence, and conclusiveness. | Flag immediate payment without adequate evidence, conclusive certificates, or no notice period before demand. | Flag demand mechanics too cumbersome or conditions that allow the guarantor to delay payment. |\n| Defences and Waivers | Identify waivers of suretyship defences, diligence, presentment, set-off, marshalling, subrogation, contribution, and notice. | Flag broad waivers of fundamental defences, excessive restriction of set-off, or waiver of subrogation rights. | Flag incomplete waiver of suretyship defences that could allow the guarantor to avoid payment. |\n| Variations and Releases | Summarize effect of amendments, waivers, releases, insolvency events, or underlying document changes. | Flag guarantee surviving material changes to the underlying facility without guarantor consent. | Flag restrictions on amendments or waivers requiring guarantor consent that limit lender flexibility. |\n| Reinstatement | Identify clawback, preference, invalid payment, or reinstatement provisions. | Flag indefinite reinstatement obligations or reinstatement beyond reasonable insolvency clawback risk. | Flag absence of reinstatement provisions that could leave the guarantee holder exposed after a clawback. |\n| Subordination | Summarize restrictions on guarantor claims, subrogation, contribution, or proof in insolvency. | Flag indefinite blockage of guarantor recovery or subrogation rights after the guarantee holder is paid in full. | Flag absence of subordination provisions that could allow the guarantor to compete with the guarantee holder in insolvency. |\n| Representations and Covenants | Identify capacity, authority, solvency, consents, sanctions, and compliance covenants. | Flag repeating representations, broad compliance obligations, or solvency statements that may be difficult to give. | Flag weak representations or covenants that do not adequately confirm guarantor capacity and authority. |\n| Termination and Release | State how the guarantee may be terminated, released, discharged, or reduced. | Flag no release mechanism after repayment or facility termination, or unclear discharge conditions. | Flag release mechanics too easy to trigger or that do not require full repayment and discharge. |\n| Costs, Expenses, and Taxes | Summarize reimbursement, gross-up, tax indemnities, and enforcement costs. | Flag unlimited costs, gross-up for avoidable taxes, or broad indemnities beyond reasonable enforcement costs. | Flag cost recovery gaps that leave enforcement costs unrecoverable from the guarantor. |\n| Assignment and Transfer | Identify whether the guarantee holder may assign or transfer benefit and whether guarantor consent is required. | Flag free transfer of benefit to unknown creditors, distressed debt purchasers, or competitors without consent. | Flag consent mechanics that give the guarantor excessive control over assignment of the guarantee benefit. |\n| Governing Law and Dispute Resolution | State governing law, jurisdiction, arbitration, service of process, and immunity waiver provisions. Flag unfamiliar law, inconvenient forum, broad immunity waiver, unclear service mechanics, or inadequate interim relief provisions. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." }, { "id": "builtin-nda-review", "title": "NDA Review", - "skill_md": "# NDA Review\n\n## Instructions\n\nReview the uploaded non-disclosure agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - confidential information definition is too narrow\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Definition of Confidential Information | Medium - Clause [x] covers broad categories of information but does not clearly address oral disclosures. The general definition point and the disclosing-party checklist point indicate a protection gap. | For the disclosing party, add oral and visual disclosures and require written confirmation within a defined period. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Disclosing Party or Receiving Party).\n\n| Issue | General | Disclosing Party | Receiving Party |\n| --- | --- | --- | --- |\n| Parties | Identify each party and their role. Confirm whether the NDA is mutual or one-way and that obligations are correctly allocated. Flag missing affiliates, mismatched roles, or obligations inconsistent with the agreed structure. | | |\n| Purpose | Summarize the permitted purpose for which confidential information may be used. | Flag overly broad purpose language that permits use beyond the intended transaction. | Flag unclear or narrow purpose that prevents legitimate use of information in connection with the transaction. |\n| Definition of Confidential Information | Explain what information is protected, including oral, visual, derived, or pre-existing information. | Flag definitions too narrow to protect all disclosed information, or no protection for oral or unmarked information. | Flag definitions overbroad, capturing publicly available information or information not actually sensitive. |\n| Exclusions | Identify standard exclusions such as public domain, independently developed, already known, or third-party received information. | Flag missing standard exclusions that would allow the receiving party to escape obligations too easily. | Flag missing standard exclusions (public domain, independently developed, already known) or exclusions that are too difficult to prove. |\n| Disclosure Obligations | Summarize confidentiality obligations, standard of care, and use or disclosure restrictions. | Flag standards of care too weak to adequately protect the information. | Flag strict liability, vague standards, or obligations higher than own-information standards that expose the receiving party disproportionately. |\n| Permitted Recipients | Identify who may receive confidential information, including affiliates, representatives, advisers, financing sources, or investors. | Flag recipient categories too broad, or no requirement for recipients to be bound by equivalent obligations. | Flag missing adviser, affiliate, or financing source access rights needed to evaluate the transaction. |\n| Recipient Liability | State whether the receiving party is responsible for breaches by permitted recipients. | Flag absence of receiving party responsibility for breaches by permitted recipients. | Flag uncapped liability for actions of recipients outside the party's direct control. |\n| Compelled Disclosure | Summarize disclosure required by law, regulation, court order, stock exchange, or governmental authority. | Flag no notice right, no cooperation obligation, or overly broad compelled disclosure permissions. | Flag overly burdensome notice requirements or obligations to resist disclosure beyond what is practicable. |\n| Term | State the agreement term and the duration of confidentiality obligations. | Flag obligations that expire too soon or unclear continuation of obligations after agreement end. | Flag indefinite obligations or unusually long terms for non-trade-secret information. |\n| Return or Destruction | Summarize return, destruction, retention, and archival copy obligations. | Flag no return obligation or inadequate destruction mechanics. | Flag no carve-out for archival, compliance, backup, or legal retention copies. |\n| Residual Knowledge | Identify whether unaided memory or residual knowledge may be used. | Flag broad residual knowledge rights that could undermine confidentiality protections. | Flag absence of a residual knowledge carve-out that prevents legitimate use of unaided memory. |\n| Non-Solicit / Standstill | Identify non-solicitation, non-circumvention, standstill, exclusivity, or similar restrictions. | Flag absence of non-solicitation or standstill protections where commercially expected. | Flag hidden restrictive covenants, long durations, broad covered persons, or restrictions unrelated to confidentiality. |\n| No Warranty / No Obligation | Summarize disclaimers about accuracy, completeness, warranties, or obligation to proceed. | Flag missing disclaimers that could create liability for the accuracy or completeness of disclosed information. | Flag disclaimers that conflict with fraud or intentional misrepresentation, or that expressly exclude reliance. |\n| Remedies | Identify injunctive relief, equitable remedies, indemnities, liquidated damages, or enforcement provisions. | Flag absence of injunctive relief or inadequate remedies for breach. | Flag automatic injunction language, broad indemnities, or liquidated damages without adequate safeguards. |\n| Assignment | Summarize restrictions on assignment or transfer. | Flag free assignment rights that could transfer obligations to unknown parties. | Flag restrictions that block legitimate affiliate transfers needed for the deal process. |\n| Governing Law and Dispute Resolution | State governing law, forum, arbitration provisions, and submission to jurisdiction. Flag unfamiliar law, asymmetric process, inconvenient forum, or missing service provisions. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." + "skill_md": "# NDA Review\n\n## Instructions\n\nReview the uploaded non-disclosure agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High - confidential information definition is too narrow\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to another party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Definition of Confidential Information | Medium - Clause [x] covers broad categories of information but does not clearly address oral disclosures. The general definition point and the disclosing-party checklist point indicate a protection gap. | For the disclosing party, add oral and visual disclosures and require written confirmation within a defined period. |\n| Drafting Consistency | Medium - Clauses [x] and [y] use inconsistent defined terms or party names. The general drafting point indicates ambiguity that may affect the represented party's rights or obligations. | For the represented party, align the defined terms, party names, numbering, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Disclosing Party or Receiving Party).\n\n| Issue | General | Disclosing Party | Receiving Party |\n| --- | --- | --- | --- |\n| Parties | Identify each party and their role. Confirm whether the NDA is mutual or one-way and that obligations are correctly allocated. Flag missing affiliates, mismatched roles, or obligations inconsistent with the agreed structure. | | |\n| Purpose | Summarize the permitted purpose for which confidential information may be used. | Flag overly broad purpose language that permits use beyond the intended transaction. | Flag unclear or narrow purpose that prevents legitimate use of information in connection with the transaction. |\n| Definition of Confidential Information | Explain what information is protected, including oral, visual, derived, or pre-existing information. | Flag definitions too narrow to protect all disclosed information, or no protection for oral or unmarked information. | Flag definitions overbroad, capturing publicly available information or information not actually sensitive. |\n| Exclusions | Identify standard exclusions such as public domain, independently developed, already known, or third-party received information. | Flag missing standard exclusions that would allow the receiving party to escape obligations too easily. | Flag missing standard exclusions (public domain, independently developed, already known) or exclusions that are too difficult to prove. |\n| Disclosure Obligations | Summarize confidentiality obligations, standard of care, and use or disclosure restrictions. | Flag standards of care too weak to adequately protect the information. | Flag strict liability, vague standards, or obligations higher than own-information standards that expose the receiving party disproportionately. |\n| Permitted Recipients | Identify who may receive confidential information, including affiliates, representatives, advisers, financing sources, or investors. | Flag recipient categories too broad, or no requirement for recipients to be bound by equivalent obligations. | Flag missing adviser, affiliate, or financing source access rights needed to evaluate the transaction. |\n| Recipient Liability | State whether the receiving party is responsible for breaches by permitted recipients. | Flag absence of receiving party responsibility for breaches by permitted recipients. | Flag uncapped liability for actions of recipients outside the party's direct control. |\n| Compelled Disclosure | Summarize disclosure required by law, regulation, court order, stock exchange, or governmental authority. | Flag no notice right, no cooperation obligation, or overly broad compelled disclosure permissions. | Flag overly burdensome notice requirements or obligations to resist disclosure beyond what is practicable. |\n| Term | State the agreement term and the duration of confidentiality obligations. | Flag obligations that expire too soon or unclear continuation of obligations after agreement end. | Flag indefinite obligations or unusually long terms for non-trade-secret information. |\n| Return or Destruction | Summarize return, destruction, retention, and archival copy obligations. | Flag no return obligation or inadequate destruction mechanics. | Flag no carve-out for archival, compliance, backup, or legal retention copies. |\n| Residual Knowledge | Identify whether unaided memory or residual knowledge may be used. | Flag broad residual knowledge rights that could undermine confidentiality protections. | Flag absence of a residual knowledge carve-out that prevents legitimate use of unaided memory. |\n| Non-Solicit / Standstill | Identify non-solicitation, non-circumvention, standstill, exclusivity, or similar restrictions. | Flag absence of non-solicitation or standstill protections where commercially expected. | Flag hidden restrictive covenants, long durations, broad covered persons, or restrictions unrelated to confidentiality. |\n| No Warranty / No Obligation | Summarize disclaimers about accuracy, completeness, warranties, or obligation to proceed. | Flag missing disclaimers that could create liability for the accuracy or completeness of disclosed information. | Flag disclaimers that conflict with fraud or intentional misrepresentation, or that expressly exclude reliance. |\n| Remedies | Identify injunctive relief, equitable remedies, indemnities, liquidated damages, or enforcement provisions. | Flag absence of injunctive relief or inadequate remedies for breach. | Flag automatic injunction language, broad indemnities, or liquidated damages without adequate safeguards. |\n| Assignment | Summarize restrictions on assignment or transfer. | Flag free assignment rights that could transfer obligations to unknown parties. | Flag restrictions that block legitimate affiliate transfers needed for the deal process. |\n| Governing Law and Dispute Resolution | State governing law, forum, arbitration provisions, and submission to jurisdiction. Flag unfamiliar law, asymmetric process, inconvenient forum, or missing service provisions. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." }, { "id": "builtin-proofread", @@ -1753,8 +1750,8 @@ export const SYSTEM_ASSISTANT_WORKFLOWS: { id: string; title: string; skill_md: "skill_md": "# Proofread\n\n## Instructions\n\nReview the uploaded document for drafting quality, internal consistency, and mechanical errors. Focus on issues that a lawyer or reviewer should correct before the document is circulated, signed, or filed.\n\nProduce a concise Markdown table with exactly these columns:\n\n- Severity\n- Category\n- Location\n- Issue\n- Recommended Fix\n\nUse these severity ratings:\n\n- Critical: an inconsistency or drafting error that may materially change rights, obligations, parties, timing, or enforceability.\n- High: an error likely to create ambiguity, negotiation friction, or implementation risk.\n- Medium: a proofreading or consistency issue that should be fixed but is unlikely to change the main legal effect.\n- Low: a minor typo, grammar, formatting, punctuation, or style issue.\n\nReview the document for these categories:\n\n| Category | What to Check |\n| --- | --- |\n| Definitions | Check that defined terms are used consistently, all capitalized defined terms are defined, definitions are not duplicated or conflicting, definitions are not circular, unused definitions are identified, and defined terms match the operative provisions. |\n| Cross-References | Check that clause, section, schedule, exhibit, annex, and document references exist, point to the correct place, use the correct numbering, and remain accurate after any apparent drafting changes. |\n| Internal Consistency | Check for terms, sections, dates, parties, amounts, thresholds, notice periods, conditions, remedies, or obligations that conflict with each other or create inconsistent outcomes. |\n| Parties and Entity Names | Check that party names, entity suffixes, registration details, capacities, addresses, signatory names, and role labels are consistent throughout the document. |\n| Numbers, Dates, and Calculations | Check monetary amounts, percentages, dates, deadlines, time periods, notice periods, interest rates, formulas, schedules, and words-versus-figures consistency. |\n| Grammar and Typos | Check spelling, grammar, punctuation, missing words, duplicate words, repeated phrases, tense, subject-verb agreement, and obvious typographical errors. |\n| Numbering | Check clause numbering, section numbering, sub-clause hierarchy, schedule numbering, exhibit numbering, table numbering, skipped numbers, duplicate numbers, and numbering sequences. If the document has a table of contents, check that clause numbers, headings, and hierarchy are consistent with the table of contents. |\n| Formatting | Check headings, list formatting, indentation, spacing, fonts, emphasis, table formatting, schedule formatting, and inconsistent styles that may affect readability or references. |\n\nFor each issue, include the best available clause, section, page, schedule, or paragraph reference in the **Location** column. If the location is unclear, describe where the issue appears as specifically as possible.\n\nIn the **Issue** column, explain the problem and why it matters. In the **Recommended Fix** column, provide a specific correction or drafting action. Where useful, include replacement wording, but keep it concise. Do not rewrite the whole document. If no material issues are found, provide a short table row stating that no material proofreading issues were identified and note any review limitations.\n\nBefore finalizing, double-check that definitions, cross-references, numbering, formatting, and internal inconsistencies have each been considered separately. If a table of contents is present, verify that the clause numbers and headings in the document match the table of contents. Keep the response focused on actionable corrections." }, { - "id": "builtin-sha-summary", + "id": "builtin-shareholder-agreement-review", "title": "Shareholder Agreement Review", - "skill_md": "# Shareholder Agreement Review\n\n## Instructions\n\nReview the uploaded shareholder agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — drag threshold is too low\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Include annotations such as [1] and [2] in the **Summary** and **Recommended Change** columns to reference the relevant sections of the document. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Drag-Along Rights | High — Clause [x] sets the drag threshold at [x]% and does not include a minimum price protection. The minority-specific checklist point indicates the minority can be forced to sell at an unfavorable price. | For the minority, raise the drag threshold, add a minimum price equal to fair market value, and limit warranties to proceeds received. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the share classes. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, share class definitions, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Majority or Minority).\n\n| Issue | General | Majority | Minority |\n| --- | --- | --- | --- |\n| Parties and Shareholdings | Identify each shareholder, role, share class, percentage holding, and fully diluted position. Flag inconsistent cap table information, missing parties, or unclear beneficial ownership. | | |\n| Share Classes and Rights | Summarize voting rights, dividend rights, liquidation preferences, conversion rights, redemption rights, and class consents. | Flag class consents or voting requirements that effectively give minority approval rights over ordinary decisions. | Flag hidden preference rights, disproportionate majority voting rights, or unfavorable class economics. |\n| Board Composition and Governance | Identify board size, appointment rights, observer rights, quorum, chair, and casting vote. | Flag quorum or deadlock provisions giving minority an effective veto over governance. | Flag entrenched majority appointment rights, casting vote held by a majority nominee, or no observer rights for minority. |\n| Reserved Matters | List matters requiring special majority, unanimity, investor consent, or board consent. | Flag reserved matters requiring minority consent that constrain ordinary business decisions. | Flag absence of meaningful minority veto rights or low-dollar thresholds allowing majority to structure around them. |\n| Pre-emption on New Shares | Summarize pre-emption rights, offer process, timing, exclusions, and carve-outs. | Flag mechanics slowing fundraising or requiring minority consent to issue new shares. | Flag broad carve-outs, short exercise periods, or mechanics permitting dilution without proper notice. |\n| Transfer Restrictions | Summarize lock-ups, prohibited transfers, permitted transfers, and consent requirements. | Flag restrictions preventing majority exit or group reorganisation without minority consent. | Flag absence of lock-up on majority transfers or mechanics allowing majority to exit leaving minority trapped. |\n| Right of First Refusal / Pre-emption on Transfer | Identify trigger, process, pricing, matching rights, and exceptions. | Flag long ROFR processes or pricing mechanics delaying majority exit. | Flag unclear matching rights, long processes excluding minority participation, or exceptions removing minority protections. |\n| Drag-Along Rights | Identify drag threshold, sale conditions, minority protections, and power of attorney. | Flag high drag threshold or conditions preventing majority from executing a sale. | Flag low drag threshold, no minimum price protection, forced warranties beyond proceeds received, or broad power of attorney. |\n| Tag-Along Rights | Identify triggering transfers, eligible holders, and sale terms. | Flag broad tag triggers complicating majority exit. | Flag missing or narrow tag rights, or mechanics allowing majority to exclude minority from exit proceeds. |\n| Anti-Dilution Protections | Identify anti-dilution mechanics, carve-outs, and adjustment triggers. | Flag mechanics punishing founders or majority holders on down-rounds. | Flag absence of anti-dilution protection, full ratchet terms, or unclear carve-outs from adjustment. |\n| Dividend Policy | Summarize dividend rights, preferential dividends, restrictions, and discretion. | Flag mandatory dividend obligations impairing business cash flow or restricting majority discretion. | Flag unclear preferential dividend rights or majority discretion over dividends without minority consent. |\n| Exit and Liquidity | Identify IPO, trade sale, redemption, put/call rights, timelines, and liquidation preferences. | Flag forced exit timelines or investor put rights constraining majority exit strategy. | Flag unclear waterfall on exit, exit rights not applying equally, or no minority participation in liquidity events. |\n| Deadlock | Summarize deadlock definition, escalation, expert determination, shoot-out, and liquidation mechanics. | Flag deadlock provisions giving minority disproportionate leverage or effective veto. | Flag shoot-out rights triggered at low thresholds or mechanics structurally favoring majority. |\n| Non-Compete and Non-Solicitation | Identify who is bound, restricted activities, geography, duration, and carve-outs. | Flag restraints binding the majority entity or overly broad scope applied to the majority group. | Flag broad non-competes restricting the minority's ability to operate independently after exit. |\n| Information Rights | Identify reporting, inspection, management accounts, and confidentiality obligations. | Flag extensive information rights giving minority commercially sensitive operational visibility. | Flag absence of reporting or inspection rights, or inadequate confidentiality obligations on recipients. |\n| Related Party Transactions | Identify approval requirements, disclosure duties, and arm's-length standards. | Flag overly strict conflict controls restricting legitimate majority-group transactions. | Flag weak conflict controls, broad permitted related-party dealings, or no arm's-length enforcement. |\n| Governing Law and Dispute Resolution | State governing law, forum, arbitration, escalation, and interim relief rights. Flag unclear or ambiguous forum or dispute mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." + "skill_md": "# Shareholder Agreement Review\n\n## Instructions\n\nReview the uploaded shareholder agreement and produce a comprehensive table-based legal review from the perspective of the party represented by the user/client. If the user has not already identified which party they represent, ask them to clarify that party before producing the review.\n\nOnce the represented party is clear, provide exactly one Markdown result table. Use one row for each material issue found in the agreement, guided by the review checklist below, and add a final row called **Overall Risk Rating**. The result table must have exactly these columns:\n\n- Issue\n- Summary\n- Recommended Change\n\nUse these risk ratings inside the **Summary** column: Low means standard or minimal concern; Medium means a manageable negotiation concern; High means a material legal, commercial, operational, or enforceability concern requiring negotiation; Critical means a severe issue that may block signing unless resolved. Start each summary with the risk rating, e.g. \"High — drag threshold is too low\".\n\nThe **Summary** column should include only the relevant points from the **General** checklist column and the party-specific checklist column for the represented party, together with clause references where available. Do not include issues that are adverse only to the other party unless they also create risk for the represented party. The **Recommended Change** column must be drafted from the represented party's perspective. Also flag general drafting errors that may affect the represented party, including inconsistent defined terms, inconsistent entity names, cross-reference errors, numbering issues, duplicated provisions, missing schedules, and internal inconsistencies. Keep the response concise and avoid long prose outside the table.\n\n## Result Table Format\n\nUse this result table structure. Cite the relevant clause, section, schedule, or page directly in the **Summary** and **Recommended Change** columns. The example rows are illustrative only; tailor the actual rows to the uploaded agreement and represented party.\n\n| Issue | Summary | Recommended Change |\n| --- | --- | --- |\n| Drag-Along Rights | High — Clause [x] sets the drag threshold at [x]% and does not include a minimum price protection. The minority-specific checklist point indicates the minority can be forced to sell at an unfavorable price. | For the minority, raise the drag threshold, add a minimum price equal to fair market value, and limit warranties to proceeds received. |\n| Drafting Consistency | Medium — Clauses [x] and [y] use inconsistent defined terms for the share classes. The general drafting point indicates ambiguity that may affect the represented party's rights. | For the represented party, align defined terms, share class definitions, and cross-references before signing. |\n\n## Review Checklist\n\nUse this checklist as guidance for what to review and flag. It is not the result-table template and should not be reproduced verbatim. For each checklist issue, consider both the **General** column and the party-specific column for the represented party (Majority or Minority).\n\n| Issue | General | Majority | Minority |\n| --- | --- | --- | --- |\n| Parties and Shareholdings | Identify each shareholder, role, share class, percentage holding, and fully diluted position. Flag inconsistent cap table information, missing parties, or unclear beneficial ownership. | | |\n| Share Classes and Rights | Summarize voting rights, dividend rights, liquidation preferences, conversion rights, redemption rights, and class consents. | Flag class consents or voting requirements that effectively give minority approval rights over ordinary decisions. | Flag hidden preference rights, disproportionate majority voting rights, or unfavorable class economics. |\n| Board Composition and Governance | Identify board size, appointment rights, observer rights, quorum, chair, and casting vote. | Flag quorum or deadlock provisions giving minority an effective veto over governance. | Flag entrenched majority appointment rights, casting vote held by a majority nominee, or no observer rights for minority. |\n| Reserved Matters | List matters requiring special majority, unanimity, investor consent, or board consent. | Flag reserved matters requiring minority consent that constrain ordinary business decisions. | Flag absence of meaningful minority veto rights or low-dollar thresholds allowing majority to structure around them. |\n| Pre-emption on New Shares | Summarize pre-emption rights, offer process, timing, exclusions, and carve-outs. | Flag mechanics slowing fundraising or requiring minority consent to issue new shares. | Flag broad carve-outs, short exercise periods, or mechanics permitting dilution without proper notice. |\n| Transfer Restrictions | Summarize lock-ups, prohibited transfers, permitted transfers, and consent requirements. | Flag restrictions preventing majority exit or group reorganisation without minority consent. | Flag absence of lock-up on majority transfers or mechanics allowing majority to exit leaving minority trapped. |\n| Right of First Refusal / Pre-emption on Transfer | Identify trigger, process, pricing, matching rights, and exceptions. | Flag long ROFR processes or pricing mechanics delaying majority exit. | Flag unclear matching rights, long processes excluding minority participation, or exceptions removing minority protections. |\n| Drag-Along Rights | Identify drag threshold, sale conditions, minority protections, and power of attorney. | Flag high drag threshold or conditions preventing majority from executing a sale. | Flag low drag threshold, no minimum price protection, forced warranties beyond proceeds received, or broad power of attorney. |\n| Tag-Along Rights | Identify triggering transfers, eligible holders, and sale terms. | Flag broad tag triggers complicating majority exit. | Flag missing or narrow tag rights, or mechanics allowing majority to exclude minority from exit proceeds. |\n| Anti-Dilution Protections | Identify anti-dilution mechanics, carve-outs, and adjustment triggers. | Flag mechanics punishing founders or majority holders on down-rounds. | Flag absence of anti-dilution protection, full ratchet terms, or unclear carve-outs from adjustment. |\n| Dividend Policy | Summarize dividend rights, preferential dividends, restrictions, and discretion. | Flag mandatory dividend obligations impairing business cash flow or restricting majority discretion. | Flag unclear preferential dividend rights or majority discretion over dividends without minority consent. |\n| Exit and Liquidity | Identify IPO, trade sale, redemption, put/call rights, timelines, and liquidation preferences. | Flag forced exit timelines or investor put rights constraining majority exit strategy. | Flag unclear waterfall on exit, exit rights not applying equally, or no minority participation in liquidity events. |\n| Deadlock | Summarize deadlock definition, escalation, expert determination, shoot-out, and liquidation mechanics. | Flag deadlock provisions giving minority disproportionate leverage or effective veto. | Flag shoot-out rights triggered at low thresholds or mechanics structurally favoring majority. |\n| Non-Compete and Non-Solicitation | Identify who is bound, restricted activities, geography, duration, and carve-outs. | Flag restraints binding the majority entity or overly broad scope applied to the majority group. | Flag broad non-competes restricting the minority's ability to operate independently after exit. |\n| Information Rights | Identify reporting, inspection, management accounts, and confidentiality obligations. | Flag extensive information rights giving minority commercially sensitive operational visibility. | Flag absence of reporting or inspection rights, or inadequate confidentiality obligations on recipients. |\n| Related Party Transactions | Identify approval requirements, disclosure duties, and arm's-length standards. | Flag overly strict conflict controls restricting legitimate majority-group transactions. | Flag weak conflict controls, broad permitted related-party dealings, or no arm's-length enforcement. |\n| Governing Law and Dispute Resolution | State governing law, forum, arbitration, escalation, and interim relief rights. Flag unclear or ambiguous forum or dispute mechanics. | | |\n\nDeliver the review inline in your chat response. Do not generate a downloadable Word document unless the user explicitly asks for one." } ]; diff --git a/frontend/public/icons/app-sidebar/library.svg b/frontend/public/icons/app-sidebar/library.svg index e68ea92..067637b 100644 --- a/frontend/public/icons/app-sidebar/library.svg +++ b/frontend/public/icons/app-sidebar/library.svg @@ -44,13 +44,10 @@ - - - - + @@ -62,7 +59,7 @@ - + @@ -74,7 +71,7 @@ - + @@ -86,7 +83,7 @@ - + diff --git a/frontend/src/app/components/assistant/message/MarkdownContent.tsx b/frontend/src/app/components/assistant/message/MarkdownContent.tsx index da605aa..c3af80f 100644 --- a/frontend/src/app/components/assistant/message/MarkdownContent.tsx +++ b/frontend/src/app/components/assistant/message/MarkdownContent.tsx @@ -110,6 +110,18 @@ export function MarkdownContent({ {...withoutMarkdownNode(props)} /> ), + h5: (props) => ( +
+ ), + h6: (props) => ( +
+ ), p: ({ node, ...props }) => { const parent = node && typeof node === "object" && "parent" in node @@ -275,4 +287,3 @@ export function MarkdownContent({ ); } - diff --git a/frontend/src/app/components/assistant/message/useSmoothedReveal.ts b/frontend/src/app/components/assistant/message/useSmoothedReveal.ts index 13bbda0..bfcc527 100644 --- a/frontend/src/app/components/assistant/message/useSmoothedReveal.ts +++ b/frontend/src/app/components/assistant/message/useSmoothedReveal.ts @@ -55,6 +55,11 @@ export function useSmoothedReveal(text: string, active: boolean): string { }; }, [text.length, active]); + // Once the stream ends, render the authoritative text immediately. The + // effect above keeps the animation cursor in sync, but updating a ref does + // not trigger a render; slicing with the last animated state here could + // otherwise leave the final few characters permanently hidden. + if (!active) return text; + return text.slice(0, Math.min(revealedInt, text.length)); } - diff --git a/frontend/src/app/components/workflows/NewWorkflowModal.tsx b/frontend/src/app/components/workflows/NewWorkflowModal.tsx index 8f7a955..fe19263 100644 --- a/frontend/src/app/components/workflows/NewWorkflowModal.tsx +++ b/frontend/src/app/components/workflows/NewWorkflowModal.tsx @@ -164,14 +164,33 @@ interface Props { onClose: () => void; onCreated: (workflow: Workflow) => void; editWorkflow?: Workflow; + readOnly?: boolean; onUpdated?: (workflow: Workflow) => void; } +function getWorkflowSourceLabel(workflow: Workflow) { + if (workflow.is_system) return "System"; + if (workflow.is_owner === false) { + return workflow.shared_by_name?.trim() || "Shared"; + } + return "User"; +} + +const OPEN_SOURCE_STATUS_LABELS: Record< + NonNullable["status"], + string +> = { + pending: "Pending review", + approved: "Approved", + rejected: "Rejected", +}; + export function NewWorkflowModal({ open, onClose, onCreated, editWorkflow, + readOnly = false, onUpdated, }: Props) { const [title, setTitle] = useState(""); @@ -199,6 +218,41 @@ export function NewWorkflowModal({ const markdownInputRef = useRef(null); const isEditing = !!editWorkflow; + const viewOnly = isEditing && readOnly; + const workflowDetails = editWorkflow + ? [ + { + label: "Type", + value: + editWorkflow.metadata.type === "tabular" + ? "Tabular" + : "Assistant", + }, + { + label: "Source", + value: getWorkflowSourceLabel(editWorkflow), + }, + ...(editWorkflow.metadata.version + ? [ + { + label: "Version", + value: editWorkflow.metadata.version, + }, + ] + : []), + ...(editWorkflow.open_source_submission + ? [ + { + label: "Open source", + value: + OPEN_SOURCE_STATUS_LABELS[ + editWorkflow.open_source_submission.status + ], + }, + ] + : []), + ] + : []; const isOtherLanguage = language === "Other"; const isOtherPractice = practice === "Other"; const isOtherJurisdiction = jurisdiction === "Other"; @@ -332,6 +386,7 @@ export function NewWorkflowModal({ async function handleSubmit(e: React.FormEvent) { e.preventDefault(); + if (viewOnly) return; if (!title.trim()) return; setLoading(true); setError(""); @@ -417,20 +472,24 @@ export function NewWorkflowModal({ onClose={handleClose} breadcrumbs={[ "Workflows", - isEditing ? "Edit workflow" : "New workflow", + isEditing ? "View and Edit details" : "New workflow", ]} - primaryAction={{ - label: loading - ? isEditing - ? "Saving…" - : "Creating…" - : isEditing - ? "Save changes" - : "Create workflow", - type: "submit", - form: formId, - disabled: !title.trim() || loading, - }} + primaryAction={ + viewOnly + ? undefined + : { + label: loading + ? isEditing + ? "Saving…" + : "Creating…" + : isEditing + ? "Save changes" + : "Create workflow", + type: "submit", + form: formId, + disabled: !title.trim() || loading, + } + } secondaryAction={ !isEditing && type === "assistant" ? { @@ -445,9 +504,23 @@ export function NewWorkflowModal({
+ {workflowDetails.length > 0 && ( +
+ {workflowDetails.map((detail) => ( +
+
+ {detail.label} +
+
+ {detail.value} +
+
+ ))} +
+ )}
Title @@ -459,7 +532,8 @@ export function NewWorkflowModal({ onChange={(e) => setTitle(e.target.value)} placeholder="Add workflow name" variant="minimal" - autoFocus + disabled={viewOnly} + autoFocus={!viewOnly} />
@@ -494,6 +568,7 @@ export function NewWorkflowModal({ id="workflow-language" value={language} options={languageOptions} + disabled={viewOnly} open={openDropdown === "language"} onOpenChange={(nextOpen) => setOpenDropdown((current) => @@ -517,6 +592,7 @@ export function NewWorkflowModal({ ref={customLanguageInputRef} type="text" value={customLanguage} + disabled={viewOnly} onChange={(e) => setCustomLanguage(e.target.value) } @@ -534,6 +610,7 @@ export function NewWorkflowModal({ id="workflow-practice" value={practice} options={PRACTICE_OPTIONS} + disabled={viewOnly} open={openDropdown === "practice"} onOpenChange={(nextOpen) => setOpenDropdown((current) => @@ -557,6 +634,7 @@ export function NewWorkflowModal({ ref={customInputRef} type="text" value={customPractice} + disabled={viewOnly} onChange={(e) => setCustomPractice(e.target.value) } @@ -575,6 +653,7 @@ export function NewWorkflowModal({ id="workflow-jurisdiction" value={jurisdiction} options={jurisdictionOptions} + disabled={viewOnly} open={openDropdown === "jurisdiction"} onOpenChange={(nextOpen) => setOpenDropdown((current) => @@ -600,6 +679,7 @@ export function NewWorkflowModal({ className="mt-2" value={jurisdictionRegion} options={jurisdictionRegionOptions} + disabled={viewOnly} placeholder={ jurisdiction === "United States" ? "Select state..." @@ -626,6 +706,7 @@ export function NewWorkflowModal({ ref={customJurisdictionInputRef} type="text" value={customJurisdiction} + disabled={viewOnly} onChange={(e) => setCustomJurisdiction(e.target.value) } diff --git a/frontend/src/app/components/workflows/WorkflowDetailPage.tsx b/frontend/src/app/components/workflows/WorkflowDetailPage.tsx index d80b1fd..15827db 100644 --- a/frontend/src/app/components/workflows/WorkflowDetailPage.tsx +++ b/frontend/src/app/components/workflows/WorkflowDetailPage.tsx @@ -47,8 +47,25 @@ import { PeopleModal } from "@/app/components/modals/PeopleModal"; import { OpenSourceWorkflowModal } from "@/app/components/workflows/OpenSourceWorkflowModal"; import { PageHeader } from "@/app/components/shared/PageHeader"; import { PillButton } from "@/app/components/ui/pill-button"; +import { TabPillButton } from "@/app/components/ui/tab-pill-button"; +import { LIQUID_TABLE_SURFACE_CLASS } from "@/app/components/ui/liquid-surface"; import { NewWorkflowModal } from "@/app/components/workflows/NewWorkflowModal"; import { TabularReviewSkeuoIcon } from "@/app/components/shared/AppSidebarSkeuoIcons"; +import { + TABLE_CHECKBOX_CLASS, + SkeletonDot, + SkeletonLine, + TableBody, + TableCell, + TableEmptyState, + TableHeaderCell, + TableHeaderRow, + TablePrimaryCell, + TableRow, + TableScrollArea, + TableStickyCell, +} from "@/app/components/shared/TablePrimitive"; +import { TableToolbar } from "@/app/components/shared/TableToolbar"; import { useAuth } from "@/app/contexts/AuthContext"; import { useUserProfile } from "@/app/contexts/UserProfileContext"; import { downloadWorkflowZip } from "./workflowZipExport"; @@ -71,7 +88,6 @@ type DeleteStatus = "idle" | "loading" | "complete"; type WorkflowShare = Awaited>[number]; const NAME_COL_W = "w-[332px] shrink-0"; -const CHECKBOX_GUTTER = "h-2.5 w-2.5 shrink-0"; const WORKFLOW_CONTRIBUTIONS_ENABLED = process.env.NEXT_PUBLIC_WORKFLOW_CONTRIBUTIONS_ENABLED === "true"; @@ -82,8 +98,6 @@ export function WorkflowDetailPage({ id, workflowType }: Props) { const router = useRouter(); const { user } = useAuth(); const { profile } = useUserProfile(); - const stickyCellBg = "bg-[#fafbfc]"; - const [workflow, setWorkflow] = useState(null); const [loading, setLoading] = useState(true); const [notFound, setNotFound] = useState(false); @@ -308,6 +322,16 @@ export function WorkflowDetailPage({ id, workflowType }: Props) { setAddColumnOpen(false); } + function handleDeleteSelectedColumns() { + const next = columns + .filter((column) => !selectedColIndices.includes(column.index)) + .map((column, index) => ({ ...column, index })); + setColumns(next); + saveColumns(next); + setSelectedColIndices([]); + setColActionsOpen(false); + } + function handleColumnSaved(updated: ColumnConfig) { const next = columns.map((c) => c.index === updated.index ? updated : c, @@ -335,7 +359,6 @@ export function WorkflowDetailPage({ id, workflowType }: Props) { ]} />
- {workflowType === "tabular" ? ( ) : ( @@ -364,15 +387,14 @@ export function WorkflowDetailPage({ id, workflowType }: Props) { icon: Download, onSelect: () => downloadWorkflowZip(workflow, promptMd, columns), }, + { + label: "View and Edit details", + icon: Pencil, + onSelect: () => setDetailsOpen(true), + }, ]; if (!readOnly) { - workflowActionItems.push({ - label: "Edit details", - icon: Pencil, - onSelect: () => setDetailsOpen(true), - }); - if (canOpenSource) { workflowActionItems.push({ label: "Open source this", @@ -467,6 +489,7 @@ export function WorkflowDetailPage({ id, workflowType }: Props) { setDetailsOpen(false)} onCreated={() => undefined} onUpdated={(updated) => { @@ -537,12 +560,9 @@ export function WorkflowDetailPage({ id, workflowType }: Props) { {/* Body */}
- {/* Metadata */} - - {workflow.metadata.type === "assistant" ? ( /* ── Assistant: WYSIWYG editor ── */ -
+
- {/* Toolbar */} {!readOnly && ( -
- {visibleColumns.length > 0 && - selectedColIndices.length > 0 && ( -
- +
+ )} +
+ + Delete + + + )} + + setAddColumnOpen(true) + } > - Actions - - - {colActionsOpen && ( -
- -
- )} + + Add Column +
- )} - {(visibleColumns.length === 0 || - selectedColIndices.length === 0) && ( -
+ } + /> )} {readOnly && (
@@ -606,36 +637,63 @@ export function WorkflowDetailPage({ id, workflowType }: Props) {
)} -
-
- {/* Table header */} -
-
- {visibleColumns.length > 0 ? ( - { if (el) el.indeterminate = selectedColIndices.length > 0 && selectedColIndices.length < visibleColumns.length; }} - onChange={() => setSelectedColIndices(selectedColIndices.length === visibleColumns.length ? [] : visibleColumns.map((c) => c.index))} - className={`${CHECKBOX_GUTTER} rounded border-gray-200 cursor-pointer accent-black`} - /> - ) : ( -
-
Format
-
Prompt
- {!readOnly &&
} -
- - {/* Rows */} -
+ + + {visibleColumns.length > 0 ? ( + { + if (el) + el.indeterminate = + selectedColIndices.length > + 0 && + selectedColIndices.length < + visibleColumns.length; + }} + onChange={() => + setSelectedColIndices( + selectedColIndices.length === + visibleColumns.length + ? [] + : visibleColumns.map( + (column) => + column.index, + ), + ) + } + className={TABLE_CHECKBOX_CLASS} + /> + ) : ( + + + Format + + + Prompt + + {!readOnly && ( + + )} + + } + > {visibleColumns.length === 0 ? ( -
+

Columns @@ -654,68 +712,100 @@ export function WorkflowDetailPage({ id, workflowType }: Props) { Add Column )} -

+ ) : ( - visibleColumns.map((col) => { - const FormatIcon = formatIcon(col.format ?? "text"); - const isChecked = selectedColIndices.includes(col.index); - return ( -
readOnly ? setViewingColumn(col) : setEditingColumn(col)} - className="group flex items-center h-10 pr-3 md:pr-10 border-b border-gray-50 hover:bg-gray-100/70 cursor-pointer transition-colors" - > -
-
- setSelectedColIndices((prev) => prev.includes(col.index) ? prev.filter((i) => i !== col.index) : [...prev, col.index])} - onClick={(e) => e.stopPropagation()} - className={`${CHECKBOX_GUTTER} rounded border-gray-200 cursor-pointer accent-black`} - /> - - {col.name} + + {visibleColumns.map((col) => { + const FormatIcon = formatIcon( + col.format ?? "text", + ); + const isChecked = + selectedColIndices.includes( + col.index, + ); + return ( + + readOnly + ? setViewingColumn(col) + : setEditingColumn(col) + } + className="md:pr-10" + > + + setSelectedColIndices( + (previous) => + previous.includes( + col.index, + ) + ? previous.filter( + (index) => + index !== + col.index, + ) + : [ + ...previous, + col.index, + ], + ) + } + label={col.name} + /> + + + + {formatLabel( + col.format ?? + "text", + )} -
-
-
- - - {formatLabel(col.format ?? "text")} - -
-
- + + {col.prompt} - -
- {!readOnly && ( -
- -
- )} -
- ); - }) + + {!readOnly && ( +
+ +
+ )} + + ); + })} + )} -
-
-
+
)}
@@ -753,81 +843,12 @@ export function WorkflowDetailPage({ id, workflowType }: Props) { ); } -function WorkflowMetadata({ workflow }: { workflow: Workflow }) { - const fields: { label: string; value: string }[] = [ - { label: "Type", value: workflow.metadata.type === "tabular" ? "Tabular" : "Assistant" }, - { label: "Source", value: getWorkflowSourceLabel(workflow) }, - ]; - if (workflow.metadata.language) fields.push({ label: "Language", value: workflow.metadata.language }); - if (workflow.metadata.version) fields.push({ label: "Version", value: workflow.metadata.version }); - if (workflow.metadata.practice) fields.push({ label: "Practice", value: workflow.metadata.practice }); - if (workflow.metadata.jurisdictions?.length) { - fields.push({ label: "Jurisdiction", value: workflow.metadata.jurisdictions.join(", ") }); - } - if (workflow.open_source_submission) { - const statusLabels: Record< - NonNullable["status"], - string - > = { - pending: "Pending review", - approved: "Approved", - rejected: "Rejected", - }; - fields.push({ - label: "Open source", - value: statusLabels[workflow.open_source_submission.status], - }); - } - - return ( -
- {fields.map(({ label, value }) => ( -
- {label} - {value} -
- ))} -
- ); -} - -function WorkflowMetadataSkeleton() { - const fields = [ - { labelWidth: "w-8", valueWidth: "w-16" }, - { labelWidth: "w-10", valueWidth: "w-14" }, - { labelWidth: "w-12", valueWidth: "w-20" }, - { labelWidth: "w-10", valueWidth: "w-12" }, - { labelWidth: "w-12", valueWidth: "w-24" }, - ]; - - return ( -
- {fields.map((field, index) => ( -
-
-
-
- ))} -
- ); -} - -function getWorkflowSourceLabel(workflow: Workflow) { - if (workflow.is_system) return "System"; - if (workflow.is_owner === false) { - return workflow.shared_by_name?.trim() || "Shared"; - } - return "User"; -} - function AssistantWorkflowEditorSkeleton() { return ( -
-
+
+
@@ -851,60 +872,68 @@ function AssistantWorkflowEditorSkeleton() { } function TabularWorkflowEditorSkeleton() { + const titleWidths = ["w-36", "w-44", "w-40", "w-52", "w-48"]; + const promptWidths = ["w-64", "w-80", "w-72", "w-96", "w-60"]; + return (
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
- -
- {[1, 2, 3, 4, 5].map((i) => ( -
-
+ } + /> + + -
-
-
-
-
-
-
-
-
-
-
- ))} -
+ + + + + + + + + + + + } + > + + {[1, 2, 3, 4, 5].map((i) => ( + + +
+ + +
+
+ + + + + + + +
+ ))} +
+
); } diff --git a/frontend/src/app/components/workflows/WorkflowPromptEditor.tsx b/frontend/src/app/components/workflows/WorkflowPromptEditor.tsx index 1b33ff8..2e6f004 100644 --- a/frontend/src/app/components/workflows/WorkflowPromptEditor.tsx +++ b/frontend/src/app/components/workflows/WorkflowPromptEditor.tsx @@ -17,6 +17,7 @@ import { Table2, } from "lucide-react"; import { Button } from "@/app/components/ui/button"; +import { LIQUID_TABLE_SURFACE_CLASS } from "@/app/components/ui/liquid-surface"; interface Props { value: string; @@ -352,14 +353,10 @@ export function WorkflowPromptEditor({ return (
{!readOnly && editor && ( -
+
rawMode @@ -558,7 +555,7 @@ export function WorkflowPromptEditor({
)} {readOnly && ( -
+
Read-only @@ -591,7 +588,7 @@ export function WorkflowPromptEditor({ } readOnly={readOnly} spellCheck={false} - className="h-full min-h-full w-full resize-none bg-white px-5 py-4 font-mono text-xs leading-6 text-gray-800 outline-none placeholder:text-gray-400 read-only:cursor-default" + className="h-full min-h-full w-full resize-none bg-transparent px-5 py-4 font-mono text-xs leading-6 text-gray-800 outline-none placeholder:text-gray-400 read-only:cursor-default" aria-label="Raw Markdown" /> ) : ( diff --git a/frontend/src/app/hooks/useAssistantChat.ts b/frontend/src/app/hooks/useAssistantChat.ts index 62a0085..6de162f 100644 --- a/frontend/src/app/hooks/useAssistantChat.ts +++ b/frontend/src/app/hooks/useAssistantChat.ts @@ -380,11 +380,16 @@ export function useAssistantChat({ while (true) { const { done, value } = await reader.read(); - if (done) break; - - buffer += decoder.decode(value, { stream: true }); + if (done) { + // Flush any bytes still held by TextDecoder. A response is allowed + // to close without a final newline, so the remaining buffer must be + // parsed as the last SSE record instead of being discarded. + buffer += decoder.decode(); + } else { + buffer += decoder.decode(value, { stream: true }); + } const lines = buffer.split("\n"); - buffer = lines.pop() || ""; + buffer = done ? "" : lines.pop() || ""; for (const line of lines) { const trimmed = line.trim(); @@ -1181,6 +1186,8 @@ export function useAssistantChat({ ); } } + + if (done) break; } finalizeStreamingReasoning(); diff --git a/scripts/build-workflows.js b/scripts/build-workflows.js index f4fc14c..d739c94 100644 --- a/scripts/build-workflows.js +++ b/scripts/build-workflows.js @@ -6,7 +6,10 @@ const path = require("path"); const ROOT_DIR = path.resolve(__dirname, ".."); const WORKSPACE_DIR = path.resolve(ROOT_DIR, ".."); const WORKFLOWS_DIR = path.join(WORKSPACE_DIR, "mike-workflows"); -const SYSTEM_WORKFLOWS_DIR = path.join(WORKFLOWS_DIR, "system"); +const WORKFLOW_COLLECTIONS = [ + { directory: "assistant-workflows", type: "assistant" }, + { directory: "tabular-review-workflows", type: "tabular" }, +]; const BACKEND_OUT = path.join(ROOT_DIR, "backend/src/lib/systemWorkflows.ts"); const LANDING_OUT = path.join(ROOT_DIR, "landing/app/generated-workflows.ts"); @@ -75,6 +78,7 @@ function parseSimpleYaml(source, label) { const scalarItems = []; const objectItems = []; + const properties = {}; let mode = null; i++; for (; i < lines.length; i++) { @@ -116,6 +120,19 @@ function parseSimpleYaml(source, label) { continue; } + const childPropMatch = child.match(/^ ([A-Za-z_][A-Za-z0-9_-]*):(.*)$/); + if (childPropMatch) { + mode ??= "properties"; + if (mode !== "properties") { + fail(`${label}.${key} mixes mapping and list values`); + } + properties[childPropMatch[1]] = parseScalar( + childPropMatch[2], + `${label}.${key}.${childPropMatch[1]}`, + ); + continue; + } + const propMatch = child.match(/^ ([A-Za-z_][A-Za-z0-9_-]*):(.*)$/); if (!propMatch || mode !== "objects" || objectItems.length === 0) { fail(`${label}:${i + 1} has unsupported frontmatter structure`); @@ -126,7 +143,12 @@ function parseSimpleYaml(source, label) { ); } - result[key] = mode === "objects" ? objectItems : scalarItems; + result[key] = + mode === "objects" + ? objectItems + : mode === "properties" + ? properties + : scalarItems; } return result; @@ -152,7 +174,7 @@ function readSkillFile(filePath) { }; } -function parseTableConfigYaml(filePath) { +function parseTableColumnsYaml(filePath) { const lines = readText(filePath).replace(/\r\n/g, "\n").split("\n"); const result = { columns_config: [] }; let i = 0; @@ -171,8 +193,8 @@ function parseTableConfigYaml(filePath) { continue; } - if (line !== "columns_config:") { - fail(`${relative(filePath)}:${i + 1} is not valid table config YAML`); + if (line !== "columns:") { + fail(`${relative(filePath)}:${i + 1} is not valid table columns YAML`); } i++; break; @@ -300,9 +322,8 @@ function assertColumnConfig(columns, label) { }); } -function readWorkflow(category, dirent) { - const slug = dirent.name; - const workflowDir = path.join(SYSTEM_WORKFLOWS_DIR, category, slug); +function readWorkflow(category, workflowDir) { + const slug = path.basename(workflowDir); const metadataPath = path.join(workflowDir, "metadata.json"); if (fs.existsSync(metadataPath)) { fail(`${relative(metadataPath)} is no longer supported; use SKILL.md frontmatter`); @@ -311,103 +332,93 @@ function readWorkflow(category, dirent) { if (!fs.existsSync(skillPath)) { fail(`${relative(skillPath)} is required`); } - const { metadata, body: skillMd, fullText: sourceSkillMd } = readSkillFile(skillPath); + const { metadata: frontmatter, body: skillMd, fullText: sourceSkillMd } = + readSkillFile(skillPath); const label = `${relative(skillPath)} frontmatter`; + const metadata = frontmatter.metadata; const id = `builtin-${slug}`; - if (metadata.id !== undefined) { - fail(`${label}.id is not supported; the ID is generated from the directory name`); - } - if (metadata.$schema !== undefined) { - fail(`${label}.$schema is not supported in SKILL.md frontmatter`); - } - if (metadata.title !== undefined) { - fail(`${label}.title is not supported; use name`); - } - if (metadata.order !== undefined) { - fail(`${label}.order is not supported`); - } - assertString(metadata.name, `${label}.name`); - if (metadata.name !== slug) { + assertString(frontmatter.name, `${label}.name`); + if (frontmatter.name !== slug) { fail(`${label}.name must match the folder name "${slug}"`); } - assertString(metadata.display_name, `${label}.display_name`); - assertString(metadata.description, `${label}.description`); - const contributors = normalizeContributors( - metadata.contributors, - `${label}.contributors`, - ); + assertString(frontmatter.description, `${label}.description`); + assertString(frontmatter.license, `${label}.license`); + if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) { + fail(`${label}.metadata must be a mapping`); + } + assertString(metadata.author, `${label}.metadata.author`); assertString(metadata.language, `${label}.language`); assertString(metadata.version, `${label}.version`); - if (metadata.type !== category) { - fail(`${label}.type must be "${category}"`); + assertString(metadata["mike-display-name"], `${label}.metadata.mike-display-name`); + if (metadata["mike-type"] !== category) { + fail(`${label}.metadata.mike-type must be "${category}"`); } - if (metadata.category !== undefined) { - fail(`${label}.category is not supported`); + if (!["system", "add-on"].includes(metadata["mike-availability"])) { + fail(`${label}.metadata.mike-availability must be "system" or "add-on"`); } - if (metadata.action !== undefined) { - fail(`${label}.action is not supported`); - } - assertOptionalString(metadata.practice, `${label}.practice`); - assertOptionalStringArray(metadata.jurisdictions, `${label}.jurisdictions`); + assertString(metadata.practice, `${label}.metadata.practice`); + assertString(metadata.jurisdictions, `${label}.metadata.jurisdictions`); + + const normalizedMetadata = { + title: metadata["mike-display-name"], + description: frontmatter.description, + type: metadata["mike-type"], + contributors: [ + { + name: metadata.author.trim(), + organisation: null, + role: null, + linkedin: null, + }, + ], + language: metadata.language, + version: metadata.version, + practice: metadata.practice, + jurisdictions: metadata.jurisdictions + .split(",") + .map((item) => item.trim()) + .filter(Boolean), + }; if (category === "assistant") { if (!skillMd.trim()) { fail(`${relative(skillPath)} must include instructions after frontmatter`); } - const tableConfigPath = path.join(workflowDir, "table-config.yaml"); - if (fs.existsSync(tableConfigPath)) { - fail(`${relative(tableConfigPath)} is only supported for tabular workflows`); + const tableColumnsPath = path.join(workflowDir, "table-columns.yaml"); + if (fs.existsSync(tableColumnsPath)) { + fail(`${relative(tableColumnsPath)} is only supported for tabular workflows`); } return { id, - metadata: { - title: metadata.display_name, - description: metadata.description, - type: metadata.type, - contributors, - language: metadata.language, - version: metadata.version, - practice: metadata.practice ?? null, - jurisdictions: metadata.jurisdictions ?? null, - }, + availability: metadata["mike-availability"], + metadata: normalizedMetadata, skill_md: skillMd, source_skill_md: sourceSkillMd, columns_config: null, }; } - if (metadata.columns_config !== undefined) { - fail(`${label}.columns_config is not supported; use table-config.yaml`); + const tableColumnsPath = path.join(workflowDir, "table-columns.yaml"); + if (!fs.existsSync(tableColumnsPath)) { + fail(`${relative(tableColumnsPath)} is required for tabular workflows`); } - const legacyTableConfigPath = path.join(workflowDir, "table-config.json"); - if (fs.existsSync(legacyTableConfigPath)) { - fail(`${relative(legacyTableConfigPath)} is no longer supported; use table-config.yaml`); - } - const tableConfigPath = path.join(workflowDir, "table-config.yaml"); - if (!fs.existsSync(tableConfigPath)) { - fail(`${relative(tableConfigPath)} is required for tabular workflows`); - } - const tableConfig = parseTableConfigYaml(tableConfigPath); - const tableConfigLabel = relative(tableConfigPath); - const expectedTableConfigSchema = "../../../schema/table-config.schema.yaml"; - if (tableConfig.$schema !== expectedTableConfigSchema) { - fail(`${tableConfigLabel}.$schema must be "${expectedTableConfigSchema}"`); + const tableConfig = parseTableColumnsYaml(tableColumnsPath); + const tableConfigLabel = relative(tableColumnsPath); + const expectedSchemaPath = path.join( + WORKFLOWS_DIR, + "workflow-schema/table-columns.schema.yaml", + ); + const actualSchemaPath = path.resolve(workflowDir, tableConfig.$schema ?? ""); + if (actualSchemaPath !== expectedSchemaPath) { + fail(`${tableConfigLabel}.$schema must point to workflow-schema/table-columns.schema.yaml`); } assertColumnConfig(tableConfig.columns_config, tableConfigLabel); return { id, - metadata: { - title: metadata.display_name, - description: metadata.description, - type: metadata.type, - contributors, - language: metadata.language, - version: metadata.version, - practice: metadata.practice ?? null, - jurisdictions: metadata.jurisdictions ?? null, - }, + availability: metadata["mike-availability"], + metadata: normalizedMetadata, skill_md: skillMd || null, source_skill_md: sourceSkillMd, columns_config: tableConfig.columns_config, @@ -418,17 +429,30 @@ function loadWorkflows() { const workflows = []; const seenIds = new Set(); - for (const category of ["assistant", "tabular"]) { - const categoryDir = path.join(SYSTEM_WORKFLOWS_DIR, category); - if (!fs.existsSync(categoryDir)) continue; + for (const collection of WORKFLOW_COLLECTIONS) { + const collectionDir = path.join(WORKFLOWS_DIR, collection.directory); + if (!fs.existsSync(collectionDir)) continue; + const workflowDirs = fs + .readdirSync(collectionDir, { withFileTypes: true }) + .filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")) + .flatMap((entry) => { + const entryDir = path.join(collectionDir, entry.name); + if (fs.existsSync(path.join(entryDir, "SKILL.md"))) return [entryDir]; + if (!fs.existsSync(path.join(entryDir, "pack.json"))) return []; + return fs + .readdirSync(entryDir, { withFileTypes: true }) + .filter( + (child) => + child.isDirectory() && + fs.existsSync(path.join(entryDir, child.name, "SKILL.md")), + ) + .map((child) => path.join(entryDir, child.name)); + }) + .sort((a, b) => a.localeCompare(b)); - const entries = fs - .readdirSync(categoryDir, { withFileTypes: true }) - .filter((dirent) => dirent.isDirectory() && !dirent.name.startsWith(".")) - .sort((a, b) => a.name.localeCompare(b.name)); - - for (const entry of entries) { - const workflow = readWorkflow(category, entry); + for (const workflowDir of workflowDirs) { + const workflow = readWorkflow(collection.type, workflowDir); + if (workflow.availability !== "system") continue; if (seenIds.has(workflow.id)) { fail(`Duplicate workflow id: ${workflow.id}`); } @@ -483,8 +507,11 @@ function main() { if (!fs.existsSync(WORKFLOWS_DIR)) { fail(`Workflow source directory not found: ${relative(WORKFLOWS_DIR)}`); } - if (!fs.existsSync(SYSTEM_WORKFLOWS_DIR)) { - fail(`System workflow source directory not found: ${relative(SYSTEM_WORKFLOWS_DIR)}`); + for (const collection of WORKFLOW_COLLECTIONS) { + const collectionDir = path.join(WORKFLOWS_DIR, collection.directory); + if (!fs.existsSync(collectionDir)) { + fail(`Workflow collection not found: ${relative(collectionDir)}`); + } } const workflows = loadWorkflows();