| name | protocol-knowledge |
|---|---|
| description | Use this skill when a coding agent needs version-pinned dependency semantics from Maven artifacts and must inspect protocol or adjacent library sources without guessing from namespace, README prose, or latest repository state. Trigger for work involving `pom.xml`, `.thrift`, `.proto`, protocol methods, fields, enums, RPCs, callbacks, lifecycle semantics, transport contracts, or library integration points tied to dependency behavior. |
Resolve the exact artifact version from the consumer project, query that pinned artifact, and verify behavior against canonical source before making claims or code changes. This skill is for source-grounded protocol navigation, not for latest-based lookup or prose-driven inference.
If protocol-knowledge is not installed as a global CLI in the current environment, run the repo-local entrypoint instead:
npm run dev -- <protocol-knowledge-subcommand> ...- Work from the consumer project's pinned dependency version.
- Prefer
pom.xmlevidence over package-name or namespace guesses. - Prefer raw
.thriftor.protoas semantic truth when available. - Treat retrieval as navigation, not final truth.
- Open returned canonical source before asserting behavior, field shape, callback semantics, or lifecycle rules.
- If local prose disagrees with canonical source, treat the prose as commentary only.
-
Start with:
protocol-knowledge inspect-project --pom pom.xml --all-dependencies --json
Repo-local fallback:
npm run dev -- inspect-project --pom pom.xml --all-dependencies --json
-
If direct dependencies do not explain the symbol, package, or import you are tracing, rerun with the effective Maven tree:
protocol-knowledge inspect-project --pom pom.xml --all-dependencies --transitive --json
Repo-local fallback:
npm run dev -- inspect-project --pom pom.xml --all-dependencies --transitive --json
-
Use local implementation files as implementation context only.
-
Use local README or notes only as repository context, never as protocol truth.
- Identify the relevant dependency from the manifest or transitive tree.
- If artifact selection by
--artifactis ambiguous, use--gav. - Do not infer the owning artifact from package or namespace alone; one artifact can expose multiple namespaces or protocol files.
-
Query through the consumer project when artifact selection is clear:
protocol-knowledge query --pom pom.xml --artifact <artifactId> --q "<ExactSymbol> lifecycle semantics" --json
Repo-local fallback:
npm run dev -- query --pom pom.xml --artifact <artifactId> --q "<ExactSymbol> lifecycle semantics" --json
-
If the artifact is only reachable through transitive dependencies, include
--transitive:protocol-knowledge query --pom pom.xml --artifact <artifactId> --q "<ExactSymbol>" --transitive --json
Repo-local fallback:
npm run dev -- query --pom pom.xml --artifact <artifactId> --q "<ExactSymbol>" --transitive --json
-
If coordinates are already known or selection is ambiguous, query directly:
protocol-knowledge query --gav <groupId:artifactId:version> --q "<ExactSymbol>" --json
Repo-local fallback:
npm run dev -- query --gav <groupId:artifactId:version> --q "<ExactSymbol>" --json
-
If you want an explicit prefetch and index-build step first, run:
protocol-knowledge ensure-artifact --gav <groupId:artifactId:version> --json
Repo-local fallback:
npm run dev -- ensure-artifact --gav <groupId:artifactId:version> --json
- Treat the top hit as a starting point, not final truth.
- Use:
artifact_keyto confirm the exact pinned artifact version;match_modeto understand exact, FTS/BM25, or hybrid retrieval;kindto distinguish whether the hit is a service, RPC, message, field, enum, enum value, oneof, or adjacent library symbol;symbol,symbol_path, andqualified_symbolto decide what to open next;file_path,start_line, andend_lineto open the canonical source location;commentsas useful local contract context, while still treating the source definition as authoritative;related_symbolsfor immediate expansion candidates;scoreas ranking signal only, not correctness proof.
- Open the returned canonical source files.
- Reconcile protocol semantics with the local implementation before editing code.
- For current repository behavior, local implementation code wins.
- For protocol contract semantics, canonical protocol source wins.
- Prefer exact symbol names when known.
- Add behavior terms that narrow the question to contract semantics or library intent.
- Good shapes:
<ExactMethodOrRpcName> lifecycle semantics<ExactTypeName> validation rules<LibraryClassOrFunctionName> integration flow
- Weak shapes:
payment flowcallbackshow does it work
- Do not query
latest. - Do not treat unnamed repository state as the source of truth.
- Do not trust retrieval results without opening source.
- Do not use local README as protocol truth.
- Do not use generated Java as the preferred semantic source when raw IDL is available.
- Do not expand scope to unrelated artifacts when
--artifactselection is ambiguous; switch to--gav.
When this skill materially informs an answer or code change, make the reasoning traceable:
- identify which pinned artifact version was used;
- state whether the artifact came from direct or transitive dependency inspection;
- mention whether the result path was exact, FTS/BM25, or hybrid when that matters;
- cite the canonical source files inspected before making behavioral claims;
- distinguish protocol truth from local implementation behavior when they are different concerns.