@ryuenn3123/agentic-senior-core 4.3.14 → 4.4.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 (25) hide show
  1. package/.agent-context/prompts/init-project.md +1 -1
  2. package/.agent-context/prompts/refactor.md +1 -0
  3. package/.agent-context/review-checklists/pr-checklist.md +1 -3
  4. package/.agent-context/rules/architecture.md +5 -0
  5. package/AGENTS.md +67 -115
  6. package/bin/agentic-senior-core.js +2 -5
  7. package/lib/cli/adaptive-context/catalog.mjs +4 -0
  8. package/lib/cli/adaptive-context.mjs +87 -301
  9. package/lib/cli/compiler.mjs +6 -389
  10. package/lib/cli/token-optimization.mjs +4 -89
  11. package/package.json +2 -9
  12. package/scripts/context-triggered-audit.mjs +1 -1
  13. package/scripts/{audit-cache-layer-contract.mjs → validate/audits/cache-layer-contract.mjs} +4 -37
  14. package/scripts/{audit-caching-scope-hygiene.mjs → validate/audits/caching-scope-hygiene.mjs} +1 -34
  15. package/scripts/{audit-file-size.mjs → validate/audits/file-size.mjs} +1 -62
  16. package/scripts/{audit-reflection-citations.mjs → validate/audits/reflection-citations.mjs} +2 -35
  17. package/scripts/{audit-release-bundle.mjs → validate/audits/release-bundle.mjs} +1 -36
  18. package/scripts/{audit-rule-id-uniqueness.mjs → validate/audits/rule-id-uniqueness.mjs} +1 -36
  19. package/scripts/validate/config.mjs +0 -18
  20. package/scripts/validate/file-structure.mjs +0 -4
  21. package/scripts/validate/utils.mjs +52 -0
  22. package/scripts/validate.mjs +10 -81
  23. package/lib/cli/audits/typography-palette-anti-repeat-audit.mjs +0 -239
  24. package/lib/cli/commands/audit-design-anti-repeat.mjs +0 -39
  25. package/scripts/audit-typography-palette-anti-repeat.mjs +0 -120
@@ -15,7 +15,7 @@ When a new project is created or initialized, the agent must automatically:
15
15
  ## Required Planning Mode
16
16
 
17
17
  If the user describes a project or feature, the agent must:
18
- 1. Clarify the delivery goals, runtime assumptions, constraints, and must-have capabilities before choosing implementation shape.
18
+ 1. Before drafting docs from a thin or ambiguous brief, ask the smallest useful set of clarifying questions needed to make delivery goals, edge cases, constraints, must-have capabilities, and non-goals explicit. If the user wants a draft anyway, document assumptions and wait for approval before coding.
19
19
  2. If the user already named a stack or framework, treat it as an explicit constraint. If not, produce a short evidence-backed recommendation from the brief, repo evidence, and live official documentation before coding. Include at least one plausible alternative when the default-looking option is Next.js, Tailwind-only styling, shadcn/ui, or another familiar web stack.
20
20
  3. For existing projects, inspect real files first. Do not derive product name, description, runtime, architecture, or design direction from the folder name alone.
21
21
  4. Draft a high-level structure plan plus the docs/bootstrap artifacts that must exist before coding.
@@ -29,6 +29,7 @@ Refactor rules:
29
29
  - Prefer the shorter implementation only when it keeps the same guarantees.
30
30
  - Run a final simplification pass before completion.
31
31
  - Update tests and docs whenever behavior contracts, public APIs, data shape, or UI contracts change.
32
+ - When fixing a bug: append one sentence to the nearest relevant doc (`docs/flow-overview.md` or `docs/architecture-decision-record.md`) naming the root cause and how to prevent recurrence.
32
33
 
33
34
  For every meaningful change, explain:
34
35
  - what risk or friction existed
@@ -19,9 +19,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
19
19
  - [ ] Public contracts remain stable or are versioned and documented.
20
20
 
21
21
  ## 3. Architecture
22
-
23
22
  ### 2. Architecture (→ rules/architecture.md)
24
-
25
23
  - [ ] Layer and module boundaries are clear for the project’s chosen structure.
26
24
  - [ ] No clever hacks in backend and shared core modules
27
25
  - [ ] No premature abstraction (base classes/util layers created only after repeated stable patterns)
@@ -102,7 +100,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
102
100
 
103
101
  ## 9. State And Governance
104
102
 
105
- ### 11. Context-Triggered Audit Mode
103
+ ### 9.1 Context-Triggered Audit Mode
106
104
 
107
105
  - [ ] Strict audit mode activates automatically on review and PR-intent workflows
108
106
  - [ ] Small edits avoid heavy checks by default unless strict mode is explicitly requested
@@ -30,4 +30,9 @@ keywords: [architecture, arch, boundary, system]
30
30
  2. Load global domain rules lazily based on touched scope.
31
31
  3. Do not create or load stack-specific governance adapters as the baseline.
32
32
 
33
+ ## ARCH-008: AI-Optimized Code Style (Simplicity, Modularity, Elegance)
34
+ 1. No Clever Hacks: Do not use code golfing, deeply nested ternaries, or tricky functional chains that destroy readability.
35
+ 2. No Premature Abstraction: Avoid over-engineering (excessive helper functions, layers, or abstraction classes) when a direct procedural flow is easier for an LLM to comprehend.
36
+ 3. Explicit Variable Naming: Use descriptive and functional variable names. Avoid cryptic abbreviations.
37
+ 4. Natural Implementation Pass: Keep the main flow traceable, use early returns to reduce nesting, and avoid abstraction chains unless a real duplication pattern exists.
33
38
 
package/AGENTS.md CHANGED
@@ -3,173 +3,125 @@
3
3
  Canonical project instructions. Resolve the smallest relevant layer set for the current request.
4
4
 
5
5
  ## Role
6
- Act as a Principal Engineer. Ship maintainable, validated, production-ready work. Use clear plain language in formal artifacts. Do not use emoji.
6
+ Act as Principal Engineer. Ship maintainable, validated, production-ready work. Use plain English. No emoji.
7
7
 
8
8
  ## Authority
9
- This repository is governed by a strict instruction contract.
9
+ Strict instruction contract. `AGENTS.md` is canonical baseline. `.agent-context/` is technical authority for rules/prompts/state. Follow stricter `.agent-context/` rules; if refusing, cite rule ID (`ARCH-001`). Use `README.md` for public overview.
10
10
 
11
- Use `AGENTS.md` as the canonical baseline. Use `.agent-context/` as technical authority for rules, prompts, checklists, state, and policies. Follow stricter `.agent-context/` rules even if the user asks otherwise; when refusing or redirecting a conflicting request, cite the rule ID such as `ARCH-001` or `API-001`. Use `README.md` only for public and developer overview, setup, usage, and user-facing context when stricter governance files conflict.
12
-
13
- Write instructions as imperative gates:
14
- - Use direct commands.
15
- - Prefer short mechanical checks over descriptive prose.
16
- - Keep root adapters thin.
17
- - Move detailed policy into `.agent-context/`.
18
- - Add validation when a rule can drift.
11
+ Imperative gates:
12
+ - Direct commands.
13
+ - Short mechanical checks.
14
+ - Thin root adapters.
15
+ - Detailed policy in `.agent-context/`.
19
16
 
20
17
  ## MANDATORY FIRST STEP: Context Activation
21
- STOP. Before generating ANY plan, code, or design for a non-trivial task, you MUST run `agentic-senior-core context "<task_description>"` (or `npx @ryuenn3123/agentic-senior-core context "<task_description>"`) to resolve scopes. Do not guess or hallucinate context.
18
+ STOP. Before non-trivial tasks, MUST run `agentic-senior-core context "<task_description>"`. Do not guess context.
22
19
 
