@trieungoctam/speckit 0.3.6 → 0.4.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/README.md CHANGED
@@ -23,6 +23,10 @@ npx @trieungoctam/speckit@latest sync
23
23
  npx @trieungoctam/speckit@latest graph setup
24
24
  npx @trieungoctam/speckit@latest sprint plan
25
25
  npx @trieungoctam/speckit@latest graph triage --json
26
+ npx @trieungoctam/speckit@latest team status .speckit/stories/<story>.md
27
+ npx @trieungoctam/speckit@latest team audit .speckit/stories/<story>.md --json
28
+ npx @trieungoctam/speckit@latest team handoff .speckit/stories/<story>.md --from dev --to qa
29
+ npx @trieungoctam/speckit@latest score .speckit/stories/<story>.md
26
30
  npx @trieungoctam/speckit@latest validate --json
27
31
  npx @trieungoctam/speckit@latest permissions audit --path .env --json
28
32
  npx @trieungoctam/speckit@latest ready .speckit/stories/<story>.md
@@ -85,6 +89,11 @@ For implementation stories, red-green-refactor evidence is mandatory. A story is
85
89
  | `speckit session compact` | Create an anchored summary for resume or handoff. |
86
90
  | `speckit session resume` | Mark a session as active and print its handoff path. |
87
91
  | `speckit session status` | Print active session state paths. |
92
+ | `speckit team status <story>` | Show role-by-role team artifact readiness for a story. |
93
+ | `speckit team audit <story>` | Run enterprise review-gate checks and return nonzero when blockers remain. |
94
+ | `speckit team handoff <story>` | Create a durable role-to-role handoff artifact. |
95
+ | `speckit score` | Score project workflow health across contract, team model, context/session, and graph sync. |
96
+ | `speckit score <story>` | Score story health across team readiness, developer trace, TDD evidence, and review gate. |
88
97
  | `speckit shape "<intent>"` | Create a short spec contract. |
89
98
  | `speckit context <story>` | Build the current implementation context from a story. |
90
99
  | `speckit quick "<intent>"` | Create one story plus matching TDD evidence file. |
@@ -118,6 +127,7 @@ See `docs/adapters.md` for exact output paths.
118
127
  ## Guides
119
128
 
120
129
  - `docs/use-cases.md` covers setup, migration, quick changes, full planning, long sessions, TDD, graph automation, review, CI, and troubleshooting.
130
+ - `docs/team-workflow.md` covers enterprise role ownership, status, audit, and handoff flow.
121
131
  - `docs/beads-viewer-setup.md` covers Beads Viewer installation, `bv` verification, and robot-safe graph usage.
122
132
  - `docs/workflow-model.md` describes the quick and full workflow lanes.
123
133
  - `docs/prompt-architecture.md` describes the prompt contract used by the super-agent, skills, workflows, run prompt, and IDE adapters.
package/dist/cli.js CHANGED
@@ -9,6 +9,8 @@ import { planCommand } from "./commands/plan.js";
9
9
  import { memoryCommand } from "./commands/memory.js";
10
10
  import { permissionsCommand } from "./commands/permissions.js";
11
11
  import { sessionCommand } from "./commands/session.js";
12
+ import { teamCommand } from "./commands/team.js";
13
+ import { scoreCommand } from "./commands/score.js";
12
14
  import { sprintCommand } from "./commands/sprint.js";
13
15
  import { graphCommand } from "./commands/graph.js";
14
16
  import { validateCommand } from "./commands/validate.js";
@@ -66,6 +68,21 @@ export async function main(argv = process.argv.slice(2), root = process.cwd()) {
66
68
  note: value(parsed, "note"),
67
69
  json: has(parsed, "json"),
68
70
  });
71
+ case "team":
72
+ return teamCommand({
73
+ root,
74
+ action: requiredAction(parsed),
75
+ target: parsed.args.slice(1).join(" ").trim() || undefined,
76
+ from: value(parsed, "from"),
77
+ to: value(parsed, "to"),
78
+ json: has(parsed, "json"),
79
+ });
80
+ case "score":
81
+ return scoreCommand({
82
+ root,
83
+ target: parsed.args.join(" ").trim() || undefined,
84
+ json: has(parsed, "json"),
85
+ });
69
86
  case "sprint":
70
87
  return sprintCommand({ root, action: requiredAction(parsed), json: has(parsed, "json") });
71
88
  case "graph":
@@ -162,6 +179,8 @@ Usage:
162
179
  speckit memory refresh
163
180
  speckit permissions audit [--path <path>] [--command <command>] [--json]
164
181
  speckit session start|checkpoint|compact|resume|status [target] [--note "..."] [--json]
182
+ speckit team status|audit|handoff <story-path-or-id> [--from <role>] [--to <role>] [--json]
183
+ speckit score [story-path-or-id] [--json]
165
184
  speckit sprint plan|next [--json]
166
185
  speckit graph setup|triage|plan|insights [--json]
167
186
  speckit validate [--json]
@@ -40,16 +40,49 @@ export async function planCommand(options) {
40
40
  evidence: ${dir}/tdd-evidence.md
41
41
  context: pending`, `# Story: ${options.intent}
42
42
 
43
+ ## Business Goal
44
+ - Goal: ${options.intent}
45
+ - Priority: medium
46
+ - Success signal:
47
+
43
48
  ## Acceptance Criteria
44
49
  - Given ...
45
50
  - When ...
46
51
  - Then ...
47
52
 
53
+ ## Edge Cases
54
+ - Boundary:
55
+ - Error path:
56
+ - State transition:
57
+
58
+ ## Implementation Scope
59
+ - In scope:
60
+ - Out of scope:
61
+ - Files likely to read:
62
+ - Files likely to modify:
63
+
64
+ ## Architecture Notes
65
+ - Constraints:
66
+ - Integration points:
67
+ - Risks:
68
+
48
69
  ## TDD Evidence File
49
70
  \`${dir}/tdd-evidence.md\`
50
71
 
51
72
  ## Implementation Notes
52
73
 
74
+ ## Dev Agent Record
75
+ ### Test Intent
76
+
77
+ ### Debug Log
78
+
79
+ ### Completion Notes
80
+
81
+ ### File List
82
+
83
+ ## Change Log
84
+ - ${new Date().toISOString().slice(0, 10)}: Story drafted.
85
+
53
86
  ## Spec Anti-Mistake Checklist
54
87
  - Reuse existing project patterns before adding new files.
55
88
  - Verify file locations before editing.
@@ -62,11 +95,15 @@ context: pending`, `# Story: ${options.intent}
62
95
  content: markdownWithFrontmatter(`status: missing
63
96
  story: ${dir}/story.md`, `# TDD Evidence: ${options.intent}
64
97
 
98
+ ## Test Intent
99
+
65
100
  ## Red
66
101
 
67
102
  ## Green
68
103
 
69
104
  ## Refactor
105
+
106
+ ## Review Evidence
70
107
  `),
71
108
  },
72
109
  ];
@@ -18,11 +18,32 @@ context: pending`, `# Story: ${options.intent}
18
18
  ## Intent
19
19
  ${options.intent}
20
20
 
21
+ ## Business Goal
22
+ - Goal: ${options.intent}
23
+ - Priority: medium
24
+ - Success signal: behavior is covered by executable tests and Speckit evidence
25
+
21
26
  ## Acceptance Criteria
22
27
  - Given the current product state
23
28
  - When this story is implemented
24
29
  - Then the behavior is covered by executable tests and Speckit evidence
25
30
 
31
+ ## Edge Cases
32
+ - Boundary: document the smallest input, state, or permission boundary this story touches.
33
+ - Error path: document how failures are surfaced or recovered.
34
+ - State transition: document before and after behavior.
35
+
36
+ ## Implementation Scope
37
+ - In scope: the smallest change needed to satisfy the acceptance criteria.
38
+ - Out of scope: unrelated refactors, new dependencies, or behavior not tied to acceptance criteria.
39
+ - Files likely to read:
40
+ - Files likely to modify:
41
+
42
+ ## Architecture Notes
43
+ - Constraints: reuse existing project patterns before adding new abstractions.
44
+ - Integration points:
45
+ - Risks:
46
+
26
47
  ## TDD Checklist
27
48
  - [ ] Test target identified
28
49
  - [ ] Red evidence recorded in ${evidencePath}
@@ -38,6 +59,18 @@ ${options.intent}
38
59
  - Do not introduce new libraries without explicit need.
39
60
  - Preserve existing behavior unless an acceptance criterion requires change.
40
61
  - Update docs only when behavior or workflow changes.
62
+
63
+ ## Dev Agent Record
64
+ ### Test Intent
65
+
66
+ ### Debug Log
67
+
68
+ ### Completion Notes
69
+
70
+ ### File List
71
+
72
+ ## Change Log
73
+ - ${new Date().toISOString().slice(0, 10)}: Story drafted.
41
74
  `),
