Skip to content

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

Merged
jamesramsden-bh merged 13 commits into
developfrom
Python_Toolkit-#264-AddBHoMPythonClaudeSkill
Nov 23, 2026
Merged

jamesramsden-bh merged 13 commits into
developfrom
Python_Toolkit-#264-AddBHoMPythonClaudeSkill

Conversation

@Felix-Mallinder

@Felix-Mallinder Felix-Mallinder commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Issues addressed by this PR

Closes #264

Adds a Claude Code skill in .claude/skills/bhom-python/ that guides how Python in Python_Toolkit is written, tested and reviewed:

  • 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 (PY-xxx) and review report format

Also adds .claude/skills/bhom-branch-naming/, a skill for naming branches <Project>-#<IssueNumber>-<PascalCaseDescription>.

This PR is documentation only. No code changes.

Test files

None needed. The code examples and the C# -> run_wrapped contract described in SKILL-FRAMEWORK.md were checked against develop (d9d1edd) in an installed Python_Toolkit/v3_10 environment.

To try it: open this repo in Claude Code and ask it to add a small helper plus a C#-callable wrapper with tests, or to review bhom/decorators/_bhom_callable_decorator.py.

Changelog

  • Added bhom-python Claude Code skill for writing, testing and reviewing Python in Python_Toolkit.

Additional comments

Review decisions are applied in the skill text (see each skill's CHANGELOG.md). Still open, tracked in #264: test location, the wrapped-method identifier convention, and lint/CI configuration.

🤖 Generated with Claude Code

Draft (v0.2.0, for QA) Claude Code skill covering Python in Python_Toolkit:
- SKILL.md: overview, golden rules, decision tree
- SKILL-IMPLEMENTATION.md: package layout, packaging, style rules
- SKILL-FRAMEWORK.md: bhom_callable + run_wrapped as the only C# route,
  BHoMObject/IObject and BHoM JSON, logging, analytics, pythonnet,
  known framework defects on develop
- SKILL-TESTING.md: pytest standards, wrapped-method test patterns
- SKILL-REVIEW.md: compliance rule catalogue and review report format
- QA-NOTES.md: open decisions for reviewers (remove before release)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…defects

- Console-logger-on-stdout defect now references the UV environment
  management update (#253), where the C# run method returns stdout and
  stderr separately, instead of an open question about moving to stderr.
- Removed references to defects already fixed on develop.
- Bumped SKILL-FRAMEWORK, SKILL-IMPLEMENTATION and CHANGELOG to 0.2.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… value

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Felix-Mallinder and others added 2 commits November 18, 2026 12:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Felix-Mallinder Felix-Mallinder left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we don't need the QA notes file to be merged

@Felix-Mallinder Felix-Mallinder left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We should be authoring these filesBHoM

@Felix-Mallinder
Felix-Mallinder marked this pull request as ready for review November 19, 2026 09:20
Felix-Mallinder and others added 2 commits November 19, 2026 09:24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- PY-F07/S22: no "error" in Python file or folder names (fails the
  BHoMBot installer check on dependent toolkits, #266)
- PY-F03 tightened: file named after its single public class/function
- PY-D05: docstring Args complete, in order, punctuated; Returns present
- PY-B11: no custom_data in place of real properties
- Mapping from BHoM CodeComplianceTest_Engine checks to Python rules
- scripts/check_file_names.py and scripts/check_docstrings.py

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Felix-Mallinder

Copy link
Copy Markdown
Contributor Author

@BHoMBot check required

@bhombot-ci

bhombot-ci Bot commented Nov 20, 2026

Copy link
Copy Markdown

@Felix-Mallinder to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

There are 1 requests in the queue ahead of you.

@SimosManiatis SimosManiatis 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.

I checked it against the repo: the counts it reports for develop (34 PY-F03, 9 PY-D05, 24 BOM files) match when I run the scripts, and the defects I spot-checked (except:, is_annual, Errors.extend, HOME) are real.

1.Links to skills not in the repo. bhom-coding-standards, bhom-copyright, bhom-develop, bhom-om, bhom-engine and bhom-debug are linked as ..//SKILL.md, but only bhom-python and bhom-branch-naming are in .claude/skills/. Could the key rules (British English, priority order) be inlined, or the skills be added?

2.check_docstrings.py: a description line starting with Word: (e.g. Note: ...) is read as a new entry, so the description before it gets flagged for missing punctuation. It also checks nested functions; is that intended?

3.SKILL-REVIEW.md proposed config: pyproject.toml already sets pytest pythonpath = "src"; the proposal should only add what's missing.
Nit: the branch-naming example uses #270, which is a real (unrelated) issue. Could you use #264?

@Felix-Mallinder Felix-Mallinder added the type:feature New capability or enhancement label Nov 23, 2026

@Tom-Kingstone Tom-Kingstone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved as all my changes have been resolved

@jamesramsden-bh
jamesramsden-bh merged commit b48da80 into develop Nov 23, 2026
19 checks passed
@jamesramsden-bh
jamesramsden-bh deleted the Python_Toolkit-#264-AddBHoMPythonClaudeSkill branch November 23, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New capability or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants