devflow-kit 2.4.0 → 3.0.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 (213) hide show
  1. package/CHANGELOG.md +229 -0
  2. package/README.md +111 -18
  3. package/dist/agents/git.md +822 -0
  4. package/dist/cli/commands/agents.js +6 -1
  5. package/dist/cli/commands/ambient.js +160 -145
  6. package/dist/cli/commands/attribution-prompts.js +1 -1
  7. package/dist/cli/commands/capture.js +29 -55
  8. package/dist/cli/commands/compliance-prompts.js +1 -1
  9. package/dist/cli/commands/compliance.js +48 -55
  10. package/dist/cli/commands/context.js +17 -32
  11. package/dist/cli/commands/debug.js +65 -26
  12. package/dist/cli/commands/flags.js +3 -3
  13. package/dist/cli/commands/hud.js +34 -10
  14. package/dist/cli/commands/init-seed.js +61 -27
  15. package/dist/cli/commands/init.js +649 -240
  16. package/dist/cli/commands/install-report.js +200 -0
  17. package/dist/cli/commands/knowledge/index.js +2 -2
  18. package/dist/cli/commands/knowledge/toggle.js +35 -37
  19. package/dist/cli/commands/learning.js +79 -57
  20. package/dist/cli/commands/legacy-hooks.js +11 -14
  21. package/dist/cli/commands/memory.js +134 -135
  22. package/dist/cli/commands/prompt-io.js +4 -4
  23. package/dist/cli/commands/proxy.js +23 -41
  24. package/dist/cli/commands/security.js +81 -29
  25. package/dist/cli/commands/skills.js +71 -7
  26. package/dist/cli/commands/tracker-prompts.js +145 -0
  27. package/dist/cli/commands/tracker.js +277 -0
  28. package/dist/cli/commands/uninstall.js +520 -169
  29. package/dist/cli.js +2 -0
  30. package/dist/commands/bug-analysis.md +58 -14
  31. package/dist/commands/code-review.md +110 -32
  32. package/dist/commands/debug.md +55 -11
  33. package/dist/commands/dynamic-build.md +344 -73
  34. package/dist/commands/dynamic-plan.md +77 -27
  35. package/dist/commands/dynamic-profile.md +25 -11
  36. package/dist/commands/dynamic-tickets.md +76 -15
  37. package/dist/commands/explore.md +37 -7
  38. package/dist/commands/implement.md +314 -62
  39. package/dist/commands/plan.md +146 -32
  40. package/dist/commands/release.md +64 -17
  41. package/dist/commands/research.md +34 -8
  42. package/dist/commands/resolve.md +196 -68
  43. package/dist/commands/self-review.md +45 -9
  44. package/dist/core/agent-models.js +55 -12
  45. package/dist/core/assets.js +58 -2
  46. package/dist/core/compliance-compose.js +27 -27
  47. package/dist/core/evidence-policy.js +363 -0
  48. package/dist/core/feature-config.js +200 -65
  49. package/dist/core/feature-switch.js +112 -0
  50. package/dist/core/flags.js +34 -6
  51. package/dist/core/fs-atomic.js +27 -0
  52. package/dist/core/hook-log-dirs.js +104 -0
  53. package/dist/core/learning-tuning-config.js +5 -3
  54. package/dist/core/ledger-root.js +102 -0
  55. package/dist/core/manifest.js +38 -10
  56. package/dist/core/mds-variants.js +798 -0
  57. package/dist/core/migrations.js +49 -23
  58. package/dist/core/model-discovery.js +12 -1
  59. package/dist/core/plugins.js +361 -12
  60. package/dist/core/project-paths.js +1 -18
  61. package/dist/core/proxy-log.js +8 -6
  62. package/dist/core/proxy-state.js +11 -8
  63. package/dist/core/reference-sweep.js +136 -0
  64. package/dist/core/same-location.js +25 -0
  65. package/dist/core/tracker.js +494 -0
  66. package/dist/hud/components/config-counts.js +15 -4
  67. package/dist/hud/components/learning-counts.js +14 -0
  68. package/dist/hud/config.js +2 -1
  69. package/dist/hud/cost-history.js +2 -4
  70. package/dist/hud/git.js +52 -7
  71. package/dist/hud/index.js +7 -9
  72. package/dist/skills/git/references/decision-markers.md +19 -0
  73. package/dist/skills/git/references/learn-conventions.md +56 -0
  74. package/dist/skills/git/references/pr/check-ci-status.md +14 -0
  75. package/dist/skills/git/references/pr/check-merge-readiness.md +28 -0
  76. package/dist/skills/git/references/pr/ensure-pr-ready.md +24 -0
  77. package/dist/skills/git/references/pr/fetch-review-threads.md +22 -0
  78. package/dist/skills/git/references/pr/post-resolution-summary.md +40 -0
  79. package/dist/skills/git/references/pr/post-review-summary.md +42 -0
  80. package/dist/skills/git/references/pr/resolve-review-threads.md +35 -0
  81. package/dist/skills/git/references/pr/update-pr-evidence.md +14 -0
  82. package/dist/skills/git/references/pr/validate-branch.md +18 -0
  83. package/dist/skills/git/references/publication-gate.md +13 -0
  84. package/dist/skills/git/references/tracker/_mcp.md +153 -0
  85. package/dist/skills/git/references/tracker/github/associate-release.md +18 -0
  86. package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +40 -0
  87. package/dist/skills/git/references/tracker/github/create-release.md +11 -0
  88. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +16 -0
  89. package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +69 -0
  90. package/dist/skills/git/references/tracker/github/fetch-issue.md +32 -0
  91. package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +17 -0
  92. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +19 -0
  93. package/dist/skills/git/references/tracker/github/manage-debt.md +101 -0
  94. package/dist/skills/git/references/tracker/github/post-wave-report.md +28 -0
  95. package/dist/skills/git/references/tracker/github/setup-task.md +26 -0
  96. package/dist/skills/git/references/tracker/jira/associate-release.md +18 -0
  97. package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +49 -0
  98. package/dist/skills/git/references/tracker/jira/create-release.md +17 -0
  99. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +22 -0
  100. package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +53 -0
  101. package/dist/skills/git/references/tracker/jira/fetch-issue.md +14 -0
  102. package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +15 -0
  103. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +18 -0
  104. package/dist/skills/git/references/tracker/jira/manage-debt.md +37 -0
  105. package/dist/skills/git/references/tracker/jira/post-wave-report.md +33 -0
  106. package/dist/skills/git/references/tracker/jira/setup-task.md +31 -0
  107. package/dist/skills/git/references/tracker/linear/associate-release.md +18 -0
  108. package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +53 -0
  109. package/dist/skills/git/references/tracker/linear/create-release.md +17 -0
  110. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +22 -0
  111. package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +53 -0
  112. package/dist/skills/git/references/tracker/linear/fetch-issue.md +14 -0
  113. package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +15 -0
  114. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +18 -0
  115. package/dist/skills/git/references/tracker/linear/manage-debt.md +37 -0
  116. package/dist/skills/git/references/tracker/linear/post-wave-report.md +33 -0
  117. package/dist/skills/git/references/tracker/linear/setup-task.md +32 -0
  118. package/dist/skills/git/references/trust-rule.md +7 -0
  119. package/dist/targets/claude-code/claude-paths.js +59 -57
  120. package/dist/targets/claude-code/compliance-install.js +49 -65
  121. package/dist/targets/claude-code/hooks.js +108 -3
  122. package/dist/targets/claude-code/installer.js +1187 -32
  123. package/dist/targets/claude-code/legacy.js +5 -0
  124. package/dist/targets/claude-code/post-install.js +366 -151
  125. package/dist/targets/claude-code/tracker-install.js +134 -0
  126. package/package.json +8 -6
  127. package/src/assets/agents/code.md +45 -6
  128. package/src/assets/agents/design.md +2 -1
  129. package/src/assets/agents/git.mds +825 -0
  130. package/src/assets/agents/knowledge.md +3 -3
  131. package/src/assets/agents/learning.md +11 -0
  132. package/src/assets/agents/review.md +3 -1
  133. package/src/assets/agents/synthesize.md +1 -1
  134. package/src/assets/agents/test.md +16 -5
  135. package/src/assets/agents/tracker.md +474 -0
  136. package/src/assets/agents/validate.md +7 -5
  137. package/src/assets/commands/_partials/_compliance.mds +19 -1
  138. package/src/assets/commands/_partials/_decisions.mds +15 -3
  139. package/src/assets/commands/_partials/_docs_root.mds +35 -0
  140. package/src/assets/commands/_partials/_engine.mds +13 -11
  141. package/src/assets/commands/_partials/_evidence_policy.mds +30 -0
  142. package/src/assets/commands/_partials/_factory.mds +1 -1
  143. package/src/assets/commands/_partials/_knowledge.mds +27 -9
  144. package/src/assets/commands/_partials/_plan_contract.mds +22 -7
  145. package/src/assets/commands/_partials/_preamble.mds +2 -2
  146. package/src/assets/commands/_partials/_publication.mds +8 -2
  147. package/src/assets/commands/_partials/_settings.mds +28 -0
  148. package/src/assets/commands/_partials/_ticket_template.mds +3 -2
  149. package/src/assets/commands/_partials/_tracker.mds +18 -0
  150. package/src/assets/commands/_partials/_wave.mds +16 -10
  151. package/src/assets/commands/bug-analysis.mds +31 -19
  152. package/src/assets/commands/code-review.mds +67 -41
  153. package/src/assets/commands/debug.mds +13 -7
  154. package/src/assets/commands/dynamic-build.mds +274 -66
  155. package/src/assets/commands/dynamic-plan.mds +50 -23
  156. package/src/assets/commands/dynamic-profile.mds +24 -11
  157. package/src/assets/commands/dynamic-tickets.mds +63 -16
  158. package/src/assets/commands/explore.mds +4 -5
  159. package/src/assets/commands/implement.mds +234 -67
  160. package/src/assets/commands/plan.mds +91 -33
  161. package/src/assets/commands/release.md +64 -17
  162. package/src/assets/commands/research.mds +11 -9
  163. package/src/assets/commands/resolve.mds +150 -78
  164. package/src/assets/commands/self-review.mds +24 -25
  165. package/src/assets/mds/git/_pr.mds +331 -0
  166. package/src/assets/mds/git/_references.mds +135 -0
  167. package/src/assets/mds/tracker/_common.mds +156 -0
  168. package/src/assets/mds/tracker/_github.mds +472 -0
  169. package/src/assets/mds/tracker/_jira.mds +407 -0
  170. package/src/assets/mds/tracker/_linear.mds +449 -0
  171. package/src/assets/mds/tracker/_mcp.mds +305 -0
  172. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +5 -8
  173. package/src/assets/scripts/hooks/background-memory-update +40 -19
  174. package/src/assets/scripts/hooks/capture-prompt +18 -8
  175. package/src/assets/scripts/hooks/capture-question +18 -8
  176. package/src/assets/scripts/hooks/capture-turn +27 -13
  177. package/src/assets/scripts/hooks/debug-trace +11 -6
  178. package/src/assets/scripts/hooks/ensure-devflow-init +33 -6
  179. package/src/assets/scripts/hooks/ensure-proxy +9 -8
  180. package/src/assets/scripts/hooks/ensure-root-gitignore +236 -60
  181. package/src/assets/scripts/hooks/git-marker +48 -0
  182. package/src/assets/scripts/hooks/hook-log-init +3 -1
  183. package/src/assets/scripts/hooks/json-helper.cjs +228 -5
  184. package/src/assets/scripts/hooks/lib/project-paths.cjs +1 -20
  185. package/src/assets/scripts/hooks/log-paths +80 -0
  186. package/src/assets/scripts/hooks/memory-worker +22 -13
  187. package/src/assets/scripts/hooks/pre-compact-memory +44 -15
  188. package/src/assets/scripts/hooks/preamble +1 -4
  189. package/src/assets/scripts/hooks/queue-append +146 -28
  190. package/src/assets/scripts/hooks/resolve-project-root +101 -7
  191. package/src/assets/scripts/hooks/session-start-context +534 -20
  192. package/src/assets/scripts/hooks/session-start-memory +38 -15
  193. package/src/assets/scripts/lib/project-config.cjs +633 -0
  194. package/src/assets/scripts/pr-evidence.cjs +1961 -0
  195. package/src/assets/scripts/redact-secrets.cjs +490 -62
  196. package/src/assets/scripts/release-trace.cjs +1143 -0
  197. package/src/assets/scripts/resolve-evidence-policy.cjs +1145 -0
  198. package/src/assets/scripts/resolve-settings.cjs +1054 -0
  199. package/src/assets/scripts/verify-evidence.cjs +1822 -0
  200. package/src/assets/skills/compliance/SKILL.md +4 -2
  201. package/src/assets/skills/docs-framework/SKILL.md +11 -10
  202. package/src/assets/skills/docs-framework/references/patterns.md +10 -17
  203. package/src/assets/skills/gap-analysis/SKILL.md +2 -2
  204. package/src/assets/skills/git/SKILL.md +8 -78
  205. package/src/assets/skills/git/references/github-api.md +179 -141
  206. package/src/assets/skills/git/references/patterns.md +11 -6
  207. package/src/assets/skills/review-methodology/SKILL.md +1 -1
  208. package/src/assets/skills/review-methodology/references/patterns.md +6 -61
  209. package/src/assets/skills/review-methodology/references/violations.md +14 -22
  210. package/src/assets/skills/worktree-support/SKILL.md +1 -1
  211. package/src/assets/skills/worktree-support/references/roots.md +29 -0
  212. package/src/targets/claude-code/templates/managed-settings.json +25 -9
  213. 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.
