symbol-analysis
Answers C# structure questions with puck references and declarations: which types derive from, implement or override a symbol, who references it, safe to delete or rename. Text: content-search.
- License 许可
- Apache-2.0
- 所属仓库
- ByteTerrace/Puck
- 最近更新
- 2026-11-12
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- symbol-analysis
- description
- Answers C# structure questions with puck references and declarations: which types derive from, implement or override a symbol, who references it, safe to delete or rename. Text: content-search.
02 资源文件 35
- 参考文档evals/y01-implementers-of-frame-source/graders/implementers-flag.md119 B
- 参考文档evals/y01-implementers-of-frame-source/graders/narrows-the-member-query.md69 B
- 参考文档evals/y01-implementers-of-frame-source/graders/partial-locations.md108 B
- 参考文档evals/y01-implementers-of-frame-source/graders/skill-fired.md36 B
- 参考文档evals/y01-implementers-of-frame-source/prompt.md344 B
- 参考文档evals/y02-unused-extension-type/graders/builds-before-deleting.md156 B
- 参考文档evals/y02-unused-extension-type/graders/extension-call-sites.md108 B
- 参考文档evals/y02-unused-extension-type/graders/no-doc-flag.md65 B
- 参考文档evals/y02-unused-extension-type/graders/puck-references.md93 B
- 参考文档evals/y02-unused-extension-type/graders/skill-fired.md36 B
- 参考文档evals/y02-unused-extension-type/graders/type-versus-member.md108 B
- 参考文档evals/y02-unused-extension-type/graders/uncompiled-files.md117 B
- 参考文档evals/y02-unused-extension-type/prompt.md345 B
- 参考文档evals/y03-declarations-of-a-file/graders/declarations-members.md86 B
- 参考文档evals/y03-declarations-of-a-file/graders/missing-path-is-an-error.md108 B
- 参考文档evals/y03-declarations-of-a-file/graders/no-semantic-usage.md201 B
- 参考文档evals/y03-declarations-of-a-file/graders/sees-uncompiled-code.md83 B
- 参考文档evals/y03-declarations-of-a-file/graders/skill-fired.md36 B
- 参考文档evals/y03-declarations-of-a-file/graders/syntactic-and-build-free.md112 B
- 参考文档evals/y03-declarations-of-a-file/prompt.md467 B
- 参考文档evals/y04-workspace-load-fails-in-fresh-worktree/graders/rejects-allow-partial.md110 B
- 参考文档evals/y04-workspace-load-fails-in-fresh-worktree/graders/restores-the-solution.md98 B
- 参考文档evals/y04-workspace-load-fails-in-fresh-worktree/graders/skill-fired.md36 B
- 参考文档evals/y04-workspace-load-fails-in-fresh-worktree/prompt.md359 B
- 参考文档evals/y05-alias-hides-a-reference/graders/alias-hides-text-matches.md154 B
- 参考文档evals/y05-alias-hides-a-reference/graders/builds-after-the-rename.md134 B
- 参考文档evals/y05-alias-hides-a-reference/graders/puck-references.md93 B
- 参考文档evals/y05-alias-hides-a-reference/graders/skill-fired.md36 B
- 参考文档evals/y05-alias-hides-a-reference/prompt.md402 B
- 参考文档evals/y06-overrides-and-derived/graders/derived-flag.md114 B
- 参考文档evals/y06-overrides-and-derived/graders/narrows-same-named-members.md69 B
- 参考文档evals/y06-overrides-and-derived/graders/overrides-flag.md116 B
- 参考文档evals/y06-overrides-and-derived/graders/skill-fired.md36 B
- 参考文档evals/y06-overrides-and-derived/prompt.md362 B
- 参考文档references/complete-reference.md16.7 KB
03 SKILL.md 正文
Symbol analysis
Use compiler-backed evidence for C# structure. Text matching cannot resolve aliases, overloads, extensions, generic instantiations, or name collisions. Treat repository-specific examples as snapshots; re-run the command against the current tree before relying on one.
| Question | Command |
|---|---|
| Who references it, is it dead, is a delete safe | puck references <name> --no-doc, then puck search -M 0 -l <name> for files no project compiles; build the affected projects before declaring a delete safe |
| What implements this interface or member | puck references <name> --implementers |
| What overrides this member | puck references <name> --overrides |
| What derives from this type | puck references <name> --derived |
| Two same-named symbols: which is which | puck references <name> --declarations, then narrow with --containing <namespace-or-type> |
| What a file or tree declares, members, base lists, attributes, crefs | puck declarations --members <path> (add --kind, --name, --base, --attribute, --doc); parse-only, so it needs no build and sees uncompiled files, but proves no usage |
| Literal, config or non-C# content | content-search |
| Whether a refactor still compiles | Build the affected project |
.puck DSL name resolution (state, prototype, placement, camera names, imports) |
Neither verb parses .puck; use puck lint (PUCK_LINT_00x) and the DSL's LSP, see puck-dsl |
Start the CLI from a clean checkout
Run from the repository root with the checkout's own CLI build, never a
published copy or the global puck tool, both of which lag the head. Copy
src/Puck.Cli/bin/Release/net11.0/ to a scratch directory named for your lane
and run the copy, so the running tool never locks the build output another
build needs:
dotnet <lane>-cli/Puck.Cli.dll <verb> <arguments>
If that build is absent, build it (dotnet build src/Puck.Cli -c Release -nodeReuse:false) and copy it
(verification);
dotnet run on the project runs the build in place and locks its output, so it
is not a substitute for the copy.
references loads the whole solution. A fresh worktree is unrestored, and the
load then fails with exit 2 and a message counting the projects that carry no
obj/project.assets.json: run dotnet restore Puck.slnx -nodeReuse:false at the
worktree root and retry. declarations needs neither a restore nor a build.
Evidence rules
- Inventory a family with
declarations, then query named symbols one at a time. An empty-namereferences "" --contains --containing <family>can retain gigabytes of workspace and reference state while searching every matching member; narrowing the containing name does not make that broad query cheap. Usesearchfor a textual family inventory. referencesloads a project graph and resolves symbols. Narrowing with--projectchanges the closure and therefore the question.- Read the definition on each
refline: it is the resolved symbol, which is not always the one queried. Constructing a type reports under its constructor, and an interface-dispatched call reports under the interface.--strictkeeps only the queried symbol's own group, so it hides every construction site. - Documentation
creflocations count as references;--no-docdrops them. A symbol whose only references are crefs is a dead-code candidate. - A symbol that looks unused by name can be used through an extension method or
a
usingalias, and one that looks used can be a name collision. Check the member, not only the containing type (AllocatorExtensionshas no references while itsAllocmethod has many). - Rename safety: a text count undercounts, because a
using Alias = ...;hides the type's name at its uses. Take thereferenceslist, then build the affected projects after the rename; the compiler is the full check. referencescannot see files no project compiles (the quarantinedexperimental/trees, file-based apps). "Zero references" means zero compiled references: pair a deletion decision withpuck search -M 0 -l <name>.declarationsparses syntax without a build and can see those files, but it matches names and cannot prove semantic usage. A missing path is an error (exit 2), never an empty inventory.- A partial workspace load is not a clean answer. Use
--allow-partialonly when explicitly accepting and reporting incomplete evidence. - Inspect ambiguity and resolved-definition output before acting on a short
symbol name. Several
partialdeclarations of one type report one line each. references/declarationsparse the C# project graph only; nothing inPuck.Cli's analysis verbs parses.puck. Treat a.puckname question as out of scope rather than assuming a text search is the only fallback.
Load the full reference selectively
Read references/complete-reference.md for exact flags and output, solution/project closure traps, documentation behavior, generated and inactive-code limits, verified edge cases, and the Release-mode file-based Roslyn app fallback.
Related skills
| Question | Skill |
|---|---|
| Literal, config or non-C# text; exhaustive file lists | content-search |
.puck name diagnostics, puck lint |
puck-dsl |
| Whether a deletion or rename also leaves stale docs | boy-scout |
04 同仓库更多 Skills
verification
Verifies Puck changes: landing bar, builds, stale DLLs, flaky tests, GPU/heavy leases, coverage, source-scan or regex laws versus type/compiler enforcement, and writing tests.
tooling
Maps shared build/CLI architecture, compiler assembly identity, candidate installation, generated sections, and host admission.
tooling-files
Maps shared repository tooling for files, paths, Git queries, project ownership and Markdown fences. Load before adding or changing a helper in these areas.
state
Maps Puck's state and rule engine (Puck.State, .Rules, .Search, .Topology, .Vectors, .Generators): arena, journal scopes, undo, hashing, rule compiler, faults, transforms, search, draws.
sdf-authoring
Authors creations: shape rows, primitives, blends, folds, palettes, paints, render lanes, rigs, bake work and bytes, creation stats. Use to sculpt or fix a part. Grammar: puck-dsl; GPU: rendering.
rom-forge
Authors and compiles Puck cartridges (puck.cartridge.v1, *.cgb.puck, *.dmg.puck, *.agb.puck, forge.play, forge.open, puck compile --validate), native compilers, cost. Emulator core is gaming-bricks.