@captain_z/zsk 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +24 -32
  2. package/dist/bin.js +6 -4
  3. package/dist/bin.js.map +1 -1
  4. package/dist/commands/check.d.ts +1 -0
  5. package/dist/commands/check.js +188 -11
  6. package/dist/commands/check.js.map +1 -1
  7. package/dist/commands/config.js +1 -1
  8. package/dist/commands/config.js.map +1 -1
  9. package/dist/commands/demo.d.ts +1 -0
  10. package/dist/commands/demo.js +341 -36
  11. package/dist/commands/demo.js.map +1 -1
  12. package/dist/commands/issue.js +5 -5
  13. package/dist/commands/issue.js.map +1 -1
  14. package/dist/commands/module.js +11 -28
  15. package/dist/commands/module.js.map +1 -1
  16. package/dist/commands/prep.js +3 -3
  17. package/dist/commands/prep.js.map +1 -1
  18. package/dist/commands/project-init.js +60 -10
  19. package/dist/commands/project-init.js.map +1 -1
  20. package/dist/core/config.d.ts +13 -2
  21. package/dist/core/config.js +64 -11
  22. package/dist/core/config.js.map +1 -1
  23. package/dist/core/scaffolder.js +5 -2
  24. package/dist/core/scaffolder.js.map +1 -1
  25. package/dist/core/workspace-layout.d.ts +54 -0
  26. package/dist/core/workspace-layout.js +107 -0
  27. package/dist/core/workspace-layout.js.map +1 -0
  28. package/package.json +2 -2
  29. package/schemas/zsk-config.schema.json +25 -4
  30. package/templates/issue/default/issue.md +5 -5
  31. package/templates/module/frontend-module/module.yaml +4 -3
  32. package/templates/module/frontend-module/tasks.md +2 -2
  33. package/templates/project-init/.zsk/config.yaml +34 -24
  34. package/templates/project-init/.zsk/docs/PROJECT-CONFIG.md +39 -0
  35. package/templates/project-init/.zsk/docs/SYSTEM-SPEC.md +27 -0
  36. package/templates/project-init/{.issues → .zsk/issues}/README.md +19 -18
  37. package/templates/project-init/.zsk/issues/_taxonomy.md +35 -0
  38. package/templates/project-init/.zsk/modules/.gitkeep +1 -0
  39. package/templates/project-init/.zsk/plans/.gitkeep +1 -0
  40. package/templates/project-init/.zsk/playwright/.gitkeep +1 -0
  41. package/templates/project-init/.zsk/resources/.gitkeep +1 -0
  42. package/templates/module/frontend-module/acceptance.md +0 -18
  43. package/templates/module/frontend-module/archive.md +0 -17
  44. package/templates/module/frontend-module/commit.md +0 -15
  45. package/templates/module/frontend-module/demo-outline.md +0 -59
  46. package/templates/module/frontend-module/demo-report.md +0 -23
  47. package/templates/module/frontend-module/deploy.md +0 -18
  48. package/templates/module/frontend-module/ready.md +0 -12
  49. package/templates/module/frontend-module/review.md +0 -12
  50. package/templates/module/frontend-module/scenarios/index.md +0 -21
  51. package/templates/module/frontend-module/scenarios/p0-happy-path.spec.ts +0 -13
  52. package/templates/module/frontend-module/smoke.md +0 -21
  53. package/templates/module/frontend-module/verification.md +0 -6
  54. package/templates/module/frontend-module/verify.md +0 -12
  55. package/templates/project-init/.issues/_taxonomy.md +0 -35
  56. package/templates/project-init/.raws/README.md +0 -27
  57. package/templates/project-init/.raws/api-contracts/index.md +0 -22
  58. package/templates/project-init/.raws/backend-repositories/index.md +0 -12
  59. package/templates/project-init/.raws/design-assets/index.md +0 -25
  60. package/templates/project-init/.raws/design-sources/index.md +0 -24
  61. package/templates/project-init/.raws/index.md +0 -56
  62. package/templates/project-init/.raws/issues/index.md +0 -4
  63. package/templates/project-init/.raws/manifest.json +0 -4
  64. package/templates/project-init/.raws/requirements/index.md +0 -23
  65. package/templates/project-init/.raws/testing/index.md +0 -22
  66. package/templates/project-init/.zsk/checkpoints/index.md +0 -4
  67. package/templates/project-init/.zsk/learning/index.md +0 -14
  68. package/templates/project-init/.zsk/resource-manifest.json +0 -55
  69. package/templates/project-init/.zsk/workflow-state.json +0 -6
  70. package/templates/project-init/docs/SYSTEM-SPEC.md +0 -53
  71. package/templates/project-init/docs/_module-index.md +0 -15
  72. package/templates/project-init/project-config.md +0 -154
  73. /package/templates/project-init/.zsk/{learning/proposals → evidence}/.gitkeep +0 -0
  74. /package/templates/project-init/{.issues → .zsk/issues}/index.md +0 -0
