Skip to content
Myr

generated.ts

This file

Path

apps/platform/src/workflows/generated.ts

41 lines · 1.9 KiB · TypeScript

Last changed by

Drop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6

History of this file

Take it

Merge build/410-project-skill-at-landing: a project's contribute skill stays current, re-landed when its config changes and flagged when a copy is staleoscabrielbefore adoptiondefaf32

line 1why, one step back
1/**

Drop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6

lines 2–3why, one step back
2 * The platform's generator for a project's own agent files:
3 * the contribute skill (`.agents/skills/<project>-contribute/SKILL.md`

Merge build/410-project-skill-at-landing: a project's contribute skill stays current, re-landed when its config changes and flagged when a copy is staleoscabrielbefore adoptiondefaf32

line 4why, one step back
4 * and its `.claude/skills/` copy) and the block in the project's AGENTS.md,

Drop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6

line 5why, one step back
5 * from `@repo/agent-kit`, which `@repo/project` may not import.

Merge build/410-project-skill-at-landing: a project's contribute skill stays current, re-landed when its config changes and flagged when a copy is staleoscabrielbefore adoptiondefaf32

lines 6–41why, one step back
6 *
7 * The Project DO runs it after any landing that moved its landed SHA8 * (`@repo/project/generated`): when the policy read there changes what the9 * files say, the DO lands them as a separate platform commit, composed onto10 * main and landed through the Lander like every platform landing, with the11 * request id `gen-<landed>`. `ProjectSkillGenerator` is the layer a DO's12 * ports carry it in; a project whose ports leave it out generates nothing.13 */14import { agentsBlock, upsertAgentsBlock } from "@repo/agent-kit/agents-block";15import { projectSkill } from "@repo/agent-kit/project-skill";16import { ProjectGenerator } from "@repo/project/generated";17import type { Generate } from "@repo/project/generated";18import { Effect, Layer, Option } from "effect";1920/** The project's own AGENTS.md: only the block between the platform's markers is written. */21const agentsFile = "AGENTS.md";2223/**24 * The skill, in both places harnesses read it, and AGENTS.md as the landed25 * tree has it with the block put in (appended after a blank line when the26 * file has none; made when there is no file).27 */28export const generate: Generate = ({ landed, policy, project, read }) =>29 Effect.gen(function* () {30 const skills = yield* projectSkill({ landed, policy, project });31 const block = yield* agentsBlock({ landed, policy, project });32 const existing = Option.getOrElse(yield* read(agentsFile), () => "");3334 return [35 ...skills,36 { content: upsertAgentsBlock(existing, block), path: agentsFile },37 ];38 });3940/** The generator, for a Project DO's ports. */41export const ProjectSkillGenerator = Layer.succeed(ProjectGenerator, generate);