Skip to content

Add bhom-python Claude Code skill for writing, testing and reviewing Python #264

Open

Description

@Felix-Mallinder

Description:

Add a Claude Code skill to Python_Toolkit so AI-assisted development writes, tests and reviews Python to the BHoM standard.

The skill lives in .claude/skills/bhom-python/ and builds on the published guidance in Python_Engine/Python/README.md. It contains:

  • SKILL.md - overview, golden rules and decision tree
  • SKILL-IMPLEMENTATION.md - package layout, packaging and style rules
  • SKILL-FRAMEWORK.md - bhom_wrapper.bhom_callable + run_wrapped as the route from C# into Python, BHoMObject/IObject and BHoM JSON, logging, bhom_analytics and pythonnet
  • SKILL-TESTING.md - pytest standards, including tests for wrapped (C#-callable) methods
  • SKILL-REVIEW.md - compliance rule catalogue and review report format

Expected behaviour: when working in this repo, Claude Code loads the skill for Python work, and its code and reviews follow the rules above.

Open decisions to settle during review:

  • Copyright header on .py files
  • Test location (Python_Engine/Python/tests/ vs .ci/unit_tests/python/)
  • Identifier convention for wrapped methods
  • A black/pylint configuration and a Python CI step

While drafting the skill, these framework issues came up. They can be split into separate issues if preferred:

  • bhom_callable fails when the input JSON root is a BHoM-serialised CustomObject or Dictionary, because BHoM_Guid / _t / _bhomVersion are passed as keyword arguments
  • bhom_callable uses a bare except:, and invalid JSON then raises UnboundLocalError
  • bhom/wrapped/_test_wrapped.py registers a "test" method that prints to stdout
  • CONSOLE_LOGGER writes to stdout, the same stream as wrapped results
  • validate_timeseries(is_annual=True) always raises

Metadata

Metadata

Labels

type:featureNew capability or enhancement

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions