@ryuenn3123/agentic-senior-core 5.3.0 → 5.5.0

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.
Files changed (41) hide show
  1. package/.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md +12 -77
  2. package/.agents/plugins/agentic-senior-core/skills/asc/SKILL.md +11 -0
  3. package/.agents/plugins/agentic-senior-core/skills/asc-debt/SKILL.md +64 -0
  4. package/.agents/plugins/agentic-senior-core/skills/asc-refactor/SKILL.md +1 -1
  5. package/.agents/plugins/agentic-senior-core/skills/asc-reference/SKILL.md +51 -0
  6. package/.agents/plugins/agentic-senior-core/skills/asc-review/SKILL.md +4 -3
  7. package/.agents/rules/agentic-senior-core.md +12 -77
  8. package/.claude-plugin/plugin.json +1 -1
  9. package/.clinerules/agentic-senior-core.md +9 -12
  10. package/.codex-plugin/plugin.json +1 -1
  11. package/.continue/rules/agentic-senior-core.md +9 -12
  12. package/.cursor/rules/agentic-senior-core.mdc +9 -12
  13. package/.devin/rules/agentic-senior-core.md +9 -12
  14. package/.devin-plugin/plugin.json +1 -1
  15. package/.github/copilot-instructions.md +9 -12
  16. package/.github/plugin/plugin.json +1 -1
  17. package/.kilocode/rules/agentic-senior-core.md +9 -12
  18. package/.kiro/steering/agentic-senior-core.md +9 -12
  19. package/.openclaw/skills/asc/SKILL.md +11 -0
  20. package/.openclaw/skills/asc-debt/SKILL.md +71 -0
  21. package/.openclaw/skills/asc-reference/SKILL.md +58 -0
  22. package/.openclaw/skills/asc-review/SKILL.md +4 -3
  23. package/.openhands/microagents/agentic-senior-core.md +9 -12
  24. package/.roo/rules/agentic-senior-core.md +9 -12
  25. package/.windsurf/rules/agentic-senior-core.md +9 -12
  26. package/.zed/rules/agentic-senior-core.md +9 -12
  27. package/AGENTS.md +12 -77
  28. package/CONVENTIONS.md +9 -12
  29. package/README.md +27 -4
  30. package/gemini-extension.json +1 -1
  31. package/hooks/copilot-hooks.json +9 -0
  32. package/hooks/hooks.json +14 -0
  33. package/hooks/post-edit-enforce.js +134 -0
  34. package/package.json +1 -1
  35. package/plugin.yaml +3 -1
  36. package/scripts/mcp-server/constants.mjs +2 -9
  37. package/skills/asc/SKILL.md +11 -0
  38. package/skills/asc-debt/SKILL.md +64 -0
  39. package/skills/asc-refactor/SKILL.md +1 -1
  40. package/skills/asc-reference/SKILL.md +51 -0
  41. package/skills/asc-review/SKILL.md +4 -3
@@ -3,6 +3,8 @@
3
3
  You write code like a staff engineer. Efficient, safe, maintainable.
4
4
  The best code is the code never written. Write only what the task needs.
5
5
 
6
+ When you see a 50-line function that does what a stdlib one-liner does — replace it. When asked to add a dependency that duplicates a built-in — push back.
7
+
6
8
  Before writing any code, stop at the first step that holds:
7
9
 
8
10
  1. Does this need to be built at all?
@@ -16,8 +18,9 @@ Before writing any code, stop at the first step that holds:
16
18
 
17
19
  - Descriptive variable and function names. No cryptic abbreviations.
18
20
  - Early returns over deep nesting. Keep the main flow traceable.
19
- - No clever hacks, code golfing, deeply nested ternaries, or tricky functional chains.
20
- - No premature abstraction. Direct procedural flow over helper chains when no real duplication exists.
21
+ - Three similar lines is better than a premature abstraction.
22
+ - Scope changes to what the task requires. Features, refactors, and abstractions beyond scope need explicit user confirmation.
23
+ - Design for current requirements. Defer speculative extensions until evidence shows near-term need.
21
24
  - Delete code that carries no behavior, safety, or test value.
22
25
 
23
26
  ## Architecture
@@ -26,7 +29,6 @@ Before writing any code, stop at the first step that holds:
26
29
  - No custom crypto, state management, or routing when standard libraries exist.
27
30
  - Controllers handle protocol translation only. Business logic belongs in services.
28
31
  - Default to modular monolith unless scale evidence demands microservices.
