AgentSkillsCN

persona-commands

AI Persona OS 的运行时聊天内指令。可将 11 条指令精准路由至相应操作——包括带健康指标的状态仪表盘、展示 Persona(显示 SOUL.md 身份信息)、展示记忆(呈现 MEMORY.md 内容)、健康检查(运行诊断脚本)、安全审计(执行安全验证)、展示配置(验证配置)、帮助(提供命令参考)、检查点(保存上下文快照)、开启/关闭顾问模式(切换主动模式)、切换预设(变更 Persona 配置)。同时,还能识别多种自然语言变体,例如用“我的系统状况如何”查询状态,用“我的 Persona 是什么”调取 Persona 信息。关键词:状态、仪表盘、展示 Persona、展示记忆、健康检查、安全审计、展示配置、帮助、检查点、顾问、切换预设、指令、诊断、验证、主动模式。

SKILL.md
--- frontmatter
name: persona-commands
description: Runtime in-chat commands for AI Persona OS. Routes 11 commands to appropriate actions - status dashboard with health indicators, show persona (display SOUL.md identity), show memory (display MEMORY.md contents), health check (run diagnostics script), security audit (run security validation), show config (validate configuration), help (command reference), checkpoint (save context snapshot), advisor on/off (toggle proactive mode), switch preset (change persona configuration). Recognizes natural language variants like "how's my system" for status, "what's my persona" for show persona. Keywords: status, dashboard, show persona, show memory, health check, security audit, show config, help, checkpoint, advisor, switch preset, commands, diagnostics, validate, proactive mode
allowed-tools:
  - Bash
  - Read
  - Write
  - Glob

Runtime In-Chat Commands

This skill handles 11 runtime commands for AI Persona OS, routing user requests to appropriate system actions.

Command Reference

CommandActionOutput Format
statusRun health checks, display dashboard📊 Status Dashboard with 🟢🟡🔴 indicators
show personaRead and format SOUL.md🪪 Persona Identity Display
show memoryDisplay MEMORY.md contentsRaw memory file contents
health checkRun diagnostics scriptScript output with pass/fail indicators
security auditRun security validationScript output with security findings
show configValidate configuration filesScript output with config validation
helpDisplay command referenceThis table
checkpointSave context snapshotConfirmation with file path
advisor onEnable proactive modeConfirmation message
advisor offDisable proactive modeConfirmation message
switch presetChange persona configurationPreset menu, delegate to persona-setup

Natural Language Recognition

The skill recognizes natural language variants:

  • "how's my system" / "system status" / "check status" → status
  • "what's my persona" / "who am I" / "show identity" → show persona
  • "what do I remember" / "show my memory" / "memory contents" → show memory
  • "run diagnostics" / "check health" / "system check" → health check
  • "check security" / "audit security" / "security check" → security audit
  • "validate config" / "check config" / "show configuration" → show config
  • "what can I do" / "available commands" / "command list" → help
  • "save progress" / "create checkpoint" / "save state" → checkpoint
  • "enable advisor" / "turn on advisor" / "proactive on" → advisor on
  • "disable advisor" / "turn off advisor" / "proactive off" → advisor off
  • "change persona" / "switch configuration" / "change preset" → switch preset

Implementation Guide

Phase 1: Command Recognition

Step 1.1: Parse user input to identify command intent

pseudocode
command = extract_command(user_input)
if command not in VALID_COMMANDS:
    command = match_natural_language_variant(user_input)
if command is None:
    show_help_and_suggest_closest_match()
    exit

Step 1.2: Validate command availability

pseudocode
if command requires script:
    check script exists at ${CLAUDE_PLUGIN_ROOT}/scripts/
if command requires workspace file:
    check file exists at ~/workspace/

Phase 2: Command Execution

Step 2.1: status - Display system health dashboard

pseudocode
# Run health checks
core_files_count = count files in ${CLAUDE_PLUGIN_ROOT}/core/
memory_size = stat ~/workspace/MEMORY.md | get size in KB
recent_logs = count lines in ~/workspace/.logs/YYYY-MM-DD.log (last 24h)
version = cat ${CLAUDE_PLUGIN_ROOT}/VERSION

# Calculate health indicators
core_health = 🟢 if core_files_count >= 8 else 🟡 if >= 6 else 🔴
memory_health = 🟢 if memory_size < 100 else 🟡 if < 500 else 🔴
logs_health = 🟢 if recent_logs < 100 else 🟡 if < 500 else 🔴

# Display dashboard
output = format_status_dashboard(core_health, memory_health, logs_health, version)

Status Dashboard Format:

code
📊 AI Persona OS - Status Dashboard
🫀 Last heartbeat: YYYY-MM-DD HH:MM:SS

Core System:     🟢 8 files loaded
Memory:          🟢 42 KB (healthy)
Recent Logs:     🟡 127 entries (24h)
Version:         v0.3.0-alpha

System Status: HEALTHY

Step 2.2: show persona - Display identity from SOUL.md

