Teams App Developer
MicrosoftOfficialPublished by Microsoft
- Skill
- Tool integration
- Software development
- MIT
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The teams-app-developer skill provides a structured framework for managing the lifecycle of Microsoft 365 agents and Teams applications. It leverages the ATK CLI to handle project scaffolding, local testing via the Agents Playground, cloud provisioning on Azure, and troubleshooting. The skill includes specialized guidance for migrating Slack bots to Teams, including converting Block Kit UI to Adaptive Cards, and provides access to an extensive library of micro-expert documentation for cross-platform development.
What it does
- Scaffolds new Microsoft 365 agents and Teams applications from templates.
- Facilitates local testing using the Agents Playground or Teams-specific environments.
- Automates Azure resource provisioning and cloud deployment workflows.
- Provides diagnostic procedures for common authentication and configuration errors.
- Supports migration of Slack bots to the Teams platform.
- Manages project configuration and environment variables for ATK-based projects.
When to use it
- When starting a new Teams app, bot, or Declarative Agent project.
- When you need to test an agent locally before deploying to the cloud.
- When migrating existing Slack bots to the Microsoft Teams ecosystem.
- When troubleshooting deployment or authentication issues in a Teams project.
- When you need to provision Azure infrastructure for a Teams application.
Advantages
- Streamlines the development lifecycle with standardized CLI commands.
- Reduces development time by offering a local testing playground.
- Provides expert-level guidance for complex cross-platform migrations.
- Ensures consistent configuration management across development environments.
- Includes robust error-handling protocols for common platform-specific pitfalls.
Usage examples
- “Create a new Teams bot project using the default template.”
- The agent will initialize a new project folder, configure the necessary YAML files, and guide you through the initial setup using the ATK CLI.
- “How do I migrate my Slack bot to Microsoft Teams?”
- The agent will initiate the slack-to-teams workflow, providing access to cross-platform bridging experts and guidance on converting UI components.
- “My Teams bot is returning a 401 error, how do I fix it?”
- The agent will trigger the troubleshooting workflow, checking your environment variables, tunnel status, and authentication configuration.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/microsoft/teams-app-developer/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip teams-app-developer.zip -d .agents/skills
Documentation by Microsoft
Microsoft 365 Agents Toolkit Skill
Build Microsoft 365 agents and Teams apps using the ATK CLI.
AI Behavior Guidelines
Testing Strategy: Recommend Agents Playground first (faster, no M365 needed). Use Teams workflow only if user explicitly requests it.
Environment Variables: NEVER hardcode secrets or make up placeholder values. Always ask users for real values.
Error Handling: Read error messages carefully. Check
env/.env.local,.localConfigs, andatk auth list. Common pitfalls:AADSTS7000229→aadApp/createmissinggenerateServicePrincipal: truein YAML — add it and re-provisionMissing
TENANT_IDin.localConfigs→ SDK uses wrong token authority → 401 from Bot Connector401 persists after auth fix → devtunnel URL may be blacklisted — create a fresh tunnel
See troubleshoot/troubleshoot.md for full diagnostic steps
Long-Running Commands — WAIT for completion:
atk new,atk provision,atk deploycan take several minutesAlways wait for completion before running the next step (timeout 120000ms+)
Local Service Startup — Hangs terminal (expected):
npm run dev,npm start,python app.py,devtunnel host, etc. will hang — the process keeps running indefinitelyALWAYS run as a background process (
isBackground=true) — NEVER useisBackground=falsefor these commandsDo NOT wait for it to "finish" — verify startup by checking output for "listening on port" or tunnel URL
If errors appear, read logs, diagnose, fix, restart
Use a NEW terminal to launch Agents Playground or open Teams sideloading URL
Monitor App Logs: Periodically check background terminal output for runtime errors. If the app crashes, read the error, fix the root cause, and restart.
Telemetry Tagging: Before running any
atkCLI commands, set the session environment variable so all CLI invocations are tagged as skill-initiated:export ATK_CLI_SKILL=trueRun this once at the start of the session. All subsequent
atkcommands in the same terminal will inherit it.
ATK CLI Setup
atk --version # Must be > 1.1.5-betaIf ATK is not found or version is too old:
npm i -g @microsoft/m365agentstoolkit-cli@betaCLI Global Options
| Option | Meaning | Recommendation |
|---|---|---|
-i | Interactive mode | Always use -i false in automation to avoid hanging |
-f | Project folder | Default to be current directory, used when specifying a custom folder. When scaffolding a new project, this is the parent folder where the project folder will be created under. |
-h | Command help | Use atk <command> -h for quick syntax checks |
Sub-Skills
| Sub-Skill | When to Use | Reference |
|---|---|---|
| create-project | Scaffold new project from template, choose template, atk new | create-project/create-project.md |
| test-playground | Test locally with Agents Playground, agentsplayground, quick testing | test-playground/test-playground.md |
| test-teams | Run on Teams, devtunnel, sideload, Teams testing, test in Copilot | test-teams/test-teams.md |
| provision-deploy | Provision Azure resources, deploy to cloud, atk provision, atk deploy | provision-deploy/provision-deploy.md |
| troubleshoot | Fix errors, 401, port conflicts, YAML errors, stale bots | troubleshoot/troubleshoot.md |
| slack-to-teams | Migrate Slack bot to Teams, cross-platform bridging, Block Kit to Adaptive Cards | slack-to-teams/SKILL.md |
MANDATORY: Before executing any workflow, read the corresponding sub-skill document.
Shared References
manifest-and-yaml.md — Project files, YAML config, env vars, .localConfigs flow
commands.md — ATK CLI commands: package, validate, share, collaborate
templates.md — Complete template catalog with language support
experts/ — 100+ micro-expert files: Teams SDK, Slack SDK, cross-platform bridging, deploy, AI models, security, language conversion
docs/ — Platform comparison guides: UI, messaging, identity, infrastructure, feature gaps
Workflow Chains
Match user intent to the smallest valid workflow.
| User Intent | Workflow (read in order) |
|---|---|
| Build new app from scratch | create-project → test-playground |
| Test existing project locally | test-playground (recommended) or test-teams |
| Deploy to Azure | provision-deploy |
| Fix broken bot | troubleshoot → re-test |
| Migrate Slack bot to Teams | slack-to-teams |
MANDATORY: Before executing any slack-to-teams workflow, read slack-to-teams/SKILL.md first. The sub-skill contains a routed expert system with 100+ micro-expert files for cross-platform bot development.
ATK Project Context Resolution
Resolve config values only when missing. If a value is already known in the session, reuse it.
Step 1: Detect ATK Project
If m365agentstoolkit*.yml exists in the current folder, treat it as an ATK project and parse configuration.
Step 2: Resolve Common Configuration
Resolve variables referenced in m365agentstoolkit*.yml. Common variables:
AZURE_OPENAI_API_KEY
AZURE_OPENAI_ENDPOINT
AZURE_OPENAI_DEPLOYMENT_NAME
Step 3: Collect Missing Values
If required values are missing, ask the user for only the missing ones.
Refer to manifest-and-yaml.md for full config-file details.
Files
- ATTRIBUTION.mdAdded by AutoGineer906 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md7.6 KiB
- create-project/create-project.md8.1 KiB
- docs/README.md2.8 KiB
- docs/advanced-features.md7.0 KiB
- docs/feature-gaps.md46.3 KiB
- docs/files-and-links.md4.2 KiB
- docs/identity-and-auth.md4.3 KiB
- docs/infrastructure.md6.7 KiB
- docs/interactive-responses.md4.4 KiB
- docs/messaging-and-commands.md4.5 KiB
- docs/middleware-and-handlers.md4.4 KiB
- docs/ui-components.md6.9 KiB
- docs/workflows.md14.4 KiB
- experts/README.md8.6 KiB
- experts/_expert-ts.md2.2 KiB
- experts/analyzer.md14.0 KiB
- experts/bridge/app-distribution-packaging-ts.md14.2 KiB
- experts/bridge/channel-ops-graph-ts.md15.4 KiB
- experts/bridge/commands-slash-text-ts.md18.5 KiB
- experts/bridge/cross-platform-advisor-ts.md36.4 KiB
- experts/bridge/cross-platform-architecture-ts.md8.3 KiB
- experts/bridge/events-activities-ts.md22.4 KiB
- experts/bridge/files-upload-download-ts.md17.2 KiB
- experts/bridge/identity-oauth-bridge-ts.md19.8 KiB
- experts/bridge/index.md13.0 KiB
- experts/bridge/infra-compute-ts.md14.6 KiB
- experts/bridge/infra-observability-ts.md14.0 KiB
- experts/bridge/infra-secrets-config-ts.md13.2 KiB
- experts/bridge/infra-storage-ts.md14.3 KiB
- experts/bridge/interactive-responses-ts.md19.6 KiB
- experts/bridge/link-unfurl-preview-ts.md17.1 KiB
- experts/bridge/middleware-handlers-ts.md15.4 KiB
- experts/bridge/python-cross-platform.md9.3 KiB
- experts/bridge/rate-limiting-resilience-ts.md17.6 KiB
- experts/bridge/rest-only-integration-ts.md8.4 KiB
- experts/bridge/scheduling-deferred-send-ts.md17.8 KiB
- experts/bridge/shortcuts-extensions-ts.md17.5 KiB
- experts/bridge/transport-socketmode-https-ts.md14.3 KiB
- experts/bridge/ui-app-home-personal-tab-ts.md14.5 KiB
- experts/bridge/ui-block-kit-adaptive-cards-ts.md21.5 KiB
- experts/bridge/ui-legacy-attachments-cards-ts.md11.2 KiB
- experts/bridge/ui-modals-dialogs-ts.md21.4 KiB
- experts/bridge/workflow.composable-platform-ts.md13.7 KiB
- experts/bridge/workflows-automation-ts.md14.3 KiB
- experts/builder.md11.1 KiB
- experts/convert/bulk-conversion-strategy-ts.md12.8 KiB
- experts/convert/dependency-mapping-ts.md8.3 KiB
- experts/convert/index.md3.5 KiB
- experts/convert/java-to-ts-ts.md20.6 KiB
- experts/convert/js-to-ts-ts.md6.2 KiB
- experts/convert/json-serialization-ts.md11.0 KiB
- experts/convert/kotlin-to-ts-ts.md11.2 KiB
- experts/convert/ruby-to-ts-ts.md9.7 KiB
- experts/convert/type-mapping-ts.md10.1 KiB
- experts/deploy/aws-bot-deploy-ts.md14.6 KiB
- experts/deploy/aws-cli-reference-ts.md52.4 KiB
- experts/deploy/azure-bot-deploy-ts.md15.4 KiB
- experts/deploy/azure-cli-reference-ts.md16.9 KiB
- experts/deploy/index.md4.6 KiB
- experts/fallback.md2.1 KiB
- experts/index.md18.9 KiB
- experts/models/anthropic-ts.md7.8 KiB
- experts/models/bedrock-ts.md9.9 KiB
- experts/models/foundry-cloud-ts.md8.1 KiB
- experts/models/foundry-local-ts.md10.6 KiB
- experts/models/index.md5.8 KiB
- experts/models/openai-azure-openai-ts.md8.3 KiB
- experts/models/oss-openai-compatible-ts.md10.7 KiB
- experts/models/transformers-js-ts.md11.6 KiB
- experts/prompt-engineer.md14.7 KiB
- experts/researcher.md2.8 KiB
- experts/security/index.md1.2 KiB
- experts/security/input-validation-ts.md13.8 KiB
- experts/security/secrets-ts.md13.9 KiB
- experts/slack/bolt-assistant-ts.md9.9 KiB
- experts/slack/bolt-events-ts.md9.3 KiB
- experts/slack/bolt-java.md8.9 KiB
- experts/slack/bolt-oauth-distribution-ts.md10.9 KiB
- experts/slack/bolt-python.md9.5 KiB
- experts/slack/cli.app-management.md7.9 KiB
- experts/slack/cli.datastore-env.md8.6 KiB
- experts/slack/cli.getting-started.md8.0 KiB
- experts/slack/cli.local-dev-deploy.md8.4 KiB
- experts/slack/cli.manifest-triggers.md9.9 KiB
- experts/slack/index.md8.9 KiB
- experts/slack/runtime.ack-rules-ts.md9.8 KiB
- experts/slack/runtime.bolt-foundations-ts.md10.7 KiB
- experts/slack/runtime.shortcuts-ts.md11.0 KiB
- experts/slack/runtime.slash-commands-ts.md11.6 KiB
- experts/slack/runtime.socket-mode-ts.md9.5 KiB
- experts/slack/ui.block-kit-ts.md11.5 KiB
- experts/slack/ui.modals-lifecycle-ts.md13.3 KiB
- experts/slack/web-api-proactive-ts.md11.0 KiB
- experts/slack/workflow.slack-automations-ts.md10.2 KiB
- experts/teams/a2a.client-basics-ts.md9.7 KiB
- experts/teams/a2a.orchestrator-patterns-ts.md12.7 KiB
- experts/teams/a2a.server-basics-ts.md11.4 KiB
- experts/teams/ai.chatprompt-basics-ts.md8.1 KiB
- experts/teams/ai.citations-feedback-ts.md6.9 KiB
- experts/teams/ai.conversational-query-ts.md14.2 KiB
- experts/teams/ai.function-calling-design-ts.md9.0 KiB
- experts/teams/ai.function-calling-implementation-ts.md7.7 KiB
- experts/teams/ai.memory-localmemory-ts.md7.3 KiB
- experts/teams/ai.model-setup-ts.md6.6 KiB
- experts/teams/ai.rag-retrieval-ts.md7.4 KiB
- experts/teams/ai.rag-vectorstores-ts.md8.5 KiB
- experts/teams/ai.streaming-ts.md6.9 KiB
- experts/teams/auth.oauth-sso-ts.md10.1 KiB
- experts/teams/compat.botbuilder-interop-ts.md14.6 KiB
- experts/teams/dev.debug-test-ts.md14.1 KiB
- experts/teams/graph.usergraph-appgraph-ts.md9.0 KiB
- experts/teams/index.md9.8 KiB
- experts/teams/mcp.client-basics-ts.md9.5 KiB
- experts/teams/mcp.expose-chatprompt-tools-ts.md9.5 KiB
- experts/teams/mcp.security-ts.md10.4 KiB
- experts/teams/mcp.server-basics-ts.md9.9 KiB
- experts/teams/project.scaffold-files-ts.md12.2 KiB
- experts/teams/runtime.app-init-ts.md10.9 KiB
- experts/teams/runtime.manifest-ts.md12.3 KiB
- experts/teams/runtime.proactive-messaging-ts.md12.6 KiB
- experts/teams/runtime.routing-handlers-ts.md12.3 KiB
- experts/teams/state.storage-patterns-ts.md9.4 KiB
- experts/teams/teams-dotnet.md8.2 KiB
- experts/teams/teams-python.md8.3 KiB
- experts/teams/ui.adaptive-cards-ts.md12.9 KiB
- experts/teams/ui.dialogs-task-modules-ts.md15.1 KiB
- experts/teams/ui.message-extensions-ts.md15.6 KiB
- experts/teams/workflow.approvals-inline-ts.md12.4 KiB
- experts/teams/workflow.message-native-records-ts.md10.6 KiB
- experts/teams/workflow.sharepoint-lists-ts.md9.0 KiB
- experts/teams/workflow.state-driven-events-ts.md12.2 KiB
- experts/teams/workflow.triggers-compose-ts.md10.3 KiB
- experts/update-experts.md10.0 KiB
- provision-deploy/provision-deploy.md4.3 KiB
- test-playground/playground-cli.md4.6 KiB
- test-playground/playground.md4.5 KiB
- test-playground/test-playground.md1.1 KiB
- test-teams/test-teams.md4.9 KiB
- toolkit/README.md4.2 KiB
- toolkit/commands.md2.6 KiB
- toolkit/environments.md12.6 KiB
- toolkit/lifecycle-cli.md17.6 KiB
- toolkit/manifest-and-yaml.md6.0 KiB
- toolkit/playground.md7.6 KiB
- toolkit/publish.md9.3 KiB
- toolkit/templates.md6.7 KiB
- troubleshoot/troubleshoot.md20.2 KiB
experts/convert/java-to-ts-ts.md
java-to-ts-ts
purpose
Rewriting Java source code as idiomatic TypeScript — mapping Java's class-based OOP, generics, annotations, collections, and concurrency patterns to their TypeScript equivalents.
rules
Java class hierarchies map to TypeScript interfaces + classes. Prefer interfaces over abstract classes for defining contracts. Java
implements Interfacemaps directly to TypeScriptimplements Interface. Javaextends AbstractClassmaps to TypeScriptextends BaseClass.Java generics map to TypeScript generics with the same
<T>syntax. Key difference: Java generics are erased at runtime; TypeScript generics are erased at compile time. Both are structural at their core. Java bounded wildcards (? extends T) map to TS constrained generics (<U extends T>). Java? super Thas no direct TS equivalent — use a union or contravariant generic.Java annotations (
@Override,@Deprecated,@JsonProperty) have no built-in TS equivalent. Map to: TS decorators (experimental, stage 3), JSDoc comments, or runtime metadata patterns. For simple markers like@Override, simply remove them — TS enforces override correctness with theoverridekeyword.Java
Optional<T>maps toT | nullorT | undefined.Optional.of(x)→ justx,Optional.empty()→null,Optional.isPresent()→!= null,Optional.map(fn)→ optional chaining + nullish coalescing (x?.transform() ?? default).Java checked exceptions do not exist in TypeScript. Remove
throwsdeclarations from method signatures. Converttry/catchblocks but let unexpected errors propagate naturally. Document thrown errors in JSDoc if important for callers.Java
finalmaps toreadonlyfor class fields andconstfor local variables. Javafinalon method parameters has no TS equivalent (parameters are already effectively final by convention).Java
staticmethods and fields map directly to TypeScriptstatic. Java static utility classes (e.g.,Collections,Math) often map better to standalone exported functions rather than a class with all-static members.Java
enummaps to TypeScriptenumfor simple cases, but prefer string literal unions for most use cases. Java enums with methods and fields → TypeScriptas constobject + associated functions or a class hierarchy.Java
StreamAPI maps to TypeScript array methods.stream().filter().map().collect(Collectors.toList())becomes.filter().map().Collectors.toMap()→reduce()orObject.fromEntries().Collectors.groupingBy()→Object.groupBy()orreduce().Java
synchronized/volatile/Lockhave no TypeScript equivalent (JS is single-threaded). Remove synchronization primitives entirely. If the Java code uses threads for parallelism, redesign aroundPromise.all(), async/await, or worker threads.Java
Map<K,V>maps toMap<K,V>(JS built-in) orRecord<string, V>for string-keyed maps.List<T>→T[]orArray<T>.Set<T>→Set<T>. JavaHashMap/TreeMapdistinctions are irrelevant — JSMaphas insertion-order iteration.Java getter/setter pairs (
getName()/setName()) should be simplified to direct property access in TS. Only useget/setaccessors if validation or side effects are needed.Java
StringBuilder/ string concatenation in loops → template literals orArray.join(). TS strings are immutable like Java strings, but template literals handle most interpolation needs.Java package structure (
com.example.app.service) does NOT map to deeply nested TS folders. Flatten to a pragmatic folder structure:src/services/,src/models/, etc. Use barrel files (index.ts) for clean re-exports.Lombok
@Datagenerates getters, setters,equals(),hashCode(),toString(), and a required-args constructor. In TypeScript, replace with a plaininterface(for data-only types) or aclasswithpublicconstructor parameters. Remove all generated method equivalents — TS doesn't need them.Lombok
@Buildergenerates a fluent builder class. Replace with a TypeScript options interface:new Foo({ bar, baz })or a factory function. The builder pattern is unnecessary when constructors accept named parameters via object destructuring.Lombok
@Getter/@Setteron individual fields → directpublicproperty access in TS. If the field was@Getteronly (read-only), usereadonly. If@Setterhas custom logic, use a TSsetaccessor.Lombok
@AllArgsConstructor/@NoArgsConstructor/@RequiredArgsConstructor→ TypeScript constructor with explicit parameters.@NoArgsConstructoron a data class → all properties optional or have defaults.@RequiredArgsConstructor→ constructor with onlyfinalfields as parameters.Lombok
@Slf4jgenerates aprivate static final Logger logfield. Replace with a module-level logger:import pino from 'pino'; const log = pino({ name: 'MyClass' });or accept a logger via constructor injection.Lombok
@Value(immutable@Data) → TypeScriptinterfacewith allreadonlyfields, or useReadonly<T>utility type.CompletableFuture<T>maps toPromise<T>.thenApply(fn)→.then(fn),thenCompose(fn)→.then(fn)(Promise auto-flattens),exceptionally(fn)→.catch(fn),thenAccept(fn)→.then(fn)(when return is void).CompletableFuture.allOf()→Promise.all().CompletableFuture.anyOf()→Promise.race().CompletableFuture.supplyAsync(fn, executor)→ just call the async function directly (no executor needed in single-threaded JS).CompletableFuturechains should be rewritten asasync/awaitfor readability. A chain of.thenApply().thenCompose().exceptionally()becomes a simpletry { const a = await step1(); const b = await step2(a); } catch (e) { ... }.@FunctionalInterfaceannotations → TypeScript function type aliases.@FunctionalInterface interface Handler<T> { void handle(T t); }becomestype Handler<T> = (t: T) => void.
patterns
Java class hierarchy → TypeScript interfaces + classes
// --- Before (Java) ---
public interface MessageHandler {
void handle(Message message);
boolean canHandle(String type);
}
public abstract class BaseHandler implements MessageHandler {
protected final Logger logger;
public BaseHandler(Logger logger) {
this.logger = logger;
}
@Override
public boolean canHandle(String type) {
return getSupportedTypes().contains(type);
}
protected abstract Set<String> getSupportedTypes();
}
public class SlashCommandHandler extends BaseHandler {
private final CommandRegistry registry;
public SlashCommandHandler(Logger logger, CommandRegistry registry) {
super(logger);
this.registry = registry;
}
@Override
public void handle(Message message) {
String command = message.getText().split(" ")[0];
registry.execute(command, message);
}
@Override
protected Set<String> getSupportedTypes() {
return Set.of("slash_command", "block_actions");
}
}// --- After (TypeScript) ---
interface MessageHandler {
handle(message: Message): void;
canHandle(type: string): boolean;
}
abstract class BaseHandler implements MessageHandler {
constructor(protected readonly logger: Logger) {}
canHandle(type: string): boolean {
return this.getSupportedTypes().has(type);
}
abstract handle(message: Message): void;
protected abstract getSupportedTypes(): Set<string>;
}
class SlashCommandHandler extends BaseHandler {
constructor(
logger: Logger,
private readonly registry: CommandRegistry,
) {
super(logger);
}
handle(message: Message): void {
const command = message.text.split(' ')[0];
this.registry.execute(command, message);
}
protected getSupportedTypes(): Set<string> {
return new Set(['slash_command', 'block_actions']);
}
}Java Stream API → TypeScript array methods
// --- Before (Java) ---
import java.util.stream.Collectors;
List<UserDTO> activeUsers = users.stream()
.filter(u -> u.isActive())
.filter(u -> !u.getRole().equals(Role.GUEST))
.sorted(Comparator.comparing(User::getName))
.map(u -> new UserDTO(u.getName(), u.getEmail()))
.collect(Collectors.toList());
Map<String, List<User>> byDepartment = users.stream()
.collect(Collectors.groupingBy(User::getDepartment));
Optional<User> admin = users.stream()
.filter(u -> u.getRole().equals(Role.ADMIN))
.findFirst();// --- After (TypeScript) ---
interface UserDTO {
name: string;
email: string;
}
const activeUsers: UserDTO[] = users
.filter((u) => u.active)
.filter((u) => u.role !== 'guest')
.sort((a, b) => a.name.localeCompare(b.name))
.map((u) => ({ name: u.name, email: u.email }));
const byDepartment: Record<string, User[]> = Object.groupBy(
users,
(u) => u.department,
) as Record<string, User[]>;
const admin: User | undefined = users.find((u) => u.role === 'admin');Java enum with behavior → TypeScript const object + functions
// --- Before (Java) ---
public enum Priority {
HIGH(1, "High Priority"),
MEDIUM(2, "Medium Priority"),
LOW(3, "Low Priority");
private final int level;
private final String label;
Priority(int level, String label) {
this.level = level;
this.label = label;
}
public int getLevel() { return level; }
public String getLabel() { return label; }
public boolean isUrgent() {
return this == HIGH;
}
}// --- After (TypeScript) ---
const Priority = {
HIGH: { level: 1, label: 'High Priority' },
MEDIUM: { level: 2, label: 'Medium Priority' },
LOW: { level: 3, label: 'Low Priority' },
} as const;
type PriorityKey = keyof typeof Priority;
type PriorityValue = (typeof Priority)[PriorityKey];
function isUrgent(priority: PriorityValue): boolean {
return priority === Priority.HIGH;
}Lombok @Data/@Builder → TypeScript interface + options constructor
// --- Before (Java with Lombok) ---
import lombok.Builder;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Data
@Builder
@Slf4j
public class SlackMessage {
private final String channel;
private final String text;
private final String threadTs;
private final boolean unfurlLinks;
private final List<Attachment> attachments;
public void send(WebClient client) {
log.info("Sending message to {}", channel);
client.chatPostMessage(r -> r
.channel(channel)
.text(text)
.threadTs(threadTs)
.unfurlLinks(unfurlLinks)
.attachments(attachments));
}
}
// Usage with builder:
SlackMessage msg = SlackMessage.builder()
.channel("#general")
.text("Hello!")
.unfurlLinks(false)
.build();
msg.send(client);// --- After (TypeScript) ---
import pino from 'pino';
const log = pino({ name: 'SlackMessage' });
interface SlackMessageOptions {
channel: string;
text: string;
threadTs?: string;
unfurlLinks?: boolean;
attachments?: Attachment[];
}
// Interface replaces @Data — no getters/setters/equals/hashCode/toString needed
// Options object replaces @Builder — named params via destructuring
class SlackMessage {
readonly channel: string;
readonly text: string;
readonly threadTs?: string;
readonly unfurlLinks: boolean;
readonly attachments: Attachment[];
constructor({
channel,
text,
threadTs,
unfurlLinks = false,
attachments = [],
}: SlackMessageOptions) {
this.channel = channel;
this.text = text;
this.threadTs = threadTs;
this.unfurlLinks = unfurlLinks;
this.attachments = attachments;
}
send(client: WebClient): void {
log.info(`Sending message to ${this.channel}`);
client.chat.postMessage({
channel: this.channel,
text: this.text,
thread_ts: this.threadTs,
unfurl_links: this.unfurlLinks,
attachments: this.attachments,
});
}
}
// Usage — options object replaces builder chain:
const msg = new SlackMessage({
channel: '#general',
text: 'Hello!',
unfurlLinks: false,
});
msg.send(client);CompletableFuture chain → async/await
// --- Before (Java) ---
import java.util.concurrent.CompletableFuture;
public class AsyncSlackClient {
private final MethodsClient client;
private final ExecutorService executor;
public CompletableFuture<String> fetchAndNotify(String userId, String channel) {
return CompletableFuture.supplyAsync(() -> client.usersInfo(r -> r.user(userId)), executor)
.thenApply(response -> response.getUser().getRealName())
.thenCompose(name -> CompletableFuture.supplyAsync(
() -> client.chatPostMessage(r -> r.channel(channel).text("Hello " + name)),
executor
))
.thenApply(response -> response.getTs())
.exceptionally(ex -> {
log.error("Failed: {}", ex.getMessage());
return null;
});
}
public CompletableFuture<List<String>> fetchMultipleUsers(List<String> userIds) {
List<CompletableFuture<String>> futures = userIds.stream()
.map(id -> CompletableFuture.supplyAsync(
() -> client.usersInfo(r -> r.user(id)).getUser().getRealName(),
executor
))
.collect(Collectors.toList());
return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]))
.thenApply(v -> futures.stream()
.map(CompletableFuture::join)
.collect(Collectors.toList()));
}
}// --- After (TypeScript) ---
class AsyncSlackClient {
constructor(private readonly client: WebClient) {}
// CompletableFuture chain → simple async/await
async fetchAndNotify(userId: string, channel: string): Promise<string | null> {
try {
const userResponse = await this.client.users.info({ user: userId });
const name = userResponse.user?.real_name ?? 'Unknown';
const msgResponse = await this.client.chat.postMessage({
channel,
text: `Hello ${name}`,
});
return msgResponse.ts ?? null;
} catch (err) {
log.error(`Failed: ${(err as Error).message}`);
return null;
}
}
// CompletableFuture.allOf → Promise.all
async fetchMultipleUsers(userIds: string[]): Promise<string[]> {
const results = await Promise.all(
userIds.map(async (id) => {
const response = await this.client.users.info({ user: id });
return response.user?.real_name ?? 'Unknown';
}),
);
return results;
}
}@FunctionalInterface → TypeScript function types
// --- Before (Java) ---
@FunctionalInterface
public interface BoltEventHandler<E extends Event> {
Response apply(EventsApiPayload<E> payload, EventContext context) throws Exception;
}
@FunctionalInterface
public interface Middleware {
Response apply(Request req, Response resp, MiddlewareChain chain) throws Exception;
}
// Usage:
app.event(AppMentionEvent.class, (payload, ctx) -> {
ctx.say("Hello!");
return ctx.ack();
});// --- After (TypeScript) ---
// @FunctionalInterface → type alias for the function signature
type BoltEventHandler<E extends Event> = (
payload: EventsApiPayload<E>,
context: EventContext,
) => Promise<Response>;
type Middleware = (
req: Request,
resp: Response,
chain: MiddlewareChain,
) => Promise<Response>;
// Usage — identical lambda syntax:
app.event(AppMentionEvent, async (payload, ctx) => {
await ctx.say('Hello!');
return ctx.ack();
});pitfalls
Null vs undefined: Java has one null; TypeScript has
nullANDundefined. Decide on a convention early. Recommendation: useundefinedfor "not provided" (optional params),nullfor "explicitly empty" (API responses).No method overloading at runtime: Java allows multiple methods with the same name but different signatures. TypeScript supports overload signatures but only one implementation. Merge overloads into a single function with union parameter types.
Access modifiers are compile-time only: TypeScript's
private/protectedare erased at runtime (unlike Java). For true runtime privacy, use#privateField(ES2022 private fields).No runtime type checking: Java's
instanceofchecks actual class identity. TypeScript'sinstanceofworks for classes but NOT for interfaces (they're erased). Use discriminated unions or type guard functions instead.Collections are not auto-imported: Java's
List,Map,Setare imports fromjava.util. TypeScript'sArray,Map,Setare global built-ins — no import needed. But helper methods likeObject.groupBy()may need a polyfill.Checked exceptions disappear: Java forces callers to handle checked exceptions. TypeScript has no mechanism for this. Document important error conditions in JSDoc comments.
Java
equals()vs TS===: Java objects use.equals()for value comparison. TS===compares references for objects. Use deep-equal libraries or compare relevant fields explicitly.Thread safety patterns are dead code: Remove all
synchronized,volatile,Lock,Atomic*patterns. JS is single-threaded. Keeping them adds confusion with zero benefit.Builder pattern is often unnecessary: Java builders exist because constructors can't have named parameters. TypeScript objects with optional properties serve the same purpose more concisely.
Over-engineering inheritance: Java projects often have deep class hierarchies. In TypeScript, prefer composition and interfaces. Flatten hierarchies where possible — if a class exists only to share one method, use a utility function instead.
Lombok
@Dataon mutable classes: If the Java class was mutable (setters used), decide whether TS version should be mutable too. Often the answer is no — make propertiesreadonlyand create new instances instead of mutating.Lombok
@Builder.Default: Default values in Lombok builders (@Builder.Default private boolean unfurlLinks = true) must become explicit defaults in the TS constructor destructuring:{ unfurlLinks = true }: Options.CompletableFuture.join()blocks the thread: There is NO blocking equivalent in JS.awaitis non-blocking. Code that usesjoin()for synchronous access must be redesigned to be fully async.ExecutorServicethread pools: Remove entirely. JS is single-threaded.Promise.all()provides concurrency for I/O-bound work without thread management. For CPU-bound work, use worker threads only if profiling shows a bottleneck.@FunctionalInterfacewith checked exceptions: Java functional interfaces can declarethrows Exception. TypeScript function types cannot. Async functions that reject should document their error types in JSDoc but cannot enforce catching at the type level.
references
https://www.typescriptlang.org/docs/handbook/2/classes.html -- TS classes and inheritance
https://www.typescriptlang.org/docs/handbook/2/generics.html -- TS generics
https://www.typescriptlang.org/docs/handbook/decorators.html -- TS decorators (annotation equivalent)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map -- JS Map (HashMap equivalent)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise -- Promise (Future equivalent)
instructions
Use this expert when rewriting Java source code in TypeScript. Start by identifying the Java patterns in use (class hierarchies, generics, annotations, Lombok annotations, Stream API, CompletableFuture chains, functional interfaces, concurrency, Optional) and map each to its TS equivalent. Focus on simplification: flatten unnecessary class hierarchies, replace Lombok @Data/@Builder with interfaces and options objects, remove builder patterns in favor of typed options objects, rewrite CompletableFuture chains as async/await, convert @FunctionalInterface to type aliases, eliminate synchronization code, and convert getters/setters to direct property access. Pair with dependency-mapping-ts.md for Maven/Gradle → npm equivalents, type-mapping-ts.md for cross-language type reference, and json-serialization-ts.md for Gson/Jackson serialization conversion.
research
Deep Research prompt:
"Write a micro expert on converting Java to TypeScript. Cover: class hierarchies to interfaces/classes, generics mapping, annotations to decorators, Stream API to array methods, Optional to nullable types, checked exceptions removal, synchronized/volatile removal, enum with behavior to const objects, getter/setter simplification, builder pattern elimination, and package structure flattening. Include 3 worked examples."
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an API key, Needs Python, Needs Node.js
Security
What our scanner noticed· Medium risk
- Possible data-exfiltration endpoints
- Instructions that use the network
- Downloads piped into a shell
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills · .github/plugins/microsoft-365-agents-toolkit/skills/teams-app-developer · commit 0696600
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download teams-app-developer.zip