@ryuenn3123/agentic-senior-core 4.2.7 → 4.2.8

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.
@@ -11,7 +11,7 @@ Before editing:
11
11
  3. If required project docs are missing, stop and bootstrap or update docs first.
12
12
  4. If the change touches UI, load .agent-context/prompts/bootstrap-design.md and .agent-context/rules/frontend-architecture.md before editing.
13
13
  5. If the change touches a dependency, framework, Docker, runtime, or ecosystem claim, verify current official docs before choosing.
14
- 6. Enforce Universal SOP hard gate: stop implementation if root `README.md` is missing, if `docs/doc-index.md` is missing while `docs/` exists, if `docs/architecture-decision-record.md` is missing, or for UI scope if `docs/DESIGN.md` or `docs/design-intent.json` is missing.
14
+ 6. Enforce Universal SOP hard gate: stop implementation if root `README.md` is missing, if `docs/doc-index.md` is missing while `docs/` exists, if `docs/project-brief.md` is missing, if `docs/architecture-decision-record.md` is missing, if `docs/flow-overview.md` is missing, if `docs/database-schema.md` is missing while the project uses persistent data, if `docs/api-contract.md` is missing while the project exposes API or web application flows, or for UI scope if `docs/DESIGN.md` or `docs/design-intent.json` is missing.
15
15
  7. Enforce backend universal principles: no clever hacks, no premature abstraction, readability over brevity.
16
16
  8. For backend/API scope, enforce layered boundaries, zero-trust input validation, safe centralized error responses, bounded list reads, transaction safety for multi-write mutations, idempotency for sensitive mutations, and behavior-focused API tests.
17
17
  9. Backend/API governance is global and stack-agnostic. Do not create stack-specific adapters or framework-specific rule branches; apply the global rules through the framework already present in the target project.
@@ -11,7 +11,7 @@ Before reviewing:
11
11
  3. Read .agent-context/review-checklists/architecture-review.md only when architecture or boundaries changed.
12
12
  4. Load only the rules relevant to the changed scope.
13
13
  5. For UI changes, load .agent-context/prompts/bootstrap-design.md, .agent-context/rules/frontend-architecture.md, docs/DESIGN.md, and docs/design-intent.json when present.
14
- 6. Enforce Universal SOP hard gate: block coding flow when required project docs are missing (root `README.md`; `docs/doc-index.md` when `docs/` exists; `docs/architecture-decision-record.md`; and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).
14
+ 6. Enforce Universal SOP hard gate: block coding flow when required project docs are missing (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; and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).
15
15
  7. Enforce single-source and lazy-loading policy: canonical rule source must be explicitly enforced, global domain governance must load lazily based on touched scope, and conflicting duplicate rule instructions must not appear during normal flow.
16
16
 
17
17
  Prioritize findings in this order:
@@ -122,9 +122,13 @@ Run this before declaring a task done. Apply only the sections relevant to the c
122
122
 
123
123
  - [ ] `.agent-context/rules/` remains the default guidance source for implementation and review.
124
124
  - [ ] Security and testing requirements remain mandatory after static template purge.
125
+ - [ ] Coding flow is blocked if `docs/project-brief.md` is missing
125
126
  - [ ] Coding flow is blocked if `docs/architecture-decision-record.md` (or `docs/Architecture-Decision-Record.md`) is missing
126
127
  - [ ] Coding flow is blocked if root `README.md` is missing
127
128
  - [ ] Coding flow is blocked if `docs/doc-index.md` is missing while `docs/` exists
129
+ - [ ] Coding flow is blocked if `docs/flow-overview.md` is missing
130
+ - [ ] Coding flow is blocked if `docs/database-schema.md` is missing while the project uses persistent data
131
+ - [ ] Coding flow is blocked if `docs/api-contract.md` is missing while the project exposes API or web application flows
128
132
  - [ ] UI implementation flow is blocked if `docs/DESIGN.md` or `docs/design-intent.json` is missing
129
133
 
130
134
  ## Verdict
