@brainervirus/workit-core 0.6.0 → 0.7.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/package.json +10 -14
- package/scripts/doctor-check.ts +20 -0
- package/scripts/install-cursor-plugin.sh +51 -28
- package/scripts/install-opencode-plugin.sh +25 -22
- package/scripts/rewrite-workspace-deps.ts +15 -9
- package/scripts/sync-runtime.sh +71 -19
- package/scripts/vendor-assets.ts +37 -0
- package/skills/wk-implement/SKILL.md +2 -2
- package/skills/wk-pr/SKILL.md +1 -1
- package/src/core/boundary.ts +27 -0
- package/src/core/branch-policy.ts +63 -0
- package/src/core/branch.ts +166 -57
- package/src/core/changelog.ts +17 -14
- package/src/core/config-guard.ts +9 -2
- package/src/core/config.ts +227 -32
- package/src/core/detector.ts +22 -11
- package/src/core/docs-layout.ts +251 -0
- package/src/core/docs-migration.ts +639 -0
- package/src/core/docs-repo.ts +58 -21
- package/src/core/docs-validate.ts +181 -43
- package/src/core/doctor.ts +801 -0
- package/src/core/flow-state.ts +1579 -137
- package/src/core/git.ts +22 -5
- package/src/core/gitignore.ts +11 -2
- package/src/core/handoff-context.ts +18 -5
- package/src/{tools/handoff.ts → core/handoff-tools.ts} +16 -63
- package/src/core/hygiene.ts +53 -17
- package/src/core/init.ts +128 -31
- package/src/core/logger.ts +321 -0
- package/src/core/package-root.ts +28 -0
- package/src/core/parse-sections.ts +2 -2
- package/src/core/plan-tasks.ts +13 -3
- package/src/core/ports/init-toolkit-status.ts +1 -1
- package/src/core/ports/vcs-verify-token.ts +1 -1
- package/src/core/ports/youtrack-api.ts +4 -2
- package/src/core/ports/youtrack-config.ts +1 -3
- package/src/core/ports/youtrack-verify-token.ts +1 -1
- package/src/core/pr-create.ts +156 -29
- package/src/core/present.ts +11 -2
- package/src/core/registration.ts +215 -0
- package/src/core/reminder.ts +1 -2
- package/src/core/repo-context.ts +447 -0
- package/src/core/repo-tool.ts +4 -1
- package/src/core/repo-tools.ts +23 -0
- package/src/core/rules.ts +10 -7
- package/src/core/safe-write.ts +22 -0
- package/src/core/scripts.ts +3 -39
- package/src/core/sdd.ts +56 -31
- package/src/core/setup-state.ts +54 -0
- package/src/core/setup.ts +1216 -0
- package/src/core/skill-manifests.ts +95 -0
- package/src/core/support-matrix.ts +12 -0
- package/src/core/sync-runtime.ts +348 -0
- package/src/core/templates.ts +16 -6
- package/src/core/vcs-config.ts +191 -62
- package/src/core/verify-parse.ts +4 -2
- package/src/core/verify-project.ts +181 -0
- package/src/core/workspaces.ts +136 -17
- package/src/core/youtrack-tools.ts +228 -0
- package/src/core/youtrack.ts +320 -87
- package/src/core.ts +18 -3
- package/templates/execution-contract.md +9 -7
- package/templates/superpowers-doc-contract.md +5 -4
- package/scripts/_shared/common.sh +0 -158
- package/scripts/changelog-context.sh +0 -42
- package/scripts/docs-refresh-context.sh +0 -40
- package/scripts/init/apply.sh +0 -5
- package/scripts/init/status.sh +0 -5
- package/scripts/init/toolkit-status.sh +0 -5
- package/scripts/pr-create.sh +0 -5
- package/scripts/pr-ready-context.sh +0 -88
- package/scripts/present/ascii-wireframe.sh +0 -5
- package/scripts/present/flow-diagram.sh +0 -5
- package/scripts/release-notes-context.sh +0 -40
- package/scripts/vcs/config.sh +0 -5
- package/scripts/vcs/merged-style.sh +0 -5
- package/scripts/vcs/token-create-urls.sh +0 -5
- package/scripts/vcs/verify-token.sh +0 -5
- package/scripts/verify-project.sh +0 -140
- package/scripts/youtrack/api.sh +0 -5
- package/scripts/youtrack/config.sh +0 -5
- package/scripts/youtrack/greeting.sh +0 -5
- package/scripts/youtrack/parse-duration.sh +0 -5
- package/scripts/youtrack/token-create-url.sh +0 -5
- package/scripts/youtrack/verify-token.sh +0 -5
- package/scripts/youtrack/work-date-ms.sh +0 -5
- package/src/tools/docs-repo.ts +0 -42
- package/src/tools/flow.ts +0 -88
- package/src/tools/index.ts +0 -22
- package/src/tools/present.ts +0 -45
- package/src/tools/repo.ts +0 -357
- package/src/tools/rules.ts +0 -30
- package/src/tools/sdd.ts +0 -189
- package/src/tools/templates.ts +0 -27
- package/src/tools/youtrack.ts +0 -360
package/src/core.ts
CHANGED
|
@@ -7,7 +7,11 @@ export type Result<T> =
|
|
|
7
7
|
| { ok: false; data: T | null; error: string };
|
|
8
8
|
|
|
9
9
|
export const ok = <T>(data: T): Result<T> => ({ ok: true, data, error: null });
|
|
10
|
-
export const fail = <T = never>(error: string, data: T | null = null): Result<T> => ({
|
|
10
|
+
export const fail = <T = never>(error: string, data: T | null = null): Result<T> => ({
|
|
11
|
+
ok: false,
|
|
12
|
+
data,
|
|
13
|
+
error,
|
|
14
|
+
});
|
|
11
15
|
|
|
12
16
|
const revision = /^[A-Za-z0-9@][A-Za-z0-9@._/~^{}-]*$/;
|
|
13
17
|
|
|
@@ -25,7 +29,13 @@ export function gitRevisionParts(value: string): string[] {
|
|
|
25
29
|
|
|
26
30
|
export function resolveGitRevision(root: string, value: string): void {
|
|
27
31
|
for (const part of gitRevisionParts(value)) {
|
|
28
|
-
const result = run(root, "git", [
|
|
32
|
+
const result = run(root, "git", [
|
|
33
|
+
"rev-parse",
|
|
34
|
+
"--verify",
|
|
35
|
+
"--quiet",
|
|
36
|
+
"--end-of-options",
|
|
37
|
+
`${part}^{commit}`,
|
|
38
|
+
]);
|
|
29
39
|
if (result.exitCode !== 0) throw new Error(`invalid Git revision or range: ${value}`);
|
|
30
40
|
}
|
|
31
41
|
}
|
|
@@ -46,7 +56,12 @@ export function resolveInside(root: string, candidate: string): string {
|
|
|
46
56
|
return target;
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
export function run(
|
|
59
|
+
export function run(
|
|
60
|
+
root: string,
|
|
61
|
+
executable: string,
|
|
62
|
+
args: string[],
|
|
63
|
+
env: Record<string, string> = {},
|
|
64
|
+
) {
|
|
50
65
|
const cwd = realpathSync(root);
|
|
51
66
|
const result = spawnSync(executable, args, {
|
|
52
67
|
cwd,
|
|
@@ -9,16 +9,18 @@ Load `using-superpowers`, `subagent-driven-development`, `test-driven-developmen
|
|
|
9
9
|
|
|
10
10
|
- The parent is coordinator-only: it does not edit product code or perform delegated exploration.
|
|
11
11
|
- Never use a worktree. Branch changes are in-place through `workflow_branch_setup` on `feature/*` or `bugfix/*`; never commit on protected branches.
|
|
12
|
-
-
|
|
13
|
-
- Use native `todowrite` for visible task state as well as the
|
|
14
|
-
- Use native `question` for branch/stash choices and guarded external mutations; call mutation tools only after approval with `confirmed: true
|
|
12
|
+
- Working state, briefs, ledgers, and review diffs live only under gitignored `<SDD_DIR>` in `docs/<slug>/sdd/` and use `workflow_sdd_*` tools.
|
|
13
|
+
- Use native `todowrite` for visible task state as well as the gitignored ledger.
|
|
14
|
+
- Use native `question` for branch/stash choices and guarded external mutations; call mutation tools only after approval with `confirmed: true` (grounded in the recorded NativeChoiceEvidence).
|
|
15
|
+
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `workflow_spec_approve` / `workflow_plan_approve` / `workflow_plan_menu` — no evidence argument exists, and delegated worker status comes from host session parentage (`parentID`), never a caller `role` field. On Cursor, confirmations are policy-only (`attested: false`) and subagent-driven execution is rejected as unsupported.
|
|
16
|
+
- On Cursor, for every repository-scoped `workflow_*` call, pass the active Cursor workspace as `workspace_root`; never rely on the MCP process default.
|
|
15
17
|
- Use native `task` with only the built-in `explore` and `general` agents.
|
|
16
18
|
|
|
17
19
|
## Flow gates (HARD)
|
|
18
20
|
|
|
19
21
|
- `wk-implement` refuses to run unless the plan is `approved` (flow.json) and the post-plan menu was presented.
|
|
20
22
|
- `wk-handoff` refuses to run unless both spec and plan are `approved`.
|
|
21
|
-
- Sequence is enforced by tools: `workflow_spec_approve
|
|
23
|
+
- Sequence is enforced by tools: `workflow_spec_approve`, `workflow_plan_approve`, `workflow_plan_menu` — never skip a step (the spec/plan self-review runs automatically inside the transition; only the final approval asks for your confirmation).
|
|
22
24
|
|
|
23
25
|
## Setup
|
|
24
26
|
|
|
@@ -35,16 +37,16 @@ Load `using-superpowers`, `subagent-driven-development`, `test-driven-developmen
|
|
|
35
37
|
For each top-level task absent from `completed_task_ids`:
|
|
36
38
|
|
|
37
39
|
1. Mark it `in_progress` with `todowrite`.
|
|
38
|
-
2. Create a
|
|
40
|
+
2. Create a working-state brief with `workflow_sdd_task_brief` and `confirmed: true`.
|
|
39
41
|
3. Delegate read-only discovery, when needed, to an `explore` agent. Delegate implementation to a fresh `general` agent. Product changes follow TDD.
|
|
40
|
-
4. Create a
|
|
42
|
+
4. Create a working-state diff with `workflow_sdd_review_package` and `confirmed: true`.
|
|
41
43
|
5. Delegate spec-compliance review and code-quality review to separate `general` agents.
|
|
42
44
|
6. **Blocking** findings (Critical, Important, or spec-compliance) may trigger at most **two** fix+re-review rounds per task. **Advisory** findings (Minor, style, YAGNI, taste) never pause the loop — append them to `<SDD_DIR>/advisories.md`.
|
|
43
45
|
7. Append the validated ledger entry with `workflow_sdd_append_progress` and `confirmed: true`; mark the todo completed.
|
|
44
46
|
|
|
45
47
|
## Final gate
|
|
46
48
|
|
|
47
|
-
Run a separate full-branch code review, then `workflow_verify`. Present the full `<SDD_DIR>/advisories.md` roll-up once, then use native `question` so the user can choose which advisory items to fix, discuss, or discard. Report exact check results and never infer success. Use `workflow_git_context` for a commit preview and load `wk-commit` through `skill` for an approved commit. If
|
|
49
|
+
Run a separate full-branch code review, then `workflow_verify`. Present the full `<SDD_DIR>/advisories.md` roll-up once, then use native `question` so the user can choose which advisory items to fix, discuss, or discard. Report exact check results and never infer success. Use `workflow_git_context` for a commit preview and load `wk-commit` through `skill` for an approved commit. If working state contains a stash reference, preview reapplication through `question`, then call `workflow_branch_setup` with `confirmed: true` after approval.
|
|
48
50
|
|
|
49
51
|
## Task order
|
|
50
52
|
|
|
@@ -27,15 +27,16 @@ Plans require:
|
|
|
27
27
|
|
|
28
28
|
`bugfix/<slug>` is also valid. Never use `main`, `develop`, `master`, or `prod`. Use plain backtick paths. Top-level headings are exactly `### Task N: Title`; steps use `- [ ] **Step N:** ...`; task headings never appear inside fences.
|
|
29
29
|
|
|
30
|
-
Before writing **Branch:** into a new spec or plan, call `workflow_docs_branch` and write the returned `branch` verbatim. When `action` is `keep`, use the current feature/bugfix branch. When `action` is `create_from_develop`, create the branch only through `workflow_branch_setup
|
|
30
|
+
Before writing **Branch:** into a new spec or plan, call `workflow_docs_branch` and write the returned `branch` verbatim. When `action` is `keep`, use the current feature/bugfix branch. When `action` is `create_from_develop` or `create_from_base`, create the branch only through `workflow_branch_setup`; it uses the configured workspace/global target branch.
|
|
31
31
|
|
|
32
32
|
## Execution and handoff
|
|
33
33
|
|
|
34
34
|
- Implementation uses `wk-implement` and subagent-driven development, with native `todowrite` and `task`.
|
|
35
35
|
- Commits use `wk-commit` after its native `question` confirmation.
|
|
36
36
|
- Continuation uses `wk-handoff`, whose `workflow_handoff_session` creates and seeds the OpenCode session automatically.
|
|
37
|
-
- Never use worktrees. Resolve the declared branch with `workflow_resolve_branch`, preview dirty-tree stash choices with `question`, and apply an approved in-place checkout through `workflow_branch_setup` with `confirmed: true
|
|
38
|
-
-
|
|
37
|
+
- Never use worktrees. Resolve the declared branch with `workflow_resolve_branch`, preview dirty-tree stash choices with `question`, and apply an approved in-place checkout through `workflow_branch_setup` with `confirmed: true` (grounded in the recorded NativeChoiceEvidence).
|
|
38
|
+
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `workflow_spec_approve` / `workflow_plan_approve` / `workflow_plan_menu` — no evidence argument exists, and delegated worker status comes from host session parentage (`parentID`), never a caller `role` field. On Cursor, confirmations are policy-only (`attested: false`) and subagent-driven execution is rejected as unsupported.
|
|
39
|
+
- Keep all SDD state under the gitignored `docs/<slug>/sdd/`; use `workflow_sdd_context` and the registered `workflow_sdd_*` tools.
|
|
39
40
|
- After implementation, use `question` before an approved stash reapply through `workflow_branch_setup` with `confirmed: true`.
|
|
40
41
|
|
|
41
42
|
## YouTrack content
|
|
@@ -46,7 +47,7 @@ Chat follows the user's language. YouTrack task comments are Spanish (`es-CL`) a
|
|
|
46
47
|
|
|
47
48
|
Before handoff, call `workflow_docs_validate` on the linked spec/plan pair. Hard-fail on any error; never offer execution when validation fails.
|
|
48
49
|
|
|
49
|
-
Before handoff, verify the saved spec path, plan path, declared branch, top-level task numbering, and
|
|
50
|
+
Before handoff, verify the saved spec path, plan path, declared branch, top-level task numbering, and workflow-managed SDD directory through the registered read-only workflow tools. Report structured failures; never infer success.
|
|
50
51
|
|
|
51
52
|
## Post-plan execution choice
|
|
52
53
|
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
set -u
|
|
4
|
-
|
|
5
|
-
repo_root() {
|
|
6
|
-
git rev-parse --show-toplevel 2>/dev/null || pwd
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
current_branch() {
|
|
10
|
-
git rev-parse --abbrev-ref HEAD 2>/dev/null || printf 'unknown'
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
default_base() {
|
|
14
|
-
for ref in origin/main main origin/master master origin/develop develop; do
|
|
15
|
-
if git rev-parse --verify "$ref" >/dev/null 2>&1; then
|
|
16
|
-
printf '%s\n' "$ref"
|
|
17
|
-
return 0
|
|
18
|
-
fi
|
|
19
|
-
done
|
|
20
|
-
printf 'HEAD~1\n'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
range_arg_or_default() {
|
|
24
|
-
if [ "${1:-}" != "" ]; then
|
|
25
|
-
printf '%s\n' "$1"
|
|
26
|
-
else
|
|
27
|
-
base=$(default_base)
|
|
28
|
-
printf '%s...HEAD\n' "$base"
|
|
29
|
-
fi
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
pr_range_arg_or_default() {
|
|
33
|
-
if [ "${1:-}" != "" ]; then
|
|
34
|
-
printf '%s\n' "$1"
|
|
35
|
-
return 0
|
|
36
|
-
fi
|
|
37
|
-
resolve_pr_range
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
is_protected_branch() {
|
|
41
|
-
branch=$1
|
|
42
|
-
case "$branch" in
|
|
43
|
-
main|master|develop|prod|production) return 0 ;;
|
|
44
|
-
*) return 1 ;;
|
|
45
|
-
esac
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
is_pr_branch() {
|
|
49
|
-
branch=$1
|
|
50
|
-
case "$branch" in
|
|
51
|
-
feature/*|bugfix/*) return 0 ;;
|
|
52
|
-
*) return 1 ;;
|
|
53
|
-
esac
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
# ponytail: develop-only base — main is release-only in this workflow; never compare PRs to main
|
|
57
|
-
resolve_pr_branch_context() {
|
|
58
|
-
branch=$(current_branch)
|
|
59
|
-
|
|
60
|
-
if is_protected_branch "$branch"; then
|
|
61
|
-
printf 'ERROR: cannot build PR context on protected branch %s — PRs are for feature/* or bugfix/* only\n' "$branch" >&2
|
|
62
|
-
return 1
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
if ! is_pr_branch "$branch"; then
|
|
66
|
-
if [ "$branch" = "unknown" ]; then
|
|
67
|
-
printf 'ERROR: not in a git repository at %s — open the target repository as the OpenCode session directory\n' "$(pwd)" >&2
|
|
68
|
-
else
|
|
69
|
-
printf 'ERROR: branch %s is not feature/* or bugfix/* — checkout a feature branch or pass an explicit git range\n' "$branch" >&2
|
|
70
|
-
fi
|
|
71
|
-
return 1
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
best_ref=""
|
|
75
|
-
best_mb=""
|
|
76
|
-
|
|
77
|
-
for ref in origin/develop develop; do
|
|
78
|
-
git rev-parse --verify "$ref" >/dev/null 2>&1 || continue
|
|
79
|
-
mb=$(git merge-base "$ref" HEAD 2>/dev/null) || continue
|
|
80
|
-
best_ref=$ref
|
|
81
|
-
best_mb=$mb
|
|
82
|
-
break
|
|
83
|
-
done
|
|
84
|
-
|
|
85
|
-
if [ "$best_ref" = "" ] || [ "$best_mb" = "" ]; then
|
|
86
|
-
printf 'ERROR: develop branch not found — PRs target develop (not main). Fetch/checkout develop or pass an explicit git range\n' >&2
|
|
87
|
-
return 1
|
|
88
|
-
fi
|
|
89
|
-
|
|
90
|
-
PR_BASE_REF=$best_ref
|
|
91
|
-
PR_MERGE_BASE=$best_mb
|
|
92
|
-
PR_RANGE="${best_ref}..HEAD"
|
|
93
|
-
PR_DIFF_RANGE="${best_mb}..HEAD"
|
|
94
|
-
export PR_BASE_REF PR_MERGE_BASE PR_RANGE PR_DIFF_RANGE
|
|
95
|
-
return 0
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
resolve_pr_range() {
|
|
99
|
-
if ! resolve_pr_branch_context; then
|
|
100
|
-
return 1
|
|
101
|
-
fi
|
|
102
|
-
printf '%s\n' "$PR_RANGE"
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
print_section() {
|
|
106
|
-
printf '\n## %s\n\n' "$1"
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
run_or_note() {
|
|
110
|
-
label=$1
|
|
111
|
-
shift
|
|
112
|
-
print_section "$label"
|
|
113
|
-
"$@" 2>&1 || printf '[command failed: %s]\n' "$*"
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
find_pr_template() {
|
|
117
|
-
for path in \
|
|
118
|
-
.gitlab/merge_request_templates/Default.md \
|
|
119
|
-
.gitlab/merge_request_templates/default.md \
|
|
120
|
-
.gitlab/merge_request_templates/merge_request_template.md \
|
|
121
|
-
.github/PULL_REQUEST_TEMPLATE.md \
|
|
122
|
-
.github/pull_request_template.md \
|
|
123
|
-
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md \
|
|
124
|
-
docs/PULL_REQUEST_TEMPLATE.md \
|
|
125
|
-
PULL_REQUEST_TEMPLATE.md
|
|
126
|
-
do
|
|
127
|
-
if [ -f "$path" ]; then
|
|
128
|
-
printf '%s\n' "$path"
|
|
129
|
-
return 0
|
|
130
|
-
fi
|
|
131
|
-
done
|
|
132
|
-
return 1
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
fallback_pr_template() {
|
|
136
|
-
cat <<'TEMPLATE'
|
|
137
|
-
## Summary
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
## Validation
|
|
141
|
-
- [ ] Not run
|
|
142
|
-
TEMPLATE
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
changed_files_for_range() {
|
|
146
|
-
range=$1
|
|
147
|
-
git diff --name-only "$range" -- 2>/dev/null || git diff --name-only -- 2>/dev/null || true
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
commit_log_for_range() {
|
|
151
|
-
range=$1
|
|
152
|
-
git log --oneline --decorate --no-merges "$range" -- 2>/dev/null || git log --oneline --decorate -10 -- 2>/dev/null || true
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
diff_stat_for_range() {
|
|
156
|
-
range=$1
|
|
157
|
-
git diff --stat "$range" -- 2>/dev/null || git diff --stat -- 2>/dev/null || true
|
|
158
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
set -u
|
|
4
|
-
|
|
5
|
-
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
6
|
-
. "$SCRIPT_DIR/_shared/common.sh"
|
|
7
|
-
|
|
8
|
-
cd "$(repo_root)" || exit 1
|
|
9
|
-
|
|
10
|
-
range=$(range_arg_or_default "${1:-}")
|
|
11
|
-
|
|
12
|
-
print_section "Repository"
|
|
13
|
-
printf 'root: %s\n' "$(pwd)"
|
|
14
|
-
printf 'branch: %s\n' "$(current_branch)"
|
|
15
|
-
printf 'range: %s\n' "$range"
|
|
16
|
-
|
|
17
|
-
print_section "Keep a Changelog Rules"
|
|
18
|
-
cat <<'RULES'
|
|
19
|
-
- Use an [Unreleased] section.
|
|
20
|
-
- Use Added, Changed, Deprecated, Removed, Fixed, Security.
|
|
21
|
-
- Entries should be human-readable and user-facing.
|
|
22
|
-
- Do not use raw commit messages as changelog bullets.
|
|
23
|
-
- MERGE into existing ### Category under [Unreleased] — never append a second ### Added / ### Fixed block.
|
|
24
|
-
- Apply with the native workflow_changelog_apply tool only (not hand-edits under Unreleased).
|
|
25
|
-
- If Unreleased already has duplicate category headings, normalize_only first.
|
|
26
|
-
RULES
|
|
27
|
-
|
|
28
|
-
print_section "Existing CHANGELOG.md"
|
|
29
|
-
if [ -f CHANGELOG.md ]; then
|
|
30
|
-
sed -n '1,260p' CHANGELOG.md
|
|
31
|
-
else
|
|
32
|
-
printf 'CHANGELOG.md not found.\n'
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
print_section "Commits"
|
|
36
|
-
commit_log_for_range "$range"
|
|
37
|
-
|
|
38
|
-
print_section "Diff Stat"
|
|
39
|
-
diff_stat_for_range "$range"
|
|
40
|
-
|
|
41
|
-
print_section "Changed Files"
|
|
42
|
-
changed_files_for_range "$range"
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
set -u
|
|
4
|
-
|
|
5
|
-
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
6
|
-
. "$SCRIPT_DIR/_shared/common.sh"
|
|
7
|
-
|
|
8
|
-
cd "$(repo_root)" || exit 1
|
|
9
|
-
|
|
10
|
-
range=$(range_arg_or_default "${1:-}")
|
|
11
|
-
|
|
12
|
-
print_section "Repository"
|
|
13
|
-
printf 'root: %s\n' "$(pwd)"
|
|
14
|
-
printf 'branch: %s\n' "$(current_branch)"
|
|
15
|
-
printf 'range: %s\n' "$range"
|
|
16
|
-
|
|
17
|
-
print_section "Changed Files"
|
|
18
|
-
changed_files_for_range "$range"
|
|
19
|
-
|
|
20
|
-
print_section "Documentation Files"
|
|
21
|
-
find . -maxdepth 3 \( -name 'README.md' -o -name '*.md' \) \
|
|
22
|
-
-not -path './.git/*' \
|
|
23
|
-
-not -path './node_modules/*' \
|
|
24
|
-
-not -path './target/*' \
|
|
25
|
-
-not -path './dist/*' \
|
|
26
|
-
| sort | sed -n '1,200p'
|
|
27
|
-
|
|
28
|
-
print_section "README Preview"
|
|
29
|
-
if [ -f README.md ]; then
|
|
30
|
-
sed -n '1,220p' README.md
|
|
31
|
-
else
|
|
32
|
-
printf 'README.md not found.\n'
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
print_section "Package Scripts"
|
|
36
|
-
if [ -f package.json ]; then
|
|
37
|
-
node -e "const p=require('./package.json'); console.log(JSON.stringify({name:p.name,version:p.version,scripts:p.scripts}, null, 2))" 2>/dev/null || true
|
|
38
|
-
else
|
|
39
|
-
printf 'package.json not found.\n'
|
|
40
|
-
fi
|
package/scripts/init/apply.sh
DELETED
package/scripts/init/status.sh
DELETED
package/scripts/pr-create.sh
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
set -u
|
|
4
|
-
|
|
5
|
-
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
6
|
-
. "$SCRIPT_DIR/_shared/common.sh"
|
|
7
|
-
|
|
8
|
-
cd "$(repo_root)" || exit 1
|
|
9
|
-
|
|
10
|
-
auto_range=false
|
|
11
|
-
if [ "${1:-}" != "" ]; then
|
|
12
|
-
range=$1
|
|
13
|
-
else
|
|
14
|
-
auto_range=true
|
|
15
|
-
if ! resolve_pr_branch_context; then
|
|
16
|
-
exit 1
|
|
17
|
-
fi
|
|
18
|
-
range=$PR_RANGE
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
print_section "Repository"
|
|
22
|
-
printf 'root: %s\n' "$(pwd)"
|
|
23
|
-
printf 'branch: %s\n' "$(current_branch)"
|
|
24
|
-
printf 'range: %s\n' "$range"
|
|
25
|
-
if [ "$auto_range" = true ]; then
|
|
26
|
-
printf 'base_ref: %s\n' "$PR_BASE_REF"
|
|
27
|
-
printf 'merge_base: %s\n' "$PR_MERGE_BASE"
|
|
28
|
-
printf 'diff_range: %s\n' "$PR_DIFF_RANGE"
|
|
29
|
-
printf 'range_mode: branch-exclusive\n'
|
|
30
|
-
if [ "${PR_SYNC_NOTES:-}" != "" ]; then
|
|
31
|
-
printf 'git_sync: %s\n' "$PR_SYNC_NOTES"
|
|
32
|
-
fi
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
print_section "Working Tree"
|
|
36
|
-
git status --short 2>&1 || true
|
|
37
|
-
|
|
38
|
-
print_section "Commits"
|
|
39
|
-
commit_log_for_range "$range"
|
|
40
|
-
|
|
41
|
-
diff_range=$range
|
|
42
|
-
if [ "$auto_range" = true ]; then
|
|
43
|
-
diff_range=$PR_DIFF_RANGE
|
|
44
|
-
fi
|
|
45
|
-
|
|
46
|
-
print_section "Diff Stat"
|
|
47
|
-
diff_stat_for_range "$diff_range"
|
|
48
|
-
|
|
49
|
-
print_section "Changed Files"
|
|
50
|
-
changed_files_for_range "$diff_range"
|
|
51
|
-
|
|
52
|
-
print_section "PR Template"
|
|
53
|
-
template=$(find_pr_template || true)
|
|
54
|
-
if [ "$template" != "" ]; then
|
|
55
|
-
printf 'template_path: %s\n\n' "$template"
|
|
56
|
-
sed -n '1,220p' "$template"
|
|
57
|
-
else
|
|
58
|
-
printf 'template_path: none\n\n'
|
|
59
|
-
fallback_pr_template
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
print_section "Recent Validation Signals"
|
|
63
|
-
if [ -f package.json ]; then
|
|
64
|
-
printf 'package.json detected. Common scripts:\n'
|
|
65
|
-
node -e "const p=require('./package.json'); for (const k of ['lint','format:check','test','build']) if (p.scripts&&p.scripts[k]) console.log(k+': '+p.scripts[k])" 2>/dev/null || true
|
|
66
|
-
fi
|
|
67
|
-
if [ -f Cargo.toml ] || [ -f src-tauri/Cargo.toml ]; then
|
|
68
|
-
printf 'Rust project detected.\n'
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
print_section "VCS Config"
|
|
72
|
-
RES=$(bash "$SCRIPT_DIR/vcs/config.sh" resolve 2>/dev/null || true)
|
|
73
|
-
if [ -n "$RES" ]; then
|
|
74
|
-
printf '%s\n' "$RES" | bun -e 'const r = JSON.parse(await Bun.stdin.text()); console.log("workspace: " + String(r.workspace_name || "none")); console.log("provider: " + String(r.provider || "gitlab"))'
|
|
75
|
-
fi
|
|
76
|
-
if bash "$SCRIPT_DIR/vcs/config.sh" summary 2>/dev/null; then
|
|
77
|
-
:
|
|
78
|
-
else
|
|
79
|
-
printf 'vcs: not configured — run /wk-init action vcs_scaffold\n'
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
print_section "Merged PR Style"
|
|
83
|
-
STYLE=$(bash "$SCRIPT_DIR/vcs/merged-style.sh" 6 2>/dev/null || true)
|
|
84
|
-
if [ -n "$STYLE" ]; then
|
|
85
|
-
printf '%s\n' "$STYLE"
|
|
86
|
-
else
|
|
87
|
-
printf 'style_hints: Configure VCS token to load your recent merged MR/PR examples\n'
|
|
88
|
-
fi
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
set -u
|
|
4
|
-
|
|
5
|
-
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
6
|
-
. "$SCRIPT_DIR/_shared/common.sh"
|
|
7
|
-
|
|
8
|
-
cd "$(repo_root)" || exit 1
|
|
9
|
-
|
|
10
|
-
requested="${1:-}"
|
|
11
|
-
if [ -z "$requested" ]; then
|
|
12
|
-
printf 'ERROR: release tag or range required\n' >&2
|
|
13
|
-
exit 1
|
|
14
|
-
fi
|
|
15
|
-
range=$(range_arg_or_default "$requested")
|
|
16
|
-
|
|
17
|
-
print_section "Repository"
|
|
18
|
-
printf 'root: %s\n' "$(pwd)"
|
|
19
|
-
printf 'branch: %s\n' "$(current_branch)"
|
|
20
|
-
printf 'requested: %s\n' "${requested:-none}"
|
|
21
|
-
printf 'range: %s\n' "$range"
|
|
22
|
-
|
|
23
|
-
print_section "Tags"
|
|
24
|
-
git tag --sort=-creatordate 2>/dev/null | sed -n '1,20p' || true
|
|
25
|
-
|
|
26
|
-
print_section "Commits"
|
|
27
|
-
commit_log_for_range "$range"
|
|
28
|
-
|
|
29
|
-
print_section "Diff Stat"
|
|
30
|
-
diff_stat_for_range "$range"
|
|
31
|
-
|
|
32
|
-
print_section "Changed Files"
|
|
33
|
-
changed_files_for_range "$range"
|
|
34
|
-
|
|
35
|
-
print_section "Existing Release Files"
|
|
36
|
-
for path in CHANGELOG.md RELEASE_NOTES.md .github/releases.md; do
|
|
37
|
-
if [ -f "$path" ]; then
|
|
38
|
-
printf '%s\n' "$path"
|
|
39
|
-
fi
|
|
40
|
-
done
|
package/scripts/vcs/config.sh
DELETED