@osfactory/har 0.64.2 → 1.0.0-rc.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.
Files changed (141) hide show
  1. package/dist/index.js +15675 -6536
  2. package/dist/prompts/system-authoring.md +155 -0
  3. package/dist/templates/adaptation-prompt-init.md +67 -43
  4. package/dist/templates/adaptation-prompt-maintain.md +38 -38
  5. package/dist/templates/agent-skills/har-maintain.md +2 -2
  6. package/dist/templates/agent-skills/setup-har.md +6 -4
  7. package/dist/templates/cursor-rule.mdc.template +3 -3
  8. package/dist/templates/har-boilerplate/docker-compose.agent.yml +1 -1
  9. package/dist/templates/har-boilerplate/harness.env +11 -155
  10. package/dist/templates/har-boilerplate/stages.json +51 -2
  11. package/dist/templates/har-boilerplate-cli/docker-compose.agent.yml +1 -1
  12. package/dist/templates/har-boilerplate-cli/harness.env +12 -138
  13. package/dist/templates/har-boilerplate-cli/stages.json +42 -2
  14. package/dist/templates/har-boilerplate-ios/harness.env +10 -126
  15. package/dist/templates/har-boilerplate-ios/stages.json +42 -2
  16. package/dist/templates/migration-prompt.md +54 -0
  17. package/dist/templates/plugins/custom-stage-skeleton.sh +11 -20
  18. package/dist/templates/plugins/gitleaks/.github/workflows/gitleaks.yml +1 -1
  19. package/dist/templates/plugins/gitleaks/.har/stages/GITLEAKS.md +1 -1
  20. package/dist/templates/plugins/gitleaks/.har/stages/secrets-scan.sh +8 -23
  21. package/dist/templates/plugins/gitleaks/README.md +1 -1
  22. package/dist/templates/plugins/gitleaks/template.manifest.json +20 -5
  23. package/dist/templates/plugins/kerno/.github/workflows/kerno.yml +1 -1
  24. package/dist/templates/plugins/kerno/.har/stages/backend-validation.sh +8 -23
  25. package/dist/templates/plugins/kerno/README.md +1 -1
  26. package/dist/templates/plugins/kerno/template.manifest.json +20 -9
  27. package/dist/templates/plugins/local-plugin-skeleton/README.md +46 -0
  28. package/dist/templates/plugins/playwright/.har/stages/browser-e2e.sh +8 -23
  29. package/dist/templates/plugins/playwright/template.manifest.json +36 -13
  30. package/dist/templates/plugins/rocketsim/.har/stages/rocketsim-flows.sh +8 -23
  31. package/dist/templates/plugins/rocketsim/template.manifest.json +20 -8
  32. package/dist/templates/plugins/semgrep/.har/stages/sast.sh +10 -26
  33. package/dist/templates/plugins/semgrep/README.md +1 -1
  34. package/dist/templates/plugins/semgrep/template.manifest.json +16 -7
  35. package/dist/templates/plugins/trivy/.har/stages/vuln-scan.sh +8 -23
  36. package/dist/templates/plugins/trivy/README.md +1 -1
  37. package/dist/templates/plugins/trivy/template.manifest.json +20 -8
  38. package/dist/templates/{har-boilerplate-cli/CLAUDE.agent.md → profiles/cli/docs/claude-agent/definition-of-done.md} +0 -42
  39. package/dist/templates/profiles/cli/docs/claude-agent/do-not.md +6 -0
  40. package/dist/templates/profiles/cli/docs/claude-agent/environment.md +12 -0
  41. package/dist/templates/profiles/cli/docs/claude-agent/project-commands.md +10 -0
  42. package/dist/templates/profiles/cli/docs/claude-agent/readiness.md +6 -0
  43. package/dist/templates/profiles/cli/docs/readme/for-coding-agents.md +9 -0
  44. package/dist/templates/profiles/cli/docs/readme/intro.md +7 -0
  45. package/dist/templates/profiles/cli/docs/readme/port-shared-services-cli-profile.md +25 -0
  46. package/dist/templates/profiles/cli/docs/readme/quick-start.md +24 -0
  47. package/dist/templates/profiles/cli/docs/readme/verification-contract.md +22 -0
  48. package/dist/templates/profiles/cli/docs/readme/what-s-in-here.md +27 -0
  49. package/dist/templates/profiles/cli/profile.manifest.json +56 -1
  50. package/dist/templates/profiles/default/docs/claude-agent/definition-of-done.md +24 -0
  51. package/dist/templates/profiles/default/docs/claude-agent/do-not.md +10 -0
  52. package/dist/templates/profiles/default/docs/claude-agent/environment.md +19 -0
  53. package/dist/templates/profiles/default/docs/claude-agent/project-commands.md +10 -0
  54. package/dist/templates/profiles/default/docs/claude-agent/readiness.md +12 -0
  55. package/dist/templates/profiles/default/docs/readme/architecture.md +11 -0
  56. package/dist/templates/profiles/default/docs/readme/for-coding-agents.md +9 -0
  57. package/dist/templates/profiles/default/docs/readme/intro.md +7 -0
  58. package/dist/templates/profiles/default/docs/readme/port-shared-services.md +41 -0
  59. package/dist/templates/profiles/default/docs/readme/quick-start.md +24 -0
  60. package/dist/templates/profiles/default/docs/readme/readiness-layers.md +16 -0
  61. package/dist/templates/profiles/default/docs/readme/verification-contract.md +17 -0
  62. package/dist/templates/profiles/default/docs/readme/what-s-in-here.md +28 -0
  63. package/dist/templates/profiles/default/profile.manifest.json +62 -1
  64. package/dist/templates/profiles/ios/docs/claude-agent/definition-of-done.md +23 -0
  65. package/dist/templates/profiles/ios/docs/claude-agent/do-not.md +6 -0
  66. package/dist/templates/profiles/ios/docs/claude-agent/environment.md +14 -0
  67. package/dist/templates/profiles/ios/docs/claude-agent/intro.md +3 -0
  68. package/dist/templates/profiles/ios/docs/claude-agent/project-commands.md +21 -0
  69. package/dist/templates/profiles/ios/docs/claude-agent/readiness.md +6 -0
  70. package/dist/templates/profiles/ios/docs/claude-agent/user-flow-validation-rocketsim.md +11 -0
  71. package/dist/templates/profiles/ios/docs/readme/configuration.md +7 -0
  72. package/dist/templates/profiles/ios/docs/readme/intro.md +7 -0
  73. package/dist/templates/profiles/ios/docs/readme/port-shared-services-ios-profile.md +25 -0
  74. package/dist/templates/profiles/ios/docs/readme/quick-start.md +22 -0
  75. package/dist/templates/profiles/ios/docs/readme/simulators.md +45 -0
  76. package/dist/templates/profiles/ios/docs/readme/user-flow-validation.md +9 -0
  77. package/dist/templates/profiles/ios/docs/readme/verification-contract.md +13 -0
  78. package/dist/templates/profiles/ios/docs/readme/what-s-in-here.md +27 -0
  79. package/dist/templates/profiles/ios/profile.manifest.json +59 -3
  80. package/dist/templates/runtime-bundles/pm2-runtime/attach.sh +8 -15
  81. package/dist/templates/runtime-bundles/pm2-runtime/env.template +1 -1
  82. package/dist/templates/runtime-bundles/pm2-runtime/stages/api-health.sh +9 -0
  83. package/dist/templates/runtime-bundles/shared-kernel/STAGES.md +32 -18
  84. package/dist/templates/runtime-bundles/shared-kernel/agent-cli.sh +35 -0
  85. package/dist/templates/runtime-bundles/shared-kernel/launch.sh +35 -0
  86. package/dist/templates/runtime-bundles/shared-kernel/lib/verify-runner.mjs +129 -0
  87. package/dist/templates/runtime-bundles/shared-kernel/preflight.sh +35 -0
  88. package/dist/templates/runtime-bundles/shared-kernel/setup-infra.sh +35 -0
  89. package/dist/templates/runtime-bundles/shared-kernel/stages/README.sh +1 -1
  90. package/dist/templates/runtime-bundles/shared-kernel/stages/readiness.sh +14 -0
  91. package/dist/templates/runtime-bundles/shared-kernel/teardown.sh +35 -0
  92. package/dist/templates/runtime-bundles/shared-kernel/verify.sh +35 -0
  93. package/dist/templates/shared-docs/claude-agent/intro.md +3 -0
  94. package/dist/templates/shared-docs/readme/maintaining-this-harness.md +14 -0
  95. package/dist/templates/shared-docs/readme/run-history.md +5 -0
  96. package/dist/templates/shared-docs/readme/session-lifecycle.md +20 -0
  97. package/package.json +1 -1
  98. package/dist/templates/har-boilerplate/CLAUDE.agent.md +0 -83
  99. package/dist/templates/har-boilerplate/README.md +0 -199
  100. package/dist/templates/har-boilerplate/STAGES.md +0 -99
  101. package/dist/templates/har-boilerplate/agent-cli.sh +0 -225
  102. package/dist/templates/har-boilerplate/agent-slot.sh +0 -850
  103. package/dist/templates/har-boilerplate/attach.sh +0 -22
  104. package/dist/templates/har-boilerplate/ecosystem.agent.template.cjs +0 -52
  105. package/dist/templates/har-boilerplate/env.template +0 -40
  106. package/dist/templates/har-boilerplate/launch.sh +0 -323
  107. package/dist/templates/har-boilerplate/preflight.sh +0 -32
  108. package/dist/templates/har-boilerplate/provision-toolchain.sh +0 -766
  109. package/dist/templates/har-boilerplate/setup-infra.sh +0 -178
  110. package/dist/templates/har-boilerplate/stages/README.sh +0 -11
  111. package/dist/templates/har-boilerplate/teardown.sh +0 -87
  112. package/dist/templates/har-boilerplate/verify.sh +0 -249
  113. package/dist/templates/har-boilerplate-cli/README.md +0 -157
  114. package/dist/templates/har-boilerplate-cli/STAGES.md +0 -99
  115. package/dist/templates/har-boilerplate-cli/agent-cli.sh +0 -160
  116. package/dist/templates/har-boilerplate-cli/agent-slot.sh +0 -832
  117. package/dist/templates/har-boilerplate-cli/launch.sh +0 -216
  118. package/dist/templates/har-boilerplate-cli/preflight.sh +0 -28
  119. package/dist/templates/har-boilerplate-cli/provision-toolchain.sh +0 -766
  120. package/dist/templates/har-boilerplate-cli/setup-infra.sh +0 -178
  121. package/dist/templates/har-boilerplate-cli/stages/README.sh +0 -11
  122. package/dist/templates/har-boilerplate-cli/teardown.sh +0 -66
  123. package/dist/templates/har-boilerplate-cli/verify.sh +0 -210
  124. package/dist/templates/har-boilerplate-ios/ADAPT-PROMPT.md +0 -63
  125. package/dist/templates/har-boilerplate-ios/CLAUDE.agent.md +0 -90
  126. package/dist/templates/har-boilerplate-ios/README.md +0 -173
  127. package/dist/templates/har-boilerplate-ios/STAGES.md +0 -99
  128. package/dist/templates/har-boilerplate-ios/agent-cli.sh +0 -149
  129. package/dist/templates/har-boilerplate-ios/agent-slot.sh +0 -479
  130. package/dist/templates/har-boilerplate-ios/launch.sh +0 -206
  131. package/dist/templates/har-boilerplate-ios/provision-toolchain.sh +0 -766
  132. package/dist/templates/har-boilerplate-ios/setup-infra.sh +0 -112
  133. package/dist/templates/har-boilerplate-ios/simulator.sh +0 -492
  134. package/dist/templates/har-boilerplate-ios/stages/README.sh +0 -11
  135. package/dist/templates/har-boilerplate-ios/teardown.sh +0 -68
  136. package/dist/templates/har-boilerplate-ios/verify.sh +0 -185
  137. package/dist/templates/runtime-bundles/pm2-runtime/README.md +0 -4
  138. package/dist/templates/runtime-bundles/shared-kernel/README.md +0 -3
  139. package/dist/templates/runtime-bundles/shared-kernel/provision-toolchain.sh +0 -766
  140. package/dist/templates/runtime-bundles/xcode-sim/README.md +0 -4
  141. package/dist/templates/runtime-bundles/xcode-sim/simulator.sh +0 -492
