Compare commits
No commits in common. "a506e5b36bf5b65ba5504e8d32afcf065f2bfa08" and "215a8f6566a6f50ce181ec80f34e8023a6f5fd53" have entirely different histories.
a506e5b36b
...
215a8f6566
@ -4,25 +4,15 @@ import { hermesAdapter } from "@uncaged/nerve-adapter-hermes";
|
||||
import type { LlmExtractorConfig } from "@uncaged/nerve-workflow-utils";
|
||||
import { createRole } from "@uncaged/nerve-workflow-utils";
|
||||
|
||||
import {
|
||||
coderMetaSchema,
|
||||
coderPrompt,
|
||||
} from "./roles/coder.js";
|
||||
import {
|
||||
buildWorkspaceCommitterRole,
|
||||
} from "./roles/committer.js";
|
||||
import {
|
||||
plannerMetaSchema,
|
||||
plannerPrompt,
|
||||
} from "./roles/planner.js";
|
||||
import {
|
||||
reviewerMetaSchema,
|
||||
reviewerPrompt,
|
||||
} from "./roles/reviewer.js";
|
||||
import {
|
||||
testerMetaSchema,
|
||||
testerPrompt,
|
||||
} from "./roles/tester.js";
|
||||
import { coderPrompt } from "./roles/coder/prompt.js";
|
||||
import { coderMetaSchema } from "./roles/coder/index.js";
|
||||
import { plannerPrompt } from "./roles/planner/prompt.js";
|
||||
import { plannerMetaSchema } from "./roles/planner/index.js";
|
||||
import { reviewerPrompt } from "./roles/reviewer/prompt.js";
|
||||
import { reviewerMetaSchema } from "./roles/reviewer/index.js";
|
||||
import { testerPrompt } from "./roles/tester/prompt.js";
|
||||
import { testerMetaSchema } from "./roles/tester/index.js";
|
||||
import { buildWorkspaceCommitterRole } from "./roles/committer/index.js";
|
||||
import { moderator } from "./moderator.js";
|
||||
import type { SenseMeta } from "./moderator.js";
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { END } from "@uncaged/nerve-core";
|
||||
import type { Moderator } from "@uncaged/nerve-core";
|
||||
import type { PlannerMeta } from "./roles/planner.js";
|
||||
import type { CoderMeta } from "./roles/coder.js";
|
||||
import type { ReviewerMeta } from "./roles/reviewer.js";
|
||||
import type { TesterMeta } from "./roles/tester.js";
|
||||
import type { CommitterMeta } from "./roles/committer.js";
|
||||
import type { PlannerMeta } from "./roles/planner/index.js";
|
||||
import type { CoderMeta } from "./roles/coder/index.js";
|
||||
import type { ReviewerMeta } from "./roles/reviewer/index.js";
|
||||
import type { TesterMeta } from "./roles/tester/index.js";
|
||||
import type { CommitterMeta } from "./roles/committer/index.js";
|
||||
|
||||
export type SenseMeta = {
|
||||
planner: PlannerMeta;
|
||||
|
||||
6
workflows/develop-sense/roles/coder/index.ts
Normal file
6
workflows/develop-sense/roles/coder/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const coderMetaSchema = z.object({
|
||||
filesCreated: z.boolean().describe("true if the sense files were created"),
|
||||
});
|
||||
export type CoderMeta = z.infer<typeof coderMetaSchema>;
|
||||
@ -1,10 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const coderMetaSchema = z.object({
|
||||
filesCreated: z.boolean().describe("true if the sense files were created"),
|
||||
});
|
||||
export type CoderMeta = z.infer<typeof coderMetaSchema>;
|
||||
|
||||
export function coderPrompt({ threadId }: { threadId: string }): string {
|
||||
return `Read the workflow thread for the planner's sense design and any tester feedback: \`nerve thread ${threadId}\`
|
||||
Read the nerve-dev skill for sense file structure and conventions: \`cat node_modules/@uncaged/nerve-skills/nerve-dev/SKILL.md\`
|
||||
@ -3,4 +3,4 @@ export {
|
||||
committerMetaSchema,
|
||||
type BuildWorkspaceCommitterDeps,
|
||||
type CommitterMeta,
|
||||
} from "../../_shared/workspace-committer.js";
|
||||
} from "../../../_shared/workspace-committer.js";
|
||||
6
workflows/develop-sense/roles/planner/index.ts
Normal file
6
workflows/develop-sense/roles/planner/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const plannerMetaSchema = z.object({
|
||||
senseName: z.string().describe("kebab-case sense name from the plan"),
|
||||
});
|
||||
export type PlannerMeta = z.infer<typeof plannerMetaSchema>;
|
||||
@ -1,10 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const plannerMetaSchema = z.object({
|
||||
senseName: z.string().describe("kebab-case sense name from the plan"),
|
||||
});
|
||||
export type PlannerMeta = z.infer<typeof plannerMetaSchema>;
|
||||
|
||||
export function plannerPrompt({ threadId }: { threadId: string }): string {
|
||||
return `You are planning a new Nerve sense.
|
||||
|
||||
6
workflows/develop-sense/roles/reviewer/index.ts
Normal file
6
workflows/develop-sense/roles/reviewer/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const reviewerMetaSchema = z.object({
|
||||
approved: z.boolean().describe("true if the diff is clean and ready for tester validation"),
|
||||
});
|
||||
export type ReviewerMeta = z.infer<typeof reviewerMetaSchema>;
|
||||
@ -1,10 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const reviewerMetaSchema = z.object({
|
||||
approved: z.boolean().describe("true if the diff is clean and ready for tester validation"),
|
||||
});
|
||||
export type ReviewerMeta = z.infer<typeof reviewerMetaSchema>;
|
||||
|
||||
export function reviewerPrompt({ threadId, nerveRoot }: { threadId: string; nerveRoot: string }): string {
|
||||
return `You are a **code reviewer** for Nerve workflow changes. You run after the coder and before the tester.
|
||||
|
||||
6
workflows/develop-sense/roles/tester/index.ts
Normal file
6
workflows/develop-sense/roles/tester/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const testerMetaSchema = z.object({
|
||||
passed: z.boolean().describe("true if all e2e checks passed"),
|
||||
});
|
||||
export type TesterMeta = z.infer<typeof testerMetaSchema>;
|
||||
@ -1,10 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const testerMetaSchema = z.object({
|
||||
passed: z.boolean().describe("true if all e2e checks passed"),
|
||||
});
|
||||
export type TesterMeta = z.infer<typeof testerMetaSchema>;
|
||||
|
||||
export function testerPrompt({ threadId, nerveRoot }: { threadId: string; nerveRoot: string }): string {
|
||||
return `You are testing a newly created Nerve sense end-to-end.
|
||||
|
||||
@ -4,25 +4,15 @@ import { hermesAdapter } from "@uncaged/nerve-adapter-hermes";
|
||||
import type { LlmExtractorConfig } from "@uncaged/nerve-workflow-utils";
|
||||
import { createRole } from "@uncaged/nerve-workflow-utils";
|
||||
|
||||
import {
|
||||
coderMetaSchema,
|
||||
coderPrompt,
|
||||
} from "./roles/coder.js";
|
||||
import {
|
||||
buildWorkspaceCommitterRole,
|
||||
} from "./roles/committer.js";
|
||||
import {
|
||||
plannerMetaSchema,
|
||||
plannerPrompt,
|
||||
} from "./roles/planner.js";
|
||||
import {
|
||||
reviewerMetaSchema,
|
||||
reviewerPrompt,
|
||||
} from "./roles/reviewer.js";
|
||||
import {
|
||||
testerMetaSchema,
|
||||
testerPrompt,
|
||||
} from "./roles/tester.js";
|
||||
import { coderPrompt } from "./roles/coder/prompt.js";
|
||||
import { coderMetaSchema } from "./roles/coder/index.js";
|
||||
import { plannerPrompt } from "./roles/planner/prompt.js";
|
||||
import { plannerMetaSchema } from "./roles/planner/index.js";
|
||||
import { reviewerPrompt } from "./roles/reviewer/prompt.js";
|
||||
import { reviewerMetaSchema } from "./roles/reviewer/index.js";
|
||||
import { testerPrompt } from "./roles/tester/prompt.js";
|
||||
import { testerMetaSchema } from "./roles/tester/index.js";
|
||||
import { buildWorkspaceCommitterRole } from "./roles/committer/index.js";
|
||||
import { moderator } from "./moderator.js";
|
||||
import type { WorkflowMeta } from "./moderator.js";
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { END } from "@uncaged/nerve-core";
|
||||
import type { Moderator } from "@uncaged/nerve-core";
|
||||
import type { PlannerMeta } from "./roles/planner.js";
|
||||
import type { CoderMeta } from "./roles/coder.js";
|
||||
import type { ReviewerMeta } from "./roles/reviewer.js";
|
||||
import type { TesterMeta } from "./roles/tester.js";
|
||||
import type { CommitterMeta } from "./roles/committer.js";
|
||||
import type { PlannerMeta } from "./roles/planner/index.js";
|
||||
import type { CoderMeta } from "./roles/coder/index.js";
|
||||
import type { ReviewerMeta } from "./roles/reviewer/index.js";
|
||||
import type { TesterMeta } from "./roles/tester/index.js";
|
||||
import type { CommitterMeta } from "./roles/committer/index.js";
|
||||
|
||||
export type WorkflowMeta = {
|
||||
planner: PlannerMeta;
|
||||
|
||||
6
workflows/develop-workflow/roles/coder/index.ts
Normal file
6
workflows/develop-workflow/roles/coder/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const coderMetaSchema = z.object({
|
||||
done: z.boolean().describe("true if the workflow files were created and build passes"),
|
||||
});
|
||||
export type CoderMeta = z.infer<typeof coderMetaSchema>;
|
||||
@ -1,10 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const coderMetaSchema = z.object({
|
||||
done: z.boolean().describe("true if the workflow files were created and build passes"),
|
||||
});
|
||||
export type CoderMeta = z.infer<typeof coderMetaSchema>;
|
||||
|
||||
export function coderPrompt({ threadId }: { threadId: string }): string {
|
||||
return `Read the workflow thread to get the planner's design and any reviewer/tester/committer feedback: \`nerve thread ${threadId}\`
|
||||
Read the nerve-dev skill for workflow file structure and conventions: \`cat node_modules/@uncaged/nerve-skills/nerve-dev/SKILL.md\`
|
||||
@ -32,7 +25,8 @@ Each workflow must have:
|
||||
- \`workflows/<name>/index.ts\` — WorkflowDefinition default export
|
||||
- \`workflows/<name>/build.ts\` — factory function
|
||||
- \`workflows/<name>/moderator.ts\` — moderator + meta types
|
||||
- \`workflows/<name>/roles/<role>.ts\` — meta schema and prompt function per role
|
||||
- \`workflows/<name>/roles/<role>/index.ts\` — role build function
|
||||
- \`workflows/<name>/roles/<role>/prompt.ts\` — prompt pure function
|
||||
- \`workflows/<name>/package.json\` — with esbuild build script
|
||||
- \`workflows/<name>/tsconfig.json\` — TypeScript config
|
||||
|
||||
@ -3,4 +3,4 @@ export {
|
||||
committerMetaSchema,
|
||||
type BuildWorkspaceCommitterDeps,
|
||||
type CommitterMeta,
|
||||
} from "../../_shared/workspace-committer.js";
|
||||
} from "../../../_shared/workspace-committer.js";
|
||||
6
workflows/develop-workflow/roles/planner/index.ts
Normal file
6
workflows/develop-workflow/roles/planner/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const plannerMetaSchema = z.object({
|
||||
ready: z.boolean().describe("true if requirements are clear and a workflow can be implemented"),
|
||||
});
|
||||
export type PlannerMeta = z.infer<typeof plannerMetaSchema>;
|
||||
@ -1,10 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const plannerMetaSchema = z.object({
|
||||
ready: z.boolean().describe("true if requirements are clear and a workflow can be implemented"),
|
||||
});
|
||||
export type PlannerMeta = z.infer<typeof plannerMetaSchema>;
|
||||
|
||||
export function plannerPrompt({ threadId }: { threadId: string }): string {
|
||||
return `You are a Nerve workflow planner. You can **create new workflows** or **modify existing ones**.
|
||||
|
||||
6
workflows/develop-workflow/roles/reviewer/index.ts
Normal file
6
workflows/develop-workflow/roles/reviewer/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const reviewerMetaSchema = z.object({
|
||||
approved: z.boolean().describe("true if the diff is clean and ready for tester validation"),
|
||||
});
|
||||
export type ReviewerMeta = z.infer<typeof reviewerMetaSchema>;
|
||||
@ -1,10 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const reviewerMetaSchema = z.object({
|
||||
approved: z.boolean().describe("true if the diff is clean and ready for tester validation"),
|
||||
});
|
||||
export type ReviewerMeta = z.infer<typeof reviewerMetaSchema>;
|
||||
|
||||
export function reviewerPrompt({ threadId, nerveRoot }: { threadId: string; nerveRoot: string }): string {
|
||||
return `You are a **code reviewer** for Nerve workflow changes. You run after the coder and before the tester.
|
||||
|
||||
6
workflows/develop-workflow/roles/tester/index.ts
Normal file
6
workflows/develop-workflow/roles/tester/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const testerMetaSchema = z.object({
|
||||
passed: z.boolean().describe("true if all validation checks passed"),
|
||||
});
|
||||
export type TesterMeta = z.infer<typeof testerMetaSchema>;
|
||||
@ -1,10 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const testerMetaSchema = z.object({
|
||||
passed: z.boolean().describe("true if all validation checks passed"),
|
||||
});
|
||||
export type TesterMeta = z.infer<typeof testerMetaSchema>;
|
||||
|
||||
export function testerPrompt({ threadId, nerveRoot }: { threadId: string; nerveRoot: string }): string {
|
||||
return `You are testing a Nerve workflow — either newly created or recently modified.
|
||||
|
||||
@ -21,7 +14,7 @@ Verify the full lifecycle in this order:
|
||||
- \`workflows/<name>/index.ts\`
|
||||
- \`workflows/<name>/build.ts\`
|
||||
- \`workflows/<name>/moderator.ts\`
|
||||
- \`workflows/<name>/roles/\` with one \`.ts\` file per role
|
||||
- \`workflows/<name>/roles/\` with subdirectories
|
||||
- \`workflows/<name>/package.json\`
|
||||
|
||||
2. **Build** — run inside the workflow directory:
|
||||
Loading…
x
Reference in New Issue
Block a user