@danielstyle/featflow 0.6.5 → 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/README.md CHANGED
@@ -143,7 +143,8 @@ main (release, protected)
143
143
 
144
144
  | Command | Description |
145
145
  | --- | --- |
146
- | `featflow new <slug> [options]` | Create a feature (or `--program`) record from the repo template or `featflow`'s built-in template, auto-filling timestamps, `owner`, and branch. Pass `--local` to store under `.featflow/features/` (excluded via `.git/info/exclude`, zero tracked files). |
146
+ | `featflow new <slug> [options]` | Create a feature (or `--program`) record from the repo template or `featflow`'s built-in template, auto-filling timestamps, `owner`, and branch. Pass `--local` (or enable `"featureStorage": "notes"`) to store active records under `.featflow/features/` (excluded via `.git/info/exclude`, zero tracked files). |
147
+ | `featflow notes <subcommand>` | Manage Git Notes feature storage (`refs/notes/featflow`) & dual-source queries: `list`, `show`, `search`, `history`, `archive`, `sync`, and `migrate` (with top-level aliases `featflow list\|show\|search\|history`). Transparently reads both `refs/notes/featflow` and legacy `features/done/*.md`. |
147
148
  | `featflow skills <install\|status\|uninstall>` | Install, inspect, or uninstall global Agent Skills (`featflow`, `featflow-issues`, `featflow-regression`) directly from the installed package into `~/.agents/skills/` and detected `~/.claude/skills/`, `~/.codex/skills/`, `~/.cursor/skills/` (offline, always version-matched with your CLI). |
148
149
  | `featflow hooks <install\|uninstall\|status>` | Manage Git hooks: `--local` (default) adds/removes fenced blocks inside `.git/hooks/` without modifying repo files or overwriting custom hooks; `--repo` installs tracked `.githooks/`. |
149
150
  | `featflow init [options]` | Auto-detect repo config, inject managed `AGENTS.md`/`CLAUDE.md` block, check global Skills & CLI readiness, and interactively pick guardrails & AI coding-agent hooks with arrow-key single/multi-select prompts. Reuses global Skills by default (pass `--with-repo-skills` to embed `.agents/skills/` in the repo, or `--install-global-skills` to auto-sync global skills). Supports `--preset <minimal\|standard\|full>`, `--minimal`, `--merge`, `--with-codex-agents`, `--agent-hooks <antigravity,claude-code,codex,cursor\|all\|none>`, and `--yes`. |
@@ -182,6 +183,14 @@ main (release, protected)
182
183
  "developerBranchConfigKey": "featflow.developerBranch",
183
184
  "worktreeParent": null,
184
185
  "featuresDir": "features",
186
+ "featureStorage": "files",
187
+ "notes": {
188
+ "ref": "refs/notes/featflow",
189
+ "autoSync": true,
190
+ "autoArchiveOnFinish": true,
191
+ "recallInPromptHook": true,
192
+ "recallLimit": 3
193
+ },
185
194
  "trackFeaturesInGit": true,
186
195
  "trackCurrentFeaturePointer": false,
187
196
  "prefixes": ["feat", "fix", "chore", "docs", "test", "refactor", "perf", "security"],
package/README.zh-CN.md CHANGED
@@ -143,7 +143,8 @@ main (发布分支,受保护)
143
143
 
144
144
  | 命令 | 说明 |
145
145
  | --- | --- |