@@ -121,3 +121,13 @@ keywords:
121
121
  7. Reject silent acceptance of duplicate side-effect-producing requests without a key. A caller that retried without a key gets a 400-class response that names the missing key, not a second charge.
122
122
  8. Authority for the rules above includes IETF RFC 9110 for HTTP method idempotency semantics and successor specifications for the `Idempotency-Key` request header where the platform standardizes one. Verify the current standardization status at audit time, because the header has been a draft and an RFC at different points in its history.
123
123
  <!-- DURABILITY CHECK: Rule relies exclusively on architectural invariants and relative operational thresholds. Valid beyond standard tooling lifecycles. -->
124
+
125
+ ## API-013: Documentation Diagram Format (Mandatory)
126
+
127
+ 1. Use Mermaid.js as the default diagram format for all project documentation diagrams: flowcharts, sequence diagrams, ER diagrams, architecture diagrams, C4 model diagrams, and state machine diagrams.
128
+ 2. Embed Mermaid diagrams as fenced code blocks with the `mermaid` language tag inside Markdown files.
129
+ 3. Do not use PlantUML, ASCII art diagrams, Graphviz DOT, or Structurizr DSL. These formats lack native rendering in GitHub, GitLab, and VS Code Markdown preview, or have lower LLM generation accuracy.
130
+ 4. D2 is on the watch list. Do not adopt D2 until GitHub ships native rendering support.
131
+ 5. Keep diagrams at macro-architecture and critical-flow level. Do not diagram micro-logic or individual function internals unless the complexity warrants it.
132
+ 6. When updating project behavior, update the matching diagrams in the same change. Stale diagrams are worse than no diagrams.
133
+ 7. When updating an existing doc that contains prose-only flow descriptions, architecture explanations, or data model descriptions without diagrams, convert the relevant sections to Mermaid diagrams in the same change.
package/AGENTS.md CHANGED
@@ -103,8 +103,8 @@ Trigger: docs, documentation, dokumen, `docs/*`, architecture docs, flow docs, A
103
103
 
104
104
  1. Load `architecture.md`, `api-docs.md`, and only additional rules required by scope.
105
105
  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` plus `docs/design-intent.json` for UI scope.
106
- 3. Use `docs/doc-index.md` as the compact read-routing map. Add PRD, SRS, technical-design, or separate ERD only when project evidence justifies them.
107
- 4. Write formal project docs in English by default unless the user asks otherwise.
106
+ 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.
107
+ 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.
108
108
  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.
109
109
 
110
110
  ### 2. New Project Planning
@@ -163,7 +163,7 @@ Use valid rule IDs only; do not quote full rule prose, expose hidden chain-of-th
163
163
  Never claim done without:
164
164
  1. Relevant rules applied.
165
165
  2. PR and architecture checklists considered.
166
- 3. Universal SOP gates satisfied: public and developer root `README.md`; `docs/architecture-decision-record.md`; plus `docs/DESIGN.md` and `docs/design-intent.json` for UI scope.
166
+ 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` and `docs/design-intent.json` for UI scope.
167
167
  4. If `.agent-context/state/active-memory.json` exists and material project progress happened, refresh it while preserving privacy rules and user-owned entries.
168
168
  5. Project validation passed through `npm run validate`.
169
169
 
@@ -55,6 +55,8 @@ export const RULE_FAMILY_CATALOG = [
55
55
  'idempotent',
56
56
  'idempotency',
57
57
  'documented',
58
+ 'diagram',
59
+ 'mermaid',
58
60
  ],
59
61
  },
