Scope and Design
How much should the workflow do?
Each routine (simple) workflow should be fairly focused. Workflows do not "branch"; at most they canskip a step based on a condition. So if a workflow would have a great deal of conditional logic, it should be broken down into separate workflows which can be composed into a complex workflow as part of an execution plan.
Here is an example list of workflows which are included in SAF, to give an idea of scope:
commander/add-cli
commander/add-command
cron/add-job
cron/init
drizzle/add-query
drizzle/init
drizzle/update-schema
email/add-template
env/add-var
express/add-handler
express/init
grpc/add-handler
grpc/add-proto
grpc/add-rpc
grpc/init-client
grpc/init-proto
grpc/init-server
identity/init
monorepo/add-export
monorepo/add-package
openapi/add-event
openapi/add-route
openapi/add-schema
openapi/init
processes/spec-project
sdk/add-component
sdk/add-query
sdk/init
service/init
vue/add-page
vue/add-spa
workflows/add-workflowWorkflow arguments
Workflows take any string argument, but it's good to adopt some conventions. Most workflows can get away with just either or both of the following:
name- kebab-case name of the thing, such asuserfor a database table,@saflib/new-libfor a new npm package, orwelcome-pagefor a web component.path- relative path for the main file being added, such as./src/components/welcome-page.tsfor a web component.
A package which uses all three combinations is @saflib/openapi.
openapi/inittakes both thenameof the package and thepathto instantiate the library.openapi/add-schematakes just aname, since all schemas go in the same directory.openapi/add-routetakes apath, since routes are grouped by resource, for example./routes/users/list.yaml.
If your code and names follow conventional patterns, you can also infer values from these inputs which can be used in templates. See template docs for more details.