Skip to content

Coding Standards

These standards apply to all contributions -- skills, agents, MCP server tools, and documentation. Following them ensures consistency and prevents common errors.


Jurisdiction: England & Wales Only

Critical Rule

Every skill, agent, and output is scoped exclusively to England & Wales law. This is a hard requirement -- not a guideline.

DoDo Not
Reference the Housing Act 1988Reference the Housing (Scotland) Act 1987
Reference the Land Registration Act 2002Reference the Land Registration (Scotland) Act 2012
Say "England and Wales"Say "the UK" when referring to legal jurisdiction
Reference ICO as the supervisory authorityReference the Scottish Information Commissioner
Omit non-E&W statutes entirelyInclude Scottish/NI equivalents "for completeness"

If a user asks about Scottish or Northern Irish law, the correct response is to state that this tool is scoped to England & Wales and recommend consulting a solicitor qualified in the relevant jurisdiction.


Disclaimer Block

Every user-facing output must start with the standard disclaimer. This is non-negotiable and load-bearing for the project:

AI-Generated Legal Analysis -- This output is produced by AI and does not
constitute legal advice. It is intended as a starting point for review.
Always consult a qualified solicitor before signing contracts or relying
on generated legal documents. This tool is designed for use under the
laws of England and Wales.

INFO

Do not omit, paraphrase, shorten, reposition, or move this disclaimer to a footer. Use it verbatim at the top of every output. Skills and agents include it in their output templates.


Risk Indicators

Use the standardised three-tier risk indicator format throughout all skills and agents:

IndicatorEmojiMeaningUsage
High Risk🔴Material legal exposure; must address before signingImmediate attention required
Medium Risk🟡Notable concern; should address during negotiationShould be addressed
Low Risk🟢Minor or no concern; well-draftedAcceptable, standard terms

In Markdown output:

markdown
| Risk Level | Count | Clauses |
|------------|-------|---------|
| 🔴 High Risk | 3 | Termination, Liability, IP |
| 🟡 Medium Risk | 5 | Payment, Notice, ... |
| 🟢 Low Risk | 8 | Governing Law, Severability, ... |

Input Handling

All skills must support exactly three input methods. Never remove support for any of them:

#MethodToolWhen
1File pathRead toolUser provides a path to a file
2Pasted textDirect inputUser pastes contract text into the chat
3URLWebFetchUser provides a URL to fetch

If the user invokes a skill without specifying input, prompt them to provide one of the three options.


Output File Naming

All generated documents are saved as Markdown files in the current working directory with standardised naming:

Document TypePatternExample
Contract reviewCONTRACT-REVIEW-[name]-[YYYY-MM-DD].mdCONTRACT-REVIEW-Acme-Corp-2025-03-15.md
Contract comparisonCONTRACT-COMPARISON-[YYYY-MM-DD].mdCONTRACT-COMPARISON-2025-03-15.md
NDANDA-[party-name]-[YYYY-MM-DD].mdNDA-TechStart-Ltd-2025-03-15.md
Terms of serviceTERMS-OF-SERVICE-[company]-[YYYY-MM-DD].mdTERMS-OF-SERVICE-Widgets-Inc-2025-03-15.md
Privacy policyPRIVACY-POLICY-[company]-[YYYY-MM-DD].mdPRIVACY-POLICY-Widgets-Inc-2025-03-15.md
Property analysisPROPERTY-ANALYSIS-[address]-[YYYY-MM-DD].mdPROPERTY-ANALYSIS-42-High-Street-2025-03-15.md
Tenancy reviewTENANCY-REVIEW-[address]-[YYYY-MM-DD].mdTENANCY-REVIEW-Flat-3-Oak-Lane-2025-03-15.md
GDPR auditGDPR-AUDIT-[name]-[YYYY-MM-DD].mdGDPR-AUDIT-DataFlow-Ltd-2025-03-15.md
IP reviewIP-REVIEW-[name]-[YYYY-MM-DD].mdIP-REVIEW-PatentCo-2025-03-15.md
Debt reviewDEBT-REVIEW-[debtor]-[YYYY-MM-DD].mdDEBT-REVIEW-Smith-Trading-2025-03-15.md
Immigration reviewIMMIGRATION-REVIEW-[name]-[YYYY-MM-DD].mdIMMIGRATION-REVIEW-J-Patel-2025-03-15.md
Will reviewWILL-REVIEW-[testator]-[YYYY-MM-DD].mdWILL-REVIEW-E-Thompson-2025-03-15.md

