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.
Files changed (89) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +9 -0
  3. package/README.ja.md +448 -0
  4. package/README.md +520 -0
  5. package/agent-instructions/codex/AGENTS.vibepro.md +45 -0
  6. package/bin/vibepro.js +9 -0
  7. package/docs/assets/vibepro-header.png +0 -0
  8. package/package.json +51 -0
  9. package/skills/vibepro-diagnosis-packages/SKILL.md +133 -0
  10. package/skills/vibepro-human-review/SKILL.md +73 -0
  11. package/skills/vibepro-story-refactor/SKILL.md +89 -0
  12. package/skills/vibepro-workflow/SKILL.md +139 -0
  13. package/src/agent-harness-map.js +230 -0
  14. package/src/agent-harness-scanner.js +337 -0
  15. package/src/agent-review.js +2180 -0
  16. package/src/api-boundary-scanner.js +452 -0
  17. package/src/architecture-profiler.js +423 -0
  18. package/src/authorization-scoring.js +149 -0
  19. package/src/brainbase-importer.js +534 -0
  20. package/src/change-risk-classifier.js +195 -0
  21. package/src/check-packs.js +605 -0
  22. package/src/checkpoint-manager.js +233 -0
  23. package/src/cli.js +2213 -0
  24. package/src/code-quality-scanner.js +310 -0
  25. package/src/codex-manager.js +143 -0
  26. package/src/component-style-scanner.js +336 -0
  27. package/src/coverage-report.js +99 -0
  28. package/src/database-access-scanner.js +163 -0
  29. package/src/decision-records.js +315 -0
  30. package/src/design-modernize.js +1435 -0
  31. package/src/design-system.js +1732 -0
  32. package/src/diagnostic-engine.js +1945 -0
  33. package/src/diagram-requirement-resolver.js +194 -0
  34. package/src/doctor.js +677 -0
  35. package/src/environment-graph.js +424 -0
  36. package/src/execution-state.js +849 -0
  37. package/src/explore-evidence.js +425 -0
  38. package/src/flow-design-scanner.js +896 -0
  39. package/src/flow-verifier.js +887 -0
  40. package/src/gesture-interaction-scanner.js +330 -0
  41. package/src/graph-context.js +263 -0
  42. package/src/graphify-adapter.js +189 -0
  43. package/src/html-report.js +1035 -0
  44. package/src/journey-map.js +1299 -0
  45. package/src/language.js +48 -0
  46. package/src/lazy-pattern-detector.js +182 -0
  47. package/src/local-dev-scanner.js +135 -0
  48. package/src/managed-worktree-gate.js +187 -0
  49. package/src/managed-worktree.js +766 -0
  50. package/src/merge-manager.js +501 -0
  51. package/src/network-contract-scanner.js +442 -0
  52. package/src/nocodb-story-sync.js +386 -0
  53. package/src/oss-readiness-scanner.js +417 -0
  54. package/src/performance-evidence.js +756 -0
  55. package/src/performance-measurer.js +591 -0
  56. package/src/pr-manager.js +8220 -0
  57. package/src/presets.js +682 -0
  58. package/src/public-discovery-scanner.js +519 -0
  59. package/src/refactoring-delta-reporter.js +367 -0
  60. package/src/refactoring-opportunity-generator.js +797 -0
  61. package/src/regression-risk-scanner.js +146 -0
  62. package/src/repo-status.js +266 -0
  63. package/src/report-fingerprint.js +188 -0
  64. package/src/report-pr-body-prompt-template.md +108 -0
  65. package/src/report-pr-body-schema.json +95 -0
  66. package/src/report-store.js +135 -0
  67. package/src/report-validator.js +192 -0
  68. package/src/requirement-consistency.js +1066 -0
  69. package/src/runtime-info.js +134 -0
  70. package/src/self-dogfood-scanner.js +476 -0
  71. package/src/session-learning.js +164 -0
  72. package/src/skills-manager.js +157 -0
  73. package/src/spec-drift.js +378 -0
  74. package/src/spec-fingerprint.js +445 -0
  75. package/src/spec-prompt-template.md +155 -0
  76. package/src/spec-schema.json +219 -0
  77. package/src/spec-store.js +258 -0
  78. package/src/spec-validator.js +459 -0
  79. package/src/static-site-scanner.js +316 -0
  80. package/src/story-candidate-generator.js +85 -0
  81. package/src/story-catalog-generator.js +2813 -0
  82. package/src/story-html.js +156 -0
  83. package/src/story-manager.js +2144 -0
  84. package/src/story-task-generator.js +522 -0
  85. package/src/task-manager.js +1029 -0
  86. package/src/terminal-link-scanner.js +238 -0
  87. package/src/usage-report.js +417 -0
  88. package/src/verification-evidence.js +284 -0
  89. package/src/workspace.js +126 -0
