Skill: jcools1977/openpaw (version 0.1.0)

--- name: ResonanceEngine description: Conversational Frequency Matching — reads invisible micro-signals in every conversation and tells the bot exactly how to respond for maximum engagement, conversion, and revenue. Zero API cost. Pure algorithmic intelligence. version: 0.1.0 author: J. DeVere Cooley tags: [engagement, conversion, monetization, optimization, universal, zero-cost] category: AI & LLMs --- # ResonanceEngine **The Physics of Persuasion, Applied to Bots.** ## What It Does ResonanceEngine reads **15+ invisible micro-signals** in every conversation — message length trends, hedging language, commitment words, mirror behavior, sentiment velocity — and computes **4 real-time frequencies** that tell the bot exactly how to respond for maximum impact. Think of it like this: In physics, **resonance** amplifies a system dramatically when you match its natural frequency. Every user has a hidden conversational frequency. A bot that matches it converts **3-10x better**. ## The 4 Frequencies | Frequency | What It Measures | |-----------|-----------------| | **Engagement** | Is the user leaning in or pulling away? | | **Trust** | How much does the user trust the bot? | | **Decision** | How close are they to converting/deciding? | | **Style Match** | How well is the bot resonating with the user's style? | ## Why Every Bot Needs This - **Zero cost** — Pure Python text analysis. No API calls. No ML models. No GPU. - **Universal** — Works for sales bots, support bots, companion bots, any bot. - **Revenue multiplier** — Directly increases conversion, retention, and upsell rates. - **Invisible advantage** — The bot "just seems better" and nobody understands why. ## Usage ```python from openpaw import ResonanceEngine from openpaw.models import Conversation engine = ResonanceEngine() convo = Conversation(goal="sale") convo.add_bot_message("Hi! How can I help you today?") convo.add_user_message("I've been looking at your premium plan, but I'm not sure if it's right for me") result = engine.analyze(convo) # Get the resonance level print(result.profile.resonance_level) # "BUILDING" # Get specific recommendations print(result.recommendation.action) # "Momentum is building. Keep the conversation flowing. Ask a focused question..." # Get conversion probability print(result.yield_prediction.conversion_probability) # 0.35 # Inject tuning into bot's system prompt system_prompt += result.recommendation.to_prompt_injection() ``` ## What It Outputs After analyzing each user message, ResonanceEngine returns: 1. **Frequency Profile** — The 4 frequencies (0-1 each) plus composite score 2. **Resonance Level** — PEAK_RESONANCE, HIGH_RESONANCE, BUILDING, WEAK, or NO_RESONANCE 3. **Tuning Recommendation** — Specific guidance: response length, style, techniques, objection handling 4. **Yield Prediction** — Conversion probability, estimated value, optimal turns remaining, risks & opportunities 5. **Prompt Injection** — A ready-to-use string to inject into the bot's system prompt ## Integration Drop ResonanceEngine into any bot's message processing pipeline: ```python # In your bot's message handler: user_msg = get_user_message() conversation.add_user_message(user_msg) # Analyze with ResonanceEngine result = engine.analyze(conversation) # Use the tuning to adjust the bot's response if result.yield_prediction.should_close: # Present the offer NOW response = generate_closing_response(result.recommendation) else: # Build more resonance response = generate_response( user_msg, system_prompt_suffix=result.recommendation.to_prompt_injection() ) conversation.add_bot_message(response) ``` ## Signals Analyzed | Signal | Category | What It Detects | |--------|----------|----------------| | Message Length Trajectory | Engagement | Growing/shrinking responses | | Question Density | Engagement | Curiosity vs. skepticism | | Response Elaboration | Engagement | Investment in conversation | | Topic Persistence | Engagement | Focus vs. drift | | Hedge Ratio | Trust | Uncertainty language | | Personal Disclosure | Trust | Sharing personal info | | Mirror Behavior | Trust | Copying bot's style | | Sentiment Trend | Trust | Warming up vs. cooling down | | Commitment Language | Decision | "Yes", "let's do it" | | Objection Frequency | Decision | "But", "however", "expensive" | | Urgency Markers | Decision | "ASAP", "now", "today" | | Action Language | Decision | "Do", "start", "make" | | Formality Level | Style | Casual vs. formal | | Vocabulary Complexity | Style | Simple vs. sophisticated | | Emotional Energy | Style | Exclamation patterns | ## Install ```bash pip install openpaw ``` Or add to your project: ```bash git clone https://github.com/jcools1977/Openpaw-.git cd Openpaw- pip install -e . ```

path: openpaw/models/conversation.py
content: """Conversation data models for the ResonanceEngine."""

from __future__ import annotations

import time
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional


class Speaker(Enum):
    USER = "user"
    BOT = "bot"


@dataclass
class Message:
    """A single message in a conversation."""

    text: str
    speaker: Speaker
    timestamp: float = field(default_factory=time.time)
    metadata: dict = field(default_factory=dict)

    @property
    def word_count(self) -> int:
        return len(self.text.split())

    @property
    def char_count(self) -> int:
        return len(self.text)

    @property
    def sentence_count(self) -> int:
        count = 0
        for char in self.text:
            if char in ".!?":
                count += 1
        return max(count, 1)

    @property
    def question_count(self) -> int:
        return self.text.count("?")


@dataclass
class Conversation:
    """A full conversation thread with analysis-ready accessors."""

    messages: list[Message] = field(default_factory=list)
    conversation_id: Optional[str] = None
    started_at: float = field(default_factory=time.time)
    goal: Optional[str] = None  # "sale", "support", "engagement", "retention"

    def add_message(self, text: str, speaker: Speaker, **metadata) -> Message:
        msg = Message(text=text, speaker=speaker, metadata=metadata)
        self.messages.append(msg)
        return msg

    def add_user_message(self, text: str, **metadata) -> Message:
        return self.add_message(text, Speaker.USER, **metadata)

    def add_bot_message(self, text: str, **metadata) -> Message:
        return self.add_message(text, Speaker.BOT, **metadata)

    @property
    def user_messages(self) -> list[Message]:
        return [m for m in self.messages if m.speaker == Speaker.USER]

    @property
    def bot_messages(self) -> list[Message]:
        return [m for m in self.messages if m.speaker == Speaker.BOT]

    @property
    def turn_count(self) -> int:
        return len(self.messages)

    @property
    def duration(self) -> float:
        if len(self.messages) < 2:
            return 0.0
        return self.messages[-1].timestamp - self.messages[0].timestamp

    def last_n_user_messages(self, n: int) -> list[Message]:
        return self.user_messages[-n:]

    def last_n_messages(self, n: int) -> list[Message]:
        return self.messages[-n:]


path: openpaw/utils/__init__.py
content: from openpaw.utils.text_analysis import TextAnalyzer

__all__ = ["TextAnalyzer"]


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)