@osfactory/har 1.18.0 → 1.19.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/dist/index.js
CHANGED
|
@@ -82005,7 +82005,9 @@ function buildInstallPlan(detection, targets, options = {}) {
|
|
|
82005
82005
|
agentsMd: writeAgentsMd,
|
|
82006
82006
|
migrateLegacyAgentMd: writeAgentsMd && detection.agentMd,
|
|
82007
82007
|
providers: targets,
|
|
82008
|
-
|
|
82008
|
+
// Deprecated: Claude Code reads AGENTS.md directly, so HAR no longer
|
|
82009
|
+
// creates a CLAUDE.md. An existing one is still kept pointing at AGENTS.md.
|
|
82010
|
+
claudeMd: targets.includes("claude") && detection.claudeMd,
|
|
82009
82011
|
cursorRule: wantsCursor,
|
|
82010
82012
|
skills: options.skills ?? []
|
|
82011
82013
|
};
|
|
@@ -82019,7 +82021,7 @@ function formatInstallPlan(plan, detection) {
|
|
|
82019
82021
|
lines.push(` ${mark(true)} Migrate ${LEGACY_AGENT_MD} \u2192 ${AGENTS_MD}, then remove legacy file`);
|
|
82020
82022
|
}
|
|
82021
82023
|
lines.push(
|
|
82022
|
-
` ${mark(
|
|
82024
|
+
plan.claudeMd ? ` ${mark(true)} Claude \u2014 keep the existing ${CLAUDE_MD} pointing at ${AGENTS_MD}` : ` ${mark(false)} Claude \u2014 reads ${AGENTS_MD} directly (no ${CLAUDE_MD} created)`
|
|
82023
82025
|
);
|
|
82024
82026
|
lines.push(
|
|
82025
82027
|
` ${mark(plan.cursorRule)} Cursor \u2014 install/refresh .cursor/rules/har-workflow.mdc`
|
|
@@ -82153,13 +82155,6 @@ ${legacyTrimmed}
|
|
|
82153
82155
|
return true;
|
|
82154
82156
|
}
|
|
82155
82157
|
var CLAUDE_MD_IMPORT = "@AGENTS.md";
|
|
82156
|
-
function loadClaudeMdTemplate() {
|
|
82157
|
-
const templatePath = resolveTemplateFile("CLAUDE.md.template");
|
|
82158
|
-
if (!templatePath) {
|
|
82159
|
-
throw new Error("CLAUDE.md.template not found. Run npm run build.");
|
|
82160
|
-
}
|
|
82161
|
-
return fs51.readFileSync(templatePath, "utf8");
|
|
82162
|
-
}
|
|
82163
82158
|
function isHarOwnedClaudeMd(content) {
|
|
82164
82159
|
const trimmed = content.trim();
|
|
82165
82160
|
if (trimmed === CLAUDE_MD_IMPORT) return true;
|
|
@@ -82171,11 +82166,9 @@ function hasAgentsImport(content) {
|
|
|
82171
82166
|
}
|
|
82172
82167
|
function ensureClaudeMdPointer(repoPath, options = {}) {
|
|
82173
82168
|
const dest = path59.join(repoPath, CLAUDE_MD);
|
|
82174
|
-
|
|
82175
|
-
|
|
82176
|
-
|
|
82177
|
-
return "created";
|
|
82178
|
-
}
|
|
82169
|
+
if (!fs51.existsSync(dest)) return "skipped";
|
|
82170
|
+
const thin = `${CLAUDE_MD_IMPORT}
|
|
82171
|
+
`;
|
|
82179
82172
|
const existing = fs51.readFileSync(dest, "utf8");
|
|
82180
82173
|
if (isHarOwnedClaudeMd(existing) || options.force) {
|
|
82181
82174
|
if (existing.trim() === CLAUDE_MD_IMPORT) return "skipped";
|
|
@@ -82283,9 +82276,7 @@ async function handleInstructionFiles(options) {
|
|
|
82283
82276
|
}
|
|
82284
82277
|
if (plan.claudeMd) {
|
|
82285
82278
|
claudeMdAction = ensureClaudeMdPointer(repoPath);
|
|
82286
|
-
if (claudeMdAction === "
|
|
82287
|
-
success(`Wrote ${CLAUDE_MD} (pointer \u2192 ${AGENTS_MD})`);
|
|
82288
|
-
} else if (claudeMdAction === "updated" || claudeMdAction === "appended") {
|
|
82279
|
+
if (claudeMdAction === "updated" || claudeMdAction === "appended") {
|
|
82289
82280
|
info(
|
|
82290
82281
|
`${claudeMdAction === "updated" ? "Updated" : "Appended"} ${CLAUDE_MD} pointer \u2192 ${AGENTS_MD}`
|
|
82291
82282
|
);
|
|
@@ -83713,13 +83704,7 @@ function buildInstructionFileNotes(repoPath) {
|
|
|
83713
83704
|
notes.push({
|
|
83714
83705
|
kind: "claude_md_pointer",
|
|
83715
83706
|
path: "CLAUDE.md",
|
|
83716
|
-
message: "Keep CLAUDE.md as the `@AGENTS.md` import \u2014 no workflow content of its own. Existing project-specific notes stay; the import goes on top."
|
|
83717
|
-
});
|
|
83718
|
-
} else {
|
|
83719
|
-
notes.push({
|
|
83720
|
-
kind: "claude_md_pointer",
|
|
83721
|
-
path: "CLAUDE.md",
|
|
83722
|
-
message: "Optional: add a CLAUDE.md containing `@AGENTS.md` when Claude Code is used on this repo."
|
|
83707
|
+
message: "Keep CLAUDE.md as the `@AGENTS.md` import \u2014 no workflow content of its own. Existing project-specific notes stay; the import goes on top. It is optional now that Claude Code reads AGENTS.md directly."
|
|
83723
83708
|
});
|
|
83724
83709
|
}
|
|
83725
83710
|
return notes;
|
|
@@ -202,7 +202,7 @@ Launch creates an isolated session worktree at `~/worktrees/<base>-<sha4>-har-ag
|
|
|
202
202
|
|
|
203
203
|
Coding agents discover the harness through two files:
|
|
204
204
|
|
|
205
|
-
1. **`AGENTS.md`** (repo root) — shared agent instructions (Codex
|
|
205
|
+
1. **`AGENTS.md`** (repo root) — shared agent instructions (Codex and Claude Code both auto-load this)
|
|
206
206
|
2. **`.har/README.md`** — full index of what's in the harness
|
|
207
207
|
|
|
208
208
|
Do **not** create `AGENT.md` (singular) — that legacy name is obsolete. If `AGENT.md` exists, merge any unique notes into `AGENTS.md` and delete `AGENT.md`.
|
|
@@ -219,14 +219,14 @@ If **no `AGENTS.md` exists**, create one at the repo root using this structure:
|
|
|
219
219
|
|
|
220
220
|
If **`AGENTS.md` already exists** (project-owned), add or update a concise **HAR / agent environment** section — do not replace unrelated content.
|
|
221
221
|
|
|
222
|
-
|
|
222
|
+
Do **not** create a `CLAUDE.md` — Claude Code reads `AGENTS.md` directly. If one already exists, keep it as the line `@AGENTS.md` and never paste the harness workflow into it — `AGENTS.md` is the single instruction file.
|
|
223
223
|
|
|
224
224
|
### Monorepos / multiple harnesses
|
|
225
225
|
|
|
226
226
|
If this repository contains **more than one project or `.har` harness** (check for `.har/` directories above or below this one):
|
|
227
227
|
|
|
228
228
|
- Maintain a **"Harnesses in this repo"** table in the ROOT `AGENTS.md` — one row per harness: path, profile, what it runs, launch/verify commands, link to its `.har/README.md`. Lead with "pick the harness that owns the files you are changing."
|
|
229
|
-
- Keep a small `AGENTS.md`
|
|
229
|
+
- Keep a small `AGENTS.md` **inside each project directory** for local discovery, with a back-link to the root index.
|
|
230
230
|
- Keep ONE Cursor rule at the repo root (`.cursor/rules/har-workflow.mdc`) listing all harnesses — not one rule per project.
|
|
231
231
|
|
|
232
232
|
Include a **Run history** subsection:
|
|
@@ -90,7 +90,7 @@ come back here afterwards. Two standing rules:
|
|
|
90
90
|
|
|
91
91
|
- Verification customization lives in `stages.json` / `.har/stages/` — the
|
|
92
92
|
top-level `*.sh` files are generated shims, safe to regenerate.
|
|
93
|
-
- Repo-root agent docs (`AGENTS.md
|
|
93
|
+
- Repo-root agent docs (`AGENTS.md`) follow Step 3 below.
|
|
94
94
|
|
|
95
95
|
## Step 3 — Refresh repo-root `AGENTS.md`
|
|
96
96
|
|
|
@@ -105,7 +105,7 @@ If harness commands, rules, or workflow changed, update the **HAR / agent enviro
|
|
|
105
105
|
|
|
106
106
|
If `AGENTS.md` does not mention HAR yet, add a concise section. If it already has a HAR section, update it minimally — do not replace unrelated content.
|
|
107
107
|
|
|
108
|
-
Do **not** create `AGENT.md` (singular). If legacy `AGENT.md` exists, merge unique notes into `AGENTS.md` and delete `AGENT.md`.
|
|
108
|
+
Do **not** create `AGENT.md` (singular). If legacy `AGENT.md` exists, merge unique notes into `AGENTS.md` and delete `AGENT.md`. Do not create a `CLAUDE.md`; if one exists, keep it as the line `@AGENTS.md`.
|
|
109
109
|
|
|
110
110
|
## Rules
|
|
111
111
|
|
|
@@ -79,7 +79,7 @@ Fix the harness scripts until both pass. Then tear down or keep the slot as the
|
|
|
79
79
|
After the user confirms, commit the harness:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
git add .har/ AGENTS.md
|
|
82
|
+
git add .har/ AGENTS.md .claude/ .cursor/ 2>/dev/null || git add .har/ AGENTS.md
|
|
83
83
|
git commit -m "chore: add har agent harness"
|
|
84
84
|
```
|
|
85
85
|
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@AGENTS.md
|