Skip to content

docs(agents): sync code standards from vault Reference notes#353

Merged
aliasunder merged 1 commit into
mainfrom
worktree-sync-code-standards
Jul 20, 2026
Merged

docs(agents): sync code standards from vault Reference notes#353
aliasunder merged 1 commit into
mainfrom
worktree-sync-code-standards

Conversation

@aliasunder

Copy link
Copy Markdown
Owner

Summary

  • Initial distillation of vault Reference/code-standards-* notes into AGENTS.md's existing sections
  • Fills gaps in ## Logging, ## Code style, ### Test conventions, and ## Operational docs — 100 insertions, zero deletions of existing repo-specific rules
  • Adds provenance stamp for future staleness checks (<!-- distilled from vault ... on 2026-07-20 -->)

What changed, by section

Logging (5 rules from code-standards-logging-observability):
PII/credential ban, redaction via destructuring, catch-logs-or-rethrows, layer-appropriate error messages, internal-vs-external error detail separation

Code style (14 rules from code-standards-typescript):

  • Error handling: per-operation try/catch, catch-logs-or-rethrows, explicit rejection over silent normalization
  • Structure: extract multi-step callbacks, boolean mode param = split, block bodies for multiline, named params at >2 args, scope constants to usage site
  • Comments: JSDoc on exports, durable rationale only, extraction preserves placement
  • Types: TS 5.5 filter predicate inference, Boolean(x) over !!x
  • Data-layer: no observability-only return values, prepared statements at factory scope

Test conventions (8 rules from code-standards-testing):
Two new two-bar traps (wrong-item pass, coincidental-equality hazard), never-decompose assertions, deterministic error messages get exact assertions, cleanup via onTestFinished, test-per-module structure, separate it() over callback it.each, error-path coverage, never mock time internals, production type rules in tests

Operational docs (6 rules from code-standards-docs):
Reader-walk persona test, multi-path doc coverage, structural self-references as claims, sibling-doc coherence, factual-claims-match-code, mechanism language earned

Promotion pass: no candidates — existing repo-specific rules are either already covered by the Reference notes or too project-specific (MCP conventions) to generalize.

Test plan

  • Docs-only change — no code affected
  • Pre-commit hooks pass (tsc + lint-staged + prettier)
  • All additions are gap-fills; no existing rules modified or deleted
  • Provenance stamp enables future staleness checks

🤖 Generated with Claude Code

Initial distillation of cross-project standards from vault
Reference/code-standards-* notes into AGENTS.md. Fills gaps in
existing sections without modifying repo-specific rules.

Additions by section:
- Logging: PII/credential ban, redaction pattern, catch-logs-or-rethrows,
  layer-appropriate messages, internal-vs-external error detail
- Code style: error handling (per-op try/catch, explicit rejection),
  structure (extract callbacks, boolean mode split, block bodies,
  named params, scoped constants), comments (JSDoc on exports, durable
  rationale, extraction preserves placement), types (TS 5.5 filter
  inference, Boolean(x)), data-layer (no observability returns,
  prepared statements)
- Test conventions: two-bar traps (wrong-item, coincidental-equality),
  never-decompose assertions, deterministic error messages, cleanup via
  onTestFinished, test-per-module, separate it() over callback it.each,
  error-path coverage, never mock time internals, production type rules
- Operational docs: reader-walk test, multi-path coverage, structural
  self-references, sibling-doc coherence, factual-claims-match-code,
  mechanism language

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @aliasunder, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@umm-actually

umm-actually Bot commented Jul 20, 2026

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@aliasunder
aliasunder merged commit 68e60e7 into main Jul 20, 2026
17 checks passed
@aliasunder
aliasunder deleted the worktree-sync-code-standards branch July 20, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant