Argo and Tekton are projects that come to mind. Also, if you try to implement this, you will see that encapsulating your pipeline in a single file gets disorganized quickly.
Not exactly. Tekton and Argo are really different from what I described, but regarding the second part, agree that it won't be as perfect as what you can compose the file yourself (at least at the beginning) but that's not the point.