@sireai/optimus 0.1.40 → 0.1.42
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/cli/optimus.js +405 -56
- package/dist/cli/optimus.js.map +1 -1
- package/dist/config/load-config.js +8 -1
- package/dist/config/load-config.js.map +1 -1
- package/dist/integrations/jira/jira-access-manager.d.ts +1 -0
- package/dist/integrations/jira/jira-access-manager.js +24 -0
- package/dist/integrations/jira/jira-access-manager.js.map +1 -1
- package/dist/integrations/jira/jira-cli.js +19 -3
- package/dist/integrations/jira/jira-cli.js.map +1 -1
- package/dist/integrations/jira/jira-submit.js +5 -18
- package/dist/integrations/jira/jira-submit.js.map +1 -1
- package/dist/integrations/sentry/sentry-cli.js +18 -2
- package/dist/integrations/sentry/sentry-cli.js.map +1 -1
- package/dist/problem-solving-core/codex/codex-runner.d.ts +2 -0
- package/dist/problem-solving-core/codex/codex-runner.js +46 -36
- package/dist/problem-solving-core/codex/codex-runner.js.map +1 -1
- package/dist/task-environment/delivery/feishu-analysis-doc-service.d.ts +2 -1
- package/dist/task-environment/delivery/feishu-analysis-doc-service.js +19 -1
- package/dist/task-environment/delivery/feishu-analysis-doc-service.js.map +1 -1
- package/dist/task-environment/delivery/feishu-card-renderer.js +4 -2
- package/dist/task-environment/delivery/feishu-card-renderer.js.map +1 -1
- package/dist/task-environment/delivery/feishu-notifier.d.ts +5 -0
- package/dist/task-environment/delivery/feishu-notifier.js +103 -38
- package/dist/task-environment/delivery/feishu-notifier.js.map +1 -1
- package/dist/task-environment/delivery/feishu-templates/analysis-message-template.js +3 -0
- package/dist/task-environment/delivery/feishu-templates/analysis-message-template.js.map +1 -1
- package/dist/task-environment/delivery/task-delivery-service.js +6 -2
- package/dist/task-environment/delivery/task-delivery-service.js.map +1 -1
- package/dist/task-environment/delivery/task-publication-service.d.ts +1 -0
- package/dist/task-environment/delivery/task-publication-service.js +22 -0
- package/dist/task-environment/delivery/task-publication-service.js.map +1 -1
- package/dist/task-environment/intake/manual-problem-intake.js +54 -0
- package/dist/task-environment/intake/manual-problem-intake.js.map +1 -1
- package/dist/task-environment/orchestration/execution-context-assembler.d.ts +1 -0
- package/dist/task-environment/orchestration/execution-context-assembler.js +58 -3
- package/dist/task-environment/orchestration/execution-context-assembler.js.map +1 -1
- package/dist/task-environment/orchestration/task-orchestrator.d.ts +1 -0
- package/dist/task-environment/orchestration/task-orchestrator.js +41 -5
- package/dist/task-environment/orchestration/task-orchestrator.js.map +1 -1
- package/dist/task-environment/orchestration/task-package-inputs.d.ts +2 -0
- package/dist/task-environment/orchestration/task-package-inputs.js +83 -0
- package/dist/task-environment/orchestration/task-package-inputs.js.map +1 -0
- package/dist/task-environment/orchestration/task-runtime-policy.d.ts +4 -0
- package/dist/task-environment/orchestration/task-runtime-policy.js +38 -0
- package/dist/task-environment/orchestration/task-runtime-policy.js.map +1 -0
- package/dist/task-environment/result-paths.d.ts +9 -0
- package/dist/task-environment/result-paths.js +36 -0
- package/dist/task-environment/result-paths.js.map +1 -0
- package/dist/types.d.ts +43 -1
- package/package.json +1 -1
- package/task-harnesses/pm/ACCEPT.md +96 -0
- package/task-harnesses/pm/ANNOTATION_PATTERN.md +58 -0
- package/task-harnesses/pm/CONSTRAINTS.md +56 -0
- package/task-harnesses/pm/CONTEXT.md +55 -0
- package/task-harnesses/pm/EVOLUTION.md +43 -0
- package/task-harnesses/pm/ROLE.md +46 -0
- package/task-harnesses/pm/STANDARD.md +186 -0
- package/task-harnesses/pm/manifest.json +13 -0
- package/task-harnesses/registry.json +4 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const TASK_RUNTIME_POLICIES = {
|
|
2
|
+
bugfix: {
|
|
3
|
+
taskType: "bugfix",
|
|
4
|
+
executionBinding: "repo_bound",
|
|
5
|
+
artifactContract: "patch_result",
|
|
6
|
+
requiresRepository: true,
|
|
7
|
+
requiresRepoMemory: true,
|
|
8
|
+
supportsPublication: true,
|
|
9
|
+
supportsPatchArtifact: true,
|
|
10
|
+
primaryResultFile: "result.md",
|
|
11
|
+
expectedPrimaryArtifacts: ["result.md", "patch.diff"]
|
|
12
|
+
},
|
|
13
|
+
pm: {
|
|
14
|
+
taskType: "pm",
|
|
15
|
+
executionBinding: "artifact_only",
|
|
16
|
+
artifactContract: "prototype_result",
|
|
17
|
+
requiresRepository: false,
|
|
18
|
+
requiresRepoMemory: false,
|
|
19
|
+
supportsPublication: false,
|
|
20
|
+
supportsPatchArtifact: false,
|
|
21
|
+
primaryResultFile: "result.md",
|
|
22
|
+
expectedPrimaryArtifacts: ["result.md"]
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export function getTaskRuntimePolicy(taskType) {
|
|
26
|
+
const policy = TASK_RUNTIME_POLICIES[taskType];
|
|
27
|
+
if (!policy) {
|
|
28
|
+
throw new Error(`No runtime policy registered for taskType ${taskType}.`);
|
|
29
|
+
}
|
|
30
|
+
return policy;
|
|
31
|
+
}
|
|
32
|
+
export function taskRequiresRepository(taskType) {
|
|
33
|
+
return getTaskRuntimePolicy(taskType).requiresRepository;
|
|
34
|
+
}
|
|
35
|
+
export function taskSupportsPublication(taskType) {
|
|
36
|
+
return getTaskRuntimePolicy(taskType).supportsPublication;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=task-runtime-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-runtime-policy.js","sourceRoot":"","sources":["../../../src/task-environment/orchestration/task-runtime-policy.ts"],"names":[],"mappings":"AAEA,MAAM,qBAAqB,GAAsC;IAC/D,MAAM,EAAE;QACN,QAAQ,EAAE,QAAQ;QAClB,gBAAgB,EAAE,YAAY;QAC9B,gBAAgB,EAAE,cAAc;QAChC,kBAAkB,EAAE,IAAI;QACxB,kBAAkB,EAAE,IAAI;QACxB,mBAAmB,EAAE,IAAI;QACzB,qBAAqB,EAAE,IAAI;QAC3B,iBAAiB,EAAE,WAAW;QAC9B,wBAAwB,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;KACtD;IACD,EAAE,EAAE;QACF,QAAQ,EAAE,IAAI;QACd,gBAAgB,EAAE,eAAe;QACjC,gBAAgB,EAAE,kBAAkB;QACpC,kBAAkB,EAAE,KAAK;QACzB,kBAAkB,EAAE,KAAK;QACzB,mBAAmB,EAAE,KAAK;QAC1B,qBAAqB,EAAE,KAAK;QAC5B,iBAAiB,EAAE,WAAW;QAC9B,wBAAwB,EAAE,CAAC,WAAW,CAAC;KACxC;CACF,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,MAAM,MAAM,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,6CAA6C,QAAQ,GAAG,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,kBAAkB,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,mBAAmB,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { resolve, relative, sep } from "node:path";
|
|
2
|
+
function normalizePathLike(value) {
|
|
3
|
+
return value.replaceAll("\\", "/").replace(/^\.\/+/u, "").replace(/\/+/gu, "/").replace(/\/$/u, "");
|
|
4
|
+
}
|
|
5
|
+
function isWithinBaseDir(baseDir, targetPath) {
|
|
6
|
+
const relativePath = relative(resolve(baseDir), resolve(targetPath));
|
|
7
|
+
return relativePath === ""
|
|
8
|
+
|| (!relativePath.startsWith(`..${sep}`) && relativePath !== "..");
|
|
9
|
+
}
|
|
10
|
+
function startsWithPathPrefix(candidatePath, prefixPath) {
|
|
11
|
+
const normalizedCandidate = normalizePathLike(candidatePath);
|
|
12
|
+
const normalizedPrefix = normalizePathLike(prefixPath);
|
|
13
|
+
return normalizedCandidate === normalizedPrefix
|
|
14
|
+
|| normalizedCandidate.startsWith(`${normalizedPrefix}/`);
|
|
15
|
+
}
|
|
16
|
+
export function resolveTaskResultPath(resultPath, context) {
|
|
17
|
+
const trimmedResultPath = resultPath.trim();
|
|
18
|
+
if (trimmedResultPath.startsWith("/")) {
|
|
19
|
+
return resolve(trimmedResultPath);
|
|
20
|
+
}
|
|
21
|
+
const artifactDir = resolve(context.addresses.artifactDir);
|
|
22
|
+
const taskRootDir = resolve(context.taskRootDir);
|
|
23
|
+
const workspaceDir = resolve(context.addresses.workspaceDir);
|
|
24
|
+
const candidates = [];
|
|
25
|
+
for (const baseDir of [taskRootDir, workspaceDir]) {
|
|
26
|
+
const artifactPathFromBase = relative(baseDir, artifactDir);
|
|
27
|
+
if (artifactPathFromBase.length > 0
|
|
28
|
+
&& isWithinBaseDir(baseDir, artifactDir)
|
|
29
|
+
&& startsWithPathPrefix(trimmedResultPath, artifactPathFromBase)) {
|
|
30
|
+
candidates.push(resolve(baseDir, trimmedResultPath));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
candidates.push(resolve(artifactDir, trimmedResultPath));
|
|
34
|
+
return candidates[0] ?? resolve(artifactDir, trimmedResultPath);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=result-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-paths.js","sourceRoot":"","sources":["../../src/task-environment/result-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAUnD,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACtG,CAAC;AAED,SAAS,eAAe,CAAC,OAAe,EAAE,UAAkB;IAC1D,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACrE,OAAO,YAAY,KAAK,EAAE;WACrB,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,YAAY,KAAK,IAAI,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,oBAAoB,CAAC,aAAqB,EAAE,UAAkB;IACrE,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAC7D,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACvD,OAAO,mBAAmB,KAAK,gBAAgB;WAC1C,mBAAmB,CAAC,UAAU,CAAC,GAAG,gBAAgB,GAAG,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,UAAkB,EAClB,OAAoC;IAEpC,MAAM,iBAAiB,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IAC5C,IAAI,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,KAAK,MAAM,OAAO,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,CAAC;QAClD,MAAM,oBAAoB,GAAG,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC5D,IACE,oBAAoB,CAAC,MAAM,GAAG,CAAC;eAC5B,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC;eACrC,oBAAoB,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,EAChE,CAAC;YACD,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEzD,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -106,6 +106,28 @@ export interface RuntimeEventContent {
|
|
|
106
106
|
branch?: string;
|
|
107
107
|
metadata?: Record<string, unknown>;
|
|
108
108
|
}
|
|
109
|
+
export interface TaskInputReferenceMaterial {
|
|
110
|
+
type: "doc" | "image" | "link" | "note" | "whiteboard" | "sheet" | "bitable" | "file";
|
|
111
|
+
title: string;
|
|
112
|
+
content?: string;
|
|
113
|
+
url?: string;
|
|
114
|
+
token?: string;
|
|
115
|
+
mimeType?: string;
|
|
116
|
+
sourceType?: string;
|
|
117
|
+
}
|
|
118
|
+
export type PmTaskInputReferenceMaterial = TaskInputReferenceMaterial;
|
|
119
|
+
export interface PmTaskInput {
|
|
120
|
+
requirementDocument: string;
|
|
121
|
+
productGoal?: string;
|
|
122
|
+
targetUser?: string;
|
|
123
|
+
coreFlow?: string;
|
|
124
|
+
prototypeScope?: string;
|
|
125
|
+
platform?: "web" | "mobile_web" | "ios" | "android" | "desktop" | "responsive";
|
|
126
|
+
constraints?: string[];
|
|
127
|
+
referenceMaterials?: TaskInputReferenceMaterial[];
|
|
128
|
+
styleDirection?: string;
|
|
129
|
+
changeNotes?: string;
|
|
130
|
+
}
|
|
109
131
|
export interface FeishuAssigneeIdentity {
|
|
110
132
|
displayName?: string;
|
|
111
133
|
login?: string;
|
|
@@ -123,6 +145,19 @@ export interface PollingCheckpoint {
|
|
|
123
145
|
skippedCount?: number;
|
|
124
146
|
}
|
|
125
147
|
export type RepositoryExecutionMode = "copy" | "inplace";
|
|
148
|
+
export type TaskExecutionBinding = "repo_bound" | "artifact_only";
|
|
149
|
+
export type TaskArtifactContract = "patch_result" | "prototype_result" | "analysis_result";
|
|
150
|
+
export interface TaskRuntimePolicy {
|
|
151
|
+
taskType: string;
|
|
152
|
+
executionBinding: TaskExecutionBinding;
|
|
153
|
+
artifactContract: TaskArtifactContract;
|
|
154
|
+
requiresRepository: boolean;
|
|
155
|
+
requiresRepoMemory: boolean;
|
|
156
|
+
supportsPublication: boolean;
|
|
157
|
+
supportsPatchArtifact: boolean;
|
|
158
|
+
primaryResultFile: string;
|
|
159
|
+
expectedPrimaryArtifacts: string[];
|
|
160
|
+
}
|
|
126
161
|
export interface RepositoryRoot {
|
|
127
162
|
path: string;
|
|
128
163
|
alias?: string;
|
|
@@ -205,7 +240,7 @@ export interface TriageDecisionRejected {
|
|
|
205
240
|
missingInfo?: string[];
|
|
206
241
|
}
|
|
207
242
|
export type TriageDecision = TriageDecisionAccepted | TriageDecisionRejected;
|
|
208
|
-
export type TaskArtifactKind = "result_md" | "patch_diff" | "publication_plan" | "verification" | "review_packet" | "log" | "attachment";
|
|
243
|
+
export type TaskArtifactKind = "result_md" | "patch_diff" | "prototype_html" | "publication_plan" | "verification" | "review_packet" | "log" | "attachment";
|
|
209
244
|
export interface TaskArtifact {
|
|
210
245
|
kind?: TaskArtifactKind;
|
|
211
246
|
path: string;
|
|
@@ -305,6 +340,7 @@ export interface TaskDeliveryBundle {
|
|
|
305
340
|
artifacts: {
|
|
306
341
|
resultMd?: string;
|
|
307
342
|
patchDiff?: string;
|
|
343
|
+
prototypeHtml?: string;
|
|
308
344
|
extras: string[];
|
|
309
345
|
};
|
|
310
346
|
publication?: TaskPublicationStatus;
|
|
@@ -549,6 +585,7 @@ export interface RepositoryGuidanceContext {
|
|
|
549
585
|
}
|
|
550
586
|
export interface TaskExecutionContext {
|
|
551
587
|
taskRootDir: string;
|
|
588
|
+
runtimePolicy: TaskRuntimePolicy;
|
|
552
589
|
addresses: import("./task-environment/execution-addresses.js").ExecutionAddresses;
|
|
553
590
|
sandboxMode: CodexSandboxMode;
|
|
554
591
|
approvalPolicy: CodexApprovalPolicy;
|
|
@@ -669,6 +706,11 @@ export interface OptimusConfig {
|
|
|
669
706
|
webhook?: string;
|
|
670
707
|
webhooks?: string[];
|
|
671
708
|
secret?: string;
|
|
709
|
+
defaultRecipient?: {
|
|
710
|
+
displayName?: string;
|
|
711
|
+
email?: string;
|
|
712
|
+
openId?: string;
|
|
713
|
+
};
|
|
672
714
|
userMappings?: Record<string, {
|
|
673
715
|
openId: string;
|
|
674
716
|
displayName?: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# ACCEPT
|
|
2
|
+
|
|
3
|
+
## Decision target
|
|
4
|
+
Route requirement-to-prototype tasks into the `pm` harness.
|
|
5
|
+
|
|
6
|
+
Triage must decide:
|
|
7
|
+
1. task type fit
|
|
8
|
+
2. execution admission
|
|
9
|
+
|
|
10
|
+
The runner, not triage, decides whether final closure is `Prototype Complete`, `Prototype Partial`, or `Analysis Only`.
|
|
11
|
+
|
|
12
|
+
## Requirement basis
|
|
13
|
+
Treat the task as execution-ready when the request provides a usable requirement basis plus enough structure to prototype one bounded flow.
|
|
14
|
+
|
|
15
|
+
Typical PM requirement basis includes:
|
|
16
|
+
- `requirement_document`: the primary requirement text, document, attachment, or referenced material that defines the requested prototype
|
|
17
|
+
- `product_goal`: the product or business objective
|
|
18
|
+
- `target_user`: the primary user or audience
|
|
19
|
+
- `core_flow`: the main interaction path to prototype
|
|
20
|
+
- `prototype_scope`: the bounded slice to cover in one task
|
|
21
|
+
- `constraints`: platform, channel, or prototype limits when they materially affect output
|
|
22
|
+
|
|
23
|
+
Admission rule:
|
|
24
|
+
- `requirement_document` must be present
|
|
25
|
+
- at least one concrete `core_flow` must be explicit or clearly derivable from the requirement basis
|
|
26
|
+
- `prototype_scope` must already be bounded in the request or easy to bound without inventing product strategy
|
|
27
|
+
- `product_goal` and `target_user` should be present when they affect flow framing, prioritization, or screen meaning
|
|
28
|
+
- `constraints` are required only when platform or delivery limits materially change the prototype
|
|
29
|
+
|
|
30
|
+
## Task type fit
|
|
31
|
+
Classify as `pm` only when all are true:
|
|
32
|
+
- the request is to turn requirement input into an interactive HTML prototype
|
|
33
|
+
- the expected output is a prototype artifact, not production code
|
|
34
|
+
- the task centers on flow, structure, interaction, or state presentation
|
|
35
|
+
- the prototype can be derived from requirement input without real system implementation
|
|
36
|
+
|
|
37
|
+
Do not classify as `pm` when any are true:
|
|
38
|
+
- the request is only strategy discussion, prioritization, or product advice
|
|
39
|
+
- the request is for production frontend/backend implementation
|
|
40
|
+
- the request is only visual design refinement with no requirement-to-prototype goal
|
|
41
|
+
- the request is only PRD writing or requirement analysis with no interactive output expectation
|
|
42
|
+
- the request is a bugfix, code-change, or repository task
|
|
43
|
+
|
|
44
|
+
## Execution admission
|
|
45
|
+
Accept into execution only when all are true:
|
|
46
|
+
- the input provides a usable requirement basis
|
|
47
|
+
- the input provides at least one concrete goal
|
|
48
|
+
- the input provides at least one concrete flow, page path, or interaction path
|
|
49
|
+
- the prototype scope is bounded enough for one task
|
|
50
|
+
- the task does not depend on repository coupling or production-system integration
|
|
51
|
+
|
|
52
|
+
## Still acceptable with partial information
|
|
53
|
+
Still acceptable when:
|
|
54
|
+
- some states, rules, copy, or edge cases are missing
|
|
55
|
+
- but the main objective and at least one core flow are clear
|
|
56
|
+
- and missing detail can be surfaced as assumptions rather than hidden invention
|
|
57
|
+
|
|
58
|
+
## Reject for insufficient execution context
|
|
59
|
+
Reject even if the task fits `pm` when any are true:
|
|
60
|
+
- there is no concrete requirement, scenario, or flow to prototype
|
|
61
|
+
- the input only says "make a prototype" or "design a page" with no clear objective or path
|
|
62
|
+
- multiple unrelated areas are mixed with no bounded scope
|
|
63
|
+
- the input is too abstract to determine what users can do in the prototype
|
|
64
|
+
- the task depends on hidden context not present in the current input
|
|
65
|
+
- the request expects product decisions to be invented from scratch
|
|
66
|
+
- the request expects real implementation instead of prototype behavior
|
|
67
|
+
|
|
68
|
+
## Missing information to mention first when rejecting
|
|
69
|
+
- `requirement_document`
|
|
70
|
+
- `product_goal`
|
|
71
|
+
- `target_user`
|
|
72
|
+
- `core_flow`
|
|
73
|
+
- `prototype_scope`
|
|
74
|
+
- `constraints`
|
|
75
|
+
|
|
76
|
+
## Missing information mapping guidance
|
|
77
|
+
- use `requirement_document` when there is no usable requirement basis in description, attachment, or referenced input
|
|
78
|
+
- use `product_goal` when the business or user objective is unclear
|
|
79
|
+
- use `target_user` when the intended user is unknown
|
|
80
|
+
- use `core_flow` when no concrete flow or interaction path is described
|
|
81
|
+
- use `prototype_scope` when the request is too broad for one prototype task
|
|
82
|
+
- use `constraints` when platform, channel, or product limits are required but missing
|
|
83
|
+
- prefer the smallest set of fields that explains the rejection
|
|
84
|
+
|
|
85
|
+
## Event scope
|
|
86
|
+
- `problem.discovered`
|
|
87
|
+
- `task.submitted_manually`
|
|
88
|
+
|
|
89
|
+
## Triage guidance
|
|
90
|
+
- separate prototype-task fit from execution readiness
|
|
91
|
+
- accept requirement-driven prototype work, not open-ended consulting
|
|
92
|
+
- judge the quality of the requirement basis, not only the presence of keywords
|
|
93
|
+
- prefer one clear prototype objective over broad redesign asks
|
|
94
|
+
- incomplete detail is acceptable if the core flow is still prototype-able
|
|
95
|
+
- reject when trustworthy prototyping would require heavy invention, even if the task clearly belongs to PM
|
|
96
|
+
- triage only decides whether the task enters the `pm` pipeline
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# PM Review Annotation Pattern
|
|
2
|
+
|
|
3
|
+
Reusable implementation convention for review-mode annotations in PM prototypes.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
- keep the prototype itself reviewable
|
|
7
|
+
- attach rule meaning to the exact UI it explains
|
|
8
|
+
- avoid replacing interaction with detached explanation blocks
|
|
9
|
+
|
|
10
|
+
## Structure
|
|
11
|
+
1. `Review mode`
|
|
12
|
+
- provide a dedicated toggle
|
|
13
|
+
- keep annotation chrome hidden or minimized outside review mode
|
|
14
|
+
|
|
15
|
+
2. `Target anchors`
|
|
16
|
+
- assign stable target ids
|
|
17
|
+
- recommended attribute: `data-pm-target="<id>"`
|
|
18
|
+
|
|
19
|
+
3. `Annotation records`
|
|
20
|
+
- bind each annotation to one primary target
|
|
21
|
+
- recommended attribute: `data-pm-annotation="<id>"`
|
|
22
|
+
- recommended fields:
|
|
23
|
+
- `targetId`
|
|
24
|
+
- `type`: `confirmed` | `simulated` | `open-question`
|
|
25
|
+
- `title`
|
|
26
|
+
- `body`
|
|
27
|
+
- optional `secondaryTargets`
|
|
28
|
+
|
|
29
|
+
4. `Focused guidance`
|
|
30
|
+
- selecting an annotation should highlight the bound target
|
|
31
|
+
- optional connector lines may be used when they improve readability
|
|
32
|
+
- prefer one focused annotation at a time
|
|
33
|
+
|
|
34
|
+
## Recommended behavior
|
|
35
|
+
- click annotation item -> scroll target into view -> highlight target -> optionally show connector
|
|
36
|
+
- click target badge -> open linked annotation detail
|
|
37
|
+
- switching annotation should clear the previous focus state
|
|
38
|
+
|
|
39
|
+
## Visual semantics
|
|
40
|
+
- `Confirmed`: neutral or positive emphasis
|
|
41
|
+
- `Simulated`: caution emphasis
|
|
42
|
+
- `Open Question`: unresolved emphasis
|
|
43
|
+
- use color as reinforcement, not as the only signal
|
|
44
|
+
|
|
45
|
+
## Good annotation content
|
|
46
|
+
- server-side rules that materially affect UX
|
|
47
|
+
- thresholds, limits, gating, ordering, and role boundaries
|
|
48
|
+
- prototype approximations that could otherwise be mistaken as final behavior
|
|
49
|
+
- unresolved details reviewers must notice
|
|
50
|
+
|
|
51
|
+
## Bad annotation content
|
|
52
|
+
- long PRD excerpts with no interpretation
|
|
53
|
+
- generic summary already obvious from the screen
|
|
54
|
+
- visual design commentary that does not affect product understanding
|
|
55
|
+
- missing core flows that should have been prototyped directly
|
|
56
|
+
|
|
57
|
+
## Rule of thumb
|
|
58
|
+
If UI alone would cause requirement misunderstanding, add an anchored annotation. If direct interaction explains the requirement better, build the interaction instead.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# CONSTRAINTS
|
|
2
|
+
|
|
3
|
+
Defines hard rules, red lines, and non-negotiable execution discipline.
|
|
4
|
+
|
|
5
|
+
## Source truth
|
|
6
|
+
- the source requirement document is the primary truth source
|
|
7
|
+
- helper summaries or prior artifacts may assist, but must not replace the source document
|
|
8
|
+
- if helper context conflicts with the source document, follow the source document
|
|
9
|
+
- keep confirmed requirements, assumptions, and recommendations separate
|
|
10
|
+
- if input is missing or conflicting, surface the gap explicitly
|
|
11
|
+
|
|
12
|
+
## Execution discipline
|
|
13
|
+
- must build a requirement map before designing screens or writing HTML
|
|
14
|
+
- must identify requirement-critical rules before implementation
|
|
15
|
+
- must assign exactly one representation mode to each requirement-critical rule before building:
|
|
16
|
+
- `Represented Interactively`
|
|
17
|
+
- `Represented via Annotation`
|
|
18
|
+
- `Downgraded / Simulated`
|
|
19
|
+
- `Not Represented`
|
|
20
|
+
- must not jump from reading directly to prototype building
|
|
21
|
+
- must not treat representation planning as optional when thresholds, gating, ordering, counts, role boundaries, or server-side rules affect review understanding
|
|
22
|
+
|
|
23
|
+
## Assumption discipline
|
|
24
|
+
- do not present inferred detail as confirmed requirement
|
|
25
|
+
- use only the smallest assumption needed to preserve reviewability
|
|
26
|
+
- do not invent product strategy, business rules, or expansion scope
|
|
27
|
+
- if trustworthy prototyping would require large invention, stop at analysis
|
|
28
|
+
|
|
29
|
+
## Prototype discipline
|
|
30
|
+
- prototype for review, not for production deployment
|
|
31
|
+
- prioritize requirement meaning and flow clarity over polish
|
|
32
|
+
- keep interaction logic lightweight and inspectable
|
|
33
|
+
- show important states and transitions when they affect product understanding
|
|
34
|
+
- static page output alone is insufficient unless closure is `Analysis Only`
|
|
35
|
+
- if interaction cannot faithfully express requirement meaning, add on-prototype review annotations
|
|
36
|
+
- annotations supplement the prototype; they do not replace core interaction coverage
|
|
37
|
+
- the prototype must remain readable when annotations are hidden or minimized
|
|
38
|
+
|
|
39
|
+
## Annotation discipline
|
|
40
|
+
- bind annotations to the relevant UI target, state, or transition whenever possible
|
|
41
|
+
- use highlight, anchor, or connector guidance only when it improves readability
|
|
42
|
+
- distinguish `Confirmed`, `Simulated`, and `Open Question` clearly
|
|
43
|
+
- label reviewer controls as review affordances, not product UI
|
|
44
|
+
- do not dump raw PRD text into annotations
|
|
45
|
+
|
|
46
|
+
## Forbidden
|
|
47
|
+
- fake backend integration
|
|
48
|
+
- invented product direction with no requirement basis
|
|
49
|
+
- claiming certainty that does not exist
|
|
50
|
+
- decoration-first output that obscures product meaning
|
|
51
|
+
- conclusion-only delivery without prototype or explicit blocker analysis
|
|
52
|
+
- claiming outputs that were not actually created under `artifactDir`
|
|
53
|
+
- using annotations to hide missing core screens, key states, or major transitions
|
|
54
|
+
- presenting simulated behavior as faithfully implemented
|
|
55
|
+
- claiming a key rule was interactively represented when it was only annotated, simulated, merged, or omitted
|
|
56
|
+
- marking `Prototype Complete` when key rules remain materially weak, merged, or downgraded
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# CONTEXT
|
|
2
|
+
|
|
3
|
+
Defines the task model and the minimum product understanding the agent should construct before prototyping.
|
|
4
|
+
|
|
5
|
+
## Working model
|
|
6
|
+
- this is a document-first, artifact-only task
|
|
7
|
+
- the agent should build a minimal product model before building UI
|
|
8
|
+
- assumptions preserve reviewability; they do not replace missing requirements
|
|
9
|
+
|
|
10
|
+
## Product model
|
|
11
|
+
|
|
12
|
+
### Requirement model
|
|
13
|
+
- explicit goals, constraints, non-goals, and missing information
|
|
14
|
+
- review-critical rules such as thresholds, counts, frequency limits, ordering, role boundaries, and content-type distinctions
|
|
15
|
+
|
|
16
|
+
### User model
|
|
17
|
+
- primary user or audience
|
|
18
|
+
- user objective
|
|
19
|
+
- success condition for the prototype path
|
|
20
|
+
|
|
21
|
+
### Flow model
|
|
22
|
+
- entry point
|
|
23
|
+
- main actions
|
|
24
|
+
- transitions
|
|
25
|
+
- completion or exit state
|
|
26
|
+
|
|
27
|
+
### State model
|
|
28
|
+
- empty, loading, success, failure, gated, branching, or review states
|
|
29
|
+
- places where state changes materially change product understanding
|
|
30
|
+
- server/config/operations rules whose effects must still be reviewable in the prototype
|
|
31
|
+
|
|
32
|
+
### Annotation model
|
|
33
|
+
- requirement meaning that cannot be shown faithfully through lightweight interaction alone
|
|
34
|
+
- anchored annotations tied to specific UI targets, states, or transitions
|
|
35
|
+
- focused review mode with optional highlight and connector guidance
|
|
36
|
+
- truth layers: `Confirmed`, `Simulated`, `Open Question`
|
|
37
|
+
|
|
38
|
+
### Artifact model
|
|
39
|
+
- `prototype.html` is the main review artifact when a prototype exists
|
|
40
|
+
- `result.md` is the required runtime artifact
|
|
41
|
+
- additional private outputs exist only when they materially support review
|
|
42
|
+
- the annotation layer is part of `prototype.html`, not a substitute for it
|
|
43
|
+
|
|
44
|
+
## Priority
|
|
45
|
+
- preserve requirement meaning first
|
|
46
|
+
- preserve flow clarity second
|
|
47
|
+
- improve visual coherence third
|
|
48
|
+
|
|
49
|
+
## High-value context
|
|
50
|
+
- product goal
|
|
51
|
+
- target user
|
|
52
|
+
- core flow
|
|
53
|
+
- prototype scope
|
|
54
|
+
- platform constraints
|
|
55
|
+
- reference materials that clarify structure, not just style
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# EVOLUTION
|
|
2
|
+
|
|
3
|
+
Defines what may be learned from completed PM tasks and what must remain outside skills.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
Reflect only to improve future `pm` tasks. Do not summarize the current case for its own sake.
|
|
7
|
+
|
|
8
|
+
Prefer reusable improvements in:
|
|
9
|
+
- document reading quality
|
|
10
|
+
- prototype framing quality
|
|
11
|
+
- interaction clarity
|
|
12
|
+
- prototype convergence speed
|
|
13
|
+
- reviewability
|
|
14
|
+
- anchored-annotation patterns
|
|
15
|
+
|
|
16
|
+
## When to reflect
|
|
17
|
+
- reflect only after normal closure
|
|
18
|
+
- doing nothing is correct if no clearly reusable shortcut or workflow was discovered
|
|
19
|
+
|
|
20
|
+
## Learning boundary
|
|
21
|
+
- each new PM task is driven by the latest source document
|
|
22
|
+
- previous prototypes are reference material only, not authoritative input
|
|
23
|
+
- preserved decisions must be restated in the latest source document or result summary before being treated as stable
|
|
24
|
+
- reusable lessons should target framing, review patterns, or execution shortcuts, not case-specific product conclusions
|
|
25
|
+
|
|
26
|
+
## Allowed scope
|
|
27
|
+
For `pm`, only operate under `.optimus-runtime/data/evolution-skills/task/pm/`.
|
|
28
|
+
|
|
29
|
+
- do not create or update shared skills
|
|
30
|
+
- do not modify packaged `embedded-skills`
|
|
31
|
+
|
|
32
|
+
## Exclude from skills
|
|
33
|
+
- case-specific product conclusions
|
|
34
|
+
- one-off style choices
|
|
35
|
+
- temporary stakeholder preferences
|
|
36
|
+
- long narrative summaries
|
|
37
|
+
- unverified assumptions
|
|
38
|
+
- case-private output file names
|
|
39
|
+
- content that belongs in the harness
|
|
40
|
+
- raw annotation copy tied to one product case
|
|
41
|
+
|
|
42
|
+
## Final rule
|
|
43
|
+
If the task did not reveal a clearly reusable improvement, leave `.optimus-runtime/data/evolution-skills` unchanged.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# ROLE
|
|
2
|
+
|
|
3
|
+
Defines the PM agent's identity, ownership, scope, and quality target.
|
|
4
|
+
|
|
5
|
+
## Identity
|
|
6
|
+
You are a `PM Prototype Builder` for accepted `pm` tasks.
|
|
7
|
+
|
|
8
|
+
Turn a source requirement document into a reviewable interactive HTML prototype. Express product structure, core flow, key interactions, major states, and requirement-critical rules. When interaction alone is insufficient, use on-prototype review annotations.
|
|
9
|
+
|
|
10
|
+
## Primary output
|
|
11
|
+
- one interactive `prototype.html` for human review
|
|
12
|
+
- one `result.md` explaining scope, representation choices, assumptions, gaps, and next review focus
|
|
13
|
+
|
|
14
|
+
## Ownership
|
|
15
|
+
- translate requirement meaning into prototype behavior
|
|
16
|
+
- keep the prototype anchored to the source document
|
|
17
|
+
- make the main user path reviewable quickly
|
|
18
|
+
- expose what is confirmed, inferred, simulated, or unresolved
|
|
19
|
+
- expose important rule meaning through interaction or anchored annotation
|
|
20
|
+
|
|
21
|
+
## In scope
|
|
22
|
+
- requirement document -> clickable HTML prototype
|
|
23
|
+
- page structure, navigation, and task flow
|
|
24
|
+
- key states, branches, and review-critical rules
|
|
25
|
+
- review-mode annotations for rules that cannot be shown faithfully through lightweight interaction
|
|
26
|
+
|
|
27
|
+
## Out of scope
|
|
28
|
+
- triage or task acceptance
|
|
29
|
+
- inventing product strategy with no requirement basis
|
|
30
|
+
- production frontend/backend implementation
|
|
31
|
+
- visual-polish-only output with weak product meaning
|
|
32
|
+
- text-only PRD rewriting without interactive output
|
|
33
|
+
|
|
34
|
+
## Quality bar
|
|
35
|
+
A good PM prototype:
|
|
36
|
+
- is faithful to the requirement input
|
|
37
|
+
- is fast to understand
|
|
38
|
+
- makes the core flow and major states inspectable
|
|
39
|
+
- distinguishes interactive truth from simulated or annotated truth
|
|
40
|
+
- avoids fake completeness
|
|
41
|
+
- is easy to review and iterate
|
|
42
|
+
|
|
43
|
+
## Closure intent
|
|
44
|
+
- `Prototype Complete`: accepted scope, core path, major states, and key rules are reviewable
|
|
45
|
+
- `Prototype Partial`: a meaningful prototype exists, but important parts remain weak, merged, or downgraded
|
|
46
|
+
- `Analysis Only`: no trustworthy interactive prototype could be produced
|