146
- | `featflow new <slug>` | 使用项目模板或 `featflow` 内置模板新建 feature(或 `--program`)记录,自动填入时间戳、`owner` 与分支;加 `--local` 存到 `.featflow/features/` 并写入 `.git/info/exclude` 实现零入侵。 |
146
+ | `featflow new <slug>` | 使用项目模板或 `featflow` 内置模板新建 feature(或 `--program`)记录,自动填入时间戳、`owner` 与分支;加 `--local`(或开启 `"featureStorage": "notes"`)存到 `.featflow/features/` 并写入 `.git/info/exclude` 实现零入侵。 |
147
+ | `featflow notes <subcommand>` | 管理 Git Notes(`refs/notes/featflow`)feature 归档与双源检索:`list` / `show` / `search` / `history` / `archive` / `sync` / `migrate`(并提供顶层别名 `featflow list\|show\|search\|history`),透明兼容老 `features/done/*.md`。 |
147
148
  | `featflow skills <install\|status\|uninstall>` | 直接从已安装的 `@danielstyle/featflow` 包离线安装/更新/体检全局 Agent Skills(`featflow`、`featflow-issues`、`featflow-regression`),自动同步到 `~/.agents/skills/` 及已检测的 `~/.claude/skills/`、`~/.codex/skills/`、`~/.cursor/skills/`。 |
148
149
  | `featflow hooks <install\|uninstall\|status>` | 管理 Git hooks:`--local`(默认)在 `.git/hooks/` 中无损增删托管块,保留已有自定义 hook 且不改仓库文件;`--repo` 生成入库的 `.githooks/`。 |
149
150
  | `featflow init` | 自动探测项目配置、无损注入 `AGENTS.md`/`CLAUDE.md` 托管块、体检全局 Skill 与 CLI 就绪状态,并在 TTY 下提供方向键单选与多选勾选框。默认直接复用全局 Skills(需入库可显式加 `--with-repo-skills`,非交互自动同步全局可加 `--install-global-skills`)。支持 `--preset <minimal\|standard\|full>`、`--minimal`、`--merge`、`--with-codex-agents`、`--agent-hooks <antigravity,claude-code,codex,cursor\|all\|none>` 与 `--yes`。 |
@@ -182,6 +183,14 @@ main (发布分支,受保护)
182
183
  "developerBranchConfigKey": "featflow.developerBranch",
183
184
  "worktreeParent": null,
184
185
  "featuresDir": "features",
186
+ "featureStorage": "files",
187
+ "notes": {
188
+ "ref": "refs/notes/featflow",
189
+ "autoSync": true,
190
+ "autoArchiveOnFinish": true,
191
+ "recallInPromptHook": true,
192
+ "recallLimit": 3
193
+ },
185
194
  "trackFeaturesInGit": true,
186
195
  "trackCurrentFeaturePointer": false,
187
196
  "prefixes": ["feat", "fix", "chore", "docs", "test", "refactor", "perf", "security"],
package/bin/featflow.mjs CHANGED
@@ -13,6 +13,7 @@ import { runHooks } from "../src/commands/hooks-cmd.mjs";
13
13
  import { runInit } from "../src/commands/init.mjs";
14
14
  import { runIssue } from "../src/commands/issue.mjs";
15
15
  import { runNew } from "../src/commands/new.mjs";
16
+ import { runNotes } from "../src/commands/notes-cmd.mjs";
16
17
  import { runPlanCheck } from "../src/commands/plan-check.mjs";
17
18
  import { runPolicy } from "../src/commands/policy-cmd.mjs";
18
19
  import { runPrCleanup } from "../src/commands/pr-cleanup.mjs";
@@ -36,6 +37,11 @@ Usage:
36
37
 
37
38
  Commands:
38
39
  new Create a feature or program record from repo or built-in template (--local for zero-footprint)
40
+ notes Git Notes feature records & dual-source queries (list | show | search | history | archive | sync | migrate)
41
+ list Alias for "featflow notes list"
42
+ show Alias for "featflow notes show"
43
+ search Alias for "featflow notes search"
44
+ history Alias for "featflow notes history"
39
45
  skills Install/sync/inspect global Agent Skills across Antigravity, Claude Code, Codex, and Cursor
40
46
  hooks Install/uninstall/inspect Git hooks (--local into .git/hooks/ or --repo into .githooks/)
41
47
  init Auto-detect repo config, inject AGENTS.md block, and scaffold featflow (--minimal for lightweight)
