Skip to main content

Soul

Struct Soul 

Source
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: String

Source path (for display/logging only)

Implementations§

Source§

impl Soul

Source

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.

Source

pub fn load(path: &Path) -> Result<Self>

Load a SOUL.md file from disk.

Source

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.

Source

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).

Source

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.

Source

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§

Source§

impl Clone for Soul

Source§

fn clone(&self) -> Soul

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Soul

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more