psl

A product-definition method for describing how an experience or product world works, including its rules, meanings, and tests for correctness. It fills in missing decisions by asking the user questions.

In plain words
What is it for?
Use it for fuzzy requirements involving memory, personality, relationships, content organisation, recommendations, search intent, or social feeds. It can turn a short requirement or existing product document into a complete product specification.
Why use it?
It prevents an agent from following vague wording literally and building something technically correct but wrong for the intended product experience.

Skill for Claude CodeCodex

Part of the looper plugin — 3 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xrensiu/claude-code-forge/psl
Any agent
npx skills add XRenSiu/claude-code-forge --skill psl
Clone the repo
git clone --depth 1 https://github.com/XRenSiu/claude-code-forge

Made for: Claude Code, Codex.

Or install looper, the plugin that ships this one along with the rest of its 3 skills.

Per session 249 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,240 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00249 $0.03240
Opus 5 $0.00125 $0.01620
Sonnet 5 $0.00050 $0.00648
Haiku 4.5 $0.00025 $0.00324

Measured 2d ago against content hash 82e97fac99f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

psl scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify_psl.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/looper/skills/psl/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

psl

输入一句到一段的产品需求(可附物料:旧 PRD、代码、设计稿、访谈、笔记),输出一份完整的 PSL-<产品/功能名>.md本 skill 不规定步骤顺序——引擎自己排工作;下面给的是缺口、 世界的形状、判据与门。 写第一份 PSL 前先读 references/EXAMPLE.md(先见过一份"对的 样子"再动手,这是认识论顺序,不是流水线)。

缺口(这个 skill 补什么、不补什么)

引擎本就会推理、会写结构化文档、会编排问答——这些全部留给引擎。缺的恰好是:

  • Σ(形状 + 来路纪律):PSL 的六层模子长什么样;某个具体产品的私有世界内容从哪来;
  • φ(判据):什么算"世界写对了"——Domain Model 推翻测试、行为可判验收、消歧判据;
  • γ(纪律):提问何时问 / 何时不问 / 何时停;未知内容何时 seam;交付契约不可跳。

deletion 测试:撤掉本 skill,让引擎实现"按时间搜索记忆",它会交出 {created_at} 加日历 筛选器——技术正确、产品错误。缺口真实存在。

入口判据:双轨裁决(先跑,决定该不该干)

对需求先问一件事:语义份额与确定性份额谁主导?

  • (Σ+φ 占比 × 变化率) 高、Capability 难度低 → 写 PSL。 即:需求的难点在"世界怎么运转、 什么算对"(且这些语义随人/场景漂移),而不在实现原语本身。速判:把需求交给一个不了解 这个产品的工程师照字面做,他会不会做出技术正确、产品错误的东西?会 → PSL。
  • 确定性主导 → 明说"这里 PRD 的精确恰好够用,套世界模型是过填",然后停。 不虚构世界。 (支付校验、合规字段、固定列的报表导出,都属此类。)
  • 混合需求 → 只对体验性内核写 PSL,确定性部分注明"留在 PRD,按字面做即可"。
  • 用户给的是现成 PRD → 用同一判据裁决"该不该改写为 PSL",两个方向的结论都合法。

诚实公理(世界内容只有三种来路,没有第四种)

运行本 skill 的引擎脑子里没有这个具体产品的世界。所以每一条世界内容必须有来路:

来路 什么内容 处理
surface 引擎已知但不会主动说的通用世界知识(领域常识、用户心理规律) 自己填,不问;展示给用户确认
elicit 只有用户知道的私有内容(核心赌注、目标人群、关键承诺),且承重 问用户 / 从物料里抽
seam 私有但不承重;或问了答不上来("不知道 / 直接写") 显式列入 Open Questions,写清为什么需要人来定

承重槽的定义:其取值会改变产品形状、或会翻转某条验收结果的槽。典型:核心 Vision 赌注、目标 Persona、关键 Mental Model 承诺、能推翻朴素数据结构的 Domain 实体。

第四种来路(编造、默认值糊上)不存在。用户没说、物料里没有、又不是通用常识的东西,一律 seam。

世界(Σ):一份 PSL 长什么样

骨架六层,上一层是下一层的定律(这是推导依赖,不是填表顺序):

位点 写什么
Vision Σ 产品为什么存在。一句能推翻朴素实现的根命题。
Mental Model Σ 用户与 AI 共享的世界关键事实(如"时间不是时间戳")。
Domain Model Σ 核心实体 + 关联。必须能推翻朴素数据结构(否则这份 PSL 没干活)。
State Machine Σ 实体状态流转(领域动力学,不是执行顺序)。
Workflow Σ+φ 拆成 Σ(发生了什么)+ φ(消歧判据 + "对"的样子)。严禁写成 Step 1/2/3。
Acceptance φ-出口 怎样算"世界转对了"。每条都是"问 X → 返回 Y"的行为可判语句。

血肉层(按需):Personas / Jobs(JTBD)(Σ·用户:意图词表、场景→元素映射——最常被漏的 一层)、UI Contract(φ:产物须呈现的性质,不是交互流程)、Design Principles(φ:能 裁决冲突的取舍判据,不是口号)。

再加两块:γ 约束(消歧门 + seam 位置,以 done_when + 约束写,不写步骤)、 Open Questions(未决的承重槽,留给用户,每条写清为什么需要人来定)。

Read the full file on GitHub · 162 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 162 lines · 249 tokens per session scan A 82e97fac99f6

Subscribe to this mod's changes

psl is a skill published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed 1mo ago), licensed MIT. It adds 249 tokens to every session and 3,240 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens