@danielstyle/featflow 0.0.0-stage → 0.6.3
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/LICENSE +21 -0
- package/README.md +206 -2
- package/README.zh-CN.md +163 -0
- package/bin/featflow.mjs +113 -0
- package/package.json +62 -4
- package/skills/featflow/SKILL.md +127 -0
- package/skills/featflow-issues/SKILL.md +104 -0
- package/skills/featflow-regression/SKILL.md +63 -0
- package/src/agent-docs.mjs +143 -0
- package/src/changed-files.mjs +204 -0
- package/src/commands/cleanup.mjs +221 -0
- package/src/commands/codegraph.mjs +110 -0
- package/src/commands/doctor.mjs +265 -0
- package/src/commands/finish.mjs +249 -0
- package/src/commands/hook-cmd.mjs +78 -0
- package/src/commands/hooks-cmd.mjs +238 -0
- package/src/commands/init.mjs +382 -0
- package/src/commands/issue.mjs +434 -0
- package/src/commands/new.mjs +311 -0
- package/src/commands/plan-check.mjs +75 -0
- package/src/commands/policy-cmd.mjs +51 -0
- package/src/commands/pr-cleanup.mjs +194 -0
- package/src/commands/regression.mjs +206 -0
- package/src/commands/setup.mjs +343 -0
- package/src/commands/size-check.mjs +137 -0
- package/src/commands/status.mjs +100 -0
- package/src/commands/sync.mjs +407 -0
- package/src/commands/verify.mjs +206 -0
- package/src/commands/worktree.mjs +205 -0
- package/src/config.mjs +295 -0
- package/src/detect.mjs +314 -0
- package/src/git.mjs +331 -0
- package/src/hook-adapters.mjs +218 -0
- package/src/hooks-core.mjs +420 -0
- package/src/index.mjs +13 -0
- package/src/init-args.mjs +282 -0
- package/src/init-hooks.mjs +312 -0
- package/src/init-prompts.mjs +191 -0
- package/src/issues-helpers.mjs +463 -0
- package/src/issues.mjs +521 -0
- package/src/plan.mjs +202 -0
- package/src/policy.mjs +143 -0
- package/src/regression.mjs +338 -0
- package/src/size-check.mjs +203 -0
- package/src/tui-select.mjs +378 -0
- package/templates/adapters/antigravity/hooks.json +42 -0
- package/templates/adapters/claude-code/settings.json +46 -0
- package/templates/adapters/codex/config.toml +19 -0
- package/templates/adapters/cursor/hooks.json +27 -0
- package/templates/agents/codex/codebase-locator.toml +28 -0
- package/templates/agents/codex/implementation-scout.toml +28 -0
- package/templates/agents/codex/regression-guard-planner.toml +20 -0
- package/templates/features/README.md +56 -0
- package/templates/features/_program_template.md +79 -0
- package/templates/features/_template.md +120 -0
- package/templates/features/current-feature.md +18 -0
- package/templates/githooks/post-merge +7 -0
- package/templates/githooks/pre-commit +11 -0
- package/templates/githooks/pre-push +10 -0
- package/templates/regression/regression-ledger.yml +23 -0
- package/templates/snippets/AGENTS-workflow.md +21 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: featflow
|
|
3
|
+
description: Structured AI-native feature planning, execution records, multi-phase program roadmaps, and isolated Git worktree workflow. Use whenever starting, planning, implementing, resuming, pausing, or completing a substantial feature, cross-module change, bug fix, or multi-phase initiative. Enforces read-only discovery, concrete pre-implementation planning, explicit user approval, dedicated worktrees, and clean branch lifecycle handoffs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Featflow — Feature Workflow
|
|
7
|
+
|
|
8
|
+
Use this skill from the active repository checkout or task worktree root. It keeps substantial engineering work predictable and resumable by pairing **discovery-first planning**, **explicit pre-implementation approval**, **canonical Markdown feature records**, and **isolated Git worktrees**.
|
|
9
|
+
|
|
10
|
+
## Core Files
|
|
11
|
+
|
|
12
|
+
`featflow` works in **three flexible modes** — from zero-footprint global usage (0 tracked repo files) to full repo-tracked team workflows:
|
|
13
|
+
|
|
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`):
|
|
16
|
+
- `active/`: feature records currently being implemented.
|
|
17
|
+
- `done/`: completed feature records.
|
|
18
|
+
- `paused/`: parked feature records ready to resume later.
|
|
19
|
+
- `programs/`: long-running program records linking multiple feature phases.
|
|
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
|
+
- `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
|
+
|
|
23
|
+
## Core Principles
|
|
24
|
+
|
|
25
|
+
1. **Discovery precedes planning.** Perform read-only research into relevant modules, entry points, contracts, and tests before creating a worktree, drafting `Plan Details`, or naming affected files.
|
|
26
|
+
2. **User approval precedes implementation.** For any write-oriented work, present a concrete plan after discovery and wait for explicit approval before creating/switching an implementation worktree, editing tracked files, running generators, applying migrations, committing, pushing, or opening PRs.
|
|
27
|
+
- If the user explicitly opts out of confirmation (e.g., "implement directly", "no confirmation needed"), record that instruction in `Pre-Implementation Approval` or `Handoff`.
|
|
28
|
+
3. **AI owns the records.** The AI drafts and maintains feature and program records from repository context and user constraints. Do not ask the user to manually fill templates.
|
|
29
|
+
4. **Complete `Plan Details` before product code.** Never edit product source files while an active feature record still has empty headings, template placeholders, or `Approval status: pending`. Run `featflow plan-check` when available.
|
|
30
|
+
5. **Re-plan on material drift.** If implementation uncovers a materially different root cause, scope, security boundary, migration need, or risk profile, pause and present an updated plan for approval before continuing.
|
|
31
|
+
6. **Isolated branches & worktrees.** Do not edit tracked files directly on protected branches (`main`, `dev`) or a long-lived developer branch unless the user explicitly approves that exception.
|
|
32
|
+
7. **Useful continuity over verbose diaries.** Record decisions, changed files, verification commands (including skipped checks and reasons), and residual risks.
|
|
33
|
+
8. **Zero secrets in records.** Never write API keys, credentials, private tokens, local-only `.env` values, or sensitive user data into `features/`.
|
|
34
|
+
9. **Absolute timestamps.** Use local 24-hour `YYYY-MM-DD-HHMM-short-kebab-title` for feature IDs and ISO 8601 timestamps with timezone offset (e.g., `2026-06-15T14:30:00Z` or local offset) in frontmatter.
|
|
35
|
+
10. **Standard statuses.** Use `planned`, `in_progress`, `review`, `blocked`, `paused`, `done`, `cancelled`.
|
|
36
|
+
|
|
37
|
+
## Branch Modes
|
|
38
|
+
|
|
39
|
+
Inspect `.featflow.json` (or run `featflow status`) to determine the repository's branch mode:
|
|
40
|
+
|
|
41
|
+
- **`trunk` mode (default)**:
|
|
42
|
+
- Base branch: `baseBranch` (typically `main`).
|
|
43
|
+
- Task branch format: `<prefix>/<short-kebab-title>` (e.g., `feat/oauth-pkce`, `fix/retry-backoff`).
|
|
44
|
+
- Finish: `featflow finish <branch>` merges into `baseBranch` (when `finishTarget: "merge"`) or pushes the task branch for a pull request (when `finishTarget: "pr"` or `--pr`, followed by `featflow pr-cleanup <pr>` after merge).
|
|
45
|
+
- **`developer-branch` mode (team workflow)**:
|
|
46
|
+
- Protected branches: `main` (release) and `dev` (team integration).
|
|
47
|
+
- Personal developer branch: stored in `git config featflow.developerBranch` (configured once via `featflow setup <name>`).
|
|
48
|
+
- Task branch format: `<prefix>/<developer>-<short-kebab-title>` (e.g., `feat/alice-oauth-pkce`). Never use `<developer>/...` because Git cannot store both `<developer>` and `<developer>/...` refs simultaneously.
|
|
49
|
+
- Finish: `featflow finish <branch>` merges into the personal developer branch, pushes it (unless `--no-push`), and removes the clean worktree and local task branch. Open `<developer> -> dev` or `dev -> main` PRs only when the user explicitly requests team integration or release promotion.
|
|
50
|
+
|
|
51
|
+
## Branch Prefix Policy
|
|
52
|
+
|
|
53
|
+
Select the prefix based on the primary user need after read-only discovery:
|
|
54
|
+
|
|
55
|
+
- User explicitly specified a branch name or prefix: use it unless it violates branch safety rules.
|
|
56
|
+
- Bug fixes, regressions, broken behavior: `fix/`
|
|
57
|
+
- New capabilities or substantial enhancements: `feat/`
|
|
58
|
+
- Documentation-only changes: `docs/`
|
|
59
|
+
- Test-only additions or hardening: `test/`
|
|
60
|
+
- Behavior-preserving restructuring: `refactor/`
|
|
61
|
+
- Maintenance, dependencies, tooling, config, workflow updates: `chore/`
|
|
62
|
+
- Performance improvements: `perf/`
|
|
63
|
+
- Security hardening or vulnerability fixes: `security/`
|
|
64
|
+
|
|
65
|
+
## Program Workflow (Multi-Phase Initiatives)
|
|
66
|
+
|
|
67
|
+
Use a program record (`features/programs/YYYY-MM-DD-short-kebab-program.md` from `features/_program_template.md`) **only** when work naturally spans multiple feature records, branches, pull requests, repositories, or releases. Do not create a program record for normal single-branch features.
|
|
68
|
+
|
|
69
|
+
- A program record is the cross-phase roadmap, phase index, decision log, risk register, and resume point.
|
|
70
|
+
- A program record alone does **not** authorize coding. Each implementation phase still requires its own feature record, typed branch/worktree, approved `Plan Details`, verification, and cleanup.
|
|
71
|
+
- Before starting or resuming a phase, read the program record and the latest linked phase feature record.
|
|
72
|
+
- Update the program's phase index and `Resume Notes` whenever a phase starts, blocks, pauses, reaches review, or completes.
|
|
73
|
+
|
|
74
|
+
## Start A Feature
|
|
75
|
+
|
|
76
|
+
1. **Check Git state**: inspect `git status --short` and current branch. Never discard or relocate unrelated uncommitted changes without asking.
|
|
77
|
+
2. **Read-only discovery**: inspect the relevant files, architecture boundaries, contracts, and closest existing tests.
|
|
78
|
+
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.
|
|
79
|
+
4. **Verify workflow setup**:
|
|
80
|
+
- In `developer-branch` mode, verify the configured developer branch (`featflow status`). If unset, stop and ask the user to run `featflow setup <your-branch>`.
|
|
81
|
+
5. **Choose feature ID & branch**:
|
|
82
|
+
- Feature ID: `YYYY-MM-DD-HHMM-short-kebab-title` (local 24-hour time).
|
|
83
|
+
- Typed branch according to Branch Modes & Branch Prefix Policy.
|
|
84
|
+
6. **Create dedicated worktree**:
|
|
85
|
+
- Check `git worktree list --porcelain` to avoid collisions.
|
|
86
|
+
- Run `featflow worktree <branch> ../<repo>-worktrees/<feature-id>` (or `git worktree add -b <branch> ...` if CLI is not installed).
|
|
87
|
+
- If the task is a tiny tracked doc/config change and using a worktree adds unnecessary friction, record the no-worktree exception in `Branch Plan`.
|
|
88
|
+
7. **Draft the canonical feature record inside the task worktree**:
|
|
89
|
+
- Prefer `featflow new <short-kebab-title>` (automatically resolves `owner` from `git config user.name`, local ISO 8601 timestamp, branch, and built-in or repo template).
|
|
90
|
+
- If the repository does not track `features/` in Git (zero-footprint / external OSS repo), use `featflow new <short-kebab-title> --local` to store the record under `.featflow/features/active/` (excluded via `.git/info/exclude` with zero `git status` noise).
|
|
91
|
+
- If the CLI is unavailable, copy `features/_template.md` into `features/active/<feature-id>.md` and resolve `owner` via `git config --get user.name` (fallback: `Unknown`).
|
|
92
|
+
- Fill every `Feature Brief` and `Plan Details` subsection concretely, including `Pre-Implementation Approval`. Use `None - <reason>` for non-applicable subsections and `Unknown - <discovery plan>` for non-blocking unknowns.
|
|
93
|
+
- Run `featflow plan-check` to confirm completeness.
|
|
94
|
+
8. **Implement inside the task worktree**.
|
|
95
|
+
|
|
96
|
+
## Execute A Feature
|
|
97
|
+
|
|
98
|
+
- Keep edits, tests, and commits inside the task worktree.
|
|
99
|
+
- Update `Implementation Plan` checkboxes, `Execution Log`, `Decisions`, and `Changed Files` at meaningful milestones.
|
|
100
|
+
- Run focused tests while iterating; run broader verification gates before completion.
|
|
101
|
+
- For bug fixes or regressions, include a durable regression test or executable guard unless clearly impractical (and document why).
|
|
102
|
+
- If interrupted or resumed in a new session, locate the worktree via `git worktree list --porcelain` and read its active feature record before making edits.
|
|
103
|
+
|
|
104
|
+
## Pause Or Block
|
|
105
|
+
|
|
106
|
+
- Use `blocked` when external input or state is required.
|
|
107
|
+
- Use `paused` when intentionally parking work: set `status: paused`, update `Handoff` with exact resume instructions, and move the record from `features/active/` to `features/paused/`.
|
|
108
|
+
- Keep the worktree intact unless the user explicitly asks to remove it. Never remove a dirty worktree without explicit consent.
|
|
109
|
+
|
|
110
|
+
## Complete A Feature
|
|
111
|
+
|
|
112
|
+
1. Run required verification checks in the task worktree.
|
|
113
|
+
2. Update `Verification` (commands run, skipped checks with reasons), `Changed Files`, and `Handoff` (residual risks and follow-ups).
|
|
114
|
+
3. Set `status: done`, refresh `updated`, and move the record from `features/active/` to `features/done/`.
|
|
115
|
+
4. If linked to a program, update the program's phase index row to `done` and refresh `Resume Notes`.
|
|
116
|
+
5. If the repository tracks `features/current-feature.md`, clear `active_feature:`, set `status: none`, and update `last_completed`.
|
|
117
|
+
6. Commit all changes (including the `done` record) on the task branch with a focused Conventional Commit message.
|
|
118
|
+
7. Run `featflow finish <branch>` (or pass `--no-push` for local-only, or `--pr` if opening a pull request):
|
|
119
|
+
- In merge workflows (`developer-branch` or `trunk` with `finishTarget: "merge"`), this merges the verified branch into the target base, pushes if configured, and cleans up the clean worktree and local task branch.
|
|
120
|
+
- In PR workflows (`--pr` or `finishTarget: "pr"`), open the pull request as requested, and after merge run `featflow pr-cleanup <pr-number>` from the main checkout to sync the base branch and clean up the worktree and branch.
|
|
121
|
+
|
|
122
|
+
## Lightweight Changes (No Feature Record Required)
|
|
123
|
+
|
|
124
|
+
Tiny one-off edits (typo fixes, narrow config tweaks, small doc updates) do not need a `features/` record unless requested. They still follow:
|
|
125
|
+
1. Read-only discovery + concise pre-implementation plan + explicit approval.
|
|
126
|
+
2. Dedicated typed-branch worktree (no direct edits on protected branches).
|
|
127
|
+
3. Focused verification, commit, and `featflow finish <branch>`.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: featflow-issues
|
|
3
|
+
description: Optional GitHub Issues closed-loop workflow built on featflow (`featflow issue`). Use whenever the user explicitly wants to file a new GitHub Issue (with standardized fix:/feat:/docs: prefixes and optional screenshot uploads), list or triage open GitHub Issues, claim an Issue with collision protection into an isolated featflow worktree, or move a verified fix to status:in-review.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitHub Issue Closed-Loop Workflow (`featflow-issues`)
|
|
7
|
+
|
|
8
|
+
Manage the full lifecycle of GitHub Issues directly inside a `featflow`-managed repository using `featflow issue` (powered by GitHub CLI `gh`) — from filing prefixed Issues with optional original screenshots to collision-safe claiming into isolated `featflow` worktrees, verifying, and moving to `status:in-review`.
|
|
9
|
+
|
|
10
|
+
## Intent Routing (Direct Fix vs. File Issue vs. Claim)
|
|
11
|
+
|
|
12
|
+
Distinguish user intent clearly — never create an unwanted GitHub Issue when the user just wants a direct fix, and never start editing code when the user only asked to file an Issue:
|
|
13
|
+
|
|
14
|
+
- **Direct fix / build (default)**: Prompts like "帮我修一下这个 bug", "fix this error", or "adjust this button" -> go straight to normal `featflow` local development (`featflow worktree` / `featflow finish`). Do **not** create a GitHub Issue unless asked.
|
|
15
|
+
- **File an Issue (no code edits)**: Prompts with explicit filing intent — e.g., **"提单 / 提个单 / 提个 bug / 提个需求 / 记个单 / 提 issue / file an issue"** (or shorthand `提单 fix:` / `提单 feat:`) -> follow **Flow A** (`featflow issue create`).
|
|
16
|
+
- **Fetch / Claim / Fix Issues**: Prompts like **"拉单 / 看单 / 认领 / 看看未认领的 / fix #12 / claim #12"** -> follow **Flow B** (`featflow issue list | view --download-images | claim | review`).
|
|
17
|
+
- **Ambiguous screenshot or symptom only** (user shares a screenshot/symptom without saying whether to fix now or file an Issue): briefly summarize what you observe, then ask one crisp question: *"要直接排查修复,还是先帮你提一个 `fix(...)` GitHub Issue?"*
|
|
18
|
+
|
|
19
|
+
## Unified Prefix, Label & Branch Taxonomy
|
|
20
|
+
|
|
21
|
+
Use the same typed prefixes across Issue titles, `featflow` worktree branches, and Conventional Commits:
|
|
22
|
+
|
|
23
|
+
| Work Type | Issue Title Format | Default Label | Claimed Branch (`trunk` / `developer-branch`) |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| Bug / defect | `fix(<scope>): <summary>` | `bug` | `fix/issue-<num>-<slug>` / `fix/<dev>-issue-<num>-<slug>` |
|
|
26
|
+
| New feature | `feat(<scope>): <summary>` | `enhancement` | `feat/issue-<num>-<slug>` / `feat/<dev>-issue-<num>-<slug>` |
|
|
27
|
+
| Documentation | `docs(<scope>): <summary>` | `documentation` | `docs/issue-<num>-<slug>` / `docs/<dev>-issue-<num>-<slug>` |
|
|
28
|
+
| Refactor / Perf / Security / Chore / Test | `refactor:` / `perf:` / `security:` / `chore:` / `test:` | Optional `--label` | `<prefix>/issue-<num>-<slug>` / `<prefix>/<dev>-issue-<num>-<slug>` |
|
|
29
|
+
|
|
30
|
+
Workflow labels (idempotently synced via `featflow issue labels:sync`):
|
|
31
|
+
- State: `status:in-progress` (active lock), `status:in-review` (fix verified & pushed, awaiting PR/acceptance), `status:blocked`
|
|
32
|
+
- Priority: `priority:p0` (critical), `priority:p1` (high), `priority:p2` (normal)
|
|
33
|
+
- Pickup: `agent-ready` (scoped for AI coding agent pickup)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Flow A: Filing a GitHub Issue (Text or Screenshots)
|
|
38
|
+
|
|
39
|
+
1. **Inspect visually & check duplicates (read-only)**:
|
|
40
|
+
- Inspect any user-provided screenshots carefully (surface, error text, visual state).
|
|
41
|
+
- Check open issues first (`featflow issue list --json`) to avoid duplicates.
|
|
42
|
+
- Optionally run narrow read-only discovery to note suspected modules/files.
|
|
43
|
+
2. **Draft & confirm before creating** (unless the user explicitly opted out):
|
|
44
|
+
- Prefixed title: `<type>(<scope>): <concise summary>`
|
|
45
|
+
- Suggested labels (`bug` / `enhancement` / `documentation`, optional `priority:p0|p1|p2`, `agent-ready`)
|
|
46
|
+
- Structured body: Observed Behavior / Context, Steps to Reproduce (for `fix`) or Goal (for `feat`), Expected Behavior / Acceptance Criteria, and Suspected Scope.
|
|
47
|
+
3. **Create the Issue**:
|
|
48
|
+
```bash
|
|
49
|
+
featflow issue create \
|
|
50
|
+
--type fix --scope auth \
|
|
51
|
+
--title "login screen stays blank after OAuth callback" \
|
|
52
|
+
--body-file /tmp/issue-body.md \
|
|
53
|
+
--priority p1 --agent-ready --json
|
|
54
|
+
```
|
|
55
|
+
- When `.featflow.json` configures `issues.assetsRepo` (or `--assets-repo <owner/repo>` is passed), pass `--attach /path/to/screenshot.png` (repeatable, <= 10 MB) to upload originals via `gh api` and embed them directly in the Issue body without bloating the code repository.
|
|
56
|
+
- Report the created Issue reference (`<repo>#<num>`) and URL.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Flow B: Fetching, Claiming, Fixing & Reviewing GitHub Issues
|
|
61
|
+
|
|
62
|
+
1. **Fetch & Triage (Read-Only)**:
|
|
63
|
+
- List open issues:
|
|
64
|
+
```bash
|
|
65
|
+
featflow issue list --unassigned --json
|
|
66
|
+
```
|
|
67
|
+
- Inspect full details and download any attached original screenshots (when `issues.assetsRepo` is configured):
|
|
68
|
+
```bash
|
|
69
|
+
featflow issue view <num> --download-images --json
|
|
70
|
+
```
|
|
71
|
+
- Inspect every returned `downloadedImages[].localPath` before diagnosing UI or visual bugs.
|
|
72
|
+
- Complete read-only root-cause discovery and check repository-specific rules in `AGENTS.md` and local specialist skills.
|
|
73
|
+
|
|
74
|
+
2. **Present Triage & Implementation Plan (Universal Pre-Implementation Gate)**:
|
|
75
|
+
- Summarize target Issue(s), priority, root cause / implementation approach, affected files, whether a `features/active/` record is needed (substantial features -> yes; small isolated fixes -> Lightweight Change Workflow), and verification commands.
|
|
76
|
+
- Wait for explicit user approval before claiming issues, editing files, creating worktrees, or mutating GitHub state (unless explicitly waived).
|
|
77
|
+
|
|
78
|
+
3. **Atomic Claim + Isolated Worktree Creation**:
|
|
79
|
+
```bash
|
|
80
|
+
featflow issue claim <num> --json
|
|
81
|
+
```
|
|
82
|
+
- Preflights local worktree creation **before** mutating GitHub state so failed local setup never leaves a half-claimed Issue.
|
|
83
|
+
- Checks for closed status, concurrent assignees, or `status:in-progress` collision lock; assigns `@me`, adds `status:in-progress`, posts a claim comment, and creates the matching typed `featflow` worktree (automatically adapting to `trunk` or `developer-branch` mode).
|
|
84
|
+
|
|
85
|
+
4. **Implement, Verify & Finish Inside the Worktree**:
|
|
86
|
+
- Work strictly inside the created task worktree — never directly on protected branches (`main`, `dev`) or personal developer branches.
|
|
87
|
+
- Honor all repository-specific quality gates, security invariants, regression guards, and tests declared in `AGENTS.md`.
|
|
88
|
+
- Commit with a Conventional Commit message referencing the Issue without prematurely auto-closing on personal/feature branches:
|
|
89
|
+
- `fix(auth): handle empty OAuth callback state (Refs #12)`
|
|
90
|
+
- Finish cleanly via `featflow finish <branch>`.
|
|
91
|
+
|
|
92
|
+
5. **Move to `status:in-review` (Do Not Prematurely Close)**:
|
|
93
|
+
```bash
|
|
94
|
+
featflow issue review <num> \
|
|
95
|
+
--commit <short-sha> \
|
|
96
|
+
--summary "Concise summary of fix and root cause" \
|
|
97
|
+
--checks "Verification commands and pass counts" \
|
|
98
|
+
--json
|
|
99
|
+
```
|
|
100
|
+
- Leave the Issue open; close it automatically when the integration PR merges (include `Closes #<num>` in the PR body) or after manual acceptance, then clean up merged PR branches with `featflow pr-cleanup <pr>`.
|
|
101
|
+
- If blocked, release instead of moving to review:
|
|
102
|
+
```bash
|
|
103
|
+
featflow issue release <num> --blocked --reason "Why work is blocked"
|
|
104
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: featflow-regression
|
|
3
|
+
description: Optional Regression Guardian workflow built on featflow (`featflow regression`). Use whenever fixing a bug, regression, failing test, or GitHub Issue bug in a repository with a regression memory ledger so fixes become durable executable guards and future edits check impacted invariants before changing files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Regression Guardian Workflow (`featflow-regression`)
|
|
7
|
+
|
|
8
|
+
Turn hard-won bug fixes into durable, discoverable executable guards backed by a repository regression ledger (configured via `regression.ledgerFile` in `.featflow.json`, e.g., `context/regression-ledger.yml`).
|
|
9
|
+
|
|
10
|
+
## Principles
|
|
11
|
+
|
|
12
|
+
- **Prefer executable guards over memory**: if a bug matters enough to fix, convert it into the smallest reliable runnable check (unit test, integration test, E2E spec, fixture, or static rule).
|
|
13
|
+
- **Store the invariant, not only the test command**: future agents need to understand *what must stay true* before modifying related files.
|
|
14
|
+
- **Honor the Universal Pre-Implementation Gate**: inspect impacted ledger entries read-only, present root cause + repair plan + regression guard + verification commands, and wait for explicit user approval before editing files.
|
|
15
|
+
|
|
16
|
+
## Operating Loop
|
|
17
|
+
|
|
18
|
+
### 1. Check Impacted Regressions During Discovery
|
|
19
|
+
|
|
20
|
+
Before editing files (or after drafting a candidate file list), run:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
featflow regression impact --files path/to/file1 path/to/file2 --json
|
|
24
|
+
# Or check all files already changed on the current task branch:
|
|
25
|
+
featflow regression impact --json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Read the `invariant`, `guards`, and `ownerNotes` for every impacted entry so your change does not reintroduce a previously solved bug.
|
|
29
|
+
|
|
30
|
+
### 2. Record New or Updated Bug Fixes in the Ledger
|
|
31
|
+
|
|
32
|
+
When fixing a bug or regression, add or update an entry in `regression.ledgerFile`:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
- id: short-stable-slug
|
|
36
|
+
title: Concise statement of the invariant
|
|
37
|
+
status: guarded
|
|
38
|
+
surfaces: [core]
|
|
39
|
+
symptom: Observed failure mode.
|
|
40
|
+
root_cause: Why it occurred.
|
|
41
|
+
invariant: What must remain true across future edits.
|
|
42
|
+
files:
|
|
43
|
+
- src/path/to/affected-file.ts
|
|
44
|
+
guards:
|
|
45
|
+
- tests/path/to/regression.test.ts
|
|
46
|
+
commands:
|
|
47
|
+
- npm test -- tests/path/to/regression.test.ts
|
|
48
|
+
owner_notes: Brief context for future maintainers.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Allowed `status` values:
|
|
52
|
+
- `guarded`: executable guard exists and passes
|
|
53
|
+
- `needs_guard`: known risk without an automated guard yet (justify why)
|
|
54
|
+
- `retired`: code path removed or invariant superseded
|
|
55
|
+
|
|
56
|
+
### 3. Validate Ledger & Run Impacted Guards Before Finish
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
featflow regression validate
|
|
60
|
+
featflow regression check # shorthand for: featflow regression impact --run
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Include impacted regression IDs and executed guard commands in your feature record `Verification` section or final handoff.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import { packageRoot } from "./config.mjs";
|
|
5
|
+
import { samePath } from "./git.mjs";
|
|
6
|
+
|
|
7
|
+
export const AGENT_BLOCK_START = "<!-- FEATFLOW_START -->";
|
|
8
|
+
export const AGENT_BLOCK_END = "<!-- FEATFLOW_END -->";
|
|
9
|
+
export const DEFAULT_AGENT_DOC_CANDIDATES = ["AGENTS.md", "CLAUDE.md"];
|
|
10
|
+
|
|
11
|
+
function normalizeLineEndings(content) {
|
|
12
|
+
return content.replace(/\r\n/g, "\n");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function toPosixRel(repoRoot, filePath) {
|
|
16
|
+
return path.relative(repoRoot, filePath).replaceAll("\\", "/");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function renderAgentWorkflowBlock() {
|
|
20
|
+
const snippetPath = path.join(packageRoot, "templates", "snippets", "AGENTS-workflow.md");
|
|
21
|
+
const snippet = normalizeLineEndings(readFileSync(snippetPath, "utf8")).trim();
|
|
22
|
+
return `${AGENT_BLOCK_START}\n${snippet}\n${AGENT_BLOCK_END}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function resolveAgentDocTargets(repoRoot, explicitTargets = null) {
|
|
26
|
+
if (Array.isArray(explicitTargets) && explicitTargets.length > 0) {
|
|
27
|
+
const resolved = [];
|
|
28
|
+
for (const raw of explicitTargets) {
|
|
29
|
+
const trimmed = String(raw).trim();
|
|
30
|
+
if (!trimmed) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const abs = path.resolve(repoRoot, trimmed);
|
|
34
|
+
if (!resolved.some((existing) => samePath(existing, abs))) {
|
|
35
|
+
resolved.push(abs);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return resolved.map((abs) => toPosixRel(repoRoot, abs));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const agentsPath = path.join(repoRoot, "AGENTS.md");
|
|
42
|
+
const claudePath = path.join(repoRoot, "CLAUDE.md");
|
|
43
|
+
const hasAgents = existsSync(agentsPath);
|
|
44
|
+
const hasClaude = existsSync(claudePath);
|
|
45
|
+
|
|
46
|
+
if (!hasClaude) {
|
|
47
|
+
return ["AGENTS.md"];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (hasAgents && samePath(agentsPath, claudePath)) {
|
|
51
|
+
return ["AGENTS.md"];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const claudeContent = readFileSync(claudePath, "utf8");
|
|
55
|
+
if (/^\s*@AGENTS\.md\b/m.test(claudeContent)) {
|
|
56
|
+
return ["AGENTS.md"];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return ["AGENTS.md", "CLAUDE.md"];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function findManagedAgentDocs(repoRoot) {
|
|
63
|
+
const found = [];
|
|
64
|
+
for (const rel of DEFAULT_AGENT_DOC_CANDIDATES) {
|
|
65
|
+
const abs = path.join(repoRoot, rel);
|
|
66
|
+
if (!existsSync(abs)) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (found.some((existing) => samePath(existing, abs))) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const content = readFileSync(abs, "utf8");
|
|
73
|
+
if (content.includes(AGENT_BLOCK_START)) {
|
|
74
|
+
found.push(abs);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return found.map((abs) => toPosixRel(repoRoot, abs));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function inspectAgentDocBlock(filePath, renderedBlock = renderAgentWorkflowBlock()) {
|
|
81
|
+
if (!existsSync(filePath)) {
|
|
82
|
+
return { status: "missing-file" };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const existing = normalizeLineEndings(readFileSync(filePath, "utf8"));
|
|
86
|
+
const startIdx = existing.indexOf(AGENT_BLOCK_START);
|
|
87
|
+
const endIdx = existing.indexOf(AGENT_BLOCK_END);
|
|
88
|
+
|
|
89
|
+
if (startIdx === -1 && endIdx === -1) {
|
|
90
|
+
return { status: "missing-block" };
|
|
91
|
+
}
|
|
92
|
+
if (startIdx === -1 || endIdx === -1 || endIdx < startIdx) {
|
|
93
|
+
return { status: "drifted", reason: "malformed featflow markers" };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const actual = existing.slice(startIdx, endIdx + AGENT_BLOCK_END.length);
|
|
97
|
+
if (actual === normalizeLineEndings(renderedBlock)) {
|
|
98
|
+
return { status: "up-to-date" };
|
|
99
|
+
}
|
|
100
|
+
return { status: "drifted" };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function upsertAgentDocBlock(filePath, renderedBlock = renderAgentWorkflowBlock(), options = {}) {
|
|
104
|
+
const dryRun = Boolean(options.dryRun);
|
|
105
|
+
const normalizedBlock = normalizeLineEndings(renderedBlock);
|
|
106
|
+
|
|
107
|
+
if (!existsSync(filePath)) {
|
|
108
|
+
if (!dryRun) {
|
|
109
|
+
mkdirSync(path.dirname(filePath), { recursive: true });
|
|
110
|
+
writeFileSync(filePath, `${normalizedBlock}\n`, "utf8");
|
|
111
|
+
}
|
|
112
|
+
return { action: "created", filePath };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const rawExisting = readFileSync(filePath, "utf8");
|
|
116
|
+
const existing = normalizeLineEndings(rawExisting);
|
|
117
|
+
const startIdx = existing.indexOf(AGENT_BLOCK_START);
|
|
118
|
+
const endIdx = existing.indexOf(AGENT_BLOCK_END);
|
|
119
|
+
|
|
120
|
+
if ((startIdx !== -1 && endIdx === -1) || (startIdx === -1 && endIdx !== -1) || (startIdx !== -1 && endIdx < startIdx)) {
|
|
121
|
+
throw new Error(
|
|
122
|
+
`Malformed featflow markers in ${filePath}. Ensure both ${AGENT_BLOCK_START} and ${AGENT_BLOCK_END} exist in order.`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let next;
|
|
127
|
+
if (startIdx !== -1 && endIdx !== -1) {
|
|
128
|
+
const before = existing.slice(0, startIdx);
|
|
129
|
+
const after = existing.slice(endIdx + AGENT_BLOCK_END.length);
|
|
130
|
+
next = `${before}${normalizedBlock}${after}`;
|
|
131
|
+
if (next === existing) {
|
|
132
|
+
return { action: "unchanged", filePath };
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
const trimmed = existing.replace(/\s+$/, "");
|
|
136
|
+
next = trimmed.length > 0 ? `${trimmed}\n\n${normalizedBlock}\n` : `${normalizedBlock}\n`;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (!dryRun) {
|
|
140
|
+
writeFileSync(filePath, next, "utf8");
|
|
141
|
+
}
|
|
142
|
+
return { action: "updated", filePath };
|
|
143
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
import { gitConfigGet, runStatus } from "./git.mjs";
|
|
6
|
+
|
|
7
|
+
export function normalizeRelPath(filePath) {
|
|
8
|
+
return String(filePath ?? "")
|
|
9
|
+
.replaceAll("\\", "/")
|
|
10
|
+
.replace(/^\.\//, "")
|
|
11
|
+
.trim();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function uniqueNormalizedPaths(paths) {
|
|
15
|
+
return [...new Set((paths ?? []).map(normalizeRelPath).filter(Boolean))].sort();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function existingFiles(repoRoot, paths) {
|
|
19
|
+
return uniqueNormalizedPaths(paths).filter((rel) => existsSync(path.resolve(repoRoot, rel)));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function globToRegExp(pattern) {
|
|
23
|
+
const normalized = normalizeRelPath(pattern);
|
|
24
|
+
if (!normalized) {
|
|
25
|
+
return /^$/;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let regexStr = "^";
|
|
29
|
+
for (let i = 0; i < normalized.length; i += 1) {
|
|
30
|
+
const ch = normalized[i];
|
|
31
|
+
if (ch === "*") {
|
|
32
|
+
if (normalized[i + 1] === "*") {
|
|
33
|
+
if (normalized[i + 2] === "/") {
|
|
34
|
+
regexStr += "(?:.*/)?";
|
|
35
|
+
i += 2;
|
|
36
|
+
} else {
|
|
37
|
+
regexStr += ".*";
|
|
38
|
+
i += 1;
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
regexStr += "[^/]*";
|
|
42
|
+
}
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (ch === "?") {
|
|
46
|
+
regexStr += "[^/]";
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
regexStr += ch.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
50
|
+
}
|
|
51
|
+
regexStr += "$";
|
|
52
|
+
return new RegExp(regexStr);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function matchesPattern(relPath, pattern) {
|
|
56
|
+
const normPath = normalizeRelPath(relPath);
|
|
57
|
+
const normPattern = normalizeRelPath(pattern);
|
|
58
|
+
if (!normPattern) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
if (!/[*?]/.test(normPattern)) {
|
|
62
|
+
if (normPattern.endsWith("/")) {
|
|
63
|
+
return normPath.startsWith(normPattern);
|
|
64
|
+
}
|
|
65
|
+
return normPath === normPattern || normPath.startsWith(`${normPattern}/`);
|
|
66
|
+
}
|
|
67
|
+
return globToRegExp(normPattern).test(normPath);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function matchesAnyPattern(relPath, patterns) {
|
|
71
|
+
return (patterns ?? []).some((pattern) => matchesPattern(relPath, pattern));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function gitRefExists(repoRoot, ref) {
|
|
75
|
+
return runStatus("git", ["rev-parse", "--verify", "--quiet", `${ref}^{commit}`], repoRoot) === 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function gitCurrentBranch(repoRoot) {
|
|
79
|
+
const res = spawnSync("git", ["symbolic-ref", "--quiet", "--short", "HEAD"], {
|
|
80
|
+
cwd: repoRoot,
|
|
81
|
+
encoding: "utf8",
|
|
82
|
+
});
|
|
83
|
+
return res.status === 0 ? (res.stdout ?? "").trim() : "";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function gitDiffNameOnly(repoRoot, args) {
|
|
87
|
+
const res = spawnSync("git", ["diff", "--name-only", "-z", ...args], {
|
|
88
|
+
cwd: repoRoot,
|
|
89
|
+
encoding: "utf8",
|
|
90
|
+
});
|
|
91
|
+
if (res.status !== 0) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
return (res.stdout ?? "").split("\0").filter(Boolean);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function gitStatusFiles(repoRoot) {
|
|
98
|
+
const res = spawnSync("git", ["status", "--porcelain=v1", "-z", "--untracked-files=all"], {
|
|
99
|
+
cwd: repoRoot,
|
|
100
|
+
encoding: "utf8",
|
|
101
|
+
});
|
|
102
|
+
if (res.status !== 0) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
const entries = (res.stdout ?? "").split("\0").filter(Boolean);
|
|
106
|
+
const files = [];
|
|
107
|
+
for (let index = 0; index < entries.length; index += 1) {
|
|
108
|
+
const entry = entries[index];
|
|
109
|
+
const status = entry.slice(0, 2);
|
|
110
|
+
files.push(entry.slice(3));
|
|
111
|
+
if (status.includes("R") || status.includes("C")) {
|
|
112
|
+
index += 1;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return files;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function resolveChangedBase(repoRoot, config = null, options = {}) {
|
|
119
|
+
if (options.base !== undefined && options.base !== "") {
|
|
120
|
+
return { base: options.base, source: "--base" };
|
|
121
|
+
}
|
|
122
|
+
if (process.env.FEATFLOW_CHANGED_BASE) {
|
|
123
|
+
return { base: process.env.FEATFLOW_CHANGED_BASE, source: "FEATFLOW_CHANGED_BASE" };
|
|
124
|
+
}
|
|
125
|
+
if (process.env.CHANGED_CHECKS_BASE) {
|
|
126
|
+
return { base: process.env.CHANGED_CHECKS_BASE, source: "CHANGED_CHECKS_BASE" };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const current = gitCurrentBranch(repoRoot);
|
|
130
|
+
const remote = config?.remote || "origin";
|
|
131
|
+
|
|
132
|
+
if (config?.mode === "developer-branch") {
|
|
133
|
+
const devKey = config.developerBranchConfigKey || "featflow.developerBranch";
|
|
134
|
+
const devBranch = gitConfigGet(devKey, repoRoot);
|
|
135
|
+
if (devBranch) {
|
|
136
|
+
if (current === devBranch) {
|
|
137
|
+
return { base: "HEAD", source: `developer branch ${devBranch} working tree` };
|
|
138
|
+
}
|
|
139
|
+
if (gitRefExists(repoRoot, devBranch)) {
|
|
140
|
+
return { base: devBranch, source: `configured developer branch ${devBranch}` };
|
|
141
|
+
}
|
|
142
|
+
if (gitRefExists(repoRoot, `${remote}/${devBranch}`)) {
|
|
143
|
+
return { base: `${remote}/${devBranch}`, source: `remote developer branch ${remote}/${devBranch}` };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const baseBranch = config?.baseBranch || "main";
|
|
149
|
+
if (current === baseBranch) {
|
|
150
|
+
return { base: "HEAD", source: `base branch ${baseBranch} working tree` };
|
|
151
|
+
}
|
|
152
|
+
if (gitRefExists(repoRoot, baseBranch)) {
|
|
153
|
+
return { base: baseBranch, source: `base branch ${baseBranch}` };
|
|
154
|
+
}
|
|
155
|
+
if (gitRefExists(repoRoot, `${remote}/${baseBranch}`)) {
|
|
156
|
+
return { base: `${remote}/${baseBranch}`, source: `remote base branch ${remote}/${baseBranch}` };
|
|
157
|
+
}
|
|
158
|
+
return { base: "HEAD", source: "fallback HEAD working tree" };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function changedFileSelection(repoRoot, config = null, options = {}) {
|
|
162
|
+
if (options.files?.length > 0) {
|
|
163
|
+
return {
|
|
164
|
+
base: null,
|
|
165
|
+
head: null,
|
|
166
|
+
source: "explicit files",
|
|
167
|
+
files: uniqueNormalizedPaths(options.files),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (process.env.FEATFLOW_TEST_CHANGED_FILES) {
|
|
172
|
+
const testFiles = process.env.FEATFLOW_TEST_CHANGED_FILES.split(/\r?\n|,/)
|
|
173
|
+
.map((entry) => entry.trim())
|
|
174
|
+
.filter(Boolean);
|
|
175
|
+
return {
|
|
176
|
+
base: null,
|
|
177
|
+
head: null,
|
|
178
|
+
source: "FEATFLOW_TEST_CHANGED_FILES",
|
|
179
|
+
files: uniqueNormalizedPaths(testFiles),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const files = [];
|
|
184
|
+
const { base, source } = resolveChangedBase(repoRoot, config, options);
|
|
185
|
+
const head = options.head || process.env.FEATFLOW_CHANGED_HEAD || process.env.CHANGED_CHECKS_HEAD || "HEAD";
|
|
186
|
+
|
|
187
|
+
if (base && base !== "HEAD" && gitRefExists(repoRoot, base) && gitRefExists(repoRoot, head)) {
|
|
188
|
+
files.push(...gitDiffNameOnly(repoRoot, [`${base}...${head}`]));
|
|
189
|
+
}
|
|
190
|
+
files.push(...gitDiffNameOnly(repoRoot, ["--cached"]));
|
|
191
|
+
files.push(...gitDiffNameOnly(repoRoot, []));
|
|
192
|
+
files.push(...gitStatusFiles(repoRoot));
|
|
193
|
+
|
|
194
|
+
return {
|
|
195
|
+
base,
|
|
196
|
+
head,
|
|
197
|
+
source,
|
|
198
|
+
files: uniqueNormalizedPaths(files),
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export function changedFiles(repoRoot, config = null, options = {}) {
|
|
203
|
+
return changedFileSelection(repoRoot, config, options).files;
|
|
204
|
+
}
|