@@ -1,185 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Verification pipeline for iOS mobile app repos — build and test with xcodebuild.
3
- # Outputs JSON to stdout (machine contract), human-readable progress to stderr.
4
- # Passing steps omit `output`. `har env verify` streams progress only.
5
- #
6
- # Usage: ./.har/verify.sh <agent-id> [--full]
7
- #
8
- # Quick (default): build smoke (compile-only)
9
- # Full (--full): + unit tests, lint (SwiftLint), and every registered stage
10
- # in stages.json verificationStages (see .har/STAGES.md)
11
- # Step lists are examples — not exhaustive. Adapt commands to this repo's stack.
12
- set -euo pipefail
13
-
14
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15
- REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
16
-
17
- # shellcheck source=/dev/null
18
- source "$SCRIPT_DIR/harness.env"
19
- # shellcheck source=/dev/null
20
- source "$SCRIPT_DIR/agent-slot.sh"
21
-
22
- AGENT_ID="${1:?Usage: verify.sh <agent-id> [--full]}"
23
- FULL=""
24
-
25
- for arg in "${@:2}"; do
26
- [ "$arg" = "--full" ] && FULL=1
27
- done
28
-
29
- validate_agent_id "$AGENT_ID"
30
-
31
- ENV_FILE="$(resolve_agent_env_file "$AGENT_ID" "$REPO_ROOT")" || {
32
- echo "No .env.agent.${AGENT_ID} found." >&2
33
- har_suggest_launch "$AGENT_ID" >&2
34
- exit 1
35
- }
36
-
37
- set -a
38
- # shellcheck source=/dev/null
39
- source "$ENV_FILE"
40
- set +a
41
-
42
- WORK_DIR="$(resolve_agent_work_dir "$ENV_FILE")"
43
-
44
- echo "==> Verifying agent ${AGENT_ID} in ${WORK_DIR}..." >&2
45
- REG_FILE="$(slot_registry_file "$AGENT_ID")"
46
- echo " Work dir: ${WORK_DIR}" >&2
47
- echo " Env file: ${ENV_FILE}" >&2
48
- if [ -f "$REG_FILE" ]; then
49
- echo " Registry: ${REG_FILE}" >&2
50
- else
51
- echo " Registry: missing (${REG_FILE})" >&2
52
- fi
53
-
54
- # Build xcodebuild project/workspace flags
55
- xc_target_flags() {
56
- if [ -n "${HARNESS_XCODE_WORKSPACE:-}" ] && [ -e "$WORK_DIR/${HARNESS_XCODE_WORKSPACE}" ]; then
57
- echo "-workspace $WORK_DIR/${HARNESS_XCODE_WORKSPACE}"
58
- elif [ -n "${HARNESS_XCODE_PROJECT:-}" ] && [ -e "$WORK_DIR/${HARNESS_XCODE_PROJECT}" ]; then
59
- echo "-project $WORK_DIR/${HARNESS_XCODE_PROJECT}"
60
- else
61
- # Auto-detect: prefer workspace (CocoaPods), then project. Runs from inside
62
- # WORK_DIR so a dot in the worktree path itself cannot trip the dotfile
63
- # filter, and skips both the project.xcworkspace every .xcodeproj carries
64
- # inside it and the CocoaPods project under Pods/ — either would point
65
- # xcodebuild at the wrong target.
66
- local ws prj
67
- ws="$(cd "$WORK_DIR" && find . -maxdepth 2 -name "*.xcworkspace" \
68
- ! -path "./.*" ! -path "*.xcodeproj/*" ! -path "*/Pods/*" 2>/dev/null | head -1 || true)"
69
- prj="$(cd "$WORK_DIR" && find . -maxdepth 2 -name "*.xcodeproj" \
70
- ! -path "./.*" ! -path "*/Pods/*" 2>/dev/null | head -1 || true)"
71
- if [ -n "$ws" ]; then echo "-workspace $WORK_DIR/${ws#./}"
72
- elif [ -n "$prj" ]; then echo "-project $WORK_DIR/${prj#./}"
73
- fi
74
- fi
75
- }
76
-
77
- XC_FLAGS="$(xc_target_flags)"
78
- XC_SCHEME="${HARNESS_XCODE_SCHEME:-MyApp}"
79
- XC_DESTINATION="${HARNESS_IOS_DESTINATION:-platform=iOS Simulator,name=iPhone 16}"
80
- XC_DERIVED="${WORK_DIR}/build/DerivedData"
81
-
82
- OVERALL_PASS=true
83
- START_TOTAL=$(now_ms)
84
- RESULTS_JSON="[]"
85
-
86
- run_step() {
87
- local name="$1"
88
- local cmd="$2"
89
- local start end elapsed exit_code output
90
-
91
- printf " → %-40s" "$name..." >&2
92
- start=$(now_ms)
93
-
94
- set +e
95
- output=$(cd "$WORK_DIR" && set -a && . "$ENV_FILE" && set +a && eval "$cmd" 2>&1)
96
- exit_code=$?
97
- set -e
98
-
99
- end=$(now_ms)
100
- elapsed=$(( end - start ))
101
-
102
- local pass_bool
103
- if [ "$exit_code" = "0" ]; then
104
- echo "✓ (${elapsed}ms)" >&2
105
- pass_bool="true"
106
- else
107
- echo "✗ (${elapsed}ms)" >&2
108
- echo "$output" | head -40 | sed 's/^/ /' >&2
109
- pass_bool="false"
110
- OVERALL_PASS=false
111
- fi
112
-
113
- record_step_result "$name" "$pass_bool" "$elapsed" "$output"
114
-
115
- if [ "$pass_bool" = "false" ] && [ -z "$FULL" ]; then
116
- return 1
117
- fi
118
- }
119
-
120
- # Quick (default): compile-only — use XCODEBUILD_BIN from .env.agent.<id> (written by launch)
121
- # Nothing is installed or run, so CODE_SIGNING_ALLOWED=NO keeps the smoke build
122
- # from needing a signing identity.
123
- run_step "build" '${XCODEBUILD_BIN:-xcodebuild} build \
124
- ${XC_FLAGS} \
125
- -scheme "${XC_SCHEME}" \
126
- -destination "${XC_DESTINATION}" \
127
- -derivedDataPath "${XC_DERIVED}" \
128
- CODE_SIGNING_ALLOWED=NO \
129
- | xcbeautify 2>/dev/null || ${XCODEBUILD_BIN:-xcodebuild} build \
130
- ${XC_FLAGS} \
131
- -scheme "${XC_SCHEME}" \
132
- -destination "${XC_DESTINATION}" \
133
- -derivedDataPath "${XC_DERIVED}" \
134
- CODE_SIGNING_ALLOWED=NO' || { [ -z "$FULL" ] && true; }
135
-
136
- if [ -n "$FULL" ]; then
137
- # Full: project-specific checks — add/remove/reorder steps for this repo.
138
- # No CODE_SIGNING_ALLOWED=NO here, unlike the build step: tests install and run
139
- # the host app on the simulator, and an unsigned app gets no entitlements. Apps
140
- # using CloudKit, NSUbiquitousKeyValueStore, or push then trap at launch, before
141
- # the test harness connects — the whole bundle is lost, not one test.
142
- run_step "unit-tests" '${XCODEBUILD_BIN:-xcodebuild} test \
143
- ${XC_FLAGS} \
144
- -scheme "${XC_SCHEME}" \
145
- -destination "${XC_DESTINATION}" \
146
- -derivedDataPath "${XC_DERIVED}" \
147
- | xcbeautify 2>/dev/null || ${XCODEBUILD_BIN:-xcodebuild} test \
148
- ${XC_FLAGS} \
149
- -scheme "${XC_SCHEME}" \
150
- -destination "${XC_DESTINATION}" \
151
- -derivedDataPath "${XC_DERIVED}"' || true
152
-
153
- # SwiftLint — optional, skip gracefully when not installed
154
- run_step "lint" "command -v \"${HARNESS_SWIFTLINT_CMD:-swiftlint}\" >/dev/null 2>&1 && \
155
- \"${HARNESS_SWIFTLINT_CMD:-swiftlint}\" --quiet 2>&1 || echo 'swiftlint not installed — skipping'" || true
156
-
157
- run_step "readiness" "run_readiness_if_configured \"$AGENT_ID\"" || true
158
-
159
- # Registered verification stages from .har/stages.json (see .har/STAGES.md).
160
- # Every stage listed in verificationStages with a registered script/command
161
- # runs here -- plugins and custom stages alike.
162
- while IFS=$'\t' read -r STAGE_ID STAGE_CMD; do
163
- [ -n "$STAGE_ID" ] || continue
164
- run_step "$STAGE_ID" "$STAGE_CMD" || true
165
- done < <(list_registered_verification_stage_commands "$SCRIPT_DIR" "$AGENT_ID")
166
- fi
167
-
168
- END_TOTAL=$(now_ms)
169
- TOTAL_MS=$(( END_TOTAL - START_TOTAL ))
170
-
171
- node -e "
172
- const results = $RESULTS_JSON;
173
- const overall = results.length > 0 && results.every(r => r.pass);
174
- const out = {
175
- status: overall ? 'pass' : 'fail',
176
- agent_id: $AGENT_ID,
177
- total_ms: $TOTAL_MS,
178
- stages: results,
179
- };
180
- process.stdout.write(JSON.stringify(out, null, 2) + '\n');
181
- " 2>/dev/null || echo "{\"status\":\"fail\",\"agent_id\":${AGENT_ID},\"stages\":[]}"
182
-
183
- if [ "$OVERALL_PASS" = "false" ]; then
184
- exit 1
185
- fi
@@ -1,4 +0,0 @@
1
- # pm2-runtime
2
-
3
- Runtime bundle for web/SaaS profiles: PM2 ecosystem template, env.template, and attach.sh.
4
- Presence of `ecosystem.agent.template.cjs` is the capability marker (`harnessUsesPm2`).
@@ -1,3 +0,0 @@
1
- # shared-kernel
2
-
3
- Runtime bundle shared by every HAR profile: toolchain provisioning and the stages authoring guide.