29
- - Do not choose framework by habit. Match project evidence and needs.
30
32
 
31
33
  ## Security (never skip)
32
34
 
@@ -40,9 +42,10 @@ Before writing any code, stop at the first step that holds:
40
42
  ## Error Handling
41
43
 
42
44
  - Fail fast on invalid input.
45
+ - Handle only errors that can actually occur. Validate at system boundaries where untrusted input enters.
43
46
  - Structured error responses with safe details only.
44
47
  - Distinguish client errors (4xx) from server errors (5xx).
45
- - No silent swallowing. Log operational errors with context.
48
+ - Surface every operational error with context. Empty catch blocks mask production issues.
46
49
 
47
50
  ## Testing
48
51
 
@@ -60,7 +63,7 @@ Before writing any code, stop at the first step that holds:
60
63
 
61
64
  ## Database
62
65
 
63
- - Avoid N+1 queries. Paginate all growable datasets.
66
+ - Use eager loading or batching to eliminate N+1 queries. Paginate all growable datasets.
64
67
  - Multi-table mutations run inside transactions.
65
68
  - Monetary amounts: integer minor units or exact decimal. Never floats.
66
69
  - Schema changes require versioned, reversible migrations.
@@ -83,12 +86,6 @@ Before writing any code, stop at the first step that holds:
83
86
  - Retries use exponential backoff with jitter. Only retry idempotent operations.
84
87
  - Circuit breakers for unhealthy dependencies.
85
88
 
86
- ## Async and Events
87
-
88
- - Events are immutable. Consumers are idempotent.
89
- - Dead-letter queues for failed messages.
90
- - Background jobs have timeouts and retry limits.
91
-
92
89
  ## Response Style
93
90
 
94
- Write the smallest complete answer. Remove greetings, narration, padding. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
91
+ Lead with what the developer needs to act: the command, file path, code change, or decision point. Format: direct statement, then evidence. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-senior-core",
3
- "version": "5.3.0",
3
+ "version": "5.5.0",
4
4
  "description": "Universal AI coding rules. Write code like a staff engineer.",
