ワンクリックで
enterprise-integration-skill
Patterns for Microsoft Graph, Azure AD, and enterprise feature integration in VS Code extensions
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Patterns for Microsoft Graph, Azure AD, and enterprise feature integration in VS Code extensions
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Focus blocks, distraction management, and flow state triggers for cognitively demanding work
Internal metacognitive skill for automatic capability discovery — self-triggers when uncertain about available skills
End-to-end academic paper drafting for CHI, HBR, journals, and conferences with venue-specific templates, drafting workflows, and revision strategies.
Patterns for thesis writing, dissertations, research papers, literature reviews, and scholarly work.
**Domain**: AI/ML Architecture
Domain knowledge for AI adoption measurement, psychometric instrument development, and appropriate reliance research
| name | Enterprise Integration Skill |
| description | Patterns for Microsoft Graph, Azure AD, and enterprise feature integration in VS Code extensions |
| applyTo | **/enterprise/**,**/graph/**,**/auth/** |
Expert in building enterprise features with Microsoft Graph API, Azure AD authentication, and enterprise-mode feature gating for VS Code extensions.
Microsoft Graph and Azure AD APIs evolve frequently. Authentication flows and permission models change.
Refresh triggers:
Last validated: February 2026 (MSAL 2.x, Graph v1.0)
Check current state: Microsoft Graph docs, MSAL.js docs
// Progressive scope acquisition - request minimal scopes initially
const INITIAL_SCOPES = ['User.Read'];
const GRAPH_SCOPES = [
'User.Read',
'Calendars.Read',
'Mail.Read',
'Presence.Read',
'People.Read'
];
// Get token with automatic scope upgrade
async function getGraphToken(): Promise<string | null> {
const session = await vscode.authentication.getSession(
'microsoft',
GRAPH_SCOPES,
{ createIfNone: false }
);
return session?.accessToken ?? null;
}
// Check availability without triggering auth prompt
function isGraphAvailable(): boolean {
return !!cachedToken && isEnterpriseMode();
}
const GRAPH_ENDPOINT = 'https://graph.microsoft.com/v1.0';
async function graphFetch<T>(path: string): Promise<T | null> {
const token = await getGraphToken();
if (!token) return null;
const response = await fetch(`${GRAPH_ENDPOINT}${path}`, {
headers: { 'Authorization': `Bearer ${token}` }
});
if (!response.ok) {
console.error(`Graph API error: ${response.status}`);
return null;
}
return response.json();
}
| Feature | Endpoint | Scope Required |
|---|---|---|
| Calendar | /me/calendar/events | Calendars.Read |
/me/messages | Mail.Read | |
| Presence | /me/presence | Presence.Read |
| People | /me/people | People.Read |
| User Profile | /me | User.Read |
// Check enterprise mode is enabled
function isEnterpriseMode(): boolean {
const config = vscode.workspace.getConfiguration('alex.enterprise');
return config.get<boolean>('enabled', false);
}
// Check specific feature is enabled
function isCalendarEnabled(): boolean {
if (!isEnterpriseMode()) return false;
const config = vscode.workspace.getConfiguration('alex.enterprise.graph');
return config.get<boolean>('calendarEnabled', true);
}
// In WebviewView provider
private getHtmlContent(): string {
const showEnterprise = isEnterpriseMode();
const graphConnected = isGraphAvailable();
return `
${showEnterprise ? `
<section class="enterprise">
<h3>Enterprise</h3>
${graphConnected
? this.getGraphButtons()
: this.getSignInButton()}
</section>
` : ''}
`;
}
{
"commands": [
{
"name": "calendar",
"description": "View upcoming calendar events",
"when": "config.alex.enterprise.enabled"
}
]
}
Enterprise settings should be hierarchically organized:
{
"alex.enterprise.enabled": {
"type": "boolean",
"default": false,
"description": "Master toggle for enterprise features"
},
"alex.enterprise.graph.enabled": {
"type": "boolean",
"default": true,
"description": "Enable Microsoft Graph integration"
},
"alex.enterprise.graph.calendarEnabled": {
"type": "boolean",
"default": true,
"description": "Feature-specific toggle"
},
"alex.enterprise.graph.calendarDaysAhead": {
"type": "number",
"default": 7,
"minimum": 1,
"maximum": 30,
"description": "Feature-specific configuration"
}
}
Hierarchy: extension.area.feature.setting
interface IAlexChatResult extends vscode.ChatResult {
metadata?: {
command?: string;
// Command-specific metadata
eventCount?: number;
messageCount?: number;
error?: boolean;
};
}
async function handleCalendarCommand(
request: vscode.ChatRequest,
stream: vscode.ChatResponseStream,
token: vscode.CancellationToken
): Promise<IAlexChatResult> {
// Check prerequisites
if (!isEnterpriseMode()) {
stream.markdown('Enterprise mode is not enabled.');
return { metadata: { command: 'calendar', error: true } };
}
if (!isGraphAvailable()) {
stream.markdown('Please sign in to Microsoft Graph first.');
return { metadata: { command: 'calendar', error: true } };
}
// Execute feature logic
const events = await getCalendarEvents();
stream.markdown(formatCalendarEvents(events));
return {
metadata: {
command: 'calendar',
eventCount: events.length
}
};
}