SKILL: draft-benchmark
Use when: user asks to run draft pipeline benchmarks, fill Draft_test.xlsx, compare with ChatGPT-5.4, or analyze draft errors.
Instructions for Claude
When this skill is invoked, follow these steps ONE BY ONE:
Step 1: Run Pipeline on Each Scenario (Fill "Draft Agent" Column C)
For each of the 10 scenarios in docs/Draft_test.xlsx column B:
- Read the scenario text from the Excel file using openpyxl
- Run the drafting pipeline:
import asyncio, openpyxl, sys, time
from pathlib import Path
sys.path.insert(0, str(Path("c:/Girish/Fundamental_Projects/ActionAi/Agent_steer_backend/BoardingMcp-Server")))
from app.agents.drafting_agents.drafting_graph import get_drafting_graph
graph = get_drafting_graph()
result = await graph.ainvoke({"user_request": scenario_text})
- Extract draft text from result:
- Try
result["final_draft"]["draft_artifacts"][0]["text"] first
- Fallback to
result["draft"]["draft_artifacts"][0]["text"]
- Write the draft text into column C of that row
- Save Excel after each scenario
- Print: scenario number, word count, time taken
- Move to next scenario
Do this ONE scenario at a time. Do NOT batch. Save after each one.
Step 2: Error Analysis + Compare (Fill Columns E and F)
After all 10 drafts are filled, for each scenario:
- Read column C (Draft Agent) and column D (ChatGPT-5.4) from the Excel
- Run error analysis on BOTH drafts using
research/run_draft_benchmark.py --compare OR manually check:
Error Categories to Check:
| Category |
Severity |
What to Look For |
| Fabrication |
CRITICAL (-2.0) |
Invented AIR/SCC/ILR citations, fake annexures for documents not in input, invented events/dates |
| Wrong Statute |
CRITICAL (-2.0) |
Indian Evidence Act 1872 (repealed→BSA 2023), CrPC 1973 (repealed→BNSS 2023), IPC (repealed→BNS 2023), phantom S.27A SRA |
| Missing Section |
HIGH (-1.0) |
No verification clause, no prayer, no jurisdiction, no cause of action, no valuation, no court fee |
| Legal Error |
HIGH/MEDIUM (-1.0/-0.5) |
Limitation anchored to notice date, pendente lite cites S.34 CPC (should be Order XX Rule 11), facts-law section mixing, "and/or" usage |
| Placeholder Excess |
MEDIUM (-0.5) |
More than 15 {{PLACEHOLDER}} in one draft |
| Structural |
MEDIUM/LOW (-0.5/-0.25) |
Missing paragraph numbers, non-continuous numbering, no continuous numbering through document |
Scoring: Start at 10.0, deduct per severity above. Min 0, max 10.
Write into column E ("Compare"):
Winner: [pipeline/chatgpt] ([score diff])
Pipeline: [score]/10 ([word_count]w, [placeholder_count] placeholders)
ChatGPT: [score]/10 ([word_count]w, [placeholder_count] placeholders)
Write into column F ("Improvements") — list every pipeline error:
[CRITICAL] Fabricated citation: AIR 2019 SC 456
[HIGH] Missing: cause of action section
[MEDIUM] Pendente lite cites S.34 CPC instead of Order XX Rule 11
[MISSING] Sections present in ChatGPT but not pipeline: schedule of property
Save Excel after each scenario comparison
Step 3: Print Summary
After all 10 are compared, print:
- Average score: Pipeline vs ChatGPT
- Win count: Pipeline X | ChatGPT Y
- Top 3 error categories hurting pipeline (by frequency)
- Which scenarios pipeline loses worst on
Key Files
- Excel:
docs/Draft_test.xlsx (columns: s.no, Civil Draft Scenarios, Draft Agent, Chatgpt-5.4, Compare, Improvements)
- Pipeline:
app/agents/drafting_agents/drafting_graph.py → get_drafting_graph()
- Runner script:
research/run_draft_benchmark.py (--draft or --compare mode)
- Reports saved to:
research/output/
Running Via Script (Alternative)
# Fill Draft Agent column
agent_steer/Scripts/python.exe research/run_draft_benchmark.py --draft
# Compare + fill Compare and Improvements columns
agent_steer/Scripts/python.exe research/run_draft_benchmark.py --compare
1---2name: draft-benchmark3description: SKILL: draft-benchmark4---5# SKILL: draft-benchmark67Use when: user asks to run draft pipeline benchmarks, fill Draft_test.xlsx, compare with ChatGPT-5.4, or analyze draft errors.89## Instructions for Claude1011When this skill is invoked, follow these steps ONE BY ONE:1213### Step 1: Run Pipeline on Each Scenario (Fill "Draft Agent" Column C)1415For each of the 10 scenarios in `docs/Draft_test.xlsx` column B:16171. Read the scenario text from the Excel file using openpyxl182. Run the drafting pipeline:19 ```python20 import asyncio, openpyxl, sys, time21 from pathlib import Path22 sys.path.insert(0, str(Path("c:/Girish/Fundamental_Projects/ActionAi/Agent_steer_backend/BoardingMcp-Server")))23 from app.agents.drafting_agents.drafting_graph import get_drafting_graph2425 graph = get_drafting_graph()26 result = await graph.ainvoke({"user_request": scenario_text})27 ```283. Extract draft text from result:29 - Try `result["final_draft"]["draft_artifacts"][0]["text"]` first30 - Fallback to `result["draft"]["draft_artifacts"][0]["text"]`314. Write the draft text into column C of that row325. Save Excel after each scenario336. Print: scenario number, word count, time taken347. Move to next scenario3536Do this ONE scenario at a time. Do NOT batch. Save after each one.3738### Step 2: Error Analysis + Compare (Fill Columns E and F)3940After all 10 drafts are filled, for each scenario:41421. Read column C (Draft Agent) and column D (ChatGPT-5.4) from the Excel432. Run error analysis on BOTH drafts using `research/run_draft_benchmark.py --compare` OR manually check:4445**Error Categories to Check:**4647| Category | Severity | What to Look For |48|----------|----------|------------------|49| Fabrication | CRITICAL (-2.0) | Invented AIR/SCC/ILR citations, fake annexures for documents not in input, invented events/dates |50| Wrong Statute | CRITICAL (-2.0) | Indian Evidence Act 1872 (repealed→BSA 2023), CrPC 1973 (repealed→BNSS 2023), IPC (repealed→BNS 2023), phantom S.27A SRA |51| Missing Section | HIGH (-1.0) | No verification clause, no prayer, no jurisdiction, no cause of action, no valuation, no court fee |52| Legal Error | HIGH/MEDIUM (-1.0/-0.5) | Limitation anchored to notice date, pendente lite cites S.34 CPC (should be Order XX Rule 11), facts-law section mixing, "and/or" usage |53| Placeholder Excess | MEDIUM (-0.5) | More than 15 `{{PLACEHOLDER}}` in one draft |54| Structural | MEDIUM/LOW (-0.5/-0.25) | Missing paragraph numbers, non-continuous numbering, no continuous numbering through document |5556**Scoring:** Start at 10.0, deduct per severity above. Min 0, max 10.57583. Write into column E ("Compare"):59 ```60 Winner: [pipeline/chatgpt] ([score diff])61 Pipeline: [score]/10 ([word_count]w, [placeholder_count] placeholders)62 ChatGPT: [score]/10 ([word_count]w, [placeholder_count] placeholders)63 ```64654. Write into column F ("Improvements") — list every pipeline error:66 ```67 [CRITICAL] Fabricated citation: AIR 2019 SC 45668 [HIGH] Missing: cause of action section69 [MEDIUM] Pendente lite cites S.34 CPC instead of Order XX Rule 1170 [MISSING] Sections present in ChatGPT but not pipeline: schedule of property71 ```72735. Save Excel after each scenario comparison7475### Step 3: Print Summary7677After all 10 are compared, print:78- Average score: Pipeline vs ChatGPT79- Win count: Pipeline X | ChatGPT Y80- Top 3 error categories hurting pipeline (by frequency)81- Which scenarios pipeline loses worst on8283## Key Files8485- Excel: `docs/Draft_test.xlsx` (columns: s.no, Civil Draft Scenarios, Draft Agent, Chatgpt-5.4, Compare, Improvements)86- Pipeline: `app/agents/drafting_agents/drafting_graph.py` → `get_drafting_graph()`87- Runner script: `research/run_draft_benchmark.py` (--draft or --compare mode)88- Reports saved to: `research/output/`8990## Running Via Script (Alternative)9192```bash93# Fill Draft Agent column94agent_steer/Scripts/python.exe research/run_draft_benchmark.py --draft9596# Compare + fill Compare and Improvements columns97agent_steer/Scripts/python.exe research/run_draft_benchmark.py --compare98```