@codebehind/agent-workflow 1.1.8 → 1.1.10

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.8",
3
+ "version": "1.1.10",
4
4
  "description": "Scaffold the agent-workflow spec-driven delivery framework into any repo",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: prepare-spec
3
- description: Turn a Notion task or free-form request into a repository spec file, gather supporting assets, commit the result on a spec branch, and open or update a GitLab MR.
3
+ description: Turn a Notion page, Google Drive doc, local file, or free-form request into a repository spec file, gather supporting assets, commit the result on a spec branch, and open or update a GitLab MR.
4
4
  ---
5
5
 
6
6
  Use this skill when the user wants a new spec created or an existing draft refined.
@@ -9,11 +9,19 @@ Use this skill when the user wants a new spec created or an existing draft refin
9
9
  Produce a clean implementation-ready spec in `.agent-workflow/specs/`, gather relevant supporting files in `.agent-workflow/specs/assets/<spec-slug>/`, and hand the result off through GitLab when the current session is running in the local GitLab workflow.
10
10
 
11
11
  ## Inputs
12
- Possible inputs:
13
- - pasted Notion task content
14
- - Notion page or subpage content available through connectors
12
+
13
+ The source type is identified from the prompt. Fetch content accordingly:
14
+
15
+ | Source | Identified by | How to fetch |
16
+ |--------|--------------|--------------|
17
+ | **Notion page** | Prompt says "from Notion page: `<url>`" | Use Notion MCP (`API-retrieve-a-page` or equivalent) |
18
+ | **Google Drive doc** | Prompt says "from Google Drive document: `<url>`" | Use Google Drive MCP if available; otherwise use WebFetch to retrieve the document content |
19
+ | **Local file** | Prompt says "from local file: `<path>`" | Use the Read tool to read the file directly |
20
+ | **Free-form / pasted** | No prefix — content is provided inline | Use the content as-is |
21
+
22
+ Additional input types that may accompany any of the above:
15
23
  - screenshots or JSON examples
16
- - short free-form feature request
24
+ - short free-form feature description
17
25
 
18
26
  ## Required behavior
19
27
  1. Read `.agent-workflow/specs/_template.md` if present.
@@ -59,30 +59,40 @@ Use `_template.md` when creating specs by hand.
59
59
 
60
60
  ## Phase A — Prepare spec
61
61
 
62
- ### Option 1: Scripted (worktrees) — from a Notion page
62
+ ### Option 1: Scripted (worktrees)
63
63
 
64
64
  From the repo root, run:
65
65
 
66
66
  ```bash
67
- scripts/agent/prepare-spec.sh <slug> <notion-link>
67
+ scripts/agent/prepare-spec.sh <slug> <source>
68
68
  ```
69
69
 
70
+ The `<source>` can be:
71
+
72
+ | Source | Example |
73
+ |--------|---------|
74
+ | Notion page URL | `https://www.notion.so/org/Page-Title-abc123` |
75
+ | Google Drive doc URL | `https://docs.google.com/document/d/...` |
76
+ | Local file path | `.agent-workflow/briefs/my-feature.md` |
77
+
78
+ The script auto-detects the source type — no extra flags needed.
79
+
70
80
  This script:
71
81
  - creates a worktree at `~/agent-runs/{PROJECT_NAME}/worktrees/spec-<slug>` on branch `agent/spec/<slug>`
72
82
  - starts a Claude session inside that worktree
73
- - invokes `/prepare-spec` with the given Notion link
83
+ - invokes `/prepare-spec` with the detected source
74
84
 
75
- The agent fetches the Notion page, maps content to the spec template, asks clarifying questions, then writes `.agent-workflow/specs/<date>_<slug>.md` with `status: draft`.
85
+ The agent fetches the source, maps content to the spec template, asks clarifying questions, then writes `.agent-workflow/specs/<date>_<slug>.md` with `status: draft`.
76
86
 
77
87
  Add `--interactive` to follow along in the same session and skip the automatic GitLab MR:
78
88
 
79
89
  ```bash
80
- scripts/agent/prepare-spec.sh --interactive \<slug\> \<notion-link\>
90
+ scripts/agent/prepare-spec.sh --interactive <slug> <source>
81
91
  ```
82
92
 
83
93
  Claude launches interactively with the first message pre-filled. The worktree and branch are still created — but nothing is pushed or opened in GitLab unless you do it manually.
84
94
 
85
- ### Option 2: Direct (no worktrees) — from a Notion page or description
95
+ ### Option 2: Direct (no worktrees)
86
96
 
87
97
  Skip the script and run everything yourself:
88
98
 
@@ -93,10 +103,13 @@ git checkout -b agent/spec/<slug>
93
103
  # 2. Open Claude in the repo root
94
104
  claude
95
105
 
