Skip to content

feat(edit-writing-with-jev): add Jev writing-tell detection, calibration, and rewrite skill - #187

Closed
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1789741117-edit-writing-with-jev-skill
Closed

devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1789741117-edit-writing-with-jev-skill

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Packages the Jev editing loop from openrouter-web#44634 (blog) and openrouter-web#44308 (cookbook) as an installable skill, and adds the human-in-the-loop calibration step those posts describe but do not automate. SKILL.md follows the writing-for-agents structure (ordered steps, each ending on a Done when criterion, reference material behind pointers).

Flow the agent runs

  1. File path or pasted text becomes a draft file, the user supplies a one-string brief (task), and rubric.json is copied into a working dir.
  2. evaluate.ts prints findings plus near_misses (noul answers within --margin under the threshold) and writes every raw probability to answers.json.
  3. Agent shows findings and near misses, asks "did it miss any tells?" and "is anything flagged fine as written?"
  4. Each report maps to a rubric edit: regex/vocabulary entry, structure check on or off, reworded or new proposition, exception clause, or threshold change. probe.ts asks Jev about one passage with --check <id> or an ad hoc --instructions (returned as candidate) so wording is tested before it is saved. Re-evaluate, repeat until the user accepts the list.
  5. rewrite.ts runs the evaluate → writer → evaluate loop and reports stopped: clean | rounds | length.

Rubric coverage vs. Wikipedia: Signs of AI writing

The cookbook rubric covered the Content and Language sections. This PR adds the Style, Communication, and Markup signs that apply to a Markdown draft, and leaves out the wiki-only ones (wikitext, template and category names, citation validity, edit summaries, talk-page behavior, AfC).

Wikipedia section Rubric checks
Content (significance, notability, superficial analysis, promotion, vague attribution, challenges boilerplate) puffed_significance, canned_notability, tacked_on_analysis, promotional_tone, weasel_attribution, challenges_boilerplate, neutrality
Language (vocabulary, copula avoidance, vague association, negative parallelism, rule of three) ai_vocabulary (list extended with the GPT-4o era words), copula_avoidance, vague_association, negative_parallelism, rule_of_three_flourish
Style (title heading, title case, empty headings, bold, inline-header lists, em dashes, emoji, small tables, curly quotes, skipped levels, level-1 overuse, thematic breaks) title_heading, title_case_heading, empty_heading, bold_overuse, inline_header_list, dash, emoji, small_table, curly_quotes, skipped_heading_level, multiple_h1, thematic_break
Communication (collaborative voice, knowledge-cutoff speculation, placeholders) assistant_voice_leak, knowledge_gap_speculation, placeholder_text
Markup (Markdown in wikitext, ChatGPT, Gemini, Grok, DeepSeek, Perplexity artifacts, utm_source) Markdown itself is not a tell in a Markdown draft, so the blanket markdown_syntax pattern is gone. citation_artifact now matches every listed marker and referrer=grok.com
Historical (didactic disclaimers, section summaries, elegant variation) section_summary, elegant_variation, padding

Differences from the cookbook code worth knowing

  • Rubric is data (rubric.json), not constants, so calibration is a file edit. The scripts validate its shape and fail closed on missing or mistyped Jev answers.
  • New paragraph_scope preamble prepended to every paragraph proposition. Without it Jev judged the whole article for some checks; on the test draft a three-word lead-in paragraph fired passive_voice at 0.85 because a later paragraph was passive. With the preamble it read 0.06. The scoping sentence that lived only inside mannered_prose moved here.
  • New structure rubric section for checks that need the whole draft: lintStructure(body, held, rubric) walks the heading list for title_heading (H1 equal to the front matter title), multiple_h1, skipped_heading_level, empty_heading (level 2+ followed by a heading or EOF), and inspects held-out tables for small_table (three or fewer non-separator rows). Its fix names the [[HELD_n]] line and carries the cells, and the writer prompt now allows replacing a held line when an instruction names it. The check stops firing once the token is gone from the body.
  • Front matter, fenced code, and tables are otherwise held out as [[HELD_n]] paragraphs (skipped by lint and Jev, told to the writer to copy through) and restored on output, so the length check counts prose only.
  • Writer prompt splits fixed instructions (system) from <task>/<article>/<instructions> (user) per the cookbook's injection note. Findings are sorted by location since paragraph evaluation is concurrent (pool of 8).
  • stiff_register only fires when the paragraph has a full form that could be contracted (the dry run showed it firing on plain past-tense narration).
  • No zod, matching the other script-bearing skills' tsx-only package.json.

