poly-context
Skill by JetBrains
Implements PolyContext, an IntelliJ Platform mechanism that detects the active coding environment for a location, such as the web framework in use. It is for plugin developers who need feature gating or environment detection.
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/.agents/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/.agents/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 answers which coding environment applies at a given location. For a context kind such as "framework", it returns at most one active name, or null if none applies. Plugins can add detection through direct PolyContextProvider implementations, declarative Web Types context rules, or code-based rules.
The mechanism is designed to be cheap and cached, so it can serve any feature relevance check, not only JavaScript framework detection. A VirtualFile overload works before a PSI tree exists, which lets language substitution choose a dialect. Users can force context values with a .ws-context file. Poly Symbols is its biggest consumer, but PolyContext does not depend on it.
Written from the project's SKILL.md and checked against it.
What it can do
- PolyContext.getReturns the active name for a context kind at a PsiElement or VirtualFile location.
- PolyContextProviderAdds direct or dynamic detection by implementing isEnabled() or isForbidden().
- Context rules in Web TypesDeclares enable-when and disable-when rules under contexts-config in Web Types JSON files.
- PolyContextRulesProviderDefines context rules in code for cases that static file data cannot express.
- .ws-context overridesLets users force context values per file path using a JSON file with glob patterns.
- PolyContextSourceProximityProviderComputes proximity for new package managers or languages with a global-library concept.
Try asking
- Explain how to detect the active framework for a file with PolyContext.
- Show how to write a PolyContextProvider that caches its detection result.
- Add a Web Types contexts-config rule that enables a context for a file extension.
Good to know
- Rule output must stay stable, since a change triggers project rescanning and cache invalidation.
- The disable-when rule supports only file-extensions and file-name-patterns.
- The Node Package Manager Web Types context rule requires the JavaScript plugin.
- The pre-2024.2 Web Types layout is deprecated and should not be used for new files.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/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 given context kind at a location, or null if no name applies. The source gives "framework" with values such as "vue", "angular" or "astro" as an example.
Can PolyContext be used during language substitution?
Yes. The VirtualFile and Project overload works before any PSI exists for the file, so the platform can use it while deciding which Language to parse the file as.
Can users override detected contexts?
Since 2024.1.2, users can force context values with a .ws-context JSON file that maps context kinds or glob paths to values.
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.
