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.
- package/CHANGELOG.md +229 -0
- package/README.md +111 -18
- package/dist/agents/git.md +822 -0
- package/dist/cli/commands/agents.js +6 -1
- package/dist/cli/commands/ambient.js +160 -145
- package/dist/cli/commands/attribution-prompts.js +1 -1
- package/dist/cli/commands/capture.js +29 -55
- package/dist/cli/commands/compliance-prompts.js +1 -1
- package/dist/cli/commands/compliance.js +48 -55
- package/dist/cli/commands/context.js +17 -32
- package/dist/cli/commands/debug.js +65 -26
- package/dist/cli/commands/flags.js +3 -3
- package/dist/cli/commands/hud.js +34 -10
- package/dist/cli/commands/init-seed.js +61 -27
- package/dist/cli/commands/init.js +649 -240
- package/dist/cli/commands/install-report.js +200 -0
- package/dist/cli/commands/knowledge/index.js +2 -2
- package/dist/cli/commands/knowledge/toggle.js +35 -37
- package/dist/cli/commands/learning.js +79 -57
- package/dist/cli/commands/legacy-hooks.js +11 -14
- package/dist/cli/commands/memory.js +134 -135
- package/dist/cli/commands/prompt-io.js +4 -4
- package/dist/cli/commands/proxy.js +23 -41
- package/dist/cli/commands/security.js +81 -29
- package/dist/cli/commands/skills.js +71 -7
- package/dist/cli/commands/tracker-prompts.js +145 -0
- package/dist/cli/commands/tracker.js +277 -0
- package/dist/cli/commands/uninstall.js +520 -169
- package/dist/cli.js +2 -0
- package/dist/commands/bug-analysis.md +58 -14
- package/dist/commands/code-review.md +110 -32
- package/dist/commands/debug.md +55 -11
- package/dist/commands/dynamic-build.md +344 -73
- package/dist/commands/dynamic-plan.md +77 -27
- package/dist/commands/dynamic-profile.md +25 -11
- package/dist/commands/dynamic-tickets.md +76 -15
- package/dist/commands/explore.md +37 -7
- package/dist/commands/implement.md +314 -62
- package/dist/commands/plan.md +146 -32
- package/dist/commands/release.md +64 -17
- package/dist/commands/research.md +34 -8
- package/dist/commands/resolve.md +196 -68
- package/dist/commands/self-review.md +45 -9
- package/dist/core/agent-models.js +55 -12
- package/dist/core/assets.js +58 -2
- package/dist/core/compliance-compose.js +27 -27
- package/dist/core/evidence-policy.js +363 -0
- package/dist/core/feature-config.js +200 -65
- package/dist/core/feature-switch.js +112 -0
- package/dist/core/flags.js +34 -6
- package/dist/core/fs-atomic.js +27 -0
- package/dist/core/hook-log-dirs.js +104 -0
- package/dist/core/learning-tuning-config.js +5 -3
- package/dist/core/ledger-root.js +102 -0
- package/dist/core/manifest.js +38 -10
- package/dist/core/mds-variants.js +798 -0
- package/dist/core/migrations.js +49 -23
- package/dist/core/model-discovery.js +12 -1
- package/dist/core/plugins.js +361 -12
- package/dist/core/project-paths.js +1 -18
- package/dist/core/proxy-log.js +8 -6
- package/dist/core/proxy-state.js +11 -8
- package/dist/core/reference-sweep.js +136 -0
- package/dist/core/same-location.js +25 -0
- package/dist/core/tracker.js +494 -0
- package/dist/hud/components/config-counts.js +15 -4
- package/dist/hud/components/learning-counts.js +14 -0
- package/dist/hud/config.js +2 -1
- package/dist/hud/cost-history.js +2 -4
- package/dist/hud/git.js +52 -7
- package/dist/hud/index.js +7 -9
- package/dist/skills/git/references/decision-markers.md +19 -0
- package/dist/skills/git/references/learn-conventions.md +56 -0
- package/dist/skills/git/references/pr/check-ci-status.md +14 -0
- package/dist/skills/git/references/pr/check-merge-readiness.md +28 -0
- package/dist/skills/git/references/pr/ensure-pr-ready.md +24 -0
- package/dist/skills/git/references/pr/fetch-review-threads.md +22 -0
- package/dist/skills/git/references/pr/post-resolution-summary.md +40 -0
- package/dist/skills/git/references/pr/post-review-summary.md +42 -0
- package/dist/skills/git/references/pr/resolve-review-threads.md +35 -0
- package/dist/skills/git/references/pr/update-pr-evidence.md +14 -0
- package/dist/skills/git/references/pr/validate-branch.md +18 -0
- package/dist/skills/git/references/publication-gate.md +13 -0
- package/dist/skills/git/references/tracker/_mcp.md +153 -0
- package/dist/skills/git/references/tracker/github/associate-release.md +18 -0
- package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +40 -0
- package/dist/skills/git/references/tracker/github/create-release.md +11 -0
- package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +16 -0
- package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +69 -0
- package/dist/skills/git/references/tracker/github/fetch-issue.md +32 -0
- package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +17 -0
- package/dist/skills/git/references/tracker/github/gather-release-evidence.md +19 -0
- package/dist/skills/git/references/tracker/github/manage-debt.md +101 -0
- package/dist/skills/git/references/tracker/github/post-wave-report.md +28 -0
- package/dist/skills/git/references/tracker/github/setup-task.md +26 -0
- package/dist/skills/git/references/tracker/jira/associate-release.md +18 -0
- package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +49 -0
- package/dist/skills/git/references/tracker/jira/create-release.md +17 -0
- package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +22 -0
- package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +53 -0
- package/dist/skills/git/references/tracker/jira/fetch-issue.md +14 -0
- package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +15 -0
- package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +18 -0
- package/dist/skills/git/references/tracker/jira/manage-debt.md +37 -0
- package/dist/skills/git/references/tracker/jira/post-wave-report.md +33 -0
- package/dist/skills/git/references/tracker/jira/setup-task.md +31 -0
- package/dist/skills/git/references/tracker/linear/associate-release.md +18 -0
- package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +53 -0
- package/dist/skills/git/references/tracker/linear/create-release.md +17 -0
- package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +22 -0
- package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +53 -0
- package/dist/skills/git/references/tracker/linear/fetch-issue.md +14 -0
- package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +15 -0
- package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +18 -0
- package/dist/skills/git/references/tracker/linear/manage-debt.md +37 -0
- package/dist/skills/git/references/tracker/linear/post-wave-report.md +33 -0
- package/dist/skills/git/references/tracker/linear/setup-task.md +32 -0
- package/dist/skills/git/references/trust-rule.md +7 -0
- package/dist/targets/claude-code/claude-paths.js +59 -57
- package/dist/targets/claude-code/compliance-install.js +49 -65
- package/dist/targets/claude-code/hooks.js +108 -3
- package/dist/targets/claude-code/installer.js +1187 -32
- package/dist/targets/claude-code/legacy.js +5 -0
- package/dist/targets/claude-code/post-install.js +366 -151
- package/dist/targets/claude-code/tracker-install.js +134 -0
- package/package.json +8 -6
- package/src/assets/agents/code.md +45 -6
- package/src/assets/agents/design.md +2 -1
- package/src/assets/agents/git.mds +825 -0
- package/src/assets/agents/knowledge.md +3 -3
- package/src/assets/agents/learning.md +11 -0
- package/src/assets/agents/review.md +3 -1
- package/src/assets/agents/synthesize.md +1 -1
- package/src/assets/agents/test.md +16 -5
- package/src/assets/agents/tracker.md +474 -0
- package/src/assets/agents/validate.md +7 -5
- package/src/assets/commands/_partials/_compliance.mds +19 -1
- package/src/assets/commands/_partials/_decisions.mds +15 -3
- package/src/assets/commands/_partials/_docs_root.mds +35 -0
- package/src/assets/commands/_partials/_engine.mds +13 -11
- package/src/assets/commands/_partials/_evidence_policy.mds +30 -0
- package/src/assets/commands/_partials/_factory.mds +1 -1
- package/src/assets/commands/_partials/_knowledge.mds +27 -9
- package/src/assets/commands/_partials/_plan_contract.mds +22 -7
- package/src/assets/commands/_partials/_preamble.mds +2 -2
- package/src/assets/commands/_partials/_publication.mds +8 -2
- package/src/assets/commands/_partials/_settings.mds +28 -0
- package/src/assets/commands/_partials/_ticket_template.mds +3 -2
- package/src/assets/commands/_partials/_tracker.mds +18 -0
- package/src/assets/commands/_partials/_wave.mds +16 -10
- package/src/assets/commands/bug-analysis.mds +31 -19
- package/src/assets/commands/code-review.mds +67 -41
- package/src/assets/commands/debug.mds +13 -7
- package/src/assets/commands/dynamic-build.mds +274 -66
- package/src/assets/commands/dynamic-plan.mds +50 -23
- package/src/assets/commands/dynamic-profile.mds +24 -11
- package/src/assets/commands/dynamic-tickets.mds +63 -16
- package/src/assets/commands/explore.mds +4 -5
- package/src/assets/commands/implement.mds +234 -67
- package/src/assets/commands/plan.mds +91 -33
- package/src/assets/commands/release.md +64 -17
- package/src/assets/commands/research.mds +11 -9
- package/src/assets/commands/resolve.mds +150 -78
- package/src/assets/commands/self-review.mds +24 -25
- package/src/assets/mds/git/_pr.mds +331 -0
- package/src/assets/mds/git/_references.mds +135 -0
- package/src/assets/mds/tracker/_common.mds +156 -0
- package/src/assets/mds/tracker/_github.mds +472 -0
- package/src/assets/mds/tracker/_jira.mds +407 -0
- package/src/assets/mds/tracker/_linear.mds +449 -0
- package/src/assets/mds/tracker/_mcp.mds +305 -0
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +5 -8
- package/src/assets/scripts/hooks/background-memory-update +40 -19
- package/src/assets/scripts/hooks/capture-prompt +18 -8
- package/src/assets/scripts/hooks/capture-question +18 -8
- package/src/assets/scripts/hooks/capture-turn +27 -13
- package/src/assets/scripts/hooks/debug-trace +11 -6
- package/src/assets/scripts/hooks/ensure-devflow-init +33 -6
- package/src/assets/scripts/hooks/ensure-proxy +9 -8
- package/src/assets/scripts/hooks/ensure-root-gitignore +236 -60
- package/src/assets/scripts/hooks/git-marker +48 -0
- package/src/assets/scripts/hooks/hook-log-init +3 -1
- package/src/assets/scripts/hooks/json-helper.cjs +228 -5
- package/src/assets/scripts/hooks/lib/project-paths.cjs +1 -20
- package/src/assets/scripts/hooks/log-paths +80 -0
- package/src/assets/scripts/hooks/memory-worker +22 -13
- package/src/assets/scripts/hooks/pre-compact-memory +44 -15
- package/src/assets/scripts/hooks/preamble +1 -4
- package/src/assets/scripts/hooks/queue-append +146 -28
- package/src/assets/scripts/hooks/resolve-project-root +101 -7
- package/src/assets/scripts/hooks/session-start-context +534 -20
- package/src/assets/scripts/hooks/session-start-memory +38 -15
- package/src/assets/scripts/lib/project-config.cjs +633 -0
- package/src/assets/scripts/pr-evidence.cjs +1961 -0
- package/src/assets/scripts/redact-secrets.cjs +490 -62
- package/src/assets/scripts/release-trace.cjs +1143 -0
- package/src/assets/scripts/resolve-evidence-policy.cjs +1145 -0
- package/src/assets/scripts/resolve-settings.cjs +1054 -0
- package/src/assets/scripts/verify-evidence.cjs +1822 -0
- package/src/assets/skills/compliance/SKILL.md +4 -2
- package/src/assets/skills/docs-framework/SKILL.md +11 -10
- package/src/assets/skills/docs-framework/references/patterns.md +10 -17
- package/src/assets/skills/gap-analysis/SKILL.md +2 -2
- package/src/assets/skills/git/SKILL.md +8 -78
- package/src/assets/skills/git/references/github-api.md +179 -141
- package/src/assets/skills/git/references/patterns.md +11 -6
- package/src/assets/skills/review-methodology/SKILL.md +1 -1
- package/src/assets/skills/review-methodology/references/patterns.md +6 -61
- package/src/assets/skills/review-methodology/references/violations.md +14 -22
- package/src/assets/skills/worktree-support/SKILL.md +1 -1
- package/src/assets/skills/worktree-support/references/roots.md +29 -0
- package/src/targets/claude-code/templates/managed-settings.json +25 -9
- package/src/assets/agents/git.md +0 -938
|
@@ -43,31 +43,25 @@ git diff --name-only # Only file names, no line numbers
|
|
|
43
43
|
|
|
44
44
|
## PR Comment Violations
|
|
45
45
|
|
|
46
|
-
###
|
|
46
|
+
### Publishing from Inside a Review
|
|
47
47
|
|
|
48
|
-
```
|
|
49
|
-
# VIOLATION:
|
|
50
|
-
gh api "repos/${REPO}/pulls/${PR_NUMBER}/comments" \
|
|
51
|
-
-f path="$FILE" \
|
|
52
|
-
-f line="$LINE" # May fail if file not in PR
|
|
53
|
-
|
|
54
|
-
# VIOLATION: No rate limiting
|
|
55
|
-
for issue in "${ISSUES[@]}"; do
|
|
56
|
-
create_pr_comment "$issue" # Will hit API rate limits
|
|
57
|
-
done
|
|
48
|
+
```markdown
|
|
49
|
+
# VIOLATION: Publishing from inside a review
|
|
58
50
|
```
|
|
59
51
|
|
|
52
|
+
A review that posts its own comments bypasses the repo-visibility gate and the
|
|
53
|
+
comment-sink scrub that post-review-summary applies, and publishes findings that were
|
|
54
|
+
never synthesized or deduplicated. Write the finding into the report instead.
|
|
55
|
+
|
|
60
56
|
### Wrong Comment Scope
|
|
61
57
|
|
|
62
|
-
```
|
|
58
|
+
```markdown
|
|
63
59
|
# VIOLATION: Commenting on pre-existing issues
|
|
64
|
-
# Category 3 issues should NOT get PR comments
|
|
65
|
-
create_pr_comment "file.ts" "456" "Pre-existing bug" # Wrong!
|
|
66
|
-
|
|
67
|
-
# VIOLATION: Missing severity indicator
|
|
68
|
-
create_pr_comment "file.ts" "123" "This is a problem" # No severity
|
|
69
60
|
```
|
|
70
61
|
|
|
62
|
+
Category 3 findings belong to the summary report. A comment on a line the author did
|
|
63
|
+
not touch reads as a request to fix unrelated code.
|
|
64
|
+
|
|
71
65
|
---
|
|
72
66
|
|
|
73
67
|
## Report Violations
|
|
@@ -111,11 +105,9 @@ Use these to find violations in review code:
|
|
|
111
105
|
# Find hardcoded base branches
|
|
112
106
|
grep -r 'BASE_BRANCH="main"' --include="*.sh"
|
|
113
107
|
|
|
114
|
-
# Find
|
|
115
|
-
grep -
|
|
116
|
-
|
|
117
|
-
# Find missing severity classifications
|
|
118
|
-
grep -r 'create_pr_comment' --include="*.sh" | grep -v 'CRITICAL\|HIGH\|MEDIUM\|LOW'
|
|
108
|
+
# Find review instructions that post their own comments instead of writing the report
|
|
109
|
+
grep -rn 'gh pr comment' --include="*.md" --include="*.sh"
|
|
110
|
+
grep -rn 'gh api .*/comments' --include="*.md" --include="*.sh"
|
|
119
111
|
```
|
|
120
112
|
|
|
121
113
|
---
|
|
@@ -49,7 +49,7 @@ Extract: `worktree {path}`, `HEAD {sha}`, `branch refs/heads/{name}`
|
|
|
49
49
|
|
|
50
50
|
Exclude:
|
|
51
51
|
- **Bare worktrees** (no branch)
|
|
52
|
-
- **Detached HEAD** (no named branch)
|
|
52
|
+
- **Detached HEAD** (no named branch; roots and detached HEAD: `references/roots.md`)
|
|
53
53
|
- **Protected branches**: `main`, `master`, `develop`, `integration`, `trunk`, `release/*`, `staging`, `production`
|
|
54
54
|
- **Mid-rebase or mid-merge**: check `git -C {path} status` for "rebase in progress" or "merging"
|
|
55
55
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Project Roots and Detached HEAD
|
|
2
|
+
|
|
3
|
+
Where devflow keeps per-project data across checkouts, and what it does on a detached HEAD. Companion to the worktree discovery algorithm in `SKILL.md`.
|
|
4
|
+
|
|
5
|
+
## Which Root Holds What
|
|
6
|
+
|
|
7
|
+
Devflow's per-project data does not all live in the same checkout.
|
|
8
|
+
|
|
9
|
+
| Data | Root | Why |
|
|
10
|
+
|------|------|-----|
|
|
11
|
+
| Learning ledger and queue (`.devflow/learning/`) | The main worktree, when its `.devflow/` exists and the main worktree is not HOME; else this checkout's toplevel | One ledger per repository, so ADR/PF numbers never restart or collide in a linked worktree (D-LEDGER-MAIN-WORKTREE) |
|
|
12
|
+
| Working memory (`.devflow/memory/`) | This checkout's toplevel | Memory describes the branch in front of you |
|
|
13
|
+
| Feature knowledge bases (`.devflow/features/`) | This checkout's toplevel | They are committed per branch (D-PROMPT-ROOT) |
|
|
14
|
+
| Personal `.devflow/config.json` | This checkout's toplevel | Per-worktree by decision: a new worktree does not inherit the source checkout's personal settings |
|
|
15
|
+
|
|
16
|
+
Hooks, loaders, the `devflow learning` CLI and the HUD resolve the root from git, never from cwd, so a session started in a subdirectory uses the repository root. Outside a git repository, and in a repository rooted at HOME, no hook creates `.devflow/` or a `.gitignore` (D-HOOKS-GIT-ONLY). A worktree that grew its own ledger before the main-worktree rule keeps it on disk; sessions there stop appending to it.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Detached HEAD
|
|
21
|
+
|
|
22
|
+
A detached HEAD is a commit checked out without a branch (`git checkout <sha>`, `git bisect`, a rebase stop, `git worktree add --detach`, a CI checkout). Devflow treats it as follows (D-DETACHED-HEAD):
|
|
23
|
+
|
|
24
|
+
| Surface | Behaviour |
|
|
25
|
+
|---------|-----------|
|
|
26
|
+
| Knowledge commit | Skipped: a commit there becomes unreachable once HEAD moves. The Knowledge agent reports `KB_COMMIT: skipped (detached HEAD) — uncommitted: <paths>`, and the calling workflow names those paths to the user |
|
|
27
|
+
| Worktree discovery | Excluded from auto-review (discovery Step 3 in `SKILL.md`): there is no branch to review, compare or push |
|
|
28
|
+
| Memory bootstrap | The first compaction bootstraps `WORKING-MEMORY.md` stamped `branch: (detached)`, keyed on the HEAD commit; an unborn branch has no commit and still skips |
|
|
29
|
+
| Memory header | Renders `detached @ <short-sha>` instead of `on unknown` |
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
"Bash(> /dev/nvme*)",
|
|
25
25
|
"Bash(sh -c *)",
|
|
26
26
|
"Bash(bash -c *)",
|
|
27
|
-
"Bash(
|
|
28
|
-
"Bash(
|
|
29
|
-
"Bash(
|
|
30
|
-
"Bash(
|
|
31
|
-
"Bash(
|
|
32
|
-
"Bash(
|
|
33
|
-
"Bash(
|
|
34
|
-
"Bash(
|
|
35
|
-
"Bash(
|
|
27
|
+
"Bash(zsh -c *)",
|
|
28
|
+
"Bash(bash)",
|
|
29
|
+
"Bash(sh)",
|
|
30
|
+
"Bash(zsh)",
|
|
31
|
+
"Bash(bash - *)",
|
|
32
|
+
"Bash(sh - *)",
|
|
33
|
+
"Bash(zsh - *)",
|
|
34
|
+
"Bash(bash -s *)",
|
|
35
|
+
"Bash(sh -s *)",
|
|
36
|
+
"Bash(zsh -s *)",
|
|
36
37
|
"Bash(eval *)",
|
|
37
38
|
"Bash(exec *)",
|
|
38
39
|
"Bash(sudo *)",
|
|
@@ -90,6 +91,21 @@
|
|
|
90
91
|
"Bash(docker run -v /:/host*)",
|
|
91
92
|
"Bash(docker run --pid=host*)",
|
|
92
93
|
"Bash(docker run --net=host*)",
|
|
94
|
+
"Bash(docker run*--privileged*)",
|
|
95
|
+
"Bash(docker run*-v /:*)",
|
|
96
|
+
"Bash(docker run*--volume /:*)",
|
|
97
|
+
"Bash(docker run*--volume=/:*)",
|
|
98
|
+
"Bash(docker pull *)",
|
|
99
|
+
"Bash(docker image pull *)",
|
|
100
|
+
"Bash(docker rm *)",
|
|
101
|
+
"Bash(docker container rm *)",
|
|
102
|
+
"Bash(docker rmi *)",
|
|
103
|
+
"Bash(docker image rm *)",
|
|
104
|
+
"Bash(docker volume rm *)",
|
|
105
|
+
"Bash(docker*prune*)",
|
|
106
|
+
"Bash(orb *)",
|
|
107
|
+
"Bash(orbctl *)",
|
|
108
|
+
"Bash(open *OrbStack*)",
|
|
93
109
|
"Bash(nsenter*)",
|
|
94
110
|
"Bash(crontab*)",
|
|
95
111
|
"Bash(rm /var/log*)",
|