@codebehind/agent-workflow 1.1.14 → 1.1.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebehind/agent-workflow",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "description": "Scaffold the agent-workflow spec-driven delivery framework into any repo",
5
5
  "type": "module",
6
6
  "bin": {
@@ -94,8 +94,8 @@ When writing final documentation, choose update/create in this order:
94
94
  To reduce onboarding cost, use a reusable codebase snapshot file:
95
95
 
96
96
  - Path: `.agent-workflow/codebase.md`
97
- - If the file is missing, the first onboarded agent scans the codebase and creates it.
98
- - If the file exists, agents read it instead of rescanning the codebase.
97
+ - **If the file is missing, create it immediately before doing any other work.** Scan the codebase and write the snapshot. Do not ask, do not wait.
98
+ - If the file exists, read it instead of rescanning the codebase.
99
99
  - Rescan and refresh this file only when the user explicitly asks.
100
100
 
101
101
  Expected snapshot structure (keep concise and high-level):
@@ -6,7 +6,7 @@ Follow these rules in every session.
6
6
  ## Read order at session start
7
7
  1. Read `AGENTS.md` — determines repo mode (single-repo vs meta-repo) and project context
8
8
  2. Read `.agent-workflow/README.md`
9
- 3. Read `.agent-workflow/codebase.md` if it exists
9
+ 3. Read `.agent-workflow/codebase.md` — **if it does not exist, create it immediately by scanning the codebase before continuing**
10
10
  4. Read the target spec and any linked feature doc before planning or implementation
11
11
  5. Read relevant existing code (in the appropriate directory) before proposing structural changes
12
12
 
@@ -40,7 +40,7 @@ When asked to prepare a spec:
40
40
  - Default `acceptance_proof: true` unless user explicitly says otherwise
41
41
  - Collect supporting assets into `.agent-workflow/specs/assets/<spec-slug>/`
42
42
  - Prefer assets over embedding large JSON, CSV, or screenshots inline
43
- - When spec is ready, commit the changes, push the current branch `agent/spec/<slug>`, and open or update a GitLab MR (always, unless the user explicitly says to skip GitLab flow)
43
+ - When spec is ready, commit the changes. If running non-interactively, also push the branch and open or update a GitLab MR automatically. If running interactively, stop after the commit and ask the user whether to push and open/update the MR before proceeding.
44
44
 
45
45
  ### B. Plan implementation
46
46
  When asked to implement a spec:
@@ -71,9 +71,16 @@ Use filenames that reveal purpose, for example:
71
71
  ## GitLab handoff behavior
72
72
  1. Stage only the relevant spec, asset, and doc changes.
73
73
  2. Create a focused commit.
74
- 3. Push the current branch with `scripts/agent/git-push-branch.sh`.
75
- 4. Generate MR body content using `scripts/agent/mr-template.sh spec <spec-path> - - -`.
76
- 5. Open or update the MR using the scripts in `scripts/agent/`.
74
+ 3. Decide whether to proceed with push and MR:
75
+ - **Non-interactive session** (invoked with `-p`, no user to prompt) proceed to steps 4–6 automatically.
76
+ - **Prompt includes `with push`** (e.g. "use prepare-spec skill with push …") proceed to steps 4–6 automatically.
77
+ - **Prompt explicitly instructs full handoff** (e.g. "Full GitLab handoff — push the branch and open or update the MR without asking.") → proceed to steps 4–6 automatically.
78
+ - **All other interactive sessions** → stop here, report the commit, and ask:
79
+ > "Spec committed on `<branch>`. Should I push the branch and open/update the MR? (yes / no)"
80
+ Proceed to steps 4–6 only if the user confirms.
81
+ 4. Push the current branch with `scripts/agent/git-push-branch.sh`.
82
+ 5. Generate MR body content using `scripts/agent/mr-template.sh spec <spec-path> - - -`.
83
+ 6. Open or update the MR using the scripts in `scripts/agent/`.
77
84
 
78
85
  ## Final handoff
79
86
  Return:
@@ -11,7 +11,7 @@ See `agents-workflow-dev-process.md` for both the **scripted workflow** (bash sc
11
11
  ## Quick Start
12
12
 
13
13
  1. Read `.agent-workflow/README.md` (workflow process — **Phase A** spec authorship vs **Phase B** delivery).
14
- 2. Read `.agent-workflow/codebase.md` (codebase snapshot — do NOT rescan unless explicitly asked).
14
+ 2. Read `.agent-workflow/codebase.md` (codebase snapshot). **If it does not exist, create it immediately by scanning the codebase — do not skip this step.** Do NOT rescan if it already exists unless explicitly asked.
15
15
  3. Determine the task:
16
16
  - **Prepare a spec** (user pasted Notion URL, asked for chat-assisted drafting, or asked to convert Notion → spec): follow **Phase A**; write `.agent-workflow/specs/*.md` with `status: draft` unless the user says otherwise; use `.agent-workflow/notion-spec-mapping.md` for Notion.
17
17
  - **Implement a feature**: only specs with **`status: open`**; check `.agent-workflow/specs/` for those.
@@ -2,19 +2,21 @@
2
2
  set -euo pipefail
3
3
 
4
4
  INTERACTIVE=false
5
+ PUSH=false
5
6
 
6
7
  # Parse flags
7
8
  POSITIONAL=()
8
9
  for arg in "$@"; do
9
10
  case "$arg" in
10
11
  --interactive) INTERACTIVE=true ;;
12
+ --push) PUSH=true ;;
11
13
  *) POSITIONAL+=("$arg") ;;
12
14
  esac
13
15
  done
14
16
  set -- "${POSITIONAL[@]}"
15
17
 
16
18
  if [[ $# -lt 2 ]]; then
17
- echo "Usage: $0 [--interactive] <slug> <notion-url|gdrive-url|local-file>" >&2
19
+ echo "Usage: $0 [--interactive] [--push] <slug> <notion-url|gdrive-url|local-file>" >&2
18
20
  exit 1
19
21
  fi
20
22
 
@@ -39,8 +41,13 @@ echo "Worktree: ${WORKTREE_DIR}" >&2
39
41
  cd "${WORKTREE_DIR}"
40
42
 
41
43
  if [[ "$INTERACTIVE" == true ]]; then
42
- echo "Starting interactive Claude session (GitLab flow disabled)..." >&2
43
- exec claude --dangerously-skip-permissions "${SOURCE_PROMPT}. Skip GitLab flow do not push or open an MR."
44
+ if [[ "$PUSH" == true ]]; then
45
+ echo "Starting interactive Claude session (full GitLab handoff enabled)..." >&2
46
+ exec claude --dangerously-skip-permissions "${SOURCE_PROMPT}. Full GitLab handoff — push the branch and open or update the MR without asking."
47
+ else
48
+ echo "Starting interactive Claude session..." >&2
49
+ exec claude --dangerously-skip-permissions "${SOURCE_PROMPT}"
50
+ fi
44
51
  else
45
52
  exec claude --dangerously-skip-permissions -p "${SOURCE_PROMPT}"
46
53
  fi