Compare commits

..

31 commits

Author SHA1 Message Date
326b65f507
Elaborate on the iterative process for refactor scripts 2026-04-20 00:26:12 +03:00
d22b10a8ab
Teach Claude about the Three Virtues 2026-04-20 00:26:11 +03:00
d7e16e108d
Permit Claude to restructure automatically-committed history 2026-04-20 00:26:11 +03:00
d9d1ef0878
Integrate git into Claude's development process 2026-04-20 00:24:14 +03:00
6029206d1b
Add guidelines for naming and magic numbers in tests 2026-04-20 00:24:14 +03:00
575976e578
Invite creative writing in source code 2026-04-20 00:24:14 +03:00
2be49fd182
Describe the preferred setup of green-field projects 2026-04-20 00:24:13 +03:00
ff76aaf525
Clarify the role of integration testing for code that requires I/O 2026-04-20 00:24:13 +03:00
d3c941a8c1
Elaborate on outlier cases in the testing instructions 2026-04-20 00:24:12 +03:00
48c5b4e00e
Add Gemma 4 to the model library 2026-04-20 00:24:12 +03:00
69d53d4d8a
Increase the cache TTL for loaded models 2026-04-20 00:24:11 +03:00
4dd9795b0b
Mirror resource limits in podman as well 2026-04-20 00:24:11 +03:00
5910825ca9
Restrict service resource usage 2026-04-20 00:24:10 +03:00
8c53e540d8
Ignore local Claude Code files globally 2026-04-20 00:24:10 +03:00
5e559aa2a9
Use a widely-available terminal config in SSH remotes 2026-04-20 00:24:09 +03:00
e72fe95497
Create periodic healthcheck units for the transient store 2026-04-20 00:24:09 +03:00
bebbefcda7
Support health checks for the services 2026-04-20 00:24:09 +03:00
7be6bccbc9
Check for image updates on startup 2026-04-20 00:24:08 +03:00
36a16cc1dd
Only expose access ports on the localhost network 2026-04-20 00:24:08 +03:00
2a383a6c3c
Restrict service container privileges 2026-04-20 00:24:07 +03:00
ce0be360e5
Install SimpleX Chat from the GitHub repository 2026-04-20 00:24:07 +03:00
4bd68f4614
Short-circuit installation commands on failure 2026-04-20 00:24:06 +03:00
87c66ec157
Use hardened defaults for SSH connections 2026-04-20 00:24:06 +03:00
340b20f39e
Sort keybindings 2026-04-20 00:24:05 +03:00
31106b267d
Back up the password databases 2026-04-20 00:24:05 +03:00
34bf948ef1
Update the script to work in strict mode 2026-04-20 00:24:05 +03:00
59d1f1d22d
DRY the sync backup script 2026-04-20 00:24:04 +03:00
bec062d420
Install a CLI tool for Hetzner Cloud 2026-04-20 00:24:04 +03:00
d5f4376125
Provide installation suggestions for missing utilities 2026-04-20 00:24:03 +03:00
c9c788efe3
Correctly update executable links 2026-04-20 00:24:03 +03:00
fc840dd54e
Set core rules for Claude Code behavior 2026-04-20 00:24:02 +03:00

View file

