Skip to content

Add TrustFoundry Legal Search API cursor rules#237

Open
iamgroot2285 wants to merge 1 commit intoPatrickJS:mainfrom
iamgroot2285:add-trustfoundry-legal-search
Open

Add TrustFoundry Legal Search API cursor rules#237
iamgroot2285 wants to merge 1 commit intoPatrickJS:mainfrom
iamgroot2285:add-trustfoundry-legal-search

Conversation

@iamgroot2285
Copy link
Copy Markdown

@iamgroot2285 iamgroot2285 commented Apr 7, 2026

Adds cursor rules for integrating with TrustFoundry's legal research API.

What's included

  • .cursorrules file covering authentication, 4 public endpoints, NDJSON streaming, error handling
  • README entry under Database and API section

Why this is useful

TrustFoundry provides an AI-powered legal research API (search US laws, regulations, case law). The API
uses NDJSON streaming responses which are a common source of integration errors — developers often try
res.json() which fails. These rules prevent that and other common mistakes (wrong auth header, invalid
jurisdiction codes, hallucinated URLs).

Summary by CodeRabbit

  • Documentation

    • Added support documentation for TrustFoundry Legal Search API integration.
  • Chores

    • Added development configuration for TrustFoundry Legal Search API integration.

Adds integration rules for TrustFoundry's legal research API covering:
- API key authentication (X-API-Key header)
- 4 public endpoints (agentic search, direct search, result retrieval, document description)
- NDJSON streaming response parsing
- Rate limit (429) and credit exhaustion (402) error handling
- Jurisdiction codes and model_type enum constraints

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

Documentation and cursor rules for TrustFoundry Legal Search API integration have been added. README updated with new entry linking to comprehensive cursor rules file covering authentication, API endpoints, NDJSON streaming behavior, and error handling specifications.

Changes

Cohort / File(s) Summary
TrustFoundry Legal Search API
README.md, rules/trustfoundry-legal-search-api-cursorrules-prompt-file/.cursorrules
Added README entry for TrustFoundry Legal Search API; new .cursorrules file defining API integration patterns including X-API-Key authentication, NDJSON streaming for search endpoints, endpoint specifications (agentic search, search, retrieve results, describe items), jurisdiction formatting, and error handling for 429 (rate limit), 402 (insufficient credits), and 401 (invalid key) responses.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • PatrickJS

Poem

🐰 Hopping through docs with carrot delight,
Legal APIs now shine oh so bright,
With headers and streams, auth set just right,
The TrustFoundry path illuminates night!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding cursor rules for the TrustFoundry Legal Search API, which matches both files modified in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
rules/trustfoundry-legal-search-api-cursorrules-prompt-file/.cursorrules (1)

5-5: Clarify the API key length specification.

The current wording "API keys are prefixed api_ and are 36 characters" is ambiguous—it's unclear whether this means 36 characters total (including the prefix) or 36 characters after the prefix. Reword for clarity, such as: "API keys are 36 characters total, prefixed with api_" or "API keys follow the format api_ + 32 random characters (36 total)".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rules/trustfoundry-legal-search-api-cursorrules-prompt-file/.cursorrules` at
line 5, The rule text "API keys are prefixed api_ and are 36 characters" is
ambiguous; update the string in the .cursorrules content to explicitly state
whether the 36 characters includes the prefix—for example replace it with either
"API keys are 36 characters total, prefixed with `api_`" or "API keys follow the
format `api_` + 32 random characters (36 total)" so readers know the exact
format.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@rules/trustfoundry-legal-search-api-cursorrules-prompt-file/.cursorrules`:
- Line 5: The rule text "API keys are prefixed api_ and are 36 characters" is
ambiguous; update the string in the .cursorrules content to explicitly state
whether the 36 characters includes the prefix—for example replace it with either
"API keys are 36 characters total, prefixed with `api_`" or "API keys follow the
format `api_` + 32 random characters (36 total)" so readers know the exact
format.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 66fb011f-3ddb-442c-b8a5-afc5042db157

📥 Commits

Reviewing files that changed from the base of the PR and between fc2ce04 and 06b7712.

📒 Files selected for processing (2)
  • README.md
  • rules/trustfoundry-legal-search-api-cursorrules-prompt-file/.cursorrules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant