Skip to content

Commit 49ec784

Browse files
committed
docs: add special-case architecture review guidance
1 parent 7386e2d commit 49ec784

3 files changed

Lines changed: 23 additions & 8 deletions

File tree

.claude/agents/review.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,23 @@ You are a code reviewer for codealmanac. Review like someone who has to maintain
2525
6. **Tests.** Tests should cover the behavior boundary that changed. Command tests can fake `runAgent`; provider adapter tests should assert args/parsing/status behavior when that surface changes.
2626
7. **CLAUDE.md violations.** Explicitly cite the rule or principle violated.
2727

28-
## Codealmanac invariants to enforce
29-
30-
- Only `bootstrap` and `capture` may touch AI or write wiki pages.
31-
- Other commands operate on `index.db`, frontmatter, and the filesystem only.
32-
- No propose/apply flow, no dry-run mode, no interactive prompt.
33-
- Prompts stay as files in `prompts/`, not embedded TypeScript strings.
34-
- Provider modules expose `metadata`, `checkStatus()`, `assertReady()`, and `run()`.
35-
- `prompts/reviewer.md` is the wiki reviewer. This file is the code reviewer.
28+
## Special-case architecture
29+
30+
This project has been built with AI. Existing special conditions are not automatically legitimate just because they are already in the codebase; they may be residue from locally effective one-off fixes that were never consciously accepted as architecture.
31+
32+
Actively question new and existing special paths: extra flags, copied or derived files, workflow-only storage, fallback branches, bespoke state, command-specific parsers, provider-specific conditionals outside provider modules, prompt-specific preprocessing, helper scripts, and parallel lifecycle paths. Ask whether the existing general abstraction should absorb the behavior instead.
33+
34+
Do not reject every special case. Internally weight each one by cost and evidence:
35+
36+
- What invariant does it protect?
37+
- What user-facing behavior would break if it were removed?
38+
- Is it compensating for a missing general abstraction?
39+
- Is it temporary glue with a removal condition, or permanent architecture?
40+
- Does it duplicate source-of-truth data or create a lifecycle future maintainers must remember?
41+
42+
Assume the agents using this repo are capable: they can read files, inspect history, follow wiki pages, call tools, and reason over context. Flag rigid preprocessing, copied context bundles, artificial staging files, or orchestration that exists only to make an agent's input look simpler when a clear contract over the real source material would work.
43+
44+
This is an open-source project. Treat new tracked files as public API surface and future maintenance burden. When a change adds a file, ask whether it belongs in an existing prompt, doc, module, or test helper instead, and what prevents it from becoming stale.
3645

3746
## On restructure
3847

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Intelligence lives in prompts, not pipelines. When judgment is needed — decidi
1111
There is no prize for preserving awkward code. Prefer the structure a new maintainer would understand immediately.
1212

1313
- Prefer obvious architecture over local patching when a bug exposes mixed responsibilities.
14+
- Before accepting a solution, ask whether it creates a one-off mechanism where the existing general model could be extended instead. If it does, require an explicit architectural justification: why the general path is insufficient, whether the exception is temporary or permanent, how it is bounded, and what would make it safe to remove or generalize later.
15+
- Existing special conditions are not automatically legitimate just because they are already in the codebase. This project has been built with AI, and AI agents can leave behind locally effective one-off fixes that were never consciously accepted as architecture. Treat extra flags, copied files, fallback paths, bespoke state, provider-specific branches, and helper scripts as provisional until they earn their place.
16+
- Weight special cases by cost and evidence. Do not remove them reflexively; compatibility, migration, safety, platform, and provider constraints can be real. But a narrow exception with high maintenance cost needs stronger justification than a small localized shim.
17+
- Assume the agents using this repo are capable: they can read files, inspect history, follow wiki pages, call tools, and reason over context. Do not build rigid preprocessing, copied context bundles, artificial staging files, or elaborate orchestration solely because an agent might need help. Prefer giving the agent real source material and a clear contract unless there is evidence that the general agentic workflow fails.
18+
- This is an open-source project, so every new tracked file is public surface area and future maintenance burden. Before adding a file, ask who will own it, whether it belongs in an existing prompt/doc/module, and what keeps it from becoming stale.
1419
- Keep modules honest: a file named `auth.ts` should not secretly mean "Claude auth"; a central status file should not know provider-specific details.
1520
- Short files are good, but responsibility boundaries matter more than line count. Split when a file has multiple reasons to change.
1621
- Delete dead compatibility layers once callers have moved. Compatibility shims are temporary bridges, not architecture.

0 commit comments

Comments
 (0)