devflow-kit 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/CHANGELOG.md +177 -0
  2. package/README.md +86 -18
  3. package/dist/agents/git.md +824 -0
  4. package/dist/cli/commands/agents.js +6 -1
  5. package/dist/cli/commands/attribution-prompts.js +144 -0
  6. package/dist/cli/commands/compliance-prompts.js +7 -11
  7. package/dist/cli/commands/compliance.js +23 -1
  8. package/dist/cli/commands/init-seed.js +69 -30
  9. package/dist/cli/commands/init.js +551 -77
  10. package/dist/cli/commands/install-report.js +205 -0
  11. package/dist/cli/commands/knowledge/index.js +2 -2
  12. package/dist/cli/commands/knowledge/toggle.js +27 -37
  13. package/dist/cli/commands/learning.js +37 -30
  14. package/dist/cli/commands/memory.js +79 -69
  15. package/dist/cli/commands/prompt-io.js +38 -0
  16. package/dist/cli/commands/proxy.js +91 -31
  17. package/dist/cli/commands/security.js +76 -16
  18. package/dist/cli/commands/skills.js +53 -7
  19. package/dist/cli/commands/tracker-prompts.js +145 -0
  20. package/dist/cli/commands/tracker.js +405 -0
  21. package/dist/cli/commands/uninstall.js +233 -77
  22. package/dist/cli.js +2 -0
  23. package/dist/commands/bug-analysis.md +22 -4
  24. package/dist/commands/code-review.md +44 -15
  25. package/dist/commands/debug.md +20 -6
  26. package/dist/commands/dynamic-build.md +289 -67
  27. package/dist/commands/dynamic-plan.md +60 -21
  28. package/dist/commands/dynamic-profile.md +1 -1
  29. package/dist/commands/dynamic-tickets.md +58 -8
  30. package/dist/commands/explore.md +2 -2
  31. package/dist/commands/implement.md +241 -53
  32. package/dist/commands/plan.md +88 -17
  33. package/dist/commands/release.md +64 -17
  34. package/dist/commands/resolve.md +138 -58
  35. package/dist/commands/self-review.md +2 -2
  36. package/dist/core/agent-models.js +55 -12
  37. package/dist/core/assets.js +58 -2
  38. package/dist/core/evidence-policy.js +147 -0
  39. package/dist/core/feature-config.js +130 -64
  40. package/dist/core/feature-switch.js +112 -0
  41. package/dist/core/flags.js +149 -8
  42. package/dist/core/manifest.js +33 -7
  43. package/dist/core/mds-variants.js +861 -0
  44. package/dist/core/model-discovery.js +12 -1
  45. package/dist/core/plugins.js +357 -9
  46. package/dist/core/project-paths.js +1 -1
  47. package/dist/core/proxy-log.js +8 -4
  48. package/dist/core/proxy-state.js +100 -43
  49. package/dist/core/reference-sweep.js +136 -0
  50. package/dist/core/tracker.js +407 -0
  51. package/dist/skills/git/references/decision-markers.md +19 -0
  52. package/dist/skills/git/references/learn-conventions.md +56 -0
  53. package/dist/skills/git/references/pr/check-ci-status.md +14 -0
  54. package/dist/skills/git/references/pr/check-merge-readiness.md +28 -0
  55. package/dist/skills/git/references/pr/ensure-pr-ready.md +24 -0
  56. package/dist/skills/git/references/pr/fetch-review-threads.md +22 -0
  57. package/dist/skills/git/references/pr/post-resolution-summary.md +40 -0
  58. package/dist/skills/git/references/pr/post-review-summary.md +42 -0
  59. package/dist/skills/git/references/pr/resolve-review-threads.md +35 -0
  60. package/dist/skills/git/references/pr/update-pr-evidence.md +14 -0
  61. package/dist/skills/git/references/pr/validate-branch.md +18 -0
  62. package/dist/skills/git/references/publication-gate.md +13 -0
  63. package/dist/skills/git/references/tracker/_mcp.md +153 -0
  64. package/dist/skills/git/references/tracker/github/associate-release.md +18 -0
  65. package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +40 -0
  66. package/dist/skills/git/references/tracker/github/create-release.md +11 -0
  67. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +16 -0
  68. package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +69 -0
  69. package/dist/skills/git/references/tracker/github/fetch-issue.md +32 -0
  70. package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +17 -0
  71. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +19 -0
  72. package/dist/skills/git/references/tracker/github/manage-debt.md +101 -0
  73. package/dist/skills/git/references/tracker/github/post-wave-report.md +28 -0
  74. package/dist/skills/git/references/tracker/github/setup-task.md +26 -0
  75. package/dist/skills/git/references/tracker/jira/associate-release.md +18 -0
  76. package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +49 -0
  77. package/dist/skills/git/references/tracker/jira/create-release.md +17 -0
  78. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +22 -0
  79. package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +53 -0
  80. package/dist/skills/git/references/tracker/jira/fetch-issue.md +14 -0
  81. package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +15 -0
  82. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +18 -0
  83. package/dist/skills/git/references/tracker/jira/manage-debt.md +37 -0
  84. package/dist/skills/git/references/tracker/jira/post-wave-report.md +33 -0
  85. package/dist/skills/git/references/tracker/jira/setup-task.md +31 -0
  86. package/dist/skills/git/references/tracker/linear/associate-release.md +18 -0
  87. package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +53 -0
  88. package/dist/skills/git/references/tracker/linear/create-release.md +17 -0
  89. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +22 -0
  90. package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +53 -0
  91. package/dist/skills/git/references/tracker/linear/fetch-issue.md +14 -0
  92. package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +15 -0
  93. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +18 -0
  94. package/dist/skills/git/references/tracker/linear/manage-debt.md +37 -0
  95. package/dist/skills/git/references/tracker/linear/post-wave-report.md +33 -0
  96. package/dist/skills/git/references/tracker/linear/setup-task.md +32 -0
  97. package/dist/skills/git/references/trust-rule.md +7 -0
  98. package/dist/targets/claude-code/installer.js +1213 -31
  99. package/dist/targets/claude-code/legacy.js +5 -0
  100. package/dist/targets/claude-code/post-install.js +303 -104
  101. package/dist/targets/claude-code/tracker-install.js +161 -0
  102. package/package.json +4 -3
  103. package/src/assets/agents/code.md +42 -4
  104. package/src/assets/agents/design.md +1 -1
  105. package/src/assets/agents/git.mds +827 -0
  106. package/src/assets/agents/knowledge.md +1 -1
  107. package/src/assets/agents/learning.md +11 -0
  108. package/src/assets/agents/synthesize.md +1 -1
  109. package/src/assets/agents/test.md +16 -5
  110. package/src/assets/agents/tracker.md +467 -0
  111. package/src/assets/agents/validate.md +7 -5
  112. package/src/assets/commands/_partials/_engine.mds +11 -9
  113. package/src/assets/commands/_partials/_evidence_policy.mds +30 -0
  114. package/src/assets/commands/_partials/_knowledge.mds +2 -2
  115. package/src/assets/commands/_partials/_plan_contract.mds +22 -7
  116. package/src/assets/commands/_partials/_preamble.mds +1 -1
  117. package/src/assets/commands/_partials/_publication.mds +3 -1
  118. package/src/assets/commands/_partials/_ticket_template.mds +3 -2
  119. package/src/assets/commands/_partials/_tracker.mds +18 -0
  120. package/src/assets/commands/_partials/_wave.mds +16 -10
  121. package/src/assets/commands/bug-analysis.mds +15 -5
  122. package/src/assets/commands/code-review.mds +34 -14
  123. package/src/assets/commands/debug.mds +11 -4
  124. package/src/assets/commands/dynamic-build.mds +227 -41
  125. package/src/assets/commands/dynamic-plan.mds +35 -13
  126. package/src/assets/commands/dynamic-tickets.mds +47 -5
  127. package/src/assets/commands/implement.mds +206 -52
  128. package/src/assets/commands/plan.mds +70 -17
  129. package/src/assets/commands/release.md +64 -17
  130. package/src/assets/commands/resolve.mds +126 -56
  131. package/src/assets/mds/git/_pr.mds +331 -0
  132. package/src/assets/mds/git/_references.mds +135 -0
  133. package/src/assets/mds/tracker/_common.mds +156 -0
  134. package/src/assets/mds/tracker/_github.mds +472 -0
  135. package/src/assets/mds/tracker/_jira.mds +407 -0
  136. package/src/assets/mds/tracker/_linear.mds +449 -0
  137. package/src/assets/mds/tracker/_mcp.mds +299 -0
  138. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +5 -8
  139. package/src/assets/scripts/hooks/background-memory-update +14 -9
  140. package/src/assets/scripts/hooks/capture-prompt +6 -2
  141. package/src/assets/scripts/hooks/capture-question +6 -2
  142. package/src/assets/scripts/hooks/capture-turn +6 -2
  143. package/src/assets/scripts/hooks/ensure-devflow-init +1 -1
  144. package/src/assets/scripts/hooks/ensure-proxy +64 -5
  145. package/src/assets/scripts/hooks/ensure-root-gitignore +161 -60
  146. package/src/assets/scripts/hooks/hook-log-init +3 -1
  147. package/src/assets/scripts/hooks/json-helper.cjs +223 -5
  148. package/src/assets/scripts/hooks/lib/project-paths.cjs +1 -1
  149. package/src/assets/scripts/hooks/memory-worker +15 -8
  150. package/src/assets/scripts/hooks/pre-compact-memory +12 -8
  151. package/src/assets/scripts/hooks/preamble +1 -4
  152. package/src/assets/scripts/hooks/queue-append +68 -24
  153. package/src/assets/scripts/hooks/session-start-context +355 -8
  154. package/src/assets/scripts/hooks/session-start-memory +12 -8
  155. package/src/assets/scripts/pr-evidence.cjs +1961 -0
  156. package/src/assets/scripts/redact-secrets.cjs +490 -62
  157. package/src/assets/scripts/release-trace.cjs +1143 -0
  158. package/src/assets/scripts/resolve-evidence-policy.cjs +1065 -0
  159. package/src/assets/scripts/verify-evidence.cjs +1822 -0
  160. package/src/assets/skills/compliance/SKILL.md +2 -0
  161. package/src/assets/skills/docs-framework/SKILL.md +5 -3
  162. package/src/assets/skills/git/SKILL.md +8 -82
  163. package/src/assets/skills/git/references/github-api.md +179 -141
  164. package/src/assets/skills/git/references/patterns.md +11 -12
  165. package/src/assets/skills/review-methodology/SKILL.md +1 -1
  166. package/src/assets/skills/review-methodology/references/patterns.md +6 -61
  167. package/src/assets/skills/review-methodology/references/violations.md +14 -22
  168. package/src/targets/claude-code/templates/settings.json +0 -4
  169. package/src/assets/agents/git.md +0 -938
@@ -28,6 +28,8 @@ ${DEVFLOW_COMPLIANCE_ACTIVE}
28
28
 
29
29
  Compliance covers regulatory-specific gaps: retention, erasure/data-subject rights, audit-trail completeness (actor/purpose fields), segregation of duties, framework mapping, IaC exposure. Do NOT re-raise security lens findings (injection, secret handling, authN/Z) — reference those via framework mapping only.
30
30
 
31
+ **Lens only.** This skill shapes what a compliance review looks for in the diff or design. It does not decide how much evidence a change must carry: tracker links, test plans, approvals and release traces follow the repository's evidence policy. Never report a missing ticket, test plan or approval as a compliance finding.
32
+
31
33
  ## Clean-Report Contract
32
34
 
33
35
  If the diff/design has no regulated-data surface (no PII/PHI/payment fields, no sensitive data in logs, no IaC, no auth/audit/retention changes) → emit zero findings with a one-line "no compliance-relevant surface detected" note. Never manufacture findings.
@@ -42,7 +42,7 @@ All generated documentation lives under `.devflow/docs/` in the project root:
42
42
  │ ├── bug-analysis-summary.md # Synthesize agent output
43
43
  │ └── resolution-summary.md # Written by /resolve (if run)
44
44
  ├── design/ # Design artifacts from /plan
