@slopus/beer 0.1.2 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_workflows/_index.d.ts +1 -1
- package/dist/_workflows/_index.js +7 -7
- package/dist/_workflows/bootstrap.d.ts +1 -1
- package/dist/_workflows/bootstrap.js +14 -14
- package/dist/_workflows/checkpointWorkflow.d.ts +1 -1
- package/dist/_workflows/checkpointWorkflow.js +2 -2
- package/dist/_workflows/context/context.d.ts +2 -2
- package/dist/_workflows/context/context.js +11 -11
- package/dist/_workflows/context/context.spec.js +1 -1
- package/dist/_workflows/context/utils/contextApplyConfig.d.ts +1 -1
- package/dist/_workflows/context/utils/contextApplyConfig.js +1 -1
- package/dist/_workflows/context/utils/contextApplyConfig.spec.js +1 -1
- package/dist/_workflows/context/utils/contextAskGithubRepo.d.ts +1 -1
- package/dist/_workflows/context/utils/contextAskGithubRepo.js +3 -3
- package/dist/_workflows/context/utils/contextAskGithubRepo.spec.js +1 -1
- package/dist/_workflows/context/utils/contextGitignoreEnsure.spec.js +1 -1
- package/dist/_workflows/context/utils/progressMultilineStart.spec.js +1 -1
- package/dist/_workflows/planWorkflow.d.ts +1 -1
- package/dist/_workflows/planWorkflow.js +9 -9
- package/dist/_workflows/prompts/PROMPT_AGENTS_MD.md +168 -0
- package/dist/_workflows/prompts/PROMPT_DECISIONS.md +372 -0
- package/dist/_workflows/prompts/PROMPT_PRODUCT_NAME.md +101 -0
- package/dist/_workflows/prompts/PROMPT_PRODUCT_PITCH.md +197 -0
- package/dist/_workflows/prompts/PROMPT_PRODUCT_PITCH_FINAL.md +44 -0
- package/dist/_workflows/prompts/PROMPT_PROJECT_BLUEPRINT.md +469 -0
- package/dist/_workflows/prompts/PROMPT_README.md +101 -0
- package/dist/_workflows/prompts/PROMPT_RESEARCH.md +407 -0
- package/dist/_workflows/prompts/PROMPT_RESEARCH_PROBLEMS.md +296 -0
- package/dist/_workflows/prompts/PROMPT_TECHNOLOGY_STACK.md +460 -0
- package/dist/_workflows/prompts/PROMPT_TECHNOLOGY_STACK_FINAL.md +48 -0
- package/dist/_workflows/ralphLoopWorkflow.d.ts +1 -1
- package/dist/_workflows/ralphLoopWorkflow.js +5 -5
- package/dist/_workflows/ralphWorkflow.d.ts +1 -1
- package/dist/_workflows/ralphWorkflow.js +5 -5
- package/dist/_workflows/researchWorkflow.d.ts +1 -1
- package/dist/_workflows/researchWorkflow.js +3 -3
- package/dist/_workflows/steps/generate.d.ts +2 -2
- package/dist/_workflows/steps/generate.js +3 -3
- package/dist/_workflows/steps/generateCommit.d.ts +1 -1
- package/dist/_workflows/steps/generateCommit.js +2 -2
- package/dist/_workflows/steps/generateDocument.d.ts +2 -2
- package/dist/_workflows/steps/generateDocument.js +3 -3
- package/dist/_workflows/steps/generateFrontmatter.d.ts +2 -2
- package/dist/_workflows/steps/generateFrontmatter.js +1 -1
- package/dist/_workflows/steps/generateProgressMessageResolve.d.ts +1 -1
- package/dist/_workflows/steps/generateReadme.d.ts +1 -1
- package/dist/_workflows/steps/generateReadme.js +2 -2
- package/dist/_workflows/steps/ralphExecute.d.ts +1 -1
- package/dist/_workflows/steps/ralphExecute.js +2 -2
- package/dist/_workflows/steps/ralphLoopExecute.d.ts +1 -1
- package/dist/_workflows/steps/ralphLoopExecute.js +2 -2
- package/dist/_workflows/steps/ralphLoopPlanGenerate.d.ts +1 -1
- package/dist/_workflows/steps/ralphLoopPlanGenerate.js +3 -3
- package/dist/_workflows/steps/ralphLoopPlanPathResolve.d.ts +1 -1
- package/dist/_workflows/steps/ralphLoopReviewRound.d.ts +1 -1
- package/dist/_workflows/steps/ralphLoopReviewRound.js +2 -2
- package/dist/_workflows/steps/ralphPlan.d.ts +1 -1
- package/dist/_workflows/steps/ralphPlan.js +6 -6
- package/dist/_workflows/steps/ralphPlanPathResolve.d.ts +1 -1
- package/dist/_workflows/steps/ralphReview.d.ts +1 -1
- package/dist/_workflows/steps/ralphReview.js +4 -4
- package/dist/main.js +5 -5
- package/dist/modules/ai/aiOutputExtract.spec.js +1 -1
- package/dist/modules/ai/generate.d.ts +2 -2
- package/dist/modules/ai/generate.js +5 -5
- package/dist/modules/ai/generate.spec.js +1 -1
- package/dist/modules/ai/generate.unit.spec.js +1 -1
- package/dist/modules/ai/generateEventTypes.d.ts +2 -2
- package/dist/modules/ai/generateFile.d.ts +2 -2
- package/dist/modules/ai/generateFile.js +2 -2
- package/dist/modules/ai/generateFile.spec.js +1 -1
- package/dist/modules/ai/generatePureSessionCreate.d.ts +3 -3
- package/dist/modules/ai/generatePureSessionCreate.js +1 -1
- package/dist/modules/ai/generatePureSessionCreate.spec.js +1 -1
- package/dist/modules/ai/generatePureText.d.ts +2 -2
- package/dist/modules/ai/generatePureText.js +5 -5
- package/dist/modules/ai/generatePureText.spec.js +1 -1
- package/dist/modules/ai/generateSessionCreate.d.ts +2 -2
- package/dist/modules/ai/generateSessionCreate.js +1 -1
- package/dist/modules/ai/generateSessionCreate.spec.js +1 -1
- package/dist/modules/ai/generateText.d.ts +2 -2
- package/dist/modules/ai/generateText.js +1 -1
- package/dist/modules/ai/generateText.spec.js +1 -1
- package/dist/modules/ai/generateVerify.spec.js +1 -1
- package/dist/modules/ai/providerGenerate.d.ts +3 -3
- package/dist/modules/ai/providerGenerate.js +2 -2
- package/dist/modules/ai/providerGenerate.spec.js +2 -2
- package/dist/modules/ai/providerGenerate.unit.spec.js +1 -1
- package/dist/modules/ai/providers/commandJSONL.d.ts +1 -1
- package/dist/modules/ai/providers/commandJSONL.js +2 -2
- package/dist/modules/ai/providers/commandJSONL.spec.js +1 -1
- package/dist/modules/ai/providers/piProviderGenerate.d.ts +1 -1
- package/dist/modules/ai/providers/piProviderGenerate.js +1 -1
- package/dist/modules/ai/providers/piProviderGenerate.spec.js +1 -1
- package/dist/modules/beer/beerOriginalPathResolve.spec.js +1 -1
- package/dist/modules/beer/beerSettingsRead.d.ts +1 -1
- package/dist/modules/beer/beerSettingsRead.spec.js +1 -1
- package/dist/modules/beer/beerSettingsTypes.d.ts +2 -2
- package/dist/modules/beer/beerSettingsWrite.d.ts +1 -1
- package/dist/modules/git/gitPush.js +1 -1
- package/dist/modules/git/gitRemoteEnsure.js +1 -1
- package/dist/modules/git/gitRepoCheckout.js +1 -1
- package/dist/modules/git/gitRepoCheckout.spec.js +2 -2
- package/dist/modules/git/gitRepoEnsure.js +1 -1
- package/dist/modules/git/gitRepoEnsure.spec.js +1 -1
- package/dist/modules/git/gitStageAndCommit.js +1 -1
- package/dist/modules/git/gitignoreEnsure.spec.js +1 -1
- package/dist/modules/github/githubCliEnsure.js +2 -2
- package/dist/modules/github/githubOwnerChoicesGet.js +1 -1
- package/dist/modules/github/githubRepoCreate.js +1 -1
- package/dist/modules/github/githubRepoExists.js +1 -1
- package/dist/modules/github/githubRepoNameResolve.d.ts +1 -1
- package/dist/modules/github/githubRepoNameResolve.js +1 -1
- package/dist/modules/github/githubRepoNameResolve.spec.js +1 -1
- package/dist/modules/github/githubRepoParse.d.ts +1 -1
- package/dist/modules/github/githubRepoParse.spec.js +1 -1
- package/dist/modules/github/githubRepoStatusGet.d.ts +1 -1
- package/dist/modules/github/githubRepoStatusGet.js +2 -2
- package/dist/modules/github/githubViewerGet.js +2 -2
- package/dist/modules/plan/planPromptChildren.d.ts +2 -2
- package/dist/modules/plan/planPromptChildren.spec.js +1 -1
- package/dist/modules/plan/planPromptDocument.d.ts +2 -2
- package/dist/modules/plan/planPromptDocument.spec.js +1 -1
- package/dist/modules/plan/planPromptPicker.d.ts +1 -1
- package/dist/modules/plan/planPromptPicker.js +1 -1
- package/dist/modules/plan/planPromptPicker.spec.js +1 -1
- package/dist/modules/plan/planPromptRoot.d.ts +1 -1
- package/dist/modules/plan/planPromptRoot.spec.js +1 -1
- package/dist/modules/plan/planSourceDocumentsResolve.d.ts +1 -1
- package/dist/modules/plan/planSourceDocumentsResolve.spec.js +1 -1
- package/dist/modules/providers/providerDetect.d.ts +1 -1
- package/dist/modules/providers/providerDetect.js +2 -2
- package/dist/modules/providers/providerDetect.spec.js +1 -1
- package/dist/modules/providers/providerModelSelect.d.ts +1 -1
- package/dist/modules/providers/providerModelSelect.spec.js +1 -1
- package/dist/modules/providers/providerModelsGet.d.ts +1 -1
- package/dist/modules/providers/providerModelsGet.js +1 -1
- package/dist/modules/providers/providerModelsGet.spec.js +1 -1
- package/dist/modules/providers/providerPriorityList.d.ts +1 -1
- package/dist/modules/providers/providerPriorityList.spec.js +1 -1
- package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.d.ts +1 -1
- package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.js +1 -1
- package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.spec.js +1 -1
- package/dist/modules/sandbox/sandboxInferenceGet.d.ts +2 -2
- package/dist/modules/sandbox/sandboxInferenceGet.js +1 -1
- package/dist/modules/sandbox/sandboxPassthrough.d.ts +1 -1
- package/dist/modules/sandbox/sandboxPassthrough.spec.js +1 -1
- package/dist/modules/tree/treeChildrenParse.d.ts +1 -1
- package/dist/modules/tree/treeChildrenRead.d.ts +1 -1
- package/dist/modules/tree/treeChildrenRead.spec.js +1 -1
- package/dist/modules/tree/treeChildrenWrite.d.ts +1 -1
- package/dist/modules/tree/treeChildrenWrite.spec.js +1 -1
- package/dist/modules/tree/treeInferenceProgressRun.d.ts +1 -1
- package/dist/modules/tree/treeInferenceProgressRun.js +1 -1
- package/dist/modules/tree/treeInferenceProgressRun.spec.js +1 -1
- package/dist/modules/tree/treeLeafPick.d.ts +1 -1
- package/dist/modules/tree/treeLeafPick.js +8 -8
- package/dist/modules/tree/treeLeafPick.spec.js +1 -1
- package/dist/modules/tree/treeNodeExpand.d.ts +1 -1
- package/dist/modules/tree/treeNodeExpand.js +8 -8
- package/dist/modules/tree/treeNodeExpand.spec.js +3 -3
- package/dist/modules/tree/treeNodePathResolve.d.ts +1 -1
- package/dist/modules/tree/treeNodeRead.d.ts +1 -1
- package/dist/modules/tree/treeNodeRead.spec.js +1 -1
- package/dist/modules/tree/treeNodeSlug.spec.js +1 -1
- package/dist/modules/tree/treeNodeWrite.d.ts +1 -1
- package/dist/modules/tree/treeNodeWrite.spec.js +1 -1
- package/dist/modules/tree/treeSearchRun.d.ts +1 -1
- package/dist/modules/tree/treeSearchRun.js +12 -12
- package/dist/modules/tree/treeSearchRun.spec.js +3 -3
- package/dist/modules/tree/treeSearchTypes.d.ts +1 -1
- package/dist/modules/tree/treeStateLeaves.d.ts +1 -1
- package/dist/modules/tree/treeStateLeaves.spec.js +1 -1
- package/dist/modules/tree/treeStateRead.d.ts +1 -1
- package/dist/modules/tree/treeStateRead.js +2 -2
- package/dist/modules/tree/treeStateRead.spec.js +1 -1
- package/dist/modules/tree/treeStateRender.d.ts +1 -1
- package/dist/modules/tree/treeStateRender.spec.js +1 -1
- package/dist/modules/util/asyncLock.spec.js +1 -1
- package/dist/modules/util/commandRun.d.ts +1 -1
- package/dist/modules/util/commandRun.js +2 -2
- package/dist/modules/util/commandRun.spec.js +1 -1
- package/dist/modules/util/pathLock.js +2 -2
- package/dist/modules/util/pathLock.spec.js +1 -1
- package/dist/modules/util/pathLockOverlap.spec.js +1 -1
- package/dist/release/releaseRun.js +3 -3
- package/dist/release/releaseVersionPrompt.js +3 -3
- package/dist/text/text.d.ts +2 -2
- package/dist/text/text.js +1 -1
- package/dist/text/text.spec.js +1 -1
- package/dist/text/textGenBuild.js +1 -1
- package/dist/text/textGenGenerate.spec.js +1 -1
- package/dist/types.d.ts +9 -9
- package/dist/types.js +1 -1
- package/package.json +3 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { bootstrap } from "
|
|
3
|
-
import { checkpointWorkflow } from "
|
|
4
|
-
import { planWorkflow } from "
|
|
5
|
-
import { ralphLoopWorkflow } from "
|
|
6
|
-
import { ralphWorkflow } from "
|
|
7
|
-
import { researchWorkflow } from "
|
|
1
|
+
import { text } from "../text/text.js";
|
|
2
|
+
import { bootstrap } from "../_workflows/bootstrap.js";
|
|
3
|
+
import { checkpointWorkflow } from "../_workflows/checkpointWorkflow.js";
|
|
4
|
+
import { planWorkflow } from "../_workflows/planWorkflow.js";
|
|
5
|
+
import { ralphLoopWorkflow } from "../_workflows/ralphLoopWorkflow.js";
|
|
6
|
+
import { ralphWorkflow } from "../_workflows/ralphWorkflow.js";
|
|
7
|
+
import { researchWorkflow } from "../_workflows/researchWorkflow.js";
|
|
8
8
|
export const workflowBootstrap = {
|
|
9
9
|
id: "bootstrap",
|
|
10
10
|
title: text.workflow_bootstrap_title,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { text, textFormatKey } from "
|
|
2
|
-
import { generateReadme } from "
|
|
3
|
-
import { beerOriginalPathResolve } from "
|
|
4
|
-
import { gitRemoteEnsure } from "
|
|
5
|
-
import { gitRepoCheckout } from "
|
|
6
|
-
import { gitRepoEnsure } from "
|
|
7
|
-
import { githubOwnerChoicesGet } from "
|
|
8
|
-
import { githubRepoCreate } from "
|
|
9
|
-
import { githubRepoNameResolve } from "
|
|
10
|
-
import { githubRepoStatusGet } from "
|
|
11
|
-
import { githubRepoUrlBuild } from "
|
|
12
|
-
import { githubViewerGet } from "
|
|
13
|
-
import { promptConfirm } from "
|
|
14
|
-
import { promptInput } from "
|
|
1
|
+
import { text, textFormatKey } from "../text/text.js";
|
|
2
|
+
import { generateReadme } from "../_workflows/steps/generateReadme.js";
|
|
3
|
+
import { beerOriginalPathResolve } from "../modules/beer/beerOriginalPathResolve.js";
|
|
4
|
+
import { gitRemoteEnsure } from "../modules/git/gitRemoteEnsure.js";
|
|
5
|
+
import { gitRepoCheckout } from "../modules/git/gitRepoCheckout.js";
|
|
6
|
+
import { gitRepoEnsure } from "../modules/git/gitRepoEnsure.js";
|
|
7
|
+
import { githubOwnerChoicesGet } from "../modules/github/githubOwnerChoicesGet.js";
|
|
8
|
+
import { githubRepoCreate } from "../modules/github/githubRepoCreate.js";
|
|
9
|
+
import { githubRepoNameResolve } from "../modules/github/githubRepoNameResolve.js";
|
|
10
|
+
import { githubRepoStatusGet } from "../modules/github/githubRepoStatusGet.js";
|
|
11
|
+
import { githubRepoUrlBuild } from "../modules/github/githubRepoUrlBuild.js";
|
|
12
|
+
import { githubViewerGet } from "../modules/github/githubViewerGet.js";
|
|
13
|
+
import { promptConfirm } from "../modules/prompt/promptConfirm.js";
|
|
14
|
+
import { promptInput } from "../modules/prompt/promptInput.js";
|
|
15
15
|
/**
|
|
16
16
|
* Runs the interactive bootstrap workflow for holdmybeer.
|
|
17
17
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { promptInput } from "
|
|
1
|
+
import { text } from "../text/text.js";
|
|
2
|
+
import { promptInput } from "../modules/prompt/promptInput.js";
|
|
3
3
|
/**
|
|
4
4
|
* Runs a checkpoint workflow with AI-generated commit message.
|
|
5
5
|
* Expects: repository is initialized and configured for pushing to origin/main.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PathLock } from "
|
|
2
|
-
import type { BeerSettings, GitHubRepoRef, PathLockResult, ProviderDetection, ProviderModelSelectionMode } from "
|
|
1
|
+
import { PathLock } from "../../modules/util/pathLock.js";
|
|
2
|
+
import type { BeerSettings, GitHubRepoRef, PathLockResult, ProviderDetection, ProviderModelSelectionMode } from "../../types.js";
|
|
3
3
|
export interface ContextCheckpointOptions {
|
|
4
4
|
remote?: string;
|
|
5
5
|
branch?: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { lstat, mkdir, stat, symlink, unlink, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text as catalog } from "
|
|
4
|
-
import { contextApplyConfig } from "
|
|
5
|
-
import { contextAskGithubRepo } from "
|
|
6
|
-
import { contextGitignoreEnsure } from "
|
|
7
|
-
import { progressMultilineStart } from "
|
|
8
|
-
import { generateCommit } from "
|
|
9
|
-
import { beerSettingsRead } from "
|
|
10
|
-
import { gitPush } from "
|
|
11
|
-
import { gitStageAndCommit } from "
|
|
12
|
-
import { providerDetect } from "
|
|
13
|
-
import { PathLock } from "
|
|
3
|
+
import { text as catalog } from "../../text/text.js";
|
|
4
|
+
import { contextApplyConfig } from "../../_workflows/context/utils/contextApplyConfig.js";
|
|
5
|
+
import { contextAskGithubRepo } from "../../_workflows/context/utils/contextAskGithubRepo.js";
|
|
6
|
+
import { contextGitignoreEnsure } from "../../_workflows/context/utils/contextGitignoreEnsure.js";
|
|
7
|
+
import { progressMultilineStart } from "../../_workflows/context/utils/progressMultilineStart.js";
|
|
8
|
+
import { generateCommit } from "../../_workflows/steps/generateCommit.js";
|
|
9
|
+
import { beerSettingsRead } from "../../modules/beer/beerSettingsRead.js";
|
|
10
|
+
import { gitPush } from "../../modules/git/gitPush.js";
|
|
11
|
+
import { gitStageAndCommit } from "../../modules/git/gitStageAndCommit.js";
|
|
12
|
+
import { providerDetect } from "../../modules/providers/providerDetect.js";
|
|
13
|
+
import { PathLock } from "../../modules/util/pathLock.js";
|
|
14
14
|
/**
|
|
15
15
|
* Runtime workflow context with repository-aware helpers.
|
|
16
16
|
* Expects: projectPath points to the repository root.
|
|
@@ -34,7 +34,7 @@ vi.mock("@/_workflows/context/utils/contextGitignoreEnsure.js", () => ({
|
|
|
34
34
|
vi.mock("@/_workflows/context/utils/progressMultilineStart.js", () => ({
|
|
35
35
|
progressMultilineStart: progressMultilineStartMock
|
|
36
36
|
}));
|
|
37
|
-
import { Context } from "
|
|
37
|
+
import { Context } from "../../_workflows/context/context.js";
|
|
38
38
|
describe("Context", () => {
|
|
39
39
|
beforeEach(() => {
|
|
40
40
|
providerDetectMock.mockReset();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { beerSettingsWrite } from "
|
|
2
|
+
import { beerSettingsWrite } from "../../../modules/beer/beerSettingsWrite.js";
|
|
3
3
|
/**
|
|
4
4
|
* Applies a mutation to current settings and persists the result to .beer/settings.json.
|
|
5
5
|
* Expects: projectPath is the repository root.
|
|
@@ -3,7 +3,7 @@ const beerSettingsWriteMock = vi.hoisted(() => vi.fn());
|
|
|
3
3
|
vi.mock("@/modules/beer/beerSettingsWrite.js", () => ({
|
|
4
4
|
beerSettingsWrite: beerSettingsWriteMock
|
|
5
5
|
}));
|
|
6
|
-
import { contextApplyConfig } from "
|
|
6
|
+
import { contextApplyConfig } from "../../../_workflows/context/utils/contextApplyConfig.js";
|
|
7
7
|
describe("contextApplyConfig", () => {
|
|
8
8
|
it("applies update, persists with refreshed timestamp, and keeps input immutable", async () => {
|
|
9
9
|
const current = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { githubRepoExists } from "
|
|
2
|
-
import { githubRepoParse } from "
|
|
3
|
-
import { promptInput } from "
|
|
1
|
+
import { githubRepoExists } from "../../../modules/github/githubRepoExists.js";
|
|
2
|
+
import { githubRepoParse } from "../../../modules/github/githubRepoParse.js";
|
|
3
|
+
import { promptInput } from "../../../modules/prompt/promptInput.js";
|
|
4
4
|
/**
|
|
5
5
|
* Prompts until a valid and accessible GitHub repository is provided.
|
|
6
6
|
* Expects: question is a non-empty prompt text for the user.
|
|
@@ -11,7 +11,7 @@ vi.mock("@/modules/github/githubRepoParse.js", () => ({
|
|
|
11
11
|
vi.mock("@/modules/github/githubRepoExists.js", () => ({
|
|
12
12
|
githubRepoExists: githubRepoExistsMock
|
|
13
13
|
}));
|
|
14
|
-
import { contextAskGithubRepo } from "
|
|
14
|
+
import { contextAskGithubRepo } from "../../../_workflows/context/utils/contextAskGithubRepo.js";
|
|
15
15
|
describe("contextAskGithubRepo", () => {
|
|
16
16
|
beforeEach(() => {
|
|
17
17
|
promptInputMock.mockReset();
|
|
@@ -2,7 +2,7 @@ import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
import { contextGitignoreEnsure } from "
|
|
5
|
+
import { contextGitignoreEnsure } from "../../../_workflows/context/utils/contextGitignoreEnsure.js";
|
|
6
6
|
const tempDirs = [];
|
|
7
7
|
afterEach(async () => {
|
|
8
8
|
await Promise.all(tempDirs.splice(0).map((dir) => rm(dir, { recursive: true, force: true })));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { progressMultilineStart } from "
|
|
2
|
+
import { progressMultilineStart } from "../../../_workflows/context/utils/progressMultilineStart.js";
|
|
3
3
|
const originalIsTTY = process.stderr.isTTY;
|
|
4
4
|
afterEach(() => {
|
|
5
5
|
process.stderr.isTTY = originalIsTTY;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { text } from "
|
|
2
|
+
import { text } from "../text/text.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { planPromptChildren } from "
|
|
5
|
-
import { planPromptDocument } from "
|
|
6
|
-
import { planPromptPicker } from "
|
|
7
|
-
import { planPromptRoot } from "
|
|
8
|
-
import { planSourceDocumentsResolve } from "
|
|
9
|
-
import { treeSearchRun } from "
|
|
10
|
-
import { treeStateRead } from "
|
|
11
|
-
import { treeStateRender } from "
|
|
4
|
+
import { planPromptChildren } from "../modules/plan/planPromptChildren.js";
|
|
5
|
+
import { planPromptDocument } from "../modules/plan/planPromptDocument.js";
|
|
6
|
+
import { planPromptPicker } from "../modules/plan/planPromptPicker.js";
|
|
7
|
+
import { planPromptRoot } from "../modules/plan/planPromptRoot.js";
|
|
8
|
+
import { planSourceDocumentsResolve } from "../modules/plan/planSourceDocumentsResolve.js";
|
|
9
|
+
import { treeSearchRun } from "../modules/tree/treeSearchRun.js";
|
|
10
|
+
import { treeStateRead } from "../modules/tree/treeStateRead.js";
|
|
11
|
+
import { treeStateRender } from "../modules/tree/treeStateRender.js";
|
|
12
12
|
const planNodeFrontmatterSchema = z.object({
|
|
13
13
|
title: z.string().min(1),
|
|
14
14
|
slug: z.string().min(1),
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
You are a senior software architect producing an AGENTS.md file — the definitive agent instruction manual for an AI coding assistant that will build a **new product from scratch**. There is no existing codebase to scan. Instead, you have research documents from studying an original project, and you must synthesize conventions, patterns, and rules for the new product based on what was learned.
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
- **Output File Path**: {outputPath}
|
|
6
|
+
- **Original source repository:** {sourceFullName} (Use a `gh` tool to look into issues)
|
|
7
|
+
- **Local checkout path:** {originalCheckoutPath} (the original project we studied — read for reference, not to copy)
|
|
8
|
+
- **Product name:** {productName}
|
|
9
|
+
|
|
10
|
+
The local checkout is the **original project we studied**. It is a reference, not our codebase. We are building a new product informed by what we learned from dissecting this one.
|
|
11
|
+
|
|
12
|
+
Five documents have already been generated by analyzing the original project. Read them before starting:
|
|
13
|
+
|
|
14
|
+
- **Research Summary**: {researchPath} — structured analysis of the original project's identity, architecture, dependencies, development lifecycle, conventions, and hidden knowledge.
|
|
15
|
+
- **Unresolved Problems**: {unresolvedProblemsPath} — catalog of open questions, risks, contradictions, and gaps found in the original codebase.
|
|
16
|
+
- **Key Decisions**: {decisionsPath} — comprehensive catalog of every significant decision visible in the original project, with analysis of what to keep and what to change.
|
|
17
|
+
- **Product Pitch**: {productPitchPath} — description of the new product we are building, its features, philosophy, and goals.
|
|
18
|
+
- **Technology Stack**: {technologyStackPath} — comprehensive stack recommendation with exact tools, versions, and conventions for the new product.
|
|
19
|
+
|
|
20
|
+
## Core objective
|
|
21
|
+
|
|
22
|
+
Produce an AGENTS.md that an AI agent reads before every task on the **new product**. It must be:
|
|
23
|
+
- **Prescriptive**: tell the agent exactly how to write code for this new project
|
|
24
|
+
- **Actionable**: every rule can be followed mechanically
|
|
25
|
+
- **Minimal**: no filler, no aspirational statements, no repeating what tools already enforce
|
|
26
|
+
- **Informed**: conventions are derived from lessons learned (what worked in the original, what didn't, what we're doing differently)
|
|
27
|
+
|
|
28
|
+
This is NOT a description of the original project's conventions. This is the rulebook for the new one.
|
|
29
|
+
|
|
30
|
+
================================================================
|
|
31
|
+
SYNTHESIS PROCESS
|
|
32
|
+
================================================================
|
|
33
|
+
Follow this process in order. Do not skip phases. Do not guess when you can read.
|
|
34
|
+
|
|
35
|
+
### Phase 1: Extract what to keep
|
|
36
|
+
|
|
37
|
+
1. **Read the key decisions document.** For each decision marked as "keep" or with positive assessment:
|
|
38
|
+
- Extract the convention it implies
|
|
39
|
+
- Note the evidence that it worked well in the original
|
|
40
|
+
|
|
41
|
+
2. **Read the research summary.** Extract conventions that are:
|
|
42
|
+
- Consistently applied across the original codebase
|
|
43
|
+
- Well-suited to the new product's goals (from the product pitch)
|
|
44
|
+
- Worth carrying forward as rules
|
|
45
|
+
|
|
46
|
+
3. **Read the product pitch.** Extract:
|
|
47
|
+
- Stated design philosophy and values
|
|
48
|
+
- Technical architecture choices
|
|
49
|
+
- Features that imply specific coding patterns
|
|
50
|
+
|
|
51
|
+
### Phase 2: Extract what to change
|
|
52
|
+
|
|
53
|
+
4. **Read the unresolved problems document.** For each problem:
|
|
54
|
+
- Determine if it was caused by a convention (or lack of one)
|
|
55
|
+
- Design a rule that prevents the same problem in the new product
|
|
56
|
+
|
|
57
|
+
5. **Read the key decisions document.** For decisions marked as problematic or with tensions:
|
|
58
|
+
- Determine the better alternative for the new product
|
|
59
|
+
- Write a concrete rule that enforces the better choice
|
|
60
|
+
|
|
61
|
+
6. **Read the original codebase selectively** — only to verify or clarify specific patterns referenced in the research documents. Do not do a full codebase scan. Look at:
|
|
62
|
+
- Build/lint/format configs — to understand which settings worked and which to adjust
|
|
63
|
+
- Package manifests — to understand runtime and dependency baseline
|
|
64
|
+
- A few source files — to see patterns referenced in the research in their full context
|
|
65
|
+
|
|
66
|
+
### Phase 3: Design new conventions
|
|
67
|
+
|
|
68
|
+
7. **Fill gaps.** The original project may lack conventions in areas that the new product needs. For each gap:
|
|
69
|
+
- Check if the unresolved problems document flagged the absence
|
|
70
|
+
- Design a convention appropriate for the new product's goals
|
|
71
|
+
- Mark it as "new" (not inherited from the original)
|
|
72
|
+
|
|
73
|
+
8. **Resolve contradictions.** Where the original had inconsistent patterns:
|
|
74
|
+
- Pick the better pattern based on the key decisions analysis
|
|
75
|
+
- Write a single clear rule
|
|
76
|
+
|
|
77
|
+
### Phase 4: Write the AGENTS.md
|
|
78
|
+
|
|
79
|
+
9. **Structure the output** following the format below. Every rule must be:
|
|
80
|
+
- Concrete enough that an agent can follow it without asking questions
|
|
81
|
+
- Justified by evidence from the research documents (even if briefly)
|
|
82
|
+
- Applicable to a greenfield codebase (no references to "existing code" — there is none yet)
|
|
83
|
+
|
|
84
|
+
================================================================
|
|
85
|
+
OUTPUT FORMAT
|
|
86
|
+
================================================================
|
|
87
|
+
|
|
88
|
+
Produce a single AGENTS.md file with the following structure. Every section is mandatory. If a section does not apply, omit it entirely (do not write "N/A"). Use the shortest phrasing that is unambiguous.
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
# {productName} agent notes
|
|
92
|
+
|
|
93
|
+
## Goals
|
|
94
|
+
{3-5 bullet points: project philosophy and non-negotiable principles.
|
|
95
|
+
Derived from the product pitch and key decisions. These are the values that inform every convention below.}
|
|
96
|
+
|
|
97
|
+
## Conventions
|
|
98
|
+
{Bullet list of top-level structural conventions: package layout, language, output format, source locations, test patterns.
|
|
99
|
+
Each convention should state what to do, not what was done in the original.}
|
|
100
|
+
|
|
101
|
+
## Build, Test, and Development Commands
|
|
102
|
+
{Exact commands with one-line descriptions. Include prerequisites and command dependencies.
|
|
103
|
+
Derived from the original project's working setup, adjusted for any tooling changes.
|
|
104
|
+
Format: `- command: `exact invocation` (tool) — description`}
|
|
105
|
+
|
|
106
|
+
## Coding Style & Naming Conventions
|
|
107
|
+
{Concrete rules for the new product.
|
|
108
|
+
Include: language, strictness, naming patterns, file size guidelines, import patterns.
|
|
109
|
+
Carry forward conventions that worked in the original. Replace conventions that caused problems.
|
|
110
|
+
Every rule should be phrased as an instruction: "Use X", "Prefer Y over Z", "Never do W".}
|
|
111
|
+
|
|
112
|
+
## {Pattern-specific sections}
|
|
113
|
+
{One section per major architectural pattern for the new product.
|
|
114
|
+
Section name should be the pattern name (e.g., "Central Types", "Text Catalog", "Facade Classes").
|
|
115
|
+
Each section: brief explanation + usage example + rules for when/how to apply.
|
|
116
|
+
Include patterns carried forward from the original AND new patterns designed for the new product.
|
|
117
|
+
Only include code examples when the pattern is non-obvious.}
|
|
118
|
+
|
|
119
|
+
## Agent-Specific Notes
|
|
120
|
+
{Operational rules for AI agents working on this new codebase:
|
|
121
|
+
- Safety constraints (git, node_modules, versions, releases)
|
|
122
|
+
- Multi-agent coordination rules (if the new product will use multiple agents)
|
|
123
|
+
- Investigation methodology
|
|
124
|
+
- Commit and documentation workflow
|
|
125
|
+
- Things that require explicit user approval}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Section writing rules
|
|
129
|
+
|
|
130
|
+
- **Bullet points over paragraphs.** Each rule is one bullet. Use sub-bullets for examples only.
|
|
131
|
+
- **Code examples only when essential.** If a pattern is clear from a sentence, skip the example. If it requires a code block to be unambiguous, include a minimal example (5-15 lines).
|
|
132
|
+
- **Good/bad examples only for counter-intuitive rules.** If the convention matches common practice, don't waste lines showing it.
|
|
133
|
+
- **No redundancy with tooling.** Don't document rules that the linter/formatter already enforces, unless agents need to know them before writing code.
|
|
134
|
+
- **Forward-looking, not backward-looking.** Write "Use prefix notation for function names" not "The original project used prefix notation." The agent doesn't need to know the history — just the rule.
|
|
135
|
+
- **Be specific.** "Keep files under ~500 LOC" not "Keep files small". "`bun run test`" not "run the tests". "`githubRepoCreate`" not "use prefix naming".
|
|
136
|
+
|
|
137
|
+
================================================================
|
|
138
|
+
RESEARCH RULES
|
|
139
|
+
================================================================
|
|
140
|
+
|
|
141
|
+
- **Read the documents, not the codebase.** The four research documents are your primary source. Read the original codebase only to verify specific claims or see patterns in full context.
|
|
142
|
+
- **Distinguish keep from change.** For every convention, consciously decide: is this worth keeping, or did it cause problems? The unresolved problems and key decisions documents are your guide.
|
|
143
|
+
- **Design for a blank slate.** The new product has no legacy code. Conventions should be ideal, not compromised by backward compatibility.
|
|
144
|
+
- **Prioritize actionability.** Ask: "Could an agent follow this rule on the first file they create?" If not, rephrase until they can.
|
|
145
|
+
- **Omit the obvious.** Don't document things universal to the language/framework. Only document project-specific choices.
|
|
146
|
+
- **Note deliberate absences.** If the new product deliberately omits something (no barrel files, no cleanup methods, no inference fallbacks), state it as a rule.
|
|
147
|
+
- **Quantify when possible.** "~500 LOC per file" is better than "keep files small".
|
|
148
|
+
- **Fill the gaps the original left open.** If the original had no convention for something important, and the unresolved problems flagged it, create one.
|
|
149
|
+
|
|
150
|
+
================================================================
|
|
151
|
+
QUALITY GATES
|
|
152
|
+
================================================================
|
|
153
|
+
|
|
154
|
+
Before finalizing, verify:
|
|
155
|
+
1. Every rule is phrased as an instruction for the new product (not a description of the original)
|
|
156
|
+
2. No aspirational or opinion-based statements ("clean code", "well-structured", "best practices")
|
|
157
|
+
3. No duplication between sections
|
|
158
|
+
4. No rules that merely restate linter/formatter enforcement
|
|
159
|
+
5. Code examples are minimal and realistic for the new product (not copied from the original unless the pattern is identical)
|
|
160
|
+
6. An agent reading this file could create the first module of the new product without asking any questions about style, naming, file placement, testing, or commit workflow
|
|
161
|
+
7. Conventions that differ from the original are justified by evidence from the research documents
|
|
162
|
+
8. The file is under 500 lines (aim for 200-400 — dense and scannable)
|
|
163
|
+
|
|
164
|
+
If any check fails, revise before returning.
|
|
165
|
+
|
|
166
|
+
## Output
|
|
167
|
+
|
|
168
|
+
Output only raw markdown. No preamble, no explanation, no commentary outside the document structure.
|