opencode-agent-skill 7.7.0
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/CHANGELOG.md +163 -0
- package/LICENSE +9 -0
- package/README.md +581 -0
- package/bin/ocskill.mjs +975 -0
- package/docs/DETERMINISTIC-TOOLS.md +88 -0
- package/docs/ENGINEERING-DESIGN.md +176 -0
- package/docs/EVALS.md +136 -0
- package/docs/NPM-PUBLISH.md +102 -0
- package/docs/OPENCODE-COMPAT.md +109 -0
- package/docs/RESEARCH-SOURCES.md +37 -0
- package/docs/TRACE-SCHEMA.md +109 -0
- package/docs/V7-INTELLIGENCE-RUNTIME.md +166 -0
- package/evals/live/fixtures/engineering-bench/package.json +1 -0
- package/evals/live/fixtures/engineering-bench/src/api-errors.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/authz.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/cache-tags.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/config.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/contract-consumer.mjs +6 -0
- package/evals/live/fixtures/engineering-bench/src/contract-producer.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/dedupe.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/dependency.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/discount.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/inventory.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/migration.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/money.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/pagination.mjs +5 -0
- package/evals/live/fixtures/engineering-bench/src/path-safe.mjs +5 -0
- package/evals/live/fixtures/engineering-bench/src/payment.mjs +5 -0
- package/evals/live/fixtures/engineering-bench/src/query-sort.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/react-state.mjs +8 -0
- package/evals/live/fixtures/engineering-bench/src/retry.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/rn-platform.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/upload.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/webhook.mjs +3 -0
- package/evals/live/graders/engineering-bench.mjs +239 -0
- package/evals/live/tasks.json +126 -0
- package/evals/long/fixtures/long-horizon/package.json +1 -0
- package/evals/long/fixtures/long-horizon/src/auth.mjs +5 -0
- package/evals/long/fixtures/long-horizon/src/checkout.mjs +9 -0
- package/evals/long/fixtures/long-horizon/src/inventory.mjs +5 -0
- package/evals/long/fixtures/long-horizon/src/money.mjs +3 -0
- package/evals/long/fixtures/long-horizon/src/payment.mjs +7 -0
- package/evals/long/fixtures/long-horizon/src/product-api.mjs +10 -0
- package/evals/long/fixtures/long-horizon/src/product-cache.mjs +3 -0
- package/evals/long/fixtures/long-horizon/src/product-service.mjs +6 -0
- package/evals/long/fixtures/long-horizon/src/product-state.mjs +8 -0
- package/evals/long/fixtures/long-horizon/src/project-api.mjs +9 -0
- package/evals/long/fixtures/long-horizon/src/project-service.mjs +7 -0
- package/evals/long/fixtures/long-horizon/src/user-consumer.mjs +3 -0
- package/evals/long/fixtures/long-horizon/src/user-migration.mjs +7 -0
- package/evals/long/fixtures/long-horizon/src/user-serializer.mjs +3 -0
- package/evals/long/fixtures/long-horizon/src/user-validation.mjs +3 -0
- package/evals/long/graders/long-horizon.mjs +209 -0
- package/evals/long/tasks.json +36 -0
- package/evals/router-triggers.json +1238 -0
- package/evals/routing.json +321 -0
- package/global-config/AGENTS.md +212 -0
- package/global-config/agents/architect.md +38 -0
- package/global-config/agents/codebase-mapper.md +41 -0
- package/global-config/agents/critic.md +37 -0
- package/global-config/agents/debugger.md +36 -0
- package/global-config/agents/executor.md +48 -0
- package/global-config/agents/integration-verifier.md +43 -0
- package/global-config/agents/plan-checker.md +43 -0
- package/global-config/agents/researcher.md +30 -0
- package/global-config/agents/reviewer.md +30 -0
- package/global-config/agents/verifier.md +33 -0
- package/global-config/commands/audit.md +8 -0
- package/global-config/commands/critique.md +8 -0
- package/global-config/commands/debug.md +8 -0
- package/global-config/commands/feature.md +8 -0
- package/global-config/commands/fix.md +8 -0
- package/global-config/commands/plan.md +8 -0
- package/global-config/commands/research.md +8 -0
- package/global-config/commands/resume.md +22 -0
- package/global-config/commands/review.md +8 -0
- package/global-config/commands/run.md +29 -0
- package/global-config/commands/verify.md +8 -0
- package/global-config/plugins/ues-router/capabilities.js +20 -0
- package/global-config/plugins/ues-router/index.js +277 -0
- package/global-config/plugins/ues-router/router.js +74 -0
- package/global-config/plugins/ues-router/safety.js +16 -0
- package/global-config/skills/accessibility/SKILL.md +10 -0
- package/global-config/skills/accessibility/references/workflow.md +17 -0
- package/global-config/skills/api-contract/SKILL.md +12 -0
- package/global-config/skills/api-contract/references/workflow.md +17 -0
- package/global-config/skills/auth-security/SKILL.md +12 -0
- package/global-config/skills/auth-security/references/workflow.md +15 -0
- package/global-config/skills/bug-diagnosis/SKILL.md +28 -0
- package/global-config/skills/change-impact-analysis/SKILL.md +23 -0
- package/global-config/skills/code-review/SKILL.md +19 -0
- package/global-config/skills/context-engineering/SKILL.md +18 -0
- package/global-config/skills/context-engineering/references/large-repo.md +16 -0
- package/global-config/skills/database-engineering/SKILL.md +12 -0
- package/global-config/skills/database-engineering/references/workflow.md +15 -0
- package/global-config/skills/dependency-management/SKILL.md +12 -0
- package/global-config/skills/dependency-management/references/workflow.md +14 -0
- package/global-config/skills/devops-engineering/SKILL.md +10 -0
- package/global-config/skills/devops-engineering/references/workflow.md +11 -0
- package/global-config/skills/django-engineering/SKILL.md +10 -0
- package/global-config/skills/django-engineering/references/workflow.md +11 -0
- package/global-config/skills/documentation-engineering/SKILL.md +10 -0
- package/global-config/skills/documentation-engineering/references/workflow.md +15 -0
- package/global-config/skills/dotnet-engineering/SKILL.md +10 -0
- package/global-config/skills/dotnet-engineering/references/workflow.md +11 -0
- package/global-config/skills/ecommerce-engineering/SKILL.md +10 -0
- package/global-config/skills/ecommerce-engineering/references/workflow.md +17 -0
- package/global-config/skills/engineering-orchestrator/SKILL.md +29 -0
- package/global-config/skills/engineering-orchestrator/references/delegation.md +22 -0
- package/global-config/skills/engineering-orchestrator/references/evaluator-loop.md +18 -0
- package/global-config/skills/engineering-orchestrator/references/long-horizon.md +57 -0
- package/global-config/skills/engineering-orchestrator/references/model-escalation.md +19 -0
- package/global-config/skills/engineering-orchestrator/references/retry-policy.md +12 -0
- package/global-config/skills/engineering-orchestrator/references/routing.md +39 -0
- package/global-config/skills/engineering-orchestrator/references/verification-matrix.md +18 -0
- package/global-config/skills/fastapi-engineering/SKILL.md +10 -0
- package/global-config/skills/fastapi-engineering/references/workflow.md +13 -0
- package/global-config/skills/file-upload-engineering/SKILL.md +10 -0
- package/global-config/skills/file-upload-engineering/references/workflow.md +17 -0
- package/global-config/skills/flutter-engineering/SKILL.md +10 -0
- package/global-config/skills/flutter-engineering/references/workflow.md +13 -0
- package/global-config/skills/git-safety/SKILL.md +10 -0
- package/global-config/skills/git-safety/references/workflow.md +15 -0
- package/global-config/skills/implementation-engineer/SKILL.md +10 -0
- package/global-config/skills/implementation-engineer/references/workflow.md +14 -0
- package/global-config/skills/java-spring-engineering/SKILL.md +10 -0
- package/global-config/skills/java-spring-engineering/references/workflow.md +13 -0
- package/global-config/skills/long-task-state/SKILL.md +28 -0
- package/global-config/skills/long-task-state/references/context-ledger.md +27 -0
- package/global-config/skills/long-task-state/templates/STATE.md +48 -0
- package/global-config/skills/nestjs-engineering/SKILL.md +10 -0
- package/global-config/skills/nestjs-engineering/references/workflow.md +11 -0
- package/global-config/skills/nextjs-engineering/SKILL.md +12 -0
- package/global-config/skills/nextjs-engineering/references/workflow.md +15 -0
- package/global-config/skills/nodejs-engineering/SKILL.md +12 -0
- package/global-config/skills/nodejs-engineering/references/workflow.md +11 -0
- package/global-config/skills/payment-engineering/SKILL.md +12 -0
- package/global-config/skills/payment-engineering/references/workflow.md +19 -0
- package/global-config/skills/performance-engineering/SKILL.md +10 -0
- package/global-config/skills/performance-engineering/references/workflow.md +17 -0
- package/global-config/skills/python-engineering/SKILL.md +10 -0
- package/global-config/skills/python-engineering/references/workflow.md +11 -0
- package/global-config/skills/react-engineering/SKILL.md +14 -0
- package/global-config/skills/react-engineering/references/workflow.md +16 -0
- package/global-config/skills/react-native-engineering/SKILL.md +14 -0
- package/global-config/skills/react-native-engineering/references/workflow.md +16 -0
- package/global-config/skills/repo-explorer/SKILL.md +17 -0
- package/global-config/skills/research-verification/SKILL.md +18 -0
- package/global-config/skills/research-verification/references/source-hierarchy.md +12 -0
- package/global-config/skills/rest-api-design/SKILL.md +10 -0
- package/global-config/skills/rest-api-design/references/workflow.md +18 -0
- package/global-config/skills/software-architect/SKILL.md +10 -0
- package/global-config/skills/software-architect/references/workflow.md +18 -0
- package/global-config/skills/task-planner/SKILL.md +21 -0
- package/global-config/skills/task-planner/references/plan-schema.md +56 -0
- package/global-config/skills/test-driven-development/SKILL.md +22 -0
- package/global-config/skills/test-driven-development/references/writing-good-tests.md +21 -0
- package/global-config/skills/test-verification/SKILL.md +20 -0
- package/global-config/skills/ui-ux-engineering/SKILL.md +10 -0
- package/global-config/skills/ui-ux-engineering/references/workflow.md +17 -0
- package/global-config/skills/web-security-review/SKILL.md +10 -0
- package/global-config/skills/web-security-review/references/workflow.md +22 -0
- package/lib/context-manifest.mjs +101 -0
- package/lib/control-center.mjs +148 -0
- package/lib/eval-auth.mjs +21 -0
- package/lib/eval-report.mjs +72 -0
- package/lib/eval-telemetry.mjs +155 -0
- package/lib/evidence-receipt.mjs +50 -0
- package/lib/hermes-bridge.mjs +28 -0
- package/lib/ids.mjs +21 -0
- package/lib/installer.mjs +636 -0
- package/lib/learning-engine.mjs +161 -0
- package/lib/model-config.mjs +88 -0
- package/lib/model-policy.mjs +71 -0
- package/lib/opencode-compat.mjs +86 -0
- package/lib/orchestrator-policy.mjs +35 -0
- package/lib/process-runner.mjs +117 -0
- package/lib/repo-graph.mjs +135 -0
- package/lib/repo-inspect.mjs +264 -0
- package/lib/review-scope.mjs +98 -0
- package/lib/router-config.mjs +40 -0
- package/lib/task-engine.mjs +777 -0
- package/lib/task-graph.mjs +262 -0
- package/lib/update-resolver.mjs +43 -0
- package/lib/verification-plan.mjs +52 -0
- package/lib/version.mjs +47 -0
- package/lib/workspace-snapshot.mjs +45 -0
- package/lib/worktree-sandbox.mjs +59 -0
- package/package.json +69 -0
- package/scripts/check-working-tree.mjs +2 -0
- package/scripts/collect-evidence.mjs +2 -0
- package/scripts/control-center.mjs +37 -0
- package/scripts/detect-stack.mjs +2 -0
- package/scripts/detect-test-commands.mjs +2 -0
- package/scripts/eval-live.mjs +437 -0
- package/scripts/eval-report.mjs +49 -0
- package/scripts/eval-router.mjs +45 -0
- package/scripts/eval-skills.mjs +71 -0
- package/scripts/impact-map.mjs +4 -0
- package/scripts/install.mjs +61 -0
- package/scripts/repo-map.mjs +2 -0
- package/scripts/smoke-packed-install.mjs +326 -0
- package/scripts/syntax-check.mjs +35 -0
- package/scripts/uninstall.mjs +21 -0
- package/scripts/validate-live-suite.mjs +65 -0
- package/scripts/validate.mjs +133 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { Plugin } from "@opencode/plugin"
|
|
2
|
+
import { readFileSync } from "node:fs"
|
|
3
|
+
import { fileURLToPath } from "node:url"
|
|
4
|
+
import path from "node:path"
|
|
5
|
+
import { spawnSync } from "node:child_process"
|
|
6
|
+
import { routeSkills } from "./router.js"
|
|
7
|
+
import { destructiveShellRisk } from "./safety.js"
|
|
8
|
+
import { runtimeCapabilities } from "./capabilities.js"
|
|
9
|
+
|
|
10
|
+
const CONFIG_FILE = path.resolve(
|
|
11
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
12
|
+
"..",
|
|
13
|
+
"..",
|
|
14
|
+
".ues",
|
|
15
|
+
"router.json",
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
function routerConfig() {
|
|
19
|
+
try {
|
|
20
|
+
const parsed = JSON.parse(readFileSync(CONFIG_FILE, "utf8"))
|
|
21
|
+
return {
|
|
22
|
+
enabled: parsed.enabled !== false,
|
|
23
|
+
maxSkills: Number.isInteger(parsed.maxSkills) ? Math.max(1, Math.min(parsed.maxSkills, 6)) : 4,
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
return { enabled: true, maxSkills: 4 }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
function runOcskill(args, cwd) {
|
|
32
|
+
const result = spawnSync("ocskill", args, {
|
|
33
|
+
cwd,
|
|
34
|
+
encoding: "utf8",
|
|
35
|
+
shell: process.platform === "win32",
|
|
36
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
37
|
+
})
|
|
38
|
+
if (result.status !== 0) {
|
|
39
|
+
throw new Error((result.stderr || result.stdout || "ocskill command failed").trim())
|
|
40
|
+
}
|
|
41
|
+
return (result.stdout || "").trim()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function runOcskillJSON(args, cwd) {
|
|
45
|
+
const output = runOcskill(args, cwd)
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(output)
|
|
48
|
+
} catch {
|
|
49
|
+
throw new Error("ocskill returned invalid JSON for: " + args.join(" "))
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function modelRef(value) {
|
|
54
|
+
if (!value || typeof value !== "string") return null
|
|
55
|
+
const [base, variant] = value.split("#", 2)
|
|
56
|
+
const slash = base.indexOf("/")
|
|
57
|
+
if (slash <= 0 || slash === base.length - 1) return null
|
|
58
|
+
return {
|
|
59
|
+
providerID: base.slice(0, slash),
|
|
60
|
+
id: base.slice(slash + 1),
|
|
61
|
+
...(variant ? { variant } : {}),
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function messageExcerpt(messages) {
|
|
66
|
+
const value = Array.isArray(messages) ? messages.slice(-6) : messages
|
|
67
|
+
const text = JSON.stringify(value)
|
|
68
|
+
return text.length <= 24000 ? text : text.slice(-24000)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default Plugin.define({
|
|
72
|
+
id: "ues-router",
|
|
73
|
+
async setup(ctx) {
|
|
74
|
+
const projectRoot = ctx.location.project?.canonical || ctx.location.directory
|
|
75
|
+
const capabilities = runtimeCapabilities(ctx)
|
|
76
|
+
|
|
77
|
+
await ctx.tool.transform((editor) => {
|
|
78
|
+
editor.namespace({
|
|
79
|
+
name: "ues",
|
|
80
|
+
description: "UES long-horizon state, deterministic planning evidence, and fresh-context task execution.",
|
|
81
|
+
})
|
|
82
|
+
editor.add({
|
|
83
|
+
name: "capabilities",
|
|
84
|
+
description: "Report detected OpenCode runtime capabilities used by UES instead of assuming behavior from a version number.",
|
|
85
|
+
input: {
|
|
86
|
+
type: "object",
|
|
87
|
+
properties: {},
|
|
88
|
+
additionalProperties: false,
|
|
89
|
+
},
|
|
90
|
+
options: { namespace: "ues", codemode: true },
|
|
91
|
+
execute: async () => ({ content: JSON.stringify(capabilities, null, 2) }),
|
|
92
|
+
})
|
|
93
|
+
editor.add({
|
|
94
|
+
name: "task_policy",
|
|
95
|
+
description: "Classify an engineering request into inline, standard or long-horizon mode with risk/model/context guidance.",
|
|
96
|
+
input: {
|
|
97
|
+
type: "object",
|
|
98
|
+
properties: { text: { type: "string" } },
|
|
99
|
+
required: ["text"],
|
|
100
|
+
additionalProperties: false,
|
|
101
|
+
},
|
|
102
|
+
options: { namespace: "ues", codemode: true },
|
|
103
|
+
execute: async (input) => ({
|
|
104
|
+
content: runOcskill(["task-policy", input.text], projectRoot),
|
|
105
|
+
}),
|
|
106
|
+
})
|
|
107
|
+
editor.add({
|
|
108
|
+
name: "work_status",
|
|
109
|
+
description: "Read durable status for a UES .ues-work item without modifying it.",
|
|
110
|
+
input: {
|
|
111
|
+
type: "object",
|
|
112
|
+
properties: { slug: { type: "string" } },
|
|
113
|
+
required: ["slug"],
|
|
114
|
+
additionalProperties: false,
|
|
115
|
+
},
|
|
116
|
+
options: { namespace: "ues", codemode: true },
|
|
117
|
+
execute: async (input) => ({
|
|
118
|
+
content: runOcskill(["work", "status", input.slug, projectRoot], projectRoot),
|
|
119
|
+
}),
|
|
120
|
+
})
|
|
121
|
+
editor.add({
|
|
122
|
+
name: "task_graph",
|
|
123
|
+
description: "Validate a UES PLAN.json and compute dependency-safe execution waves.",
|
|
124
|
+
input: {
|
|
125
|
+
type: "object",
|
|
126
|
+
properties: { plan: { type: "string" } },
|
|
127
|
+
required: ["plan"],
|
|
128
|
+
additionalProperties: false,
|
|
129
|
+
},
|
|
130
|
+
options: { namespace: "ues", codemode: true },
|
|
131
|
+
execute: async (input) => ({
|
|
132
|
+
content: runOcskill(["task-graph", input.plan], projectRoot),
|
|
133
|
+
}),
|
|
134
|
+
})
|
|
135
|
+
editor.add({
|
|
136
|
+
name: "context_pack",
|
|
137
|
+
description: "Read the bounded durable context pack for one UES task executor.",
|
|
138
|
+
input: {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: {
|
|
141
|
+
slug: { type: "string" },
|
|
142
|
+
task: { type: "string" },
|
|
143
|
+
},
|
|
144
|
+
required: ["slug", "task"],
|
|
145
|
+
additionalProperties: false,
|
|
146
|
+
},
|
|
147
|
+
options: { namespace: "ues", codemode: true },
|
|
148
|
+
execute: async (input) => ({
|
|
149
|
+
content: runOcskill(["context-pack", input.slug, input.task, projectRoot], projectRoot),
|
|
150
|
+
}),
|
|
151
|
+
})
|
|
152
|
+
editor.add({
|
|
153
|
+
name: "dispatch_task",
|
|
154
|
+
description: "Start one approved UES task and execute it in a fresh ues-executor session, applying configured attempt-based model escalation when available. The parent must inspect the diff and record completion evidence separately.",
|
|
155
|
+
input: {
|
|
156
|
+
type: "object",
|
|
157
|
+
properties: {
|
|
158
|
+
slug: { type: "string" },
|
|
159
|
+
task: { type: "string" },
|
|
160
|
+
},
|
|
161
|
+
required: ["slug", "task"],
|
|
162
|
+
additionalProperties: false,
|
|
163
|
+
},
|
|
164
|
+
options: { namespace: "ues", codemode: true },
|
|
165
|
+
execute: async (input, tool) => {
|
|
166
|
+
if (!capabilities.freshDispatch) {
|
|
167
|
+
throw new Error("OpenCode runtime does not expose the fresh-session capabilities required by ues.dispatch_task")
|
|
168
|
+
}
|
|
169
|
+
await tool.progress({ status: "starting fresh UES executor" })
|
|
170
|
+
const started = runOcskillJSON(["work", "start", input.slug, input.task, projectRoot], projectRoot)
|
|
171
|
+
const attempt = started?.record?.attempts || 1
|
|
172
|
+
const runId = started?.record?.runId || null
|
|
173
|
+
const taskText = [
|
|
174
|
+
started?.contextPack?.task?.title,
|
|
175
|
+
started?.contextPack?.task?.summary,
|
|
176
|
+
...(started?.contextPack?.task?.acceptance || []),
|
|
177
|
+
].filter(Boolean).join(" ")
|
|
178
|
+
const taskPolicy = runOcskillJSON(["task-policy", taskText], projectRoot)
|
|
179
|
+
const policyArgs = ["model-policy", "executor", "--attempt", String(attempt)]
|
|
180
|
+
if (taskText) policyArgs.push("--text", taskText)
|
|
181
|
+
const policy = runOcskillJSON(policyArgs, projectRoot)
|
|
182
|
+
const heartbeatStarted = Date.now()
|
|
183
|
+
const heartbeat = setInterval(() => {
|
|
184
|
+
try {
|
|
185
|
+
const args = ["work", "heartbeat", input.slug, input.task, projectRoot]
|
|
186
|
+
if (runId) args.push("--run-id", runId)
|
|
187
|
+
runOcskill(args, projectRoot)
|
|
188
|
+
void tool.progress({ status: "executor running " + Math.round((Date.now() - heartbeatStarted) / 1000) + "s" })
|
|
189
|
+
} catch {}
|
|
190
|
+
}, 30_000)
|
|
191
|
+
|
|
192
|
+
try {
|
|
193
|
+
const created = await ctx.session.create({ title: "UES " + input.slug + " " + input.task })
|
|
194
|
+
await ctx.session.switchAgent({ sessionID: created.id, agent: "ues-executor" })
|
|
195
|
+
const selectedModel = modelRef(policy?.model)
|
|
196
|
+
if (selectedModel) {
|
|
197
|
+
await ctx.session.switchModel({ sessionID: created.id, model: selectedModel })
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
await ctx.session.prompt({
|
|
201
|
+
sessionID: created.id,
|
|
202
|
+
text:
|
|
203
|
+
"Implement exactly this approved UES task in the current repository. " +
|
|
204
|
+
"Do not broaden scope or launch child agents. Run the declared verification and return the executor report.\n\n" +
|
|
205
|
+
JSON.stringify(started.contextPack, null, 2),
|
|
206
|
+
})
|
|
207
|
+
await ctx.session.wait({ sessionID: created.id })
|
|
208
|
+
const messages = await ctx.session.context({ sessionID: created.id })
|
|
209
|
+
return {
|
|
210
|
+
content: JSON.stringify({
|
|
211
|
+
sessionID: created.id,
|
|
212
|
+
task: input.task,
|
|
213
|
+
attempt,
|
|
214
|
+
runId,
|
|
215
|
+
taskPolicy,
|
|
216
|
+
model: policy,
|
|
217
|
+
messages: messageExcerpt(messages),
|
|
218
|
+
next: "Inspect the child diff and verification, then call ocskill work complete or fail.",
|
|
219
|
+
}, null, 2),
|
|
220
|
+
}
|
|
221
|
+
} catch (error) {
|
|
222
|
+
try {
|
|
223
|
+
const failArgs = [
|
|
224
|
+
"work", "fail", input.slug, input.task, projectRoot,
|
|
225
|
+
"--reason", "fresh executor failed: " + String(error?.message || error),
|
|
226
|
+
]
|
|
227
|
+
if (runId) failArgs.push("--run-id", runId)
|
|
228
|
+
runOcskill(failArgs, projectRoot)
|
|
229
|
+
} catch {}
|
|
230
|
+
throw error
|
|
231
|
+
} finally {
|
|
232
|
+
clearInterval(heartbeat)
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
await ctx.session.hook("context", (event) => {
|
|
239
|
+
if (event.agent === "title" || event.agent === "summary" || event.agent === "compaction") return
|
|
240
|
+
event.system.push({
|
|
241
|
+
type: "text",
|
|
242
|
+
text: "UES V7 runtime: classify task complexity/risk, trust durable .ues-work state over conversation memory, use lease-backed fresh execution when supported, prefer structured verification receipts, recover stale work after interruption, and require integration evidence before completion.",
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
await ctx.session.hook("prompt", (event) => {
|
|
247
|
+
const config = routerConfig()
|
|
248
|
+
if (!config.enabled) return
|
|
249
|
+
|
|
250
|
+
const selected = routeSkills(event.prompt.text, config.maxSkills)
|
|
251
|
+
if (selected.length === 0) return
|
|
252
|
+
|
|
253
|
+
event.prompt.skills ??= []
|
|
254
|
+
if (!Array.isArray(event.prompt.skills)) return
|
|
255
|
+
|
|
256
|
+
for (const id of selected) {
|
|
257
|
+
if (!event.prompt.skills.includes(id)) event.prompt.skills.push(id)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
event.metadata = {
|
|
261
|
+
...event.metadata,
|
|
262
|
+
uesRouter: {
|
|
263
|
+
selected,
|
|
264
|
+
version: 3,
|
|
265
|
+
},
|
|
266
|
+
}
|
|
267
|
+
})
|
|
268
|
+
|
|
269
|
+
await ctx.permission.hook("evaluate", (event) => {
|
|
270
|
+
if (event.action !== "shell") return
|
|
271
|
+
const risk = destructiveShellRisk(event.resources.join("\n"))
|
|
272
|
+
if (!risk.risky) return
|
|
273
|
+
event.effect = "ask"
|
|
274
|
+
event.message = "UES safety gate: confirm destructive/high-impact shell action (" + risk.id + ")."
|
|
275
|
+
})
|
|
276
|
+
},
|
|
277
|
+
})
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
function add(list, id) {
|
|
2
|
+
if (!list.includes(id)) list.push(id)
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
const PROCESS_SKILLS = new Set([
|
|
6
|
+
"ues-engineering-orchestrator",
|
|
7
|
+
"ues-long-task-state",
|
|
8
|
+
"ues-task-planner",
|
|
9
|
+
"ues-bug-diagnosis",
|
|
10
|
+
"ues-research-verification",
|
|
11
|
+
"ues-repo-explorer",
|
|
12
|
+
])
|
|
13
|
+
|
|
14
|
+
export function routeSkills(text, maxSkills = 4) {
|
|
15
|
+
const value = String(text || "").toLowerCase()
|
|
16
|
+
const limit = Number.isInteger(maxSkills) ? Math.max(1, Math.min(maxSkills, 6)) : 4
|
|
17
|
+
const routed = []
|
|
18
|
+
const risky = /(migration|schema|database|sql|auth|permission|security|payment|webhook|public api|contract|dependency|deploy|ci|production|rollback)/
|
|
19
|
+
const nonTrivial = value.length > 220 || risky.test(value) || /(implement|feature|refactor|fix|debug|investigate|review|audit|bug|regression|failing|failure|error|exception|broken)/.test(value)
|
|
20
|
+
|
|
21
|
+
if (nonTrivial) add(routed, "ues-engineering-orchestrator")
|
|
22
|
+
const longHorizon = value.length > 700 || /(large task|big task|long[- ]running|multi[- ]file|cross[- ]module|whole (?:repo|repository|project)|entire (?:repo|repository|project)|full refactor|refactor all|migrate all|resume this work)/.test(value)
|
|
23
|
+
if (longHorizon) {
|
|
24
|
+
add(routed, "ues-engineering-orchestrator")
|
|
25
|
+
add(routed, "ues-long-task-state")
|
|
26
|
+
add(routed, "ues-task-planner")
|
|
27
|
+
}
|
|
28
|
+
if (/(\bfix\b|\bbug\b|crash|regression|failing|failure|error|exception|broken|\bdebug\b)/.test(value)) add(routed, "ues-bug-diagnosis")
|
|
29
|
+
if (/(latest|current docs|documentation|release notes|version compatibility|dependency|package version|api changed)/.test(value)) add(routed, "ues-research-verification")
|
|
30
|
+
|
|
31
|
+
if (/(react native|expo|android|ios|gradle|xcode|metro)/.test(value)) add(routed, "ues-react-native-engineering")
|
|
32
|
+
else if (/(next\.js|nextjs|app router|server component)/.test(value)) add(routed, "ues-nextjs-engineering")
|
|
33
|
+
else if (/(\breact\b|\bhook\b|useeffect|usestate|\bcomponent\b)/.test(value)) add(routed, "ues-react-engineering")
|
|
34
|
+
|
|
35
|
+
if (/(database|migration|sql|query|index|transaction|schema changes?)/.test(value)) {
|
|
36
|
+
add(routed, "ues-database-engineering")
|
|
37
|
+
add(routed, "ues-change-impact-analysis")
|
|
38
|
+
}
|
|
39
|
+
if (/(auth|authorization|authentication|permission|role|tenant|idor|token|session)/.test(value)) {
|
|
40
|
+
add(routed, "ues-auth-security")
|
|
41
|
+
add(routed, "ues-change-impact-analysis")
|
|
42
|
+
}
|
|
43
|
+
if (/(payment|checkout|webhook|refund|idempotenc)/.test(value)) {
|
|
44
|
+
add(routed, "ues-payment-engineering")
|
|
45
|
+
add(routed, "ues-change-impact-analysis")
|
|
46
|
+
}
|
|
47
|
+
if (/(api contract|openapi|response schema|request schema|breaking api|public api)/.test(value)) {
|
|
48
|
+
add(routed, "ues-api-contract")
|
|
49
|
+
add(routed, "ues-change-impact-analysis")
|
|
50
|
+
}
|
|
51
|
+
if (/(docker|github actions|ci\/cd|pipeline|deploy|kubernetes|container)/.test(value)) add(routed, "ues-devops-engineering")
|
|
52
|
+
if (/(performance|slow|latency|memory leak|n\+1|bundle size)/.test(value)) add(routed, "ues-performance-engineering")
|
|
53
|
+
if (/(accessibility|accessible|a11y|screen reader|keyboard navigation|aria|focus management|focus handling)/.test(value)) add(routed, "ues-accessibility")
|
|
54
|
+
if (/(upload|file upload|multipart|object storage)/.test(value)) add(routed, "ues-file-upload-engineering")
|
|
55
|
+
if (/(ecommerce|marketplace|inventory|cart|catalog|order)/.test(value)) add(routed, "ues-ecommerce-engineering")
|
|
56
|
+
|
|
57
|
+
if (routed.length === 0 && /(code|repository|repo|project|function|class|endpoint|test)/.test(value)) {
|
|
58
|
+
add(routed, "ues-repo-explorer")
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (routed.length > limit) {
|
|
62
|
+
const prioritized = []
|
|
63
|
+
const domain = []
|
|
64
|
+
const process = []
|
|
65
|
+
for (const id of routed) {
|
|
66
|
+
if (id === "ues-engineering-orchestrator") prioritized.push(id)
|
|
67
|
+
else if (PROCESS_SKILLS.has(id)) process.push(id)
|
|
68
|
+
else domain.push(id)
|
|
69
|
+
}
|
|
70
|
+
return prioritized.concat(domain, process).slice(0, limit)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return routed.slice(0, limit)
|
|
74
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const RULES = [
|
|
2
|
+
{ id: "git-force", pattern: /\bgit\s+(?:push\b[^\n]*(?:--force(?:-with-lease)?|(?:^|\s)-f(?:\s|$))|reset\s+--hard|clean\s+-[^\n]*f)/i },
|
|
3
|
+
{ id: "history-rewrite", pattern: /\bgit\s+(?:rebase\b|filter-branch\b|filter-repo\b)/i },
|
|
4
|
+
{ id: "publish", pattern: /\b(?:npm\s+publish|pnpm\s+publish|yarn\s+npm\s+publish)\b/i },
|
|
5
|
+
{ id: "destructive-files", pattern: /(?:^|[;&|]\s*)(?:rm\s+-[^\n]*r[^\n]*f|rmdir\s+\/s|del\s+\/s|remove-item\b[^\n]*-recurse[^\n]*-force)/i },
|
|
6
|
+
{ id: "database-drop", pattern: /\b(?:drop\s+(?:database|schema|table)|truncate\s+table)\b/i },
|
|
7
|
+
{ id: "deployment", pattern: /\b(?:kubectl\s+(?:delete|apply)|terraform\s+(?:apply|destroy)|helm\s+(?:install|upgrade|uninstall))\b/i },
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
export function destructiveShellRisk(command) {
|
|
11
|
+
const value = String(command || "")
|
|
12
|
+
for (const rule of RULES) {
|
|
13
|
+
if (rule.pattern.test(value)) return { risky: true, id: rule.id }
|
|
14
|
+
}
|
|
15
|
+
return { risky: false, id: null }
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: accessibility
|
|
3
|
+
description: Improve web/mobile accessibility including semantics, keyboard behavior, labels, focus, touch targets, and screen-reader usability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Accessibility
|
|
7
|
+
|
|
8
|
+
Check semantic elements/roles, labels, keyboard navigation, focus order/visibility, form errors, image alternatives, touch targets, dynamic content and reduced motion when relevant. Prefer native semantics over ARIA workarounds.
|
|
9
|
+
|
|
10
|
+
Read [workflow.md](references/workflow.md) when the task reaches domain-specific behavior, compatibility, failure, or verification boundaries.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Accessibility workflow
|
|
2
|
+
|
|
3
|
+
Start from the actual interaction and semantic tree, not visual appearance alone.
|
|
4
|
+
|
|
5
|
+
Check:
|
|
6
|
+
- native element/control semantics before adding ARIA
|
|
7
|
+
- accessible name, description, state and error association
|
|
8
|
+
- keyboard reachability, order, visible focus and escape from traps
|
|
9
|
+
- pointer/touch target size and equivalent keyboard behavior
|
|
10
|
+
- headings/landmarks and meaningful image alternatives
|
|
11
|
+
- live/dynamic updates that need status or alert semantics
|
|
12
|
+
- color contrast, zoom/reflow, reduced motion and text scaling
|
|
13
|
+
- modal focus entry/return and background inertness
|
|
14
|
+
|
|
15
|
+
For forms, connect labels, instructions, errors and invalid state to the exact field. Do not use placeholder text as the only label.
|
|
16
|
+
|
|
17
|
+
Verification should include keyboard-only flow and, when available, automated accessibility checks plus at least one screen-reader or accessibility-tree inspection for the changed path. Treat automated tools as partial evidence, not proof.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-contract
|
|
3
|
+
description: Keep frontend, backend, DTOs, schemas, generated clients, validation, status codes, serialization, pagination, and errors consistent end-to-end across producers and consumers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API Contract
|
|
7
|
+
|
|
8
|
+
Treat an API change as a producer/consumer contract, not only a handler edit.
|
|
9
|
+
|
|
10
|
+
Trace request -> validation -> handler/service -> persistence -> response serialization -> client/generated types -> UI/consumer. Compare method/path, params/query/body, required/optional/nullability, enums, status/error shapes, pagination and date/number serialization.
|
|
11
|
+
|
|
12
|
+
Read [workflow.md](references/workflow.md) for compatibility analysis, source-of-truth selection, generated clients, error semantics and contract verification.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# API contract workflow
|
|
2
|
+
|
|
3
|
+
Identify the contract source of truth: OpenAPI/schema/protobuf/generated types/server DTOs or repository convention. Do not create a second conflicting truth.
|
|
4
|
+
|
|
5
|
+
Before editing, map all known producers and consumers. Classify each field/change:
|
|
6
|
+
- additive optional
|
|
7
|
+
- additive required
|
|
8
|
+
- rename/remove
|
|
9
|
+
- type/nullability/enum change
|
|
10
|
+
- semantic change with same type
|
|
11
|
+
- status/error/pagination change
|
|
12
|
+
|
|
13
|
+
Backward compatibility depends on consumer behavior, not only type compatibility. A new enum value can break exhaustive clients; changing null to missing can break serializers; changing 404 to 200-empty can alter control flow.
|
|
14
|
+
|
|
15
|
+
Update generated clients through the repository's generator rather than hand-editing generated files.
|
|
16
|
+
|
|
17
|
+
Verification should cover provider validation/serialization and at least one real consumer or contract test. Test error/status shapes and boundary serialization, not only the success body.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auth-security
|
|
3
|
+
description: Implement and review authentication, authorization, sessions, tokens, passwords, permissions, roles, secrets, and security-sensitive APIs with server-side enforcement.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Auth Security
|
|
7
|
+
|
|
8
|
+
Separate authentication (who) from authorization (may do what). Identify the trust boundary and enforce permissions on the server for every protected object/action; UI hiding is never authorization.
|
|
9
|
+
|
|
10
|
+
Inspect session/token creation, validation, rotation/revocation, expiry, password storage, cookies/CSRF/CORS, object-level access, redirects, secrets and error leakage as relevant to the stack.
|
|
11
|
+
|
|
12
|
+
Read [workflow.md](references/workflow.md) for threat questions, IDOR/object ownership, session/token invariants, web cookie controls, and negative verification.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Auth/security workflow
|
|
2
|
+
|
|
3
|
+
Map: credential/session source -> authentication middleware -> identity -> authorization policy -> protected resource/action.
|
|
4
|
+
|
|
5
|
+
Ask:
|
|
6
|
+
- Can an unauthenticated caller reach the action?
|
|
7
|
+
- Can an authenticated user change an identifier and access another user's object (IDOR)?
|
|
8
|
+
- Is role/tenant/resource ownership checked at the server boundary that performs the action?
|
|
9
|
+
- Are token/session expiry, revocation, rotation and replay properties consistent with the design?
|
|
10
|
+
- For cookie auth, are Secure/HttpOnly/SameSite and CSRF protections appropriate to the request model?
|
|
11
|
+
- Are CORS and redirect allowlists narrowly scoped?
|
|
12
|
+
- Are password hashes using the project's approved adaptive algorithm/settings?
|
|
13
|
+
- Can logs/errors expose credentials, tokens or sensitive data?
|
|
14
|
+
|
|
15
|
+
Verification must include negative cases: missing auth, wrong role/tenant/owner, expired/revoked session/token and malformed input where relevant. Do not weaken controls to make tests or local development pass.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bug-diagnosis
|
|
3
|
+
description: Diagnose runtime errors, build failures, regressions, failing tests, integration issues, crashes, and incorrect behavior through reproducible evidence and root-cause hypotheses before fixing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bug Diagnosis
|
|
7
|
+
|
|
8
|
+
Do not patch the first visible symptom.
|
|
9
|
+
|
|
10
|
+
## 1. Establish the failure
|
|
11
|
+
|
|
12
|
+
Capture the exact error, failing command, reproduction steps, environment/version clues, and recent relevant diff. If the issue is intermittent, gather enough evidence to identify the changing condition.
|
|
13
|
+
|
|
14
|
+
## 2. Trace cause
|
|
15
|
+
|
|
16
|
+
Find where the bad value/state first becomes wrong. In multi-component flows, inspect boundaries one at a time: input, output, configuration, ownership, and assumptions. Find a nearby working analogue and compare meaningful differences.
|
|
17
|
+
|
|
18
|
+
## 3. Test one hypothesis
|
|
19
|
+
|
|
20
|
+
State one causal hypothesis and why the evidence supports it. Make the smallest diagnostic or code change that can confirm/refute it. Do not bundle multiple speculative fixes.
|
|
21
|
+
|
|
22
|
+
## 4. Fix and prove
|
|
23
|
+
|
|
24
|
+
When practical, add a focused failing regression test or reproduction. Fix the earliest supported cause, rerun the exact failure, then run adjacent checks.
|
|
25
|
+
|
|
26
|
+
If two fixes fail, stop stacking changes and restart the investigation from fresh evidence. If three distinct hypotheses fail or the fixes expose widening coupling, surface the architectural assumption before another broad edit.
|
|
27
|
+
|
|
28
|
+
Never use cache clearing, lockfile deletion, disabled checks, or dependency upgrades as generic debugging rituals without evidence.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: change-impact-analysis
|
|
3
|
+
description: Map the blast radius of cross-module, public-contract, schema, auth, payment, migration, or shared-library changes before editing and before final review.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Change Impact Analysis
|
|
7
|
+
|
|
8
|
+
For changes that cross a boundary, identify both producers and consumers. If `ocskill` is available, use `ocskill impact <term>` as a bounded evidence pass, then validate important matches with exact repository reads/callers.
|
|
9
|
+
|
|
10
|
+
Map:
|
|
11
|
+
- entry point and changed contract
|
|
12
|
+
- direct callers/importers/clients
|
|
13
|
+
- persisted data or schema assumptions
|
|
14
|
+
- validation/error behavior
|
|
15
|
+
- configuration/environment dependencies
|
|
16
|
+
- tests/fixtures/mocks
|
|
17
|
+
- generated code or documentation
|
|
18
|
+
- compatibility, migration, and rollback concerns
|
|
19
|
+
|
|
20
|
+
Before editing, identify the smallest safe boundary for the change.
|
|
21
|
+
After editing, inspect the diff and re-run the map: confirm every affected consumer was either updated, proven compatible, or explicitly left unchanged for a reason.
|
|
22
|
+
|
|
23
|
+
Do not infer "no impact" merely because compilation succeeds.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Review changed code for real defects and regressions with context-aware evidence, prioritizing correctness, data loss, security, contracts, state/races, performance, and missing verification over style noise.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
Review the actual diff and enough surrounding context to validate each finding.
|
|
9
|
+
|
|
10
|
+
Prioritize:
|
|
11
|
+
1. correctness, data loss, and broken invariants
|
|
12
|
+
2. security, authentication, and permission boundaries
|
|
13
|
+
3. API, schema, type, and compatibility mismatches
|
|
14
|
+
4. error handling, edge cases, races, and state bugs
|
|
15
|
+
5. plausible performance regressions
|
|
16
|
+
6. maintainability problems that create concrete risk
|
|
17
|
+
7. missing or misleading verification
|
|
18
|
+
|
|
19
|
+
For each material finding include the location, evidence, impact, and a practical fix direction. Distinguish confirmed defects from risks or uncertainty. Check callers or contracts before asserting an issue. Prefer a few high-signal findings over speculative volume. Do not nitpick formatting already enforced by tooling.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-engineering
|
|
3
|
+
description: Control context in large or unfamiliar repositories by building a compact evidence map, reading only relevant interfaces and analogues, and avoiding repeated low-value file loading.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Context Engineering
|
|
7
|
+
|
|
8
|
+
Build a working set instead of reading the repository indiscriminately.
|
|
9
|
+
|
|
10
|
+
1. Read applicable instructions and manifests.
|
|
11
|
+
2. Locate the task entry point and exact symbols/errors involved.
|
|
12
|
+
3. Find the nearest working analogue before inventing a new pattern.
|
|
13
|
+
4. Trace only direct callers, dependencies, contracts, tests, and configuration needed to explain the behavior.
|
|
14
|
+
5. Summarize findings as paths, interfaces, constraints, and open questions before expanding scope.
|
|
15
|
+
6. Prefer targeted search and line ranges over whole-tree dumps.
|
|
16
|
+
7. Reuse established findings; do not reread large unchanged files without a reason.
|
|
17
|
+
|
|
18
|
+
For monorepos or deep dependency graphs, read [large-repo.md](references/large-repo.md).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Large repository strategy
|
|
2
|
+
|
|
3
|
+
Start with a compact map:
|
|
4
|
+
|
|
5
|
+
- repository instructions
|
|
6
|
+
- package/workspace manifests
|
|
7
|
+
- package containing the entry point
|
|
8
|
+
- direct dependency packages
|
|
9
|
+
- nearest analogous implementation
|
|
10
|
+
- relevant tests and build scripts
|
|
11
|
+
|
|
12
|
+
Then follow edges only when evidence requires it.
|
|
13
|
+
|
|
14
|
+
Prefer interface boundaries (types, public functions, route/service contracts, schemas) over implementation detail until a boundary is implicated. When a search returns many matches, narrow by package/import/caller rather than opening every result.
|
|
15
|
+
|
|
16
|
+
Before a major new read, ask: what uncertainty will this file resolve? If the answer is unclear, do not load it yet.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-engineering
|
|
3
|
+
description: Design and modify schemas, migrations, indexes, queries, ORM models, transactions, and data integrity with compatibility, rollback, and existing-data safety.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Database Engineering
|
|
7
|
+
|
|
8
|
+
Inspect the actual database/ORM, migration history, production-relevant query patterns, and existing data assumptions before editing.
|
|
9
|
+
|
|
10
|
+
Treat schema constraints, nullability/defaults, foreign keys/cascades, uniqueness, transactions, locking/concurrency, indexes, migration ordering, data backfill and rollback as explicit invariants. Do not infer migration safety from compilation.
|
|
11
|
+
|
|
12
|
+
Read [workflow.md](references/workflow.md) for expand/contract migrations, query/index analysis, transaction boundaries, data backfills, and verification.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Database engineering workflow
|
|
2
|
+
|
|
3
|
+
## Schema change
|
|
4
|
+
Map old readers/writers and new readers/writers. For live systems prefer compatible expand -> backfill -> switch -> contract sequencing when one-step migration could break mixed versions.
|
|
5
|
+
|
|
6
|
+
Check existing rows before adding NOT NULL/unique/foreign-key constraints. Separate schema migration from expensive data backfill when operational risk warrants it.
|
|
7
|
+
|
|
8
|
+
## Queries and indexes
|
|
9
|
+
Use real filter/join/order patterns. An index should support an observed query shape; avoid speculative indexes. Watch N+1 ORM access, full-table scans, unbounded result sets and lock amplification.
|
|
10
|
+
|
|
11
|
+
## Transactions
|
|
12
|
+
Define the invariant and the smallest atomic boundary. Consider retries, unique conflicts, lost updates, isolation behavior and external side effects that cannot roll back with the database.
|
|
13
|
+
|
|
14
|
+
## Verification
|
|
15
|
+
Validate migration up/down strategy when supported, run affected data tests, and inspect generated SQL/schema diff. For risky changes use representative existing data or a dry run. Confirm old/new application compatibility when rollout can overlap.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dependency-management
|
|
3
|
+
description: Change dependencies safely by verifying package legitimacy, pinned/current compatibility, peer/runtime constraints, release guidance, lockfiles, supply-chain surface, and the smallest necessary version movement.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dependency Management
|
|
7
|
+
|
|
8
|
+
Identify package manager, lockfile, runtime/framework versions and the concrete reason a dependency change is needed.
|
|
9
|
+
|
|
10
|
+
Verify package identity and the intended version using registry/primary sources when current information matters. Prefer the smallest compatible movement, read migration guidance for behavior-changing upgrades, and avoid opportunistic dependency churn.
|
|
11
|
+
|
|
12
|
+
Read [workflow.md](references/workflow.md) for compatibility evidence, lockfile discipline, transitive/supply-chain impact and verification.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Dependency management workflow
|
|
2
|
+
|
|
3
|
+
Before adding/upgrading:
|
|
4
|
+
- confirm the package name is legitimate and maintained enough for the use case
|
|
5
|
+
- inspect repository runtime/framework constraints
|
|
6
|
+
- check peer dependencies, engines and platform/native requirements
|
|
7
|
+
- compare current -> target release notes/migration guide for breaking or behavior changes
|
|
8
|
+
- identify whether the change is direct or only needed transitively
|
|
9
|
+
|
|
10
|
+
Use the repository package manager to update manifests/lockfiles; do not hand-edit lock resolution unless the ecosystem requires it.
|
|
11
|
+
|
|
12
|
+
For major upgrades, map deprecated APIs and affected imports/config before changing the version. Keep unrelated packages stable.
|
|
13
|
+
|
|
14
|
+
Verification should include a clean/locked install or package-manager resolution check, affected tests/build/typecheck, and runtime smoke for behavior-sensitive upgrades. If a security advisory motivates the change, verify the fixed version range from a primary advisory/registry source rather than guessing.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devops-engineering
|
|
3
|
+
description: Work on Docker, CI/CD, build pipelines, environment config, deployment, health checks, logging, and infrastructure-related files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Devops Engineering
|
|
7
|
+
|
|
8
|
+
Inspect current deployment/runtime assumptions. Check reproducible builds, secrets, health/readiness, build caching, CI visibility, migration ordering, rollback and environment parity. Do not deploy production or rotate secrets without explicit intent.
|
|
9
|
+
|
|
10
|
+
Read [workflow.md](references/workflow.md) when the task reaches domain-specific behavior, compatibility, failure, or verification boundaries.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# DevOps engineering workflow
|
|
2
|
+
|
|
3
|
+
Map source -> build artifact -> deploy unit -> runtime dependencies -> health signal -> rollback path.
|
|
4
|
+
|
|
5
|
+
For containers, inspect build context, multi-stage boundaries, pinned base/runtime versions, non-root execution when practical, signal handling, health checks, secret injection and cache-invalidating COPY order.
|
|
6
|
+
|
|
7
|
+
For CI, compare local and runner OS/runtime/tool versions, environment variables, working directories, permissions, caches, artifacts and service dependencies. Diagnose the first failing step rather than rewriting the pipeline broadly.
|
|
8
|
+
|
|
9
|
+
For deployments, separate build-time from runtime configuration, sequence schema migrations safely, define readiness before traffic, preserve old/new compatibility during rolling changes, and keep rollback independent of destructive data changes.
|
|
10
|
+
|
|
11
|
+
Verification should validate configuration syntax, run the closest representative build/job locally when possible, inspect produced artifacts, and exercise health/readiness/failure behavior. Never print or commit secrets.
|