@ryuenn3123/agentic-senior-core 3.0.50 → 4.0.1
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 +3 -1
- package/.agent-context/prompts/research-design.md +165 -0
- package/.agent-context/review-checklists/pr-checklist.md +1 -0
- package/.agent-context/rules/api-docs.md +63 -47
- package/.agent-context/rules/architecture.md +133 -120
- package/.agent-context/rules/database-design.md +36 -18
- package/.agent-context/rules/docker-runtime.md +66 -43
- package/.agent-context/rules/efficiency-vs-hype.md +38 -17
- package/.agent-context/rules/error-handling.md +35 -16
- package/.agent-context/rules/event-driven.md +35 -18
- package/.agent-context/rules/frontend-architecture.md +103 -76
- package/.agent-context/rules/git-workflow.md +81 -197
- package/.agent-context/rules/microservices.md +42 -41
- package/.agent-context/rules/naming-conv.md +27 -8
- package/.agent-context/rules/performance.md +32 -12
- package/.agent-context/rules/realtime.md +26 -9
- package/.agent-context/rules/security.md +39 -20
- package/.agent-context/rules/testing.md +36 -16
- package/AGENTS.md +21 -20
- package/README.md +10 -1
- package/lib/cli/commands/init.mjs +12 -0
- package/lib/cli/commands/upgrade.mjs +11 -0
- package/lib/cli/compiler.mjs +1 -0
- package/lib/cli/detector/constants.mjs +135 -0
- package/lib/cli/detector/design-evidence/collector.mjs +256 -0
- package/lib/cli/detector/design-evidence/constants.mjs +39 -0
- package/lib/cli/detector/design-evidence/file-traversal.mjs +83 -0
- package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +117 -0
- package/lib/cli/detector/design-evidence/summary.mjs +109 -0
- package/lib/cli/detector/design-evidence/utility-helpers.mjs +122 -0
- package/lib/cli/detector/design-evidence.mjs +25 -610
- package/lib/cli/detector/stack-detection.mjs +243 -0
- package/lib/cli/detector/ui-signals.mjs +150 -0
- package/lib/cli/detector/workspace-scan.mjs +177 -0
- package/lib/cli/detector.mjs +20 -688
- package/lib/cli/memory-continuity.mjs +1 -0
- package/lib/cli/project-scaffolder/design-contract/research-dossier-migration.mjs +165 -0
- package/lib/cli/project-scaffolder/design-contract/sections/audits.mjs +96 -0
- package/lib/cli/project-scaffolder/design-contract/sections/conceptual-anchor.mjs +233 -0
- package/lib/cli/project-scaffolder/design-contract/sections/execution-handoff.mjs +211 -0
- package/lib/cli/project-scaffolder/design-contract/seed-signals.mjs +79 -0
- package/lib/cli/project-scaffolder/design-contract/signal-vocab.mjs +64 -0
- package/lib/cli/project-scaffolder/design-contract/validation/anchor-validators.mjs +456 -0
- package/lib/cli/project-scaffolder/design-contract/validation/audit-validators.mjs +117 -0
- package/lib/cli/project-scaffolder/design-contract/validation/completeness.mjs +83 -0
- package/lib/cli/project-scaffolder/design-contract/validation/execution-validators.mjs +328 -0
- package/lib/cli/project-scaffolder/design-contract/validation/helpers.mjs +8 -0
- package/lib/cli/project-scaffolder/design-contract/validation/research-dossier-validators.mjs +104 -0
- package/lib/cli/project-scaffolder/design-contract/validation/structural-validators.mjs +79 -0
- package/lib/cli/project-scaffolder/design-contract/validation/system-validators.mjs +256 -0
- package/lib/cli/project-scaffolder/design-contract/validation.mjs +61 -896
- package/lib/cli/project-scaffolder/design-contract.mjs +151 -556
- package/lib/cli/project-scaffolder/prompt-builders.mjs +9 -0
- package/mcp.json +30 -9
- package/package.json +17 -2
- package/scripts/audit-cache-layer-contract.mjs +258 -0
- package/scripts/audit-caching-scope-hygiene.mjs +263 -0
- package/scripts/audit-file-size.mjs +219 -0
- package/scripts/audit-reflection-citations.mjs +163 -0
- package/scripts/audit-release-bundle.mjs +170 -0
- package/scripts/audit-rule-id-uniqueness.mjs +313 -0
- package/scripts/benchmark-evidence-bundle.mjs +1 -0
- package/scripts/build-release-benchmark-bundle.mjs +204 -0
- package/scripts/context-triggered-audit.mjs +1 -0
- package/scripts/documentation-boundary-audit.mjs +1 -0
- package/scripts/explain-on-demand-audit.mjs +2 -1
- package/scripts/frontend-usability-audit.mjs +10 -10
- package/scripts/llm-judge/checklist-loader.mjs +45 -0
- package/scripts/llm-judge/constants.mjs +66 -0
- package/scripts/llm-judge/diff-collection.mjs +74 -0
- package/scripts/llm-judge/prompting.mjs +78 -0
- package/scripts/llm-judge/providers.mjs +111 -0
- package/scripts/llm-judge/verdict.mjs +134 -0
- package/scripts/llm-judge.mjs +21 -482
- package/scripts/mcp-server/tool-registry.mjs +55 -0
- package/scripts/mcp-server/tools.mjs +137 -1
- package/scripts/migrate-rule-format/id-prefix-table.mjs +37 -0
- package/scripts/migrate-rule-format/parse-legacy.mjs +180 -0
- package/scripts/migrate-rule-format/render-new.mjs +169 -0
- package/scripts/migrate-rule-format/roundtrip-validate.mjs +89 -0
- package/scripts/migrate-rule-format.mjs +192 -0
- package/scripts/release-gate/constants.mjs +1 -1
- package/scripts/release-gate/static-checks.mjs +1 -1
- package/scripts/rules-guardian-audit.mjs +5 -2
- package/scripts/single-source-lazy-loading-audit.mjs +2 -1
- package/scripts/ui-design-judge/git-input.mjs +3 -0
- package/scripts/validate/config.mjs +27 -2
- package/scripts/validate/coverage-checks.mjs +1 -1
- package/scripts/validate.mjs +94 -1
|
@@ -13,12 +13,14 @@ This contract is a decision scaffold, not a style preset. We guide the agent; we
|
|
|
13
13
|
- Keep external references non-copying; extract constraints only.
|
|
14
14
|
- Before choosing a new UI, animation, scroll, 3D, canvas, chart, icon, styling, or component library, research current official docs.
|
|
15
15
|
## Required Order
|
|
16
|
-
1. Read `AGENTS.md`, this prompt, `../rules/frontend-architecture.md`, current UI code, current project docs, and existing design docs.
|
|
16
|
+
1. Read `AGENTS.md`, this prompt, `research-design.md`, `../rules/frontend-architecture.md`, current UI code, current project docs, and existing design docs.
|
|
17
17
|
2. Refine existing `docs/DESIGN.md` and `docs/design-intent.json`; do not replace them blindly.
|
|
18
18
|
3. If either design doc is missing, create it before UI implementation.
|
|
19
19
|
4. Record `motionPaletteDecision` before UI code; product categories are heuristics, not style presets.
|
|
20
20
|
5. Encode `repoEvidence.designEvidenceSummary` when onboarding or detector evidence exists.
|
|
21
21
|
6. Keep both design docs synchronized after implementation.
|
|
22
|
+
7. Complete the Section 3-5 gates from `research-design.md` before UI implementation: `conceptualAnchor.categoryCodes.candidateEntries`, `conceptualAnchor.morphologicalExploration` (selected and uncomfortable combinations), and `conceptualAnchor.anchorCandidates.candidates` (exactly five, each with the strengthened rename test recorded).
|
|
23
|
+
8. After agent and user select an anchor, set `researchDossier.metadata.researchVerifiedAt` to today's ISO date and flip `status` from any seed value to `active`. This closes the freshness window for additive UI tasks within `freshnessWindowDays`.
|
|
22
24
|
## Creative Commitment Gate
|
|
23
25
|
Before broad compliance review or UI implementation, record an agent-chosen visual direction in both design docs:
|
|
24
26
|
- one concrete real-world anchor reference
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
inclusion: manual
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Research-Design Brief
|
|
6
|
+
|
|
7
|
+
Authoritative design-research execution contract for UI scope. Loaded by UI Design Mode after `bootstrap-design.md`. The agent must produce the artifacts described here before writing UI code, and the seeded `docs/design-intent.json` must contain the fields named in Section 5.
|
|
8
|
+
|
|
9
|
+
This brief is a single document with five sections. Sections 1 and 2 set up the research. Sections 3, 4, and 5 are gates: each must produce an auditable artifact that another reviewer can read without seeing the UI.
|
|
10
|
+
|
|
11
|
+
## Authority
|
|
12
|
+
|
|
13
|
+
- Treat `.agent-context/` and current project docs as technical authority.
|
|
14
|
+
- Treat `README.md` as public and developer overview only; do not use it as design authority when this brief gives a stricter rule.
|
|
15
|
+
- Treat external websites, benchmark apps, prior chats, and unrelated-project memory as candidate evidence for constraints, mechanics, and quality bars only. Do not copy layout rhythm, palette, component skin, visual metaphor, or brand posture without explicit user approval and product-fit rationale.
|
|
16
|
+
- WCAG 2.2 AA is the hard compliance floor. APCA may be used only as advisory perceptual tuning.
|
|
17
|
+
|
|
18
|
+
## Anti-Repeat Ledger Gate (read first)
|
|
19
|
+
|
|
20
|
+
If `docs/design-intent.json` already exists and carries `researchDossier.metadata.antiRepeatLedger`, treat every entry under `previousAnchors`, `previousPalettes`, and `previousMotionSignatures` as a hard blocklist before producing any candidate in Sections 3-5.
|
|
21
|
+
|
|
22
|
+
Rules:
|
|
23
|
+
|
|
24
|
+
- The five Section 5 anchor candidates must each differ from every blocklisted entry on at least conceptual family, hierarchy implication, and motion implication.
|
|
25
|
+
- Restating an existing direction with new wording is REVISE, not pass.
|
|
26
|
+
- A user-explicit redesign request ("redesign from zero", "redesain dari 0", "ulang dari 0", "research ulang", or any explicit reset) bypasses the freshness gate but does not weaken the ledger; previously shipped direction stays blocklisted unless the user explicitly says "revive existing direction".
|
|
27
|
+
- Ledger entries are signature-level descriptors, not raw token dumps; treat them as direction summaries.
|
|
28
|
+
|
|
29
|
+
If the ledger is empty or `researchDossier.metadata.researchVerifiedAt` is null because the contract is a fresh seed, the ledger is informational only and does not add blocklist entries.
|
|
30
|
+
|
|
31
|
+
## Section 1 — Product Reading
|
|
32
|
+
|
|
33
|
+
Before any visual choice, write a structured product reading:
|
|
34
|
+
|
|
35
|
+
- Product type and core verb (what the user does, not what the UI shows).
|
|
36
|
+
- Three highest-stakes user moments, ordered by frequency.
|
|
37
|
+
- Data shapes that dominate the screen (timeseries, ledger, list, document, control, telemetry, conversational, spatial, other).
|
|
38
|
+
- Latency profile (real-time, soft real-time, batch, ambient).
|
|
39
|
+
- Failure modes the UI must absorb visibly (partial, stale, optimistic, conflict, offline, permission, rate-limit, none).
|
|
40
|
+
- Context of use (one-shot, sustained focus, glance-and-go, background monitor, shared display, embedded).
|
|
41
|
+
- Known constraints (device, runtime, accessibility, regulatory, performance budget, brand continuity).
|
|
42
|
+
|
|
43
|
+
Output: `productReading` block. Each field must be one sentence, evidence-backed from repo or brief. Speculation is not allowed; if a field is unknown, name it as such and stop until the user resolves it.
|
|
44
|
+
|
|
45
|
+
## Section 2 — Reference Intake
|
|
46
|
+
|
|
47
|
+
Reference material is fuel for variance, not a style source.
|
|
48
|
+
|
|
49
|
+
- Capture between three and seven references per dimension that needs exploration: hierarchy, density, type system, motion, state language, material logic, color behavior.
|
|
50
|
+
- For each reference, record: source URL or citation, what is borrowed (mechanic, behavior, hierarchy, density, type pairing, motion choreography), and what is explicitly not borrowed (palette, component skin, layout rhythm, brand posture).
|
|
51
|
+
- References live in `referenceIntake[]`. The agent may not select an anchor in Section 5 that copies a reference's surface; only the borrowed mechanic is allowed to flow downstream.
|
|
52
|
+
|
|
53
|
+
If references are not provided by the user and web search is unavailable, set `referenceIntakeStatus` to `internal-evidence-only` and constrain Sections 3 to 5 to repo evidence and project docs.
|
|
54
|
+
|
|
55
|
+
## Section 3 — Category Code Identification
|
|
56
|
+
|
|
57
|
+
Before exploring variance, name the cliches the product category will default to without intervention. These are the patterns reviewers recognize on sight as "the standard look" for the category.
|
|
58
|
+
|
|
59
|
+
This list becomes `categoryCodes` in the design-intent.json. Specificity standard: a category code is only valid if someone can recognize the exact cliche from the text description alone, without seeing the UI and without knowing the product name.
|
|
60
|
+
|
|
61
|
+
Fails specificity:
|
|
62
|
+
- `clean typography` (too abstract, applies to anything)
|
|
63
|
+
- `modern color palette` (not falsifiable)
|
|
64
|
+
- `smooth animations` (describes nothing specific)
|
|
65
|
+
|
|
66
|
+
Examples of cliches described with sufficient specificity. Read carefully: these examples illustrate the description format. They are themselves AI-defaultable cliches of their categories. They are NOT target aesthetics. They are not aesthetic candidates for any product. They appear here so you can see what specificity reads like; you are not allowed to ship them.
|
|
67
|
+
|
|
68
|
+
The three example categories below were chosen specifically because they are unlikely to overlap with common software products, to prevent leakage:
|
|
69
|
+
|
|
70
|
+
- `children's storybook illustration site: hand-painted gouache textures with irregular hand-lettered titles, off-grid spreads with whitespace gutters, page-turn pacing rather than scroll` (instantly recognizable as kids book category default)
|
|
71
|
+
- `luxury car configurator: full-bleed monochrome photography on black, ultra-thin sans-serif tracked wide, slow horizontal scroll with locked vertical alignment, micro-counters that tick instead of slide` (instantly recognizable as luxury auto category default)
|
|
72
|
+
- `academic philosophy journal: high-contrast black-on-cream, book-class serif body at 11pt with generous leading, footnote markers with hover panels, numbered table-of-contents navigation, no hero imagery` (instantly recognizable as academic journal category default)
|
|
73
|
+
|
|
74
|
+
Anti-leakage rule: listing a cliche is identifying a trap, not endorsing an aesthetic. If your product happens to fall in one of the example categories above, the matching cliche still must appear in your `categoryCodes` AND must carry an explicit rejection note. The same applies to the AI-safe defaults below.
|
|
75
|
+
|
|
76
|
+
Common AI-safe cliches you must list and reject if your product is anywhere near them. Software products almost always pattern-match one of these without intervention:
|
|
77
|
+
|
|
78
|
+
- `dev-tool default: condensed tabular numerics with minimal chrome and monospace code blocks on dark slate background, sans-serif metadata at 11–12px, monochrome status dots, single-line settings rows`
|
|
79
|
+
- `AI-startup landing default: purple-to-pink gradient hero with floating 3D glass cards, sans-serif display type at 700–900 weight, vague hero copy, three-up feature grid below the fold`
|
|
80
|
+
- `health/wellness app default: mint accent on white surface with coral status indicators, rounded pill-shaped buttons, friendly sans-serif at high weight, soft drop shadows on cards`
|
|
81
|
+
- `SaaS admin default: left-side icon-only nav, top utility bar, three-card KPI row above a single data table, neutral grey-on-white with one accent color, modal-driven detail flows`
|
|
82
|
+
- `marketing site default: hero image with one-line headline plus subhead, three feature tiles below, two pricing tiers, testimonial carousel, footer link grid`
|
|
83
|
+
|
|
84
|
+
If you find yourself describing your selected direction in the same shape as any of these, you have inverted the test. Revise.
|
|
85
|
+
|
|
86
|
+
Self-test: read each category code aloud to someone unfamiliar with the project.
|
|
87
|
+
|
|
88
|
+
- If they cannot visualize a specific aesthetic direction from the text alone, the code is too abstract. Revise until it passes.
|
|
89
|
+
- If they say "yeah that's basically the X cliche", the description is specific enough. The cliche then belongs on your reject list, not on your candidate list.
|
|
90
|
+
|
|
91
|
+
Output: at least three category codes per product surface in `categoryCodes`. Each entry must pass the specificity self-test, must include the one-sentence reason that pattern is the default for the category, and must include an explicit one-sentence rejection note ("I will not ship this; here is the trap it sets") so the cliche cannot quietly become the target.
|
|
92
|
+
|
|
93
|
+
## Section 4 — Morphological Exploration
|
|
94
|
+
|
|
95
|
+
A morphological matrix forces the design space to be explored beyond the first idea.
|
|
96
|
+
|
|
97
|
+
Choose five or six dimensions that matter for this product. Common dimensions include hierarchy, density, type role contrast, motion language, state vocabulary, material logic, color behavior, composition rhythm, and interaction grammar. Generate four or five values per dimension. Do not include the category code defaults from Section 3 as values; the matrix is for variance, not for ratifying the cliche.
|
|
98
|
+
|
|
99
|
+
Output a 5x5 or 6x5 morphological matrix. Then:
|
|
100
|
+
|
|
101
|
+
1. Highlight the combination that becomes the basis for Section 5 candidates.
|
|
102
|
+
2. Highlight at least ONE combination that feels instinctively wrong or uncomfortable but CAN be argued with product logic. This is the uncomfortable combination requirement.
|
|
103
|
+
|
|
104
|
+
The uncomfortable combination exists to prove the matrix actually spans the design space. If every combination in the matrix feels safe, shippable, and unobjectionable, the matrix has not explored far enough; it is clustering in the safe-creative zone.
|
|
105
|
+
|
|
106
|
+
Rules for the uncomfortable combination:
|
|
107
|
+
- It must be genuinely uncomfortable (the agent's first reaction is "this would not work").
|
|
108
|
+
- It must be arguable (the agent can construct a two-sentence product-logic justification for why it could work despite discomfort).
|
|
109
|
+
- It must not be random noise (uncomfortable plus unjustifiable equals waste, not exploration).
|
|
110
|
+
- The user is not required to choose it. Its purpose is to prove the design space was explored beyond the comfort boundary.
|
|
111
|
+
|
|
112
|
+
If the agent cannot produce an uncomfortable-but-arguable combination, the dimensions chosen are too narrow. Widen at least one dimension and regenerate the matrix.
|
|
113
|
+
|
|
114
|
+
Output: `morphologicalExploration` block with `dimensions[]`, `matrix` (rendered as a Markdown table inside `docs/DESIGN.md` and as a structured array inside `docs/design-intent.json`), `selectedCombination`, `uncomfortableCombination` ({ `combinationLabel`, `discomfortReason`, `productLogicJustification` }).
|
|
115
|
+
|
|
116
|
+
## Section 5 — Anchor Candidates
|
|
117
|
+
|
|
118
|
+
From the selected morphological combination, generate exactly five anchor candidates. An anchor is a real-world reference whose mechanics, hierarchy, density, type roles, state language, and motion behavior translate into UI grammar without copying its surface.
|
|
119
|
+
|
|
120
|
+
Hard constraints on anchors:
|
|
121
|
+
- The anchor must be concrete and googleable. "Modern", "clean", "premium", "expressive", "minimal", "bold", "futuristic", "elegant" are not anchors.
|
|
122
|
+
- Do not default to spatial place metaphors such as room, darkroom, control room, counting room, war room, studio, lab, cockpit, command center. Use them only when the product genuinely depends on a physical place model. Prefer artifacts, custody flows, instruments, data behaviors, materials, editorial systems, service rituals, or interaction mechanisms.
|
|
123
|
+
- Pass the strengthened rename test: mentally rename the product to three genuinely different categories. Categories must be remote from each other and from the actual product (for example, if the product is a health app, test against fintech dashboard, kids educational game, and industrial equipment monitoring console).
|
|
124
|
+
|
|
125
|
+
Strengthened rename test scoring:
|
|
126
|
+
- UI still coherent in zero of three renamed categories: anchor is highly specific. STRONG PASS.
|
|
127
|
+
- UI still coherent in one of three: anchor is specific enough. PASS with note.
|
|
128
|
+
- UI still coherent in two of three: anchor is too generic. REVISE the anchor to add product-specific constraints until it fails in at least two of three.
|
|
129
|
+
- UI still coherent in three of three: anchor is category-agnostic. DISCARD immediately.
|
|
130
|
+
|
|
131
|
+
Test-category freshness: do not reuse the same three test categories across every anchor. Pick fresh categories per anchor. Categories used in earlier examples (fintech dashboard, kids educational game, industrial equipment monitoring console) are listed only as illustration of "remote from each other"; they are not a fixed test triple. Reusing the same triple lets the agent memorize the pass condition instead of stress-testing the anchor.
|
|
132
|
+
|
|
133
|
+
The three test categories must be stated explicitly in the dossier alongside each anchor's rename test result. This makes the test auditable by human reviewers.
|
|
134
|
+
|
|
135
|
+
For EACH of the five candidates, record:
|
|
136
|
+
|
|
137
|
+
- `anchorReference` (concrete, googleable)
|
|
138
|
+
- `conceptualFamily`
|
|
139
|
+
- `jobFit` (one sentence linking to product)
|
|
140
|
+
- `hierarchyImplication`
|
|
141
|
+
- `densityImplication`
|
|
142
|
+
- `typeImplication` (variable axis or pairing logic, not just family)
|
|
143
|
+
- `stateLanguage` (loading, empty, error, partial, stale, optimistic, success using the anchor's own vocabulary)
|
|
144
|
+
- `motionImplication` (choreography rule, what state change it serves)
|
|
145
|
+
- `whatItRulesOut` (proves variance)
|
|
146
|
+
- `renameTest`:
|
|
147
|
+
- `testCategories`: three remote categories used for testing
|
|
148
|
+
- `results`: coherent or incoherent per category, in order
|
|
149
|
+
- `verdict`: STRONG PASS, PASS, REVISE, or DISCARD
|
|
150
|
+
- `categoryCodeOverlap` check: list any Section 3 category codes this candidate accidentally inherits, with reasoning
|
|
151
|
+
|
|
152
|
+
Output: `anchorCandidates[]` (length five). Discard any candidate with `verdict: DISCARD` before selection. The selected anchor populates `conceptualAnchor.anchorReference` and `derivedTokenLogic.anchorReference` (they must match exactly).
|
|
153
|
+
|
|
154
|
+
## Done Criteria
|
|
155
|
+
|
|
156
|
+
The brief is complete when:
|
|
157
|
+
|
|
158
|
+
1. `productReading` is filled with evidence-backed sentences.
|
|
159
|
+
2. `referenceIntake[]` records the borrowed mechanic and the explicit non-copy boundary per reference (or `referenceIntakeStatus: internal-evidence-only` is set).
|
|
160
|
+
3. `categoryCodes[]` has at least three entries that pass the specificity self-test.
|
|
161
|
+
4. `morphologicalExploration` has a 5x5 or 6x5 matrix, a selected combination, and an uncomfortable combination with the three required fields.
|
|
162
|
+
5. `anchorCandidates[]` has exactly five entries; each has a complete `renameTest`; the selected anchor has `verdict: STRONG PASS` or `verdict: PASS`.
|
|
163
|
+
6. Generic anchors and spatial-place defaults are rejected with the rejection reason recorded.
|
|
164
|
+
|
|
165
|
+
Only after the brief is complete does the agent move on to `docs/DESIGN.md` and the rest of `docs/design-intent.json` (token logic, motion budget, accessibility policy, review rubric, library decisions, etc., per `bootstrap-design.md`).
|
|
@@ -6,6 +6,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
|
|
|
6
6
|
|
|
7
7
|
- [ ] The agent read `AGENTS.md` and the smallest relevant rule set.
|
|
8
8
|
- [ ] For non-trivial coding, review, planning, or governance work, the agent produced a Bootstrap Receipt with loaded files, selected rules, skipped rules, unreachable files, and validation plan before implementation output.
|
|
9
|
+
- [ ] Risky actions used the AGENTS.md Bounded Reflection block with valid rule IDs, one-line rationale, and no copied rule prose or hidden chain-of-thought.
|
|
9
10
|
- [ ] Existing project context came from real files, docs, package metadata, and changed code, not folder name alone.
|
|
10
11
|
- [ ] Runtime, framework, library, topology, and design choices are explicit user constraints or agent recommendations from current evidence.
|
|
11
12
|
- [ ] No offline default stack, blueprint, vendor, or visual style was treated as authoritative.
|
|
@@ -1,56 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
id_prefix: API
|
|
3
|
+
domain: api-docs
|
|
4
|
+
priority: high
|
|
5
|
+
scope: backend
|
|
6
|
+
applies_to:
|
|
7
|
+
- backend
|
|
8
|
+
- fullstack
|
|
9
|
+
keywords:
|
|
10
|
+
- api-docs
|
|
11
|
+
- api
|
|
12
|
+
- contract
|
|
13
|
+
- documentation
|
|
14
|
+
- readme
|
|
15
|
+
- writing
|
|
16
|
+
---
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Keep README overview-level. Do not make it the canonical governance source. Do not put secrets, private agent notes, hidden reasoning, backlog chatter, raw architecture debate, or internal policy dumps in it.
|
|
18
|
+
# API and Public Contract Boundary
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
## API-001: Documentation as Hard Rule (Boundary-Aware)
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
1. If a change affects an API, CLI command, exported library behavior, schema, event, or integration contract, update the matching docs in the same change.
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
## API-002: Public README Boundary
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
1. Root `README.md` is required for every fresh or existing project, including private projects, because a future maintainer still needs a clear public and developer entrypoint.
|
|
27
|
+
2. README content must be safe for outside readers and useful for developers.
|
|
28
|
+
3. README content must explain what the project is, who it is for, how to set it up, how to run the main workflow, how to configure it, and where deeper docs live when those topics apply.
|
|
29
|
+
4. Keep README overview-level. Do not make it the canonical governance source. Do not put secrets, private agent notes, hidden reasoning, backlog chatter, raw architecture debate, or internal policy dumps in it.
|
|
30
|
+
5. Choose README sections from project evidence. Do not force a fixed template when a section does not apply.
|
|
31
|
+
6. For private/internal projects, keep the same clear style but omit private URLs, credentials, customer names, and internal-only operational details that do not belong in repo docs.
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
## API-003: Documentation Growth Model
|
|
24
34
|
|
|
25
|
-
|
|
35
|
+
1. Documentation must evolve with the project.
|
|
36
|
+
2. When behavior, setup, architecture, public contracts, data shape, deployment, or validation changes, update README and the matching docs in the same change.
|
|
37
|
+
3. When `docs/` exists, keep `docs/doc-index.md` as the compact routing map for humans and agents. It should list active docs, their purpose, read triggers, status, and last update.
|
|
38
|
+
4. `docs/doc-index.md` must not duplicate requirements, architecture, or API contracts.
|
|
39
|
+
5. Start compact, then split only when a topic earns its own file.
|
|
40
|
+
6. Good split signals are: the section is long, the workflow is owned separately, the content is referenced often, or the topic needs step-by-step care such as hardware setup, deployment, testing validation, operations, or troubleshooting.
|
|
41
|
+
7. Use PRD, SRS, technical design, and ERD as conditional docs, not default boilerplate. PRD covers product intent and roadmap ownership; SRS covers contractual or complex acceptance criteria; technical design covers architecture under pressure; ERD stays inside `docs/database-schema.md` unless the data model is large or relationship-heavy.
|
|
26
42
|
|
|
27
|
-
## Contract Rules
|
|
43
|
+
## API-004: Public Contract Rules
|
|
28
44
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- Async, webhook, and event contracts must document idempotency, retry, ordering, dead-letter or recovery behavior, and duplicate-message handling.
|
|
38
|
-
- Event APIs should define producer, consumer, payload, versioning, retry, and failure behavior.
|
|
39
|
-
- CLI/library public behavior must update README, help text, changelog, or docs as appropriate.
|
|
40
|
-
- Do not write "see code" as the contract.
|
|
41
|
-
- Do not expose generic `object` or `any` contract shapes when the boundary can be typed.
|
|
42
|
-
- Public error shapes must be safe, stable, and documented.
|
|
45
|
+
1. Document the public surface before or alongside implementation.
|
|
46
|
+
2. Machine-readable API contracts should use the current project standard. If unresolved, the LLM must recommend a current maintained option from official docs.
|
|
47
|
+
3. HTTP APIs should prefer OpenAPI 3.1 when no stronger project standard exists.
|
|
48
|
+
4. Choose transport (REST, GraphQL, tRPC, gRPC, SSE, WebSocket) and shape (resource-oriented vs action/command-oriented) from domain evidence, not by habit.
|
|
49
|
+
5. When the domain has verbs such as cancel, refund, dispatch, approve, or retry, prefer command endpoints over awkward `PATCH` shoehorns and record at least one alternative transport considered.
|
|
50
|
+
6. Treat HTTP as a behavioral contract, not just a shape.
|
|
51
|
+
7. Document `ETag` and conditional requests for cacheable reads, `Cache-Control` and `Vary` when shared caches apply, rate-limit headers (`RateLimit-*` or `X-RateLimit-*`) with `Retry-After` when rate limiting exists, and require an `Idempotency-Key` request header on unsafe non-idempotent mutations.
|
|
52
|
+
8. List endpoints must document pagination, limits, filtering, sorting, and empty-state behavior.
|
|
43
53
|
|
|
44
|
-
##
|
|
54
|
+
## API-005: Boundary Contract Details
|
|
45
55
|
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
1. Sensitive mutation endpoints must document idempotency behavior, retry safety, duplicate-submit handling, and any required idempotency key or request fingerprint.
|
|
57
|
+
2. Public error contracts must document stable machine-readable codes and any RFC 9457 Problem Details-style fields the project exposes, including safe trace or correlation identifiers when present.
|
|
58
|
+
3. Async, webhook, and event contracts must document idempotency, retry, ordering, dead-letter or recovery behavior, and duplicate-message handling.
|
|
59
|
+
4. Event APIs should define producer, consumer, payload, versioning, retry, and failure behavior.
|
|
60
|
+
5. CLI/library public behavior must update README, help text, changelog, or docs as appropriate.
|
|
61
|
+
6. Do not write "see code" as the contract.
|
|
62
|
+
7. Do not expose generic `object` or `any` contract shapes when the boundary can be typed.
|
|
63
|
+
8. Public error shapes must be safe, stable, and documented.
|
|
48
64
|
|
|
49
|
-
|
|
65
|
+
## API-006: Human Writing Standard (Mandatory)
|
|
50
66
|
|
|
51
|
-
|
|
67
|
+
1. This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations.
|
|
68
|
+
2. API docs and README updates are included in this scope.
|
|
69
|
+
3. Write formal project docs in English by default, even when the user prompt is in another language.
|
|
70
|
+
4. Use another documentation language only when the user explicitly asks for it or when existing project docs already establish that language.
|
|
52
71
|
|
|
53
|
-
|
|
72
|
+
## API-007: Style Baseline
|
|
54
73
|
|
|
55
74
|
1. Write for native English speakers.
|
|
56
75
|
2. Target an 8th-grade reading level.
|
|
@@ -59,7 +78,7 @@ Write formal project docs in English by default, even when the user prompt is in
|
|
|
59
78
|
5. Sound confident, practical, and conversational.
|
|
60
79
|
6. State the main point first, then supporting detail.
|
|
61
80
|
|
|
62
|
-
|
|
81
|
+
## API-008: Required Writing Behavior
|
|
63
82
|
|
|
64
83
|
1. Explain decisions the way a competent coworker would explain them out loud.
|
|
65
84
|
2. Cut unnecessary words and remove filler.
|
|
@@ -67,27 +86,24 @@ Write formal project docs in English by default, even when the user prompt is in
|
|
|
67
86
|
4. Rewrite and reorder content when flow is weak.
|
|
68
87
|
5. Keep explanations short by default; expand only when complexity requires it.
|
|
69
88
|
|
|
70
|
-
|
|
89
|
+
## API-009: Scope Severity and Merge Behavior
|
|
71
90
|
|
|
72
91
|
1. Scope style guidance controls readability and consistency.
|
|
73
92
|
2. Style baseline findings are advisory by default and must not block endpoint-change commits that already include accurate docs/spec updates.
|
|
74
93
|
3. Hard blockers remain contract failures: missing same-commit docs sync, incorrect schema, missing required responses, or factual inaccuracies.
|
|
75
94
|
4. If style polish is still needed, open a follow-up task instead of delaying the contract update.
|
|
76
95
|
|
|
77
|
-
|
|
96
|
+
## API-010: Non-Negotiables
|
|
78
97
|
|
|
79
98
|
1. No emoji in formal artifacts.
|
|
80
99
|
2. Avoid AI cliches and buzzwords: delve, leverage, robust, utilize, seamless.
|
|
81
100
|
3. Avoid inflated, academic, or performative language.
|
|
82
101
|
4. Avoid padding, hedging, and redundant phrasing.
|
|
83
102
|
|
|
84
|
-
|
|
103
|
+
## API-011: Critical Controls and Final Check
|
|
85
104
|
|
|
86
105
|
1. Any claim about quality, performance, or reliability must include a measurable source and timestamp.
|
|
87
106
|
2. Expand acronyms on first use, then use terms consistently.
|
|
88
107
|
3. Separate facts from assumptions explicitly.
|
|
89
108
|
4. End major explanations with a clear next action.
|
|
90
|
-
|
|
91
|
-
### Final Check
|
|
92
|
-
|
|
93
|
-
Read the text out loud before shipping. If it sounds robotic, rewrite it.
|
|
109
|
+
5. Read the text out loud before shipping. If it sounds robotic, rewrite it.
|