@defend-tech/opencode-optima 0.1.14 → 0.1.16
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/index.js +15 -9
- package/dist/sanitize_cli.js +15 -9
- package/package.json +1 -1
- package/policies/README.md +62 -0
- package/policies/codemap.yml +12 -0
- package/policies/definition-of-done.md +27 -0
- package/policies/definition-of-ready.md +27 -0
- package/policies/development-guidelines.md +21 -0
- package/policies/documentation-guidelines.md +39 -0
- package/policies/git-commit-messaging.md +14 -0
- package/policies/product-guidelines.md +20 -0
- package/policies/testing-guidelines.md +30 -0
- package/policies/ui-ux-guidelines.md +33 -0
package/dist/index.js
CHANGED
|
@@ -9207,24 +9207,30 @@ async function createOpenCodeSession(client, { title, directory } = {}) {
|
|
|
9207
9207
|
const result = await client.session.create({ query: { directory }, body: { title } });
|
|
9208
9208
|
return result?.data?.id || result?.id;
|
|
9209
9209
|
}
|
|
9210
|
-
async function
|
|
9210
|
+
async function callOpenCodePromptWithFallbacks(method, sessionId, flatPayload, structuredPayload) {
|
|
9211
9211
|
try {
|
|
9212
|
-
return await method({
|
|
9213
|
-
} catch (
|
|
9212
|
+
return await method({ sessionID: sessionId, ...flatPayload });
|
|
9213
|
+
} catch (flatError) {
|
|
9214
9214
|
try {
|
|
9215
|
-
return await method({ ...
|
|
9215
|
+
return await method({ ...structuredPayload, path: { sessionID: sessionId } });
|
|
9216
9216
|
} catch {
|
|
9217
|
-
|
|
9217
|
+
try {
|
|
9218
|
+
return await method({ ...structuredPayload, path: { id: sessionId } });
|
|
9219
|
+
} catch {
|
|
9220
|
+
throw flatError;
|
|
9221
|
+
}
|
|
9218
9222
|
}
|
|
9219
9223
|
}
|
|
9220
9224
|
}
|
|
9221
9225
|
async function sendOpenCodeSessionEvent(client, { sessionId, agent, text, directory } = {}) {
|
|
9222
|
-
const
|
|
9226
|
+
const parts = [{ type: "text", text }];
|
|
9227
|
+
const flatPayload = { directory, agent, parts };
|
|
9228
|
+
const structuredPayload = { query: { directory }, body: { agent, parts } };
|
|
9223
9229
|
if (typeof client?.session?.prompt === "function") {
|
|
9224
|
-
return
|
|
9230
|
+
return callOpenCodePromptWithFallbacks(client.session.prompt.bind(client.session), sessionId, flatPayload, structuredPayload);
|
|
9225
9231
|
}
|
|
9226
9232
|
if (typeof client?.session?.promptAsync === "function") {
|
|
9227
|
-
return
|
|
9233
|
+
return callOpenCodePromptWithFallbacks(client.session.promptAsync.bind(client.session), sessionId, flatPayload, structuredPayload);
|
|
9228
9234
|
}
|
|
9229
9235
|
throw new Error("OpenCode client does not expose session.prompt or session.promptAsync.");
|
|
9230
9236
|
}
|
|
@@ -11133,7 +11139,7 @@ Follow-up: use optima_prompt_workflow with session_id '${sessionId}' to check in
|
|
|
11133
11139
|
}
|
|
11134
11140
|
};
|
|
11135
11141
|
}
|
|
11136
|
-
OptimaPlugin.__internals = { buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, createClickUpApiClient, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, readClickUpWebhookState, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
11142
|
+
OptimaPlugin.__internals = { BUNDLE_AGENTS_DIR, BUNDLE_POLICIES_DIR, buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, createClickUpApiClient, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, readClickUpWebhookState, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
11137
11143
|
export {
|
|
11138
11144
|
OptimaPlugin as default
|
|
11139
11145
|
};
|
package/dist/sanitize_cli.js
CHANGED
|
@@ -9214,24 +9214,30 @@ async function createOpenCodeSession(client, { title, directory } = {}) {
|
|
|
9214
9214
|
const result = await client.session.create({ query: { directory }, body: { title } });
|
|
9215
9215
|
return result?.data?.id || result?.id;
|
|
9216
9216
|
}
|
|
9217
|
-
async function
|
|
9217
|
+
async function callOpenCodePromptWithFallbacks(method, sessionId, flatPayload, structuredPayload) {
|
|
9218
9218
|
try {
|
|
9219
|
-
return await method({
|
|
9220
|
-
} catch (
|
|
9219
|
+
return await method({ sessionID: sessionId, ...flatPayload });
|
|
9220
|
+
} catch (flatError) {
|
|
9221
9221
|
try {
|
|
9222
|
-
return await method({ ...
|
|
9222
|
+
return await method({ ...structuredPayload, path: { sessionID: sessionId } });
|
|
9223
9223
|
} catch {
|
|
9224
|
-
|
|
9224
|
+
try {
|
|
9225
|
+
return await method({ ...structuredPayload, path: { id: sessionId } });
|
|
9226
|
+
} catch {
|
|
9227
|
+
throw flatError;
|
|
9228
|
+
}
|
|
9225
9229
|
}
|
|
9226
9230
|
}
|
|
9227
9231
|
}
|
|
9228
9232
|
async function sendOpenCodeSessionEvent(client, { sessionId, agent, text, directory } = {}) {
|
|
9229
|
-
const
|
|
9233
|
+
const parts = [{ type: "text", text }];
|
|
9234
|
+
const flatPayload = { directory, agent, parts };
|
|
9235
|
+
const structuredPayload = { query: { directory }, body: { agent, parts } };
|
|
9230
9236
|
if (typeof client?.session?.prompt === "function") {
|
|
9231
|
-
return
|
|
9237
|
+
return callOpenCodePromptWithFallbacks(client.session.prompt.bind(client.session), sessionId, flatPayload, structuredPayload);
|
|
9232
9238
|
}
|
|
9233
9239
|
if (typeof client?.session?.promptAsync === "function") {
|
|
9234
|
-
return
|
|
9240
|
+
return callOpenCodePromptWithFallbacks(client.session.promptAsync.bind(client.session), sessionId, flatPayload, structuredPayload);
|
|
9235
9241
|
}
|
|
9236
9242
|
throw new Error("OpenCode client does not expose session.prompt or session.promptAsync.");
|
|
9237
9243
|
}
|
|
@@ -11140,7 +11146,7 @@ Follow-up: use optima_prompt_workflow with session_id '${sessionId}' to check in
|
|
|
11140
11146
|
}
|
|
11141
11147
|
};
|
|
11142
11148
|
}
|
|
11143
|
-
OptimaPlugin.__internals = { buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, createClickUpApiClient, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, readClickUpWebhookState, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
11149
|
+
OptimaPlugin.__internals = { BUNDLE_AGENTS_DIR, BUNDLE_POLICIES_DIR, buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, createClickUpApiClient, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, readClickUpWebhookState, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
11144
11150
|
|
|
11145
11151
|
// src/sanitize_cli.js
|
|
11146
11152
|
var { migrateLegacyOptimaLayout: migrateLegacyOptimaLayout2 } = OptimaPlugin.__internals;
|
package/package.json
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Optima Policies
|
|
2
|
+
|
|
3
|
+
This package-internal directory contains bundled fallback policy assets. Optima target repositories should put repo-local policy overrides in `.optima/policies/`, not in a root `policies/` directory.
|
|
4
|
+
|
|
5
|
+
## How Policy Resolution Works
|
|
6
|
+
|
|
7
|
+
For any `<include:policy:<file>.md>` include, Optima resolves policy files in this order:
|
|
8
|
+
|
|
9
|
+
1. `.optima/policies/<file>.md`
|
|
10
|
+
2. bundled plugin default `policies/<file>.md`
|
|
11
|
+
|
|
12
|
+
Files under `.optima/.config/generated/policies/` are reference copies only. They are not read directly at runtime.
|
|
13
|
+
|
|
14
|
+
## Available Policies
|
|
15
|
+
|
|
16
|
+
- `development-guidelines.md`
|
|
17
|
+
- Repository-specific engineering rules, stack notes, and implementation conventions.
|
|
18
|
+
- Used by: `developer`, `technical_architect`, `tech_lead`, `workflow_runner`
|
|
19
|
+
|
|
20
|
+
- `testing-guidelines.md`
|
|
21
|
+
- Testing, evidence, regression, and verification conventions.
|
|
22
|
+
- Used by: `developer`, `qa_engineer`, `tech_lead`, `workflow_runner`
|
|
23
|
+
|
|
24
|
+
- `documentation-guidelines.md`
|
|
25
|
+
- Documentation layout, naming, ownership, and update expectations.
|
|
26
|
+
- Used by all agents through the shared prompt.
|
|
27
|
+
|
|
28
|
+
- `definition-of-ready.md`
|
|
29
|
+
- Canonical readiness criteria before execution begins.
|
|
30
|
+
- Used by all agents through the shared prompt and reflected in task templates.
|
|
31
|
+
|
|
32
|
+
- `definition-of-done.md`
|
|
33
|
+
- Canonical completion criteria before closure.
|
|
34
|
+
- Used by all agents through the shared prompt and reflected in task templates.
|
|
35
|
+
|
|
36
|
+
- `git-commit-messaging.md`
|
|
37
|
+
- Commit subject and body rules.
|
|
38
|
+
- Used by: `tech_lead`, `workflow_runner`
|
|
39
|
+
|
|
40
|
+
- `product-guidelines.md`
|
|
41
|
+
- User story, acceptance criteria, terminology, and product-truth conventions.
|
|
42
|
+
- Used by: `product_manager`, `business_analyst`
|
|
43
|
+
|
|
44
|
+
- `ui-ux-guidelines.md`
|
|
45
|
+
- UI review standards and visual quality expectations.
|
|
46
|
+
- Used by: `ui_ux_designer`
|
|
47
|
+
|
|
48
|
+
## Customizing A Policy
|
|
49
|
+
|
|
50
|
+
1. Set `.optima/.config/optima.yaml` `policies.extract_defaults` to `all` if you want reference copies of all bundled defaults.
|
|
51
|
+
2. Inspect `.optima/.config/generated/policies/` for the default files.
|
|
52
|
+
3. Copy the policy you want to customize into `.optima/policies/`.
|
|
53
|
+
4. Edit the copied file. The repo-local version will override the plugin default automatically.
|
|
54
|
+
|
|
55
|
+
## Policy Extraction
|
|
56
|
+
|
|
57
|
+
`policies.extract_defaults` supports:
|
|
58
|
+
|
|
59
|
+
- `none`: do not generate reference policy files
|
|
60
|
+
- `all`: write all bundled default policy files to `.optima/.config/generated/policies/`
|
|
61
|
+
|
|
62
|
+
Only files in `.optima/policies/` affect runtime prompt behavior.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
scope: module
|
|
2
|
+
parent: ../.optima/codemap.yml
|
|
3
|
+
sources_of_truth:
|
|
4
|
+
- path: README.md
|
|
5
|
+
- path: definition-of-done.md
|
|
6
|
+
- path: definition-of-ready.md
|
|
7
|
+
- path: development-guidelines.md
|
|
8
|
+
- path: documentation-guidelines.md
|
|
9
|
+
- path: git-commit-messaging.md
|
|
10
|
+
- path: product-guidelines.md
|
|
11
|
+
- path: testing-guidelines.md
|
|
12
|
+
- path: ui-ux-guidelines.md
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Definition Of Done
|
|
2
|
+
|
|
3
|
+
A task is done only when the implementation, verification, documentation, and workflow closure requirements are all complete.
|
|
4
|
+
|
|
5
|
+
## Completion Criteria
|
|
6
|
+
|
|
7
|
+
- All in-scope acceptance criteria are satisfied or explicitly marked blocked with documented reason.
|
|
8
|
+
- Required tests, builds, and other verification commands pass according to the repository testing policy.
|
|
9
|
+
- Required evidence and verification artifacts are recorded.
|
|
10
|
+
- Product and technical documentation impact is resolved according to the repository documentation policy.
|
|
11
|
+
- Relevant CodeMap updates are completed when the changed code affects entrypoints, wiring, or maintained source structure.
|
|
12
|
+
- Task files, discussion references, and workflow registries are updated as needed.
|
|
13
|
+
- `.optima/` task, todo, evidence, SCR/docs, registry, discussion, and runtime tracking artifacts are written before the final commit.
|
|
14
|
+
- The authorized review and closure roles have completed their required checks.
|
|
15
|
+
- The final committed state includes all required code, documentation, `.optima` closure artifacts, and registry updates.
|
|
16
|
+
|
|
17
|
+
## Not Done Conditions
|
|
18
|
+
|
|
19
|
+
- Any required test or build fails.
|
|
20
|
+
- Evidence is missing for claimed verification.
|
|
21
|
+
- Documentation or CodeMap impact remains unresolved.
|
|
22
|
+
- Acceptance criteria are incomplete, unclear, or unverified.
|
|
23
|
+
- Required finalization or archiving steps are missing.
|
|
24
|
+
|
|
25
|
+
## Operational Rule
|
|
26
|
+
|
|
27
|
+
A task must not be marked complete while any Definition of Done item remains open.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Definition Of Ready
|
|
2
|
+
|
|
3
|
+
A task is ready to begin only when the repository has enough information to execute safely and efficiently without inventing scope.
|
|
4
|
+
|
|
5
|
+
## Readiness Criteria
|
|
6
|
+
|
|
7
|
+
- Scope is clear, bounded, and appropriate for the task's declared complexity.
|
|
8
|
+
- The task objective is specific enough that the next responsible agent can act without guessing intent.
|
|
9
|
+
- Acceptance criteria are present, testable, and aligned with the stated scope.
|
|
10
|
+
- Complexity, track, and slice are set correctly for the work being requested.
|
|
11
|
+
- Required dependencies, assumptions, blockers, and open questions are either resolved or explicitly recorded.
|
|
12
|
+
- Required pre-sync specialists have reviewed the task definition according to the active task model.
|
|
13
|
+
- An approved SCR exists whenever the workflow requires one.
|
|
14
|
+
- The relevant repository areas are identified well enough to begin safe investigation, design, or implementation.
|
|
15
|
+
|
|
16
|
+
## Not Ready Conditions
|
|
17
|
+
|
|
18
|
+
- Requirements are ambiguous or contradictory.
|
|
19
|
+
- Acceptance criteria are missing or too vague to verify.
|
|
20
|
+
- The task is larger or riskier than its current routing metadata suggests.
|
|
21
|
+
- Required specialist review has not happened yet.
|
|
22
|
+
- A required SCR is missing or not approved.
|
|
23
|
+
- Critical blockers or dependencies are unknown or unrecorded.
|
|
24
|
+
|
|
25
|
+
## Operational Rule
|
|
26
|
+
|
|
27
|
+
If the task fails the Definition of Ready, execution should pause until the missing information is resolved or explicitly recorded for follow-up.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Development Guidelines
|
|
2
|
+
|
|
3
|
+
These defaults are intended to be customized per repository when needed.
|
|
4
|
+
|
|
5
|
+
## Stack Notes
|
|
6
|
+
|
|
7
|
+
- Language: define in the repository if needed.
|
|
8
|
+
- Runtime / Framework: define in the repository if needed.
|
|
9
|
+
- Frontend stack: define in the repository if needed.
|
|
10
|
+
- Testing stack: define in the repository if needed.
|
|
11
|
+
- Database / storage: define in the repository if needed.
|
|
12
|
+
|
|
13
|
+
## Default Engineering Conventions
|
|
14
|
+
|
|
15
|
+
- Prefer clear module or feature boundaries over ad-hoc file placement.
|
|
16
|
+
- Keep external integrations behind stable interfaces or wrappers when practical.
|
|
17
|
+
- Update `.gitignore` when repository changes introduce generated, temporary, or sensitive files.
|
|
18
|
+
- Prefer stable dependency versions unless repository compatibility requires otherwise.
|
|
19
|
+
- Use dependency-provided setup or initialization utilities when they are the standard way to integrate the dependency safely.
|
|
20
|
+
- Document meaningful architecture changes in the repository's documentation before or alongside implementation.
|
|
21
|
+
- Keep code changes aligned with existing repository conventions unless the repository policy explicitly changes them.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Documentation Guidelines
|
|
2
|
+
|
|
3
|
+
## Documentation Goals
|
|
4
|
+
|
|
5
|
+
- Keep documentation easy to locate and update.
|
|
6
|
+
- Separate steady-state truth from change proposals and workflow records.
|
|
7
|
+
- Update documentation in the same change set as the implementation whenever the documented truth changes.
|
|
8
|
+
|
|
9
|
+
## Default Documentation Layout
|
|
10
|
+
|
|
11
|
+
- `docs/product/`: whole-product truth and top-level feature inventory
|
|
12
|
+
- `docs/domains/`: stable product-area truth shared by multiple features
|
|
13
|
+
- `docs/features/`: one concrete capability or feature specification
|
|
14
|
+
- `docs/architecture/`: technical design, contracts, and cross-cutting decisions
|
|
15
|
+
- `.optima/docs/scrs/`: proposed and approved changes, not steady-state truth
|
|
16
|
+
|
|
17
|
+
## Update Expectations
|
|
18
|
+
|
|
19
|
+
Update the relevant documentation when work changes:
|
|
20
|
+
|
|
21
|
+
- product behavior, terminology, or feature inventory
|
|
22
|
+
- architecture, interfaces, or technical invariants
|
|
23
|
+
- feature specifications or acceptance criteria
|
|
24
|
+
- documentation ownership, naming, or structure conventions
|
|
25
|
+
|
|
26
|
+
## Default Ownership
|
|
27
|
+
|
|
28
|
+
- Business Analyst: product, domain, and feature truth from the product perspective
|
|
29
|
+
- Technical Architect: architecture truth and technical design documentation
|
|
30
|
+
- Product Manager: verifies documentation closure during workflow execution
|
|
31
|
+
- Developer / Tech Lead / QA: contribute technical accuracy when implementation changes documented truth
|
|
32
|
+
|
|
33
|
+
## Default Repository Matrix
|
|
34
|
+
|
|
35
|
+
- Product overview: `docs/product/PRODUCT_OVERVIEW.md`
|
|
36
|
+
- Features list: `docs/product/FEATURES_LIST.md`
|
|
37
|
+
- Architecture: `docs/architecture/TECHNICAL_ARCHITECTURE.md`
|
|
38
|
+
- Feature specification: `docs/features/<feature>/SPECIFICATION.md`
|
|
39
|
+
- CodeMap updates: relevant `codemap.yml` files for changed code areas
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Git Commit Messaging
|
|
2
|
+
|
|
3
|
+
Use a concise subject line in this format:
|
|
4
|
+
|
|
5
|
+
`<type>: <optional-task-id> <short summary>`
|
|
6
|
+
|
|
7
|
+
Examples:
|
|
8
|
+
|
|
9
|
+
- `docs: update workflow guidance`
|
|
10
|
+
- `fix: TASK-014 correct task archive logic`
|
|
11
|
+
|
|
12
|
+
Always include a brief body that explains what the commit is for and why the change exists.
|
|
13
|
+
|
|
14
|
+
If the commit is associated with a task, include the task ID in the subject when practical.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Product Guidelines
|
|
2
|
+
|
|
3
|
+
## Product Writing Defaults
|
|
4
|
+
|
|
5
|
+
- Write user stories and requirements in clear, unambiguous language.
|
|
6
|
+
- Keep acceptance criteria specific, testable, and easy to map to verification evidence.
|
|
7
|
+
- Use numbered acceptance criteria (`AC-1`, `AC-2`, ...) for tracked work.
|
|
8
|
+
- Maintain consistent product terminology across SCRs, tasks, and steady-state docs.
|
|
9
|
+
|
|
10
|
+
## User Story And Acceptance Criteria Conventions
|
|
11
|
+
|
|
12
|
+
- User stories may use the format: `As a <user>, I want <action>, so that <benefit>.`
|
|
13
|
+
- Acceptance criteria should describe observable behavior or outcomes rather than implementation details.
|
|
14
|
+
- When requirements are incomplete or ambiguous, stop and push for clarification instead of inventing scope.
|
|
15
|
+
|
|
16
|
+
## Product Truth Stewardship
|
|
17
|
+
|
|
18
|
+
- Keep product documentation cross-linked and internally consistent.
|
|
19
|
+
- When behavior changes, update the relevant product-facing docs and SCR registries.
|
|
20
|
+
- If the repository establishes domain or feature naming conventions, apply them consistently.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Testing Guidelines
|
|
2
|
+
|
|
3
|
+
## Test Levels
|
|
4
|
+
|
|
5
|
+
1. Unit tests verify isolated logic, functions, and classes.
|
|
6
|
+
2. Integration tests verify interactions between multiple modules or external services.
|
|
7
|
+
3. End-to-end tests verify real user or system flows through the product.
|
|
8
|
+
4. Manual verification is allowed for visual or interaction checks that cannot be automated effectively.
|
|
9
|
+
|
|
10
|
+
## Verification Policy
|
|
11
|
+
|
|
12
|
+
- All automated tests must pass. No expected skips or tolerated failures are allowed by default.
|
|
13
|
+
- Tests should live close to the code they verify unless the repository uses a clearly defined alternative structure.
|
|
14
|
+
- Every `implementation` task must produce reviewable verification artifacts under `.optima/evidences/<task_id>/`.
|
|
15
|
+
- Do not create or reference a root `evidences/` folder; implementation evidence belongs only under `.optima/evidences/<task_id>/`.
|
|
16
|
+
- Verification artifacts should map back to the task's numbered acceptance criteria.
|
|
17
|
+
- Run the relevant regression coverage before handing implementation back for technical review.
|
|
18
|
+
|
|
19
|
+
## Evidence Defaults
|
|
20
|
+
|
|
21
|
+
By default, `.optima/evidences/<task_id>/` implementation evidence should include:
|
|
22
|
+
|
|
23
|
+
- `SUMMARY.md` with a short summary and numbered acceptance criteria coverage
|
|
24
|
+
- `logs/` with command output or logs for relevant automated checks
|
|
25
|
+
- `screenshots/` with UI screenshots or visual review artifacts when UI changes are involved
|
|
26
|
+
|
|
27
|
+
## Non-Implementation Outputs
|
|
28
|
+
|
|
29
|
+
- `investigation` tasks should produce findings, reproduction notes, useful logs, and a recommended next step.
|
|
30
|
+
- `spec` tasks should produce SCR or documentation updates that define the accepted change and its impact.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# UI/UX Guidelines
|
|
2
|
+
|
|
3
|
+
## Core Principles
|
|
4
|
+
|
|
5
|
+
1. Prioritize ease of use, accessibility, and intuitive navigation.
|
|
6
|
+
2. Aim for a modern, clean, and polished visual design.
|
|
7
|
+
3. Keep UI elements visually consistent with the repository's design language.
|
|
8
|
+
4. Use layout, color, and typography to create clear visual hierarchy.
|
|
9
|
+
|
|
10
|
+
## Review Workflow
|
|
11
|
+
|
|
12
|
+
- Define the intended screens, interactions, and layout before implementation when UI work is involved.
|
|
13
|
+
- Review screenshots and other visual evidence under `.optima/evidences/<task_id>/` after implementation; do not look for a root evidence folder.
|
|
14
|
+
- Evaluate the result visually rather than by reading code.
|
|
15
|
+
- If the available evidence is insufficient, say so clearly and ask for better screenshots or artifacts.
|
|
16
|
+
|
|
17
|
+
## Visual Quality Checklist
|
|
18
|
+
|
|
19
|
+
Reject or request fixes when you see:
|
|
20
|
+
|
|
21
|
+
- obvious misalignment against the page or component grid
|
|
22
|
+
- inconsistent spacing between similar elements
|
|
23
|
+
- weak typography hierarchy that makes the screen hard to scan
|
|
24
|
+
- interactive elements that do not look interactive
|
|
25
|
+
- low-contrast text or other readability issues
|
|
26
|
+
- cluttered, dated, or visibly unpolished presentation
|
|
27
|
+
|
|
28
|
+
## Required Fix Triggers
|
|
29
|
+
|
|
30
|
+
- overlapping UI or clipped text
|
|
31
|
+
- missing key interaction steps that were part of the intended flow
|
|
32
|
+
- ignored design system conventions for color, typography, or spacing
|
|
33
|
+
- an overall result that feels amateur or not ready for users
|