@jakkrichm/create-nexus-devflow 2.0.12 → 2.0.14
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/dist/bin/create-nexus-devflow.d.ts +2 -0
- package/dist/bin/create-nexus-devflow.js +233 -0
- package/dist/bin/create-nexus-devflow.js.map +1 -0
- package/dist/lib/starter-templates.d.ts +6 -0
- package/dist/lib/starter-templates.js +8 -0
- package/dist/lib/starter-templates.js.map +1 -0
- package/dist/lib/update.d.ts +68 -0
- package/dist/lib/update.js +325 -0
- package/dist/lib/update.js.map +1 -0
- package/dist/scripts/clean-template.d.ts +1 -0
- package/dist/scripts/clean-template.js +14 -0
- package/dist/scripts/clean-template.js.map +1 -0
- package/dist/scripts/prepare-template.d.ts +1 -0
- package/dist/scripts/prepare-template.js +89 -0
- package/dist/scripts/prepare-template.js.map +1 -0
- package/package.json +11 -9
- package/template/.agents/skills/00-discover/SKILL.md +2 -0
- package/template/.agents/skills/60-report/SKILL.md +21 -75
- package/template/.agents/skills/70-release/SKILL.md +7 -4
- package/template/.agents/skills/check/SKILL.md +68 -0
- package/template/.agents/skills/ci/SKILL.md +25 -78
- package/template/.agents/skills/commit/SKILL.md +39 -43
- package/template/.agents/skills/complete/SKILL.md +73 -0
- package/template/.agents/skills/debug/SKILL.md +43 -104
- package/template/.agents/skills/deploy/SKILL.md +37 -65
- package/template/.agents/skills/devflow/SKILL.md +89 -80
- package/template/.agents/skills/idea/SKILL.md +57 -0
- package/template/.agents/skills/implement/SKILL.md +64 -0
- package/template/.agents/skills/insight/SKILL.md +27 -116
- package/template/.agents/skills/overview/SKILL.md +114 -0
- package/template/.agents/skills/preview/SKILL.md +24 -103
- package/template/.agents/skills/report-html/SKILL.md +45 -0
- 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/spec/SKILL.md +105 -0
- package/template/.agents/skills/test/SKILL.md +63 -51
- package/template/.claude/skills/00-discover/SKILL.md +2 -0
- package/template/.claude/skills/60-report/SKILL.md +21 -75
- package/template/.claude/skills/70-release/SKILL.md +7 -4
- package/template/.claude/skills/check/SKILL.md +68 -0
- package/template/.claude/skills/ci/SKILL.md +25 -78
- package/template/.claude/skills/commit/SKILL.md +39 -43
- package/template/.claude/skills/complete/SKILL.md +73 -0
- package/template/.claude/skills/debug/SKILL.md +43 -104
- package/template/.claude/skills/deploy/SKILL.md +37 -65
- package/template/.claude/skills/devflow/SKILL.md +89 -80
- package/template/.claude/skills/idea/SKILL.md +57 -0
- package/template/.claude/skills/implement/SKILL.md +64 -0
- package/template/.claude/skills/insight/SKILL.md +27 -116
- package/template/.claude/skills/overview/SKILL.md +114 -0
- package/template/.claude/skills/preview/SKILL.md +24 -103
- package/template/.claude/skills/report-html/SKILL.md +45 -0
- 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/spec/SKILL.md +105 -0
- package/template/.claude/skills/test/SKILL.md +63 -51
- package/template/AGENTS.md +71 -74
- package/template/devflow/context/ai-interaction.md +1 -0
- package/template/devflow/context/coding-standards.md +31 -18
- package/template/devflow/context/current-stage.md +3 -3
- package/template/devflow/context/findings.md +10 -6
- package/template/devflow/context/project-overview.md +29 -11
- package/template/devflow/discoveries/.gitkeep +0 -0
- package/template/devflow/history/HISTORY.md +31 -0
- package/template/devflow/ideas.md +15 -0
- package/template/devflow/reference/running-id-contract.md +1 -1
- package/template/devflow/runs/.gitkeep +0 -0
- package/bin/create-nexus-devflow.js +0 -287
- package/lib/starter-templates.js +0 -111
- package/lib/update.js +0 -379
- 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
- package/template/.nexus/nexus-devflow.json +0 -44
|
@@ -3,119 +3,40 @@ name: preview
|
|
|
3
3
|
description: "[Devflow] Local preview server management, smoke-check, and temporary runtime inspection before formal verification."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
description: Preview management and temporary runtime checks. Transitional compatibility path for the Preview companion command in DevFlow 2.0.
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Preview Management
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
```text
|
|
15
|
-
Preview
|
|
16
|
-
Preview start
|
|
17
|
-
Preview stop
|
|
18
|
-
Preview restart
|
|
19
|
-
Preview check
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
This file keeps its old numeric path for migration compatibility.
|
|
23
|
-
|
|
24
|
-
In DevFlow 2.0, `Preview` is a companion command, not a numbered mainline workflow.
|
|
25
|
-
|
|
26
|
-
Primary behavior now lives in:
|
|
27
|
-
|
|
28
|
-
```text
|
|
29
|
-
.agents/skills/preview-local-check/SKILL.md
|
|
30
|
-
```
|
|
6
|
+
# Preview Management & Local Runtime Inspection
|
|
31
7
|
|
|
32
|
-
|
|
8
|
+
## Overview
|
|
33
9
|
|
|
34
|
-
|
|
10
|
+
This is the preview master skill for Nexus-DevFlow. It manages local development/preview servers (`npm run dev`, `npm run preview`, `vite`, `next dev`), handles port conflicts, and executes smoke checks before formal verification.
|
|
35
11
|
|
|
36
|
-
|
|
12
|
+
## Usage & Sub-Commands
|
|
37
13
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
Preferred DevFlow 2.0 pairing:
|
|
44
|
-
|
|
45
|
-
- from `40-implement`
|
|
46
|
-
- from `50-verify`
|
|
14
|
+
- `/preview` - Inspect current preview status and health
|
|
15
|
+
- `/preview start` - Start the local preview/dev server
|
|
16
|
+
- `/preview stop` - Stop the running server process
|
|
17
|
+
- `/preview restart` - Restart the preview server
|
|
18
|
+
- `/preview check` - Perform runtime smoke check against `http://localhost:<port>`
|
|
47
19
|
|
|
48
20
|
---
|
|
49
21
|
|
|
50
|
-
##
|
|
22
|
+
## 1. Process & Runtime Management
|
|
51
23
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
24
|
+
1. **Detect Framework & Command**: Identify the project runtime (`npm run dev`, `vite preview`, `pnpm start`, `python -m http.server`).
|
|
25
|
+
2. **Handle Port Conflicts**: Check if the standard port (3000, 5173, 8080) is occupied; auto-select fallback port or terminate stale background processes.
|
|
26
|
+
3. **Health & Smoke Check**: Query local endpoint via HTTP GET to verify HTTP 200 OK and asset loading.
|
|
27
|
+
4. **Report Status**:
|
|
28
|
+
```markdown
|
|
29
|
+
## Preview Status
|
|
30
|
+
- **URL**: `http://localhost:3000`
|
|
31
|
+
- **App Type**: Next.js / Vite / Node.js
|
|
32
|
+
- **Health Status**: `OK` (200 OK)
|
|
33
|
+
- **Console / Network**: Zero fatal runtime errors
|
|
34
|
+
```
|
|
57
35
|
|
|
58
36
|
---
|
|
59
37
|
|
|
60
|
-
## Internal Process
|
|
61
|
-
|
|
62
|
-
`Preview` manages the local preview workflow using the `preview-local-check` skill plus any available preview automation or equivalent project-local commands.
|
|
63
|
-
|
|
64
|
-
When handling preview operations:
|
|
65
|
-
|
|
66
|
-
1. detect the correct project or server command path
|
|
67
|
-
2. report the current state clearly
|
|
68
|
-
3. handle port conflicts gracefully
|
|
69
|
-
4. keep the action scoped to preview management, not broader deployment
|
|
70
|
-
5. distinguish between preview success and full verification success
|
|
71
|
-
|
|
72
|
-
Commands should use the nearest equivalent project-local preview command for the project, such as `npm run dev`, `npm run preview`, framework-specific local servers, or other runtime helpers that already exist in the target project.
|
|
73
|
-
|
|
74
|
-
### Resolving Port Conflicts
|
|
75
|
-
|
|
76
|
-
If the port is in use, offer options:
|
|
77
|
-
|
|
78
|
-
1. start on a different port
|
|
79
|
-
2. terminate the process on the existing port
|
|
80
|
-
3. specify a custom port
|
|
81
|
-
|
|
82
|
-
### Status Format
|
|
83
|
-
|
|
84
|
-
When displaying status, clearly state:
|
|
85
|
-
|
|
86
|
-
- URL
|
|
87
|
-
- project path
|
|
88
|
-
- app type
|
|
89
|
-
- health status
|
|
90
|
-
- notes about blockers, missing dependencies, or startup warnings
|
|
91
|
-
|
|
92
|
-
Example summary:
|
|
93
|
-
|
|
94
|
-
```markdown
|
|
95
|
-
## Preview Status
|
|
96
|
-
|
|
97
|
-
- **URL**: `http://localhost:3000`
|
|
98
|
-
- **Project Path**: `[absolute path]`
|
|
99
|
-
- **App Type**: `Next.js | FastAPI | Odoo | PHP | Other`
|
|
100
|
-
- **Health Status**: `OK | Warning | Failed`
|
|
101
|
-
- **Notes**: [port conflict, startup issue, missing dependency, or none]
|
|
102
|
-
```
|
|
103
|
-
|
|
104
38
|
## Relationship To DevFlow 2.0
|
|
105
39
|
|
|
106
|
-
- Classification
|
|
107
|
-
- Mainline
|
|
108
|
-
-
|
|
109
|
-
- Typical handoff targets: `50-verify`, `Debug`, `40-implement`
|
|
110
|
-
|
|
111
|
-
## Sources
|
|
112
|
-
|
|
113
|
-
- `AGENTS.md`
|
|
114
|
-
- `.agents/skills/preview-local-check/SKILL.md`
|
|
115
|
-
- Related commands: `40-implement`, `50-verify`, `Debug`
|
|
116
|
-
|
|
117
|
-
## Next Workflow Recommendation
|
|
118
|
-
|
|
119
|
-
- **Primary**: `50-verify` when preview confirms the change is ready for formal checks
|
|
120
|
-
- **Alternative**: `40-implement` when preview exposed implementation work
|
|
121
|
-
|
|
40
|
+
- **Classification**: Companion command & Runtime support
|
|
41
|
+
- **Mainline stages**: `40-implement` (interactive visual check), `50-verify` (smoke test check)
|
|
42
|
+
- **Handoff**: `50-verify`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: report-html
|
|
3
|
+
description: "[Devflow] Standalone HTML Report Generator - render an interactive standalone HTML dashboard from spec.md or 60-report.md on demand."
|
|
4
|
+
argument-hint: "{running-id or workspace path}"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Standalone: Report HTML
|
|
8
|
+
|
|
9
|
+
$ARGUMENTS
|
|
10
|
+
|
|
11
|
+
Standalone companion command to generate an interactive, self-contained HTML report dashboard on demand from either a Fast-Track `spec.md` or a Deep-Track `60-report.md`.
|
|
12
|
+
|
|
13
|
+
> [!NOTE]
|
|
14
|
+
> HTML reports are **never automatically generated** during normal mainline stages (`/complete` or `60-report`). Use this command whenever you or stakeholders wish to view or share an interactive web report.
|
|
15
|
+
|
|
16
|
+
## Invocations & Aliases
|
|
17
|
+
|
|
18
|
+
- `/report:html`: Generate HTML report for the active or most recent run
|
|
19
|
+
- `/report:html {running-id}`: Generate HTML report for the specified running ID
|
|
20
|
+
- `npm run report:html -- {running-id}`: CLI npm script invocation
|
|
21
|
+
- `$report:html`: Codex CLI invocation
|
|
22
|
+
|
|
23
|
+
## Behavior & Contract
|
|
24
|
+
|
|
25
|
+
When invoked:
|
|
26
|
+
|
|
27
|
+
### 1. Identify Target Run
|
|
28
|
+
1. Locate target run directory in `devflow/runs/{running-id}` from argument or `devflow/context/current-stage.md`.
|
|
29
|
+
2. Check for either:
|
|
30
|
+
- Fast-Track Living Spec: `devflow/runs/{RUNNING_ID}/spec.md` (or `blueprint.md`)
|
|
31
|
+
- Deep-Track Report Digest: `devflow/runs/{RUNNING_ID}/60-report.md`
|
|
32
|
+
|
|
33
|
+
### 2. Render Interactive HTML Dashboard
|
|
34
|
+
Execute the HTML generation engine:
|
|
35
|
+
```bash
|
|
36
|
+
npm run report:html -- {RUNNING_ID}
|
|
37
|
+
```
|
|
38
|
+
Or execute the renderer to transform Markdown into a styled, standalone HTML document:
|
|
39
|
+
- Path: `devflow/runs/{RUNNING_ID}/report.html`
|
|
40
|
+
|
|
41
|
+
### 3. Output
|
|
42
|
+
Provide:
|
|
43
|
+
- Generated HTML file path: `file:///devflow/runs/{RUNNING_ID}/report.html`
|
|
44
|
+
- Summary of sections rendered (Spec, Plan, Progress, QA Evidence, Release Notes)
|
|
45
|
+
- Instructions to open the file in any browser
|
|
@@ -1,55 +1,71 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
|
-
description: "[Devflow]
|
|
3
|
+
description: "[Devflow] Multi-axis code and PR review. Reviews diffs against standards, specs, correctness, security, performance, and 9arm scrutinize discipline."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Review
|
|
6
|
+
# Code Review, Quality & PR Analysis
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Overview
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
This is the comprehensive review master skill for Nexus-DevFlow. It evaluates code modifications, local diffs, branches, and pull requests across multiple dimensions before merging or releasing. Every change gets reviewed before merge — no exceptions.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- **Spec**: does the change implement the originating issue, PRD, spec, or stage artifact?
|
|
12
|
+
**The approval standard**: Approve a change when it definitely improves overall code health and satisfies the specification, even if it isn't perfect.
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. The Scrutinize Discipline (9arm Review Pattern)
|
|
17
|
+
|
|
18
|
+
Before jumping into line-by-line comments, apply the 4-step Scrutiny check:
|
|
19
|
+
1. **Intent Check**: What problem is this change truly trying to solve? Is this the right problem?
|
|
20
|
+
2. **Safer / Smaller Alternative**: Could this be achieved with fewer lines, zero new dependencies, or less complexity?
|
|
21
|
+
3. **Runtime Path Trace**: Trace the execution path through inputs, error handling, async boundaries, and state mutations.
|
|
22
|
+
4. **Precision & Evidence**: Does the code contain unproven assumptions or missing test evidence?
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 2. The Five-Axis Review Framework
|
|
18
27
|
|
|
19
|
-
|
|
20
|
-
- Use the user-supplied commit, branch, tag, or merge-base.
|
|
21
|
-
- If none is supplied, default to the active branch merge-base with `main` when available.
|
|
22
|
-
- Confirm the diff is non-empty.
|
|
28
|
+
Every review evaluates code across these 5 core axes:
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
```text
|
|
31
|
+
┌──────────────────────────────────────────────────────────┐
|
|
32
|
+
│ FIVE-AXIS CODE REVIEW │
|
|
33
|
+
├──────────────┬───────────────────────────────────────────┤
|
|
34
|
+
│ 1. Correctness│ Logic, edge cases, error paths, races │
|
|
35
|
+
│ 2. Simplicity │ Readable, concise, no dead code, DAMP/DRY │
|
|
36
|
+
│ 3. Architecture│ Boundaries, dependencies, design patterns │
|
|
37
|
+
│ 4. Security │ Input validation, auth, no secrets/XSS │
|
|
38
|
+
│ 5. Performance│ No N+1 queries, async I/O, memoization │
|
|
39
|
+
└──────────────┴───────────────────────────────────────────┘
|
|
40
|
+
```
|
|
27
41
|
|
|
28
|
-
|
|
29
|
-
- Look for repo docs such as `AGENTS.md`, `CONTRIBUTING.md`, coding standards, workflow docs, or stage contracts.
|
|
42
|
+
---
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
- Cite the violated standard.
|
|
33
|
-
- Distinguish hard violations from judgment calls.
|
|
34
|
-
- Skip issues that tooling already enforces unless tooling is missing.
|
|
44
|
+
## 3. Review Lenses & Finding Severities
|
|
35
45
|
|
|
36
|
-
|
|
37
|
-
- Report missing or partial requirements.
|
|
38
|
-
- Report scope creep.
|
|
39
|
-
- Report implemented behavior that appears wrong against the spec.
|
|
46
|
+
Categorize all findings into actionable severities:
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
- **P0 (Critical Blocker)**: Security vulnerability, data loss, runtime crash, broken main functionality. (Blocks `70-release`)
|
|
49
|
+
- **P1 (Major Blocker)**: Spec mismatch, broken error handling, severe regression risk. (Blocks `70-release`)
|
|
50
|
+
- **P2 (Normal Improvement)**: Readability, missing edge-case test, minor performance optimization.
|
|
51
|
+
- **P3 (Nit / Suggestion)**: Naming polish, optional refactor, comment clarity.
|
|
45
52
|
|
|
46
|
-
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 4. PR Review Process
|
|
56
|
+
|
|
57
|
+
1. **Load Context**: Pin fixed point (merge-base with `main`), read spec (`20-spec.md`) and coding standards.
|
|
58
|
+
2. **Review Standards vs. Spec**: Check adherence to project instructions (`AGENTS.md`) and acceptance criteria.
|
|
59
|
+
3. **Validate Findings**: Ensure every finding is reproducible and points to specific files and line numbers.
|
|
60
|
+
4. **Generate Report**: Save substantial review reports under:
|
|
61
|
+
```text
|
|
62
|
+
devflow/runs/{ID}-{slug}/pr_review.md
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
47
66
|
|
|
48
|
-
|
|
67
|
+
## Relationship To DevFlow 2.0
|
|
49
68
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- findings by axis
|
|
54
|
-
- worst issue per axis
|
|
55
|
-
- recommended DevFlow route
|
|
69
|
+
- **Classification**: Companion command & Verification support
|
|
70
|
+
- **Mainline stages**: `50-verify` (QA & Code Review lane), `70-release` (Pre-merge review)
|
|
71
|
+
- **Handoff**: `40-implement` (for fixes), `50-verify`, `70-release`
|
|
@@ -103,6 +103,7 @@ Present the rollback plan to the user:
|
|
|
103
103
|
## Rules
|
|
104
104
|
|
|
105
105
|
- **Preserve History**: Never delete run folders under `devflow/runs/`. Historical reports must remain intact.
|
|
106
|
+
- **Update History Ledger**: When the rollback is completed and verified, update the target entry's status in `devflow/history/HISTORY.md` to `Rolled Back` with reference to the reversal commit.
|
|
106
107
|
- **No Destructive Git Commands**: Never execute `git reset --hard HEAD~N` or `git push --force`. All reversals must be applied as forward commits.
|
|
107
108
|
- **One Target Per Rollback**: Avoid bundling multiple unrelated rollbacks into one pass.
|
|
108
109
|
- **Explicit Human Gate**: Always wait for user approval before applying any reverse diffs to code.
|
|
@@ -1,166 +1,63 @@
|
|
|
1
|
-
---name: security-review
|
|
2
|
-
|
|
3
|
-
description: "[Devflow] High-severity security code review and vulnerability audit for folders, projects, files, or diffs."
|
|
4
|
-
argument-hint: "[target folder, project path, file list, or git diff] [--lang=en]"
|
|
5
1
|
---
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
$ARGUMENTS
|
|
10
|
-
|
|
11
|
-
Perform a focused security-only review of a specified target (directory, project, list of files, or code diff) for **High Severity** and **Critical** security vulnerabilities.
|
|
12
|
-
|
|
13
|
-
This workflow is a companion command in DevFlow 2.0. It creates a standardized stage artifact contract inside the active workspace.
|
|
14
|
-
|
|
15
|
-
## Purpose
|
|
16
|
-
|
|
17
|
-
Use this workflow to check an entire folder, project, or changed files for major security risks. It ensures your codebase does not introduce high-severity flaws before advancing to verification or release.
|
|
18
|
-
|
|
19
|
-
## Behavior
|
|
20
|
-
|
|
21
|
-
When `Security-Review` is triggered:
|
|
22
|
-
|
|
23
|
-
1. **Resolve target and scope**:
|
|
24
|
-
- Determine the target folder, project, list of files, or git diff from the arguments.
|
|
25
|
-
- Scan all source files in the target directory recursively, or evaluate the specific list of files/diff.
|
|
26
|
-
2. **Anchor the run**:
|
|
27
|
-
- Locate the active `running_id` from the workspace.
|
|
28
|
-
- If no active running ID is found, prompt the user or create a temporary run workspace (e.g., `sec-global` under `devflow/runs/sec-global/`).
|
|
29
|
-
3. **Execute security-focused analysis**:
|
|
30
|
-
- Trace trust boundaries and inputs across the target files.
|
|
31
|
-
- Check only for **High Severity** and **Critical** security vulnerabilities (e.g., SQL/Command Injection, hardcoded secrets, authentication bypass, path traversal, RCE, data exposure).
|
|
32
|
-
- Ignore theoretical, style, low-impact, or medium/low severity findings for status blocking, but report them under Suggestions if present.
|
|
33
|
-
4. **Load Template**:
|
|
34
|
-
- Inspect `.agent/resources/schemas/security_review.template.md`.
|
|
35
|
-
- Read the `artifact_language` configuration (framework default: `"th"`).
|
|
36
|
-
- Generate the report in English.
|
|
37
|
-
5. **Write the Artifact**:
|
|
38
|
-
- Write the finalized security report to `devflow/runs/{ID}-{slug}/security-review.md`.
|
|
39
|
-
- Ensure the output strictly follows the template contract structure (Headings 1 to 11).
|
|
40
|
-
|
|
41
|
-
## Output Contract & Formats
|
|
42
|
-
|
|
43
|
-
The generated artifact must follow the English contract shape below.
|
|
44
|
-
|
|
45
|
-
### English Output Template
|
|
46
|
-
|
|
47
|
-
```markdown
|
|
2
|
+
name: security-review
|
|
3
|
+
description: "[Devflow] Security review, vulnerability scanner, and code hardening. Audits for OWASP vulnerabilities, secrets, injections, and auth flaws."
|
|
48
4
|
---
|
|
49
|
-
id: "{running_id}-security-review"
|
|
50
|
-
title: "Security Review: {Work Title}"
|
|
51
|
-
doc_type: "companion"
|
|
52
|
-
stage: "security-review"
|
|
53
|
-
created: "{Date}"
|
|
54
|
-
updated: "{Date}"
|
|
55
|
-
owner: "{Owner}"
|
|
56
|
-
status: "draft"
|
|
57
|
-
artifact_language: "th"
|
|
58
|
-
related_run: "{running_id}"
|
|
59
|
-
related_files: []
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
# Security Review: {Work Title}
|
|
63
|
-
|
|
64
|
-
## 1. Objective
|
|
65
|
-
|
|
66
|
-
- Perform a focused security review on the target directory, project, or files to detect High Severity and Critical security vulnerabilities.
|
|
67
|
-
|
|
68
|
-
## 2. Source Inputs
|
|
69
|
-
|
|
70
|
-
- Review Target: {Review Target}
|
|
71
|
-
- Files Evaluated: []
|
|
72
|
-
|
|
73
|
-
## 3. Project Context To Preserve
|
|
74
5
|
|
|
75
|
-
|
|
76
|
-
- Known exceptions or legacy patterns excluded from security flags.
|
|
6
|
+
# Security Review, Hardening & Vulnerability Audit
|
|
77
7
|
|
|
78
|
-
##
|
|
8
|
+
## Overview
|
|
79
9
|
|
|
80
|
-
|
|
81
|
-
- **Status:** [pass | fail]
|
|
82
|
-
- **Reason:** [Explain in detail with file and line references if fail, or "No high-severity or Critical security vulnerabilities found" if pass]
|
|
10
|
+
This is the comprehensive security master skill for Nexus-DevFlow. It combines static vulnerability scanning, threat modeling, OWASP Top 10 defenses, and code hardening. Treat every external input as hostile, every secret as sacred, and every authorization check as mandatory.
|
|
83
11
|
|
|
84
|
-
|
|
85
|
-
[Provide concrete instructions and guidance for the subsequent Agent. If pass, list any medium/low security findings or recommendations for human consideration, directing the next verification/release Agent accordingly. If fail, list step-by-step remediation tasks for the implementer Agent to execute.]
|
|
86
|
-
|
|
87
|
-
### 🔍 Detailed Scope Analysis
|
|
88
|
-
- **Secrets & Configuration:** [Pass | Fail]
|
|
89
|
-
- **Input Validation & Injection:** [Pass | Fail]
|
|
90
|
-
- **Access Control & Auth:** [Pass | Fail]
|
|
91
|
-
- **Data Protection & Cryptography:** [Pass | Fail]
|
|
92
|
-
- **File System & Shell Safety:** [Pass | Fail]
|
|
93
|
-
|
|
94
|
-
## 5. AI Actions Performed
|
|
95
|
-
|
|
96
|
-
- Analyzed target codebase and traced untrusted inputs to critical sinks.
|
|
97
|
-
- Scanned for hardcoded secrets, API keys, and environment leaks.
|
|
98
|
-
|
|
99
|
-
## 6. Human Review Required
|
|
100
|
-
|
|
101
|
-
- Verify findings and evaluate false positives if any.
|
|
102
|
-
- Review medium/low risk suggestions for optional implementation.
|
|
103
|
-
|
|
104
|
-
## 7. Approval Status
|
|
105
|
-
|
|
106
|
-
- Pending
|
|
107
|
-
|
|
108
|
-
## 8. Next Allowed Command
|
|
109
|
-
|
|
110
|
-
- `40-implement {running_id}` (if fail, for code remediation)
|
|
111
|
-
- `50-verify {running_id}` (if pass, to verify execution correctness)
|
|
112
|
-
|
|
113
|
-
## 9. Nexus Event
|
|
114
|
-
|
|
115
|
-
- `Debug` for deep-dive diagnostics or debugging.
|
|
116
|
-
- `grill-with-docs` to clarify security guidelines.
|
|
117
|
-
|
|
118
|
-
## 10. Change Log
|
|
119
|
-
|
|
120
|
-
- {Date}: Initial English security review report created.
|
|
121
|
-
|
|
122
|
-
## 11. Additional Notes
|
|
12
|
+
---
|
|
123
13
|
|
|
124
|
-
|
|
125
|
-
```
|
|
14
|
+
## 1. The Three-Tier Security Boundary
|
|
126
15
|
|
|
127
|
-
|
|
16
|
+
### Always Do (No Exceptions)
|
|
17
|
+
- **Validate & sanitize all inputs** at the boundary (Zod, Yup, schema validation).
|
|
18
|
+
- **Parameterize all queries** — never concatenate user input into SQL/NoSQL queries.
|
|
19
|
+
- **Encode outputs** to prevent XSS (rely on framework auto-escaping).
|
|
20
|
+
- **Hash credentials** using bcrypt, Argon2, or scrypt.
|
|
21
|
+
- **Enforce secure cookies**: `httpOnly`, `secure`, `sameSite=lax/strict`.
|
|
128
22
|
|
|
129
|
-
|
|
23
|
+
### Never Do
|
|
24
|
+
- **Never commit secrets**, API keys, tokens, or credentials to git.
|
|
25
|
+
- **Never trust client-side checks** as a security barrier.
|
|
26
|
+
- **Never use `eval()`, `exec()`, or raw `innerHTML`** with untrusted user data.
|
|
27
|
+
- **Never expose internal stack traces** or detailed database errors to users.
|
|
130
28
|
|
|
131
|
-
|
|
132
|
-
### 🛡️ Security Review Result
|
|
133
|
-
- **Status:** pass
|
|
134
|
-
- **Reason:** No high-severity or Critical security vulnerabilities found
|
|
29
|
+
---
|
|
135
30
|
|
|
136
|
-
|
|
137
|
-
[List any medium, low security findings or recommendations for human consideration, directing the next verification/release Agent accordingly]
|
|
138
|
-
```
|
|
31
|
+
## 2. OWASP & Critical Vulnerability Vectors
|
|
139
32
|
|
|
140
|
-
|
|
33
|
+
| Category | Primary Risk | Mandatory Defense |
|
|
34
|
+
| :--- | :--- | :--- |
|
|
35
|
+
| **A01: Broken Access Control** | IDOR, missing role checks | Enforce server-side authorization on every endpoint/data fetch |
|
|
36
|
+
| **A02: Cryptographic Failures** | Plaintext tokens/passwords, weak cipher | Use TLS 1.3, salted hashing, secret managers / `.env` |
|
|
37
|
+
| **A03: Injection** | SQL, NoSQL, OS Command, Template | Parameterized queries, avoid shell spawning with user input |
|
|
38
|
+
| **A04: Insecure Design** | Missing rate limits, business logic flaw | Defense-in-depth, token bucket throttling, safe defaults |
|
|
39
|
+
| **A05: Security Misconfig** | Permissive CORS (`*`), exposed debug endpoints | Restrict CORS origins, disable debug/admin paths in production |
|
|
40
|
+
| **A07: Identification & Auth** | Session fixation, brute-force | Account lockouts, secure session rotation, MFA support |
|
|
41
|
+
| **A08: Software & Data Integrity**| Untrusted CI/CD packages, deserialization | Run `npm audit`, pin dependency hashes, validate payloads |
|
|
42
|
+
| **A09: Logging & Monitoring** | Missing audit logs or logging secrets | Structured logging with PII masking, alert on repeated auth failure |
|
|
43
|
+
| **A10: SSRF** | Fetching internal URLs from user input | Whitelist allowable destination protocols and domains |
|
|
141
44
|
|
|
142
|
-
|
|
45
|
+
---
|
|
143
46
|
|
|
144
|
-
|
|
145
|
-
- Explain why the issue is High/Critical Severity with file and line references.
|
|
146
|
-
- In **Suggestions for Next Agent Action / Handoff**, write a clear set of step-by-step remediation tasks for the Coder/Implementer Agent to resolve the vulnerability.
|
|
47
|
+
## 3. Security Review Process
|
|
147
48
|
|
|
148
|
-
|
|
49
|
+
1. **Target & Scope**: Inspect targeted files, PR diffs, or entire project directories.
|
|
50
|
+
2. **Trace Trust Boundaries**: Follow untrusted data from entry (HTTP handlers, CLI arguments, file uploads) to sinks (DB, shell, HTML).
|
|
51
|
+
3. **Scan for Secrets & Configs**: Detect hardcoded passwords, private keys, and environment variable leaks.
|
|
52
|
+
4. **Generate Report**: Save formal security audits under:
|
|
53
|
+
```text
|
|
54
|
+
devflow/runs/{ID}-{slug}/security-review.md
|
|
55
|
+
```
|
|
149
56
|
|
|
150
|
-
|
|
151
|
-
- **Hardcoded secrets**: passwords, API keys, private keys, database strings.
|
|
152
|
-
- **Injections**: SQL, NoSQL, OS Command, Template, or Path traversal.
|
|
153
|
-
- **Unvalidated inputs**: dynamic evaluation (`eval`), shell execution, or raw unescaped HTML rendering.
|
|
154
|
-
- **Insecure configuration**: broken authorization, sensitive exposure in public endpoints/logs.
|
|
57
|
+
---
|
|
155
58
|
|
|
156
59
|
## Relationship To DevFlow 2.0
|
|
157
60
|
|
|
158
|
-
- **Classification**: Companion command
|
|
159
|
-
- **Mainline
|
|
160
|
-
- **
|
|
161
|
-
|
|
162
|
-
## Sources
|
|
163
|
-
|
|
164
|
-
- `AGENTS.md`
|
|
165
|
-
- `.agent/resources/schemas/security_review.template.md`
|
|
166
|
-
- `docs/workspace-artifacts.md`
|
|
61
|
+
- **Classification**: Companion command & Safety gate
|
|
62
|
+
- **Mainline integration**: Run during `40-implement` or `50-verify` before `70-release`.
|
|
63
|
+
- **Handoff**: P0/P1 security findings block release and return to `40-implement` for immediate remediation.
|
|
@@ -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).
|