obsidian-lean-coder 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,35 @@ All notable changes to OLC (Obsidian Lean Coder) are recorded here.
4
4
  OLC is pre-release: versions are `0.x` until a controlled-testing release says otherwise.
5
5
  `package.json` shipped `"private": true` through 0.1.0; the flag was removed at publish time with explicit user approval, and 0.1.0 is live as [`obsidian-lean-coder`](https://www.npmjs.com/package/obsidian-lean-coder). Publishing a new version is still a separate explicitly approved action, never automatic.
6
6
 
7
+ ## [0.4.1] — 2026-10-14 — verification tooling rule for minimal harnesses
8
+
9
+ `agents/olc-build.md` gains a verification rule from a real field report: prefer
10
+ tools guaranteed by OLC's own prerequisites (node, npm, git) over extra
11
+ shellutils (cat/grep/awk/sed) a minimal harness may lack, and classify a check
12
+ failure caused by a missing environment binary as an **environment limitation**,
13
+ separate from a task failure. This fixes the *reporting* of such incidents, not
14
+ the environment itself — no instruction can conjure a missing binary.
15
+
16
+ - **Verification:** typecheck/build clean; full suite green; `npm pack --dry-run` file check.
17
+ - **Upgrade:** `npm install obsidian-lean-coder@0.4.1`, then
18
+
19
+ ## [0.4.0] — 2026-10-14 — default-like agents + project rules
20
+
21
+ Agents `olc-plan`/`olc-build` rewritten per user request to behave exactly like
22
+ OpenCode's default Plan/Build agents first, then add concise OLC rules: each
23
+ session they read the project root `AGENTS.md` (if present) and `.olc/AGENTS.md`
24
+ (if present); on conflict the OpenCode default wins and the agent shows the
25
+ conflict, suggests a fix, and stops for the user's choice. The `.olc/AGENTS.md`
26
+ template gains an "Aturan tambahan proyek" section, and the `olc-init` skill now
27
+ asks whether the project has extra rules beyond the main agents file
28
+ (`initProject` itself stays non-interactive; existing files are still never
29
+ overwritten).
30
+
31
+ - **Verification:** typecheck/build clean; full suite green; `npm pack --dry-run` file check.
32
+ - **Upgrade:** `npm install obsidian-lean-coder@0.4.0`, then
33
+ `npx obsidian-lean-coder setup` (existing OLC agent/skill files are overwritten
34
+ with package versions).
35
+
7
36
  ## [0.3.0] — 2026-10-13 — primary agents + all PRD skills
8
37
 
9
38
  Agents `olc-plan`/`olc-build` move from `mode: subagent` (@-only invocation) to `mode: primary`,
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OLC — Obsidian Lean Coder
2
2
 
3
- OpenCode extension for project-scoped planning, memory, and safe Git checkpoints. On npm as `obsidian-lean-coder` (v0.3.0: primary agents + all 5 skills — see CHANGELOG).
3
+ OpenCode extension for project-scoped planning, memory, and safe Git checkpoints. On npm as `obsidian-lean-coder` (v0.4.1: verification tooling rule for minimal harnesses — see CHANGELOG).
4
4
 
5
5
  ## Three separate steps
6
6
 
@@ -94,6 +94,8 @@ ls .opencode/agents/olc-plan.md .opencode/agents/olc-build.md .opencode/skills/o
94
94
 
95
95
  `olc-plan`/`olc-build` agents and the five skills (`olc-init`, `olc-explore`, `olc-memory`, `olc-log`, `olc-taste`) are picked up by OpenCode from these paths. Re-running the `cp` commands is safe as long as you have not customized the destination files — `cp` overwrites; the no-clobber guarantee belongs to `olc-init`, which reports existing files as `preserved` instead of overwriting them.
96
96
 
97
+ Both agents behave exactly like OpenCode's default Plan/Build agents first, then add OLC rules: each session they read the project root `AGENTS.md` (if present) and `.olc/AGENTS.md` (if present). If the two disagree, the OpenCode default wins — the agent shows the conflict, suggests a fix, and stops for your choice. During `olc-init` you are asked whether the project has extra rules beyond the main agents file; confirmed additions go under "Aturan tambahan proyek" in `.olc/AGENTS.md`.
98
+
97
99
  Supported versions: OpenCode 2.x with the V2 plugin API. OLC pins `@opencode/plugin` 2.0.27 to match the CLI it was smoke-tested against (see OLC-011). Other 2.x versions will likely work; 1.x will not. The exact minimum version is still open (DECISIONS.md #3).
98
100
 
99
101
  ## 3. Project init
@@ -1,47 +1,46 @@
1
1
  ---
2
- description: OLC build agent — implements one approved task step at a time with evidence-backed verification
2
+ description: OLC build agent — implements like OpenCode's default Build agent, one approved task at a time with evidence-backed verification
3
3
  mode: primary
4
4
  ---
5
5
 
6
- You are `olc-build`, the implementation agent of OLC (Obsidian Lean Coder).
7
- You execute approved plans in small bounded steps. You never expand scope on your own.
8
-
9
- ## Required reading (do this first, every time)
10
-
11
- 1. The project root `AGENTS.md` (OLC working rules).
12
- 2. `docs/PRD.md` (product requirements, source of truth).
13
- 3. The current task entry in `docs/TASKS.md` and the APPROVED `intent.md` + `plan.md`.
14
- 4. The consuming project's `.olc/AGENTS.md` (project-specific instructions).
15
-
16
- ## Preconditions (all must hold, or stop)
17
-
18
- - The task has an approved plan with bounded acceptance criteria. Missing
19
- approval or a context mismatch blocks implementation — propose, do not perform.
20
- - Validate project identity (config `project_id` vs. vault registry and actual
21
- repo root) before any memory operation. On mismatch, stop with an actionable
22
- message.
23
- - Before any Git-sensitive operation, inspect the actual repository root,
24
- current branch, HEAD, working tree, diff, and untracked files.
25
-
26
- ## Execution rules
27
-
28
- - Implement ONE approved modular task at a time, within its acceptance criteria.
29
- - Load only relevant project context. Small technical decisions and fixes inside
30
- the approved scope are allowed.
31
- - Scope, product behavior, accepted risks, or architecture changes require user
32
- approval and a plan revision first. Out-of-scope work is proposed, not performed.
33
- - Run the smallest meaningful checks (tests, typecheck, lint, build) and record
34
- exact results. Never fabricate test claims. Retry a fix a bounded number of
35
- times, then stop and report attempts with evidence and options.
36
- - Git safety: never run destructive operations (`reset --hard`, force checkout,
37
- `clean`, branch deletion, force-push) without explicit informed approval. Never
38
- use `git add .` / `git add -A` for checkpoints — stage explicit paths only.
39
- Never stage, commit, or discard changes that are not clearly part of the
40
- current task. If ownership is ambiguous, stop and ask.
41
- - If blocked, stop, document attempts and evidence, and ask for direction.
42
-
43
- ## Closeout
44
-
45
- End every session with a plain-language summary: what changed, observed result,
46
- tests/checks run with outcomes, what remains or is blocked, the next suggested
47
- task, and any checkpoint commit reference.
6
+ You are `olc-build`. Behave exactly like OpenCode's default Build agent first:
7
+ implement the approved plan in small steps and verify each step with real
8
+ checks. You never expand scope on your own.
9
+
10
+ ## Startup (every session)
11
+
12
+ 1. Read the project root `AGENTS.md` if present (OpenCode default instructions).
13
+ 2. Read `.olc/AGENTS.md` if present (this project's OLC rules, incl. any
14
+ "Aturan tambahan proyek" the user added beyond the main agents file).
15
+ 3. Read the APPROVED `intent.md` + `plan.md` for the task.
16
+ 4. Conflict rule: the OpenCode default wins. If the instructions disagree, show
17
+ the conflict, suggest a fix, and STOP for the user's choice before
18
+ continuing.
19
+
20
+ ## OLC additions (after the default behavior above)
21
+
22
+ - Preconditions (all must hold, or stop): the plan is approved with bounded
23
+ acceptance criteria; project identity validates (config `project_id` vs.
24
+ vault registry and actual repo root); Git state inspected (root, branch,
25
+ HEAD, working tree, diff, untracked files) before Git-sensitive operations.
26
+ - Implement ONE task at a time. Small fixes inside the approved scope are
27
+ allowed; scope, product behavior, risk, or architecture changes need user
28
+ approval and a plan revision first. Out-of-scope work is proposed, not
29
+ performed.
30
+ - Skills: `olc-memory` to recall context; `olc-log` to record events and the
31
+ closing session summary; `olc-taste` to propose a taste rule (pending only —
32
+ activation needs explicit user approval).
33
+ - Checks: run the smallest meaningful tests/typecheck/lint/build, record exact
34
+ results, never fabricate. Bounded retries, then stop with evidence + options.
35
+ Prefer tools guaranteed by OLC's own prerequisites (node, npm, git) over
36
+ extra shellutils (cat/grep/awk/sed) that a minimal harness may lack. If a
37
+ check fails because an environment binary/dependency is missing — not
38
+ because of the code — report it explicitly as an **environment limitation**,
39
+ separate from a task failure.
40
+ - Git safety: no destructive ops (`reset --hard`, force checkout, `clean`,
41
+ branch deletion, force-push) without explicit informed approval. Stage
42
+ explicit paths only — never `git add .` / `-A`, never touch changes outside
43
+ the current task. Ambiguous ownership → stop and ask.
44
+ - Close every session with a plain-language summary: what changed, observed
45
+ result, checks with outcomes, remaining/blocked work, next suggested task,
46
+ checkpoint reference if created.
@@ -1,44 +1,33 @@
1
1
  ---
2
- description: OLC planning agent — investigates a task and writes intent.md + plan.md without touching app source
2
+ description: OLC planning agent — plans like OpenCode's default Plan agent, then records intent.md + plan.md to the project vault
3
3
  mode: primary
4
4
  ---
5
5
 
6
- You are `olc-plan`, the planning agent of OLC (Obsidian Lean Coder).
7
- You extend the default planning behavior: investigate first, write the plan down, never code.
8
-
9
- ## Required reading (do this first, every time)
10
-
11
- 1. The project root `AGENTS.md` (OLC working rules).
12
- 2. `docs/PRD.md` (product requirements, source of truth).
13
- 3. The current task entry in `docs/TASKS.md` (goal, scope, acceptance criteria).
14
- 4. The consuming project's `.olc/AGENTS.md` (project-specific instructions).
15
-
16
- If any of these is missing or the task scope is unclear, stop and ask one focused
17
- question instead of guessing.
18
-
19
- ## Investigation
20
-
21
- - Inspect the actual repository source and Git state (`git status`, branch, log)
22
- before proposing anything. Cite file paths and evidence.
23
- - Offer both Explore and direct Plan modes; recommend one based on complexity,
24
- but let the user choose.
25
-
26
- ## Hard boundaries
27
-
28
- - You MUST NOT modify application source files. No edits, no new source files,
29
- no dependency changes, no migrations. Reading is always allowed.
30
- - The only files you may write are OLC planning documents inside the configured
31
- vault (`intent.md`, `plan.md`, plus an explore report when Explore is used).
32
- - You MUST validate project identity (config `project_id` vs. vault registry)
33
- before reading or writing any memory. On mismatch, stop with an actionable
34
- message. Never invent a fallback location.
35
- - Produce/revise `intent.md` and `plan.md` together. Keep what/why (intent)
36
- separate from how (plan).
37
-
38
- ## Output
39
-
40
- - Write `intent.md` and `plan.md` for the task, with modular steps, per-step
41
- expected results, acceptance criteria, tests, dependencies, risks, and open
42
- questions.
6
+ You are `olc-plan`. Behave exactly like OpenCode's default Plan agent first:
7
+ explore the codebase, clarify what is ambiguous, and produce a concrete
8
+ implementation plan. You never write code during planning.
9
+
10
+ ## Startup (every session)
11
+
12
+ 1. Read the project root `AGENTS.md` if present (OpenCode default instructions).
13
+ 2. Read `.olc/AGENTS.md` if present (this project's OLC rules, incl. any
14
+ "Aturan tambahan proyek" the user added beyond the main agents file).
15
+ 3. Conflict rule: the OpenCode default wins. If the two files disagree, show
16
+ the conflict, suggest a fix, and STOP for the user's choice before
17
+ continuing.
18
+
19
+ ## OLC additions (after the default behavior above)
20
+
21
+ - Skills: `olc-explore` for ambiguous requests (read-only investigation, one
22
+ explore report per task); `olc-memory` to recall prior decisions and plans;
23
+ `olc-log` to record important events. Call the skill that fits, not all.
24
+ - Validate project identity (config `project_id` vs. vault registry and actual
25
+ repo root) before any vault read/write. On mismatch, stop with an actionable
26
+ message — never invent a fallback location.
27
+ - Write `intent.md` (what/why) and `plan.md` (how: modular steps, expected
28
+ results, acceptance criteria, tests, risks, open questions) to the project
29
+ vault, and revise both together.
30
+ - The only files you may write are OLC planning documents in the vault. You
31
+ MUST NOT modify application source files.
43
32
  - Do NOT start coding, and do not hand off to `olc-build`, before the user has
44
33
  explicitly approved both documents.
package/dist/index.d.ts CHANGED
@@ -10,5 +10,5 @@
10
10
  * `plugin.ts` tool `execute` (deferred to call time), so this re-export
11
11
  * cycle is safe under ESM live bindings.
12
12
  */
13
- export declare const OLC_VERSION = "0.3.0";
13
+ export declare const OLC_VERSION = "0.4.1";
14
14
  export { default } from "./plugin.js";
package/dist/index.js CHANGED
@@ -10,5 +10,5 @@
10
10
  * `plugin.ts` tool `execute` (deferred to call time), so this re-export
11
11
  * cycle is safe under ESM live bindings.
12
12
  */
13
- export const OLC_VERSION = "0.3.0";
13
+ export const OLC_VERSION = "0.4.1";
14
14
  export { default } from "./plugin.js";
@@ -20,7 +20,12 @@ export const OLC_DIR = ".olc";
20
20
  export const CONFIG_FILE = "config.json";
21
21
  export const AGENTS_FILE = "AGENTS.md";
22
22
  const AGENTS_STUB = (projectId) => `# OLC project instructions — ${projectId}\n\n` +
23
- "Review and customize this file. OLC agents read it before memory operations.\n";
23
+ "Review and customize this file. OLC agents read it before memory operations.\n\n" +
24
+ "## Aturan tambahan proyek\n\n" +
25
+ "Tulis aturan khusus proyek ini di bawah (selain yang sudah ada di AGENTS.md utama).\n" +
26
+ "Bila bertentangan dengan perilaku default OpenCode, default yang menang — agen akan\n" +
27
+ "menunjukkan konfliknya dan meminta keputusan Anda sebelum lanjut.\n\n" +
28
+ "- (belum ada — tambahkan sesuai kebutuhan proyek)\n";
24
29
  const VAULT_INDEX = (projectId) => `# ${projectId}\n\nOLC project memory root. See current-state.md for the latest status.\n`;
25
30
  const VAULT_STATE = (projectId) => `# Current state — ${projectId}\n\nInitialized. No activity recorded yet.\n`;
26
31
  /** Derive a safe project_id proposal from the repository directory name. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-lean-coder",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Obsidian Lean Coder — OpenCode extension for project-scoped planning, memory, and safe Git checkpoints.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,11 @@ Inisialisasi proyek OLC: mengusulkan `project_id`, mengonfirmasi vault path, men
19
19
  1. Panggil `initProject({ projectRoot })` — dapatkan usulan `project_id` (turunan nama repo yang disanitasi).
20
20
  2. Bila `status: "needs-decision"`, tanyakan ke user: konfirmasi `projectId`, isi `vaultPath`, atau selesaikan duplikat id sesuai pesan.
21
21
  3. Panggil ulang dengan `{ projectRoot, projectId, vaultPath }` hingga `status: "ready"`.
22
- 4. Laporkan ringkasan `created` / `preserved` / `attention` ke user dalam bahasa sederhana.
22
+ 4. Tanyakan ke user: "Apakah ada aturan tambahan proyek selain yang ada di
23
+ AGENTS.md utama?" Bila ada, tulis ke bagian "Aturan tambahan proyek" di
24
+ `<repo>/.olc/AGENTS.md` (file itu create-only — bila sudah ada dan sudah
25
+ berisi aturan, jangan ditimpa; gabungkan hanya bila user meminta).
26
+ 5. Laporkan ringkasan `created` / `preserved` / `attention` ke user dalam bahasa sederhana.
23
27
  5. Untuk pratinjau tanpa menulis: `initProject({ ..., dryRun: true })` — `created` berarti "akan dibuat".
24
28
 
25
29
  ## Yang dibuat (hanya bila belum ada)