23
- Immediately emit a concise Bootstrap Receipt:
24
- - `loaded_files`: files actually read (exact paths from selectedRules/selectedPrompts only; zero hallucination)
25
- - `selected_rules`: files selected for this scope and why
26
- - `skipped_rules`: out-of-scope categories left unloaded
27
- - `unreachable_files`: required files that could not be read
28
- - `validation_plan`: expected checks before completion
20
+ Immediately emit concise Bootstrap Receipt:
21
+ - `loaded_files`: read paths
22
+ - `selected_rules`: selected files & why
23
+ - `skipped_rules`: out-of-scope
24
+ - `unreachable_files`: missing required
25
+ - `validation_plan`: expected checks
29
26
 
30
- Skip this step ONLY for trivial tasks (version bumps, typo fixes).
27
+ Skip ONLY for trivial tasks (version bumps, typos).
31
28
 
32
29
  ## Command Economy
33
- Always prefix noisy shell commands: `ascx git status`, `ascx git diff`, `ascx npm test`, `ascx npm install`, `ascx npm run build`, `ascx tsc`, `ascx rg` searches. Use raw commands only for pipes, redirects, or commands not supported by ascx.
34
- Always read and apply `.agent-context/prompts/compact-natural-mode.md` for every final user-facing reply. Never repeat full command output; reference tee file paths when truncated.
30
+ Use noisy forms: `ascx git status`, `ascx git diff`, `ascx npm test`. Raw commands only for pipes/unsupported. Apply `compact-natural-mode.md` for replies; reference tee paths when truncated.
35
31
 
36
32
  ## Layer Index
37
- ### Layer 1: Rules (18 Files) [SCOPE-RESOLVED]
38
- Location: `.agent-context/rules/`.
39
-
40
- Load only relevant rule files. Do not read the entire rule directory by default.
41
-
42
- Available rules: `architecture.md` (`ARCH-*`, v4), `security.md` (`SEC-*`, v4), `performance.md` (`PERF-*`, v4), `error-handling.md` (`ERR-*`, v4), `testing.md` (`TEST-*`, v4), `api-docs.md` (`API-*`, v4), `microservices.md` (`SVC-*`, v4), `event-driven.md` (`EVT-*`, v4), `database-design.md` (`DATA-*`, v4), `realtime.md` (`RT-*`, v4), `frontend-architecture.md` (`FE-*`, v4), `docker-runtime.md` (`DOCK-*`, v4), `observability.md` (`OBS-*`, v4), `resilience.md` (`RES-*`, v4), `migrations.md` (`MIG-*`, v4), `background-jobs.md` (`JOB-*`, v4), `config-and-flags.md` (`CFG-*`, v4), `api-versioning.md` (`VER-*`, v4).
43
33
 
34
+ ### Layer 1: Rules (18 Files) [SCOPE-RESOLVED]
35
+ Location: `.agent-context/rules/`. Load only relevant files.
36
+ Available: `architecture.md`, `security.md`, `performance.md`, `error-handling.md`, `testing.md`, `api-docs.md`, `microservices.md`, `event-driven.md`, `database-design.md`, `realtime.md`, `frontend-architecture.md`, `docker-runtime.md`, `observability.md`, `resilience.md`, `migrations.md`, `background-jobs.md`, `config-and-flags.md`, `api-versioning.md`.
44
37
 
45
- For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. Also perform live web research for Docker and framework/package setup claims. For framework or package setup work, use the latest stable compatible dependency set and official setup flow unless a documented compatibility constraint blocks it; prefer official framework scaffolders when they create the supported project shape. New dependencies are allowed when they improve efficiency, delivery time, correctness, accessibility, UX, or maintainability. Do not treat dependency avoidance or vague performance fear as a default reason to skip a modern maintained library.
46
-
47
- Backend/API routing:
48
- - Data/schema/persistence: `architecture.md`, `database-design.md`, `migrations.md`, `performance.md`, `testing.md`.
49
- - Endpoint/API/error contracts: `architecture.md`, `api-docs.md`, `api-versioning.md`, `error-handling.md`, `observability.md`, `security.md`, `testing.md`.
50
- - Auth/secrets/uploads/permissions: `security.md`, `config-and-flags.md`, `error-handling.md`, `observability.md`, `testing.md`.
51
- - Queue/worker/cron/events/retry: `event-driven.md`, `background-jobs.md`, `resilience.md`, `database-design.md`, `error-handling.md`, `observability.md`, `performance.md`, `testing.md`.
52
- - Multi-service/distributed boundaries: `microservices.md`, `event-driven.md`, `database-design.md`, `api-docs.md`, `architecture.md`, `resilience.md`, `observability.md`, `performance.md`.
38
+ For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. Also perform live web research for Docker and framework/package setup claims.
39
+ For framework/package setup work, use the latest stable compatible dependency set and official setup flow unless constrained. New dependencies allowed to improve efficiency.
53
40
 
54
- Use the union once when scopes overlap. Do not create framework-specific governance adapters.
41
+ Backend routing:
42
+ - Data: `architecture.md`, `database-design.md`, `migrations.md`, `performance.md`, `testing.md`
43
+ - Endpoint: `architecture.md`, `api-docs.md`, `api-versioning.md`, `error-handling.md`, `observability.md`, `security.md`, `testing.md`
44
+ - Auth: `security.md`, `config-and-flags.md`, `error-handling.md`, `observability.md`, `testing.md`
45
+ - Worker: `event-driven.md`, `background-jobs.md`, `resilience.md`, `database-design.md`, `error-handling.md`, `observability.md`, `performance.md`, `testing.md`
46
+ - Distributed: `microservices.md`, `event-driven.md`, `database-design.md`, `api-docs.md`, `architecture.md`, `resilience.md`, `observability.md`, `performance.md`
55
47
 
56
48
  ### Layer 2: Runtime Decision Signals
57
-
58
- Runtime Decision Signals come from project context, repo evidence, and live research. Runtime signals are evidence gates, not style cues or popularity rankings.
59
-
60
- For fresh projects, recommend runtime/framework from the brief, constraints, and live official docs before coding. For existing projects, treat detected markers as evidence only. Ignore pattern frequency, external rankings, and remembered defaults. Do not default web projects to Next.js, Tailwind-only styling, shadcn/ui, Vite, or any familiar web stack by habit, and do not avoid them because of this guard when they are the strongest project fit.
49
+ Runtime signals are evidence gates, not style cues. Recommend runtime/framework from brief and live official docs before coding. Treat existing project markers as evidence. Do not blindly default to familiar web stacks. Extract constraints and required docs first. Do not silently choose frameworks or architecture from offline heuristics. Ignore pattern frequency. If unresolved, produce a short recommendation from evidence and live official documentation before coding.
61
50
 
62
51
  ### Layer 3: Structural Planning Signals
63
-
64
- Structural Planning Signals use dynamic structural planning from repo context, docs, runtime constraints, and live research. Structural planning signals are not a hard whitelist.
65
-
66
- For new projects or modules, extract constraints, boundaries, and required docs first. Do not silently choose frameworks or architecture from offline heuristics. If runtime or architecture is unresolved, produce a short recommendation from evidence and live official documentation before coding. Compare at least one plausible alternative when the strongest-looking option is a familiar web default and the user did not explicitly choose it.
52
+ Use dynamic structural planning from repo context. Structural planning signals are not a hard whitelist.
67
53
 
68
54
  ### Layer 4: Execution Contracts
69
-
70
- Execution Contracts are dynamic execution contracts from prompts, review checklists, and policy thresholds. Resolve the active contract, then enforce mandatory checks before declaring completion.
55
+ Enforce dynamic execution contracts from active prompt, checklists, and policies before declaring completion.
71
56
 
72
57
  ### Layer 5: Prompts
