neurocore.skills.base.Skill¶
- class neurocore.skills.base.Skill(name: str | None = None)¶
Bases:
flowengine.BaseComponentBase class for all NeuroCore skills.
Extends FlowEngine’s BaseComponent with: - Declarative metadata via skill_meta (SkillMeta) - Config validation against JSON Schema - Health check with initialization guard
Subclasses MUST: 1. Define skill_meta as a class attribute (SkillMeta instance) 2. Implement process(context) -> context
Subclasses MAY override: - init(config) — for one-time setup (call super().init(config)) - setup(context) — per-run preparation - teardown(context) — per-run cleanup - validate_config() — additional validation beyond schema - health_check() — custom health checking
- Lifecycle:
__init__(name) — instance creation (name defaults to skill_meta.name)
init(config) — configuration (once)
setup(context) — pre-processing (each run)
process(context) — main logic (each run)
teardown(context) — cleanup (each run)
Example:
class GreetSkill(Skill): skill_meta = SkillMeta( name="greet", version="1.0.0", description="Greets the user by name", provides=["greeting"], consumes=["user_name"], ) def process(self, context: FlowContext) -> FlowContext: name = context.get("user_name", "World") context.set("greeting", f"Hello, {name}!") return context
- get_meta() Any¶
Derive a FlowEngine
ComponentMetafrom this skill’sSkillMeta.This is the NeuroCore → FlowEngine bridge: it lets skills participate in FlowEngine’s agent-native tooling (semantic validation, the component catalog, planning) using the same metadata they already declare. The mapping is:
SkillMeta.provides -> ComponentMeta.outputs (keys) SkillMeta.consumes -> ComponentMeta.inputs (keys) SkillMeta.tags -> ComponentMeta.tags SkillMeta.config_schema-> ComponentMeta.config_schema SkillMeta.requires_llm -> ComponentMeta.requires_llm
Returns
Noneif FlowEngine is too old to exposeComponentMeta(i.e. it pre-dates the v0.5.0 agent API).
- llm: Any = None¶