oh-my-customcode 0.51.0 → 0.51.1
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/README.md +2 -2
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/CLAUDE.md +1 -1
- package/templates/guides/drizzle-orm/README.md +69 -0
- package/templates/manifest.json +2 -2
package/README.md
CHANGED
|
@@ -228,7 +228,7 @@ Key rules: R010 (orchestrator never writes files), R009 (parallel execution mand
|
|
|
228
228
|
|
|
229
229
|
---
|
|
230
230
|
|
|
231
|
-
### Guides (
|
|
231
|
+
### Guides (30)
|
|
232
232
|
|
|
233
233
|
Reference documentation covering best practices, architecture decisions, and integration patterns. Located in `guides/` at project root, covering topics from agent design to CI/CD to observability.
|
|
234
234
|
|
|
@@ -281,7 +281,7 @@ your-project/
|
|
|
281
281
|
│ ├── specs/ # Extracted canonical specs
|
|
282
282
|
│ ├── contexts/ # 4 shared context files
|
|
283
283
|
│ └── ontology/ # Knowledge graph for RAG
|
|
284
|
-
└── guides/ #
|
|
284
|
+
└── guides/ # 30 reference documents
|
|
285
285
|
```
|
|
286
286
|
|
|
287
287
|
---
|
package/dist/cli/index.js
CHANGED
|
@@ -9323,7 +9323,7 @@ var init_package = __esm(() => {
|
|
|
9323
9323
|
package_default = {
|
|
9324
9324
|
name: "oh-my-customcode",
|
|
9325
9325
|
workspaces: ["packages/*"],
|
|
9326
|
-
version: "0.51.
|
|
9326
|
+
version: "0.51.1",
|
|
9327
9327
|
description: "Batteries-included agent harness for Claude Code",
|
|
9328
9328
|
type: "module",
|
|
9329
9329
|
bin: {
|
package/dist/index.js
CHANGED
|
@@ -1668,7 +1668,7 @@ import { join as join6 } from "node:path";
|
|
|
1668
1668
|
var package_default = {
|
|
1669
1669
|
name: "oh-my-customcode",
|
|
1670
1670
|
workspaces: ["packages/*"],
|
|
1671
|
-
version: "0.51.
|
|
1671
|
+
version: "0.51.1",
|
|
1672
1672
|
description: "Batteries-included agent harness for Claude Code",
|
|
1673
1673
|
type: "module",
|
|
1674
1674
|
bin: {
|
package/package.json
CHANGED
package/templates/CLAUDE.md
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Drizzle ORM: sql Template Literal Pitfalls
|
|
2
|
+
|
|
3
|
+
## The Bug: Column References in Subqueries
|
|
4
|
+
|
|
5
|
+
When using Drizzle ORM's `sql` template literals, `${table.column}` generates a **bare column name without the table qualifier**. This causes silent semantic errors inside aliased subqueries.
|
|
6
|
+
|
|
7
|
+
### Symptom
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
// Code
|
|
11
|
+
sql`SELECT ${agentInvocations.errorSummary} as sub_es
|
|
12
|
+
FROM ${agentInvocations} AS ai2
|
|
13
|
+
WHERE ai2.agent_type = ${agentInvocations.agentType}`
|
|
14
|
+
|
|
15
|
+
// Generated SQL (WRONG)
|
|
16
|
+
SELECT "error_summary" as sub_es
|
|
17
|
+
FROM "agent_invocations" AS ai2
|
|
18
|
+
WHERE ai2.agent_type = "agent_type" -- "agent_type" becomes a literal string, always true!
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`${agentInvocations.agentType}` expands to the **quoted column name** `"agent_type"` — not the value of the column. The `WHERE` clause compares `ai2.agent_type = "agent_type"`, which SQLite treats as a string literal match — always true for rows where `agent_type` equals the string `"agent_type"`.
|
|
22
|
+
|
|
23
|
+
### Why Reviewers Miss It
|
|
24
|
+
|
|
25
|
+
- The code *looks* correct — you see `agentInvocations.agentType` and assume it's a column reference.
|
|
26
|
+
- Drizzle's `${table.column}` syntax works fine in top-level queries where table context is unambiguous.
|
|
27
|
+
- The bug only manifests inside subqueries with table aliases (`AS ai2`) — normal queries pass.
|
|
28
|
+
- No compile-time error; the SQL executes but returns wrong results.
|
|
29
|
+
|
|
30
|
+
## The Fix: Raw SQL for Subquery Internal References
|
|
31
|
+
|
|
32
|
+
Use raw SQL strings for column references *inside* aliased subqueries. Reserve `${table.column}` only for Drizzle's top-level query builder where it resolves correctly.
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// CORRECT: raw SQL column references inside aliased subquery
|
|
36
|
+
sql`SELECT ai2.error_summary as sub_es
|
|
37
|
+
FROM ${agentInvocations} AS ai2
|
|
38
|
+
WHERE ai2.agent_type = ${agentInvocations}.agent_type`
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Note: `${agentInvocations}` (the table object itself) still correctly expands to the table name and is safe to use for the `FROM` clause. Only *column* references inside subqueries must be written as raw SQL.
|
|
42
|
+
|
|
43
|
+
## Decision Table
|
|
44
|
+
|
|
45
|
+
| Context | Pattern | Safe? |
|
|
46
|
+
|---------|---------|-------|
|
|
47
|
+
| Top-level `FROM` clause | `${table}` | ✅ Yes |
|
|
48
|
+
| Top-level `WHERE` with parameterized value | `${value}` | ✅ Yes (auto-parameterized) |
|
|
49
|
+
| Top-level `SELECT` column | `${table.column}` | ✅ Yes |
|
|
50
|
+
| Inside aliased subquery `SELECT` | `${table.column}` | ❌ No — bare column name |
|
|
51
|
+
| Inside aliased subquery `WHERE` comparison | `${table.column}` | ❌ No — string literal, not column ref |
|
|
52
|
+
| Inside aliased subquery (fixed) | `alias.column_name` | ✅ Yes |
|
|
53
|
+
|
|
54
|
+
## Verification
|
|
55
|
+
|
|
56
|
+
Use `.toSQL()` to inspect generated SQL before running:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
const query = sql`SELECT ${agentInvocations.errorSummary} as sub_es
|
|
60
|
+
FROM ${agentInvocations} AS ai2
|
|
61
|
+
WHERE ai2.agent_type = ${agentInvocations.agentType}`
|
|
62
|
+
|
|
63
|
+
console.log(query.toSQL())
|
|
64
|
+
// Reveals the bare column names — catches the bug before runtime
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Key Takeaway
|
|
68
|
+
|
|
69
|
+
> **`${table.column}` in Drizzle's `sql` template generates a bare column identifier, not a qualified reference.** Inside aliased subqueries, this breaks table-qualified comparisons. Always use raw `alias.column_name` strings inside subquery bodies.
|
package/templates/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.51.
|
|
2
|
+
"version": "0.51.1",
|
|
3
3
|
"lastUpdated": "2026-03-16T00:00:00.000Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"name": "guides",
|
|
25
25
|
"path": "guides",
|
|
26
26
|
"description": "Reference documentation",
|
|
27
|
-
"files":
|
|
27
|
+
"files": 30
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"name": "hooks",
|