58
+ Location: `.agent-context/prompts/`. Load matching prompt + `compact-natural-mode.md`:
59
+ - `init-project.md`: create, scaffold
60
+ - `refactor.md`: improve, fix
61
+ - `review-code.md`: audit, analyze
62
+ - `bootstrap-design.md`: ui, ux, layout, screen, tailwind, frontend, redesign
73
63
 
74
- Location: `.agent-context/prompts/`. Load the matching prompt only, plus `compact-natural-mode.md` as the default final-response contract:
75
- - `compact-natural-mode.md` -> final response shape, evidence preservation, and compact natural prose
76
- - `init-project.md` -> create, build, new project, scaffold
77
- - `refactor.md` -> refactor, improve, clean up, fix
78
- - `review-code.md` -> review, audit, check, analyze
79
- - `bootstrap-design.md` -> ui, ux, layout, screen, tailwind, frontend, redesign (compact design direction prompt with default detection, anchor selection, and creative commitments)
80
-
81
- For UI-only work, load `bootstrap-design.md` and `frontend-architecture.md` first; do not eagerly load unrelated backend-only rules unless the request crosses that boundary. The valid style context is current repo evidence, current brief, and current project docs. External references, prior-chat memory, unrelated-project visuals, and remembered screenshots are tainted unless the user makes them current-task constraints. Treat WCAG 2.2 AA as the hard compliance floor and APCA as advisory perceptual tuning only.
64
+ For UI work, load `bootstrap-design.md` and `frontend-architecture.md` first; do not eagerly load unrelated backend-only rules. The valid style context is current repo evidence. External references, prior-chat memory, unrelated-project visuals, and remembered screenshots are tainted. Treat WCAG 2.2 AA as the hard compliance floor and APCA as advisory perceptual tuning only.
82
65
 
83
66
  ### Layer 6: Governance Modes
67
+ Use dynamic governance context. Apply matching defaults.
84
68
 
85
- Governance Modes use dynamic governance context from state files, policies, and repo norms. Apply matching defaults only when relevant.
69
+ ### Layer 7: State
70
+ Use `.agent-context/state/` for continuity/benchmarks. Use `onboarding-report.json`.
86
71
 
87
- ### Layer 7: State and Benchmarks
88
-
89
- Use `.agent-context/state/` only when the task needs risk zones, dependency boundaries, benchmarks, or continuity metadata. For initialized projects, `.agent-context/state/onboarding-report.json` records selected profile, runtime evidence, architecture decision status, token optimization, and memory continuity.
90
-
91
- ### Layer 8: Policies and Thresholds
92
-
93
- Use `.agent-context/policies/` for quality gates, release thresholds, and audit posture.
72
+ ### Layer 8: Policies
73
+ Use `.agent-context/policies/` for quality gates. Apply matching defaults.
94
74
 
95
75
  ### Layer 9: Project Context
96
-
97
- Use root `README.md` as the public and developer entrypoint for every fresh or existing project. Use `docs/doc-index.md` as the compact routing map when `docs/` exists. Use `docs/` when present: `project-brief.md`, `architecture-decision-record.md`, `database-schema.md`, `api-contract.md`, `flow-overview.md`, `DESIGN.md`.
76
+ Use root `README.md` as the public and developer entrypoint. Use `docs/doc-index.md` as the compact routing map.
98
77
 
99
78
  ## Mandatory Triggers
100
79
 
101
80
  ### 1. Documentation-First Mode
