Use when user says "brief dla prawnika", "brief prawny", "przygotuj brief do regulaminu", "co musi byc w regulaminie", "red flags przed produkcja", "co brakuje przed startem", or asks about legal aspects of a web service in the context of its codebase. Also use when updating an existing LEGAL_BRIEF.md with new findings.
Generate a professional legal brief (LEGAL_BRIEF.md) for a lawyer writing Terms of Service for a web platform. You act as an experienced legal counsel specializing in e-commerce who can also read source code and translate technical mechanisms into legal risks.
digraph legal_brief {
"User requests brief" [shape=doublecircle];
"LEGAL_BRIEF.md exists?" [shape=diamond];
"Read existing brief" [shape=box];
"Note what's covered" [shape=box];
"Collect project context" [shape=box];
"Analyze FAQ vs code gaps" [shape=box];
"Generate/update brief" [shape=box];
"Write LEGAL_BRIEF.md" [shape=box];
"Report summary to user" [shape=doublecircle];
"User requests brief" -> "LEGAL_BRIEF.md exists?";
"LEGAL_BRIEF.md exists?" -> "Read existing brief" [label="yes"];
"LEGAL_BRIEF.md exists?" -> "Collect project context" [label="no"];
"Read existing brief" -> "Note what's covered";
"Note what's covered" -> "Collect project context";
"Collect project context" -> "Analyze FAQ vs code gaps";
"Analyze FAQ vs code gaps" -> "Generate/update brief";
"Generate/update brief" -> "Write LEGAL_BRIEF.md";
"Write LEGAL_BRIEF.md" -> "Report summary to user";
}
Use Glob to find **/LEGAL_BRIEF.md. If found, Read it. Identify what's already covered. Improve and extend rather than rewriting from scratch. Add a changelog entry.
Use dedicated tools (Glob, Read, Grep) — never bash find/cat/grep:
**/*.py, **/*.ts, **/*.js (skip migrations, node_modules)docs/faq/faq_generated.json (or equivalent)stripe|payu|payment|checkout|commission|prowizja, Read matching filesregister|signup|consent|gdpr|rodo|privacy|cookieban|block|dispute|complaint|refund|suspendterms|regulamin|privacy|polityka, Read templatesFor each legally-critical file — Read its full content.
Read the FAQ file and produce an explicit cross-reference:
| FAQ topic | Code status | Implication |
|---|---|---|
| FAQ says X | Code implements / doesn't implement | Gap for ToS / gray area |
Extract:
Include this cross-reference as a subsection within section 2.11 of the brief.
Write to project root. Follow the template in references/brief-template.md exactly.
Language: Polish, functional descriptions for a lawyer who doesn't read code. Describe mechanisms functionally ("system automatycznie pobiera prowizje po potwierdzeniu odbioru"), NOT technically.
Forbidden in output: function/class/variable names, code constants (FEE_PERCENT, DISPUTE_WINDOW_DAYS), endpoint paths (/api/...), field names (is_buyer_blocked), SDK/product codenames (Stripe Connect Express, Cloudflare R2). Use plain descriptions instead: "operator platnosci", "magazyn mediow w chmurze".
No hallucination: Describe ONLY what exists in code or FAQ. If something can't be determined, mark: [DO USTALENIA Z ZESPOLEM].
Every item in section 2 must follow this format:
Every place where users can be charged money = KRYTYCZNY priority.
FAQ questions about refunds/disputes/bans = proof the process exists and MUST be in ToS.
Red flags section must be brutally honest — its purpose is protection against real legal risk. Use structured tables per category (see template).
After writing the file, tell the user:
If you updated an existing file — state what specifically changed.