ai-workflow-init 3.6.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli.js
CHANGED
|
@@ -86,7 +86,7 @@ function cloneDocsAI(source, dest) {
|
|
|
86
86
|
mkdirSync(destSubfolder, { recursive: true });
|
|
87
87
|
|
|
88
88
|
// Chỉ copy file template và README.md
|
|
89
|
-
const filesToCopy = ["README.md", "
|
|
89
|
+
const filesToCopy = ["README.md", "unit-template.md", "req-template.md", "integration-template.md"];
|
|
90
90
|
|
|
91
91
|
for (const file of filesToCopy) {
|
|
92
92
|
const srcFile = path.join(tempSubfolder, file);
|
|
@@ -205,6 +205,15 @@ async function main() {
|
|
|
205
205
|
step("🚚 Downloading workflow template (docs/ai)...");
|
|
206
206
|
cloneDocsAI(`${REPO}/docs/ai`, "docs/ai");
|
|
207
207
|
|
|
208
|
+
// Create docs/dev folder for dev documentation output
|
|
209
|
+
step("📁 Creating docs/dev folder...");
|
|
210
|
+
if (!existsSync("docs/dev")) {
|
|
211
|
+
mkdirSync("docs/dev", { recursive: true });
|
|
212
|
+
console.log("✅ Created: docs/dev");
|
|
213
|
+
} else {
|
|
214
|
+
console.log("⏭️ Skipping (already exists): docs/dev");
|
|
215
|
+
}
|
|
216
|
+
|
|
208
217
|
// Clone Cursor commands (luôn ghi đè)
|
|
209
218
|
if (installCursor) {
|
|
210
219
|
if (!existsSync(".cursor/commands")) {
|
|
@@ -4,15 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
## Folders
|
|
6
6
|
- src/: source code
|
|
7
|
+
- tests/: all test files
|
|
8
|
+
- unit/: unit test files (`*.spec.ts`, `*.test.ts`)
|
|
9
|
+
- integration/: integration/E2E test files (`*.e2e.spec.ts`)
|
|
7
10
|
- docs/ai/project/: project docs (structure, conventions, patterns)
|
|
8
11
|
- docs/ai/planning/: feature plans
|
|
9
12
|
- docs/ai/implementation/: implementation notes per feature
|
|
10
13
|
- docs/ai/testing/: test plans per feature
|
|
14
|
+
- `unit-{name}.md`: unit test docs (created by `/writing-test`)
|
|
15
|
+
- `integration-{name}.md`: integration test docs (created by `/writing-integration-test`)
|
|
11
16
|
|
|
12
17
|
## Design Patterns (in use)
|
|
13
18
|
- Pattern A: short description + when to use
|
|
14
19
|
- Pattern B: short description + when to use
|
|
15
20
|
|
|
21
|
+
## Test Configuration
|
|
22
|
+
|
|
23
|
+
> This section is used by `/writing-test`, `/writing-integration-test`, and `/run-test` commands.
|
|
24
|
+
> Run `/generate-standards` to auto-detect and populate this section.
|
|
25
|
+
|
|
26
|
+
### Unit Tests
|
|
27
|
+
- Framework: [Vitest/Jest/Mocha/pytest/etc.]
|
|
28
|
+
- Run command: `[npm test / npx vitest run / pytest / etc.]`
|
|
29
|
+
- Config file: [vitest.config.ts / jest.config.js / pytest.ini / none]
|
|
30
|
+
- Test location: `tests/unit/`
|
|
31
|
+
- File pattern: `*.spec.ts` or `*.test.ts`
|
|
32
|
+
|
|
33
|
+
### Integration Tests
|
|
34
|
+
- Framework: [Playwright/Cypress/etc.]
|
|
35
|
+
- Run command: `npx playwright test`
|
|
36
|
+
- Config file: `playwright.config.ts`
|
|
37
|
+
- Test location: `tests/integration/`
|
|
38
|
+
- File pattern: `*.e2e.spec.ts`
|
|
39
|
+
|
|
16
40
|
## Notes
|
|
17
41
|
- Import/module conventions
|
|
18
42
|
- Config & secrets handling (if applicable)
|
|
@@ -21,7 +45,10 @@
|
|
|
21
45
|
- `docs/ai/project/`: repository-wide conventions and structure; workflow overview and navigation live in `README.md`.
|
|
22
46
|
- `docs/ai/planning/`: feature plans using `feature-template.md` with Acceptance Criteria; plans should drive a todo checklist before coding.
|
|
23
47
|
- `docs/ai/implementation/`: per-feature implementation notes tracking what changed and why.
|
|
24
|
-
- `docs/ai/testing/`:
|
|
48
|
+
- `docs/ai/testing/`: test plans and results
|
|
49
|
+
- `unit-{name}.md`: unit test docs (from `/writing-test`)
|
|
50
|
+
- `integration-{name}.md`: integration test docs (from `/writing-integration-test`)
|
|
51
|
+
- Run tests via `/run-test` command
|
|
25
52
|
|
|
26
53
|
## Guiding Questions (for AI regeneration)
|
|
27
54
|
- How is the codebase organized by domain/feature vs layers?
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Integration Test Plan: {Feature Name}
|
|
2
|
+
|
|
3
|
+
Note: All content in this document must be written in English.
|
|
4
|
+
|
|
5
|
+
## Test Files Created
|
|
6
|
+
- `tests/integration/{feature-name}.e2e.spec.ts` - E2E tests for {feature}
|
|
7
|
+
|
|
8
|
+
## Test Scenarios
|
|
9
|
+
|
|
10
|
+
### Happy Path
|
|
11
|
+
- ✓ User can [complete main flow]
|
|
12
|
+
- ✓ Form submits successfully with valid data
|
|
13
|
+
- ✓ Navigation works correctly
|
|
14
|
+
|
|
15
|
+
### Error Handling
|
|
16
|
+
- ✓ Validation errors display for invalid input
|
|
17
|
+
- ✓ Error messages are clear and helpful
|
|
18
|
+
|
|
19
|
+
### Edge Cases
|
|
20
|
+
- ✓ Empty state displays correctly
|
|
21
|
+
- ✓ Special characters handled properly
|
|
22
|
+
|
|
23
|
+
## Run Command
|
|
24
|
+
```bash
|
|
25
|
+
# Run specific feature tests
|
|
26
|
+
npx playwright test tests/integration/{feature-name}.e2e.spec.ts
|
|
27
|
+
|
|
28
|
+
# Run all integration tests
|
|
29
|
+
npx playwright test
|
|
30
|
+
|
|
31
|
+
# Run in headed mode (see browser)
|
|
32
|
+
npx playwright test --headed
|
|
33
|
+
|
|
34
|
+
# Run with UI mode (interactive debugging)
|
|
35
|
+
npx playwright test --ui
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Last Run Results
|
|
39
|
+
- Total: 0 tests
|
|
40
|
+
- Passed: 0
|
|
41
|
+
- Failed: 0
|
|
42
|
+
- Duration: 0s
|
|
43
|
+
|
|
44
|
+
## Coverage
|
|
45
|
+
- Happy path scenarios: [count]
|
|
46
|
+
- Error scenarios: [count]
|
|
47
|
+
- Edge case scenarios: [count]
|
|
48
|
+
|
|
49
|
+
## Issues Found
|
|
50
|
+
- None yet
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
- Tests are repeatable and independent
|
|
54
|
+
- Run `npx playwright test --ui` for interactive debugging
|
|
55
|
+
- Screenshots captured on failure in `test-results/` directory
|
|
56
|
+
- HTML report available via `npx playwright show-report`
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Test Plan: {Feature Name}
|
|
1
|
+
# Unit Test Plan: {Feature Name}
|
|
2
2
|
|
|
3
3
|
Note: All content in this document must be written in English.
|
|
4
4
|
|
|
5
5
|
## Test Files Created
|
|
6
|
-
- `
|
|
7
|
-
- `
|
|
6
|
+
- `tests/unit/test-file.spec.ts` - Tests for [component/function]
|
|
7
|
+
- `tests/unit/another-test.spec.ts` - Tests for [component/function]
|
|
8
8
|
|
|
9
9
|
## Unit Tests
|
|
10
10
|
|