Skip to content

chore(cleanup): remove OPENCODE.md and align repo conventions#101

Merged
Steffen025 merged 2 commits intomainfrom
fix/repo-cleanup-followup
Apr 1, 2026
Merged

chore(cleanup): remove OPENCODE.md and align repo conventions#101
Steffen025 merged 2 commits intomainfrom
fix/repo-cleanup-followup

Conversation

@Steffen025
Copy link
Copy Markdown
Owner

@Steffen025 Steffen025 commented Apr 1, 2026

This bundles the remaining repository cleanup items into one PR.

  • Remove .opencode/OPENCODE.md (AGENTS.md is the canonical startup/context file in this setup).
  • Align mapping docs to AGENTS.md instead of OPENCODE.md:
    • .opencode/PAISYSTEM/PAI-TO-OPENCODE-MAPPING.md
    • docs/specs/UPSTREAM-SYNC-v1.8.0-SPEC.md
  • Fix stale parser workflow examples still pointing to ~/.claude/skills/parser:
    • .opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
  • Normalize migration marker wording in installer step:
    • PAI-Install/engine/steps-migrate.ts (marker: # PAI shell setup)

Validation:

  • bun run PAI-Install/cli/quick-install.ts --help

Summary by CodeRabbit

  • Documentation

    • Restructured onboarding and meta-file references and updated mapping conventions used across docs.
    • Updated upstream spec references to the new target document.
  • New Features / Workflows

    • Updated utility workflow locations and related output/index references to the reorganized directory layout.
  • Chores

    • Changed installer shell-rc marker handling and refreshed how the installer updates shell configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ed4fce02-e835-4985-a3e6-e9cc001bf8db

📥 Commits

Reviewing files that changed from the base of the PR and between b35c52b and e65cc7a.

📒 Files selected for processing (2)
  • .opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
  • PAI-Install/engine/steps-migrate.ts
✅ Files skipped from review due to trivial changes (1)
  • PAI-Install/engine/steps-migrate.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • .opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md

📝 Walkthrough

Walkthrough

This PR migrates repository documentation and runtime paths from older Claude-oriented conventions to OpenCode/AGENTS conventions, removes the .opencode/OPENCODE.md onboarding document, updates meta-file references to AGENTS.md, adjusts workflow filesystem paths to ~/.opencode/..., and standardizes the installer shell setup markers.

Changes

Cohort / File(s) Summary
Documentation Removal
.opencode/OPENCODE.md
Removed the entire OPENCODE.md onboarding/setup document.
Meta-file & Spec Updates
.opencode/PAISYSTEM/PAI-TO-OPENCODE-MAPPING.md, docs/specs/UPSTREAM-SYNC-v1.8.0-SPEC.md
Repointed meta-file references and PRD template docs from OPENCODE.md / CLAUDE.md to AGENTS.md.
Workflow Path Migration
.opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
Rebased workflow path constants and file locations from ~/.claude/... to ~/.opencode/skills/Utilities/Parser/..., updating entity index, schema, and per-batch filenames.
Installer RC Update Logic
PAI-Install/engine/steps-migrate.ts
Switched fs import to node:fs style and changed shell rc cleanup/append logic to remove/replace blocks delimited by new # PAI shell setup — added by PAI installer / # end PAI shell setup markers around the appended alias snippet.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped from Claude to OpenCode today,
I nudged some files, then ran away,
AGENTS.md now leads our tune,
.opencode glows beneath the moon,
A tiny hop — a brighter bay. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: removing OPENCODE.md and updating repo conventions to use AGENTS.md as the canonical reference.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/repo-cleanup-followup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
PAI-Install/engine/steps-migrate.ts (1)

227-238: ⚠️ Potential issue | 🔴 Critical

Critical: Shell marker pattern is inconsistent with other installer files.

The marker is now correctly named # PAI shell setup (line 227), but the implementation writes an unbounded marker without the suffix or end marker (line 238). This creates a critical inconsistency:

Current code writes:

# PAI shell setup
alias pai='bun ...'

Expected pattern (per actions.ts and steps-fresh.ts):

# PAI shell setup — added by PAI installer
alias pai='bun ...'
# end PAI shell setup

Impact: The removal pattern in actions.ts (/\n?# PAI shell setup — added by PAI installer[\s\S]*?# end PAI shell setup\n?/g) won't match what this migration step writes. Subsequent fresh installs or updates will fail to clean up the migration-written alias, causing duplicate aliases in the user's rc file.

As per relevant code snippets from actions.ts:797-810 and steps-fresh.ts:430-445, all shell setup logic must use the same bounded-block pattern with explicit start and end markers.

🔧 Proposed fix to align with the bounded-block pattern
 const marker = "# PAI shell setup";
+const endMarker = "# end PAI shell setup";
 
 try {
   let content = "";
   if (existsSync(rcPath)) {
     content = require("fs").readFileSync(rcPath, "utf-8");
-    // Remove old PAI aliases
+    // Remove old PAI aliases (legacy formats)
     content = content.replace(/^#\s*(?:PAI|CORE)\s*alias.*\n.*alias pai=.*\n?/gm, "");
     content = content.replace(/^alias pai=.*\n?/gm, "");
     content = content.replace(/^alias pai\s+.*\n?/gm, "");
+    // Remove installer-managed block if it exists
+    content = content.replace(/\n?# PAI shell setup — added by PAI installer[\s\S]*?# end PAI shell setup\n?/g, "");
   }
-  content = content.trimEnd() + `\n\n${marker}\n${aliasLine}\n`;
+  content = content.trimEnd() + `\n\n${marker} — added by PAI installer\n${aliasLine}\n${endMarker}\n`;
   writeFileSync(rcPath, content);
 } catch (err) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@PAI-Install/engine/steps-migrate.ts` around lines 227 - 238, The migration
writes an unbounded marker ("# PAI shell setup") which doesn’t match the bounded
block pattern used elsewhere; update the construction around the
marker/aliasLine in steps-migrate.ts (the marker constant and the code that
appends to content) so it emits the full bounded block exactly like
actions.ts/steps-fresh.ts: use a start marker string " # PAI shell setup — added
by PAI installer" followed by aliasLine and then an explicit end marker line "#
end PAI shell setup" (ensure content uses trimEnd() +
`\n\n${startMarker}\n${aliasLine}\n${endMarker}\n`), so the removal regex in
actions.ts will match and clean the block.
.opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md (5)

571-579: ⚠️ Potential issue | 🔴 Critical

Critical: Incorrect path in verification command.

Line 572 uses ~/.opencode/skills/parser/entity-index.json in the bash command. This path is incorrect and should be ~/.opencode/skills/Utilities/Parser/entity-index.json to match the repository structure.

🔧 Proposed fix for verification command
-cat ~/.opencode/skills/parser/entity-index.json | jq '{
+cat ~/.opencode/skills/Utilities/Parser/entity-index.json | jq '{
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
around lines 571 - 579, The verification command is using the wrong path string
"~/.opencode/skills/parser/entity-index.json"; update that path in the command
block to "~/.opencode/skills/Utilities/Parser/entity-index.json" so the jq check
reads the correct file (look for the literal path in the markdown block and
replace it accordingly).

558-563: ⚠️ Potential issue | 🔴 Critical

Critical: Incorrect output directory path.

Line 559 constructs the output filename using ~/.opencode/skills/parser/output/ (lowercase 'parser'). This should be ~/.opencode/skills/Utilities/Parser/output/ to match the repository structure and ensure processed articles are saved to the correct location.

🔧 Proposed fix to use correct output path
-    const filename = `~/.opencode/skills/parser/output/${timestamp}_batch-${index + 1}.json`;
+    const filename = `${process.env.HOME}/.opencode/skills/Utilities/Parser/output/${timestamp}_batch-${index + 1}.json`;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
around lines 558 - 563, The output path is wrong: update the filename
construction where the const filename is defined (refer to the timestamp
constant and the fs.writeFileSync call) to use the correct repository path
"~/.opencode/skills/Utilities/Parser/output/" instead of
"~/.opencode/skills/parser/output/"; ensure the rest of the filename logic
(timestamp, `batch-${index + 1}.json`) and the subsequent
fs.writeFileSync(filename, JSON.stringify(fullContent, null, 2)) and
console.log(`Saved: ${filename}`) calls remain unchanged so files are written to
the corrected directory.

69-79: ⚠️ Potential issue | 🔴 Critical

Critical: Incorrect entity-index.json path in pre-flight check.

Line 73 uses ~/.opencode/skills/parser/entity-index.json (lowercase 'parser'), but the canonical path is ~/.opencode/skills/Utilities/Parser/entity-index.json. This mismatch means the pre-flight check will either fail (file not found) or read from a stale/incorrect entity index, causing duplicate entity tracking.

As per the relevant code snippet from collision-detection.ts, the collision detection utility expects the entity index at .opencode/skills/Utilities/Parser/entity-index.json.

🔧 Proposed fix to use correct path
 const entityIndex = JSON.parse(
-  fs.readFileSync('~/.opencode/skills/parser/entity-index.json', 'utf-8')
+  fs.readFileSync(`${process.env.HOME}/.opencode/skills/Utilities/Parser/entity-index.json`, 'utf-8')
 );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
around lines 69 - 79, The pre-flight check reads the wrong entity-index.json
path; update the fs.readFileSync call that populates the entityIndex variable so
it points to the canonical path used by collision-detection (replace
'~/.opencode/skills/parser/entity-index.json' with
'~/.opencode/skills/Utilities/Parser/entity-index.json'), ensuring
isContentAlreadyParsed receives the correct index and preventing stale/missing
file reads.

455-473: ⚠️ Potential issue | 🔴 Critical

Critical: Incorrect entity-index.json path in main processing.

Line 456 hardcodes the entity index path as ~/.opencode/skills/parser/entity-index.json (lowercase 'parser'), which doesn't match the correct path structure ~/.opencode/skills/Utilities/Parser/entity-index.json. This will cause the workflow to write the updated entity index to the wrong directory, creating data divergence between what this code writes and what the collision-detection utility reads.

🔧 Proposed fix to use correct path
-const entityIndexPath = '~/.opencode/skills/parser/entity-index.json';
+const entityIndexPath = `${process.env.HOME}/.opencode/skills/Utilities/Parser/entity-index.json`;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
around lines 455 - 473, The entity index path is incorrect: update the hardcoded
entityIndexPath used when reading/writing the index so it points to the correct
directory (use "~/.opencode/skills/Utilities/Parser/entity-index.json" instead
of the lowercase "parser"); locate the entityIndexPath declaration and the
fs.readFileSync/fs.writeFileSync calls that read and write entityIndex (and
ensure entityIndex.last_updated is preserved) so processArticleEntities and the
collision-detection utility use the same file.

486-488: ⚠️ Potential issue | 🔴 Critical

Critical: Incorrect schema path.

Line 487 references the schema at ~/.opencode/skills/parser/schema/content-schema.json (lowercase 'parser'). The correct path should be ~/.opencode/skills/Utilities/Parser/schema/content-schema.json, consistent with the repository structure.

🔧 Proposed fix to use correct schema path
 const schema = JSON.parse(
-  fs.readFileSync('~/.opencode/skills/parser/schema/content-schema.json', 'utf-8')
+  fs.readFileSync(`${process.env.HOME}/.opencode/skills/Utilities/Parser/schema/content-schema.json`, 'utf-8')
 );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
around lines 486 - 488, The code creating the schema constant uses an incorrect
path string; update the fs.readFileSync call that assigns the const schema to
read the correct schema file location by replacing the lowercase parser path
with the repository-correct path (Utilities/Parser/schema/content-schema.json)
so JSON.parse(fs.readFileSync(..., 'utf-8')) loads the proper
content-schema.json.
🧹 Nitpick comments (1)
PAI-Install/engine/steps-migrate.ts (1)

232-232: Use imported readFileSync instead of require("fs").

The file already imports readFileSync from "node:fs" at line 8, but line 232 uses require("fs").readFileSync. This is inconsistent and adds unnecessary overhead.

♻️ Proposed fix
+    const { readFileSync: fsRead } = require("node:fs");
     if (existsSync(rcPath)) {
-      content = require("fs").readFileSync(rcPath, "utf-8");
+      content = fsRead(rcPath, "utf-8");

Or better yet, add readFileSync to the import at the top if not already imported with that name:

-import { existsSync, cpSync, mkdirSync, writeFileSync } from "node:fs";
+import { existsSync, cpSync, mkdirSync, writeFileSync, readFileSync } from "node:fs";

Then use directly:

-      content = require("fs").readFileSync(rcPath, "utf-8");
+      content = readFileSync(rcPath, "utf-8");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@PAI-Install/engine/steps-migrate.ts` at line 232, Replace the inline
require("fs").readFileSync usage with the module-level imported readFileSync:
ensure the top-level import includes readFileSync from "node:fs" (or add it if
missing) and change the assignment that sets content =
require("fs").readFileSync(rcPath, "utf-8") to use the imported
readFileSync(rcPath, "utf-8") instead, removing the unnecessary require call;
look for the content variable assignment near rcPath in steps-migrate.ts to
update.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md:
- Around line 571-579: The verification command is using the wrong path string
"~/.opencode/skills/parser/entity-index.json"; update that path in the command
block to "~/.opencode/skills/Utilities/Parser/entity-index.json" so the jq check
reads the correct file (look for the literal path in the markdown block and
replace it accordingly).
- Around line 558-563: The output path is wrong: update the filename
construction where the const filename is defined (refer to the timestamp
constant and the fs.writeFileSync call) to use the correct repository path
"~/.opencode/skills/Utilities/Parser/output/" instead of
"~/.opencode/skills/parser/output/"; ensure the rest of the filename logic
(timestamp, `batch-${index + 1}.json`) and the subsequent
fs.writeFileSync(filename, JSON.stringify(fullContent, null, 2)) and
console.log(`Saved: ${filename}`) calls remain unchanged so files are written to
the corrected directory.
- Around line 69-79: The pre-flight check reads the wrong entity-index.json
path; update the fs.readFileSync call that populates the entityIndex variable so
it points to the canonical path used by collision-detection (replace
'~/.opencode/skills/parser/entity-index.json' with
'~/.opencode/skills/Utilities/Parser/entity-index.json'), ensuring
isContentAlreadyParsed receives the correct index and preventing stale/missing
file reads.
- Around line 455-473: The entity index path is incorrect: update the hardcoded
entityIndexPath used when reading/writing the index so it points to the correct
directory (use "~/.opencode/skills/Utilities/Parser/entity-index.json" instead
of the lowercase "parser"); locate the entityIndexPath declaration and the
fs.readFileSync/fs.writeFileSync calls that read and write entityIndex (and
ensure entityIndex.last_updated is preserved) so processArticleEntities and the
collision-detection utility use the same file.
- Around line 486-488: The code creating the schema constant uses an incorrect
path string; update the fs.readFileSync call that assigns the const schema to
read the correct schema file location by replacing the lowercase parser path
with the repository-correct path (Utilities/Parser/schema/content-schema.json)
so JSON.parse(fs.readFileSync(..., 'utf-8')) loads the proper
content-schema.json.

In `@PAI-Install/engine/steps-migrate.ts`:
- Around line 227-238: The migration writes an unbounded marker ("# PAI shell
setup") which doesn’t match the bounded block pattern used elsewhere; update the
construction around the marker/aliasLine in steps-migrate.ts (the marker
constant and the code that appends to content) so it emits the full bounded
block exactly like actions.ts/steps-fresh.ts: use a start marker string " # PAI
shell setup — added by PAI installer" followed by aliasLine and then an explicit
end marker line "# end PAI shell setup" (ensure content uses trimEnd() +
`\n\n${startMarker}\n${aliasLine}\n${endMarker}\n`), so the removal regex in
actions.ts will match and clean the block.

---

Nitpick comments:
In `@PAI-Install/engine/steps-migrate.ts`:
- Line 232: Replace the inline require("fs").readFileSync usage with the
module-level imported readFileSync: ensure the top-level import includes
readFileSync from "node:fs" (or add it if missing) and change the assignment
that sets content = require("fs").readFileSync(rcPath, "utf-8") to use the
imported readFileSync(rcPath, "utf-8") instead, removing the unnecessary require
call; look for the content variable assignment near rcPath in steps-migrate.ts
to update.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 57ae0132-6954-4ab0-9e7e-cd4ed7c06b85

📥 Commits

Reviewing files that changed from the base of the PR and between fbcc2f1 and b35c52b.

📒 Files selected for processing (5)
  • .opencode/OPENCODE.md
  • .opencode/PAISYSTEM/PAI-TO-OPENCODE-MAPPING.md
  • .opencode/skills/Utilities/Parser/Workflows/BatchEntityExtractionGemini3.md
  • PAI-Install/engine/steps-migrate.ts
  • docs/specs/UPSTREAM-SYNC-v1.8.0-SPEC.md
💤 Files with no reviewable changes (1)
  • .opencode/OPENCODE.md

@Steffen025 Steffen025 merged commit 39cc3f3 into main Apr 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant