nitm-ai-dev-toolkit 4.0.0 → 5.0.1
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 +83 -1
- package/README.md +87 -11
- package/bin/cli.js +721 -84
- 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 +643 -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/assign-tasks.md +1 -0
- package/src/monorepo/.claude/commands/factory.md +24 -0
- package/src/monorepo/.claude/commands/ponytail-review.md +1 -1
- package/src/monorepo/.claude/prompt-snippets/assign-tasks.md +16 -2
- package/src/monorepo/.claude/prompt-snippets/bootstrap-patch.md +31 -24
- package/src/monorepo/.claude/prompt-snippets/bootstrap-upgrade.md +12 -13
- package/src/monorepo/.claude/prompt-snippets/bootstrap.md +30 -21
- package/src/monorepo/.claude/prompt-snippets/factory.md +20 -0
- package/src/monorepo/.claude/prompt-snippets/implement-feature.md +4 -2
- package/src/monorepo/.claude/prompt-snippets/tasks.md +49 -87
- package/src/monorepo/.claude/rules-snippets/documentation.md +8 -6
- package/src/monorepo/.claude/rules-snippets/subagent-workflow.md +2 -2
- 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/.opencode/agents/admin-portal.md +1 -1
- package/src/monorepo/.opencode/agents/api-specialist.md +1 -1
- package/src/monorepo/.opencode/agents/backend-architect.md +1 -1
- package/src/monorepo/.opencode/agents/documenter.md +1 -1
- 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 +1 -1
- package/src/monorepo/.opencode/agents/frontend-developer.md +1 -1
- package/src/monorepo/.opencode/agents/green.md +1 -1
- package/src/monorepo/.opencode/agents/implementer.md +1 -1
- package/src/monorepo/.opencode/agents/planner.md +1 -1
- package/src/monorepo/.opencode/agents/red.md +1 -1
- package/src/monorepo/.opencode/agents/refactor.md +1 -1
- package/src/monorepo/.opencode/agents/researcher.md +1 -1
- package/src/monorepo/.opencode/agents/reviewer.md +1 -1
- package/src/monorepo/.opencode/agents/tdd.md +1 -1
- package/src/monorepo/.opencode/commands/assign-tasks.md +1 -1
- package/src/monorepo/.opencode/commands/bootstrap-patch.md +1 -1
- package/src/monorepo/.opencode/commands/bootstrap-upgrade.md +1 -1
- package/src/monorepo/.opencode/commands/bootstrap.md +1 -1
- package/src/monorepo/.opencode/commands/commit-push.md +1 -1
- package/src/monorepo/.opencode/commands/constitution.md +1 -1
- package/src/monorepo/.opencode/commands/create-skill.md +1 -1
- package/src/monorepo/.opencode/commands/factory.md +29 -0
- package/src/monorepo/.opencode/commands/implement-feature.md +1 -1
- package/src/monorepo/.opencode/commands/implement-fixes.md +1 -1
- package/src/monorepo/.opencode/commands/implement.md +1 -1
- package/src/monorepo/.opencode/commands/plan.md +1 -1
- package/src/monorepo/.opencode/commands/playwright-test.md +1 -1
- package/src/monorepo/.opencode/commands/ponytail-audit.md +1 -1
- package/src/monorepo/.opencode/commands/ponytail-debt.md +1 -1
- package/src/monorepo/.opencode/commands/ponytail-gain.md +1 -1
- package/src/monorepo/.opencode/commands/ponytail-help.md +1 -1
- package/src/monorepo/.opencode/commands/ponytail-review.md +1 -1
- package/src/monorepo/.opencode/commands/ponytail.md +1 -1
- package/src/monorepo/.opencode/commands/release-notes.md +1 -1
- package/src/monorepo/.opencode/commands/review-pr.md +1 -1
- package/src/monorepo/.opencode/commands/review.md +1 -1
- package/src/monorepo/.opencode/commands/specify.md +1 -1
- package/src/monorepo/.opencode/commands/tasks.md +1 -1
- package/src/monorepo/.opencode/opencode.jsonc +1 -2
- package/src/monorepo/.opencode/rules/agent-conduct.md +1 -1
- package/src/monorepo/.opencode/rules/api-server.md +1 -1
- package/src/monorepo/.opencode/rules/coding-standards.md +1 -1
- package/src/monorepo/.opencode/rules/component-structure.md +1 -1
- package/src/monorepo/.opencode/rules/core-libraries.md +1 -1
- package/src/monorepo/.opencode/rules/environment-tooling.md +1 -1
- package/src/monorepo/.opencode/rules/logging-comments.md +1 -1
- package/src/monorepo/.opencode/rules/logging.md +1 -1
- package/src/monorepo/.opencode/rules/prisma-migrations.md +1 -1
- package/src/monorepo/.opencode/rules/project-context.md +1 -1
- package/src/monorepo/.opencode/rules/server-client-separation.md +1 -1
- package/src/monorepo/.opencode/rules/subagent-workflow.md +1 -1
- package/src/monorepo/.opencode/rules/testing-quality.md +1 -1
- package/src/monorepo/.opencode/rules/ui-accessibility.md +1 -1
- package/src/monorepo/.opencode/rules/version-control.md +1 -1
- package/src/monorepo/.opencode/rules/what-to-avoid.md +1 -1
- package/src/monorepo/AGENTS.md +25 -4
- package/src/monorepo/README.md +10 -4
- package/src/monorepo/factory/README.md +219 -0
- package/src/monorepo/factory/_gitignore +5 -0
- package/src/monorepo/factory/worktree-bootstrap.md +32 -0
- package/src/repo/.agents/skills/factory/SKILL.md +643 -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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/repo/.claude/agents/reviewer.agent.md +1 -1
- 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/assign-tasks.md +1 -0
- package/src/repo/.claude/commands/factory.md +24 -0
- package/src/repo/.claude/commands/ponytail-review.md +1 -1
- package/src/repo/.claude/prompt-snippets/assign-tasks.md +16 -2
- package/src/repo/.claude/prompt-snippets/bootstrap-patch.md +31 -24
- package/src/repo/.claude/prompt-snippets/bootstrap-upgrade.md +16 -16
- package/src/repo/.claude/prompt-snippets/bootstrap.md +38 -28
- package/src/repo/.claude/prompt-snippets/factory.md +20 -0
- package/src/repo/.claude/prompt-snippets/implement-feature.md +4 -2
- package/src/repo/.claude/prompt-snippets/tasks.md +49 -112
- package/src/repo/.claude/rules-snippets/subagent-workflow.md +2 -2
- 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 +1 -1
- package/src/repo/.opencode/agents/api-specialist.md +1 -1
- package/src/repo/.opencode/agents/backend-architect.md +1 -1
- package/src/repo/.opencode/agents/documenter.md +1 -1
- 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 +1 -1
- package/src/repo/.opencode/agents/frontend-developer.md +1 -1
- package/src/repo/.opencode/agents/green.md +1 -1
- package/src/repo/.opencode/agents/implementer.md +1 -1
- package/src/repo/.opencode/agents/planner.md +1 -1
- package/src/repo/.opencode/agents/red.md +1 -1
- package/src/repo/.opencode/agents/refactor.md +1 -1
- package/src/repo/.opencode/agents/researcher.md +1 -1
- package/src/repo/.opencode/agents/reviewer.md +1 -1
- package/src/repo/.opencode/agents/tdd.md +1 -1
- package/src/repo/.opencode/commands/assign-tasks.md +1 -1
- package/src/repo/.opencode/commands/bootstrap-patch.md +1 -1
- package/src/repo/.opencode/commands/bootstrap-upgrade.md +1 -1
- package/src/repo/.opencode/commands/bootstrap.md +1 -1
- package/src/repo/.opencode/commands/commit-push.md +1 -1
- package/src/repo/.opencode/commands/constitution.md +1 -1
- package/src/repo/.opencode/commands/create-skill.md +1 -1
- package/src/repo/.opencode/commands/factory.md +29 -0
- package/src/repo/.opencode/commands/implement-feature.md +1 -1
- package/src/repo/.opencode/commands/implement-fixes.md +1 -1
- package/src/repo/.opencode/commands/implement.md +1 -1
- package/src/repo/.opencode/commands/plan.md +1 -1
- package/src/repo/.opencode/commands/playwright-test.md +1 -1
- package/src/repo/.opencode/commands/ponytail-audit.md +1 -1
- package/src/repo/.opencode/commands/ponytail-debt.md +1 -1
- package/src/repo/.opencode/commands/ponytail-gain.md +1 -1
- package/src/repo/.opencode/commands/ponytail-help.md +1 -1
- package/src/repo/.opencode/commands/ponytail-review.md +1 -1
- package/src/repo/.opencode/commands/ponytail.md +1 -1
- package/src/repo/.opencode/commands/release-notes.md +1 -1
- package/src/repo/.opencode/commands/review-pr.md +1 -1
- package/src/repo/.opencode/commands/review.md +1 -1
- package/src/repo/.opencode/commands/specify.md +1 -1
- package/src/repo/.opencode/commands/tasks.md +1 -1
- package/src/repo/.opencode/opencode.jsonc +1 -2
- package/src/repo/.opencode/rules/agent-conduct.md +1 -1
- package/src/repo/.opencode/rules/api-server.md +1 -1
- package/src/repo/.opencode/rules/coding-standards.md +1 -1
- package/src/repo/.opencode/rules/component-structure.md +1 -1
- package/src/repo/.opencode/rules/core-libraries.md +1 -1
- package/src/repo/.opencode/rules/environment-tooling.md +1 -1
- package/src/repo/.opencode/rules/logging-comments.md +1 -1
- package/src/repo/.opencode/rules/logging.md +1 -1
- package/src/repo/.opencode/rules/prisma-migrations.md +1 -1
- package/src/repo/.opencode/rules/project-context.md +1 -1
- package/src/repo/.opencode/rules/server-client-separation.md +1 -1
- package/src/repo/.opencode/rules/subagent-workflow.md +1 -1
- package/src/repo/.opencode/rules/testing-quality.md +1 -1
- package/src/repo/.opencode/rules/ui-accessibility.md +1 -1
- package/src/repo/.opencode/rules/version-control.md +1 -1
- package/src/repo/.opencode/rules/what-to-avoid.md +1 -1
- package/src/repo/AGENTS.md +22 -4
- package/src/repo/README.md +10 -4
- package/src/repo/factory/README.md +213 -0
- package/src/repo/factory/_gitignore +5 -0
- package/src/repo/factory/worktree-bootstrap.md +32 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Factory Spec Writer
|
|
2
|
+
|
|
3
|
+
You turn a feature request into a testable spec, and then into a plan. You are one agent in the [factory](../../.agents/skills/factory/SKILL.md) pipeline. You work from the paths block the orchestrator gives you. The task line names your mode: **spec** or **plan**.
|
|
4
|
+
|
|
5
|
+
## Inputs
|
|
6
|
+
|
|
7
|
+
Read these, in this order:
|
|
8
|
+
|
|
9
|
+
1. The feature request in your prompt.
|
|
10
|
+
2. The project's `AGENTS.md` (conventions and commands).
|
|
11
|
+
3. The existing code the feature touches. Inspect it. Do not write a spec or plan from the request alone.
|
|
12
|
+
4. [Feature spec template](../../templates/feature-spec.template.md) for the section structure.
|
|
13
|
+
5. Any existing `spec.md`, `plan.md`, and `tasks.md` in the feature folder, and the change note the orchestrator gave you (`spec-<k>.md` in spec mode, `plan-<k>.md` in plan mode). Update them, do not start over blind.
|
|
14
|
+
6. `intake.md` in the job folder, if the paths block lists it: the operator's answers to the intake questions. They clarify the request and win over the request text where they conflict.
|
|
15
|
+
|
|
16
|
+
## Spec mode
|
|
17
|
+
|
|
18
|
+
You write `spec.md` in the feature folder (paths block). Nothing else.
|
|
19
|
+
|
|
20
|
+
Use this skeleton, keeping the template's section order and dropping sections that do not apply (Timeline, References, Changelog):
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
# Feature Specification: <short title>
|
|
24
|
+
|
|
25
|
+
## Summary
|
|
26
|
+
|
|
27
|
+
One paragraph: what changes for whom.
|
|
28
|
+
|
|
29
|
+
## Background
|
|
30
|
+
|
|
31
|
+
- **Problem:** what is wrong or missing today.
|
|
32
|
+
- **Current behavior:** what the code does now, with file references.
|
|
33
|
+
|
|
34
|
+
## Requirements
|
|
35
|
+
|
|
36
|
+
- **FR-1:** The system shall ...
|
|
37
|
+
- **FR-2:** ...
|
|
38
|
+
|
|
39
|
+
## Acceptance Criteria
|
|
40
|
+
|
|
41
|
+
Numbered, each one testable by a command or an observable step.
|
|
42
|
+
|
|
43
|
+
- **AC-1:** Given ..., when ..., then ... (verify: `<command or step>`)
|
|
44
|
+
- **AC-2:** ...
|
|
45
|
+
|
|
46
|
+
## Affected Code
|
|
47
|
+
|
|
48
|
+
- `path/to/file`: why it changes
|
|
49
|
+
|
|
50
|
+
## Out of Scope
|
|
51
|
+
|
|
52
|
+
- ...
|
|
53
|
+
|
|
54
|
+
## Assumptions
|
|
55
|
+
|
|
56
|
+
- Technical assumption: ...
|
|
57
|
+
- **[PRODUCT DECISION]** Assumption that a person must decide: ... (options: ...)
|
|
58
|
+
|
|
59
|
+
## Open Questions
|
|
60
|
+
|
|
61
|
+
- ... (or "None")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Rules for the spec:
|
|
65
|
+
|
|
66
|
+
- Every acceptance criterion must be testable. Name the check (a test, a command, or an observable UI step). "Works well" is not testable.
|
|
67
|
+
- Acceptance criteria are numbered `AC-n`, and requirements are numbered `FR-n`. Builders and reviewers refer to these numbers.
|
|
68
|
+
- Keep scope to what the request asks. Put tempting extras under Out of Scope.
|
|
69
|
+
- An assumption that a product owner should decide is flagged `[PRODUCT DECISION]`. Do not decide it silently. The spec gate collects the operator's answer, and the approver escalates only on `[PRODUCT DECISION]` items still open in the spec.
|
|
70
|
+
- Prefer the smallest spec that covers the request. Ponytail applies to specs too: if the request is already one line of code, say so in Summary and keep the rest short.
|
|
71
|
+
- Do not write a size line or a plan in the spec. Sizing happens in plan mode.
|
|
72
|
+
|
|
73
|
+
## Plan mode
|
|
74
|
+
|
|
75
|
+
You write `plan.md` in the feature folder, and `tasks.md` for large work. Nothing else. Do not change `spec.md`.
|
|
76
|
+
|
|
77
|
+
`plan.md` is concise. Use this skeleton:
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
# Plan: <short title>
|
|
81
|
+
|
|
82
|
+
**Size:** small — one line of reason. (The word after `Size:` is exactly one of `small`, `large`, or `unclear`.)
|
|
83
|
+
|
|
84
|
+
## Approach
|
|
85
|
+
|
|
86
|
+
Short: how the change is built, and which files it touches.
|
|
87
|
+
|
|
88
|
+
## Steps
|
|
89
|
+
|
|
90
|
+
1. <step, in build order>
|
|
91
|
+
2. ...
|
|
92
|
+
|
|
93
|
+
## Checks
|
|
94
|
+
|
|
95
|
+
- AC-n: <test or command that proves it>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Sizing: **small** is one or two steps, so write no `tasks.md` and delete a stale one. **Large** has more steps than that, so write `tasks.md`. **Unclear** means you cannot tell from the spec and the code. Say why in the Size line; the operator decides at the plan gate.
|
|
99
|
+
|
|
100
|
+
`tasks.md` (large only) is a slim list, one line per task, with no per-task sections:
|
|
101
|
+
|
|
102
|
+
```markdown
|
|
103
|
+
# Tasks: <KEY-or-slug>
|
|
104
|
+
- [ ] T1 <one-line task>
|
|
105
|
+
- [ ] T2 <one-line task> [P]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Number tasks `T1`, `T2`, and so on in build order. Add `[P]` only to tasks that can run in parallel. Do not write ticket keys; the orchestrator adds them at tracking.
|
|
109
|
+
|
|
110
|
+
On a re-plan, keep each existing task line that still applies, with its T-number, its text, and any ` — <KEY>` suffix, unchanged. Match a kept task by its T-number and text. Number new tasks after the highest existing number. A line that already has a ticket key keeps it, because that ticket exists.
|
|
111
|
+
|
|
112
|
+
## Rules
|
|
113
|
+
|
|
114
|
+
- A change note with `spec-<k>.md` or `plan-<k>.md` is the operator's request. Apply it, and keep everything else the operator already accepted.
|
|
115
|
+
- When a change note answers a `[PRODUCT DECISION]` item, rewrite that item to start with `[DECIDED]` and the operator's answer, for example `[DECIDED] Free tier: 3 seats.`. Items the note does not answer stay `[PRODUCT DECISION]`. Never mark an item decided yourself.
|
|
116
|
+
- Keep `spec.md` and `plan.md` free of tooling chatter. They are feature docs that merge with the code.
|
|
117
|
+
- Do not modify code, tests, `build.md`, `job.json`, `qa.md`, or any file outside the feature folder. Your writes are `spec.md` (spec mode), or `plan.md` and `tasks.md` (plan mode), in the feature folder only.
|
|
@@ -34,7 +34,7 @@ For each feature request:
|
|
|
34
34
|
|
|
35
35
|
When dispatching a specialist subagent, provide:
|
|
36
36
|
|
|
37
|
-
1. Full task description and acceptance criteria
|
|
37
|
+
1. Full task description (the `tasks.md` line) and the acceptance criteria from `spec.md` that it covers
|
|
38
38
|
2. Relevant file paths and patterns from the codebase
|
|
39
39
|
3. Related tasks already completed (for context)
|
|
40
40
|
4. Testing expectations
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run an opt-in factory job: intake, spec and plan gates, build in a worktree or in place, reviews, approval, merge (local, or a merge request on the forge)"
|
|
3
|
+
allowed-tools: "Read, Grep, Glob, Write, Edit, Bash(*), agent"
|
|
4
|
+
argument-hint: "[--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]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Factory
|
|
8
|
+
|
|
9
|
+
## Agent Dispatch
|
|
10
|
+
> **Run in the main session.** The orchestrator dispatches these agents; they cannot dispatch others.
|
|
11
|
+
|
|
12
|
+
| Agent | When to use |
|
|
13
|
+
|-------|-------------|
|
|
14
|
+
| `factory-spec-writer` | Spec stage (`spec` mode) writes `spec.md`; plan stage (`plan` mode) writes `plan.md` and `tasks.md` |
|
|
15
|
+
| `factory-builder` | Build, repair, and rework: writes `build.md` in the job folder; its code goes in the build location |
|
|
16
|
+
| `factory-reviewer-code` | Review round, `code` lens |
|
|
17
|
+
| `factory-reviewer-security` | Review round, `security` lens |
|
|
18
|
+
| `factory-reviewer-ux` | Review round, `ux` lens (opt-in) |
|
|
19
|
+
| `factory-reviewer-ui` | Review round, `ui` lens (opt-in) |
|
|
20
|
+
| `factory-approver` | Approval gate: writes `decision.md` |
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
Follow the prompt defined in [.claude/prompt-snippets/factory.md](../prompt-snippets/factory.md).
|
|
@@ -50,9 +50,17 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
|
|
|
50
50
|
1. **Parse Document**:
|
|
51
51
|
- Load the specified document (.md, .txt, .json)
|
|
52
52
|
- Detect document structure (headers, lists, task categories)
|
|
53
|
-
-
|
|
53
|
+
- For `tasks.md`, detect the format first:
|
|
54
|
+
- **Slim** (has `- [ ] T<n>` or `- [x] T<n>` lines): each such line is one task. The text after the ID is the summary. Sub-bullets, if any, are subtasks. A line already has a ticket only when it ends with ` — {{PROJECT_KEY}}-<digits>`; skip it then. Any other ` — ` suffix (e.g. ` — depends on T3`) is a note, not a key: keep the line
|
|
55
|
+
- **Legacy** (no slim lines; has `#{2,4} T<n>` headings, e.g. `## T01`, `### T001`): each `T<n>` heading is one task. Checkboxes beneath it are subtasks: put them in the ticket description, never as separate tickets. Skip a heading that contains `{{PROJECT_KEY}}-<digits>` anywhere (e.g. `## T001 (PROJ-256): …`); it already has a ticket
|
|
56
|
+
- **Mixed** (slim lines and legacy headings): treat as slim and say in the report that the headings were ignored
|
|
57
|
+
- **Neither**: treat as a requirement document
|
|
58
|
+
- Keys are always `{{PROJECT_KEY}}-<digits>`. Nothing else counts as a key
|
|
59
|
+
- For requirement documents: extract task hierarchy: Epic → Story → Task → Subtask
|
|
54
60
|
|
|
55
61
|
2. **Consolidate First** (BEFORE creating tickets):
|
|
62
|
+
- **A slim `tasks.md` from `/tasks` is pre-consolidated**: one line = one ticket. Only merge lines that are clearly one deliverable; do not re-split them
|
|
63
|
+
- **A legacy `tasks.md` is not pre-consolidated**: one heading = one ticket. Never merge or re-split headings. If the count exceeds the Maximum Ticket Counts, stop and ask before creating anything
|
|
56
64
|
- **Group related items** by component, feature area, or deliverable
|
|
57
65
|
- **Merge small tasks** (< 2 SP) into related larger tasks
|
|
58
66
|
- **Eliminate redundant subtasks** that are obvious steps
|
|
@@ -64,7 +72,7 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
|
|
|
64
72
|
- **Task**: Implementation work, 2-8 story points (avoid < 2 SP)
|
|
65
73
|
- **Subtask**: Only for complex tasks, 1-3 story points (use sparingly)
|
|
66
74
|
|
|
67
|
-
4. **Estimate Effort
|
|
75
|
+
4. **Estimate Effort** (`tasks.md` has no effort field: take hours from `plan.md` for the matching work, or estimate from the scope in `spec.md`):
|
|
68
76
|
- 0.5-1 hours → **Merge with related task** (too small alone)
|
|
69
77
|
- 2-3 hours → 2 story points
|
|
70
78
|
- 4-6 hours → 3-5 story points
|
|
@@ -76,9 +84,13 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
|
|
|
76
84
|
- Link child issues to parents
|
|
77
85
|
- Set assignees, labels, and story points
|
|
78
86
|
- Create dependency links where noted
|
|
87
|
+
- Ticket description: the task summary plus the acceptance criteria from `spec.md` for that deliverable
|
|
88
|
+
- **Slim `tasks.md`**: append ` — <KEY>` at the end of the task's line, after any notes (`- [ ] T1 Schema + migration — PROJ-124`)
|
|
89
|
+
- **Legacy `tasks.md`**: never write back. Record heading → ticket key in the report instead
|
|
79
90
|
|
|
80
91
|
6. **Generate Report**:
|
|
81
92
|
- List all created tickets with IDs
|
|
93
|
+
- **Legacy `tasks.md`**: heading → ticket key mapping, plus headings skipped because they already had a key
|
|
82
94
|
- Show hierarchy and relationships
|
|
83
95
|
- Report total story points
|
|
84
96
|
- **Consolidation summary**: "Merged X raw items into Y tickets"
|
|
@@ -149,6 +161,8 @@ Creating tickets...
|
|
|
149
161
|
|
|
150
162
|
## Document Format Support
|
|
151
163
|
|
|
164
|
+
**Legacy `tasks.md` worked example**: a file with 45 `## T<n>` / `### T<n>` headings and 266 checkboxes plans **45 tickets**, not 266. Each ticket's description lists that heading's checkboxes. If 2 headings already carry a `{{PROJECT_KEY}}-<digits>` key, plan 43. Do not modify the file; report the heading → key mapping.
|
|
165
|
+
|
|
152
166
|
**Markdown Headers**:
|
|
153
167
|
|
|
154
168
|
```markdown
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Bootstrap Patch
|
|
2
2
|
|
|
3
|
-
Fetch
|
|
3
|
+
Fetch the published toolkit templates for the target version (4.0.0 or later) from npm or the ai-assisted-dev-toolkit repository's `<version>` git tag, and merge updated, new, or missing guidance into this project.
|
|
4
4
|
|
|
5
5
|
## OpenCode version preflight (before any changes)
|
|
6
6
|
|
|
7
7
|
- Confirm OpenCode use from actual session/runtime evidence or ask the user; directory presence alone is not proof. If only other harnesses are used, skip this preflight and all OpenCode steps.
|
|
8
|
-
- For confirmed OpenCode use, run `opencode --version` before any project writes. Trim output and parse numeric major/minor/patch components, accepting an optional leading `v`; toolkit 4.
|
|
9
|
-
- If OpenCode V1 (`major < 2`) is detected, **STOP** before customizing/migrating OpenCode files or writing `.toolkit-version` as
|
|
8
|
+
- For confirmed OpenCode use, run `opencode --version` before any project writes. Trim output and parse numeric major/minor/patch components, accepting an optional leading `v`; toolkit 4.0.0 and later require `major >= 2`.
|
|
9
|
+
- If OpenCode V1 (`major < 2`) is detected, **STOP** before customizing/migrating OpenCode files or writing `.toolkit-version` as 4.0.0 or later. Ask the user to upgrade OpenCode to V2 or remain on toolkit 3.x.
|
|
10
10
|
- If the CLI is missing, fails, or output is unparseable, **STOP OpenCode steps** and leave the version marker unchanged; ask the user to confirm/install a supported OpenCode version, then rerun this check. Never assume V2.
|
|
11
11
|
- If oh-my-opencode-slim >=3.0.0 is used or planned, require OpenCode >=2.0.7 (compare version components numerically); otherwise **STOP** before changes and ask to upgrade. Proceed only after this gate passes.
|
|
12
12
|
|
|
@@ -25,6 +25,8 @@ Fetch supported toolkit v4.x templates from the ai-assisted-dev-toolkit reposito
|
|
|
25
25
|
/bootstrap-patch --category commands,prompts
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
The CLI runs the same patch flow without an AI session: `npx nitm-ai-dev-toolkit patch --dry-run` previews changes, `--only <categories>` and `--exclude <categories>` narrow the scope, and `npx nitm-ai-dev-toolkit upgrade@<version>` (or `--version <version>`) pins the target version. Pinning a version does not skip the gates in Step 1.
|
|
29
|
+
|
|
28
30
|
## Process
|
|
29
31
|
|
|
30
32
|
**Codex invocation and scope:** `/bootstrap-patch` is not a native Codex command. Ask Codex to read and follow this snippet as a task document. Identify the actual harness from session/runtime evidence or ask; scaffold directories do not prove use. Codex targets `AGENTS.md`, relevant nested instructions, `.agents/skills/`, and optional `.codex/config.toml`. Include `.github/instructions/` and `.claude/rules-snippets/` solely as AGENTS-linked standards and their wrapper sources for Codex-scoped installs, not automatically loaded rules or evidence of Copilot/Claude use. Only include other harness command, agent, and config categories when those harnesses are confirmed in use.
|
|
@@ -33,33 +35,38 @@ Fetch supported toolkit v4.x templates from the ai-assisted-dev-toolkit reposito
|
|
|
33
35
|
|
|
34
36
|
1. **Fetch Latest Templates**:
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
**Resolve versions before any download.**
|
|
39
|
+
- **Installed version**: read `.toolkit-version` in the project root. If it is missing or unparseable, **STOP** and ask the user to confirm the installed version; absence alone does not prove a pre-3.0 installation.
|
|
40
|
+
- **Target version**: use the version the user pinned (`upgrade@<version>` or `--version <version>` in the CLI, or the version given to this task), validated as SemVer `X.Y.Z`. Otherwise use the latest published version from `npm view nitm-ai-dev-toolkit version`. If npm is unreachable or the output is unparseable, **STOP** and ask. Never guess a version.
|
|
41
|
+
|
|
42
|
+
**Fetch the matching release.** Try Option A first and use Option B only if `npm pack` fails (for example, the version is not on npm). Each download goes into a new, empty directory:
|
|
37
43
|
|
|
38
44
|
```bash
|
|
39
45
|
set -e
|
|
40
|
-
TOOLKIT_TEMP=$(mktemp -d)
|
|
41
|
-
|
|
46
|
+
TOOLKIT_TEMP=$(mktemp -d) # removed in step 6
|
|
47
|
+
mkdir "$TOOLKIT_TEMP/pack" "$TOOLKIT_TEMP/unpacked"
|
|
48
|
+
# Option A (preferred): the published package, the same artifact users install
|
|
49
|
+
if (cd "$TOOLKIT_TEMP/pack" && npm pack "nitm-ai-dev-toolkit@<version>"); then
|
|
50
|
+
tar -xzf "$TOOLKIT_TEMP/pack/nitm-ai-dev-toolkit-<version>.tgz" -C "$TOOLKIT_TEMP/unpacked"
|
|
51
|
+
SOURCE_ROOT="$TOOLKIT_TEMP/unpacked/package"
|
|
52
|
+
else
|
|
53
|
+
# Option B (fallback): the git tag for that release (tags have no "v" prefix)
|
|
54
|
+
git clone --depth 1 --branch "<version>" https://github.com/ninjasitm/ai-assisted-dev-toolkit.git "$TOOLKIT_TEMP/git"
|
|
55
|
+
SOURCE_ROOT="$TOOLKIT_TEMP/git"
|
|
56
|
+
fi
|
|
42
57
|
```
|
|
43
58
|
|
|
44
|
-
**Source availability gate:** If the clone
|
|
59
|
+
**Source availability gate:** If both `npm pack` and the tag clone fail (the version is unpublished and the tag is missing), **STOP** before diff/apply/version marking. Do not fall back to the default branch, another version, or an older major, and do not publish anything to unblock this task; ask for an available source version.
|
|
45
60
|
|
|
46
|
-
Determine the correct source path based on project structure
|
|
47
|
-
- **Single repo**:
|
|
48
|
-
- **Monorepo**:
|
|
61
|
+
Determine the correct source path based on project structure, under `$SOURCE_ROOT`:
|
|
62
|
+
- **Single repo**: `$SOURCE_ROOT/src/repo/`
|
|
63
|
+
- **Monorepo**: `$SOURCE_ROOT/src/monorepo/`
|
|
49
64
|
|
|
50
65
|
Detection heuristic:
|
|
51
66
|
- If `apps/` and `packages/` directories exist at root → monorepo
|
|
52
67
|
- Otherwise → single repo
|
|
53
68
|
|
|
54
|
-
**
|
|
55
|
-
|
|
56
|
-
Check for a `.toolkit-version` file in the project root:
|
|
57
|
-
- If exists: Read the version string (e.g., `2.0.10`, `3.0.0`)
|
|
58
|
-
- If missing: Verify the installed version or legacy state with the user; absence alone does not prove a pre-3.0 installation
|
|
59
|
-
|
|
60
|
-
Read the toolkit's version from the `version` field in `$TOOLKIT_TEMP/package.json` to compare; `.toolkit-version` tracks the target project's installed version.
|
|
61
|
-
|
|
62
|
-
**Source version guard (before diff/apply/version marking):** Parse source/target versions as SemVer and compare them (major/minor/patch numerically). If the fetched package's major is not `4`, or its version is older than the target `.toolkit-version`, **STOP** without diffing, applying changes, or updating the marker. Unknown/unparseable versions must also **STOP** and ask rather than guess. Never auto-downgrade.
|
|
69
|
+
**Source version gate (before diff/apply/version marking):** Read the `version` field in `$SOURCE_ROOT/package.json` and parse it as SemVer. The fetched version must equal the target version exactly, its major must be greater than or equal to the installed major from `.toolkit-version`, and it must not be older than the installed `.toolkit-version`. If any check fails, or a version is unknown or unparseable, **STOP** without diffing, applying changes, or updating the marker. Never auto-downgrade, and never hard-code a major.
|
|
63
70
|
|
|
64
71
|
**Version Comparison:**
|
|
65
72
|
- **Same version**: No structural changes expected
|
|
@@ -102,9 +109,9 @@ Fetch supported toolkit v4.x templates from the ai-assisted-dev-toolkit reposito
|
|
|
102
109
|
|
|
103
110
|
- Use `agents`/`system`, `request.body.temperature`, ordered `permissions` (`action`/`resource`/`effect`, `shell`/`subagent`, last match wins), `commands`/`subagent`, `plugins` with `{ "package": "…", "options": {} }`, skill-directory arrays, and `mcp.servers` with inverse `disabled` and `timeout.catalog`/`timeout.execution`.
|
|
104
111
|
- The version preflight must pass before changes. Back up V1 before native conversion (converted files are incompatible with V1). Preserve models/providers/user-global plugins. Only with approval, merge `"plugins": ["oh-my-opencode-slim@3.0.0"]` locally. Slim's separate strict schema keeps `prompt`/`permission`/`variant`; do not host-migrate it or silently upgrade the separate external starter.
|
|
105
|
-
- **Ponytail
|
|
106
|
-
- `instructions` entries
|
|
107
|
-
- `--env opencode` supplies minimal shared references without other harness activation. Activate on the next run/restart and report only installed-V2 checks actually run, not assumed runtime validation.
|
|
112
|
+
- **Obsolete Ponytail cleanup (plan here; apply after backup and approval in Step 5):** Remove only known obsolete toolkit-owned `.opencode/plugins/ponytail.js`, `.opencode/plugins/ponytail.mjs`, and `.opencode/plugins/ponytail.ts` copies. Preserve unrelated local plugins. The OpenCode Ponytail plugin is installed globally by the operator; never add it to project config. If it is not installed globally, tell the operator to install it globally. Do not edit global config. Keep `opentmux` commented as V1-only. Do not port local APIs or add bridges; runtime integration is untested.
|
|
113
|
+
- Ambient `AGENTS.md` works. `instructions` entries load only when the runtime injects them (OpenChamber does; other hosts may not), so do not rely on them: write explicit "Read and follow" wrappers regardless. `@refs` are ordinary text: explicitly read snippets. `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).
|
|
114
|
+
- `--env opencode` supplies minimal shared references without other harness activation. Activate on the next run/restart and report only installed-V2 checks actually run, not assumed runtime validation.
|
|
108
115
|
|
|
109
116
|
3. **Diff Analysis** (parallelizable — dispatch one subagent per category):
|
|
110
117
|
|
|
@@ -175,8 +182,8 @@ Fetch supported toolkit v4.x templates from the ai-assisted-dev-toolkit reposito
|
|
|
175
182
|
a. **New files**: Copy directly from template
|
|
176
183
|
b. **Updated files (no customization)**: Replace with template version
|
|
177
184
|
c. **Updated files (customized)**: Apply structural additions while preserving project values
|
|
178
|
-
d. **OpenCode plugins**: Apply only the approved Ponytail
|
|
179
|
-
e. **Toolkit version**:
|
|
185
|
+
d. **OpenCode plugins**: Apply only the approved obsolete Ponytail cleanup above after backing up the known obsolete toolkit copies and local config; preserve all unrelated local/global plugins. Never add Ponytail to project config.
|
|
186
|
+
e. **Toolkit version**: Keep the `.toolkit-version` value the CLI writes for the verified target version (the installed package version, 4.0.0 or later; never hard-coded) only after the approved migration and OpenCode preflight pass (or OpenCode is confirmed out of scope).
|
|
180
187
|
f. **Git commit**: Stage and commit all changes with message:
|
|
181
188
|
```bash
|
|
182
189
|
git add -A
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# Bootstrap Upgrade to
|
|
1
|
+
# Bootstrap Upgrade to toolkit <version>
|
|
2
2
|
|
|
3
|
-
Upgrade to toolkit
|
|
3
|
+
Upgrade to toolkit <version> (the installed package version), including native OpenCode V2 for confirmed OpenCode users (toolkit 4.0.0 and later). For pre-3.0 installations, also migrate inline content to snippet-based architecture and clean up duplicate skills. Only modify confirmed harness targets; preserve unrelated harness/Codex behavior.
|
|
4
4
|
|
|
5
5
|
## OpenCode version preflight (before any changes)
|
|
6
6
|
|
|
7
7
|
- Confirm OpenCode use from actual session/runtime evidence or ask the user; directory presence alone is not proof. If only other harnesses are used, skip this preflight and all OpenCode steps.
|
|
8
|
-
- For confirmed OpenCode use, run `opencode --version` before any project writes. Trim output and parse numeric major/minor/patch components, accepting an optional leading `v`; toolkit 4.
|
|
9
|
-
- If OpenCode V1 (`major < 2`) is detected, **STOP** before customizing/migrating OpenCode files or writing `.toolkit-version` as
|
|
8
|
+
- For confirmed OpenCode use, run `opencode --version` before any project writes. Trim output and parse numeric major/minor/patch components, accepting an optional leading `v`; toolkit 4.0.0 and later require `major >= 2`.
|
|
9
|
+
- If OpenCode V1 (`major < 2`) is detected, **STOP** before customizing/migrating OpenCode files or writing `.toolkit-version` as 4.0.0 or later. Ask the user to upgrade OpenCode to V2 or remain on toolkit 3.x.
|
|
10
10
|
- If the CLI is missing, fails, or output is unparseable, **STOP OpenCode steps** and leave the version marker unchanged; ask the user to confirm/install a supported OpenCode version, then rerun this check. Never assume V2.
|
|
11
11
|
- If oh-my-opencode-slim >=3.0.0 is used or planned, require OpenCode >=2.0.7 (compare version components numerically); otherwise **STOP** before changes and ask to upgrade. Proceed only after this gate passes.
|
|
12
12
|
|
|
@@ -21,7 +21,7 @@ Read `.toolkit-version` and select the route before dispatching agents or changi
|
|
|
21
21
|
|
|
22
22
|
## OpenCode migration guardrails
|
|
23
23
|
|
|
24
|
-
Back up V1; native-converted files are incompatible with V1. Preserve models/providers/user-global plugins.
|
|
24
|
+
Back up V1; native-converted files are incompatible with V1. Preserve models/providers/user-global plugins. The OpenCode Ponytail plugin (`@dietrichgebert/ponytail`) is installed globally by the operator and is never registered by templates or project config; obsolete toolkit-local Ponytail copies are removed only after backup and approval (Step 7), with no API port or bridge. Keep `opentmux` commented as V1-only. Only with approval, merge pinned `"plugins": ["oh-my-opencode-slim@3.0.0"]` locally without replacing other registrations. Slim's separate strict schema retains `prompt`/`permission`/`variant`; do not host-migrate it or silently upgrade the separate external starter. Activate on the next run/restart; plugin/runtime integration is untested.
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
@@ -56,7 +56,7 @@ Run all checks before making any changes:
|
|
|
56
56
|
3. **Confirm migration scope**:
|
|
57
57
|
|
|
58
58
|
```markdown
|
|
59
|
-
## 🔄 Bootstrap Upgrade: toolkit
|
|
59
|
+
## 🔄 Bootstrap Upgrade: toolkit <version>
|
|
60
60
|
|
|
61
61
|
**Project type**: repo | monorepo
|
|
62
62
|
**Current version**: <version or "none (legacy)">
|
|
@@ -68,7 +68,7 @@ Run all checks before making any changes:
|
|
|
68
68
|
2. Confirmed OpenCode only: merge native V2 host files and approved missing wrappers (Step 7)
|
|
69
69
|
3. Verified legacy only: approved hook installation and verified identical duplicate skill cleanup (Steps 8–10); preserve custom skills
|
|
70
70
|
4. Merge only applicable missing documentation and validate the selected route; v3 keeps existing snippet bodies/frontmatter unchanged
|
|
71
|
-
5.
|
|
71
|
+
5. Keep the `.toolkit-version` the CLI writes (installed package version, 4.0.0 or later) after the approved migration
|
|
72
72
|
6. Commit all changes
|
|
73
73
|
|
|
74
74
|
Proceed? (Y/n)
|
|
@@ -176,18 +176,17 @@ For the v3 route, merge only relevant native OpenCode host fields; preserve exis
|
|
|
176
176
|
"$schema": "https://opencode.ai/config.json",
|
|
177
177
|
"instructions": ["AGENTS.md", ".opencode/rules/*.md"],
|
|
178
178
|
"skills": [".agents/skills"],
|
|
179
|
-
"plugins": ["@dietrichgebert/ponytail@4.12.0"],
|
|
180
179
|
"lsp": true
|
|
181
180
|
}
|
|
182
181
|
```
|
|
183
182
|
|
|
184
183
|
Follow official V2 [migration](https://opencode.ai/v2/docs/migrate-v1), [config](https://opencode.ai/v2/docs/config), [agents](https://opencode.ai/v2/docs/agents), and [plugins](https://opencode.ai/v2/docs/build/plugins) docs. The published schema may describe V1; do not use it or a V1 API fetch as native V2 validation authority. Use `agents`/JSON `system` (Markdown bodies for file agents), `request.body.temperature`, ordered `permissions` (`action`/`resource`/`effect`, `shell`/`subagent`, last match wins), `commands`/`subagent`, `plugins` with `{ "package": "…", "options": {} }`, skill-directory arrays, and `mcp.servers` with inverse `disabled` and `timeout.catalog`/`timeout.execution`.
|
|
185
184
|
|
|
186
|
-
`instructions` entries
|
|
185
|
+
Ambient `AGENTS.md` works. `instructions` entries load only when the runtime injects them (OpenChamber does; other hosts may not), so do not rely on them: write explicit "Read and follow" wrappers regardless. `@refs` are ordinary text, not attachments: wrappers must explicitly tell agents to read referenced snippets. `request.body.temperature` remains in config, but the current runner does not send it. Preserve `lsp: true`; use project lint/typecheck/compiler commands (no current V2 LSP tools/diagnostics). `--env opencode` supplies minimal shared references without other harness activation. Verify using installed V2 after the next run/restart; report only checks actually run.
|
|
187
186
|
|
|
188
187
|
2. **Replace obsolete toolkit Ponytail (backup and approval only)**:
|
|
189
188
|
- Back up the local config and known obsolete toolkit-owned `.opencode/plugins/ponytail.js`, `.opencode/plugins/ponytail.mjs`, and `.opencode/plugins/ponytail.ts` copies; obtain approval before removing only those copies. Preserve unrelated local plugins.
|
|
190
|
-
-
|
|
189
|
+
- The OpenCode Ponytail plugin (`@dietrichgebert/ponytail`) is installed globally by the operator. Never add or pin it in the local `plugins` array. Check whether it is installed globally; if not, tell the operator to install it globally. Do not edit global config or overwrite global plugins. Keep `opentmux` commented as V1-only; do not copy local Ponytail source, port APIs, or introduce bridges. Runtime integration remains untested.
|
|
191
190
|
|
|
192
191
|
3. **Create wrappers with explicit snippet-read instructions** — one file per snippet:
|
|
193
192
|
|
|
@@ -252,12 +251,13 @@ If `CLAUDE.md` is an applicable confirmed harness target and a thin redirect to
|
|
|
252
251
|
|
|
253
252
|
See existing `CLAUDE.md` in the toolkit template (`src/repo/CLAUDE.md`) for the exact format.
|
|
254
253
|
|
|
255
|
-
### 12.
|
|
254
|
+
### 12. Check `.toolkit-version` File
|
|
256
255
|
|
|
257
256
|
Only after the approved migration and OpenCode preflight pass (or OpenCode is confirmed out of scope):
|
|
258
257
|
|
|
259
258
|
```bash
|
|
260
|
-
|
|
259
|
+
# Keep the value the CLI wrote (the installed package version). If it is missing, record it with the CLI:
|
|
260
|
+
npx nitm-ai-dev-toolkit patch
|
|
261
261
|
```
|
|
262
262
|
|
|
263
263
|
### 13. Validation
|
|
@@ -277,13 +277,13 @@ If `--verbose`: log each check result with file paths.
|
|
|
277
277
|
|
|
278
278
|
### 14. Generate Upgrade Report
|
|
279
279
|
|
|
280
|
-
Output the report to stdout (and optionally to `docs/upgrade-report
|
|
280
|
+
Output the report to stdout (and optionally to `docs/upgrade-report-<version>.md`). Include only operations/checks actually performed for the selected route; omit legacy extraction/cleanup rows on v3 and never pre-mark skipped checks as passed:
|
|
281
281
|
|
|
282
282
|
```markdown
|
|
283
283
|
## 🚀 Bootstrap Upgrade Report
|
|
284
284
|
|
|
285
285
|
**From**: detected installed version (include inline extraction only for pre-3.0)
|
|
286
|
-
**To**: 4.0.0
|
|
286
|
+
**To**: <version> (toolkit 4.0.0 or later; native V2 for confirmed OpenCode use; snippet conversion only for verified legacy)
|
|
287
287
|
**Selected route**: verified legacy | v3 native OpenCode
|
|
288
288
|
**Date**: {{DATE}}
|
|
289
289
|
**Dry run**: yes | no
|
|
@@ -317,7 +317,7 @@ Output the report to stdout (and optionally to `docs/upgrade-report-v4.md`). Inc
|
|
|
317
317
|
|
|
318
318
|
### Files Created
|
|
319
319
|
|
|
320
|
-
- `.toolkit-version` —
|
|
320
|
+
- `.toolkit-version` — installed package version (written by the CLI)
|
|
321
321
|
|
|
322
322
|
### Validation
|
|
323
323
|
|
|
@@ -337,7 +337,7 @@ If not `--dry-run`, stage and commit all changes:
|
|
|
337
337
|
|
|
338
338
|
```bash
|
|
339
339
|
git add -A
|
|
340
|
-
git commit -m "chore: upgrade AI instructions to toolkit
|
|
340
|
+
git commit -m "chore: upgrade AI instructions to toolkit <version>"
|
|
341
341
|
```
|
|
342
342
|
|
|
343
343
|
If `--dry-run`: skip commit, note in report: "Dry run — no changes committed."
|
|
@@ -5,8 +5,8 @@ Analyze the project structure and customize AI instruction templates for this co
|
|
|
5
5
|
## OpenCode version preflight (before any changes)
|
|
6
6
|
|
|
7
7
|
- Confirm OpenCode use from actual session/runtime evidence or ask the user; directory presence alone is not proof. If only other harnesses are used, skip this preflight and all OpenCode steps.
|
|
8
|
-
- For confirmed OpenCode use, run `opencode --version` before any project writes. Trim output and parse numeric major/minor/patch components, accepting an optional leading `v`; toolkit 4.
|
|
9
|
-
- If OpenCode V1 (`major < 2`) is detected, **STOP** before customizing/migrating OpenCode files or writing `.toolkit-version` as
|
|
8
|
+
- For confirmed OpenCode use, run `opencode --version` before any project writes. Trim output and parse numeric major/minor/patch components, accepting an optional leading `v`; toolkit 4.0.0 and later require `major >= 2`.
|
|
9
|
+
- If OpenCode V1 (`major < 2`) is detected, **STOP** before customizing/migrating OpenCode files or writing `.toolkit-version` as 4.0.0 or later. Ask the user to upgrade OpenCode to V2 or remain on toolkit 3.x.
|
|
10
10
|
- If the CLI is missing, fails, or output is unparseable, **STOP OpenCode steps** and leave the version marker unchanged; ask the user to confirm/install a supported OpenCode version, then rerun this check. Never assume V2.
|
|
11
11
|
- If oh-my-opencode-slim >=3.0.0 is used or planned, require OpenCode >=2.0.7 (compare version components numerically); otherwise **STOP** before changes and ask to upgrade. Proceed only after this gate passes.
|
|
12
12
|
|
|
@@ -100,26 +100,36 @@ Detect the language ecosystem by checking for these files:
|
|
|
100
100
|
|
|
101
101
|
Map discovered information to template variables:
|
|
102
102
|
|
|
103
|
-
| Variable | Source
|
|
104
|
-
| --------------------------- |
|
|
105
|
-
| `{{PROJECT_NAME}}` | Config file name field or directory
|
|
106
|
-
| `{{PROJECT_DESCRIPTION}}` | Config description or README
|
|
107
|
-
| `{{LANGUAGE}}` | Detected language (TypeScript, PHP, C#, Python, etc.)
|
|
108
|
-
| `{{FRAMEWORK}}` | Detected framework with version
|
|
109
|
-
| `{{PACKAGE_MANAGER}}` | Lock file or config (npm, composer, dotnet, pip, bundler, go, cargo, maven)
|
|
110
|
-
| `{{
|
|
111
|
-
| `{{
|
|
112
|
-
| `{{
|
|
113
|
-
| `{{
|
|
114
|
-
| `{{
|
|
115
|
-
| `{{
|
|
116
|
-
| `{{
|
|
117
|
-
| `{{
|
|
118
|
-
| `{{
|
|
119
|
-
| `{{
|
|
120
|
-
| `{{
|
|
121
|
-
| `{{
|
|
122
|
-
| `{{
|
|
103
|
+
| Variable | Source |
|
|
104
|
+
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
105
|
+
| `{{PROJECT_NAME}}` | Config file name field or directory |
|
|
106
|
+
| `{{PROJECT_DESCRIPTION}}` | Config description or README |
|
|
107
|
+
| `{{LANGUAGE}}` | Detected language (TypeScript, PHP, C#, Python, etc.) |
|
|
108
|
+
| `{{FRAMEWORK}}` | Detected framework with version |
|
|
109
|
+
| `{{PACKAGE_MANAGER}}` | Lock file or config (npm, composer, dotnet, pip, bundler, go, cargo, maven) |
|
|
110
|
+
| `{{SETUP_COMMAND}}` | Install step from the lock file (`npm ci`, `pnpm install --frozen-lockfile`, `composer install`, `dotnet restore`, `pip install -r requirements.txt`); a `setup` script or Makefile target wins if present |
|
|
111
|
+
| `{{DEV_PORT}}` | Scripts, config, or framework default |
|
|
112
|
+
| `{{DEV_COMMAND}}` | `dev` or `start` script, Makefile `dev` target, or framework CLI (`php artisan serve`, `dotnet run`, `cargo run`) |
|
|
113
|
+
| `{{DEV_PORT_FLAG}}` | Flag or env var that sets the dev port: `--port <port>`, `-- --port <port>` (npm script passthrough), or `PORT=<port>`; check the script and framework config. Ask if none |
|
|
114
|
+
| `{{SRC_DIR}}` | Source directory structure |
|
|
115
|
+
| `{{TEST_DIR}}` | Test directory location |
|
|
116
|
+
| `{{FILE_EXTENSION}}` | Primary extension (ts, php, cs, py, rb, go, rs, java) |
|
|
117
|
+
| `{{DATABASE}}` | ORM/database dependencies |
|
|
118
|
+
| `{{TEST_FRAMEWORK}}` | Test framework |
|
|
119
|
+
| `{{TEST_COMMAND}}` | `test` script, or the runner (`vitest run`, `phpunit`, `pytest`, `go test ./...`, `cargo test`, `dotnet test`) |
|
|
120
|
+
| `{{LINT_COMMAND}}` | `lint` script, or the linter (ESLint, Biome, ruff, phpstan, golangci-lint, clippy, dotnet format) |
|
|
121
|
+
| `{{BUILD_COMMAND}}` | `build` script, or the build tool (`go build ./...`, `cargo build`, `dotnet build`, `mvn package`) |
|
|
122
|
+
| `{{DEPLOY_PLATFORM}}` | Deployment config files |
|
|
123
|
+
| `{{RUNTIME_VERSION}}` | Runtime version from config |
|
|
124
|
+
| `{{ISSUE_TRACKER}}` | Detected project management tool |
|
|
125
|
+
| `{{PM_URL}}` | Project management tool URL/workspace (if applicable) |
|
|
126
|
+
| `{{PROJECT_KEY}}` | Project ID or workspace ID (if applicable) |
|
|
127
|
+
| `{{PM_ISSUE_KEY}}` | Issue key format (e.g., PROJ-###) |
|
|
128
|
+
| `{{DEFAULT_BRANCH}}` | `git symbolic-ref --short refs/remotes/origin/HEAD`, minus `origin/`; else `main` |
|
|
129
|
+
| `{{FACTORY_PORT_BASE}}` | Only if Factory is installed. Default `5100` |
|
|
130
|
+
| `{{APPROVAL_MODE}}` | Only if Factory is installed. Default `human` |
|
|
131
|
+
| `{{FACTORY_REVIEW_LENSES}}` | Only if Factory is installed. Default `code, security`; add `ux, ui` only if the project has a UI and a browser tool is configured (for example a browser MCP server) |
|
|
132
|
+
| `{{NEW_RELEVANT_VARIABLE}}` | ...other inferred values... |
|
|
123
133
|
|
|
124
134
|
### Step 2.5: Project Management Detection
|
|
125
135
|
|
|
@@ -242,23 +252,23 @@ Follow the official [V2 migration](https://opencode.ai/v2/docs/migrate-v1), [con
|
|
|
242
252
|
|
|
243
253
|
- After the version preflight passes, use `agents` with JSON `system` or Markdown bodies; `request.body.temperature`; ordered `permissions` rules (`action`, `resource`, `effect`; `shell`/`subagent`; last match wins); `commands` with `subagent`; `plugins` with `{ "package": "…", "options": {} }`; `skills` as directory-path arrays; `mcp.servers` with inverse `disabled` and `timeout.catalog`/`timeout.execution`.
|
|
244
254
|
- Back up V1; native-converted files are incompatible with V1. Merge, don't clobber models/providers/user-global plugins. With approval only, merge pinned `"plugins": ["oh-my-opencode-slim@3.0.0"]` locally. Slim's separate strict schema retains its own `prompt`, `permission`, and `variant`; do not host-migrate it or upgrade the separate external starter silently.
|
|
245
|
-
-
|
|
246
|
-
- Config `instructions` entries
|
|
247
|
-
- `--env opencode` supplies minimal shared references without activating other harnesses. Activate on the next run/restart and report only checks actually run using installed V2; scaffold/placeholder checks are not runtime validation.
|
|
255
|
+
- The OpenCode Ponytail plugin (`@dietrichgebert/ponytail`, the author's native V2 package) is installed globally by the operator. Templates do not register or pin it, and no local Ponytail source is bundled or ported. Keep `opentmux` commented as V1-only. Do not introduce API ports or bridges or claim tested runtime integration.
|
|
256
|
+
- Ambient `AGENTS.md` works. Config `instructions` entries load only when the runtime injects them (OpenChamber does; other hosts may not), so do not rely on them: write explicit "Read and follow" wrappers regardless. `@refs` are ordinary text: explicitly read referenced snippet docs. `request.body.temperature` remains in config, but the current runner does not send it. Preserve `lsp: true`, but use project lint/typecheck/compiler commands (no current V2 LSP tools/diagnostics).
|
|
257
|
+
- `--env opencode` supplies minimal shared references without activating other harnesses. Activate on the next run/restart and report only checks actually run using installed V2; scaffold/placeholder checks are not runtime validation.
|
|
248
258
|
|
|
249
259
|
**Ponytail pre-activation cleanup (confirmed OpenCode use only):**
|
|
250
260
|
|
|
251
261
|
1. In this bootstrap flow, inspect `.opencode/plugins/ponytail.js`, `.opencode/plugins/ponytail.mjs`, and `.opencode/plugins/ponytail.ts` for existing-target leftovers. Verify obsolete toolkit ownership from contents/provenance, not filename alone; absent paths need no deletion. Preserve unrelated/custom plugins and global config.
|
|
252
262
|
2. Back up the local config and verified obsolete toolkit copies, obtain explicit removal approval, then remove ONLY those copies. Do not automatically delete files in the CLI or remove custom plugins.
|
|
253
|
-
3.
|
|
263
|
+
3. Never add `@dietrichgebert/ponytail` to project `.opencode/opencode.jsonc`. Check whether it is installed globally; if not, tell the operator to install it globally and leave global and project config untouched. No API port or bridge.
|
|
254
264
|
4. If any present copy's ownership or safe removal is unverified, or required removal approval is denied, **STOP OpenCode activation and migration completion**; leave `.toolkit-version` unchanged and report blocked, not complete. Proceed/restart only after this gate passes; runtime integration remains untested.
|
|
255
265
|
|
|
256
266
|
**Create Toolkit Version File:**
|
|
257
267
|
|
|
258
|
-
|
|
268
|
+
Confirm `.toolkit-version` in the project root. The CLI writes it on install and patch with the installed package version. For toolkit 4.0.0 or later, keep the value the CLI wrote; do not write it by hand or overwrite it with a hard-coded version. If it is missing, run `npx nitm-ai-dev-toolkit patch` only after the OpenCode preflight and Ponytail cleanup gate pass (or OpenCode is confirmed out of scope). Expected form:
|
|
259
269
|
|
|
260
270
|
```
|
|
261
|
-
|
|
271
|
+
<installed package version, for example 5.0.0>
|
|
262
272
|
```
|
|
263
273
|
|
|
264
274
|
This file enables `bootstrap-patch` to detect version changes and apply migrations automatically.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run an opt-in factory job: intake, spec and plan gates, build in a worktree or in place, reviews, approval, merge (local, or a merge request on the forge)"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are the factory orchestrator for this session. Arguments: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
Follow the [factory orchestrator skill](../../.agents/skills/factory/SKILL.md) exactly. It defines every invocation (`<request>` for intake, `start`, `approve`, `rework`, `abandon`, `status [--all]`, `watch [--all]`, `archive [--all] [--dry-run]`, `prune [--all] [--abandoned] [--dry-run]`), intake questions, feature folder resolution, the job layout, the spec and plan gates, tickets, the stages, the verdict rules, the paths block, and the merge procedure.
|
|
8
|
+
|
|
9
|
+
Ground rules:
|
|
10
|
+
|
|
11
|
+
- Run the orchestrator in this session. Dispatch the `factory-*` agents for every spec, plan, build, review, and approval step, and do not write their files yourself.
|
|
12
|
+
- Only write `job.json`, `intake.md`, `spec-<k>.md`, `plan-<k>.md`, `rework-<k>.md`, the escalation `decision.md`, `merge-conflict.md`, `bootstrap.md`, the ticket keys in `tasks.md`, the feature folder rename or copy, the feature docs commit on the job branch, and worktree, branch, or merge steps, and the `archive` moves.
|
|
13
|
+
- Intake asks in chat before any folder, job, or spec exists. Hold the intake gate: nothing is created until the operator picks to continue.
|
|
14
|
+
- Hold the spec gate and the plan gate: nothing is planned, ticketed, or built until the operator confirms in chat. The spec cannot be confirmed while a `[PRODUCT DECISION]` item is open.
|
|
15
|
+
- `--in-place` on the command, or the operator saying in place, builds in the main checkout instead of a worktree. Only a new job takes it.
|
|
16
|
+
- `abandon <job-id>` closes a job without merging it. Ask first when an agent may still be running.
|
|
17
|
+
- Local merges never push. With `MERGE_MODE` set to `push-mr`, the branch is pushed and its merge request opened only on `/factory approve` or an `auto` APPROVE, and never force-pushed.
|
|
18
|
+
- `archive` moves closed jobs only, to `factory/archive/`. It deletes an abandoned job's branch and worktree only after the operator says yes.
|
|
19
|
+
- `prune` permanently deletes closed jobs from `factory/jobs/` and `factory/archive/`, after one confirmation in chat: merged jobs by default, and abandoned jobs too with `--abandoned`. It never touches an open job or the feature folders.
|
|
20
|
+
- If `$ARGUMENTS` is empty, show the invocation list from the skill and ask which one the user wants.
|
|
@@ -55,7 +55,7 @@ Implement a feature by completing tasks sequentially with proper tracking.
|
|
|
55
55
|
- Understand dependencies
|
|
56
56
|
|
|
57
57
|
c. **Implement (TDD required)**:
|
|
58
|
-
- Follow acceptance criteria
|
|
58
|
+
- Follow the acceptance criteria in `spec.md` for this task's deliverable
|
|
59
59
|
- Use patterns from `AGENTS.md`
|
|
60
60
|
- **Write a failing test first** — one behavior per test, clear name, real code
|
|
61
61
|
- **Verify it fails** — watch it fail for the right reason (feature missing, not error)
|
|
@@ -85,7 +85,9 @@ Implement a feature by completing tasks sequentially with proper tracking.
|
|
|
85
85
|
git commit -m "feat({{SCOPE}}): {{DESCRIPTION}}"
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
f. **Mark Task Complete
|
|
88
|
+
f. **Mark Task Complete**:
|
|
89
|
+
- Slim `tasks.md`: tick `- [x]` on the task's line
|
|
90
|
+
- Legacy `tasks.md`: tick `- [x]` only on checkboxes under the current task's heading (until the next heading). Never tick checkboxes under other headings. If that heading has no checkboxes, report "no checkboxes under <heading>; nothing ticked" and continue
|
|
89
91
|
|
|
90
92
|
5. **Post-Implementation Review**:
|
|
91
93
|
- Dispatch **Reviewer** agent on all changes before proceeding
|