[camera_andriod_camerax] Add gspencergoog/write-prose skill - #12309
[camera_andriod_camerax] Add gspencergoog/write-prose skill#12309camsim99 wants to merge 3 commits into
gspencergoog/write-prose skill#12309Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request introduces the write-prose skill, which includes guidelines, standards, and a Python script (analyze_prose.py) to analyze text statistics and scan for banned AI-isms. Feedback on the changes highlights several issues: hardcoded absolute paths in SKILL.md and standards.md, markdown links wrapped in backticks in SKILL.md violating the defined standards, a bug in analyze_prose.py where the banned word scanner fails to track code blocks, and an issue where sentence splitting is performed on raw text instead of filtered paragraphs, skewing statistics.
| 1. **Run the Statistical Analyzer**: | ||
| Execute the analyzer script on the target file: | ||
| ```bash | ||
| python3 /usr/local/google/home/gspencer/.gemini/config/skills/write-prose/scripts/analyze_prose.py <path-to-file> |
There was a problem hiding this comment.
This command uses a hardcoded absolute path pointing to a specific user's home directory (/usr/local/google/home/gspencer/...). This will fail for other developers and CI environments. Please use a repository-relative path instead.
| python3 /usr/local/google/home/gspencer/.gemini/config/skills/write-prose/scripts/analyze_prose.py <path-to-file> | |
| python3 third_party/skill-repos/gspencergoog/.agents/skills/write-prose/scripts/analyze_prose.py <path-to-file> |
| | **Word Length** | $\le \mathbf{5\text{ characters}}$ median | Prefer simple words (*use* vs *utilize*, *check* vs *investigate*). | | ||
| | **Noun Clusters** | $\le \mathbf{3\text{ consecutive nouns}}$ | Avoid heavy noun stacks (e.g., write *"system for monitoring engine temperature"*, not *"engine temperature monitoring system"*). | | ||
|
|
||
| Run `python3 /usr/local/google/home/gspencer/.gemini/config/skills/write-prose/scripts/analyze_prose.py <path-to-file>` to measure these stats automatically. |
| - **Pull Request Descriptions**: Refer to [`write-pr-description`](../write-pr-description/SKILL.md) for diff structure and testing steps. | ||
| - **Commit Messages**: Refer to [`commit-changes`](../commit-changes/SKILL.md) for conventional commit formatting. | ||
| - **Code & API Documentation**: Refer to [`code-documentation`](../code-documentation/SKILL.md) for docstring and tag conventions. | ||
| - **AI Prompts & Skill Instructions**: Refer to Section 7 in [`references/standards.md`](references/standards.md#7-prompt-design-standards-for-llm-audiences) for XML tagging, primacy placement, and token conservation. |
There was a problem hiding this comment.
These links violate the critical rule defined in standards.md (Section 2), which states that markdown link text should never be wrapped in backticks because it breaks clickable formatting in IDEs and web views.
| - **Pull Request Descriptions**: Refer to [`write-pr-description`](../write-pr-description/SKILL.md) for diff structure and testing steps. | |
| - **Commit Messages**: Refer to [`commit-changes`](../commit-changes/SKILL.md) for conventional commit formatting. | |
| - **Code & API Documentation**: Refer to [`code-documentation`](../code-documentation/SKILL.md) for docstring and tag conventions. | |
| - **AI Prompts & Skill Instructions**: Refer to Section 7 in [`references/standards.md`](references/standards.md#7-prompt-design-standards-for-llm-audiences) for XML tagging, primacy placement, and token conservation. | |
| - **Pull Request Descriptions**: Refer to [write-pr-description](../write-pr-description/SKILL.md) for diff structure and testing steps. | |
| - **Commit Messages**: Refer to [commit-changes](../commit-changes/SKILL.md) for conventional commit formatting. | |
| - **Code & API Documentation**: Refer to [code-documentation](../code-documentation/SKILL.md) for docstring and tag conventions. | |
| - **AI Prompts & Skill Instructions**: Refer to Section 7 in [references/standards.md](references/standards.md#7-prompt-design-standards-for-llm-audiences) for XML tagging, primacy placement, and token conservation. |
| for line_idx, line in enumerate(lines, 1): | ||
| # Skip code blocks | ||
| if line.strip().startswith('```') or line.strip().startswith('|'): | ||
| continue |
There was a problem hiding this comment.
The current implementation only skips the lines that start with ``` or |, but it does not track whether the scanner is currently inside a code block. This will cause false positives for any banned words that appear inside code blocks. We should track in_code_block to correctly skip all code block contents.
in_code_block = False
for line_idx, line in enumerate(lines, 1):
line_str = line.strip()
if line_str.startswith('```'):
in_code_block = not in_code_block
continue
if in_code_block or line_str.startswith('|'):
continue| median_word_length = statistics.median(word_lengths) if word_lengths else 0 | ||
|
|
||
| # Sentences analysis | ||
| sentences = split_into_sentences(full_text) |
There was a problem hiding this comment.
Splitting sentences directly from full_text includes code blocks, tables, and headers, which will highly skew the sentence count and length statistics. Since paragraphs already filters out these non-prose elements, we should split sentences from the extracted paragraphs instead.
| sentences = split_into_sentences(full_text) | |
| sentences = [] | |
| for para in paragraphs: | |
| sentences.extend(split_into_sentences(para)) |
reidbaker
left a comment
There was a problem hiding this comment.
Normally we would add evidence of this skill running and providing value before merging.
Installs https://github.com/gspencergoog/skills/tree/main/skills/write-prose to the third_party directory and symlinks it to the camera_android_camerax plugin.
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2