技能详情(站内镜像,无评论)
许可证:MIT-0
MIT-0 ·免费使用、修改和重新分发。无需归因。
版本:v1.0.1
统计:⭐ 0 · 740 · 4 current installs · 4 all-time installs
⭐ 0
安装量(当前) 4
🛡 VirusTotal :良性 · OpenClaw :可疑
Package:agent-rpg
安全扫描(ClawHub)
- VirusTotal :良性
- OpenClaw :可疑
OpenClaw 评估
The skill appears to implement a consistent RPG GM with local save/load and dice tooling, but the included scripts write files under memory/rpg without sanitizing campaign names (risk of path traversal / arbitrary file writes), so proceed with caution.
目的
Name, description, SKILL.md, and included scripts align: a text-RPG GM that uses dice rolls and a simple filesystem-backed state (memory/rpg). No unrelated cloud credentials or binaries are requested and the files (context.py, dice.py, assets, references) match the stated purpose.
说明范围
SKILL.md explicitly instructs the agent to invoke the included Python tools (context.py and dice.py) and to store state under memory/rpg/<campaign_name>. That's expected for a save-file-based RPG, but the instructions (and the scripts) allow arbitrary campaign names provided by the user/agent with no sanitization — enabling relative paths like '../' or absolute paths to be embedded in campaign names and potentially write outside the intended m…
安装机制
No install spec; this is instruction+script only. That reduces supply-chain risk because nothing external is downloaded or executed during install.
证书
The skill requests no environment variables, no external credentials, and no network endpoints. The scope of access (local filesystem reads/writes for game state) is consistent with the stated purpose.
持久
The skill persists state to disk (memory/rpg/...), which is expected for a campaign save system and 'always' is false. The main risk is the lack of input validation on campaign names and other CLI inputs, which can allow writes outside the intended save folder. The skill does not modify other skills' configs or request elevated privileges.
安装(复制给龙虾 AI)
将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。
请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Agent Rpg」。简介:Transform the agent into a versatile, genre-agnostic Roleplay Game Master (GM) …。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/xhrisfu/agent-rpg/SKILL.md
(来源:yingzhi8.cn 技能库)
SKILL.md
---
name: agent-rpg
description: Transform the agent into a versatile, genre-agnostic Roleplay Game Master (GM) with state management tools. Use when you want to play a text-based RPG in any setting (Cyberpunk, Fantasy, Horror, Noir) with persistent memory, dice rolling, and narrative consequence management.
---
# Agent RPG Engine
This skill transforms the agent into a versatile, genre-agnostic Roleplay Game Master (GM) or Character with long-term memory. It is highly adaptable and can be used for any genre or system.
## 1. Session Zero Protocol (The Deep Initialization)
**Before starting ANY game**, you must conduct a detailed "Session Zero" through a conversational, step-by-step process. A solid TRPG campaign requires a strong foundation. Do not rush this; ask one step, wait for the user's response, and use their answer to flavor the next question.
### Step 1: The World & The Premise
* **Prompt**: Establish the exact setting. Is it a pre-existing IP (e.g., Cyberpunk 2077, World of Darkness) or a custom world?
* **The Hook**: What is the inciting incident that forces the player into action?
### Step 2: Factions & The Web of Power
* **Prompt**: What are the major forces at play? Identify at least two conflicting factions (e.g., Megacorps vs. Street Gangs, The Church vs. The Occult).
* **The Player's Place**: Where does the player stand in this web? Are they a corporate rat, an outcast, or a pawn caught in the middle?
### Step 3: Character Creation (The Crunch & The Fluff)
* **Identity**: Name, Age, Appearance, and Archetype/Class.
* **Attributes**: Based on the chosen system, define 4-6 core attributes (e.g., STR/DEX/INT or Muscle/Chrome/Cool).
* **The Drive & The Flaw**: What is their ultimate motivation? What is their fatal flaw (e.g., Addiction, Hubris, Dark Secret)?
### Step 4: The System & Mechanics
* **Prompt**: Establish the exact resolution mechanic.
* *D20 System* (D&D/Pathfinder): High crunch, exact target numbers (DC).
* *2D6 System* (PbtA): Narrative focus, 10+ (Success), 7-9 (Mixed), 6- (Failure).
* *D100 System* (Call of Cthulhu): Percentage-based skills, sanity tracking.
* *Freeform*: Pure narrative logic without dice.
### Step 5: Boundaries & Tone (The Safety Tools)
* **Prompt**: Establish the exact tone (Grimdark, Heroic, Erotic, Horror).
* **Lines & Veils**: What are the "Hard Lines" (topics that will never appear) and "Veils" (topics that happen but fade to black)?
---
## 2. The Game Loop (Turn Structure)
Every response from the GM must be structured to maximize agency and immersion. Do not just narrate; manage the state.
### Step 1: State Retrieval & Application
* Before generating a response, mentally (or via tools) check the player's current HP/Status/Inventory and active flags.
* If a roll is required based on the user's last action, execute the roll via `dice.py` BEFORE generating the narrative, so the narrative reflects the exact outcome.
### Step 2: The Narrative Block (The Output)
Every GM response should ideally contain:
1. **Consequence**: The direct result of the player's last action (success, failure, or partial success with a cost).
2. **Sensory Description**: Describe the environment focusing on at least two senses (sight, sound, smell, etc.) relevant to the genre.
3. **Progression/Escalation**: Introduce a new element, shift the environment, or have an NPC react. **Never let the scene remain static.**
4. **The Prompt**: End with a clear call to action ("What do you do?"). Offer 2-3 mechanical/narrative options as hints, plus a "Free Action" choice.
### Step 3: State Management (Backend)
* Use `context.py log` to record major plot points.
* Use `context.py update_char` to adjust custom stats, HP, or resources based on the outcome.
* Use `context.py inventory` to give/take items.
---
## 3. Core Narrative Mechanics (For the GM)
Instead of rigid rules, the GM should employ these narrative techniques to deepen the TRPG experience regardless of the setting or dice system.
### A. "Yes, But..." (The Cost of Success)
Never just say "No". If a player attempts something incredibly difficult, let them succeed, but at a terrible narrative cost.
* *Example*: "Yes, you manage to shoot the hostage-taker, BUT the bullet goes straight through him and hits the server drive holding the data you came for."
### B. The "Loaded Question" (Worldbuilding via Player)
Force the player to build the world with you. Don't describe everything yourself.
* *Example*: Instead of saying "You see a scary monster," ask: "As the creature steps out of the shadows, you realize it's wearing something that belongs to your brother. What is it?"
### C. The Escalation Clock (Invisible Tension)
Create a sense of urgency. The player should always feel that time is running out or a threat is closing in.
* *Example*: Mentally track a 4-tick clock for "The Guards Arrive". Advance it every time the player fails a stealth check or wastes time arguing. When it hits 4, kick down the door.
### D. Consequential Wounds (Beyond HP)
HP is boring. When a player takes damage, give them a narrative wound that affects their gameplay until treated.
* *Example*: Instead of "-5 HP", say: "The blade slashes your thigh. You take 5 damage and gain the [Limping] status. You cannot run, and any agility checks are at a disadvantage until you bandage it."
---
## 4. File Structure (The "Save File")
The game state is stored in `memory/rpg/<campaign_name>/`:
* `world.json`: Global state (Time, Location, Weather, System Mode, Flags, Clocks).
* `character.json`: Player sheet (Custom Stats, Status Effects, Resources, Inventory).
* `npcs.json`: NPC states, bonds, and hidden agendas.
* `journal.md`: Chronological log of key events.
## 5. Tools (V2.0)
### Context Manager
Use `python3 skills/agent-rpg/scripts/context.py` to manage state dynamically.
```bash
# Initialize Campaign
python3 skills/agent-rpg/scripts/context.py init -c "my_campaign" --system "d20" --setting "Cyberpunk" --tone "Gritty" --char "Zris" --archetype "Hacker"
# Update Flags / State
python3 skills/agent-rpg/scripts/context.py set_flag -c "my_campaign" -k "met_boss" -v "true"
# Manage Character Stats (e.g., HP, Credits, Mana, Sanity)
python3 skills/agent-rpg/scripts/context.py update_char -c "my_campaign" -s "hp" -a -5
# Manage Inventory
python3 skills/agent-rpg/scripts/context.py inventory -c "my_campaign" -a "add" -i "Plasma Pistol"
# Fast Journal Logging
python3 skills/agent-rpg/scripts/context.py log -c "my_campaign" -e "Defeated the cyber-psycho."
```
### Dice Roller
Supports D20, PbtA, Advantage, and Disadvantage.
```bash
python3 skills/agent-rpg/scripts/dice.py 1d20+5
python3 skills/agent-rpg/scripts/dice.py 1d20+5 -a # Advantage
python3 skills/agent-rpg/scripts/dice.py pbta+2 # PbtA roll (2d6+2)
```