@kortix/sandbox 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/customize.sh +143 -0
- package/config/kortix-env-setup.sh +25 -0
- package/kortix-master/package.json +22 -0
- package/kortix-master/src/config.ts +22 -0
- package/kortix-master/src/index.ts +44 -0
- package/kortix-master/src/routes/env.ts +65 -0
- package/kortix-master/src/routes/proxy.ts +108 -0
- package/kortix-master/src/routes/update.ts +185 -0
- package/kortix-master/src/services/proxy.ts +43 -0
- package/kortix-master/src/services/secret-store.ts +156 -0
- package/kortix-master/tsconfig.json +14 -0
- package/opencode/agents/kortix-browser.md +142 -0
- package/opencode/agents/kortix-build.md +62 -0
- package/opencode/agents/kortix-explore.md +66 -0
- package/opencode/agents/kortix-image-gen.md +33 -0
- package/opencode/agents/kortix-main.md +450 -0
- package/opencode/agents/kortix-plan.md +100 -0
- package/opencode/agents/kortix-research.md +84 -0
- package/opencode/agents/kortix-sheets.md +61 -0
- package/opencode/agents/kortix-slides.md +64 -0
- package/opencode/agents/kortix-web-dev.md +572 -0
- package/opencode/commands/email.md +36 -0
- package/opencode/commands/init.md +43 -0
- package/opencode/commands/journal.md +44 -0
- package/opencode/commands/memory-init.md +81 -0
- package/opencode/commands/memory-search.md +50 -0
- package/opencode/commands/memory-status.md +56 -0
- package/opencode/commands/research.md +36 -0
- package/opencode/commands/search.md +38 -0
- package/opencode/commands/slides.md +32 -0
- package/opencode/commands/spreadsheet.md +30 -0
- package/opencode/memory.json +37 -0
- package/opencode/ocx.jsonc +10 -0
- package/opencode/opencode.jsonc +103 -0
- package/opencode/package.json +25 -0
- package/opencode/patches/apply.sh +19 -0
- package/opencode/patches/opencode-pty-spawn.txt +49 -0
- package/opencode/plugin/background-agents.ts.disabled +483 -0
- package/opencode/plugin/kdco-primitives/get-project-id.ts +172 -0
- package/opencode/plugin/kdco-primitives/index.ts +26 -0
- package/opencode/plugin/kdco-primitives/log-warn.ts +51 -0
- package/opencode/plugin/kdco-primitives/mutex.ts +122 -0
- package/opencode/plugin/kdco-primitives/shell.ts +138 -0
- package/opencode/plugin/kdco-primitives/temp.ts +36 -0
- package/opencode/plugin/kdco-primitives/terminal-detect.ts +34 -0
- package/opencode/plugin/kdco-primitives/types.ts +13 -0
- package/opencode/plugin/kdco-primitives/with-timeout.ts +84 -0
- package/opencode/plugin/memory.ts +306 -0
- package/opencode/plugin/worktree/state.ts +412 -0
- package/opencode/plugin/worktree/terminal.ts +1002 -0
- package/opencode/plugin/worktree.ts +861 -0
- package/opencode/skills/KORTIX-browser/SKILL.md +478 -0
- package/opencode/skills/KORTIX-cron-triggers/SKILL.md +173 -0
- package/opencode/skills/KORTIX-deep-research/SKILL.md +278 -0
- package/opencode/skills/KORTIX-docx/SKILL.md +398 -0
- package/opencode/skills/KORTIX-docx/scripts/__init__.py +1 -0
- package/opencode/skills/KORTIX-docx/scripts/accept_changes.py +104 -0
- package/opencode/skills/KORTIX-docx/scripts/comment.py +244 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/__init__.py +0 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/merge_runs.py +199 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/opencode/skills/KORTIX-docx/scripts/office/pack.py +159 -0
- package/opencode/skills/KORTIX-docx/scripts/office/soffice.py +183 -0
- package/opencode/skills/KORTIX-docx/scripts/office/unpack.py +132 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validate.py +111 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/__init__.py +15 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/base.py +847 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/docx.py +446 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/pptx.py +275 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/redlining.py +247 -0
- package/opencode/skills/KORTIX-docx/scripts/render_docx.py +179 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/comments.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtended.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtensible.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsIds.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/people.xml +3 -0
- package/opencode/skills/KORTIX-domain-research/SKILL.md +96 -0
- package/opencode/skills/KORTIX-domain-research/scripts/domain-lookup.py +810 -0
- package/opencode/skills/KORTIX-elevenlabs/SKILL.md +230 -0
- package/opencode/skills/KORTIX-elevenlabs/scripts/tts.py +389 -0
- package/opencode/skills/KORTIX-email/SKILL.md +145 -0
- package/opencode/skills/KORTIX-legal-writer/SKILL.md +409 -0
- package/opencode/skills/KORTIX-legal-writer/references/bluebook.md +152 -0
- package/opencode/skills/KORTIX-legal-writer/references/document-types.md +416 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/courtlistener.py +291 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/ecfr_lookup.py +299 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/verify-legal.py +507 -0
- package/opencode/skills/KORTIX-logo-creator/SKILL.md +293 -0
- package/opencode/skills/KORTIX-logo-creator/references/prompt-patterns.md +134 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/compose_logo.py +406 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/create_logo_sheet.py +258 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/remove_bg.py +96 -0
- package/opencode/skills/KORTIX-memory/SKILL.md +261 -0
- package/opencode/skills/KORTIX-memory/scripts/export-sessions.py +409 -0
- package/opencode/skills/KORTIX-paper-creator/SKILL.md +549 -0
- package/opencode/skills/KORTIX-paper-creator/assets/template.tex +101 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/compile.sh +177 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/openalex_to_bibtex.py +220 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/verify.sh +354 -0
- package/opencode/skills/KORTIX-paper-search/SKILL.md +418 -0
- package/opencode/skills/KORTIX-pdf/SKILL.md +232 -0
- package/opencode/skills/KORTIX-pdf/forms.md +36 -0
- package/opencode/skills/KORTIX-pdf/reference.md +105 -0
- package/opencode/skills/KORTIX-pdf/scripts/check_bounding_boxes.py +65 -0
- package/opencode/skills/KORTIX-pdf/scripts/check_fillable_fields.py +11 -0
- package/opencode/skills/KORTIX-pdf/scripts/convert_pdf_to_images.py +33 -0
- package/opencode/skills/KORTIX-pdf/scripts/create_validation_image.py +37 -0
- package/opencode/skills/KORTIX-pdf/scripts/extract_form_field_info.py +122 -0
- package/opencode/skills/KORTIX-pdf/scripts/extract_form_structure.py +115 -0
- package/opencode/skills/KORTIX-pdf/scripts/fill_fillable_fields.py +98 -0
- package/opencode/skills/KORTIX-pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/opencode/skills/KORTIX-plan/SKILL.md +228 -0
- package/opencode/skills/KORTIX-presentation-viewer/SKILL.md +87 -0
- package/opencode/skills/KORTIX-presentation-viewer/serve.ts +136 -0
- package/opencode/skills/KORTIX-presentation-viewer/viewer.html +559 -0
- package/opencode/skills/KORTIX-presentations/SKILL.md +344 -0
- package/opencode/skills/KORTIX-remotion/SKILL.md +56 -0
- package/opencode/skills/KORTIX-remotion/rules/3d.md +86 -0
- package/opencode/skills/KORTIX-remotion/rules/animations.md +29 -0
- package/opencode/skills/KORTIX-remotion/rules/assets.md +78 -0
- package/opencode/skills/KORTIX-remotion/rules/audio-visualization.md +198 -0
- package/opencode/skills/KORTIX-remotion/rules/audio.md +169 -0
- package/opencode/skills/KORTIX-remotion/rules/calculate-metadata.md +104 -0
- package/opencode/skills/KORTIX-remotion/rules/can-decode.md +75 -0
- package/opencode/skills/KORTIX-remotion/rules/charts.md +120 -0
- package/opencode/skills/KORTIX-remotion/rules/compositions.md +141 -0
- package/opencode/skills/KORTIX-remotion/rules/display-captions.md +184 -0
- package/opencode/skills/KORTIX-remotion/rules/extract-frames.md +229 -0
- package/opencode/skills/KORTIX-remotion/rules/ffmpeg.md +38 -0
- package/opencode/skills/KORTIX-remotion/rules/fonts.md +152 -0
- package/opencode/skills/KORTIX-remotion/rules/get-audio-duration.md +58 -0
- package/opencode/skills/KORTIX-remotion/rules/get-video-dimensions.md +68 -0
- package/opencode/skills/KORTIX-remotion/rules/get-video-duration.md +58 -0
- package/opencode/skills/KORTIX-remotion/rules/gifs.md +141 -0
- package/opencode/skills/KORTIX-remotion/rules/images.md +130 -0
- package/opencode/skills/KORTIX-remotion/rules/import-srt-captions.md +69 -0
- package/opencode/skills/KORTIX-remotion/rules/light-leaks.md +73 -0
- package/opencode/skills/KORTIX-remotion/rules/lottie.md +68 -0
- package/opencode/skills/KORTIX-remotion/rules/maps.md +401 -0
- package/opencode/skills/KORTIX-remotion/rules/measuring-dom-nodes.md +35 -0
- package/opencode/skills/KORTIX-remotion/rules/measuring-text.md +143 -0
- package/opencode/skills/KORTIX-remotion/rules/parameters.md +98 -0
- package/opencode/skills/KORTIX-remotion/rules/sequencing.md +118 -0
- package/opencode/skills/KORTIX-remotion/rules/subtitles.md +36 -0
- package/opencode/skills/KORTIX-remotion/rules/tailwind.md +11 -0
- package/opencode/skills/KORTIX-remotion/rules/text-animations.md +20 -0
- package/opencode/skills/KORTIX-remotion/rules/timing.md +179 -0
- package/opencode/skills/KORTIX-remotion/rules/transcribe-captions.md +70 -0
- package/opencode/skills/KORTIX-remotion/rules/transitions.md +197 -0
- package/opencode/skills/KORTIX-remotion/rules/transparent-videos.md +106 -0
- package/opencode/skills/KORTIX-remotion/rules/trimming.md +53 -0
- package/opencode/skills/KORTIX-remotion/rules/videos.md +171 -0
- package/opencode/skills/KORTIX-secrets/SKILL.md +280 -0
- package/opencode/skills/KORTIX-semantic-search/SKILL.md +213 -0
- package/opencode/skills/KORTIX-session-search/SKILL.md +807 -0
- package/opencode/skills/KORTIX-session-search/Untitled +1 -0
- package/opencode/skills/KORTIX-skill-creator/SKILL.md +163 -0
- package/opencode/skills/KORTIX-web-research/SKILL.md +69 -0
- package/opencode/skills/KORTIX-xlsx/LICENSE.txt +30 -0
- package/opencode/skills/KORTIX-xlsx/SKILL.md +549 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/__init__.py +0 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/pack.py +159 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/soffice.py +183 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/unpack.py +132 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validate.py +111 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/__init__.py +15 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/base.py +847 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/docx.py +446 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/pptx.py +275 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/redlining.py +247 -0
- package/opencode/skills/KORTIX-xlsx/scripts/recalc.py +184 -0
- package/opencode/tools/image-gen.ts +342 -0
- package/opencode/tools/image-search.ts +190 -0
- package/opencode/tools/memory-get.ts +168 -0
- package/opencode/tools/memory-search.ts +247 -0
- package/opencode/tools/presentation-gen.ts +723 -0
- package/opencode/tools/scrape-webpage.ts +115 -0
- package/opencode/tools/scripts/.python-version +1 -0
- package/opencode/tools/scripts/convert_pdf.py +184 -0
- package/opencode/tools/scripts/convert_pptx.py +562 -0
- package/opencode/tools/scripts/pyproject.toml +11 -0
- package/opencode/tools/scripts/uv.lock +287 -0
- package/opencode/tools/scripts/validate_slide.py +74 -0
- package/opencode/tools/show-user.ts +217 -0
- package/opencode/tools/tests/e2e-presentation-fix.ts +277 -0
- package/opencode/tools/tests/image-gen.test.ts +215 -0
- package/opencode/tools/tests/image-search.test.ts +125 -0
- package/opencode/tools/tests/memory-system-benchmark.ts +1076 -0
- package/opencode/tools/tests/presentation-gen.test.ts +389 -0
- package/opencode/tools/tests/scrape-webpage.test.ts +74 -0
- package/opencode/tools/tests/show-user.test.ts +241 -0
- package/opencode/tools/tests/video-gen.test.ts +110 -0
- package/opencode/tools/tests/web-search.test.ts +106 -0
- package/opencode/tools/video-gen.ts +200 -0
- package/opencode/tools/web-search.ts +153 -0
- package/opencode/tsconfig.json +29 -0
- package/package.json +36 -0
- package/patch-agent-browser.js +100 -0
- package/postinstall.sh +88 -0
- package/services/KORTIX-presentation-viewer/run +37 -0
- package/services/agent-browser-viewer/run +48 -0
- package/services/kortix-master/run +16 -0
- package/services/lss-sync/run +22 -0
- package/services/opencode-serve/run +25 -0
- package/services/opencode-web/run +21 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kortix-email
|
|
3
|
+
description: "Send and receive email via IMAP/SMTP using curl. Works with any email provider. By default uses the agent's own inbox configured via KORTIX_AGENT_EMAIL_INBOX_* env vars, but can target any SMTP/IMAP server by passing credentials directly. Use when the agent needs to: send email, check inbox, read messages, reply, search, or manage flags."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Email (IMAP/SMTP via curl)
|
|
7
|
+
|
|
8
|
+
Send and receive email from the terminal. Just `curl`. Works with any provider — AgentMail, Gmail, Outlook, Fastmail, self-hosted, anything with IMAP/SMTP.
|
|
9
|
+
|
|
10
|
+
By default uses the agent's own inbox (env vars below). Can also target any arbitrary SMTP/IMAP server by swapping the credentials.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Default Credentials (agent's inbox)
|
|
15
|
+
|
|
16
|
+
These env vars are pre-configured:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
USER="$KORTIX_AGENT_EMAIL_INBOX_USER_NAME"
|
|
20
|
+
PASS="$KORTIX_AGENT_EMAIL_INBOX_PASSWORD"
|
|
21
|
+
SMTP="smtps://$KORTIX_AGENT_EMAIL_INBOX_SMTP_HOST:$KORTIX_AGENT_EMAIL_INBOX_SMTP_PORT"
|
|
22
|
+
IMAP="imaps://$KORTIX_AGENT_EMAIL_INBOX_IMAP_HOST:$KORTIX_AGENT_EMAIL_INBOX_IMAP_PORT"
|
|
23
|
+
FROM="$KORTIX_AGENT_EMAIL_INBOX_FROM_NAME <$KORTIX_AGENT_EMAIL_INBOX_FROM_EMAIL>"
|
|
24
|
+
EMAIL="$KORTIX_AGENT_EMAIL_INBOX_FROM_EMAIL"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
To use a different mailbox, just swap those values.
|
|
28
|
+
|
|
29
|
+
**Never print credentials.**
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Send
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
TMPFILE=$(mktemp)
|
|
37
|
+
cat > "$TMPFILE" <<EOF
|
|
38
|
+
From: $FROM
|
|
39
|
+
To: recipient@example.com
|
|
40
|
+
Subject: Hello
|
|
41
|
+
Date: $(date -R)
|
|
42
|
+
MIME-Version: 1.0
|
|
43
|
+
Content-Type: text/plain; charset=UTF-8
|
|
44
|
+
|
|
45
|
+
Your message body here.
|
|
46
|
+
EOF
|
|
47
|
+
|
|
48
|
+
curl -sS "$SMTP" --user "$USER:$PASS" \
|
|
49
|
+
--mail-from "$EMAIL" \
|
|
50
|
+
--mail-rcpt "recipient@example.com" \
|
|
51
|
+
--upload-file "$TMPFILE"
|
|
52
|
+
|
|
53
|
+
rm -f "$TMPFILE"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Multiple recipients: add more `--mail-rcpt` flags. CC: add `Cc:` header in the file AND a `--mail-rcpt` per CC address.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## List Folders
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
curl -sS "$IMAP/" --user "$USER:$PASS" | tr -d '\r'
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Inbox Count
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X "EXAMINE INBOX" | tr -d '\r'
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`* N EXISTS` = total messages.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## List Messages
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" \
|
|
82
|
+
-X "FETCH 1:* (FLAGS BODY.PEEK[HEADER.FIELDS (FROM SUBJECT DATE)])" | tr -d '\r'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Read a Message
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" \
|
|
91
|
+
-X "FETCH 3 BODY.PEEK[]" | tr -d '\r'
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`BODY.PEEK[]` = read without marking seen. `BODY[]` = mark as read.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Search
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X "SEARCH UNSEEN" | tr -d '\r'
|
|
102
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X 'SEARCH FROM "bob@example.com"' | tr -d '\r'
|
|
103
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X 'SEARCH SUBJECT "meeting"' | tr -d '\r'
|
|
104
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X 'SEARCH SINCE 01-Jan-2026' | tr -d '\r'
|
|
105
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X 'SEARCH UNSEEN FROM "bob"' | tr -d '\r'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Returns `* SEARCH 1 4 7` — matching sequence numbers.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Mark Read / Unread
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X 'STORE 3 +FLAGS (\Seen)' | tr -d '\r'
|
|
116
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X 'STORE 3 -FLAGS (\Seen)' | tr -d '\r'
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Delete
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X 'STORE 3 +FLAGS (\Deleted)' | tr -d '\r'
|
|
125
|
+
curl -sS "$IMAP/INBOX" --user "$USER:$PASS" -X 'EXPUNGE' | tr -d '\r'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Reply
|
|
131
|
+
|
|
132
|
+
1. FETCH original to get `From`, `Subject`, `Message-ID`
|
|
133
|
+
2. Compose reply with `In-Reply-To:` and `References:` set to original `Message-ID`
|
|
134
|
+
3. Prefix subject with `Re: `
|
|
135
|
+
4. Send via SMTP as above
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Rules
|
|
140
|
+
|
|
141
|
+
- **Act, don't ask.** Send/read when instructed.
|
|
142
|
+
- **Never print credentials.**
|
|
143
|
+
- **Human language.** Say "I sent the email" not "curl smtps://..."
|
|
144
|
+
- **Always `tr -d '\r'`** on IMAP output.
|
|
145
|
+
- **Identity:** when sending from the agent's own inbox, always use the configured FROM_NAME/FROM_EMAIL.
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kortix-legal-writer
|
|
3
|
+
description: "Legal document drafting -- contracts, memos, briefs, complaints, demand letters, opinions, discovery, settlements, ToS, privacy policies. Full pipeline: document structure, per-section writing, Bluebook citation, case law lookup (CourtListener API), regulation lookup (eCFR API), DOCX output, and TDD-style verification (defined terms, cross-references, placeholders, boilerplate, citation format). Triggers on: 'draft a contract', 'write a legal memo', 'create an NDA', 'write a brief', 'legal document about', 'draft a complaint', 'terms of service', 'privacy policy', 'demand letter', 'settlement agreement', 'legal opinion', 'discovery requests', any request to produce a legal or law-related document."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Legal Document Writer
|
|
7
|
+
|
|
8
|
+
Draft publication-quality legal documents in DOCX (Word) format with a **test-driven workflow**: every section is verified before moving to the next. Covers contracts, memos, briefs, complaints, demand letters, and more.
|
|
9
|
+
|
|
10
|
+
## Bundled Resources
|
|
11
|
+
|
|
12
|
+
Find the skill directory via `glob("**/KORTIX-legal-writer/")`.
|
|
13
|
+
|
|
14
|
+
| Resource | Path | Purpose |
|
|
15
|
+
|----------|------|---------|
|
|
16
|
+
| **Verifier** | `scripts/verify-legal.py` | TDD verification suite (10 checks) |
|
|
17
|
+
| **Case law API** | `scripts/courtlistener.py` | CourtListener search/lookup for case citations |
|
|
18
|
+
| **Regulation API** | `scripts/ecfr_lookup.py` | eCFR + Federal Register lookup for statutes/regs |
|
|
19
|
+
| **Bluebook ref** | `references/bluebook.md` | Bluebook citation format quick reference |
|
|
20
|
+
| **Doc type ref** | `references/document-types.md` | Section templates for every document type |
|
|
21
|
+
|
|
22
|
+
## The TDD Rule
|
|
23
|
+
|
|
24
|
+
**After writing every section of the document:**
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
1. WRITE section content
|
|
28
|
+
2. GENERATE: build/update the DOCX via the kortix-docx skill
|
|
29
|
+
3. VERIFY: python3 verify-legal.py legal/{slug}/
|
|
30
|
+
4. If FAIL → FIX → go to 2
|
|
31
|
+
5. If PASS → move to next section
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The document must pass verification at every step. Never batch errors.
|
|
35
|
+
|
|
36
|
+
## Pipeline Overview
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Phase 1: SCAFFOLD → Create project, metadata.json, empty DOCX with structure
|
|
40
|
+
Verify: document exists and has correct sections ✓
|
|
41
|
+
|
|
42
|
+
Phase 2: RESEARCH → Case law, statutes, regulations (if litigation/regulatory doc)
|
|
43
|
+
Verify: citations are formatted correctly ✓
|
|
44
|
+
|
|
45
|
+
Phase 3: WRITE → Per-section drafting in logical order
|
|
46
|
+
Verify: verify-legal.py after EACH section ✓
|
|
47
|
+
|
|
48
|
+
Phase 4: POLISH → Self-reflection pass, strict verification, final DOCX
|
|
49
|
+
Verify: verify-legal.py --strict with zero warnings ✓
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Filesystem Architecture
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
legal/{document-slug}/
|
|
56
|
+
├── metadata.json # Document type, parties, jurisdiction, etc.
|
|
57
|
+
├── document.docx # The main document (generated via kortix-docx)
|
|
58
|
+
├── research/ # Case law, statutes, notes (optional)
|
|
59
|
+
│ ├── cases.json # CourtListener search results
|
|
60
|
+
│ ├── regulations.json # eCFR lookup results
|
|
61
|
+
│ └── notes.md # Research notes
|
|
62
|
+
└── versions/ # Prior versions (optional)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### metadata.json
|
|
66
|
+
|
|
67
|
+
This file drives verification. Create it during scaffold:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"type": "contract",
|
|
72
|
+
"title": "Services Agreement",
|
|
73
|
+
"jurisdiction": "State of Delaware",
|
|
74
|
+
"governing_law": "Delaware",
|
|
75
|
+
"date": "2025-01-15",
|
|
76
|
+
"parties": [
|
|
77
|
+
{"name": "Acme Corporation", "short_name": "Company", "role": "client"},
|
|
78
|
+
{"name": "Jane Smith Consulting LLC", "short_name": "Contractor", "role": "contractor"}
|
|
79
|
+
],
|
|
80
|
+
"word_limit": null,
|
|
81
|
+
"page_limit": null
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
For briefs/motions, include `word_limit` or `page_limit` from court rules.
|
|
86
|
+
|
|
87
|
+
## Phase 1: Scaffold
|
|
88
|
+
|
|
89
|
+
### 1a. Identify document type
|
|
90
|
+
|
|
91
|
+
Read `references/document-types.md` for the section template matching the requested document type. The major types:
|
|
92
|
+
|
|
93
|
+
| Type | Key | Use Case |
|
|
94
|
+
|------|-----|----------|
|
|
95
|
+
| Legal memorandum | `memo` | Internal analysis, predictive |
|
|
96
|
+
| Motion brief | `brief` | Persuasive, court filing |
|
|
97
|
+
| Contract/Agreement | `contract` | Transactional, bilateral obligations |
|
|
98
|
+
| Complaint/Petition | `complaint` | Initiating litigation |
|
|
99
|
+
| Demand letter | `demand` | Pre-litigation claim |
|
|
100
|
+
| Legal opinion | `opinion` | Formal legal opinion for transaction |
|
|
101
|
+
| Discovery requests | `discovery` | Interrogatories, doc requests |
|
|
102
|
+
| Settlement agreement | `settlement` | Resolving dispute |
|
|
103
|
+
| Terms of Service | `tos` | User-facing terms |
|
|
104
|
+
| Privacy Policy | `privacy` | Data privacy compliance |
|
|
105
|
+
|
|
106
|
+
### 1b. Create project structure
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
SLUG="document-slug-here"
|
|
110
|
+
mkdir -p "legal/$SLUG"/{research,versions}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 1c. Create metadata.json
|
|
114
|
+
|
|
115
|
+
Write the JSON file with document type, parties, jurisdiction, and any constraints.
|
|
116
|
+
|
|
117
|
+
### 1d. Generate initial DOCX
|
|
118
|
+
|
|
119
|
+
Load the `kortix-docx` skill. Use `python-docx` to create the document with:
|
|
120
|
+
- Proper heading styles (Heading 1, 2, 3 for section structure)
|
|
121
|
+
- 12pt font (Times New Roman or similar serif for court filings)
|
|
122
|
+
- 1-inch margins (adjust per jurisdiction — see court rules)
|
|
123
|
+
- Double-spacing for briefs/court filings, single for contracts
|
|
124
|
+
- Proper page numbering
|
|
125
|
+
- Section headers matching the document type template from `references/document-types.md`
|
|
126
|
+
- Placeholder text: `[TO BE DRAFTED]` in each section
|
|
127
|
+
|
|
128
|
+
### 1e. VERIFY: First green state
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
python3 verify-legal.py legal/$SLUG/
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The scaffolded document should exist and have correct structure. Placeholders are expected at this stage (they'll be flagged as warnings, not failures, unless `--strict`).
|
|
135
|
+
|
|
136
|
+
## Phase 2: Legal Research (if applicable)
|
|
137
|
+
|
|
138
|
+
For litigation documents (memos, briefs, complaints) and regulatory documents, research case law and statutes before writing.
|
|
139
|
+
|
|
140
|
+
### Case Law Search (CourtListener)
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
SKILL_DIR="..." # from glob
|
|
144
|
+
# Search for relevant cases
|
|
145
|
+
python3 "$SKILL_DIR/scripts/courtlistener.py" search "search terms" --after 2015 --limit 10
|
|
146
|
+
|
|
147
|
+
# Get specific opinion details
|
|
148
|
+
python3 "$SKILL_DIR/scripts/courtlistener.py" opinion 12345
|
|
149
|
+
|
|
150
|
+
# Format as Bluebook citation
|
|
151
|
+
python3 "$SKILL_DIR/scripts/courtlistener.py" bluebook 12345
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Save results to `research/cases.json`. Extract key holdings for use in the document.
|
|
155
|
+
|
|
156
|
+
**Note:** CourtListener requires a free API token for higher rate limits. Set `COURTLISTENER_API_TOKEN` env var. Without it, limited to 100 requests/day.
|
|
157
|
+
|
|
158
|
+
### Statute/Regulation Lookup (eCFR)
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Search regulations
|
|
162
|
+
python3 "$SKILL_DIR/scripts/ecfr_lookup.py" search "employment discrimination" --title 29
|
|
163
|
+
|
|
164
|
+
# Get specific CFR section
|
|
165
|
+
python3 "$SKILL_DIR/scripts/ecfr_lookup.py" section 16 444.1
|
|
166
|
+
|
|
167
|
+
# Search Federal Register for recent rules
|
|
168
|
+
python3 "$SKILL_DIR/scripts/ecfr_lookup.py" fedreg "data privacy"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
No API key required.
|
|
172
|
+
|
|
173
|
+
### Citation Formatting
|
|
174
|
+
|
|
175
|
+
Read `references/bluebook.md` for Bluebook citation format. Key rules:
|
|
176
|
+
- **Cases:** *Party v. Party*, Vol Reporter Page, Pin (Court Year).
|
|
177
|
+
- **Statutes:** Title U.S.C. § Section (Year).
|
|
178
|
+
- **Regulations:** Title C.F.R. § Section (Year).
|
|
179
|
+
- **Pinpoint cites required** — always cite to the specific page.
|
|
180
|
+
- **Short forms** after first full citation: *Id.*, *supra*, or party name + reporter.
|
|
181
|
+
|
|
182
|
+
For non-litigation documents (contracts, ToS), formal citations are generally not needed — just reference applicable law by name and section.
|
|
183
|
+
|
|
184
|
+
## Phase 3: Per-Section Writing
|
|
185
|
+
|
|
186
|
+
### Writing Order by Document Type
|
|
187
|
+
|
|
188
|
+
**Contract:** Definitions → Core obligations → Reps & warranties → Indemnification → Limitation of liability → Term/termination → General provisions → Preamble/recitals (last, once scope is clear)
|
|
189
|
+
|
|
190
|
+
**Memo:** Question Presented → Brief Answer → Statement of Facts → Discussion (IRAC per issue) → Conclusion
|
|
191
|
+
|
|
192
|
+
**Brief:** Statement of Facts → Argument (strongest points first) → Introduction/Summary (last, once you know what to say) → Conclusion
|
|
193
|
+
|
|
194
|
+
**Complaint:** Parties → Jurisdiction/Venue → Statement of Facts → Causes of Action → Prayer for Relief
|
|
195
|
+
|
|
196
|
+
### The Writing Loop (for each section)
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
1. READ all previously written sections for context
|
|
200
|
+
2. WRITE the section following document-type conventions
|
|
201
|
+
3. REGENERATE the DOCX (update via python-docx)
|
|
202
|
+
4. VERIFY: python3 verify-legal.py legal/{slug}/
|
|
203
|
+
5. If errors → FIX → go to 3
|
|
204
|
+
6. SELF-REFLECT:
|
|
205
|
+
- Is every legal assertion supported by authority? (litigation docs)
|
|
206
|
+
- Are defined terms used consistently?
|
|
207
|
+
- Any ambiguous language? ("reasonable" without standard, "timely" without deadline)
|
|
208
|
+
- Cross-references point to correct sections?
|
|
209
|
+
- No placeholder text remaining in this section?
|
|
210
|
+
7. REVISE if needed → regenerate → verify
|
|
211
|
+
8. Section DONE → next
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Legal Writing Standards
|
|
215
|
+
|
|
216
|
+
Apply these throughout all sections:
|
|
217
|
+
|
|
218
|
+
**Clarity over formality:**
|
|
219
|
+
- "before" not "prior to"
|
|
220
|
+
- "about" not "with respect to"
|
|
221
|
+
- "if" not "in the event that"
|
|
222
|
+
- "under" not "pursuant to"
|
|
223
|
+
- "to" not "in order to"
|
|
224
|
+
|
|
225
|
+
**Precision:**
|
|
226
|
+
- "shall" = duty/obligation (the party SHALL do X)
|
|
227
|
+
- "will" = future event or declaration
|
|
228
|
+
- "may" = permission (the party MAY do X)
|
|
229
|
+
- "must" = condition/requirement
|
|
230
|
+
- Never use "shall" for anything other than imposing a duty
|
|
231
|
+
|
|
232
|
+
**Defined terms:**
|
|
233
|
+
- Define on first use: `"Effective Date" means [definition].`
|
|
234
|
+
- Capitalize consistently throughout: always "Effective Date", never "effective date"
|
|
235
|
+
- Alphabetize in definitions section
|
|
236
|
+
- Don't over-define (common English words don't need definitions)
|
|
237
|
+
|
|
238
|
+
**Sentence structure:**
|
|
239
|
+
- Active voice: "The Contractor shall deliver" not "Delivery shall be made"
|
|
240
|
+
- Front-load: put the actor and action first
|
|
241
|
+
- One idea per sentence in contracts (each obligation = one sentence)
|
|
242
|
+
- Short paragraphs (max 4-5 sentences in persuasive writing)
|
|
243
|
+
|
|
244
|
+
**Numbers and dates:**
|
|
245
|
+
- Spell out numbers 1-9, use digits for 10+
|
|
246
|
+
- Dates: "January 15, 2025" (consistent throughout)
|
|
247
|
+
- Money: "$50,000" or "Fifty Thousand Dollars ($50,000)" (for contracts, both)
|
|
248
|
+
- Time periods: "thirty (30) days" in contracts; "30 days" in memos/briefs
|
|
249
|
+
|
|
250
|
+
### Section-Specific Guidance
|
|
251
|
+
|
|
252
|
+
#### Contracts: Definitions Section
|
|
253
|
+
```
|
|
254
|
+
"Agreement" means this Services Agreement, including all exhibits and schedules.
|
|
255
|
+
|
|
256
|
+
"Confidential Information" means any information disclosed by one party to the
|
|
257
|
+
other that is designated as confidential or that reasonably should be understood
|
|
258
|
+
to be confidential given the nature of the information and the circumstances of
|
|
259
|
+
disclosure.
|
|
260
|
+
|
|
261
|
+
"Deliverables" means the work product to be delivered by Contractor as described
|
|
262
|
+
in Exhibit A.
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### Contracts: Limitation of Liability
|
|
266
|
+
```
|
|
267
|
+
IN NO EVENT SHALL EITHER PARTY BE LIABLE TO THE OTHER PARTY FOR ANY
|
|
268
|
+
INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES,
|
|
269
|
+
REGARDLESS OF THE CAUSE OF ACTION OR THE THEORY OF LIABILITY, EVEN IF
|
|
270
|
+
SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
271
|
+
|
|
272
|
+
THE TOTAL AGGREGATE LIABILITY OF [PARTY] UNDER THIS AGREEMENT SHALL NOT
|
|
273
|
+
EXCEED THE TOTAL FEES PAID BY [OTHER PARTY] DURING THE TWELVE (12) MONTH
|
|
274
|
+
PERIOD PRECEDING THE CLAIM.
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Memos: IRAC Discussion Structure
|
|
278
|
+
For each legal issue:
|
|
279
|
+
```
|
|
280
|
+
[ISSUE] The issue is whether [legal question under specific law/standard].
|
|
281
|
+
|
|
282
|
+
[RULE] Under [jurisdiction] law, [state the rule]. See [Authority]. The [court]
|
|
283
|
+
has held that [rule elaboration]. [Authority]. Courts consider [factors/elements]:
|
|
284
|
+
(1) [factor]; (2) [factor]; and (3) [factor]. [Authority].
|
|
285
|
+
|
|
286
|
+
[APPLICATION] Here, [apply each factor to the client's facts]. First, [fact]
|
|
287
|
+
satisfies [factor] because [reasoning]. See [analogous case]. Unlike in
|
|
288
|
+
[distinguishable case], where [different facts led to different outcome], here
|
|
289
|
+
[explain why our facts are more like the favorable case].
|
|
290
|
+
|
|
291
|
+
[CONCLUSION] Therefore, [conclusion on this issue]. A court would likely
|
|
292
|
+
[prediction].
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
#### Briefs: Argument Headings
|
|
296
|
+
Headings should be complete persuasive sentences:
|
|
297
|
+
```
|
|
298
|
+
Good: "I. THE TRIAL COURT ERRED BY GRANTING SUMMARY JUDGMENT BECAUSE
|
|
299
|
+
GENUINE DISPUTES OF MATERIAL FACT EXIST."
|
|
300
|
+
Bad: "I. SUMMARY JUDGMENT"
|
|
301
|
+
|
|
302
|
+
Good: "A. Plaintiff's Deposition Testimony Creates a Triable Issue of Fact
|
|
303
|
+
Regarding Defendant's Knowledge of the Defect."
|
|
304
|
+
Bad: "A. Deposition Testimony"
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
#### Complaints: Numbered Paragraphs
|
|
308
|
+
Every factual allegation gets its own numbered paragraph:
|
|
309
|
+
```
|
|
310
|
+
12. On or about March 15, 2024, Plaintiff entered into a written agreement
|
|
311
|
+
with Defendant for the purchase of the Property (the "Purchase Agreement").
|
|
312
|
+
A true and correct copy of the Purchase Agreement is attached hereto as
|
|
313
|
+
Exhibit A and incorporated by reference.
|
|
314
|
+
|
|
315
|
+
13. Pursuant to Section 4.1 of the Purchase Agreement, Defendant represented
|
|
316
|
+
and warranted that the Property was free of all environmental contamination.
|
|
317
|
+
|
|
318
|
+
14. On or about June 1, 2024, Plaintiff discovered that the Property contained
|
|
319
|
+
significant levels of lead contamination in the soil.
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
## Phase 4: Polish & Final Verification
|
|
323
|
+
|
|
324
|
+
### 4a. Self-Reflection Pass
|
|
325
|
+
|
|
326
|
+
Re-read the entire document and check:
|
|
327
|
+
|
|
328
|
+
1. **Consistency:** Same terminology, same party names, same defined terms throughout
|
|
329
|
+
2. **Completeness:** All required sections present for document type, no gaps in logic
|
|
330
|
+
3. **Cross-references:** Every "Section X.Y" reference is correct after any reordering
|
|
331
|
+
4. **Defined terms:** Every capitalized term is defined, every definition is used
|
|
332
|
+
5. **Ambiguity:** No vague terms without standards, no dangling pronouns
|
|
333
|
+
6. **Placeholders:** Zero `[INSERT]`, `[TBD]`, `[TODO]`, or blank lines remaining
|
|
334
|
+
7. **Dates and numbers:** Consistent format throughout
|
|
335
|
+
8. **Citations:** (for litigation docs) All citations in Bluebook format with pinpoints
|
|
336
|
+
|
|
337
|
+
### 4b. Strict Verification
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
python3 "$SKILL_DIR/scripts/verify-legal.py" "legal/$SLUG/" --strict
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
All checks must pass:
|
|
344
|
+
|
|
345
|
+
- [ ] Document exists and is non-trivial size
|
|
346
|
+
- [ ] Defined terms: all defined, all used, consistent capitalization
|
|
347
|
+
- [ ] Cross-references: section/exhibit/schedule references valid
|
|
348
|
+
- [ ] Citations: proper format (litigation docs only)
|
|
349
|
+
- [ ] Zero placeholders / TODOs / draft artifacts
|
|
350
|
+
- [ ] Party names used consistently
|
|
351
|
+
- [ ] Required boilerplate provisions present (contracts)
|
|
352
|
+
- [ ] Modal verb consistency (shall/must/may/will)
|
|
353
|
+
- [ ] Word count within limits (briefs)
|
|
354
|
+
- [ ] Date format consistency
|
|
355
|
+
|
|
356
|
+
### 4c. Final Output
|
|
357
|
+
|
|
358
|
+
The deliverable is `legal/{slug}/document.docx`. If the user needs PDF, convert:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# If libreoffice is available:
|
|
362
|
+
libreoffice --headless --convert-to pdf "legal/$SLUG/document.docx" --outdir "legal/$SLUG/"
|
|
363
|
+
|
|
364
|
+
# Or use python-docx2pdf:
|
|
365
|
+
pip install docx2pdf && python3 -c "from docx2pdf import convert; convert('legal/$SLUG/document.docx')"
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
## DOCX Formatting Standards
|
|
369
|
+
|
|
370
|
+
When generating the DOCX (via `kortix-docx` skill / `python-docx`):
|
|
371
|
+
|
|
372
|
+
### Court Filings (briefs, motions, complaints)
|
|
373
|
+
- **Font:** Times New Roman, 12pt (or Century Schoolbook 12pt)
|
|
374
|
+
- **Spacing:** Double-spaced body text
|
|
375
|
+
- **Margins:** 1 inch all sides (check local rules — some require 1.5" left)
|
|
376
|
+
- **Page numbers:** Bottom center
|
|
377
|
+
- **Caption:** Court name, parties, case number — use the court's required format
|
|
378
|
+
- **Line numbers:** Required in some jurisdictions (e.g., California state courts)
|
|
379
|
+
|
|
380
|
+
### Contracts and Transactional Documents
|
|
381
|
+
- **Font:** Times New Roman or Calibri, 11-12pt
|
|
382
|
+
- **Spacing:** Single-spaced or 1.15
|
|
383
|
+
- **Margins:** 1 inch all sides
|
|
384
|
+
- **Section numbering:** Article → Section: 1.1, 1.2, 2.1, etc.
|
|
385
|
+
- **Defined terms:** Bold on first definition
|
|
386
|
+
- **Signature blocks:** Right-aligned or centered, with lines for signature/name/title/date
|
|
387
|
+
- **All-caps:** Use sparingly — limitation of liability and disclaimer sections only
|
|
388
|
+
- **Headers:** Document title + confidential marking if applicable
|
|
389
|
+
- **Footers:** Page numbers, draft date if working draft
|
|
390
|
+
|
|
391
|
+
### General
|
|
392
|
+
- **Heading styles:** Use Word Heading 1/2/3 styles (enables auto TOC)
|
|
393
|
+
- **Paragraph styles:** Use consistent named styles, not manual formatting
|
|
394
|
+
- **Page breaks:** Before major section headings (Articles in contracts, main sections in briefs)
|
|
395
|
+
- **Widow/orphan control:** Enabled (no single lines at page top/bottom)
|
|
396
|
+
|
|
397
|
+
## Jurisdiction-Specific Notes
|
|
398
|
+
|
|
399
|
+
Always check **local rules** before filing any court document. Key variations:
|
|
400
|
+
|
|
401
|
+
| Jurisdiction | Font | Spacing | Margins | Special |
|
|
402
|
+
|-------------|------|---------|---------|---------|
|
|
403
|
+
| Federal appellate | 14pt proportional serif | Double | 1" all | Word limit varies by circuit |
|
|
404
|
+
| U.S. Supreme Court | 12pt Century | 2pt leading | Special text field | Booklet format |
|
|
405
|
+
| California state | 13pt+ proportional serif | Double | 1.5" left/right | Line numbers required |
|
|
406
|
+
| New York state | 12pt+ proportional | Double | 1" all | Varies by court |
|
|
407
|
+
| Most federal district | 12pt TNR or similar | Double | 1" all | Check local rules |
|
|
408
|
+
|
|
409
|
+
When in doubt: **12pt Times New Roman, double-spaced, 1-inch margins** is safe for most courts.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Bluebook Citation Quick Reference
|
|
2
|
+
|
|
3
|
+
Practitioner format (Bluepages). For use in briefs, motions, memos, and court filings.
|
|
4
|
+
|
|
5
|
+
## Cases (Rule 10)
|
|
6
|
+
|
|
7
|
+
### Full citation
|
|
8
|
+
```
|
|
9
|
+
Party1 v. Party2, [Vol] [Reporter] [FirstPage], [PinPage] ([Court] [Year]).
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**Federal:**
|
|
13
|
+
```
|
|
14
|
+
Marbury v. Madison, 5 U.S. 137, 138 (1803).
|
|
15
|
+
Brown v. Bd. of Educ., 347 U.S. 483, 495 (1954).
|
|
16
|
+
Ashcroft v. Iqbal, 556 U.S. 662, 678 (2009).
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Circuit courts:**
|
|
20
|
+
```
|
|
21
|
+
Smith v. Jones, 950 F.3d 1234, 1240 (9th Cir. 2020).
|
|
22
|
+
Doe v. Roe, 800 F.2d 555, 560 (5th Cir. 1986).
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**District courts:**
|
|
26
|
+
```
|
|
27
|
+
Acme Corp. v. Widget Inc., 400 F. Supp. 3d 100, 105 (S.D.N.Y. 2019).
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**State courts:**
|
|
31
|
+
```
|
|
32
|
+
Howard Fin. Grp. v. Roche, 233 A.2d 33, 35 (Pa. Super. Ct. 1983).
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Unpublished / Westlaw:**
|
|
36
|
+
```
|
|
37
|
+
Martin v. Brez, No. 98-1234, 1998 WL 98765, at *2 (S.D.N.Y. Feb. 3, 1998).
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Short forms
|
|
41
|
+
```
|
|
42
|
+
Iqbal, 556 U.S. at 678. (case name previously introduced)
|
|
43
|
+
556 U.S. at 678. (case name in text sentence)
|
|
44
|
+
Id. at 680. (immediately preceding citation only)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Case name rules
|
|
48
|
+
- Omit given names: Jane Smith → Smith
|
|
49
|
+
- First-listed party on each side only
|
|
50
|
+
- Abbreviate per Table T6 when in citation (not in text)
|
|
51
|
+
- Italicize or underline the case name (including "v.")
|
|
52
|
+
|
|
53
|
+
## Statutes (Rule 12)
|
|
54
|
+
|
|
55
|
+
### Federal
|
|
56
|
+
```
|
|
57
|
+
42 U.S.C. § 1983 (2018).
|
|
58
|
+
15 U.S.C. §§ 78a-78qq. (range)
|
|
59
|
+
Americans with Disabilities Act of 1990, 42 U.S.C. §§ 12101-12213.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### State
|
|
63
|
+
```
|
|
64
|
+
Cal. Civ. Code § 1942.5 (West 2020).
|
|
65
|
+
N.Y. Gen. Bus. Law § 349 (McKinney 2021).
|
|
66
|
+
Tex. Bus. & Com. Code Ann. § 17.46 (West 2019).
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Short form
|
|
70
|
+
```
|
|
71
|
+
§ 1983.
|
|
72
|
+
Id. § 1985.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Regulations (Rule 14)
|
|
76
|
+
|
|
77
|
+
### Code of Federal Regulations
|
|
78
|
+
```
|
|
79
|
+
47 C.F.R. § 73.609 (2019).
|
|
80
|
+
FTC Credit Practices Rule, 16 C.F.R. § 444.1 (2019).
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Federal Register
|
|
84
|
+
```
|
|
85
|
+
Medicare Program, 62 Fed. Reg. 25,844 (May 12, 1997).
|
|
86
|
+
Proposed Rule, 88 Fed. Reg. 1234 (Jan. 5, 2023).
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Secondary Sources
|
|
90
|
+
|
|
91
|
+
### Books / treatises
|
|
92
|
+
```
|
|
93
|
+
Bryan A. Garner, Legal Writing in Plain English § 4 (2d ed. 2013).
|
|
94
|
+
5 Williston on Contracts § 6:3 (4th ed. 2023).
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Law review articles
|
|
98
|
+
```
|
|
99
|
+
Jane Doe, Contract Ambiguity, 95 Harv. L. Rev. 1001, 1015 (2024).
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Restatements
|
|
103
|
+
```
|
|
104
|
+
Restatement (Second) of Contracts § 201 (Am. L. Inst. 1981).
|
|
105
|
+
Restatement (Third) of Torts: Liab. for Phys. & Emot. Harm § 7 (Am. L. Inst. 2010).
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Signals (Rule 1.2)
|
|
109
|
+
|
|
110
|
+
| Signal | Meaning |
|
|
111
|
+
|--------|---------|
|
|
112
|
+
| [no signal] | Directly states the proposition |
|
|
113
|
+
| *See* | Clearly supports but not directly stated |
|
|
114
|
+
| *See also* | Additional support |
|
|
115
|
+
| *Cf.* | Supports by analogy |
|
|
116
|
+
| *But see* | Contradicts |
|
|
117
|
+
| *See generally* | Background material |
|
|
118
|
+
| *Contra* | Directly contradicts |
|
|
119
|
+
| *Compare ... with ...* | Comparison |
|
|
120
|
+
|
|
121
|
+
## Id. and Supra
|
|
122
|
+
|
|
123
|
+
- **Id.** — Immediately preceding citation (same source). Italicize. Can add different pinpoint: `Id. at 45.`
|
|
124
|
+
- **Supra** — Previously cited non-case authority: `Garner, supra note 5, at 23.`
|
|
125
|
+
- Never use *supra* for cases — use short form instead.
|
|
126
|
+
|
|
127
|
+
## Order of Authorities in String Cites
|
|
128
|
+
|
|
129
|
+
1. Constitutions (federal, then state)
|
|
130
|
+
2. Statutes (federal, then state)
|
|
131
|
+
3. Treaties and international agreements
|
|
132
|
+
4. Cases: U.S. Supreme Court → Circuit → District → State (descending authority)
|
|
133
|
+
5. Legislative materials
|
|
134
|
+
6. Administrative and executive materials
|
|
135
|
+
7. Secondary sources (treatises, law reviews, etc.)
|
|
136
|
+
|
|
137
|
+
## Common Reporter Abbreviations
|
|
138
|
+
|
|
139
|
+
| Reporter | Abbreviation | Court |
|
|
140
|
+
|----------|-------------|-------|
|
|
141
|
+
| United States Reports | U.S. | Supreme Court |
|
|
142
|
+
| Supreme Court Reporter | S. Ct. | Supreme Court |
|
|
143
|
+
| Federal Reporter | F., F.2d, F.3d, F.4th | Circuit Courts |
|
|
144
|
+
| Federal Supplement | F. Supp., F. Supp. 2d, F. Supp. 3d | District Courts |
|
|
145
|
+
| Federal Rules Decisions | F.R.D. | District Courts |
|
|
146
|
+
| Bankruptcy Reporter | B.R. | Bankruptcy Courts |
|
|
147
|
+
|
|
148
|
+
## Spacing Rules (Rule 6.1)
|
|
149
|
+
|
|
150
|
+
- Close adjacent single capitals: `S.D.N.Y.`, `F.3d`
|
|
151
|
+
- Space between single capital and longer abbreviation: `F. Supp.`, `S. Ct.`
|
|
152
|
+
- Ordinals treated as single capitals: `F.2d`, `F.3d`
|