spring-cloud-function
Spring Cloud Function for serverless and FaaS deployments. Covers function beans, AWS Lambda, Azure Functions, and GCP adapters. USE WHEN: user mentions "spring cloud function", "serverless Spring", "AWS Lambda Spring", "Azure Functions Spring", "FaaS", "function composition" DO NOT USE FOR: simple REST APIs - use standard controllers, complex workflows - consider Step Functions or similar
What this skill does
# Spring Cloud Function - Quick Reference
> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `spring-cloud-function` for comprehensive documentation.
## Dependencies
```xml
<!-- Core -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-function-web</artifactId>
</dependency>
<!-- AWS Lambda adapter -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-aws</artifactId>
</dependency>
<!-- Azure Functions adapter -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-azure</artifactId>
</dependency>
<!-- GCP Cloud Functions adapter -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-gcp</artifactId>
</dependency>
```
## Function Types
```
┌─────────────────────────────────────────────────────────────┐
│ Function Types │
│ │
│ Function<I, O> Input → Processing → Output │
│ Consumer<I> Input → Processing (no output) │
│ Supplier<O> (no input) → Generate Output │
│ │
│ ┌───────┐ ┌──────────┐ ┌────────┐ │
│ │ Input │───▶│ Function │───▶│ Output │ │
│ └───────┘ └──────────┘ └────────┘ │
└─────────────────────────────────────────────────────────────┘
```
## Basic Functions
### Function (Input → Output)
```java
@Configuration
public class FunctionConfig {
@Bean
public Function<String, String> uppercase() {
return value -> value.toUpperCase();
}
@Bean
public Function<Person, Greeting> greet() {
return person -> new Greeting("Hello, " + person.getName() + "!");
}
@Bean
public Function<Flux<String>, Flux<String>> reactiveUppercase() {
return flux -> flux.map(String::toUpperCase);
}
}
public record Person(String name, int age) {}
public record Greeting(String message) {}
```
### Consumer (Input → void)
```java
@Bean
public Consumer<Order> processOrder() {
return order -> {
log.info("Processing order: {}", order.getId());
orderService.process(order);
};
}
@Bean
public Consumer<Flux<Event>> eventProcessor() {
return events -> events
.doOnNext(event -> log.info("Received event: {}", event))
.subscribe(eventService::handle);
}
```
### Supplier (void → Output)
```java
@Bean
public Supplier<String> hello() {
return () -> "Hello, World!";
}
@Bean
public Supplier<Flux<Long>> counter() {
return () -> Flux.interval(Duration.ofSeconds(1));
}
@Bean
public Supplier<List<Product>> getProducts() {
return () -> productRepository.findAll();
}
```
## Configuration
### application.yml
```yaml
spring:
cloud:
function:
# Default function to invoke
definition: uppercase
# For multiple functions
# definition: validate|process|notify
# Routing based on header
routing-expression: "headers['function-name']"
# Function-specific config
uppercase:
prefix: "RESULT: "
```
## Function Composition
```java
// Compose functions
@Bean
public Function<String, String> validate() {
return input -> {
if (input == null || input.isEmpty()) {
throw new IllegalArgumentException("Input cannot be empty");
}
return input;
};
}
@Bean
public Function<String, String> sanitize() {
return input -> input.trim().toLowerCase();
}
@Bean
public Function<String, String> process() {
return input -> "Processed: " + input;
}
// Configuration to compose: validate|sanitize|process
// spring.cloud.function.definition=validate|sanitize|process
```
### Programmatic Composition
```java
@Bean
public Function<String, String> composedFunction(
Function<String, String> validate,
Function<String, String> sanitize,
Function<String, String> process) {
return validate.andThen(sanitize).andThen(process);
}
```
## HTTP Endpoints
```java
// Automatic HTTP endpoints when using spring-cloud-starter-function-web
// POST /uppercase → invokes uppercase function
// POST /greet → invokes greet function
// GET /hello → invokes hello supplier
// Example requests:
// curl -X POST localhost:8080/uppercase -d "hello" -H "Content-Type: text/plain"
// curl -X POST localhost:8080/greet -d '{"name":"John"}' -H "Content-Type: application/json"
// curl localhost:8080/hello
```
## AWS Lambda
### Handler Configuration
```yaml
# AWS Lambda handler
spring:
cloud:
function:
definition: processEvent
```
### Lambda Handler Class
```java
public class LambdaHandler extends FunctionInvoker<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
}
@Bean
public Function<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> processEvent() {
return request -> {
String body = request.getBody();
// Process request
return APIGatewayProxyResponseEvent.builder()
.statusCode(200)
.body("Processed: " + body)
.build();
};
}
```
### SAM Template
```yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
Runtime: java17
CodeUri: target/my-function.jar
MemorySize: 512
Timeout: 30
Environment:
Variables:
SPRING_CLOUD_FUNCTION_DEFINITION: processEvent
Events:
Api:
Type: Api
Properties:
Path: /process
Method: POST
```
## Azure Functions
### Host Configuration
```java
public class AzureHandler extends FunctionInvoker<HttpRequestMessage<String>, HttpResponseMessage> {
}
@FunctionName("process")
public HttpResponseMessage run(
@HttpTrigger(
name = "req",
methods = {HttpMethod.POST},
authLevel = AuthorizationLevel.ANONYMOUS
) HttpRequestMessage<String> request,
ExecutionContext context) {
return handleRequest(request, context);
}
```
## GCP Cloud Functions
```java
public class GcpHandler extends FunctionInvoker<String, String> {
}
// Deployment
// gcloud functions deploy myFunction \
// --entry-point org.springframework.cloud.function.adapter.gcp.FunctionInvoker \
// --runtime java17 \
// --trigger-http \
// --memory 512MB
```
## Message-Driven Functions
### With Spring Cloud Stream
```java
@Bean
public Function<Flux<Order>, Flux<OrderResult>> processOrders() {
return orders -> orders
.map(order -> {
// Process order
return new OrderResult(order.getId(), "PROCESSED");
});
}
```
```yaml
spring:
cloud:
stream:
bindings:
processOrders-in-0:
destination: orders
processOrders-out-0:
destination: order-results
function:
definition: processOrders
```
## Function Catalog
```java
@Autowired
private FunctionCatalog functionCatalog;
public void invokeDynamically(String functionName, Object input) {
Function<Object, Object> function = functionCatalog.lookup(functionName);
if (function != null) {
Object result = function.apply(input);
log.info("Result: {}", result);
}
}
```
## Error Handling
```java
@Bean
public Function<Order, OrderResult> processOrder() {
return order -> {
try {
validateOrder(order);
return new OrderResult(order.getId(), "SUCCESS");
} catch (ValidationException e) {
return new OrderResult(order.getId(), "VALIDATION_ERROR: " + e.getMessage());
} catch (Exception e) {
log.error("Error processing ordRelated in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.