cc-devflow 4.5.10 → 4.5.12

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 (187) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +23 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
  3. package/.claude/skills/cc-act/SKILL.md +38 -418
  4. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
  5. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
  6. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
  7. package/.claude/skills/cc-act/references/closure-contract.md +12 -63
  8. package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
  9. package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
  10. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
  11. package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
  12. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
  13. package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
  14. package/.claude/skills/cc-check/CHANGELOG.md +24 -0
  15. package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
  16. package/.claude/skills/cc-check/SKILL.md +33 -454
  17. package/.claude/skills/cc-check/references/review-contract.md +12 -147
  18. package/.claude/skills/cc-dev/CHANGELOG.md +20 -0
  19. package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
  20. package/.claude/skills/cc-dev/SKILL.md +52 -130
  21. package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
  22. package/.claude/skills/cc-do/CHANGELOG.md +17 -0
  23. package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
  24. package/.claude/skills/cc-do/SKILL.md +39 -236
  25. package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
  26. package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
  27. package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
  28. package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
  29. package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
  30. package/.claude/skills/cc-investigate/CHANGELOG.md +23 -0
  31. package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
  32. package/.claude/skills/cc-investigate/SKILL.md +65 -513
  33. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -95
  34. package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -217
  35. package/.claude/skills/cc-next/CHANGELOG.md +6 -0
  36. package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
  37. package/.claude/skills/cc-next/SKILL.md +34 -140
  38. package/.claude/skills/cc-plan/CHANGELOG.md +29 -0
  39. package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
  40. package/.claude/skills/cc-plan/SKILL.md +47 -640
  41. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -225
  42. package/.claude/skills/cc-plan/references/planning-contract.md +24 -160
  43. package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
  44. package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
  45. package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
  46. package/.claude/skills/cc-pr-land/SKILL.md +14 -114
  47. package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
  48. package/.claude/skills/cc-pr-review/SKILL.md +20 -103
  49. package/.claude/skills/cc-review/CHANGELOG.md +17 -0
  50. package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
  51. package/.claude/skills/cc-review/SKILL.md +53 -241
  52. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
  53. package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
  54. package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
  55. package/.claude/skills/cc-review/references/review-methods.md +10 -218
  56. package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
  57. package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
  58. package/.claude/skills/cc-roadmap/SKILL.md +3 -3
  59. package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
  60. package/.claude/skills/cc-simplify/SKILL.md +26 -21
  61. package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
  62. package/.claude/skills/cc-spec-init/SKILL.md +29 -132
  63. package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
  64. package/CHANGELOG.md +27 -0
  65. package/README.md +5 -3
  66. package/README.zh-CN.md +5 -3
  67. package/bin/cc-devflow-cli.js +20 -260
  68. package/bin/cc-devflow.js +44 -7
  69. package/docs/commands/README.md +1 -1
  70. package/docs/commands/README.zh-CN.md +1 -1
  71. package/docs/examples/README.md +1 -1
  72. package/docs/examples/START-HERE.md +14 -14
  73. package/docs/examples/example-bindings.json +11 -11
  74. package/docs/examples/full-design-blocked/README.md +4 -6
  75. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
  76. package/docs/examples/local-handoff/README.md +8 -11
  77. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
  78. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
  79. package/docs/examples/pdca-loop/README.md +6 -9
  80. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
  81. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
  82. package/docs/examples/scripts/check-example-bindings.sh +11 -62
  83. package/docs/guides/artifact-contract.md +10 -36
  84. package/docs/guides/getting-started.md +8 -7
  85. package/docs/guides/getting-started.zh-CN.md +8 -7
  86. package/docs/guides/minimize-artifacts.md +16 -116
  87. package/docs/guides/project-postmortem.md +14 -71
  88. package/lib/compiler/__tests__/skills-registry.test.js +9 -8
  89. package/lib/compiler/resource-copier.js +29 -0
  90. package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
  91. package/lib/skill-runtime/__tests__/benchmark-skills.test.js +109 -0
  92. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
  93. package/lib/skill-runtime/errors.js +3 -3
  94. package/lib/skill-runtime/index.js +5 -23
  95. package/lib/skill-runtime/paths.js +5 -52
  96. package/lib/skill-runtime/query-registry.js +4 -4
  97. package/lib/skill-runtime/query.js +89 -201
  98. package/lib/skill-runtime/store.js +4 -40
  99. package/lib/skill-runtime/trace.js +2 -2
  100. package/package.json +5 -7
  101. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
  102. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
  103. package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
  104. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
  105. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
  106. package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
  107. package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
  108. package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
  109. package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
  110. package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
  111. package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
  112. package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
  113. package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
  114. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -225
  115. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -179
  116. package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
  117. package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
  118. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
  119. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
  120. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
  121. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
  122. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
  123. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
  124. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
  125. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
  126. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
  127. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
  128. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
  129. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
  130. package/docs/get-shit-done-strategy-audit.md +0 -518
  131. package/docs/skill-runtime-migration.md +0 -46
  132. package/lib/skill-runtime/__tests__/approve.test.js +0 -92
  133. package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
  134. package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
  135. package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
  136. package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
  137. package/lib/skill-runtime/__tests__/intent.test.js +0 -203
  138. package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
  139. package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
  140. package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
  141. package/lib/skill-runtime/__tests__/query.test.js +0 -860
  142. package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
  143. package/lib/skill-runtime/__tests__/release.test.js +0 -85
  144. package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
  145. package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
  146. package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
  147. package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
  148. package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
  149. package/lib/skill-runtime/__tests__/task-contract.test.js +0 -783
  150. package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
  151. package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
  152. package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
  153. package/lib/skill-runtime/__tests__/worker.test.js +0 -56
  154. package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
  155. package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
  156. package/lib/skill-runtime/artifacts.js +0 -88
  157. package/lib/skill-runtime/context-index.js +0 -545
  158. package/lib/skill-runtime/delegation.js +0 -533
  159. package/lib/skill-runtime/intent.js +0 -309
  160. package/lib/skill-runtime/lifecycle.js +0 -294
  161. package/lib/skill-runtime/operations/CLAUDE.md +0 -19
  162. package/lib/skill-runtime/operations/approve.js +0 -81
  163. package/lib/skill-runtime/operations/autopilot-core.js +0 -337
  164. package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
  165. package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
  166. package/lib/skill-runtime/operations/autopilot.js +0 -163
  167. package/lib/skill-runtime/operations/dispatch.js +0 -416
  168. package/lib/skill-runtime/operations/init.js +0 -60
  169. package/lib/skill-runtime/operations/janitor.js +0 -61
  170. package/lib/skill-runtime/operations/plan.js +0 -59
  171. package/lib/skill-runtime/operations/prepare-pr.js +0 -25
  172. package/lib/skill-runtime/operations/release.js +0 -99
  173. package/lib/skill-runtime/operations/resume.js +0 -126
  174. package/lib/skill-runtime/operations/review-records.js +0 -265
  175. package/lib/skill-runtime/operations/snapshot.js +0 -45
  176. package/lib/skill-runtime/operations/task-contract.js +0 -524
  177. package/lib/skill-runtime/operations/verify.js +0 -170
  178. package/lib/skill-runtime/operations/worker-run.js +0 -531
  179. package/lib/skill-runtime/operations/worker.js +0 -33
  180. package/lib/skill-runtime/planner.js +0 -539
  181. package/lib/skill-runtime/readiness.js +0 -84
  182. package/lib/skill-runtime/review-records.js +0 -123
  183. package/lib/skill-runtime/review.js +0 -855
  184. package/lib/skill-runtime/schemas.js +0 -746
  185. package/lib/skill-runtime/task-contract.js +0 -187
  186. package/lib/skill-runtime/team-state.js +0 -122
  187. package/lib/skill-runtime/workflow-context.js +0 -748