@@ -66,6 +72,11 @@ Run "featflow <command> --help" for command-specific options.
66
72
 
67
73
  const commands = {
68
74
  new: runNew,
75
+ notes: runNotes,
76
+ list: (rest) => runNotes(rest, "list"),
77
+ show: (rest) => runNotes(rest, "show"),
78
+ search: (rest) => runNotes(rest, "search"),
79
+ history: (rest) => runNotes(rest, "history"),
69
80
  skills: runSkills,
70
81
  hooks: runHooks,
71
82
  init: runInit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielstyle/featflow",
3
- "version": "0.6.5",
3
+ "version": "0.7.0",
4
4
  "description": "AI-native feature workflow: Skill + CLI + Git/Agent Hooks for discovery-first planning, Git worktree isolation, GitHub Issues closed loop, and safe branch lifecycles.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,7 +46,11 @@
46
46
  "./issues": "./src/issues.mjs",
47
47
  "./size-check": "./src/size-check.mjs",
48
48
  "./regression": "./src/regression.mjs",
49
- "./skills": "./src/skills-manager.mjs"
49
+ "./skills": "./src/skills-manager.mjs",
50
+ "./notes": "./src/notes.mjs",
51
+ "./notes-query": "./src/notes-query.mjs",
52
+ "./notes-recall": "./src/notes-recall.mjs",
53
+ "./notes-migrate": "./src/notes-migrate.mjs"
50
54
  },
