@bovinphang/frontend-craft 2.8.0 → 2.9.0
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/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +378 -339
- package/CHANGELOG.zh-CN.md +377 -338
- package/CONTRIBUTING.md +371 -361
- package/CONTRIBUTING.zh-CN.md +371 -361
- package/README.md +545 -493
- package/README.openclaw.md +359 -320
- package/README.openclaw.zh-CN.md +359 -320
- package/README.zh-CN.md +545 -493
- package/agents/fec-code-reviewer.md +24 -3
- package/agents/fec-debugger.md +1 -1
- package/agents/fec-doc-updater.md +1 -1
- package/agents/fec-e2e-runner.md +1 -1
- package/agents/fec-figma-implementer.md +1 -1
- package/agents/fec-performance-optimizer.md +1 -1
- package/agents/fec-refactor-cleaner.md +4 -1
- package/agents/fec-refactoring-expert.md +81 -0
- package/agents/fec-security-reviewer.md +17 -1
- package/agents/fec-test-planner.md +1 -1
- package/agents/fec-typescript-reviewer.md +24 -8
- package/agents/fec-ui-checker.md +11 -11
- package/commands/fec-debug.md +1 -1
- package/commands/fec-refactor-plan.md +17 -0
- package/commands/fec-refactor.md +18 -0
- package/commands/fec-review.md +40 -10
- package/commands/fec-scaffold.md +1 -1
- package/commands/fec-smell.md +17 -0
- package/commands/fec-tdd.md +6 -2
- package/dist/bin/frontend-craft.js +190 -38
- package/dist/hooks/fec-run-tests.js +5 -1
- package/dist/hooks/fec-session-start.js +1 -1
- package/docs/example-prompts.md +157 -140
- package/docs/ja-JP/README.md +534 -493
- package/docs/ko-KR/README.md +534 -493
- package/docs/project-structure.md +151 -131
- package/docs/refactoring/README.md +50 -0
- package/docs/refactoring/catalog.md +105 -0
- package/docs/refactoring/smell-refactoring-matrix.md +41 -0
- package/docs/review-and-diagram-workflows.md +39 -0
- package/docs/runtimes/antigravity.md +18 -10
- package/docs/runtimes/augment.md +18 -10
- package/docs/runtimes/claude.md +191 -177
- package/docs/runtimes/claude.zh-CN.md +189 -175
- package/docs/runtimes/cline.md +18 -10
- package/docs/runtimes/codebuddy.md +18 -10
- package/docs/runtimes/codex.md +18 -10
- package/docs/runtimes/compatibility.md +27 -0
- package/docs/runtimes/copilot.md +18 -10
- package/docs/runtimes/cursor.md +18 -10
- package/docs/runtimes/gemini.md +18 -10
- package/docs/runtimes/kilo.md +18 -10
- package/docs/runtimes/openclaw.md +18 -10
- package/docs/runtimes/opencode.md +18 -10
- package/docs/runtimes/qoder.md +18 -19
- package/docs/runtimes/trae.md +18 -10
- package/docs/runtimes/windsurf.md +18 -10
- package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
- package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
- package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
- package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
- package/docs/zh-CN/example-prompts.md +157 -140
- package/docs/zh-CN/project-structure.md +148 -128
- package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
- package/docs/zh-TW/README.md +534 -493
- package/localized/zh-CN/agents/fec-code-reviewer.md +22 -3
- package/localized/zh-CN/agents/fec-refactor-cleaner.md +3 -0
- package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +16 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +23 -7
- package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
- package/localized/zh-CN/commands/fec-refactor.md +14 -0
- package/localized/zh-CN/commands/fec-review.md +40 -9
- package/localized/zh-CN/commands/fec-smell.md +13 -0
- package/localized/zh-CN/commands/fec-tdd.md +4 -0
- package/localized/zh-CN/skills/eval_queries.json +244 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +20 -1
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +11 -1
- package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
- package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +31 -1
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +10 -3
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +8 -1
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +48 -80
- package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +193 -53
- package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +3 -0
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
- package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
- package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
- package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +16 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +10 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +3 -0
- package/localized/zh-CN/skills/metadata.json +408 -50
- package/localized/zh-CN/skills/relations.json +271 -3
- package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +1 -0
- package/openclaw.plugin.json +2 -3
- package/package.json +27 -17
- package/skills/eval_queries.json +244 -0
- package/skills/fec-code-review/SKILL.md +20 -1
- package/skills/fec-code-review/references/report-template.md +11 -1
- package/skills/fec-code-smells/SKILL.md +33 -0
- package/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/skills/fec-code-smells/references/smell-catalog.md +861 -0
- package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/skills/fec-data-fetching/SKILL.md +1 -1
- package/skills/fec-image-generation/SKILL.md +31 -1
- package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +10 -3
- package/skills/fec-image-generation/references/html-technical-diagrams.md +8 -1
- package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +48 -80
- package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +193 -53
- package/skills/fec-legacy-web-standard/SKILL.md +1 -1
- package/skills/fec-refactor-clean/SKILL.md +3 -0
- package/skills/fec-refactoring/SKILL.md +83 -0
- package/skills/fec-refactoring/references/principles.md +60 -0
- package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
- package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
- package/skills/fec-refactoring/references/workflow.md +90 -0
- package/skills/fec-refactoring-api/SKILL.md +25 -0
- package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/skills/fec-refactoring-catalog/SKILL.md +28 -0
- package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
- package/skills/fec-refactoring-control/SKILL.md +25 -0
- package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/skills/fec-refactoring-data/SKILL.md +25 -0
- package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/skills/fec-refactoring-validation/SKILL.md +59 -0
- package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
- package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
- package/skills/fec-security-review/SKILL.md +16 -0
- package/skills/fec-security-review/references/report-template.md +10 -0
- package/skills/fec-tdd-workflow/SKILL.md +5 -1
- package/skills/metadata.json +434 -71
- package/skills/relations.json +264 -0
- package/templates/shared/rules/fec-agent-workflow.md +1 -0
- package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
|
@@ -5,6 +5,22 @@ description: Use when the user asks for general frontend code review, PR review,
|
|
|
5
5
|
|
|
6
6
|
# Front-end code review
|
|
7
7
|
|
|
8
|
+
## Review modes and coverage
|
|
9
|
+
|
|
10
|
+
User-specified scope takes precedence over the default. Use the following three review modes:
|
|
11
|
+
|
|
12
|
+
- **Change review**: only when recent changes, current edits, staged changes, a PR or a commit are explicitly requested or clearly established by the active task, review those changes and necessary context. For local changes, inspect staged and unstaged diffs and relevant untracked project files within the requested scope; a staged-only request reviews only staged changes. If there are no changes, report that there is nothing to review; do not switch to recent commits or expand scope automatically.
|
|
13
|
+
- **Targeted review**: when files or directories are specified, inventory and review existing code in that scope, including unchanged code; no Git diff is required.
|
|
14
|
+
- **Project review (default)**: when no scope or change context is specified, or when the entire project is requested, inventory project-owned frontend code, related tests, configuration and dependency declarations, then review in module batches, including unchanged code; no Git diff is required.
|
|
15
|
+
|
|
16
|
+
Select scope before collecting diffs. A file/directory alone means full review of that scope; a path combined with an explicit change request restricts incremental review to that path. An unqualified invocation defaults to project review even if Git changes exist. At review start, state the selected mode and target scope. When automatically delegating review after edits, pass the current change scope explicitly; do not trigger project review merely because the reviewer was called.
|
|
17
|
+
|
|
18
|
+
Exclude dependency directories, build outputs, caches, generated files and third-party code by default, and record exclusions. Keep the frontend responsibility boundary; this is not a backend audit. A nonexistent target or a scope with no relevant files must be reported explicitly, not replaced with another scope.
|
|
19
|
+
|
|
20
|
+
Merge findings with the same root cause across batches. Report **review mode, target scope, reviewed files/modules, exclusions, unreviewed files/modules, completion status and verification commands/results**. If context or execution limits prevent completion, mark the review partial and list remaining modules; never claim complete project coverage. Reading callers for context or running project-wide lint/typecheck does not count as manual review of those files.
|
|
21
|
+
|
|
22
|
+
Change reviews retain merge recommendations. Targeted and project reviews use a risk assessment (Low / Medium / High, with blocking findings), not a claim of merge readiness. Preserve severity levels, evidence requirements and report filenames. Output reports only unless repairs are explicitly requested.
|
|
23
|
+
|
|
8
24
|
## Purpose
|
|
9
25
|
|
|
10
26
|
Review the front-end code quality from 8 dimensions including architecture, type safety, accessibility, style consistency, performance and testability, and output a graded review report.
|
|
@@ -128,7 +144,7 @@ When writing a code review report, load [references/report-template.md](referenc
|
|
|
128
144
|
## Constraints
|
|
129
145
|
|
|
130
146
|
- Do not write personal style preferences as blocking issues; blocking items must have clear evidence of user impact, runtime risk, security risk, or maintenance cost.
|
|
131
|
-
-
|
|
147
|
+
- Do not give findings without file locations and supporting evidence; a diff is required only for change review.
|
|
132
148
|
- In-depth security, accessibility, E2E and performance issues are only screened initially; when an evidence chain is needed, they will be diverted to special skills.
|
|
133
149
|
- Do not report multiple reports for the same root cause; merge them into one representative finding and list the scope of impact.
|
|
134
150
|
- Format issues that are stably covered by automated tools are handed over to lint/format and are not discovered by human reviewers.
|
|
@@ -141,3 +157,6 @@ When writing a code review report, load [references/report-template.md](referenc
|
|
|
141
157
|
- The review report is saved as `reports/code-review-YYYY-MM-DD-HHmmss.md`
|
|
142
158
|
- Multi-dimensional reviews should consolidate duplicate findings and explain which special capabilities have been diverted to
|
|
143
159
|
- Label uncertain items with required verification commands or supplementary context, and do not write guesses into facts
|
|
160
|
+
## Refactoring Boundary
|
|
161
|
+
|
|
162
|
+
A general review may flag maintainability evidence, but dedicated smell diagnosis or a behavior-preserving refactoring plan owns deeper structural analysis. Review should not silently execute structural changes; it can recommend diagnosis/planning when a finding needs systematic transformation.
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
> Generation time: YYYY-MM-DD HH:mm
|
|
7
7
|
> Review tool: frontend-craft
|
|
8
8
|
|
|
9
|
+
> Review mode: change / targeted / project
|
|
10
|
+
> Target scope: paths or PR/commit
|
|
11
|
+
> Reviewed: file or module inventory
|
|
12
|
+
> Exclusions: paths and reasons
|
|
13
|
+
> Unreviewed: remaining files or modules (state none if complete)
|
|
14
|
+
> Completion: complete / partial
|
|
15
|
+
> Verification: commands, results and reasons for skipped checks
|
|
16
|
+
|
|
9
17
|
## CRITICAL / Must be modified (N items)
|
|
10
18
|
- **[File:line number]** Problem description -> Suggested modifications
|
|
11
19
|
|
|
@@ -23,7 +31,9 @@
|
|
|
23
31
|
|
|
24
32
|
## Risk Level: Low / Medium / High
|
|
25
33
|
|
|
26
|
-
**
|
|
34
|
+
**Conclusion**: Change review: merge recommendation; targeted/project review: Low / Medium / High risk and blocking findings
|
|
27
35
|
```
|
|
28
36
|
|
|
29
37
|
After the review is completed, save the report to `reports/code-review-YYYY-MM-DD-HHmmss.md` and inform the user of the report path.
|
|
38
|
+
|
|
39
|
+
Retain merge recommendations for change review; use risk assessments for targeted and project reviews. For partial reviews, conclusions apply only to reviewed scope and do not establish project-wide approval.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-code-smells
|
|
3
|
+
description: Use when diagnosing structural maintainability problems in existing frontend code before deciding how to refactor it, especially when evidence, false-positive checks, and candidate transformations are needed without editing business code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Smell Diagnosis
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
Diagnose structural problems from concrete evidence. A smell is a prompt to investigate, not proof that code must change.
|
|
10
|
+
|
|
11
|
+
## Procedure
|
|
12
|
+
1. Establish the requested scope and project facts.
|
|
13
|
+
2. Collect concrete structural and change-coupling evidence.
|
|
14
|
+
3. Match evidence against [the smell catalog](references/smell-catalog.md).
|
|
15
|
+
4. Apply [false-positive checks](references/detection-guide.md).
|
|
16
|
+
5. Report confidence, impact, and candidates from [the mapping guide](references/smell-to-refactoring-map.md).
|
|
17
|
+
6. If the request is diagnosis-only, do not modify business code.
|
|
18
|
+
|
|
19
|
+
## Finding Contract
|
|
20
|
+
Every finding states location, evidence, smell ID/name, impact, confidence (`HIGH`, `MEDIUM`, `LOW`), candidate refactorings, priority, and material false-positive considerations. `LOW` confidence is never an automatic-edit signal.
|
|
21
|
+
|
|
22
|
+
## Quick Reference
|
|
23
|
+
| Need | Reference |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| Standard 24-smell model | [Smell catalog](references/smell-catalog.md) |
|
|
26
|
+
| Evidence and false positives | [Detection guide](references/detection-guide.md) |
|
|
27
|
+
| Candidate refactorings | [Smell-to-refactoring map](references/smell-to-refactoring-map.md) |
|
|
28
|
+
|
|
29
|
+
## Common Mistakes
|
|
30
|
+
- Treating a metric threshold as proof.
|
|
31
|
+
- Reporting a smell without a file/symbol and evidence.
|
|
32
|
+
- Treating every loop, switch, comment, wrapper, or pipeline as defective.
|
|
33
|
+
- Editing code when the user asked for diagnosis only.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Code Smell Detection Guide
|
|
2
|
+
|
|
3
|
+
## Evidence First
|
|
4
|
+
Use code structure, dependency direction, ownership, repeated change patterns, and observable maintenance burden. Metrics can focus investigation but cannot prove a smell alone.
|
|
5
|
+
|
|
6
|
+
## Required False-Positive Guards
|
|
7
|
+
- LOC alone does not prove Long Function or Large Class.
|
|
8
|
+
- One switch does not prove Repeated Switches.
|
|
9
|
+
- A function/array pipeline is not automatically Message Chains.
|
|
10
|
+
- Comments are not defects by themselves.
|
|
11
|
+
- Immutable transfer data may legitimately remain data-only.
|
|
12
|
+
- React/Vue declarative composition is not automatically Middle Man.
|
|
13
|
+
- `filter().map().reduce()` pipelines are not Message Chains.
|
|
14
|
+
|
|
15
|
+
## Frontend Evidence Checklist
|
|
16
|
+
- Identify data ownership across props, stores, API DTOs, hooks/composables, and modules.
|
|
17
|
+
- Check lifecycle semantics before labeling effects/watchers as duplication or message chains.
|
|
18
|
+
- Check public component, route, event, and package contracts before recommending movement.
|
|
19
|
+
- Check dynamic references: lazy imports, route registries, Storybook, i18n keys, runtime templates, and generated CSS classes.
|
|
20
|
+
- Distinguish domain duplication from coincidentally similar rendering.
|
|
21
|
+
|
|
22
|
+
## Confidence
|
|
23
|
+
- **HIGH:** direct, repeated evidence and false positives ruled out.
|
|
24
|
+
- **MEDIUM:** evidence is meaningful but history, dynamic references, or ownership is incomplete.
|
|
25
|
+
- **LOW:** mostly metric/surface evidence or material uncertainty remains. Report only; do not auto-edit.
|