@@ -97,13 +99,13 @@ resource "aws_s3_bucket_logging" "data" { target_bucket = var.audit_bucket_id }
97
99
  | **CRITICAL** | Plaintext regulated data exposed; public IaC exposure of regulated stores |
98
100
  | **HIGH** | Missing audit trail on regulated mutations; PII in logs or errors |
99
101
  | **MEDIUM** | Missing retention/erasure paths; weak traceability (no actor/purpose) |
100
- | **LOW** | No active framework reference files installed; documentation/annotation gaps |
102
+ | **LOW** | Documentation/annotation gaps |
101
103
 
102
104
  ${DEVFLOW_COMPLIANCE_MAPPING}
103
105
 
104
106
  ## Checklist
105
107
 
106
- - [ ] Active frameworks identified from installed `references/{id}.md` files; controls applied
108
+ - [ ] Frameworks in force are the ids given (`COMPLIANCE_FRAMEWORKS`); their controls applied
107
109
  - [ ] No PII/PHI/payment data in logs, errors, or analytics events
108
110
  - [ ] Regulated data encrypted in transit (TLS 1.2+) and at rest
109
111
  - [ ] Every regulated mutation has an append-only audit entry (actor, purpose, timestamp)
@@ -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` |
@@ -115,15 +117,14 @@ TOPIC_SLUG=$(echo "$TOPIC" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed 's/[^
115
117
 
116
118
  ## Helper Functions
117
119
 
118
- Source helpers for consistent naming:
120
+ Define these inline, in the Bash call that needs them, for consistent naming. `.devflow/docs/` lives at the checkout's toplevel, never under a subdirectory the session started in:
119
121
 
120
122
  ```bash
121
- source .devflow/scripts/docs-helpers.sh 2>/dev/null || {
122
- get_timestamp() { date +%Y-%m-%d_%H%M; }
123
- get_branch_slug() { git branch --show-current 2>/dev/null | sed 's/\//-/g' || echo "standalone"; }
124
- get_topic_slug() { echo "$1" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed 's/[^a-z0-9-]//g' | cut -c1-50; }
125
- ensure_docs_dir() { mkdir -p ".devflow/docs/$1"; }
126
- }
123
+ get_timestamp() { date +%Y-%m-%d_%H%M; }
124
+ get_branch_slug() { git branch --show-current 2>/dev/null | sed 's/\//-/g' || echo "standalone"; }
125
+ get_topic_slug() { echo "$1" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed 's/[^a-z0-9-]//g' | cut -c1-50; }
126
+ get_docs_root() { git rev-parse --show-toplevel 2>/dev/null || pwd; }
127
+ ensure_docs_dir() { mkdir -p "$(get_docs_root)/.devflow/docs/$1"; }
127
128
  ```
128
129
 
129
130
  ---
@@ -141,7 +142,7 @@ source .devflow/scripts/docs-helpers.sh 2>/dev/null || {
141
142
  | Working Memory | `.devflow/memory/WORKING-MEMORY.md` | Overwrites (auto-maintained by Stop hook) |
142
143
  | Decisions | `.devflow/learning/decisions.md` | Rendered from `decisions-ledger.jsonl` (active ADR-NNN rows; retired rows dropped) |
143
144
  | 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 |
145
+ | Design agent (via /plan) | `.devflow/docs/design/{ISSUE_ID}-{topic-slug}.{timestamp}.md` | Creates new design artifact |
145
146
  | Research agent | `.devflow/docs/research/{topic-slug}/{timestamp}/{type}.md` | Creates new in timestamped dir |
146
147
  | Synthesize agent (research) | `.devflow/docs/research/{topic-slug}/{timestamp}/research-summary.md` | Creates new in timestamped dir |
147
148
  | Diagnose agent | `.devflow/docs/bug-analysis/{branch-slug}/{timestamp}/{focus}.md` | Creates new in timestamped dir |
@@ -150,12 +150,9 @@ Always lowercase:
150
150
 
151
151
  ## Helper Functions
152
152
 
153
- Full implementation for `.devflow/scripts/docs-helpers.sh`:
153
+ Full implementations, defined inline in the Bash call that needs them. `.devflow/docs/` lives at the checkout's toplevel, never under a subdirectory the session started in:
154
154
 
155
155
  ```bash
