Fold per-stage skill files into bundled prompt modules (retire *_SKILL_PATH) #28

Closed
opened 2026-07-27 06:42:40 +00:00 by david · 0 comments
Owner

Summary

Fold the per-stage skill bodies into bundled TypeScript modules composed directly into each stage's system prompt, replacing the external *_SKILL_PATH file-loading mechanism and its degrade path.

Motivation

  • Determinism: external skill files were an unattended-pipeline liability — a missing/edited/unreadable file changed prompt behaviour and forced a degrade path.
  • Simplicity: removes the skill-file reader, frontmatter stripping, degrade branching, and four config env vars.
  • Editability: stage how-to now lives in versioned, reviewable TypeScript modules under src/skills/ alongside the code, with shared guidance factored out.

What changed

  • New bundled skill modules under src/skills/:
    • implementSkill.ts, reviewSkill.ts, remediateSkill.ts, mrSkill.ts
    • shared/codeQuality.ts shared by implement + remediate
  • composeStagePrompt simplified to wrapper + separator + bundled body; removed the filesystem read, stripFrontmatter, and all degrade branches.
  • ComposeStagePromptInput now takes body (bundled) instead of skillPath/defaultBody/readSkillFile.
  • degraded/degradedStages retained in the schema for downstream/artifact compatibility, but always false/[].
  • Per-stage defaults.ts re-export the bundled bodies under the historic DEFAULT_*_SKILL_BODY names to keep stage wiring stable.
  • Config: removed SkillPathsConfig and the skills block from PiLoopConfig/MaskedConfig and the loader/masker.
  • Retired env vars (now ignored, CLI warns when set): IMPLEMENT_SKILL_PATH, REVIEW_SKILL_PATH, REMEDIATE_SKILL_PATH, MR_SKILL_PATH.
  • Docs updated: README.md, AGENTS.md (error-handling policy, config, testing expectations).

Acceptance Criteria

  • Skill bodies bundled in src/skills/ (implement/review/remediate/mr + shared/codeQuality.ts)
  • composeStagePrompt composes wrapper + bundled body with no file read and no degrade path
  • ComposeStagePromptInput uses body instead of skillPath/defaultBody/readSkillFile
  • degraded/degradedStages retained for compatibility and always false/[]
  • *_SKILL_PATH env vars removed from config and added to RETIRED_ENV_VARS
  • README.md and AGENTS.md updated to reflect bundled skills
  • npm test and npm run lint pass
  • Prior design: prompt/skill composition (D15/D16) in DESIGN.md
  • Retires: IMPLEMENT_SKILL_PATH, REVIEW_SKILL_PATH, REMEDIATE_SKILL_PATH, MR_SKILL_PATH
## Summary Fold the per-stage skill bodies into bundled TypeScript modules composed directly into each stage's system prompt, replacing the external `*_SKILL_PATH` file-loading mechanism and its degrade path. ## Motivation - **Determinism:** external skill files were an unattended-pipeline liability — a missing/edited/unreadable file changed prompt behaviour and forced a degrade path. - **Simplicity:** removes the skill-file reader, frontmatter stripping, degrade branching, and four config env vars. - **Editability:** stage how-to now lives in versioned, reviewable TypeScript modules under `src/skills/` alongside the code, with shared guidance factored out. ## What changed - New bundled skill modules under `src/skills/`: - `implementSkill.ts`, `reviewSkill.ts`, `remediateSkill.ts`, `mrSkill.ts` - `shared/codeQuality.ts` shared by implement + remediate - `composeStagePrompt` simplified to `wrapper + separator + bundled body`; removed the filesystem read, `stripFrontmatter`, and all degrade branches. - `ComposeStagePromptInput` now takes `body` (bundled) instead of `skillPath`/`defaultBody`/`readSkillFile`. - `degraded`/`degradedStages` retained in the schema for downstream/artifact compatibility, but always `false`/`[]`. - Per-stage `defaults.ts` re-export the bundled bodies under the historic `DEFAULT_*_SKILL_BODY` names to keep stage wiring stable. - Config: removed `SkillPathsConfig` and the `skills` block from `PiLoopConfig`/`MaskedConfig` and the loader/masker. - Retired env vars (now ignored, CLI warns when set): `IMPLEMENT_SKILL_PATH`, `REVIEW_SKILL_PATH`, `REMEDIATE_SKILL_PATH`, `MR_SKILL_PATH`. - Docs updated: `README.md`, `AGENTS.md` (error-handling policy, config, testing expectations). ## Acceptance Criteria - [x] Skill bodies bundled in `src/skills/` (implement/review/remediate/mr + `shared/codeQuality.ts`) - [x] `composeStagePrompt` composes wrapper + bundled body with no file read and no degrade path - [x] `ComposeStagePromptInput` uses `body` instead of `skillPath`/`defaultBody`/`readSkillFile` - [x] `degraded`/`degradedStages` retained for compatibility and always `false`/`[]` - [x] `*_SKILL_PATH` env vars removed from config and added to `RETIRED_ENV_VARS` - [x] `README.md` and `AGENTS.md` updated to reflect bundled skills - [ ] `npm test` and `npm run lint` pass ## Related - Prior design: prompt/skill composition (D15/D16) in `DESIGN.md` - Retires: `IMPLEMENT_SKILL_PATH`, `REVIEW_SKILL_PATH`, `REMEDIATE_SKILL_PATH`, `MR_SKILL_PATH`
david closed this issue 2026-07-27 06:47:44 +00:00
Sign in to join this conversation.
No milestone
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-loop#28
No description provided.