@jakkrichm/create-nexus-devflow 2.0.12 → 2.0.13
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/lib/update.js +15 -1
- package/package.json +1 -1
- package/template/.agents/skills/70-release/SKILL.md +2 -0
- package/template/.agents/skills/ci/SKILL.md +25 -78
- package/template/.agents/skills/commit/SKILL.md +39 -43
- package/template/.agents/skills/debug/SKILL.md +43 -104
- package/template/.agents/skills/deploy/SKILL.md +37 -65
- package/template/.agents/skills/insight/SKILL.md +27 -116
- package/template/.agents/skills/preview/SKILL.md +24 -103
- package/template/.agents/skills/review/SKILL.md +53 -37
- package/template/.agents/skills/rollback/SKILL.md +1 -0
- package/template/.agents/skills/security-review/SKILL.md +44 -147
- package/template/.agents/skills/simplify/SKILL.md +48 -57
- package/template/.agents/skills/test/SKILL.md +63 -51
- package/template/.claude/skills/70-release/SKILL.md +2 -0
- package/template/.claude/skills/ci/SKILL.md +25 -78
- package/template/.claude/skills/commit/SKILL.md +39 -43
- package/template/.claude/skills/debug/SKILL.md +43 -104
- package/template/.claude/skills/deploy/SKILL.md +37 -65
- package/template/.claude/skills/insight/SKILL.md +27 -116
- package/template/.claude/skills/preview/SKILL.md +24 -103
- package/template/.claude/skills/review/SKILL.md +53 -37
- package/template/.claude/skills/rollback/SKILL.md +1 -0
- package/template/.claude/skills/security-review/SKILL.md +44 -147
- package/template/.claude/skills/simplify/SKILL.md +48 -57
- package/template/.claude/skills/test/SKILL.md +63 -51
- package/template/devflow/history/HISTORY.md +27 -0
- package/template/devflow/reference/running-id-contract.md +1 -1
- package/template/.agents/skills/9arm-skills/README.md +0 -51
- package/template/.agents/skills/9arm-skills/debug-mantra/SKILL.md +0 -86
- package/template/.agents/skills/9arm-skills/management-talk/SKILL.md +0 -79
- package/template/.agents/skills/9arm-skills/post-mortem/SKILL.md +0 -71
- package/template/.agents/skills/9arm-skills/scrutinize/SKILL.md +0 -72
- package/template/.agents/skills/browser-testing-with-devtools/SKILL.md +0 -302
- package/template/.agents/skills/ci-cd-and-automation/SKILL.md +0 -390
- package/template/.agents/skills/code-review-and-quality/SKILL.md +0 -392
- package/template/.agents/skills/code-simplification/SKILL.md +0 -331
- package/template/.agents/skills/debugging-and-error-recovery/SKILL.md +0 -298
- package/template/.agents/skills/deployment-procedures/SKILL.md +0 -241
- package/template/.agents/skills/deprecation-and-migration/SKILL.md +0 -206
- package/template/.agents/skills/diagnosing-bugs/SKILL.md +0 -93
- package/template/.agents/skills/git-workflow-and-versioning/SKILL.md +0 -300
- package/template/.agents/skills/human-review-decisions/SKILL.md +0 -74
- package/template/.agents/skills/idea-refine/SKILL.md +0 -178
- package/template/.agents/skills/idea-refine/examples.md +0 -238
- package/template/.agents/skills/idea-refine/frameworks.md +0 -99
- package/template/.agents/skills/idea-refine/refinement-criteria.md +0 -113
- package/template/.agents/skills/idea-refine/scripts/idea-refine.sh +0 -15
- package/template/.agents/skills/incremental-implementation/SKILL.md +0 -248
- package/template/.agents/skills/insight-capture/SKILL.md +0 -84
- package/template/.agents/skills/intelligent-routing/SKILL.md +0 -176
- package/template/.agents/skills/md2html/SKILL.md +0 -154
- package/template/.agents/skills/md2html/components.md +0 -505
- package/template/.agents/skills/md2html/template.html +0 -1152
- package/template/.agents/skills/planning-and-task-breakdown/SKILL.md +0 -239
- package/template/.agents/skills/pr-review/SKILL.md +0 -143
- package/template/.agents/skills/pr-review-analysis/SKILL.md +0 -89
- package/template/.agents/skills/preview-local-check/SKILL.md +0 -59
- package/template/.agents/skills/release-git-operations/SKILL.md +0 -97
- package/template/.agents/skills/review-followup-routing/SKILL.md +0 -98
- package/template/.agents/skills/security-and-hardening/SKILL.md +0 -349
- package/template/.agents/skills/security-and-hardening/security-checklist.md +0 -134
- package/template/.agents/skills/shipping-and-launch/SKILL.md +0 -311
- package/template/.agents/skills/silent-failure-audit/SKILL.md +0 -73
- package/template/.agents/skills/spec-orchestration/SKILL.md +0 -91
- package/template/.agents/skills/specialist-agent-routing/SKILL.md +0 -107
- package/template/.agents/skills/test-driven-development/SKILL.md +0 -422
- package/template/.agents/skills/test-driven-development/testing-patterns.md +0 -236
- package/template/.agents/skills/test-execution-and-coverage/SKILL.md +0 -56
- package/template/.agents/skills/using-agent-skills/SKILL.md +0 -171
- package/template/.agents/skills/verification-orchestration/SKILL.md +0 -68
- package/template/.agents/skills/vulnerability-scanner/SKILL.md +0 -276
- package/template/.agents/skills/vulnerability-scanner/checklists.md +0 -121
- package/template/.agents/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
- package/template/.agents/skills/wiki/SKILL.md +0 -149
- package/template/.agents/skills/workflow-documentation-sync/SKILL.md +0 -87
- package/template/.claude/skills/9arm-skills/README.md +0 -51
- package/template/.claude/skills/9arm-skills/debug-mantra/SKILL.md +0 -86
- package/template/.claude/skills/9arm-skills/management-talk/SKILL.md +0 -79
- package/template/.claude/skills/9arm-skills/post-mortem/SKILL.md +0 -71
- package/template/.claude/skills/9arm-skills/scrutinize/SKILL.md +0 -72
- package/template/.claude/skills/browser-testing-with-devtools/SKILL.md +0 -302
- package/template/.claude/skills/ci-cd-and-automation/SKILL.md +0 -390
- package/template/.claude/skills/code-review-and-quality/SKILL.md +0 -392
- package/template/.claude/skills/code-simplification/SKILL.md +0 -331
- package/template/.claude/skills/debugging-and-error-recovery/SKILL.md +0 -298
- package/template/.claude/skills/deployment-procedures/SKILL.md +0 -241
- package/template/.claude/skills/deprecation-and-migration/SKILL.md +0 -206
- package/template/.claude/skills/diagnosing-bugs/SKILL.md +0 -93
- package/template/.claude/skills/git-workflow-and-versioning/SKILL.md +0 -300
- package/template/.claude/skills/human-review-decisions/SKILL.md +0 -74
- package/template/.claude/skills/idea-refine/SKILL.md +0 -178
- package/template/.claude/skills/idea-refine/examples.md +0 -238
- package/template/.claude/skills/idea-refine/frameworks.md +0 -99
- package/template/.claude/skills/idea-refine/refinement-criteria.md +0 -113
- package/template/.claude/skills/idea-refine/scripts/idea-refine.sh +0 -15
- package/template/.claude/skills/incremental-implementation/SKILL.md +0 -248
- package/template/.claude/skills/insight-capture/SKILL.md +0 -84
- package/template/.claude/skills/intelligent-routing/SKILL.md +0 -176
- package/template/.claude/skills/md2html/SKILL.md +0 -154
- package/template/.claude/skills/md2html/components.md +0 -505
- package/template/.claude/skills/md2html/template.html +0 -1152
- package/template/.claude/skills/planning-and-task-breakdown/SKILL.md +0 -239
- package/template/.claude/skills/pr-review/SKILL.md +0 -143
- package/template/.claude/skills/pr-review-analysis/SKILL.md +0 -89
- package/template/.claude/skills/preview-local-check/SKILL.md +0 -59
- package/template/.claude/skills/release-git-operations/SKILL.md +0 -97
- package/template/.claude/skills/review-followup-routing/SKILL.md +0 -98
- package/template/.claude/skills/security-and-hardening/SKILL.md +0 -349
- package/template/.claude/skills/security-and-hardening/security-checklist.md +0 -134
- package/template/.claude/skills/shipping-and-launch/SKILL.md +0 -311
- package/template/.claude/skills/silent-failure-audit/SKILL.md +0 -73
- package/template/.claude/skills/spec-orchestration/SKILL.md +0 -91
- package/template/.claude/skills/specialist-agent-routing/SKILL.md +0 -107
- package/template/.claude/skills/test-driven-development/SKILL.md +0 -422
- package/template/.claude/skills/test-driven-development/testing-patterns.md +0 -236
- package/template/.claude/skills/test-execution-and-coverage/SKILL.md +0 -56
- package/template/.claude/skills/using-agent-skills/SKILL.md +0 -171
- package/template/.claude/skills/verification-orchestration/SKILL.md +0 -68
- package/template/.claude/skills/vulnerability-scanner/SKILL.md +0 -276
- package/template/.claude/skills/vulnerability-scanner/checklists.md +0 -121
- package/template/.claude/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
- package/template/.claude/skills/wiki/SKILL.md +0 -149
- package/template/.claude/skills/workflow-documentation-sync/SKILL.md +0 -87
|
@@ -3,77 +3,68 @@ name: simplify
|
|
|
3
3
|
description: "[Devflow] Code simplification and refactoring for clarity and maintainability without altering runtime behavior."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
description: Simplify code for clarity and maintainability while preserving behavior.
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Simplify - Code Simplification And Refactoring
|
|
6
|
+
# Code Simplification & Refactoring
|
|
11
7
|
|
|
12
|
-
|
|
8
|
+
## Overview
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
.agents/skills/code-simplification/SKILL.md
|
|
18
|
-
```
|
|
10
|
+
This is the comprehensive code simplification master skill for Nexus-DevFlow. It reduces cognitive load, cleans up unnecessary abstractions, flattens deep nesting, and removes dead code while **preserving 100% exact runtime behavior**.
|
|
19
11
|
|
|
20
|
-
|
|
12
|
+
**Core Rule**: Every simplification must pass: *"Would a new team member understand this faster than the original, without any behavioral regression?"*
|
|
21
13
|
|
|
22
|
-
|
|
14
|
+
---
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
## 1. The Five Principles of Simplification
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
1. **Preserve Behavior Exactly**: Same inputs, outputs, error conditions, side effects, and ordering.
|
|
19
|
+
2. **Follow Project Conventions**: Consistency with neighboring files beats personal style preferences.
|
|
20
|
+
3. **Delete Dead & Unused Code**: Remove abandoned helpers, dead branch paths, and leftover debugging code.
|
|
21
|
+
4. **Flatten Control Flow**: Replace nested conditionals and callback pyramids with guard clauses and early returns.
|
|
22
|
+
5. **Eliminate Speculative Generalization**: Replace single-use abstractions with clear, direct implementations.
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
2. Identify the target code: recent changes unless a broader scope is specified.
|
|
30
|
-
3. Understand purpose, callers, edge cases, and test coverage before touching it.
|
|
31
|
-
4. Scan for simplification opportunities:
|
|
32
|
-
- deep nesting to guard clauses or extracted helpers
|
|
33
|
-
- long functions to responsibility-based splits
|
|
34
|
-
- nested ternaries to clearer control flow
|
|
35
|
-
- vague names to descriptive names
|
|
36
|
-
- duplicated logic to shared helpers
|
|
37
|
-
- dead code to removal after confirmation
|
|
38
|
-
- speculative abstraction to simpler concrete flow
|
|
39
|
-
5. Inspect `.agent/resources/schemas/refactoring.template.md` before generating a report.
|
|
40
|
-
6. Apply each simplification incrementally and run verification after each meaningful change.
|
|
41
|
-
7. Save the refactoring report to:
|
|
24
|
+
---
|
|
42
25
|
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
## 2. High-Impact Simplification Techniques
|
|
27
|
+
|
|
28
|
+
### A. Guard Clauses Over Nested Conditionals
|
|
29
|
+
```typescript
|
|
30
|
+
// Before: Deep indentation
|
|
31
|
+
function processOrder(order) {
|
|
32
|
+
if (order) {
|
|
33
|
+
if (order.isValid) {
|
|
34
|
+
if (order.isPaid) {
|
|
35
|
+
return fulfill(order);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// After: Early returns
|
|
42
|
+
function processOrder(order) {
|
|
43
|
+
if (!order || !order.isValid) return;
|
|
44
|
+
if (!order.isPaid) return;
|
|
45
|
+
return fulfill(order);
|
|
46
|
+
}
|
|
45
47
|
```
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
If tests fail after a simplification, revert that specific change and reconsider.
|
|
49
|
+
### B. Inline Single-Use Helpers & Dead Shims
|
|
50
|
+
If a helper function is only called once and adds indirection without semantic clarity, inline it directly.
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
### C. Remove Dead Code & Leftover Comments
|
|
53
|
+
Delete commented-out code blocks, `// removed` notes, and unused variables (`_unused`). Version control (Git) remembers the history.
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- what was simplified
|
|
56
|
-
- what was intentionally left alone
|
|
57
|
-
- validation evidence
|
|
58
|
-
- remaining risks or debt
|
|
59
|
-
|
|
60
|
-
## Relationship To DevFlow 2.0
|
|
61
|
-
|
|
62
|
-
- Classification: Companion command
|
|
63
|
-
- Mainline status: Not a numbered stage
|
|
64
|
-
- Typical entry points: `40-implement`, `50-verify`, `PR-Review`, `Agent`
|
|
65
|
-
- Typical handoff targets: `40-implement`, `50-verify`, `PR-Review`
|
|
55
|
+
---
|
|
66
56
|
|
|
67
|
-
##
|
|
57
|
+
## 3. Verification & Safety Loop
|
|
68
58
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
59
|
+
1. Run unit tests before touching code (`npm test` -> GREEN).
|
|
60
|
+
2. Apply one small refactoring step at a time.
|
|
61
|
+
3. Rerun tests immediately after each step. If tests break, revert and reconsider.
|
|
62
|
+
4. Verify overall build and linter checks.
|
|
73
63
|
|
|
74
|
-
|
|
64
|
+
---
|
|
75
65
|
|
|
76
|
-
|
|
77
|
-
- **Why**: simplification should finish with explicit proof that behavior did not regress
|
|
78
|
-
- **Alternative**: `40-implement` when simplification exposed a deeper implementation change rather than a pure refactor
|
|
66
|
+
## Relationship To DevFlow 2.0
|
|
79
67
|
|
|
68
|
+
- **Classification**: Companion command & Refactoring support
|
|
69
|
+
- **Mainline integration**: Used during `40-implement` (Refactor step of TDD) or `50-verify`.
|
|
70
|
+
- **Handoff**: `50-verify` (proves zero regressions).
|
|
@@ -1,82 +1,94 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test
|
|
3
|
-
description: "[Devflow] Test
|
|
3
|
+
description: "[Devflow] Test-driven development, test generation, test execution, and coverage analysis across unit, integration, and smoke test suites."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
description: Test Generation and Execution - Generates missing tests, runs existing test suites, or checks test coverage for the project.
|
|
8
|
-
---
|
|
9
|
-
# ๐งช Test Generation and Execution
|
|
10
|
-
|
|
11
|
-
## Usage: `/13-Test [target]`
|
|
6
|
+
# Test-Driven Development, Generation & Execution
|
|
12
7
|
|
|
13
|
-
|
|
8
|
+
## Overview
|
|
14
9
|
|
|
15
|
-
|
|
10
|
+
This is the comprehensive testing master skill for Nexus-DevFlow. It drives development with tests (TDD), handles test generation, execution, coverage analysis, and bug reproduction. Tests are proof — "seems right" is not done.
|
|
16
11
|
|
|
17
12
|
```text
|
|
18
|
-
|
|
13
|
+
RED GREEN REFACTOR
|
|
14
|
+
Write a test Write minimal code Clean up the
|
|
15
|
+
that fails ──→ to make it pass ──→ implementation ──→ (repeat)
|
|
16
|
+
│ │ │
|
|
17
|
+
▼ ▼ ▼
|
|
18
|
+
Test FAILS Test PASSES Tests still PASS
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
## Usage & Sub-Commands
|
|
22
|
+
|
|
23
|
+
- `/test` - Run all project test suites
|
|
24
|
+
- `/test [file/feature]` - Generate tests for a specific target
|
|
25
|
+
- `/test coverage` - Show test coverage report
|
|
26
|
+
- `/test watch` - Run tests in watch mode
|
|
22
27
|
|
|
23
28
|
---
|
|
24
29
|
|
|
25
|
-
##
|
|
30
|
+
## 1. The TDD Cycle
|
|
31
|
+
|
|
32
|
+
### Step 1: RED — Write a Failing Test
|
|
33
|
+
Write the test first. It must fail. A test that passes immediately proves nothing.
|
|
34
|
+
|
|
35
|
+
### Step 2: GREEN — Make It Pass
|
|
36
|
+
Write the minimum code to make the test pass. Avoid premature over-engineering.
|
|
26
37
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- `/13-Test coverage` - Show test coverage report
|
|
30
|
-
- `/13-Test watch` - Run tests in watch mode
|
|
38
|
+
### Step 3: REFACTOR — Clean Up
|
|
39
|
+
Improve code readability, naming, structure, and eliminate duplication while keeping tests green.
|
|
31
40
|
|
|
32
41
|
---
|
|
33
42
|
|
|
34
|
-
##
|
|
43
|
+
## 2. The Prove-It Pattern (Bug Reproduction)
|
|
35
44
|
|
|
36
|
-
|
|
37
|
-
If the user requests tests for a target:
|
|
38
|
-
1. **Analyze**: Identify functions, edge cases, and external dependencies.
|
|
39
|
-
2. **Template Verification**: **MANDATORY:** Before generating the test plan, inspect `.agent/resources/schemas/test_report.template.md`, preserve its required layout, and replace placeholder text with concrete coverage, command output, failures, and gaps.
|
|
40
|
-
3. **Generate Cases**: Develop Happy path, Error cases, Edge cases.
|
|
41
|
-
4. **Write**: Implement the tests using the project's testing framework (Pytest, Jest, Vitest, etc.). Follow the `Arrange-Act-Assert` pattern and mock external dependencies.
|
|
42
|
-
5. **Save Test Report**: Save the test plan and results to `devflow/reports/{date}-test-report-{target}.md` (where `{date}` is today's date in `YYYY-MM-DD` format and `{target}` is a slugified version of the file or feature name).
|
|
45
|
+
When fixing any defect, **do not attempt a fix without proving the bug exists first**:
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
```text
|
|
48
|
+
Bug report arrives ➔ Write reproduction test (FAILS) ➔ Implement fix ➔ Test PASSES ➔ Guard regression
|
|
49
|
+
```
|
|
46
50
|
|
|
47
51
|
---
|
|
48
52
|
|
|
49
|
-
##
|
|
50
|
-
- **Test behavior, not implementation.**
|
|
51
|
-
- **One assertion per test** (when practical).
|
|
52
|
-
- **Descriptive test names.**
|
|
53
|
-
- **Arrange-Act-Assert pattern.**
|
|
54
|
-
- **Save Report**: Always save the test plan or results to disk for persistent logging.
|
|
53
|
+
## 3. The Test Pyramid & Resource Sizes
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
| Level | Size | Target % | Scope & Characteristics |
|
|
56
|
+
| :--- | :--- | :--- | :--- |
|
|
57
|
+
| **Unit** | Small | ~80% | Pure logic, in-memory, single process, milliseconds each |
|
|
58
|
+
| **Integration** | Medium | ~15% | API boundaries, database interaction, component seams |
|
|
59
|
+
| **E2E** | Large | ~5% | Critical user journeys, full workflows, browser automation |
|
|
57
60
|
|
|
58
|
-
|
|
59
|
-
Generate a summary indicating:
|
|
60
|
-
- **Test Plan**: Table of Test Case, Type, Coverage (Happy path, error case, validation)
|
|
61
|
-
- **Generated Tests**: File path and the code block
|
|
62
|
-
- **Report Location**: Confirm the report has been written to the specified workspace path.
|
|
63
|
-
- **Run command**: e.g. `npm test`
|
|
61
|
+
---
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
Display an organized output listing Passed/Failed files, and explicitly show the expectation vs received outcome for failed assertions.
|
|
63
|
+
## 4. Key Testing Principles & Best Practices
|
|
67
64
|
|
|
68
|
-
|
|
65
|
+
1. **Test behavior, not implementation details**: Assert on output and state changes, not private method call sequences.
|
|
66
|
+
2. **DAMP over DRY in tests**: Descriptive and meaningful test setup beats overly abstract shared helpers.
|
|
67
|
+
3. **Arrange-Act-Assert**: Distinct setup, action, and verification phases in every test case.
|
|
68
|
+
4. **Prefer real implementations & fakes over heavy mocks**: Mock only at boundaries where real dependencies are slow or non-deterministic.
|
|
69
|
+
5. **One assertion concept per test**: Isolate test failure reasons clearly.
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 5. Browser Testing & Runtime Verification
|
|
74
|
+
|
|
75
|
+
For browser and UI features, unit tests alone are insufficient:
|
|
76
|
+
- **Console**: Zero errors and unhandled exceptions in production code.
|
|
77
|
+
- **Network**: Accurate status codes, payload shapes, and CORS handling.
|
|
78
|
+
- **DOM & Styles**: Verified layout rendering, accessibility tree, and responsive behaviors.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 6. Test Generation & Persistent Execution Reports
|
|
74
83
|
|
|
75
|
-
|
|
84
|
+
When generating or logging test runs during `40-implement` or `50-verify`:
|
|
85
|
+
- Save summary reports to `devflow/reports/{date}-test-report-{slug}.md`
|
|
86
|
+
- Include: Target, Test Cases (Happy Path, Error, Edge Cases), Pass/Fail statistics, and gaps/risks.
|
|
76
87
|
|
|
77
|
-
|
|
78
|
-
- `.agents/skills/test-execution-and-coverage/SKILL.md`
|
|
79
|
-
- `.agent/resources/schemas/test_report.template.md`
|
|
80
|
-
- Related commands: `40-implement`, `50-verify`, `Debug`, `QA-Orchestrate`
|
|
88
|
+
---
|
|
81
89
|
|
|
90
|
+
## Relationship To DevFlow 2.0
|
|
82
91
|
|
|
92
|
+
- **Classification**: Companion command & Engineering standard
|
|
93
|
+
- **Mainline stages**: `30-plan` (TDD decisions), `40-implement` (TDD execution), `50-verify` (QA gate)
|
|
94
|
+
- **Handoff**: `50-verify`, `Debug`, `autopilot`
|
|
@@ -77,6 +77,8 @@ Before packaging, merging, or releasing:
|
|
|
77
77
|
- **การ Push ไปยัง Remote หรือ Deploy จะต้องขออนุมัติแยกต่างหากอย่างชัดเจน (Merge approval DOES NOT equal Push approval)**
|
|
78
78
|
3. **Archive Resolved Findings**:
|
|
79
79
|
- ย้ายรายการ Findings ที่ปิดแล้ว (`closed`, `accepted`, `invalid`) ไปบันทึกในเอกสาร Release และรีเซ็ต `findings.md` ให้สะอาด
|
|
80
|
+
4. **Append to Master History Ledger**:
|
|
81
|
+
- บันทึก Entry ใหม่ลงใน `devflow/history/HISTORY.md` พร้อมระบุ Running ID, Title, วันที่, Git Commit Hash / Tag, สถานะ (`Released`), และลิงก์ไปยังรายงานสรุป `60-report.md`
|
|
80
82
|
|
|
81
83
|
### 1. Load Verified Context
|
|
82
84
|
|
|
@@ -1,70 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ci
|
|
3
|
-
description: "[Devflow]
|
|
3
|
+
description: "[Devflow] CI/CD pipeline automation and GitHub Actions setup (.github/workflows/verify.yml). Automates quality gates, typechecks, tests, and build checks."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# CI/CD Pipeline Automation & Quality Gates
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
This is the CI/CD and automation master skill for Nexus-DevFlow. It automates quality gates so that no change reaches production without passing static analysis, typechecking, tests, security audits, and builds.
|
|
9
11
|
|
|
10
12
|
```text
|
|
11
|
-
|
|
12
|
-
(project setup) (setup) (same command) (automated checks)
|
|
13
|
+
PR / Push ➔ Lint & Typecheck ➔ Unit & Integration Tests ➔ Build Verification ➔ Security Audit
|
|
13
14
|
```
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- **Verify is the recipe**: Runs the project's real checks (typecheck, tests, build) defined in `AGENTS.md`.
|
|
18
|
-
- **GitHub Actions is the worker**: Executes the same recipe automatically on pull requests and pushes.
|
|
19
|
-
- **Branch Protection / Ruleset is the gate**: Optionally requires the check to pass before merging.
|
|
20
|
-
|
|
21
|
-
This skill configures the workflow file. It **never pushes to remote, changes remote repository rulesets, or publishes releases** without explicit permission.
|
|
22
|
-
|
|
23
|
-
## Input
|
|
24
|
-
|
|
25
|
-
No argument is required. A preferred package manager or branch name can be optionally provided.
|
|
26
|
-
|
|
27
|
-
## Step 1 - Inspect Project Setup (Read-Only)
|
|
28
|
-
|
|
29
|
-
Inspect the repository without modifying files:
|
|
30
|
-
|
|
31
|
-
1. **Commands in `AGENTS.md`**: Look for existing `Verify`, `Test`, `Build`, and `Dev` commands.
|
|
32
|
-
2. **Project Manifests**: `package.json`, `requirements.txt`, `pyproject.toml`, `go.mod`, `Cargo.toml`, etc.
|
|
33
|
-
3. **Lockfiles & Package Manager**: `pnpm-lock.yaml` (pnpm), `package-lock.json` (npm), `yarn.lock` (yarn), `bun.lockb` (bun), `poetry.lock` (poetry), `Cargo.lock` (cargo).
|
|
34
|
-
4. **Runtime Versions**: `.node-version`, `.nvmrc`, `package.json` engines, `.python-version`.
|
|
35
|
-
5. **Existing Workflows**: Inspect `.github/workflows/` to check if a CI workflow already exists.
|
|
36
|
-
6. **Git Default Branch**: Detect `main` or `master`.
|
|
37
|
-
|
|
38
|
-
If a healthy and matching workflow already exists, report that CI is already in place and stop.
|
|
39
|
-
|
|
40
|
-
## Step 2 - Define The Single Verify Command
|
|
41
|
-
|
|
42
|
-
Build one combined Verify command from actual checks that exist in the project, in this standard order:
|
|
43
|
-
|
|
44
|
-
1. **Typecheck** (e.g. `tsc --noEmit`, `mypy`, `pyright`, `go vet`)
|
|
45
|
-
2. **Tests** (e.g. `npm test`, `pytest`, `go test ./...`, `cargo test`) - only if real tests exist
|
|
46
|
-
3. **Build** (e.g. `npm run build`, `cargo build`)
|
|
47
|
-
|
|
48
|
-
For JavaScript/TypeScript projects, ensure a `verify` or `check` script exists in `package.json` (or combine existing scripts: e.g. `npm run check:static && npm test && npm run build`).
|
|
49
|
-
|
|
50
|
-
Record the exact command in the Commands section of `AGENTS.md`:
|
|
16
|
+
---
|
|
51
17
|
|
|
52
|
-
|
|
53
|
-
## Commands
|
|
54
|
-
- Verify: `npm run check` (or detected verify command)
|
|
55
|
-
```
|
|
18
|
+
## 1. Shift-Left Quality Gate Pipeline
|
|
56
19
|
|
|
57
|
-
|
|
20
|
+
1. **Static Analysis & Typecheck**: `tsc --noEmit`, `eslint`, `biome` (Catches syntax & type flaws in seconds).
|
|
21
|
+
2. **Automated Tests**: Unit & Integration tests (`npm test`, `pytest`, `go test`).
|
|
22
|
+
3. **Build Integrity**: `npm run build` (Ensures bundle compiles cleanly without warnings).
|
|
23
|
+
4. **Security Hygiene**: `npm audit --audit-level=high` (Flags vulnerable dependencies).
|
|
58
24
|
|
|
59
|
-
|
|
25
|
+
---
|
|
60
26
|
|
|
61
|
-
|
|
62
|
-
- **Permissions**: Set least privilege `permissions: contents: read`.
|
|
63
|
-
- **Concurrency**: Cancel in-progress runs on the same PR branch.
|
|
64
|
-
- **Lockfile-Safe Install**: Use `npm ci`, `pnpm install --frozen-lockfile`, `yarn install --immutable`, or `cargo --locked`.
|
|
65
|
-
- **Exact Verify Step**: Run the exact Verify command from `AGENTS.md`.
|
|
27
|
+
## 2. GitHub Actions Setup (`.github/workflows/verify.yml`)
|
|
66
28
|
|
|
67
|
-
|
|
29
|
+
When setting up or updating CI:
|
|
30
|
+
- **Trigger**: Pull requests and pushes to `main` / `master`.
|
|
31
|
+
- **Permissions**: Enforce least privilege (`permissions: contents: read`).
|
|
32
|
+
- **Concurrency**: Cancel stale in-progress runs on the same PR.
|
|
33
|
+
- **Deterministic Install**: Use `npm ci` or `--frozen-lockfile`.
|
|
68
34
|
|
|
69
35
|
```yaml
|
|
70
36
|
name: Verify
|
|
@@ -90,7 +56,7 @@ jobs:
|
|
|
90
56
|
- name: Checkout Code
|
|
91
57
|
uses: actions/checkout@v4
|
|
92
58
|
|
|
93
|
-
- name: Setup
|
|
59
|
+
- name: Setup Node
|
|
94
60
|
uses: actions/setup-node@v4
|
|
95
61
|
with:
|
|
96
62
|
node-version: 20
|
|
@@ -103,29 +69,10 @@ jobs:
|
|
|
103
69
|
run: npm run check
|
|
104
70
|
```
|
|
105
71
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Execute the Verify command locally to confirm that it succeeds on clean code before recommending it:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
npm run check
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
If local verification fails, report the failing check and assist in resolving it before claiming CI readiness.
|
|
115
|
-
|
|
116
|
-
## Step 5 - Summary & Handoff
|
|
117
|
-
|
|
118
|
-
Output a concise summary:
|
|
119
|
-
|
|
120
|
-
- **Verify Command**: Documented command in `AGENTS.md`.
|
|
121
|
-
- **Workflow File**: `.github/workflows/verify.yml` (created/updated).
|
|
122
|
-
- **Trigger Events**: `pull_request` & `push`.
|
|
123
|
-
- **Local Test**: Result of local execution.
|
|
124
|
-
- **Next Steps**: Advise user to commit and push the workflow to activate GitHub Actions.
|
|
72
|
+
---
|
|
125
73
|
|
|
126
|
-
##
|
|
74
|
+
## Relationship To DevFlow 2.0
|
|
127
75
|
|
|
128
|
-
- **
|
|
129
|
-
- **
|
|
130
|
-
- **
|
|
131
|
-
- **No Auto-Push**: Stop at local file creation; do not push to remote automatically.
|
|
76
|
+
- **Classification**: Companion command & Automated testing infrastructure
|
|
77
|
+
- **Mainline integration**: Invoked via `/ci` during `onboard` or `adopt`.
|
|
78
|
+
- **Handoff**: `50-verify`, `70-release`
|
|
@@ -1,63 +1,59 @@
|
|
|
1
|
-
---name: commit
|
|
2
|
-
|
|
3
|
-
description: "[Devflow] Smart Commit (Git Orchestration) - Stage files intelligently and write a concise, imperative commit message according to project standards."
|
|
4
1
|
---
|
|
5
|
-
|
|
2
|
+
name: commit
|
|
3
|
+
description: "[Devflow] Smart Commit (Git Orchestration) - Stage files intelligently, write conventional imperative commit messages, and manage trunk-based versioning."
|
|
4
|
+
---
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
# Smart Commit & Git Workflow Versioning
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
## Overview
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
.agents/skills/release-git-operations/SKILL.md
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Treat this workflow file as a compatibility wrapper around that skill in `commit` mode.
|
|
10
|
+
This is the Git orchestration and versioning master skill for Nexus-DevFlow. It enforces atomic commits, conventional commit formatting, intelligent staging, and safe trunk-based workflows. Commits are save points, branches are sandboxes, and Git history is durable documentation.
|
|
18
11
|
|
|
19
12
|
---
|
|
20
13
|
|
|
21
|
-
##
|
|
14
|
+
## 1. Commit Discipline & The Conventional Commits Standard
|
|
15
|
+
|
|
16
|
+
Each commit should represent one atomic, self-contained change:
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
```text
|
|
19
|
+
<type>(<scope>): <short imperative summary>
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- Provide the target description (e.g., "all", "backend only", "staged").
|
|
28
|
-
- The agent will:
|
|
29
|
-
- Check the current Git status and branch.
|
|
30
|
-
- **MANDATORY BRANCH RULE:** Use the user's current branch as-is. Do not create, switch, or checkout a branch automatically. Only create or switch branches when the user explicitly asks for that exact branch action in the current request.
|
|
31
|
-
- If the current branch appears risky for the intended commit (for example `main`/`master` or a protected branch), warn the user and ask whether they want to continue on the current branch or explicitly create/switch to another branch.
|
|
32
|
-
- Interpret your description to stage the correct files.
|
|
33
|
-
- Review the staged changes to understand the context.
|
|
21
|
+
[optional detailed body explaining WHY, not WHAT]
|
|
22
|
+
```
|
|
34
23
|
|
|
35
|
-
###
|
|
36
|
-
-
|
|
37
|
-
-
|
|
24
|
+
### Commit Types:
|
|
25
|
+
- `feat`: A new user-facing feature or capability
|
|
26
|
+
- `fix`: A bug fix
|
|
27
|
+
- `docs`: Documentation only changes
|
|
28
|
+
- `refactor`: A code change that neither fixes a bug nor adds a feature
|
|
29
|
+
- `test`: Adding missing tests or correcting existing tests
|
|
30
|
+
- `chore`: Maintenance, build tasks, package updates
|
|
38
31
|
|
|
39
|
-
###
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
- Final Commit Message.
|
|
43
|
-
- Statistics (Files changed, additions, deletions).
|
|
32
|
+
### Formatting Rules:
|
|
33
|
+
- Use the imperative mood: `"feat(auth): add password reset flow"` (NOT `"added"` or `"adds"`).
|
|
34
|
+
- Never mix formatting/refactoring with behavioral feature changes in the same commit.
|
|
44
35
|
|
|
45
36
|
---
|
|
46
37
|
|
|
47
|
-
|
|
38
|
+
## 2. Trunk-Based Branching & Safety
|
|
48
39
|
|
|
49
|
-
|
|
40
|
+
- **Keep `main` deployable**: Feature branches (`feature/{slug}-{running-id}`) must be short-lived.
|
|
41
|
+
- **Never commit directly to `main` without review**: Use feature/fix branches during development.
|
|
42
|
+
- **Small, verified increments**: Test and verify before committing each checkpoint.
|
|
50
43
|
|
|
51
|
-
|
|
52
|
-
- Mainline status: Release support command, not a numbered stage
|
|
53
|
-
- Typical entry points: `70-release` after the report is aligned and release execution is ready
|
|
54
|
-
- Typical handoff targets: `PR`, `Deploy`, `70-release`
|
|
44
|
+
---
|
|
55
45
|
|
|
56
|
-
##
|
|
46
|
+
## 3. Execution Flow
|
|
57
47
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
1. Check `git status` and verify current branch.
|
|
49
|
+
2. Stage relevant files explicitly (`git add <files>` — avoid blindly running `git add .` if untracked temporary files exist).
|
|
50
|
+
3. Generate concise conventional commit message.
|
|
51
|
+
4. Execute `git commit` and capture commit hash.
|
|
62
52
|
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Relationship To DevFlow 2.0
|
|
63
56
|
|
|
57
|
+
- **Classification**: Companion command & Version control support
|
|
58
|
+
- **Mainline integration**: Used during `40-implement` (checkpoint commits), `70-release` (final release commit).
|
|
59
|
+
- **Handoff**: `pr`, `merge`, `70-release`
|