poly-context
Skill by JetBrains
Implements PolyContext feature gating and environment detection for IntelliJ Platform plugins. It reports which context name, such as a web framework, applies at a file or PSI element. Aimed at plugin developers who need cached, cheap context checks.
Install poly-context
Built from the published package, never by AI.
git clone --depth 1 https://github.com/JetBrains/intellij-community /tmp/intellij-community && mkdir -p ~/.claude/skills && cp -r /tmp/intellij-community/.claude/skills/poly-context ~/.claude/skills/poly-contextRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/JetBrains/intellij-community /tmp/intellij-community && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/intellij-community/.claude/skills/poly-context ~/.gemini/antigravity-cli/skills/poly-contextAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
PolyContext is an IntelliJ Platform mechanism that answers which coding environment applies at a location. For a given context kind, such as framework, it returns at most one active name, or null if none applies. It can be queried with a PsiElement, or with a VirtualFile and Project, which works before a PSI tree exists, such as during language substitution.
Detection can come from custom PolyContextProvider classes, from declarative context rules in Web Types files, or from PolyContextRulesProvider code. Users can also force values with a .ws-context file. The source notes that poly-symbols is the biggest consumer, but PolyContext has no dependency on PolySymbols or web frameworks. It is meant for developers building feature gating and environment detection in plugins.
Written from the project's SKILL.md and checked against it.
What it can do
- PolyContext.getReturns the active context name for a kind at a PsiElement or VirtualFile location.
- PolyContextProviderImplements isEnabled or isForbidden for direct, cached custom detection.
- Context rules in Web TypesDeclares enable-when and disable-when rules in a contexts-config property.
- PolyContextRulesProviderSupplies context rules from code for rules that cannot be expressed as static data.
- ws-context overridesLets users force context values per path with a .ws-context JSON file.
- PolyContextSourceProximityProviderCalculates proximity for package managers or languages with a global-library concept.
Try asking
- Add a PolyContextProvider that detects my framework from the file imports
- Write a Web Types contexts-config block that enables a context for .vue files
- Show how to gate my PolySymbols registrations with PolyContext framework checks
Good to know
- Results are called very often, so providers should cache them.
- Rule output must stay stable, because a change triggers project rescanning and cache invalidation.
- The pre-2024.2 Web Types layout is deprecated and should not be used for new files.
- The source describes a general mechanism and lists only one official doc page for it.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .claude/skills/poly-context/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to poly-context
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
poly-context: common questions
What does PolyContext return?
It returns the single active name for a context kind at a location, or null if none applies. For example, a framework kind might return vue, angular, astro, or null.
Can PolyContext run before a file is parsed?
Yes. The VirtualFile and Project overload works without PSI access, so it can be used during language substitution before a PSI tree is built.
Is PolyContext only for web frameworks?
No. The source gives non-web examples such as Ruby gems and Symfony bundles, and says it has no dependency on PolySymbols or web frameworks.
How do I install poly-context?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is poly-context free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is poly-context safe to use?
It scores 78 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to poly-context?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
