@jakkrichm/create-nexus-devflow 2.0.11 → 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.
Files changed (125) hide show
  1. package/bin/create-nexus-devflow.js +15 -3
  2. package/lib/update.js +15 -1
  3. package/package.json +1 -1
  4. package/template/.agents/skills/70-release/SKILL.md +2 -0
  5. package/template/.agents/skills/ci/SKILL.md +25 -78
  6. package/template/.agents/skills/commit/SKILL.md +39 -43
  7. package/template/.agents/skills/debug/SKILL.md +43 -104
  8. package/template/.agents/skills/deploy/SKILL.md +37 -65
  9. package/template/.agents/skills/insight/SKILL.md +27 -116
  10. package/template/.agents/skills/preview/SKILL.md +24 -103
  11. package/template/.agents/skills/review/SKILL.md +53 -37
  12. package/template/.agents/skills/rollback/SKILL.md +1 -0
  13. package/template/.agents/skills/security-review/SKILL.md +44 -147
  14. package/template/.agents/skills/simplify/SKILL.md +48 -57
  15. package/template/.agents/skills/test/SKILL.md +63 -51
  16. package/template/.claude/skills/70-release/SKILL.md +2 -0
  17. package/template/.claude/skills/ci/SKILL.md +25 -78
  18. package/template/.claude/skills/commit/SKILL.md +39 -43
  19. package/template/.claude/skills/debug/SKILL.md +43 -104
  20. package/template/.claude/skills/deploy/SKILL.md +37 -65
  21. package/template/.claude/skills/insight/SKILL.md +27 -116
  22. package/template/.claude/skills/preview/SKILL.md +24 -103
  23. package/template/.claude/skills/review/SKILL.md +53 -37
  24. package/template/.claude/skills/rollback/SKILL.md +1 -0
  25. package/template/.claude/skills/security-review/SKILL.md +44 -147
  26. package/template/.claude/skills/simplify/SKILL.md +48 -57
  27. package/template/.claude/skills/test/SKILL.md +63 -51
  28. package/template/devflow/history/HISTORY.md +27 -0
  29. package/template/devflow/reference/running-id-contract.md +1 -1
  30. package/template/.agents/skills/9arm-skills/README.md +0 -51
  31. package/template/.agents/skills/9arm-skills/debug-mantra/SKILL.md +0 -86
  32. package/template/.agents/skills/9arm-skills/management-talk/SKILL.md +0 -79
  33. package/template/.agents/skills/9arm-skills/post-mortem/SKILL.md +0 -71
  34. package/template/.agents/skills/9arm-skills/scrutinize/SKILL.md +0 -72
  35. package/template/.agents/skills/browser-testing-with-devtools/SKILL.md +0 -302
  36. package/template/.agents/skills/ci-cd-and-automation/SKILL.md +0 -390
  37. package/template/.agents/skills/code-review-and-quality/SKILL.md +0 -392
  38. package/template/.agents/skills/code-simplification/SKILL.md +0 -331
  39. package/template/.agents/skills/debugging-and-error-recovery/SKILL.md +0 -298
  40. package/template/.agents/skills/deployment-procedures/SKILL.md +0 -241
  41. package/template/.agents/skills/deprecation-and-migration/SKILL.md +0 -206
  42. package/template/.agents/skills/diagnosing-bugs/SKILL.md +0 -93
  43. package/template/.agents/skills/git-workflow-and-versioning/SKILL.md +0 -300
  44. package/template/.agents/skills/human-review-decisions/SKILL.md +0 -74
  45. package/template/.agents/skills/idea-refine/SKILL.md +0 -178
  46. package/template/.agents/skills/idea-refine/examples.md +0 -238
  47. package/template/.agents/skills/idea-refine/frameworks.md +0 -99
  48. package/template/.agents/skills/idea-refine/refinement-criteria.md +0 -113
  49. package/template/.agents/skills/idea-refine/scripts/idea-refine.sh +0 -15
  50. package/template/.agents/skills/incremental-implementation/SKILL.md +0 -248
  51. package/template/.agents/skills/insight-capture/SKILL.md +0 -84
  52. package/template/.agents/skills/intelligent-routing/SKILL.md +0 -176
  53. package/template/.agents/skills/md2html/SKILL.md +0 -154
  54. package/template/.agents/skills/md2html/components.md +0 -505
  55. package/template/.agents/skills/md2html/template.html +0 -1152
  56. package/template/.agents/skills/planning-and-task-breakdown/SKILL.md +0 -239
  57. package/template/.agents/skills/pr-review/SKILL.md +0 -143
  58. package/template/.agents/skills/pr-review-analysis/SKILL.md +0 -89
  59. package/template/.agents/skills/preview-local-check/SKILL.md +0 -59
  60. package/template/.agents/skills/release-git-operations/SKILL.md +0 -97
  61. package/template/.agents/skills/review-followup-routing/SKILL.md +0 -98
  62. package/template/.agents/skills/security-and-hardening/SKILL.md +0 -349
  63. package/template/.agents/skills/security-and-hardening/security-checklist.md +0 -134
  64. package/template/.agents/skills/shipping-and-launch/SKILL.md +0 -311
  65. package/template/.agents/skills/silent-failure-audit/SKILL.md +0 -73
  66. package/template/.agents/skills/spec-orchestration/SKILL.md +0 -91
  67. package/template/.agents/skills/specialist-agent-routing/SKILL.md +0 -107
  68. package/template/.agents/skills/test-driven-development/SKILL.md +0 -422
  69. package/template/.agents/skills/test-driven-development/testing-patterns.md +0 -236
  70. package/template/.agents/skills/test-execution-and-coverage/SKILL.md +0 -56
  71. package/template/.agents/skills/using-agent-skills/SKILL.md +0 -171
  72. package/template/.agents/skills/verification-orchestration/SKILL.md +0 -68
  73. package/template/.agents/skills/vulnerability-scanner/SKILL.md +0 -276
  74. package/template/.agents/skills/vulnerability-scanner/checklists.md +0 -121
  75. package/template/.agents/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  76. package/template/.agents/skills/wiki/SKILL.md +0 -149
  77. package/template/.agents/skills/workflow-documentation-sync/SKILL.md +0 -87
  78. package/template/.claude/skills/9arm-skills/README.md +0 -51
  79. package/template/.claude/skills/9arm-skills/debug-mantra/SKILL.md +0 -86
  80. package/template/.claude/skills/9arm-skills/management-talk/SKILL.md +0 -79
  81. package/template/.claude/skills/9arm-skills/post-mortem/SKILL.md +0 -71
  82. package/template/.claude/skills/9arm-skills/scrutinize/SKILL.md +0 -72
  83. package/template/.claude/skills/browser-testing-with-devtools/SKILL.md +0 -302
  84. package/template/.claude/skills/ci-cd-and-automation/SKILL.md +0 -390
  85. package/template/.claude/skills/code-review-and-quality/SKILL.md +0 -392
  86. package/template/.claude/skills/code-simplification/SKILL.md +0 -331
  87. package/template/.claude/skills/debugging-and-error-recovery/SKILL.md +0 -298
  88. package/template/.claude/skills/deployment-procedures/SKILL.md +0 -241
  89. package/template/.claude/skills/deprecation-and-migration/SKILL.md +0 -206
  90. package/template/.claude/skills/diagnosing-bugs/SKILL.md +0 -93
  91. package/template/.claude/skills/git-workflow-and-versioning/SKILL.md +0 -300
  92. package/template/.claude/skills/human-review-decisions/SKILL.md +0 -74
  93. package/template/.claude/skills/idea-refine/SKILL.md +0 -178
  94. package/template/.claude/skills/idea-refine/examples.md +0 -238
  95. package/template/.claude/skills/idea-refine/frameworks.md +0 -99
  96. package/template/.claude/skills/idea-refine/refinement-criteria.md +0 -113
  97. package/template/.claude/skills/idea-refine/scripts/idea-refine.sh +0 -15
  98. package/template/.claude/skills/incremental-implementation/SKILL.md +0 -248
  99. package/template/.claude/skills/insight-capture/SKILL.md +0 -84
  100. package/template/.claude/skills/intelligent-routing/SKILL.md +0 -176
  101. package/template/.claude/skills/md2html/SKILL.md +0 -154
  102. package/template/.claude/skills/md2html/components.md +0 -505
  103. package/template/.claude/skills/md2html/template.html +0 -1152
  104. package/template/.claude/skills/planning-and-task-breakdown/SKILL.md +0 -239
  105. package/template/.claude/skills/pr-review/SKILL.md +0 -143
  106. package/template/.claude/skills/pr-review-analysis/SKILL.md +0 -89
  107. package/template/.claude/skills/preview-local-check/SKILL.md +0 -59
  108. package/template/.claude/skills/release-git-operations/SKILL.md +0 -97
  109. package/template/.claude/skills/review-followup-routing/SKILL.md +0 -98
  110. package/template/.claude/skills/security-and-hardening/SKILL.md +0 -349
  111. package/template/.claude/skills/security-and-hardening/security-checklist.md +0 -134
  112. package/template/.claude/skills/shipping-and-launch/SKILL.md +0 -311
  113. package/template/.claude/skills/silent-failure-audit/SKILL.md +0 -73
  114. package/template/.claude/skills/spec-orchestration/SKILL.md +0 -91
  115. package/template/.claude/skills/specialist-agent-routing/SKILL.md +0 -107
  116. package/template/.claude/skills/test-driven-development/SKILL.md +0 -422
  117. package/template/.claude/skills/test-driven-development/testing-patterns.md +0 -236
  118. package/template/.claude/skills/test-execution-and-coverage/SKILL.md +0 -56
  119. package/template/.claude/skills/using-agent-skills/SKILL.md +0 -171
  120. package/template/.claude/skills/verification-orchestration/SKILL.md +0 -68
  121. package/template/.claude/skills/vulnerability-scanner/SKILL.md +0 -276
  122. package/template/.claude/skills/vulnerability-scanner/checklists.md +0 -121
  123. package/template/.claude/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  124. package/template/.claude/skills/wiki/SKILL.md +0 -149
  125. package/template/.claude/skills/workflow-documentation-sync/SKILL.md +0 -87
