Solution Scaffolding Tutorial#
This tutorial covers using scafctl new solution to quickly scaffold new solution files with the correct structure, providers, and best practices.
Overview#
The new solution command generates a complete, valid solution YAML file based on your inputs. Instead of writing YAML from scratch (and getting field names wrong), scaffolding gives you a working starting point.
flowchart LR A["Parameters<br/>(name, etc)"] --> B["scafctl<br/>new solution"] --> C["Solution<br/>YAML File"]
1. Quick Start#
Generate a Basic Solution#
scafctl new solution \
--name my-app \
--description "My application configuration" \
--output my-app.yamlscafctl new solution `
--name my-app `
--description "My application configuration" `
--output my-app.yamlThis generates a valid solution file with:
- Correct
apiVersionandkind - Metadata with name, version, and description
- A sample resolver using the
staticprovider - An example workflow action
Verify the Output#
Immediately validate the generated file:
scafctl lint -f my-app.yamlscafctl lint -f my-app.yamlRun it:
scafctl run solution -f my-app.yamlscafctl run solution -f my-app.yaml2. Choosing Providers#
Specify which providers to include in the scaffolded solution:
# Include specific providers
scafctl new solution \
--name api-collector \
--description "Collect data from APIs" \
--providers http,cel,exec \
--output api-collector.yaml# Include specific providers
scafctl new solution `
--name api-collector `
--description "Collect data from APIs" `
--providers http,cel,exec `
--output api-collector.yamlThe generator creates resolver examples using each specified provider with correct input schemas.
Available Providers#
Not sure which providers to use? List them first:
scafctl get providerscafctl get providerOr get details on a specific provider:
scafctl get provider httpscafctl get provider http3. Starting from Examples#
Instead of scaffolding from scratch, you can also start from an existing example:
# Browse available solution examples
scafctl examples list --category solutions
# Download one as a starting point
scafctl examples get solutions/email-notifier/solution.yaml -o my-solution.yaml
# Modify and validate
scafctl lint -f my-solution.yamlscafctl examples list --category solutions
scafctl examples get solutions/email-notifier/solution.yaml -o my-solution.yaml
scafctl lint -f my-solution.yamlThis is useful when you want a more complete starting point with real patterns (parameters, validation, actions, composition).
4. Common Scaffolding Patterns#
Resolver-Only Solution#
For solutions that just gather and transform data without side-effect actions:
scafctl new solution \
--name data-collector \
--description "Gather configuration from multiple sources" \
--providers static,env,http,cel \
--output data-collector.yamlscafctl new solution `
--name data-collector `
--description "Gather configuration from multiple sources" `
--providers static,env,http,cel `
--output data-collector.yamlThen run with the resolver command:
scafctl run resolver -f data-collector.yaml -o yamlscafctl run resolver -f data-collector.yaml -o yamlFull Workflow Solution#
For solutions with actions:
scafctl new solution \
--name deploy-pipeline \
--description "Deployment automation pipeline" \
--providers static,exec,cel \
--output deploy-pipeline.yamlscafctl new solution `
--name deploy-pipeline `
--description "Deployment automation pipeline" `
--providers static,exec,cel `
--output deploy-pipeline.yamlAdding Tests After Scaffolding#
Once your solution works, add functional tests:
# Validate the solution
scafctl lint -f my-solution.yaml
# Use the MCP server to generate test scaffolding (if using AI tools)
# Or see the Functional Testing Tutorial for manual test writingscafctl lint -f my-solution.yaml5. Workflow#
The recommended scaffolding workflow:
- Scaffold —
scafctl new solution --name my-app --output my-app.yaml - Lint —
scafctl lint -f my-app.yaml - Edit — Modify resolvers and actions for your needs
- Lint again —
scafctl lint -f my-app.yaml - Test —
scafctl run resolver -f my-app.yamlto verify resolvers - Run —
scafctl run solution -f my-app.yamlfor the full workflow
Next Steps#
- Getting Started — Full getting started guide
- Resolver Tutorial — Deep dive into resolvers
- Actions Tutorial — Build workflow actions
- Provider Reference — All available providers
- Functional Testing Tutorial — Add automated tests
- Eval Tutorial — Test expressions before adding to solutions