1 Commits
Author SHA1 Message Date
rick 8876e1225e Initial commit 2026-04-09 14:26:32 +00:00
5 changed files with 12 additions and 340 deletions
+10
View File
@@ -0,0 +1,10 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>
+2
View File
@@ -0,0 +1,2 @@
# openclaw-magical-item-price-discovery-skill
-260
View File
@@ -1,260 +0,0 @@
---
name: magic-item-price-discovery
description: Multi-agent magical-item rarity/price discovery and negotiation workflow for D&D/homebrew catalogs. Use when calibrating item prices, balancing progression, resolving agent disagreement with voting rounds (4/7 consensus), running unresolved-only reconciliation with coalition-first elasticity, preserving dissent rationales, and writing finalized results back into item card files (including filename normalization, lore alternatives, dispatch watchdogs, and post-writeback integrity verification/repair).
---
# Magic Item Price Discovery
## Overview
Run a 7-agent negotiation panel to discover balanced rarity/price outcomes, converge contested items across capped rounds, and write final consensus (plus dissent context) directly into item files.
This skill is designed for repeatable item-balance passes where you want both rigor and practical output files.
## When to use
Use this skill when the request includes one or more of:
- “price these magical items”
- “balance rarity/price for progression”
- “run multi-agent negotiation / voting”
- “resolve contested items over rounds”
- “append negotiation rationale / dissent into item cards”
- “rename item files to match final rarity/price”
## Panel architecture (fixed roles)
Use all seven agents each round.
- **Alpha**: lower rarity/more Common when plausible.
- **Bravo**: higher rarity when plausible.
- **Charlie**: higher stock_gp pressure.
- **Delta**: lower stock_gp pressure.
- **Echo**: player-wow/fun pressure.
- **Foxtrot**: DM-balanced perspective; primary consensus bridge.
- **Gold**: progression runway guardian (anti-short-term inflation).
## Consensus rules (hard)
- Pass threshold: **>= 4/7 yes votes** on the same anchor.
- Run full-set negotiation first, then contested-only rounds.
- Round cap: **5 total rounds**.
- If still <4/7 after round 5:
- mark unresolved,
- append a **No Consensus Negotiation Note** with all seven final round bids (rarity/gp), vote split, and each agent’s final rationale,
- rename unresolved file to `Item Name [no consensus].txt` until manual adjudication.
## Workflow
### 1) Prepare working set
1. Load item set (name, mechanics, current rarity/price, file path).
2. Ensure a compact JSON exists for agent consumption.
3. Keep a deterministic item key (`item` string) for joins.
Typical files in this workspace:
- `scratchpad/recovery_t1_t2_items.json`
- `scratchpad/recovery_t1_t2_items_compact.json`
### 2) Round 1 (proposals)
1. Spawn 7 subagents (one per role) with same item input.
2. Require structured JSON output per agent:
- `item`, `rarity`, `stock_gp`, `rationale`.
3. Build round matrix.
4. Choose initial anchor candidate per item (Foxtrot/median-aware compromise is preferred).
### 3) Round 2 (vote on anchors)
Per item, each agent returns:
- `revised_rarity`
- `revised_stock_gp`
- `vote_on_anchor` (bool)
- `counterproposal` (`rarity`, `stock_gp`)
- `comparators_used` (>=2 canonical comparator item names)
- `comparison_rationale` (explicitly references those comparators)
- `concession`
- `red_line`
- `vote_reason`
Tally yes/no by item.
- `yes >= 4` => pass and lock.
- else => contested queue.
### 4) Rounds 3–5 (contested-only)
For contested queue only:
1. Foxtrot proposes first-pass compromise anchor.
2. All 7 agents vote with same schema as round 2.
3. Re-tally and lock passes.
4. Continue until all resolved or round 5 reached.
### 5) Reconciliation pass (unresolved-only; recommended when unresolved remain)
Run this pass after an initial flavor pass if unresolved items exist or if the user requests higher convergence.
1. Load only unresolved items from the flavor’s prior `final_outcome` manifest.
2. Keep hard rules unchanged: same 7-agent panel, same `>=4/7`, same round cap 5.
3. Apply coalition-first elasticity for close-spread disputes:
- classify as **near-consensus** when rarity proposals are equal/adjacent and gp spread is narrow (<=25% of median gp),
- require each agent to provide a practical concession corridor (acceptable rarity set + gp band),
- for near-consensus items, prefer `YES` unless anchor crosses an explicit red line,
- in R3+, ratchet anchors toward a weighted center (Foxtrot+Gold stability, Alpha/Delta affordability pressure, Bravo/Charlie risk pressure, Echo table-fun pressure),
- do not force convergence when spreads are genuinely wide or progression risk is material.
4. Produce dedicated reconciliation artifacts:
- `*_reconcile_final_outcome_r1_r5.json`
- `*_reconcile_full_writeback_<date>.json`
- before/after unresolved counts.
### 6) Finalization write-back
For each item card file:
1. If **consensus reached**, set final `Rarity` and `Price` from consensus.
2. Append consensus block with:
- panel,
- rule,
- final rarity/price,
- round and vote count,
- yes/no agent lists,
- no-vote dissent reasons + counterproposal.
3. If **no consensus after round cap**, append a no-consensus block with:
- panel,
- rule + cap,
- final round anchor and vote split,
- why consensus failed,
- all seven final bids + rationales,
- explicit unresolved disposition note.
4. Remove obsolete diagnostics once consensus exists:
- `Price basis (detailed)`
- `Rarity comparison vs source (diagnostic)`
5. Rename files:
- consensus items: `Item Name [Rarity] [Price].txt`
- unresolved items: `Item Name [no consensus].txt`
6. Update metadata manifests with new file paths.
7. Write machine-readable consensus/unresolved manifests under `scratchpad/`.
### 7) Post-writeback integrity verification + repair (mandatory for this corpus)
Run this after every major writeback (and after reconciliation writebacks).
1. Verify core card sections exist for every touched card:
- `^Item:`
- `^Front (mechanics):`
- `^Lore (`
2. If any card is missing core sections:
- create timestamped backups first (under `scratchpad/`),
- reconstruct the core header from best available sources (priority order):
1) source tier markdown (`tier-1.md`, `tier-2.md`, `tier-3.md`) Front/Back,
2) `tmp/item-card-images-tier*/ITEM_INDEX.json` (`front`, `lore_text`),
3) `nonrecovery_t1_t3_<flavor>_items_compact.json` (`mechanics`) for front fallback,
4) existing `Lore alt 1` text as emergency lore fallback,
- preserve existing tail blocks from first marker onward:
- `--- Lore Alternatives ... ---`
- `--- Consensus Negotiation Update ... ---`
- write a repair report JSON with file list, source provenance, and failures.
3. Re-run verification until missing-core count is zero for touched categories.
4. Run a final cross-category verification sweep before handoff.
## Lore alternatives protocol (recipe lock)
When lore alternatives are requested, treat this as a **locked style recipe** (matching the successful Recovery/Defense runs):
Per item, write exactly two alternatives (100–140 words each):
1) **Alt 1:** origin/hook sentence → paraphrased effect sentence → flavorful table-feel/humor line(s) → strong closing line.
2) **Alt 2:** distinct framing (not a near-duplicate of Alt 1) → paraphrased effect sentence → flavorful table-feel/humor line(s) → strong closing line.
Hard constraints:
- Keep prose player-facing, witty, and in-world.
- **Do not** use dry meta phrasing (e.g., “Mechanically”, “Rules text”, “In plain language”, “Boiled down”, similar).
- **Do not** copy front mechanics verbatim; paraphrase naturally.
- Avoid repetitive sentence templates across the two alternatives for the same item.
Inject the lore alternatives block before consensus/no-consensus notes using a clear section marker.
## Workspace set override (hardcoded for this item-card corpus)
When the target files are under:
- `/home/rick/output/to-dnd-session-rclone/Item Card Images/`
treat the following as **default post-processing for this set**, regardless of category (Recovery/Defense/Offense/etc.):
1. Append consensus + dissent block to each finalized `.txt` card.
2. Remove obsolete diagnostics (`Price basis`, `Rarity comparison vs source`).
3. Add two lore alternatives per item (same-style pair, ~120 words each).
4. Rename files to:
- `Item Name [Rarity] [Price].txt` for consensus items
- `Item Name [no consensus].txt` for unresolved items after round cap
5. Update any local manifests/index JSON paths after rename.
### Northlands economy conversion (required in this corpus)
Use `stock_gp` as the negotiation/RAW unit, then convert display price to Northlands silver by rarity:
- Common: `stock_gp × 10` silver
- Uncommon: `stock_gp × 100` silver
- Rare: `stock_gp × 1000` silver
- Very Rare: `stock_gp × 10000` silver
- Legendary: `stock_gp × 100000` silver
Do not use a flat `×10` conversion outside Common.
Display rule for this corpus:
- If converted silver ends with `000` (divisible by 1000), display as gold token: `silver/1000` with `g` suffix (e.g., `770000s` → `770g`).
- Otherwise display in silver with `s` suffix.
- For filename readability, add comma separators when the numeric token has **4 or more digits** (inclusive lower bound; e.g., `1100s` → `1,100s`, `12500s` → `12,500s`, `21800g` → `21,800g`).
Apply the display token in both:
- `Price:` line in the card text (`<token> (Northlands gold|Northlands silver)`)
- filename segment `[Price]` in `Item Name [Rarity] [Price].txt`
### Canonical stock_gp comparator rail (required)
When calibrating rarity + stock_gp for this corpus, load and use:
- `references/canonical-stock-gp-comparators.md`
Hard rules:
1. Keep argumentation in **stock_gp** against named canonical comparators.
2. Treat listed outliers as **invalid** comparator anchors.
3. Every ballot item must cite at least **two** valid comparator items and explain why the proposed rarity/stock_gp should be above/below/near those references.
4. If comparator citation is missing or uses invalid outliers, ballot is non-compliant and should be retried.
5. Convert to Northlands token format only after stock_gp + rarity consensus is settled.
## Output block template (consensus)
Use this shape exactly for consistency:
`--- Consensus Negotiation Update (YYYY-MM-DD) ---`
- Panel list
- Rule (`>=4/7`)
- Final consensus (`rarity`, `gp`, converted local currency)
- Consensus round and vote split
- Yes list
- No list
- Dissent summary bullets (no-vote agents)
- Process note that consensus supersedes prior diagnostics
`--- End Consensus Negotiation Update ---`
## Non-blocking execution policy
For long runs:
- spawn and continue in background,
- send heartbeat progress updates,
- do not block the main chat thread waiting on sequential heavy tool chains.
### Dispatch watchdog (anti-stall)
- Do **not** always dispatch Gold last; prefer launching Gold early (first or second) so moderation ballast is available sooner.
- Set a practical watchdog per round: if one expected ballot has not arrived within ~8–10 minutes while others finished, re-dispatch that ballot once in a fresh subagent run.
- If multiple ballots are stalled after the watchdog window, re-dispatch each stalled ballot once (no infinite retry loop).
- Treat late duplicate completions as non-authoritative if a replacement run already superseded them.
- Persist round status artifacts (`expected_agents`, `received_agents`, `pending_agents`) for watchdog decisions and auditability.
## Applied-set tracking (workspace corpus)
When this skill is used against the local Item Card Images corpus, update:
- `references/applied-itemcard-sets.md`
Mark each targeted tier/category as completed only after full write-back + cleanup is done.
## Verification checklist
Before declaring done:
- [ ] All expected subagent returns received for the active round.
- [ ] Vote tallies computed and saved.
- [ ] Every item either resolved or explicitly marked unresolved (after round cap).
- [ ] Comparator-citation rule passed (>=2 valid canonical comparators per item revision; no invalid outliers used).
- [ ] (If requested/needed) unresolved-only reconciliation pass executed.
- [ ] Reconciliation before/after unresolved counts recorded.
- [ ] Item files updated with consensus + dissent.
- [ ] Obsolete diagnostics removed.
- [ ] Filenames normalized to `Item Name [Rarity] [Price].txt`.
- [ ] Metadata file paths updated.
- [ ] Final manifest written.
- [ ] (If requested) lore alternatives inserted for all items.
- [ ] Core section integrity (`Item`, `Front (mechanics)`, `Lore`) verified for all touched cards.
- [ ] Any missing core sections repaired with timestamped backups + repair report.
- [ ] Final post-repair sweep returns zero missing-core cards in touched categories.
## Practical notes
- Preserve structured JSON from subagents; treat it as data, not prose.
- Keep joins keyed by exact item name to avoid drift during renames.
- When disagreements are narrow, choose anchors that maximize coalition viability, not ideological purity.
- Foxtrot + Gold are usually the stability core for long-term campaign balance.
- Known failure mode: a bad writeback can leave cards with only lore-alternative/consensus tail blocks; trigger the integrity-repair flow immediately when detected.
-23
View File
@@ -1,23 +0,0 @@
# Applied Item-Card Sets (Magic Item Price Discovery)
Status tracking for this workspace corpus (`/home/rick/output/to-dnd-session-rclone/Item Card Images/`).
- [x] Recovery Tier 1–2 (completed 2026-04-08)
- [x] Recovery Tier 3–4 (completed 2026-04-08)
- [x] Recovery Tier 5 (completed 2026-04-08)
- [x] Defense Tier 1–3 (completed 2026-04-08)
- [x] Magic Tier 1–3 (initial pass completed 2026-04-08; unresolved items were marked `[no consensus]`)
- [x] Offense Tier 1–3 (initial pass completed 2026-04-09; unresolved items were marked `[no consensus]`)
- [x] Stealth Tier 1–3 (completed 2026-04-09)
- [x] Strike Tier 1–3 (completed 2026-04-09)
- [x] Utility Tier 1–3 (completed 2026-04-09)
- [x] Offense Tier 1–3 reconciliation pass (unresolved-only; completed 2026-04-09, unresolved 26 → 0)
- [x] Magic Tier 1–3 reconciliation pass (unresolved-only; completed 2026-04-09, unresolved 20 → 0)
- [x] Tier 6 Exit Pack A (comparator-anchored sample completed 2026-04-09)
- [ ] Tier 6 Exit Pack B (pending comparator-anchored rerun)
- [ ] Tier 6 Exit Pack C (pending comparator-anchored rerun)
- [ ] Tier 6 Exit Pack D (pending comparator-anchored rerun)
## Notes
- "Completed" means: consensus negotiated, dissent captured, diagnostic sections removed, lore alternatives inserted, Northlands rarity multiplier conversion applied, and filename normalization applied.
- Price token display rule in filenames/text is active (`g` when divisible by 1000 silver, else `s`, with comma separators when numeric token length is >= 4 digits).
@@ -1,57 +0,0 @@
# Canonical stock_gp comparators (argument rail)
Use this file when negotiating rarity/stock_gp for this item-card corpus.
Purpose:
- Provide a shared comparator rail so agents argue against explicit D&D/Sane reference points instead of drifting anchor-only.
- Keep all negotiation reasoning in **stock_gp** until consensus is reached.
- Convert to Northlands display currency only **after** stock_gp + rarity consensus.
Source:
- `northlands/economy/sane-magical-prices/price-list.enriched.csv`
## Comparator set (curated representative anchors)
### Common
- Spell Scroll Level 0 — 10 gp
- Potion of Healing — 50 gp
- Spell Scroll Level 1 — 60 gp
- Potion of Climbing — 180 gp
### Uncommon
- Elemental Gem — 960 gp
- Staff of the Python — 2,000 gp
- Slippers of Spider Climbing — 5,000 gp
### Rare
- Sword of Sharpness — 1,700 gp
- Ring of the Ram — 5,000 gp
- Folding Boat — 10,000 gp
### Very Rare
- Spell Scroll Level 7 — 2,560 gp
- Scimitar of Speed — 6,000 gp
- +3 Shield — 24,000 gp
### Legendary
- Sphere of Annihilation — 15,000 gp
- Vorpal Sword — 24,000 gp
- Scarab of Protection — 36,000 gp
- Holy Avenger — 165,000 gp
## Outliers (invalid for anchor/comparator use)
Treat these as invalid comparator anchors for negotiation in this workflow:
- Decanter of Endless Water — Uncommon 135,000 gp
- Prayer Bead Summons — Rare 128,000 gp
- Amulet of the Planes — Very Rare 160,000 gp
- Universal Solvent — Legendary 300 gp
Optional cautionary exclusion (same rationale as low-end legendary outlier behavior):
- Sovereign Glue — Legendary 400 gp
## Agent citation requirement
For each item revision, cite at least **two** valid comparators (non-outlier) and explain why the candidate rarity/stock_gp should be above/below/near those comparators.
Do not submit ballots that only say "higher/lower" without named comparator references.