@ryuenn3123/agentic-senior-core 3.0.17 → 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.
- package/.agent-context/prompts/bootstrap-design.md +84 -94
- 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 +66 -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 +438 -335
- package/lib/cli/project-scaffolder/discovery.mjs +36 -82
- package/lib/cli/project-scaffolder/prompt-builders.mjs +55 -63
- package/lib/cli/project-scaffolder/storage.mjs +0 -4
- 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 +57 -36
- package/scripts/llm-judge.mjs +1 -1
- package/scripts/mcp-server/constants.mjs +60 -0
- package/scripts/mcp-server/tool-registry.mjs +149 -0
- package/scripts/mcp-server/tools.mjs +446 -0
- package/scripts/mcp-server.mjs +23 -661
- package/scripts/release-gate/audit-checks.mjs +426 -0
- package/scripts/release-gate/constants.mjs +53 -0
- package/scripts/release-gate/runtime.mjs +63 -0
- package/scripts/release-gate/static-checks.mjs +182 -0
- package/scripts/release-gate.mjs +13 -794
- 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/constants.mjs +24 -0
- package/scripts/ui-design-judge/design-execution-summary.mjs +259 -0
- package/scripts/ui-design-judge/git-input.mjs +131 -0
- package/scripts/ui-design-judge/prompting.mjs +73 -0
- package/scripts/ui-design-judge/providers.mjs +102 -0
- package/scripts/ui-design-judge/reporting.mjs +182 -0
- package/scripts/ui-design-judge/rubric-calibration.mjs +214 -0
- package/scripts/ui-design-judge/rubric-goldset.json +188 -0
- package/scripts/ui-design-judge.mjs +166 -771
- package/scripts/ui-rubric-calibration.mjs +35 -0
- package/scripts/validate/config.mjs +198 -55
- package/scripts/validate/coverage-checks.mjs +32 -7
- package/scripts/validate.mjs +8 -4
- package/lib/cli/architect.mjs +0 -431
|
@@ -1,103 +1,93 @@
|
|
|
1
|
-
|
|
2
1
|
# Bootstrap Dynamic Design Contract
|
|
3
2
|
|
|
4
|
-
When a user requests
|
|
5
|
-
- `docs/DESIGN.md` for human-readable design
|
|
6
|
-
- `docs/design-intent.json` for machine-readable intent,
|
|
3
|
+
When a user requests UI, UX, frontend layout, screen, Tailwind, animation, or redesign work, create or refine:
|
|
4
|
+
- `docs/DESIGN.md` for human-readable design reasoning
|
|
5
|
+
- `docs/design-intent.json` for machine-readable design intent, guardrails, and review signals
|
|
6
|
+
|
|
7
|
+
This contract is a decision scaffold, not a style preset. It must guide the LLM to choose well from the current repo, current user brief, current project docs, and live official documentation when a technology or library claim matters.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
## Core Rule
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
- Load [AGENTS.md](../../AGENTS.md), [frontend-architecture.md](../rules/frontend-architecture.md), this prompt, UI-relevant state files, current UI code, and existing design docs first.
|
|
12
|
-
- Do not eagerly load backend-only rules such as [database-design.md](../rules/database-design.md), [docker-runtime.md](../rules/docker-runtime.md), or [microservices.md](../rules/microservices.md) unless the task explicitly crosses those boundaries.
|
|
13
|
-
- Treat UI consistency, accessibility, and cross-viewport adaptation as first-class constraints, not cosmetic afterthoughts.
|
|
14
|
-
- Start the visual language from the current project context, not from prior website references or remembered layouts from earlier chats.
|
|
11
|
+
We guide the agent; we do not pick the final style, stack, framework, palette, typography, layout paradigm, or animation library offline.
|
|
15
12
|
|
|
16
13
|
The agent must:
|
|
17
|
-
1. Read [AGENTS.md](../../AGENTS.md)
|
|
18
|
-
2.
|
|
19
|
-
3.
|
|
20
|
-
4.
|
|
21
|
-
5.
|
|
22
|
-
6.
|
|
23
|
-
7.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
14
|
+
1. Read [AGENTS.md](../../AGENTS.md), this prompt, [frontend-architecture.md](../rules/frontend-architecture.md), current UI code, current project docs, and existing design docs before UI edits.
|
|
15
|
+
2. If `docs/DESIGN.md` or `docs/design-intent.json` exists, refine them instead of replacing them blindly.
|
|
16
|
+
3. If either design doc is missing, create it before UI implementation.
|
|
17
|
+
4. Use current repo evidence, product copy, route names, component names, user goals, and existing constraints as the source of truth.
|
|
18
|
+
5. Treat prior-chat visuals, unrelated project memory, benchmark screenshots, and famous-product aesthetics as tainted unless the user explicitly asks for continuity.
|
|
19
|
+
6. When choosing a new UI, animation, styling, or component library, research current official docs and choose the latest stable compatible option for this project. Do not rely on offline defaults.
|
|
20
|
+
7. Keep external references non-copying: extract constraints and reasoning only, never clone the surface.
|
|
21
|
+
|
|
22
|
+
## Design Quality Bar
|
|
23
|
+
|
|
24
|
+
The UI must feel authored by a strong UI/UX designer, not assembled from default cards and safe framework chrome.
|
|
25
|
+
|
|
26
|
+
Do:
|
|
27
|
+
- Synthesize a visual direction from the project context and explain why it fits.
|
|
28
|
+
- Choose color, typography, spacing, motion, density, and component morphology dynamically from the product and audience.
|
|
29
|
+
- Use modern, expressive interaction when it improves hierarchy, feedback, delight, confidence, or memorability.
|
|
30
|
+
- Keep frontend code clean, componentized, accessible, and easy to maintain.
|
|
31
|
+
- Use tokens and semantic aliases so future changes do not require rewriting components.
|
|
32
|
+
- Make design decisions explicit before coding, then implement consistently.
|
|
33
|
+
|
|
34
|
+
Do not:
|
|
35
|
+
- Default to generic SaaS heroes, balanced card grids, soft startup gradients, or dashboard chrome without product rationale.
|
|
36
|
+
- Let desktop, tablet, and mobile be the same design merely scaled down.
|
|
37
|
+
- Let heading, body, data, and metadata collapse into one safe typographic treatment without rationale.
|
|
38
|
+
- Reuse colors, layout shapes, or motion signatures from unrelated memory.
|
|
39
|
+
- Add decorative animation that hurts clarity, accessibility, or runtime performance.
|
|
40
|
+
- Choose a dependency because this repo scaffold mentioned it. The LLM must verify fit from current project context and official docs.
|
|
41
|
+
|
|
42
|
+
## Responsive Rule
|
|
43
|
+
|
|
44
|
+
Responsive design means recomposition, not resizing.
|
|
45
|
+
|
|
46
|
+
For every UI task, define how major surfaces change across mobile, tablet, and desktop:
|
|
47
|
+
- What is reordered, merged, hidden, disclosed, or promoted?
|
|
48
|
+
- What interaction changes for touch and narrow screens?
|
|
49
|
+
- What content priority changes by viewport?
|
|
50
|
+
- What is explicitly forbidden, such as scale-only shrink or preserving desktop order without reason?
|
|
51
|
+
|
|
52
|
+
## Required `docs/DESIGN.md` Sections
|
|
53
|
+
|
|
42
54
|
1. Design Intent and Product Personality
|
|
43
55
|
2. Audience and Use-Context Signals
|
|
44
56
|
3. Visual Direction and Distinctive Moves
|
|
45
|
-
4. Color
|
|
46
|
-
5.
|
|
47
|
-
6.
|
|
48
|
-
7.
|
|
49
|
-
8.
|
|
50
|
-
9.
|
|
51
|
-
10.
|
|
52
|
-
11.
|
|
53
|
-
12.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- `
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- Create or update both `docs/DESIGN.md` and `docs/design-intent.json`.
|
|
83
|
-
- Keep both files synchronized: the markdown explains the why, the JSON captures the contract in machine-readable form.
|
|
84
|
-
- `docs/design-intent.json` must define a real token system, not just loose style notes. Include primitive, semantic, and component layers plus aliasing rules and naming constraints.
|
|
85
|
-
- `docs/design-intent.json` must include deterministic fields for `colorTruth.format`, `colorTruth.allowHexDerivatives`, and `crossViewportAdaptation.mutationRules.mobile/tablet/desktop`.
|
|
86
|
-
- `docs/design-intent.json` must also include `motionSystem` and `componentMorphology` so future UI work preserves state behavior and purposeful motion without collapsing into generic static output.
|
|
87
|
-
- `docs/design-intent.json` must also include `accessibilityPolicy` so the hard compliance floor, advisory contrast model, and blocking-vs-advisory checks stay machine-readable.
|
|
88
|
-
- `docs/design-intent.json` must also include `visualQaPolicy` so deterministic screenshot expectations, masking rules, viewport coverage, long-page capture strategy, stability thresholds, and semantic-escalation boundaries stay machine-readable.
|
|
89
|
-
- `docs/design-intent.json` must include `contextHygiene` so valid design sources, tainted carryover sources, and continuity rules are machine-readable.
|
|
90
|
-
- If onboarding or detector evidence exists, preserve it under `repoEvidence.designEvidenceSummary` instead of throwing away the machine-readable snapshot of the current UI system.
|
|
91
|
-
- Token intent must stay structure-first: primitive tokens hold raw values, semantic tokens carry purpose, and component tokens consume semantic tokens instead of bypassing them with raw values.
|
|
92
|
-
- Color intent must be defined in a perceptual or relational color model first. Hex values may appear only as implementation derivatives.
|
|
93
|
-
- The contract must encode viewport mutation rules, not just breakpoint names.
|
|
94
|
-
- Motion guidance must preserve creativity: allow meaningful animation, define reduced-motion behavior, and optimize choreography instead of suppressing it by default.
|
|
95
|
-
- Accessibility guidance must split hard compliance from advisory tuning: treat WCAG 2.2 AA as the minimum blocking floor and APCA as advisory perceptual guidance for readability nuance, especially in typography and dark mode.
|
|
96
|
-
- Accessibility scope must include focus visibility, focus appearance, target size, accessible authentication, keyboard access, use-of-color-only failures, and dynamic status/state access.
|
|
97
|
-
- Visual QA guidance must define deterministic-first screenshot review, noise thresholds, dynamic masking categories, mobile/tablet/desktop coverage, long-page capture strategy, and when semantic review is allowed to intervene.
|
|
98
|
-
- Color direction must come from the current project context. Similarity to prior unrelated projects is drift unless the brief or repo evidence explicitly supports it.
|
|
99
|
-
- If no approved reference system exists, synthesize the design from zero using current product context, constraints, and content only.
|
|
100
|
-
- Explicitly record which sources are allowed to shape the visual language and which sources are tainted unless the user opts into continuity.
|
|
101
|
-
- The resulting system should feel authored and recognizable in screenshots, not politely interchangeable with common template kits.
|
|
102
|
-
- Use practical, modern, accessible language grounded in the project, not generic SaaS defaults or copycat brand systems.
|
|
103
|
-
- Wait for user approval before generating Figma or code assets.
|
|
57
|
+
4. Color, Typography, Spacing, and Density Decisions
|
|
58
|
+
5. Token Architecture and Alias Strategy
|
|
59
|
+
6. Responsive Recomposition Plan
|
|
60
|
+
7. Motion, Interaction, and Feedback Rules
|
|
61
|
+
8. Component Language, States, and Morphology
|
|
62
|
+
9. Source Boundaries and Context Hygiene
|
|
63
|
+
10. Accessibility Non-Negotiables
|
|
64
|
+
11. Anti-Patterns to Avoid
|
|
65
|
+
12. Implementation Notes for Future UI Tasks
|
|
66
|
+
|
|
67
|
+
## Required `docs/design-intent.json` Behavior
|
|
68
|
+
|
|
69
|
+
The JSON must stay machine-readable and project-specific. It should record:
|
|
70
|
+
- the confirmed project context and assumptions to validate
|
|
71
|
+
- agent-chosen visual direction, not scaffold-chosen direction
|
|
72
|
+
- agent-chosen semantic color roles, typography system, spacing rhythm, and motion approach
|
|
73
|
+
- token layering with primitive, semantic, and component tokens
|
|
74
|
+
- viewport mutation rules for mobile, tablet, and desktop
|
|
75
|
+
- interaction-state expectations for key components
|
|
76
|
+
- accessibility hard floor and advisory readability checks
|
|
77
|
+
- review rubric for distinctiveness, contract fidelity, hierarchy, responsive recomposition, motion discipline, and accessibility
|
|
78
|
+
- forbidden patterns that are concrete bad habits for this project
|
|
79
|
+
- repo evidence when available, including `repoEvidence.designEvidenceSummary`
|
|
80
|
+
|
|
81
|
+
## Accessibility and Review
|
|
82
|
+
|
|
83
|
+
WCAG 2.2 AA is the hard floor. APCA may be used only as advisory perceptual tuning and must never waive a WCAG failure.
|
|
84
|
+
|
|
85
|
+
The review must block or flag:
|
|
86
|
+
- inaccessible contrast, focus, target size, keyboard, auth, or dynamic-status behavior
|
|
87
|
+
- scale-only responsive behavior
|
|
88
|
+
- unresearched dependency choices
|
|
89
|
+
- default component-kit styling without product rationale
|
|
90
|
+
- visual direction copied from unrelated memory or external references
|
|
91
|
+
- genericity findings that cannot name the exact drift signal
|
|
92
|
+
|
|
93
|
+
Wait for user approval before generating Figma or code assets when the user only asked for planning or design direction.
|
|
@@ -1,113 +1,45 @@
|
|
|
1
|
-
|
|
2
1
|
# Project Initialization Prompts
|
|
3
2
|
|
|
4
|
-
This prompt boots a repository with strict
|
|
3
|
+
This prompt boots a repository with strict AI coding guidance context.
|
|
5
4
|
|
|
6
5
|
## System Directives (Auto Execution)
|
|
7
6
|
|
|
8
|
-
When a new project is created or initialized, the agent
|
|
9
|
-
1. Read [AGENTS.md](../../AGENTS.md) to understand
|
|
10
|
-
2.
|
|
11
|
-
3. Review dynamic
|
|
12
|
-
4. If Docker or Compose is in scope, load [docker-runtime.md](../rules/docker-runtime.md) and verify the latest official Docker guidance before authoring container assets.
|
|
13
|
-
5. For framework or package setup,
|
|
14
|
-
|
|
15
|
-
## Architect Mode (Recommended)
|
|
16
|
-
If the user describes a project or feature, the agent should:
|
|
17
|
-
1. Propose the most efficient technology stack based on requirements and evidence.
|
|
18
|
-
2. Explain why this stack is the best choice for the project.
|
|
19
|
-
3. Draft a high-level architecture plan.
|
|
20
|
-
4. Wait for user approval before scaffolding the project using the selected architecture playbook.
|
|
21
|
-
|
|
22
|
-
## Direct Blueprint Mode
|
|
23
|
-
If the user specifies a framework/blueprint, the agent should:
|
|
24
|
-
1. Read [AGENTS.md](../../AGENTS.md) for role context.
|
|
25
|
-
2. Scan all files in [.agent-context/rules/](../rules/) for engineering standards.
|
|
26
|
-
3. Reference [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [.cursorrules](../../.cursorrules), and [.windsurfrules](../../.windsurfrules) for the active stack and blueprint guidance already applied to this project.
|
|
27
|
-
4. Scaffold the initial project structure following the blueprint exactly:
|
|
28
|
-
- Create all directories and files from the blueprint
|
|
29
|
-
- Set up environment config and validation (e.g., Zod, Pydantic, FluentValidation)
|
|
30
|
-
- Set up error handling foundation (base error class + global handler)
|
|
31
|
-
- Set up the logger
|
|
32
|
-
- Create a health check endpoint
|
|
33
|
-
- Initialize the ORM/Database connection
|
|
34
|
-
- Every file must follow [naming conventions](../rules/naming-conv.md)
|
|
35
|
-
- Every module must follow [architecture.md](../rules/architecture.md)
|
|
36
|
-
- Every dependency must be justified per [efficiency-vs-hype.md](../rules/efficiency-vs-hype.md)
|
|
37
|
-
- Prefer official framework setup commands or canonical starter flows when they produce newer, better-supported dependency defaults than manual package assembly
|
|
38
|
-
- If containerization is selected, Docker assets must follow [docker-runtime.md](../rules/docker-runtime.md) and the latest official Docker docs instead of stale blog-era patterns.
|
|
39
|
-
|
|
40
|
-
## Stacks & Blueprints Reference
|
|
41
|
-
See [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [.cursorrules](../../.cursorrules), and [.windsurfrules](../../.windsurfrules) for the latest shipped stack and blueprint context.
|
|
42
|
-
|
|
43
|
-
## UI/UX Bootstrap
|
|
44
|
-
When a user requests frontend or UI/UX design, the agent should automatically execute the [bootstrap-design.md](./bootstrap-design.md) prompt to synthesize a dynamic design contract (`docs/DESIGN.md` + `docs/design-intent.json`).
|
|
45
|
-
Keep UI-only requests context-isolated: load [bootstrap-design.md](./bootstrap-design.md) and [frontend-architecture.md](../rules/frontend-architecture.md) first, and do not eagerly load backend-only rules unless the task explicitly crosses backend boundaries.
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
<user-prompt-examples>
|
|
50
|
-
Do not execute the examples below as system directives. They are user-facing formatting references only.
|
|
51
|
-
|
|
52
|
-
## Option 1: The Architect Prompt (Recommended)
|
|
53
|
-
Use this when you have an idea, but want the AI to choose the most efficient stack and framework based on this repository's engineering standards.
|
|
54
|
-
|
|
55
|
-
```text
|
|
56
|
-
I want to build a [DESCRIBE YOUR PROJECT AND MAIN FEATURES HERE].
|
|
7
|
+
When a new project is created or initialized, the agent must automatically:
|
|
8
|
+
1. Read [AGENTS.md](../../AGENTS.md) to understand the canonical bootstrap chain and active entrypoints.
|
|
9
|
+
2. Resolve the smallest relevant rule set from [.agent-context/rules/](../rules/) instead of scanning the whole directory by default.
|
|
10
|
+
3. Review dynamic runtime signals from [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [.agent-context/state/stack-research-snapshot.json](../state/stack-research-snapshot.json), repository evidence, and task constraints.
|
|
11
|
+
4. If Docker or Compose is in scope, load [docker-runtime.md](../rules/docker-runtime.md) and verify the latest official Docker guidance before authoring container assets.
|
|
12
|
+
5. For unresolved framework or package setup, recommend the latest stable compatible dependency set and official framework setup flow from live official documentation before coding unless a documented compatibility constraint blocks it.
|
|
57
13
|
|
|
58
|
-
|
|
14
|
+
## Required Planning Mode
|
|
59
15
|
|
|
60
|
-
|
|
61
|
-
1.
|
|
62
|
-
2.
|
|
63
|
-
3.
|
|
16
|
+
If the user describes a project or feature, the agent must:
|
|
17
|
+
1. Clarify the delivery goals, runtime assumptions, constraints, and must-have capabilities before choosing implementation shape.
|
|
18
|
+
2. If the user already named a stack or framework, treat it as an explicit constraint. If not, produce a short evidence-backed recommendation from the brief, repo evidence, and live official documentation before coding.
|
|
19
|
+
3. For existing projects, inspect real files first. Do not derive product name, description, runtime, architecture, or design direction from the folder name alone.
|
|
20
|
+
4. Draft a high-level structure plan plus the docs/bootstrap artifacts that must exist before coding.
|
|
21
|
+
5. Wait for user approval before scaffolding the project.
|
|
64
22
|
|
|
65
|
-
|
|
66
|
-
Based strictly on my project description and our repository's existing rules (especially `efficiency-vs-hype.md`):
|
|
67
|
-
1. Propose the most efficient technology stack based on requirements and evidence.
|
|
68
|
-
2. Explain WHY this stack is the best choice for this specific project.
|
|
69
|
-
3. Draft a high-level architecture plan.
|
|
23
|
+
## Direct Constraint Mode
|
|
70
24
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
1. Read `AGENTS.md` to understand your role.
|
|
84
|
-
2. Read ALL files in `.agent-context/rules/` to understand our engineering standards.
|
|
85
|
-
3. Resolve language-specific guidance from dynamic stack signals.
|
|
86
|
-
4. Resolve the project structure from the selected architecture playbook.
|
|
87
|
-
|
|
88
|
-
Now scaffold the initial project structure following the blueprint exactly:
|
|
89
|
-
- Create all directories and files from the blueprint
|
|
90
|
-
- Set up the environment config and validation (e.g., Zod, Pydantic, FluentValidation)
|
|
91
|
-
- Set up the error handling foundation (base error class + global handler)
|
|
92
|
-
- Set up the logger
|
|
93
|
-
- Create a health check endpoint
|
|
94
|
-
- Initialize the ORM/Database connection
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Every file must follow [naming conventions](../rules/naming-conv.md).
|
|
98
|
-
Every module must follow [architecture.md](../rules/architecture.md).
|
|
99
|
-
Every dependency must be justified per [efficiency-vs-hype.md](../rules/efficiency-vs-hype.md).
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Stacks & Blueprints Reference
|
|
25
|
+
If the user specifies a framework, runtime, or architecture constraint, the agent must:
|
|
26
|
+
1. Read [AGENTS.md](../../AGENTS.md) for role context.
|
|
27
|
+
2. Resolve only the rules required by the explicit constraint and scope. Do not read unrelated backend, frontend, or DevOps rules by habit.
|
|
28
|
+
3. Reference [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [.cursorrules](../../.cursorrules), and [.windsurfrules](../../.windsurfrules) for runtime evidence and any explicit constraints already applied to this project.
|
|
29
|
+
4. Scaffold the initial project structure only after runtime and architecture decisions are explicit:
|
|
30
|
+
- Create only the directories and files justified by the approved structure.
|
|
31
|
+
- Set up configuration, validation, error handling, observability, health checks, and persistence only when they fit the approved runtime and project scope.
|
|
32
|
+
- Every file must follow [naming conventions](../rules/naming-conv.md).
|
|
33
|
+
- Every module must follow [architecture.md](../rules/architecture.md).
|
|
34
|
+
- Every dependency must be justified per [efficiency-vs-hype.md](../rules/efficiency-vs-hype.md).
|
|
35
|
+
- Use official framework setup commands or canonical starter flows when they produce newer, better-supported dependency defaults than manual package assembly.
|
|
36
|
+
- If containerization is selected, Docker assets must follow [docker-runtime.md](../rules/docker-runtime.md) and the latest official Docker docs instead of stale blog-era patterns.
|
|
105
37
|
|
|
106
|
-
|
|
38
|
+
## Runtime and Architecture Reference
|
|
107
39
|
|
|
108
|
-
|
|
40
|
+
See [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [.cursorrules](../../.cursorrules), and [.windsurfrules](../../.windsurfrules) for the latest shipped runtime evidence, explicit constraints, and agent-decision status.
|
|
109
41
|
|
|
110
|
-
##
|
|
42
|
+
## UI/UX Bootstrap
|
|
111
43
|
|
|
112
|
-
|
|
113
|
-
|
|
44
|
+
When a user requests frontend or UI/UX design, the agent must automatically execute the [bootstrap-design.md](./bootstrap-design.md) prompt to synthesize a dynamic design contract (`docs/DESIGN.md` + `docs/design-intent.json`).
|
|
45
|
+
Keep UI-only requests context-isolated: load [bootstrap-design.md](./bootstrap-design.md) and [frontend-architecture.md](../rules/frontend-architecture.md) first, and do not eagerly load backend-only rules unless the task explicitly crosses backend boundaries.
|
|
@@ -1,52 +1,30 @@
|
|
|
1
1
|
# Prompt: Refactor Code
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this when code needs cleanup, splitting, or safer structure without changing user-visible behavior.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```text
|
|
6
|
+
Refactor the target code while preserving existing behavior.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
1. Read .agent-context/rules/architecture.md — ensure proper layer separation.
|
|
14
|
-
2. Read .agent-context/rules/naming-conv.md — fix all naming violations.
|
|
15
|
-
3. Read .agent-context/rules/error-handling.md — fix error handling patterns.
|
|
16
|
-
4. Resolve active language guidance from dynamic stack signals (TypeScript in this repository).
|
|
17
|
-
5. Enforce backend universal principles: no clever hacks, no premature abstraction, readability over brevity.
|
|
8
|
+
Before editing:
|
|
9
|
+
1. Read AGENTS.md and the smallest relevant rules from .agent-context/rules/.
|
|
10
|
+
2. Inspect the real repo conventions before introducing a new structure.
|
|
11
|
+
3. If required project docs are missing, stop and bootstrap or update docs first.
|
|
12
|
+
4. If the change touches UI, load .agent-context/prompts/bootstrap-design.md and .agent-context/rules/frontend-architecture.md before editing.
|
|
13
|
+
5. If the change touches a dependency, framework, Docker, runtime, or ecosystem claim, verify current official docs before choosing.
|
|
18
14
|
6. Enforce Universal SOP hard gate: stop implementation if `docs/architecture-decision-record.md` is missing, and for UI scope stop if `docs/DESIGN.md` or `docs/design-intent.json` is missing.
|
|
15
|
+
7. Enforce backend universal principles: no clever hacks, no premature abstraction, readability over brevity.
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
- Why it was wrong (explain the risk/problem)
|
|
23
|
-
- What you changed (show the improvement)
|
|
24
|
-
|
|
25
|
-
Refactor guidance:
|
|
17
|
+
Refactor rules:
|
|
18
|
+
- Improve clarity, boundaries, naming, validation, error handling, tests, and docs.
|
|
26
19
|
- Prioritize maintainability over compressed one-liners.
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Extract [FEATURE_NAME] into its own module following .agent-context/rules/architecture.md:
|
|
38
|
-
|
|
39
|
-
1. Create the module directory: src/modules/[feature-name]/
|
|
40
|
-
2. Separate into layers:
|
|
41
|
-
- controller (transport — HTTP in/out only)
|
|
42
|
-
- service (business logic — no HTTP, no SQL)
|
|
43
|
-
- repository (data access — no business rules)
|
|
44
|
-
- dto (Zod schemas for input validation)
|
|
45
|
-
- types (type definitions)
|
|
46
|
-
3. Create barrel export (index.ts) exposing ONLY the public API
|
|
47
|
-
4. Update imports in consuming modules to use the new module path
|
|
48
|
-
5. Add unit tests for the service layer
|
|
49
|
-
|
|
50
|
-
Follow naming-conv.md for all file and variable names.
|
|
51
|
-
Provide a Reasoning Chain for every structural decision.
|
|
20
|
+
- Do not choose a stack, framework, library, or topology from offline assumptions.
|
|
21
|
+
- Keep module boundaries explicit and project-specific.
|
|
22
|
+
- Split large files when the split makes the flow easier to understand.
|
|
23
|
+
- Do not introduce abstractions before the repeated pattern is real.
|
|
24
|
+
- Update tests and docs whenever behavior contracts, public APIs, data shape, or UI contracts change.
|
|
25
|
+
|
|
26
|
+
For every meaningful change, explain:
|
|
27
|
+
- what risk or friction existed
|
|
28
|
+
- what changed
|
|
29
|
+
- why the new shape is safer or easier to maintain
|
|
52
30
|
```
|
|
@@ -1,55 +1,31 @@
|
|
|
1
1
|
# Prompt: Review Code
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Output format:
|
|
32
|
-
## PR REVIEW RESULTS
|
|
33
|
-
PASS [Item]
|
|
34
|
-
FAIL [Item] (with Reasoning Chain)
|
|
35
|
-
|
|
36
|
-
## SECURITY AUDIT RESULTS
|
|
37
|
-
CRITICAL/HIGH/MEDIUM/LOW [Finding] — severity + fix
|
|
38
|
-
|
|
39
|
-
VERDICT: PASS / FAIL
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Quick Review (Subset)
|
|
43
|
-
|
|
44
|
-
If you want a faster review focusing on the most critical items:
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
Quick review the current code. Check ONLY:
|
|
48
|
-
1. Any use of `any` type? (dynamic TypeScript stack guidance)
|
|
49
|
-
2. Any empty catch blocks? (rules/error-handling.md)
|
|
50
|
-
3. Any N+1 queries? (rules/performance.md)
|
|
51
|
-
4. Any hardcoded secrets? (rules/security.md)
|
|
52
|
-
5. Any missing input validation? (rules/security.md)
|
|
53
|
-
|
|
54
|
-
Use the Reasoning Clause for every finding.
|
|
3
|
+
Use this when reviewing current changes, a pull request, or a focused file set.
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
Review the code with a production-risk mindset.
|
|
7
|
+
|
|
8
|
+
Before reviewing:
|
|
9
|
+
1. Read AGENTS.md.
|
|
10
|
+
2. Read .agent-context/review-checklists/pr-checklist.md.
|
|
11
|
+
3. Read .agent-context/review-checklists/architecture-review.md only when architecture or boundaries changed.
|
|
12
|
+
4. Load only the rules relevant to the changed scope.
|
|
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 (`docs/architecture-decision-record.md`, and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).
|
|
15
|
+
7. Enforce single-source and lazy-loading policy: canonical rule source must be explicitly enforced, language-specific guidance must load lazily based on detected scope, and conflicting duplicate rule instructions must not appear during normal flow.
|
|
16
|
+
|
|
17
|
+
Prioritize findings in this order:
|
|
18
|
+
1. Correctness, data loss, security, privacy, auth, and permission risks.
|
|
19
|
+
2. Public contract drift: APIs, events, CLI behavior, data model, UI contract, docs.
|
|
20
|
+
3. Missing tests for changed behavior.
|
|
21
|
+
4. Architecture boundary drift and maintainability risk.
|
|
22
|
+
5. Performance and accessibility issues with concrete impact.
|
|
23
|
+
|
|
24
|
+
For every finding:
|
|
25
|
+
- include file and line
|
|
26
|
+
- explain the real risk
|
|
27
|
+
- reference the rule or contract only when it materially supports the finding
|
|
28
|
+
- propose the smallest safe fix
|
|
29
|
+
|
|
30
|
+
Do not invent stack-specific concerns unless the repo or changed files prove they apply.
|
|
55
31
|
```
|