Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .opencode/OPENCODE.md

This file was deleted.

2 changes: 1 addition & 1 deletion .opencode/PAISYSTEM/PAI-TO-OPENCODE-MAPPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PAI-OpenCode is a vanilla PAI implementation adapted for OpenCode's architecture
| **Root Directory** | `.claude/` | `.opencode/` |
| **Lifecycle Events** | `hooks/*.hook.ts` | `plugins/handlers/*.ts` |
| **Config Schema** | Claude Code settings.json | OpenCode settings.json |
| **Meta File** | `CLAUDE.md` | `OPENCODE.md` |
| **Meta File** | `CLAUDE.md` | `AGENTS.md` |
| **Path Variable** | `$PAI_DIR` → `~/.claude` | `$PAI_DIR` → `.opencode` |

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ urls=$(pbpaste)
import { isContentAlreadyParsed } from '../utils/collision-detection';

const entityIndex = JSON.parse(
fs.readFileSync('~/.opencode/skills/parser/entity-index.json', 'utf-8')
fs.readFileSync('~/.opencode/skills/Utilities/Parser/entity-index.json', 'utf-8')
);

const newUrls = urls.filter(url => !isContentAlreadyParsed(url, entityIndex));
Expand Down Expand Up @@ -453,7 +453,7 @@ function processArticleEntities(
}

// Main processing
const entityIndexPath = '~/.opencode/skills/parser/entity-index.json';
const entityIndexPath = '~/.opencode/skills/Utilities/Parser/entity-index.json';
const entityIndex: EntityIndex = JSON.parse(fs.readFileSync(entityIndexPath, 'utf-8'));

const rawEntities = JSON.parse(fs.readFileSync('raw-entities.json', 'utf-8'));
Expand Down Expand Up @@ -484,7 +484,7 @@ const ajv = new Ajv({ strict: false });
addFormats(ajv);

const schema = JSON.parse(
fs.readFileSync('~/.opencode/skills/parser/schema/content-schema.json', 'utf-8')
fs.readFileSync('~/.opencode/skills/Utilities/Parser/schema/content-schema.json', 'utf-8')
);

const validate = ajv.compile(schema);
Expand Down Expand Up @@ -556,7 +556,7 @@ processedArticles.forEach((article: any, index: number) => {
} else {
// Save validated content
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5);
const filename = `~/.opencode/skills/parser/output/${timestamp}_batch-${index + 1}.json`;
const filename = `~/.opencode/skills/Utilities/Parser/output/${timestamp}_batch-${index + 1}.json`;
fs.writeFileSync(filename, JSON.stringify(fullContent, null, 2));
console.log(`Saved: ${filename}`);
}
Expand All @@ -569,7 +569,7 @@ The entity index is automatically updated during step 5. Verify the update:

```bash
# Check entity counts
cat ~/.opencode/skills/parser/entity-index.json | jq '{
cat ~/.opencode/skills/Utilities/Parser/entity-index.json | jq '{
people_count: (.people | length),
companies_count: (.companies | length),
links_count: (.links | length),
Expand All @@ -596,7 +596,7 @@ if [ $# -eq 0 ]; then
fi

URLS=("$@")
SKILL_DIR="$HOME/.claude/skills/parser"
SKILL_DIR="$HOME/.opencode/skills/Utilities/Parser"
OUTPUT_DIR="$SKILL_DIR/output"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)

Expand Down Expand Up @@ -659,7 +659,7 @@ if (!rawEntitiesPath) {
process.exit(1);
}

const entityIndexPath = `${process.env.HOME}/.claude/skills/parser/entity-index.json`;
const entityIndexPath = `${process.env.HOME}/.opencode/skills/Utilities/Parser/entity-index.json`;
const entityIndex = JSON.parse(fs.readFileSync(entityIndexPath, 'utf-8'));

const rawEntities = JSON.parse(fs.readFileSync(rawEntitiesPath, 'utf-8'));
Expand All @@ -675,7 +675,7 @@ fs.writeFileSync(entityIndexPath, JSON.stringify(entityIndex, null, 2));
// Save processed articles
processedArticles.forEach((article: any, index: number) => {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5);
const filename = `${process.env.HOME}/.claude/skills/parser/output/${timestamp}_batch-${index + 1}.json`;
const filename = `${process.env.HOME}/.opencode/skills/Utilities/Parser/output/${timestamp}_batch-${index + 1}.json`;
fs.writeFileSync(filename, JSON.stringify(article, null, 2));
console.log(`Saved: ${filename}`);
});
Expand Down
10 changes: 6 additions & 4 deletions PAI-Install/engine/steps-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 5-step migration flow with explicit user consent and backup.
*/

import { existsSync, cpSync, mkdirSync, writeFileSync } from "node:fs";
import { existsSync, cpSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { homedir } from "node:os";
import type { InstallState } from "./types";
Expand Down Expand Up @@ -224,18 +224,20 @@ exec bun "${join(paiDir, "PAI", "Tools", "pai.ts")}" "$@"
const aliasLine = isFish
? `alias pai 'bun ${escapedPath}'`
: `alias pai='bun ${escapedPath}'`;
const marker = "# PAI alias (v3)";
const startMarker = "# PAI shell setup — added by PAI installer";
const endMarker = "# end PAI shell setup";

try {
let content = "";
if (existsSync(rcPath)) {
content = require("fs").readFileSync(rcPath, "utf-8");
content = readFileSync(rcPath, "utf-8");
content = content.replace(/\n?# PAI shell setup — added by PAI installer[\s\S]*?# end PAI shell setup\n?/g, "");
// Remove old PAI aliases
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, "");
}
content = content.trimEnd() + `\n\n${marker}\n${aliasLine}\n`;
content = content.trimEnd() + `\n\n${startMarker}\n${aliasLine}\n${endMarker}\n`;
writeFileSync(rcPath, content);
} catch (err) {
console.warn("Could not update shell rc file:", err);
Expand Down
2 changes: 1 addition & 1 deletion docs/specs/UPSTREAM-SYNC-v1.8.0-SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ Two PRD creation mechanisms:
- **Target:** `.opencode/plugins/lib/prd-template.ts`
- **Changes:**
- Replace `~/.claude/` → `~/.opencode/` in path construction
- Replace `CLAUDE.md` → `OPENCODE.md` references
- Replace `CLAUDE.md` → `AGENTS.md` references
- Update file path constants to use `PAI_DIR`

**Step 2: Create AutoWorkCreation Plugin Handler**
Expand Down
Loading