@ryuenn3123/agentic-senior-core 3.0.19 → 3.0.20

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 (77) hide show
  1. package/.agent-context/prompts/bootstrap-design.md +84 -103
  2. package/.agent-context/prompts/init-project.md +32 -100
  3. package/.agent-context/prompts/refactor.md +22 -44
  4. package/.agent-context/prompts/review-code.md +28 -52
  5. package/.agent-context/review-checklists/architecture-review.md +31 -62
  6. package/.agent-context/review-checklists/pr-checklist.md +74 -108
  7. package/.agent-context/rules/api-docs.md +18 -206
  8. package/.agent-context/rules/architecture.md +40 -207
  9. package/.agent-context/rules/database-design.md +10 -199
  10. package/.agent-context/rules/docker-runtime.md +5 -5
  11. package/.agent-context/rules/efficiency-vs-hype.md +11 -149
  12. package/.agent-context/rules/error-handling.md +9 -231
  13. package/.agent-context/rules/event-driven.md +17 -221
  14. package/.agent-context/rules/frontend-architecture.md +66 -119
  15. package/.agent-context/rules/git-workflow.md +1 -1
  16. package/.agent-context/rules/microservices.md +28 -161
  17. package/.agent-context/rules/naming-conv.md +8 -138
  18. package/.agent-context/rules/performance.md +9 -175
  19. package/.agent-context/rules/realtime.md +11 -44
  20. package/.agent-context/rules/security.md +11 -295
  21. package/.agent-context/rules/testing.md +9 -174
  22. package/.agent-context/state/benchmark-analysis.json +3 -3
  23. package/.agent-context/state/memory-continuity-benchmark.json +1 -1
  24. package/.agent-context/state/onboarding-report.json +71 -11
  25. package/.agents/workflows/init-project.md +7 -24
  26. package/.agents/workflows/refactor.md +7 -24
  27. package/.agents/workflows/review-code.md +7 -24
  28. package/.cursorrules +22 -21
  29. package/.gemini/instructions.md +2 -2
  30. package/.github/copilot-instructions.md +2 -2
  31. package/.instructions.md +112 -213
  32. package/.windsurfrules +22 -21
  33. package/AGENTS.md +4 -4
  34. package/CONTRIBUTING.md +13 -22
  35. package/README.md +6 -20
  36. package/lib/cli/commands/init.mjs +102 -148
  37. package/lib/cli/commands/launch.mjs +3 -3
  38. package/lib/cli/commands/optimize.mjs +14 -4
  39. package/lib/cli/commands/upgrade.mjs +25 -23
  40. package/lib/cli/compiler.mjs +96 -62
  41. package/lib/cli/constants.mjs +28 -136
  42. package/lib/cli/detector/design-evidence.mjs +189 -6
  43. package/lib/cli/detector.mjs +6 -7
  44. package/lib/cli/init-detection-flow.mjs +10 -93
  45. package/lib/cli/init-selection.mjs +2 -68
  46. package/lib/cli/project-scaffolder/constants.mjs +1 -1
  47. package/lib/cli/project-scaffolder/design-contract.mjs +162 -108
  48. package/lib/cli/project-scaffolder/discovery.mjs +36 -82
  49. package/lib/cli/project-scaffolder/prompt-builders.mjs +41 -55
  50. package/lib/cli/project-scaffolder/storage.mjs +0 -2
  51. package/lib/cli/token-optimization.mjs +1 -1
  52. package/lib/cli/utils.mjs +75 -9
  53. package/package.json +2 -2
  54. package/scripts/detection-benchmark.mjs +4 -15
  55. package/scripts/documentation-boundary-audit.mjs +9 -9
  56. package/scripts/explain-on-demand-audit.mjs +11 -11
  57. package/scripts/forbidden-content-check.mjs +9 -9
  58. package/scripts/frontend-usability-audit.mjs +45 -35
  59. package/scripts/llm-judge.mjs +1 -1
  60. package/scripts/mcp-server/constants.mjs +2 -2
  61. package/scripts/mcp-server/tool-registry.mjs +1 -1
  62. package/scripts/release-gate/audit-checks.mjs +4 -4
  63. package/scripts/release-gate/static-checks.mjs +5 -5
  64. package/scripts/release-gate.mjs +1 -1
  65. package/scripts/rules-guardian-audit.mjs +14 -13
  66. package/scripts/single-source-lazy-loading-audit.mjs +3 -3
  67. package/scripts/sync-thin-adapters.mjs +5 -5
  68. package/scripts/ui-design-judge/design-execution-summary.mjs +27 -1
  69. package/scripts/ui-design-judge/prompting.mjs +4 -4
  70. package/scripts/ui-design-judge/reporting.mjs +2 -1
  71. package/scripts/ui-design-judge/rubric-calibration.mjs +8 -5
  72. package/scripts/ui-design-judge/rubric-goldset.json +2 -2
  73. package/scripts/ui-design-judge.mjs +70 -6
  74. package/scripts/validate/config.mjs +138 -48
  75. package/scripts/validate/coverage-checks.mjs +32 -7
  76. package/scripts/validate.mjs +8 -4
  77. package/lib/cli/architect.mjs +0 -431
