vibepro 0.1.0-alpha.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/LICENSE +201 -0
- package/NOTICE +9 -0
- package/README.ja.md +448 -0
- package/README.md +520 -0
- package/agent-instructions/codex/AGENTS.vibepro.md +45 -0
- package/bin/vibepro.js +9 -0
- package/docs/assets/vibepro-header.png +0 -0
- package/package.json +51 -0
- package/skills/vibepro-diagnosis-packages/SKILL.md +133 -0
- package/skills/vibepro-human-review/SKILL.md +73 -0
- package/skills/vibepro-story-refactor/SKILL.md +89 -0
- package/skills/vibepro-workflow/SKILL.md +139 -0
- package/src/agent-harness-map.js +230 -0
- package/src/agent-harness-scanner.js +337 -0
- package/src/agent-review.js +2180 -0
- package/src/api-boundary-scanner.js +452 -0
- package/src/architecture-profiler.js +423 -0
- package/src/authorization-scoring.js +149 -0
- package/src/brainbase-importer.js +534 -0
- package/src/change-risk-classifier.js +195 -0
- package/src/check-packs.js +605 -0
- package/src/checkpoint-manager.js +233 -0
- package/src/cli.js +2213 -0
- package/src/code-quality-scanner.js +310 -0
- package/src/codex-manager.js +143 -0
- package/src/component-style-scanner.js +336 -0
- package/src/coverage-report.js +99 -0
- package/src/database-access-scanner.js +163 -0
- package/src/decision-records.js +315 -0
- package/src/design-modernize.js +1435 -0
- package/src/design-system.js +1732 -0
- package/src/diagnostic-engine.js +1945 -0
- package/src/diagram-requirement-resolver.js +194 -0
- package/src/doctor.js +677 -0
- package/src/environment-graph.js +424 -0
- package/src/execution-state.js +849 -0
- package/src/explore-evidence.js +425 -0
- package/src/flow-design-scanner.js +896 -0
- package/src/flow-verifier.js +887 -0
- package/src/gesture-interaction-scanner.js +330 -0
- package/src/graph-context.js +263 -0
- package/src/graphify-adapter.js +189 -0
- package/src/html-report.js +1035 -0
- package/src/journey-map.js +1299 -0
- package/src/language.js +48 -0
- package/src/lazy-pattern-detector.js +182 -0
- package/src/local-dev-scanner.js +135 -0
- package/src/managed-worktree-gate.js +187 -0
- package/src/managed-worktree.js +766 -0
- package/src/merge-manager.js +501 -0
- package/src/network-contract-scanner.js +442 -0
- package/src/nocodb-story-sync.js +386 -0
- package/src/oss-readiness-scanner.js +417 -0
- package/src/performance-evidence.js +756 -0
- package/src/performance-measurer.js +591 -0
- package/src/pr-manager.js +8220 -0
- package/src/presets.js +682 -0
- package/src/public-discovery-scanner.js +519 -0
- package/src/refactoring-delta-reporter.js +367 -0
- package/src/refactoring-opportunity-generator.js +797 -0
- package/src/regression-risk-scanner.js +146 -0
- package/src/repo-status.js +266 -0
- package/src/report-fingerprint.js +188 -0
- package/src/report-pr-body-prompt-template.md +108 -0
- package/src/report-pr-body-schema.json +95 -0
- package/src/report-store.js +135 -0
- package/src/report-validator.js +192 -0
- package/src/requirement-consistency.js +1066 -0
- package/src/runtime-info.js +134 -0
- package/src/self-dogfood-scanner.js +476 -0
- package/src/session-learning.js +164 -0
- package/src/skills-manager.js +157 -0
- package/src/spec-drift.js +378 -0
- package/src/spec-fingerprint.js +445 -0
- package/src/spec-prompt-template.md +155 -0
- package/src/spec-schema.json +219 -0
- package/src/spec-store.js +258 -0
- package/src/spec-validator.js +459 -0
- package/src/static-site-scanner.js +316 -0
- package/src/story-candidate-generator.js +85 -0
- package/src/story-catalog-generator.js +2813 -0
- package/src/story-html.js +156 -0
- package/src/story-manager.js +2144 -0
- package/src/story-task-generator.js +522 -0
- package/src/task-manager.js +1029 -0
- package/src/terminal-link-scanner.js +238 -0
- package/src/usage-report.js +417 -0
- package/src/verification-evidence.js +284 -0
- package/src/workspace.js +126 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vibepro-diagnosis-packages
|
|
3
|
+
description: Use when the user asks VibePro to check UI, security, performance, architecture, PR readiness, launch readiness, or performance improvement evidence.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VibePro Diagnosis Packages
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use VibePro purpose-level packages instead of guessing which low-level scanner or log to inspect. The package is the user-facing intent; the scanner set and evidence paths are VibePro's implementation detail.
|
|
11
|
+
|
|
12
|
+
## Diagnosis Packages
|
|
13
|
+
|
|
14
|
+
List packages first when the request is ambiguous:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
vibepro check list
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use these mappings:
|
|
21
|
+
|
|
22
|
+
- UI quality / user flow / API contract in UI calls / gesture UX: `vibepro check ui <repo> --story-id <story-id>`
|
|
23
|
+
- Security / auth / exposed surface / API route contracts: `vibepro check security <repo> --story-id <story-id>`
|
|
24
|
+
- Performance readiness / heavy dev / DB access risks: `vibepro check performance <repo> --story-id <story-id>`
|
|
25
|
+
- Architecture / responsibility boundary: `vibepro check architecture <repo> --story-id <story-id>`
|
|
26
|
+
- PR readiness: `vibepro check pr-readiness <repo> --story-id <story-id> --base <ref> --head <ref>`
|
|
27
|
+
- Release or handoff readiness: `vibepro check launch-readiness <repo> --story-id <story-id>`
|
|
28
|
+
- Broad inspection: `vibepro check all <repo> --story-id <story-id>`
|
|
29
|
+
|
|
30
|
+
Package evidence is written to:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
.vibepro/checks/<pack>/<run-id>/check.json
|
|
34
|
+
.vibepro/checks/<pack>/<run-id>/check.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Performance Evidence
|
|
38
|
+
|
|
39
|
+
For a performance improvement claim, define Story-level metrics and record before/after runs. Do not rely only on ad hoc server logs or one-off E2E output.
|
|
40
|
+
|
|
41
|
+
Define metrics:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
vibepro performance define <repo> \
|
|
45
|
+
--id <story-id> \
|
|
46
|
+
--metric-id <metric-id> \
|
|
47
|
+
--user-story <text> \
|
|
48
|
+
--start-condition <text> \
|
|
49
|
+
--completion-condition <text> \
|
|
50
|
+
--intermediate-marker <marker-id> \
|
|
51
|
+
--timeout-ms <ms> \
|
|
52
|
+
--evidence-source <server_log|browser_e2e|api_log|client_marker|manual_observation> \
|
|
53
|
+
--readiness-kind <server_side|user_perceived|external_dependency|system_internal>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Record runs:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
vibepro performance record <repo> \
|
|
60
|
+
--id <story-id> \
|
|
61
|
+
--metric-id <metric-id> \
|
|
62
|
+
--label before \
|
|
63
|
+
--status completed \
|
|
64
|
+
--duration-ms <ms> \
|
|
65
|
+
--marker <marker-id=ms> \
|
|
66
|
+
--evidence-source <type:ref:summary>
|
|
67
|
+
|
|
68
|
+
vibepro performance record <repo> \
|
|
69
|
+
--id <story-id> \
|
|
70
|
+
--metric-id <metric-id> \
|
|
71
|
+
--label after \
|
|
72
|
+
--status completed \
|
|
73
|
+
--duration-ms <ms> \
|
|
74
|
+
--marker <marker-id=ms> \
|
|
75
|
+
--evidence-source <type:ref:summary>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Compare:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
vibepro performance compare <repo> --id <story-id>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Run evidence is written to:
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
.vibepro/pr/<story-id>/performance-runs/*.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Performance Guardrails
|
|
91
|
+
|
|
92
|
+
- DB performance is included, but DB/server time and user-perceived time must be separate metrics.
|
|
93
|
+
- `server_side` examples: DB query completed, API handler completed, tmux/server readiness.
|
|
94
|
+
- `user_perceived` examples: button click to visible DOM, snapshot visible, input ready, interactive ready.
|
|
95
|
+
- Do not claim user-perceived improvement from `server_log` alone.
|
|
96
|
+
- Compare only runs with the same `metricId` and `completionCondition`.
|
|
97
|
+
- Keep incomplete runs as evidence: `blocked`, `needs_review`, `timeout`, `auth_required`, `resource_unavailable`, `unknown`.
|
|
98
|
+
- If comparison is not possible, report `改善率不明` and list the missing marker/evidence.
|
|
99
|
+
|
|
100
|
+
## Network Contract Guardrails
|
|
101
|
+
|
|
102
|
+
- When UI code introduces `fetch('/api/...')`, axios, or an API wrapper call, confirm the matching Next.js route exists.
|
|
103
|
+
- App Router route example: `/api/foo/bar` -> `src/app/api/foo/bar/route.ts`.
|
|
104
|
+
- Pages Router route example: `/api/foo/bar` -> `src/pages/api/foo/bar.ts`.
|
|
105
|
+
- If a direct server function / Server Action call is replaced by an HTTP API call, treat it as a contract change requiring route, schema, auth/runtime, and network-aware E2E evidence.
|
|
106
|
+
- In `vibepro verify flow`, API 4xx/5xx, API HTML responses, console/page errors, `Failed to fetch`, `Unexpected token '<'`, and visible loading failure text are Gate failures even when the UI appears to render.
|
|
107
|
+
|
|
108
|
+
## UI Interactive Contract Guardrails
|
|
109
|
+
|
|
110
|
+
- `vibepro check ui` must evaluate the screen at the level of visible interaction contracts, not only at the Story E2E level.
|
|
111
|
+
- Clickable-looking UI must have one of these outcomes: save/mutate, visible state change, navigation, scroll/focus movement, explicit disabled state, or an explicit unfinished state such as `準備中` / `coming soon`.
|
|
112
|
+
- Treat normal-looking placeholder buttons as findings when they only `console.log`, TODO, no-op, or have no `onClick` / `href` / submit / disabled / unfinished-state marker.
|
|
113
|
+
- Story E2E coverage is not enough when the changed screen has additional clickable-looking controls. Require a screen-level clickable element inventory for UI-heavy changes.
|
|
114
|
+
- For Playwright flow checks, click not only the main happy path but also controls that appear actionable: secondary buttons, detail links, icon buttons, tabs, menu triggers, AI/voice actions, and expandable rows.
|
|
115
|
+
|
|
116
|
+
## Gesture Interaction Guardrails
|
|
117
|
+
|
|
118
|
+
- For mobile-heavy UI, map UI, carousel UI, drag/drop, swipe, or touch changes, inspect the `Gesture Interaction` section from `vibepro check ui/all/launch-readiness`.
|
|
119
|
+
- Treat these as review-required signals: ambiguous `touch-action`, map overlays without clear `pointer-events`, drag state not connected to click suppression, carousel surfaces without snap/threshold evidence, small gesture hit areas, and map markers without collision/zIndex/contrast/hit-area contract.
|
|
120
|
+
- Static gesture findings are review candidates, not automatic proof of an app bug. Convert them to block-level evidence when Playwright/runtime probes show wrong navigation, no scroll/active-card movement, intercepted hit targets, or visible interaction failure.
|
|
121
|
+
- In `vibepro verify flow`, add gesture probes for changed surfaces. Useful steps include `drag`, `touchDrag`, `expectUrlUnchanged`, `expectScrollLeftChanged`, active item change via `activeSelector` + `expectActiveChanged`, and `expectElementFromPoint`.
|
|
122
|
+
- For “swipe becomes tap” regressions, verify that drag after a card/map interaction does not change URL and does update the expected scroll or active item state.
|
|
123
|
+
|
|
124
|
+
## Review Checklist
|
|
125
|
+
|
|
126
|
+
Before saying VibePro confirmed the result:
|
|
127
|
+
|
|
128
|
+
- The package or performance command that produced the evidence is named.
|
|
129
|
+
- The evidence artifact path is included.
|
|
130
|
+
- The Story ID is correct.
|
|
131
|
+
- p50, p90, max, sample count, and incomplete rate are shown for performance comparisons.
|
|
132
|
+
- The answer separates internal readiness from user-perceived readiness.
|
|
133
|
+
- UI findings include whether clickable-looking controls have an interaction contract or are explicitly disabled/unfinished.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vibepro-human-review
|
|
3
|
+
description: Use when reviewing VibePro PR preparation artifacts, deciding whether to proceed, split, add evidence, waive with reason, or block.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VibePro Human Review
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use this Skill when a human or AI reviewer needs to interpret VibePro PR artifacts. `pr-prepare.json` is the readiness source of truth; the review cockpit is the human control plane.
|
|
11
|
+
|
|
12
|
+
## Review Order
|
|
13
|
+
|
|
14
|
+
1. Read `.vibepro/pr/<story-id>/pr-prepare.json` `gate_status`.
|
|
15
|
+
2. Confirm `gate_status.overall_status`, `ready_for_pr_create`, unresolved Gates, and critical unresolved Gates.
|
|
16
|
+
3. If `gate_status.agent_review_instruction` is present, block human approval until the coordinator has authorization to use subagents and then has:
|
|
17
|
+
- run the listed `vibepro review prepare` commands,
|
|
18
|
+
- dispatched the generated `parallel-dispatch.md` requests to parallel subagents,
|
|
19
|
+
- closed/shutdown each review subagent after receiving its result,
|
|
20
|
+
- recorded each result with `vibepro review record` including Codex/Claude Code subagent provenance and `--agent-closed`,
|
|
21
|
+
- rerun `vibepro pr prepare` and cleared `gate:agent_review`.
|
|
22
|
+
If the coordinator runtime cannot spawn subagents, treat that as a blocker or require a human waiver decision. Do not accept manual review records as a substitute for required Codex/Claude Code subagent provenance.
|
|
23
|
+
4. Open `.vibepro/pr/<story-id>/review-cockpit.html`.
|
|
24
|
+
5. Read the recommended decision and reason.
|
|
25
|
+
6. Check split lanes and Graphify investigation scope.
|
|
26
|
+
7. For UI modernization PRs, read `.vibepro/design-modernize/<story-id>/derived-design-system.json`, `design-modernize.json`, and `ds-gate.json`. Confirm that current routes, information architecture, CTA priority, state behavior, and data dependencies are preserved unless the Story/Spec explicitly changes them.
|
|
27
|
+
8. For performance-sensitive PRs, read the `Performance Evidence` section in `pr-body.md` and the JSON runs under `.vibepro/pr/<story-id>/performance-runs/`.
|
|
28
|
+
9. Review next commands and confirm they use `vibepro pr create`.
|
|
29
|
+
10. Copy `human-review.json`, fill the review record, and keep it as the human decision artifact.
|
|
30
|
+
|
|
31
|
+
## Decision Rules
|
|
32
|
+
|
|
33
|
+
- `proceed`: Use only when `gate_status.ready_for_pr_create=true`, `gate_status.overall_status=ready_for_review`, and the split-plan does not require separation.
|
|
34
|
+
- `split_pr`: Use when scope is broad, repo-control files are mixed in, or split-plan recommends lanes.
|
|
35
|
+
- `add_evidence`: Use when required Gates need test, typecheck, integration, E2E, or requirement evidence.
|
|
36
|
+
- `waive_with_reason`: Use only with a specific reason for non-critical unresolved Gates. Critical unresolved Gates cannot be approved by reason alone.
|
|
37
|
+
- `block`: Use when Story, Architecture, Spec, security, or Gate evidence is contradictory or insufficient.
|
|
38
|
+
|
|
39
|
+
## Required Record
|
|
40
|
+
|
|
41
|
+
Fill these fields in `human-review.json`:
|
|
42
|
+
|
|
43
|
+
- `review_record.selected_decision`
|
|
44
|
+
- `review_record.reviewer`
|
|
45
|
+
- `review_record.reason`
|
|
46
|
+
- `review_record.reviewed_at`
|
|
47
|
+
- `review_record.comments` when needed
|
|
48
|
+
|
|
49
|
+
## Guardrails
|
|
50
|
+
|
|
51
|
+
- Do not treat `review-cockpit.html` as machine-readable truth; use the JSON sidecar.
|
|
52
|
+
- Do not treat `scope.status=reviewable` as completion approval. It is PR size/scope guidance only.
|
|
53
|
+
- Do not approve a PR only from the PR body. The cockpit and Gate DAG are the review control plane.
|
|
54
|
+
- Do not use raw `gh pr create`; it bypasses VibePro Gate enforcement and waiver recording.
|
|
55
|
+
- Do not approve with unresolved Agent Review Gate. Missing, stale, or blocking required roles mean the parallel subagent review workflow has not completed for the current git state.
|
|
56
|
+
- Do not approve a `pass` review result that lacks Codex/Claude Code parallel subagent provenance and closed lifecycle evidence (`--agent-closed`) when `gate:agent_review` is required. It is a coordinator note, not verified subagent review evidence.
|
|
57
|
+
- If a waiver is chosen, include the exact waiver reason in `vibepro pr create --allow-needs-verification --verification-waiver <reason>`.
|
|
58
|
+
- Do not approve a performance claim when the comparison says `改善率不明` / `not_comparable`.
|
|
59
|
+
- Do not accept server-side readiness as evidence for user-perceived readiness. User-perceived metrics need `browser_e2e`, `client_marker`, or `manual_observation`.
|
|
60
|
+
- Check that snapshot visible, DOM visible, API completed, server ready, and interactive ready are not mixed into one completion condition.
|
|
61
|
+
- Do not approve UI modernization when `ds-gate.json` is missing, has implicit fallback, or omits DS drift / component role / composition / anti-pattern checks.
|
|
62
|
+
- Do not approve a generated visual direction just because it looks better. Require evidence that it preserves the existing product workflow and that the implementation follows VibePro-derived DS constraints.
|
|
63
|
+
|
|
64
|
+
## Performance Evidence Review
|
|
65
|
+
|
|
66
|
+
For a PR that claims speed improvement, require:
|
|
67
|
+
|
|
68
|
+
- Metric definition exists in the Story `performanceMetrics[]`.
|
|
69
|
+
- Runs exist under `.vibepro/pr/<story-id>/performance-runs/*.json`.
|
|
70
|
+
- before and after use the same `metricId` and `completionCondition`.
|
|
71
|
+
- p50, p90, max, sample count, and incomplete rate are visible.
|
|
72
|
+
- `blocked`, `needs_review`, `timeout`, `auth_required`, `resource_unavailable`, or `unknown` runs are retained instead of silently dropped.
|
|
73
|
+
- DB/server metrics and user-perceived metrics are separate when both matter.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vibepro-story-refactor
|
|
3
|
+
description: Use when refactoring with VibePro so the agent follows Story -> Architecture -> Spec -> Task -> Code -> Gate -> PR instead of editing code first.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VibePro Story Refactor
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use this Skill when VibePro is driving a refactor. The goal is to find and fix code defects, security risks, DRY gaps, and responsibility-boundary problems while preserving Story / Architecture / Spec consistency.
|
|
11
|
+
|
|
12
|
+
## Required Workflow
|
|
13
|
+
|
|
14
|
+
1. Start from a Story. If no Story exists, run `vibepro story derive` and inspect the Story map before implementing.
|
|
15
|
+
2. Resolve the output language from `.vibepro/config.json` `output.language` or the explicit CLI `--language` override before manually adding or editing human-facing Story, Architecture, Spec, Task, Review, Diagnosis, Journey, or PR artifacts.
|
|
16
|
+
3. Check Architecture. If the boundary, dependency direction, or responsibility split is missing, restore or add Architecture docs before changing code.
|
|
17
|
+
4. Check Spec. If behavior, invariant, API, or data-flow expectations are missing, restore or add Spec docs before changing code.
|
|
18
|
+
5. Use VibePro task context:
|
|
19
|
+
- `vibepro story plan <repo>`
|
|
20
|
+
- `vibepro task create <repo> --from-plan --id <story-id>`
|
|
21
|
+
- `vibepro task brief|plan|handoff <repo> --task <task-id> --id <story-id>`
|
|
22
|
+
6. Use a diagnosis package when the refactor has a clear purpose:
|
|
23
|
+
- UI behavior: `vibepro check ui <repo> --story-id <story-id>`
|
|
24
|
+
- Security boundary: `vibepro check security <repo> --story-id <story-id>`
|
|
25
|
+
- Performance readiness: `vibepro check performance <repo> --story-id <story-id>`
|
|
26
|
+
- Architecture boundary: `vibepro check architecture <repo> --story-id <story-id>`
|
|
27
|
+
- Launch readiness: `vibepro check launch-readiness <repo> --story-id <story-id>`
|
|
28
|
+
7. For performance refactors, define Story-level metrics before claiming improvement. Separate DB/server readiness from user-perceived readiness.
|
|
29
|
+
8. For UI/UX modernization refactors, derive design constraints before changing components:
|
|
30
|
+
- run `vibepro design-modernize derive-system <repo> --id <story-id> ...`,
|
|
31
|
+
- run `vibepro design-modernize plan <repo> --id <story-id> ...`,
|
|
32
|
+
- preserve current routes, information architecture, CTA priority, state behavior, and data dependencies,
|
|
33
|
+
- treat image-generated or external design proposals as visual hypotheses, not implementation authority.
|
|
34
|
+
9. Implement with focused tests. Prefer small changes tied to the task target files.
|
|
35
|
+
10. Run project verification and then `vibepro pr prepare`.
|
|
36
|
+
11. Read `pr-prepare.json` `gate_status` before treating the work as PR-ready.
|
|
37
|
+
12. If Agent Review Gate is unresolved, it must be cleared before finalizing. Treat the generated review plan as an instruction to dispatch Codex/Claude Code subagents when the coordinator runtime provides subagent capability. Do not convert it into a user-permission wait or silently skip it.
|
|
38
|
+
13. Run the VibePro parallel subagent review workflow:
|
|
39
|
+
- `vibepro review prepare <repo> --id <story-id> --stage <stage>`
|
|
40
|
+
- dispatch each role in `parallel-dispatch.md` as a separate parallel subagent review,
|
|
41
|
+
- close/shutdown each review subagent after receiving its result,
|
|
42
|
+
- `vibepro review record` each result with Codex/Claude Code provenance and lifecycle evidence (`--agent-system codex|claude_code --execution-mode parallel_subagent --agent-id <id> --agent-closed` plus thread/session/call/transcript evidence),
|
|
43
|
+
- rerun `vibepro pr prepare`.
|
|
44
|
+
If the runtime cannot spawn subagents, block or record a human waiver decision; manual review records do not satisfy required Agent Review Gate.
|
|
45
|
+
14. Use the review cockpit to decide whether to proceed, split, add evidence, waive with reason, or block.
|
|
46
|
+
|
|
47
|
+
## Refactor Target Criteria
|
|
48
|
+
|
|
49
|
+
Prioritize candidates that VibePro surfaces as:
|
|
50
|
+
|
|
51
|
+
- security boundary or authorization risk
|
|
52
|
+
- duplicated query, validation, or policy shape
|
|
53
|
+
- responsibility split failure
|
|
54
|
+
- Story / Architecture / Spec contradiction
|
|
55
|
+
- Graphify-related impact beyond changed files
|
|
56
|
+
- Gate evidence missing for changed behavior
|
|
57
|
+
|
|
58
|
+
## Guardrails
|
|
59
|
+
|
|
60
|
+
- Do not refactor only because code looks untidy. Tie the work to Story value and evidence.
|
|
61
|
+
- Do not widen scope after `task handoff` unless `pr prepare` confirms the scope remains reviewable.
|
|
62
|
+
- Do not mix repo-control changes, requirement SSOT recovery, runtime behavior, and E2E gate fixes unless the split-plan allows it.
|
|
63
|
+
- Do not treat `scope.status=reviewable` as completion approval. It is PR size/scope guidance only.
|
|
64
|
+
- Do not merge or create a PR unless `gate_status.ready_for_pr_create=true` and `gate_status.overall_status=ready_for_review`.
|
|
65
|
+
- Do not waive critical unresolved Gates with a reason alone. Critical Gates require evidence closure or a split/block decision.
|
|
66
|
+
- Do not call a VibePro refactor complete while `gate:agent_review` is `needs_review`, `missing`, `stale`, `block`, or `failed`; complete the parallel subagent reviews first.
|
|
67
|
+
- Do not satisfy Agent Review Gate with a manual `pass`. A passing review must include Codex or Claude Code parallel subagent provenance and closed lifecycle evidence (`--agent-closed`) so later audits can distinguish real subagent review from coordinator self-approval and closed review threads.
|
|
68
|
+
- Do not treat visual redesign as a refactor unless the unchanged UX contracts are explicit. Current route, layout information hierarchy, CTA priority, state behavior, data dependencies, and accessibility expectations must be preserved or intentionally changed in Story/Spec.
|
|
69
|
+
- Do not use color-token substitution as a substitute for a Design System. VibePro-derived DS should include semantic colors, state colors, component roles, CTA hierarchy, composition rules, anti-patterns, and visual hypothesis policy.
|
|
70
|
+
- Do not translate machine-facing identifiers while localizing human-facing artifacts. Keep JSON keys, schema names, enums, Story IDs, Gate IDs, DAG node IDs, task IDs, role IDs, commands, file paths, package names, and external tool names unchanged.
|
|
71
|
+
- Do not claim VibePro managed worktree execution exists just because Story / Spec / Architecture documents describe the planned DAG. Until `vibepro execute start` actually creates or reuses a worktree and records that state, use a normal git worktree manually when isolation is needed.
|
|
72
|
+
- Do not clean dirty repository worktrees by reflexively stashing. First inspect `git status --short --branch`, unstaged diff, cached diff, and branch/HEAD reflog.
|
|
73
|
+
- If a branch was advanced by external sync, merge, rebase, or another worktree, check whether the dirty state is a stale reverse diff from the previous branch commit to `HEAD`. Compare `git diff --stat <old> HEAD` with `git diff --cached --stat` / `git diff --stat` before deciding.
|
|
74
|
+
- Only classify dirty state as safe to clean after proving it is already represented in `HEAD` and contains no extra user hunks. Otherwise report the exact files and keep the work intact.
|
|
75
|
+
|
|
76
|
+
## Completion Check
|
|
77
|
+
|
|
78
|
+
Before calling the work done:
|
|
79
|
+
|
|
80
|
+
- Story / Architecture / Spec relationship is clear.
|
|
81
|
+
- Tests or verification evidence exists for changed behavior.
|
|
82
|
+
- Purpose-level diagnosis package evidence exists when UI, security, performance, architecture, or launch readiness was the stated goal.
|
|
83
|
+
- UI modernization has `derived-design-system.json`, `design-modernize.json`, and `ds-gate.json` evidence when the Story changes design/UX.
|
|
84
|
+
- Performance improvements have comparable before/after evidence, or the PR explicitly says improvement rate is unknown and why.
|
|
85
|
+
- `pr-prepare.json` `gate_status.ready_for_pr_create` is true.
|
|
86
|
+
- `gate:agent_review` has passed when VibePro required parallel subagent review.
|
|
87
|
+
- `review-cockpit.html` has a clear recommended decision.
|
|
88
|
+
- `human-review.json` can record the human decision.
|
|
89
|
+
- `vibepro pr create` is the PR creation path.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vibepro-workflow
|
|
3
|
+
description: Use when working with VibePro CLI, Graphify, Story diagnosis, task planning, PR preparation, Gate evidence, or VibePro review artifacts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VibePro Workflow
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use VibePro as a Story / Architecture / Spec / Graphify / Gate control plane. The CLI creates evidence; this Skill tells the agent how to use that evidence without skipping the intended order.
|
|
11
|
+
|
|
12
|
+
## Operating Order
|
|
13
|
+
|
|
14
|
+
1. Confirm the target repository and current branch.
|
|
15
|
+
2. Initialize only when needed: `vibepro init <repo> --language ja`.
|
|
16
|
+
3. Before manually adding or editing human-facing VibePro artifacts, resolve the output language from `.vibepro/config.json` `output.language` or the explicit CLI `--language` override.
|
|
17
|
+
4. Select or create the Story before diagnosing or changing code.
|
|
18
|
+
5. Import Graphify context before impact-sensitive work: `vibepro graph <repo> --run-graphify`.
|
|
19
|
+
6. Diagnose and derive the repo context:
|
|
20
|
+
- `vibepro story diagnose <repo> --id <story-id> --run-graphify`
|
|
21
|
+
- `vibepro story derive <repo> --run-graphify`
|
|
22
|
+
- `vibepro story map <repo>`
|
|
23
|
+
7. When the user asks for a purpose-level check, use diagnosis packages instead of guessing the scanner set:
|
|
24
|
+
- `vibepro check list`
|
|
25
|
+
- `vibepro check ui <repo>`
|
|
26
|
+
- `vibepro check security <repo>`
|
|
27
|
+
- `vibepro check performance <repo>`
|
|
28
|
+
- `vibepro check architecture <repo>`
|
|
29
|
+
- `vibepro check pr-readiness <repo> --base <ref> --head <ref>`
|
|
30
|
+
- `vibepro check launch-readiness <repo>`
|
|
31
|
+
8. For performance improvement stories, define and record Story-level performance evidence before claiming speedups:
|
|
32
|
+
- `vibepro performance define <repo> --id <story-id> --metric-id <id> --user-story <text> --start-condition <text> --completion-condition <text> --evidence-source <type>`
|
|
33
|
+
- `vibepro performance record <repo> --id <story-id> --metric-id <id> --label before|after --status completed --duration-ms <ms> --evidence-source <type:ref:summary>`
|
|
34
|
+
- `vibepro performance compare <repo> --id <story-id>`
|
|
35
|
+
9. For existing UI modernization, derive the product-local Design System before screen implementation:
|
|
36
|
+
- Run Graphify first when available: `vibepro graph <repo> --run-graphify`.
|
|
37
|
+
- Run `vibepro design-system derive <repo> --id <ds-id> --product <name> --routes <csv> --brief <text> --from-code`.
|
|
38
|
+
- Review `.vibepro/design-system/<ds-id>/evidence-coverage.json` and `ds-gate.json` before accepting the DS as an implementation constraint.
|
|
39
|
+
- Treat `.vibepro/design-system/<ds-id>/design-system.json`, `semantic-tokens.json`, `component-roles.json`, `component-states.json`, `screen-patterns.json`, `cta-policy.json`, `density-policy.json`, `navigation-policy.json`, `anti-patterns.json`, and `implementation-mapping.json` as product-local DS evidence.
|
|
40
|
+
10. For screen-level UI modernization, create the story-specific design decision space before screen implementation:
|
|
41
|
+
- `vibepro design-modernize derive-system <repo> --id <story-id> --product <name> --routes <csv> --brief <text>`
|
|
42
|
+
- `vibepro design-modernize plan <repo> --id <story-id> --product <name> --routes <csv> --base-url <url>`
|
|
43
|
+
- Treat `.vibepro/design-modernize/<story-id>/derived-design-system.json`, `design-modernize.json`, and `ds-gate.json` as implementation constraints.
|
|
44
|
+
- External Design System bundles, screenshots, and image-generated ideas are visual hypotheses. The VibePro-derived Design System, current UI evidence, Story/Spec, and Gate DAG remain authoritative.
|
|
45
|
+
11. Plan work from VibePro evidence: `vibepro story plan <repo>`.
|
|
46
|
+
12. Create task context before implementation: `vibepro task create <repo> --from-plan --id <story-id>`.
|
|
47
|
+
13. After code changes, run `vibepro pr prepare <repo> --story-id <story-id>`.
|
|
48
|
+
14. Read `.vibepro/pr/<story-id>/pr-prepare.json` `gate_status` before treating work as PR-ready.
|
|
49
|
+
15. If `gate_status.agent_review_instruction` is present, Agent Review is mandatory. Treat the generated review plan as an instruction to dispatch Codex/Claude Code subagents when the coordinator runtime provides subagent capability. Do not convert it into a user-permission wait or silently skip it.
|
|
50
|
+
16. Run parallel subagent review:
|
|
51
|
+
- Run each listed `vibepro review prepare <repo> --id <story-id> --stage <stage>`.
|
|
52
|
+
- Open the generated `.vibepro/reviews/<story-id>/<stage>/parallel-dispatch.md`.
|
|
53
|
+
- Start the listed Codex/Claude Code subagents in parallel, one role per subagent.
|
|
54
|
+
- After each subagent returns, close/shutdown that review subagent before recording the result. Do not leave review subagents running.
|
|
55
|
+
- Record every result with `vibepro review record` and include subagent provenance plus closed lifecycle evidence:
|
|
56
|
+
- Codex: `--agent-system codex --execution-mode parallel_subagent --agent-id <spawned-agent-id> --agent-closed` plus `--agent-thread-id` or `--agent-call-id` when available.
|
|
57
|
+
- Claude Code: `--agent-system claude_code --execution-mode parallel_subagent --agent-id <task-or-subagent-id> --agent-closed` plus `--agent-session-id` or `--agent-transcript` when available.
|
|
58
|
+
- Rerun `vibepro pr prepare` and continue only after `gate:agent_review` passes.
|
|
59
|
+
- If the runtime cannot spawn subagents, block or record a human waiver decision; manual review records do not satisfy required Agent Review Gate.
|
|
60
|
+
17. Open `review-cockpit.html` first, then deep-dive into `gate-dag.html`, `split-plan.html`, and `pr-body.md`.
|
|
61
|
+
18. Use `vibepro pr create`; do not bypass VibePro with raw `gh pr create`.
|
|
62
|
+
|
|
63
|
+
## Human Artifact Language
|
|
64
|
+
|
|
65
|
+
- Human-facing Story, Journey, Architecture, Spec, Task, Review, Diagnosis, and PR artifacts should be written in the resolved output language.
|
|
66
|
+
- Preserve machine-facing identifiers exactly: JSON keys, schema names, enums, Story IDs, Gate IDs, DAG node IDs, task IDs, role IDs, commands, file paths, package names, and external tool names.
|
|
67
|
+
- Preserve user-provided text and external evidence text unless the artifact explicitly asks for translation or localization.
|
|
68
|
+
- When CLI-generated artifacts are incomplete and the agent fills them manually, match the repository language policy instead of defaulting to English.
|
|
69
|
+
|
|
70
|
+
## Managed Worktree Status
|
|
71
|
+
|
|
72
|
+
- Recent VibePro Story / Spec / Architecture documents define a future managed worktree Execution DAG, but this is not evidence that the installed CLI already creates, reuses, or enforces managed worktrees.
|
|
73
|
+
- Do not claim VibePro created a worktree unless a real command result records that state.
|
|
74
|
+
- Until `vibepro execute start` actually reports managed worktree creation or reuse, create normal git worktrees manually when isolation is needed, and keep implementation, verification, review, PR preparation, and PR creation in that isolated worktree.
|
|
75
|
+
- When a future VibePro CLI reports managed worktree state, prefer that state and run the rest of the VibePro flow from the reported worktree.
|
|
76
|
+
|
|
77
|
+
## Guardrails
|
|
78
|
+
|
|
79
|
+
- Do not treat VibePro diagnosis as truth by itself. Verify with code, tests, runtime logs, or product behavior.
|
|
80
|
+
- Do not patch graph-sensitive runtime, auth, data, or UI state-machine code before checking Graphify impact.
|
|
81
|
+
- Do not skip Story -> Architecture -> Spec ordering when the task is a refactor.
|
|
82
|
+
- Do not treat `scope.status=reviewable` as completion approval. It is PR size/scope guidance only.
|
|
83
|
+
- Do not ignore unresolved Gates. Add evidence, split the PR, block, or record a waiver reason.
|
|
84
|
+
- Do not waive critical unresolved Gates with a reason alone. Critical Gates require evidence closure or a split/block decision.
|
|
85
|
+
- Do not treat Agent Review Gate as optional. When it is unresolved, the coordinator must prepare, dispatch, record, and rerun the VibePro review flow before calling the work complete.
|
|
86
|
+
- Do not record a passing Agent Review result without Codex/Claude Code parallel subagent provenance and closed lifecycle evidence (`--agent-closed`). Manual `pass` records are audit notes, not enough to satisfy `gate:agent_review`.
|
|
87
|
+
- Keep JSON artifacts as the machine-readable source of truth. HTML is the human control plane.
|
|
88
|
+
- Do not claim user-perceived performance improvement from server logs alone. Use a separate `user_perceived` metric backed by `browser_e2e`, `client_marker`, or `manual_observation`.
|
|
89
|
+
- Do not mix server readiness, API completion, DOM visibility, snapshot visibility, and interactive readiness as the same completion condition. Define them as separate metrics.
|
|
90
|
+
- Do not treat type-check or a superficially rendered UI as enough when UI code introduces `/api/...` calls. Network Contract Gate requires matching Next.js routes and network-aware flow evidence for API 4xx/5xx.
|
|
91
|
+
- Do not treat Story-level E2E existence as enough for UI-heavy changes. Clickable-looking controls on the changed screen need an interaction contract: save/mutate, visible state change, navigation, scroll/focus, disabled, or explicit unfinished state.
|
|
92
|
+
- Do not skip `design-system derive` for existing products that need a reusable DS. Screen-level modernization should not invent product semantics when current routes, CTAs, states, style tokens, or Graphify evidence can define them.
|
|
93
|
+
- Do not treat `.vibepro/design-system/<ds-id>/design-system.json` as complete unless `evidence-coverage.json` and `ds-gate.json` are reviewed. Missing Graphify/style evidence may be a warning; missing semantic roles or implicit fallback is a design gate problem.
|
|
94
|
+
- Do not implement a generated design proposal directly. For UI modernization, first verify the current route, information architecture, CTA priority, state behavior, and data dependencies against the Derived Design System and `ds-gate.json`.
|
|
95
|
+
- Do not let `ds-gate.json` fall back implicitly. If DS drift, component role, composition, visual hypothesis, or anti-pattern clauses are missing, treat the design-modernize evidence as incomplete.
|
|
96
|
+
|
|
97
|
+
## Git / Worktree Dirty Guardrails
|
|
98
|
+
|
|
99
|
+
- Do not use `git stash`, `git restore`, `git reset`, or checkout changes as the first response to a dirty repository worktree. First classify the dirty state.
|
|
100
|
+
- Before cleaning dirty state, record:
|
|
101
|
+
- `git status --short --branch`
|
|
102
|
+
- `git diff --name-status`
|
|
103
|
+
- `git diff --cached --name-status`
|
|
104
|
+
- `git diff --stat`
|
|
105
|
+
- `git diff --cached --stat`
|
|
106
|
+
- `git reflog --date=iso -8 HEAD`
|
|
107
|
+
- `git reflog --date=iso -8 <current-branch>`
|
|
108
|
+
- If a checked-out branch moved via an external sync, merge, rebase, or another worktree, verify whether the dirty diff is a stale reverse diff before treating it as user work.
|
|
109
|
+
- A stale reverse diff is likely when the branch reflog advanced from an old commit to `HEAD`, while `git diff --cached` or `git diff` is exactly the inverse of the commits between that old commit and `HEAD`.
|
|
110
|
+
- Prove this before cleanup by comparing the dirty diff with the commit range, for example:
|
|
111
|
+
- `git diff --stat <old-commit> HEAD`
|
|
112
|
+
- `git diff --stat HEAD <old-commit>`
|
|
113
|
+
- `git diff --name-status <old-commit> HEAD`
|
|
114
|
+
- `git diff --name-status HEAD <old-commit>`
|
|
115
|
+
- If the dirty state is a proven stale reverse diff, say so explicitly and then synchronize the worktree/index to `HEAD` with the least destructive command that resolves the observed state. Do not preserve it as a stash unless the user asks for archival.
|
|
116
|
+
- If the dirty state contains files or hunks that do not match the stale reverse diff, treat them as possible user work and do not clean them without reporting the exact files and asking for direction when needed.
|
|
117
|
+
|
|
118
|
+
## Key Artifacts
|
|
119
|
+
|
|
120
|
+
- `.vibepro/stories/story-map.md`: repo Story map for human review.
|
|
121
|
+
- `.vibepro/stories/story-plan.md`: candidate work items.
|
|
122
|
+
- `.vibepro/pr/<story-id>/pr-prepare.json`: PR readiness source of truth; check `gate_status`.
|
|
123
|
+
- `.vibepro/pr/<story-id>/review-cockpit.html`: first screen for human decision.
|
|
124
|
+
- `.vibepro/pr/<story-id>/human-review.json`: machine-readable human decision template.
|
|
125
|
+
- `.vibepro/pr/<story-id>/gate-dag.html`: Gate dependency view.
|
|
126
|
+
- `.vibepro/pr/<story-id>/split-plan.html`: split lanes and Graphify investigation scope.
|
|
127
|
+
- `.vibepro/reviews/<story-id>/<stage>/parallel-dispatch.md`: required parallel subagent dispatch instructions when Agent Review Gate is unresolved.
|
|
128
|
+
- `.vibepro/checks/<pack>/<run-id>/check.json`: purpose-level diagnosis package evidence.
|
|
129
|
+
- `.vibepro/checks/<pack>/<run-id>/check.md`: human-readable diagnosis package report.
|
|
130
|
+
- `.vibepro/checks/ui/<run-id>/check.json`: UI check evidence, including `flow_design.interactive_contract_hits`.
|
|
131
|
+
- `.vibepro/pr/<story-id>/performance-runs/*.json`: Story-level performance evidence runs.
|
|
132
|
+
- `.vibepro/design-system/<ds-id>/design-system.json`: product-local Design System derived from current evidence.
|
|
133
|
+
- `.vibepro/design-system/<ds-id>/evidence-coverage.json`: route/style/Graphify/semantic coverage findings for the native DS.
|
|
134
|
+
- `.vibepro/design-system/<ds-id>/ds-gate.json`: explicit DS gate with fallback disabled.
|
|
135
|
+
- `.vibepro/design-system/<ds-id>/implementation-mapping.json`: route/component/file mapping for implementation handoff.
|
|
136
|
+
- `.vibepro/design-modernize/<story-id>/design-system-derivation.json`: product semantics and Derived Design System derivation.
|
|
137
|
+
- `.vibepro/design-modernize/<story-id>/derived-design-system.json`: semantic tokens, component roles, CTA hierarchy, anti-patterns, and visual hypothesis policy.
|
|
138
|
+
- `.vibepro/design-modernize/<story-id>/design-modernize.json`: screen modernization plan and Design Quality DAG.
|
|
139
|
+
- `.vibepro/design-modernize/<story-id>/ds-gate.json`: explicit DS drift and UX regression gate clauses.
|