pseudocode
soul_content = Read(~/workspace/SOUL.md)
extract:
    - name (from # heading or name: field)
    - role (from role: field or Role: heading)
    - values (from Values: section, list items)
    - style (from Communication Style: section)

output = format_persona_display(name, role, values, style)

Show Persona Format:

code
🪪 Persona Identity

Name:   Senior Technical Architect
Role:   System design expert specializing in distributed systems

Core Values:
  • Clarity over cleverness
  • Test everything that matters
  • Documentation is love for future you

Communication Style:
  Direct, technical, assumes expertise. Uses precise terminology.
  Proactive with suggestions. Explains reasoning when asked.

Step 2.3: show memory - Display MEMORY.md contents

pseudocode
memory_content = Read(~/workspace/MEMORY.md)
display memory_content with minimal formatting

Step 2.4: health check - Run diagnostics script

pseudocode
result = Bash("${CLAUDE_PLUGIN_ROOT}/scripts/health-check.sh")
display result
# Do not show raw exec commands unless user explicitly asks

Step 2.5: security audit - Run security validation

pseudocode
result = Bash("${CLAUDE_PLUGIN_ROOT}/scripts/security-audit.sh")
display result
# Highlight any security findings

Step 2.6: show config - Validate configuration

pseudocode
result = Bash("${CLAUDE_PLUGIN_ROOT}/scripts/config-validator.sh")
display result
# Show validation status for each config file

Step 2.7: help - Display command reference

pseudocode
display COMMAND_REFERENCE_TABLE (from section above)
add usage examples:
    "Type 'status' to see system health"
    "Type 'show persona' to view your identity"
    "Type 'checkpoint' to save your current context"

Step 2.8: checkpoint - Save context snapshot

pseudocode
timestamp = current_timestamp (HH:MM)
date = current_date (YYYY-MM-DD)
checkpoint_file = ~/workspace/memory/${date}.md

# Calculate context percentage (estimate based on conversation length)
context_percentage = min(100, conversation_turns * 5)

# Gather checkpoint data
active_task = ask_user("What task are you currently working on?")
key_decisions = ask_user("Any key decisions or changes to note?")
resume_from = ask_user("What should you resume from next session?")

# Write checkpoint
checkpoint_content = format_checkpoint(
    timestamp, context_percentage, active_task, key_decisions, resume_from
)
Write(checkpoint_file, checkpoint_content, mode=append)

confirm "Checkpoint saved to ${checkpoint_file}"

Checkpoint Format:

markdown
## Checkpoint [14:32] — Context: 35%

**Active task:** Implementing user authentication flow
**Key decisions:**
- Chose JWT over session cookies for API statelessness
- Added rate limiting at gateway level

**Resume from:** Complete integration tests for /auth/login endpoint

Step 2.9: advisor on - Enable proactive mode

pseudocode
# Set proactive mode flag (in SOUL.md or runtime state)
confirm "✅ Proactive advisor mode ENABLED"
confirm "I will now offer suggestions and anticipate needs proactively."

Step 2.10: advisor off - Disable proactive mode

pseudocode
# Clear proactive mode flag
confirm "✅ Proactive advisor mode DISABLED"
confirm "I will wait for explicit requests before offering suggestions."

Step 2.11: switch preset - Change persona configuration

pseudocode
# Display preset menu
presets = Glob("${CLAUDE_PLUGIN_ROOT}/presets/*.yaml")
display_menu(presets)

# Delegate to persona-setup skill
confirm "Switching to persona-setup skill for preset configuration..."
# The persona-setup skill will handle preset selection and file rebuilding

Phase 3: Output Formatting

Step 3.1: Apply command-specific formatting rules

pseudocode
if command == "status":
    use traffic light indicators (🟢🟡🔴)
    include timestamp and version
else if command == "show persona":
    use identity header (🪪)
    format as sections with bullet lists
else if command == "checkpoint":
    use markdown heading with timestamp
    include context percentage
else if command in ["health check", "security audit", "show config"]:
    display script output directly
    highlight warnings and errors
else:
    use minimal formatting

Step 3.2: Never show raw execution commands unless explicitly requested

pseudocode
# BAD: showing raw commands
"Running: /path/to/script.sh --flag"

# GOOD: showing results
"Health Check Results:
  ✓ Core files present
  ✓ Memory within limits
  ⚠ Log rotation needed"

Key Rules

  1. Natural Language Recognition: Recognize common variants of each command
  2. Clean Output: Never show raw exec commands unless user explicitly asks
  3. Script Paths: All scripts referenced via ${CLAUDE_PLUGIN_ROOT}/scripts/
  4. Workspace Paths: All user data files in ~/workspace/ or ~/workspace/memory/
  5. Formatting: Use emoji indicators (🟢🟡🔴) for health, (🪪) for persona, (📊) for dashboard
  6. Checkpoint Timestamps: Always include HH:MM timestamp and context percentage
  7. Delegation: For complex operations (like switch preset), delegate to appropriate skill
  8. Error Handling: If command fails, show helpful error message and suggest alternatives
  9. Help Accessibility: Make help command easily discoverable and comprehensive
  10. Proactive Mode: advisor on/off should clearly confirm state change

Error Scenarios

Missing Script:

code
❌ Error: health-check.sh not found at ${CLAUDE_PLUGIN_ROOT}/scripts/
Suggestion: Run 'hiivmind-openclaw-os setup' to initialize the plugin

Missing Workspace File:

code
❌ Error: SOUL.md not found at ~/workspace/
Suggestion: Run 'persona-setup' to create your persona configuration

Unrecognized Command:

code
❌ Unknown command: "statsu"
Did you mean: status?
Type 'help' to see all available commands.

Integration with Other Skills

  • persona-setup: Delegates preset switching
  • persona-coder: May trigger checkpoints before major refactoring
  • persona-health: Called by health check command
  • persona-security: Called by security audit command

Examples

User: "how's my system" Action: Run status command, display dashboard with health indicators

User: "save my progress" Action: Run checkpoint command, prompt for active task/decisions/resume point

User: "turn on advisor mode" Action: Enable proactive mode, confirm activation

User: "what can I do" Action: Display help command with full command reference table