Skill Files

Skills are pure Markdown prompts with no runtime code:

RuleRationale
No imports or require() statementsSkills are prompt documents, not code
No shared library referencesEach skill is self-contained
No environment variable accessSkills run within Claude Code, not a runtime
Include all analysis frameworks inlineDo not reference external files for scoring criteria
Use tables for structured contentTables render consistently and are parseable
Include example output with exact structureShows the expected format precisely
Professional but accessible languageExplain legal concepts in plain English alongside technical terms
Be specific about WHY something is riskyNot just THAT it is risky
Always suggest specific alternative languageWhen flagging issues in contracts

Agent Output Contracts

Agent output must match the structure expected by the parent orchestrator:

RuleRationale
Use the exact table format defined in the agent fileParent orchestrator parses the output
Include summary statisticsUsed for weighted scoring in aggregation
Use unique identifiers for each findingEnables cross-referencing between agents (e.g., CL-001, DP-003)
Include a "Handoff to Other Agents" sectionDocuments dependencies explicitly

Breaking Change Risk

Changing an agent's output contract without updating the parent orchestrator will break the aggregation step. Always update both files together in the same PR.


MCP Server

RuleDetails
TypeScript with strict modetsconfig.json has strict: true
Build to dist/npm run build compiles with tsc
Tests run on compiled outputnpm run build, then node --test on dist/**/*.test.js
Use node:test runnerNot Jest, not Vitest -- the project uses Node.js built-in test runner
Use node:assert/strictStandard Node.js assertion library
Tool names use snake_casesearch_legislation, lookup_statute, check_in_force
Return structured JSONAll MCP tool responses return typed objects
Use zod for input validationSchema validation for all tool parameters
typescript
import { describe, it } from "node:test"
import assert from "node:assert/strict"

describe("yourTool", () => {
  it("should handle the expected case", () => {
    const result = yourTool(input)
    assert.strictEqual(result, expected)
  })

  it("should throw for invalid input", () => {
    assert.throws(() => yourTool(null), /expected error message/)
  })
})

Git Conventions

Branch Names

feat/partnership-review-skill
fix/limitation-period-calculation
docs/update-legislation-reference
refactor/extract-shared-prompt-block
test/add-caselaw-lookup-tests

Commit Messages

Follow conventional commit format with imperative mood:

feat: add intellectual property review skill
fix: correct limitation period for deed contracts
docs: update legislation reference table
refactor: extract shared prompt block into a partial
test: add tests for caselaw lookup edge cases
chore: bump MCP server dependencies
PrefixWhen
feat:New feature or skill
fix:Bug fix
docs:Documentation only
refactor:Code restructuring, no behaviour change
test:Adding or updating tests
chore:Dependencies, tooling, configuration

What Not to Do

Do NotReason
Reference Scottish/NI statutesJurisdiction is England & Wales only
Omit the disclaimerRequired on all output, no exceptions
Use non-standard risk indicatorsConsistency across all 38 skills
Remove an input method from a skillAll three (file, paste, URL) must be supported
Add runtime code to skillsSkills are pure Markdown prompts
Change agent output without updating orchestratorBreaks aggregation in the parent skill
Skip npm run test:skills after registry changesParity check guards skill/agent/router/registry sync
Use any type in MCP server TypeScriptUse unknown and narrow with type guards

UK Legal Skills — Established MMXXVI · Built for England & Wales · Not legal advice.