Skip to content

Commit a9b7bfc

Browse files
committed
Add staged diff secret scanning with AI auto-fix and queue policy
Implement secret detection in staged diffs with interactive AI masking, add `queue_on_issues` commit option, and improve skills management with auto-sync and install support. Skills are now gitignored by default.
1 parent e6103ba commit a9b7bfc

16 files changed

Lines changed: 1112 additions & 165 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.cargo/
33
.ai/internal/
44
.ai/web/
5+
.ai/skills/
56
.ai/todos/*.bike
67
.claude/
78
.codex/
@@ -24,6 +25,7 @@ node_modules
2425
package-lock.json
2526
yarn.lock
2627
.vercel
28+
env-local/
2729
*.db
2830
.repo_ignore
2931
i.*

docs/commands/commit.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,19 @@ Sensitive patterns include:
162162
- `.pem`, `.key`, `id_rsa`, `id_ed25519`
163163
- Files containing `password`, `secret`, `token`
164164

165+
### Secret Scan (Staged Diff)
166+
167+
Flow scans staged diffs for likely secrets (API keys, tokens, passwords). If a match
168+
is detected, the commit is blocked. In an interactive terminal, flow offers to run
169+
an auto-fix using `ai` to mask or replace the values, then asks for approval to
170+
continue.
171+
172+
You can bypass the check for a single commit with:
173+
174+
```
175+
FLOW_ALLOW_SECRET_COMMIT=1 f commit
176+
```
177+
165178
### Large Diffs
166179

167180
Warns about files with significant changes:
@@ -239,6 +252,18 @@ model = "kimi-k2-thinking-turbo" # optional; uses Kimi default if omitted
239252

240253
This uses `kimi --quiet` (print mode) with your existing Kimi CLI auth/config.
241254

255+
### Queue Policy
256+
257+
Queue only when review finds issues (auto-push on a clean review):
258+
259+
```toml
260+
[commit]
261+
queue = true
262+
queue_on_issues = true
263+
```
264+
265+
`--queue` / `--no-queue` still override this behavior.
266+
242267
### AI Session Context
243268

244269
When `--context` is enabled, includes recent Claude Code session context:

docs/features.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ f env delete KEY1 KEY2
275275

276276
## Codex Skills
277277

278-
Manage Codex skills stored in `.ai/skills/`. Skills help Codex understand project-specific workflows.
278+
Manage Codex skills stored in `.ai/skills/` (gitignored by default). Skills help Codex understand project-specific workflows.
279279

280280
### Managing Skills
281281

@@ -315,8 +315,18 @@ f skills sync
315315

316316
This creates a skill for each task in `flow.toml`, so Codex automatically knows about your project's workflows.
317317

318+
To auto-sync tasks or auto-install curated skills on demand, add a `[skills]` section to `flow.toml`:
319+
320+
```toml
321+
[skills]
322+
sync_tasks = true
323+
install = ["linear", "github-pr"]
324+
```
325+
318326
### Skill Structure
319327

328+
`.ai/skills/` is generated locally and should not be committed.
329+
320330
```
321331
.ai/skills/
322332
└── deploy-worker/
@@ -494,7 +504,7 @@ alias f="flow"
494504
├── sessions/
495505
│ └── claude/
496506
│ └── index.json
497-
└── skills/ # Codex skills
507+
└── skills/ # Codex skills (gitignored, materialized locally)
498508
└── <skill-name>/
499509
└── skill.md
500510
```

docs/flow-toml-spec.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ activate_on_cd_to_root = true # optional, default false
2929
dependencies = ["fast"] # optional, names from [deps] or [flox.install]
3030
shortcuts = ["s"] # optional aliases for task lookup
3131

32+
[skills] # optional: skill enforcement (gitignored by default)
33+
sync_tasks = true # optional: generate skills for tasks
34+
install = ["linear"] # optional: ensure skills are installed (local ~/.codex/skills preferred, else registry)
35+
3236
[[alias]] # optional shell aliases (or use [aliases] table)
3337
fr = "f run" # key/value pairs of alias -> command
3438

@@ -50,6 +54,7 @@ fr = "f run"
5054
- `activate_on_cd_to_root`: tasks flagged run automatically when Flow is invoked via `activate` hooks.
5155
- `shortcuts`: case-insensitive aliases and abbreviations (auto-generated from task names) resolve tasks.
5256
- `alias`/`aliases`: emitted by `f setup` as shell `alias` lines.
57+
- `[skills]`: optional skill enforcement; `sync_tasks` generates `.ai/skills` from tasks and `install` ensures registry skills are present (skills are gitignored by default).
5358

5459
## Notes
5560

docs/task-failure-hooks.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ export FLOW_DISABLE_TASK_FAILURE_HOOK=1
7272

7373
## Rise / Zed Behavior
7474

75-
If your hook calls `rise work`, Flow automatically appends `--no-open` unless you
76-
explicitly allow it. This prevents Zed from opening on every failure.
75+
If your hook calls `rise work`, Flow automatically appends `--no-open` and strips
76+
`--focus` / `--focus-app` unless you explicitly allow opening. This prevents Zed
77+
or other apps from launching on every failure.
7778

7879
To allow the open behavior:
7980

flow.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ commit_with_check_review_url = "http://100.114.156.47:3000/review"
1919

2020
[commit]
2121
queue = true
22+
queue_on_issues = true
2223

2324
[jj]
2425
default_branch = "main"
@@ -209,6 +210,11 @@ name = "pond-debug"
209210
command = "bash -c 'cd /Users/nikiv/repos/ghostty-org/ghostty && zig build -Doptimize=Debug'"
210211
description = "Build Pond (Ghostty fork) in debug mode"
211212

213+
[[tasks]]
214+
name = "zed-build-debug-release"
215+
command = "bash -c 'cd /Users/nikiv/repos/zed-industries/zed && ./script/bundle-mac -d && ./script/bundle-mac'"
216+
description = "Build Zed macOS bundle in debug mode (fast) and then in release mode"
217+
212218
[[tasks]]
213219
name = "linsa-assistant-serve"
214220
command = "bash -c 'cd /Users/nikiv/code/org/linsa/linsa/api/cpp && sh ./run.sh serve'"

src/cli.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ pub enum Commands {
337337
Ext(ExtCommand),
338338
#[command(
339339
about = "Manage Codex skills (.ai/skills/).",
340-
long_about = "Create, list, and manage Codex skills for this project. Skills are stored in .ai/skills/ and help Codex understand project-specific workflows."
340+
long_about = "Create, list, and manage Codex skills for this project. Skills are stored in .ai/skills/ (gitignored by default) and help Codex understand project-specific workflows."
341341
)]
342342
Skills(SkillsCommand),
343343
#[command(
@@ -1344,6 +1344,16 @@ pub enum CommitQueueAction {
13441344
/// Commit hash (short or full).
13451345
hash: String,
13461346
},
1347+
/// Open the queued commit diff in Rise app (multi-file diff UI).
1348+
Open {
1349+
/// Commit hash (short or full).
1350+
hash: String,
1351+
},
1352+
/// Print the full diff for a queued commit to stdout.
1353+
Diff {
1354+
/// Commit hash (short or full).
1355+
hash: String,
1356+
},
13471357
/// Approve a queued commit and push it.
13481358
Approve {
13491359
/// Commit hash (short or full).

0 commit comments

Comments
 (0)