@@ -0,0 +1,54 @@
1
+ export declare const WORKSPACE_LAYOUT_VERSION = 2;
2
+ export declare const DEFAULT_WORKSPACE_PATHS: {
3
+ readonly docs: ".zsk/docs";
4
+ readonly modules: ".zsk/modules";
5
+ readonly resources: ".zsk/resources";
6
+ readonly issues: ".zsk/issues";
7
+ readonly evidence: ".zsk/evidence";
8
+ readonly playwright: ".zsk/playwright";
9
+ readonly plans: ".zsk/plans";
10
+ };
11
+ export type WorkspaceLayoutConfig = {
12
+ paths?: {
13
+ docs?: string;
14
+ modules?: string;
15
+ resources?: string;
16
+ issues?: string;
17
+ evidence?: string;
18
+ playwright?: string;
19
+ plans?: string;
20
+ raws?: string;
21
+ };
22
+ modules?: {
23
+ index?: string;
24
+ root?: string;
25
+ };
26
+ automation?: {
27
+ demo?: {
28
+ evidenceDir?: string;
29
+ scenarioDir?: string;
30
+ bridge?: {
31
+ planFile?: string;
32
+ executionFile?: string;
33
+ };
34
+ };
35
+ };
36
+ };
37
+ export type WorkspaceLayout = {
38
+ version: number;
39
+ docsRoot: string;
40
+ modulesRoot: string;
41
+ resourcesRoot: string;
42
+ issuesRoot: string;
43
+ evidenceRoot: string;
44
+ playwrightRoot: string;
45
+ plansRoot: string;
46
+ };
47
+ export type WorkspacePathKind = "config" | "workflowState" | "mcpPlaywrightConfig" | "docsRoot" | "projectConfig" | "systemSpec" | "modulesRoot" | "moduleIndex" | "moduleRoot" | "moduleConfig" | "moduleRuns" | "resourcesRoot" | "resourcesTesting" | "resourcesManifest" | "issuesRoot" | "moduleIssues" | "evidenceRoot" | "moduleEvidence" | "demoEvidence" | "playwrightRoot" | "plansRoot" | "modulePlaywright" | "playwrightSpecs" | "playwrightTestPlans" | "playwrightAuth" | "playwrightAuthState" | "playwrightResults" | "playwrightReport" | "playwrightExecution" | "demoSessionCurrent" | "bridgeOperationPlan" | "bridgeExecution";
48
+ export type WorkspacePathOptions = {
49
+ module?: string;
50
+ };
51
+ export declare function resolveWorkspaceLayout(config?: WorkspaceLayoutConfig): WorkspaceLayout;
52
+ export declare function getWorkspacePath(config: WorkspaceLayoutConfig, kind: WorkspacePathKind, options?: WorkspacePathOptions): string;
53
+ export declare function resolveWorkspacePath(root: string, config: WorkspaceLayoutConfig, kind: WorkspacePathKind, options?: WorkspacePathOptions): string;
54
+ export declare function interpolateModulePath(value: string, moduleId: string): string;
@@ -0,0 +1,107 @@
1
+ import { isAbsolute, join, resolve } from "node:path";
2
+ export const WORKSPACE_LAYOUT_VERSION = 2;
3
+ export const DEFAULT_WORKSPACE_PATHS = {
4
+ docs: ".zsk/docs",
5
+ modules: ".zsk/modules",
6
+ resources: ".zsk/resources",
7
+ issues: ".zsk/issues",
8
+ evidence: ".zsk/evidence",
9
+ playwright: ".zsk/playwright",
10
+ plans: ".zsk/plans",
11
+ };
12
+ export function resolveWorkspaceLayout(config = {}) {
13
+ const paths = config.paths ?? {};
14
+ return {
15
+ version: WORKSPACE_LAYOUT_VERSION,
16
+ docsRoot: paths.docs ?? DEFAULT_WORKSPACE_PATHS.docs,
17
+ modulesRoot: paths.modules ?? config.modules?.root ?? DEFAULT_WORKSPACE_PATHS.modules,
18
+ resourcesRoot: paths.resources ?? paths.raws ?? DEFAULT_WORKSPACE_PATHS.resources,
19
+ issuesRoot: paths.issues ?? DEFAULT_WORKSPACE_PATHS.issues,
20
+ evidenceRoot: paths.evidence ?? DEFAULT_WORKSPACE_PATHS.evidence,
21
+ playwrightRoot: paths.playwright ?? DEFAULT_WORKSPACE_PATHS.playwright,
22
+ plansRoot: paths.plans ?? DEFAULT_WORKSPACE_PATHS.plans,
23
+ };
24
+ }
25
+ export function getWorkspacePath(config, kind, options = {}) {
26
+ const layout = resolveWorkspaceLayout(config);
27
+ const moduleId = options.module;
28
+ switch (kind) {
29
+ case "config":
30
+ return join(".zsk", "config.yaml");
31
+ case "workflowState":
32
+ return join(".zsk", "workflow-state.json");
33
+ case "mcpPlaywrightConfig":
34
+ return join(".zsk", "mcp", "playwright.json");
35
+ case "docsRoot":
36
+ return layout.docsRoot;
37
+ case "projectConfig":
38
+ return join(layout.docsRoot, "PROJECT-CONFIG.md");
39
+ case "systemSpec":
40
+ return join(layout.docsRoot, "SYSTEM-SPEC.md");
41
+ case "modulesRoot":
42
+ return layout.modulesRoot;
43
+ case "moduleIndex":
44
+ return config.modules?.index ?? join(layout.modulesRoot, "_module-index.md");
45
+ case "moduleRoot":
46
+ return join(layout.modulesRoot, requireModuleId(kind, moduleId));
47
+ case "moduleConfig":
48
+ return join(layout.modulesRoot, requireModuleId(kind, moduleId), "module.yaml");
49
+ case "moduleRuns":
50
+ return join(layout.modulesRoot, requireModuleId(kind, moduleId), "runs");
51
+ case "resourcesRoot":
52
+ return layout.resourcesRoot;
53
+ case "resourcesTesting":
54
+ return join(layout.resourcesRoot, "testing");
55
+ case "resourcesManifest":
56
+ return join(layout.resourcesRoot, "manifest.json");
57
+ case "issuesRoot":
58
+ return layout.issuesRoot;
59
+ case "moduleIssues":
60
+ return join(layout.issuesRoot, requireModuleId(kind, moduleId));
61
+ case "evidenceRoot":
62
+ return layout.evidenceRoot;
63
+ case "moduleEvidence":
64
+ return join(layout.evidenceRoot, requireModuleId(kind, moduleId));
65
+ case "demoEvidence":
66
+ return join(layout.evidenceRoot, requireModuleId(kind, moduleId), "demo");
67
+ case "playwrightRoot":
68
+ return layout.playwrightRoot;
69
+ case "plansRoot":
70
+ return layout.plansRoot;
71
+ case "modulePlaywright":
72
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId));
73
+ case "playwrightSpecs":
74
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), "specs");
75
+ case "playwrightTestPlans":
76
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), "test-plans");
77
+ case "playwrightAuth":
78
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), ".auth");
79
+ case "playwrightAuthState":
80
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), ".auth", "user.json");
81
+ case "playwrightResults":
82
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), "results");
83
+ case "playwrightReport":
84
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), "report");
85
+ case "playwrightExecution":
86
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), "execution");
87
+ case "demoSessionCurrent":
88
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), "execution", "current.json");
89
+ case "bridgeOperationPlan":
90
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), "execution", "operation-plan.json");
91
+ case "bridgeExecution":
92
+ return join(layout.playwrightRoot, requireModuleId(kind, moduleId), "execution", "playwright-execution.json");
93
+ }
94
+ }
95
+ export function resolveWorkspacePath(root, config, kind, options = {}) {
96
+ const workspacePath = getWorkspacePath(config, kind, options);
97
+ return isAbsolute(workspacePath) ? workspacePath : resolve(root, workspacePath);
98
+ }
99
+ export function interpolateModulePath(value, moduleId) {
100
+ return value.split("{module}").join(moduleId);
101
+ }
102
+ function requireModuleId(kind, moduleId) {
103
+ if (moduleId)
104
+ return moduleId;
105
+ throw new Error(`${kind} requires a module id`);
106
+ }
107
+ //# sourceMappingURL=workspace-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-layout.js","sourceRoot":"","sources":["../../src/core/workspace-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,gBAAgB;IAC3B,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,iBAAiB;IAC7B,KAAK,EAAE,YAAY;CACX,CAAC;AA8EX,MAAM,UAAU,sBAAsB,CAAC,SAAgC,EAAE;IACvE,MAAM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QACnF,KAAK,oBAAoB;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QACnG,KAAK,qBAAqB;YACxB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,qBAAqB,CAAC,CAAC;QAC1G,KAAK,iBAAiB;YACpB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,2BAA2B,CAAC,CAAC;IAClH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,MAA6B,EAC7B,IAAuB,EACvB,UAAgC,EAAE;IAElC,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9D,OAAO,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,QAAgB;IACnE,OAAO,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,eAAe,CAAC,IAAuB,EAAE,QAA4B;IAC5E,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uBAAuB,CAAC,CAAC;AAClD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@captain_z/zsk",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "ZNorth Standard Kit — CLI installer for zsk skill bundles (npx @captain_z/zsk add)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "commander": "^12.1.0",
21
21
  "picocolors": "^1.1.1",
