@gordon.gan/specflow 1.7.0-beta → 1.8.0-alpha
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 +4 -4
- package/dist/cli/commands/document-run.d.ts +84 -0
- package/dist/cli/commands/document-run.js +539 -0
- package/dist/cli/index.js +2 -2
- package/dist/core/artifact-language.js +11 -1
- package/dist/core/document/chapters.d.ts +6 -0
- package/dist/core/document/chapters.js +21 -0
- package/dist/core/document/coverage.d.ts +25 -0
- package/dist/core/document/coverage.js +49 -0
- package/dist/core/document/digests.d.ts +41 -0
- package/dist/core/document/digests.js +136 -0
- package/dist/core/document/engine.d.ts +92 -0
- package/dist/core/document/engine.js +487 -0
- package/dist/core/{approval → document}/forbidden-patterns.d.ts +4 -2
- package/dist/core/document/forbidden-patterns.js +33 -0
- package/dist/core/document/gates.d.ts +27 -0
- package/dist/core/document/gates.js +33 -0
- package/dist/core/document/index.d.ts +7 -0
- package/dist/core/document/index.js +7 -0
- package/dist/core/document/input-digest.d.ts +55 -0
- package/dist/core/document/input-digest.js +121 -0
- package/dist/core/document/input-features.d.ts +24 -0
- package/dist/core/document/input-features.js +112 -0
- package/dist/core/document/lint.d.ts +22 -0
- package/dist/core/document/lint.js +29 -0
- package/dist/core/document/llm.d.ts +35 -0
- package/dist/core/document/llm.js +27 -0
- package/dist/core/document/map.d.ts +46 -0
- package/dist/core/document/map.js +212 -0
- package/dist/core/document/outline.d.ts +26 -0
- package/dist/core/document/outline.js +128 -0
- package/dist/core/document/paths.d.ts +23 -0
- package/dist/core/document/paths.js +31 -0
- package/dist/core/document/profile-validator.d.ts +23 -0
- package/dist/core/document/profile-validator.js +127 -0
- package/dist/core/document/profiles.d.ts +23 -0
- package/dist/core/document/profiles.js +69 -0
- package/dist/core/document/render.d.ts +19 -0
- package/dist/core/document/render.js +97 -0
- package/dist/core/document/review.d.ts +42 -0
- package/dist/core/document/review.js +157 -0
- package/dist/core/document/scene-detect.d.ts +25 -0
- package/dist/core/document/scene-detect.js +121 -0
- package/dist/core/document/schemas.d.ts +949 -0
- package/dist/core/document/schemas.js +158 -0
- package/dist/integrations/shared/capability-evidence.js +4 -8
- package/dist/integrations/shared/command-catalog.js +1 -1
- package/dist/integrations/shared/parity-manifest.js +4 -8
- package/package.json +1 -1
- package/prompts/apply/phase-a-plan.md +1 -1
- package/prompts/document/map/acceptance.md +8 -0
- package/prompts/document/map/api-design.md +17 -0
- package/prompts/document/map/architecture.md +7 -0
- package/prompts/document/map/closed-loop.md +8 -0
- package/prompts/document/map/compat-migration.md +8 -0
- package/prompts/document/map/config-runtime.md +8 -0
- package/prompts/document/map/core-logic.md +8 -0
- package/prompts/document/map/data-model.md +17 -0
- package/prompts/document/map/deploy.md +8 -0
- package/prompts/document/map/fix.md +7 -0
- package/prompts/document/map/goal.md +7 -0
- package/prompts/document/map/impact.md +7 -0
- package/prompts/document/map/implementability.md +8 -0
- package/prompts/document/map/mvp-boundary.md +7 -0
- package/prompts/document/map/non-goals.md +7 -0
- package/prompts/document/map/regression.md +7 -0
- package/prompts/document/map/reproduce.md +7 -0
- package/prompts/document/map/requirement.md +7 -0
- package/prompts/document/map/root-cause.md +7 -0
- package/prompts/document/map/signoff.md +8 -0
- package/prompts/document/map/tech-selection.md +17 -0
- package/prompts/document/map/test-strategy.md +7 -0
- package/prompts/document/map/ui-design.md +18 -0
- package/prompts/document/outline/general.md +37 -0
- package/prompts/document/review/ai-review.md +56 -0
- package/prompts/explore/explore-session.md +1 -1
- package/prompts/propose/design-draft.md +1 -1
- package/prompts/propose/proposal.md +1 -1
- package/prompts/propose/specs.md +1 -1
- package/prompts/propose/tasks-draft.md +1 -1
- package/prompts/refine/design-output.md +1 -1
- package/prompts/refine/update-artifacts.md +2 -0
- package/prompts/shared/artifact-language.md +13 -0
- package/skills/specflow-document/SKILL.md +124 -0
- package/templates/document/chapters/acceptance.yaml +16 -0
- package/templates/document/chapters/api-design.yaml +24 -0
- package/templates/document/chapters/architecture.yaml +18 -0
- package/templates/document/chapters/closed-loop.yaml +22 -0
- package/templates/document/chapters/compat-migration.yaml +17 -0
- package/templates/document/chapters/config-runtime.yaml +16 -0
- package/templates/document/chapters/core-logic.yaml +16 -0
- package/templates/document/chapters/data-model.yaml +25 -0
- package/templates/document/chapters/deploy.yaml +18 -0
- package/templates/document/chapters/fix.yaml +18 -0
- package/templates/document/chapters/goal.yaml +17 -0
- package/templates/document/chapters/impact.yaml +16 -0
- package/templates/document/chapters/implementability.yaml +22 -0
- package/templates/document/chapters/mvp-boundary.yaml +20 -0
- package/templates/document/chapters/non-goals.yaml +17 -0
- package/templates/document/chapters/regression.yaml +16 -0
- package/templates/document/chapters/reproduce.yaml +16 -0
- package/templates/document/chapters/requirement.yaml +18 -0
- package/templates/document/chapters/root-cause.yaml +18 -0
- package/templates/document/chapters/signoff.yaml +15 -0
- package/templates/document/chapters/tech-selection.yaml +20 -0
- package/templates/document/chapters/test-strategy.yaml +20 -0
- package/templates/document/chapters/ui-design.yaml +22 -0
- package/templates/document/profiles/0to1.yaml +12 -0
- package/templates/document/profiles/approve.yaml +22 -0
- package/templates/document/profiles/bugfix.yaml +10 -0
- package/templates/document/profiles/feature.yaml +11 -0
- package/dist/cli/commands/approval-assemble.d.ts +0 -64
- package/dist/cli/commands/approval-assemble.js +0 -408
- package/dist/core/approval/assemble.d.ts +0 -10
- package/dist/core/approval/assemble.js +0 -384
- package/dist/core/approval/bundle.d.ts +0 -9
- package/dist/core/approval/bundle.js +0 -172
- package/dist/core/approval/forbidden-patterns.js +0 -37
- package/dist/core/approval/index-schema.d.ts +0 -676
- package/dist/core/approval/index-schema.js +0 -193
- package/dist/core/approval/index.d.ts +0 -12
- package/dist/core/approval/index.js +0 -9
- package/dist/core/approval/lint.d.ts +0 -10
- package/dist/core/approval/lint.js +0 -302
- package/dist/core/approval/paths.d.ts +0 -13
- package/dist/core/approval/paths.js +0 -43
- package/dist/core/approval/pipeline.d.ts +0 -28
- package/dist/core/approval/pipeline.js +0 -146
- package/dist/core/approval/playbook-schema.d.ts +0 -182
- package/dist/core/approval/playbook-schema.js +0 -51
- package/dist/core/approval/render.d.ts +0 -20
- package/dist/core/approval/render.js +0 -210
- package/dist/core/approval/review-pack.d.ts +0 -26
- package/dist/core/approval/review-pack.js +0 -205
- package/dist/core/approval/types.d.ts +0 -223
- package/dist/core/approval/types.js +0 -1
- package/prompts/approval/acp-pipeline.md +0 -104
- package/prompts/approval/ai-review.md +0 -145
- package/prompts/approval/api-guidance.md +0 -179
- package/prompts/approval/database-guidance.md +0 -105
- package/prompts/approval/frontend-guidance.md +0 -249
- package/prompts/approval/generate.md +0 -1583
- package/prompts/approval/multi-repo-guidance.md +0 -238
- package/prompts/approval/project-conventions-guidance.md +0 -171
- package/prompts/approval/runtime-guidance.md +0 -64
- package/prompts/approval/segmented-generation.md +0 -157
- package/skills/specflow-approval/SKILL.md +0 -663
- package/templates/approval-index.yaml +0 -93
- package/templates/approval-part.md +0 -15
- package/templates/approval-playbook.yaml +0 -28
- package/templates/approval.md +0 -261
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Engine — zod schemas (data model)
|
|
3
|
+
*
|
|
4
|
+
* Source of truth for the Generic LongDoc Engine (design doc
|
|
5
|
+
* docs/GENERIC_LONGDOC_ENGINE_DESIGN.md §6.2, decisions 1–9).
|
|
6
|
+
*
|
|
7
|
+
* Layered source of truth:
|
|
8
|
+
* - Contract entities (interfaces/tables/decisions) → structured, zod-validated
|
|
9
|
+
* - Narrative content → controlled Markdown fragments
|
|
10
|
+
* - Outline is the two-pass core IR (replaces ACP index.yaml/parts_order)
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
// ============= Field-level contract primitives =============
|
|
14
|
+
export const FieldSchema = z.object({
|
|
15
|
+
name: z.string().min(1),
|
|
16
|
+
type: z.string().min(1),
|
|
17
|
+
required: z.boolean().default(false),
|
|
18
|
+
desc: z.string().optional(),
|
|
19
|
+
default: z.string().optional(),
|
|
20
|
+
});
|
|
21
|
+
export const ErrorSpecSchema = z.object({
|
|
22
|
+
condition: z.string().min(1),
|
|
23
|
+
status: z.string().min(1),
|
|
24
|
+
note: z.string().optional(),
|
|
25
|
+
});
|
|
26
|
+
// ============= Contract entities =============
|
|
27
|
+
export const InterfaceEntitySchema = z.object({
|
|
28
|
+
id: z.string().min(1), // stable id, e.g. "I1"
|
|
29
|
+
name: z.string().min(1), // e.g. "SubmitStepResult"
|
|
30
|
+
method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']),
|
|
31
|
+
path: z.string().min(1),
|
|
32
|
+
request_fields: z.array(FieldSchema).optional(),
|
|
33
|
+
response_fields: z.array(FieldSchema).optional(),
|
|
34
|
+
errors: z.array(ErrorSpecSchema).min(1), // G2: errors required
|
|
35
|
+
failure_examples: z.array(z.string()).min(1), // G2 hard gate
|
|
36
|
+
});
|
|
37
|
+
export const TableEntitySchema = z.object({
|
|
38
|
+
id: z.string().min(1), // stable id, e.g. "T1"
|
|
39
|
+
name: z.string().min(1),
|
|
40
|
+
ddl: z.string().min(1),
|
|
41
|
+
fields: z.array(FieldSchema).optional(),
|
|
42
|
+
migration: z.string().optional(), // G3: fill strategy
|
|
43
|
+
rollback: z.string().optional(), // G4: rollback compat
|
|
44
|
+
});
|
|
45
|
+
export const DecisionEntitySchema = z.object({
|
|
46
|
+
id: z.string().min(1), // e.g. "D1"
|
|
47
|
+
text: z.string().min(1),
|
|
48
|
+
});
|
|
49
|
+
export const EntitiesSchema = z.object({
|
|
50
|
+
interfaces: z.array(InterfaceEntitySchema).default([]),
|
|
51
|
+
tables: z.array(TableEntitySchema).default([]),
|
|
52
|
+
decisions: z.array(DecisionEntitySchema).default([]),
|
|
53
|
+
});
|
|
54
|
+
// ============= Outline (two-pass core IR, decision 6/8/9) =============
|
|
55
|
+
export const OutlinePointKindSchema = z.enum(['entity', 'narrative', 'mixed']);
|
|
56
|
+
export const OutlinePointSchema = z.object({
|
|
57
|
+
id: z.string().min(1),
|
|
58
|
+
text: z.string().min(1),
|
|
59
|
+
required: z.boolean().default(true),
|
|
60
|
+
kind: OutlinePointKindSchema.default('mixed'), // decision 9: coverage channel
|
|
61
|
+
references: z.array(z.string()).default([]), // decision 8: entity ids (full contract injection)
|
|
62
|
+
source_segments: z.array(z.string()).default([]), // decision 9: original input segment ids
|
|
63
|
+
});
|
|
64
|
+
export const OutlineChapterSchema = z.object({
|
|
65
|
+
id: z.string().min(1),
|
|
66
|
+
title: z.string().min(1),
|
|
67
|
+
points: z.array(OutlinePointSchema).min(1),
|
|
68
|
+
optional: z.boolean().default(false),
|
|
69
|
+
});
|
|
70
|
+
export const OutlineEntitySchema = z.object({
|
|
71
|
+
id: z.string().min(1),
|
|
72
|
+
frozen: z.string().min(1), // frozen name, must not drift
|
|
73
|
+
standalone: z.boolean().default(false), // decision 9: referenced by decisions only, no contract injection
|
|
74
|
+
});
|
|
75
|
+
export const FillOnceSchema = z.object({
|
|
76
|
+
enabled: z.boolean().default(false),
|
|
77
|
+
input_budget_tokens: z.number().int().positive().default(8000), // decision 9: exceed → fallback per-chapter
|
|
78
|
+
});
|
|
79
|
+
export const OutlineSchema = z.object({
|
|
80
|
+
profile: z.string().min(1),
|
|
81
|
+
chapters: z.array(OutlineChapterSchema).min(1), // order = render order
|
|
82
|
+
entities: z.array(OutlineEntitySchema).default([]),
|
|
83
|
+
decisions: z.array(z.string()).default([]),
|
|
84
|
+
fill_once: FillOnceSchema.optional(),
|
|
85
|
+
});
|
|
86
|
+
// ============= Constraint list (decision 8 · P1-D) =============
|
|
87
|
+
export const ConstraintItemKindSchema = z.enum(['entity', 'decision', 'point']);
|
|
88
|
+
export const ConstraintItemSchema = z.object({
|
|
89
|
+
kind: ConstraintItemKindSchema,
|
|
90
|
+
id: z.string().min(1),
|
|
91
|
+
label: z.string().min(1), // one-line label for digest prompt
|
|
92
|
+
});
|
|
93
|
+
// ============= Chapter component (reusable) =============
|
|
94
|
+
export const ChapterComponentSchema = z.object({
|
|
95
|
+
id: z.string().min(1),
|
|
96
|
+
title: z.string().min(1),
|
|
97
|
+
when: z.preprocess((v) => (v === null || v === '' ? undefined : v), z.string().optional()), // condition DSL: input.<feature> && / || / !
|
|
98
|
+
depends_on: z.array(z.string()).default([]),
|
|
99
|
+
outline_points: z.array(OutlinePointSchema).default([]), // candidate points (Pass 1 reference)
|
|
100
|
+
entities: z.record(z.any()).optional(), // chapter entity schema description
|
|
101
|
+
narratives: z.record(z.any()).optional(),
|
|
102
|
+
gates: z.array(z.string()).default([]),
|
|
103
|
+
map_prompt: z.string().optional(),
|
|
104
|
+
output_budget_tokens: z.number().int().positive().optional(), // per-chapter output cap
|
|
105
|
+
});
|
|
106
|
+
// ============= Scenario profile (three-way classification, decision 8 · P1-J) =============
|
|
107
|
+
export const ScenarioProfileSchema = z.object({
|
|
108
|
+
id: z.string().min(1),
|
|
109
|
+
name: z.string().min(1),
|
|
110
|
+
required: z.array(z.string()).min(1), // must be included by outline
|
|
111
|
+
optional_candidates: z.array(z.string()).default([]), // LLM may choose (subject to when)
|
|
112
|
+
forbidden: z.array(z.string()).default([]), // never appear in this scenario
|
|
113
|
+
shared: z.array(z.string()).default([]), // global chapters allowed in dependency closure
|
|
114
|
+
});
|
|
115
|
+
// ============= Review (decision 9 · target + max_rounds) =============
|
|
116
|
+
export const ReviewTargetSchema = z.enum(['entity', 'narrative', 'mixed']);
|
|
117
|
+
export const ReviewFindingSchema = z.object({
|
|
118
|
+
id: z.string().min(1),
|
|
119
|
+
severity: z.enum(['critical', 'important', 'minor']),
|
|
120
|
+
category: z.string().min(1),
|
|
121
|
+
message: z.string().min(1),
|
|
122
|
+
target: ReviewTargetSchema.default('narrative'), // decision 9: what to fix
|
|
123
|
+
chapter: z.string().optional(),
|
|
124
|
+
status: z.enum(['open', 'fixed', 'waived']).default('open'),
|
|
125
|
+
waiver_reason: z.string().optional(),
|
|
126
|
+
});
|
|
127
|
+
export const ReviewResultSchema = z.object({
|
|
128
|
+
schema: z.literal('specflow.document.review/v1'),
|
|
129
|
+
change: z.string().min(1),
|
|
130
|
+
reviewed_at: z.string().min(1),
|
|
131
|
+
reviewer: z.enum(['ai', 'human']).default('ai'),
|
|
132
|
+
verdict: z.enum(['pass', 'fail', 'pass_with_waivers']),
|
|
133
|
+
summary: z.string().optional(),
|
|
134
|
+
findings: z.array(ReviewFindingSchema).default([]),
|
|
135
|
+
part_hashes: z.array(z.object({ id: z.string(), sha256: z.string().min(64).max(64) })).default([]),
|
|
136
|
+
});
|
|
137
|
+
export function parseReviewResult(raw) {
|
|
138
|
+
return ReviewResultSchema.parse(raw);
|
|
139
|
+
}
|
|
140
|
+
// ============= Parsers =============
|
|
141
|
+
export function parseInterfaceEntity(raw) {
|
|
142
|
+
return InterfaceEntitySchema.parse(raw);
|
|
143
|
+
}
|
|
144
|
+
export function parseTableEntity(raw) {
|
|
145
|
+
return TableEntitySchema.parse(raw);
|
|
146
|
+
}
|
|
147
|
+
export function parseEntities(raw) {
|
|
148
|
+
return EntitiesSchema.parse(raw);
|
|
149
|
+
}
|
|
150
|
+
export function parseOutline(raw) {
|
|
151
|
+
return OutlineSchema.parse(raw);
|
|
152
|
+
}
|
|
153
|
+
export function parseChapterComponent(raw) {
|
|
154
|
+
return ChapterComponentSchema.parse(raw);
|
|
155
|
+
}
|
|
156
|
+
export function parseScenarioProfile(raw) {
|
|
157
|
+
return ScenarioProfileSchema.parse(raw);
|
|
158
|
+
}
|
|
@@ -7,13 +7,10 @@ const MARKER_RULES = [
|
|
|
7
7
|
{ id: 'sub.propose.first_iteration', skill: 'propose', includes: ['first-iteration deep-analysis pass'] },
|
|
8
8
|
{ id: 'sub.refine.multi_round', skill: 'refine', includes: ['auto-multi-round loop', '## LOOP (Stages 2-4)'] },
|
|
9
9
|
{ id: 'sub.refine.challenge_scope', skill: 'refine', includes: ['Challenge Behaviors #3 and #4', 'question scope'] },
|
|
10
|
-
{ id: 'sub.
|
|
11
|
-
{ id: 'sub.
|
|
12
|
-
{ id: 'sub.
|
|
13
|
-
{ id: 'sub.
|
|
14
|
-
{ id: 'sub.approval.design_quality', skill: 'approval', includes: ['Design Quality Assessment', 'Over-Engineering'] },
|
|
15
|
-
{ id: 'sub.approval.acp_finalize', skill: 'approval', includes: ['specflow approval finalize', 'Stage 12f'] },
|
|
16
|
-
{ id: 'sub.approval.ai_review', skill: 'approval', includes: ['12e AI Review', 'part_hashes'] },
|
|
10
|
+
{ id: 'sub.document.two_pass_outline', skill: 'document', includes: ['outline', 'Pass 1'] },
|
|
11
|
+
{ id: 'sub.document.fill_in_by_points', skill: 'document', includes: ['填空', '要点'] },
|
|
12
|
+
{ id: 'sub.document.contract_injection', skill: 'document', includes: ['契约注入', 'references'] },
|
|
13
|
+
{ id: 'sub.document.coverage_check', skill: 'document', includes: ['覆盖', 'coverage'] },
|
|
17
14
|
{ id: 'sub.apply.phase_a', skill: 'apply', includes: ['## Phase A: Task Rewrite'] },
|
|
18
15
|
{ id: 'sub.apply.phase_b', skill: 'apply', includes: ['## Phase B: Subagent TDD Execution'] },
|
|
19
16
|
{ id: 'sub.apply.gap_detection', skill: 'apply', includes: ['Gap Detection'] },
|
|
@@ -26,7 +23,6 @@ const MARKER_RULES = [
|
|
|
26
23
|
{ id: 'failure.explore.proposal_exists_redirect', skill: 'explore', includes: ['explore is too late', 'refine'] },
|
|
27
24
|
{ id: 'failure.propose.explore_draft_gate', skill: 'propose', includes: ['Status: draft', 'REFUSE to proceed'] },
|
|
28
25
|
{ id: 'failure.apply.phase_gate', skill: 'apply', includes: ['HARD GATE (prerequisite)', 'phase is not `refined`, REFUSE'] },
|
|
29
|
-
{ id: 'failure.approval.phase_gate', skill: 'approval', includes: ['phase must be `refined`', 'REFUSE to proceed'] },
|
|
30
26
|
{ id: 'failure.verify.explicit_skip_marker', skill: 'verify', includes: ['Pass 2: skipped (no baseline'] },
|
|
31
27
|
];
|
|
32
28
|
/**
|
|
@@ -2,7 +2,7 @@ export const COMMAND_CATALOG = [
|
|
|
2
2
|
{ id: 'explore', description: 'Think-before-propose exploration when requirements are fuzzy' },
|
|
3
3
|
{ id: 'propose', description: 'Create proposal and spec artifacts for a change' },
|
|
4
4
|
{ id: 'refine', description: 'Refine and iterate on spec artifacts' },
|
|
5
|
-
{ id: '
|
|
5
|
+
{ id: 'document', description: 'Generate scenario-based solution documents via the Generic LongDoc Engine' },
|
|
6
6
|
{ id: 'apply', description: 'Implement tasks from a change spec' },
|
|
7
7
|
{ id: 'review', description: 'Review code changes against spec' },
|
|
8
8
|
{ id: 'test', description: 'Run tests and verify coverage' },
|
|
@@ -13,13 +13,10 @@ export const CAPABILITY_MANIFEST = [
|
|
|
13
13
|
{ id: 'sub.propose.first_iteration', commandId: 'propose', level: 'sub-capability', required: true },
|
|
14
14
|
{ id: 'sub.refine.multi_round', commandId: 'refine', level: 'sub-capability', required: true },
|
|
15
15
|
{ id: 'sub.refine.challenge_scope', commandId: 'refine', level: 'sub-capability', required: true },
|
|
16
|
-
{ id: 'sub.
|
|
17
|
-
{ id: 'sub.
|
|
18
|
-
{ id: 'sub.
|
|
19
|
-
{ id: 'sub.
|
|
20
|
-
{ id: 'sub.approval.design_quality', commandId: 'approval', level: 'sub-capability', required: true },
|
|
21
|
-
{ id: 'sub.approval.acp_finalize', commandId: 'approval', level: 'sub-capability', required: true },
|
|
22
|
-
{ id: 'sub.approval.ai_review', commandId: 'approval', level: 'sub-capability', required: true },
|
|
16
|
+
{ id: 'sub.document.two_pass_outline', commandId: 'document', level: 'sub-capability', required: true },
|
|
17
|
+
{ id: 'sub.document.fill_in_by_points', commandId: 'document', level: 'sub-capability', required: true },
|
|
18
|
+
{ id: 'sub.document.contract_injection', commandId: 'document', level: 'sub-capability', required: true },
|
|
19
|
+
{ id: 'sub.document.coverage_check', commandId: 'document', level: 'sub-capability', required: true },
|
|
23
20
|
{ id: 'sub.apply.phase_a', commandId: 'apply', level: 'sub-capability', required: true },
|
|
24
21
|
{ id: 'sub.apply.phase_b', commandId: 'apply', level: 'sub-capability', required: true },
|
|
25
22
|
{ id: 'sub.apply.gap_detection', commandId: 'apply', level: 'sub-capability', required: true },
|
|
@@ -32,7 +29,6 @@ export const CAPABILITY_MANIFEST = [
|
|
|
32
29
|
{ id: 'failure.explore.proposal_exists_redirect', commandId: 'explore', level: 'failure-path', required: true },
|
|
33
30
|
{ id: 'failure.propose.explore_draft_gate', commandId: 'propose', level: 'failure-path', required: true },
|
|
34
31
|
{ id: 'failure.apply.phase_gate', commandId: 'apply', level: 'failure-path', required: true },
|
|
35
|
-
{ id: 'failure.approval.phase_gate', commandId: 'approval', level: 'failure-path', required: true },
|
|
36
32
|
{ id: 'failure.verify.explicit_skip_marker', commandId: 'verify', level: 'failure-path', required: true },
|
|
37
33
|
];
|
|
38
34
|
export const IDE_ASSET_MANIFEST = [
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
## Artifact Language
|
|
20
20
|
|
|
21
|
-
Before rewriting, resolve `artifacts.language` from the active planning root's `specflow/config.yaml` (see shared `artifact-language.md`). Rewrite **group titles and task description prose** in that language (`zh-CN` → Simplified Chinese; `en` → English). Keep file paths, commands, code blocks, symbols, and Verify command text unchanged. Do not switch business narrative to English when `zh-CN` is configured.
|
|
21
|
+
Before rewriting, resolve `artifacts.language` from the active planning root's `specflow/config.yaml` (see shared `artifact-language.md`). Rewrite **group titles and task description prose** in that language (`zh-CN` → Simplified Chinese; `en` → English). Keep file paths, commands, code blocks, symbols, and Verify command text unchanged. Do not switch business narrative to English when `zh-CN` is configured. zh-CN: 叙述简要;怎么做用 1. 2. 3.。
|
|
22
22
|
|
|
23
23
|
## Input Order
|
|
24
24
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 章节填充:acceptance
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
- 涉及项目规约/DB/API/前端约束时,遵循「项目约定 > SpecFlow guidance > LLM」优先级
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 章节填充:api-design(接口设计)
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
|
|
9
|
+
## 接口章节硬规则(借鉴 approval api-guidance)
|
|
10
|
+
|
|
11
|
+
1. **分层契约,禁止混层**:每个契约面对应一个独立 `In`(L2 Worker HTTP / L3 RPC+HTTP / L4 客户端 RPC),禁止「内部经 I7 一行代替 L4 详设」。
|
|
12
|
+
2. **RPC / 服务名冻结**:禁止「暂定 / 如 Xxx / 实现时命名」;给出冻结的 RPC 名 + proto 字段号 + http_path。
|
|
13
|
+
3. **proto 最小集**:新接口尽量给出可生成的 Proto 草案(rpc 名 / message / field 编号 / google.api.http)。
|
|
14
|
+
4. **G2 失败示例(强制)**:清单中每个接口(含「不变」)除成功示例外,必须 ≥1 组失败示例(参数校验失败/租约过期/未认证),附完整 HTTP 或等价示例。只有错误码表不合格。
|
|
15
|
+
5. **固定顺序**:元信息 → 请求体字段(或路径/Query/CLI flags)→ 请求示例 → 成功响应字段 → 响应示例(成功) → 响应示例(失败)(G2) → 错误表 →(可选)处理顺序。
|
|
16
|
+
6. **接口清单稳定编号**:`In` 稳定,供 §4.6 页面引用与跨章交叉引用。
|
|
17
|
+
7. **优先级**:项目约定 + 现网 OpenAPI/proto > SpecFlow 骨架 > LLM。
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:architecture
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 章节填充:closed-loop
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
- 涉及项目规约/DB/API/前端约束时,遵循「项目约定 > SpecFlow guidance > LLM」优先级
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 章节填充:compat-migration
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
- 涉及项目规约/DB/API/前端约束时,遵循「项目约定 > SpecFlow guidance > LLM」优先级
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 章节填充:config-runtime
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
- 涉及项目规约/DB/API/前端约束时,遵循「项目约定 > SpecFlow guidance > LLM」优先级
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 章节填充:core-logic
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
- 涉及项目规约/DB/API/前端约束时,遵循「项目约定 > SpecFlow guidance > LLM」优先级
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 章节填充:data-model(数据结构/数据模型变更)
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
|
|
9
|
+
## 数据章节硬规则(借鉴 approval database-guidance)
|
|
10
|
+
|
|
11
|
+
1. **先探测项目 DB 栈**:读项目规约 `conventions.database` + 现网 DDL/迁移文件,判断 MySQL/PostgreSQL/SQLite/Redis/ES 等。命中本地 guidance 则遵循,未命中 LLM fallback。
|
|
12
|
+
2. **总则必须写明**:数据库迁移、新建表、增删列、新增索引、DDL 来源、项目约定(路径或「未发现」)。
|
|
13
|
+
3. **每张表必须**:完整 CREATE TABLE(含 ENGINE/CHARSET/索引)+ 字段说明(类型/本迭代用法)。
|
|
14
|
+
4. **G3 存量填充**:JSON 形状变更或新增列时必须写存量默认值填充策略(回填 SQL/读时默认值/禁止空读/上线顺序)。
|
|
15
|
+
5. **G4 回滚兼容**:回滚后旧版本能否安全跳过/忽略新数据?写明机制(omitempty/忽略未知键/version 分派)。禁止只写「回滚应用」。
|
|
16
|
+
6. **零 DDL 迭代**:仍须展示现网 DDL,禁止假装「不涉及数据库」。
|
|
17
|
+
7. **优先级**:项目约定 > SpecFlow guidance > LLM。项目禁令(如「本迭代禁止迁移」)不得被通用规则覆盖。
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 章节填充:deploy
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
- 涉及项目规约/DB/API/前端约束时,遵循「项目约定 > SpecFlow guidance > LLM」优先级
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:fix
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:goal
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:impact
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 章节填充:implementability
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
- 涉及项目规约/DB/API/前端约束时,遵循「项目约定 > SpecFlow guidance > LLM」优先级
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:mvp-boundary
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:non-goals
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:regression
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:reproduce
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:requirement
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:root-cause
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 章节填充:signoff
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
- 涉及项目规约/DB/API/前端约束时,遵循「项目约定 > SpecFlow guidance > LLM」优先级
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 章节填充:tech-selection(技术方案评估)
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
|
|
9
|
+
## 技术评估章节硬规则(借鉴 approval 技术方案评估)
|
|
10
|
+
|
|
11
|
+
1. **选型五元组表格**:方向/选定方案/备选/选择理由/来源——前端、后端、数据库与缓存、基础设施至少四行。禁止只写「用 React」。
|
|
12
|
+
2. **决策评审表**:每个关键决策给 决策/选定方案/备选方案/理由/影响评估/状态。来源=用户确认优先;绿场缺选型时强制。
|
|
13
|
+
3. **风险与权衡**:列出技术风险(复杂度/依赖/性能/成本),给缓解措施或接受理由。
|
|
14
|
+
4. **目标与非目标**:明确本章方案的 Goals 与 Non-Goals(不做什么)。
|
|
15
|
+
5. **现状与约束**:用可读中文归纳现状与硬约束(含「本迭代禁止…」类红线);禁止代码腔堆砌。
|
|
16
|
+
6. **设计质量评估**:检查过度设计(YAGNI)——是否合理扩展性 vs 不必要的复杂度。
|
|
17
|
+
7. **优先级**:项目约定 + 用户确认 > SpecFlow guidance > LLM。
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 章节填充:test-strategy
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 章节填充:ui-design(前端/UI 设计)
|
|
2
|
+
|
|
3
|
+
你是方案文档撰写员。按大纲要点"填空题"式展开本章,逐要点填充,不自由发挥。
|
|
4
|
+
- kind=entity|mixed 的要点 → 产出结构化契约实体(JSON 块 ```json {"entities": {...}} ```)
|
|
5
|
+
- kind=narrative|mixed 的要点 → 产出叙述 Markdown
|
|
6
|
+
- 遵循 prompts/shared/artifact-language.md 的中文叙述规范(简要;怎么做用 1. 2. 3.)
|
|
7
|
+
- 禁止 stub(TODO/待补充/此处省略);禁止含糊词
|
|
8
|
+
|
|
9
|
+
## 前端章节硬规则(借鉴 approval frontend-guidance)
|
|
10
|
+
|
|
11
|
+
1. **总则必须写明**:Surface、Framework、Styling/设计系统、State、UI kit、FE testing、本迭代页面、项目约定(路径或「未发现」)、IDE skills/rules(路径或「未发现」)、**本迭代不选/不适用(至少 1 条)**、本迭代不涉及。
|
|
12
|
+
2. **G5 页面/路由清单**:必须给出本迭代页面/路由清单 + 栈五元组。禁止只写「用 React」。
|
|
13
|
+
3. **G6 空态/加载/错误**:每个关键 `Page · <短名>` 必须写清空态、加载、错误三项(文案或行为),并标明依赖的接口编号。成功态/无权限按需。
|
|
14
|
+
4. **每页填空表**:目的/路由/组件树/依赖接口/字段级状态/请求时机/五态/边界。
|
|
15
|
+
5. **交互状态机**:仅复杂交互页(多步表单/向导/可逆流程)用 stateDiagram-v2;简单页写「不涉及」。
|
|
16
|
+
6. **IDE skills/rules 扫描**:读 `.cursor` / `.claude` / `.agents` 下与组件/状态/表单/测试/a11y/样式相关的 rules 与 skills,落地到页面设计(解析路径后 Read,禁止 invoke skill)。
|
|
17
|
+
7. **性能/XSS/埋点**:仅 design 或项目约定点名时才写,否则省略。
|
|
18
|
+
8. **优先级**:项目约定 + IDE 落地文档 > SpecFlow 骨架 > LLM。
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Outline 生成(Pass 1)— 通用
|
|
2
|
+
|
|
3
|
+
你是文档大纲设计专家。基于【全局输入摘要】与【场景 Profile 约束】,生成一份结构化的文档大纲。
|
|
4
|
+
|
|
5
|
+
## 输入
|
|
6
|
+
- 全局输入摘要(含各段 id 与实体候选)
|
|
7
|
+
- 场景 Profile:必选章 / 候选章(含 when 条件)/ 禁止章
|
|
8
|
+
|
|
9
|
+
## 输出(JSON,符合 outline schema)
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"profile": "<profile-id>",
|
|
13
|
+
"chapters": [
|
|
14
|
+
{
|
|
15
|
+
"id": "<chapter-id>",
|
|
16
|
+
"title": "<章节标题>",
|
|
17
|
+
"optional": false,
|
|
18
|
+
"points": [
|
|
19
|
+
{ "id": "P1", "text": "要点描述", "required": true, "kind": "mixed", "references": ["I1"], "source_segments": ["seg-design-01"] }
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"entities": [
|
|
24
|
+
{ "id": "I1", "frozen": "scheduler.SubmitStepResult", "standalone": false }
|
|
25
|
+
],
|
|
26
|
+
"decisions": ["D1", "D2"]
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 硬规则
|
|
31
|
+
1. **章节约束**:必选章全含;候选章按 when 条件与输入取舍;禁止章绝不出现。
|
|
32
|
+
2. **要点 kind**:引用了实体的要点 → `mixed` 或 `entity`;纯论述 → `narrative`。有 `references` 时 kind 不能是 `narrative`。
|
|
33
|
+
3. **references**:要点引用的实体 id 必须在 `entities` 注册表里。
|
|
34
|
+
4. **实体完整性**:注册表里每个实体必须被至少一个要点 `references` 引用(除非 `standalone: true`,仅供全局决策引用)。
|
|
35
|
+
5. **source_segments**:要点尽量标注来源段 id(来自全局摘要的段 id)。
|
|
36
|
+
6. **每要点引用 ≤3 个实体**。
|
|
37
|
+
7. **要点数量**:每章 2-5 个要点,覆盖该章必须覆盖的维度。
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# AI Review(Pass 3)— 通用长文档审查
|
|
2
|
+
|
|
3
|
+
你是独立审查者,审查一份**分片生成**的方案文档。你与生成者是分离的——以"挑错"为目标,不替生成者辩护。
|
|
4
|
+
|
|
5
|
+
## 输入
|
|
6
|
+
- 大纲(outline.yaml)
|
|
7
|
+
- 各章填充(chapters/*.md)
|
|
8
|
+
- 契约实体(entities.json)
|
|
9
|
+
- 依赖摘要与约束清单
|
|
10
|
+
|
|
11
|
+
## 审查维度(R1–R14)
|
|
12
|
+
- R1 跨章命名:同一实体在 § 各章/大纲/实体区用同一规范名,无「暂定/实现时」
|
|
13
|
+
- R2 决策落地:大纲 decisions 每项在对应章有具体行为
|
|
14
|
+
- R3 实体↔正文:大纲实体注册表每个实体有实质内容;无孤儿实体
|
|
15
|
+
- R4 深度均衡:同批/同依赖链的章节深度可比,无「一章详、一章 stub」
|
|
16
|
+
- R5 交叉引用:引用用稳定 id(P*/I*/T*),目标存在
|
|
17
|
+
- R6 图文一致:时序/流程图与相邻正文一致
|
|
18
|
+
- R7 契约完整:listed 接口/表满足字段/成功/失败示例/错误表
|
|
19
|
+
- R8 枚举闭合:status/enum 集合明确闭合,无「等」
|
|
20
|
+
- R9 分支闭合:提到的重试/取消/超时/回滚路径有结论或 [待 refine 澄清]
|
|
21
|
+
- R10 UI↔API 对齐:uiInScope 时 §UI 字段与接口对齐;空态/加载/错误齐
|
|
22
|
+
- R11 多场景一致:各 Profile 章节覆盖与该场景匹配
|
|
23
|
+
- R12 stub 清除:无 TODO/待补充/仅占位
|
|
24
|
+
- R13 结论一致:可实施性/就绪结论与章节深度匹配
|
|
25
|
+
- R14 大纲要点覆盖:每个 kind=narrative|mixed 要点对应小节存在且有实质内容(非 stub)
|
|
26
|
+
|
|
27
|
+
## 输出(JSON,符合 review-result schema)
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"schema": "specflow.document.review/v1",
|
|
31
|
+
"change": "<id>",
|
|
32
|
+
"reviewed_at": "<iso>",
|
|
33
|
+
"reviewer": "ai",
|
|
34
|
+
"verdict": "pass | fail | pass_with_waivers",
|
|
35
|
+
"summary": "发现与修复概况",
|
|
36
|
+
"findings": [
|
|
37
|
+
{
|
|
38
|
+
"id": "F1",
|
|
39
|
+
"severity": "critical | important | minor",
|
|
40
|
+
"category": "cross_part_naming",
|
|
41
|
+
"message": "I3 在 §2 与 04.5 命名不一致",
|
|
42
|
+
"target": "entity | narrative | mixed",
|
|
43
|
+
"chapter": "api-design",
|
|
44
|
+
"status": "open | fixed | waived",
|
|
45
|
+
"waiver_reason": "仅 minor 可 waived,必须写明理由"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"part_hashes": [{ "id": "api-design", "sha256": "<sha256>" }]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 规则
|
|
53
|
+
1. critical/important 必须 fixed 或升级人工;只有 minor 可 waived(须 waiver_reason)
|
|
54
|
+
2. findings 每条带 target(decision 9):entity → 改 entities.json;narrative → 改 chapters/<id>.md;mixed → 两者
|
|
55
|
+
3. part_hashes 为修复后各章 sha256(供防篡改校验)
|
|
56
|
+
4. verdict:全 fixed → pass;仅 minor waived → pass_with_waivers;任一 critical/important open → fail
|
|
@@ -84,7 +84,7 @@ If exploration reveals the idea is not worth building, say so — that is a vali
|
|
|
84
84
|
|
|
85
85
|
### Step 5 — Draft explore.md
|
|
86
86
|
|
|
87
|
-
Load the scaffold from `.claude/specflow/templates/explore.md` and write `specflow/changes/<name>/explore.md` using the exact sections below.
|
|
87
|
+
Load the scaffold from `.claude/specflow/templates/explore.md` and write `specflow/changes/<name>/explore.md` using the exact sections below. Follow `prompts/shared/artifact-language.md`. zh-CN: 叙述简要;怎么做用 1. 2. 3.。
|
|
88
88
|
|
|
89
89
|
### Step 6 — Gate: Direction confirmation (HARD GATE)
|
|
90
90
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Generate a substantive `design.md` representing your **first round of deep thinking** on this change. This is v1 of the design — refine will produce v2 by challenging assumptions, proposing alternative options, probing edge cases, and questioning scope. Your job here is to give refine something real to work with.
|
|
8
8
|
|
|
9
|
-
**Narrative language:** Follow the resolved `artifacts.language` for Context, Goals / Non-Goals, Decisions, Risks, and Open Questions. Keep paths, commands, code, symbols, and technical identifiers unchanged.
|
|
9
|
+
**Narrative language:** Follow the resolved `artifacts.language` for Context, Goals / Non-Goals, Decisions, Risks, and Open Questions. Keep paths, commands, code, symbols, and technical identifiers unchanged. zh-CN: 叙述简要;怎么做用 1. 2. 3.(见 `artifact-language.md`)。
|
|
10
10
|
|
|
11
11
|
## Inputs You Must Read
|
|
12
12
|
|