@@ -1,179 +0,0 @@
1
- {
2
- "changeId": "REQ-XXX",
3
- "goal": "Deliver planned requirement changes safely.",
4
- "createdAt": "2026-05-11T00:00:00.000Z",
5
- "updatedAt": "2026-05-11T00:00:00.000Z",
6
- "requirementId": "REQ-XXX",
7
- "requirementVersion": "REQ-XXX.v1",
8
- "outputPolicy": {
9
- "documentLanguage": ""
10
- },
11
- "planningMeta": {
12
- "reqPlanSkillVersion": "3.9.0",
13
- "designVersion": "design.v1",
14
- "workBranch": "REQ/XXX-short-feature-name",
15
- "approvedAt": "2026-04-15T12:00:00.000Z",
16
- "basedOnOption": "Option A",
17
- "aiLeverageDecisionLens": {
18
- "realUserOrOperator": "",
19
- "statusQuoWorkaround": "",
20
- "humanTeamEffortForFullScope": "",
21
- "ccAgentEffortForFullScope": "",
22
- "aiCompressionRatio": "",
23
- "completeLakeBoundary": "",
24
- "oceanBoundary": "",
25
- "scopeRecommendation": "sharp-wedge",
26
- "costModel": {
27
- "agentTime": "",
28
- "humanReviewTime": "",
29
- "verificationCost": "",
30
- "maintenanceCost": "",
31
- "failureCost": "",
32
- "reversibility": ""
33
- },
34
- "verdict": "sharp-wedge",
35
- "missingEvidenceOrPivotReason": "",
36
- "impactOnApprovedDirection": ""
37
- },
38
- "externalBestPractice": {
39
- "needed": false,
40
- "decisionStatus": "not-needed",
41
- "decisionQuestionId": "",
42
- "privacyGuard": "generalized terms only; no project names, private requirements, customer names, secrets, logs, or proprietary concepts",
43
- "generalizedSearchTerms": [],
44
- "sourcesChecked": [],
45
- "conventionalWisdom": "",
46
- "currentDiscourse": "",
47
- "repoFitVerdict": "skipped",
48
- "designImpacts": [],
49
- "skippedReason": "repo evidence is sufficient for this plan"
50
- },
51
- "decisionQuestions": [
52
- {
53
- "questionId": "D1",
54
- "gate": "approach-approval",
55
- "knownEvidence": [],
56
- "recommendation": "Option A",
57
- "options": [
58
- {
59
- "id": "A",
60
- "label": "Minimal viable",
61
- "recommended": true,
62
- "completeness": "7/10",
63
- "good": "",
64
- "costRisk": ""
65
- },
66
- {
67
- "id": "B",
68
- "label": "Ideal architecture",
69
- "recommended": false,
70
- "completeness": "10/10",
71
- "good": "",
72
- "costRisk": ""
73
- }
74
- ],
75
- "userChoice": "A",
76
- "impact": "cc-do follows the approved implementation surface and task split",
77
- "status": "answered"
78
- }
79
- ]
80
- },
81
- "currentTaskId": "T001",
82
- "tasks": [
83
- {
84
- "id": "T001",
85
- "title": "[TEST] Add a failing test for the missing behavior",
86
- "type": "TEST",
87
- "phase": 1,
88
- "contract": {
89
- "sourceFunnelRounds": [
90
- "Requirement Reality",
91
- "Interface & Data Contract",
92
- "Task Contract"
93
- ],
94
- "userStory": "US-001",
95
- "edgeOrRecoveryStory": "US-EDGE-001",
96
- "fileResponsibility": "tests own behavior proof",
97
- "methodOrInterface": "public interface / caller flow / CLI / API / UI / trace replay / harness",
98
- "keyFields": [],
99
- "inputOutput": "",
100
- "failurePath": "The behavior is currently missing",
101
- "afkOrHitl": "AFK",
102
- "doNotRedecide": [
103
- "target behavior",
104
- "public seam",
105
- "key fields",
106
- "allowed mock boundary"
107
- ],
108
- "artifactUpdates": [
109
- "src/feature/feature.test.ts"
110
- ]
111
- },
112
- "parallel": false,
113
- "dependsOn": [],
114
- "touches": [
115
- "tests",
116
- "requirement-behavior"
117
- ],
118
- "files": [
119
- "src/feature/feature.test.ts"
120
- ],
121
- "run": [
122
- "npm test -- src/feature/feature.test.ts"
123
- ],
124
- "acceptance": [
125
- "The target behavior is reproduced as a failing test",
126
- "The failure message points to the missing requirement behavior"
127
- ],
128
- "verification": [
129
- "npm test -- src/feature/feature.test.ts"
130
- ],
131
- "evidence": [
132
- "Failing test output"
133
- ],
134
- "context": {
135
- "readFiles": [
136
- "design.md",
137
- "tasks.md",
138
- "change-meta.json"
139
- ],
140
- "commands": [
141
- "npm test -- src/feature/feature.test.ts"
142
- ],
143
- "notes": [
144
- "Write the failing test first",
145
- "Do not change unrelated contracts in this task",
146
- "Do not generate execution context.md, checkpoint.json, review markdown, or AI-written process files"
147
- ]
148
- },
149
- "reviews": {
150
- "spec": "pending",
151
- "code": "pending"
152
- },
153
- "status": "pending",
154
- "tddPhase": "red",
155
- "verticalSlice": "Slice 1",
156
- "testSeam": {
157
- "entry": "public interface / caller flow / CLI / API / UI / trace replay / harness",
158
- "behaviorAsserted": "The user or caller observable behavior that should exist",
159
- "specStyleTestName": "caller can observe the required behavior",
160
- "oneLogicalBehavior": true,
161
- "publicVerificationPath": "Read back through the same public interface or user-visible path",
162
- "implementationDetailRisk": "low"
163
- },
164
- "feedbackLoop": {
165
- "type": "automated-test",
166
- "determinism": "deterministic",
167
- "expectedFailure": "Fails because the target behavior is missing"
168
- },
169
- "checks": [],
170
- "attempts": 0,
171
- "maxRetries": 1
172
- }
173
- ],
174
- "metadata": {
175
- "source": "tasks.md",
176
- "generatedBy": "skill:cc-plan",
177
- "planVersion": 1
178
- }
179
- }
@@ -1,28 +0,0 @@
1
- {
2
- "changeId": "REQ-001",
3
- "requirementId": "REQ-001",
4
- "outputPolicy": {
5
- "documentLanguage": ""
6
- },
7
- "sourceRoadmap": {
8
- "itemId": "RM-001",
9
- "roadmapVersion": "roadmap.v1",
10
- "roadmapSkillVersion": "4.1.0"
11
- },
12
- "spec": {
13
- "primaryCapability": "cap-example",
14
- "secondaryCapabilities": [],
15
- "changeType": "update",
16
- "specFiles": [
17
- "devflow/specs/capabilities/cap-example.md"
18
- ],
19
- "expectedDelta": [
20
- "Describe the new truth the change should add or tighten"
21
- ],
22
- "affectedInvariants": [],
23
- "gapsClosed": [],
24
- "newGaps": [],
25
- "syncStatus": "planned",
26
- "notes": []
27
- }
28
- }
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -euo pipefail
4
-
5
- # ------------------------------------------------------------
6
- # 校验 spec / roadmap / change 链路是否断裂
7
- # ------------------------------------------------------------
8
-
9
- ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
10
- INDEX_FILE="$ROOT/devflow/specs/INDEX.md"
11
- CAP_DIR="$ROOT/devflow/specs/capabilities"
12
- FAILED=0
13
-
14
- if [[ ! -f "$INDEX_FILE" ]]; then
15
- echo "Missing devflow/specs/INDEX.md" >&2
16
- exit 1
17
- fi
18
-
19
- if [[ ! -d "$CAP_DIR" ]]; then
20
- echo "Missing devflow/specs/capabilities/" >&2
21
- exit 1
22
- fi
23
-
24
- while IFS= read -r capability; do
25
- [[ -z "$capability" ]] && continue
26
- if [[ ! -f "$CAP_DIR/$capability.md" ]]; then
27
- echo "Dangling capability in INDEX.md: $capability" >&2
28
- FAILED=1
29
- fi
30
- done < <(awk -F'|' '/^\|/ {id=$2; gsub(/^[[:space:]]+|[[:space:]]+$/, "", id); if (id != "" && id != "Capability ID" && id !~ /^-+$/) print id}' "$INDEX_FILE")
31
-
32
- while IFS= read -r meta; do
33
- primary="$(jq -r '.spec.primaryCapability // empty' "$meta" 2>/dev/null || true)"
34
- [[ -z "$primary" ]] && continue
35
- if [[ ! -f "$CAP_DIR/$primary.md" ]]; then
36
- echo "Dangling primary capability in ${meta#$ROOT/}: $primary" >&2
37
- FAILED=1
38
- fi
39
- done < <(find "$ROOT/devflow/changes" -maxdepth 2 -name change-meta.json -type f 2>/dev/null | sort)
40
-
41
- if [[ "$FAILED" -ne 0 ]]; then
42
- exit 1
43
- fi
44
-
45
- echo "Spec links are valid"
@@ -1,234 +0,0 @@
1
- # DESIGN
2
-
3
- ## Document Meta
4
-
5
- - Requirement version: `REQ-002.v2`
6
- - Design version: `design.v2`
7
- - CC-Plan skill version: `3.9.0`
8
- - Work branch: `REQ/002-bulk-invite-import`
9
- - Requirement ID: `REQ-002`
10
- - Design mode: `full-design`
11
- - Why not `tiny-design`: the feature crosses import parsing, invite rules, billing limits, duplicate handling, and audit logging
12
- - Design status: `in-review`
13
- - Source roadmap item: `RM-010`
14
- - Source roadmap version: `roadmap.v2`
15
- - Source roadmap skill version: `4.1.0`
16
- - Date: `2026-04-16`
17
- - Owner: `product-owner`
18
-
19
- ## Source Handoff
20
-
21
- - Source stage: `Stage 2`
22
- - Why now from roadmap: admin demand is real, but trust risks dominate the design
23
- - Inherited success signal: admins can predict every bulk invite outcome
24
- - Inherited kill signal: if semantics remain underspecified, stop execution and reopen planning
25
- - Inherited dependencies:
26
- - existing seat limit enforcement
27
- - current audit log contract
28
- - Inherited non-goals:
29
- - no background job redesign
30
- - no enterprise provisioning layer
31
- - Upstream evidence: support notes from larger teams
32
- - Assumptions to re-validate:
33
- - duplicate emails can be skipped safely
34
- - seat-limit failures can be partially accepted
35
-
36
- ## Requirement Snapshot
37
-
38
- - Raw ask: admins want to upload a CSV of emails instead of inviting people one by one
39
- - User: workspace admins onboarding 20-200 collaborators
40
- - Pain: manual invites are too slow and error-prone
41
- - Smallest viable wedge: a CSV upload that clearly predicts accepted, skipped, and rejected rows
42
- - Out of scope:
43
- - enterprise SCIM provisioning
44
- - background retry orchestration
45
-
46
- ## PRD-Grade Requirement Brief
47
-
48
- - Problem statement: admins onboarding larger teams spend too much time sending individual invites, and they cannot predict how duplicates, invalid rows, and seat limits will resolve in bulk.
49
- - Solution summary: admins upload a CSV and receive deterministic row outcomes before the invite flow can be trusted for execution.
50
- - Actors / personas:
51
- - workspace admin onboarding 20-200 collaborators
52
- - support operator explaining invite outcomes
53
- - Primary user stories:
54
-
55
- | ID | Actor | Wants | Benefit | Acceptance / evidence |
56
- |----|-------|-------|---------|-----------------------|
57
- | US-001 | Workspace admin | upload a CSV of invite emails | invite many collaborators without one-by-one entry | mixed valid rows produce visible accepted outcomes |
58
- | US-002 | Workspace admin | see duplicate, invalid, and over-limit row states | understand what happened without support help | every skipped or rejected row has a reason |
59
- | US-003 | Support operator | trust the audit trail for each row outcome | explain invite history consistently | audit entries match visible row outcomes |
60
-
61
- - Edge / recovery stories:
62
-
63
- | ID | Actor | Failure / boundary | Desired outcome | Acceptance / evidence |
64
- |----|-------|--------------------|-----------------|-----------------------|
65
- | US-EDGE-001 | Workspace admin | CSV contains duplicates and invalid emails | safe rows can proceed while bad rows are explained | rule matrix covers duplicate and invalid cases |
66
- | US-EDGE-002 | Workspace admin | upload exceeds seat limits | over-limit rows are rejected consistently | billing-seat tests match UI summary |
67
-
68
- - Implementation decisions:
69
- - Freeze one row-outcome matrix before execution resumes.
70
- - Reuse the existing invite engine, billing seat checks, and audit log contract.
71
- - Keep enterprise provisioning and background retry orchestration outside this requirement.
72
- - Testing decisions:
73
- - Test row semantics through bulk-import rules and the admin upload flow.
74
- - Verify audit mapping against visible row outcomes.
75
- - Use existing invite and admin panel tests as prior art.
76
- - Out of scope:
77
- - enterprise SCIM provisioning
78
- - background job redesign
79
- - rollback wizard for partial success
80
- - Further notes:
81
- - This design remains blocked until duplicate and seat-limit semantics are approved.
82
-
83
- ## Success Criteria
84
-
85
- - Observable success signals:
86
- - admin sees deterministic results for each CSV row
87
- - duplicate, over-limit, and invalid rows are explained consistently
88
- - Business / operator success signals:
89
- - support no longer manually explains bulk invite outcomes
90
- - Abort signals:
91
- - billing-seat or audit outcomes differ from the documented plan
92
-
93
- ## Options Considered
94
-
95
- ### Option A
96
-
97
- - Shape: front-end-only CSV parsing with best-effort invite submission
98
- - Reuses: existing single-invite API
99
- - Pros: fast to prototype
100
- - Cons: semantics depend on hidden backend edge cases
101
- - Risks: partial success becomes impossible to explain
102
-
103
- ### Option B
104
-
105
- - Shape: freeze a rule matrix first, then implement import around it
106
- - Reuses: existing invite engine, but with explicit row-state mapping
107
- - Pros: makes billing, duplicate, and audit behavior reviewable
108
- - Cons: more upfront planning
109
- - Risks: may expose a need for additional shared contracts
110
-
111
- ## Approved Direction
112
-
113
- - Approved option: `Option B`
114
- - Why this is the best trade-off now: the import UX is not trustworthy until row outcomes and seat limits are explicitly modeled
115
- - Why not the other options now: best-effort submission would let implementation invent semantics during execution
116
- - What we explicitly rejected: a UI-only CSV uploader that guesses row behavior
117
- - Frozen decisions:
118
- - bulk import must classify each row into accepted, skipped, or rejected
119
- - seat-limit failures cannot silently pass
120
- - audit log entries must match the visible row outcome
121
- - Deferred questions:
122
- - whether partial success needs an explicit rollback option
123
-
124
- ## AI Leverage Decision Lens
125
-
126
- - Real user / operator: workspace admin onboarding larger teams
127
- - Status quo workaround: paste invite emails one by one or track them in spreadsheets
128
- - Human-team effort for full scope: multiple weeks across product, engineering, billing, and support review
129
- - CC / agent effort for full scope: several hours once row semantics are approved, but unbounded before that
130
- - AI compression ratio: high after semantics freeze, low while the product contract is ambiguous
131
- - Complete-lake boundary: row classification, admin upload flow, billing-seat checks, and audit mapping after rule approval
132
- - Ocean boundary: SCIM, background retries, rollback wizard, and unspecified billing semantics
133
- - Scope recommendation: `sharp-wedge`
134
- - Cost model: medium agent time after rule approval, high human review time until semantics are approved, high failure cost if billing or audit outcomes drift
135
- - Verdict: `sharp-wedge`
136
- - Missing evidence or pivot reason: none at plan approval; cc-check later reopened duplicate, invalid-row, partial-success, and seat-limit semantics before retry or cc-act
137
-
138
- ## External Best-Practice Validation
139
-
140
- - Needed: Yes
141
- - Decision status: declined
142
- - Decision question: `D2`
143
- - Privacy guard: generalized terms only; no project names, private requirements, customer names, secrets, logs, or proprietary concepts
144
- - Generalized search terms:
145
- - `bulk invite CSV import validation best practices`
146
- - Sources checked:
147
- - Conventional wisdom:
148
- - Current discourse:
149
- - Repo-fit verdict: skipped
150
- - Changes to options / tasks:
151
- - keep the design blocked until row-outcome semantics are approved from internal evidence
152
- - Skipped reason: user kept the example repo-local for the blocked design
153
-
154
- ## Decision Questions
155
-
156
- | ID | Gate | Known evidence | Recommendation | User choice | Impact on `cc-do` | Status |
157
- |----|------|----------------|----------------|-------------|-------------------|--------|
158
- | D1 | approach-approval | Best-effort upload would let duplicate, invalid, and seat-limit semantics drift during execution | Choose Option B and freeze a rule matrix first | Option B | Keep execution blocked until row outcomes are modeled | answered |
159
- | D2 | external-best-practice | Bulk CSV import semantics could benefit from generalized external practice, but this example stays repo-local | Stay repo-local for this blocked example | Stay repo-local | `cc-do` still must not start implementation until row outcomes are answered from internal evidence | answered |
160
- | D3 | review-blocker | Duplicate and seat-limit outcomes are still not explicit enough for final requirement proof | Answer the row-outcome matrix before retry or cc-act | pending | `cc-do` retry and `cc-act` must stay blocked until this is answered | asked |
161
-
162
- ## Design
163
-
164
- - Modules touched:
165
- - admin invite UI
166
- - invite validation rules
167
- - billing / seat limit decision points
168
- - audit log mapping
169
- - Data flow:
170
- - CSV parse -> row validation -> invite decision -> row result summary -> audit log write
171
- - Contracts:
172
- - one rule matrix for duplicate, invalid, over-limit, and existing-member rows
173
- - Error handling:
174
- - every rejected row must expose a user-readable reason
175
- - Rollout / migration:
176
- - release only after rule matrix and verification plan are both approved
177
-
178
- ## File Plan
179
-
180
- | File | Change | Reason |
181
- |------|--------|--------|
182
- | `src/admin/BulkInvitePanel.tsx` | update | upload and result display |
183
- | `src/admin/BulkInvitePanel.test.tsx` | update | row-state behavior tests |
184
- | `src/invite/bulk-import.ts` | add | import rule orchestration |
185
- | `src/invite/bulk-import.test.ts` | add | duplicate / seat / invalid cases |
186
- | `src/audit/invite-log.ts` | update | audit consistency |
187
-
188
- ## Validation Strategy
189
-
190
- - Unit: rule matrix tests for each row outcome
191
- - Integration: admin upload flow covering duplicates and seat-limit failures
192
- - Manual: CSV import with mixed valid and invalid rows
193
- - Observability / evidence: row summary and audit log must agree
194
-
195
- ## Risks
196
-
197
- | Risk | Impact | Mitigation |
198
- |------|--------|------------|
199
- | duplicate handling is underspecified | high | freeze explicit rule matrix before continuing |
200
- | audit and visible row summary diverge | high | verify audit mapping in integration review |
201
-
202
- ## Review Gate
203
-
204
- - Placeholder scan: pass
205
- - Consistency scan: fail; current implementation evidence still assumes some row outcomes not frozen here
206
- - Scope scan: pass
207
- - Ambiguity scan: blocked; duplicate + seat-limit semantics still need sharper wording
208
- - Feasibility scan: pass
209
- - Source alignment: pass; roadmap still prioritizes trust over speed
210
- - PRD brief scan: pass for actors and stories; blocked on duplicate and seat-limit semantics
211
- - AI Leverage Decision Lens scan: pass at plan approval as a sharp wedge; cc-check later blocked final proof because product semantics were still unbounded evidence risk
212
- - External best-practice scan: pass; declined and recorded before task generation
213
- - Decision question scan: blocked; `D3` is still unanswered
214
- - UI / interaction review summary: result states are acceptable if semantics are frozen first
215
- - DX review summary: execution still needs a single row-outcome matrix
216
- - Auto-decided items:
217
- - CSV upload stays inside admin settings
218
- - Taste decisions:
219
- - show result rows directly after parse instead of a second confirmation wizard
220
- - User challenges:
221
- - can admins predict partial failure without reading documentation?
222
- - Recommendation: do not declare this design complete until the row-outcome matrix is explicit
223
-
224
- ## Approval
225
-
226
- - User approval status: `in-review`
227
- - Follow-up changes after review:
228
- - add a rule matrix section before execution resumes
229
-
230
- ## First-Read Test
231
-
232
- - 10 秒内能看出这次为什么不是 `tiny-design`
233
- - 10 秒内能看出批准方案和被拒方案的边界
234
- - `cc-do` 是否还能被迫二次设计;这里答案仍然是“会”,所以设计还不能诚实闭环