Run Your AI Software Factory Like a Real Engineering Org (Here's How)

summarized

TLDR

Port 为 AI 软件工厂提供了企业级包装层,通过代理/技能注册表、上下文湖、评分卡和控制来实现多个工厂的集中管理、自动监控和自修复,同时保持关键环节的人工参与。其核心创新在于标准化检查和工作流自动触发(如 CI 失败时自动创建议题),使工厂能自我改进。演示证明,这种架构可在两天内全自动构建一个 RAG 知识库应用。

Key points

Port 的代理注册表集中管理所有代理的身份、权限和生命周期,每个工厂可从注册表拉取所需代理。

上下文湖集成 Slack、Jira、SharePoint 等业务上下文,使工厂在规划时能获取仓库所有权、服务层级等关键信息。

评分卡自动检查仓库是否准备好成为软件工厂(如是否有 README、PR 模板、CI 通过),并持续监控状态。

当 CI 失败时,Port 的工作流自动检测、等待人工批准后创建 GitHub 议题,工厂随后自动修复并将评分卡恢复为 Gold。

整个系统设计为人工在环,强调在关键步骤(如规划、批准议题)需要人类参与,避免完全自动化的‘暗工厂’模式。

Tools mentioned

Techniques

  • software-factory
  • agent-registry
  • skill-registry
  • context-lake
  • scorecards
  • human-in-the-loop
  • mcp-server
  • plan-implement-validate-cycle
Transcript (captions)

0:00 My AI software factory is hands down my biggest project right now. I've spent hundreds of hours refining it over the course of this year. And it's even gotten to the point where I've started

0:08 to help companies incorporate this kind of system. Not replacing all their engineering, but using a software factory for certain teams and certain applications. But as I've been going

0:18 through these engagements, it's become quite apparent to me that the factory by itself is not enough. When you get to an enterprise level or you just have a lot of applications, you need a sort of

0:28 wrapper around the factory to make sure that it has all of the guardrails, context, and observability that you need. Because the AI software factory represents the most autonomous form of

0:38 AI coding. We still have some human in the loop so we can communicate what we want. We plan that release with the agent and then we send that into the harness to split it into tasks and

0:46 implement them in a loop. Now, it's not a black box because we're engineering the harness that goes through this. But you can see how when we really start to scale the factory, we do need that

0:55 harness to help us manage everything. Now, I could always build this wrapper myself, but like I'll show you in this video, it's not that simple. There's a lot more to it than what meets the eye.

1:04 And I don't want to be focused on that part of the factory. I want to be focused on the underlying engineering loop that's doing the actual development. And so, I've been searching

1:12 far and wide recently to find a platform that gives me this wrapper, but still allows me to run my own custom harness for the development. And I have found an exact match. Port is the platform that

1:24 gives me exactly what I need. It gives me the layer of context and obserability and guard rails over my factories. Like it's integrated directly with my pull requests. It's watching everything. It's

1:34 giving me a health check across my repository. A lot more that I'll show you here. But all the while I still get to run my software factory. And so I'll show you how this all works right now.

1:43 not just to give you a port tutorial, but to show you how they're incorporating all these different concepts that really start to matter once you have a lot of factories and you

1:52 care about like ownership of different components and how you can have a central layer of context for all your factories. There is a lot of cool stuff to get into here. And let me tell you,

2:01 it was a hard requirement because of the effort I put into this harness for me to not have to change it when I incorporate a platform like Port. And so the entire architecture that I showed in one of my

2:12 last videos that I'll link to right here, I'm still using it exactly. I'm just using port to add the wrapper around it for four core things that we're going to cover today. We'll talk

2:21 about the agent and skill registry, the context lake, the standards we can apply to every single factory, and how we have the control to match each factory to those standards as they evolve. And so

2:33 the biggest takeaway for you as we go through everything here is just learning from port. What does it take to take a software factory to an enterprise level and what are the different components?

2:41 Because let me tell you, Port knocks it out of the park. There is a reason why I'm partnering with them and I'm so interested in incorporating my software factory with Port. They're really doing

2:51 it the right way. And I've even had some conversations learning from them how I can incorporate my software factory with their platform and now bringing that to use. You can take inspiration from

2:59 everything here. And so if you haven't seen it yet or just as a refresher, I want to start by going over my underlying software factory, the core engineering loop. And then this will set

3:08 the stage for port and the components that I have on top of it. And so let me be very clear. If you are just getting started incorporating a software factory or building one, I encourage you to keep

3:18 it simple and stick to the core loop. But everybody is going to have to scale at some point. And that is when it's going to be really important to have things like an agent and skill registry

3:27 and a context link. And so we'll get to that, but let's start with the underlying loop here. So the way that I always start with my software factory is I begin by planning the next release.

3:36 And so for green field, this means planning the proof of concept for my application. For brownfield, it means planning the next epic, the next set of tasks, whatever you want to call it.

3:45 Generally something that can be split into 10 to 20 tickets. And so we're very much a part of the process with the agent here creating something like a PRD document. It's really up to you what you

3:55 create. The point is you have some kind of context to go into the core loop of the factory because now the agent is going to take that planning and figure out exactly how to split it into tasks

4:05 and even do dependency mapping so it can figure out what loops it can run in parallel versus other work that has to wait for different tickets to be finished. And so then with every single

4:14 issue or ticket that it creates from the split, it's going to send each one through the core engineering loop. Then every time the core loop runs and I usually just have a cron job to trigger

4:23 it on a schedule basis, it's going to start by picking the next issue to implement based on priority order and the dependency mapping. And then it's going to take that and go through the

4:32 full plan, implement and validate cycle. So it's going to plan around the bug or new feature whatever the issue is describing. It's going to implement based on the plan and then go through

4:41 very comprehensive testing. So it's going to validate the application exactly as a user would, right? like what is the user journey we can go through to test this new feature and

4:50 then it's going to spin up a separate agent to perform a code review on the pull request and only once all the checks are green with our CI and the code review from the other agent then we

5:00 can merge and typically we're not just going to merge straight to production I don't really believe in that for software factories it's more get it on a branch that's going to be deployed to

5:08 staging and so we take the entire release we run a bunch of loops to go through all the tickets and we get everything set up in a staging ing environment. So now we at the end can go

5:18 through and validate things in batch. We don't have to sit there and code review and test every individual issue. We can test everything at once and then if there's anything that's off with any of

5:27 the features or whatever we wanted to build. We just send that in as new issues to the factory. So it can automatically pick up any of our feedback, implement that and then we can

5:36 iterate typically just a couple of times and then once everything's looking good in the staging environment we ship to production. So there you go. That is a couple of minutes just a very high level

5:45 of my underlying engineering loop. I cover a lot more in that video I linked to earlier. But now that you understand this, we can talk about the problems that we encounter when we really start

5:54 to scale the factory and run multiple. And so right now there are four core components of port that I want to cover with you just to show you what it truly takes to scale a software factory. And

6:04 they help you with a lot more than just this as well. There are so many considerations that go into scaling a software factory. Like another one is thinking about ownership because when we

6:13 have our factory running with all these different agents, a lot of times they're borrowing our credentials for things like our GitHub account. And so when something breaks in production and we

6:22 trace it to a commit from a certain account, we don't really know is it the engineer or is it their agents? And so that's why port also helps us by assigning identities to all the agents

6:31 running in our factories. And speaking of our agents, that brings us to the first one here with our registry. Every agent and every skill has an owner. and we're going to sort of version control

6:41 everything within port so that we can pull it into our factories as needed. So port calls themselves the harness around your software factory for orchestration, context, governance and measurement. And

6:53 this in my mind is the first big component for this. So let me show you in port what this looks like. There's a lot of inspiration we can take here for how we manage our skills and agents for

7:02 our factory. And so what the skill registry gives me is a central place to store every single skill that I'm using in any of my factories. And it'll help me identify the number of distinct

7:13 versions that I have. It's bad for this number to be high generally because it means that my skills have drifted across my different factories as much as I can. I want to maintain one version of every

7:23 skill and then distribute it from the registry. And by the way, the reason the skill registry is so important is because every single step within my underlying engineering loop is driven by

7:34 a skill. I don't just have a couple of lines for a prompt. I have an elaborate skill that's defining my exact process for everything here. The only reason I trust the software factory is because

7:44 I'm spending a lot of time engineering the harness and the skills and agents are a very big part of that. So we have the skill registry and going to their demo environment. We can also see a

7:53 better example of what it looks like to assign ownership and the publish status. Even building out our skill life cycle for how we can rerun certification. We're making updates to our skills.

8:03 Rejecting publishes, deprecating them over time, right? Like managing the life cycle of our skills for our factories is also very important. And we're going to be doing a very similar thing for the

8:11 agents we're running throughout as well. So the skills are simply our workflows, but agents are roles within our factory. Like we have the planner that helps us build that release up front, the backlog

8:22 splitter that takes that plan and splits it into tickets. And for every single one of these agents, we have the platform we're using for it. Like some parts of our factory we're going to

8:29 drive with cloud code. Other parts we could drive with codecs or pi. We have the model defined for each one. The permissions for what it's able to touch or what it can't do, the approval

8:39 status. And so we have this registry of everything that's driving the entire underlying harness. And so I still get to define the agents and skills for exactly how I want to run my factory.

8:48 Port just helps me manage it all and make it very easy for me to reuse these things, pull from the registry for every factory that I'm running. So this tab is my actual agent registry, but going to

8:59 their demo environment again, you can see what it looks like when we have more runtime platforms like running part of our factory in GCP Vertex AI or AWS Bedrock. A lot of what enterprises are

9:08 doing. And just like we have the skills life cycle, we also have the agent life cycle for how we're creating new agents, promoting them, updating their permissions. You want to have an owner

9:17 within the organization that's managing these things for the different factories. Now, the next really important component to cover here is the context lake. And this is probably my

9:26 favorite part of port, even though I love it all. Because here's the thing, our underlying engineering loop, what we have consisting of our agents and skills that we pull from the registry, this is

9:36 really just our process. It has nothing to do with business context and we need a lot of that if we really want to set our factories up for success. And so obviously connecting our factories to

9:47 our GitHub repos and directly to CI but also platforms like Jira and Slack. So it has business context and even knowledge of things like who owns the different applications and features that

9:58 we're building. Now going back to their demo environment really quickly, they have a really good example of what it looks like when we have a rich context lake because as our factory is working

10:07 with the higher level planning we do with it and even as it's going through the individual tickets, there's a lot of information that's critical where it can't just get that by looking at the

10:16 codebase. It needs extra business context from things like Slack or SharePoint or Jira. For example, knowing is a human required before we would maybe approve the merge cuz some things

10:25 you might want to be more autonomous. Other things you need more of a review because the blast radius might be high. And again, determining this kind of thing, you can't always do it from just

10:33 the codebase, especially things like the service tier and the domain. Like this is a marketing related feature. Here's the owner that we'd want to send approval to. having the factory not just

10:42 work entirely in isolation, but figuring out the places where we need a human, especially for certain things. That is what port helps us manage with the context lake. Now, of course, port also

10:52 has very rich information on the codebase itself with your pull requests and the status of the factory and CI and all of that. But what I want to show you right now is more of the business

11:00 context that we need to especially pull in when we're first doing the planning. So when we're actually having the conversation with our agent, establishing the plan before we send it

11:09 into the factory, we're still going to be using port because of the context link. And so the exact prompt that I have here is not really important to go into detail. I'm essentially just

11:18 planning what I want to create up front with my agent. And I'm using the port MCP server to pull key information from the context lake. And here we're pulling things like the ownerships of the

11:29 repositories, templates we can use as a starting point, the readiness of the repo. There is so much context that we're pulling here. And of course, you can tune how you're using the port MCP

11:38 server to figure out what you're pulling, what you're searching, and import you can decide the platforms that you're connecting like GitHub and Jira and Slack. The important thing here is

11:46 after it makes all these calls, it's just in a better place to help us plan for the factory run itself and exactly what we're going to build. And so right here, like I figured out the owners, the

11:55 factory team, the repos at bronze, that's the readiness of the repo to become a factory like we'll talk about in a little bit. And so all this now goes into us having a conversation with

12:05 our agent using ports context to assist to create that PRD. That is what we plan. And then this is what we send into the factory. And by the way, none of this is theoretical. I've already built

12:14 a lot of apps with my software factory and port. Like this is the demo that I have for today. Just one of many applications I've built. And so this is a team knowledge base, a central place

12:24 for people to get answers across repositories. It's not the most elaborate application, but I built this over just 2 days using port in my software factory completely handsoff

12:34 after I built that initial PRD. And so it's a rag application under the hood where I can ask questions to the central knowledge base. It'll search through everything and you'll even have source

12:44 citation. And it looks pretty good overall. It's not the fanciest thing like I said, but this is pretty impressive for just letting it rip for a couple of days. And if we look in port,

12:53 we have full management of everything. And so all the pull requests that I created, there's 20 in total for this release that I created a PRD for. We can see all of them import with their

13:03 status. So we can click into this and get a lot more detail. And we also have the scorecard. This is the readiness of our repo. The things that we need to have in place so it's truly ready to

13:14 become an autonomous factory. And this is the standard that we can apply to every software factory. So essentially what we have here is a readiness check. Is our repository ready to become a

13:24 software factory and are we ready for that level of autonomy? Now port can't check everything because we do bring our own engineering loop but it is able to check the highle things like do we have

13:34 an owner defined for the repository that's very important like a part of our context lake like we were talking about earlier does it have a readme a PR template does it have a CI workflow and

13:42 is CI passing on main if all these things are checked then we are gold and we are ready to implement the factory into this repository and so for all the other repos that I have that are not

13:53 gold this is usually how we'll start where we have a sort of laundry list of things that we have to address in our repository before we are ready to just turn on the autonomy. Now, not only does

14:05 this set of standards give us a checklist to work against as we initially set up our factory, but also every single time we have a pull request merged, port is going to grade that

14:14 merge against the standards that we have here. So, for example, when CI is failing, we know we have to do something about it. It's reported in port and it's even going to go through a workflow

14:24 where we can approve addressing this problem creating an issue in the factory just like all the other work we do to address the problem in the codebase itself. And so I actually have a demo

14:34 prepared to show you what this looks like. All right, so I've recorded this ahead of time to very quickly show you both the scorecards and controls working together in port. These are the last two

14:43 big components I want to show you. And so we have here to start is a workflow. We can build workflows in port to help us manage our contacts lake, our factories, everything. And so I'm going

14:53 to go ahead and play this here and just kind of talk through everything that's happening. And so this is our workflow to fix our scorecard whenever there is an issue. And so what I'm doing here is

15:02 I'm purposely making CI fail in my workflow. And we'll see that port is automatically going to detect that and that's going to trigger the workflow. So it proposes to me. I have to approve it,

15:13 but it's going to propose creating an issue to address CI failing in the repository. Now, obviously, it's a little bit forced because you can see that I'm making a commit to purposely

15:22 break it. But the point is your CI starts failing all of the time in a real codebase because you always have tests that are flaky or things that break when you're making changes. And so, we want

15:33 port to identify that. That's what we're showing right here. And so, now we have a backend failure in our CI. And so, going back to port, look at that. It went from gold to silver. The readiness

15:42 is down because we have CI failing. And so now we can see in execution of this workflow, it is now waiting for our approval. It detected the failure and now it's saying, hey, I want to create a

15:53 GitHub issue so that we have the factory automatically pick it up and fix the CI. So we have sort of this self-improvement using port to guide it. Okay, so we approve it, which means now we're going

16:03 to go and automatically create the issue in GitHub. And so I'll pop over there. So you'll see that we have the new issue, which means the next lap is going to pick this up. and then fix the CI

16:12 automatically. And then I'll kind of skip ahead here to show what that looks like. So we get to the point where the lap has addressed it. It's merged. Our CI is green. And then going back to

16:21 port, we go back from silver to gold because our CI is passing. And so it's autonomous with human in the loop at least for that fast approval. But besides us quickly approving things,

16:32 everything is self-improving. So it's able to detect when CI is failing. So, especially if your CI is elaborate enough where you're confident green CI means the application is in a healthy

16:42 state, this is a really important addition that port gives us to make our repository self-improving. So, there you go. With that, we've covered all four of the core parts of

16:52 port that I wanted to hit on today, helping us evolve our software factories. And the most important thing with everything here is the human in the loop. I really respect and resonate with

17:01 how port has built the human in the loop throughout the entire harness because when I first started building my software factory, it was more of what I call a dark factory where there's no

17:11 human in the loop at all. Not doing the planning up front with the agent. No staging environment is going straight to production. It's not going to ask for our approval when it adjusts things

17:20 within CI, right? Like it could adjust its own harness. It could literally do anything and we have no visibility. And I purposely moved away from that. I still want to make the process as

17:30 autonomous as possible, but it has to be within reason. There needs to be certain things where we have human in the loop. And so port's philosophy with their larger harness is we build in the

17:40 owners. We have the context like we do the planning. We have the approval when we are working with the standards because we need human in the loop and then we just remove that when we see

17:50 fit. But for the most part, we aren't just going to be completely lights out like I used to do with the dark factory. So, just another golden nugget to end things off for you here. And so, I hope

17:59 that this video was useful for you overall, giving you inspiration and ideas for truly scaling your software factories. And Port just as a great platform that's an option for you to do

18:09 so. And like I said, I did work with Port on this video. And Port is free for up to 15 seats. No credit card required. So, you can go ahead and try it right now on your repositories. You can try

18:19 for free with the link that I'll have in the description. And thanks to Port for working with me on this. And so with that, if you found these ideas useful for you, you're interested to follow my

18:28 content on agentic engineering and building out my software factory, I would really appreciate a like and a subscribe. And with that, I will see you in the next video.

Frontier News · by Hyperjump Technology