Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 55 additions & 55 deletions .agents/skills/better-logging/references/runtime-patterns-electron.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,57 @@ Wrap the entrypoint once, enrich inside the operation, and finalize in `finally`

```ts
type OperationOutcome = {
appVersion: string
actor?: { idHash?: string | undefined; type: string } | undefined
completedAt?: string | undefined
correlationId?: string | undefined
durationMs?: number | undefined
environment: 'development' | 'preview' | 'production'
errorCode?: null | string | undefined
errorMessage?: null | string | undefined
gitCommit?: string | undefined
metrics?: Record<string, number> | undefined
operationId: string
operationName: string
appVersion: string;
actor?: { idHash?: string | undefined; type: string } | undefined;
completedAt?: string | undefined;
correlationId?: string | undefined;
durationMs?: number | undefined;
environment: "development" | "preview" | "production";
errorCode?: null | string | undefined;
errorMessage?: null | string | undefined;
gitCommit?: string | undefined;
metrics?: Record<string, number> | undefined;
operationId: string;
operationName: string;
operationType:
| 'ipc_command'
| 'trpc_mutation'
| 'trpc_query'
| 'background_job'
| 'startup_step'
| 'queue_consumer'
resource?: { id?: string | undefined; type: string } | undefined
retryCount: number
rollout?: Record<string, boolean | number | string> | undefined
sessionId?: string | undefined
startedAt: string
statusCode?: number | undefined
success: boolean
trigger?: 'manual' | 'startup' | 'background' | 'retry' | 'auto' | undefined
}
| "ipc_command"
| "trpc_mutation"
| "trpc_query"
| "background_job"
| "startup_step"
| "queue_consumer";
resource?: { id?: string | undefined; type: string } | undefined;
retryCount: number;
rollout?: Record<string, boolean | number | string> | undefined;
sessionId?: string | undefined;
startedAt: string;
statusCode?: number | undefined;
success: boolean;
trigger?: "manual" | "startup" | "background" | "retry" | "auto" | undefined;
};

type OperationOutcomeSeed = Omit<
OperationOutcome,
| 'completedAt'
| 'durationMs'
| 'errorCode'
| 'errorMessage'
| 'operationId'
| 'startedAt'
| 'success'
>
| "completedAt"
| "durationMs"
| "errorCode"
| "errorMessage"
| "operationId"
| "startedAt"
| "success"
>;

// Put these helpers in one shared file such as src/backend/lib/outcome.ts.
const classifyError = (error: unknown): string => {
// Classify domain errors before they reach this function.
// Returning error.name is a last-resort fallback; prefer stable codes
// like "update_feed_http_404" at the call site when possible.
return error instanceof Error ? error.name : 'unknown_error'
}
return error instanceof Error ? error.name : "unknown_error";
};

const formatErrorMessage = (error: unknown): string => {
return error instanceof Error ? error.message : 'Unknown error'
}
return error instanceof Error ? error.message : "Unknown error";
};

// Keep camelCase in memory and map to storage casing at the persistence boundary.
const toStoredOutcome = (outcome: OperationOutcome) => ({
Expand All @@ -92,43 +92,43 @@ const toStoredOutcome = (outcome: OperationOutcome) => ({
success: outcome.success,
trigger: outcome.trigger,
actor: outcome.actor,
})
});

const persistOutcome = async (outcome: OperationOutcome): Promise<void> => {
// Replace this with a Prisma, SQLite, or analytics-sink write in your app.
// Example: await prisma.operationOutcome.create({ data: toStoredOutcome(outcome) })
void outcome
}
void outcome;
};

const withOutcome = async <T>(
seed: OperationOutcomeSeed,
run: (outcome: OperationOutcome) => Promise<T>,
): Promise<T> => {
const startMs = Date.now()
const startMs = Date.now();
const outcome: OperationOutcome = {
...seed,
operationId: crypto.randomUUID(),
startedAt: new Date(startMs).toISOString(),
errorCode: null,
success: false,
}
};

try {
const result = await run(outcome)
outcome.success = true
return result
const result = await run(outcome);
outcome.success = true;
return result;
} catch (error) {
outcome.errorCode = classifyError(error)
outcome.errorMessage = formatErrorMessage(error)
throw error
outcome.errorCode = classifyError(error);
outcome.errorMessage = formatErrorMessage(error);
throw error;
} finally {
outcome.completedAt = new Date().toISOString()
outcome.durationMs = Date.now() - startMs
outcome.completedAt = new Date().toISOString();
outcome.durationMs = Date.now() - startMs;
await persistOutcome(outcome).catch((persistError: unknown) => {
console.error('[outcome] failed to persist outcome', persistError)
})
console.error("[outcome] failed to persist outcome", persistError);
});
}
}
};
```