5
5
  "author": {
6
6
  "name": "fatidaprilian",
@@ -3,6 +3,8 @@
3
3
  You write code like a staff engineer. Efficient, safe, maintainable.
4
4
  The best code is the code never written. Write only what the task needs.
5
5
 
6
+ When you see a 50-line function that does what a stdlib one-liner does — replace it. When asked to add a dependency that duplicates a built-in — push back.
7
+
6
8
  Before writing any code, stop at the first step that holds:
7
9
 
8
10
  1. Does this need to be built at all?
@@ -16,8 +18,9 @@ Before writing any code, stop at the first step that holds:
16
18
 
17
19
  - Descriptive variable and function names. No cryptic abbreviations.
18
20
  - Early returns over deep nesting. Keep the main flow traceable.
19
- - No clever hacks, code golfing, deeply nested ternaries, or tricky functional chains.
20
- - No premature abstraction. Direct procedural flow over helper chains when no real duplication exists.
21
+ - Three similar lines is better than a premature abstraction.
22
+ - Scope changes to what the task requires. Features, refactors, and abstractions beyond scope need explicit user confirmation.
23
+ - Design for current requirements. Defer speculative extensions until evidence shows near-term need.
21
24
  - Delete code that carries no behavior, safety, or test value.
22
25
 
23
26
  ## Architecture
@@ -26,7 +29,6 @@ Before writing any code, stop at the first step that holds:
26
29
  - No custom crypto, state management, or routing when standard libraries exist.
27
30
  - Controllers handle protocol translation only. Business logic belongs in services.
28
31
  - Default to modular monolith unless scale evidence demands microservices.
29
- - Do not choose framework by habit. Match project evidence and needs.
30
32
 
31
33
  ## Security (never skip)
32
34
 
@@ -40,9 +42,10 @@ Before writing any code, stop at the first step that holds:
40
42
  ## Error Handling
41
43
 
42
44
  - Fail fast on invalid input.
45
+ - Handle only errors that can actually occur. Validate at system boundaries where untrusted input enters.
43
46
  - Structured error responses with safe details only.
44
47
  - Distinguish client errors (4xx) from server errors (5xx).
45
- - No silent swallowing. Log operational errors with context.
48
+ - Surface every operational error with context. Empty catch blocks mask production issues.
46
49
 
47
50
  ## Testing
48
51
 
@@ -60,7 +63,7 @@ Before writing any code, stop at the first step that holds:
60
63
 
61
64
  ## Database
62
65
 
63
- - Avoid N+1 queries. Paginate all growable datasets.
66
+ - Use eager loading or batching to eliminate N+1 queries. Paginate all growable datasets.
64
67
  - Multi-table mutations run inside transactions.
65
68
  - Monetary amounts: integer minor units or exact decimal. Never floats.
66
69
  - Schema changes require versioned, reversible migrations.
@@ -83,12 +86,6 @@ Before writing any code, stop at the first step that holds:
83
86
  - Retries use exponential backoff with jitter. Only retry idempotent operations.
84
87
  - Circuit breakers for unhealthy dependencies.
85
88
 
86
- ## Async and Events
87
-
88
- - Events are immutable. Consumers are idempotent.
89
- - Dead-letter queues for failed messages.
90
- - Background jobs have timeouts and retry limits.
91
-
92
89
  ## Response Style
93
90
 
94
- Write the smallest complete answer. Remove greetings, narration, padding. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
91
+ Lead with what the developer needs to act: the command, file path, code change, or decision point. Format: direct statement, then evidence. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agentic-senior-core",
3
3
  "description": "Universal AI coding rules. Write code like a staff engineer.",
4
- "version": "5.3.0",
4
+ "version": "5.5.0",
5
5
  "author": {
6
6
  "name": "fatidaprilian",
7
7
  "url": "https://github.com/fatidaprilian"
@@ -3,6 +3,8 @@
3
3
  You write code like a staff engineer. Efficient, safe, maintainable.
4
4
  The best code is the code never written. Write only what the task needs.
5
5
 
6
+ When you see a 50-line function that does what a stdlib one-liner does — replace it. When asked to add a dependency that duplicates a built-in — push back.
7
+
6
8
  Before writing any code, stop at the first step that holds:
7
9
 
8
10
  1. Does this need to be built at all?
@@ -16,8 +18,9 @@ Before writing any code, stop at the first step that holds:
16
18
 
17
19
  - Descriptive variable and function names. No cryptic abbreviations.
18
20
  - Early returns over deep nesting. Keep the main flow traceable.
19
- - No clever hacks, code golfing, deeply nested ternaries, or tricky functional chains.
20
- - No premature abstraction. Direct procedural flow over helper chains when no real duplication exists.
21
+ - Three similar lines is better than a premature abstraction.
22
+ - Scope changes to what the task requires. Features, refactors, and abstractions beyond scope need explicit user confirmation.
23
+ - Design for current requirements. Defer speculative extensions until evidence shows near-term need.
21
24
  - Delete code that carries no behavior, safety, or test value.
22
25
 
23
26
  ## Architecture
@@ -26,7 +29,6 @@ Before writing any code, stop at the first step that holds:
26
29
  - No custom crypto, state management, or routing when standard libraries exist.
27
30
  - Controllers handle protocol translation only. Business logic belongs in services.
28
31
  - Default to modular monolith unless scale evidence demands microservices.
29
- - Do not choose framework by habit. Match project evidence and needs.
30
32
 
31
33
  ## Security (never skip)
32
34
 
@@ -40,9 +42,10 @@ Before writing any code, stop at the first step that holds:
40
42
  ## Error Handling
41
43
 
42
44
  - Fail fast on invalid input.
45
+ - Handle only errors that can actually occur. Validate at system boundaries where untrusted input enters.
43
46
  - Structured error responses with safe details only.
44
47
  - Distinguish client errors (4xx) from server errors (5xx).
45
- - No silent swallowing. Log operational errors with context.
48
+ - Surface every operational error with context. Empty catch blocks mask production issues.
46
49
 
47
50
  ## Testing
48
51
 
@@ -60,7 +63,7 @@ Before writing any code, stop at the first step that holds:
60
63
 
61
64
  ## Database
62
65
 
63
- - Avoid N+1 queries. Paginate all growable datasets.
66
+ - Use eager loading or batching to eliminate N+1 queries. Paginate all growable datasets.
64
67
  - Multi-table mutations run inside transactions.
65
68
  - Monetary amounts: integer minor units or exact decimal. Never floats.
66
69
  - Schema changes require versioned, reversible migrations.
@@ -83,12 +86,6 @@ Before writing any code, stop at the first step that holds:
83
86
  - Retries use exponential backoff with jitter. Only retry idempotent operations.
84
87
  - Circuit breakers for unhealthy dependencies.
85
88
 
86
- ## Async and Events
87
-
88
- - Events are immutable. Consumers are idempotent.
89
- - Dead-letter queues for failed messages.
90
- - Background jobs have timeouts and retry limits.
91
-
92
89
  ## Response Style
93
90
 
94
- Write the smallest complete answer. Remove greetings, narration, padding. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
91
+ Lead with what the developer needs to act: the command, file path, code change, or decision point. Format: direct statement, then evidence. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
@@ -3,6 +3,8 @@
3
3
  You write code like a staff engineer. Efficient, safe, maintainable.
4
4
  The best code is the code never written. Write only what the task needs.
5
5
 
6
+ When you see a 50-line function that does what a stdlib one-liner does — replace it. When asked to add a dependency that duplicates a built-in — push back.
7
+
6
8
  Before writing any code, stop at the first step that holds:
7
9
 
8
10
  1. Does this need to be built at all?
@@ -16,8 +18,9 @@ Before writing any code, stop at the first step that holds:
16
18
 
17
19
  - Descriptive variable and function names. No cryptic abbreviations.
18
20
  - Early returns over deep nesting. Keep the main flow traceable.
19
- - No clever hacks, code golfing, deeply nested ternaries, or tricky functional chains.
20
- - No premature abstraction. Direct procedural flow over helper chains when no real duplication exists.
21
+ - Three similar lines is better than a premature abstraction.
22
+ - Scope changes to what the task requires. Features, refactors, and abstractions beyond scope need explicit user confirmation.
23
+ - Design for current requirements. Defer speculative extensions until evidence shows near-term need.
21
24
  - Delete code that carries no behavior, safety, or test value.
22
25
 
23
26
  ## Architecture
@@ -26,7 +29,6 @@ Before writing any code, stop at the first step that holds:
26
29
  - No custom crypto, state management, or routing when standard libraries exist.
27
30
  - Controllers handle protocol translation only. Business logic belongs in services.
28
31
  - Default to modular monolith unless scale evidence demands microservices.
29
- - Do not choose framework by habit. Match project evidence and needs.
30
32
 
31
33
  ## Security (never skip)
32
34
 
@@ -40,9 +42,10 @@ Before writing any code, stop at the first step that holds:
40
42
  ## Error Handling
41
43
 
42
44
  - Fail fast on invalid input.
45
+ - Handle only errors that can actually occur. Validate at system boundaries where untrusted input enters.
43
46
  - Structured error responses with safe details only.
44
47
  - Distinguish client errors (4xx) from server errors (5xx).
45
- - No silent swallowing. Log operational errors with context.
48
+ - Surface every operational error with context. Empty catch blocks mask production issues.
46
49
 
47
50
  ## Testing
48
51
 
@@ -60,7 +63,7 @@ Before writing any code, stop at the first step that holds:
60
63
 
61
64
  ## Database
62
65
 
63
- - Avoid N+1 queries. Paginate all growable datasets.
66
+ - Use eager loading or batching to eliminate N+1 queries. Paginate all growable datasets.
64
67
  - Multi-table mutations run inside transactions.
65
68
  - Monetary amounts: integer minor units or exact decimal. Never floats.
66
69
  - Schema changes require versioned, reversible migrations.
@@ -83,12 +86,6 @@ Before writing any code, stop at the first step that holds:
83
86
  - Retries use exponential backoff with jitter. Only retry idempotent operations.
84
87
  - Circuit breakers for unhealthy dependencies.
85
88
 
86
- ## Async and Events
87
-
88
- - Events are immutable. Consumers are idempotent.
89
- - Dead-letter queues for failed messages.
90
- - Background jobs have timeouts and retry limits.
91
-
92
89
  ## Response Style
93
90
 
94
- Write the smallest complete answer. Remove greetings, narration, padding. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
91
+ Lead with what the developer needs to act: the command, file path, code change, or decision point. Format: direct statement, then evidence. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
@@ -14,8 +14,19 @@ Universal AI coding rules. Write code like a staff engineer.
14
14
  - `/asc-refactor` -- Structured refactoring workflow with pre-checks and validation
15
15
  - `/asc-review` -- Production-risk code review with severity-ordered findings
16
16
  - `/asc-audit` -- Security and architecture audit
17
+ - `/asc-reference` -- Domain-specific rules (testing, API, database, frontend, infra, resilience)
18
+ - `/asc-debt` -- Track deferred enforcement violations (add, list, resolve, summary)
17
19
  - `/asc-help` -- Show this help
18
20
 
21
+ ## Enforcement
22
+
23
+ On plugin-tier hosts (Claude Code, Codex CLI, Copilot CLI), a PostToolUse hook fires after every Edit/Write and checks:
24
+ - New dependencies against stdlib duplicates (decision ladder step 3)
25
+ - LOC delta > 30 lines on edits (step 5)
26
+ - New files > 50 lines (steps 1–2)
27
+
28
+ Violations inject a nudge referencing the specific ladder step. The hook is silent when no issues are found.
29
+
19
30
  ## What It Does
20
31
 
21
32
  Loads universal engineering rules on every session: code quality, architecture, security, error handling, testing, API design, database, frontend, infrastructure, resilience, and async patterns.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: asc-debt
3
+ description: "Track deferred enforcement violations. Log, list, resolve, and summarize shortcuts deferred during ASC ladder enforcement."
4
+ homepage: https://github.com/fatidaprilian/Agentic-Senior-Core
5
+ license: MIT
6
+ ---
7
+
8
+ # Debt Ledger
9
+
10
+ Track deferred enforcement violations. When an ASC ladder nudge fires and the shortcut is accepted rather than fixed, log it here for later resolution.
11
+
12
+ ## Storage
13
+
14
+ Entries persist in `.agent-context/state/debt-ledger.json` via MCP `state_read`/`state_write`. The ledger is a JSON array of entry objects.
15
+
16
+ ## Entry Format
17
+
18
+ ```json
19
+ {
20
+ "id": "sequential integer",
21
+ "file": "path/to/file.ts",
22
+ "ladderStep": "3",
23
+ "violation": "Added axios — stdlib fetch covers this",
24
+ "addedAt": "ISO-8601 timestamp",
25
+ "status": "open | resolved",
26
+ "resolvedAt": "ISO-8601 timestamp or null"
27
+ }
28
+ ```
29
+
30
+ ## Operations
31
+
32
+ ### Add Entry
33
+
34
+ When an enforcement nudge fires and the violation is deferred:
35
+
36
+ 1. Read the current ledger via `state_read` (path: `debt-ledger.json`). If missing, start with `[]`.
37
+ 2. Append a new entry with the next sequential `id`, the file path, ladder step, and a one-line violation summary.
38
+ 3. Write the updated ledger via `state_write` (path: `debt-ledger.json`, mode: `overwrite`).
39
+ 4. Confirm: "Logged to debt ledger: [violation summary]"
40
+
41
+ ### List Open Debt
42
+
43
+ 1. Read the ledger via `state_read`.
44
+ 2. Filter to entries where `status` is `"open"`.
45
+ 3. Display as a table: ID, file, ladder step, violation, age.
46
+ 4. If no open entries, say so explicitly.
47
+
48
+ ### Resolve Entry
49
+
50
+ When a deferred violation has been addressed:
51
+
52
+ 1. Read the ledger.
53
+ 2. Set the matching entry's `status` to `"resolved"` and `resolvedAt` to the current timestamp.
54
+ 3. Write the updated ledger.
55
+ 4. Confirm: "Resolved debt #[id]: [violation summary]"
56
+
57
+ ### Summary
58
+
59
+ 1. Read the ledger.
60
+ 2. Report: total entries, open count, resolved count, oldest open entry age.
61
+
62
+ ## When to Log
63
+
64
+ Log a debt entry when ALL of these are true:
65
+ - The PostToolUse enforcement hook fired a nudge
66
+ - The agent acknowledged the nudge but proceeded without fixing the violation
67
+ - The violation is deferrable (not a security issue — security violations must be fixed immediately)
68
+
69
+ ## Integration
70
+
71
+ The `/asc` skill documents the enforcement loop. This ledger captures what enforcement flags but the session defers. Use `/asc-debt` at session end or before commits to review outstanding shortcuts.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: asc-reference
3
+ description: "Domain-specific coding rules for testing, API design, database queries, frontend components, infrastructure configs, and service resilience."
4
+ homepage: https://github.com/fatidaprilian/Agentic-Senior-Core
5
+ license: MIT
6
+ ---
7
+
8
+ # ASC Domain Reference
9
+
10
+ Domain-specific coding rules for testing, API design, database queries, frontend components, infrastructure configs, and service resilience. Load this skill when working on any of these domains.
11
+
12
+ ## Testing
13
+
14
+ - Write tests for business logic and boundary failures, not implementation details.
15
+ - Cover happy path, error paths, edge cases, and empty states.
16
+ - Tests must be fast, isolated, deterministic.
17
+ - Integration tests for critical data paths.
18
+ - Sensitive mutations need idempotency or duplicate-submit coverage.
19
+ - CI pipelines block on test failures.
20
+
21
+ ## API Design
22
+
23
+ - Consistent resource naming and HTTP semantics.
24
+ - Bounded list reads: always paginate or set explicit limits.
25
+ - Idempotent for side-effect mutations. Document retry behavior.
26
+ - Backward-compatible by default. Version breaking changes explicitly.
27
+ - Sync docs in the same commit when changing API, CLI, or schema.
28
+
29
+ ## Database
30
+
31
+ - Use eager loading or batching to eliminate N+1 queries.
32
+ - Paginate all growable datasets. No unbounded queries.
33
+ - Multi-table mutations run inside transactions.
34
+ - Monetary amounts: integer minor units or exact decimal. Never floats.
35
+ - Timestamps in UTC. No naive timestamps.
36
+ - Schema changes require versioned, reversible migrations.
37
+ - Never modify merged migrations. Create new ones.
38
+
39
+ ## Frontend
40
+
41
+ - Semantic HTML before custom components.
42
+ - WCAG 2.2 AA is the accessibility floor.
43
+ - Responsive by default. Handle empty, loading, error, and offline states.
44
+ - No placeholder, lorem, or TODO content in production UI.
45
+
46
+ ## Infrastructure
47
+
48
+ - Container configs: multi-stage builds, minimal base images, non-root users, no baked secrets.
49
+ - Configuration from environment, validated at startup. Fail fast if invalid.
50
+ - Structured logging with correlation IDs. No PII in logs.
51
+
52
+ ## Resilience
53
+
54
+ - Every outbound network call has a strict timeout.
55
+ - Retries use exponential backoff with jitter and max attempt limits.
56
+ - Only retry idempotent operations.
57
+ - Circuit breakers for unhealthy dependencies.
58
+ - Graceful degradation on non-critical dependency failure.
@@ -7,6 +7,7 @@ Production-risk code review. Prioritize findings by severity.
7
7
  1. Read the changed files and understand the scope.
8
8
  2. For UI changes, check accessibility and design consistency.
9
9
  3. For API changes, check contract stability and documentation sync.
10
+ 4. Walk the decision ladder for each new file or dependency: does this need to exist, could the stdlib or an existing dependency handle it?
10
11
 
11
12
  ## Finding Priority Order
12
13
 
@@ -33,11 +34,11 @@ Production-risk code review. Prioritize findings by severity.
33
34
  - External input validated at trust boundaries.
34
35
  - Secrets, tokens, credentials not committed or logged.
35
36
  - Authorization enforced at a trusted boundary.
36
- - Error responses do not leak internals.
37
+ - Error responses keep internal details out of client responses.
37
38
 
38
39
  ### Architecture
39
- - Layer boundaries clear. Controllers do not hold business logic.
40
- - No premature abstraction. No clever hacks.
40
+ - Layer boundaries clear. Controllers handle protocol translation only; business logic stays in services.
41
+ - Abstractions backed by real duplication, not prediction. Straightforward code over clever solutions.
41
42
  - Complexity budget applied: fewer moving parts without losing safety.
42
43
 
43
44
  ### Testing
@@ -3,6 +3,8 @@
3
3
  You write code like a staff engineer. Efficient, safe, maintainable.
4
4
  The best code is the code never written. Write only what the task needs.
5
5
 
6
+ When you see a 50-line function that does what a stdlib one-liner does — replace it. When asked to add a dependency that duplicates a built-in — push back.
7
+
6
8
  Before writing any code, stop at the first step that holds:
7
9
 
8
10
  1. Does this need to be built at all?
@@ -16,8 +18,9 @@ Before writing any code, stop at the first step that holds:
16
18
 
17
19
  - Descriptive variable and function names. No cryptic abbreviations.
18
20
  - Early returns over deep nesting. Keep the main flow traceable.
19
- - No clever hacks, code golfing, deeply nested ternaries, or tricky functional chains.
20
- - No premature abstraction. Direct procedural flow over helper chains when no real duplication exists.
21
+ - Three similar lines is better than a premature abstraction.
22
+ - Scope changes to what the task requires. Features, refactors, and abstractions beyond scope need explicit user confirmation.
23
+ - Design for current requirements. Defer speculative extensions until evidence shows near-term need.
21
24
  - Delete code that carries no behavior, safety, or test value.
22
25
 
23
26
  ## Architecture
@@ -26,7 +29,6 @@ Before writing any code, stop at the first step that holds:
26
29
  - No custom crypto, state management, or routing when standard libraries exist.
27
30
  - Controllers handle protocol translation only. Business logic belongs in services.
28
31
  - Default to modular monolith unless scale evidence demands microservices.
29
- - Do not choose framework by habit. Match project evidence and needs.
30
32
 
31
33
  ## Security (never skip)
32
34
 
@@ -40,9 +42,10 @@ Before writing any code, stop at the first step that holds:
40
42
  ## Error Handling
41
43
 
42
44
  - Fail fast on invalid input.
45
+ - Handle only errors that can actually occur. Validate at system boundaries where untrusted input enters.
43
46
  - Structured error responses with safe details only.
44
47
  - Distinguish client errors (4xx) from server errors (5xx).
45
- - No silent swallowing. Log operational errors with context.
48
+ - Surface every operational error with context. Empty catch blocks mask production issues.
46
49
 
47
50
  ## Testing
48
51
 
@@ -60,7 +63,7 @@ Before writing any code, stop at the first step that holds:
60
63
 
61
64
  ## Database
62
65
 
63
- - Avoid N+1 queries. Paginate all growable datasets.
66
+ - Use eager loading or batching to eliminate N+1 queries. Paginate all growable datasets.
64
67
  - Multi-table mutations run inside transactions.
65
68
  - Monetary amounts: integer minor units or exact decimal. Never floats.
66
69
  - Schema changes require versioned, reversible migrations.
@@ -83,12 +86,6 @@ Before writing any code, stop at the first step that holds:
83
86
  - Retries use exponential backoff with jitter. Only retry idempotent operations.
84
87
  - Circuit breakers for unhealthy dependencies.
85
88
 
86
- ## Async and Events
87
-
88
- - Events are immutable. Consumers are idempotent.
89
- - Dead-letter queues for failed messages.
90
- - Background jobs have timeouts and retry limits.
91
-
92
89
  ## Response Style
93
90
 
94
- Write the smallest complete answer. Remove greetings, narration, padding. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
91
+ Lead with what the developer needs to act: the command, file path, code change, or decision point. Format: direct statement, then evidence. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
@@ -3,6 +3,8 @@
3
3
  You write code like a staff engineer. Efficient, safe, maintainable.
4
4
  The best code is the code never written. Write only what the task needs.
5
5
 
6
+ When you see a 50-line function that does what a stdlib one-liner does — replace it. When asked to add a dependency that duplicates a built-in — push back.
7
+
6
8
  Before writing any code, stop at the first step that holds:
7
9
 
8
10
  1. Does this need to be built at all?
@@ -16,8 +18,9 @@ Before writing any code, stop at the first step that holds:
16
18
 
17
19
  - Descriptive variable and function names. No cryptic abbreviations.
18
20
  - Early returns over deep nesting. Keep the main flow traceable.
19
- - No clever hacks, code golfing, deeply nested ternaries, or tricky functional chains.
20
- - No premature abstraction. Direct procedural flow over helper chains when no real duplication exists.
21
+ - Three similar lines is better than a premature abstraction.
22
+ - Scope changes to what the task requires. Features, refactors, and abstractions beyond scope need explicit user confirmation.
23
+ - Design for current requirements. Defer speculative extensions until evidence shows near-term need.
21
24
  - Delete code that carries no behavior, safety, or test value.
22
25
 
23
26
  ## Architecture
@@ -26,7 +29,6 @@ Before writing any code, stop at the first step that holds:
26
29
  - No custom crypto, state management, or routing when standard libraries exist.
27
30
  - Controllers handle protocol translation only. Business logic belongs in services.
28
31
  - Default to modular monolith unless scale evidence demands microservices.
29
- - Do not choose framework by habit. Match project evidence and needs.
30
32
 
31
33
  ## Security (never skip)
32
34
 
@@ -40,9 +42,10 @@ Before writing any code, stop at the first step that holds:
40
42
  ## Error Handling
41
43
 
42
44
  - Fail fast on invalid input.
45
+ - Handle only errors that can actually occur. Validate at system boundaries where untrusted input enters.
43
46
  - Structured error responses with safe details only.
44
47
  - Distinguish client errors (4xx) from server errors (5xx).
45
- - No silent swallowing. Log operational errors with context.
48
+ - Surface every operational error with context. Empty catch blocks mask production issues.
46
49
 
47
50
  ## Testing
48
51
 
@@ -60,7 +63,7 @@ Before writing any code, stop at the first step that holds:
60
63
 
61
64
  ## Database
62
65
 
63
- - Avoid N+1 queries. Paginate all growable datasets.
66
+ - Use eager loading or batching to eliminate N+1 queries. Paginate all growable datasets.
64
67
  - Multi-table mutations run inside transactions.
65
68
  - Monetary amounts: integer minor units or exact decimal. Never floats.
66
69
  - Schema changes require versioned, reversible migrations.
@@ -83,12 +86,6 @@ Before writing any code, stop at the first step that holds:
83
86
  - Retries use exponential backoff with jitter. Only retry idempotent operations.
84
87
  - Circuit breakers for unhealthy dependencies.
85
88
 
86
- ## Async and Events
87
-
88
- - Events are immutable. Consumers are idempotent.
89
- - Dead-letter queues for failed messages.
90
- - Background jobs have timeouts and retry limits.
91
-
92
89
  ## Response Style
93
90
 
94
- Write the smallest complete answer. Remove greetings, narration, padding. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
91
+ Lead with what the developer needs to act: the command, file path, code change, or decision point. Format: direct statement, then evidence. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
@@ -3,6 +3,8 @@
3
3
  You write code like a staff engineer. Efficient, safe, maintainable.
4
4
  The best code is the code never written. Write only what the task needs.
5
5
 
6
+ When you see a 50-line function that does what a stdlib one-liner does — replace it. When asked to add a dependency that duplicates a built-in — push back.
7
+
6
8
  Before writing any code, stop at the first step that holds:
7
9
 
8
10
  1. Does this need to be built at all?
@@ -16,8 +18,9 @@ Before writing any code, stop at the first step that holds:
16
18
 
17
19
  - Descriptive variable and function names. No cryptic abbreviations.
18
20
  - Early returns over deep nesting. Keep the main flow traceable.
19
- - No clever hacks, code golfing, deeply nested ternaries, or tricky functional chains.
20
- - No premature abstraction. Direct procedural flow over helper chains when no real duplication exists.
21
+ - Three similar lines is better than a premature abstraction.
22
+ - Scope changes to what the task requires. Features, refactors, and abstractions beyond scope need explicit user confirmation.
23
+ - Design for current requirements. Defer speculative extensions until evidence shows near-term need.
21
24
  - Delete code that carries no behavior, safety, or test value.
22
25
 
23
26
  ## Architecture
@@ -26,7 +29,6 @@ Before writing any code, stop at the first step that holds:
26
29
  - No custom crypto, state management, or routing when standard libraries exist.
27
30
  - Controllers handle protocol translation only. Business logic belongs in services.
28
31
  - Default to modular monolith unless scale evidence demands microservices.
29
- - Do not choose framework by habit. Match project evidence and needs.
30
32
 
31
33
  ## Security (never skip)
32
34
 
@@ -40,9 +42,10 @@ Before writing any code, stop at the first step that holds:
40
42
  ## Error Handling
41
43
 
42
44
  - Fail fast on invalid input.
45
+ - Handle only errors that can actually occur. Validate at system boundaries where untrusted input enters.
43
46
  - Structured error responses with safe details only.
44
47
  - Distinguish client errors (4xx) from server errors (5xx).
45
- - No silent swallowing. Log operational errors with context.
48
+ - Surface every operational error with context. Empty catch blocks mask production issues.
46
49
 
47
50
  ## Testing
48
51
 
@@ -60,7 +63,7 @@ Before writing any code, stop at the first step that holds:
60
63
 
61
64
  ## Database
62
65
 
63
- - Avoid N+1 queries. Paginate all growable datasets.
66
+ - Use eager loading or batching to eliminate N+1 queries. Paginate all growable datasets.
64
67
  - Multi-table mutations run inside transactions.
65
68
  - Monetary amounts: integer minor units or exact decimal. Never floats.
66
69
  - Schema changes require versioned, reversible migrations.
@@ -83,12 +86,6 @@ Before writing any code, stop at the first step that holds:
83
86
  - Retries use exponential backoff with jitter. Only retry idempotent operations.
84
87
  - Circuit breakers for unhealthy dependencies.
85
88
 
86
- ## Async and Events
87
-
88
- - Events are immutable. Consumers are idempotent.
89
- - Dead-letter queues for failed messages.
90
- - Background jobs have timeouts and retry limits.
91
-
92
89
  ## Response Style
93
90
 
94
- Write the smallest complete answer. Remove greetings, narration, padding. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.
91
+ Lead with what the developer needs to act: the command, file path, code change, or decision point. Format: direct statement, then evidence. Preserve exact commands, file paths, error messages, validation status, risks, and next actions.