Update package.json: add install:local script and register forgejo extension #95

Closed
opened 2026-08-27 23:59:07 +00:00 by david · 1 comment
Owner

Summary

Add the install:local npm script (running node scripts/local-install.mjs) and register the forgejo extension in the pi manifest, bringing the manifest from 3 to 4 extensions.

Background

This repo is a pi package: the pi key in the root package.json is the manifest pi loads. Currently it declares 3 extensions (extensions/rg/index.ts, extensions/postgres/index.ts, extensions/pr-comments/src/index.ts) plus ./skills (12 markdown-only skills), and has no scripts section. The forgejo extension at extensions/forgejo/src/index.ts already has a working entry point (forgejo_detect plus issue/PR/milestone tool suites) and imports only @earendil-works/pi-coding-agent (root peerDependency) and typebox (root dependency) — no new runtime dependencies.

This step is a prerequisite for npm run install:local to work; the script file itself is created in a later step of this plan.

Part of the npm run install:local feature (tracking issue #41). Per AGENTS.md, this is a feature-labeled change: branch feature/issue-<N>/<slug>, commits prefixed issue-<N>: <summary>, PR issue-<N>: <title> with Closes #<N>, squash-merge and delete the branch.

Implementation Details

Edit the root package.json:

  1. Add a scripts section with "install:local": "node scripts/local-install.mjs". This must be an explicit script only — deliberately NOT an npm lifecycle hook (no postinstall/prepare); it must never auto-run on npm install and must run only via npm run install:local.
  2. In pi.extensions, add "extensions/forgejo/src/index.ts" → exactly 4 extensions total (keep the existing 3).
  3. Leave pi.skills as ["./skills"] (12 skills) unchanged.
  4. Do not add anything to dependencies/peerDependencies — verify forgejo's imports resolve against the existing root peerDependencies (@earendil-works/pi-coding-agent) and dependencies (typebox).

Acceptance Criteria

  • package.json stays valid JSON; npm pkg get scripts.install:local outputs "node scripts/local-install.mjs".
  • npm run lists an install:local entry, and no lifecycle/postinstall hook was added.
  • pi.extensions contains exactly 4 entries including extensions/forgejo/src/index.ts.
  • No new entries were added to dependencies or peerDependencies.
  • npm install completes without errors.
  • Known intermediate state: npm run install:local fails with a module-not-found error until scripts/local-install.mjs exists (created in a later step) — expected and acceptable at this point.

Test Plan

  • npm pkg get scripts.install:local → expect "node scripts/local-install.mjs".
  • npm pkg get pi.extensions → expect an array of 4 entries including extensions/forgejo/src/index.ts.
  • npm install → exits 0.
## Summary Add the `install:local` npm script (running `node scripts/local-install.mjs`) and register the forgejo extension in the pi manifest, bringing the manifest from 3 to 4 extensions. ## Background This repo is a pi package: the `pi` key in the root `package.json` is the manifest pi loads. Currently it declares 3 extensions (`extensions/rg/index.ts`, `extensions/postgres/index.ts`, `extensions/pr-comments/src/index.ts`) plus `./skills` (12 markdown-only skills), and has no `scripts` section. The forgejo extension at `extensions/forgejo/src/index.ts` already has a working entry point (forgejo_detect plus issue/PR/milestone tool suites) and imports only `@earendil-works/pi-coding-agent` (root peerDependency) and `typebox` (root dependency) — no new runtime dependencies. This step is a prerequisite for `npm run install:local` to work; the script file itself is created in a later step of this plan. Part of the `npm run install:local` feature (tracking issue #41). Per AGENTS.md, this is a `feature`-labeled change: branch `feature/issue-<N>/<slug>`, commits prefixed `issue-<N>: <summary>`, PR `issue-<N>: <title>` with `Closes #<N>`, squash-merge and delete the branch. ## Implementation Details Edit the root `package.json`: 1. Add a `scripts` section with `"install:local": "node scripts/local-install.mjs"`. This must be an explicit script only — deliberately **NOT** an npm lifecycle hook (no `postinstall`/`prepare`); it must never auto-run on `npm install` and must run only via `npm run install:local`. 2. In `pi.extensions`, add `"extensions/forgejo/src/index.ts"` → exactly 4 extensions total (keep the existing 3). 3. Leave `pi.skills` as `["./skills"]` (12 skills) unchanged. 4. Do not add anything to `dependencies`/`peerDependencies` — verify forgejo's imports resolve against the existing root `peerDependencies` (`@earendil-works/pi-coding-agent`) and `dependencies` (`typebox`). ## Acceptance Criteria - [ ] `package.json` stays valid JSON; `npm pkg get scripts.install:local` outputs `"node scripts/local-install.mjs"`. - [ ] `npm run` lists an `install:local` entry, and no lifecycle/postinstall hook was added. - [ ] `pi.extensions` contains exactly 4 entries including `extensions/forgejo/src/index.ts`. - [ ] No new entries were added to `dependencies` or `peerDependencies`. - [ ] `npm install` completes without errors. - [ ] Known intermediate state: `npm run install:local` fails with a module-not-found error until `scripts/local-install.mjs` exists (created in a later step) — expected and acceptable at this point. ## Test Plan - `npm pkg get scripts.install:local` → expect `"node scripts/local-install.mjs"`. - `npm pkg get pi.extensions` → expect an array of 4 entries including `extensions/forgejo/src/index.ts`. - `npm install` → exits 0.
Author
Owner

Work for this issue is complete — closing.

  • package.json has "install:local": "node scripts/local-install.mjs" as an explicit script (no lifecycle/postinstall hook).
  • pi.extensions includes extensions/forgejo/src/index.ts (the manifest now lists 10 extensions; pi.skills unchanged at ["./skills"]).
  • No new entries were added to dependencies/peerDependencies for the forgejo extension.
  • The "known intermediate state" (module-not-found until the script exists) no longer applies — scripts/local-install.mjs is implemented and npm run install:local works end-to-end.
Work for this issue is complete — closing. - `package.json` has `"install:local": "node scripts/local-install.mjs"` as an explicit script (no lifecycle/postinstall hook). - `pi.extensions` includes `extensions/forgejo/src/index.ts` (the manifest now lists 10 extensions; `pi.skills` unchanged at `["./skills"]`). - No new entries were added to `dependencies`/`peerDependencies` for the forgejo extension. - The "known intermediate state" (module-not-found until the script exists) no longer applies — `scripts/local-install.mjs` is implemented and `npm run install:local` works end-to-end.
david closed this issue 2026-09-18 05:42:12 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-extensions-and-skills#95
No description provided.