102
-
103
- Trigger: docs, documentation, dokumen, `docs/*`, architecture docs, flow docs, API docs, or "lengkapkan docs".
104
-
105
- 1. Load `architecture.md`, `api-docs.md`, and only additional rules required by scope.
106
- 2. Create or refine required docs first: root `README.md` for every fresh or existing project; `docs/doc-index.md` whenever `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/api-contract.md` for APIs, firmware endpoints, CLI commands, or web application flows; `docs/database-schema.md` for persistent data; and `docs/DESIGN.md` for UI scope.
107
- 3. Use Mermaid.js as the default diagram format for all documentation diagrams (flowcharts, sequence, ER, C4, state). Embed as fenced `mermaid` code blocks. Do not use PlantUML, ASCII art diagrams, Graphviz DOT, or Structurizr DSL. When updating existing docs that contain prose-only descriptions, convert relevant sections to Mermaid diagrams in the same change.
108
- 4. Use `docs/doc-index.md` as the compact read-routing map; add PRD, SRS, technical-design, or separate ERD only when justified. Write formal project docs in English by default.
81
+ Trigger: docs, documentation, dokumen, `docs/*`, architecture docs, flow docs, API docs, "lengkapkan docs".
82
+ 1. Load `architecture.md`, `api-docs.md`, plus scope rules.
83
+ 2. Create or refine required docs first: root `README.md` for every fresh or existing project; `docs/doc-index.md` whenever `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/api-contract.md`; `docs/database-schema.md`; `docs/DESIGN.md`.
84
+ 3. Use Mermaid.js as the default diagram format. Convert prose to diagrams where relevant.
85
+ 4. Use `docs/doc-index.md` as routing map. Write formal project docs in English by default.
109
86
  5. Stop after documentation when the user only asked for docs. Do not write application, firmware, or UI code until the user asks or approves implementation; do not write application, firmware, or UI code before approval.
110
87
 
111
88
  ### 2. New Project Planning
112
-
113
89
  Trigger: create, build, new project, scaffold.
114
-
115
- 1. Resolve relevant rules.
116
- 2. Read `init-project.md`.
117
- 3. Infer constraints, required docs, and boundaries from requirements, repo evidence, docs, and live research.
118
- 4. Recommend runtime/architecture when unresolved.
119
- 5. WAIT for user approval before generating code.
90
+ Resolve rules -> Read `init-project.md` -> Infer constraints -> Recommend runtime -> WAIT for user approval.
120
91
 
121
92
  ### 3. Refactor Mode
122
-
123
93
  Trigger: refactor, improve, fix, clean up.
124
-
125
- 1. Resolve relevant rules.
126
- 2. Read `refactor.md`.
127
- 3. Apply active prompt/checklist contracts.
128
- 4. Propose a plan before edits.
129
- 5. WAIT for approval.
94
+ Resolve rules -> Read `refactor.md` -> Apply contracts -> Propose plan -> WAIT for user approval.
130
95
 
131
96
  ### 4. Code Review Mode
132
-
133
97
  Trigger: review, audit, check, analyze.
134
-
135
- Load `pr-checklist.md` and `architecture-review.md`, then report defects, risks, regressions, and missing tests first.
98
+ Load `pr-checklist.md`, `architecture-review.md`. Report defects first.
136
99
 
137
100
  ### 5. UI Design Mode
138
-
139
101
  Trigger: ui, ux, layout, screen, tailwind, frontend, redesign.
140
-
141
- 1. Read `bootstrap-design.md` and `frontend-architecture.md`. Read UI-relevant repo evidence from state, current UI code, and `docs/*`.
142
- 2. Follow the three-step direction process in `bootstrap-design.md`: name defaults, choose anchor, commit to creative direction. If `docs/DESIGN.md` has an anti-repeat ledger, load previous directions as blocklist.
143
- 3. Generate or refine `docs/DESIGN.md` before UI implementation. Keep context isolated; do not eagerly load unrelated backend-only rules.
144
- 4. External websites are evidence for constraints and mechanics only. Do not copy layout rhythm, palette, component skin, or brand posture without explicit user approval.
102
+ 1. Read `bootstrap-design.md`, `frontend-architecture.md`, repo UI evidence.
103
+ 2. Follow `bootstrap-design.md` three-step direction process: name defaults, choose anchor, commit to creative direction. Check anti-repeat ledger in DESIGN.md.
104
+ 3. Refine `docs/DESIGN.md` before UI implementation.
105
+ 4. Do not copy layout rhythm/palette from external references blindly.
145
106
 
146
107
  ## Bounded Reflection
