software-factory
Skill73 starsChanged 8 days agoMITView on GitHub
Use when the user wants to discover, design, or build an unattended Software Factory (軟體工廠) — turning recurring manual workflows into an automated Trigger → Run → Three Brakes loop, or says "做成軟體工廠", "有哪些事可以轉成軟體工廠", "幫這個流程建軟體工廠", "/software-factory". Do not use for single-hook gates inside an interactive turn (use gate-authoring), general feature specs without unattended automation (use grill-me or to-spec), or one-off cron reminders (use schedule or loop).
- Commits and pushes
24 other projects use a version of this.
Adopted by
Most recently taken up by
- quarkiverse/quarkus-reactive-messaging-nats-jetstreamtheir own version, first seen Nov 30, 2026
- Rain-kl/OpenFlaretheir own version, first seen Nov 30, 2026
- ngxccc/engineered-skillstheir own version, first seen Nov 29, 2026
- atpaawej/skillstheir own version, first seen Nov 29, 2026
- lizliz404/agent-skillstheir own version, first seen Nov 29, 2026
- IsKenKenYa/skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use chief-of-staff, setup-ts-deep-modules and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
getnaoSkillchief-of-staff
Also in 11 projects that use this
liufeng1976Skillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 9 projects that use this
richard12511Skillclaude-handoff
Hand the current conversation off to a fresh background agent that picks up the work immediately.
Also in 8 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 9 projects that use this
LesaniSkillwriting-beats
Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.
Also in 9 projects that use this
LesaniSkillwriting-fragments
Grilling session that mines the user for fragments — heterogeneous nuggets of writing (claims, vignettes, sharp sentences, half-thoughts) — and appends them to a single document as raw material for a future article. Use when the user wants to develop ideas before imposing structure, or mentions "fragments", "ideate", or "raw material" for writing.
Also in 9 projects that use this
- +1 more from Lesani
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- mattpocock/skills★ 335ksame name
- ericosiu/ai-marketing-skills★ 3.9ksame name
- devcxl/mattpocock-skills-zh★ 565same name
- Rain-kl/OpenFlare★ 305same name
- alexj11324/Mikka★ 90same name
- aspectly-labs/Mikka★ 90same name
- glassflow/tares★ 49same name
- HiteSit/real-scientist-skills★ 45same name
- quarkiverse/quarkus-reactive-messaging-nats-jetstream★ 17same name
- anis-dr/skills★ 4same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository44 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- folder-level/CLAUDE.mdCLAUDE.md
- absorb-packSkill
- agent-authoringSkill
- agent-dispatchSkill
- align-intentSkill
- auto-choiceSkill
- brainstormSkill
- cavemanSkill
- check-my-stackSkill
- debuggingSkill
- deep-checkSkill
- domain-modelingSkill
- e2e-contractSkill
- e2e-explore-then-batchSkill
- e2e-routeSkill
- figma-context-budgetSkill
- find-skillsSkill
- gate-authoringSkill
- github-repo-researchSkill
- grill-meSkill
- handoff-implSkill
- hillclimbSkill
- implementSkill
- model-onboardSkill
- mutation-testingSkill
- prototypeSkill
- receiving-code-reviewSkill
- research-before-answerSkill
- resolving-merge-conflictsSkill
- review-implementSkill
- review-methodSkill
- review-zhSkill
- skill-creatorSkill
- strategic-compactSkill
- tddSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- wayfinderSkill
- wizardSkill
- workflow-hardeningSkill
- write-pr-descriptionSkill
- zoom-outSkill
The file
Files
<!-- 本檔在契約測試底下:bash ~/.claude/skills/software-factory/scripts/tests/software-factory-contract.test.sh -->Software Factory(軟體工廠探索、白話訪談與安全落地)
出處注記(2026-10-24,2026-11-04 補對帳):受控詞彙(9 槽位與三道煞車)借鑑自 mattpocock/skills#1316(已於 2026-10-31 以
4ae2317合入上游main);三階段動線(既有自動化反查 → 白話防呆訪談與掛機保護 → 調度器獨立複驗與 7 天觀察期落地)為本機自寫流程。踩坑紀錄見 LESSONS.md。
把需要真人開視窗喊「開始」的重複工作,轉化為「自動觸發(Trigger)→ 隔離黑盒子執行(Run)→ 三道煞車驗收(Three Brakes)」的無人值守產線。沒有煞車與防重跑鎖的自動化只會變成狂燒額度與刷通知的垃圾大砲(slop cannon),因此設計與實作必須綁定下方的除錯對帳、白話防呆與確定性複驗。
觸發與呼叫邊界
- Invocation capability:保留模型自動選用(model-callable)、使用者直接輸入
/software-factory,以及從其他流程(如grill-me或retro-workflow)交入的接線;不設disable-model-invocation。 - Trigger condition(與 frontmatter description 同步):當使用者想從近期工作挖掘可轉化為軟體工廠的候選、為某個重複流程設計無人值守工廠規格,或直接把工廠排程落地時使用。不要用於單一回合內的互動式 hook 攔截(改用
gate-authoring)、不涉及無人值守自動化的普通功能規格(改用grill-me或to-spec),或單純的定時提醒(改用schedule或loop)。
階段 1:候選探索與既有自動化反查
不論使用者是請你從近期紀錄挖掘候選,還是已經直接點名某個流程(使用者可能因看到大量收據或 log 而誤以為該流程仍是手動),動手設計前都先執行步驟 1 對帳既有自動觸發器;確認目標流程尚未自動化後,若使用者已指定目標即可跳過步驟 2 的跨領域海選、直接進入階段 2。
- 先盤點既有自動觸發器,不單憑收據數量提名:
.scratch/或logs/裡出現幾十份收據,往往是因為某支PreToolUsehook 或LaunchAgents排程早已在自動運轉,不代表每次都是人類手動發起。- 執行內建盤點腳本列出已掛載的 hooks 與排程(若在測試沙盒或指定工作區目錄
<root>下操作,傳入--root <root>):python3 ~/.claude/skills/software-factory/scripts/inventory-existing-automations.py - 同步檢查目標專案的
.git/hooks/與.github/workflows/(或在沙盒目錄下枚舉設定檔與LaunchAgents/*.plist)。
- 比對活動紀錄、自動觸發器與實際產出/消費端,分流三類結果:
- 對每個手動重複流程回答:「目前卡在哪一步還要真人按開始?」以篩出真正的新候選。
- 對已被
settings.jsonhook、LaunchAgentsplist、.github/workflows/或既有 workflow channel 自動觸發的流程,同步核對近期有無實際產出,以及產物有無下游消費端(腳本、hook、digest 或對話實際讀取),拆成兩類呈現:- 排除項目(已由既有機制自動化且有實際消費):觸發器正常產出且有下游消費端,附檔案與行號出處標明排除,不端出來當新候選。
- 殭屍排程/無消費端提醒(待健檢或退役):雖掛有自動觸發器,但近期零產出、持續失敗,或產出檔案無任何下游讀取與消費端,單獨列在此區並附證據交使用者決定修復或退役,不得混入正常排除項目掩蓋。
- 若掃描範圍涵蓋多個工作領域,先完成跨領域盤點再拿 Top 候選、殭屍排程提醒與排除清單跟使用者討論。
完成條件:每個被提名的候選都已對照 inventory-existing-automations.py(或沙盒內的 settings.json 與 LaunchAgents/*.plist)確認無既有自動觸發器;每條已有自動觸發器的流程都已核對近期產出與消費端,分別歸入「排除項目」或單獨列出「殭屍排程/無消費端提醒」並附出處。完成後接階段 2。
階段 2:白話防呆訪談與軟體工廠規格表
先閱讀目標專案裡人寫的既有規範與腳本,把已經定死的事實直接對齊,只針對會改變執行環境、分支權限、交付落點與防撞規則的分歧向使用者提問。
- 白話防呆訪談(禁止丟底層術語牆):
- 向使用者確認輪詢頻率、防重跑與讓鎖規則時,將內部機制翻譯成以下三個白話日常情境提問:
- 情境 A(無新事時 0 成本跳過):排程醒來先做純 git 或檔案檢查,沒新事就花 0 token 直接退下。若工作來源是上游 git 標籤,必須先找出「目前已是目標分支(如
dev)祖先的最高正式版 SemVer 高水位線(highest_merged)」,只對嚴格匹配正式版^v\d+\.\d+\.\d+$且版號> highest_merged的新標籤觸發——說明這能避開歷史未合併的舊標籤(如早期v0.x)與-edge.*/-rc.*/-beta.*預發版。 - 情境 B(同一件事卡住只跑 1 次,但模型缺油/斷線不鎖死版本):無人值守工廠遇到語意衝突或測試紅燈時,自動重試 2~3 次只會白燒數倍 token 並重複刷通知。因此
state.json採 1-shot 狀態機(in_flight→merged/needs_human/failed/retry_pending):一旦版號或任務產出收據後進入merged、needs_human或failed,最多只跑 1 次、發 1 次通知就鎖定跳過,等人類處理;但若無頭 worker 因模型額度耗盡(429/憑證失效)連收據都沒產出,會先自動切換config.json的launcher_chain備援鏈下一順位(如["agent-cli-primary", "agent-cli-fallback", "claude-sonnet"]),整條鏈都缺油或結尾git push撞到遠端 non-fast-forward 競態時,一律標retry_pending(絕不誤鎖成failed)等下一輪重跑。 - 情境 C(你在忙時怎麼讓路——掛機視窗絕不誤擋):操作者常在主工作目錄開著多個終端機與 Claude Code 視窗掛機數小時至隔夜,因此不能用「有沒有開著 Claude 視窗」或「主目錄有沒有未提交改動」當忙碌判斷。固定採雙層保護:
- 工廠全程在
/tmp/<slug>-<id>獨立臨時git worktree作業,完全不碰主工作目錄; - 只在活躍鎖持有
< 30分鐘(例如lane-lock.sh status顯示持有程序存活且< 30分鐘;若>= 30分鐘視為閒置掛機、不阻塞工廠)或目標分支有in_progress的 CI workflow(避免推播觸發cancel-in-progress砍斷進行中的 CI)時才禮讓退出。
- 工廠全程在
- 情境 A(無新事時 0 成本跳過):排程醒來先做純 git 或檔案檢查,沒新事就花 0 token 直接退下。若工作來源是上游 git 標籤,必須先找出「目前已是目標分支(如
- 向使用者確認輪詢頻率、防重跑與讓鎖規則時,將內部機制翻譯成以下三個白話日常情境提問:
- 產出完整軟體工廠規格表(四段必填骨架):
- 訪談收斂(或在單輪規劃請求中)產出規格時,必須完整列出下列四個結構化區塊,不省略任何槽位:
- 六欄重述(Six-field Restate):
Outcome、User、Why now、Success、Constraint、Out of scope。 - 9 大受控詞彙槽位(9 Controlled Glossary Slots):
Task(單一工作單元)Trigger(啟動排程或事件)Run(單次黑盒子執行生命週期,中途絕不停下等真人對話)Runner(可拋棄式隔離執行環境,如/tmp下的git worktree)Ticket tracker(狀態機檔案如state.json與收據目錄)Ticket source(工作來源與高水位線篩選條件)Git host(遠端倉庫與目標分支)Orchestrator(掌控前置檢查、建拆 worktree、呼叫 worker、獨立複驗與推播的調度腳本)Observability platform(無外部 APM 時填none,並指明本地 log、收據 JSON 與通知通道如 Discord Keychain webhook)
- 三道煞車(Three Brakes):
Automated checks(第一道煞車:型別、lint、版本檢查與雙端測試等確定性檢查)Automated review(第二道煞車:零對話脈絡的獨立審查 subagent,例如prepare_merge_review.py三方 diff + 雙盲routed-judge或task-verifier)Human review(第三道煞車:何時直推目標分支、何時退守候審分支如sync/upstream-vX.Y.Z並發單次通知請人類裁決)
- 5+1 設計問答對映(Q1~Q5 + 演進路線):逐題回答 Q1 任務來源、Q2 開工條件、Q3 Runner 隔離與權限邊界(明定 worker 禁止自行
git push)、Q4 完成定義與獨立複驗、Q5 失敗交接與防洗版機制。
- 六欄重述(Six-field Restate):
- 訪談收斂(或在單輪規劃請求中)產出規格時,必須完整列出下列四個結構化區塊,不省略任何槽位:
完成條件:防呆題目已涵蓋「0 成本跳過(含 SemVer 高水位線與排除預發版)」、「1-shot 不重試 needs_human/failed」與「掛機視窗不誤擋(/tmp worktree + < 30 分鐘活躍鎖與 in_progress CI 才讓路)」;規格表已完整填齊六欄重述、9 大槽位、三道煞車與 Q1~Q5。完成後接階段 3。
階段 3:安全硬化落地、五類回歸測試與觀察期登記
- 如果使用者確認要直接實作工廠調度器與排程,就在動工寫任何腳本前讀
~/.claude/skills/gate-authoring/SKILL.md,將調度器視為自動化控制面套用安全設計。 - 如果工廠將透過
launchd、cron或常駐排程上線,就在宣告完工前讀~/.claude/rules/common/trial-observation.md,完成 +7 天觀察期登記。
實作調度器(Orchestrator)或撰寫「調度器必備安全與驗收檢查清單」時,必須逐項落實下列 5 條硬性防護:
- Threat Model、Surface 四分表與
factory.disabled停機開關:- 在設計文件(
DESIGN.md)開頭寫明防護目標與明文不承諾事項(點名factory.disabled是操作者的一鍵緊急停機開關,不是防禦本機主動攻擊者的安全邊界)。 - 標出
Locked(調度器、worker prompt、測試檔)、Editable(臨時/tmpworktree 與收據)、Append-only / State(state.json與純 runtime loglogs/factory.log)、Human-controlled(factory.disabled、plist 與候審分支裁決)四分表,並寫明bootstrap、update、recovery三條自身生命週期指令。
- 在設計文件(
- 調度器確定性獨立複驗與備援鏈換手防護(絕不盲信 Worker 自報 JSON):
- 無頭 Claude worker 明文禁止自行執行
git push,只能產出變更與收據(如factory-verdict.json、merge-review.md)。(在DESIGN.md§0 明示同帳號下的禁止git push與 Locked 面屬gate-authoring §0防漂移架構分工,非跨 OS 帳號沙盒)。 launcher_chain換手迴圈必須以start_new_session=True執行子行程並捕捉TimeoutExpired(逾時以os.killpg回收整個 process group)與OSError;判斷某腿是否成功產出收據時,必須驗證該收據為合法 JSON 且含有效verdict與匹配的tag(若為空檔或截斷 JSON 則視為該腿崩潰、刪除後繼續切換下一腿,絕不因半份 JSON 提前停下並誤鎖為failed)。- Orchestrator 在推播或判定通過前必須親自執行確定性檢查:驗證
git status --porcelain完全為空(防止 worker 修好工作樹卻漏 commit 導致推播舊HEAD)、驗證開工時固定的origin_dev_sha與<target_tag>祖先關係、重跑scripts/check-version.sh(檔案不存在視為失敗)、核對merge-review.md非空與雙判官CLEAR;任一項不符立即攔截並降級為needs_human。 - 降級為
needs_human時,若工作樹有未提交衝突,先建立自動快照 commit 並寫入本機refs/factory-recovery/...持久 ref,再推送至不覆蓋人類分支的候審分支;推播目標分支前再次檢查factory.disabled且一律不加--force,遇 non-fast-forward 競態時記為retry_pending。
- 無頭 Claude worker 明文禁止自行執行
- 病態檔案防護(
lstat+O_NOFOLLOW)、原子寫入與單實例互斥鎖(fcntl.flock):- Orchestrator 進入主流程前先對
factory.lock取得非阻塞排他鎖fcntl.flock(fd, LOCK_EX | LOCK_NB)(拿不到鎖即以busy_self_lock0-token 退出),防止排程與手動重入互拆 worktree;所有前置忙碌與git fetch檢查遇失敗時一律 fail-closed 禮讓退出;--dry-run保持純唯讀、不寫入state.json。 - 讀寫
state.json、config.json與logs/factory.log前,先用os.lstat與os.O_NOFOLLOW | os.O_NONBLOCK驗證目標:若為 symlink、FIFO 或st_nlink > 1hardlink,立即拋錯拒寫;寫入設定與狀態時採「同目錄O_CREAT | O_EXCL | O_NOFOLLOW暫存檔 →fsync→os.replace原子替換」(不用原地O_TRUNC),且既存的空state.json視為損壞拋錯、不靜默重置。
- Orchestrator 進入主流程前先對
- 零內容雜湊紀律(No Content Hashing):
- 不在
state.json、收據或 manifest 計算、儲存或比對檔案內容 hash(sha256、md5、checksum、digest);只記錄版號、git commit SHA 與結構化狀態欄位。
- 不在
- 五類回歸測試 + 實機乾跑 + 7 天 Trial 登記:
- 撰寫並實跑涵蓋 5 大類情境的測試套件:①
known-good(無新版 0-token 跳過 + 乾淨合併推進)、②known-bad(已標failed/needs_human單次熔斷不重跑 + 攔截 worker 謊報ready_to_push)、③boundary(lane-lock< 30分鐘禮讓 vs>= 30分鐘掛機放行 +in_progressCI 禮讓)、④lifecycle(bootstrap / update /factory.disabledrecovery 停機與恢復)、⑤pathological(拒絕 symlink / FIFO / hardlink),全過才印出專用通過 token(如FACTORY_TEST_SUITE_ALL_GREEN)。 - 對真實倉庫跑一次乾跑、載入排程(
plutil -lint+launchctl bootstrap),並在~/Desktop/projects/.claude/trials/active.md新增 +7 天觀察期條目與 detail 檔。
- 撰寫並實跑涵蓋 5 大類情境的測試套件:①
完成條件:上述 5 項調度器安全與驗收檢查(Threat Model + Surface 四分表 + factory.disabled、調度器獨立複驗禁 worker push、lstat + O_NOFOLLOW 防 symlink/FIFO/hardlink、零內容雜湊、五類測試+7 天 Trial 登記)已全數列入檢查清單或實作驗證通過。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