@@ -0,0 +1,156 @@
1
+ import path from 'node:path';
2
+
3
+ import { __testing__ as htmlHelpers } from './html-report.js';
4
+
5
+ const { renderDocument, metricCard, renderTable, escapeHtml, escapeAttr, statusClass } = htmlHelpers;
6
+
7
+ const ARTIFACT_LABELS = {
8
+ summary: 'summary.md',
9
+ risk_register: 'risk-register.md',
10
+ evidence: 'evidence.json',
11
+ static_site_check: 'static-site-check-result.md',
12
+ component_style_check: 'component-style-check-result.md',
13
+ flow_design_check: 'flow-design-check-result.md',
14
+ terminal_link_check: 'terminal-link-check-result.md',
15
+ architecture_profile: 'architecture-profile.md',
16
+ finding_review: 'finding-review.md',
17
+ refactoring_delta: 'refactoring-delta.md',
18
+ requirement_consistency: 'requirement-consistency.md',
19
+ story_tasks_markdown: 'tasks.md',
20
+ story_tasks_json: 'tasks.json'
21
+ };
22
+
23
+ const PRIMARY_ARTIFACT_KEYS = [
24
+ 'summary',
25
+ 'risk_register',
26
+ 'evidence',
27
+ 'finding_review',
28
+ 'architecture_profile'
29
+ ];
30
+
31
+ export function renderStoryReportHtml({ story, latestRun, runs, storyDir, repoRoot, graphHtmlPath, storyReportMdPath, storyTasksMdPath, evidence = null }) {
32
+ const generatedAt = new Date().toISOString();
33
+ const artifactRows = buildArtifactRows({ latestRun, repoRoot, storyDir });
34
+ const localLinks = buildLocalLinkRows({ storyDir, storyReportMdPath, storyTasksMdPath, repoRoot });
35
+ const graphLink = buildGraphLink({ storyDir, repoRoot, graphHtmlPath });
36
+ const findings = Array.isArray(evidence?.findings) ? evidence.findings : [];
37
+ const findingTable = findings.length === 0
38
+ ? '<p class="muted">検出事項なし</p>'
39
+ : renderTable(['ID', 'Title', 'Severity'], findings.slice(0, 20).map((finding) => [
40
+ finding.id ?? '-',
41
+ finding.title ?? '-',
42
+ finding.severity ?? '-'
43
+ ]));
44
+ const graphLinkHtml = graphLink ? renderLink(graphLink, graphLink) : '-';
45
+
46
+ const cards = [
47
+ metricCard('Story', story.story_id, story.title ?? ''),
48
+ metricCard('Latest Run', latestRun?.run_id ?? '-', latestRun?.gate_status ?? '-'),
49
+ metricCard('Runs', String(runs?.length ?? 0), 'historical'),
50
+ metricCard('Findings', String(findings.length), evidence ? 'in latest evidence' : 'evidence missing')
51
+ ].join('');
52
+
53
+ const localLinksTable = localLinks.length === 0
54
+ ? '<p class="muted">なし</p>'
55
+ : renderLinkTable(localLinks);
56
+
57
+ const artifactTable = artifactRows.length === 0
58
+ ? '<p class="muted">最新runのartifactが見つかりません。</p>'
59
+ : renderLinkTable(artifactRows);
60
+
61
+ return renderDocument({
62
+ title: 'VibePro Story Report',
63
+ reportType: 'story-report',
64
+ generatedAt,
65
+ body: `
66
+ <section class="hero" data-overall-status="${escapeAttr(latestRun?.gate_status ?? 'unknown')}">
67
+ <div>
68
+ <p class="eyebrow">Story diagnostics dashboard</p>
69
+ <h2>${escapeHtml(story.title ?? story.story_id)}</h2>
70
+ <p class="muted">${escapeHtml(story.story_id)} / view:${escapeHtml(story.view ?? '-')} / period:${escapeHtml(story.period ?? '-')}</p>
71
+ </div>
72
+ <span class="${statusClass(latestRun?.gate_status ?? 'unknown')}">${escapeHtml(latestRun?.gate_status ?? 'unknown')}</span>
73
+ </section>
74
+ <section class="metrics">${cards}</section>
75
+ <section>
76
+ <h2>Story Artifacts</h2>
77
+ ${localLinksTable}
78
+ ${graphLink ? `<p>Graph: ${graphLinkHtml}</p>` : ''}
79
+ </section>
80
+ <section>
81
+ <h2>Latest Run Artifacts (${escapeHtml(latestRun?.run_id ?? '-')})</h2>
82
+ ${artifactTable}
83
+ </section>
84
+ <section>
85
+ <h2>Findings (latest run)</h2>
86
+ ${findingTable}
87
+ </section>
88
+ `
89
+ });
90
+ }
91
+
92
+ function buildArtifactRows({ latestRun, repoRoot, storyDir }) {
93
+ if (!latestRun?.artifacts) return [];
94
+ const artifacts = latestRun.artifacts;
95
+ const ordered = [
96
+ ...PRIMARY_ARTIFACT_KEYS.filter((key) => artifacts[key]),
97
+ ...Object.keys(artifacts).filter((key) => artifacts[key] && !PRIMARY_ARTIFACT_KEYS.includes(key))
98
+ ];
99
+ return ordered.map((key) => ({
100
+ label: ARTIFACT_LABELS[key] ?? key,
101
+ href: toRelativeFromStoryDir({ repoRoot, storyDir, repoRelativePath: artifacts[key] })
102
+ }));
103
+ }
104
+
105
+ function buildLocalLinkRows({ storyDir, storyReportMdPath, storyTasksMdPath, repoRoot }) {
106
+ const rows = [];
107
+ if (storyReportMdPath) {
108
+ rows.push({
109
+ label: 'story-report.md',
110
+ href: toRelativeFromAbsolute(storyDir, storyReportMdPath)
111
+ });
112
+ }
113
+ if (storyTasksMdPath) {
114
+ rows.push({
115
+ label: 'tasks.md',
116
+ href: typeof storyTasksMdPath === 'string' && path.isAbsolute(storyTasksMdPath)
117
+ ? toRelativeFromAbsolute(storyDir, storyTasksMdPath)
118
+ : toRelativeFromStoryDir({ repoRoot, storyDir, repoRelativePath: storyTasksMdPath })
119
+ });
120
+ }
121
+ return rows;
122
+ }
123
+
124
+ function buildGraphLink({ storyDir, repoRoot, graphHtmlPath }) {
125
+ if (!graphHtmlPath) return null;
126
+ if (path.isAbsolute(graphHtmlPath)) return toRelativeFromAbsolute(storyDir, graphHtmlPath);
127
+ return toRelativeFromStoryDir({ repoRoot, storyDir, repoRelativePath: graphHtmlPath });
128
+ }
129
+
130
+ function toRelativeFromAbsolute(fromDir, toPath) {
131
+ return path.relative(fromDir, toPath).split(path.sep).join('/');
132
+ }
133
+
134
+ function toRelativeFromStoryDir({ repoRoot, storyDir, repoRelativePath }) {
135
+ if (!repoRelativePath) return '';
136
+ const absolute = path.isAbsolute(repoRelativePath)
137
+ ? repoRelativePath
138
+ : path.resolve(repoRoot, repoRelativePath);
139
+ return toRelativeFromAbsolute(storyDir, absolute);
140
+ }
141
+
142
+ function renderLink(href, label) {
143
+ if (!href) return '-';
144
+ return `<a href="${escapeAttr(href)}">${escapeHtml(label)}</a>`;
145
+ }
146
+
147
+ function renderLinkTable(rows) {
148
+ return `
149
+ <table>
150
+ <thead><tr><th>Artifact</th><th>Path</th></tr></thead>
151
+ <tbody>
152
+ ${rows.map((row) => `<tr><td>${escapeHtml(row.label)}</td><td>${renderLink(row.href, row.href)}</td></tr>`).join('')}
153
+ </tbody>
154
+ </table>
155
+ `;
156
+ }