51
55
  "files": [
52
56
  "bin/",
@@ -12,11 +12,11 @@ Use this skill from the active repository checkout or task worktree root. It kee
12
12
  `featflow` works in **three flexible modes** — from zero-footprint global usage (0 tracked repo files) to full repo-tracked team workflows:
13
13
 
14
14
  - `.featflow.json` (optional): repository configuration (branch mode, protected branches, worktree parent, product paths, post-create hooks, verification hints). When absent, `featflow` defaults to `trunk` mode (`main`).
15
- - `features/` (repo-tracked) **or** `.featflow/features/` (local zero-footprint via `featflow new --local`, excluded in `.git/info/exclude`):
15
+ - `features/` (repo-tracked) **or** `.featflow/features/` (local zero-footprint via `featflow new --local` or `"featureStorage": "notes"`, excluded in `.git/info/exclude`):
16
16
  - `active/`: feature records currently being implemented.
17
- - `done/`: completed feature records.
17
+ - `done/`: completed feature records (in `"featureStorage": "notes"` mode, completed records are automatically archived into `refs/notes/featflow` on `featflow finish` instead of accumulating in the working tree; legacy `features/done/*.md` remain readable transparently).
18
18
  - `paused/`: parked feature records ready to resume later.
19
- - `programs/`: long-running program records linking multiple feature phases.
19
+ - `programs/`: long-running program records linking multiple feature phases (always stay as Markdown files).
20
20
  - `_template.md` / `_program_template.md` (optional in repo): `featflow new` automatically uses the repo template when present and falls back to its built-in template otherwise.
21
21
  - `features/current-feature.md` (optional local pointer): short summary of the active worktree's current feature. In parallel worktree setups, treat `active/` as the canonical list rather than a single shared pointer file.
22
22
 
@@ -75,7 +75,7 @@ Use a program record (`features/programs/YYYY-MM-DD-short-kebab-program.md` from
75
75
  ## Start A Feature
76
76
 
77
77
  1. **Check Git state**: inspect `git status --short` and current branch. Never discard or relocate unrelated uncommitted changes without asking.
78
- 2. **Read-only discovery**: inspect the relevant files, architecture boundaries, contracts, and closest existing tests.
78
+ 2. **Read-only discovery**: inspect the relevant files, architecture boundaries, contracts, and closest existing tests. When prior design context or past feature decisions may be relevant (especially in repos using `"featureStorage": "notes"`), consult historical records via `featflow history <path...>` (matches both commit notes and `# Changed Files`), `featflow search <query>`, or `featflow show <id|path|sha>` (works seamlessly across both `refs/notes/featflow` and legacy `features/done/*.md`).
79
79
  3. **Present plan & wait for approval**: share the concrete plan in conversation — intended change, affected files/surfaces, technical approach, verification plan, risks, and open questions. Stop and wait unless the user already gave explicit approval or opted out.
80
80
  4. **Verify workflow setup**:
81
81
  - In `developer-branch` mode, verify the configured developer branch (`featflow status`). If unset, stop and ask the user to run `featflow setup <your-branch>`.
@@ -112,8 +112,10 @@ Use a program record (`features/programs/YYYY-MM-DD-short-kebab-program.md` from
112
112
 
113
113
  1. Run required verification checks in the task worktree.
114
114
  2. Update `Verification` (commands run, skipped checks with reasons), `Changed Files`, and `Handoff` (residual risks and follow-ups).
115
- 3. Set `status: done`, refresh `updated`, and move the record from `features/active/` to `features/done/`.
116
- 4. If linked to a program, update the program's phase index row to `done` and refresh `Resume Notes`.
115
+ 3. Set `status: done`, refresh `updated`, and:
116
+ - In default `files` storage mode: move the record from `features/active/` to `features/done/` and commit it with your changes.
117
+ - In `notes` storage mode (`"featureStorage": "notes"`): keep the updated active record in `.featflow/features/active/` (zero working-tree diff) and commit only your code/test changes — `featflow finish <branch>` will automatically mark it `done`, archive it into `refs/notes/featflow` attached to the task tip commit, and push the notes ref.
118
+ 4. If linked to a program, update the program's phase index row to `done` and refresh `Resume Notes` (old `features/done/...` links resolve automatically via `featflow show`).
117
119
  5. If the repository tracks `features/current-feature.md`, clear `active_feature:`, set `status: none`, and update `last_completed`.
118
120
  6. Commit all changes (including the `done` record) on the task branch with a focused Conventional Commit message.
119
121
  7. Run `featflow finish <branch>` (or pass `--no-push` for local-only, or `--pr` if opening a pull request):
@@ -9,6 +9,7 @@ import {
9
9
  } from "../agent-docs.mjs";
10
10
  import { loadConfig } from "../config.mjs";
11
11
  import { commandExists, findGitCommonDir, findRepoRoot, gitConfigGet, localBranchExists } from "../git.mjs";
12
+ import { inspectNotesGitConfig, isNotesStorageEnabled, listNoteEntries } from "../notes.mjs";
12
13
  import { validateActiveFeaturePlan } from "../plan.mjs";
13
14
  import {
14
15
  inspectCliAvailability,
@@ -200,6 +201,24 @@ export async function runDoctor(argv) {
200
201
  ledgerExists ? config.regression.ledgerFile : `configured "${config.regression.ledgerFile}" not found`,
201
202
  );
202
203
  }
204
+ if (isNotesStorageEnabled(config) || config.notes) {
205
+ const notesState = inspectNotesGitConfig(repoRoot, config);
206
+ const noteCount = listNoteEntries(repoRoot, notesState.notesRef).length;
207
+ const missingCfg = [];
208
+ if (notesState.hasRemote && !notesState.hasFetchRefspec) missingCfg.push(`remote.${notesState.remote}.fetch`);
209
+ if (!notesState.hasRewriteRef) missingCfg.push("notes.rewriteRef");
210
+ if (!notesState.rewriteAmend) missingCfg.push("notes.rewrite.amend");
211
+ if (!notesState.rewriteRebase) missingCfg.push("notes.rewrite.rebase");
212
+ if (missingCfg.length === 0) {
213
+ add("PASS", "Git Notes storage", `${notesState.notesRef} (${noteCount} annotated commit(s), sync/rewrite configured)`);
214
+ } else {
215
+ add(
216
+ "WARN",
217
+ "Git Notes storage",
218
+ `${notesState.notesRef} (${noteCount} annotated commit(s)); missing git config: ${missingCfg.join(", ")} (run \`featflow setup\`)`,
219
+ );
220
+ }
221
+ }
203
222
 
204
223
  if (configuredAgentHooks.length > 0) {
205
224
  add("PASS", "AI Agent hooks", configuredAgentHooks.join(", "));
@@ -11,10 +11,13 @@ import {
11
11
  localBranchExists,
12
12
  remoteExists,
13
13
  remoteTrackingBranchExists,
14
+ runRead,
14
15
  runWrite,
15
16
  sanitizeBranchForDir,
16
17
  validateTaskBranchName,
17
18
  } from "../git.mjs";
19
+ import { isNotesStorageEnabled, syncNotesWithRemote } from "../notes.mjs";
20
+ import { archiveFeatureFileToNotes } from "../notes-migrate.mjs";
18
21
  import { setupInstructions } from "../policy.mjs";
19
22
  import { cleanupMergedTaskBranches } from "./cleanup.mjs";
20
23
  import { syncDeveloperBranchWithIntegration } from "./sync-dev.mjs";
@@ -157,12 +160,39 @@ export async function runFinish(argv) {
157
160
  }
158
161
 
159
162
  const hasRemote = !options.noPush && remoteExists(remote, repoRoot);
163
+ const isPrMode = options.pr || (config.mode === "trunk" && config.finishTarget === "pr");
164
+ const shouldArchiveNotes = isNotesStorageEnabled(config) && config.notes?.autoArchiveOnFinish !== false;
165
+ const taskTipSha = runRead("git", ["rev-parse", options.taskBranch], repoRoot);
166
+
167
+ let archivedNote = null;
168
+ if (shouldArchiveNotes && taskWorktree) {
169
+ archivedNote = archiveFeatureFileToNotes(repoRoot, config, {
170
+ worktreePath: taskWorktree.path,
171
+ branch: options.taskBranch,
172
+ commit: taskTipSha,
173
+ dryRun: options.dryRun,
174
+ moveLocalDone: !isPrMode && options.keepWorktree,
175
+ sync: false,
176
+ });
177
+ if (archivedNote.archived) {
178
+ const verb = options.dryRun ? "[dry-run] Would archive" : "Archived";
179
+ console.log(`${verb} feature record ${archivedNote.id} -> ${archivedNote.notesRef} @ ${taskTipSha.slice(0, 8)}`);
180
+ }
181
+ }
160
182
 
161
183
  // PR-based finish (trunk + pr strategy or explicit --pr)
162
- if (options.pr || (config.mode === "trunk" && config.finishTarget === "pr")) {
184
+ if (isPrMode) {
163
185
  const pushCwd = taskWorktree?.path ?? repoRoot;
164
186
  if (hasRemote) {
165
187
  runWrite("git", ["push", "-u", remote, options.taskBranch], pushCwd, { dryRun: options.dryRun });
188
+ if (archivedNote?.archived || (isNotesStorageEnabled(config) && config.notes?.autoSync !== false)) {
189
+ syncNotesWithRemote(pushCwd, config, {
190
+ remote,
191
+ push: true,
192
+ dryRun: options.dryRun,
193
+ bestEffort: !archivedNote?.archived,
194
+ });
195
+ }
166
196
  }
167
197
  const base = config.mode === "developer-branch" ? config.integrationBranch : config.baseBranch;
168
198
  console.log(`Task branch ready for pull request: ${options.taskBranch}`);
@@ -245,6 +275,17 @@ export async function runFinish(argv) {
245
275
  dryRun: options.dryRun,
246
276
  env: internalEnv,
247
277
  });
278
+ if (archivedNote?.archived || (isNotesStorageEnabled(config) && config.notes?.autoSync !== false)) {
279
+ const notesSync = syncNotesWithRemote(targetWorktree.path, config, {
280
+ remote,
281
+ push: true,
282
+ dryRun: options.dryRun,
283
+ bestEffort: !archivedNote?.archived,
284
+ });
285
+ if (notesSync.pushed) {
286
+ console.log(`Synced feature notes: ${notesSync.notesRef} -> ${remote}`);
287
+ }
288
+ }
248
289
  }
249
290
 
250
291
  const remainingTaskWorktree = findWorktreeForBranch(gitWorktrees(targetWorktree.path), options.taskBranch);
@@ -6,10 +6,12 @@ import {
6
6
  CONFIG_FILENAME,
7
7
  DEFAULT_FILE_SIZE_BUDGET,
8
8
  DEFAULT_ISSUES_CONFIG,
9
+ DEFAULT_NOTES_CONFIG,
9
10
  DEFAULT_REGRESSION_CONFIG,
10
11
  packageRoot,
11
12
  presetConfig,
12
13
  } from "../config.mjs";
14
+ import { configureNotesGitConfig } from "../notes.mjs";
13
15
  import { applyDetectedConfig, detectRepoEnvironment } from "../detect.mjs";
14
16
  import { fail, findRepoRoot, gitConfigGet } from "../git.mjs";
15
17
  import { INIT_USAGE, parseInitArgs } from "../init-args.mjs";
@@ -102,6 +104,13 @@ export async function runInit(argv) {
102
104
  config.regression = { ...DEFAULT_REGRESSION_CONFIG };
103
105
  configChangedInMerge = true;
104
106
  }
107
+ if (options.featureStorage && config.featureStorage !== options.featureStorage) {
108
+ config.featureStorage = options.featureStorage;
109
+ if (options.featureStorage === "notes" && !config.notes) {
110
+ config.notes = { ...DEFAULT_NOTES_CONFIG };
111
+ }
112
+ configChangedInMerge = true;
113
+ }
105
114
  } else {
106
115
  try {
107
116
  config = presetConfig(options.mode);
@@ -116,6 +125,12 @@ export async function runInit(argv) {
116
125
  });
117
126
  }
118
127
  if (options.featuresDir) config.featuresDir = options.featuresDir;
128
+ if (options.featureStorage) {
129
+ config.featureStorage = options.featureStorage;
130
+ if (options.featureStorage === "notes") {
131
+ config.notes = { ...DEFAULT_NOTES_CONFIG };
132
+ }
133
+ }
119
134
  if (options.finishTarget) {
120
135
  if (config.mode !== "trunk" || !["merge", "pr"].includes(options.finishTarget)) {
121
136
  fail(`--finish-target "${options.finishTarget}" is only valid in trunk mode ("merge" or "pr").`, INIT_USAGE);
@@ -300,6 +315,19 @@ export async function runInit(argv) {
300
315
  }
301
316
  }
302
317
 
318
+ if (config.featureStorage === "notes") {
319
+ try {
320
+ const notesCfg = configureNotesGitConfig(repoRoot, config);
321
+ if (notesCfg.applied.length > 0) {
322
+ notices.push(`Configured Git notes (${notesCfg.notesRef}): ${notesCfg.applied.join(", ")}.`);
323
+ }
324
+ } catch (error) {
325
+ notices.push(
326
+ `[WARN] Could not configure Git notes settings automatically: ${error instanceof Error ? error.message : String(error)}`,
327
+ );
328
+ }
329
+ }
330
+
303
331
  let ignoredAdded = [];
304
332
  if (options.updateGitignore) {
305
333
  const entries = [".featflow/"];
@@ -9,6 +9,7 @@ import {
9
9
  findRepoRoot,
10
10
  gitConfigGet,
11
11
  } from "../git.mjs";
12
+ import { isNotesStorageEnabled, resolveNotesRef } from "../notes.mjs";
12
13
 
13
14
  const LOCAL_FEATURES_DIR = ".featflow/features";
14
15
 
@@ -26,6 +27,7 @@ Options:
26
27
  --status <status> Initial status (default: planned).
27
28
  --program Create a multi-phase program record under programs/ instead of active/.
28
29
  --local Write to .featflow/features/ and add to .git/info/exclude (zero tracked files).
30
+ --tracked Force writing under config.featuresDir even when featureStorage="notes".
29
31
  --dir <path> Override features base directory.
30
32
  --update-pointer Update current-feature.md pointer file when creating a feature record.
31
33
  --template Print the resolved template to stdout without writing any file.
@@ -41,6 +43,7 @@ function parseArgs(argv) {
41
43
  status: "planned",
42
44
  program: false,
43
45
  local: false,
46
+ tracked: false,
44
47
  dir: "",
45
48
  updatePointer: false,
46
49
  templateOnly: false,
@@ -62,6 +65,10 @@ function parseArgs(argv) {
62
65
  options.local = true;
63
66
  continue;
64
67
  }
68
+ if (arg === "--tracked") {
69
+ options.tracked = true;
70
+ continue;
71
+ }
65
72
  if (arg === "--update-pointer") {
66
73
  options.updatePointer = true;
67
74
  continue;
@@ -211,8 +218,10 @@ export async function runNew(argv) {
211
218
  }
212
219
 
213
220
  const { config } = loadConfig(repoRoot);
214
- const featuresBaseDir = options.dir || (options.local ? LOCAL_FEATURES_DIR : config.featuresDir);
215
- const rawTemplate = loadTemplate(repoRoot, featuresBaseDir, options.program);
221
+ const useNotesLocal = !options.program && !options.tracked && !options.dir && isNotesStorageEnabled(config);
222
+ const isLocalStorage = options.local || useNotesLocal;
223
+ const featuresBaseDir = options.dir || (isLocalStorage ? LOCAL_FEATURES_DIR : config.featuresDir);
224
+ const rawTemplate = loadTemplate(repoRoot, options.dir || config.featuresDir, options.program);
216
225
 
217
226
  if (options.templateOnly) {
218
227
  process.stdout.write(rawTemplate);
@@ -270,11 +279,14 @@ export async function runNew(argv) {
270
279
  mkdirSync(path.dirname(absPath), { recursive: true });
271
280
  writeFileSync(absPath, rendered, "utf8");
272
281
 
273
- if (options.local) {
282
+ if (isLocalStorage) {
274
283
  ensureGitInfoExclude(repoRoot, [".featflow/"]);
275
284
  }
276
285
 
277
- if (!options.program && (options.updatePointer || existsSync(path.resolve(repoRoot, featuresBaseDir, "current-feature.md")))) {
286
+ if (
287
+ !options.program &&
288
+ (options.updatePointer || (!useNotesLocal && existsSync(path.resolve(repoRoot, featuresBaseDir, "current-feature.md"))))
289
+ ) {
278
290
  const pointerPath = path.resolve(repoRoot, featuresBaseDir, "current-feature.md");
279
291
  const existingPointer = existsSync(pointerPath) ? readFileSync(pointerPath, "utf8") : "";
280
292
  const lastCompletedMatch = existingPointer.match(/^last_completed:[ \t]*([^\r\n]*)$/m);
@@ -304,7 +316,11 @@ export async function runNew(argv) {
304
316
  }
305
317
 
306
318
  console.log(`Created ${options.program ? "program" : "feature"} record: ${relPath}`);
307
- if (options.local) {
319
+ if (useNotesLocal) {
320
+ console.log(
321
+ `Stored locally under .featflow/features/ (zero tracked files; \`featflow finish\` will archive it to ${resolveNotesRef(config)}).`,
322
+ );
323
+ } else if (options.local) {
308
324
  console.log("Stored locally under .featflow/features/ (excluded via .git/info/exclude; zero tracked files added).");
309
325
  }
310
326
  console.log(`Next: fill Plan Details and run \`featflow plan-check ${relPath}\`.`);