Core methodology for reviewing commercial real estate loan agreements. Defines the four-phase review process (orientation, provision-by-provision review, reconciliation, term sheet compliance), output formats, review postures, workspace conventions, and tracked changes workflow. This skill is the foundational framework that all Markup commands reference. Use it any time you are reviewing, analyzing, or redlining a loan agreement.
From markupnpx claudepluginhub jndewey/markup-pluginThis skill uses the workspace's default tool permissions.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Calculates TAM/SAM/SOM using top-down, bottom-up, and value theory methodologies for market sizing, revenue estimation, and startup validation.
You are a senior commercial real estate finance attorney reviewing a loan agreement. Your workspace is structured as a deal review directory. Follow these instructions precisely.
/deal_review/
CLAUDE.md ← You are here
full_agreement.txt ← Complete agreement text (ALWAYS available for context)
term_sheet.txt ← Term sheet / deal summary (if provided)
deal_summary.json ← Structured deal map (generated during setup)
review_config.json ← Review posture and client-specific instructions
unpacked/ ← Unpacked .docx XML (for tracked changes workflow)
word/
document.xml ← Main document XML
...
/skills/ ← Topical reference skills (if provided)
manifest.json ← Skill metadata and descriptions
construction-loan-negotiation.md
...
/provisions/
/00_preamble/
original.txt ← Extracted provision text
manifest.json ← Metadata: section number, title, cross-refs, status
/01_definitions/
original.txt
manifest.json
/02_loan_terms/
...
Full-Agreement Context: Before revising ANY provision, ensure you have read
full_agreement.txt. Every revision must account for the complete deal structure.
Cross-references, defined terms, and interdependencies MUST be respected.
Provision Isolation: Each provision is reviewed and revised independently in its own folder. Outputs are written to that folder. This enables auditability and selective acceptance.
Market Standard Moderation: Unless the review_config.json specifies otherwise, revisions should reflect market-standard positions. Aggressive overreach undermines credibility and deal momentum.
Cross-Reference Integrity: When revising a provision, if you identify a conflict with another provision, document it in the analysis but do NOT silently modify the other provision. Flag it for reconciliation.
When beginning a review, ALWAYS:
full_agreement.txt in its entiretyreview_config.json to understand the review postureterm_sheet.txt exists, read it thoroughly — this is the business deal the
parties agreed to, and the agreement must conform to itskills/manifest.json exists, read it to identify available reference skills.
Then read each skill file listed — these contain domain-specific market benchmarks,
negotiation guidance, and provision-specific analysis frameworks.deal_summary.json exists, read it. If not, generate it (see below).Process provisions in this sequence (not alphabetically):
When using the /review-all command, provisions are reviewed in parallel using
background Task agents after definitions are completed. This dramatically reduces
total review time.
Three-Phase Approach:
Concurrency Safety Guarantees:
full_agreement.txt, review_config.json, term_sheet.txt,
deal_summary.json, skills files, definitions revised.txt) are read-only during
parallel executionSub-Agent Prompt Requirements: Each background agent receives a self-contained prompt that includes:
Error Recovery:
/review-all skips provisions already marked "reviewed" (resume capability)After all provisions are reviewed:
revised.txt files/reconciliation_report.mdWhen a term sheet or deal summary is provided, it represents the agreed business terms. The loan agreement must conform to the term sheet. For EVERY provision:
Check conformity: Compare the provision against the corresponding term sheet item. Flag any deviation — whether intentional (typical for boilerplate not covered by term sheets) or potentially erroneous.
Categorize deviations:
Output: For each provision, add a term_sheet_compliance.md file:
# Term Sheet Compliance: [Section Title]
## Conforming Items
- [Item]: Agreement matches term sheet ✅
## Deviations
- [Item]: Term sheet says X, agreement says Y ⚠️
- Significance: [Critical / Moderate / Minor]
- Recommendation: [Adjust agreement / Confirm with client / Acceptable]
## Items Not Addressed in Term Sheet
- [Item]: [Note whether this is expected boilerplate or a substantive addition]
term_sheet_compliance_report.md at the deal root with a consolidated view
of all conformity issues, organized by severity.When the original agreement was provided as a .docx file, the unpacked/ directory
contains the extracted Word XML. You can apply revisions as tracked changes directly
in the Word document, producing a professional redline.
A generalized script at scripts/apply_redlines.py automates the entire redlining
process using the Document library from the built-in docx skill:
PYTHONPATH=~/.claude/skills/docx python scripts/apply_redlines.py [deal_dir]
The script:
revised.txt)replace_node(), suggest_deletion(), insert_after())redline_agreement.docx in the deal directoryThe docx skill includes a Document library (importable when PYTHONPATH includes
the skill root) that handles OOXML infrastructure automatically:
people.xml, RSIDs, settings.xml entries for tracked changesw:id, w:author, w:date, w:rsidR on all tracked change elementsdoc.add_comment(start_node, end_node, text) with auto-wired comment referencesRead the full API documentation in ooxml.md from the docx skill before writing
custom redlining scripts. Key classes: Document, DocxXMLEditor.
If the automated script is unavailable, apply changes manually in unpacked/word/document.xml:
To delete text:
<w:del w:id="UNIQUE_ID" w:author="HK" w:date="2026-01-01T00:00:00Z">
<w:r><w:rPr>COPY_ORIGINAL_RPR</w:rPr><w:delText>text being removed</w:delText></w:r>
</w:del>
To insert text:
<w:ins w:id="UNIQUE_ID" w:author="HK" w:date="2026-01-01T00:00:00Z">
<w:r><w:rPr>COPY_ORIGINAL_RPR</w:rPr><w:t>text being added</w:t></w:r>
</w:ins>
To replace text (delete + insert):
<w:del w:id="ID1" w:author="HK" w:date="...">
<w:r><w:rPr>COPY_RPR</w:rPr><w:delText>old text</w:delText></w:r>
</w:del>
<w:ins w:id="ID2" w:author="HK" w:date="...">
<w:r><w:rPr>COPY_RPR</w:rPr><w:t>new text</w:t></w:r>
</w:ins>
w:id must be unique across the entire document<w:rPr> formatting into tracked change runs<w:r> elements — don't inject tracked change tags inside a run<w:delText> (not <w:t>) inside <w:del> blocks’ for apostrophes and “/” for quotescustomXml/item*.xml in UTF-16;
convert to UTF-8 before processingrevised.txtredline_agreement.docx in the deal workspaceFor each provision folder, create these files:
analysis.md# Analysis: [Section Title]
## Summary
[2-3 sentence summary of what this provision does]
## Key Terms
- [Defined terms used and their significance]
## Cross-References
- [Other sections this provision references or depends on]
## Risk Assessment
- [Issues identified from client's perspective]
## Market Comparison
- [How this compares to market standard]
revised.txtThe full revised text of the provision. Include ALL text, not just changes. Mark revisions with brief [REVISED: explanation] inline comments (e.g., [REVISED: added reasonableness qualifier] or [REVISED: conformed to term sheet]). Keep markers to ONE SHORT PHRASE — do not include analysis, recommendations, or multi-sentence commentary inside markers. Detailed analysis belongs in analysis.md and changes_summary.md, not in revised.txt. If a provision requires no changes, reproduce the original text without any markers.
CRITICAL — revised.txt Quality Rules:
revised.txt is the operative contract language that will be used to generate tracked
changes in a Word document. It must satisfy ALL of the following rules:
No AI/skill references in contract text. Never reference skill files, benchmark documents, AI tools, or review methodology in the revised provision text. Phrases like "per the construction-loan-negotiation skill" or "as referenced in the attached benchmark" must NEVER appear. The revised text must read as if drafted by a human attorney with no awareness of AI tools.
No advisory commentary in contract text. The revised text must contain ONLY
enforceable contract language plus brief [REVISED: ...] markers. Never include
[NOTE: ...], [RECOMMENDATION: ...], [COMMENT: ...], [OBSERVATION: ...],
or any other advisory/analytical text. All commentary belongs in analysis.md and
changes_summary.md.
Every revision described in analysis.md must be drafted in revised.txt. If your analysis identifies a change and your changes_summary.md lists it as a "Revision Made", the revised.txt MUST contain the actual drafted language implementing that change. Do not describe revisions without drafting them.
No contradictory legal formulations. Common errors to avoid:
No placeholder cross-references. Never use "Section [X]", "Section 1.XX", "Article [__]", or similar placeholders. If you are adding a cross-reference, identify the actual section number from the agreement. If no matching section exists, draft the substantive language inline or flag it as an open issue — do not insert a placeholder.
No irrelevant provisions. Only include provisions appropriate to the actual deal type and property type specified in review_config.json. Do not add hotel management provisions to a multifamily deal, condominium conversion clauses to a rental project, or agricultural covenants to an office building loan. If a skill benchmark covers a provision type that doesn't apply, skip it.
Scale thresholds to deal size. When a skill provides dollar thresholds calibrated to a different deal size, scale proportionally. For example, if a skill's benchmark is based on a $150M construction loan and the actual deal is $24.5M, a $450,000 change order threshold should scale to approximately $75,000. Document the scaling rationale in analysis.md.
Preserve all original provisions unless deliberately removing them. Do not accidentally omit provisions that exist in original.txt. If the original contains a bankruptcy default trigger, a force majeure clause, or any other provision, it must appear in revised.txt (either as-is or revised). If you are deliberately removing a provision, explain why in changes_summary.md.
Preserve section numbering. Do not renumber sections, subsections, or clauses. The original document's numbering scheme must be maintained exactly. If adding new subsections, use the original's numbering convention (e.g., new subsection after 5.2.3 becomes 5.2.4, shifting subsequent numbers only if absolutely necessary — and if so, flag this in cross_ref_flags).
Consistent discretion standards. When revising lender discretion clauses, use consistent formulations throughout. Pick ONE standard per context:
changes_summary.md# Changes: [Section Title]
## Revisions Made
1. [Change description] — [Rationale]
2. ...
## Revisions NOT Made (and Why)
1. [What was considered but rejected] — [Rationale]
## Open Issues for Client Discussion
1. [Business-point issues that require client input]
## Cross-Reference Impacts
1. [Changes in other provisions that should be reviewed in light of this revision]
manifest.jsonSet "status": "reviewed" and add "reviewed_at" timestamp and "cross_ref_flags" array.
term_sheet_compliance.md (if term sheet provided)# Term Sheet Compliance: [Section Title]
## Conforming Items
- [Item]: Agreement matches term sheet ✅
## Deviations
- [Item]: Term sheet says X, agreement says Y ⚠️
- Significance: Critical / Moderate / Minor
- Recommendation: Adjust agreement / Confirm with client / Acceptable
## Items Not Addressed in Term Sheet
- [Item]: Expected boilerplate / Substantive addition requiring discussion
The review_config.json file specifies the review posture. Common postures:
borrower_friendlylender_friendlybalancedcompliance_onlyIf deal_summary.json does not exist, generate it with this structure:
{
"deal_type": "Construction Loan | Term Loan | Revolving Credit | ...",
"parties": {
"borrower": "...",
"lender": "...",
"guarantor": "...",
"other": []
},
"property": {
"address": "...",
"type": "Multifamily | Office | Retail | Industrial | ...",
"description": "..."
},
"economics": {
"loan_amount": "...",
"interest_rate": "...",
"maturity": "...",
"extension_options": "...",
"fees": []
},
"key_structural_features": [
"e.g., cash management with hard lockbox",
"e.g., springing recourse on transfer"
],
"defined_terms_index": {
"Term Name": "Brief definition or section reference"
},
"cross_reference_map": {
"Section X.XX": ["references Section Y.YY", "defines Term Z"]
}
}
Skills are domain-specific reference documents that provide market benchmarks, negotiation
strategies, and provision-level guidance for particular deal types. They live in the
skills/ directory.
Each skill file contains structured knowledge about a specific area — for example, a construction loan negotiation cheat sheet covering the 14 most commonly negotiated provisions with lender positions, borrower positions, and market benchmarks from well-negotiated deals.
Skills are NOT instructions to follow blindly. They are reference materials that inform your analysis, the same way a partner's negotiation notes or a firm's precedent database would.
When reviewing each provision:
Match the provision to any applicable skill section. A construction loan's "Cost Overrun Funding" provision maps to the corresponding section in a construction loan negotiation skill. A standard term loan's financial covenants may not have a matching skill section — that's fine.
Compare against the skill's market benchmark. When a skill provides a market benchmark for a provision, use it as a reference point in your analysis:
Incorporate skill guidance into output files. For each provision where a skill
applies, add a ## Skill Reference section to analysis.md:
## Skill Reference: [Skill Name]
**Applicable Section:** [Section number and title from the skill]
### Benchmark Comparison
- [Item]: Agreement says X; benchmark says Y
- Assessment: [More lender-favorable / More borrower-favorable / Aligned]
### Skill-Informed Recommendations
- [Recommendation based on the skill's guidance]
### Interdependencies Noted in Skill
- [Cross-provision dependencies flagged by the skill]
Scale thresholds appropriately. Skills based on large-scale deals may have dollar thresholds that need proportional adjustment for smaller transactions. The skill will often note this. When it does, adjust accordingly and document your scaling rationale.
Skills inform the review posture. If the review posture is borrower_friendly,
use the skill's "Borrower's Desired Position" as the target and the market benchmark
as the floor. If lender_friendly, reverse that. If balanced, use the benchmark
as the target.
Draft the operative provisions, not just reasonableness qualifiers. When a skill identifies a substantive mechanical provision as market standard (e.g., budget reallocation rights, retainage step-downs, force majeure extensions, deemed-approval mechanisms, punch-list carve-outs), you must draft the fully operative contract language in revised.txt — not merely add a "reasonableness" qualifier to the existing text. Adding "not to be unreasonably withheld" is a necessary first step, but a thorough review requires building out the mechanical provisions that give the reasonableness standard practical effect. For example:
The analysis.md should explain the benchmark and the rationale. The revised.txt must contain the actual drafted language a partner could send to opposing counsel. If the skill describes a market-standard mechanism and the agreement lacks it, draft it — do not merely note the gap.
Multiple skills may be installed. They may overlap (e.g., a general CRE lending skill and a construction-specific skill). When they overlap:
Many provisions won't have a matching skill section. In those cases, rely on your general legal knowledge and the review posture. Don't force a skill reference where none applies.