22
22
  "yaml": "^2.7.0",
23
- "@captain_z/zsk-skills": "1.6.1"
23
+ "@captain_z/zsk-skills": "1.8.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.10.0",
@@ -28,21 +28,42 @@
28
28
  }
29
29
  }
30
30
  },
31
+ "layoutVersion": {
32
+ "description": "Workspace layout version. Version 2 keeps all zsk-managed outputs under .zsk/ by default.",
33
+ "type": "integer",
34
+ "minimum": 2
35
+ },
31
36
  "paths": {
32
37
  "description": "Top-level project knowledge workspace paths.",
33
38
  "type": "object",
34
39
  "additionalProperties": false,
35
- "required": ["raws", "docs", "issues"],
40
+ "required": ["docs", "modules", "resources", "issues", "evidence", "playwright"],
36
41
  "properties": {
37
- "raws": {
42
+ "docs": {
38
43
  "$ref": "#/$defs/pathRef"
39
44
  },
40
- "docs": {
45
+ "modules": {
46
+ "$ref": "#/$defs/pathRef"
47
+ },
48
+ "resources": {
49
+ "$ref": "#/$defs/pathRef"
50
+ },
51
+ "raws": {
52
+ "description": "Legacy resource root accepted only for compatibility with older workspaces.",
41
53
  "$ref": "#/$defs/pathRef"
42
54
  },
43
55
  "issues": {
44
56
  "$ref": "#/$defs/pathRef"
45
57
  },
58
+ "evidence": {
59
+ "$ref": "#/$defs/pathRef"
60
+ },
61
+ "playwright": {
62
+ "$ref": "#/$defs/pathRef"
63
+ },
64
+ "plans": {
65
+ "$ref": "#/$defs/pathRef"
66
+ },
46
67
  "metadata": {
47
68
  "$ref": "#/$defs/metadata"
48
69
  }
@@ -121,7 +142,7 @@
121
142
  "properties": {
122
143
  "defaultMode": {
123
144
  "type": "string",
124
- "enum": ["manual", "script", "playwright", "computer-use", "hybrid"]
145
+ "enum": ["manual", "script", "optimized", "playwright", "computer-use", "hybrid"]
125
146
  },
126
147
  "baseUrl": {
127
148
  "type": "string",
@@ -62,11 +62,11 @@ __SEVERITY__
62
62
  ## Documentation Feedback
63
63
 
64
64
  - 需要反哺的文档:
65
- - [ ] `docs/{module}/spec.md`
66
- - [ ] `docs/{module}/design.md`
67
- - [ ] `docs/{module}/tasks.md`
68
- - [ ] `docs/SYSTEM-SPEC.md`
69
- - [ ] `.zsk/learning/proposals`
65
+ - [ ] `.zsk/modules/{module}/spec.md`
66
+ - [ ] `.zsk/modules/{module}/design.md`
67
+ - [ ] `.zsk/modules/{module}/tasks.md`
68
+ - [ ] `.zsk/docs/SYSTEM-SPEC.md`
69
+ - [ ] `.zsk/resources`
70
70
  - 更新内容或 no-update rationale:
71
71
  - 反哺时机:修复通过 verify 且经用户/产品确认后执行
72
72
 
@@ -9,19 +9,20 @@ sources: {}
9
9
  runtime:
10
10
  url: http://localhost:3000
11
11
  tools:
12
- - playwright_mcp
12
+ - playwright_cli
13
13
  - playwright
14
14
  - computer_use
15
15
  - browser_use
16
16
 
17
17
  tests:
18
18
  raw_cases: []
19
- derived_cases: []
19
+ derived_cases:
20
+ - __PLAYWRIGHT_TEST_PLANS__/test-plan.json
20
21
  automated:
21
22
  unit: []
22
23
  integration: []
23
24
  e2e:
24
- - __DOCS_OUTPUT__/scenarios
25
+ - __PLAYWRIGHT_SPECS__
25
26
  tdd_required: true
26
27
 
27
28
  outputs:
@@ -4,11 +4,11 @@
4
4
 
5
5
  | Task | Scenario Contract | Case File | Fixture/Auth | Reuse Target | Status |
6
6
  | --- | --- | --- | --- | --- | --- |
7
- | Create P0 happy path skeleton | P0 happy path | `scenarios/p0-happy-path.spec.ts` | | demo, verify, regression | TODO |
7
+ | Create P0 happy path skeleton | P0 happy path | `__PLAYWRIGHT_SPECS__/p0-happy-path.spec.ts` | | demo, verify, regression | TODO |
8
8
 
9
9
  Rules:
10
10
 
11
- - Create Playwright skeletons before demo.
11
+ - Create Playwright skeletons under `__PLAYWRIGHT_SPECS__` before demo.
12
12
  - Create or update source-aligned tests/scenarios before implementation for testable behavior changes.
13
13
  - Tag cases as smoke/demo/verify/regression.
14
14
  - Include tasks for labels/test ids required by stable locators.
@@ -1,16 +1,22 @@
1
1
  # yaml-language-server: $schema=__ZSK_CONFIG_SCHEMA_URL__
2
2
 
3
+ layoutVersion: 2
4
+
3
5
  project:
4
6
  name: "<project-name>"
5
7
 
6
8
  paths:
7
- raws: .raws
8
- docs: docs
9
- issues: .issues
9
+ docs: .zsk/docs
10
+ modules: .zsk/modules
11
+ resources: .zsk/resources
12
+ issues: .zsk/issues
13
+ evidence: .zsk/evidence
14
+ playwright: .zsk/playwright
15
+ plans: .zsk/plans
10
16
 
11
17
  # Resource origins. AI or zsk config setup should fill these with online URLs,
12
18
  # git repositories, Figma/Modao links, OpenAPI locations, or local files.
13
- # Optional snapshots should land under paths.raws, for example:
19
+ # Optional snapshots should land under paths.resources, for example:
14
20
  #
15
21
  # sources:
16
22
  # srs:
@@ -18,26 +24,26 @@ paths:
18
24
  # origin:
19
25
  # kind: url
20
26
  # url: https://example.com/srs
21
- # snapshot: .raws/requirements/srs.md
27
+ # snapshot: .zsk/resources/requirements/srs.md
22
28
  # figma_main:
23
29
  # type: design
24
30
  # origin:
25
31
  # kind: figma
26
32
  # url: https://www.figma.com/file/...
27
- # snapshot: .raws/design-sources/figma-main.json
33
+ # snapshot: .zsk/resources/design-sources/figma-main.json
28
34
  # backend_api:
29
35
  # type: backend_repo
30
36
  # origin:
31
37
  # kind: git
32
38
  # repository: https://github.com/example/backend-api.git
33
39
  # path: openapi.yaml
34
- # snapshot: .raws/backend-repositories/backend-openapi.yaml
40
+ # snapshot: .zsk/resources/backend-repositories/backend-openapi.yaml
35
41
  # acceptance_cases:
36
42
  # type: test_case
37
43
  # origin:
38
44
  # kind: url
39
45
  # url: https://example.com/qa-cases
40
- # snapshot: .raws/testing/acceptance-cases.md
46
+ # snapshot: .zsk/resources/testing/acceptance-cases.md
41
47
  sources: {}
42
48
 
43
49
  tools:
@@ -45,14 +51,14 @@ tools:
45
51
  - playwright_cli
46
52
  - playwright_mcp
47
53
  - playwright
48
- - browser_use
49
54
  - computer_use
55
+ - browser_use
50
56
  design:
51
57
  - figma_mcp
52
58
 
53
59
  modules:
54
- index: docs/_module-index.md
55
- root: docs
60
+ index: .zsk/modules/_module-index.md
61
+ root: .zsk/modules
56
62
 
57
63
  automation:
58
64
  smoke:
@@ -63,17 +69,20 @@ automation:
63
69
  deploy:
64
70
  command: pnpm deploy:staging
65
71
  demo:
66
- # Default hybrid lane:
67
- # - Playwright CLI/UI mode is preferred for visible demo performance, controlled stop/pause, screenshots, traces, reports, and repeatable runs.
68
- # - Playwright MCP inspects structured accessibility snapshots and proposes operations when needed.
69
- # - Browser Use identifies the human-intent target and preserves existing logged-in browser/profile state when auth cannot be reproduced cheaply.
70
- # - Computer Use is reserved for visual/system-level context that browser automation cannot expose.
71
- # - Playwright consumes the handoff to pre-write/rehearse scenarios, then performs the external demo with visible trace/report evidence.
72
- defaultMode: hybrid
72
+ # Default optimized lane:
73
+ # - Formal test cases come from module tests.raw_cases or sources.testing, normally snapshots under .zsk/resources/testing.
74
+ # - Playwright storageState is the preferred way to reuse login/session state without stopping on login pages.
75
+ # - Computer Use is the preferred visual/current-page observation lane when it is available and authorized.
76
+ # - Browser Use is optional and runtime-specific; use it only where the agent platform supports it and permissions are available.
77
+ # - If neither Computer Use nor Browser Use exists, use Playwright MCP/ARIA/CDP snapshots or documented manual evidence as the compatible handoff.
78
+ # - zsk/agent generation writes test-plan.json, then Playwright CLI/Skills generate executable .spec.ts cases.
79
+ # - Playwright Test executes/debugs and records evidence. No MCP or bridge fallback is used in optimized mode.
80
+ # - Use --hybrid explicitly for the legacy bridge lane.
81
+ defaultMode: optimized
73
82
  baseUrl: http://localhost:3000
74
83
  command: pnpm dev
75
- evidenceDir: .issues/{module}/demo/_evidence
76
- scenarioDir: docs/{module}/scenarios
84
+ evidenceDir: .zsk/evidence/{module}/demo
85
+ scenarioDir: .zsk/playwright/{module}/specs
77
86
  playwright:
78
87
  config: playwright.config.ts
79
88
  project: chromium
@@ -83,12 +92,13 @@ automation:
83
92
  role: understand-and-decide
84
93
  bridge:
85
94
  enabled: true
86
- # decisionTool may be playwright_mcp for structured accessibility snapshots,
87
- # browser_use for existing login/profile state, or computer_use for visual/system-level understanding.
95
+ # Legacy hybrid-only bridge. Not used by defaultMode: optimized.
96
+ # Prefer computer_use for visual/system-level understanding when available.
97
+ # Fall back to playwright_mcp for structured accessibility snapshots, or browser_use only on runtimes that support it.
88
98
  decisionTool: playwright_mcp
89
99
  executionTool: playwright
90
- planFile: .zsk/demo-sessions/{module}/operation-plan.json
91
- executionFile: .zsk/demo-sessions/{module}/playwright-execution.json
100
+ planFile: .zsk/playwright/{module}/execution/operation-plan.json
101
+ executionFile: .zsk/playwright/{module}/execution/playwright-execution.json
92
102
  verify:
93
103
  commands:
94
104
  - pnpm test:e2e
@@ -0,0 +1,39 @@
1
+ # Project Config
2
+
3
+ This file is the human-readable companion to `.zsk/config.yaml`.
4
+
5
+ ## Workspace Layout
6
+
7
+ `zsk init` owns only the `.zsk/` workspace by default:
8
+
9
+ | Path | Purpose |
10
+ | --- | --- |
11
+ | `.zsk/config.yaml` | Machine-readable project config and path authority |
12
+ | `.zsk/docs/` | Project-level docs such as this file and `SYSTEM-SPEC.md` |
13
+ | `.zsk/modules/{module}/` | Module `module.yaml`, `proposal.md`, `spec.md`, `design.md`, `tasks.md` |
14
+ | `.zsk/resources/` | Shared source snapshots and manually provided resources |
15
+ | `.zsk/issues/` | Issues and issue indexes created on demand |
16
+ | `.zsk/evidence/` | Runtime evidence, screenshots, traces, logs, and verification artifacts |
17
+ | `.zsk/playwright/{module}/` | Playwright specs, plans, auth state, results, reports, and execution records |
18
+
19
+ Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are not default write targets. Use explicit export or migration tooling when you need project-root copies.
20
+
21
+ ## Source Priorities
22
+
23
+ 1. `.zsk/config.yaml`
24
+ 2. `.zsk/docs/SYSTEM-SPEC.md`
25
+ 3. Project resource origins listed under `.zsk/config.yaml#sources`
26
+ 4. `.zsk/modules/{module}/module.yaml`
27
+ 5. `.zsk/modules/{module}/spec.md`
28
+ 6. `.zsk/modules/{module}/design.md`
29
+ 7. Runtime evidence under `.zsk/evidence/` and `.zsk/playwright/`
30
+
31
+ When sources conflict, record the conflict under `.zsk/issues/{module}/` and update the affected module docs with a Documentation Feedback note or an explicit no-update rationale.
32
+
33
+ ## Maintenance Checklist
34
+
35
+ - Update `.zsk/config.yaml` when paths, tools, or source origins change.
36
+ - Keep project-wide reusable rules in `.zsk/docs/SYSTEM-SPEC.md`.
37
+ - Keep module-specific decisions in `.zsk/modules/{module}/`.
38
+ - Keep shared raw resources under `.zsk/resources/`.
39
+ - Keep runtime outputs out of docs and under `.zsk/evidence/` or `.zsk/playwright/`.
@@ -0,0 +1,27 @@
1
+ # System Spec
2
+
3
+ This document captures project-wide rules that should guide module work.
4
+
5
+ ## Path Boundaries
6
+
7
+ - `paths.docs` stores project-level docs only.
8
+ - `paths.modules` stores module source-of-truth docs.
9
+ - `paths.resources` stores shared source snapshots and manually provided resources.
10
+ - `paths.issues` stores actionable issue records and indexes created on demand.
11
+ - `paths.evidence` stores runtime evidence and verification artifacts.
12
+ - `paths.playwright` stores Playwright specs, plans, auth state, results, reports, and execution records.
13
+
14
+ Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are legacy or export surfaces, not default zsk write targets.
15
+
16
+ ## Testing Assets
17
+
18
+ Original QA, acceptance, release, and manually supplied test cases belong in configured project sources and may be snapshotted under `paths.resources`. Module-derived test plans and Playwright specs belong under `paths.playwright/{module}`.
19
+
20
+ ## Completion Feedback
21
+
22
+ Every stage document that changes durable behavior should include Documentation Feedback with either:
23
+
24
+ - a concrete update to project/module docs, or
25
+ - an explicit no-update rationale.
26
+
27
+ Runtime evidence should be linked from docs, not embedded in docs.
@@ -1,4 +1,4 @@
1
- # .issues Local Verification And Bug Evidence
1
+ # .zsk/issues - Local Verification And Bug Evidence
2
2
 
3
3
  This is the default issue root configured by `.zsk/config.yaml` `paths.issues`. It stores local review findings, bug reports, screenshots, logs, reproduction evidence, and verification records created during project work.
4
4
 
@@ -7,31 +7,32 @@ Every actionable finding from demo, smoke, review, formal test, verify, or accep
7
7
  ## Directory Contract
8
8
 
9
9
  ```text
10
- .issues/
10
+ .zsk/issues/
11
11
  ├── README.md
12
- ├── index.md # global module issue totals
12
+ ├── _taxonomy.md
13
+ ├── index.md # global module issue totals
13
14
  └── {area-or-module}/
14
- ├── index.md # module issue index and status table
15
+ ├── index.md # module issue index and status table
15
16
  ├── BUG-0001-short-slug/
16
- │ ├── issue.md # required issue body
17
- │ ├── analysis.md # optional root-cause notes
18
- │ ├── reproduction.md # optional detailed repro script
19
- │ ├── assets/ # screenshots, videos, HAR, exported state
17
+ │ ├── issue.md # required issue body
18
+ │ ├── analysis.md # optional root-cause notes
19
+ │ ├── reproduction.md # optional detailed repro script
20
+ │ ├── assets/ # screenshots, videos, HAR, exported state
20
21
  │ │ └── index.md
21
- │ └── debug-logs/ # console, test, network, investigation logs
22
+ │ └── debug-logs/ # console, test, network, investigation logs
22
23
  │ └── index.md
23
- ├── demo/ # optional stage view / evidence bucket
24
+ ├── demo/ # optional stage view / evidence bucket
24
25
  │ └── index.md
25
- ├── _evidence/ # shared evidence referenced by multiple issues/docs
26
- └── _debug-logs/ # untriaged or cross-issue historical logs only
26
+ ├── _evidence/ # shared evidence referenced by multiple issues/docs
27
+ └── _debug-logs/ # untriaged or cross-issue historical logs only
27
28
  ```
28
29
 
29
30
  Use `zsk issue create -m <module-id>` to generate issue folders from the packaged template. `zsk init` does not write `_templates/` into the project.
30
31
 
31
32
  `zsk issue update -m <module-id> --id <issue-dir> --status <status>` updates the concrete issue and refreshes:
32
33
 
33
- - `.issues/{module}/index.md` all issues and statuses for one module.
34
- - `.issues/index.md` module totals across the project.
34
+ - `.zsk/issues/{module}/index.md` - all issues and statuses for one module.
35
+ - `.zsk/issues/index.md` - module totals across the project.
35
36
 
36
37
  ## Bug Directory Rules
37
38
 
@@ -45,13 +46,13 @@ Use `zsk issue create -m <module-id>` to generate issue folders from the package
45
46
  ## Closure And Documentation Feedback
46
47
 
47
48
  - Record the affected PRD/SRS, spec, design, task, test case, and evidence links in the issue.
48
- - After the fix is verified and confirmed by the user/product owner, update the relevant `docs/{module}/spec.md`, `docs/{module}/design.md`, `docs/{module}/tasks.md`, or project spec for gaps or vague behavior exposed by the issue.
49
+ - After the fix is verified and confirmed by the user/product owner, update the relevant `.zsk/modules/{module}/spec.md`, `.zsk/modules/{module}/design.md`, `.zsk/modules/{module}/tasks.md`, or `.zsk/docs/SYSTEM-SPEC.md` for gaps or vague behavior exposed by the issue.
49
50
  - Close the issue only after it links verification evidence, confirmation, documentation feedback update or no-update rationale, and regression guard.
50
51
 
51
52
  ## Relationship To Other Project Directories
52
53
 
53
54
  | Directory | Purpose | May contain local screenshots/logs? |
54
55
  |---|---|---|
55
- | `.raws/` | Upstream facts, mirrored snapshots, original external test cases | No |
56
- | `docs/{module}/` | Human-authored module proposal/spec/design/tasks/verification | No |
57
- | `.issues/{module}/` | Local defects, verification evidence, debug logs, issue-quality records | Yes |
56
+ | `.zsk/resources/` | Upstream facts, mirrored snapshots, original external test cases | No |
57
+ | `.zsk/modules/{module}/` | Human-authored module proposal/spec/design/tasks | No |
58
+ | `.zsk/issues/{module}/` | Local defects, verification evidence, debug logs, issue-quality records | Yes |
@@ -0,0 +1,35 @@
1
+ # Issue Taxonomy
2
+
3
+ Managed issue records belong under `.zsk/issues/` or the configured `.zsk/config.yaml#paths.issues` root.
4
+
5
+ Each module has a module index at `.zsk/issues/{module}/index.md`. The issue root has a global index at `.zsk/issues/index.md` with module totals. `zsk issue create` and `zsk issue update` refresh both indexes.
6
+
7
+ | Type | Concrete Issue Directory | Prefix |
8
+ | --- | --- | --- |
9
+ | Demo Issue | `.zsk/issues/{module}/{prefix}-0001-slug/` | `DEMO` |
10
+ | Smoke Issue | `.zsk/issues/{module}/{prefix}-0001-slug/` | `SMOKE` |
11
+ | Review Issue | `.zsk/issues/{module}/{prefix}-0001-slug/` | `REV` |
12
+ | Defect | `.zsk/issues/{module}/{prefix}-0001-slug/` | `DEFECT` |
13
+ | Verify Issue | `.zsk/issues/{module}/{prefix}-0001-slug/` | `VER` |
14
+ | Acceptance Issue | `.zsk/issues/{module}/{prefix}-0001-slug/` | `ACC` |
15
+
16
+ Stage directories such as `.zsk/issues/{module}/demo/index.md` may exist as stage views or evidence buckets. The authoritative status indexes are `.zsk/issues/{module}/index.md` and `.zsk/issues/index.md`.
17
+
18
+ `.zsk/resources/issues/` is reserved for imported external issue feeds or compatibility inputs.
19
+
20
+ ## Required Intake
21
+
22
+ Every actionable issue should include:
23
+
24
+ - reproduction steps or triggering command;
25
+ - actual/current behavior;
26
+ - expected behavior;
27
+ - severity and rationale;
28
+ - environment/version/data source;
29
+ - evidence links;
30
+ - root-cause hypothesis and confidence;
31
+ - fix route;
32
+ - Documentation Feedback target or no-update rationale;
33
+ - regression guard;
34
+ - verification evidence and user/product confirmation before closing behavior-changing issues;
35
+ - updated module index and global issue index.
@@ -1,18 +0,0 @@
1
- # __MODULE_NAME__ Acceptance
2
-
3
- ## Verdict
4
-
5
- - Result: NOT_STARTED
6
- - Accepted by:
7
- - Date:
8
-
9
- ## Evidence Summary
10
-
11
- | Source | Conclusion | Link |
12
- | --- | --- | --- |
13
-
14
- ## Documentation Feedback
15
-
16
- - No-update rationale:
17
- - Created from the ZSK module template; no acceptance has been performed yet.
18
-