@@ -1,55 +1,71 @@
1
1
  ---
2
2
  name: review
3
- description: "[Devflow] Two-axis review for changed work. Use inside 50-verify or 70-release when a branch, PR, or work-in-progress diff needs standards and spec review."
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
- Use this support skill as one verification lane. `50-verify` owns validation evidence; this skill reviews a diff from two separate angles.
8
+ ## Overview
9
9
 
10
- ## Axes
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
- - **Standards**: does the change follow documented repo conventions?
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
- Keep the axes separate so one does not hide the other.
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
- ## Process
24
+ ---
25
+
26
+ ## 2. The Five-Axis Review Framework
18
27
 
19
- 1. Pin the fixed point.
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
- 2. Identify the spec source.
25
- - Prefer `devflow/runs/{ID}-*20-spec.md`, `30-plan.md`, issue brief, PRD, or explicit user path.
26
- - If no spec exists, mark the Spec axis as skipped.
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
- 3. Identify standards sources.
29
- - Look for repo docs such as `AGENTS.md`, `CONTRIBUTING.md`, coding standards, workflow docs, or stage contracts.
42
+ ---
30
43
 
31
- 4. Review standards.
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
- 5. Review spec.
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
- 6. Aggregate findings.
42
- - Present `Standards` and `Spec` separately.
43
- - Lead with concrete findings and file references.
44
- - Record residual risk and skipped axes.
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
- ## Output
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
- Return:
67
+ ## Relationship To DevFlow 2.0
49
68
 