42
75
  },
43
76
  {
@@ -58,6 +91,11 @@ story: ${storyPath}`, `# TDD Evidence: ${options.intent}
58
91
  ## Refactor
59
92
  - Command: \`${testCommand}\`
60
93
  - Result:
94
+
95
+ ## Review Evidence
96
+ - Reviewer:
97
+ - Outcome:
98
+ - Follow-ups:
61
99
  `),
62
100
  },
63
101
  ]);
@@ -0,0 +1,7 @@
1
+ export type ScoreOptions = {
2
+ root: string;
3
+ target?: string;
4
+ json?: boolean;
5
+ stdout?: Pick<typeof console, "log">;
6
+ };
7
+ export declare function scoreCommand(options: ScoreOptions): Promise<number>;
@@ -0,0 +1,29 @@
1
+ import { createColors } from "../core/colors.js";
2
+ import { calculateSpecScore } from "../core/spec-score.js";
3
+ export async function scoreCommand(options) {
4
+ const stdout = options.stdout ?? console;
5
+ const report = await calculateSpecScore(options.root, options.target);
6
+ stdout.log(options.json ? JSON.stringify(report, null, 2) : renderScore(report));
7
+ return report.status === "blocked" ? 1 : 0;
8
+ }
9
+ function renderScore(report) {
10
+ const colors = createColors();
11
+ const lines = [
12
+ `${colors.bold("Spec Runtime Score")}: ${colors.status(report.score >= 75, `${report.score}/100`, `${report.score}/100`)}`,
13
+ `Status: ${report.status}`,
14
+ ];
15
+ if (report.target)
16
+ lines.push(`Target: ${colors.cyan(report.target)}`);
17
+ lines.push("");
18
+ for (const category of report.categories) {
19
+ const ok = category.score >= 75;
20
+ lines.push(`${colors.status(ok, String(category.score), String(category.score)).padStart(colors.enabled ? 12 : 3)} ${category.name}: ${category.passed}/${category.total} - ${category.detail}`);
21
+ }
22
+ lines.push("", "Recommendations:");
23
+ lines.push(...report.recommendations.map((item) => `- ${item}`));
24
+ if (report.blockers.length) {
25
+ lines.push("", "Blockers:");
26
+ lines.push(...report.blockers.map((item) => `- ${item}`));
27
+ }
28
+ return lines.join("\n");
29
+ }
@@ -0,0 +1,10 @@
1
+ export type TeamOptions = {
2
+ root: string;
3
+ action: string;
4
+ target?: string;
5
+ from?: string;
6
+ to?: string;
7
+ json?: boolean;
8
+ stdout?: Pick<typeof console, "log" | "error">;
9
+ };
10
+ export declare function teamCommand(options: TeamOptions): Promise<number>;
@@ -0,0 +1,129 @@
1
+ import { buildTeamReport } from "../core/team-report.js";
2
+ import { createColors } from "../core/colors.js";
3
+ import { markdown, writeManagedFiles } from "../core/managed-files.js";
4
+ import { slugify, timestamp } from "../core/slug.js";
5
+ export async function teamCommand(options) {
6
+ const stdout = options.stdout ?? console;
7
+ switch (options.action) {
8
+ case "status":
9
+ return status(options);
10
+ case "audit":
11
+ return audit(options);
12
+ case "handoff":
13
+ return handoff(options);
14
+ default:
15
+ stdout.error("Usage: speckit team status|audit|handoff <story> [--from <role>] [--to <role>] [--json]");
16
+ return 1;
17
+ }
18
+ }
19
+ async function status(options) {
20
+ const stdout = options.stdout ?? console;
21
+ const target = requireTarget(options);
22
+ if (!target)
23
+ return 1;
24
+ const report = await buildTeamReport(options.root, target);
25
+ stdout.log(options.json ? JSON.stringify(report, null, 2) : renderReport(report, "Spec Team Status"));
26
+ return report.story ? 0 : 1;
27
+ }
28
+ async function audit(options) {
29
+ const stdout = options.stdout ?? console;
30
+ const target = requireTarget(options);
31
+ if (!target)
32
+ return 1;
33
+ const report = await buildTeamReport(options.root, target);
34
+ const auditReport = {
35
+ gate: "review",
36
+ status: report.status,
37
+ story: report.story,
38
+ blockers: report.blockers,
39
+ warnings: report.warnings,
40
+ roles: report.roles,
41
+ };
42
+ stdout.log(options.json ? JSON.stringify(auditReport, null, 2) : renderAudit(auditReport));
43
+ return report.status === "ok" ? 0 : 1;
44
+ }
45
+ async function handoff(options) {
46
+ const stdout = options.stdout ?? console;
47
+ const target = requireTarget(options);
48
+ if (!target)
49
+ return 1;
50
+ const report = await buildTeamReport(options.root, target);
51
+ if (!report.story) {
52
+ stdout.error(report.blockers[0] ?? `Story not found: ${target}`);
53
+ return 1;
54
+ }
55
+ const from = options.from ?? "current-role";
56
+ const to = options.to ?? "next-role";
57
+ const path = `.speckit/team/handoffs/${timestamp()}-${slugify(report.story.id)}-${slugify(from)}-to-${slugify(to)}.md`;
58
+ await writeManagedFiles(options.root, [
59
+ {
60
+ path,
61
+ content: markdown(`# Spec Team Handoff
62
+
63
+ ## Story
64
+ \`${report.story.path}\`
65
+
66
+ ## Route
67
+ - From: ${from}
68
+ - To: ${to}
69
+
70
+ ## Current Status
71
+ - Story status: ${report.story.status ?? "missing"}
72
+ - Team status: ${report.status}
73
+
74
+ ## Blockers
75
+ ${report.blockers.length ? report.blockers.map((item) => `- ${item}`).join("\n") : "- none"}
76
+
77
+ ## Warnings
78
+ ${report.warnings.length ? report.warnings.map((item) => `- ${item}`).join("\n") : "- none"}
79
+
80
+ ## Next Role Checklist
81
+ - [ ] Read the story and linked evidence file.
82
+ - [ ] Resolve blockers owned by the target role.
83
+ - [ ] Update durable artifacts before handing off again.
84
+ - [ ] Run \`speckit team audit ${report.story.path}\`.
85
+ `),
86
+ },
87
+ ]);
88
+ stdout.log(path);
89
+ return 0;
90
+ }
91
+ function renderReport(report, title) {
92
+ const colors = createColors();
93
+ if (!report.story)
94
+ return `${colors.bold(title)}: ${colors.red("blocked")}\n${report.blockers.join("\n")}`;
95
+ const lines = [
96
+ `${colors.bold(title)}: ${colors.status(report.status === "ok", "ok", "blocked")}`,
97
+ `Story: ${colors.cyan(report.story.path)}`,
98
+ `State: ${report.story.status ?? "missing"}`,
99
+ "",
100
+ ];
101
+ for (const role of report.roles) {
102
+ lines.push(`${colors.bold(role.role)}: ${colors.status(role.status === "ok", role.status, role.status)}`);
103
+ for (const check of role.checks) {
104
+ lines.push(` - ${colors.status(check.ok)} ${check.name}: ${check.detail}`);
105
+ }
106
+ lines.push("");
107
+ }
108
+ return lines.join("\n").trimEnd();
109
+ }
110
+ function renderAudit(report) {
111
+ const colors = createColors();
112
+ return [
113
+ `${colors.bold("Spec Team Audit")}: ${colors.status(report.status === "ok", "ok", "blocked")}`,
114
+ `Gate: ${report.gate}`,
115
+ report.story ? `Story: ${colors.cyan(report.story.path)}` : undefined,
116
+ "",
117
+ "Blocking:",
118
+ ...(report.blockers.length ? report.blockers.map((item) => `- ${item}`) : ["- none"]),
119
+ "",
120
+ "Warnings:",
121
+ ...(report.warnings.length ? report.warnings.map((item) => `- ${item}`) : ["- none"]),
122
+ ].filter((line) => line !== undefined).join("\n");
123
+ }
124
+ function requireTarget(options) {
125
+ if (options.target)
126
+ return options.target;
127
+ options.stdout?.error("Team command requires a story path or id.");
128
+ return undefined;
129
+ }
@@ -2,6 +2,7 @@ import { markdown, text } from "./managed-files.js";
2
2
  import { agilePolicy, enterpriseSafetyPolicy, tddPolicy, workflowReview, workflowShape, workflowTddRun, } from "./policy.js";
