@shinnodua/agent-workflows 0.0.0-stage → 0.2.8
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/.agents/agents/backend-developer/agent.md +39 -0
- package/.agents/agents/frontend-developer/agent.md +42 -0
- package/.agents/agents/project-manager/agent.md +37 -0
- package/.agents/agents/tech-lead/agent.md +41 -0
- package/.agents/agents/ui-ux-designer/agent.md +41 -0
- package/.agents/skills/add-project/SKILL.md +90 -0
- package/.agents/skills/add-project/agents/openai.yaml +4 -0
- package/.agents/skills/add-project/references/save-protocol.md +90 -0
- package/.agents/skills/approve-plan/SKILL.md +86 -0
- package/.agents/skills/approve-plan/agents/openai.yaml +4 -0
- package/.agents/skills/approve-prd/SKILL.md +59 -0
- package/.agents/skills/approve-prd/agents/openai.yaml +4 -0
- package/.agents/skills/auto-mode/SKILL.md +103 -0
- package/.agents/skills/auto-mode/agents/openai.yaml +4 -0
- package/.agents/skills/create-design/SKILL.md +197 -0
- package/.agents/skills/create-design/agents/openai.yaml +4 -0
- package/.agents/skills/create-diagram/SKILL.md +83 -0
- package/.agents/skills/create-diagram/agents/openai.yaml +4 -0
- package/.agents/skills/create-plan/SKILL.md +104 -0
- package/.agents/skills/create-plan/agents/openai.yaml +4 -0
- package/.agents/skills/create-prd/SKILL.md +82 -0
- package/.agents/skills/create-prd/agents/openai.yaml +4 -0
- package/.agents/skills/griling-plan/SKILL.md +114 -0
- package/.agents/skills/griling-plan/agents/openai.yaml +4 -0
- package/.agents/skills/griling-prd/SKILL.md +91 -0
- package/.agents/skills/griling-prd/agents/openai.yaml +4 -0
- package/.agents/skills/package-installation/SKILL.md +67 -0
- package/.agents/skills/package-installation/agents/openai.yaml +4 -0
- package/.agents/skills/project-setup/SKILL.md +104 -0
- package/.agents/skills/project-setup/agents/openai.yaml +3 -0
- package/.agents/skills/research/SKILL.md +61 -0
- package/.agents/skills/research/agents/openai.yaml +4 -0
- package/.agents/skills/sprint-meeting/SKILL.md +230 -0
- package/.agents/skills/sprint-meeting/agents/openai.yaml +4 -0
- package/.claude/agents/backend-developer.md +7 -0
- package/.claude/agents/frontend-developer.md +7 -0
- package/.claude/agents/project-manager.md +7 -0
- package/.claude/agents/tech-lead.md +7 -0
- package/.claude/agents/ui-ux-designer.md +7 -0
- package/.claude/skills/add-project/SKILL.md +10 -0
- package/.claude/skills/approve-plan/SKILL.md +8 -0
- package/.claude/skills/approve-prd/SKILL.md +8 -0
- package/.claude/skills/auto-mode/SKILL.md +8 -0
- package/.claude/skills/create-design/SKILL.md +8 -0
- package/.claude/skills/create-diagram/SKILL.md +8 -0
- package/.claude/skills/create-plan/SKILL.md +8 -0
- package/.claude/skills/create-prd/SKILL.md +8 -0
- package/.claude/skills/griling-plan/SKILL.md +8 -0
- package/.claude/skills/griling-prd/SKILL.md +8 -0
- package/.claude/skills/package-installation/SKILL.md +8 -0
- package/.claude/skills/project-setup/SKILL.md +8 -0
- package/.claude/skills/research/SKILL.md +8 -0
- package/.claude/skills/sprint-meeting/SKILL.md +8 -0
- package/.codex/prompts/add-project.md +3 -0
- package/.codex/prompts/approve-plan.md +3 -0
- package/.codex/prompts/approve-prd.md +3 -0
- package/.codex/prompts/auto-mode.md +3 -0
- package/.codex/prompts/create-design.md +3 -0
- package/.codex/prompts/create-diagram.md +3 -0
- package/.codex/prompts/create-plan.md +3 -0
- package/.codex/prompts/create-prd.md +3 -0
- package/.codex/prompts/griling-plan.md +3 -0
- package/.codex/prompts/griling-prd.md +3 -0
- package/.codex/prompts/grilling-plan.md +3 -0
- package/.codex/prompts/project-setup.md +3 -0
- package/.codex/prompts/research.md +3 -0
- package/.codex/prompts/sprint-meeting.md +3 -0
- package/.gitmodules.example +9 -0
- package/AGENTS.md +84 -0
- package/CLAUDE.md +1 -0
- package/INSTALL.md +284 -0
- package/LICENSE +21 -0
- package/README.md +342 -2
- package/bin/postinstall.js +57 -0
- package/bin/workflows.js +1172 -0
- package/bin/workflows.test.mjs +682 -0
- package/commands/add-project.md +20 -0
- package/commands/approve-plan.md +25 -0
- package/commands/approve-prd.md +24 -0
- package/commands/auto-mode.md +15 -0
- package/commands/create-design.md +20 -0
- package/commands/create-diagram.md +16 -0
- package/commands/create-plan.md +22 -0
- package/commands/create-prd.md +16 -0
- package/commands/griling-plan.md +16 -0
- package/commands/griling-prd.md +16 -0
- package/commands/grilling-plan.md +16 -0
- package/commands/project-setup.md +16 -0
- package/commands/research.md +16 -0
- package/commands/sprint-meeting.md +16 -0
- package/dashboard/.agents/skills/coding-conventions/SKILL.md +76 -0
- package/dashboard/.agents/skills/coding-conventions/agents/openai.yaml +4 -0
- package/dashboard/.agents/skills/design-system-guideline/SKILL.md +51 -0
- package/dashboard/.agents/skills/design-system-guideline/agents/openai.yaml +4 -0
- package/dashboard/.agents/skills/lint-and-fix/SKILL.md +55 -0
- package/dashboard/.agents/skills/lint-and-fix/agents/openai.yaml +4 -0
- package/dashboard/.agents/skills/taste-ui/SKILL.md +45 -0
- package/dashboard/.agents/skills/taste-ui/agents/openai.yaml +4 -0
- package/dashboard/AGENTS.md +43 -0
- package/dashboard/bun.lock +352 -0
- package/dashboard/index.html +12 -0
- package/dashboard/package.json +32 -0
- package/dashboard/src/App.tsx +5 -0
- package/dashboard/src/features/task-status/components/ActionRequiredPanel/ActionRequiredPanel.module.css +85 -0
- package/dashboard/src/features/task-status/components/ActionRequiredPanel/ActionRequiredPanel.tsx +80 -0
- package/dashboard/src/features/task-status/components/ArtifactButton/ArtifactButton.module.css +25 -0
- package/dashboard/src/features/task-status/components/ArtifactButton/ArtifactButton.tsx +29 -0
- package/dashboard/src/features/task-status/components/ArtifactSummaryCards/ArtifactSummaryCards.module.css +29 -0
- package/dashboard/src/features/task-status/components/ArtifactSummaryCards/ArtifactSummaryCards.tsx +35 -0
- package/dashboard/src/features/task-status/components/CategoryPanel/CategoryPanel.module.css +85 -0
- package/dashboard/src/features/task-status/components/CategoryPanel/CategoryPanel.tsx +150 -0
- package/dashboard/src/features/task-status/components/DashboardHeader/DashboardHeader.module.css +41 -0
- package/dashboard/src/features/task-status/components/DashboardHeader/DashboardHeader.tsx +41 -0
- package/dashboard/src/features/task-status/components/FilesPanel/FilesPanel.module.css +25 -0
- package/dashboard/src/features/task-status/components/FilesPanel/FilesPanel.tsx +40 -0
- package/dashboard/src/features/task-status/components/HardnessEngineeringPanel/HardnessEngineeringPanel.module.css +330 -0
- package/dashboard/src/features/task-status/components/HardnessEngineeringPanel/HardnessEngineeringPanel.tsx +299 -0
- package/dashboard/src/features/task-status/components/LifecyclePanel/LifecyclePanel.module.css +74 -0
- package/dashboard/src/features/task-status/components/LifecyclePanel/LifecyclePanel.tsx +79 -0
- package/dashboard/src/features/task-status/components/MarkdownDialog/MarkdownDialog.module.css +133 -0
- package/dashboard/src/features/task-status/components/MarkdownDialog/MarkdownDialog.tsx +233 -0
- package/dashboard/src/features/task-status/components/Sidebar/Sidebar.module.css +53 -0
- package/dashboard/src/features/task-status/components/Sidebar/Sidebar.tsx +163 -0
- package/dashboard/src/features/task-status/components/StatusBadge/StatusBadge.module.css +41 -0
- package/dashboard/src/features/task-status/components/StatusBadge/StatusBadge.tsx +48 -0
- package/dashboard/src/features/task-status/components/TaskOverview/TaskOverview.module.css +97 -0
- package/dashboard/src/features/task-status/components/TaskOverview/TaskOverview.tsx +128 -0
- package/dashboard/src/features/task-status/components/TaskStatusDashboard/TaskStatusDashboard.module.css +9 -0
- package/dashboard/src/features/task-status/components/TaskStatusDashboard/TaskStatusDashboard.tsx +318 -0
- package/dashboard/src/features/task-status/components/WorkflowPanel/WorkflowPanel.module.css +221 -0
- package/dashboard/src/features/task-status/components/WorkflowPanel/WorkflowPanel.tsx +344 -0
- package/dashboard/src/features/task-status/taskStatusConfig.ts +100 -0
- package/dashboard/src/features/task-status/utils/actionItems.ts +247 -0
- package/dashboard/src/features/task-status/utils/artifactGrouping.ts +328 -0
- package/dashboard/src/features/task-status/utils/hardnessScanner.ts +406 -0
- package/dashboard/src/features/task-status/utils/lifecycle.ts +73 -0
- package/dashboard/src/features/task-status/utils/markdownInline/markdownInline.module.css +11 -0
- package/dashboard/src/features/task-status/utils/markdownInline/markdownInline.tsx +104 -0
- package/dashboard/src/features/task-status/utils/markdownLinks.ts +83 -0
- package/dashboard/src/features/task-status/utils/markdownRenderer/markdownRenderer.module.css +74 -0
- package/dashboard/src/features/task-status/utils/markdownRenderer/markdownRenderer.tsx +326 -0
- package/dashboard/src/features/task-status/utils/status.ts +7 -0
- package/dashboard/src/features/task-status/utils/test/actionItems.test.ts +134 -0
- package/dashboard/src/features/task-status/utils/test/artifactGrouping.test.ts +294 -0
- package/dashboard/src/features/task-status/utils/test/hardnessScanner.test.ts +138 -0
- package/dashboard/src/features/task-status/utils/test/lifecycle.test.ts +49 -0
- package/dashboard/src/features/task-status/utils/test/markdownInline.test.ts +41 -0
- package/dashboard/src/features/task-status/utils/test/markdownLinks.test.ts +158 -0
- package/dashboard/src/features/task-status/utils/test/workspaceMetadata.test.ts +37 -0
- package/dashboard/src/features/task-status/utils/workspaceMetadata.ts +175 -0
- package/dashboard/src/main.tsx +16 -0
- package/dashboard/src/shared/design-system.css +134 -0
- package/dashboard/src/shared/design-system.tsx +84 -0
- package/dashboard/src/styles.css +41 -0
- package/dashboard/src/types.ts +133 -0
- package/dashboard/src/workspace-artifacts.d.ts +9 -0
- package/dashboard/tsconfig.json +22 -0
- package/dashboard/vite.config.ts +579 -0
- package/designs/.gitkeep +1 -0
- package/docs/add-project-command-completion.md +117 -0
- package/docs/public-npm-registry-completion.md +104 -0
- package/docs/workflows.png +0 -0
- package/docs/workspace-template-setup.md +229 -0
- package/meeting-logs/.gitkeep +1 -0
- package/modules/.gitkeep +1 -0
- package/package.json +96 -5
- package/plans/.gitkeep +1 -0
- package/prds/.gitkeep +1 -0
- package/project/PROJECT.md +26 -0
- package/project/repositories.json +72 -0
- package/project/validation.json +9 -0
- package/project/workflows.json +20 -0
- package/research/.gitkeep +1 -0
- package/roles/backend-developer.md +26 -0
- package/roles/frontend-developer.md +25 -0
- package/roles/project-manager.md +42 -0
- package/roles/tech-lead.md +42 -0
- package/roles/ui-ux-designer.md +43 -0
- package/scripts/add-project.mjs +990 -0
- package/scripts/add-project.test.mjs +804 -0
- package/scripts/check-staged-security.mjs +97 -0
- package/scripts/check-staged-security.test.mjs +68 -0
- package/scripts/workspace-integrity.ts +220 -0
- package/templates/auto-mode-completion-summary-template.md +78 -0
- package/templates/meeting-log-template.md +177 -0
- package/templates/plan-template.md +219 -0
- package/templates/prd-template.md +106 -0
- package/templates/research-template.md +119 -0
- package/workflows.md +590 -0
- package/workspace.config.json +43 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
@reference "../../../../styles.css";
|
|
2
|
+
|
|
3
|
+
.divider {
|
|
4
|
+
@apply border-t-[4px] border-black;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.codeBlock {
|
|
8
|
+
@apply max-w-full overflow-x-auto rounded-xl border-[3px] border-black bg-black p-4 text-sm font-bold text-white;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.code {
|
|
12
|
+
@apply block min-w-0 whitespace-pre;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.heading {
|
|
16
|
+
@apply min-w-0 font-black leading-tight;
|
|
17
|
+
overflow-wrap: anywhere;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.headingLevelOne {
|
|
21
|
+
@apply text-3xl;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.headingLevelTwo {
|
|
25
|
+
@apply text-2xl;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.headingLevelDefault {
|
|
29
|
+
@apply text-xl;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.orderedList {
|
|
33
|
+
@apply grid min-w-0 list-decimal gap-2 pl-6 font-bold;
|
|
34
|
+
overflow-wrap: anywhere;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.unorderedList {
|
|
38
|
+
@apply grid min-w-0 list-disc gap-2 pl-6 font-bold;
|
|
39
|
+
overflow-wrap: anywhere;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.quote {
|
|
43
|
+
@apply min-w-0 rounded-xl border-[3px] border-black bg-neo-blue p-4 font-black;
|
|
44
|
+
overflow-wrap: anywhere;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tableWrap {
|
|
48
|
+
@apply max-w-full overflow-x-auto rounded-xl border-[3px] border-black;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.table {
|
|
52
|
+
@apply w-full border-collapse bg-white text-sm font-bold;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.tableHead {
|
|
56
|
+
@apply bg-neo-yellow;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tableHeader {
|
|
60
|
+
@apply border-b-[3px] border-r-[3px] border-black p-3 text-left font-black last:border-r-0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.tableRow {
|
|
64
|
+
@apply border-b-[3px] border-black last:border-b-0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.tableCell {
|
|
68
|
+
@apply min-w-48 max-w-96 border-r-[3px] border-black p-3 align-top last:border-r-0;
|
|
69
|
+
overflow-wrap: anywhere;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.paragraph {
|
|
73
|
+
@apply font-bold leading-relaxed;
|
|
74
|
+
}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import {
|
|
3
|
+
type MarkdownRenderContext,
|
|
4
|
+
renderInlineMarkdown,
|
|
5
|
+
} from "../markdownInline/markdownInline";
|
|
6
|
+
import styles from "./markdownRenderer.module.css";
|
|
7
|
+
|
|
8
|
+
type MarkdownBlockResult = {
|
|
9
|
+
nextIndex: number;
|
|
10
|
+
node?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function renderMarkdownBlocks(
|
|
14
|
+
markdown: string,
|
|
15
|
+
context: MarkdownRenderContext,
|
|
16
|
+
) {
|
|
17
|
+
const lines = markdown.replace(/\r\n/g, "\n").split("\n");
|
|
18
|
+
const blocks: ReactNode[] = [];
|
|
19
|
+
let index = 0;
|
|
20
|
+
|
|
21
|
+
while (index < lines.length) {
|
|
22
|
+
const result = parseMarkdownBlock(lines, index, context);
|
|
23
|
+
index = result.nextIndex;
|
|
24
|
+
|
|
25
|
+
if (result.node) {
|
|
26
|
+
blocks.push(result.node);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return blocks;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function parseMarkdownBlock(
|
|
34
|
+
lines: string[],
|
|
35
|
+
index: number,
|
|
36
|
+
context: MarkdownRenderContext,
|
|
37
|
+
): MarkdownBlockResult {
|
|
38
|
+
const line = lines[index] ?? "";
|
|
39
|
+
|
|
40
|
+
if (!line.trim()) {
|
|
41
|
+
return { nextIndex: index + 1 };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (line.startsWith("```")) {
|
|
45
|
+
return parseCodeBlock(lines, index);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (/^(#{1,4})\s+/.test(line)) {
|
|
49
|
+
return parseHeading(line, index, context);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (/^[-*]\s+/.test(line)) {
|
|
53
|
+
return parseList(lines, index, context, "unordered");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (/^\d+\.\s+/.test(line)) {
|
|
57
|
+
return parseList(lines, index, context, "ordered");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (line.startsWith(">")) {
|
|
61
|
+
return parseQuote(lines, index, context);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (/^-{3,}$/.test(line.trim())) {
|
|
65
|
+
return {
|
|
66
|
+
nextIndex: index + 1,
|
|
67
|
+
node: <hr className={styles.divider} key={`hr-${index}`} />,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (isTableStart(lines, index)) {
|
|
72
|
+
return parseTable(lines, index, context);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return parseParagraph(lines, index, context);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function parseCodeBlock(lines: string[], index: number) {
|
|
79
|
+
const codeLines: string[] = [];
|
|
80
|
+
let nextIndex = index + 1;
|
|
81
|
+
|
|
82
|
+
while (nextIndex < lines.length && !lines[nextIndex]?.startsWith("```")) {
|
|
83
|
+
codeLines.push(lines[nextIndex] ?? "");
|
|
84
|
+
nextIndex += 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
nextIndex: nextIndex + 1,
|
|
89
|
+
node: (
|
|
90
|
+
<pre className={styles.codeBlock} key={`code-${nextIndex}`}>
|
|
91
|
+
<code className={styles.code}>{codeLines.join("\n")}</code>
|
|
92
|
+
</pre>
|
|
93
|
+
),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function parseHeading(
|
|
98
|
+
line: string,
|
|
99
|
+
index: number,
|
|
100
|
+
context: MarkdownRenderContext,
|
|
101
|
+
) {
|
|
102
|
+
const heading = line.match(/^(#{1,4})\s+(.+)$/);
|
|
103
|
+
const level = heading?.[1].length ?? 3;
|
|
104
|
+
const text = heading?.[2] ?? line;
|
|
105
|
+
const className = `${styles.heading} ${getHeadingClassName(level)}`;
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
nextIndex: index + 1,
|
|
109
|
+
node: (
|
|
110
|
+
<h3 className={className} key={`h-${index}`}>
|
|
111
|
+
{renderInlineMarkdown(text, context)}
|
|
112
|
+
</h3>
|
|
113
|
+
),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function parseList(
|
|
118
|
+
lines: string[],
|
|
119
|
+
index: number,
|
|
120
|
+
context: MarkdownRenderContext,
|
|
121
|
+
type: "ordered" | "unordered",
|
|
122
|
+
) {
|
|
123
|
+
const items = collectListItems(lines, index, type);
|
|
124
|
+
const children = items.values.map((item) => (
|
|
125
|
+
<li key={item}>{renderInlineMarkdown(item, context)}</li>
|
|
126
|
+
));
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
nextIndex: items.nextIndex,
|
|
130
|
+
node:
|
|
131
|
+
type === "ordered" ? (
|
|
132
|
+
<ol className={styles.orderedList} key={`ol-${items.nextIndex}`}>
|
|
133
|
+
{children}
|
|
134
|
+
</ol>
|
|
135
|
+
) : (
|
|
136
|
+
<ul className={styles.unorderedList} key={`ul-${items.nextIndex}`}>
|
|
137
|
+
{children}
|
|
138
|
+
</ul>
|
|
139
|
+
),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function parseQuote(
|
|
144
|
+
lines: string[],
|
|
145
|
+
index: number,
|
|
146
|
+
context: MarkdownRenderContext,
|
|
147
|
+
) {
|
|
148
|
+
const quote = collectQuoteLines(lines, index);
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
nextIndex: quote.nextIndex,
|
|
152
|
+
node: (
|
|
153
|
+
<blockquote className={styles.quote} key={`quote-${quote.nextIndex}`}>
|
|
154
|
+
{quote.values.map((line) => (
|
|
155
|
+
<p key={line}>{renderInlineMarkdown(line, context)}</p>
|
|
156
|
+
))}
|
|
157
|
+
</blockquote>
|
|
158
|
+
),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function parseTable(
|
|
163
|
+
lines: string[],
|
|
164
|
+
index: number,
|
|
165
|
+
context: MarkdownRenderContext,
|
|
166
|
+
) {
|
|
167
|
+
const tableLines = collectTableLines(lines, index);
|
|
168
|
+
const [headerLine, , ...bodyLines] = tableLines.rows;
|
|
169
|
+
const headers = splitTableRow(headerLine ?? "");
|
|
170
|
+
|
|
171
|
+
return {
|
|
172
|
+
nextIndex: tableLines.nextIndex,
|
|
173
|
+
node: (
|
|
174
|
+
<div className={styles.tableWrap} key={`table-${tableLines.nextIndex}`}>
|
|
175
|
+
<table className={styles.table}>
|
|
176
|
+
<thead className={styles.tableHead}>
|
|
177
|
+
<tr>
|
|
178
|
+
{headers.map((header) => (
|
|
179
|
+
<th className={styles.tableHeader} key={header}>
|
|
180
|
+
{renderInlineMarkdown(header, context)}
|
|
181
|
+
</th>
|
|
182
|
+
))}
|
|
183
|
+
</tr>
|
|
184
|
+
</thead>
|
|
185
|
+
<tbody>
|
|
186
|
+
{bodyLines.map((row) => (
|
|
187
|
+
<TableRow context={context} key={row} row={row} />
|
|
188
|
+
))}
|
|
189
|
+
</tbody>
|
|
190
|
+
</table>
|
|
191
|
+
</div>
|
|
192
|
+
),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function TableRow(props: { context: MarkdownRenderContext; row: string }) {
|
|
197
|
+
const { context, row } = props;
|
|
198
|
+
|
|
199
|
+
return (
|
|
200
|
+
<tr className={styles.tableRow}>
|
|
201
|
+
{splitTableRow(row).map((cell) => (
|
|
202
|
+
<td className={styles.tableCell} key={`${row}-${cell}`}>
|
|
203
|
+
{renderInlineMarkdown(cell, context)}
|
|
204
|
+
</td>
|
|
205
|
+
))}
|
|
206
|
+
</tr>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function parseParagraph(
|
|
211
|
+
lines: string[],
|
|
212
|
+
index: number,
|
|
213
|
+
context: MarkdownRenderContext,
|
|
214
|
+
) {
|
|
215
|
+
const paragraph = collectParagraphLines(lines, index);
|
|
216
|
+
|
|
217
|
+
return {
|
|
218
|
+
nextIndex: paragraph.nextIndex,
|
|
219
|
+
node: (
|
|
220
|
+
<p className={styles.paragraph} key={`p-${paragraph.nextIndex}`}>
|
|
221
|
+
{renderInlineMarkdown(paragraph.values.join(" "), context)}
|
|
222
|
+
</p>
|
|
223
|
+
),
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function collectListItems(
|
|
228
|
+
lines: string[],
|
|
229
|
+
index: number,
|
|
230
|
+
type: "ordered" | "unordered",
|
|
231
|
+
) {
|
|
232
|
+
const values: string[] = [];
|
|
233
|
+
const pattern = type === "ordered" ? /^\d+\.\s+/ : /^[-*]\s+/;
|
|
234
|
+
let nextIndex = index;
|
|
235
|
+
|
|
236
|
+
while (nextIndex < lines.length && pattern.test(lines[nextIndex] ?? "")) {
|
|
237
|
+
values.push((lines[nextIndex] ?? "").replace(pattern, ""));
|
|
238
|
+
nextIndex += 1;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return { nextIndex, values };
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function collectQuoteLines(lines: string[], index: number) {
|
|
245
|
+
const values: string[] = [];
|
|
246
|
+
let nextIndex = index;
|
|
247
|
+
|
|
248
|
+
while (nextIndex < lines.length && lines[nextIndex]?.startsWith(">")) {
|
|
249
|
+
values.push((lines[nextIndex] ?? "").replace(/^>\s?/, ""));
|
|
250
|
+
nextIndex += 1;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return { nextIndex, values };
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function collectTableLines(lines: string[], index: number) {
|
|
257
|
+
const rows: string[] = [];
|
|
258
|
+
let nextIndex = index;
|
|
259
|
+
|
|
260
|
+
while (
|
|
261
|
+
nextIndex < lines.length &&
|
|
262
|
+
/^\s*\|.+\|\s*$/.test(lines[nextIndex] ?? "")
|
|
263
|
+
) {
|
|
264
|
+
rows.push(lines[nextIndex] ?? "");
|
|
265
|
+
nextIndex += 1;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return { nextIndex, rows };
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function collectParagraphLines(lines: string[], index: number) {
|
|
272
|
+
const values: string[] = [];
|
|
273
|
+
let nextIndex = index;
|
|
274
|
+
|
|
275
|
+
while (canContinueParagraph(lines, nextIndex)) {
|
|
276
|
+
values.push(lines[nextIndex] ?? "");
|
|
277
|
+
nextIndex += 1;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return { nextIndex, values };
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function canContinueParagraph(lines: string[], index: number) {
|
|
284
|
+
const line = lines[index] ?? "";
|
|
285
|
+
|
|
286
|
+
return (
|
|
287
|
+
Boolean(line.trim()) &&
|
|
288
|
+
!line.startsWith("```") &&
|
|
289
|
+
!line.match(/^(#{1,4})\s+/) &&
|
|
290
|
+
!/^[-*]\s+/.test(line) &&
|
|
291
|
+
!/^\d+\.\s+/.test(line) &&
|
|
292
|
+
!line.startsWith(">") &&
|
|
293
|
+
!/^-{3,}$/.test(line.trim()) &&
|
|
294
|
+
!isTableStart(lines, index)
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function isTableStart(lines: string[], index: number) {
|
|
299
|
+
const current = lines[index] ?? "";
|
|
300
|
+
const next = lines[index + 1] ?? "";
|
|
301
|
+
|
|
302
|
+
return (
|
|
303
|
+
/^\s*\|.+\|\s*$/.test(current) && /^\s*\|[\s:-]+\|[\s|:-]*$/.test(next)
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function splitTableRow(row: string) {
|
|
308
|
+
return row
|
|
309
|
+
.trim()
|
|
310
|
+
.replace(/^\|/, "")
|
|
311
|
+
.replace(/\|$/, "")
|
|
312
|
+
.split("|")
|
|
313
|
+
.map((cell) => cell.trim());
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function getHeadingClassName(level: number) {
|
|
317
|
+
if (level === 1) {
|
|
318
|
+
return styles.headingLevelOne;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (level === 2) {
|
|
322
|
+
return styles.headingLevelTwo;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return styles.headingLevelDefault;
|
|
326
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import type { Artifact, ProjectRepository } from "../../../../types";
|
|
3
|
+
import { buildActionItems, STALE_DRAFT_DAYS } from "../actionItems";
|
|
4
|
+
|
|
5
|
+
const NOW = new Date("2026-08-20T00:00:00.000Z");
|
|
6
|
+
|
|
7
|
+
describe("actionItems", () => {
|
|
8
|
+
test("finds approved PRDs without a linked plan", () => {
|
|
9
|
+
const items = buildActionItems(
|
|
10
|
+
[
|
|
11
|
+
createArtifact({
|
|
12
|
+
id: "PRD-20260820-example",
|
|
13
|
+
status: "approved",
|
|
14
|
+
type: "prd",
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
NOW,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
expect(
|
|
21
|
+
items.some((item) => item.title === "Needs implementation plan"),
|
|
22
|
+
).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("finds missing detail plans for affected submodules", () => {
|
|
26
|
+
const items = buildActionItems(
|
|
27
|
+
[
|
|
28
|
+
createArtifact({
|
|
29
|
+
content:
|
|
30
|
+
"# Plan\n\n- Status: `approved`\n\n| `example-core` | Shared work |",
|
|
31
|
+
id: "PLAN-20260820-example",
|
|
32
|
+
status: "approved",
|
|
33
|
+
type: "plan",
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
createRepository({
|
|
38
|
+
id: "example-core",
|
|
39
|
+
name: "example-core",
|
|
40
|
+
path: "modules/example-core",
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
NOW,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
expect(items.some((item) => item.title === "Missing submodule plan")).toBe(
|
|
47
|
+
true,
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("finds stale non-document drafts", () => {
|
|
52
|
+
const items = buildActionItems(
|
|
53
|
+
[
|
|
54
|
+
createArtifact({
|
|
55
|
+
created: `2026-08-${String(20 - STALE_DRAFT_DAYS - 1).padStart(2, "0")}`,
|
|
56
|
+
type: "design",
|
|
57
|
+
}),
|
|
58
|
+
createArtifact({
|
|
59
|
+
created: "2026-07-01",
|
|
60
|
+
type: "document",
|
|
61
|
+
}),
|
|
62
|
+
],
|
|
63
|
+
NOW,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
expect(items.filter((item) => item.title === "Stale draft")).toHaveLength(
|
|
67
|
+
1,
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test("finds unresolved local Markdown links", () => {
|
|
72
|
+
const items = buildActionItems(
|
|
73
|
+
[
|
|
74
|
+
createArtifact({
|
|
75
|
+
content: "# Example\n\n[Missing](../plans/missing.md)",
|
|
76
|
+
}),
|
|
77
|
+
],
|
|
78
|
+
NOW,
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
expect(items.some((item) => item.title === "Broken workspace link")).toBe(
|
|
82
|
+
true,
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test("returns no issues for a current complete artifact set", () => {
|
|
87
|
+
const prd = createArtifact({
|
|
88
|
+
id: "PRD-20260820-example",
|
|
89
|
+
status: "approved",
|
|
90
|
+
type: "prd",
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const plan = createArtifact({
|
|
94
|
+
content: "# Plan\n\n- Status: `complete`",
|
|
95
|
+
id: "PLAN-20260820-example",
|
|
96
|
+
prdId: prd.id,
|
|
97
|
+
status: "complete",
|
|
98
|
+
type: "plan",
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
expect(buildActionItems([prd, plan], NOW)).toHaveLength(0);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
function createRepository(
|
|
106
|
+
overrides: Partial<ProjectRepository> = {},
|
|
107
|
+
): ProjectRepository {
|
|
108
|
+
return {
|
|
109
|
+
id: "example-web",
|
|
110
|
+
name: "example-web",
|
|
111
|
+
path: "modules/example-web",
|
|
112
|
+
platforms: [],
|
|
113
|
+
purpose: "Desktop app",
|
|
114
|
+
scope: [],
|
|
115
|
+
...overrides,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function createArtifact(overrides: Partial<Artifact> = {}): Artifact {
|
|
120
|
+
return {
|
|
121
|
+
content: "# Example",
|
|
122
|
+
created: "2026-08-20",
|
|
123
|
+
modified: "2026-08-20T00:00:00.000Z",
|
|
124
|
+
relatedArtifactIds: [],
|
|
125
|
+
relativePath: "prds/example.md",
|
|
126
|
+
sourceModule: "workspace",
|
|
127
|
+
sourceHref: "/@fs/example.md",
|
|
128
|
+
status: "draft",
|
|
129
|
+
taskKey: "example",
|
|
130
|
+
title: "Example",
|
|
131
|
+
type: "prd",
|
|
132
|
+
...overrides,
|
|
133
|
+
};
|
|
134
|
+
}
|