@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
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
GitLab data comes from the `glab` CLI; a page fetch of gitlab.com is denied (pc-system-reminders). If `glab` is unavailable, report it as a blocker. Always pass `--repo {owner}/{repo}` explicitly, never rely on git context to resolve the repo.
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
### Step 1: Verify feature branch
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
BRANCH="$(git branch --show-current)"
|
|
9
|
-
DEFAULT_BRANCH="$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')"
|
|
10
|
-
[ -z "$DEFAULT_BRANCH" ] && DEFAULT_BRANCH="main"
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
`$BRANCH` must be a work branch (`feature/*` or `bugfix/*`: the `pc-plan-apply` skill creates `feature/{change-slug}`). Never push the default branch.
|
|
14
|
-
|
|
15
|
-
### Step 2: Capture screenshots (if UI changes exist)
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
browser_navigate url="http://localhost:{port}/{route}"
|
|
19
|
-
browser_wait ms=2000
|
|
20
|
-
browser_screenshot
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Save to: `openspec/changes/{change-name}/images/{feature}.png`
|
|
24
|
-
|
|
25
|
-
### Step 3: Commit and push
|
|
26
|
-
|
|
27
|
-
The `pc-plan-apply` skill already committed each task group: usually only screenshots or small residuals remain. Stage the paths you actually changed; unscoped staging is denied (`pc-system-reminders`):
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
git add openspec/changes/{change-name}/images/ # plus any other paths you actually changed
|
|
31
|
-
git commit -m "{change}: {summary}" # only if there is something to commit
|
|
32
|
-
git push -u origin "$BRANCH"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Step 4: Upload screenshots (if any)
|
|
36
|
-
|
|
37
|
-
If screenshots exist, upload them so they can be referenced in the MR description:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
glab api --method POST "projects/:id/uploads" -f "file=@openspec/changes/{change-name}/images/{feature}.png"
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
(`:id` is glab's placeholder for the current project: this is the one sanctioned use of git context in this skill.)
|
|
44
|
-
|
|
45
|
-
Parse the returned `markdown` field: use it to embed the image in the MR description. If the upload fails (the endpoint needs multipart form data and `-f` support varies by glab version), fall back to referencing the image committed on the branch instead.
|
|
46
|
-
|
|
47
|
-
If no UI changes, skip this step.
|
|
48
|
-
|
|
49
|
-
### Step 5: Create Merge Request
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
glab mr create \
|
|
53
|
-
--source-branch "$BRANCH" \
|
|
54
|
-
--target-branch "$DEFAULT_BRANCH" \
|
|
55
|
-
--title "{title}" \
|
|
56
|
-
--description "Closes {issue-link}
|
|
57
|
-
|
|
58
|
-
## Summary
|
|
59
|
-
{summary from proposal.md}
|
|
60
|
-
|
|
61
|
-
## Changes
|
|
62
|
-
{key changes from tasks.md}
|
|
63
|
-
|
|
64
|
-
## Test plan
|
|
65
|
-
- [ ] {checklist of manual verification steps}
|
|
66
|
-
{screenshots if available}" \
|
|
67
|
-
--remove-source-branch \
|
|
68
|
-
--squash-before-merge
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Do NOT use `--yes` unless running in autopilot/non-interactive mode.
|
|
72
|
-
|
|
73
|
-
### Step 6: Report
|
|
74
|
-
|
|
75
|
-
Display:
|
|
76
|
-
|
|
77
|
-
```text
|
|
78
|
-
Merge Request created
|
|
79
|
-
MR: {mr-url}
|
|
80
|
-
Title: {title}
|
|
81
|
-
Source: {branch}
|
|
82
|
-
Target: {default-branch}
|
|
83
|
-
```
|
|
84
|
-
|
|
1
|
+
GitLab data comes from the `glab` CLI; a page fetch of gitlab.com is denied (pc-system-reminders). If `glab` is unavailable, report it as a blocker. Always pass `--repo {owner}/{repo}` explicitly, never rely on git context to resolve the repo.
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
### Step 1: Verify feature branch
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
BRANCH="$(git branch --show-current)"
|
|
9
|
+
DEFAULT_BRANCH="$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')"
|
|
10
|
+
[ -z "$DEFAULT_BRANCH" ] && DEFAULT_BRANCH="main"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`$BRANCH` must be a work branch (`feature/*` or `bugfix/*`: the `pc-plan-apply` skill creates `feature/{change-slug}`). Never push the default branch.
|
|
14
|
+
|
|
15
|
+
### Step 2: Capture screenshots (if UI changes exist)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
browser_navigate url="http://localhost:{port}/{route}"
|
|
19
|
+
browser_wait ms=2000
|
|
20
|
+
browser_screenshot
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Save to: `openspec/changes/{change-name}/images/{feature}.png`
|
|
24
|
+
|
|
25
|
+
### Step 3: Commit and push
|
|
26
|
+
|
|
27
|
+
The `pc-plan-apply` skill already committed each task group: usually only screenshots or small residuals remain. Stage the paths you actually changed; unscoped staging is denied (`pc-system-reminders`):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git add openspec/changes/{change-name}/images/ # plus any other paths you actually changed
|
|
31
|
+
git commit -m "{change}: {summary}" # only if there is something to commit
|
|
32
|
+
git push -u origin "$BRANCH"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Step 4: Upload screenshots (if any)
|
|
36
|
+
|
|
37
|
+
If screenshots exist, upload them so they can be referenced in the MR description:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
glab api --method POST "projects/:id/uploads" -f "file=@openspec/changes/{change-name}/images/{feature}.png"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
(`:id` is glab's placeholder for the current project: this is the one sanctioned use of git context in this skill.)
|
|
44
|
+
|
|
45
|
+
Parse the returned `markdown` field: use it to embed the image in the MR description. If the upload fails (the endpoint needs multipart form data and `-f` support varies by glab version), fall back to referencing the image committed on the branch instead.
|
|
46
|
+
|
|
47
|
+
If no UI changes, skip this step.
|
|
48
|
+
|
|
49
|
+
### Step 5: Create Merge Request
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
glab mr create \
|
|
53
|
+
--source-branch "$BRANCH" \
|
|
54
|
+
--target-branch "$DEFAULT_BRANCH" \
|
|
55
|
+
--title "{title}" \
|
|
56
|
+
--description "Closes {issue-link}
|
|
57
|
+
|
|
58
|
+
## Summary
|
|
59
|
+
{summary from proposal.md}
|
|
60
|
+
|
|
61
|
+
## Changes
|
|
62
|
+
{key changes from tasks.md}
|
|
63
|
+
|
|
64
|
+
## Test plan
|
|
65
|
+
- [ ] {checklist of manual verification steps}
|
|
66
|
+
{screenshots if available}" \
|
|
67
|
+
--remove-source-branch \
|
|
68
|
+
--squash-before-merge
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Do NOT use `--yes` unless running in autopilot/non-interactive mode.
|
|
72
|
+
|
|
73
|
+
### Step 6: Report
|
|
74
|
+
|
|
75
|
+
Display:
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
Merge Request created
|
|
79
|
+
MR: {mr-url}
|
|
80
|
+
Title: {title}
|
|
81
|
+
Source: {branch}
|
|
82
|
+
Target: {default-branch}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
85
|
---
|
package/cli/index.js
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import chalk from 'chalk'
|
|
3
|
-
import { createRequire } from 'node:module'
|
|
4
|
-
import { runJoin } from './commands/join.js'
|
|
5
|
-
import { runUpdate } from './commands/update.js'
|
|
6
|
-
import { runSingleCommand } from './commands/single.js'
|
|
7
|
-
import { runWizard } from './commands/wizard.js'
|
|
8
|
-
import { exit } from './utils/process.js'
|
|
9
|
-
import { runMigrateCommand } from './commands/migrate.js'
|
|
10
|
-
import { findLegacyInstall } from './utils/legacy-check.js'
|
|
11
|
-
|
|
12
|
-
function printHelp(version) {
|
|
13
|
-
console.log(`agent-harness v${version}`)
|
|
14
|
-
console.log()
|
|
15
|
-
console.log('Usage:')
|
|
16
|
-
console.log(' npx @plainconceptsplatform/agent-harness Install the harness (full wizard)')
|
|
17
|
-
console.log(' npx @plainconceptsplatform/agent-harness <command> Run a single step command')
|
|
18
|
-
console.log()
|
|
19
|
-
console.log('Commands:')
|
|
20
|
-
console.log(' update Bring the harness up to date from saved config (no prompts)')
|
|
21
|
-
console.log(' migrate Move a v1 (opencode-onboard) project to v2, keeping your content')
|
|
22
|
-
console.log(' join Set up a teammate\'s machine (checks & local installs only)')
|
|
23
|
-
console.log(' clean Run AI files cleanup step')
|
|
24
|
-
console.log(' platform Run platform selection step')
|
|
25
|
-
console.log(' copy Run content copy step')
|
|
26
|
-
console.log(' openspec Run OpenSpec initialization step')
|
|
27
|
-
console.log(' models Run models selection step')
|
|
28
|
-
console.log(' optimization Run token optimization tools step')
|
|
29
|
-
console.log(' browser Run agent-browser installer step')
|
|
30
|
-
console.log(' metadata Write onboarding metadata step')
|
|
31
|
-
console.log()
|
|
32
|
-
console.log('Options:')
|
|
33
|
-
console.log(' -h, --help Show this help message')
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (process.stdout.isTTY) console.clear()
|
|
37
|
-
console.log()
|
|
38
|
-
const require = createRequire(import.meta.url)
|
|
39
|
-
const { version } = require('../package.json')
|
|
40
|
-
const args = process.argv.slice(2)
|
|
41
|
-
|
|
42
|
-
if (args.includes('-h') || args.includes('--help')) {
|
|
43
|
-
printHelp(version)
|
|
44
|
-
exit()
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async function refuseLegacyInstall() {
|
|
48
|
-
const legacy = await findLegacyInstall()
|
|
49
|
-
if (!legacy) return false
|
|
50
|
-
|
|
51
|
-
console.log(chalk.red('This project was set up by opencode-onboard v1.'))
|
|
52
|
-
console.log()
|
|
53
|
-
if (legacy.files.length > 0) console.log(chalk.dim(` config: ${legacy.files.join(', ')}`))
|
|
54
|
-
if (legacy.skills.length > 0) {
|
|
55
|
-
const shown = legacy.skills.slice(0, 3).join(', ')
|
|
56
|
-
const rest = legacy.skills.length > 3 ? `, +${legacy.skills.length - 3} more` : ''
|
|
57
|
-
console.log(chalk.dim(` skills: ${shown}${rest}`))
|
|
58
|
-
}
|
|
59
|
-
console.log()
|
|
60
|
-
console.log('agent-harness v2 renamed both the config files and the skill prefix,')
|
|
61
|
-
console.log('and it does not migrate v1 projects. Continuing would leave the harness')
|
|
62
|
-
console.log('half-patched without reporting an error.')
|
|
63
|
-
console.log()
|
|
64
|
-
console.log('Migrate it, keeping your generated skills and custom engineers:')
|
|
65
|
-
console.log(chalk.dim(' npx @plainconceptsplatform/agent-harness migrate'))
|
|
66
|
-
console.log(chalk.dim(' npx @plainconceptsplatform/agent-harness update'))
|
|
67
|
-
console.log()
|
|
68
|
-
console.log(chalk.dim('Add --dry-run to see what migrate would change first.'))
|
|
69
|
-
return true
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Ctrl-C out of an @inquirer prompt throws ExitPromptError; that is a normal
|
|
73
|
-
// cancellation, not a crash, so it must not exit non-zero.
|
|
74
|
-
async function main() {
|
|
75
|
-
// migrate is the way out of a v1 project, so it must run before the guard
|
|
76
|
-
// that refuses v1 projects.
|
|
77
|
-
if (args[0] === 'migrate') {
|
|
78
|
-
await runMigrateCommand(args.slice(1))
|
|
79
|
-
return
|
|
80
|
-
}
|
|
81
|
-
if (await refuseLegacyInstall()) {
|
|
82
|
-
exit(1)
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
if (args.length === 0) {
|
|
86
|
-
await runWizard(version)
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
if (args[0] === 'join') {
|
|
90
|
-
await runJoin()
|
|
91
|
-
return
|
|
92
|
-
}
|
|
93
|
-
if (args[0] === 'update') {
|
|
94
|
-
await runUpdate()
|
|
95
|
-
return
|
|
96
|
-
}
|
|
97
|
-
if (!await runSingleCommand(args[0])) {
|
|
98
|
-
console.log(chalk.red(`Unknown command: ${args[0]}`))
|
|
99
|
-
console.log()
|
|
100
|
-
printHelp(version)
|
|
101
|
-
exit(1)
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
try {
|
|
106
|
-
await main()
|
|
107
|
-
} catch (err) {
|
|
108
|
-
if (err.name === 'ExitPromptError') {
|
|
109
|
-
console.log()
|
|
110
|
-
console.log(chalk.yellow('Cancelled.'))
|
|
111
|
-
} else {
|
|
112
|
-
console.error(chalk.red('\nUnexpected error:'), err.message)
|
|
113
|
-
exit(1)
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exit()
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import chalk from 'chalk'
|
|
3
|
+
import { createRequire } from 'node:module'
|
|
4
|
+
import { runJoin } from './commands/join.js'
|
|
5
|
+
import { runUpdate } from './commands/update.js'
|
|
6
|
+
import { runSingleCommand } from './commands/single.js'
|
|
7
|
+
import { runWizard } from './commands/wizard.js'
|
|
8
|
+
import { exit } from './utils/process.js'
|
|
9
|
+
import { runMigrateCommand } from './commands/migrate.js'
|
|
10
|
+
import { findLegacyInstall } from './utils/legacy-check.js'
|
|
11
|
+
|
|
12
|
+
function printHelp(version) {
|
|
13
|
+
console.log(`agent-harness v${version}`)
|
|
14
|
+
console.log()
|
|
15
|
+
console.log('Usage:')
|
|
16
|
+
console.log(' npx @plainconceptsplatform/agent-harness Install the harness (full wizard)')
|
|
17
|
+
console.log(' npx @plainconceptsplatform/agent-harness <command> Run a single step command')
|
|
18
|
+
console.log()
|
|
19
|
+
console.log('Commands:')
|
|
20
|
+
console.log(' update Bring the harness up to date from saved config (no prompts)')
|
|
21
|
+
console.log(' migrate Move a v1 (opencode-onboard) project to v2, keeping your content')
|
|
22
|
+
console.log(' join Set up a teammate\'s machine (checks & local installs only)')
|
|
23
|
+
console.log(' clean Run AI files cleanup step')
|
|
24
|
+
console.log(' platform Run platform selection step')
|
|
25
|
+
console.log(' copy Run content copy step')
|
|
26
|
+
console.log(' openspec Run OpenSpec initialization step')
|
|
27
|
+
console.log(' models Run models selection step')
|
|
28
|
+
console.log(' optimization Run token optimization tools step')
|
|
29
|
+
console.log(' browser Run agent-browser installer step')
|
|
30
|
+
console.log(' metadata Write onboarding metadata step')
|
|
31
|
+
console.log()
|
|
32
|
+
console.log('Options:')
|
|
33
|
+
console.log(' -h, --help Show this help message')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (process.stdout.isTTY) console.clear()
|
|
37
|
+
console.log()
|
|
38
|
+
const require = createRequire(import.meta.url)
|
|
39
|
+
const { version } = require('../package.json')
|
|
40
|
+
const args = process.argv.slice(2)
|
|
41
|
+
|
|
42
|
+
if (args.includes('-h') || args.includes('--help')) {
|
|
43
|
+
printHelp(version)
|
|
44
|
+
exit()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function refuseLegacyInstall() {
|
|
48
|
+
const legacy = await findLegacyInstall()
|
|
49
|
+
if (!legacy) return false
|
|
50
|
+
|
|
51
|
+
console.log(chalk.red('This project was set up by opencode-onboard v1.'))
|
|
52
|
+
console.log()
|
|
53
|
+
if (legacy.files.length > 0) console.log(chalk.dim(` config: ${legacy.files.join(', ')}`))
|
|
54
|
+
if (legacy.skills.length > 0) {
|
|
55
|
+
const shown = legacy.skills.slice(0, 3).join(', ')
|
|
56
|
+
const rest = legacy.skills.length > 3 ? `, +${legacy.skills.length - 3} more` : ''
|
|
57
|
+
console.log(chalk.dim(` skills: ${shown}${rest}`))
|
|
58
|
+
}
|
|
59
|
+
console.log()
|
|
60
|
+
console.log('agent-harness v2 renamed both the config files and the skill prefix,')
|
|
61
|
+
console.log('and it does not migrate v1 projects. Continuing would leave the harness')
|
|
62
|
+
console.log('half-patched without reporting an error.')
|
|
63
|
+
console.log()
|
|
64
|
+
console.log('Migrate it, keeping your generated skills and custom engineers:')
|
|
65
|
+
console.log(chalk.dim(' npx @plainconceptsplatform/agent-harness migrate'))
|
|
66
|
+
console.log(chalk.dim(' npx @plainconceptsplatform/agent-harness update'))
|
|
67
|
+
console.log()
|
|
68
|
+
console.log(chalk.dim('Add --dry-run to see what migrate would change first.'))
|
|
69
|
+
return true
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Ctrl-C out of an @inquirer prompt throws ExitPromptError; that is a normal
|
|
73
|
+
// cancellation, not a crash, so it must not exit non-zero.
|
|
74
|
+
async function main() {
|
|
75
|
+
// migrate is the way out of a v1 project, so it must run before the guard
|
|
76
|
+
// that refuses v1 projects.
|
|
77
|
+
if (args[0] === 'migrate') {
|
|
78
|
+
await runMigrateCommand(args.slice(1))
|
|
79
|
+
return
|
|
80
|
+
}
|
|
81
|
+
if (await refuseLegacyInstall()) {
|
|
82
|
+
exit(1)
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
if (args.length === 0) {
|
|
86
|
+
await runWizard(version)
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
if (args[0] === 'join') {
|
|
90
|
+
await runJoin()
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
if (args[0] === 'update') {
|
|
94
|
+
await runUpdate()
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
if (!await runSingleCommand(args[0])) {
|
|
98
|
+
console.log(chalk.red(`Unknown command: ${args[0]}`))
|
|
99
|
+
console.log()
|
|
100
|
+
printHelp(version)
|
|
101
|
+
exit(1)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
await main()
|
|
107
|
+
} catch (err) {
|
|
108
|
+
if (err.name === 'ExitPromptError') {
|
|
109
|
+
console.log()
|
|
110
|
+
console.log(chalk.yellow('Cancelled.'))
|
|
111
|
+
} else {
|
|
112
|
+
console.error(chalk.red('\nUnexpected error:'), err.message)
|
|
113
|
+
exit(1)
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exit()
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"platform": {
|
|
3
|
-
"none": {
|
|
4
|
-
"workflow": "There is no backlog and no PR integration here, so the work arrives in the conversation and the local repository is the only context.\n\n- A described feature, bug or refactor: clarify if needed, then `pc-plan-propose` when the change is worth planning, or straight to `pc-plan-apply`.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`.\n- `just do it` or `quick fix`: work in this session, no proposal, no ceremony.\n\nA GitHub or Azure DevOps URL is not a trigger in this mode; re-run onboarding to configure a platform.",
|
|
5
|
-
"skillsGuide": "No platform skills installed (platform: none). Work from direct user instructions and local OpenSpec artifacts only."
|
|
6
|
-
},
|
|
7
|
-
"azure": {
|
|
8
|
-
"workflow": "An Azure DevOps work item or PR URL in the user's message means run the pipeline, in whatever words it arrives, unless they asked for analysis or context only.\n\n- Work item URL: `pc-userstory` to parse it, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n- A PR URL with a feedback or fix request: read the PR comments, fix, update the PR.",
|
|
9
|
-
"skillsGuide": "Platform skills (Azure DevOps):\n- `@pc-userstory`: load when an Azure DevOps work item URL is detected. Fetches the work item via `az` CLI and creates an OpenSpec change. NEVER use browser tools for Azure DevOps operations.\n- `pc-ops-ship`: load in ship mode to create a PR and link the work item, or in feedback mode to read and classify PR review comments."
|
|
10
|
-
},
|
|
11
|
-
"github": {
|
|
12
|
-
"workflow": "A GitHub Issue or PR URL in the user's message means run the pipeline, in whatever words it arrives, unless they asked for analysis or context only.\n\n- Issue URL: `pc-userstory` to parse it, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n- A PR URL with a feedback or fix request: read the PR comments, fix, update the PR.",
|
|
13
|
-
"skillsGuide": "Platform skills (GitHub):\n- `@pc-userstory`: load when a GitHub Issue URL is detected. Fetches the issue via `gh` CLI and creates an OpenSpec change. NEVER use webfetch to access GitHub URLs.\n- `pc-ops-ship`: load in ship mode to create a PR with screenshots, or in feedback mode to read and classify PR review comments."
|
|
14
|
-
},
|
|
15
|
-
"mixed": {
|
|
16
|
-
"default": {
|
|
17
|
-
"workflow": "The backlog and the repo are on different platforms here: `.opencode/harness.json` → `platform.backlog` and `platform.repo`. Never cross them. Work items always come from the backlog CLI and pull requests always from the repo CLI, or the command fails against the wrong host and the fallback is a page fetch that is denied.\n\nA work item URL, or a PR URL with a feedback request, means run the pipeline, in whatever words it arrives, unless the user asked for analysis or context only.\n\n- Work item URL or issue key: `pc-userstory` (backlog CLI) to parse it, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, `pc-ops-ship` (repo CLI) to ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n- A PR or MR URL with a feedback or fix request: read its comments through the repo CLI, fix, update it.",
|
|
18
|
-
"skillsGuide": "Mixed platform setup: the two platform skills target different hosts:\n- `@pc-userstory` → fetches work items from the backlog platform. Load when a work-item URL or issue key is provided.\n- `pc-ops-ship` → creates PRs/MRs and triages review feedback on the repo platform. Load in ship mode or PR-feedback mode."
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"jira": {
|
|
22
|
-
"workflow": "A Jira URL or a bare issue key (`PROJ-123`) means run the pipeline, in whatever words it arrives, unless they asked for analysis or context only.\n\n- Either one: `pc-userstory` to fetch it through `acli jira`, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n\nJira has no pull requests: PR work runs on the repo platform in `platform.repo`.",
|
|
23
|
-
"skillsGuide": "### Backlog Platform: Jira\n- `pc-userstory` -> fetches Jira work items via `acli jira` CLI. Load when a Jira URL or issue key is provided.\n\n### Repo Platform\n- PR skills are loaded based on `platform.repo` (GitHub or Azure DevOps)."
|
|
24
|
-
},
|
|
25
|
-
"gitlab": {
|
|
26
|
-
"workflow": "A backlog work item URL, or a GitLab MR URL with a feedback request, means run the pipeline, in whatever words it arrives, unless they asked for analysis or context only.\n\n- Work item URL: `pc-userstory` to fetch it through the backlog CLI, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n- An MR URL with a feedback or fix request: `glab mr note list`, triage, fix, update the MR.\n\nGitLab has no backlog here: work items come from the platform in `platform.backlog`.",
|
|
27
|
-
"skillsGuide": "### Repo Platform: GitLab\n- `pc-ops-ship` -> creates GitLab merge requests via `glab` CLI. Load when shipping a branch or processing MR feedback.\n\n### Backlog Platform\n- Work item skills are loaded based on `platform.backlog` (GitHub / Azure / Jira)."
|
|
28
|
-
},
|
|
29
|
-
"browser": {
|
|
30
|
-
"workflow": "Any work item URL means run the pipeline, whichever tool it points at, unless the user asked for analysis or context only.\n\n- The URL: `pc-userstory` to open and read the page, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n\nBrowser is backlog-only: PR work runs on the repo platform in `platform.repo`.",
|
|
31
|
-
"skillsGuide": "### Backlog Platform: Others (Browser)\n- `pc-userstory` -> opens work item URLs via agent-browser, reads page content, creates OpenSpec changes. Load when a URL the user provides does not match GitHub/Azure/Jira CLI platforms.\n\n### Repo Platform\n- PR skills are loaded based on `platform.repo` (GitHub / Azure DevOps / GitLab)."
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"platform": {
|
|
3
|
+
"none": {
|
|
4
|
+
"workflow": "There is no backlog and no PR integration here, so the work arrives in the conversation and the local repository is the only context.\n\n- A described feature, bug or refactor: clarify if needed, then `pc-plan-propose` when the change is worth planning, or straight to `pc-plan-apply`.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`.\n- `just do it` or `quick fix`: work in this session, no proposal, no ceremony.\n\nA GitHub or Azure DevOps URL is not a trigger in this mode; re-run onboarding to configure a platform.",
|
|
5
|
+
"skillsGuide": "No platform skills installed (platform: none). Work from direct user instructions and local OpenSpec artifacts only."
|
|
6
|
+
},
|
|
7
|
+
"azure": {
|
|
8
|
+
"workflow": "An Azure DevOps work item or PR URL in the user's message means run the pipeline, in whatever words it arrives, unless they asked for analysis or context only.\n\n- Work item URL: `pc-userstory` to parse it, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n- A PR URL with a feedback or fix request: read the PR comments, fix, update the PR.",
|
|
9
|
+
"skillsGuide": "Platform skills (Azure DevOps):\n- `@pc-userstory`: load when an Azure DevOps work item URL is detected. Fetches the work item via `az` CLI and creates an OpenSpec change. NEVER use browser tools for Azure DevOps operations.\n- `pc-ops-ship`: load in ship mode to create a PR and link the work item, or in feedback mode to read and classify PR review comments."
|
|
10
|
+
},
|
|
11
|
+
"github": {
|
|
12
|
+
"workflow": "A GitHub Issue or PR URL in the user's message means run the pipeline, in whatever words it arrives, unless they asked for analysis or context only.\n\n- Issue URL: `pc-userstory` to parse it, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n- A PR URL with a feedback or fix request: read the PR comments, fix, update the PR.",
|
|
13
|
+
"skillsGuide": "Platform skills (GitHub):\n- `@pc-userstory`: load when a GitHub Issue URL is detected. Fetches the issue via `gh` CLI and creates an OpenSpec change. NEVER use webfetch to access GitHub URLs.\n- `pc-ops-ship`: load in ship mode to create a PR with screenshots, or in feedback mode to read and classify PR review comments."
|
|
14
|
+
},
|
|
15
|
+
"mixed": {
|
|
16
|
+
"default": {
|
|
17
|
+
"workflow": "The backlog and the repo are on different platforms here: `.opencode/harness.json` → `platform.backlog` and `platform.repo`. Never cross them. Work items always come from the backlog CLI and pull requests always from the repo CLI, or the command fails against the wrong host and the fallback is a page fetch that is denied.\n\nA work item URL, or a PR URL with a feedback request, means run the pipeline, in whatever words it arrives, unless the user asked for analysis or context only.\n\n- Work item URL or issue key: `pc-userstory` (backlog CLI) to parse it, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, `pc-ops-ship` (repo CLI) to ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n- A PR or MR URL with a feedback or fix request: read its comments through the repo CLI, fix, update it.",
|
|
18
|
+
"skillsGuide": "Mixed platform setup: the two platform skills target different hosts:\n- `@pc-userstory` → fetches work items from the backlog platform. Load when a work-item URL or issue key is provided.\n- `pc-ops-ship` → creates PRs/MRs and triages review feedback on the repo platform. Load in ship mode or PR-feedback mode."
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"jira": {
|
|
22
|
+
"workflow": "A Jira URL or a bare issue key (`PROJ-123`) means run the pipeline, in whatever words it arrives, unless they asked for analysis or context only.\n\n- Either one: `pc-userstory` to fetch it through `acli jira`, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n\nJira has no pull requests: PR work runs on the repo platform in `platform.repo`.",
|
|
23
|
+
"skillsGuide": "### Backlog Platform: Jira\n- `pc-userstory` -> fetches Jira work items via `acli jira` CLI. Load when a Jira URL or issue key is provided.\n\n### Repo Platform\n- PR skills are loaded based on `platform.repo` (GitHub or Azure DevOps)."
|
|
24
|
+
},
|
|
25
|
+
"gitlab": {
|
|
26
|
+
"workflow": "A backlog work item URL, or a GitLab MR URL with a feedback request, means run the pipeline, in whatever words it arrives, unless they asked for analysis or context only.\n\n- Work item URL: `pc-userstory` to fetch it through the backlog CLI, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n- An MR URL with a feedback or fix request: `glab mr note list`, triage, fix, update the MR.\n\nGitLab has no backlog here: work items come from the platform in `platform.backlog`.",
|
|
27
|
+
"skillsGuide": "### Repo Platform: GitLab\n- `pc-ops-ship` -> creates GitLab merge requests via `glab` CLI. Load when shipping a branch or processing MR feedback.\n\n### Backlog Platform\n- Work item skills are loaded based on `platform.backlog` (GitHub / Azure / Jira)."
|
|
28
|
+
},
|
|
29
|
+
"browser": {
|
|
30
|
+
"workflow": "Any work item URL means run the pipeline, whichever tool it points at, unless the user asked for analysis or context only.\n\n- The URL: `pc-userstory` to open and read the page, `pc-plan-propose` for the plan, confirm, `pc-plan-apply` to build, then ship.\n- An existing OpenSpec change, plus any of `implement` / `start` / `go`: `pc-plan-apply`, then ship.\n\nBrowser is backlog-only: PR work runs on the repo platform in `platform.repo`.",
|
|
31
|
+
"skillsGuide": "### Backlog Platform: Others (Browser)\n- `pc-userstory` -> opens work item URLs via agent-browser, reads page content, creates OpenSpec changes. Load when a URL the user provides does not match GitHub/Azure/Jira CLI platforms.\n\n### Repo Platform\n- PR skills are loaded based on `platform.repo` (GitHub / Azure DevOps / GitLab)."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
package/cli/presets/browser.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"installer": {
|
|
3
|
-
"command": "npm",
|
|
4
|
-
"args": ["install", "-g", "agent-browser@0.36.0"]
|
|
5
|
-
},
|
|
6
|
-
"chromeSetup": {
|
|
7
|
-
"command": "agent-browser",
|
|
8
|
-
"args": ["install"]
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"installer": {
|
|
3
|
+
"command": "npm",
|
|
4
|
+
"args": ["install", "-g", "agent-browser@0.36.0"]
|
|
5
|
+
},
|
|
6
|
+
"chromeSetup": {
|
|
7
|
+
"command": "agent-browser",
|
|
8
|
+
"args": ["install"]
|
|
9
|
+
}
|
|
10
|
+
}
|
package/cli/presets/clean.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"preserve": ["DESIGN.md", "ARCHITECTURE.md", "openspec"],
|
|
3
|
-
"detectFiles": [
|
|
4
|
-
"AGENTS.md",
|
|
5
|
-
"CLAUDE.md",
|
|
6
|
-
"ARCHITECTURE.md",
|
|
7
|
-
"DESIGN.md",
|
|
8
|
-
".cursorrules",
|
|
9
|
-
".clinerules",
|
|
10
|
-
".windsurfrules",
|
|
11
|
-
".github/copilot-instructions.md",
|
|
12
|
-
"copilot-instructions.md",
|
|
13
|
-
".aider.conf.yml",
|
|
14
|
-
".aider",
|
|
15
|
-
".opencode",
|
|
16
|
-
".agents"
|
|
17
|
-
],
|
|
18
|
-
"directoryTargets": [".opencode", ".agents"],
|
|
19
|
-
"preserveSubfolders": ["skills"],
|
|
20
|
-
"selectionMessage": "Select AI config files to remove:"
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"preserve": ["DESIGN.md", "ARCHITECTURE.md", "openspec"],
|
|
3
|
+
"detectFiles": [
|
|
4
|
+
"AGENTS.md",
|
|
5
|
+
"CLAUDE.md",
|
|
6
|
+
"ARCHITECTURE.md",
|
|
7
|
+
"DESIGN.md",
|
|
8
|
+
".cursorrules",
|
|
9
|
+
".clinerules",
|
|
10
|
+
".windsurfrules",
|
|
11
|
+
".github/copilot-instructions.md",
|
|
12
|
+
"copilot-instructions.md",
|
|
13
|
+
".aider.conf.yml",
|
|
14
|
+
".aider",
|
|
15
|
+
".opencode",
|
|
16
|
+
".agents"
|
|
17
|
+
],
|
|
18
|
+
"directoryTargets": [".opencode", ".agents"],
|
|
19
|
+
"preserveSubfolders": ["skills"],
|
|
20
|
+
"selectionMessage": "Select AI config files to remove:"
|
|
21
|
+
}
|