If your store supports camelCase cleanly, standardize on camelCase end-to-end instead of mapping. The important rule is one casing per layer, not a forced snake_case database.
Expand Down
126 changes: 63 additions & 63 deletions .agents/skills/better-logging/references/runtime-patterns-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,105 +8,105 @@ Instrument one outcome per request or per important handler.

```ts
type OperationOutcome = {
appVersion: string
actor?: { idHash?: string | undefined; type: string } | undefined
completedAt?: string | undefined
correlationId?: string | undefined
durationMs?: number | undefined
environment: 'development' | 'preview' | 'production' | string
errorCode?: null | string | undefined
errorMessage?: null | string | undefined
gitCommit?: string | undefined
metrics?: Record<string, number> | undefined
operationId: string
operationName: string
operationType: 'http_request' | 'queue_consumer' | 'cron_run'
resource?: { id?: string | undefined; type: string } | undefined
retryCount: number
rollout?: Record<string, boolean | number | string> | undefined
sessionId?: string | undefined
startedAt: string
statusCode?: number | undefined
success: boolean
trigger?: 'manual' | 'startup' | 'background' | 'retry' | 'auto' | undefined
}
appVersion: string;
actor?: { idHash?: string | undefined; type: string } | undefined;
completedAt?: string | undefined;
correlationId?: string | undefined;
durationMs?: number | undefined;
environment: "development" | "preview" | "production" | string;
errorCode?: null | string | undefined;
errorMessage?: null | string | undefined;
gitCommit?: string | undefined;
metrics?: Record<string, number> | undefined;
operationId: string;
operationName: string;
operationType: "http_request" | "queue_consumer" | "cron_run";
resource?: { id?: string | undefined; type: string } | undefined;
retryCount: number;
rollout?: Record<string, boolean | number | string> | undefined;
sessionId?: string | undefined;
startedAt: string;
statusCode?: number | undefined;
success: boolean;
trigger?: "manual" | "startup" | "background" | "retry" | "auto" | undefined;
};

const startOutcome = (
startMs: number,
seed: Omit<
OperationOutcome,
| 'completedAt'
| 'durationMs'
| 'errorCode'
| 'errorMessage'
| 'operationId'
| 'startedAt'
| 'statusCode'
| 'success'
| "completedAt"
| "durationMs"
| "errorCode"
| "errorMessage"
| "operationId"
| "startedAt"
| "statusCode"
| "success"
>,
): OperationOutcome => ({
...seed,
errorCode: null,
operationId: crypto.randomUUID(),
startedAt: new Date(startMs).toISOString(),
success: false,
})
});

const classifyError = (error: unknown): string => {
// Classify domain errors before they reach this function.
// Returning error.name is a last-resort fallback; prefer stable codes
// like "checkout_card_declined" at the call site when possible.
return error instanceof Error ? error.name : 'unknown_error'
}
return error instanceof Error ? error.name : "unknown_error";
};

const formatErrorMessage = (error: unknown): string => {
return error instanceof Error ? error.message : 'Unknown error'
}
return error instanceof Error ? error.message : "Unknown error";
};

const inferStatusCode = (error: unknown): number => {
return error instanceof Error && 'statusCode' in error && typeof error.statusCode === 'number'
return error instanceof Error && "statusCode" in error && typeof error.statusCode === "number"
? error.statusCode
: 500
}
: 500;
};

// Put these helpers in a shared file such as src/lib/outcome.ts.
const persistOutcome = async (outcome: OperationOutcome): Promise<void> => {
void outcome
void outcome;
// Replace this with your real DB or analytics write.
}
};

app.post('/checkout', async (req, res, next) => {
const startMs = Date.now()
const requestId = req.headers['x-request-id']
app.post("/checkout", async (req, res, next) => {
const startMs = Date.now();
const requestId = req.headers["x-request-id"];
const outcome = startOutcome(startMs, {
appVersion: process.env.APP_VERSION ?? 'dev',
appVersion: process.env.APP_VERSION ?? "dev",
correlationId: Array.isArray(requestId) ? requestId[0] : requestId,
environment: process.env.NODE_ENV ?? 'development',
operationName: 'checkout.submit',
operationType: 'http_request',
environment: process.env.NODE_ENV ?? "development",
operationName: "checkout.submit",
operationType: "http_request",
retryCount: 0,
trigger: 'manual',
})
trigger: "manual",
});

try {
const result = await runCheckout(req, outcome)
outcome.success = true
outcome.statusCode = 200
res.json(result)
const result = await runCheckout(req, outcome);
outcome.success = true;
outcome.statusCode = 200;
res.json(result);
} catch (error) {
outcome.success = false
outcome.errorCode = classifyError(error)
outcome.errorMessage = formatErrorMessage(error)
outcome.statusCode = inferStatusCode(error)
next(error)
outcome.success = false;
outcome.errorCode = classifyError(error);
outcome.errorMessage = formatErrorMessage(error);
outcome.statusCode = inferStatusCode(error);
next(error);
} finally {
outcome.completedAt = new Date().toISOString()
outcome.durationMs = Date.now() - startMs
outcome.completedAt = new Date().toISOString();
outcome.durationMs = Date.now() - startMs;
await persistOutcome(outcome).catch((persistError: unknown) => {
console.error('[outcome] failed to persist outcome', persistError)
})
console.error("[outcome] failed to persist outcome", persistError);
});
}
})
});
```