@@ -1,178 +1,13 @@
1
- # Testing — Prove It Works, Don't Pray
1
+ # Testing Boundary
2
2
 
3
- > "It works on my machine" is not a test strategy.
4
- > Untested code is broken code that hasn't been caught yet.
3
+ Use the test runner and style already present in the repo. If no test setup exists, the LLM must recommend a current, lightweight, project-fit setup from official docs before adding one.
5
4
 
6
- ## The Test Pyramid (Enforced)
5
+ Test what can break:
6
+ - business rules, validation, authorization, state transitions, and error paths
7
+ - public APIs, UI flows, integration boundaries, and data contracts touched by the change
8
+ - regressions around bugs being fixed
9
+ - critical accessibility or responsive behavior when UI is in scope
7
10
 
8
- ```
9
- ╱ E2E ╲ Few — Slow — Expensive — Fragile
10
- ╱──────────╲ Test critical user journeys only
11
- ╱ Integration ╲ Medium — Test module boundaries
12
- ╱────────────────╲ Database, API contracts, service interactions
13
- ╱ Unit Tests ╲ Many — Fast — Cheap — Stable
14
- ╱──────────────────────╲ Test business logic in isolation
15
- ```
11
+ Do not test framework internals, third-party library behavior, private implementation trivia, or snapshots that only freeze noise.
16
12
 