Validation

  • tsc --noEmit --strict clean on all four scripts.
  • Author run against a seeded draft with front matter, a code block, and a table: evaluate.ts produced 18 findings and 4 near misses, probe.ts confirmed the scope fix above, rewrite.ts with openai/gpt-6-astra stopped length after 2 rounds (18 → 3 findings, held-out blocks restored byte-for-byte).
  • Fresh-agent dry run of all six SKILL.md steps from a clean npm install, including both calibration branches and four negative paths, reached stopped=clean. Details and the fixes it prompted are in the PR comment below. stopped=rounds was not exercised.
  • Style and structure checks (commit 48465aa): a synthetic draft seeded with every new sign fired all 13 new checks at the expected locations offline. Probes on elegant_variation read 0.89 on a synonym-rotating paragraph and 0.08 on the same paragraph with pronouns, and section_summary read 0.90 on an "In summary" closer and 0.08 on a next-steps closer. A one-round rewrite.ts on the synthetic draft replaced the two-row table with a sentence and cleared the other 14 findings.
  • Searched existing PRs for "jev"; none matched.

Link to Devin session: https://openrouter.devinenterprise.com/sessions/c34d613248034f6b80365e2163bb2cfb
Open in Devin Desktop: https://openrouter.devinenterprise.com/desktop/session/c34d613248034f6b80365e2163bb2cfb?variant=devin

…ion, and rewrite skill

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Original prompt from Kenny

look at the workflow we used in PR 44634 for the jev-based re-writing and turn this into a skill in our skills repo, use this skill to write it: https://github.com/mattpocock/skills/blob/main/skills/productivity/writing-for-agents/SKILL.md

It should allow the user to point at a file or past some text, do the rewrite via jev to identify any tells, ask if it missed any, adjust the patterns and sensitivity if so, and then rewrite the piece

…ields, tighten stiff_register

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Fresh-agent dry run of all six steps passed against live Jev and the default writer on 7eeae30, and the gaps it found are fixed in 3a50717.

Fixed in 3a50717

  • Running npx tsx <skill-path>/scripts/... from the work directory did not pick up scripts/node_modules, so npx prompted to install tsx again and printed the prompt ahead of the JSON. SKILL.md now runs every command as cd <skill-path>/scripts && npx tsx ... with absolute paths, matching the other script-bearing skills.
  • Prerequisites said to report cost_usd from every script. Evaluate and probe emit jev_cost_usd. Named both.
  • Step 6 now prescribes diff -u.
  • stiff_register fired on paragraphs with no full form to contract. The exception clause the dry run had to add by hand is now in the default rubric.
Proof
  • Evaluate: 15 findings, 4 near misses, exit 0. Three [[HELD_n]] paragraphs and the dialogue/question paragraph produced no findings.
  • Calibration, missed tell: puffed_significance probe 0.69 → 0.91 after rewording, clean control 0.06, re-evaluation fired at 0.91.
  • Calibration, false positive: stiff_register probe 0.82 → 0.31 after the exception clause, clean control 0.11, re-evaluation 0.36.
  • Rewrite, defaults: two writer rounds, findings 12 → 1 → 0, stopped=clean. Front matter, code block, and table byte-identical. Masked word count 223 → 211 (5.4 percent).
  • Negative paths: unknown --check, missing --task, unset OPENROUTER_API_KEY, and thresholds.noul as a string each exit 1.
  • Installed rubric.json checksum unchanged, git status clean after the run.
  • Total billed: $0.0865 (writer $0.0829, Jev $0.0036).
  • Not exercised: stopped=rounds and stopped=length (the latter was reached in my own earlier run). Borderline probabilities varied by a few hundredths between an all-check evaluation and a single-check probe, which SKILL.md now notes.
npx prompt ahead of JSON (before fix) Rewrite and preservation checks
npx installation prompt Rewrite and preservation verification

…kipedia's Signs of AI writing

Replace the blanket markdown_syntax pattern with bold_overuse, inline_header_list, thematic_break, title_case_heading, and placeholder_text. Add a structure section (title_heading, multiple_h1, skipped_heading_level, empty_heading, small_table) evaluated over the whole draft, including held-out tables. Widen citation_artifact to the Gemini, DeepSeek, Grok, Perplexity, and Copilot markers and the GPT-4o era vocabulary. Add elegant_variation and section_summary propositions.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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