96
- # 3. Inside Claude, invoke the skill
97
- /prepare-spec <notion-link>
98
- # or for a free-form description:
99
- # "Use prepare-spec skill, here is the feature: ..."
106
+ # 3. Inside Claude, invoke the skill — <source> can be a Notion URL, GDrive URL, or local file path
107
+ /prepare-spec <source>
108
+ # examples:
109
+ # /prepare-spec https://www.notion.so/org/Page-abc123
110
+ # /prepare-spec https://docs.google.com/document/d/...
111
+ # /prepare-spec .agent-workflow/briefs/my-feature.md
112
+ # or free-form: "Use prepare-spec skill, here is the feature: ..."
100
113
  ```
101
114
 
102
115
  The agent will write the spec, commit it, and open a GitLab MR on the current branch — no worktree needed.
@@ -79,10 +79,11 @@ Claude Code will read `CLAUDE.md` and `.claude/rules/agentic-workflow.md` automa
79
79
 
80
80
  **Scripted (auto worktree + branch):**
81
81
  ```bash
82
- scripts/agent/prepare-spec.sh <spec-name> <notion-link>
82
+ # <source> = Notion URL, Google Drive URL, or local file path (auto-detected)
83
+ scripts/agent/prepare-spec.sh <spec-name> <source>
83
84
 
84
85
  # Add --interactive to follow along and skip automatic GitLab MR:
85
- scripts/agent/prepare-spec.sh --interactive <spec-name> <notion-link>
86
+ scripts/agent/prepare-spec.sh --interactive <spec-name> <source>
86
87
  ```
87
88
 
88
89
  **Direct (manual branch, no worktree):**
@@ -31,7 +31,7 @@ cd "${WORKTREE_DIR}"
31
31
 
32
32
  if [[ "$INTERACTIVE" == true ]]; then
33
33
  echo "Starting interactive Claude session (GitLab flow disabled)..." >&2
34
- exec claude --dangerously-skip-permissions --message "use implement-spec skill from ${SPEC_NAME}. Skip GitLab flow — do not push or open an MR."
34
+ exec claude --dangerously-skip-permissions "use implement-spec skill from ${SPEC_NAME}. Skip GitLab flow — do not push or open an MR."
35
35
  else
36
36
  exec claude --dangerously-skip-permissions -p "use implement-spec skill from ${SPEC_NAME}"
37
37
  fi
@@ -14,14 +14,23 @@ done
14
14
  set -- "${POSITIONAL[@]}"
15
15
 
16
16
  if [[ $# -lt 2 ]]; then
17
- echo "Usage: $0 [--interactive] <slug> <notion_url>" >&2
17
+ echo "Usage: $0 [--interactive] <slug> <notion-url|gdrive-url|local-file>" >&2
18
18
  exit 1
19
19
  fi
20
20
 
21
21
  SLUG="$1"
22
- NOTION_URL="$2"
22
+ SOURCE="$2"
23
23
  REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
24
24
 
25
+ # Detect source type and build prompt
26
+ if [[ "$SOURCE" == *"notion.so"* ]]; then
27
+ SOURCE_PROMPT="use prepare-spec skill from Notion page: ${SOURCE}"
28
+ elif [[ "$SOURCE" == *"docs.google.com"* || "$SOURCE" == *"drive.google.com"* ]]; then
29
+ SOURCE_PROMPT="use prepare-spec skill from Google Drive document: ${SOURCE}"
30
+ else
31
+ SOURCE_PROMPT="use prepare-spec skill from local file: ${SOURCE}"
32
+ fi
33
+
25
34
  echo "Preparing spec worktree for '${SLUG}'..." >&2
26
35
  OUTPUT=$(bash "${REPO_ROOT}/scripts/agent/git-prepare-worktree.sh" spec "${SLUG}" "${REPO_ROOT}")
27
36
  WORKTREE_DIR=$(echo "${OUTPUT}" | grep '^WORKTREE_DIR=' | cut -d= -f2-)
@@ -31,7 +40,7 @@ cd "${WORKTREE_DIR}"
31
40
 
32
41
  if [[ "$INTERACTIVE" == true ]]; then
33
42
  echo "Starting interactive Claude session (GitLab flow disabled)..." >&2
34
- exec claude --dangerously-skip-permissions --message "use prepare-spec skill from ${NOTION_URL}. Skip GitLab flow — do not push or open an MR."
43
+ exec claude --dangerously-skip-permissions "${SOURCE_PROMPT}. Skip GitLab flow — do not push or open an MR."
35
44
  else
36
- exec claude --dangerously-skip-permissions -p "use prepare-spec skill from ${NOTION_URL}"
45
+ exec claude --dangerously-skip-permissions -p "${SOURCE_PROMPT}"
37
46
  fi