Skip to content

Commit 97f52de

Browse files
authored
Merge pull request #186 from NVIDIA-NeMo/fix/hide-skill-lifecycle-docs
Hide skill lifecycle hooks from agent docs
2 parents 8c5a15e + 70eb052 commit 97f52de

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/nooa/skill.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,15 @@ def __init__(self, obj: Any = None, *, content: str | None = None, name: str | N
302302
cls_name = name or "Skill"
303303
self.__class__ = type(cls_name, (Skill,), {"__doc__": content}) # pyright: ignore[reportAttributeAccessIssue]
304304

305+
@hidden
305306
def attach(self, agent: Any) -> None:
306307
"""Called when this skill is installed on an agent.
307308
308309
Subclasses can override to perform setup that requires the agent reference.
309310
"""
310311
self._agent = agent
311312

313+
@hidden
312314
def detach(self) -> None:
313315
"""Called when this skill is removed from an agent."""
314316
self._agent = None
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
"""Skill lifecycle hooks are framework plumbing, not model-facing tools."""
4+
5+
from nooa.agentdoc import doc
6+
from nooa.skill import Skill
7+
8+
9+
class ExampleSkill(Skill):
10+
"""A useful example skill."""
11+
12+
def useful(self, value: str) -> str:
13+
"""Return a useful value."""
14+
return value
15+
16+
17+
def test_skill_lifecycle_hooks_are_hidden_from_docs():
18+
rendered = doc(ExampleSkill)
19+
20+
assert "def useful(" in rendered
21+
assert "def attach(" not in rendered
22+
assert "def detach(" not in rendered

0 commit comments

Comments
 (0)