@plainconceptsplatform/agent-harness 3.2.0 → 3.3.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/LICENSE +21 -21
- package/README.md +454 -452
- package/cli/commands/join.js +259 -259
- package/cli/commands/migrate.js +310 -310
- package/cli/commands/shared.js +27 -27
- package/cli/commands/single.js +79 -79
- package/cli/commands/update.js +121 -121
- package/cli/commands/wizard.js +134 -134
- package/cli/fragments/archive/az.md +97 -97
- package/cli/fragments/archive/gh.md +96 -96
- package/cli/fragments/archive/gl.md +96 -96
- package/cli/fragments/archive/none.md +75 -75
- package/cli/fragments/guardrails/codegraph.md +5 -5
- package/cli/fragments/guardrails/humanizer.md +4 -4
- package/cli/fragments/guardrails/memory.md +4 -4
- package/cli/fragments/guardrails/rtk.md +3 -3
- package/cli/fragments/guardrails/simple-english.md +4 -4
- package/cli/fragments/ops-backlog/az.md +28 -28
- package/cli/fragments/ops-backlog/gh.md +28 -28
- package/cli/fragments/ops-backlog/jira.md +28 -28
- package/cli/fragments/ops-review/az.md +62 -62
- package/cli/fragments/ops-review/gh.md +51 -51
- package/cli/fragments/ops-review/gl.md +55 -55
- package/cli/fragments/ops-ship/az.md +81 -81
- package/cli/fragments/ops-ship/gh.md +67 -67
- package/cli/fragments/ops-ship/gl.md +84 -84
- package/cli/index.js +116 -116
- package/cli/presets/agents-content.json +34 -34
- package/cli/presets/browser.json +10 -10
- package/cli/presets/clean.json +21 -21
- package/cli/presets/models.json +68 -68
- package/cli/presets/optimization.json +32 -32
- package/cli/presets/platforms.json +76 -76
- package/cli/presets/source.json +23 -23
- package/cli/steps/browser/index.js +48 -48
- package/cli/steps/clean/index.js +120 -120
- package/cli/steps/copy/agents.js +120 -120
- package/cli/steps/copy/commands.js +79 -79
- package/cli/steps/copy/fullstack-engineer.js +89 -89
- package/cli/steps/copy/index.js +88 -88
- package/cli/steps/copy/opencode-json.js +324 -324
- package/cli/steps/copy/skills.js +307 -307
- package/cli/steps/metadata/index.js +115 -115
- package/cli/steps/models/format.js +88 -88
- package/cli/steps/models/index.js +64 -64
- package/cli/steps/models/write.js +38 -38
- package/cli/steps/openspec/index.js +136 -136
- package/cli/steps/optimization/codegraph.js +141 -127
- package/cli/steps/optimization/detect.js +66 -66
- package/cli/steps/optimization/humanizer.js +17 -17
- package/cli/steps/optimization/index.js +158 -158
- package/cli/steps/optimization/memory.js +91 -88
- package/cli/steps/optimization/patch-guardrails.js +111 -111
- package/cli/steps/optimization/simple-english.js +17 -17
- package/cli/steps/optimization/skills-lock.js +30 -30
- package/cli/steps/platform/index.js +109 -109
- package/cli/steps/source/index.js +123 -123
- package/cli/utils/agent-color.js +111 -111
- package/cli/utils/copy.js +134 -134
- package/cli/utils/exec-spinner.js +47 -47
- package/cli/utils/exec.js +134 -134
- package/cli/utils/legacy-check.js +30 -30
- package/cli/utils/models-cache.js +58 -58
- package/cli/utils/models-pricing.js +42 -42
- package/cli/utils/paths.js +80 -80
- package/cli/utils/process.js +3 -3
- package/cli/utils/terminal.js +6 -6
- package/cli/utils/update-manifest.js +75 -75
- package/harness/.opencode/_gitignore +9 -9
- package/harness/.opencode/commands/init.md +5 -5
- package/harness/.opencode/commands/make-architecture.md +5 -5
- package/harness/.opencode/commands/make-design.md +5 -5
- package/harness/.opencode/commands/make-engineer.md +5 -5
- package/harness/.opencode/commands/make-guardrails.md +5 -5
- package/harness/.opencode/commands/make-user-model.md +5 -5
- package/harness/.opencode/commands/ops-backlog.md +10 -10
- package/harness/.opencode/commands/ops-review.md +8 -8
- package/harness/.opencode/commands/ops-ship.md +9 -9
- package/harness/.opencode/commands/plan-apply.md +9 -9
- package/harness/.opencode/commands/plan-archive.md +5 -5
- package/harness/.opencode/commands/plan-explore.md +9 -9
- package/harness/.opencode/commands/plan-goal.md +5 -5
- package/harness/.opencode/commands/plan-propose.md +9 -9
- package/harness/.opencode/commands/plan-quick.md +5 -5
- package/harness/.opencode/commands/plan-story.md +9 -9
- package/harness/.opencode/commands/repo-audit.md +5 -5
- package/harness/.opencode/commands/repo-help.md +5 -5
- package/harness/.opencode/commands/repo-initialize.md +5 -5
- package/harness/.opencode/commands/repo-onboard.md +5 -5
- package/harness/.opencode/commands/repo-verify.md +5 -5
- package/harness/.opencode/package.json +5 -5
- package/harness/.opencode/plugins/pc-subagent-monitor.js +184 -184
- package/harness/.opencode/plugins/pc-subagent-tiers.js +354 -354
- package/harness/.opencode/plugins/pc-system-reminders.js +386 -386
- package/harness/.opencode/scripts/check-diff.mjs +26 -7
- package/harness/.opencode/scripts/code-rules.mjs +288 -280
- package/harness/AGENTS.md +49 -49
- package/harness/ARCHITECTURE.md +13 -13
- package/harness/DESIGN.md +13 -13
- package/harness/opencode.jsonc +36 -36
- package/harness/openspec/config.yaml +20 -20
- package/harness/skills-lock.json +17 -17
- package/package.json +14 -12
- package/skills/README.md +18 -18
- package/skills/agent-harness-cli/SKILL.md +86 -86
- package/skills/browser-automation/SKILL.md +72 -72
- package/skills/pc-guardrails-project/SKILL.md +8 -8
- package/skills/pc-make-architecture/SKILL.md +32 -32
- package/skills/pc-make-architecture/structure-template.md +64 -64
- package/skills/pc-make-design/SKILL.md +45 -45
- package/skills/pc-make-engineer/SKILL.md +59 -59
- package/skills/pc-make-engineer/signal-mapping.md +53 -53
- package/skills/pc-make-engineer/template.md +36 -36
- package/skills/pc-make-guardrails/SKILL.md +44 -44
- package/skills/pc-make-guardrails/category-reference.md +112 -112
- package/skills/pc-make-merge-risk-assess/SKILL.md +70 -70
- package/skills/pc-make-merge-risk-assess/category-reference.md +114 -114
- package/skills/pc-make-user-model/SKILL.md +56 -56
- package/skills/pc-ops-ship/SKILL.md +22 -18
- package/skills/pc-plan-apply/SKILL.md +86 -86
- package/skills/pc-plan-apply/simple-mode.md +21 -21
- package/skills/pc-plan-archive/SKILL.md +66 -66
- package/skills/pc-plan-explore/SKILL.md +21 -21
- package/skills/pc-plan-goal/SKILL.md +91 -91
- package/skills/pc-plan-goal/branching.md +39 -39
- package/skills/pc-plan-goal/failure-policy.md +30 -30
- package/skills/pc-plan-goal/output-mode.md +10 -10
- package/skills/pc-plan-goal/output.md +71 -71
- package/skills/pc-plan-propose/SKILL.md +125 -125
- package/skills/pc-plan-propose/task-annotation.md +39 -39
- package/skills/pc-plan-quick/SKILL.md +46 -46
- package/skills/pc-plan-story/SKILL.md +93 -93
- package/skills/pc-repo-audit/SKILL.md +44 -44
- package/skills/pc-repo-help/SKILL.md +87 -87
- package/skills/pc-repo-initialize/SKILL.md +119 -119
- package/skills/pc-repo-onboard/SKILL.md +32 -32
- package/skills/pc-repo-verify/SKILL.md +150 -150
- package/skills/pc-userstory-az/SKILL.md +71 -71
- package/skills/pc-userstory-browser/SKILL.md +64 -64
- package/skills/pc-userstory-gh/SKILL.md +63 -63
- package/skills/pc-userstory-jira/SKILL.md +74 -74
package/cli/commands/wizard.js
CHANGED
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
import { select as wizardSelect } from '@inquirer/prompts'
|
|
2
|
-
import chalk from 'chalk'
|
|
3
|
-
import { ensureGitLongpaths } from './shared.js'
|
|
4
|
-
import { chooseSourceScope } from '../steps/source/index.js'
|
|
5
|
-
import { cleanAiFiles } from '../steps/clean/index.js'
|
|
6
|
-
import { choosePlatform } from '../steps/platform/index.js'
|
|
7
|
-
import { copyContentStep } from '../steps/copy/index.js'
|
|
8
|
-
import { initOpenspec } from '../steps/openspec/index.js'
|
|
9
|
-
import { chooseModels } from '../steps/models/index.js'
|
|
10
|
-
import { tokenOptimizationStep } from '../steps/optimization/index.js'
|
|
11
|
-
import { installBrowser } from '../steps/browser/index.js'
|
|
12
|
-
import { writeHarnessConfig } from '../steps/metadata/index.js'
|
|
13
|
-
|
|
14
|
-
export async function runWizard(version) {
|
|
15
|
-
const logo = chalk.hex('#fe3d57')
|
|
16
|
-
const bannerLines = [
|
|
17
|
-
logo(' '),
|
|
18
|
-
logo(' ▒▒▒▒▒▒▒▒▒▒▒▒▒ '),
|
|
19
|
-
logo(' ▒▒▓ ▓▒▓ '),
|
|
20
|
-
logo(' ▒▒▒▒▒▒▓▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▒ '),
|
|
21
|
-
logo(' ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '),
|
|
22
|
-
logo(' ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓ '),
|
|
23
|
-
logo(' ▓▒▒▒▒░░░▒▒▒▒▒▒▒▒▒▒▒░░░▒▒▒▓▓ '),
|
|
24
|
-
logo(' ▓▓▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓▓ '),
|
|
25
|
-
logo(' ▓▓▒▒▒▒▒▒░▒▒▒▒▒▒▒░▒▒▒▒▒▒▓▓ '),
|
|
26
|
-
logo(' ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '),
|
|
27
|
-
logo(' ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '),
|
|
28
|
-
logo(' ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ '),
|
|
29
|
-
'',
|
|
30
|
-
chalk.bold(' 🧰 agent-harness') + chalk.dim(` v${version}`),
|
|
31
|
-
chalk.dim(' Prepare your codebase for AI agents'),
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
for (const line of bannerLines) console.log(line)
|
|
35
|
-
console.log()
|
|
36
|
-
console.log(' This tool will set up your project with a team of AI agents,')
|
|
37
|
-
console.log(' install skills, select models, and configure OpenCode.')
|
|
38
|
-
console.log()
|
|
39
|
-
|
|
40
|
-
// Only wait for Enter in a real interactive TTY
|
|
41
|
-
if (process.stdin.isTTY) {
|
|
42
|
-
console.log(chalk.bold(' Press Enter to begin...'))
|
|
43
|
-
console.log()
|
|
44
|
-
await new Promise(resolve => {
|
|
45
|
-
process.stdin.resume()
|
|
46
|
-
process.stdin.once('data', () => {
|
|
47
|
-
process.stdin.pause()
|
|
48
|
-
resolve()
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const longpathsConfigured = await ensureGitLongpaths()
|
|
54
|
-
if (longpathsConfigured) console.log(chalk.dim(' Git long paths enabled for this repository.'))
|
|
55
|
-
|
|
56
|
-
const scope = await chooseSourceScope()
|
|
57
|
-
|
|
58
|
-
const maxConcurrentAgents = await wizardSelect({
|
|
59
|
-
message: 'Max concurrent agents:',
|
|
60
|
-
default: 3,
|
|
61
|
-
choices: [
|
|
62
|
-
{ name: '1', value: 1, description: 'Serial: one agent at a time' },
|
|
63
|
-
{ name: '2', value: 2, description: 'Conservative: lower resource usage' },
|
|
64
|
-
{ name: '3 (default)', value: 3, description: 'Recommended: balances speed vs MCP load' },
|
|
65
|
-
{ name: '4', value: 4, description: 'Higher parallelism' },
|
|
66
|
-
{ name: '5', value: 5, description: 'Maximum: needs more resources' },
|
|
67
|
-
],
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
const installScope = await wizardSelect({
|
|
71
|
-
message: 'Install dependencies:',
|
|
72
|
-
default: 'local',
|
|
73
|
-
choices: [
|
|
74
|
-
{ name: 'Locally (default)', value: 'local', description: 'Install tools project-locally where possible' },
|
|
75
|
-
{ name: 'Globally', value: 'global', description: 'Install tools globally (affects all projects on this machine)' },
|
|
76
|
-
],
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
const preserve = await cleanAiFiles({ removeLegacyConfig: true })
|
|
80
|
-
const ctx = { ...preserve, ...scope, maxConcurrentAgents, installScope }
|
|
81
|
-
|
|
82
|
-
const { backlogPlatform, repoPlatform } = await choosePlatform()
|
|
83
|
-
|
|
84
|
-
await copyContentStep({ backlogPlatform, repoPlatform }, ctx)
|
|
85
|
-
|
|
86
|
-
const openspec = await initOpenspec()
|
|
87
|
-
|
|
88
|
-
const selectedModels = await chooseModels()
|
|
89
|
-
|
|
90
|
-
const tokenOpt = await tokenOptimizationStep({ ctx })
|
|
91
|
-
const { rtk, quota, simpleEnglish, codegraph, memory, humanizer } = tokenOpt
|
|
92
|
-
|
|
93
|
-
await installBrowser()
|
|
94
|
-
|
|
95
|
-
await writeHarnessConfig({
|
|
96
|
-
...ctx,
|
|
97
|
-
backlogPlatform,
|
|
98
|
-
repoPlatform,
|
|
99
|
-
openspec,
|
|
100
|
-
maxConcurrentAgents,
|
|
101
|
-
installScope,
|
|
102
|
-
additionalSkillsProvider: 'npx-skills',
|
|
103
|
-
...selectedModels,
|
|
104
|
-
optionalTools: { rtk, quota, simpleEnglish, codegraph, memory, humanizer },
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
const toGenerate = [
|
|
108
|
-
!ctx.hasDesign && 'DESIGN.md',
|
|
109
|
-
!ctx.hasArchitecture && 'ARCHITECTURE.md',
|
|
110
|
-
].filter(Boolean)
|
|
111
|
-
|
|
112
|
-
console.log()
|
|
113
|
-
console.log(chalk.bold.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'))
|
|
114
|
-
console.log(chalk.bold.green(' Onboarding complete!'))
|
|
115
|
-
console.log(chalk.bold.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'))
|
|
116
|
-
console.log()
|
|
117
|
-
console.log(' Open this project in OpenCode and type:')
|
|
118
|
-
console.log(chalk.bold(' "/init"'))
|
|
119
|
-
console.log(' Or run the following command in your terminal:')
|
|
120
|
-
console.log(chalk.bold(' opencode --prompt "/init" --model "opencode/big-pickle" '))
|
|
121
|
-
console.log()
|
|
122
|
-
console.log(chalk.dim(' Note: the first time you open OpenCode in this project,'))
|
|
123
|
-
console.log(chalk.dim(' it will install plugin dependencies. You may see a black'))
|
|
124
|
-
console.log(chalk.dim(' screen for a moment: this is normal. Wait for it to load.'))
|
|
125
|
-
console.log()
|
|
126
|
-
if (toGenerate.length > 0) {
|
|
127
|
-
console.log(` OpenCode will generate ${toGenerate.join(' and ')}`)
|
|
128
|
-
console.log(' from your actual codebase, then activate the agent team.')
|
|
129
|
-
} else {
|
|
130
|
-
console.log(' OpenCode will activate the agent team.')
|
|
131
|
-
}
|
|
132
|
-
console.log(` Source scope: ${ctx.sourceMode === 'parent-selected' ? ctx.sourceRoots.map(p => `../${p.split(/[/\\]/).pop()}`).join(', ') : 'current folder'}`)
|
|
133
|
-
console.log()
|
|
134
|
-
}
|
|
1
|
+
import { select as wizardSelect } from '@inquirer/prompts'
|
|
2
|
+
import chalk from 'chalk'
|
|
3
|
+
import { ensureGitLongpaths } from './shared.js'
|
|
4
|
+
import { chooseSourceScope } from '../steps/source/index.js'
|
|
5
|
+
import { cleanAiFiles } from '../steps/clean/index.js'
|
|
6
|
+
import { choosePlatform } from '../steps/platform/index.js'
|
|
7
|
+
import { copyContentStep } from '../steps/copy/index.js'
|
|
8
|
+
import { initOpenspec } from '../steps/openspec/index.js'
|
|
9
|
+
import { chooseModels } from '../steps/models/index.js'
|
|
10
|
+
import { tokenOptimizationStep } from '../steps/optimization/index.js'
|
|
11
|
+
import { installBrowser } from '../steps/browser/index.js'
|
|
12
|
+
import { writeHarnessConfig } from '../steps/metadata/index.js'
|
|
13
|
+
|
|
14
|
+
export async function runWizard(version) {
|
|
15
|
+
const logo = chalk.hex('#fe3d57')
|
|
16
|
+
const bannerLines = [
|
|
17
|
+
logo(' '),
|
|
18
|
+
logo(' ▒▒▒▒▒▒▒▒▒▒▒▒▒ '),
|
|
19
|
+
logo(' ▒▒▓ ▓▒▓ '),
|
|
20
|
+
logo(' ▒▒▒▒▒▒▓▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▒ '),
|
|
21
|
+
logo(' ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '),
|
|
22
|
+
logo(' ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓ '),
|
|
23
|
+
logo(' ▓▒▒▒▒░░░▒▒▒▒▒▒▒▒▒▒▒░░░▒▒▒▓▓ '),
|
|
24
|
+
logo(' ▓▓▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓▓ '),
|
|
25
|
+
logo(' ▓▓▒▒▒▒▒▒░▒▒▒▒▒▒▒░▒▒▒▒▒▒▓▓ '),
|
|
26
|
+
logo(' ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '),
|
|
27
|
+
logo(' ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '),
|
|
28
|
+
logo(' ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ '),
|
|
29
|
+
'',
|
|
30
|
+
chalk.bold(' 🧰 agent-harness') + chalk.dim(` v${version}`),
|
|
31
|
+
chalk.dim(' Prepare your codebase for AI agents'),
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
for (const line of bannerLines) console.log(line)
|
|
35
|
+
console.log()
|
|
36
|
+
console.log(' This tool will set up your project with a team of AI agents,')
|
|
37
|
+
console.log(' install skills, select models, and configure OpenCode.')
|
|
38
|
+
console.log()
|
|
39
|
+
|
|
40
|
+
// Only wait for Enter in a real interactive TTY
|
|
41
|
+
if (process.stdin.isTTY) {
|
|
42
|
+
console.log(chalk.bold(' Press Enter to begin...'))
|
|
43
|
+
console.log()
|
|
44
|
+
await new Promise(resolve => {
|
|
45
|
+
process.stdin.resume()
|
|
46
|
+
process.stdin.once('data', () => {
|
|
47
|
+
process.stdin.pause()
|
|
48
|
+
resolve()
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const longpathsConfigured = await ensureGitLongpaths()
|
|
54
|
+
if (longpathsConfigured) console.log(chalk.dim(' Git long paths enabled for this repository.'))
|
|
55
|
+
|
|
56
|
+
const scope = await chooseSourceScope()
|
|
57
|
+
|
|
58
|
+
const maxConcurrentAgents = await wizardSelect({
|
|
59
|
+
message: 'Max concurrent agents:',
|
|
60
|
+
default: 3,
|
|
61
|
+
choices: [
|
|
62
|
+
{ name: '1', value: 1, description: 'Serial: one agent at a time' },
|
|
63
|
+
{ name: '2', value: 2, description: 'Conservative: lower resource usage' },
|
|
64
|
+
{ name: '3 (default)', value: 3, description: 'Recommended: balances speed vs MCP load' },
|
|
65
|
+
{ name: '4', value: 4, description: 'Higher parallelism' },
|
|
66
|
+
{ name: '5', value: 5, description: 'Maximum: needs more resources' },
|
|
67
|
+
],
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const installScope = await wizardSelect({
|
|
71
|
+
message: 'Install dependencies:',
|
|
72
|
+
default: 'local',
|
|
73
|
+
choices: [
|
|
74
|
+
{ name: 'Locally (default)', value: 'local', description: 'Install tools project-locally where possible' },
|
|
75
|
+
{ name: 'Globally', value: 'global', description: 'Install tools globally (affects all projects on this machine)' },
|
|
76
|
+
],
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const preserve = await cleanAiFiles({ removeLegacyConfig: true })
|
|
80
|
+
const ctx = { ...preserve, ...scope, maxConcurrentAgents, installScope }
|
|
81
|
+
|
|
82
|
+
const { backlogPlatform, repoPlatform } = await choosePlatform()
|
|
83
|
+
|
|
84
|
+
await copyContentStep({ backlogPlatform, repoPlatform }, ctx)
|
|
85
|
+
|
|
86
|
+
const openspec = await initOpenspec()
|
|
87
|
+
|
|
88
|
+
const selectedModels = await chooseModels()
|
|
89
|
+
|
|
90
|
+
const tokenOpt = await tokenOptimizationStep({ ctx })
|
|
91
|
+
const { rtk, quota, simpleEnglish, codegraph, memory, humanizer } = tokenOpt
|
|
92
|
+
|
|
93
|
+
await installBrowser()
|
|
94
|
+
|
|
95
|
+
await writeHarnessConfig({
|
|
96
|
+
...ctx,
|
|
97
|
+
backlogPlatform,
|
|
98
|
+
repoPlatform,
|
|
99
|
+
openspec,
|
|
100
|
+
maxConcurrentAgents,
|
|
101
|
+
installScope,
|
|
102
|
+
additionalSkillsProvider: 'npx-skills',
|
|
103
|
+
...selectedModels,
|
|
104
|
+
optionalTools: { rtk, quota, simpleEnglish, codegraph, memory, humanizer },
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
const toGenerate = [
|
|
108
|
+
!ctx.hasDesign && 'DESIGN.md',
|
|
109
|
+
!ctx.hasArchitecture && 'ARCHITECTURE.md',
|
|
110
|
+
].filter(Boolean)
|
|
111
|
+
|
|
112
|
+
console.log()
|
|
113
|
+
console.log(chalk.bold.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'))
|
|
114
|
+
console.log(chalk.bold.green(' Onboarding complete!'))
|
|
115
|
+
console.log(chalk.bold.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'))
|
|
116
|
+
console.log()
|
|
117
|
+
console.log(' Open this project in OpenCode and type:')
|
|
118
|
+
console.log(chalk.bold(' "/init"'))
|
|
119
|
+
console.log(' Or run the following command in your terminal:')
|
|
120
|
+
console.log(chalk.bold(' opencode --prompt "/init" --model "opencode/big-pickle" '))
|
|
121
|
+
console.log()
|
|
122
|
+
console.log(chalk.dim(' Note: the first time you open OpenCode in this project,'))
|
|
123
|
+
console.log(chalk.dim(' it will install plugin dependencies. You may see a black'))
|
|
124
|
+
console.log(chalk.dim(' screen for a moment: this is normal. Wait for it to load.'))
|
|
125
|
+
console.log()
|
|
126
|
+
if (toGenerate.length > 0) {
|
|
127
|
+
console.log(` OpenCode will generate ${toGenerate.join(' and ')}`)
|
|
128
|
+
console.log(' from your actual codebase, then activate the agent team.')
|
|
129
|
+
} else {
|
|
130
|
+
console.log(' OpenCode will activate the agent team.')
|
|
131
|
+
}
|
|
132
|
+
console.log(` Source scope: ${ctx.sourceMode === 'parent-selected' ? ctx.sourceRoots.map(p => `../${p.split(/[/\\]/).pop()}`).join(', ') : 'current folder'}`)
|
|
133
|
+
console.log()
|
|
134
|
+
}
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
2. **Find the oldest change with a completed PR**
|
|
2
|
-
|
|
3
|
-
List unarchived changes (top-level only, excludes `archive/`):
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
find "$REPO_ROOT/openspec/changes" -mindepth 1 -maxdepth 1 -type d -not -name 'archive' | sort
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
If empty, report a blocker and stop.
|
|
10
|
-
|
|
11
|
-
List completed PRs:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
az repos pr list --repository {repo} --status completed --query "sort_by(@, &closedDate)[].{name:title,sourceRefName:sourceRefName,closedDate:closedDate,pullRequestId:pullRequestId}"
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Match each change to a completed PR using its ID and slug as search hints:
|
|
18
|
-
- No match → skip (record as blocked: `no merged PR found`).
|
|
19
|
-
- One match → eligible.
|
|
20
|
-
- Multiple matches → ask the user which PR belongs to that change.
|
|
21
|
-
|
|
22
|
-
If nothing is eligible, report a blocker and stop. Otherwise select the eligible change with the **oldest** PR `closedDate` as the candidate.
|
|
23
|
-
|
|
24
|
-
3. **Confirm the candidate**
|
|
25
|
-
|
|
26
|
-
Show the candidate (ID, title, PR ID, merged date) and any blocked changes, then ask:
|
|
27
|
-
|
|
28
|
-
```text
|
|
29
|
-
Oldest unarchived merged change found:
|
|
30
|
-
ID: {change-id}
|
|
31
|
-
Title: {title from resolved PR}
|
|
32
|
-
PR ID: {pullRequestId}
|
|
33
|
-
Merged: {closedDate}
|
|
34
|
-
|
|
35
|
-
Proceed with archiving? [yes/no]
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Stop if the user does not confirm.
|
|
39
|
-
|
|
40
|
-
4. **Archive the change**
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
git checkout -b archive/{change-id}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Load `@openspec-archive-change` skill and follow it to archive the change.
|
|
47
|
-
|
|
48
|
-
5. **Update docs**
|
|
49
|
-
|
|
50
|
-
Compare the archived change's specs against `ARCHITECTURE.md` and `DESIGN.md`. If updates are needed, show them and get user approval before applying.
|
|
51
|
-
|
|
52
|
-
6. **Create the archive PR**
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
# Stage specific paths only: a shared tree may hold another agent's or a
|
|
56
|
-
# person's edits, and -A commits them under this message.
|
|
57
|
-
git add openspec/changes/ # plus ARCHITECTURE.md / DESIGN.md if step 5 updated them
|
|
58
|
-
git commit -m "archive: {title} ({change-id})"
|
|
59
|
-
git push origin archive/{change-id}
|
|
60
|
-
|
|
61
|
-
az repos pr create \
|
|
62
|
-
--repository {repo} \
|
|
63
|
-
--source-branch refs/heads/archive/{change-id} \
|
|
64
|
-
--target-branch "refs/heads/$DEFAULT_BRANCH" \
|
|
65
|
-
--title "archive: {title} ({change-id})" \
|
|
66
|
-
--description "Archive SDD artifacts for {change-id} after merge of {sourceRefName}." \
|
|
67
|
-
--auto-complete
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
If work was stashed in step 1, restore it after the PR is created unless the user opts out.
|
|
71
|
-
|
|
72
|
-
7. **Report**
|
|
73
|
-
|
|
74
|
-
Display:
|
|
75
|
-
|
|
76
|
-
```text
|
|
77
|
-
Archive complete
|
|
78
|
-
|
|
79
|
-
Change ID: {change-id}
|
|
80
|
-
Title: {title}
|
|
81
|
-
Original PR: {original-pr-link}
|
|
82
|
-
Archive PR: {archive-pr-link}
|
|
83
|
-
|
|
84
|
-
Documentation updates:
|
|
85
|
-
- ARCHITECTURE.md: {count} changes applied
|
|
86
|
-
- DESIGN.md: {count} changes applied
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Rules
|
|
90
|
-
|
|
91
|
-
- All OpenSpec paths resolve from `git rev-parse --show-toplevel`. Never use `/openspec/...`.
|
|
92
|
-
- Only process top-level directories in `$REPO_ROOT/openspec/changes/`; exclude `archive/`.
|
|
93
|
-
- Use change ID and slug only as search hints; do not assume the source branch name.
|
|
94
|
-
- The oldest eligible merged change is the only candidate: never ask the user which change to archive (but do ask which PR if multiple match one change).
|
|
95
|
-
- Never proceed if the selected PR is not completed.
|
|
96
|
-
- Never use browser tools or direct web requests for Azure DevOps. Use `az` CLI only.
|
|
97
|
-
- Never invent or guess PR, branch, or merge metadata.
|
|
1
|
+
2. **Find the oldest change with a completed PR**
|
|
2
|
+
|
|
3
|
+
List unarchived changes (top-level only, excludes `archive/`):
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
find "$REPO_ROOT/openspec/changes" -mindepth 1 -maxdepth 1 -type d -not -name 'archive' | sort
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
If empty, report a blocker and stop.
|
|
10
|
+
|
|
11
|
+
List completed PRs:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
az repos pr list --repository {repo} --status completed --query "sort_by(@, &closedDate)[].{name:title,sourceRefName:sourceRefName,closedDate:closedDate,pullRequestId:pullRequestId}"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Match each change to a completed PR using its ID and slug as search hints:
|
|
18
|
+
- No match → skip (record as blocked: `no merged PR found`).
|
|
19
|
+
- One match → eligible.
|
|
20
|
+
- Multiple matches → ask the user which PR belongs to that change.
|
|
21
|
+
|
|
22
|
+
If nothing is eligible, report a blocker and stop. Otherwise select the eligible change with the **oldest** PR `closedDate` as the candidate.
|
|
23
|
+
|
|
24
|
+
3. **Confirm the candidate**
|
|
25
|
+
|
|
26
|
+
Show the candidate (ID, title, PR ID, merged date) and any blocked changes, then ask:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
Oldest unarchived merged change found:
|
|
30
|
+
ID: {change-id}
|
|
31
|
+
Title: {title from resolved PR}
|
|
32
|
+
PR ID: {pullRequestId}
|
|
33
|
+
Merged: {closedDate}
|
|
34
|
+
|
|
35
|
+
Proceed with archiving? [yes/no]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Stop if the user does not confirm.
|
|
39
|
+
|
|
40
|
+
4. **Archive the change**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git checkout -b archive/{change-id}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Load `@openspec-archive-change` skill and follow it to archive the change.
|
|
47
|
+
|
|
48
|
+
5. **Update docs**
|
|
49
|
+
|
|
50
|
+
Compare the archived change's specs against `ARCHITECTURE.md` and `DESIGN.md`. If updates are needed, show them and get user approval before applying.
|
|
51
|
+
|
|
52
|
+
6. **Create the archive PR**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Stage specific paths only: a shared tree may hold another agent's or a
|
|
56
|
+
# person's edits, and -A commits them under this message.
|
|
57
|
+
git add openspec/changes/ # plus ARCHITECTURE.md / DESIGN.md if step 5 updated them
|
|
58
|
+
git commit -m "archive: {title} ({change-id})"
|
|
59
|
+
git push origin archive/{change-id}
|
|
60
|
+
|
|
61
|
+
az repos pr create \
|
|
62
|
+
--repository {repo} \
|
|
63
|
+
--source-branch refs/heads/archive/{change-id} \
|
|
64
|
+
--target-branch "refs/heads/$DEFAULT_BRANCH" \
|
|
65
|
+
--title "archive: {title} ({change-id})" \
|
|
66
|
+
--description "Archive SDD artifacts for {change-id} after merge of {sourceRefName}." \
|
|
67
|
+
--auto-complete
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If work was stashed in step 1, restore it after the PR is created unless the user opts out.
|
|
71
|
+
|
|
72
|
+
7. **Report**
|
|
73
|
+
|
|
74
|
+
Display:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
Archive complete
|
|
78
|
+
|
|
79
|
+
Change ID: {change-id}
|
|
80
|
+
Title: {title}
|
|
81
|
+
Original PR: {original-pr-link}
|
|
82
|
+
Archive PR: {archive-pr-link}
|
|
83
|
+
|
|
84
|
+
Documentation updates:
|
|
85
|
+
- ARCHITECTURE.md: {count} changes applied
|
|
86
|
+
- DESIGN.md: {count} changes applied
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Rules
|
|
90
|
+
|
|
91
|
+
- All OpenSpec paths resolve from `git rev-parse --show-toplevel`. Never use `/openspec/...`.
|
|
92
|
+
- Only process top-level directories in `$REPO_ROOT/openspec/changes/`; exclude `archive/`.
|
|
93
|
+
- Use change ID and slug only as search hints; do not assume the source branch name.
|
|
94
|
+
- The oldest eligible merged change is the only candidate: never ask the user which change to archive (but do ask which PR if multiple match one change).
|
|
95
|
+
- Never proceed if the selected PR is not completed.
|
|
96
|
+
- Never use browser tools or direct web requests for Azure DevOps. Use `az` CLI only.
|
|
97
|
+
- Never invent or guess PR, branch, or merge metadata.
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
2. **Find the oldest change with a completed PR**
|
|
2
|
-
|
|
3
|
-
List unarchived changes (top-level only, excludes `archive/`):
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
find "$REPO_ROOT/openspec/changes" -mindepth 1 -maxdepth 1 -type d -not -name 'archive' | sort
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
If empty, report a blocker and stop.
|
|
10
|
-
|
|
11
|
-
List completed PRs:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
gh pr list --repo {owner}/{repo} --state merged --json title,headRefName,mergedAt,number --jq 'sort_by(.mergedAt) | .[] | {name: .title, sourceRefName: .headRefName, mergedAt: .mergedAt, pullRequestId: .number}'
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Match each change to a completed PR using its ID and slug as search hints:
|
|
18
|
-
- No match → skip (record as blocked: `no merged PR found`).
|
|
19
|
-
- One match → eligible.
|
|
20
|
-
- Multiple matches → ask the user which PR belongs to that change.
|
|
21
|
-
|
|
22
|
-
If nothing is eligible, report a blocker and stop. Otherwise select the eligible change with the **oldest** PR `mergedAt` as the candidate.
|
|
23
|
-
|
|
24
|
-
3. **Confirm the candidate**
|
|
25
|
-
|
|
26
|
-
Show the candidate (ID, title, PR ID, merged date) and any blocked changes, then ask:
|
|
27
|
-
|
|
28
|
-
```text
|
|
29
|
-
Oldest unarchived merged change found:
|
|
30
|
-
ID: {change-id}
|
|
31
|
-
Title: {title from resolved PR}
|
|
32
|
-
PR ID: {pullRequestId}
|
|
33
|
-
Merged: {mergedAt}
|
|
34
|
-
|
|
35
|
-
Proceed with archiving? [yes/no]
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Stop if the user does not confirm.
|
|
39
|
-
|
|
40
|
-
4. **Archive the change**
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
git checkout -b archive/{change-id}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Load `@openspec-archive-change` skill and follow it to archive the change.
|
|
47
|
-
|
|
48
|
-
5. **Update docs**
|
|
49
|
-
|
|
50
|
-
Compare the archived change's specs against `ARCHITECTURE.md` and `DESIGN.md`. If updates are needed, show them and get user approval before applying.
|
|
51
|
-
|
|
52
|
-
6. **Create the archive PR**
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
# Stage specific paths only: a shared tree may hold another agent's or a
|
|
56
|
-
# person's edits, and -A commits them under this message.
|
|
57
|
-
git add openspec/changes/ # plus ARCHITECTURE.md / DESIGN.md if step 5 updated them
|
|
58
|
-
git commit -m "archive: {title} ({change-id})"
|
|
59
|
-
git push origin archive/{change-id}
|
|
60
|
-
|
|
61
|
-
gh pr create \
|
|
62
|
-
--repo {owner}/{repo} \
|
|
63
|
-
--base "$DEFAULT_BRANCH" \
|
|
64
|
-
--head archive/{change-id} \
|
|
65
|
-
--title "archive: {title} ({change-id})" \
|
|
66
|
-
--body "Archive SDD artifacts for {change-id} after merge."
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
If work was stashed in step 1, restore it after the PR is created unless the user opts out.
|
|
70
|
-
|
|
71
|
-
7. **Report**
|
|
72
|
-
|
|
73
|
-
Display:
|
|
74
|
-
|
|
75
|
-
```text
|
|
76
|
-
Archive complete
|
|
77
|
-
|
|
78
|
-
Change ID: {change-id}
|
|
79
|
-
Title: {title}
|
|
80
|
-
Original PR: {original-pr-link}
|
|
81
|
-
Archive PR: {archive-pr-link}
|
|
82
|
-
|
|
83
|
-
Documentation updates:
|
|
84
|
-
- ARCHITECTURE.md: {count} changes applied
|
|
85
|
-
- DESIGN.md: {count} changes applied
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Rules
|
|
89
|
-
|
|
90
|
-
- All OpenSpec paths resolve from `git rev-parse --show-toplevel`. Never use `/openspec/...`.
|
|
91
|
-
- Only process top-level directories in `$REPO_ROOT/openspec/changes/`; exclude `archive/`.
|
|
92
|
-
- Use change ID and slug only as search hints; do not assume the source branch name.
|
|
93
|
-
- The oldest eligible merged change is the only candidate: never ask the user which change to archive (but do ask which PR if multiple match one change).
|
|
94
|
-
- Never proceed if the selected PR is not completed.
|
|
95
|
-
- Never use browser tools or direct web requests for GitHub. Use `gh` CLI only.
|
|
96
|
-
- Never invent or guess PR, branch, or merge metadata.
|
|
1
|
+
2. **Find the oldest change with a completed PR**
|
|
2
|
+
|
|
3
|
+
List unarchived changes (top-level only, excludes `archive/`):
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
find "$REPO_ROOT/openspec/changes" -mindepth 1 -maxdepth 1 -type d -not -name 'archive' | sort
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
If empty, report a blocker and stop.
|
|
10
|
+
|
|
11
|
+
List completed PRs:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
gh pr list --repo {owner}/{repo} --state merged --json title,headRefName,mergedAt,number --jq 'sort_by(.mergedAt) | .[] | {name: .title, sourceRefName: .headRefName, mergedAt: .mergedAt, pullRequestId: .number}'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Match each change to a completed PR using its ID and slug as search hints:
|
|
18
|
+
- No match → skip (record as blocked: `no merged PR found`).
|
|
19
|
+
- One match → eligible.
|
|
20
|
+
- Multiple matches → ask the user which PR belongs to that change.
|
|
21
|
+
|
|
22
|
+
If nothing is eligible, report a blocker and stop. Otherwise select the eligible change with the **oldest** PR `mergedAt` as the candidate.
|
|
23
|
+
|
|
24
|
+
3. **Confirm the candidate**
|
|
25
|
+
|
|
26
|
+
Show the candidate (ID, title, PR ID, merged date) and any blocked changes, then ask:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
Oldest unarchived merged change found:
|
|
30
|
+
ID: {change-id}
|
|
31
|
+
Title: {title from resolved PR}
|
|
32
|
+
PR ID: {pullRequestId}
|
|
33
|
+
Merged: {mergedAt}
|
|
34
|
+
|
|
35
|
+
Proceed with archiving? [yes/no]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Stop if the user does not confirm.
|
|
39
|
+
|
|
40
|
+
4. **Archive the change**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git checkout -b archive/{change-id}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Load `@openspec-archive-change` skill and follow it to archive the change.
|
|
47
|
+
|
|
48
|
+
5. **Update docs**
|
|
49
|
+
|
|
50
|
+
Compare the archived change's specs against `ARCHITECTURE.md` and `DESIGN.md`. If updates are needed, show them and get user approval before applying.
|
|
51
|
+
|
|
52
|
+
6. **Create the archive PR**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Stage specific paths only: a shared tree may hold another agent's or a
|
|
56
|
+
# person's edits, and -A commits them under this message.
|
|
57
|
+
git add openspec/changes/ # plus ARCHITECTURE.md / DESIGN.md if step 5 updated them
|
|
58
|
+
git commit -m "archive: {title} ({change-id})"
|
|
59
|
+
git push origin archive/{change-id}
|
|
60
|
+
|
|
61
|
+
gh pr create \
|
|
62
|
+
--repo {owner}/{repo} \
|
|
63
|
+
--base "$DEFAULT_BRANCH" \
|
|
64
|
+
--head archive/{change-id} \
|
|
65
|
+
--title "archive: {title} ({change-id})" \
|
|
66
|
+
--body "Archive SDD artifacts for {change-id} after merge."
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If work was stashed in step 1, restore it after the PR is created unless the user opts out.
|
|
70
|
+
|
|
71
|
+
7. **Report**
|
|
72
|
+
|
|
73
|
+
Display:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Archive complete
|
|
77
|
+
|
|
78
|
+
Change ID: {change-id}
|
|
79
|
+
Title: {title}
|
|
80
|
+
Original PR: {original-pr-link}
|
|
81
|
+
Archive PR: {archive-pr-link}
|
|
82
|
+
|
|
83
|
+
Documentation updates:
|
|
84
|
+
- ARCHITECTURE.md: {count} changes applied
|
|
85
|
+
- DESIGN.md: {count} changes applied
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Rules
|
|
89
|
+
|
|
90
|
+
- All OpenSpec paths resolve from `git rev-parse --show-toplevel`. Never use `/openspec/...`.
|
|
91
|
+
- Only process top-level directories in `$REPO_ROOT/openspec/changes/`; exclude `archive/`.
|
|
92
|
+
- Use change ID and slug only as search hints; do not assume the source branch name.
|
|
93
|
+
- The oldest eligible merged change is the only candidate: never ask the user which change to archive (but do ask which PR if multiple match one change).
|
|
94
|
+
- Never proceed if the selected PR is not completed.
|
|
95
|
+
- Never use browser tools or direct web requests for GitHub. Use `gh` CLI only.
|
|
96
|
+
- Never invent or guess PR, branch, or merge metadata.
|