Skip to content

Add measured RDKit Nature-style skill - #2

Merged
boxuan-zhao merged 1 commit into
mainfrom
agent/add-rdkit-nature-style
Jul 12, 2026
Merged

Add measured RDKit Nature-style skill#2
boxuan-zhao merged 1 commit into
mainfrom
agent/add-rdkit-nature-style

Conversation

@boxuan-zhao

Copy link
Copy Markdown
Contributor

What changed

  • Add the personal rdkit-nature-style skill under skills/boxuan-zhao/.
  • Add deterministic RDKit SVG/PNG rendering with runtime cm/pt conversion.
  • Add mandatory post-render measurements for bond length, SVG stroke width, and font size.

Why

RDKit has no official Nature preset. This skill provides a clearly labeled Nature-like local preset and verifies finished geometry instead of trusting drawing options alone.

Impact

The new skill is independently installable and does not modify existing shared skills or molecular chemistry. It defaults to a 0.381 cm atom-center bond length, 0.021 cm stroke, Arial 6 pt, and calibrated atom-label clearance.

Validation

  • Rendered representative SVG and stereochemical PNG examples.
  • Measured all 14 example bonds at 0.381 cm.
  • Measured SVG stroke width at 0.021167 cm and font size at 6.0 pt.
  • Passed skill-creator quick_validate.py.
  • Passed python scripts/validate_skills.py for all 28 skills.
  • Confirmed catalog discovery with npx skills add . --list --full-depth.

Changes:
- add a personal rdkit-nature-style skill with trigger and workflow guidance
- add deterministic SVG/PNG rendering with physical-unit conversion
- add mandatory post-render bond, stroke, and font measurements

Impact:
- adds one independently installable AtomFlow skill under boxuan-zhao
- does not modify existing shared skills or chemistry semantics

Verification:
- rendered representative SVG and stereochemical PNG examples
- passed skill-creator quick_validate.py
- passed scripts/validate_skills.py for all 28 skills
- confirmed discovery with npx skills add . --list --full-depth
Copilot AI review requested due to automatic review settings July 12, 2026 17:51
@boxuan-zhao
boxuan-zhao merged commit 4249af9 into main Jul 12, 2026
2 checks passed
@boxuan-zhao
boxuan-zhao deleted the agent/add-rdkit-nature-style branch July 12, 2026 17:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new personal skill (rdkit-nature-style) that provides a deterministic, physically calibrated RDKit rendering preset (SVG/PNG) and emits a measurement JSON after rendering to validate bond-length targets and report key draw parameters.

Changes:

  • Introduces skills/boxuan-zhao/rdkit-nature-style skill documentation and agent entrypoint.
  • Adds scripts/render_nature_style.py to render with fixed physical units (cm/pt via DPI) and emit *.measurements.json.
  • Implements post-render measurement reporting for bond lengths (and stroke/font reporting for SVG).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
skills/boxuan-zhao/rdkit-nature-style/SKILL.md Documents the Nature-like preset, workflow, and required post-render validation steps.
skills/boxuan-zhao/rdkit-nature-style/scripts/render_nature_style.py Implements RDKit rendering with cm/pt → px conversion and post-render measurement JSON output.
skills/boxuan-zhao/rdkit-nature-style/agents/openai.yaml Registers the skill with a display name and default prompt for the OpenAI agent interface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +48 to +51
font = Path(args.font_file) if args.font_file else Path(r"C:\Windows\Fonts\arial.ttf")
if font.is_file():
opts.fontFile = str(font)
rdMolDraw2D.SetMonochromeMode(opts, (0, 0, 0), (1, 1, 1))
Comment on lines +101 to +105
drawer.DrawMolecule(mol)
drawer.FinishDrawing()
data = drawer.GetDrawingText()
report = measure(drawer, mol, args, data if suffix == ".svg" else None)
report["canonical_smiles"] = canonical_before
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.

2 participants