156
- #!/bin/bash
157
- # .devflow/scripts/docs-helpers.sh
158
-
159
156
  # Get current timestamp in standard format
160
157
  get_timestamp() {
161
158
  date +%Y-%m-%d_%H%M
@@ -182,10 +179,15 @@ get_topic_slug() {
182
179
  cut -c1-50
183
180
  }
184
181
 
182
+ # The checkout's toplevel, else the working directory outside git
183
+ get_docs_root() {
184
+ git rev-parse --show-toplevel 2>/dev/null || pwd
185
+ }
186
+
185
187
  # Ensure docs directory exists
186
188
  ensure_docs_dir() {
187
189
  local subdir="$1"
188
- mkdir -p ".devflow/docs/$subdir"
190
+ mkdir -p "$(get_docs_root)/.devflow/docs/$subdir"
189
191
  }
190
192
 
191
193
  # Get full output path for a document
@@ -193,7 +195,7 @@ get_doc_path() {
193
195
  local subdir="$1"
194
196
  local filename="$2"
195
197
  ensure_docs_dir "$subdir"
196
- echo ".devflow/docs/$subdir/$filename"
198
+ echo "$(get_docs_root)/.devflow/docs/$subdir/$filename"
197
199
  }
198
200
 
199
201
  # Create timestamped status log path
@@ -211,23 +213,14 @@ get_review_path() {
211
213
  branch_slug=$(get_branch_slug)
212
214
  timestamp=$(get_timestamp)
213
215
  ensure_docs_dir "reviews/$branch_slug/$timestamp"
214
- echo ".devflow/docs/reviews/$branch_slug/$timestamp/${focus}.md"
216
+ echo "$(get_docs_root)/.devflow/docs/reviews/$branch_slug/$timestamp/${focus}.md"
215
217
  }
216
218
  ```
217
219
 
218
220
  ### Usage Example
219
221
 
220
222
  ```bash
221
- # Source helpers
222
- source .devflow/scripts/docs-helpers.sh 2>/dev/null || {
223
- # Inline fallback if script not found
224
- get_timestamp() { date +%Y-%m-%d_%H%M; }
225
- get_branch_slug() { git branch --show-current 2>/dev/null | sed 's/\//-/g' || echo "standalone"; }
226
- get_topic_slug() { echo "$1" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed 's/[^a-z0-9-]//g' | cut -c1-50; }
227
- ensure_docs_dir() { mkdir -p ".devflow/docs/$1"; }
228
- }
229
-
230
- # Use helpers
223
+ # Define the helpers above in the same Bash call, then use them
231
224
  TIMESTAMP=$(get_timestamp)
232
225
  BRANCH_SLUG=$(get_branch_slug)
233
226
  ensure_docs_dir "reviews/$BRANCH_SLUG"
@@ -103,9 +103,9 @@ Detect ordering constraints and shared resource conflicts across issues.
103
103
 
104
104
  **Evidence trigger:** Any issue that references state, contracts, or resources that may be in flux due to another issue in the batch.
105
105
 
106
- ### 7. Compliance (when compliance skill installed)
106
+ ### 7. Compliance (when the compliance lens is on)
107
107
 
108
- Detect regulatory gaps that security doesn't cover. Active frameworks = the `references/{id}.md` files present in the installed skill. Load `devflow:compliance` before analyzing.
108
+ Detect regulatory gaps that security doesn't cover. Load `devflow:compliance` before analyzing, then `references/{id}.md` only for the ids in `COMPLIANCE_FRAMEWORKS` (`none`: generic controls only).
109
109
 
110
110
  **Detection patterns:**
111
111
  - Missing audit trails on regulated mutations — writes to financial records, PHI, PCI-scoped data without durable logging
@@ -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