
























@@ -0,0 +1,210 @@
1+---
2+summary: "Comprehensive application modernization plan with frontend delivery skill updates"
3+title: "Application modernization plan"
4+read_when:
5+ - Planning a broad OpenClaw application modernization pass
6+ - Updating frontend implementation standards for app or Control UI work
7+ - Turning a broad product quality review into phased engineering work
8+---
9+10+# Application modernization plan
11+12+## Goal
13+14+Move the application toward a cleaner, faster, more maintainable product without
15+breaking current workflows or hiding risk in broad refactors. The work should
16+land as small, reviewable slices with proof for each touched surface.
17+18+## Principles
19+20+- Preserve current architecture unless a boundary is demonstrably causing churn,
21+ performance cost, or user-visible bugs.
22+- Prefer the smallest correct patch for each issue, then repeat.
23+- Separate required fixes from optional polish so maintainers can land high
24+ value work without waiting on subjective decisions.
25+- Keep plugin-facing behavior documented and backwards compatible.
26+- Verify shipped behavior, dependency contracts, and tests before claiming a
27+ regression is fixed.
28+- Make the main user path better first: onboarding, auth, chat, provider setup,
29+ plugin management, and diagnostics.
30+31+## Phase 1: Baseline audit
32+33+Inventory the current application before changing it.
34+35+- Identify the top user workflows and the code surfaces that own them.
36+- List dead affordances, duplicate settings, unclear error states, and expensive
37+ render paths.
38+- Capture current validation commands for each surface.
39+- Mark issues as required, recommended, or optional.
40+- Document known blockers that need owner review, especially API, security,
41+ release, and plugin contract changes.
42+43+Definition of done:
44+45+- One issue list with repo-root file references.
46+- Each issue has severity, owner surface, expected user impact, and a proposed
47+ validation path.
48+- No speculative cleanup items are mixed into required fixes.
49+50+## Phase 2: Product and UX cleanup
51+52+Prioritize visible workflows and remove confusion.
53+54+- Tighten onboarding copy and empty states around model auth, gateway status,
55+ and plugin setup.
56+- Remove or disable dead affordances where no action is possible.
57+- Keep important actions visible across responsive widths instead of hiding them
58+ behind fragile layout assumptions.
59+- Consolidate repeated status language so errors have one source of truth.
60+- Add progressive disclosure for advanced settings while keeping core setup fast.
61+62+Recommended validation:
63+64+- Manual happy path for first-run setup and existing user startup.
65+- Focused tests for any routing, config persistence, or status derivation logic.
66+- Browser screenshots for changed responsive surfaces.
67+68+## Phase 3: Frontend architecture tightening
69+70+Improve maintainability without a broad rewrite.
71+72+- Move repeated UI state transformations into narrow typed helpers.
73+- Keep data fetching, persistence, and presentation responsibilities separate.
74+- Prefer existing hooks, stores, and component patterns over new abstractions.
75+- Split oversized components only when it reduces coupling or clarifies tests.
76+- Avoid introducing broad global state for local panel interactions.
77+78+Required guardrails:
79+80+- Do not change public behavior as a side effect of file splitting.
81+- Keep accessibility behavior intact for menus, dialogs, tabs, and keyboard
82+ navigation.
83+- Verify that loading, empty, error, and optimistic states still render.
84+85+## Phase 4: Performance and reliability
86+87+Target measured pain rather than broad theoretical optimization.
88+89+- Measure startup, route transition, large list, and chat transcript costs.
90+- Replace repeated expensive derived data with memoized selectors or cached
91+ helpers where profiling proves value.
92+- Reduce avoidable network or filesystem scans on hot paths.
93+- Keep deterministic ordering for prompt, registry, file, plugin, and network
94+ inputs before model payload construction.
95+- Add lightweight regression tests for hot helpers and contract boundaries.
96+97+Definition of done:
98+99+- Each performance change records baseline, expected impact, actual impact, and
100+ remaining gap.
101+- No perf patch lands solely on intuition when cheap measurement is available.
102+103+## Phase 5: Type, contract, and test hardening
104+105+Raise correctness at the boundary points users and plugin authors depend on.
106+107+- Replace loose runtime strings with discriminated unions or closed code lists.
108+- Validate external inputs with existing schema helpers or zod.
109+- Add contract tests around plugin manifests, provider catalogs, gateway protocol
110+ messages, and config migration behavior.
111+- Keep compatibility paths in doctor or repair flows instead of startup-time
112+ hidden migrations.
113+- Avoid test-only coupling to plugin internals; use SDK facades and documented
114+ barrels.
115+116+Recommended validation:
117+118+- `pnpm check:changed`
119+- Targeted tests for every changed boundary.
120+- `pnpm build` when lazy boundaries, packaging, or published surfaces change.
121+122+## Phase 6: Documentation and release readiness
123+124+Keep user-facing docs aligned with behavior.
125+126+- Update docs with behavior, API, config, onboarding, or plugin changes.
127+- Add changelog entries only for user-visible changes.
128+- Keep plugin terminology user-facing; use internal package names only where
129+ needed for contributors.
130+- Confirm release and install instructions still match the current command
131+ surface.
132+133+Definition of done:
134+135+- Relevant docs are updated in the same branch as behavior changes.
136+- Generated docs or API drift checks pass when touched.
137+- The handoff names any skipped validation and why it was skipped.
138+139+## Recommended first slice
140+141+Start with a scoped Control UI and onboarding pass:
142+143+- Audit first-run setup, provider auth readiness, gateway status, and plugin
144+ setup surfaces.
145+- Remove dead actions and clarify failure states.
146+- Add or update focused tests for status derivation and config persistence.
147+- Run `pnpm check:changed`.
148+149+This gives high user value with limited architecture risk.
150+151+## Frontend skill update
152+153+Use this section to update the frontend-focused `SKILL.md` supplied with the
154+modernization task. If adopting this guidance as a repo-local OpenClaw skill,
155+create `.agents/skills/openclaw-frontend/SKILL.md` first, keep the frontmatter
156+that belongs in that target skill, then add or replace the body guidance with
157+the following content.
158+159+```markdown
160+# Frontend Delivery Standards
161+162+Use this skill when implementing or reviewing user-facing React, Next.js,
163+desktop webview, or app UI work.
164+165+## Operating rules
166+167+- Start from the existing product workflow and code conventions.
168+- Prefer the smallest correct patch that improves the current user path.
169+- Separate required fixes from optional polish in the handoff.
170+- Do not build marketing pages when the request is for an application surface.
171+- Keep actions visible and usable across supported viewport sizes.
172+- Remove dead affordances instead of leaving controls that cannot act.
173+- Preserve loading, empty, error, success, and permission states.
174+- Use existing design-system components, hooks, stores, and icons before adding
175+ new primitives.
176+177+## Implementation checklist
178+179+1. Identify the primary user task and the component or route that owns it.
180+2. Read the local component patterns before editing.
181+3. Patch the narrowest surface that solves the issue.
182+4. Add responsive constraints for fixed-format controls, toolbars, grids, and
183+ counters so text and hover states cannot resize the layout unexpectedly.
184+5. Keep data loading, state derivation, and rendering responsibilities clear.
185+6. Add tests when logic, persistence, routing, permissions, or shared helpers
186+ change.
187+7. Verify the main happy path and the most relevant edge case.
188+189+## Visual quality gates
190+191+- Text must fit inside its container on mobile and desktop.
192+- Toolbars may wrap, but controls must remain reachable.
193+- Buttons should use familiar icons when the icon is clearer than text.
194+- Cards should be used for repeated items, modals, and framed tools, not for
195+ every page section.
196+- Avoid one-note color palettes and decorative backgrounds that compete with
197+ operational content.
198+- Dense product surfaces should optimize for scanning, comparison, and repeated
199+ use.
200+201+## Handoff format
202+203+Report:
204+205+- What changed.
206+- What user behavior changed.
207+- Required validation that passed.
208+- Any validation skipped and the concrete reason.
209+- Optional follow-up work, clearly separated from required fixes.
210+```
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。