## Queues and Workers
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/conductor-setup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Use this skill when configuring a repository for Conductor workspaces. When invo
- `references/settings-and-migration.md` for settings layers, schemas, supported repository fields, or `conductor.json` migration.
- `references/scripts-and-environment.md` for setup/run/archive scripts, shells, variables, concurrency, Spotlight, or caches.
- `references/files-layouts-and-troubleshooting.md` for Files to copy, `.worktreeinclude`, monorepos, linked repositories, MCP/privacy, or diagnosis.
Read more than one only when the task crosses those concerns.
Read more than one only when the task crosses those concerns.
3. Apply the selected reference's documented contract. Prefer team settings over machine-local configuration; preserve an existing deliberate script layout; use Conductor variables instead of hard-coded workspace paths, resources, and local ports.
4. Keep secrets and machine-specific credentials out of committed settings. Change MCP/privacy configuration only when asked or required by repository policy.
5. Validate TOML and run the narrowest relevant check for every script changed. Report when the existing setup already satisfies the requested outcome.
Expand Down
21 changes: 21 additions & 0 deletions .agents/skills/create-readme/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: create-readme
description: 'Create a README.md file for the project'
---

## Role

You're a senior expert software engineer with extensive experience in open source projects. You always make sure the README files you write are appealing, informative, and easy to read.

## Task

1. Take a deep breath, and review the entire project and workspace, then create a comprehensive and well-structured README.md file for the project.
2. Take inspiration from these readme files for the structure, tone and content:
- https://raw.githubusercontent.com/Azure-Samples/serverless-chat-langchainjs/refs/heads/main/README.md
- https://raw.githubusercontent.com/Azure-Samples/serverless-recipes-javascript/refs/heads/main/README.md
- https://raw.githubusercontent.com/sinedied/run-on-output/refs/heads/main/README.md
- https://raw.githubusercontent.com/sinedied/smoke/refs/heads/main/README.md
3. Do not overuse emojis, and keep the readme concise and to the point.
4. Do not include sections like "LICENSE", "CONTRIBUTING", "CHANGELOG", etc. There are dedicated files for those sections.
5. Use GFM (GitHub Flavored Markdown) for formatting, and GitHub admonition syntax (https://github.com/orgs/community/discussions/16925) where appropriate.
6. If you find a logo or icon for the project, use it in the readme's header.
Loading
Loading