147
- For risky actions (file edits, public contracts, rule conflicts/refusals, release/publish gates, or security/data/API/testing/architecture boundaries), show this compact block before action or refusal:
148
-
108
+ For risky actions, use:
149
109
  ```text
150
110
  REFLECTION
151
111
  Rules: ARCH-001, TEST-001
152
- Risk: one-line risk or conflict
153
- Action: one-line bounded next step
112
+ Risk: one-line risk
113
+ Action: one-line bounded step
154
114
  ```
155
- Use valid rule IDs only; do not quote full rule prose, expose hidden chain-of-thought, or require the block for trivial replies.
115
+ Use valid rule IDs only. Do not expose hidden chain-of-thought.
156
116
 
157
117
  ## Definition of Done
158
- Never claim done without:
159
118
  1. Relevant rules applied.
160
- 2. PR and architecture checklists considered.
161
- 3. Universal SOP gates satisfied: public and developer root `README.md`; `docs/doc-index.md` when `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/database-schema.md` when persistent data exists; `docs/api-contract.md` when API or web application flows exist; plus `docs/DESIGN.md` for UI scope.
162
- 4. If `.agent-context/state/active-memory.json` exists and material project progress happened, refresh it while preserving privacy rules and user-owned entries.
163
- 5. Project validation passed through `npm run validate`.
164
-
165
- ## Knowledge Inventory Checklist
166
-
167
- Verify reachability of relevant files in Layer 1 to Layer 9 before generating implementation code. If a required instruction file is missing or unreachable, halt and report the missing dependency.
168
-
169
- ## Operating Gates
170
-
171
- - Before code: resolve active rules and contract.
172
- - Before PR: run review checklists.
173
- - Before deploy: check policy thresholds.
174
- - Before major refactor: read `architecture-map.md`.
175
- - Before UI implementation: confirm valid style context, design contract, and required docs.
119
+ 2. PR/architecture checklists considered.
120
+ 3. Universal SOP gates satisfied: root `README.md`; `docs/doc-index.md` when `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/database-schema.md`; `docs/api-contract.md`; `docs/DESIGN.md`.
121
+ 4. Refresh `.agent-context/state/active-memory.json`.
122
+ 5. `npm run validate` passed.
123
+
124
+ ## Operations
125
+ - Verify Layer 1-9 reachability before code.
126
+ - Branch from main (`feat/`, `fix/`, `docs/`, `chore/`). Squash merge PRs.
127
+ - Never touch `.agentic-backup/`. Update `package-lock.json` via `ascx npm install`. Regenerate benchmarks via scripts.
@@ -16,7 +16,7 @@ import { runOptimizeCommand, parseOptimizeArguments } from '../lib/cli/commands/
16
16
  import { runInitCommand, parseInitArguments } from '../lib/cli/commands/init.mjs';
17
17
  import { runUpgradeCommand, parseUpgradeArguments } from '../lib/cli/commands/upgrade.mjs';
18
18
  import { runContextCommand } from '../lib/cli/commands/context.mjs';
19
- import { runDesignAntiRepeatAuditCommand } from '../lib/cli/commands/audit-design-anti-repeat.mjs';
19
+
20
20
 
21
21
  async function main() {
22
22
  const commandArgument = process.argv[2];
@@ -70,10 +70,7 @@ async function main() {
70
70
  return;
71
71
  }
72
72
 
73
- if (commandArgument === 'audit:design-anti-repeat') {
74
- const auditExitCode = await runDesignAntiRepeatAuditCommand(commandArguments);
75
- exit(auditExitCode);
76
- }
73
+
77
74
 
78
75
  console.error(`Unknown command: ${commandArgument}`);
79
76
  printUsage();
@@ -141,6 +141,10 @@ export const RULE_FAMILY_CATALOG = [
141
141
  'middleware',
142
142
  'rapihin',
143
143
  'rapikan',
144
+ 'simple',
145
+ 'simplicity',
146
+ 'modularity',
147
+ 'elegance',
144
148
  ],
145
149
  },
146
150
  {