50
- - fixed point and diff scope
51
- - standards sources
52
- - spec source or skipped reason
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
- # Security Review
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
- - Global security constraints and authorization invariants.
76
- - Known exceptions or legacy patterns excluded from security flags.
6
+ # Security Review, Hardening & Vulnerability Audit
77
7
 
78
- ## 4. Stage-Specific Content
8
+ ## Overview
79
9
 
80
- ### 🛡️ Security Review Result
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
- ### 💡 Suggestions for Next Agent Action / Handoff
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
- - [Add custom sub-headings below if needed]
125
- ```
14
+ ## 1. The Three-Tier Security Boundary
126
15
 
127
- ## Pass Response Requirements
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
- When no High Severity or Critical vulnerability is found, the sections under **Stage-Specific Content** must be formatted as:
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
- ```markdown
132
- ### 🛡️ Security Review Result
133
- - **Status:** pass
134
- - **Reason:** No high-severity or Critical security vulnerabilities found
29
+ ---
135
30
 
136
- ### 💡 Suggestions for Next Agent Action / Handoff
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
- ## Fail Response Requirements
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
- When a High Severity or Critical vulnerability is found:
45
+ ---
143
46
 
144
- - Use status `fail`.
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
- ## Security Scope & Rules
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
- Evaluate high-severity risks including:
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 Status**: Not part of the linear Timeline. Can be run at any stage.
160
- - **Typical Entry Points**: Any stage, especially before `50-verify` or `70-release` to verify security health.
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
- Invoke the `code-simplification` skill.
8
+ ## Overview
13
9
 
