nitm-ai-dev-toolkit 3.0.23 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -3
- package/README.md +93 -6
- package/bin/cli.js +155 -25
- package/bin/factory-archive.js +71 -0
- package/bin/factory-prune.js +79 -0
- package/bin/factory-watch.js +509 -0
- package/package.json +1 -1
- package/src/monorepo/.agents/skills/factory/SKILL.md +593 -0
- package/src/monorepo/.claude/agents/admin-portal.agent.md +1 -1
- package/src/monorepo/.claude/agents/api-specialist.agent.md +1 -1
- package/src/monorepo/.claude/agents/backend-architect.agent.md +1 -1
- package/src/monorepo/.claude/agents/documenter.agent.md +1 -1
- package/src/monorepo/.claude/agents/factory-approver.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-builder.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-reviewer-code.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-reviewer-security.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-reviewer-ui.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-reviewer-ux.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-spec-writer.agent.md +12 -0
- package/src/monorepo/.claude/agents/feature-builder.agent.md +1 -1
- package/src/monorepo/.claude/agents/frontend-developer.agent.md +1 -1
- package/src/monorepo/.claude/agents/green.agent.md +1 -1
- package/src/monorepo/.claude/agents/implementer.agent.md +1 -1
- package/src/monorepo/.claude/agents/planner.agent.md +1 -1
- package/src/monorepo/.claude/agents/red.agent.md +1 -1
- package/src/monorepo/.claude/agents/refactor.agent.md +1 -1
- package/src/monorepo/.claude/agents/researcher.agent.md +1 -1
- package/src/monorepo/.claude/agents/reviewer.agent.md +1 -1
- package/src/monorepo/.claude/agents/tdd.agent.md +1 -1
- package/src/monorepo/.claude/agents-snippets/factory-approver.md +72 -0
- package/src/monorepo/.claude/agents-snippets/factory-builder.md +101 -0
- package/src/monorepo/.claude/agents-snippets/factory-reviewer-code.md +57 -0
- package/src/monorepo/.claude/agents-snippets/factory-reviewer-security.md +48 -0
- package/src/monorepo/.claude/agents-snippets/factory-reviewer-ui.md +64 -0
- package/src/monorepo/.claude/agents-snippets/factory-reviewer-ux.md +64 -0
- package/src/monorepo/.claude/agents-snippets/factory-spec-writer.md +119 -0
- package/src/monorepo/.claude/agents-snippets/feature-builder.md +1 -1
- package/src/monorepo/.claude/commands/factory.md +24 -0
- package/src/monorepo/.claude/commands/ponytail-audit.md +4 -6
- package/src/monorepo/.claude/commands/ponytail-debt.md +3 -5
- package/src/monorepo/.claude/commands/ponytail-gain.md +2 -4
- package/src/monorepo/.claude/commands/ponytail-help.md +2 -4
- package/src/monorepo/.claude/commands/ponytail-review.md +3 -5
- package/src/monorepo/.claude/commands/ponytail.md +3 -5
- package/src/monorepo/.claude/prompt-snippets/assign-tasks.md +6 -2
- package/src/monorepo/.claude/prompt-snippets/bootstrap-patch.md +32 -17
- package/src/monorepo/.claude/prompt-snippets/bootstrap-upgrade.md +76 -51
- package/src/monorepo/.claude/prompt-snippets/bootstrap.md +57 -29
- package/src/monorepo/.claude/prompt-snippets/factory.md +20 -0
- package/src/monorepo/.claude/prompt-snippets/implement-feature.md +2 -2
- package/src/monorepo/.claude/prompt-snippets/tasks.md +49 -87
- package/src/monorepo/.claude/rules-snippets/documentation.md +8 -6
- package/src/monorepo/.cursor/agents/factory-approver.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-builder.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-reviewer-code.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-reviewer-security.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-reviewer-ui.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-reviewer-ux.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-spec-writer.agent.md +11 -0
- package/src/monorepo/.cursor/commands/factory.md +24 -0
- package/src/monorepo/.github/agents/factory-approver.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-builder.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-reviewer-code.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-reviewer-security.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-reviewer-ui.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-reviewer-ux.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-spec-writer.agent.md +11 -0
- package/src/monorepo/.github/prompts/factory.prompt.md +25 -0
- package/src/monorepo/.github/prompts/review-staged.prompt.md +1 -1
- package/src/monorepo/.opencode/agents/admin-portal.md +10 -4
- package/src/monorepo/.opencode/agents/api-specialist.md +10 -4
- package/src/monorepo/.opencode/agents/backend-architect.md +10 -4
- package/src/monorepo/.opencode/agents/documenter.md +10 -4
- package/src/monorepo/.opencode/agents/factory-approver.md +20 -0
- package/src/monorepo/.opencode/agents/factory-builder.md +20 -0
- package/src/monorepo/.opencode/agents/factory-reviewer-code.md +20 -0
- package/src/monorepo/.opencode/agents/factory-reviewer-security.md +20 -0
- package/src/monorepo/.opencode/agents/factory-reviewer-ui.md +20 -0
- package/src/monorepo/.opencode/agents/factory-reviewer-ux.md +20 -0
- package/src/monorepo/.opencode/agents/factory-spec-writer.md +20 -0
- package/src/monorepo/.opencode/agents/feature-builder.md +13 -5
- package/src/monorepo/.opencode/agents/frontend-developer.md +10 -4
- package/src/monorepo/.opencode/agents/green.md +10 -4
- package/src/monorepo/.opencode/agents/implementer.md +10 -4
- package/src/monorepo/.opencode/agents/planner.md +10 -4
- package/src/monorepo/.opencode/agents/red.md +10 -4
- package/src/monorepo/.opencode/agents/refactor.md +10 -4
- package/src/monorepo/.opencode/agents/researcher.md +10 -4
- package/src/monorepo/.opencode/agents/reviewer.md +10 -4
- package/src/monorepo/.opencode/agents/tdd.md +13 -5
- package/src/monorepo/.opencode/commands/factory.md +29 -0
- package/src/monorepo/.opencode/opencode.jsonc +8 -10
- package/src/monorepo/AGENTS.md +30 -1
- package/src/monorepo/CLAUDE.md +1 -1
- package/src/monorepo/README.md +20 -0
- package/src/monorepo/factory/README.md +194 -0
- package/src/monorepo/factory/_gitignore +5 -0
- package/src/repo/.agents/skills/factory/SKILL.md +593 -0
- package/src/repo/.claude/agents/admin-portal.agent.md +1 -1
- package/src/repo/.claude/agents/api-specialist.agent.md +1 -1
- package/src/repo/.claude/agents/backend-architect.agent.md +1 -1
- package/src/repo/.claude/agents/documenter.agent.md +2 -2
- package/src/repo/.claude/agents/factory-approver.agent.md +12 -0
- package/src/repo/.claude/agents/factory-builder.agent.md +12 -0
- package/src/repo/.claude/agents/factory-reviewer-code.agent.md +12 -0
- package/src/repo/.claude/agents/factory-reviewer-security.agent.md +12 -0
- package/src/repo/.claude/agents/factory-reviewer-ui.agent.md +12 -0
- package/src/repo/.claude/agents/factory-reviewer-ux.agent.md +12 -0
- package/src/repo/.claude/agents/factory-spec-writer.agent.md +12 -0
- package/src/repo/.claude/agents/feature-builder.agent.md +1 -1
- package/src/repo/.claude/agents/frontend-developer.agent.md +1 -1
- package/src/repo/.claude/agents/green.agent.md +1 -1
- package/src/repo/.claude/agents/implementer.agent.md +1 -1
- package/src/repo/.claude/agents/planner.agent.md +2 -2
- package/src/repo/.claude/agents/red.agent.md +1 -1
- package/src/repo/.claude/agents/refactor.agent.md +1 -1
- package/src/repo/.claude/agents/researcher.agent.md +2 -2
- package/src/repo/.claude/agents/reviewer.agent.md +2 -2
- package/src/repo/.claude/agents/tdd.agent.md +1 -1
- package/src/repo/.claude/agents-snippets/factory-approver.md +72 -0
- package/src/repo/.claude/agents-snippets/factory-builder.md +100 -0
- package/src/repo/.claude/agents-snippets/factory-reviewer-code.md +57 -0
- package/src/repo/.claude/agents-snippets/factory-reviewer-security.md +48 -0
- package/src/repo/.claude/agents-snippets/factory-reviewer-ui.md +64 -0
- package/src/repo/.claude/agents-snippets/factory-reviewer-ux.md +64 -0
- package/src/repo/.claude/agents-snippets/factory-spec-writer.md +117 -0
- package/src/repo/.claude/agents-snippets/feature-builder.md +1 -1
- package/src/repo/.claude/commands/factory.md +24 -0
- package/src/repo/.claude/commands/ponytail-audit.md +4 -6
- package/src/repo/.claude/commands/ponytail-debt.md +3 -5
- package/src/repo/.claude/commands/ponytail-gain.md +2 -4
- package/src/repo/.claude/commands/ponytail-help.md +2 -4
- package/src/repo/.claude/commands/ponytail-review.md +3 -5
- package/src/repo/.claude/commands/ponytail.md +3 -5
- package/src/repo/.claude/prompt-snippets/assign-tasks.md +6 -2
- package/src/repo/.claude/prompt-snippets/bootstrap-patch.md +32 -17
- package/src/repo/.claude/prompt-snippets/bootstrap-upgrade.md +87 -77
- package/src/repo/.claude/prompt-snippets/bootstrap.md +71 -74
- package/src/repo/.claude/prompt-snippets/factory.md +20 -0
- package/src/repo/.claude/prompt-snippets/implement-feature.md +2 -2
- package/src/repo/.claude/prompt-snippets/tasks.md +49 -112
- package/src/repo/.cursor/agents/factory-approver.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-builder.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-reviewer-code.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-reviewer-security.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-reviewer-ui.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-reviewer-ux.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-spec-writer.agent.md +11 -0
- package/src/repo/.cursor/commands/factory.md +24 -0
- package/src/repo/.github/agents/factory-approver.agent.md +11 -0
- package/src/repo/.github/agents/factory-builder.agent.md +11 -0
- package/src/repo/.github/agents/factory-reviewer-code.agent.md +11 -0
- package/src/repo/.github/agents/factory-reviewer-security.agent.md +11 -0
- package/src/repo/.github/agents/factory-reviewer-ui.agent.md +11 -0
- package/src/repo/.github/agents/factory-reviewer-ux.agent.md +11 -0
- package/src/repo/.github/agents/factory-spec-writer.agent.md +11 -0
- package/src/repo/.github/prompts/factory.prompt.md +25 -0
- package/src/repo/.opencode/agents/admin-portal.md +10 -4
- package/src/repo/.opencode/agents/api-specialist.md +10 -4
- package/src/repo/.opencode/agents/backend-architect.md +10 -4
- package/src/repo/.opencode/agents/documenter.md +10 -4
- package/src/repo/.opencode/agents/factory-approver.md +20 -0
- package/src/repo/.opencode/agents/factory-builder.md +20 -0
- package/src/repo/.opencode/agents/factory-reviewer-code.md +20 -0
- package/src/repo/.opencode/agents/factory-reviewer-security.md +20 -0
- package/src/repo/.opencode/agents/factory-reviewer-ui.md +20 -0
- package/src/repo/.opencode/agents/factory-reviewer-ux.md +20 -0
- package/src/repo/.opencode/agents/factory-spec-writer.md +20 -0
- package/src/repo/.opencode/agents/feature-builder.md +13 -5
- package/src/repo/.opencode/agents/frontend-developer.md +10 -4
- package/src/repo/.opencode/agents/green.md +10 -4
- package/src/repo/.opencode/agents/implementer.md +10 -4
- package/src/repo/.opencode/agents/planner.md +10 -4
- package/src/repo/.opencode/agents/red.md +10 -4
- package/src/repo/.opencode/agents/refactor.md +10 -4
- package/src/repo/.opencode/agents/researcher.md +10 -4
- package/src/repo/.opencode/agents/reviewer.md +10 -4
- package/src/repo/.opencode/agents/tdd.md +13 -5
- package/src/repo/.opencode/commands/factory.md +29 -0
- package/src/repo/.opencode/opencode.jsonc +8 -10
- package/src/repo/AGENTS.md +27 -1
- package/src/repo/CLAUDE.md +1 -1
- package/src/repo/README.md +20 -0
- package/src/repo/factory/README.md +194 -0
- package/src/repo/factory/_gitignore +5 -0
- package/src/monorepo/.opencode/plugins/ponytail.mjs +0 -93
- package/src/repo/.opencode/plugins/ponytail.mjs +0 -93
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Write a testable spec.md for a factory job from a feature request, after inspecting the real code. Dispatched by the factory orchestrator."
|
|
3
|
+
mode: subagent
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Factory Spec Writer Agent
|
|
17
|
+
|
|
18
|
+
Write a testable spec.md for a factory job from a feature request, after inspecting the real code.
|
|
19
|
+
|
|
20
|
+
@.claude/agents-snippets/factory-spec-writer.md
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Coordinate end-to-end feature development using subagents for planning, implementation, and review. Orchestrates the full development lifecycle."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.3
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
14
|
+
- action: subagent
|
|
15
|
+
resource: "*"
|
|
16
|
+
effect: allow
|
|
9
17
|
---
|
|
10
18
|
|
|
11
19
|
# Feature Builder — Coordinator
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Build user interfaces, implement components, handle state management, and optimize frontend performance. Use for responsive, accessible, and performant web applications."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
8
14
|
---
|
|
9
15
|
|
|
10
16
|
# Frontend Developer
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Write minimal code to make failing tests pass. Part of the TDD red-green-refactor cycle."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
8
14
|
---
|
|
9
15
|
|
|
10
16
|
# Green Agent (TDD — Make Tests Pass)
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Implement code changes for a specific task. Follow TDD, write tests alongside code, and self-review before reporting completion."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
8
14
|
---
|
|
9
15
|
|
|
10
16
|
# Implementer Agent
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Break down feature requests into implementation tasks. Read specifications, analyze codebase patterns, and produce structured plans with dependencies."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
8
14
|
---
|
|
9
15
|
|
|
10
16
|
# Planner Agent
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Write failing tests that define expected behavior. Part of the TDD red-green-refactor cycle."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
8
14
|
---
|
|
9
15
|
|
|
10
16
|
# Red Agent (TDD — Write Failing Tests)
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Improve code quality and structure while keeping all tests passing. Part of the TDD red-green-refactor cycle."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
8
14
|
---
|
|
9
15
|
|
|
10
16
|
# Refactor Agent (TDD — Improve Code Quality)
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Research codebase patterns, dependencies, and technical context. Analyze code structure, find relevant examples, and report findings without making changes."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: deny
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: deny
|
|
8
14
|
---
|
|
9
15
|
|
|
10
16
|
# Researcher Agent
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Review code changes for correctness, code quality, security, and adherence to project patterns. Provide actionable feedback with specific file and line references. Use immediately after writing or modifying code, or as a quality gate in orchestrated workflows."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.1
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: deny
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
8
14
|
---
|
|
9
15
|
|
|
10
16
|
# Reviewer Agent
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Implement a feature using test-driven development with red-green-refactor cycle. Coordinates specialized subagents for writing failing tests, implementing code, and refactoring."
|
|
3
3
|
mode: subagent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
request:
|
|
5
|
+
body:
|
|
6
|
+
temperature: 0.3
|
|
7
|
+
permissions:
|
|
8
|
+
- action: edit
|
|
9
|
+
resource: "*"
|
|
10
|
+
effect: allow
|
|
11
|
+
- action: shell
|
|
12
|
+
resource: "*"
|
|
13
|
+
effect: allow
|
|
14
|
+
- action: subagent
|
|
15
|
+
resource: "*"
|
|
16
|
+
effect: allow
|
|
9
17
|
---
|
|
10
18
|
|
|
11
19
|
# TDD Coordinator Agent
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run an opt-in factory job: intake, spec and plan gates, build in a worktree or in place, reviews, approval, local merge"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Factory
|
|
6
|
+
|
|
7
|
+
## Agent Dispatch
|
|
8
|
+
|
|
9
|
+
> **Run in the main session.** The orchestrator dispatches these agents; they cannot dispatch others.
|
|
10
|
+
|
|
11
|
+
| Agent | When to use |
|
|
12
|
+
|-------|-------------|
|
|
13
|
+
| `factory-spec-writer` | Spec stage (`spec` mode) writes `spec.md`; plan stage (`plan` mode) writes `plan.md` and `tasks.md` |
|
|
14
|
+
| `factory-builder` | Build, repair, and rework: writes `build.md` in the job folder; edits code at the build location |
|
|
15
|
+
| `factory-reviewer-code` | Review round, `code` lens |
|
|
16
|
+
| `factory-reviewer-security` | Review round, `security` lens |
|
|
17
|
+
| `factory-reviewer-ux` | Review round, `ux` lens (opt-in) |
|
|
18
|
+
| `factory-reviewer-ui` | Review round, `ui` lens (opt-in) |
|
|
19
|
+
| `factory-approver` | Approval gate: writes `decision.md` |
|
|
20
|
+
|
|
21
|
+
Dispatch each agent by its kebab-case name, as in the first column. Copilot may show a display name; pick the agent with that name.
|
|
22
|
+
|
|
23
|
+
## Arguments
|
|
24
|
+
|
|
25
|
+
Subcommands: `[--in-place] <feature request>` · `start [--in-place] <request | KEY | slug | job-id>` · `approve <job-id>` · `rework <job-id> <note>` · `abandon <job-id>` · `status [--all]` · `watch [--all]` · `archive [--all] [--dry-run]` · `prune [--all] [--abandoned] [--dry-run]`
|
|
26
|
+
|
|
27
|
+
$ARGUMENTS
|
|
28
|
+
|
|
29
|
+
@.claude/prompt-snippets/factory.md
|
|
@@ -5,17 +5,15 @@
|
|
|
5
5
|
".opencode/rules/*.md",
|
|
6
6
|
".agents/skills/orient-to-recent-work/SKILL.md"
|
|
7
7
|
],
|
|
8
|
-
"skills":
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
"plugin": [
|
|
8
|
+
"skills": [
|
|
9
|
+
".agents/skills",
|
|
10
|
+
".claude/skills"
|
|
11
|
+
],
|
|
12
|
+
"plugins": [
|
|
15
13
|
"opencode-mem",
|
|
16
14
|
"@tarquinen/opencode-dcp@latest",
|
|
17
|
-
"@dietrichgebert/ponytail"
|
|
18
|
-
"opentmux"
|
|
15
|
+
"@dietrichgebert/ponytail@4.12.0"
|
|
16
|
+
// "opentmux": V1-only; enable only after it supports V2.
|
|
19
17
|
],
|
|
20
18
|
"lsp": true
|
|
21
|
-
}
|
|
19
|
+
}
|
package/src/repo/AGENTS.md
CHANGED
|
@@ -27,6 +27,19 @@ The [orient-to-recent-work](.agents/skills/orient-to-recent-work/SKILL.md) skill
|
|
|
27
27
|
**Testing:** {{TEST_FRAMEWORK}}
|
|
28
28
|
**Build:** {{BUILD_TOOL}}
|
|
29
29
|
|
|
30
|
+
## Commands
|
|
31
|
+
|
|
32
|
+
Run from the project root. Default dev port: `{{DEV_PORT}}`.
|
|
33
|
+
|
|
34
|
+
| Task | Command |
|
|
35
|
+
| --------------- | --------------------------------------------------------------------------------------- |
|
|
36
|
+
| Setup | `{{SETUP_COMMAND}}` |
|
|
37
|
+
| Dev server | `{{DEV_COMMAND}}` |
|
|
38
|
+
| Dev server port | `{{DEV_PORT_FLAG}}`: the flag or env var that sets the port; `<port>` is the port value |
|
|
39
|
+
| Test | `{{TEST_COMMAND}}` |
|
|
40
|
+
| Lint | `{{LINT_COMMAND}}` |
|
|
41
|
+
| Build | `{{BUILD_COMMAND}}` |
|
|
42
|
+
|
|
30
43
|
## Project Management
|
|
31
44
|
|
|
32
45
|
**Tracker:** {{ISSUE_TRACKER}}
|
|
@@ -77,6 +90,14 @@ When stopping to ask a question, do not just post an open-ended block of text. F
|
|
|
77
90
|
|
|
78
91
|
> **Full details:** See `.github/instructions/agent-conduct.instructions.md`
|
|
79
92
|
|
|
93
|
+
## OpenCode V2 Context
|
|
94
|
+
|
|
95
|
+
OpenCode use with toolkit v4 requires native V2; Slim >=3.0.0 requires OpenCode >=2.0.7. Read [native setup](README.md#native-opencode-v2) before migration. All bootstrap flows run `opencode --version` before changes for confirmed OpenCode use: V1 must stop and upgrade OpenCode or remain on toolkit 3.x; missing/unparseable versions block OpenCode steps and toolkit 4.0.0 marking. Directory presence is not harness proof; other-harness-only setup is unaffected.
|
|
96
|
+
|
|
97
|
+
Use `agents`/`system`, `request.body.temperature`, ordered `permissions` (`action`/`resource`/`effect`, `shell`/`subagent`), `commands`, `plugins`, directory-based `skills`, and `mcp.servers`. Preserve user models/providers/plugins and Slim's separate strict schema; do not host-migrate its `prompt`/`permission`/`variant` fields or silently upgrade the separate external starter. Templates register the author's native V2 `@dietrichgebert/ponytail@4.12.0` locally instead of a bundled Ponytail plugin; `opentmux` stays commented as V1-only. Remove only known obsolete toolkit Ponytail `.js`/`.mjs`/`.ts` copies after backup and approval, preserve unrelated local plugins, and merge/deduplicate upstream registration locally without editing global config. No local API port or bridge is used; plugin/runtime integration is untested.
|
|
98
|
+
|
|
99
|
+
Ambient `AGENTS.md` works; config `instructions` entries do not load. `@refs` are ordinary text: explicitly read linked snippets. `request.body.temperature` remains in config, but the current runner does not send it. Preserve `lsp: true`; use project lint/typecheck/compiler commands, not unavailable V2 LSP diagnostics. Back up V1 before native conversion; converted files are incompatible with V1. Activate on the next run/restart.
|
|
100
|
+
|
|
80
101
|
## Detailed Instructions
|
|
81
102
|
|
|
82
103
|
### Native Codex
|
|
@@ -117,6 +138,7 @@ For detailed standards on specific topics, refer to these skills in `.agents/ski
|
|
|
117
138
|
| **Debugger** | `debugger/SKILL.md` | Systematic debugging dispatch with mandatory root cause investigation |
|
|
118
139
|
| **Documentation** | `project-documentation/SKILL.md` | README, comments, ADRs, changelogs |
|
|
119
140
|
| **Executing Plans** | `executing-plans/SKILL.md` | Following through on implementation plans |
|
|
141
|
+
| **Factory** | `factory/SKILL.md` | Opt-in spec-to-merge feature pipeline |
|
|
120
142
|
| **Git Worktrees** | `using-git-worktrees/SKILL.md` | Parallel development branches |
|
|
121
143
|
| **GitHub CLI** | `gh-cli/SKILL.md` | GitHub Issues CLI command reference |
|
|
122
144
|
| **GitLab CLI** | `glab-cli/SKILL.md` | GitLab MRs, issues, pipelines CLI reference |
|
|
@@ -357,13 +379,17 @@ Subagents are typically **agent-initiated** — the coordinator decides when to
|
|
|
357
379
|
|
|
358
380
|
> **Docs:** [VS Code Subagents](https://code.visualstudio.com/docs/copilot/agents/subagents) · [Cursor Subagents](https://cursor.com/docs/subagents)
|
|
359
381
|
|
|
382
|
+
### Factory (opt-in)
|
|
383
|
+
|
|
384
|
+
An optional file-driven pipeline for feature-sized work, alongside Feature Builder and TDD. Start it with `/factory <request>` in Claude Code, Copilot, Cursor, or OpenCode. The orchestrator reads the project and asks only the glaring questions before it creates anything, then asks you to continue or change the answers. Resume a feature with `/factory start <KEY | slug | job-id>`. Codex runs the orchestrator skill directly. Each job belongs to a feature folder in `docs/features/`, stops at a spec gate and a plan gate for your confirmation before any ticket or build, builds in its own git worktree unless you ask for `--in-place`, and moves its tickets when the project tracks them. The orchestrator is [.agents/skills/factory/SKILL.md](.agents/skills/factory/SKILL.md). Its seven agents are `factory-spec-writer`, `factory-builder`, `factory-reviewer-code`, `factory-reviewer-security`, `factory-reviewer-ux`, `factory-reviewer-ui`, and `factory-approver`, with wrappers in each harness's agents folder that point to the shared snippets in `.claude/agents-snippets/`. Setup, placeholders, and approval modes are in [factory/README.md](factory/README.md).
|
|
385
|
+
|
|
360
386
|
## Documentation Requirements
|
|
361
387
|
|
|
362
388
|
Documentation updates are **mandatory before committing** any feature or fix. See [`.github/instructions/documentation.instructions.md`](.github/instructions/documentation.instructions.md) for the full pre-commit checklist, templates, and AI agent directives.
|
|
363
389
|
|
|
364
390
|
**Quick summary:**
|
|
365
391
|
|
|
366
|
-
- Create or update `docs/features
|
|
392
|
+
- Create or update `docs/features/<feature>/` (spec + plan) for every feature, where `<feature>` is `<KEY>-<slug>` or `<slug>`
|
|
367
393
|
- Add fixes to the monthly log in `docs/fixes/{{YYYY-MM}}.md` (or a dedicated folder for complex fixes)
|
|
368
394
|
- Update `docs/api/`, `docs/integration/`, `docs/guides/`, `README.md`, and `CHANGELOG.md` when applicable
|
|
369
395
|
- Reference `docs/constitution.md` for project principles and governance
|
package/src/repo/CLAUDE.md
CHANGED
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
- Commands are in `.opencode/commands/`.
|
|
48
48
|
- Rules are in `.opencode/rules/`.
|
|
49
49
|
- Agents are in `.opencode/agents/`.
|
|
50
|
-
-
|
|
50
|
+
- Native V2 loads ambient `AGENTS.md`, not config `instructions` entries. Explicitly read referenced snippets (`@refs` are ordinary text, not attachments). See [OpenCode setup](README.md#native-opencode-v2).
|
|
51
51
|
- Skills are loaded from `.agents/skills/` and `.claude/skills/`.
|
package/src/repo/README.md
CHANGED
|
@@ -13,6 +13,12 @@ Templates use `{{PLACEHOLDER}}` syntax (SCREAMING_SNAKE_CASE). The most common p
|
|
|
13
13
|
| `{{LANGUAGE}}` | Programming language (TypeScript, PHP, Python, C#, etc.) |
|
|
14
14
|
| `{{PACKAGE_MANAGER}}` | Package manager (npm, pnpm, composer, pip, etc.) |
|
|
15
15
|
| `{{DEV_PORT}}` | Development server port |
|
|
16
|
+
| `{{DEV_PORT_FLAG}}` | Flag or env var that sets the dev port |
|
|
17
|
+
| `{{SETUP_COMMAND}}` | Install command |
|
|
18
|
+
| `{{DEV_COMMAND}}` | Dev server command |
|
|
19
|
+
| `{{TEST_COMMAND}}` | Test command |
|
|
20
|
+
| `{{LINT_COMMAND}}` | Lint command |
|
|
21
|
+
| `{{BUILD_COMMAND}}` | Build command |
|
|
16
22
|
| `{{DEPLOY_PLATFORM}}` | Deployment target |
|
|
17
23
|
| `{{ISSUE_TRACKER}}` | Issue tracker (Jira, Linear, GitHub Issues) |
|
|
18
24
|
| `{{ISSUE_ID}}` | Issue or ticket identifier |
|
|
@@ -110,6 +116,20 @@ See the following files for AI-assisted development:
|
|
|
110
116
|
|
|
111
117
|
## AI Instructions and Commands
|
|
112
118
|
|
|
119
|
+
### Native OpenCode V2
|
|
120
|
+
|
|
121
|
+
Toolkit v4 requires **OpenCode V2 (major >=2)** for OpenCode use; oh-my-opencode-slim >=3.0.0 requires OpenCode >=2.0.7. Bootstrap, patch, and upgrade run `opencode --version` before changes (optional leading `v` accepted). V1 must stop before OpenCode customization/migration or marking toolkit 4.0.0: upgrade OpenCode or remain on toolkit 3.x. A missing CLI or unparseable version stops OpenCode steps and version marking until confirmed/installed. Confirm harness use from runtime evidence or ask, not scaffold directories; other-harness-only setup is unaffected.
|
|
122
|
+
|
|
123
|
+
The template's local `plugins` array registers the author's native V2 package `@dietrichgebert/ponytail@4.12.0`, alongside `opencode-mem` and `@tarquinen/opencode-dcp@latest`; `opentmux` remains commented as V1-only. The obsolete local Ponytail plugin is no longer bundled; no local API port or bridge is used. For existing projects, back up and obtain approval before removing only known toolkit `.opencode/plugins/ponytail.js`, `.mjs`, or `.ts` copies; preserve unrelated local plugins and merge/deduplicate upstream registration locally without editing global plugins. Native local plugins are discovered automatically; do not register them twice.
|
|
124
|
+
|
|
125
|
+
With approval, merge `"plugins": ["oh-my-opencode-slim@3.0.0"]` locally without replacing other registrations. Slim's separate strict schema retains `prompt`, `permission`, and `variant`; do not host-migrate it. The external starter is a separate package, not automatically upgraded. Plugin/runtime integration has not been tested.
|
|
126
|
+
|
|
127
|
+
Use native `agents`/`system`, `request.body.temperature`, ordered `permissions` (`action`/`resource`/`effect`, `shell`/`subagent`), `commands`/`subagent`, `plugins` with `{ "package": "…", "options": {} }`, skill-directory arrays, and `mcp.servers` with inverse `disabled` and `timeout.catalog`/`timeout.execution`. Follow the [V2 migration guide](https://opencode.ai/v2/docs/migrate-v1) and [plugin guide](https://opencode.ai/v2/docs/build/plugins); the published schema may describe V1 and is not V2 validation authority.
|
|
128
|
+
|
|
129
|
+
Ambient `AGENTS.md` works; config `instructions` entries are not loaded. `@refs` are ordinary text: read linked snippets explicitly. `request.body.temperature` remains in config, but the current runner does not send it. Preserve `lsp: true`; use project lint/typecheck/compiler commands (no V2 LSP tools/diagnostics currently).
|
|
130
|
+
|
|
131
|
+
`--env opencode` supplies minimal shared references without activating other harnesses. Back up V1, merge rather than clobber models/providers/plugins, and activate on the next run/restart. Native-converted files are incompatible with V1. Verify with installed V2; `doctor` is not runtime validation. Toolkit 4.0.0 publishing has not been executed.
|
|
132
|
+
|
|
113
133
|
### Native Codex
|
|
114
134
|
|
|
115
135
|
`--env codex` includes `.codex/`, `.agents/`, and shared context, plus `.github/instructions/` and `.claude/rules-snippets/` solely to supply AGENTS-linked standards and their wrapper source content. No other harness command, agent, or config directories are installed; these references do not establish Copilot/Claude use or load automatically as Codex rules. Other harness scopes are unchanged.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Factory (opt-in)
|
|
2
|
+
|
|
3
|
+
A file-driven pipeline for feature-sized work. One orchestrator session runs a feature through intake → spec → plan → build → review → approve → merge. Agents get their context only from files, and each agent writes only its own file. Feature docs live in `docs/features/`, and job state lives here in `factory/jobs/`.
|
|
4
|
+
|
|
5
|
+
The factory is **opt-in**. It sits alongside Feature Builder and TDD and changes nothing they do. Nothing runs until you invoke `/factory`. Quick fixes stay direct.
|
|
6
|
+
|
|
7
|
+
Orchestrator: [.agents/skills/factory/SKILL.md](../.agents/skills/factory/SKILL.md). Its agents have wrappers in `.claude/agents/`, `.github/agents/`, `.cursor/agents/`, and `.opencode/agents/`. See [Harnesses](#harnesses).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
1. **Install it.** The toolkit installer copies this folder into your project root as `factory/`.
|
|
12
|
+
2. **Document your commands in `AGENTS.md`.** Agents read setup, dev, test, lint, and build commands from there, and the dev command must document how to pass a port (a flag or an env var). Without them the factory stops and asks you.
|
|
13
|
+
3. **Replace the placeholders** below in `.agents/skills/factory/SKILL.md` and `.claude/agents-snippets/factory-*.md`. Bootstrap does this when it runs.
|
|
14
|
+
4. **Commit** `factory/README.md`, `factory/.gitignore`, and the factory agents and skill. Runtime state is ignored (see Layout). Feature docs in `docs/features/` are committed with the code.
|
|
15
|
+
5. **Run it** from your harness: `/factory <feature request>` to start from a request, or `/factory start <KEY | slug | job-id>` to pick up an existing feature. See [Harnesses](#harnesses) for each entry point.
|
|
16
|
+
|
|
17
|
+
## Placeholders
|
|
18
|
+
|
|
19
|
+
| Placeholder | Meaning | Default |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| DEFAULT_BRANCH | Branch jobs start from and merge into | `main` |
|
|
22
|
+
| FACTORY_PORT_BASE | Base dev-server port. Job `n` uses builder `base + 10n`, ux `+1`, ui `+2` | `5100` |
|
|
23
|
+
| APPROVAL_MODE | `human`: stop at `awaiting-human` for `/factory approve`. `auto`: merge on `APPROVE` | `human` |
|
|
24
|
+
| FACTORY_REVIEW_LENSES | Comma list from `code, security, ux, ui` | `code, security` |
|
|
25
|
+
|
|
26
|
+
`ux` and `ui` need browser tooling to verify anything. Without it they report every check as `Not verified`, and the job goes straight to `needs-human`. Enable them only when your agents can drive a browser.
|
|
27
|
+
|
|
28
|
+
## Invocations
|
|
29
|
+
|
|
30
|
+
| Command | What it does |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `/factory <request>` | Intake: the orchestrator reads the project and the features it touches, asks only the glaring questions, then asks you to continue or change the answers. Nothing is created before that |
|
|
33
|
+
| `/factory start <request \| KEY \| slug \| job-id>` | Find or create the feature folder, then start a job, or resume the open job for it (for example one waiting at a gate) |
|
|
34
|
+
| `/factory approve <job-id>` | Merge a job in `awaiting-human` or `needs-human`. On a `merged` job, moves its tickets to Done |
|
|
35
|
+
| `/factory rework <job-id> <note>` | Start a fresh builder with your note and a fresh retry budget |
|
|
36
|
+
| `/factory abandon <job-id>` | Close a job that will not continue. Nothing is merged. Removes its worktree and branch only when the branch has no unmerged commits. Tickets stay as they are |
|
|
37
|
+
| `/factory status [--all]` | Summarize open jobs from their `job.json` files. Closed jobs are hidden unless `--all` |
|
|
38
|
+
| `/factory watch [--all]` | Show the status table, then print the command for the live view to run in a terminal (read-only). Closed jobs are hidden unless `--all` |
|
|
39
|
+
| `/factory archive [--all] [--dry-run]` | Move closed jobs to `factory/archive/`. Open jobs never move. See [Archive](#archive) |
|
|
40
|
+
| `/factory prune [--all] [--abandoned] [--dry-run]` | Permanently delete closed jobs from `factory/jobs/` and `factory/archive/`, after one confirmation. Open jobs and `docs/features/` are never touched. See [Prune](#prune) |
|
|
41
|
+
|
|
42
|
+
`--in-place` can follow either form (`/factory --in-place <request>`, `/factory start --in-place <...>`). It builds in the main checkout instead of a worktree. See [In-place builds](#in-place-builds).
|
|
43
|
+
|
|
44
|
+
There is no queue. Start each feature with a request, a ticket key, or a slug.
|
|
45
|
+
|
|
46
|
+
## Harnesses
|
|
47
|
+
|
|
48
|
+
The orchestrator and agents are the same in every harness. Each harness has its own entry point and agent wrappers. Every wrapper points to the shared snippets in `.claude/agents-snippets/`.
|
|
49
|
+
|
|
50
|
+
| Harness | Entry point | Agent wrappers |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| Claude Code | `/factory` (`.claude/commands/factory.md`) | `.claude/agents/` |
|
|
53
|
+
| GitHub Copilot | `/factory` prompt (`.github/prompts/factory.prompt.md`) | `.github/agents/` |
|
|
54
|
+
| Cursor | `/factory` (`.cursor/commands/factory.md`) | `.cursor/agents/` |
|
|
55
|
+
| OpenCode | `/factory` (`.opencode/commands/factory.md`) | `.opencode/agents/` |
|
|
56
|
+
| Codex | The factory skill (`.agents/skills/factory/SKILL.md`) | None. Runs the snippets directly, one role at a time in one session (see Harness notes in SKILL.md) |
|
|
57
|
+
|
|
58
|
+
## Feature folders and sizing
|
|
59
|
+
|
|
60
|
+
Each job belongs to a feature folder, `docs/features/<KEY>-<slug>/` (or `docs/features/<slug>/` before a ticket exists). The spec writer puts `spec.md` there. Then the plan step adds `plan.md`, which carries the size, and, for large work, a slim `tasks.md`, one line per task:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
- [ ] T1 <one-line task> [P] — PROJ-1235
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Sizing is decided in `plan.md`:
|
|
67
|
+
|
|
68
|
+
- **Small** (one or two steps): `spec.md` and `plan.md` only, no tickets.
|
|
69
|
+
- **Large**: `tasks.md` plus tickets, when your `AGENTS.md` documents a project management tool. Otherwise `tasks.md` only.
|
|
70
|
+
- **Unclear**: the orchestrator asks you at the plan gate.
|
|
71
|
+
|
|
72
|
+
## Gates
|
|
73
|
+
|
|
74
|
+
Every job stops twice, in every approval mode, before anything is ticketed or built:
|
|
75
|
+
|
|
76
|
+
1. **Spec gate** (`awaiting-spec`). You read the spec summary, the acceptance criteria count, each open `[PRODUCT DECISION]` item, and open questions. Answer every open decision before you confirm: answers go in your change request, are saved as `spec-<k>.md`, and the spec writer records each one as `[DECIDED]`.
|
|
77
|
+
2. **Plan gate** (`awaiting-plan`). You read the plan, the tasks, the size, the tracking proposal, and the build mode. Confirm, request changes (saved as `plan-<k>.md`), or change size, tracking, or build mode. Requests that touch the spec go back through the spec gate.
|
|
78
|
+
|
|
79
|
+
Session ended at a gate? `/factory start <job-id | slug | KEY>` shows that gate again. A job whose build has started resumes without the prompt. A job that stopped before its build because a spec or plan step failed reruns that step with `/factory start <job-id>`.
|
|
80
|
+
|
|
81
|
+
## Approval modes
|
|
82
|
+
|
|
83
|
+
- **`human`** (default). An approved job stops at `awaiting-human`. Read the branch and `qa.md`, then run `/factory approve <job-id>`.
|
|
84
|
+
- **`auto`**. An approved job merges automatically. The approver still escalates anything touching auth, payments, data security, deployment, migrations, email, production data, new dependencies, or unresolved product decisions. Its tickets stay In Review until you run `/factory approve <job-id>`, which then moves them to Done.
|
|
85
|
+
|
|
86
|
+
Any value other than exactly `auto` is treated as `human`.
|
|
87
|
+
|
|
88
|
+
## Build location
|
|
89
|
+
|
|
90
|
+
By default each job builds in its own git worktree on branch `factory/<id>`, so the main checkout stays free. A job's `job.json` records this in `worktree` (`true`) and the worktree path in `worktree_path`.
|
|
91
|
+
|
|
92
|
+
### In-place builds
|
|
93
|
+
|
|
94
|
+
Ask for an in-place build with `--in-place`, or by saying so at intake or at the plan gate. The build then runs in the main checkout, on branch `factory/<id>`.
|
|
95
|
+
|
|
96
|
+
- The job starts only when the main checkout is on the default branch with no tracked changes outside `docs/features/`, no other in-place job is open, and no worktree job holds its build location. Otherwise the job waits at the plan gate and says why.
|
|
97
|
+
- While the job is open, the main checkout stays on `factory/<id>`. Do not switch it until the job is merged or abandoned.
|
|
98
|
+
- The feature docs are committed on the branch when the build starts, so the main checkout has no tracked feature-doc changes to block a merge.
|
|
99
|
+
- The merge switches the main checkout back to the default branch and removes only the branch, not a worktree.
|
|
100
|
+
- A worktree job cannot merge while an in-place job holds its build location, and an in-place job cannot start while a worktree job holds one. Each refusal names the job in the way.
|
|
101
|
+
|
|
102
|
+
## Suggested checks (`qa.md`)
|
|
103
|
+
|
|
104
|
+
The builder writes `qa.md` in the feature folder, on the job's branch. It has how to run the feature (dev server, port, seed data, flags), numbered manual checks tied to acceptance criteria, and what the automated tests do not cover. When a job waits for you, the orchestrator prints it with the reviewers' `Not verified` items under the line `Suggested checks before /factory approve — not a gate`. It is a checklist. It never affects a verdict, and a missing `qa.md` is only noted.
|
|
105
|
+
|
|
106
|
+
## Tickets
|
|
107
|
+
|
|
108
|
+
When a job is tracked, its tickets follow it:
|
|
109
|
+
|
|
110
|
+
| Job event | Tickets |
|
|
111
|
+
| --- | --- |
|
|
112
|
+
| Build starts | In Progress |
|
|
113
|
+
| Review starts | In Review |
|
|
114
|
+
| You approve and the merge runs | Done |
|
|
115
|
+
| Job abandoned | Left as they are |
|
|
116
|
+
|
|
117
|
+
The parent and every sub-task move together. The orchestrator uses the project's status names, and asks once for them if it does not know them. A failed ticket update is recorded in the job and reported. It never blocks the pipeline.
|
|
118
|
+
|
|
119
|
+
## How a job runs
|
|
120
|
+
|
|
121
|
+
1. **Intake.** For `/factory <request>`, the orchestrator reads the project and asks only the glaring questions. You answer them, then choose to continue or change the answers. Nothing is created before you continue.
|
|
122
|
+
2. **Spec.** `factory-spec-writer` inspects the code and writes `spec.md` with numbered acceptance criteria.
|
|
123
|
+
3. **Spec gate.** You confirm the spec, or request changes.
|
|
124
|
+
4. **Plan.** `factory-spec-writer` in plan mode writes `plan.md` (with the size) and `tasks.md` for large work.
|
|
125
|
+
5. **Plan gate.** You confirm the plan, or request changes. Nothing is ticketed or built before you confirm.
|
|
126
|
+
6. **Tickets and build location.** If tracked, the parent and sub-tasks are created and their keys are written into `tasks.md`. The folder is renamed to carry the key. Then a builder gets its own git worktree on branch `factory/<id>`, or the in-place branch. The job's feature docs are committed on that branch.
|
|
127
|
+
7. **Build.** The builder follows TDD, ticks `tasks.md` as it completes tasks, writes `build.md`, and writes `qa.md`.
|
|
128
|
+
8. **Review.** Every configured lens reviews the branch, writing `round-N/review-<lens>.md` with `VERDICT: PASS` or `VERDICT: CHANGES`.
|
|
129
|
+
9. **Repair.** Any `CHANGES` sends the builder back to fix it. Two repairs at most, so three review rounds. Then the job escalates to you.
|
|
130
|
+
10. **Approve.** `factory-approver` writes `decision.md` with `APPROVE` or `ESCALATE`.
|
|
131
|
+
11. **Merge.** Local only, never pushed. `--no-ff` merge, the project's test command, then the worktree (if any) and branch are removed. Feature docs in the main checkout are set aside first (copies in `main-copies/`), so the merge brings in the branch's committed copies.
|
|
132
|
+
|
|
133
|
+
Jobs that escalate (`needs-human`) keep their branch and worktree so you can inspect them. Use `/factory rework` or `/factory approve` to continue.
|
|
134
|
+
|
|
135
|
+
## Abandon
|
|
136
|
+
|
|
137
|
+
`/factory abandon <job-id>` closes a job that will not continue. It merges nothing. The worktree and branch are removed only when the branch has no unmerged commits. Every job that reached its build keeps its branch and worktree, because its feature-docs commit is unmerged; review them and remove the branch yourself when you are done. Tickets stay where they are, and the report lists their keys. An abandoned job cannot be resumed: `/factory start <slug or KEY>` starts a new one.
|
|
138
|
+
|
|
139
|
+
## Archive
|
|
140
|
+
|
|
141
|
+
`/factory archive [--all] [--dry-run]` moves closed jobs (`merged` or `abandoned`) from `factory/jobs/` to `factory/archive/`. Open jobs never move. `npx nitm-ai-dev-toolkit factory archive` makes the same moves on its own. `/factory archive` runs it, then handles branches.
|
|
142
|
+
|
|
143
|
+
- By default, only jobs last updated more than 7 days ago move. `--all` moves every closed job.
|
|
144
|
+
- `--dry-run` lists what would move and moves nothing.
|
|
145
|
+
- Archived jobs cannot be resumed. `/factory start <archived-id>` says the job is closed. Their ids still count, so new job ids never repeat until a prune removes them.
|
|
146
|
+
- For each archived abandoned job whose branch still exists, the orchestrator asks once whether to delete the branch and its worktree. Nothing is deleted without your yes. Branches of merged jobs are only listed.
|
|
147
|
+
|
|
148
|
+
## Prune
|
|
149
|
+
|
|
150
|
+
`/factory prune [--all] [--abandoned] [--dry-run]` permanently deletes closed jobs from `factory/jobs/` and `factory/archive/`. By default only `merged` jobs are deleted; `--abandoned` also deletes `abandoned` jobs. The age rule is the same as archive: jobs last updated more than 7 days ago, and `--all` drops the age limit. The list comes first, and nothing is deleted until you confirm once in chat. A pruned job cannot be recovered. Open jobs and `docs/features/` are never touched.
|
|
151
|
+
|
|
152
|
+
Without `--abandoned`, abandoned jobs are kept and counted, and the flow offers to rerun with it. When abandoned jobs are pruned, each one whose branch still exists gets the same per-branch question as archive. Merged branches are only listed. `npx nitm-ai-dev-toolkit factory prune` lists by default; add `--yes` to delete (and `--abandoned` to include abandoned jobs).
|
|
153
|
+
|
|
154
|
+
## Layout
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
docs/features/ tracked by the project
|
|
158
|
+
<KEY>-<slug>/
|
|
159
|
+
spec.md
|
|
160
|
+
plan.md
|
|
161
|
+
tasks.md large work only
|
|
162
|
+
qa.md builder, on the branch: suggested checks (not a gate)
|
|
163
|
+
factory/
|
|
164
|
+
README.md this file
|
|
165
|
+
.gitignore ignores jobs/ and archive/
|
|
166
|
+
jobs/ runtime state (ignored by git)
|
|
167
|
+
<NNN-slug>/
|
|
168
|
+
job.json stage, round, reviews, size, tracking, worktree, failed_stage, approval mode
|
|
169
|
+
intake.md intake questions and answers (only when asked)
|
|
170
|
+
spec-<k>.md after a change request at the spec gate
|
|
171
|
+
plan-<k>.md after a change request at the plan gate
|
|
172
|
+
build.md
|
|
173
|
+
round-<N>/review-<lens>.md
|
|
174
|
+
decision.md
|
|
175
|
+
merge-conflict.md after a merge conflict; blocks approve
|
|
176
|
+
rework-<k>.md
|
|
177
|
+
main-copies/ feature docs moved aside at merge
|
|
178
|
+
archive/ closed jobs moved by /factory archive (ignored by git)
|
|
179
|
+
<NNN-slug>/ same layout as jobs/; never resumed
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Job folders are ignored by git. They are working state, not history. Copy one out if you want an audit trail.
|
|
183
|
+
|
|
184
|
+
Stages, in order: `spec`, `awaiting-spec`, `plan`, `awaiting-plan`, `build`, `review`, `approve`, `awaiting-human`, `merged`, `needs-human`. `abandoned` closes a job from any open stage.
|
|
185
|
+
|
|
186
|
+
## Limitations
|
|
187
|
+
|
|
188
|
+
- **Write boundaries are conventions.** Each agent is told which files it writes, but nothing enforces that. The real gates are the spec and plan gates, the reviewer verdicts, the approver's checks, and the merge preconditions and test run.
|
|
189
|
+
- **Harness behavior varies.** Parallel review and builder resume depend on the harness. If dispatch is background-only, the orchestrator polls for each file until a 15-minute default timeout (the request can set another). A timed-out agent is never re-dispatched: the job stops at `needs-human`. See Harness notes in [SKILL.md](../.agents/skills/factory/SKILL.md).
|
|
190
|
+
- **Local merge only.** The factory never pushes. Open a pull request yourself if you want review on a remote.
|
|
191
|
+
- **One job at a time per checkout** is the tested path. An in-place job also holds the main checkout until it merges or is abandoned.
|
|
192
|
+
- **UI lenses need a browser.** Without one they cannot verify anything and the job escalates.
|
|
193
|
+
- **Tickets are best-effort.** Creation failures stop at the plan gate. Transition failures are recorded and reported.
|
|
194
|
+
- **Live status:** run `npx nitm-ai-dev-toolkit factory watch` (live) or `factory status` (one-shot). Both read `jobs/*/job.json` from disk and hide closed jobs unless `--all` is passed. `factory archive` moves closed jobs, and `factory prune` deletes them. Nothing else changes files.
|