map-feature-gates
Analyzes codebase to identify and map build-time and runtime feature gates that control system capabilities.
Install
mkdir -p .claude/skills/map-feature-gates && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11119" && unzip -o skill.zip -d .claude/skills/map-feature-gates && rm skill.zipInstalls to .claude/skills/map-feature-gates
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when you need to understand why capabilities differ across configurations, user types, or deployment environments, or when investigating feature flags and capability gatesKey capabilities
- →Identify build-time gates
- →Map runtime feature flags
- →Detect permission gates
- →Find hidden capabilities
How it works
It analyzes the codebase for five types of gates (build-time, runtime, permission, provider, config) to map capability restrictions.
Inputs & outputs
When to use map-feature-gates
- →Identify which code blocks are disabled in production
- →Map user role permissions across the codebase
- →Trace feature flags affecting specific system behaviors
About this skill
Announce at start: "Using codebase-analyzer to map feature gates."
Overview
Map the gates that control which capabilities are available under which conditions. Gates are the control plane -- understanding them reveals what the system was designed to restrict and to whom.
Prerequisite: Reads docs/analysis/tool-graph.md (from extract-tool-graph) and docs/analysis/build-pipeline.md.
Five Gate Types with Detection
Build-Time Gates
Tools filtered during compilation. These never reach the runtime artifact.
- Where to look: Build config, preprocessor directives, build scripts
- Detection patterns:
#ifdef/#ifndef,process.envchecks in build scripts, conditional exports inpackage.json, webpackDefinePlugin, tree-shaking directives - Example:
if (process.env.NODE_ENV === 'production') includeAnalytics();
Runtime Gates
Tools enabled or disabled based on runtime state.
- Where to look: Feature flag checks, config reads, state conditionals
- Detection patterns:
flags.isEnabled('x'),user.type === 'admin',env === 'production',version >= '2.0', capability checks like'speechRecognition' in navigator - Example:
if (user.type === 'admin') registerAdminTools();
Permission Gates
Tools restricted by role or permission level.
- Where to look: Auth checks, role verification, access control logic
- Detection patterns:
user.role === 'admin',user.can('write'),token.scope.includes('api:write'),acl.check(resource, action) - Example:
if (hasPermission('write')) { enableEditTools(); }
Provider Gates
Tools available only for specific backends or providers.
- Where to look: Provider-specific code paths, backend routing
- Detection patterns:
config.provider === 'openai',typeof openai !== 'undefined',switch(provider) { case 'aws': ... } - Example:
if (provider === 'openai') registerOpenAITools();
Config Gates
Tools controlled by environment variables, settings files, or feature flag services.
- Where to look: Feature flag services (GrowthBook, Unleash, LaunchDarkly), environment variables, database flag tables, remote config endpoints
- Detection patterns:
config.featureEnabled('x'),process.env.ENABLE_X, feature_flags table queries,/api/configresponses - Example:
if (config.featureEnabled('beta-api')) exposeBetaEndpoint();
Hidden Capability Detection
Tools defined but never registered in any gate configuration are dead, hidden, or upcoming. Cross-reference with dead-code analysis.
Detection approach:
- Enumerate all tool definitions found in
docs/analysis/tool-graph.md - For each tool, trace registration path through all five gate types
- Tools with no gate controlling their registration fall into three categories:
- Dead code: Once used, now orphaned
- Hidden features: Intentionally unregistered, awaiting activation
- Upcoming: Implemented but not yet wired into the product
- Cross-reference with dead-code analysis to distinguish categories
SECURITY_SIGNAL
Gates are a security boundary. Flag the following:
- Gates that bypass authentication in non-production environments
- Capability escalation paths through gate chaining
- Hidden admin gates not documented in access control policies
- Feature flags that disable security controls without audit logging
- Provider gates that fall back to less-secure backends without warning
Adversarial Lens
If a gate was designed to be bypassable, what would it look like? Check: gates that check permissions but have a fallback that grants access, feature flags that default to "on" in production, admin checks that can be bypassed via API parameter. The most dangerous gate is one that looks like it works but doesn't.
Red Flags
- Only finding explicit gates, missing implicit ones (like build-time filtering)
- Not checking for gate bypass conditions (what happens when a gate fails open?)
- Treating all gates as equal -- a build-time gate and a runtime gate have different threat models
- Missing dynamic tool registration patterns that create gates at runtime
Output Contract
Write docs/analysis/gate-map.md using standard contract.
Include:
- Gate inventory grouped by type
- Tool-to-gate mapping (which gates control which tools)
- Hidden capabilities section
- Security signal findings
- Cross-reference with tool-graph and build-pipeline outputs
When not to use it
- →When the codebase lacks feature gates
- →When the user wants to modify gates
Prerequisites
Limitations
- →Requires accurate tool-graph and build-pipeline documentation
- →Missing implicit gates is a risk
How it compares
It provides a systematic map of capability control planes rather than just identifying individual flags.
Compared to similar skills
map-feature-gates side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| map-feature-gates (this skill) | 0 | 4mo | Review | Advanced |
| error-handling-patterns | 35 | 2mo | No flags | Intermediate |
| game-engine-resources | 14 | 4mo | No flags | Advanced |
| find-bugs | 5 | 7mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
error-handling-patterns
wshobson
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
game-engine-resources
gmh5225
Guide for game engine development resources including engine source code, plugins, and development guides. Use this skill when researching game engines (Unreal, Unity, Godot, custom engines), engine architecture, or game development frameworks.
find-bugs
davila7
Find bugs, security vulnerabilities, and code quality issues in local branch changes. Use when asked to review changes, find bugs, security review, or audit code on the current branch.
supabase-common-errors
jeremylongshore
Execute diagnose and fix Supabase common errors and exceptions. Use when encountering Supabase errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "supabase error", "fix supabase", "supabase not working", "debug supabase".
codebase-context-extractor
lofcz
This skill provides a comprehensive context extraction system for large codebases. It intelligently analyzes code structure, dependencies, and relationships to extract relevant context for understanding, debugging, or modifying code.
tech-debt-analyzer
ailabs-393
This skill should be used when analyzing technical debt in a codebase, documenting code quality issues, creating technical debt registers, or assessing code maintainability. Use this for identifying code smells, architectural issues, dependency problems, missing documentation, security vulnerabilities, and creating comprehensive technical debt documentation.