一键导入
pattern-debug
Debug pattern errors systematically
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Debug pattern errors systematically
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Review a changeset for the Common Fabric repo — the local branch diff vs main, or a GitHub PR. Flags correctness and regression bugs loudly, checks that runtime-semantics changes stay coherent across docs/comments/examples, catches duplicated core machinery (hashing, serialization, cloning, identity) and code fighting the transformer/reactive model, and scrutinizes whether the tests guard the right principles. Report-first; offers to post a self-signed PR review. Use when asked to review code, review a PR, review the current branch or diff, or self-review before pushing. Invoke as /cf-review or /cf-review <PR#>.
Agent-specific interaction patterns for working with FUSE-mounted spaces. Use when deploying patterns via FUSE, working with Activity Logs, Annotations, or coordinating agent workflows that read/write pieces through the filesystem. Triggers include "deploy a pattern", "log an event", "create annotation", "agent workflow", or managing piece lifecycle via FUSE.
Critic agent that reviews pattern code for violations of documented rules, gotchas, and anti-patterns. Produces categorized checklist output with [PASS]/[FAIL]/[WARN] for each rule.
Guide for developing Common Fabric patterns (TypeScript modules that define reactive data transformations with UI). Use this skill when creating patterns, modifying existing patterns, or working with the pattern framework. Triggers include requests like "build a pattern", "fix this pattern error", "deploy this piece", or questions about handlers and reactive patterns.
Build Common Fabric patterns and sub-patterns
Guide for using the cf (Common Fabric) CLI to interact with pieces, patterns, and the Common Fabric. Use this skill when deploying patterns, managing pieces, linking data between pieces, or debugging pattern execution. Triggers include requests to "deploy this pattern", "call a handler", "link these pieces", "get data from piece", or "test this pattern locally".
| name | pattern-debug |
| description | Debug pattern errors systematically |
| user-invocable | false |
Use the cf skill, or read skills/cf/SKILL.md, if debugging deployment or
piece issues.
docs/development/debugging/workflow.md - 5-step debugging processdocs/development/debugging/README.md - Error reference matrixdocs/common/concepts/reactivity.md and docs/common/patterns/new-cells.md —
as mandated by pattern-dev; re-consult for Cell, Writable, or reactive-value
failuresCheck TypeScript errors:
deno task cf check pattern.tsx --no-run
Match error to documentation:
docs/development/debugging/README.md for matching errorsCheck gotchas:
docs/development/debugging/gotchas/quick.md - consolidated quick gotchas,
one anchor per error (e.g. #filter-map-find-is-not-a-function,
#onclick-inside-computed)docs/development/debugging/gotchas/reactive-reference-outside-context.mddocs/development/debugging/gotchas/handler-inside-pattern.mddocs/development/debugging/gotchas/immediate-event-invocation.mdSimplify to minimal reproduction:
Fix and verify:
Handler defined inside pattern body:
onClick={myHandler({ state })}Type errors with Writable/Default:
new Cell() only accepts static data:
new Writable() / new Cell(). See the static-only rule and field-decision
guidance in the pattern-implement skill, plus
docs/common/patterns/new-cells.mdString helper throws, such as .trim() / .replace() / .includes() is not
a function:
stringcomputed() or another valid
reactive expression sitedocs/common/concepts/reactivity.md and the debugging matrixAction not triggering:
raw:map never settles:
.map() bodies for event props that invoke streams or writes during
render, such as onClick={stream.send(index)}onClick={() => stream.send(index)}docs/development/debugging/gotchas/immediate-event-invocation.mdBrowser UI stays stale after a write:
.push() is broken just because
tests/CLI and browser behavior divergecomputed() wrapping JSX — conditional rendering broken:
computed() body, ternaries are plain JS (Writable objects always
truthy)$value, $checked) inside computed() may get positionally
mis-resolvedcomputed() for data onlydocs/common/concepts/computed/computed.mdTransient UI state carries over when it should not:
PerSession<> for per-session UI
state, PerUser<> for user-owned durable state).deno task cf check pattern.tsx --show-transformed.undefined, check for schema-scope traversal
restrictions: a narrower linked value may be unavailable to a broader declared
schema.PerAny<> used to fix a scope issue:
PerAny<> as a rare inner override under an outer Per* declaration,
not as a fourth default scope.PerSession<{ item: PerUser<Item>; attachment: PerAny<Attachment> }> is valid
when attachments intentionally may come from any scope.PerSpace<>, PerUser<>, or PerSession<>
instead.When the pattern compiles but behaves wrong at runtime, use the browser console
utilities. Full reference: docs/development/debugging/console-commands.md.
With agent-browser (for automated testing):
# Read piece cell values
agent-browser eval "(async () => {
const v = await commonfabric.readCell();
return JSON.stringify(v).slice(0, 500);
})()"
# Inspect VDOM tree
agent-browser eval "(async () => {
await commonfabric.vdom.dump();
return 'dumped';
})()"
# Detect non-idempotent computations (UI churning)
agent-browser eval "(async () => {
const r = await commonfabric.detectNonIdempotent(5000);
return JSON.stringify({ nonIdempotent: r.nonIdempotent.length, cycles: r.cycles.length });
})()"
# Check for action schema mismatches (handlers doing nothing)
agent-browser eval "JSON.stringify(commonfabric.getLoggerFlagsBreakdown())"
When tests or CLI calls succeed but browser-visible UI stays stale:
In browser console (for interactive debugging):
// Read cell values
await commonfabric.readCell();
await commonfabric.readArgumentCell({ path: ["items"] });
// Watch values change during interaction
const cancel = commonfabric.subscribeToCell();
// ... interact ... then cancel()
// VDOM tree
await commonfabric.vdom.dump();
commonfabric.vdom.stats();
// Logger counts and timing
commonfabric.getLoggerCountsBreakdown();
commonfabric.getTimingStatsBreakdown();
// Non-idempotent detection
await commonfabric.detectNonIdempotent();
deno task cf check succeeds
and the failing repro behaves correctly