# Stilta Patent Drafter

> Given an invention disclosure, retrieve related prior-art snippets from a local corpus via BM25 and draft a structured patent Background and Claims scaffold grounded in the disclosure and retrieved references.

- Skill: `riteshkew/stilta-patent-drafter` (Agent Skill, multi-file: 13 files)
- Install (CLI): `npx skillmds@latest add riteshkew/stilta-patent-drafter`
- Raw SKILL.md: https://api.skillmd.com/api/skills/riteshkew/stilta-patent-drafter/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: riteshkew (https://skillmd.com/u/riteshkew)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/riteshkew/stilta-patent-drafter

---


# Workflow

When this skill triggers, follow these steps in order.

## Step 1 — Receive the Invention Disclosure

Accept a plain-text or Markdown invention disclosure from the user. The disclosure should describe:

- The problem being solved
- The novel technical features of the invention
- Key components or steps of the system or method

If the user has not provided a disclosure, ask:
> "Please paste or upload your invention disclosure. Describe the problem, the novel features of your invention, and the key components or steps involved."

Save the disclosure to a temporary file, e.g. `disclosure.md`.

## Step 2 — Retrieve Prior Art via BM25

Run the dependency-free BM25 retriever over the committed prior-art corpus:

```bash
node scripts/retrieve.mjs resources/prior-art/ disclosure.md 3
```

The retriever:
- Tokenizes the disclosure and each corpus document
- Scores documents using the BM25 formula (k1=1.5, b=0.75)
- Returns the top-K files with scores and matched terms as JSON

Capture the JSON output. If the process exits non-zero, report the stderr message to the user and stop.

Inspect the top results. For each, note:
- The filename (maps to a prior-art reference)
- The BM25 score (higher = more relevant)
- The matched terms (shows which disclosure concepts overlap with prior art)

## Step 3 — Draft Background and Claims

Run the scaffold assembler with the disclosure and retrieval results:

```bash
node scripts/draft.mjs disclosure.md retrieval.json draft.md
```

The assembler produces a Markdown file containing:

1. **Background** — situates the invention against the retrieved prior art, citing each reference with its BM25 score and matched terms, followed by a verbatim excerpt of the disclosure.
2. **Claim 1** (Independent) — a system claim listing the key features extracted from the disclosure, in proper patent-claim format ("A system comprising… wherein…").
3. **Claim 2** (Dependent) — a dependent claim referencing claim 1 and adding a communication interface feature.

Present the drafted sections to the user for review.

## Step 4 — Flag Novelty Risks

Review the matched terms between the disclosure and the top retrieved prior art. For each prior art reference:

- Identify which disclosure features are already described in the prior art (potential novelty risks)
- Highlight features that appear only in the disclosure and not in any retrieved reference (potential novel aspects)
- Recommend that the user consult a registered patent attorney to evaluate patentability

Use this format:

```
Prior Art: [PA-1] <filename>
  Overlapping features: <list matched terms>
  Novelty risk: <brief assessment>

Novel aspects not found in retrieved prior art:
  - <feature A>
  - <feature B>
```

## Example

See `examples/input.md` for a worked invention disclosure (smart umbrella with on-device rain prediction) and `examples/output.md` for the corresponding Background, Claims, and retrieval detail produced by the engine.

Run the example yourself from the skill root:

```bash
cd skills/stilta-patent-drafter
bash examples/run.sh
```

## Important Disclaimer

This skill produces a structural scaffold for review purposes only. It is **not legal advice** and does not constitute a filed patent application. Patent claims require review and refinement by a registered patent attorney or agent before filing with any patent office.

