devflow-kit 2.4.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 (166) hide show
  1. package/CHANGELOG.md +156 -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 +1 -1
  6. package/dist/cli/commands/compliance-prompts.js +1 -1
  7. package/dist/cli/commands/compliance.js +23 -1
  8. package/dist/cli/commands/init-seed.js +24 -26
  9. package/dist/cli/commands/init.js +502 -71
  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 +4 -4
  16. package/dist/cli/commands/security.js +76 -16
  17. package/dist/cli/commands/skills.js +53 -7
  18. package/dist/cli/commands/tracker-prompts.js +145 -0
  19. package/dist/cli/commands/tracker.js +405 -0
  20. package/dist/cli/commands/uninstall.js +211 -65
  21. package/dist/cli.js +2 -0
  22. package/dist/commands/bug-analysis.md +22 -4
  23. package/dist/commands/code-review.md +44 -15
  24. package/dist/commands/debug.md +20 -6
  25. package/dist/commands/dynamic-build.md +289 -67
  26. package/dist/commands/dynamic-plan.md +60 -21
  27. package/dist/commands/dynamic-profile.md +1 -1
  28. package/dist/commands/dynamic-tickets.md +58 -8
  29. package/dist/commands/explore.md +2 -2
  30. package/dist/commands/implement.md +241 -53
  31. package/dist/commands/plan.md +88 -17
  32. package/dist/commands/release.md +64 -17
  33. package/dist/commands/resolve.md +138 -58
  34. package/dist/commands/self-review.md +2 -2
  35. package/dist/core/agent-models.js +55 -12
  36. package/dist/core/assets.js +58 -2
  37. package/dist/core/evidence-policy.js +147 -0
  38. package/dist/core/feature-config.js +130 -64
  39. package/dist/core/feature-switch.js +112 -0
  40. package/dist/core/flags.js +4 -4
  41. package/dist/core/manifest.js +33 -7
  42. package/dist/core/mds-variants.js +861 -0
  43. package/dist/core/model-discovery.js +12 -1
  44. package/dist/core/plugins.js +357 -9
  45. package/dist/core/project-paths.js +1 -1
  46. package/dist/core/proxy-log.js +8 -6
  47. package/dist/core/proxy-state.js +11 -8
  48. package/dist/core/reference-sweep.js +136 -0
  49. package/dist/core/tracker.js +407 -0
  50. package/dist/skills/git/references/decision-markers.md +19 -0
  51. package/dist/skills/git/references/learn-conventions.md +56 -0
  52. package/dist/skills/git/references/pr/check-ci-status.md +14 -0
  53. package/dist/skills/git/references/pr/check-merge-readiness.md +28 -0
  54. package/dist/skills/git/references/pr/ensure-pr-ready.md +24 -0
  55. package/dist/skills/git/references/pr/fetch-review-threads.md +22 -0
  56. package/dist/skills/git/references/pr/post-resolution-summary.md +40 -0
  57. package/dist/skills/git/references/pr/post-review-summary.md +42 -0
  58. package/dist/skills/git/references/pr/resolve-review-threads.md +35 -0
  59. package/dist/skills/git/references/pr/update-pr-evidence.md +14 -0
  60. package/dist/skills/git/references/pr/validate-branch.md +18 -0
  61. package/dist/skills/git/references/publication-gate.md +13 -0
  62. package/dist/skills/git/references/tracker/_mcp.md +153 -0
  63. package/dist/skills/git/references/tracker/github/associate-release.md +18 -0
  64. package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +40 -0
  65. package/dist/skills/git/references/tracker/github/create-release.md +11 -0
  66. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +16 -0
  67. package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +69 -0
  68. package/dist/skills/git/references/tracker/github/fetch-issue.md +32 -0
  69. package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +17 -0
  70. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +19 -0
  71. package/dist/skills/git/references/tracker/github/manage-debt.md +101 -0
  72. package/dist/skills/git/references/tracker/github/post-wave-report.md +28 -0
  73. package/dist/skills/git/references/tracker/github/setup-task.md +26 -0
  74. package/dist/skills/git/references/tracker/jira/associate-release.md +18 -0
  75. package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +49 -0
  76. package/dist/skills/git/references/tracker/jira/create-release.md +17 -0
  77. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +22 -0
  78. package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +53 -0
  79. package/dist/skills/git/references/tracker/jira/fetch-issue.md +14 -0
  80. package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +15 -0
  81. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +18 -0
  82. package/dist/skills/git/references/tracker/jira/manage-debt.md +37 -0
  83. package/dist/skills/git/references/tracker/jira/post-wave-report.md +33 -0
  84. package/dist/skills/git/references/tracker/jira/setup-task.md +31 -0
  85. package/dist/skills/git/references/tracker/linear/associate-release.md +18 -0
  86. package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +53 -0
  87. package/dist/skills/git/references/tracker/linear/create-release.md +17 -0
  88. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +22 -0
  89. package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +53 -0
  90. package/dist/skills/git/references/tracker/linear/fetch-issue.md +14 -0
  91. package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +15 -0
  92. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +18 -0
  93. package/dist/skills/git/references/tracker/linear/manage-debt.md +37 -0
  94. package/dist/skills/git/references/tracker/linear/post-wave-report.md +33 -0
  95. package/dist/skills/git/references/tracker/linear/setup-task.md +32 -0
  96. package/dist/skills/git/references/trust-rule.md +7 -0
  97. package/dist/targets/claude-code/installer.js +1213 -31
  98. package/dist/targets/claude-code/legacy.js +5 -0
  99. package/dist/targets/claude-code/post-install.js +196 -74
  100. package/dist/targets/claude-code/tracker-install.js +161 -0
  101. package/package.json +4 -3
  102. package/src/assets/agents/code.md +42 -4
  103. package/src/assets/agents/design.md +1 -1
  104. package/src/assets/agents/git.mds +827 -0
  105. package/src/assets/agents/knowledge.md +1 -1
  106. package/src/assets/agents/learning.md +11 -0
  107. package/src/assets/agents/synthesize.md +1 -1
  108. package/src/assets/agents/test.md +16 -5
  109. package/src/assets/agents/tracker.md +467 -0
  110. package/src/assets/agents/validate.md +7 -5
  111. package/src/assets/commands/_partials/_engine.mds +11 -9
  112. package/src/assets/commands/_partials/_evidence_policy.mds +30 -0
  113. package/src/assets/commands/_partials/_knowledge.mds +2 -2
  114. package/src/assets/commands/_partials/_plan_contract.mds +22 -7
  115. package/src/assets/commands/_partials/_preamble.mds +1 -1
  116. package/src/assets/commands/_partials/_publication.mds +3 -1
  117. package/src/assets/commands/_partials/_ticket_template.mds +3 -2
  118. package/src/assets/commands/_partials/_tracker.mds +18 -0
  119. package/src/assets/commands/_partials/_wave.mds +16 -10
  120. package/src/assets/commands/bug-analysis.mds +15 -5
  121. package/src/assets/commands/code-review.mds +34 -14
  122. package/src/assets/commands/debug.mds +11 -4
  123. package/src/assets/commands/dynamic-build.mds +227 -41
  124. package/src/assets/commands/dynamic-plan.mds +35 -13
  125. package/src/assets/commands/dynamic-tickets.mds +47 -5
  126. package/src/assets/commands/implement.mds +206 -52
  127. package/src/assets/commands/plan.mds +70 -17
  128. package/src/assets/commands/release.md +64 -17
  129. package/src/assets/commands/resolve.mds +126 -56
  130. package/src/assets/mds/git/_pr.mds +331 -0
  131. package/src/assets/mds/git/_references.mds +135 -0
  132. package/src/assets/mds/tracker/_common.mds +156 -0
  133. package/src/assets/mds/tracker/_github.mds +472 -0
  134. package/src/assets/mds/tracker/_jira.mds +407 -0
  135. package/src/assets/mds/tracker/_linear.mds +449 -0
  136. package/src/assets/mds/tracker/_mcp.mds +299 -0
  137. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +5 -8
  138. package/src/assets/scripts/hooks/background-memory-update +14 -9
  139. package/src/assets/scripts/hooks/capture-prompt +6 -2
  140. package/src/assets/scripts/hooks/capture-question +6 -2
  141. package/src/assets/scripts/hooks/capture-turn +6 -2
  142. package/src/assets/scripts/hooks/ensure-devflow-init +1 -1
  143. package/src/assets/scripts/hooks/ensure-root-gitignore +161 -60
  144. package/src/assets/scripts/hooks/hook-log-init +3 -1
  145. package/src/assets/scripts/hooks/json-helper.cjs +223 -5
  146. package/src/assets/scripts/hooks/lib/project-paths.cjs +1 -1
  147. package/src/assets/scripts/hooks/memory-worker +15 -8
  148. package/src/assets/scripts/hooks/pre-compact-memory +12 -8
  149. package/src/assets/scripts/hooks/preamble +1 -4
  150. package/src/assets/scripts/hooks/queue-append +68 -24
  151. package/src/assets/scripts/hooks/session-start-context +355 -8
  152. package/src/assets/scripts/hooks/session-start-memory +12 -8
  153. package/src/assets/scripts/pr-evidence.cjs +1961 -0
  154. package/src/assets/scripts/redact-secrets.cjs +490 -62
  155. package/src/assets/scripts/release-trace.cjs +1143 -0
  156. package/src/assets/scripts/resolve-evidence-policy.cjs +1065 -0
  157. package/src/assets/scripts/verify-evidence.cjs +1822 -0
  158. package/src/assets/skills/compliance/SKILL.md +2 -0
  159. package/src/assets/skills/docs-framework/SKILL.md +5 -3
  160. package/src/assets/skills/git/SKILL.md +8 -78
  161. package/src/assets/skills/git/references/github-api.md +179 -141
  162. package/src/assets/skills/git/references/patterns.md +11 -6
  163. package/src/assets/skills/review-methodology/SKILL.md +1 -1
  164. package/src/assets/skills/review-methodology/references/patterns.md +6 -61
  165. package/src/assets/skills/review-methodology/references/violations.md +14 -22
  166. 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
 