17
- ### Ratios
18
- - **Unit tests:** 70% — fast, isolated, test business rules
19
- - **Integration tests:** 20% — test boundaries (DB, APIs, modules)
20
- - **E2E tests:** 10% — test critical user flows only
21
-
22
- ---
23
-
24
- ## What to Test (And What Not To)
25
-
26
- ### ✅ ALWAYS Test
27
- - Business logic and calculations
28
- - Input validation rules
29
- - Edge cases (empty arrays, null values, boundary numbers)
30
- - Error handling paths (what happens when things fail)
31
- - State transitions and workflows
32
- - Authorization rules
33
-
34
- ### ❌ NEVER Test
35
- - Framework internals (don't test that Express routes work)
36
- - Simple getters/setters with no logic
37
- - Third-party library behavior
38
- - Private implementation details (test behavior, not structure)
39
- - Database migrations (verify schema, don't test the migration tool)
40
-
41
- ---
42
-
43
- ## Test Naming Convention
44
-
45
- ### Pattern: `should [expected behavior] when [condition]`
46
-
47
- ```
48
- ❌ BANNED:
49
- test('test1')
50
- test('it works')
51
- test('calculateDiscount')
52
-
53
- ✅ REQUIRED:
54
- test('should apply 20% discount when order total exceeds $100')
55
- test('should throw ValidationError when email format is invalid')
56
- test('should return empty array when user has no orders')
57
- test('should deny access when user lacks admin role')
58
- ```
59
-
60
- **Rule:** A reader must understand the expected behavior WITHOUT reading the test body.
61
-
62
- ---
63
-
64
- ## Test Structure: AAA Pattern
65
-
66
- Every test follows **Arrange → Act → Assert**:
67
-
68
- ```typescript
69
- test('should calculate shipping as free when order exceeds $50', () => {
70
- // Arrange — Set up the scenario
71
- const order = createOrder({ items: [{ price: 60, quantity: 1 }] });
72
-
73
- // Act — Execute the behavior
74
- const shippingCost = calculateShipping(order);
75
-
76
- // Assert — Verify the outcome
77
- expect(shippingCost).toBe(0);
78
- });
79
- ```
80
-
81
- ### Rules
82
- - **ONE assert concept per test** (multiple `expect` calls are fine if they test the same concept)
83
- - **No logic in tests** (no if/else, no loops, no try/catch)
84
- - **Tests must be independent** — no shared mutable state, no execution order dependency
85
- - **Tests must be deterministic** — same input = same result, every time
86
-
87
- ---
88
-
89
- ## Mocking Rules
90
-
91
- ### Mock at Boundaries, Not Everywhere
92
-
93
- ```
94
- ❌ OVER-MOCKING (testing implementation, not behavior):
95
- test('should call repository.save exactly once', () => {
96
- await service.createUser(userData);
97
- expect(repository.save).toHaveBeenCalledTimes(1);
98
- // If you refactor to call save differently, the test breaks
99
- // even though the behavior hasn't changed
100
- });
101
-
102
- ✅ CORRECT (testing behavior):
103
- test('should persist user and return created user', () => {
104
- const result = await service.createUser(userData);
105
- expect(result.id).toBeDefined();
106
- expect(result.email).toBe(userData.email);
107
- // You can verify the user exists in the test DB if integration test
108
- });
109
- ```
110
-
111
- ### When to Mock
112
- - External APIs (payment gateways, email services)
113
- - Time-dependent operations (use fake timers)
114
- - Non-deterministic operations (random, UUID)
115
-
116
- ### When NOT to Mock
117
- - Your own code in the same module ← test the real integration
118
- - Simple utility functions ← use the real thing
119
- - Database in integration tests ← use a test database
120
-
121
- ---
122
-
123
- ## Test Data Standards
124
-
125
- ### Use Factories, Not Copy-Pasted Objects
126
-
127
- ```
128
- ❌ BANNED:
129
- test('should calculate total', () => {
130
- const order = {
131
- id: '123',
132
- userId: '456',
133
- items: [{ productId: '789', price: 29.99, quantity: 2, name: 'Widget' }],
134
- status: 'pending',
135
- createdAt: new Date(),
136
- updatedAt: new Date(),
137
- // ... 15 more fields copied from another test
138
- };
139
- });
140
-
141
- ✅ REQUIRED:
142
- test('should calculate total', () => {
143
- const order = createTestOrder({
144
- items: [createTestItem({ price: 29.99, quantity: 2 })],
145
- });
146
- // Factory fills in all other fields with sensible defaults
147
- });
148
- ```
149
-
150
- ### Rules
151
- - Create factory functions for each domain entity
152
- - Factories provide sensible defaults — tests override only relevant fields
153
- - Never use production data in tests
154
- - Use descriptive, obviously-fake data (email: `test-user@example.com`, not `john@gmail.com`)
155
-
156
- ---
157
-
158
- ## Coverage Expectations
159
-
160
- | Layer | Min Coverage | What to Focus On |
161
- |-------|-------------|------------------|
162
- | Domain / Business Logic | 90%+ | All branching, edge cases, error paths |
163
- | Application / Service | 80%+ | Orchestration flows, error handling |
164
- | Transport / Controller | 60%+ | Input validation, error responses |
165
- | Utilities | 90%+ | All functions and edge cases |
166
-
167
- **Rule:** Coverage is a floor, not a goal. 100% coverage with bad tests is worse than 80% coverage with good tests. Focus on testing **behavior and edge cases**, not hitting a number.
168
-
169
- ---
170
-
171
- ## When to Skip Tests (Rare)
172
-
173
- You may skip tests ONLY for:
174
- - Prototype/spike code (must be labeled `// SPIKE: will be replaced`)
175
- - Pure UI layout (visual testing is better here — use Storybook/Chromatic)
176
- - Generated code (test the generator, not the output)
177
-
178
- Everything else gets tested. No excuses.
13
+ Tests should describe behavior, keep setup readable, and mock only at real boundaries such as network, filesystem, clock, database, or external services.
@@ -77,7 +77,7 @@
77
77
  "our_above_line": [
78
78
  "Unified design system → code → deployed component library workflow",
79
79
  "Anti-slop enforcer with measurable aesthetic rules",
80
- "Automated accessibility audit with auto-remediation suggestions",
80
+ "Automated accessibility audit with required remediation actions",
81
81
  "Performance budgeting integrated from design phase",
82
82
  "Component API contract validation (props, variants, logic)"
83
83
  ]
@@ -225,7 +225,7 @@
225
225
  ],
226
226
  "our_above_line": [
227
227
  "Interactive CLI initialization with live-reload preview",
228
- "Configuration validator & fix suggestions",
228
+ "Configuration validator and required fix actions",
229
229
  "Skill selector CLI with auto-detection",
230
230
  "Automated upgrade CLI with dry-run & rollback",
231
231
  "Plugin ecosystem for skill extensions"
@@ -314,7 +314,7 @@
314
314
  ],
315
315
  "our_above_line": [
316
316
  "AI-assisted code review with benchmark comparison (detect regressions vs 3 repos)",
317
- "Automated security vulnerability scanner + remediation suggestions",
317
+ "Automated security vulnerability scanner plus required remediation actions",
318
318
  "Performance regression gate (before/after benchmarks, SLO enforcement)",
319
319
  "Accessibility auto-audit + remediation",
320
320
  "Dependency audit with license compliance checking"
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-04-23T10:22:34.642Z",
2
+ "generatedAt": "2026-04-24T09:57:54.287Z",
3
3
  "reportName": "memory-continuity-benchmark",
4
4
  "schemaVersion": "1.0.0",
5
5
  "passed": true,
@@ -1,25 +1,43 @@
1
1
  {
2
- "cliVersion": "2.5.16",
3
- "generatedAt": "2026-04-18T00:00:00.000Z",
2
+ "cliVersion": "3.0.19",
3
+ "generatedAt": "2026-04-24T06:02:48.306Z",
4
4
  "operationMode": "upgrade",
5
5
  "selectedProfile": "beginner",
6
- "selectedStack": "typescript.md",
6
+ "projectScope": null,
7
+ "projectTopology": null,
8
+ "runtimeDecision": {
9
+ "mode": "agent-decision-required",
10
+ "explicitStack": null,
11
+ "detectedStackEvidence": "typescript.md",
12
+ "detectedAdditionalStackEvidence": []
13
+ },
14
+ "architectureDecision": {
15
+ "mode": "agent-decision-required",
16
+ "explicitBlueprint": null,
17
+ "detectedBlueprintEvidence": null
18
+ },
19
+ "selectedStack": null,
7
20
  "selectedAdditionalStacks": [],
8
- "selectedBlueprint": "api-nextjs.md",
21
+ "selectedBlueprint": null,
9
22
  "selectedAdditionalBlueprints": [],
10
23
  "ruleLoadingPolicy": {
11
24
  "canonicalSource": ".instructions.md",
12
25
  "stackLoadingMode": "lazy",
13
26
  "loadedOnDemand": true,
14
- "primaryStack": "typescript.md",
15
- "additionalStacks": []
27
+ "primaryStack": null,
28
+ "additionalStacks": [],
29
+ "agentDecisionRequired": true
16
30
  },
17
31
  "ciGuardrailsEnabled": true,
18
- "setupDurationMs": 106,
19
- "selectedSkillDomains": [],
32
+ "setupDurationMs": 127,
33
+ "runtimeEnvironment": null,
34
+ "tokenOptimization": null,
35
+ "memoryContinuity": null,
20
36
  "autoDetection": {
21
- "recommendedStack": "typescript.md",
22
- "recommendedBlueprint": "api-nextjs.md",
37
+ "detectedStack": "typescript.md",
38
+ "detectedAdditionalStacks": [],
39
+ "detectedBlueprint": null,
40
+ "detectedAdditionalBlueprints": [],
23
41
  "confidenceLabel": "high",
24
42
  "confidenceScore": 0.94,
25
43
  "confidenceGap": 0.94,
@@ -37,6 +55,48 @@
37
55
  "evidence": [
38
56
  "package.json",
39
57
  "tsconfig.json"
40
- ]
58
+ ],
59
+ "detectionTransparency": {
60
+ "declaredAt": "2026-04-24T06:02:48.218Z",
61
+ "declarationType": "existing-project",
62
+ "declarationShown": true,
63
+ "detectionSummary": "This folder looks like Typescript with high confidence based on package.json, tsconfig.json. Confidence gap: 0.94.",
64
+ "activeRulesSummary": {
65
+ "canonicalSource": ".instructions.md",
66
+ "compiledEntrypoints": [
67
+ ".cursorrules",
68
+ ".windsurfrules"
69
+ ],
70
+ "stackLoadingMode": "lazy",
71
+ "selectedProfile": "beginner",
72
+ "selectedProfileDisplayName": "Beginner",
73
+ "blockingSeverities": [
74
+ "critical"
75
+ ],
76
+ "ciGuardrailsEnabled": true
77
+ },
78
+ "majorConstraints": [
79
+ "Preserve existing project markers and avoid forced stack migration.",
80
+ "Use runtime markers as evidence only unless the user already recorded an explicit runtime constraint.",
81
+ "Upgrade keeps prior explicit onboarding constraints but does not create new stack or blueprint decisions."
82
+ ],
83
+ "quickConfirmation": {
84
+ "offered": false,
85
+ "response": "upgrade-auto",
86
+ "source": "upgrade-assistant"
87
+ },
88
+ "decision": {
89
+ "mode": "upgrade-auto",
90
+ "selectedStackFileName": "agent-decision-runtime.md",
91
+ "selectedBlueprintFileName": "agent-decision-architecture.md"
92
+ }
93
+ },
94
+ "uiScope": {
95
+ "isUiScopeLikely": false,
96
+ "signalReasons": [],
97
+ "workspaceUiEntries": [],
98
+ "frontendEvidenceMetrics": null,
99
+ "designEvidenceSummary": null
100
+ }
41
101
  }
42
102
  }
@@ -1,29 +1,12 @@
1
1
  ---
2
- description: Initialize a new project using Agentic-Senior-Core blueprints and engineering standards
2
+ description: Initialize a project with repo-grounded guidance and required docs
3
3
  ---
4
4
 
5
- // turbo-all
6
-
7
5
  ## Workflow: Initialize Project
8
6
 
9
- 1. Read all rule files from `.agent-context/rules/` to understand engineering standards.
10
-
11
- 2. Resolve language-specific guidance from dynamic stack signals based on the project's goals and constraints.
12
-
13
- 3. Resolve the chosen architecture playbook (e.g., `api-nextjs` or `nestjs-logic`).
14
-
15
- 4. Scaffold the complete project structure following the blueprint exactly:
16
- - Create all directories and files
17
- - Set up strict `tsconfig.json` (using active TypeScript guidance)
18
- - Create `.env.example` with placeholder values
19
- - Set up Zod-validated environment config
20
- - Set up error handling foundation (base error class + global handler)
21
- - Set up structured logger (pino)
22
- - Create a `/health` endpoint
23
- - Initialize the ORM with initial schema
24
-
25
- 5. Verify every file follows `rules/naming-conv.md` naming conventions.
26
-
27
- 6. Verify the architecture follows `rules/architecture.md` layer separation.
28
-
29
- 7. Run the PR checklist from `.agent-context/review-checklists/pr-checklist.md` as a final quality gate.
7
+ 1. Read `AGENTS.md`, then follow the canonical bootstrap chain only as far as the task requires.
8
+ 2. Use `.agent-context/prompts/init-project.md` as the canonical init prompt.
9
+ 3. For existing projects, inspect real project files before naming the product, describing the context, or recommending runtime/architecture choices.
10
+ 4. For fresh projects, keep questions minimal and ask the agent to recommend unresolved runtime, framework, library, and architecture choices from the brief plus live official docs.
11
+ 5. Ensure required docs exist before implementation: project brief, architecture decision, flow overview, API/public contract when relevant, data model when relevant, UI design contract when relevant, security assumptions, and testing strategy.
12
+ 6. Run `.agent-context/review-checklists/pr-checklist.md` before declaring the init complete.
@@ -1,29 +1,12 @@
1
1
  ---
2
- description: Refactor code or extract a module following architecture and naming rules
2
+ description: Refactor code without changing behavior
3
3
  ---
4
4
 
5
5
  ## Workflow: Refactor Code
6
6
 
7
- 1. Read `.agent-context/rules/architecture.md` to understand the required layer separation.
8
-
9
- 2. Read `.agent-context/rules/naming-conv.md` to understand naming standards.
10
-
11
- 3. Read `.agent-context/rules/error-handling.md` to understand error handling patterns.
12
-
13
- 4. Resolve the active language profile from dynamic stack signals (e.g., TypeScript guidance).
14
-
15
- 5. Analyze the target code for violations:
16
- - Layer leaks (business logic in controllers, SQL in services)
17
- - Naming violations (generic names, missing verb prefixes, missing boolean prefixes)
18
- - Error handling issues (swallowed errors, generic Error types)
19
- - Type safety issues (any types, unvalidated input)
20
-
21
- 6. Apply refactoring while maintaining ALL existing functionality:
22
- - Separate into proper layers if needed (controller/service/repository)
23
- - Fix all naming violations
24
- - Add Zod validation at boundaries if missing
25
- - Replace generic errors with typed error classes
26
-
27
- 7. For every change, provide a Reasoning Chain explaining what was wrong and why the new approach is better.
28
-
29
- 8. Run `.agent-context/review-checklists/pr-checklist.md` as a final quality gate.
7
+ 1. Read `AGENTS.md`.
8
+ 2. Use `.agent-context/prompts/refactor.md` as the canonical refactor prompt.
9
+ 3. Inspect the target files and existing repo conventions before changing structure.
10
+ 4. Keep behavior stable unless the user explicitly approves a behavior change.
11
+ 5. Update docs and tests when contracts, public surfaces, or architecture boundaries change.
12
+ 6. Run `.agent-context/review-checklists/pr-checklist.md` before declaring done.
@@ -1,28 +1,11 @@
1
- description: Run a comprehensive code review using PR and architecture checklists
1
+ ---
2
+ description: Review code with project contracts and risk-first findings
2
3
  ---
3
4
 
4
5
  ## Workflow: Review Code
5
6
 
6
- 1. Read `.agent-context/review-checklists/pr-checklist.md` and apply every item against the current codebase.
7
-
8
- 2. Read `.agent-context/review-checklists/architecture-review.md` and apply every item against the current codebase.
9
-
10
- 3. For every violation found, provide a Reasoning Chain:
11
- - State the exact file and line
12
- - Reference the specific rule (file + section from `.agent-context/rules/`)
13
- - Explain WHY it's a problem
14
- - Provide the corrected code
15
-
16
- 4. Output results in this format:
17
-
18
- ```
19
- ## PR REVIEW RESULTS
20
- - PASS or FAIL for each item
21
- - Reasoning Chain for each failure
22
-
23
- ## ARCHITECTURE REVIEW RESULTS
24
- - Boundary violation summary and risk level for each finding
25
- - Specific remediation for each finding
26
-
27
- ## VERDICT: PASS or FAIL
28
- ```
7
+ 1. Read `AGENTS.md`.
8
+ 2. Use `.agent-context/prompts/review-code.md` as the canonical review prompt.
9
+ 3. Apply `.agent-context/review-checklists/pr-checklist.md`.
10
+ 4. Load architecture, frontend, security, testing, API, event, realtime, or Docker rules only when the changed scope needs them.
11
+ 5. Report findings first, ordered by severity, with file/line references and concrete fixes.
package/.cursorrules CHANGED
@@ -1,7 +1,7 @@
1
1
  # AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
2
2
 
3
- Generated by Agentic-Senior-Core CLI v3.0.19
4
- Timestamp: 2026-04-22T12:30:18.799Z
3
+ Generated by Agentic-Senior-Core CLI v3.0.20
4
+ Timestamp: 2026-04-24T06:02:48.303Z
5
5
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
6
6
 
7
7
  ## GOVERNANCE PRECEDENCE
@@ -16,11 +16,11 @@ Selected policy file: .agent-context/policies/llm-judge-threshold.json
16
16
  - Scope policy: every override must include module scope, rationale, and expiry date.
17
17
 
18
18
  ## BOOTSTRAP CHAIN (MANDATORY)
19
- Load every layer before responding. Do not skip steps:
19
+ Resolve the smallest relevant layer set before responding. Do not eagerly load unrelated layers:
20
20
  1. .agent-context/rules/
21
- 2. Resolve architecture and stack signals from project context and live evidence.
21
+ 2. Resolve runtime and architecture signals from project context, repo evidence, and live research.
22
22
  3. .agent-context/prompts/
23
- 4. Dynamic architecture and stack signals (from project context + research evidence)
23
+ 4. Dynamic runtime and architecture decision signals (from project context + research evidence)
24
24
  5. .agent-context/state/
25
25
  6. .agent-context/policies/llm-judge-threshold.json
26
26
  7. docs/ project context (or bootstrap prompts when docs are not materialized)
@@ -28,8 +28,8 @@ Load every layer before responding. Do not skip steps:
28
28
  Project-specific compiled snapshot: .agent-instructions.md
29
29
  Compiled adapter entrypoints: .cursorrules, .windsurfrules, .clauderc, .gemini/instructions.md, .github/copilot-instructions.md
30
30
  Canonical baseline: .instructions.md
31
- ## LAYER 1: UNIVERSAL RULES (MANDATORY)
32
- Read every file under .agent-context/rules/ before implementation:
31
+ ## LAYER 1: RULES (SCOPE-RESOLVED)
32
+ Available rule files under .agent-context/rules/:
33
33
  1. .agent-context/rules/api-docs.md
34
34
  2. .agent-context/rules/architecture.md
35
35
  3. .agent-context/rules/database-design.md
@@ -46,16 +46,17 @@ Read every file under .agent-context/rules/ before implementation:
46
46
  14. .agent-context/rules/security.md
47
47
  15. .agent-context/rules/testing.md
48
48
 
49
- Conflict resolution: prioritize data safety and API contract integrity first, then writing polish.
50
- ## LAYER 2: STACK PROFILE (typescript.md)
51
- Source: dynamic-research-signal (static stack profile file not required)
52
- Summary: Dynamic stack strategy signal for typescript.
53
- Load this stack profile to enforce language-specific conventions.
49
+ Resolution policy: load only the rule files relevant to the current task and prioritize data safety and API contract integrity first, then writing polish.
50
+ ## LAYER 2: RUNTIME DECISION REQUIRED
51
+ No runtime stack was selected by the user.
52
+ For a fresh project, the first implementation step is to ask the AI agent to recommend a runtime/framework from the brief, constraints, and live official documentation.
53
+ For an existing project, inspect repo markers and current files directly before editing. Detection evidence is not a migration instruction.
54
+ Do not silently choose a stack from offline defaults.
54
55
  ## LAYER 2 POLICY: LAZY RULE LOADING
55
- Primary stack strategy is always loaded for this project: typescript.md (dynamic mode)
56
- Additional stack profiles load only when explicitly selected or detected.
57
- Load stack guidance only when task scope touches that stack.
58
- Avoid eager loading unrelated stack profiles to prevent instruction conflicts.
56
+ Primary runtime constraint: unresolved until agent recommendation is approved
57
+ Additional runtime guidance loads only when explicitly selected by the user or required by touched code.
58
+ Load runtime-specific guidance only when task scope touches that runtime.
59
+ Avoid eager loading unrelated runtime guidance to prevent instruction conflicts.
59
60
  ## LAYER 5: EXECUTION PROMPTS AND UI TRIGGERS
60
61
  Load these prompt contracts only when their trigger matches the user request:
61
62
  1. .agent-context/prompts/init-project.md -> create, build, new project, scaffold
@@ -64,12 +65,12 @@ Load these prompt contracts only when their trigger matches the user request:
64
65
  4. .agent-context/prompts/bootstrap-design.md -> ui, ux, layout, screen, tailwind, frontend, redesign
65
66
  UI trigger policy:
66
67
  - Load .agent-context/prompts/bootstrap-design.md and .agent-context/rules/frontend-architecture.md first.
67
- - Keep UI-only requests context-isolated and do not eagerly load backend-only rules such as database-design.md, docker-runtime.md, or microservices.md unless the task explicitly crosses those boundaries.
68
+ - Keep UI-only requests context-isolated and do not eagerly load backend-only rules such as database-design.md, docker-runtime.md, microservices.md, git-workflow.md, or general implementation-theory rules unless the task explicitly crosses those boundaries.
68
69
  - For UI scope, materialize docs/DESIGN.md and docs/design-intent.json before implementing UI surfaces.
69
- ## LAYER 3: BLUEPRINT PROFILE (api-nextjs.md)
70
- Source: dynamic-research-signal (static blueprint profile file not required)
71
- Summary: Dynamic architecture strategy signal for api nextjs.
72
- Load this blueprint when scaffolding or changing architecture boundaries.
70
+ ## LAYER 3: ARCHITECTURE DECISION REQUIRED
71
+ No architecture blueprint was selected by the user.
72
+ The AI agent must propose the architecture from the product brief, repo evidence, required docs, and live research before implementation.
73
+ Do not map detected runtime markers into a blueprint automatically.
73
74
  ## LAYER 3B: CI/CD GUARDRAILS
74
75
  Load these CI blueprints when pipeline or release logic is touched:
75
76
  1. ci-github-actions.md (dynamic CI policy signal)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 3ddc44d1c3cad20aa06e31c45b5d7289b1b4cde46decb668b0347817222fb022
5
+ Canonical Snapshot SHA256: e6984d32169e98e32c9e6b6d6209bb2613b63b22d1e66af63a70788be00c55d5
6
6
 
7
7
  Canonical policy source: [.instructions.md](../.instructions.md).
8
8
 
@@ -20,7 +20,7 @@ If your host stops at this file, follow this minimum floor:
20
20
  4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
21
21
  5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
22
22
  6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and policy thresholds from [.agent-context/policies/](../.agent-context/policies).
23
- 7. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
23
+ 7. Resolve stack, structure, and dependency choices from project context docs plus live evidence.
24
24
 
25
25
  ## Completion Gate
26
26
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 3ddc44d1c3cad20aa06e31c45b5d7289b1b4cde46decb668b0347817222fb022
5
+ Canonical Snapshot SHA256: e6984d32169e98e32c9e6b6d6209bb2613b63b22d1e66af63a70788be00c55d5
6
6
 
7
7
  The canonical policy source for this repository is [.instructions.md](../.instructions.md).
8
8
 
@@ -20,7 +20,7 @@ If your host stops at this file, follow this minimum floor:
20
20
  4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
21
21
  5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
22
22
  6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and thresholds from [.agent-context/policies/](../.agent-context/policies).
23
- 7. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
23
+ 7. Resolve stack, structure, and dependency choices from project context docs plus live evidence.
24
24
 
25
25
  ## Completion Gate
26
26