From 3aed1c8f9205131682aef1bc62b37df4abdff504 Mon Sep 17 00:00:00 2001 From: Codex Automation Date: Tue, 2 Jun 2026 10:59:16 +0200 Subject: [PATCH] Use bundled project agents template --- .../WorkflowRulesEditorTests.cs | 13 ++++++ .../Workflow/WorkflowRulesEditorTools.cs | 41 +++---------------- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/MeetingAssistant.Tests/WorkflowRulesEditorTests.cs b/MeetingAssistant.Tests/WorkflowRulesEditorTests.cs index 0df7ba3..8ab7108 100644 --- a/MeetingAssistant.Tests/WorkflowRulesEditorTests.cs +++ b/MeetingAssistant.Tests/WorkflowRulesEditorTests.cs @@ -260,6 +260,19 @@ public sealed class WorkflowRulesEditorTests Assert.Equal("Direct project instructions.", await File.ReadAllTextAsync(Path.Combine(betaRoot, "AGENTS.md"))); Assert.False(File.Exists(Path.Combine(betaRoot, "PROJECT.md"))); Assert.StartsWith("Refused:", await tools.CreateProject("../Escape")); + + var missingTemplateTools = new WorkflowRulesEditorTools( + new MeetingAssistantOptions + { + Vault = + { + ProjectsFolder = projectsRoot + } + }, + projectAgentsTemplatePath: Path.Combine(root, "Missing-Project-AGENTS.md")); + var missingTemplate = await missingTemplateTools.CreateProject("Gamma Project"); + Assert.StartsWith("Refused: recommended project AGENTS.md template was not found:", missingTemplate); + Assert.False(Directory.Exists(Path.Combine(projectsRoot, "Gamma Project"))); } [Fact] diff --git a/MeetingAssistant/Workflow/WorkflowRulesEditorTools.cs b/MeetingAssistant/Workflow/WorkflowRulesEditorTools.cs index cf4f722..21fda71 100644 --- a/MeetingAssistant/Workflow/WorkflowRulesEditorTools.cs +++ b/MeetingAssistant/Workflow/WorkflowRulesEditorTools.cs @@ -368,6 +368,11 @@ public sealed class WorkflowRulesEditorTools return "Refused: agents_md seed requires AGENTS.md content."; } + if (normalizedSeed == "recommended" && !File.Exists(projectAgentsTemplatePath)) + { + return $"Refused: recommended project AGENTS.md template was not found: {projectAgentsTemplatePath}."; + } + Directory.CreateDirectory(projectRoot.Path!); switch (normalizedSeed) { @@ -940,9 +945,7 @@ public sealed class WorkflowRulesEditorTools private async Task WriteRecommendedProjectSeedAsync(string projectRoot, string projectName) { - var agentsContent = File.Exists(projectAgentsTemplatePath) - ? await File.ReadAllTextAsync(projectAgentsTemplatePath) - : DefaultProjectAgentsContent; + var agentsContent = await File.ReadAllTextAsync(projectAgentsTemplatePath); await File.WriteAllTextAsync(Path.Combine(projectRoot, "AGENTS.md"), agentsContent); await File.WriteAllTextAsync(Path.Combine(projectRoot, "PROJECT.md"), CreateDefaultProjectFile(projectName)); await File.WriteAllTextAsync(Path.Combine(projectRoot, "JOURNAL.md"), CreateDefaultJournalFile(projectName)); @@ -999,38 +1002,6 @@ public sealed class WorkflowRulesEditorTools """; } - private const string DefaultProjectAgentsContent = """ - The project is split in 3 important files: - PROJECT.md - DECISIONS.md - JOURNAL.md - - The idea is a hierarchical summary: - - Meeting Summary -> detailed (what was discussed) - then Journal Entry -> compressed (why should I care this event happened?) - then PROJECT.md -> distilled (what do I absolutely have to know about this project EVERY TIME I work on it. This is an onboarding document that every agent should read.) - - The journal should always be appended and read using tail or searched. - - Journal entries use this shape: - - ```markdown - ## 2026-05-30 - ### Team Daily - - New Blocker: HLS delayed - - Impact: Release likely delayed, team implements Z-Levels in the meantime. - - [[20260529-093030-6187486-summary|Summary]] - ``` - - DECISIONS.md logs only important decisions in a compressed way, with a link to ADRs and/or meeting summaries for details. - Important decisions are architecture decisions that are expensive to change, or project decisions about timeline, goals, governance, team, or process. - Do not log small implementation details such as how UI elements are aligned. - """; - private async Task ReadMeetingArtifactSummaryAsync(string path) { var content = await File.ReadAllTextAsync(path);