@@ -114,6 +110,8 @@ See `references/patterns.md` for extended recovery and stash workflows.
114
110
 
115
111
  ### HEREDOC Format (Required)
116
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
+
117
115
  ```bash
118
116
  git commit -m "$(cat <<'EOF'
119
117
  feat(auth): add JWT token validation
@@ -149,7 +147,7 @@ EOF
149
147
  | Changes | Features, fixes, refactoring by category |
150
148
  | Breaking Changes | User action required (or "None") |
151
149
  | Testing | Coverage, manual steps, gaps |
152
- | Related Issues | Closes/relates to links |
150
+ | Related Issues | `Closes {ISSUE_REF}` / relates-to links |
153
151
 
154
152
  ### Size Assessment
155
153
 
@@ -187,78 +185,9 @@ See `references/detection.md` for full `check_for_secrets()` function.
187
185
 
188
186
  ## GitHub API
189
187
 
190
- > **RESPECT RATE LIMITS OR FAIL GRACEFULLY** — remaining < 10 wait 60s, 1-2s between calls, batch where possible.
191
-
192
- ### Standard Throttling
193
-
194
- ```bash
195
- REMAINING=$(gh api rate_limit --jq '.resources.core.remaining')
196
- if [ "$REMAINING" -lt 10 ]; then sleep 60; fi
197
- sleep 1 # Between each API call
198
- ```
199
-
200
- ### PR Comments
201
-
202
- - Only lines in the PR diff can receive inline comments
203
- - Deduplicate before posting (same file + line = keep one)
204
- - Always include a suggested fix; every comment carries the `<!-- devflow:* -->` marker, and the visible devflow footer (*Posted by [devflow](https://github.com/dean0x/devflow)*) is appended only on summary comments (see src/assets/agents/git.md)
205
-
206
- ### Releases
207
-
208
- ```bash
209
- [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1 # Validate semver
210
- git tag -a "v${VERSION}" -m "Version ${VERSION}" && git push origin "v${VERSION}"
211
- gh release create "v${VERSION}" --title "v${VERSION}" --notes "$NOTES"
212
- ```
213
-
214
- See `references/github-api.md` for extended API, CLI, and GraphQL patterns.
215
-
216
- ---
217
-
218
- ## Anti-Patterns
219
-
220
- | Violation | Impact | Fix |
221
- |-----------|--------|-----|
222
- | Parallel git commands | Index corruption | Sequential `&&` chains |
223
- | Grab-bag commits | Impossible to revert | One logical change per commit |
224
- | Blind staging (`git add .`) | Accidental secret commits | Stage specific files |
225
- | Force push to main | Destroys shared history | Create new commits |
226
- | Ignoring rate limits | API lockout | Check remaining, throttle |
227
- | Vague PR descriptions | Lost review context | Use structured template |
228
- | Hidden breaking changes | Consumer surprises | Mandatory section |
229
-
230
- ---
231
-
232
- ## Traceability Issue Template (D3)
233
-
234
- When creating or enriching a GitHub issue via the `ensure-traceable-issue` operation, use the following canonical D3 template:
235
-
236
- ```markdown
237
- ## Initial Request
238
- {The verbatim or paraphrased user request / scope statement that drove this task}
239
-
240
- ## Product Requirements
241
- {Discovered requirements summary — user needs, acceptance criteria, constraints}
242
-
243
- ## Implementation Plan
244
- [Design artifact posted as a collapsed comment — see linked comment below]
245
- ```
246
-
247
- **Rules:**
248
- - Pre-existing issues: post a structured comment using D3 sections — NEVER rewrite the issue body.
249
- - 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.
250
- - Issue creation is gated by the `COMPLIANCE` input: `enabled` → mandatory (DEGRADED states exempt), absent or `(none)` → optional.
251
-
252
- ## Naming Conventions Authority
253
-
254
- When `.devflow/conventions.md` is present, it is the authoritative source for:
255
- - Branch Naming — prefix style (`feat/`, `fix/`, etc.), separator style, slug rules
256
- - PR Titles — conventional commit format, scope rules
257
- - Version PR Titles and Version Names (when applicable)
258
-
259
- 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`.
260
189
 
261
- 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.
262
191
 
263
192
  ---
264
193
 
@@ -271,6 +200,7 @@ When `.devflow/conventions.md` is absent, fall back to heuristic branch-prefix d
271
200
  | `references/violations.md` | Safety, commit, and PR anti-patterns |
272
201
  | `references/detection.md` | Sensitive file regex patterns and check functions |
273
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) |
274
204
 
275
205
  ## Checklist
276
206