psl

psl is a skill for Claude Code from XRenSiu/claude-code-forge. It costs 249 tokens per session (4,747 once invoked), scanned A, original, MIT.

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 Code

Written for Claude Code: user-invocable in frontmatter.

Part of the ai-dlc plugin — 30 skills, 5 agents shipped together

Good fit 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.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xrensiu/claude-code-forge/psl
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.

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.

Or install ai-dlc, the plugin that ships this one along with the rest of its 30 skills, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for psl

README.md
[![agentmods](https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/psl/github.svg)](https://agentmods.dev/skills/xrensiu/claude-code-forge/psl)
Your own site
<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/psl"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/psl/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for psl

Your own site · 80×15
<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/psl"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/psl.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 249 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,747 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00249 $0.04747
Opus 5.5 $0.00100 $0.01899
Sonnet 5.5 $0.00050 $0.00949
Haiku 4.5 $0.00025 $0.00475

Measured 1mo ago against content hash d464694df2b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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/ai-dlc/skills/psl/SKILL.md · 218 lines

How it starts

The opening of the file, as written. The whole thing — 218 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。

来路要写得能被核对。 [elicit:物料 <文件> §N] 里的文件名与章节号是给别人复核用的,凭记忆 写等于没写——本次审计就把 ARCHITECTURE §7 的内容记成了 lifecycle.md §7,而 lifecycle.md 根本 没有 §7。verify_psl.py --material-root <物料目录> 对文件与章节做存在性 flag(只 flag:物料可能 不在本机)。标来路时打开那份文件确认一次,比事后被 G1 抓到便宜。

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

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

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

Read the full file on GitHub · 218 lines

Files

What ships with it

9 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. 1mo ago Changed d464694df2b5
  2. 1mo ago Changed · +22 lines 4f78d44f420b
  3. 1mo ago Changed · +34 lines df87e5258118
  4. 2mo 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 4,747 once invoked, about $0.0010 per session on Opus 5.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

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

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

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 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

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens