pub struct Soul {
pub identity: String,
pub core_beliefs: String,
pub communication_style: String,
pub scope_and_boundaries: String,
pub source_path: String,
}Expand description
Parsed representation of a SOUL.md document.
Runtime completely read-only — user-provided identity document. The agent cannot write or modify this struct after loading.
Fields§
§identity: String## Identity — who the agent is: name, role, persona description
core_beliefs: String## Core Beliefs — non-negotiable values (OpenClaw: “Core Truths”)
communication_style: String## Communication Style — tone, language preferences, reply style
scope_and_boundaries: String## Scope & Boundaries — what the agent will and will not do
source_path: StringSource path (for display/logging only)
Implementations§
Source§impl Soul
impl Soul
Sourcepub fn parse(content: &str, source_path: &str) -> Self
pub fn parse(content: &str, source_path: &str) -> Self
Parse a SOUL.md string into a Soul struct.
Section detection is case-insensitive. Content before the first ##
heading is treated as a preamble and ignored.
Sourcepub fn auto_load(explicit_path: Option<&str>, workspace: &str) -> Option<Self>
pub fn auto_load(explicit_path: Option<&str>, workspace: &str) -> Option<Self>
Auto-discover and load SOUL.md from the resolution chain.
Returns None if no SOUL.md is found anywhere in the chain.
Sourcepub fn offer_bootstrap_soul_if_missing(
workspace: &str,
explicit_path: Option<&str>,
) -> bool
pub fn offer_bootstrap_soul_if_missing( workspace: &str, explicit_path: Option<&str>, ) -> bool
If no SOUL exists in the resolution chain and stdin is a TTY, prompt the user to create a minimal
template at workspace/.skilllite/SOUL.md. When the user confirms (y/Y), write MINIMAL_SOUL_TEMPLATE
and return true; otherwise return false. Does nothing when explicit_path is Some (user already
chose a path) or when not interactive (no TTY).
Sourcepub fn to_planning_scope_block(&self) -> Option<String>
pub fn to_planning_scope_block(&self) -> Option<String>
Render the SOUL Scope & Boundaries as a planning constraint block (A8).
Injected into the planning prompt so the LLM respects “in scope” / “out of scope” when generating task lists. Planning must NOT create tasks that violate these rules.
Sourcepub fn to_system_prompt_block(&self) -> String
pub fn to_system_prompt_block(&self) -> String
Render the SOUL as a system prompt injection block.
Only non-empty sections are included to keep the prompt lean.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Soul
impl RefUnwindSafe for Soul
impl Send for Soul
impl Sync for Soul
impl Unpin for Soul
impl UnsafeUnpin for Soul
impl UnwindSafe for Soul
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more