Skip to content

feat(linkml-engineering): vendor tested Neo4j-targeting generators; add generated skill inventory - #49

Merged
costezki merged 2 commits into
developfrom
feature/linkml-neo4j-generators-and-skill-inventory
Jul 24, 2026
Merged

feat(linkml-engineering): vendor tested Neo4j-targeting generators; add generated skill inventory#49
costezki merged 2 commits into
developfrom
feature/linkml-neo4j-generators-and-skill-inventory

Conversation

@costezki

Copy link
Copy Markdown
Contributor

Summary

LinkML → Neo4j generators (tools/linkml_neo4j/), driven by openspec/changes/linkml-neo4j-generators:

  • Fixed two confirmed bugs found by actually running the generators against a real schema (vendored from hulubul-broker, CC-BY-4.0, attributed): a relationship whose LinkML range is an abstract class resolved to an undefined Python class in the generated neomodel code; neomodel's reserved id/deleted/element_id attribute names crashed class definition outright (the schema's identifier slot is conventionally named id).
  • Enriched the Cypher generator: existence constraints for required-multivalued properties (previously silently skipped), a --profile community/--profile full split (Community-safe subset vs. the unverified-on-Community reference output), and schema-driven CREATE INDEX via an opt-in neo4j_index annotation.
  • Vendored both generators as tested repo tooling, not skill assets — a Skill's home is knowledge (spec/skill-repo-governance.md), not a maintained codebase, so linkml-engineering documents and cites them rather than owning the code.
  • project-setup gains a real --neo4j scaffold.sh flag that projects a pinned, refreshable copy into a consuming repo — verified by actually running it (dry-run, real copy, skip-on-rerun, force-refresh, and confirming no scripts/ appears without the flag).

Generated skill inventory (docs/skill-inventory.md, tools/skill_inventory.py):

  • A generated (never hand-edited) map of all 22 skills: bundle containment + purpose classification as one Mermaid diagram, and a second diagram for skill-to-skill relations distinguishing a mechanically-parsed "depends on" (from each skill's own Delegates text) from the weaker "related" (the rest of the Related list).
  • Freshness enforced by tests/test_skill_inventory.py (fails make test on drift), same pattern as the existing .opencode/ drift gate.
  • AGENTS.md documents the one manual step (make skill-inventory after adding/editing a skill) vs. what's automated (drift detection, everything else).

Test plan

  • make validate (lint + test): 92 passed, 0 failed, 7 deselected (opt-in Docker-marked integration tests).
  • Both Mermaid diagrams compiled with mermaid-cli and visually reviewed as PNGs, not just eyeballed as text.
  • scaffold.sh --neo4j exercised end-to-end against a scratch directory (dry-run, real copy byte-identical to source, skip/force-refresh behavior, and confirmed --neo4j-less runs create no scripts/).
  • The Neo4j Community/Enterprise constraint-support spike (tests/test_linkml_neo4j_integration.py, pytest -m docker) is written but not executed — this sandbox had no reachable Docker daemon. Needs a real run before treating its "passed" status as verified; see the generator's own module docstring for the current caveat.

🤖 Generated with Claude Code

…dd generated skill inventory

Fixes two confirmed bugs in the Neo4j Cypher-constraint and neomodel
generators (a relationship whose LinkML range is abstract resolved to an
undefined class; neomodel's reserved id/deleted/element_id attribute names
crashed class definition), enriches the Cypher generator (existence
constraints for required-multivalued properties, a Community-safe --profile,
schema-driven CREATE INDEX via an opt-in annotation), and vendors both as
tested repo tooling in tools/linkml_neo4j/ — a skill's home is knowledge, not
a maintained codebase, so linkml-engineering documents and cites them rather
than owning the code. project-setup gains a real --neo4j scaffold.sh flag
that projects a pinned, refreshable copy, verified by actually running it.

Also adds docs/skill-inventory.md: a generated (not hand-written) map of all
22 skills — bundle containment, cross-cutting purpose classification, and
two distinct skill-to-skill relation types (mechanically parsed "depends on"
vs the weaker "related") rendered as Mermaid diagrams, with a freshness gate
so it can't silently drift from the skills it describes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…v.txt

CI's validate job installs only requirements-dev.txt, which never listed
the packages tools/linkml_neo4j's generators actually import. Passed
locally because these happened to already be present in the dev venv;
failed in CI's clean environment with ModuleNotFoundError: No module
named 'click' (the first missing import hit), 24 test errors.
testcontainers is deliberately left out: its import is guarded inside the
Docker-gated integration test, not at module level, so it isn't needed
for the default (non-docker) test path.

Verified against a genuinely clean venv, not the existing dev one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@costezki
costezki merged commit a8f5e7f into develop Jul 24, 2026
5 checks passed
@costezki
costezki deleted the feature/linkml-neo4j-generators-and-skill-inventory branch July 24, 2026 06:31
costezki added a commit that referenced this pull request Jul 24, 2026
Resolves the README skill-count conflict: 22 (PR #49's corrected count)
+ 1 (writing-antipatterns) = 23.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant