Skip to content

Commit 4e16ec8

Browse files
committed
update docs
1 parent 22088ce commit 4e16ec8

File tree

4 files changed

+77
-5
lines changed

4 files changed

+77
-5
lines changed

.claude/CLAUDE.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,69 @@
22

33
All guidance for working with this repository is in this single file.
44

5+
## Workflow
6+
7+
### Alignment Before Action
8+
- For non-trivial tasks, do not jump straight into implementation. First summarize:
9+
(1) your understanding of the problem, (2) the proposed approach, (3) key trade-offs or risks.
10+
Keep this short (a few sentences, not an essay). Wait for confirmation before proceeding.
11+
- **Act autonomously on clear bugs**: When the bug has a clear reproduction (failing test, error
12+
log, stack trace), go fix it — don't ask the user to guide each step. Still follow: write a
13+
failing test first, then fix, then validate. The alignment rule above still applies for ambiguous
14+
bugs where the root cause or intended behavior is unclear.
15+
- When the user requests a different approach after seeing an implementation:
16+
briefly compare the old and new approaches — state the concrete pros and cons of each.
17+
If the new approach has significant drawbacks compared to the previous one, say so clearly before implementing.
18+
The user can still choose the new approach, but the decision should be informed.
19+
20+
### Context Management
21+
- Offload codebase exploration and research to subagents (Explore/Plan types). The main context
22+
should contain decisions and results, not the search process.
23+
- For multi-step implementations (e.g., feature + tests + adjustments), use subagents for isolated
24+
subtasks when the main context is already large. Prefer splitting into: (1) implement the feature,
25+
(2) write/adjust tests, (3) fix issues found in review.
26+
- When the user requests adjustments or additional tests after an implementation, assess whether
27+
the main context has grown large. If so, delegate the follow-up work to a subagent with a clear
28+
description of what was implemented and what needs to change.
29+
30+
### Concurrency Awareness
31+
This codebase has concurrency concerns in bulk operations, temp table management, and test
32+
isolation. When modifying code in these areas:
33+
- Identify shared mutable state and how it is protected (e.g., temp table suffix leasing,
34+
connection/transaction lifecycle in context factories).
35+
- Consider whether new code respects existing isolation boundaries (e.g., SQL Server test lock
36+
tables, `DbContext` single-thread usage).
37+
- When adding async code, consider: cancellation propagation, `IAsyncDisposable` cleanup ordering,
38+
and whether operations need to be atomic within a transaction scope.
39+
- Remember that `DbContext` is not thread-safe — never share instances across threads.
40+
41+
### Self-Review Before Completion
42+
Before presenting work as complete:
43+
- Re-read the final state of all changed files (not from memory — actually re-read them).
44+
- Check for: unused variables, missing null checks, inconsistent naming, unhandled edge cases.
45+
- Simplicity check: for each new variable, ask whether it's necessary — does it name a complex
46+
expression, get reused, or aid debugging? If it only holds a value used once immediately, inline it.
47+
Apply the same scrutiny to wrapper methods, intermediate collections, and extra parameters.
48+
- Verify the changes compile (`dotnet build -c Release`).
49+
- Run affected tests (`dotnet test -c Release --no-build`, or a specific test project).
50+
- For query translation changes: verify the generated SQL matches expectations using
51+
`CollectExecutedCommands()`.
52+
- Final gut-check: "Would a staff engineer approve this?" — if anything feels over-engineered,
53+
unnecessarily clever, or under-justified, simplify before presenting.
54+
55+
### Planning
56+
- Enter plan mode for tasks that touch 3+ files or require architectural decisions.
57+
- If an approach hits a wall (repeated failures, wrong assumptions), stop and re-plan rather than
58+
pushing through. Do this immediately — do not attempt further fixes on a broken approach.
59+
Re-planning means stepping back to reassess the strategy, not retrying the same idea with tweaks.
60+
61+
### After Corrections
62+
- When the user corrects a mistake that reflects a project-wide pattern or convention, update the
63+
relevant section of CLAUDE.md.
64+
- Corrections must become **concrete rules in the relevant section**, not vague lessons. For example,
65+
if corrected about missing `CancellationToken` propagation, update the "EF Core Specifics" section
66+
with the rule — don't append a generic note somewhere else.
67+
568
## Quick Reference
669

