Add proofread_markdown skill and Dart wrapper script#13258
Add proofread_markdown skill and Dart wrapper script#13258antfitch wants to merge 3 commits intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new markdown proofreading skill and a supporting Dart script for automated line wrapping. The review feedback identifies a hardcoded absolute path in the documentation that needs to be corrected to a relative path. Additionally, the line-wrapping script has limitations in detecting ordered lists beyond three items and contains logic errors in the wrapText function that cause indentation loss and inaccurate width calculations.
|
Visit the preview URL for this PR (updated for commit 8d727f8): https://flutter-docs-prod--pr13258-add-proofreading-skill-sfkqpa8t.web.app |
| 1. Navigate to the **Search** tab (Magnifying Glass icon). | ||
| 2. Select **View topics** from the dropdown (default). | ||
| 3. Enter your query in the "Query" text box (e.g., "Flutter widgets"). | ||
| 4. Press **Enter**. | ||
| 5. View results in the main content area. |
There was a problem hiding this comment.
One thing that bugs me about the bots, is that they complain about this:
1. a
1. b
1. c
1. d
However, we PREFER this in a markdown file. Markdown numbers the steps and then if, later, you remove or add a line, it automatically fixes it.
| @@ -0,0 +1,96 @@ | |||
| import 'dart:io'; | |||
There was a problem hiding this comment.
OK, I've said this offline, but I really don't like this form of breaking lines. It's ugly, it's nasty to maintain. Semantic line breaks are much easier for a writer to process, read, update. Meaning, break on punctuation first, like commas, periods, semi-colons, colons. THEN if lines are still too long, break on natural pauses. Since that might be harder to teach a bot, I could live with breaking on 80 chars THEN.
It's MUCH easier to understand the diff of a file that uses semantic line breaks, rather than a straight 80 char line break. MUCH MUCH easier.
There was a problem hiding this comment.
Yes to this. Breaking at 80 characters without considering meaning or structure isn't really useful and I'm worried about maintaining this script as well.
I've found agents can write and update text to use semantic breaks quite well. You just need to tell them to and reference a reference doc that briefly explaina the format and provides some examples.
There was a problem hiding this comment.
A few thoughts I had around this today:
When I read a book (paperback or kindle), words generally break after a certain number of characters that don't fit on a line and this has never bothered me. So when I look at this discussion through that lens, breaking things semantically doesn't do much for me. Because I've been looking at markdown files for several years at work that simply follow the 80-character rule, I just don't have the issues of readability with non-semantic breaks.
Having an agent go line by line through a markdown file burns up a lot of tokens and is slower than a script that doesn't require tokens. On very large markdown files, a lot of tokens can be burned.
I've noticed from past recent experience that agents make mistakes when I ask them to manually go through a markdown file and fix line length. Especially in longer files, like us, they sometimes miss lines and I have to go back and double-check everything.
So, I feel strongly that we need to keep this, and especially for larger documents. However, I think we should have the ability for the author to choose.
There was a problem hiding this comment.
I feel very strongly about this. I just pulled up this answer from Antigravity (it has not seen our conversation)
"Can you assess how token expensive checking line lengths is? Let's assume you have a document with 500 lines."
Direct LLM Check: 8,000 to 20,000 tokens (Expensive and prone to counting errors).
Tool-Assisted Check: ~100 tokens (Extremely cheap and 100% accurate).
If you are planning to implement this as part of a skill, I strongly recommend writing a short Dart script or using a regex-based tool to do the line-length checking and reporting back to the agent!
There was a problem hiding this comment.
For this reason, I want to make sure we give contributors a choice. If they want to, they can choose one of three options and do some of the work by hand if they need to use semantic breaks.
There was a problem hiding this comment.
BUT I will admit. When I chose the semantic line breaks option when presented by the agent, I love the results.
|
|
||
| ## 1. Check line length | ||
|
|
||
| Leadership does not want markdown files to have lines that exceed 80 characters. |
There was a problem hiding this comment.
This is NOT about Leadership. Please change that. This is what GitHub wants and the convention that we've agreed to and adhered to.
There was a problem hiding this comment.
Deal! Actually I just grabbed @conooi's intro (love it!)
| ## Project Configuration | ||
| ``` | ||
|
|
||
| Change it to active voice that looks like this: |
There was a problem hiding this comment.
Also mention that we don't use gerunds in titles or headers. So: "Configure project" is cool but "Configuring project" is to be avoided.
There was a problem hiding this comment.
Grabbed @conooi's version. I think you'll like!
Also, if a heading changes, I had the skill add the original link id after the heading to links don't break. ## Configure the project {: #project-configuration }
| Change steps to be direct like this: | ||
|
|
||
| ``` | ||
| ### Search for a Topic |
There was a problem hiding this comment.
This should be:
### Search for a topic
| 3. Enter your query in the "Query" text box (e.g., "Flutter widgets"). | ||
| 4. Press **Enter**. | ||
| 5. View results in the main content area. | ||
| ``` |
There was a problem hiding this comment.
I had feedback I don't see now. But a numbered list should use "1." for each line.
|
Add the format that @parlough is using here to separate sections: https://github.com/flutter/website-cms/blob/main/.agents/skills/generate-showcase-from-video/SKILL.md |
Just clarifying: That new, fancy skill is by @abdallahshaban557 :) |
7f88129 to
8d727f8
Compare
Proofread markdownskill for the Flutter Docs repo. You can use this skill to update your markdown files to follow the Flutter doc teams formatting guidelines.This is an early version of this skill. As time goes on, we'll update it to be more complete, fix bugs, etc. Use this with your AI agents, but in a mode where you can approve the changes.