@ -5,9 +5,42 @@
- When asked to do ONE thing, do exactly that. Do not proactively migrate dependencies, refactor adjacent code, or expand scope. You may suggest further edits, but wait for confirmation before any scope expansion. - When asked to do ONE thing, do exactly that. Do not proactively migrate dependencies, refactor adjacent code, or expand scope. You may suggest further edits, but wait for confirmation before any scope expansion.
- Prefer the simplest, most localized solution. Changes should target the most-relevant section of code — for example, catch errors in the scope that best handles them rather than injecting data up or down the stack. Take time to think about the best approach rather than quickly jumping to an implementation. - Prefer the simplest, most localized solution. Changes should target the most-relevant section of code — for example, catch errors in the scope that best handles them rather than injecting data up or down the stack. Take time to think about the best approach rather than quickly jumping to an implementation.
## The Three Virtues
Cultivate the three virtues of a great programmer — **Laziness**, **Impatience**, and **Hubris** — in the spirit of Larry Wall's original formulation. The first virtue deserves particular emphasis.
**Laziness** means going to great lengths to reduce total effort, especially by investing upfront in tools that replace repetitive manual work. It is rare for a large change to be so heterogeneous that no aspect of it can be generalized.
### Automating Sweeping Changes
For large-scale refactors, strongly prefer a script over repetitive manual edits. Two, three, or eight similar changes are fine to do by hand, but 50 similar one-line edits should be automated. This holds even when the script ends up longer or more complicated than the diff it produces.
The preferred workflow:
1. Craft a utility that applies the transformation. Pick the tool best suited to the specific shape of the change — a regex swap for simple textual substitutions, an AST-based rewrite when the change depends on syntactic structure, purpose-built refactoring libraries (e.g. `libcst`, `jscodeshift`, `gofmt -r`, `comby`) when available, or any combination thereof.
2. Commit the script on its own.
3. Run it and commit the results as a separate commit.
If inspecting the results reveals missed cases or inappropriate changes, use git to clean up (`git restore`, `git reset --hard` against the pre-script commit), then improve the script. Commit improvements as follow-ups, or amend the script's commit for trivial bug fixes, and re-run.
Continue iterating until:
- **(a) No incorrect changes are included in the diff.** This is a hard requirement — a script that produces even one wrong edit is not done.
- **(b) Either no missing cases remain, or the remaining cases are few and share too little in common for their inclusion in the script to be easier to validate than just editing them by hand.** When a handful of outlier cases survive the automated pass, handle them in a dedicated commit, separate from both the script-creation commit and the script-execution commit.
### Why This Matters for Review
A refactor script plus a spot-check of its output is far easier to review than a diff of 50 manual edits. The reviewer can be convinced of the logical correctness of the script and sample its results, rather than verifying every edit individually and separately confirming that no instances were accidentally skipped.
### Beyond Refactoring
The same principle generalizes across many aspects of coding. Test suites can and should be easier to reason about than the code they exercise. Formal models that can be mechanically verified are usually more concise than the code implementing them. A performance benchmark provides an explicit representation of the runtime metric that optimizations only improve implicitly.
The common theme: **treat tool creation and tool use as a materialized, first-class part of development — not just ephemeral scratch work during your own process.** Show your work and publish it into the history.
## Tool Usage Preferences ## Tool Usage Preferences
- For simple factual lookups (package versions, release dates), use targeted, purpose-built commands and local CLI tools first before attempting web searches — e.g. `pip index versions <pkg>` for Python, `npm view <pkg> versions` for Node. Prefer fast local approaches over web research. For simple factual lookups (package versions, release dates), use targeted, purpose-built commands and local CLI tools first before attempting web searches — e.g. `pip index versions <pkg>` for Python, `npm view <pkg> versions` for Node. Prefer fast local approaches over web research.
## Container Environment (Podman) ## Container Environment (Podman)
@ -91,6 +124,14 @@ Assume you are working in a git repository. Partition changes into small, self-c
Leverage the git history during development as well. Git enables efficient and reliable rollbacks of recent changes or research dead ends, and clean reverts of specific diffs from earlier in the history. Prefer these over manual cleanup. Leverage the git history during development as well. Git enables efficient and reliable rollbacks of recent changes or research dead ends, and clean reverts of specific diffs from earlier in the history. Prefer these over manual cleanup.
### Automated Safety-Net Commits
An automated cron job periodically sweeps every repository and creates a single timestamped commit containing all outstanding changes — staged, unstaged, and untracked. Its sole purpose is to reduce the chance of losing useful work during prolonged writing and revising sessions; it is not meant to produce the final shape of the history.
When you go to commit your own work and find that the cron job has beaten you to it, treat those commits as raw material to be restructured. Use `git commit --amend`, `git reset --soft`, or non-interactive rebases (`git rebase --exec`, `git rebase --onto`, scripted `git-filter-repo` passes, etc.) to split, recombine, and re-message them into meaningful, atomic steps of work.
Although the cron job occasionally groups together unrelated changes that you would commit separately, the chronological order of the automated commits usually correlates well with the content. Use judgement about whether it is cleaner to soft-reset the entire batch in one go and rebuild the history from scratch, or to replace it piecewise while preserving the commits that are already well-scoped.
## Green-Field Project Setup ## Green-Field Project Setup
When setting up a new project, code-quality and developer-experience tooling must be included from the start and integrated into the development workflow. The principles below use Python as a concrete example, but apply generally to any language ecosystem. When setting up a new project, code-quality and developer-experience tooling must be included from the start and integrated into the development workflow. The principles below use Python as a concrete example, but apply generally to any language ecosystem.