770
```powershell
@@ -159,7 +222,7 @@ private NpgsqlBulkOperationExecutor SUT => field ??= ActDbContext.GetService<Npg
159222
| **Bulk Operations** | `IBulkInsertExecutor`, `IBulkUpdateExecutor`, `IBulkInsertOrUpdateExecutor` | SQL Server: `SqlBulkCopy`/MERGE; PostgreSQL: COPY protocol/INSERT ON CONFLICT; SQLite: batched INSERT/UPDATE |
160223
| **Bulk Update from Query** | `SqlServerBulkOperationsDbSetExtensions.BulkUpdateAsync`, `NpgsqlBulkOperationsDbSetExtensions.BulkUpdateAsync`, `SqliteBulkOperationsDbSetExtensions.BulkUpdateAsync`, `SetPropertyBuilder<TTarget, TSource>` | All three providers; SQL Server: `UPDATE t SET ... FROM target INNER JOIN (subquery) AS s ON ...`; PostgreSQL/SQLite: `UPDATE target AS t SET ... FROM (subquery) AS s WHERE ...`; fluent `Set` builder; accepts `IQueryable<TSource>` as source; optional `filter` parameter (`Expression<Func<TTarget, TSource, bool>>`) restricts which rows are updated (can reference both target and source properties) |
161224
| **Bulk Insert from Query** | `SqlServerBulkOperationsDbSetExtensions.BulkInsertAsync`, `NpgsqlBulkOperationsDbSetExtensions.BulkInsertAsync`, `SqliteBulkOperationsDbSetExtensions.BulkInsertAsync`, `InsertPropertyBuilder<TTarget, TSource>` | All three providers; generates `INSERT INTO target (cols) SELECT s.cols FROM (subquery) AS s`; fluent `Map` builder; accepts `IQueryable<TSource>` as source |
162-
| **Temp Tables** | `ITempTableCreator`, `ITempTableReference`, `ITempTableQuery<T>` | Queryable wrapper with auto-cleanup; name conflict prevention via `TempTableSuffixLeasing` |
225+
| **Temp Tables** | `ITempTableCreator`, `ITempTableReference`, `ITempTableQuery<T>`, `CreateTempTableAsync`, `BulkInsertIntoTempTableAsync`, `BulkInsertValuesIntoTempTableAsync` | Two workflows: all-in-one (create+insert via `BulkInsertIntoTempTableAsync`) or two-step (`CreateTempTableAsync` for empty table + insert later); auto-cleanup via `IAsyncDisposable`; name conflict prevention via `TempTableSuffixLeasing` |
163226
| **Window Functions** | `EF.Functions.RowNumber()`, `.Average()`, etc. | Fluent `PartitionBy()`/`OrderBy()`; all three providers |
164227
| **Table Hints** | `query.WithTableHints(SqlServerTableHint.NoLock)` | SQL Server only |
165228
| **Nested Transactions** | `NestedRelationalTransactionManager` | Root = real transaction; children = logical |

.mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"serena",
1010
"start-mcp-server",
1111
"--context",
12-
"ide-assistant",
12+
"claude-code",
1313
"--project-from-cwd"
1414
]
1515
}

.serena/project.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ encoding: utf-8
113113
languages:
114114
- csharp
115115

116-
# override of the corresponding setting in serena_config.yml, see the documentation there.
117-
# If null or missing, the value from the global config is used.
116+
# time budget (seconds) per tool call for the retrieval of additional symbol information
117+
# such as docstrings or parameter information.
118+
# This overrides the corresponding setting in the global configuration; see the documentation there.
119+
# If null or missing, use the setting from the global configuration.
118120
symbol_info_budget:
121+
122+
# The language backend to use for this project.
123+
# If not set, the global setting from serena_config.yml is used.
124+
# Valid values: LSP, JetBrains
125+
# Note: the backend is fixed at startup. If a project with a different backend
126+
# is activated post-init, an error will be returned.
127+
language_backend:

docs

Submodule docs updated from 09f2e3d to a369e3f

0 commit comments

Comments
 (0)