@ryuenn3123/agentic-senior-core 4.3.15 → 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.
@@ -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,177 +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
- Use noisy command forms: `ascx git status`, `ascx git diff`, `ascx npm test`, `ascx npm install`, `ascx npm run build`, `ascx tsc`, `ascx rg`. Use raw commands only for pipes/redirects or unsupported commands. Apply `.agent-context/prompts/compact-natural-mode.md` for every final reply; never repeat full output; reference tee paths when truncated.
34
- ## Layer Index
35
- ### Layer 1: Rules (18 Files) [SCOPE-RESOLVED]
36
- Location: `.agent-context/rules/`.
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.
37
31
 
38
- Load only relevant rule files. Do not read the entire rule directory by default.
39
-
40
- 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).
32
+ ## Layer Index
41
33
 
42
- 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.
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`.
43
37
 
44
- Backend/API routing:
45
- - Data/schema/persistence: `architecture.md`, `database-design.md`, `migrations.md`, `performance.md`, `testing.md`.
46
- - Endpoint/API/error contracts: `architecture.md`, `api-docs.md`, `api-versioning.md`, `error-handling.md`, `observability.md`, `security.md`, `testing.md`.
47
- - Auth/secrets/uploads/permissions: `security.md`, `config-and-flags.md`, `error-handling.md`, `observability.md`, `testing.md`.
48
- - 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`.
49
- - 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.
50
40
 
51
- 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`
52
47
 
53
48
  ### Layer 2: Runtime Decision Signals
54
-
55
- Runtime Decision Signals come from project context, repo evidence, and live research. Runtime signals are evidence gates, not style cues or popularity rankings.
56
-
57
- 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.
58
50
 
59
51
  ### Layer 3: Structural Planning Signals
60
-
61
- Structural Planning Signals use dynamic structural planning from repo context, docs, runtime constraints, and live research. Structural planning signals are not a hard whitelist.
62
-
63
- 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.
64
53
 
65
54
  ### Layer 4: Execution Contracts
66
-
67
- 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.
68
56
 
69
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
70
63
 
71
- Location: `.agent-context/prompts/`. Load the matching prompt only, plus `compact-natural-mode.md` as the default final-response contract:
72
- - `compact-natural-mode.md` -> final response shape, evidence preservation, and compact natural prose
73
- - `init-project.md` -> create, build, new project, scaffold
74
- - `refactor.md` -> refactor, improve, clean up, fix
75
- - `review-code.md` -> review, audit, check, analyze
76
- - `bootstrap-design.md` -> ui, ux, layout, screen, tailwind, frontend, redesign (compact design direction prompt with default detection, anchor selection, and creative commitments)
77
-
78
- 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.
79
65
 
80
66
  ### Layer 6: Governance Modes
67
+ Use dynamic governance context. Apply matching defaults.
81
68
 
82
- Governance Modes use dynamic governance context from state files, policies, and repo norms. Apply matching defaults only when relevant.
83
-
84
- ### Layer 7: State and Benchmarks
69
+ ### Layer 7: State
70
+ Use `.agent-context/state/` for continuity/benchmarks. Use `onboarding-report.json`.
85
71
 
86
- 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.
87
-
88
- ### Layer 8: Policies and Thresholds
89
-
90
- 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.
91
74
 
92
75
  ### Layer 9: Project Context
93
-
94
- 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.
95
77
 
96
78
  ## Mandatory Triggers
97
79
 
98
80
  ### 1. Documentation-First Mode
99
-
100
- Trigger: docs, documentation, dokumen, `docs/*`, architecture docs, flow docs, API docs, or "lengkapkan docs".
101
-
102
- 1. Load `architecture.md`, `api-docs.md`, and only additional rules required by scope.
103
- 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.
104
- 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.
105
- 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.
106
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.
107
87
 
108
88
  ### 2. New Project Planning
109
-
110
89
  Trigger: create, build, new project, scaffold.
111
-
112
- 1. Resolve relevant rules.
113
- 2. Read `init-project.md`.
114
- 3. Infer constraints, required docs, and boundaries from requirements, repo evidence, docs, and live research.
115
- 4. Recommend runtime/architecture when unresolved.
116
- 5. WAIT for user approval before generating code.
90
+ Resolve rules -> Read `init-project.md` -> Infer constraints -> Recommend runtime -> WAIT for user approval.
117
91
 
118
92
  ### 3. Refactor Mode
119
-
120
93
  Trigger: refactor, improve, fix, clean up.
121
-
122
- 1. Resolve relevant rules.
123
- 2. Read `refactor.md`.
124
- 3. Apply active prompt/checklist contracts.
125
- 4. Propose a plan before edits.
126
- 5. WAIT for approval.
94
+ Resolve rules -> Read `refactor.md` -> Apply contracts -> Propose plan -> WAIT for user approval.
127
95
 
128
96
  ### 4. Code Review Mode
129
-
130
97
  Trigger: review, audit, check, analyze.
131
-
132
- 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.
133
99
 
134
100
  ### 5. UI Design Mode
135
-
136
101
  Trigger: ui, ux, layout, screen, tailwind, frontend, redesign.
137
-
138
- 1. Read `bootstrap-design.md` and `frontend-architecture.md`. Read UI-relevant repo evidence from state, current UI code, and `docs/*`.
139
- 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.
140
- 3. Generate or refine `docs/DESIGN.md` before UI implementation. Keep context isolated; do not eagerly load unrelated backend-only rules.
141
- 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.
142
106
 
143
107
  ## Bounded Reflection
144
- 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:
145
-
108
+ For risky actions, use:
146
109
  ```text
147
110
  REFLECTION
148
111
  Rules: ARCH-001, TEST-001
149
- Risk: one-line risk or conflict
150
- Action: one-line bounded next step
112
+ Risk: one-line risk
113
+ Action: one-line bounded step
151
114
  ```
152
- 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.
153
116
 
154
117
  ## Definition of Done
155
- Never claim done without:
156
118
  1. Relevant rules applied.
157
- 2. PR and architecture checklists considered.
158
- 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.
159
- 4. If `.agent-context/state/active-memory.json` exists and material project progress happened, refresh it while preserving privacy rules and user-owned entries.
160
- 5. Project validation passed through `npm run validate`.
161
-
162
- ## Knowledge Inventory Checklist
163
-
164
- 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.
165
-
166
- ## Operating Gates
167
-
168
- - Before code: resolve active rules and contract.
169
- - Before PR: run review checklists.
170
- - Before deploy: check policy thresholds.
171
- - Before major refactor: read `architecture-map.md`.
172
- - Before UI implementation: confirm valid style context, design contract, and required docs.
173
-
174
- ## Git Workflow
175
- Branch from main with `feat/`, `fix/`, `docs/`, or `chore/`; no direct commits to main. Use Conventional Commits: `feat:`, `fix:`, `docs:`, `refactor:`, `chore:`, `test:`.
176
- PRs use squash merge only, clean Markdown summaries, a Testing section, and `npm run validate` before opening. Bug fixes add one root-cause/prevention sentence to the nearest relevant doc.
177
-
178
- ## Do Not Modify
179
- Never touch `.agentic-backup/`. Update `package-lock.json` only via `ascx npm install`. Preserve user entries in `.agent-context/state/active-memory.json`. Regenerate `benchmarks/results/` via npm scripts only.
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
  {