45
- │ └── {issue}-{topic-slug}.{timestamp}.md # Design document
45
+ │ └── {ISSUE_ID}-{topic-slug}.{timestamp}.md # Design document
46
46
  ├── tickets/{slug}/ # Ticket sets from /dynamic-tickets
47
47
  │ └── {YYYY-MM-DD_HHMM}/ # Timestamped ticket directory
48
48
  │ ├── {ticket-slug}.md # Individual ticket files
@@ -71,6 +71,8 @@ All generated documentation lives under `.devflow/docs/` in the project root:
71
71
  └── pitfalls.md # Known pitfalls (PF-NNN format)
72
72
  ```
73
73
 
74
+ `{ISSUE_ID}` in the `design/` path is the filesystem-safe issue identifier the Git agent emits as `- **Issue ID**:` under `### Handoff Values`.
75
+
74
76
  ---
75
77
 
76
78
  ## Naming Conventions
@@ -103,7 +105,7 @@ TOPIC_SLUG=$(echo "$TOPIC" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed 's/[^
103
105
  | Resolution summary | `resolution-summary.md` in timestamped dir | `2025-12-26_1430/resolution-summary.md` |
104
106
  | Review head marker | `.last-review-head` | Plain text file with SHA |
105
107
  | Status logs | `{timestamp}.md` | `2025-12-26_1430.md` |
106
- | Design documents | `{issue}-{topic-slug}.{timestamp}.md` | `42-jwt-auth.2026-04-07_1430.md` |
108
+ | Design documents | `{ISSUE_ID}-{topic-slug}.{timestamp}.md` | `42-jwt-auth.2026-04-07_1430.md` |
107
109
  | Research outputs | `{type}.md` in timestamped dir | `2025-12-26_1430/codebase.md` |
108
110
  | Research summary | `research-summary.md` in timestamped dir | `2025-12-26_1430/research-summary.md` |
109
111
  | Bug analysis reports | `{focus}.md` in timestamped dir | `2025-12-26_1430/security.md` |
@@ -141,7 +143,7 @@ source .devflow/scripts/docs-helpers.sh 2>/dev/null || {
141
143
  | Working Memory | `.devflow/memory/WORKING-MEMORY.md` | Overwrites (auto-maintained by Stop hook) |
142
144
  | Decisions | `.devflow/learning/decisions.md` | Rendered from `decisions-ledger.jsonl` (active ADR-NNN rows; retired rows dropped) |
143
145
  | Pitfalls | `.devflow/learning/pitfalls.md` | Rendered from `decisions-ledger.jsonl` (active PF-NNN rows; retired rows dropped) |
144
- | Design agent (via /plan) | `.devflow/docs/design/{issue}-{topic-slug}.{timestamp}.md` | Creates new design artifact |
146
+ | Design agent (via /plan) | `.devflow/docs/design/{ISSUE_ID}-{topic-slug}.{timestamp}.md` | Creates new design artifact |
145
147
  | Research agent | `.devflow/docs/research/{topic-slug}/{timestamp}/{type}.md` | Creates new in timestamped dir |
146
148
  | Synthesize agent (research) | `.devflow/docs/research/{topic-slug}/{timestamp}/research-summary.md` | Creates new in timestamped dir |
147
149
  | Diagnose agent | `.devflow/docs/bug-analysis/{branch-slug}/{timestamp}/{focus}.md` | Creates new in timestamped dir |
@@ -21,11 +21,7 @@ Unified skill for safe git operations, atomic commits, honest PR descriptions, a
21
21
 
22
22
  ## When This Skill Activates
23
23
 
24
- - Staging files, creating commits, pushing branches
25
- - Creating or updating pull requests
26
- - Rebasing, force-pushing, merge conflicts, undoing commits
27
- - GitHub API operations (PR comments, issues, releases)
28
- - Any `git` or `gh` CLI command
24
+ Any `git` or `gh` operation: staging, commits, branches, pull requests, rebases, issues, releases.
29
25
 
30
26
  ---
31
27
 
@@ -70,7 +66,7 @@ Only use `--amend` when ALL conditions are met:
70
66
 
71
67
  ### Branch Safety
72
68
 
73
- Never force push to: `main`, `master`, `develop`, `integration`, `trunk`, `release/*`, `staging`, `production`
69
+ Never force push to a protected branch — `devflow:worktree-support` holds the canonical list.
74
70
 
75
71
  **Branch naming**: `feat/`, `fix/`, `release/`, `hotfix/` prefixes with short descriptions.
76
72
 
@@ -97,8 +93,6 @@ See `references/patterns.md` for extended recovery and stash workflows.
97
93
  <optional body explaining what and why>
98
94
 
99
95
  <optional footer with references>
100
-
101
- Co-Authored-By: Claude <noreply@anthropic.com>
102
96
  ```
103
97
 
104
98
  ### Types
@@ -116,6 +110,8 @@ Co-Authored-By: Claude <noreply@anthropic.com>
116
110
 
117
111
  ### HEREDOC Format (Required)
118
112
 
113
+ Compose the issue/PR reference line BEFORE the heredoc. The heredoc delimiter is single-quoted; unquoting it makes every interpolated value a command.
114
+
119
115
  ```bash
120
116
  git commit -m "$(cat <<'EOF'
121
117
  feat(auth): add JWT token validation
@@ -125,8 +121,6 @@ Implement token validation middleware with:
125
121
  - Expiration checking
126
122
 
127
123
  Closes #123
128
-
129
- Co-Authored-By: Claude <noreply@anthropic.com>
130
124
  EOF
131
125
  )"
132
126
  ```
@@ -153,7 +147,7 @@ EOF
153
147
  | Changes | Features, fixes, refactoring by category |
154
148
  | Breaking Changes | User action required (or "None") |
155
149
  | Testing | Coverage, manual steps, gaps |
156
- | Related Issues | Closes/relates to links |
150
+ | Related Issues | `Closes {ISSUE_REF}` / relates-to links |
157
151
 
158
152
  ### Size Assessment
159
153
 
@@ -191,78 +185,9 @@ See `references/detection.md` for full `check_for_secrets()` function.
191
185
 
192
186
  ## GitHub API
193
187
 
194
- > **RESPECT RATE LIMITS OR FAIL GRACEFULLY** — remaining < 10 wait 60s, 1-2s between calls, batch where possible.
195
-
196
- ### Standard Throttling
197
-
198
- ```bash
199
- REMAINING=$(gh api rate_limit --jq '.resources.core.remaining')
200
- if [ "$REMAINING" -lt 10 ]; then sleep 60; fi
201
- sleep 1 # Between each API call
202
- ```
203
-
204
- ### PR Comments
205
-
206
- - Only lines in the PR diff can receive inline comments
207
- - Deduplicate before posting (same file + line = keep one)
208
- - Always include suggested fix and Claude Code attribution footer
209
-
210
- ### Releases
211
-
212
- ```bash
213
- [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1 # Validate semver
214
- git tag -a "v${VERSION}" -m "Version ${VERSION}" && git push origin "v${VERSION}"
215
- gh release create "v${VERSION}" --title "v${VERSION}" --notes "$NOTES"
216
- ```
217
-
218
- See `references/github-api.md` for extended API, CLI, and GraphQL patterns.
219
-
220
- ---
221
-
222
- ## Anti-Patterns
223
-
224
- | Violation | Impact | Fix |
225
- |-----------|--------|-----|
226
- | Parallel git commands | Index corruption | Sequential `&&` chains |
227
- | Grab-bag commits | Impossible to revert | One logical change per commit |
228
- | Blind staging (`git add .`) | Accidental secret commits | Stage specific files |
229
- | Force push to main | Destroys shared history | Create new commits |
230
- | Ignoring rate limits | API lockout | Check remaining, throttle |
231
- | Vague PR descriptions | Lost review context | Use structured template |
232
- | Hidden breaking changes | Consumer surprises | Mandatory section |
233
-
234
- ---
235
-
236
- ## Traceability Issue Template (D3)
237
-
238
- When creating or enriching a GitHub issue via the `ensure-traceable-issue` operation, use the following canonical D3 template:
239
-
240
- ```markdown
241
- ## Initial Request
242
- {The verbatim or paraphrased user request / scope statement that drove this task}
243
-
244
- ## Product Requirements
245
- {Discovered requirements summary — user needs, acceptance criteria, constraints}
246
-
247
- ## Implementation Plan
248
- [Design artifact posted as a collapsed comment — see linked comment below]
249
- ```
250
-
251
- **Rules:**
252
- - Pre-existing issues: post a structured comment using D3 sections — NEVER rewrite the issue body.
253
- - New issues: create with D3 body; then post the design artifact as a `<details>` collapsed comment; link that comment URL in the `## Implementation Plan` section.
254
- - Issue creation is gated by the `COMPLIANCE` input: `enabled` → mandatory (DEGRADED states exempt), absent or `(none)` → optional.
255
-
256
- ## Naming Conventions Authority
257
-
258
- When `.devflow/conventions.md` is present, it is the authoritative source for:
259
- - Branch Naming — prefix style (`feat/`, `fix/`, etc.), separator style, slug rules
260
- - PR Titles — conventional commit format, scope rules
261
- - Version PR Titles and Version Names (when applicable)
262
-
263
- The `learn-conventions` operation writes `.devflow/conventions.md` with a bounded scan (≤50 branches, ≤20 tags, ≤30 PR titles). To re-learn conventions from scratch, delete `.devflow/conventions.md` and re-run `learn-conventions`.
188
+ > **RESPECT RATE LIMITS OR FAIL GRACEFULLY** — at `X-RateLimit-Remaining` < 10 STOP the fan-out and report `THROTTLED` (D4); 1-2s between calls. Throttling, PR-comment rules and releases live in `references/github-api.md`.
264
189
 
265
- When `.devflow/conventions.md` is absent, fall back to heuristic branch-prefix detection from existing remote branches.
190
+ Naming conventions: `learn-conventions` writes `.devflow/conventions.md` from a bounded scan (≤50 branches, ≤20 tags, ≤30 PR titles) and is its single authority; delete that file to re-learn.
266
191
 
267
192
  ---
268
193
 
@@ -275,6 +200,7 @@ When `.devflow/conventions.md` is absent, fall back to heuristic branch-prefix d
275
200
  | `references/violations.md` | Safety, commit, and PR anti-patterns |
276
201
  | `references/detection.md` | Sensitive file regex patterns and check functions |
277
202
  | `references/github-api.md` | Rate limiting, CLI commands, GraphQL, releases, review thread GraphQL |
203
+ | `references/tracker/{provider}/{op}.md` | Generated per-op tracker mechanics (incl. the D3 template) |
278
204
 
279
205
  ## Checklist
280
206