@ryuenn3123/agentic-senior-core 3.0.19 → 3.0.21
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.
- package/.agent-context/prompts/bootstrap-design.md +96 -103
- package/.agent-context/prompts/init-project.md +32 -100
- package/.agent-context/prompts/refactor.md +22 -44
- package/.agent-context/prompts/review-code.md +28 -52
- package/.agent-context/review-checklists/architecture-review.md +31 -62
- package/.agent-context/review-checklists/pr-checklist.md +74 -108
- package/.agent-context/rules/api-docs.md +18 -206
- package/.agent-context/rules/architecture.md +40 -207
- package/.agent-context/rules/database-design.md +10 -199
- package/.agent-context/rules/docker-runtime.md +5 -5
- package/.agent-context/rules/efficiency-vs-hype.md +11 -149
- package/.agent-context/rules/error-handling.md +9 -231
- package/.agent-context/rules/event-driven.md +17 -221
- package/.agent-context/rules/frontend-architecture.md +74 -119
- package/.agent-context/rules/git-workflow.md +1 -1
- package/.agent-context/rules/microservices.md +28 -161
- package/.agent-context/rules/naming-conv.md +8 -138
- package/.agent-context/rules/performance.md +9 -175
- package/.agent-context/rules/realtime.md +11 -44
- package/.agent-context/rules/security.md +11 -295
- package/.agent-context/rules/testing.md +9 -174
- package/.agent-context/state/benchmark-analysis.json +3 -3
- package/.agent-context/state/memory-continuity-benchmark.json +1 -1
- package/.agent-context/state/onboarding-report.json +71 -11
- package/.agents/workflows/init-project.md +7 -24
- package/.agents/workflows/refactor.md +7 -24
- package/.agents/workflows/review-code.md +7 -24
- package/.cursorrules +22 -21
- package/.gemini/instructions.md +2 -2
- package/.github/copilot-instructions.md +2 -2
- package/.instructions.md +112 -213
- package/.windsurfrules +22 -21
- package/AGENTS.md +4 -4
- package/CONTRIBUTING.md +13 -22
- package/README.md +6 -20
- package/lib/cli/commands/init.mjs +102 -148
- package/lib/cli/commands/launch.mjs +3 -3
- package/lib/cli/commands/optimize.mjs +14 -4
- package/lib/cli/commands/upgrade.mjs +25 -23
- package/lib/cli/compiler.mjs +96 -62
- package/lib/cli/constants.mjs +28 -136
- package/lib/cli/detector/design-evidence.mjs +189 -6
- package/lib/cli/detector.mjs +6 -7
- package/lib/cli/init-detection-flow.mjs +10 -93
- package/lib/cli/init-selection.mjs +2 -68
- package/lib/cli/project-scaffolder/constants.mjs +1 -1
- package/lib/cli/project-scaffolder/design-contract.mjs +183 -108
- package/lib/cli/project-scaffolder/discovery.mjs +36 -82
- package/lib/cli/project-scaffolder/prompt-builders.mjs +45 -55
- package/lib/cli/project-scaffolder/storage.mjs +0 -2
- package/lib/cli/token-optimization.mjs +1 -1
- package/lib/cli/utils.mjs +75 -9
- package/package.json +2 -2
- package/scripts/detection-benchmark.mjs +4 -15
- package/scripts/documentation-boundary-audit.mjs +9 -9
- package/scripts/explain-on-demand-audit.mjs +11 -11
- package/scripts/forbidden-content-check.mjs +9 -9
- package/scripts/frontend-usability-audit.mjs +45 -35
- package/scripts/llm-judge.mjs +1 -1
- package/scripts/mcp-server/constants.mjs +2 -2
- package/scripts/mcp-server/tool-registry.mjs +1 -1
- package/scripts/release-gate/audit-checks.mjs +22 -7
- package/scripts/release-gate/static-checks.mjs +5 -5
- package/scripts/release-gate.mjs +1 -1
- package/scripts/rules-guardian-audit.mjs +14 -13
- package/scripts/single-source-lazy-loading-audit.mjs +3 -3
- package/scripts/sync-thin-adapters.mjs +5 -5
- package/scripts/ui-design-judge/design-execution-summary.mjs +27 -1
- package/scripts/ui-design-judge/prompting.mjs +5 -5
- package/scripts/ui-design-judge/reporting.mjs +3 -1
- package/scripts/ui-design-judge/rubric-calibration.mjs +8 -5
- package/scripts/ui-design-judge/rubric-goldset.json +2 -2
- package/scripts/ui-design-judge.mjs +75 -7
- package/scripts/validate/config.mjs +138 -48
- package/scripts/validate/coverage-checks.mjs +32 -7
- package/scripts/validate.mjs +8 -4
- package/lib/cli/architect.mjs +0 -431
package/.instructions.md
CHANGED
|
@@ -1,262 +1,164 @@
|
|
|
1
1
|
# Agentic-Senior-Core: Unified AI Agent Instructions
|
|
2
2
|
|
|
3
|
-
> **Bootstrap File**
|
|
4
|
-
> It
|
|
3
|
+
> **Bootstrap File** - This file is automatically loaded when your IDE initializes in this workspace.
|
|
4
|
+
> It indexes the available governance layers so the agent can resolve only the layers the current request actually needs.
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## Your Role
|
|
9
9
|
|
|
10
|
-
You are a **
|
|
10
|
+
You are a **Principal Engineer**. You enforce production-grade engineering standards at all times. You do not generate "good enough" code; you generate maintainable, validated, production-ready code.
|
|
11
11
|
You use clear, plain language in formal artifacts and do not use emoji.
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
## Complete Knowledge Base (All 9 Layers)
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Resolve the smallest relevant layer set for the current request. Do not load every layer by default when the task is narrow.
|
|
18
18
|
|
|
19
|
-
### Layer 1: Rules (15 Files) [
|
|
19
|
+
### Layer 1: Rules (15 Files) [SCOPE-RESOLVED]
|
|
20
20
|
|
|
21
21
|
**Location**: `.agent-context/rules/`
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- `naming-conv.md`
|
|
26
|
-
- `architecture.md`
|
|
27
|
-
- `security.md`
|
|
28
|
-
- `performance.md`
|
|
29
|
-
- `error-handling.md`
|
|
30
|
-
- `testing.md`
|
|
31
|
-
- `git-workflow.md`
|
|
32
|
-
- `efficiency-vs-hype.md`
|
|
33
|
-
- `api-docs.md`
|
|
34
|
-
- `microservices.md`
|
|
35
|
-
- `event-driven.md`
|
|
36
|
-
- `database-design.md`
|
|
37
|
-
- `realtime.md`
|
|
38
|
-
- `frontend-architecture.md`
|
|
23
|
+
Available engineering rule files:
|
|
24
|
+
|
|
25
|
+
- `naming-conv.md` - No lazy names like `data`, `res`, or `x`
|
|
26
|
+
- `architecture.md` - Separation of concerns, structural boundaries, file-size discipline
|
|
27
|
+
- `security.md` - Validate all input, parameterize queries, no hardcoded secrets
|
|
28
|
+
- `performance.md` - Evidence-based optimization and hard rejection patterns
|
|
29
|
+
- `error-handling.md` - Never swallow errors, use typed error codes
|
|
30
|
+
- `testing.md` - Test pyramid, behavior over implementation
|
|
31
|
+
- `git-workflow.md` - Conventional commits and change hygiene
|
|
32
|
+
- `efficiency-vs-hype.md` - Latest-compatible, stable deps over trendy ones
|
|
33
|
+
- `api-docs.md` - OpenAPI 3.1 and public surface documentation
|
|
34
|
+
- `microservices.md` - Evidence-required service splits and distributed-system boundaries
|
|
35
|
+
- `event-driven.md` - Idempotency and event boundaries
|
|
36
|
+
- `database-design.md` - Safe migrations and schema discipline
|
|
37
|
+
- `realtime.md` - Realtime boundaries and pub/sub discipline
|
|
38
|
+
- `frontend-architecture.md` - UI structure, anti-generic boundaries, responsive mutation
|
|
39
39
|
- `docker-runtime.md` - Latest-docs-first Dockerfile and Compose generation
|
|
40
40
|
|
|
41
|
-
**What to do**:
|
|
41
|
+
**What to do**: Resolve only the rule files relevant to the current task. Do not read the entire rule directory by default. For UI-only work, start with `bootstrap-design.md` and `frontend-architecture.md` and keep backend or DevOps rules unloaded unless the task explicitly crosses those boundaries. For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. For framework or package setup work, use the latest stable compatible dependency set and official setup flow unless a documented compatibility constraint blocks it.
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### Layer 2: Stack Strategy Signals (Dynamic)
|
|
46
|
-
|
|
47
|
-
**Location**: dynamic stack intelligence from project context, repository evidence, and live research.
|
|
43
|
+
### Layer 2: Runtime Decision Signals (Dynamic)
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
The table below is illustrative, not exhaustive. It is a reasoning aid, not a locked menu.
|
|
51
|
-
Do not force the project into the nearest listed stack if repository evidence, delivery constraints, team fit, hosting realities, or newer ecosystem signals point somewhere else.
|
|
52
|
-
When a better-fit stack is outside this table, prefer the better fit and explain the measurable trade-off clearly.
|
|
45
|
+
**Location**: dynamic runtime intelligence from project context, repository evidence, and live research.
|
|
53
46
|
|
|
54
|
-
|
|
47
|
+
Runtime signals are evidence gates, not style cues or popularity rankings.
|
|
48
|
+
Do not force the project into a listed stack when repository evidence, delivery constraints, or ecosystem reality require another shape.
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
| -------------------- | -------------------------- | ------------------------- |
|
|
58
|
-
| TypeScript / Node.js | JS ecosystem + rapid API | JavaScript/Node projects |
|
|
59
|
-
| Python | data + service velocity | Python projects |
|
|
60
|
-
| Go | low-latency service target | Go services |
|
|
61
|
-
| Java / Kotlin | enterprise JVM constraints | JVM projects |
|
|
62
|
-
| Rust | memory-safe performance | Systems language projects |
|
|
63
|
-
| C# / .NET | Microsoft platform fit | .NET projects |
|
|
64
|
-
| PHP | legacy/web compatibility | PHP projects |
|
|
65
|
-
| Ruby on Rails | product iteration speed | Rails projects |
|
|
66
|
-
| Flutter | single-codebase mobile | Flutter mobile apps |
|
|
67
|
-
| React Native | JS-native mobile delivery | React Native mobile apps |
|
|
50
|
+
**What to do**: For fresh projects, recommend the runtime/framework from the first brief, current constraints, and live official documentation before coding. For existing projects, inspect repo evidence directly and treat detected markers as evidence only, not migration or design direction. Ignore pattern frequency, external rankings, and remembered defaults.
|
|
68
51
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
---
|
|
52
|
+
### Layer 3: Structural Planning Signals (Dynamic)
|
|
72
53
|
|
|
73
|
-
|
|
54
|
+
**Location**: dynamic structural planning signals from repository context, docs, runtime constraints, and live research.
|
|
74
55
|
|
|
75
|
-
|
|
56
|
+
Structural planning signals are not a hard whitelist.
|
|
76
57
|
|
|
77
|
-
|
|
78
|
-
The table below lists common internal playbook patterns, but it is not exhaustive and it is not a hard whitelist.
|
|
79
|
-
If the project needs a better architecture shape than the listed examples, adapt the playbook or synthesize a new one from repo evidence, domain constraints, and runtime realities.
|
|
80
|
-
Do not contort the project to fit the closest existing label.
|
|
81
|
-
|
|
82
|
-
Example playbook patterns:
|
|
83
|
-
|
|
84
|
-
| Architecture Playbook | Use Case |
|
|
85
|
-
| ------------------------ | -------------------------- |
|
|
86
|
-
| `api-nextjs` | Next.js API projects |
|
|
87
|
-
| `nestjs-logic` | NestJS modules |
|
|
88
|
-
| `fastapi-service` | FastAPI services |
|
|
89
|
-
| `spring-boot-api` | Spring Boot APIs |
|
|
90
|
-
| `go-service` | Go HTTP services |
|
|
91
|
-
| `aspnet-api` | ASP.NET Minimal APIs |
|
|
92
|
-
| `laravel-api` | Laravel APIs |
|
|
93
|
-
| `graphql-grpc-api` | GraphQL / gRPC definitions |
|
|
94
|
-
| `ci-github-actions` | GitHub Actions CI/CD |
|
|
95
|
-
| `ci-gitlab` | GitLab CI/CD |
|
|
96
|
-
| `kubernetes-manifests` | K8s deployments |
|
|
97
|
-
| `infrastructure-as-code` | IaC patterns |
|
|
98
|
-
| `observability` | OpenTelemetry stack |
|
|
99
|
-
| `mobile-app` | Mobile app structure |
|
|
100
|
-
|
|
101
|
-
**What to do**: When the user asks for a new project or module, choose or synthesize the best-fit playbook based on the real problem, then scaffold accordingly. Explain why that shape is better than the nearest generic default.
|
|
102
|
-
|
|
103
|
-
---
|
|
58
|
+
**What to do**: When the user asks for a new project or module, extract the real constraints, system 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.
|
|
104
59
|
|
|
105
60
|
### Layer 4: Execution Contracts (Dynamic)
|
|
106
61
|
|
|
107
62
|
**Location**: dynamic execution contracts from prompts, review checklists, and policy thresholds.
|
|
108
63
|
|
|
109
|
-
|
|
64
|
+
Active contract families:
|
|
110
65
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
| **Review contract** | Defect/risk-focused quality review | `.agent-context/review-checklists/pr-checklist.md`, `.agent-context/review-checklists/architecture-review.md` | Any review or PR-intent request |
|
|
116
|
-
| **Release contract** | Validation and release posture checks | `.agent-context/policies/llm-judge-threshold.json`, `scripts/release-gate.mjs` | Any release or publish flow |
|
|
66
|
+
- **Implementation contract** - build and refactor flow plus architecture guardrails
|
|
67
|
+
- **Design contract** - UI intent, responsiveness, and design consistency
|
|
68
|
+
- **Review contract** - defect and risk focused quality review
|
|
69
|
+
- **Release contract** - validation and release posture checks
|
|
117
70
|
|
|
118
71
|
**What to do**: Resolve the active contract for the request, then enforce every mandatory check before declaring completion.
|
|
119
72
|
|
|
120
|
-
---
|
|
121
|
-
|
|
122
73
|
### Layer 5: Prompts (4 Request Templates)
|
|
123
74
|
|
|
124
75
|
**Location**: `.agent-context/prompts/`
|
|
125
76
|
|
|
126
77
|
Meta-prompts that provide complete workflows for common scenarios:
|
|
127
78
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
| `review-code.md` | "review", "audit", "check", "analyze" → Deep architectural review |
|
|
133
|
-
| `bootstrap-design.md` | "ui", "ux", "layout", "screen", "tailwind", "frontend", "redesign" → UI Design Mode |
|
|
134
|
-
|
|
135
|
-
**What to do**: When user request matches a trigger, load the full prompt to understand the workflow.
|
|
136
|
-
For UI-only requests, keep context isolated: load `bootstrap-design.md` and `frontend-architecture.md` first, and do not eagerly load unrelated backend-only rules such as `database-design.md`, `docker-runtime.md`, or `microservices.md` unless the request explicitly crosses those boundaries.
|
|
137
|
-
For design work, treat only the current repo evidence, the current brief, current project docs, and explicitly approved reference systems as valid style context. Do not let prior-chat or unrelated-project visual memory steer the result unless the user explicitly asks for continuity.
|
|
138
|
-
For accessibility in UI work, treat WCAG 2.2 AA as the hard compliance floor and APCA as advisory perceptual tuning only.
|
|
139
|
-
For UI review, use structured design execution evidence first: `designExecutionPolicy`, `docs/DESIGN.md`, `repoEvidence.designEvidenceSummary`, and the changed UI diff. Do not require screenshot capture as a baseline dependency.
|
|
79
|
+
- `init-project.md` -> create, build, new project, scaffold
|
|
80
|
+
- `refactor.md` -> refactor, improve, clean up, fix
|
|
81
|
+
- `review-code.md` -> review, audit, check, analyze
|
|
82
|
+
- `bootstrap-design.md` -> ui, ux, layout, screen, tailwind, frontend, redesign
|
|
140
83
|
|
|
141
|
-
|
|
84
|
+
**What to do**: When a request matches a trigger, load the matching prompt. For UI-only requests, keep context isolated: load `bootstrap-design.md` and `frontend-architecture.md` first, and do not eagerly load unrelated backend-only rules such as `database-design.md`, `docker-runtime.md`, `microservices.md`, `git-workflow.md`, or general implementation-theory rules unless the request explicitly crosses those boundaries. For design work, the only valid style context is the current repo evidence, the current brief, and current project docs. External references, prior-chat memory, unrelated-project visuals, and remembered screenshots are tainted unless the user turns them into explicit current-task constraints. Treat WCAG 2.2 AA as the hard compliance floor and APCA as advisory perceptual tuning only. Do not require screenshot capture as a baseline dependency.
|
|
142
85
|
|
|
143
86
|
### Layer 6: Governance Modes (Dynamic)
|
|
144
87
|
|
|
145
88
|
**Location**: dynamic governance context from state files, policies, and repository norms.
|
|
146
89
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
| Governance Mode | Default Stack Bias | CI Mode | When |
|
|
150
|
-
| --------------- | -------------------- | ---------------------------- | ------------------------------- |
|
|
151
|
-
| **platform** | Go | Strict (critical+high block) | Shared infrastructure teams |
|
|
152
|
-
| **regulated** | TypeScript + Java | Blocking (all severities) | Financial/healthcare/compliance |
|
|
153
|
-
| **startup** | TypeScript + Next.js | Permissive (critical only) | Speed-focused orgs |
|
|
90
|
+
**What to do**: Check `.agent-context/state/` and policy thresholds for governance mode signals, then apply matching defaults without overloading narrow tasks with irrelevant ceremony.
|
|
154
91
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
### Layer 7: State & Benchmarks
|
|
92
|
+
### Layer 7: State and Benchmarks
|
|
160
93
|
|
|
161
94
|
**Location**: `.agent-context/state/`
|
|
162
95
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
| File | Purpose |
|
|
166
|
-
| --------------------------- | ----------------------------------------- |
|
|
167
|
-
| `architecture-map.md` | Critical-path modules, change risk zones |
|
|
168
|
-
| `dependency-map.md` | Allowed dependencies, anti-cycle guidance |
|
|
169
|
-
| `benchmark-analysis.json` | Performance baselines |
|
|
170
|
-
| `benchmark-thresholds.json` | Performance gates |
|
|
171
|
-
| `benchmark-watchlist.json` | Monitored metrics |
|
|
172
|
-
|
|
173
|
-
**What to do**: Before major modifications, read `architecture-map.md` to understand risk zones.
|
|
174
|
-
|
|
175
|
-
---
|
|
96
|
+
Use these files for risk zones, dependency boundaries, benchmarks, and continuity metadata when the task actually needs them.
|
|
176
97
|
|
|
177
|
-
### Layer 8: Policies
|
|
98
|
+
### Layer 8: Policies and Thresholds
|
|
178
99
|
|
|
179
100
|
**Location**: `.agent-context/policies/`
|
|
180
101
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
| File | Content |
|
|
184
|
-
| -------------------------- | ------------------------------------------ |
|
|
185
|
-
| `llm-judge-threshold.json` | LLM quality gates, skill tier requirements |
|
|
186
|
-
|
|
187
|
-
**What to do**: Check your AI model's tier (beginner/balanced/advanced/expert) before complex tasks. Refuse work outside your tier.
|
|
188
|
-
|
|
189
|
-
---
|
|
102
|
+
Use policy files such as `llm-judge-threshold.json` for quality gates, release thresholds, and audit posture.
|
|
190
103
|
|
|
191
104
|
### Layer 9: Project Context (Optional)
|
|
192
105
|
|
|
193
106
|
**Location**: `docs/`
|
|
194
107
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
| File | Purpose |
|
|
198
|
-
| --------------------------------- | ---------------------------------------------- |
|
|
199
|
-
| `project-brief.md` | Project name, description, goals, constraints |
|
|
200
|
-
| `architecture-decision-record.md` | Stack justification and architecture decisions |
|
|
201
|
-
| `database-schema.md` | Initial database schema plan |
|
|
202
|
-
| `api-contract.md` | Endpoint plan and API design |
|
|
203
|
-
| `flow-overview.md` | Data and user flow diagrams |
|
|
108
|
+
If project-specific docs exist, treat them as the source of truth for what to build:
|
|
204
109
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
110
|
+
- `project-brief.md`
|
|
111
|
+
- `architecture-decision-record.md`
|
|
112
|
+
- `database-schema.md`
|
|
113
|
+
- `api-contract.md`
|
|
114
|
+
- `flow-overview.md`
|
|
115
|
+
- `DESIGN.md`
|
|
116
|
+
- `design-intent.json`
|
|
208
117
|
|
|
209
118
|
### MCP Servers
|
|
210
119
|
|
|
211
120
|
**Location**: `mcp.json`
|
|
212
121
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
| Server | Purpose | Transport |
|
|
216
|
-
| ------ | ------------------------------------------ | --------- |
|
|
217
|
-
| `lint` | Code validation via `scripts/validate.mjs` | stdio |
|
|
218
|
-
| `test` | Test execution via `tests/**/*.test.mjs` | stdio |
|
|
219
|
-
|
|
220
|
-
**What to do**: Invoke MCP servers when you need validation, linting, or test execution.
|
|
122
|
+
Use available MCP tools when you need validation, linting, or test execution.
|
|
221
123
|
|
|
222
124
|
---
|
|
223
125
|
|
|
224
126
|
## Mandatory Triggers
|
|
225
127
|
|
|
226
|
-
### 1.
|
|
128
|
+
### 1. New Project Planning
|
|
227
129
|
|
|
228
|
-
**Trigger**: User says "create", "build", "new project", "scaffold"
|
|
130
|
+
**Trigger**: User says "create", "build", "new project", or "scaffold"
|
|
229
131
|
|
|
230
132
|
**Workflow**:
|
|
231
133
|
|
|
232
|
-
1.
|
|
233
|
-
2. Read `.agent-context/prompts/init-project.md`
|
|
234
|
-
3. Infer
|
|
235
|
-
4. Produce architecture
|
|
236
|
-
5. **WAIT for user approval** before generating code
|
|
134
|
+
1. Resolve the relevant rules from `.agent-context/rules/` for the requested scope.
|
|
135
|
+
2. Read `.agent-context/prompts/init-project.md` for the full init workflow.
|
|
136
|
+
3. Infer runtime constraints, required docs, and structural boundaries from requirements, docs, repository evidence, and live research.
|
|
137
|
+
4. Produce scope, required docs, implementation boundaries, and a runtime/architecture recommendation when those decisions are unresolved.
|
|
138
|
+
5. **WAIT for user approval** before generating code.
|
|
237
139
|
|
|
238
140
|
### 2. Refactor Mode (EXISTING CODE)
|
|
239
141
|
|
|
240
|
-
**Trigger**: User says "refactor", "improve", "fix", "clean up"
|
|
142
|
+
**Trigger**: User says "refactor", "improve", "fix", or "clean up"
|
|
241
143
|
|
|
242
144
|
**Workflow**:
|
|
243
145
|
|
|
244
|
-
1.
|
|
245
|
-
2. Read `.agent-context/prompts/refactor.md`
|
|
246
|
-
3. Apply relevant execution contract from prompts
|
|
247
|
-
4. Propose plan
|
|
248
|
-
5. **WAIT for approval
|
|
146
|
+
1. Resolve the relevant rules from `.agent-context/rules/` for the touched scope.
|
|
147
|
+
2. Read `.agent-context/prompts/refactor.md` for the safety-first workflow.
|
|
148
|
+
3. Apply the relevant execution contract from prompts and checklists.
|
|
149
|
+
4. Propose plan before executing changes.
|
|
150
|
+
5. **WAIT for approval**.
|
|
249
151
|
|
|
250
152
|
### 3. Code Review Mode
|
|
251
153
|
|
|
252
|
-
**Trigger**: User says "review", "audit", "check", "analyze"
|
|
154
|
+
**Trigger**: User says "review", "audit", "check", or "analyze"
|
|
253
155
|
|
|
254
156
|
**Workflow**:
|
|
255
157
|
|
|
256
|
-
1. Load `.agent-context/review-checklists/pr-checklist.md
|
|
257
|
-
2. Load `.agent-context/review-checklists/architecture-review.md
|
|
258
|
-
3. Execute review against
|
|
259
|
-
4. Generate structured report
|
|
158
|
+
1. Load `.agent-context/review-checklists/pr-checklist.md`.
|
|
159
|
+
2. Load `.agent-context/review-checklists/architecture-review.md`.
|
|
160
|
+
3. Execute review against the active rules and contracts.
|
|
161
|
+
4. Generate a structured report.
|
|
260
162
|
|
|
261
163
|
### 4. UI Design Mode
|
|
262
164
|
|
|
@@ -264,79 +166,76 @@ Available external tools and services:
|
|
|
264
166
|
|
|
265
167
|
**Workflow**:
|
|
266
168
|
|
|
267
|
-
1. Read `.agent-context/prompts/bootstrap-design.md
|
|
268
|
-
2. Read `.agent-context/rules/frontend-architecture.md
|
|
269
|
-
3. Read UI-relevant repository evidence from `.agent-context/state/onboarding-report.json`, current UI code, and `docs
|
|
270
|
-
4. Generate or refine `docs/DESIGN.md` plus `docs/design-intent.json` before UI implementation
|
|
271
|
-
5. Keep context isolated
|
|
169
|
+
1. Read `.agent-context/prompts/bootstrap-design.md`.
|
|
170
|
+
2. Read `.agent-context/rules/frontend-architecture.md`.
|
|
171
|
+
3. Read UI-relevant repository evidence from `.agent-context/state/onboarding-report.json`, current UI code, and `docs/*`.
|
|
172
|
+
4. Generate or refine `docs/DESIGN.md` plus `docs/design-intent.json` before UI implementation.
|
|
173
|
+
5. Keep context isolated and do not eagerly load unrelated backend-only rules unless the task explicitly touches those boundaries.
|
|
272
174
|
|
|
273
175
|
---
|
|
274
176
|
|
|
275
177
|
## The Reasoning Chain (MANDATORY)
|
|
276
178
|
|
|
277
|
-
Every time you reject
|
|
179
|
+
Every time you reject an approach or enforce a rule:
|
|
278
180
|
|
|
279
|
-
```
|
|
181
|
+
```text
|
|
280
182
|
REASONING CHAIN
|
|
281
|
-
Problem: [
|
|
282
|
-
|
|
283
|
-
Why
|
|
183
|
+
Problem: [why the current approach is dangerous or unprofessional]
|
|
184
|
+
Required Action: [the production-grade boundary to apply]
|
|
185
|
+
Why Required: [why the boundary protects the project]
|
|
284
186
|
```
|
|
285
187
|
|
|
286
188
|
---
|
|
287
189
|
|
|
288
190
|
## Definition of Done
|
|
289
191
|
|
|
290
|
-
**
|
|
192
|
+
**Never claim "done"** without:
|
|
291
193
|
|
|
292
|
-
1. All relevant rules from `.agent-context/rules/` applied
|
|
293
|
-
2. Code reviewed against `.agent-context/review-checklists/pr-checklist.md` and `.agent-context/review-checklists/architecture-review.md
|
|
294
|
-
3. Universal SOP hard gates satisfied (`docs/architecture-decision-record.md`, and `docs/DESIGN.md` plus `docs/design-intent.json` for UI scope)
|
|
295
|
-
4. MCP validation passed (`npm run validate`)
|
|
194
|
+
1. All relevant rules from `.agent-context/rules/` applied.
|
|
195
|
+
2. Code reviewed against `.agent-context/review-checklists/pr-checklist.md` and `.agent-context/review-checklists/architecture-review.md`.
|
|
196
|
+
3. Universal SOP hard gates satisfied (`docs/architecture-decision-record.md`, and `docs/DESIGN.md` plus `docs/design-intent.json` for UI scope).
|
|
197
|
+
4. MCP validation passed (`npm run validate`).
|
|
296
198
|
|
|
297
199
|
---
|
|
298
200
|
|
|
299
201
|
## Knowledge Inventory Checklist
|
|
300
202
|
|
|
301
|
-
|
|
203
|
+
Verify that all nine layers are reachable:
|
|
302
204
|
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
205
|
+
- Layer 1: Rules
|
|
206
|
+
- Layer 2: Stack Strategy Signals
|
|
207
|
+
- Layer 3: Structural Planning Signals
|
|
208
|
+
- Layer 4: Execution Contracts
|
|
209
|
+
- Layer 5: Prompts
|
|
210
|
+
- Layer 6: Governance Modes
|
|
211
|
+
- Layer 7: State
|
|
212
|
+
- Layer 8: Policies
|
|
213
|
+
- Layer 9: Project Context
|
|
312
214
|
|
|
313
|
-
|
|
215
|
+
If a required layer is unreachable, report it instead of pretending the context exists.
|
|
314
216
|
|
|
315
217
|
---
|
|
316
218
|
|
|
317
219
|
## How Injection Works
|
|
318
220
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
4. **When a trigger matches**, you navigate to the specific layer files
|
|
325
|
-
5. **You load domain-specific knowledge** as needed
|
|
326
|
-
6. **You apply all mandatory checks** before shipping
|
|
221
|
+
1. A thin adapter or IDE entrypoint resolves to this file as the canonical baseline.
|
|
222
|
+
2. If `.agent-instructions.md` exists, read it next as the compiled project-specific snapshot.
|
|
223
|
+
3. Use the layer index to determine what is available.
|
|
224
|
+
4. Load only the domain-specific layers required by the request.
|
|
225
|
+
5. Apply the active contracts and checks before shipping.
|
|
327
226
|
|
|
328
|
-
**Result**:
|
|
227
|
+
**Result**: full context availability without forcing eager loading or irrelevant governance noise.
|
|
329
228
|
|
|
330
229
|
---
|
|
331
230
|
|
|
332
|
-
##
|
|
231
|
+
## Operating Gates
|
|
333
232
|
|
|
334
|
-
- **Before code**:
|
|
335
|
-
- **Before PR**: Run `.agent-context/review-checklists/pr-checklist.md
|
|
336
|
-
- **Before deploy**: Check `.agent-context/policies/llm-judge-threshold.json
|
|
337
|
-
- **Before major refactor**: Read `.agent-context/state/architecture-map.md
|
|
338
|
-
- **
|
|
233
|
+
- **Before code**: Resolve only the active rule files plus the active execution contract.
|
|
234
|
+
- **Before PR**: Run `.agent-context/review-checklists/pr-checklist.md`.
|
|
235
|
+
- **Before deploy**: Check `.agent-context/policies/llm-judge-threshold.json`.
|
|
236
|
+
- **Before major refactor**: Read `.agent-context/state/architecture-map.md`.
|
|
237
|
+
- **Before UI implementation**: confirm the valid style context, the explicit design contract, and the required docs.
|
|
339
238
|
|
|
340
239
|
---
|
|
341
240
|
|
|
342
|
-
**Start here. If `.agent-instructions.md` exists, read it next. Otherwise continue directly into the layers.**
|
|
241
|
+
**Start here. If `.agent-instructions.md` exists, read it next. Otherwise continue directly into the relevant layers.**
|
package/.windsurfrules
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
|
|
2
2
|
|
|
3
|
-
Generated by Agentic-Senior-Core CLI v3.0.
|
|
4
|
-
Timestamp: 2026-04-
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v3.0.21
|
|
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
|
-
|
|
19
|
+
Resolve the smallest relevant layer set before responding. Do not eagerly load unrelated layers:
|
|
20
20
|
1. .agent-context/rules/
|
|
21
|
-
2. Resolve
|
|
21
|
+
2. Resolve runtime and architecture signals from project context, repo evidence, and live research.
|
|
22
22
|
3. .agent-context/prompts/
|
|
23
|
-
4. Dynamic
|
|
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:
|
|
32
|
-
|
|
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
|
-
|
|
50
|
-
## LAYER 2:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|
56
|
-
Additional
|
|
57
|
-
Load
|
|
58
|
-
Avoid eager loading unrelated
|
|
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,
|
|
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:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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)
|
package/AGENTS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Adapter Mode: thin
|
|
4
4
|
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256:
|
|
5
|
+
Canonical Snapshot SHA256: e6984d32169e98e32c9e6b6d6209bb2613b63b22d1e66af63a70788be00c55d5
|
|
6
6
|
|
|
7
7
|
This file is an adapter entrypoint for agent discovery.
|
|
8
8
|
The canonical policy source is [.instructions.md](.instructions.md).
|
|
@@ -16,7 +16,7 @@ If your host stops at this file instead of following the full chain, obey the Cr
|
|
|
16
16
|
- For UI, UX, layout, screen, tailwind, frontend, or redesign requests: load [.agent-context/prompts/bootstrap-design.md](.agent-context/prompts/bootstrap-design.md) and [.agent-context/rules/frontend-architecture.md](.agent-context/rules/frontend-architecture.md) before editing code.
|
|
17
17
|
- For UI scope: if `docs/DESIGN.md` or `docs/design-intent.json` is missing, materialize or refine them before implementing UI changes.
|
|
18
18
|
- For refactor, improve, clean up, or fix requests: inspect the active rules and propose a plan before editing.
|
|
19
|
-
- For new project or module requests:
|
|
19
|
+
- For new project or module requests: clarify constraints, stack decisions, and required docs before generating code.
|
|
20
20
|
- For ecosystem, framework, dependency, or Docker claims: perform live web research instead of relying on stale local heuristics.
|
|
21
21
|
|
|
22
22
|
## Mandatory Bootstrap Chain
|
|
@@ -28,11 +28,11 @@ If your host stops at this file instead of following the full chain, obey the Cr
|
|
|
28
28
|
5. Enforce review contracts from [.agent-context/review-checklists/](.agent-context/review-checklists).
|
|
29
29
|
6. Read change-risk maps and continuity state from [.agent-context/state/](.agent-context/state).
|
|
30
30
|
7. Enforce policy thresholds from [.agent-context/policies/](.agent-context/policies).
|
|
31
|
-
8. Use dynamic stack and
|
|
31
|
+
8. Use dynamic stack, structure, and live research signals from project context docs.
|
|
32
32
|
|
|
33
33
|
## Trigger Rules
|
|
34
34
|
|
|
35
|
-
- New project or module requests: propose
|
|
35
|
+
- New project or module requests: propose scope, constraints, and required docs first, then wait for approval.
|
|
36
36
|
- Refactor or fix requests: propose plan first, then execute safely.
|
|
37
37
|
- Completion: run [.agent-context/review-checklists/pr-checklist.md](.agent-context/review-checklists/pr-checklist.md) before declaring done.
|
|
38
38
|
|