14
- Primary behavior already lives in:
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
- Treat this workflow file as a wrapper around that skill.
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
- Use this workflow when the code works but has grown harder to read, harder to change, or more general than necessary.
14
+ ---
23
15
 
24
- In DevFlow 2.0, `Simplify` is a supporting implementation workflow. It usually pairs with `40-implement` and should end in `50-verify`.
16
+ ## 1. The Five Principles of Simplification
25
17
 
26
- ## Process
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
- 1. Read project instructions and study local conventions.
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
- ```text
44
- devflow/reports/{date}-refactoring-{slug}.md
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
- 8. Verify tests pass, the build succeeds, and the diff stays behavior-preserving.
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
- ## Output
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
- Return:
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
- ## Sources
57
+ ## 3. Verification & Safety Loop
68
58
 
69
- - `AGENTS.md`
70
- - `.agents/skills/code-simplification/SKILL.md`
71
- - `.agent/resources/schemas/refactoring.template.md`
72
- - Related commands: `40-implement`, `50-verify`, `PR-Review`, `Agent`
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
- ## Next Workflow Recommendation
64
+ ---
75
65
 
76
- - **Primary**: `50-verify`
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 execution, missing test generation, and coverage analysis across unit, integration, and smoke test suites."
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
- Generates missing tests, runs existing test suites, or checks test coverage for the project.
8
+ ## Overview
14
9
 
15
- Primary behavior now lives in:
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
- .agents/skills/test-execution-and-coverage/SKILL.md
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
- Treat this workflow file as a compatibility wrapper around that skill.
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
- ## ๐Ÿ› ๏ธ Sub-commands
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
- - `/13-Test` - Run all tests
28
- - `/13-Test [file/feature]` - Generate tests for a specific target
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
- ## ๐Ÿšฆ Internal Process
43
+ ## 2. The Prove-It Pattern (Bug Reproduction)
35
44
 
36
- ### Scenario A: Generate Tests
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
- ### Scenario B: Execute Tests
45
- Use the project's native command (e.g., `npm test`, `pytest`) to run the tests and format the output clearly for the user. Highlight any failed tests with expected vs received values. Save the execution summary report matching the template to `devflow/reports/{date}-test-report-run.md` (where `{date}` is today's date in `YYYY-MM-DD` format).
47
+ ```text
48
+ Bug report arrives Write reproduction test (FAILS) Implement fix Test PASSES Guard regression
49
+ ```
46
50
 
47
51
  ---
48
52
 
49
- ## ๐Ÿ›ก๏ธ Key Principles
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
- ## ๐Ÿ“ Output Formats
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
- ### For Test Generation
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
- ### For Test Execution
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
- ## Relationship To DevFlow 2.0
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
- - Classification: Companion command
71
- - Mainline status: Verification support command, not a numbered stage
72
- - Typical entry points: `40-implement`, `50-verify`, `Debug`
73
- - Typical handoff targets: `50-verify`, `Debug`, `QA-Orchestrate`
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
- ## Sources
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
- - `AGENTS.md`
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`
@@ -0,0 +1,27 @@
1
+ # Nexus-DevFlow Master Release History Ledger
2
+
3
+ This master ledger tracks all released delivery runs, milestones, and rollbacks in chronological order. Each entry is recorded during the `70-release` stage and links to its exact Git commit hash, release tag, and generated delivery artifacts.
4
+
5
+ ---
6
+
7
+ ## 📜 Release Log
8
+
9
+ | Release Date | Running ID | Title | Git Tag / Commit | Release Status | Report Link |
10
+ | :--- | :--- | :--- | :--- | :--- | :--- |
11
+ | 2026-08-18 | `RUN-008` | ปรับปรุงโครงสร้าง Nexus-DevFlow ให้ Lean & Clean ยุบรวม Skills บริหารจัดการ History และ Safe Rollback | `be713ea` | `Released` | [`60-report.md`](../runs/RUN-008-lean-and-clean-devflow-optimization/60-report.md) |
12
+ | 2026-08-18 | `RUN-007` | ยกระดับระบบ Nexus-DevFlow ด้วยวินัยและกลไกสำคัญจาก Blueprint | `e79528b` | `Released` | [`60-report.md`](../runs/RUN-007-integrate-blueprint-skills-enhancements/60-report.md) |
13
+ | 2026-08-18 | `RUN-006` | Standardize Command Naming and Provider Invocation | `HEAD` | `Released` | [`60-report.md`](../runs/RUN-006-standardize-command-naming-and-provider-invocation/60-report.md) |
14
+ | 2026-08-18 | `RUN-005` | Add DevFlow Prefix to Skill Descriptions | `HEAD` | `Released` | [`60-report.md`](../runs/RUN-005-add-devflow-prefix-to-skill-descriptions/60-report.md) |
15
+ | 2026-08-18 | `RUN-004` | Add Autopilot Skill | `HEAD` | `Released` | [`60-report.md`](../runs/RUN-004-add-autopilot-skill/60-report.md) |
16
+ | 2026-08-18 | `RUN-003` | Add Try, Rollback, CI, Brief Skills | `HEAD` | `Released` | [`60-report.md`](../runs/RUN-003-add-try-rollback-ci-brief-skills/60-report.md) |
17
+ | 2026-08-18 | `RUN-002` | Add Onboard, Adopt, Doctor Skills | `HEAD` | `Released` | [`60-report.md`](../runs/RUN-002-add-onboard-adopt-doctor-skills/60-report.md) |
18
+ | 2026-08-18 | `RUN-001` | Align DevFlow with Blueprint Architecture | `HEAD` | `Released` | [`60-report.md`](../runs/RUN-001-align-devflow-blueprint/60-report.md) |
19
+
20
+ ---
21
+
22
+ ## 🗄️ Run Lifecycle States
23
+
24
+ - **Active**: Currently executing in `devflow/runs/{running-id}-{slug}/` (tracked in `devflow/context/current-stage.md`).
25
+ - **Released**: Finished `70-release`, merged, and logged in this master ledger.
26
+ - **Archived**: Older historical runs moved to `devflow/history/archived-runs/` to maintain a clean workspace.
27
+ - **Rolled Back**: Features safely reversed via `/rollback` with documented post-reversal verification.
@@ -35,5 +35,5 @@ All DevFlow framework context, active runs, templates, and history are consolida
35
35
  ## Mainline Lifecycle Rules
36
36
 
37
37
  1. Mainline stages move linearly: `/00-Discover` ➔ `/10-Define` ➔ `/20-Spec` ➔ `/30-Plan` ➔ `/40-Implement` ➔ `/50-Verify` ➔ `/60-Report` ➔ `/70-Release`.
38
- 2. Companion commands (`Goal`, `Brainstorm`, `Research`, `Debug`, `PRD`, `Issue-Triage`, `Security-Review`, `Wiki`, `Check-For-Updates`, `Help`) provide supporting context without replacing mainline stage numbers.
38
+ 2. Companion commands (`Goal`, `Brainstorm`, `Research`, `Debug`, `PRD`, `Issue-Triage`, `Security-Review`, `Check-For-Updates`, `Help`) provide supporting context without replacing mainline stage numbers.
39
39
  3. Every stage produces markdown-first evidence in `devflow/runs/` before passing verification gates.