60
62
  {
@@ -78,10 +78,11 @@ export function buildProjectContextBootstrapPrompt({
78
78
  '11. If runtime or framework setup is unresolved, recommend the latest stable compatible option from the brief, constraints, and live official documentation before coding. If an official setup flow yields newer, better-supported defaults than manual package assembly, use that path after approval.',
79
79
  '12. Treat topology as an agent decision unless the user explicitly constrained it. If monolith fits, explain why. If a service split fits, document the evidence and service boundary logic.',
80
80
  '13. Required docs coverage must include a public and developer README entrypoint, feature plan, architecture rationale, flow, public API or integration contracts when relevant, data model when relevant, UI/design when relevant, security assumptions, testing strategy, runtime/deployment notes, and next validation actions.',
81
- '14. README.md must be public and developer friendly, including for private projects: what it is, who it is for, setup, core workflow, configuration, and links to deeper docs. Do not include secrets, internal agent notes, private reasoning, or governance policy dumps.',
82
- '15. docs/doc-index.md is the low-token routing map for docs/*. Keep it short, list each active doc, and explain when an agent should read it. Do not make it the source of truth for requirements or architecture.',
83
- '16. Keep docs complete but compact. Add extra docs files only for stable, distinct, or long workflows such as hardware setup, deployment, operations, testing validation, or troubleshooting.',
84
- '17. Add SRS, PRD, technical-design, or ERD docs only when project evidence triggers them. Use PRD for product-roadmap/user-story ownership, SRS for contractual or multi-stakeholder acceptance criteria, technical-design for non-trivial architecture decisions, and ERD only as a separate file when the schema is too complex for docs/database-schema.md.',
81
+ '14. Use Mermaid.js as the default diagram format for flow, sequence, ER, architecture, C4, and state diagrams embedded in Markdown docs. 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.',
82
+ '15. README.md must be public and developer friendly, including for private projects: what it is, who it is for, setup, core workflow, configuration, and links to deeper docs. Do not include secrets, internal agent notes, private reasoning, or governance policy dumps.',
83
+ '16. docs/doc-index.md is the low-token routing map for docs/*. Keep it short, list each active doc, and explain when an agent should read it. Do not make it the source of truth for requirements or architecture.',
84
+ '17. Keep docs complete but compact. Add extra docs files only for stable, distinct, or long workflows such as hardware setup, deployment, operations, testing validation, or troubleshooting.',
85
+ '18. Add SRS, PRD, technical-design, or ERD docs only when project evidence triggers them. Use PRD for product-roadmap/user-story ownership, SRS for contractual or multi-stakeholder acceptance criteria, technical-design for non-trivial architecture decisions, and ERD only as a separate file when the schema is too complex for docs/database-schema.md.',
85
86
  '',
86
87
  '## Project Inputs',
87
88
  `- Project name: ${discoveryAnswers.projectName}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "4.2.7",
3
+ "version": "4.2.8",
4
4
  "type": "module",
5
5
  "description": "Change your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -218,19 +218,28 @@ export const REQUIRED_UNIVERSAL_SOP_SNIPPETS = [
218
218
  '### 15. Universal SOP Consolidation',
219
219
  'Coding flow is blocked if root `README.md` is missing',
220
220
  'Coding flow is blocked if `docs/architecture-decision-record.md` (or `docs/Architecture-Decision-Record.md`) is missing',
221
+ 'Coding flow is blocked if `docs/flow-overview.md` is missing',
222
+ 'Coding flow is blocked if `docs/database-schema.md` is missing while the project uses persistent data',
223
+ 'Coding flow is blocked if `docs/api-contract.md` is missing while the project exposes API or web application flows',
221
224
  'UI implementation flow is blocked if `docs/DESIGN.md` or `docs/design-intent.json` is missing',
222
225
  ],
223
226
  },
224
227
  {
225
228
  path: '.agent-context/prompts/review-code.md',
226
229
  snippets: [
227
- 'Enforce Universal SOP hard gate: block coding flow when required project docs are missing (root `README.md`; `docs/doc-index.md` when `docs/` exists; `docs/architecture-decision-record.md`; and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).',
230
+ 'Enforce Universal SOP hard gate: block coding flow when required project docs are missing',
231
+ 'docs/flow-overview.md',
232
+ 'docs/database-schema.md',
233
+ 'docs/api-contract.md',
228
234
  ],
229
235
  },
230
236
  {
231
237
  path: '.agent-context/prompts/refactor.md',
232
238
  snippets: [
233
- '6. Enforce Universal SOP hard gate: stop implementation if root `README.md` is missing, if `docs/doc-index.md` is missing while `docs/` exists, if `docs/architecture-decision-record.md` is missing, or for UI scope if `docs/DESIGN.md` or `docs/design-intent.json` is missing.',
239
+ 'Enforce Universal SOP hard gate: stop implementation if root `README.md` is missing',
240
+ 'docs/flow-overview.md',
241
+ 'docs/database-schema.md',
242
+ 'docs/api-contract.md',
234
243
  ],
235
244
  },
236
245
  {
@@ -247,6 +256,23 @@ export const REQUIRED_UNIVERSAL_SOP_SNIPPETS = [
247
256
  ],
248
257
  },
249
258
  ];
259
+ export const REQUIRED_DIAGRAM_FORMAT_SNIPPETS = [
260
+ {
261
+ path: '.agent-context/rules/api-docs.md',
262
+ snippets: [
263
+ '## API-013: Documentation Diagram Format (Mandatory)',
264
+ 'Mermaid.js as the default diagram format',
265
+ 'Do not use PlantUML',
266
+ 'convert the relevant sections to Mermaid diagrams in the same change',
267
+ ],
268
+ },
269
+ {
270
+ path: 'lib/cli/project-scaffolder/prompt-builders.mjs',
271
+ snippets: [
272
+ 'Mermaid.js as the default diagram format',
273
+ ],
274
+ },
275
+ ];
250
276
  export const REQUIRED_TEMPLATE_FREE_BOOTSTRAP_SNIPPETS = [
251
277
  {
252
278
  path: 'lib/cli/project-scaffolder/storage.mjs',
@@ -10,6 +10,7 @@ import {
10
10
  REQUIRED_DETECTION_TRANSPARENCY_SNIPPETS,
11
11
  REQUIRED_DETERMINISTIC_BOUNDARY_ENFORCEMENT_SNIPPETS,
12
12
  REQUIRED_DEVELOPER_FIRST_MENTION_PATTERNS,
13
+ REQUIRED_DIAGRAM_FORMAT_SNIPPETS,
13
14
  REQUIRED_DOCKER_RUNTIME_AUTOMATION_SNIPPETS,
14
15
  REQUIRED_HUMAN_WRITING_SNIPPETS,
15
16
  REQUIRED_STACK_DECISION_BOUNDARY_SNIPPETS,
@@ -170,6 +171,16 @@ export async function validateUniversalSopConsolidationCoverage(context) {
170
171
  });
171
172
  }
172
173
 
174
+ export async function validateDiagramFormatCoverage(context) {
175
+ await validateSnippetCoverage({
176
+ heading: 'Checking documentation diagram format coverage...',
177
+ coverageRules: REQUIRED_DIAGRAM_FORMAT_SNIPPETS,
178
+ missingLabel: 'diagram format source',
179
+ snippetLabel: 'diagram format snippet',
180
+ context,
181
+ });
182
+ }
183
+
173
184
  export async function validateTemplateFreeBootstrapCoverage(context) {
174
185
  const { ROOT_DIR, fileExists, readTextFile, pass, fail } = context;
175
186
 
@@ -29,6 +29,7 @@ import {
29
29
  validateDependencyFreshnessAutomationCoverage,
30
30
  validateDetectionTransparencyCoverage,
31
31
  validateDeterministicBoundaryEnforcementCoverage,
32
+ validateDiagramFormatCoverage,
32
33
  validateDockerRuntimeAutomationCoverage,
33
34
  validateHumanWritingGovernance,
34
35
  validateInstructionAdapters,
@@ -688,6 +689,7 @@ async function main() {
688
689
  await validateDetectionTransparencyCoverage(coverageValidationContext);
689
690
  await validateStackDecisionBoundaryCoverage(coverageValidationContext);
690
691
  await validateUniversalSopConsolidationCoverage(coverageValidationContext);
692
+ await validateDiagramFormatCoverage(coverageValidationContext);
691
693
  await validateTemplateFreeBootstrapCoverage(coverageValidationContext);
692
694
  await validateUpgradeUiContractWarningCoverage(coverageValidationContext);
693
695
  await validateUiDesignAutomationCoverage(coverageValidationContext);