3
3
  import { permissionPolicyFile } from "./permission-policy.js";
4
4
  import { storyTemplate, tddEvidenceTemplate } from "./templates.js";
5
+ import { teamFiles } from "./team-scaffold.js";
5
6
  export function coreFiles() {
6
7
  return [
7
8
  {
@@ -48,6 +49,7 @@ adapters:
48
49
  }
49
50
  export function enterpriseFiles() {
50
51
  return [
52
+ ...teamFiles(),
51
53
  {
52
54
  path: ".speckit/flows/spec-flow.md",
53
55
  content: markdown(`# Spec Flow
@@ -0,0 +1,16 @@
1
+ export type ScoreCategory = {
2
+ name: string;
3
+ score: number;
4
+ passed: number;
5
+ total: number;
6
+ detail: string;
7
+ };
8
+ export type SpecScoreReport = {
9
+ score: number;
10
+ target?: string;
11
+ status: "excellent" | "healthy" | "needs-attention" | "blocked";
12
+ categories: ScoreCategory[];
13
+ blockers: string[];
14
+ recommendations: string[];
15
+ };
16
+ export declare function calculateSpecScore(root: string, target?: string): Promise<SpecScoreReport>;
@@ -0,0 +1,112 @@
1
+ import { access, readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { buildTeamReport } from "./team-report.js";
4
+ import { validateWorkflowContract } from "./workflow-validator.js";
5
+ export async function calculateSpecScore(root, target) {
6
+ const categories = target
7
+ ? await storyCategories(root, target)
8
+ : await projectCategories(root);
9
+ const score = Math.round(categories.reduce((sum, item) => sum + item.score, 0) / categories.length);
10
+ const blockers = categories
11
+ .filter((item) => item.score < 70)
12
+ .map((item) => `${item.name}: ${item.detail}`);
13
+ return {
14
+ score,
15
+ target,
16
+ status: statusFor(score, blockers.length),
17
+ categories,
18
+ blockers,
19
+ recommendations: recommendationsFor(categories, Boolean(target)),
20
+ };
21
+ }
22
+ async function projectCategories(root) {
23
+ const contract = await validateWorkflowContract(root);
24
+ return [
25
+ ratio("Workflow Contract", contract.filter((check) => check.ok).length, contract.length, "Core prompts, skills, adapters, and permissions"),
26
+ await fileScore(root, "Team Operating Model", [
27
+ ".speckit/team/roles.md",
28
+ ".speckit/team/artifact-ownership.md",
29
+ ".speckit/team/working-agreement.md",
30
+ ".speckit/team/review-gates.md",
31
+ ".speckit/team/handoff-protocol.md",
32
+ ]),
33
+ await fileScore(root, "Context And Session", [
34
+ ".speckit/memory/project-context.md",
35
+ ".speckit/sessions/active.md",
36
+ ".speckit/context/current.md",
37
+ ".speckit/context/subagent-handoff.md",
38
+ ]),
39
+ await fileScore(root, "Graph Sync", [
40
+ ".speckit/sync/beads-sync.jsonl",
41
+ ".beads/beads.jsonl",
42
+ ]),
43
+ ];
44
+ }
45
+ async function storyCategories(root, target) {
46
+ const team = await buildTeamReport(root, target);
47
+ if (!team.story) {
48
+ return [ratio("Story", 0, 1, team.blockers[0] ?? "Story not found")];
49
+ }
50
+ const allRoleChecks = team.roles.flatMap((role) => role.checks);
51
+ const qa = team.roles.find((role) => role.role === "QA/Test");
52
+ const developer = team.roles.find((role) => role.role === "Developer");
53
+ const reviewer = team.roles.find((role) => role.role === "Reviewer/Lead");
54
+ return [
55
+ ratio("Team Readiness", allRoleChecks.filter((check) => check.ok).length, allRoleChecks.length, "Role-owned story artifacts"),
56
+ ratio("Developer Trace", developer?.checks.filter((check) => check.ok).length ?? 0, developer?.checks.length ?? 1, "Dev Agent Record, File List, Change Log"),
57
+ ratio("TDD Evidence", qa?.checks.filter((check) => check.ok).length ?? 0, qa?.checks.length ?? 1, "Red, green, and refactor evidence"),
58
+ ratio("Review Gate", reviewer?.checks.filter((check) => check.ok).length ?? 0, reviewer?.checks.length ?? 1, "Review evidence and follow-ups"),
59
+ ];
60
+ }
61
+ async function fileScore(root, name, paths) {
62
+ const checks = await Promise.all(paths.map((path) => exists(root, path)));
63
+ const passed = checks.filter(Boolean).length;
64
+ return ratio(name, passed, paths.length, `${passed}/${paths.length} files present`);
65
+ }
66
+ function ratio(name, passed, total, detail) {
67
+ const denominator = Math.max(total, 1);
68
+ return {
69
+ name,
70
+ score: Math.round((passed / denominator) * 100),
71
+ passed,
72
+ total,
73
+ detail,
74
+ };
75
+ }
76
+ function statusFor(score, blockers) {
77
+ if (score >= 90 && blockers === 0)
78
+ return "excellent";
79
+ if (score >= 75)
80
+ return "healthy";
81
+ if (score >= 50)
82
+ return "needs-attention";
83
+ return "blocked";
84
+ }
85
+ function recommendationsFor(categories, storyMode) {
86
+ const weak = categories.filter((item) => item.score < 100);
87
+ if (weak.length === 0)
88
+ return ["Workflow is fully aligned."];
89
+ return weak.map((item) => {
90
+ if (storyMode && item.name === "TDD Evidence")
91
+ return "Complete red, green, and refactor evidence before review.";
92
+ if (storyMode && item.name === "Developer Trace")
93
+ return "Update Dev Agent Record, File List, and Change Log.";
94
+ if (storyMode && item.name === "Review Gate")
95
+ return "Record review outcome and follow-ups.";
96
+ if (item.name === "Context And Session")
97
+ return "Run memory refresh, session start, context, and compact before long work.";
98
+ if (item.name === "Graph Sync")
99
+ return "Run speckit sync and speckit graph setup.";
100
+ return `Fix ${item.name}.`;
101
+ });
102
+ }
103
+ async function exists(root, path) {
104
+ try {
105
+ await access(join(root, path));
106
+ const content = await readFile(join(root, path), "utf8");
107
+ return content.trim().length > 0;
108
+ }
109
+ catch {
110
+ return false;
111
+ }
112
+ }
@@ -0,0 +1,19 @@
1
+ import { StoryResolution } from "./story.js";
2
+ export type TeamCheck = {
3
+ name: string;
4
+ ok: boolean;
5
+ detail: string;
6
+ };
7
+ export type TeamRoleReport = {
8
+ role: string;
9
+ status: "ok" | "blocked" | "needs-attention" | "waiting";
10
+ checks: TeamCheck[];
11
+ };
12
+ export type TeamReport = {
13
+ status: "ok" | "blocked";
14
+ story?: Pick<StoryResolution, "id" | "path" | "title" | "status" | "evidencePath">;
15
+ roles: TeamRoleReport[];
16
+ blockers: string[];
17
+ warnings: string[];
18
+ };
19
+ export declare function buildTeamReport(root: string, target: string): Promise<TeamReport>;
@@ -0,0 +1,149 @@
1
+ import { access, readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { extractSection, resolveStory } from "./story.js";
4
+ export async function buildTeamReport(root, target) {
5
+ const story = await resolveStory(root, target);
6
+ if (!story) {
7
+ return {
8
+ status: "blocked",
9
+ roles: [],
10
+ blockers: [`Story not found: ${target}`],
11
+ warnings: [],
12
+ };
13
+ }
14
+ const evidence = await readEvidence(root, story.evidencePath);
15
+ const roles = [
16
+ productOwner(story.content),
17
+ analyst(story.content),
18
+ architect(story.content),
19
+ developer(story.content),
20
+ await qa(story.evidencePath, evidence),
21
+ reviewer(evidence),
22
+ ];
23
+ const blockers = roles.flatMap((role) => role.checks.filter((check) => !check.ok).map((check) => `${role.role}: ${check.name} - ${check.detail}`));
24
+ return {
25
+ status: blockers.length ? "blocked" : "ok",
26
+ story: {
27
+ id: story.id,
28
+ path: story.path,
29
+ title: story.title,
30
+ status: story.status,
31
+ evidencePath: story.evidencePath,
32
+ },
33
+ roles,
34
+ blockers,
35
+ warnings: story.status === "ready-for-dev" ? [] : [`Story status is ${story.status ?? "missing"}`],
36
+ };
37
+ }
38
+ function productOwner(content) {
39
+ return role("Product Owner", [
40
+ check("business-goal", sectionHasDetail(content, "Business Goal") || sectionHasDetail(content, "Intent"), "Business goal or intent is filled"),
41
+ check("priority", sectionHasValue(content, "Business Goal", "Priority"), "Priority is recorded"),
42
+ ]);
43
+ }
44
+ function analyst(content) {
45
+ return role("Analyst", [
46
+ check("acceptance-criteria", hasActionableAcceptanceCriteria(content), "Acceptance criteria are testable"),
47
+ check("edge-cases", sectionHasDetail(content, "Edge Cases") || sectionHasValue(content, "Dev Notes", "Edge cases"), "Edge cases are recorded"),
48
+ ]);
49
+ }
50
+ function architect(content) {
51
+ return role("Architect", [
52
+ check("implementation-scope", sectionHasDetail(content, "Implementation Scope"), "Implementation scope is recorded"),
53
+ check("risk-notes", sectionHasDetail(content, "Architecture Notes") || sectionHasValue(content, "Notes", "Risks"), "Constraints or risks are recorded"),
54
+ ]);
55
+ }
56
+ function developer(content) {
57
+ return role("Developer", [
58
+ check("dev-agent-record", sectionHasDetail(content, "Dev Agent Record"), "Dev Agent Record exists"),
59
+ check("file-list", subsectionHasDetail(content, "File List"), "File List has at least one entry"),
60
+ check("change-log", sectionHasDetail(content, "Change Log"), "Change Log is updated"),
61
+ ]);
62
+ }
63
+ async function qa(evidencePath, evidence) {
64
+ return role("QA/Test", [
65
+ check("evidence-link", Boolean(evidencePath), evidencePath ?? "Missing linked evidence file"),
66
+ check("evidence-file", Boolean(evidence), evidencePath ?? "Missing linked evidence file"),
67
+ check("red-evidence", evidence ? sectionHasDetail(evidence, "Red") : false, "Red evidence is recorded"),
68
+ check("green-evidence", evidence ? sectionHasDetail(evidence, "Green") : false, "Green evidence is recorded"),
69
+ check("refactor-evidence", evidence ? sectionHasDetail(evidence, "Refactor") : false, "Refactor validation is recorded"),
70
+ ]);
71
+ }
72
+ function reviewer(evidence) {
73
+ const checks = [
74
+ check("review-evidence", evidence ? sectionHasDetail(evidence, "Review Evidence") : false, "Review outcome is recorded"),
75
+ ];
76
+ const report = role("Reviewer/Lead", checks);
77
+ return report.status === "blocked" ? { ...report, status: "waiting" } : report;
78
+ }
79
+ function role(roleName, checks) {
80
+ return {
81
+ role: roleName,
82
+ status: checks.every((item) => item.ok) ? "ok" : "blocked",
83
+ checks,
84
+ };
85
+ }
86
+ function check(name, ok, detail) {
87
+ return { name, ok, detail };
88
+ }
89
+ function hasActionableAcceptanceCriteria(content) {
90
+ const criteria = extractSection(content, "Acceptance Criteria");
91
+ if (!criteria)
92
+ return false;
93
+ return /Given .+|When .+|Then .+|AC\d+:/i.test(criteria) && !criteria.includes("...");
94
+ }
95
+ function sectionHasValue(content, heading, label) {
96
+ const section = extractSection(content, heading);
97
+ if (!section)
98
+ return false;
99
+ const pattern = new RegExp(`${escapeRegExp(label)}:\\s*\\S+`, "i");
100
+ return pattern.test(section);
101
+ }
102
+ function sectionHasDetail(content, heading) {
103
+ const section = extractSection(content, heading);
104
+ if (!section)
105
+ return false;
106
+ return hasDetail(section);
107
+ }
108
+ function subsectionHasDetail(content, heading) {
109
+ const lines = content.split("\n");
110
+ const start = lines.findIndex((line) => /^#{2,3}\s+/.test(line) && line.replace(/^#{2,3}\s+/, "").trim().toLowerCase() === heading.toLowerCase());
111
+ if (start === -1)
112
+ return false;
113
+ const collected = [];
114
+ for (const line of lines.slice(start + 1)) {
115
+ if (/^#{2,3}\s+/.test(line))
116
+ break;
117
+ collected.push(line);
118
+ }
119
+ return hasDetail(collected.join("\n"));
120
+ }
121
+ function hasDetail(section) {
122
+ return section
123
+ .split("\n")
124
+ .map((line) => line.replace(/^[-*\s]+/, "").trim())
125
+ .filter((line) => line && !line.startsWith("###"))
126
+ .some((line) => {
127
+ if (line.includes("..."))
128
+ return false;
129
+ if (/^[A-Za-z -]+:\s*$/.test(line))
130
+ return false;
131
+ if (/^(Command|Result|Reviewer|Outcome|Follow-ups):\s*$/i.test(line))
132
+ return false;
133
+ return true;
134
+ });
135
+ }
136
+ async function readEvidence(root, evidencePath) {
137
+ if (!evidencePath)
138
+ return undefined;
139
+ try {
140
+ await access(join(root, evidencePath));
141
+ return await readFile(join(root, evidencePath), "utf8");
142
+ }
143
+ catch {
144
+ return undefined;
145
+ }
146
+ }
147
+ function escapeRegExp(value) {
148
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
149
+ }
@@ -0,0 +1,2 @@
1
+ import { ManagedFile } from "./managed-files.js";
2
+ export declare function teamFiles(): ManagedFile[];
@@ -0,0 +1,92 @@
1
+ import { markdown } from "./managed-files.js";
2
+ export function teamFiles() {
3
+ return [
4
+ {
5
+ path: ".speckit/team/roles.md",
6
+ content: markdown(`# Spec Team Roles
7
+
8
+ ## Purpose
9
+
10
+ Speckit maps team collaboration to owned artifacts. Roles do not imply separate people; one person can hold multiple roles, but every story must show which artifact is ready and which role is blocked.
11
+
12
+ ## Roles
13
+
14
+ | Role | Owns | Exit Signal |
15
+ | --- | --- | --- |
16
+ | Product Owner | business goal, priority, scope intent | story has clear business value |
17
+ | Analyst | acceptance criteria, edge cases, assumptions | story is testable |
18
+ | Architect | implementation scope, constraints, risks | dev can start without guessing |
19
+ | Developer | Dev Agent Record, File List, Change Log | implementation evidence is traceable |
20
+ | QA/Test | red, green, refactor evidence | behavior is validated |
21
+ | Reviewer/Lead | review evidence, approval, follow-ups | story can close |
22
+ `),
23
+ },
24
+ {
25
+ path: ".speckit/team/artifact-ownership.md",
26
+ content: markdown(`# Spec Artifact Ownership
27
+
28
+ ## Story Artifacts
29
+
30
+ - Product Owner owns \`Business Goal\`, \`Priority\`, and high-level intent.
31
+ - Analyst owns \`Acceptance Criteria\`, \`Edge Cases\`, and assumptions.
32
+ - Architect owns \`Implementation Scope\`, \`Architecture Notes\`, and risks.
33
+ - Developer owns \`Dev Agent Record\`, \`File List\`, and \`Change Log\`.
34
+ - QA/Test owns the linked TDD evidence file.
35
+ - Reviewer/Lead owns review outcome and closure readiness.
36
+
37
+ ## Rule
38
+
39
+ Do not move a story to the next gate by chat memory alone. Update the durable artifact first, then run \`speckit team status <story>\` or \`speckit team audit <story>\`.
40
+ `),
41
+ },
42
+ {
43
+ path: ".speckit/team/working-agreement.md",
44
+ content: markdown(`# Spec Working Agreement
45
+
46
+ ## Agreements
47
+
48
+ - One story is the unit of planning, implementation, review, and closure.
49
+ - Every implementation story must have a linked TDD evidence file.
50
+ - Agents and humans hand off through files, not conversation history.
51
+ - Graph commands stay robot-safe through Speckit wrappers.
52
+ - Review blocks closure when acceptance criteria, evidence, or file traceability are missing.
53
+ `),
54
+ },
55
+ {
56
+ path: ".speckit/team/review-gates.md",
57
+ content: markdown(`# Spec Review Gates
58
+
59
+ ## Gates
60
+
61
+ | Gate | Required Checks |
62
+ | --- | --- |
63
+ | shape | business goal, priority |
64
+ | ready | acceptance criteria, scope, context, graph sync |
65
+ | dev | Dev Agent Record, File List, Change Log |
66
+ | qa | red, green, refactor evidence |
67
+ | review | review outcome, follow-ups, unresolved risk |
68
+ | close | sync, compact summary, docs impact |
69
+
70
+ Run \`speckit team audit <story>\` before review and close.
71
+ `),
72
+ },
73
+ {
74
+ path: ".speckit/team/handoff-protocol.md",
75
+ content: markdown(`# Spec Handoff Protocol
76
+
77
+ ## Handoff Contract
78
+
79
+ Each handoff must include:
80
+
81
+ - Story path and current status.
82
+ - From role and to role.
83
+ - Current blockers and warnings.
84
+ - Files changed or expected files to inspect.
85
+ - Test evidence state.
86
+ - Next role checklist.
87
+
88
+ Use \`speckit team handoff <story> --from <role> --to <role>\` to generate a durable handoff.
89
+ `),
90
+ },
91
+ ];
92
+ }
@@ -1,2 +1,2 @@
1
- export declare const storyTemplate = "---\nstatus: draft\nevidence: .speckit/evidence/{{slug}}-tdd-evidence.md\ncontext: pending\nstory_key: {{slug}}\nac_count: 0\n---\n\n# Story: {{title}}\n\n## Intent\n{{intent}}\n\n## Acceptance Criteria\n- AC1: Given ...\n When ...\n Then ...\n\n## Implementation Scope\n- In scope:\n- Out of scope:\n- Files likely to read:\n- Files likely to modify:\n\n## Dev Notes\n- Existing patterns to reuse:\n- Architecture constraints:\n- Edge cases:\n- Previous-story learnings:\n\n## Tasks / Subtasks\n- [ ] Map acceptance criteria to tests.\n- [ ] RED: create or identify failing test.\n- [ ] GREEN: implement minimum passing change.\n- [ ] REFACTOR: improve design while tests stay green.\n- [ ] Update evidence, file list, and change log.\n\n## TDD Checklist\n- [ ] Test targets identified\n- [ ] Red evidence recorded\n- [ ] Green evidence recorded\n- [ ] Refactor validation recorded\n\n## Notes\n- Risks:\n- Dependencies:\n\n## Dev Agent Record\n### Test Intent\n\n### Debug Log\n\n### Completion Notes\n\n### File List\n\n## Change Log\n- {{date}}: Story drafted.\n\n## Spec Anti-Mistake Checklist\n- Reuse existing project patterns before adding new files.\n- Verify file locations before editing.\n- Do not introduce new libraries without explicit need.\n- Preserve existing behavior unless an acceptance criterion requires change.\n- Capture previous-story learnings if this continues prior work.\n- Do not mark any task complete without test or validation evidence.\n";
1
+ export declare const storyTemplate = "---\nstatus: draft\nevidence: .speckit/evidence/{{slug}}-tdd-evidence.md\ncontext: pending\nstory_key: {{slug}}\nac_count: 0\n---\n\n# Story: {{title}}\n\n## Intent\n{{intent}}\n\n## Business Goal\n- Goal:\n- Priority: medium\n- Success signal:\n\n## Acceptance Criteria\n- AC1: Given ...\n When ...\n Then ...\n\n## Edge Cases\n- Boundary:\n- Error path:\n- State transition:\n\n## Implementation Scope\n- In scope:\n- Out of scope:\n- Files likely to read:\n- Files likely to modify:\n\n## Architecture Notes\n- Constraints:\n- Integration points:\n- Risks:\n\n## Dev Notes\n- Existing patterns to reuse:\n- Architecture constraints:\n- Edge cases:\n- Previous-story learnings:\n\n## Tasks / Subtasks\n- [ ] Map acceptance criteria to tests.\n- [ ] RED: create or identify failing test.\n- [ ] GREEN: implement minimum passing change.\n- [ ] REFACTOR: improve design while tests stay green.\n- [ ] Update evidence, file list, and change log.\n\n## TDD Checklist\n- [ ] Test targets identified\n- [ ] Red evidence recorded\n- [ ] Green evidence recorded\n- [ ] Refactor validation recorded\n\n## Notes\n- Risks:\n- Dependencies:\n\n## Dev Agent Record\n### Test Intent\n\n### Debug Log\n\n### Completion Notes\n\n### File List\n\n## Change Log\n- {{date}}: Story drafted.\n\n## Spec Anti-Mistake Checklist\n- Reuse existing project patterns before adding new files.\n- Verify file locations before editing.\n- Do not introduce new libraries without explicit need.\n- Preserve existing behavior unless an acceptance criterion requires change.\n- Capture previous-story learnings if this continues prior work.\n- Do not mark any task complete without test or validation evidence.\n";
2
2
  export declare const tddEvidenceTemplate = "---\nstatus: missing\nstory: {{story}}\nphase: not-started\n---\n\n# TDD Evidence: {{story}}\n\n## Test Intent\n- Acceptance criteria covered:\n- Test files:\n- Command:\n\n## Red\n- Command:\n- Result:\n- Failing reason:\n\n## Green\n- Command:\n- Result:\n- Passing evidence:\n\n## Refactor\n- Command:\n- Result:\n- Regression evidence:\n\n## Review Evidence\n- Reviewer:\n- Outcome:\n- Follow-ups:\n";
@@ -11,17 +11,32 @@ ac_count: 0
11
11
  ## Intent
12
12
  {{intent}}
13
13
 
14
+ ## Business Goal
15
+ - Goal:
16
+ - Priority: medium
17
+ - Success signal:
18
+
14
19
  ## Acceptance Criteria
15
20
  - AC1: Given ...
16
21
  When ...
17
22
  Then ...
18
23
 
24
+ ## Edge Cases
25
+ - Boundary:
26
+ - Error path:
27
+ - State transition:
28
+
19
29
  ## Implementation Scope
20
30
  - In scope:
21
31
  - Out of scope:
22
32
  - Files likely to read:
23
33
  - Files likely to modify:
24
34
 
35
+ ## Architecture Notes
36
+ - Constraints:
37
+ - Integration points:
38
+ - Risks:
39
+
25
40
  ## Dev Notes
26
41
  - Existing patterns to reuse:
27
42
  - Architecture constraints:
package/docs/adapters.md CHANGED
@@ -14,6 +14,18 @@ Speckit compiles one workflow into native files for five IDEs.
14
14
 
15
15
  Generated files include the `speckit:managed` marker. Speckit updates managed files idempotently and skips unmanaged files unless `--force` is provided.
16
16
 
17
+ ## Shared Enterprise Contract
18
+
19
+ All adapters point agents back to the shared Speckit runtime:
20
+
21
+ - `.speckit/agents/super-agent.md`
22
+ - `.speckit/skills/catalog.md`
23
+ - `.speckit/team/*.md`
24
+ - `.speckit/context/current.md`
25
+ - `.speckit/context/subagent-handoff.md`
26
+
27
+ Adapters should not redefine team workflow rules independently. Update the shared generator and re-run `speckit init --enterprise --ide <name>` when the contract changes.
28
+
17
29
  ## Cursor Policy
18
30
 
19
31
  Cursor uses `.cursor/rules/*.mdc`. Speckit does not generate the legacy `.cursorrules` file.
@@ -5,5 +5,7 @@
5
5
  - Prefer deterministic file generation over runtime prompts.
6
6
  - Use `writeManagedFiles` for generated files so unmanaged user files are protected.
7
7
  - Keep adapter logic declarative: `name`, `displayName`, `outputPaths`, `render`.
8
+ - Keep enterprise evaluators artifact-based. Team status, audit, and score should inspect durable files instead of chat history.
9
+ - Keep public docs aligned with CLI help whenever a command is added.
8
10
  - Add tests for command behavior and adapter contracts before expanding implementation scope.
9
11
  - Do not invoke interactive external tools from automation paths.
@@ -4,9 +4,9 @@
4
4
 
5
5
  Speckit MVP is implemented and pushed to `git@github.com:trieungoctam/speckit.git` on `main`.
6
6
 
7
- Current package target: `@trieungoctam/speckit@0.3.5`.
7
+ Current package target: `@trieungoctam/speckit@0.4.0`.
8
8
 
9
- The CLI is npx-ready, generates Agile + TDD rules, creates workflow artifacts, supports five IDE adapters, wraps Beads Viewer safely, includes an enterprise harness, and has automated prompt/readiness/session tests plus CI.
9
+ The CLI is npx-ready, generates Agile + TDD rules, creates workflow artifacts, supports five IDE adapters, wraps Beads Viewer safely, includes an enterprise harness, and now exposes team-role workflow status, review-gate audit, handoff files, and runtime scoring.
10
10
 
11
11
  ## Milestones
12
12
 
@@ -20,17 +20,21 @@ The CLI is npx-ready, generates Agile + TDD rules, creates workflow artifacts, s
20
20
  | Beads integration | MVP Complete | `graph setup` prints install commands and prepares `.beads/beads.jsonl`; `next` and `graph triage/plan/insights` wrap BV robot mode; `sync` exports story metadata JSONL. |
21
21
  | Sprint automation | MVP Complete | `sprint plan` and `sprint next` select work from synced stories. |
22
22
  | Enterprise harness | MVP Complete | `init --enterprise` creates flow, tool-policy, and prompt harness files; `doctor --deep` verifies them. |
23
+ | Enterprise team workflow | Complete | `init --enterprise` creates `.speckit/team/*`; `team status`, `team audit`, and `team handoff` expose role-owned artifacts and review blockers. |
24
+ | Runtime scoring | Complete | `score` reports project or story workflow health across contract, team, session/context, graph, TDD, and review categories. |
23
25
  | Curated skill catalog | Complete | Speckit now generates focused phase skills, a schema, delegation statuses, and task hydration/sync-back guidance. |
24
26
  | Workflow contract validator | Complete | `speckit validate` and `doctor --deep` check phase order, core skills, router terms, run prompt terms, and adapter parity. |
25
27
  | Prompt architecture | Complete | Generated prompts now enforce artifact contracts, hard gates, common mistake prevention, TDD evidence, and review layers across adapters. |
26
28
  | Permission policy | MVP Complete | `.speckit/permissions.yaml` and `permissions audit` cover privacy files, heavy paths, destructive commands, and release commands. |
27
29
  | Validation | Complete | Build and `node:test` suite pass locally with flow contract gates. |
28
30
  | GitHub publish | Complete | Initial code pushed to `trieungoctam/speckit` at commit `7e5c582`; status docs follow-up in progress. |
29
- | npm package readiness | Ready | Package scoped as `@trieungoctam/speckit`; `npm pack --dry-run` passes. |
31
+ | npm package readiness | Ready | Package scoped as `@trieungoctam/speckit`; `npm pack --dry-run` passes for `0.4.0`. |
30
32
 
31
33
  ## Next Roadmap
32
34
 
35
+ - Add `score --threshold <n>` for CI gating after teams agree on rollout policy.
33
36
  - Add `review --deep` with multi-layer acceptance, edge-case, and production-readiness prompts.
34
37
  - Add graph drift and history correlation commands.
38
+ - Add lockfile and drift detection for generated Speckit contracts.
35
39
  - Add GitHub trusted publishing for npm releases.
36
40
  - Add snapshot tests for full adapter file contents.
@@ -6,9 +6,10 @@ Speckit works best as a repo-local standard, then as an organization template.
6
6
 
7
7
  1. Pilot in one service repository with `speckit init --ide all`.
8
8
  2. Require stories to include acceptance criteria and TDD evidence.
9
- 3. Add `speckit doctor` and project tests to CI.
10
- 4. Export stories with `speckit sync` for task graph visibility.
11
- 5. Roll the generated adapter pack into team templates.
9
+ 3. Require `speckit team status <story>` before implementation handoff.
10
+ 4. Add `speckit doctor`, `speckit validate`, `speckit score --json`, and project tests to CI.
11
+ 5. Export stories with `speckit sync` for task graph visibility.
12
+ 6. Roll the generated adapter pack into team templates.
12
13
 
13
14
  ## Governance Layers
14
15
 
@@ -16,12 +17,16 @@ Speckit works best as a repo-local standard, then as an organization template.
16
17
  | --- | --- | --- |
17
18
  | Company policy | Engineering leadership | `.speckit/rules/enterprise-safety.md` |
18
19
  | Team workflow | Tech lead | `.speckit/workflows/*.md` |
20
+ | Team roles | Product / engineering lead | `.speckit/team/*.md` |
19
21
  | Repo standard | Maintainers | `AGENTS.md`, `CLAUDE.md`, IDE config |
20
22
  | Story evidence | Implementer | `.speckit/evidence/*.md` |
23
+ | Review readiness | Reviewer / lead | `speckit team audit <story>` |
21
24
 
22
25
  ## Recommended Controls
23
26
 
24
27
  - Do not allow code stories to merge without red-green-refactor evidence.
25
28
  - Keep adapter output generated from Speckit instead of hand-maintaining per-IDE rules.
26
29
  - Treat `speckit doctor` warnings as rollout debt.
30
+ - Treat `speckit score` as the adoption health metric. Start non-blocking, then define a threshold after the pilot.
31
+ - Use `speckit team handoff` whenever work moves from development to QA or review.
27
32
  - Use Beads Viewer only through robot commands for non-interactive automation.
@@ -5,11 +5,13 @@ Speckit owns the workflow contract for enterprise Agile + TDD development with a
5
5
  ## Speckit Owns
6
6
 
7
7
  - The `.speckit/` source of truth: config, rules, workflows, templates, generated artifacts.
8
- - The command surface: `init`, `doctor`, `validate`, `start`, `memory`, `permissions`, `session`, `shape`, `plan`, `context`, `quick`, `sync`, `triage`, `sprint`, `graph`, `next`, `ready`, `run`, `review`, `close`.
8
+ - The command surface: `init`, `doctor`, `validate`, `start`, `memory`, `permissions`, `session`, `team`, `score`, `shape`, `plan`, `context`, `quick`, `sync`, `triage`, `sprint`, `graph`, `next`, `ready`, `run`, `review`, `close`.
9
9
  - The skill catalog and super-agent routing contract for phase-specific agent behavior.
10
10
  - IDE-specific initialization that installs the shared Speckit runtime plus only the selected IDE adapter when `--ide <name>` is provided.
11
11
  - The long-session contract: project memory, active session state, checkpoints, compaction summaries, and resume handoffs.
12
12
  - The workflow validation contract: phase order, core skills, super-agent routing, run prompt terms, and installed adapter prompt parity.
13
+ - The enterprise team contract: Product Owner, Analyst, Architect, Developer, QA/Test, and Reviewer/Lead artifact ownership.
14
+ - The runtime score contract: project and story health across workflow, team, session/context, graph, TDD, and review categories.
13
15
  - The TDD gate: code stories require red, green, and refactor evidence.
14
16
  - The adapter compiler for Claude Code, Codex, Antigravity, OpenCode, and Cursor.
15
17
  - The safety policy for destructive commands, secrets, production access, and review readiness.
@@ -26,7 +28,24 @@ Speckit owns the workflow contract for enterprise Agile + TDD development with a
26
28
  ## State Model
27
29
 
28
30
  ```text
29
- intake -> session -> memory-ready -> shaped -> planned -> sprint-ready -> context-ready -> synced -> graph-triaged -> ready-for-dev -> tests-red -> checkpointed -> running -> tests-green -> refactor -> compacted -> review-ready -> closed
31
+ intake -> session -> memory-ready -> shaped -> planned -> sprint-ready -> context-ready -> synced -> graph-triaged -> team-status -> ready-for-dev -> tests-red -> checkpointed -> running -> tests-green -> refactor -> team-audit -> compacted -> review-ready -> closed
30
32
  ```
31
33
 
32
34
  Implementation starts only after `speckit ready <story>` passes. Review starts only after test evidence exists and the active session has a current checkpoint.
35
+
36
+ ## Team Artifact Model
37
+
38
+ | Role | Owned Artifact |
39
+ | --- | --- |
40
+ | Product Owner | `Business Goal`, priority, success signal |
41
+ | Analyst | `Acceptance Criteria`, `Edge Cases` |
42
+ | Architect | `Implementation Scope`, `Architecture Notes` |
43
+ | Developer | `Dev Agent Record`, `File List`, `Change Log` |
44
+ | QA/Test | linked TDD evidence red, green, refactor sections |
45
+ | Reviewer/Lead | `Review Evidence`, follow-ups, close readiness |
46
+
47
+ `speckit team status` reports current ownership gaps. `speckit team audit` enforces the review gate. `speckit team handoff` records role transfer.
48
+
49
+ ## Runtime Score Model
50
+
51
+ `speckit score` is a health signal, not a replacement for tests. It shows whether the project or story has enough durable workflow evidence to be understandable, reviewable, and handoff-ready.
@@ -1,5 +1,24 @@
1
1
  # Project Changelog
2
2
 
3
+ ## 0.4.0 - 2026-05-11
4
+
5
+ ### Added
6
+
7
+ - Added the Enterprise Team Workflow layer with generated team role, artifact ownership, working agreement, review gate, and handoff protocol files.
8
+ - Added `speckit team status <story>` to show role-by-role artifact readiness for Product Owner, Analyst, Architect, Developer, QA/Test, and Reviewer/Lead.
9
+ - Added `speckit team audit <story> [--json]` for review-gate blocking checks that can run in CI.
10
+ - Added `speckit team handoff <story> --from <role> --to <role>` to create durable role handoff files.
11
+ - Added `speckit score [story] [--json]` to score project or story workflow health for enterprise demos and CI health reporting.
12
+
13
+ ### Changed
14
+
15
+ - Story templates and generated quick/plan stories now include business goal, priority, edge cases, implementation scope, architecture notes, Dev Agent Record, File List, and Change Log sections for team traceability.
16
+ - `.beads/` is ignored as runtime graph mirror state.
17
+
18
+ ### Quality
19
+
20
+ - Added enterprise team workflow tests for generated files, status, audit, and handoff behavior.
21
+
3
22
  ## 0.3.6 - 2026-05-11
4
23
 
5
24
  ### Added
@@ -6,12 +6,16 @@ Before publishing Speckit:
6
6
  - [x] `npm run lint` passes.
7
7
  - [x] `npm test` passes.
8
8
  - [x] `bin/speckit init --ide all` works in a temporary directory.
9
+ - [x] `speckit init --enterprise --ide all` creates `.speckit/team/*`.
10
+ - [x] `speckit team status|audit|handoff` has test coverage.
11
+ - [x] `speckit score [story] --json` has test coverage.
9
12
  - [x] `npm pack --dry-run` includes only package-safe files.
10
13
  - [x] `package.json` name is `@trieungoctam/speckit` and `publishConfig.access` is `public`.
11
14
  - [x] README uses `npx @trieungoctam/speckit@latest`.
12
15
  - [x] Adapter output paths match `docs/adapters.md`.
13
16
  - [x] Cursor output uses `.cursor/rules/*.mdc`, not `.cursorrules`.
14
17
  - [x] `speckit next` only invokes `bv --robot-*`.
18
+ - [x] `.beads/` runtime mirror files are ignored by git.
15
19
  - [ ] License and attribution review is complete for Speckit, Speckit Method, and Beads Viewer inspiration.
16
20
  - [x] README quickstart is accurate.
17
21
  - [x] No secrets, local credentials, or generated private data are included.
@@ -29,6 +29,8 @@ Every phase must link to the next durable artifact.
29
29
  | context | story | context pack | story -> context |
30
30
  | sync | story | graph task | story -> task id |
31
31
  | run | task/story | TDD evidence | task -> evidence |
32
+ | team status | story + evidence | role readiness | role -> artifact |
33
+ | team audit | story + evidence | gate report | blocker -> owner |
32
34
  | review | diff + evidence | review checklist | evidence -> review |
33
35
  | close | review | changelog / graph close | review -> close |
34
36
 
@@ -51,6 +53,30 @@ All supported IDEs must receive the same Speckit policy:
51
53
  - Session/context instructions
52
54
  - Graph command safety
53
55
 
56
+ ## Team Gate
57
+
58
+ Enterprise stories must expose role-owned artifacts:
59
+
60
+ - Product Owner: business goal, priority, success signal.
61
+ - Analyst: testable acceptance criteria and edge cases.
62
+ - Architect: implementation scope, constraints, and risks.
63
+ - Developer: Dev Agent Record, File List, and Change Log.
64
+ - QA/Test: red, green, and refactor evidence.
65
+ - Reviewer/Lead: review outcome and follow-ups.
66
+
67
+ Run:
68
+
69
+ ```bash
70
+ speckit team status <story>
71
+ speckit team audit <story> --json
72
+ ```
73
+
74
+ ## Score Gate
75
+
76
+ `speckit score` gives a project-level health signal across workflow contract, team operating model, context/session, and graph sync. `speckit score <story>` gives a story-level signal across team readiness, developer trace, TDD evidence, and review gate.
77
+
78
+ Use score as a rollout metric first. Only turn it into a hard CI threshold after the team agrees on acceptable minimums.
79
+
54
80
  ## Release Gate
55
81
 
56
82
  Before release:
@@ -67,4 +93,5 @@ For enterprise releases:
67
93
  ```bash
68
94
  speckit init --enterprise --ide all
69
95
  speckit doctor --deep --json
96
+ speckit score --json
70
97
  ```
@@ -14,6 +14,9 @@ bin/speckit
14
14
  - `src/commands/*`: command implementations with filesystem-safe outputs.
15
15
  - `src/core/managed-files.ts`: creates or updates only Speckit-managed files unless forced.
16
16
  - `src/core/scaffold.ts`: defines core `.speckit/` rules, workflows, and templates.
17
+ - `src/core/team-scaffold.ts`: defines generated team operating model files for enterprise mode.
18
+ - `src/core/team-report.ts`: evaluates role-owned story artifacts for team status, audit, and handoff.
19
+ - `src/core/spec-score.ts`: calculates project and story workflow health scores.
17
20
  - `src/core/test-detection.ts`: detects project test commands for TDD evidence.
18
21
  - `src/adapters/*`: renders native IDE config and instruction packs.
19
22
  - `src/adapters/tool-checks.ts`: reports external tool availability.
@@ -21,7 +24,22 @@ bin/speckit
21
24
  ## Data Flow
22
25
 
23
26
  ```text
24
- user intent -> CLI command -> markdown/json artifact -> IDE adapter -> agent workflow
27
+ user intent -> CLI command -> markdown/json artifact -> team/status gates -> IDE adapter -> agent workflow
25
28
  ```
26
29
 
27
30
  The CLI does not depend on external workflow runtimes. Beads and Beads Viewer are optional integrations discovered at runtime.
31
+
32
+ ## Enterprise Team Layer
33
+
34
+ ```text
35
+ story + evidence
36
+ -> team-report
37
+ -> team status / audit / handoff
38
+ -> score
39
+ ```
40
+
41
+ Team checks are artifact-based. They inspect story sections, linked TDD evidence, and generated team contracts instead of relying on chat history.
42
+
43
+ ## Score Layer
44
+
45
+ `speckit score` aggregates health across workflow contract, team operating model, context/session state, and graph sync. `speckit score <story>` aggregates story health across team readiness, developer trace, TDD evidence, and review gate.
@@ -0,0 +1,40 @@
1
+ # Enterprise Team Workflow
2
+
3
+ Speckit Enterprise Team Workflow makes agentic development visible across roles. A role can be a person, a pair, or an agent, but every role owns durable artifacts.
4
+
5
+ ## Roles
6
+
7
+ | Role | Owns | Speckit Checks |
8
+ | --- | --- | --- |
9
+ | Product Owner | business goal, priority | `Business Goal`, `Priority` |
10
+ | Analyst | acceptance criteria, edge cases | `Acceptance Criteria`, `Edge Cases` |
11
+ | Architect | scope, constraints, risk | `Implementation Scope`, `Architecture Notes` |
12
+ | Developer | implementation trace | `Dev Agent Record`, `File List`, `Change Log` |
13
+ | QA/Test | TDD proof | linked evidence `Red`, `Green`, `Refactor` |
14
+ | Reviewer/Lead | approval | `Review Evidence` |
15
+
16
+ ## Flow
17
+
18
+ ```bash
19
+ speckit setup
20
+ speckit quick "Add customer export"
21
+ speckit context .speckit/stories/<story>.md
22
+ speckit sync
23
+ speckit team status .speckit/stories/<story>.md
24
+ speckit ready .speckit/stories/<story>.md
25
+ speckit run .speckit/stories/<story>.md
26
+ speckit team handoff .speckit/stories/<story>.md --from dev --to qa
27
+ speckit team audit .speckit/stories/<story>.md
28
+ speckit score .speckit/stories/<story>.md
29
+ ```
30
+
31
+ ## Status Vs Audit
32
+
33
+ - `speckit team status <story>` answers where the story is blocked across roles.
34
+ - `speckit team audit <story>` answers whether the story can pass the review gate.
35
+ - `speckit team handoff <story> --from <role> --to <role>` writes a durable handoff for long sessions or role transfer.
36
+ - `speckit score <story>` gives a compact health score for team readiness, developer trace, TDD evidence, and review gate.
37
+
38
+ ## Enterprise Rule
39
+
40
+ Do not advance a story by chat memory alone. Update the story, evidence, session, or handoff artifact first, then run team status or audit.
package/docs/use-cases.md CHANGED
@@ -162,6 +162,10 @@ Best practices:
162
162
  Use after implementation and tests pass.
163
163
 
164
164
  ```bash
165
+ speckit team status .speckit/stories/<story>.md
166
+ speckit team audit .speckit/stories/<story>.md
167
+ speckit score .speckit/stories/<story>.md
168
+ speckit team handoff .speckit/stories/<story>.md --from dev --to reviewer
165
169
  speckit review
166
170
  speckit session compact
167
171
  speckit close .speckit/stories/<story>.md
@@ -172,6 +176,9 @@ speckit validate
172
176
  Best practices:
173
177
 
174
178
  - Review acceptance coverage before style or preference issues.
179
+ - Use `team status` to locate the role and artifact blocking review.
180
+ - Use `score <story>` as a quick executive summary before review or demo.
181
+ - Use `team handoff` when responsibility moves between dev, QA, reviewer, or lead.
175
182
  - Check TDD evidence, session freshness, docs impact, and graph sync.
176
183
  - Close only after the story has current evidence and a clean handoff.
177
184
  - Sync after closing so downstream graph and sprint views are current.
@@ -187,12 +194,16 @@ npm run build
187
194
  npm test
188
195
  npx @trieungoctam/speckit@latest doctor --deep --json
189
196
  npx @trieungoctam/speckit@latest validate --json
197
+ npx @trieungoctam/speckit@latest score --json
198
+ npx @trieungoctam/speckit@latest team audit .speckit/stories/<story>.md --json
190
199
  ```
191
200
 
192
201
  Best practices:
193
202
 
194
203
  - Fail CI when `validate` returns `needs-attention`.
204
+ - Use `score --json` as a non-blocking health metric until the team agrees on a threshold.
195
205
  - Require `doctor --deep` before release branches are merged.
206
+ - Require `team audit` for stories that are ready for review or close.
196
207
  - Keep generated prompt files reviewed like source code.
197
208
  - Add new workflow phases only through the central contract and tests.
198
209
  - Do not allow IDE-specific prompts to drift from the shared Speckit contract.
@@ -47,6 +47,26 @@ Outputs:
47
47
  - `.speckit/sprint/status.yaml`
48
48
  - `.speckit/sprint/plan.md`
49
49
 
50
+ ## Enterprise Team Lane
51
+
52
+ Use when a story moves across product, analysis, architecture, development, QA, and review responsibilities.
53
+
54
+ ```bash
55
+ speckit team status .speckit/stories/<story>.md
56
+ speckit team handoff .speckit/stories/<story>.md --from dev --to qa
57
+ speckit team audit .speckit/stories/<story>.md
58
+ speckit score .speckit/stories/<story>.md
59
+ ```
60
+
61
+ Outputs:
62
+
63
+ - `.speckit/team/roles.md`
64
+ - `.speckit/team/artifact-ownership.md`
65
+ - `.speckit/team/review-gates.md`
66
+ - `.speckit/team/handoffs/<handoff>.md`
67
+
68
+ The team lane does not simulate people. It maps team responsibilities to durable artifacts so any person or agent can see which role is blocking the story.
69
+
50
70
  ## TDD Evidence Gate
51
71
 
52
72
  Each code story must record:
@@ -72,3 +92,14 @@ Long-running agent work must keep durable state outside chat history:
72
92
  `speckit sync` prepares both Speckit sync metadata and a Beads Viewer-compatible `.beads/beads.jsonl` mirror. `speckit graph triage|plan|insights` refreshes that mirror before invoking `bv --robot-*` from the project root, then falls back to local JSON if Beads Viewer is unavailable or still fails.
73
93
 
74
94
  Run `speckit graph setup` on a new machine to print Beads Viewer install commands, check `br`/`bd`/`bv`, and prepare `.beads/beads.jsonl`.
95
+
96
+ ## Runtime Score
97
+
98
+ Use score as the compact executive summary of workflow health:
99
+
100
+ ```bash
101
+ speckit score
102
+ speckit score .speckit/stories/<story>.md
103
+ ```
104
+
105
+ Project score checks workflow contract, team operating model, context/session, and graph sync. Story score checks team readiness, developer trace, TDD evidence, and review gate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trieungoctam/speckit",
3
- "version": "0.3.6",
3
+ "version": "0.4.0",
4
4
  "description": "Enterprise Agile + TDD workflow compiler for agentic IDEs.",
5
5
  "type": "module",
6
6
  "files": [