You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(workflow): save scope, root resolution, and size guideline (#51)
## Related Issue
No linked issue — the problem is explained below.
## Problem
`/workflow save` had three limitations:
1. It always saved into the project scope — there was no way to keep a
saved workflow in the user's home skills directory.
2. It used the session working directory as the project root. Saving
from a repository subdirectory placed the skill where the skill scanner
(which resolves the closest `.git` ancestor) would never find it — the
saved skill was invisible until the session was reopened at the
repository root.
3. The workflow size guideline in force during the run was not
persisted, so a re-run of the saved skill lost the fan-out expectation.
## What changed
- `/workflow save <name> [--personal]`: `--personal` saves into the home
skills directory; project scope stays the default.
- `writeSavedWorkflowSkill` now takes the working directory and resolves
the repository root itself via the skill scanner's own `findProjectRoot`
(now exported) — the same rule the scanner uses to look skills up, so a
save from a subdirectory lands where it will be found.
- Saved workflows persist the size guideline into the skill frontmatter
and state it in the body (the body is what the model reads on
invocation; frontmatter alone is inert). The TUI caches the resolved
guideline at startup, and the resolver is exported from the SDK.
- Docs: the `/workflow save` row in the slash-command reference, and the
`PYTHINKER_CODE_DISABLE_WORKFLOWS` /
`PYTHINKER_CODE_WORKFLOW_SIZE_GUIDELINE` rows in the env-var reference.
- Rider: removes an unused mission-control streaming helper and narrows
another to module scope (no behavior change).
Tests: the save suite covers scope selection, root resolution from a
subdirectory, and guideline persistence; the TUI suite covers
`--personal` parsing.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/Pythoughts-labs/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue, or explained the problem above.
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
The saved-workflow write helper now takes the working directory and resolves the repository root itself, saved workflows can carry a size guideline, and the workflow size guideline resolver is exported.
`/workflow save` accepts `--personal` to save into the home skills directory, resolves the repository root when saving from a subdirectory so the saved skill is discoverable, and persists the workflow size guideline into the saved skill.
|`PYTHINKER_CODE_BACKGROUND_KEEP_ALIVE_ON_EXIT`| Whether to keep background tasks when the session closes; takes higher priority than `config.toml`. The default is to stop them on exit | Truthy: `1`/`true`/`yes`/`on`; falsy: `0`/`false`/`no`/`off`|
133
133
|`PYTHINKER_CODE_PLUGIN_MARKETPLACE_URL`| Override the plugin marketplace JSON loaded by `/plugins`| URL or local path |
134
+
|`PYTHINKER_CODE_DISABLE_WORKFLOWS`| Disable Dynamic Workflow: the `DynamicWorkflow` tool is not registered and `/workflow` is hidden; takes higher priority than `config.toml`| Truthy: `1`/`true`/`yes`/`on`; falsy: `0`/`false`/`no`/`off`|
135
+
|`PYTHINKER_CODE_WORKFLOW_SIZE_GUIDELINE`| Override the advisory Dynamic Workflow size guideline injected into the tool guidance; takes higher priority than `config.toml`|`small`, `medium`, `large`, `unrestricted`|
134
136
|`PYTHINKER_CODE_EXPERIMENTAL_FLAG`| Enable all registered experimental features for this process; `micro_compaction` is already enabled by default |`1`, `true`, `yes`, `on`|
135
137
|`PYTHINKER_CODE_EXPERIMENTAL_MICRO_COMPACTION`| Override [`[experimental].micro_compaction`](./config-files.md#experimental) for this process | Truthy or falsy |
136
138
|`PYTHINKER_SHELL_PATH`| Override the Git Bash path on Windows (used when auto-detection fails) | Absolute path |
Copy file name to clipboardExpand all lines: docs/reference/slash-commands.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,7 @@ Some commands are only available in the idle state. Executing these commands whi
52
52
|`/workflow [on\|off]`| — | Toggle Dynamic Workflow mode without sending a prompt. Without arguments, flips the current state; explicitly passing `on`/`off` forces the setting. | No |
53
53
|`/workflow <task>`| — | Turn Dynamic Workflow mode on, then send `<task>` as a normal prompt. If the turn completes normally, Dynamic Workflow mode turns off automatically. In `manual` permission mode, Pythinker Code asks whether to switch to `auto` or `yolo` before starting. | No |
54
54
|`/workflow model [alias\|off]`| — | Ask Dynamic Workflow subagents to run on `alias` instead of the session model, so workers can use a cheaper or faster model than the agent orchestrating them. Without arguments, shows the current setting; `off` clears it. Lasts for the session. | No |
55
+
|`/workflow save <name> [--personal]`| — | Save the last Dynamic Workflow that ran in this session as a skill, immediately invocable under its generated skill name — `Audit Routes` becomes `/audit-routes`. Saves into the project (`<repo root>/.pythinker-code/skills/`) by default; `--personal` saves into your home skills directory instead. | No |
55
56
|`/goal [...]`| — | Start or manage an autonomous goal | See below |
0 commit comments