@xynogen/pix-skills 0.5.3 → 0.5.5

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
@@ -7,7 +7,7 @@ Pi coding agent extension — skill loader tool + skills bundle.
7
7
  | Resource | Type | Description |
8
8
  |---|---|---|
9
9
  | `read_skills` | tool | Browse and load bundled skills. No args → list all. `name` only → description. `name + full=true` → full instructions. |
10
- | `skills/` | skills | 29 bundled skills (off-context by default — discovered on demand via `read_skills`) |
10
+ | `skills/` | skills | 27 bundled skills (off-context by default — discovered on demand via `read_skills`) |
11
11
 
12
12
  ## How it works
13
13
 
@@ -54,13 +54,11 @@ as `/skill:<name>` slash commands.
54
54
  | `finish` | Structured branch completion — verify, decide, clean up |
55
55
  | `graphify` | Codebase questions via a persistent knowledge graph |
56
56
  | `handoff` | Toggle session handoff — write or read+delete `HANDOFF.md` |
57
- | `notion` | Efficient Notion workspace retrieval — pages, databases, lists |
58
57
  | `plan` | Write detailed, bite-sized implementation plans before coding |
59
58
  | `readme` | Create or update a deployment-focused README in a fixed style |
60
59
  | `review` | Architectural review and quality assurance |
61
60
  | `runner` | Generate or convert a task runner (just/make/mise/task/npm/sh) |
62
61
  | `search` | Deep logic discovery and project context mapping |
63
- | `standup` | Prepare a daily standup update from Notion context |
64
62
  | `suggest` | Multi-dimensional optimization and improvement recommendations |
65
63
  | `task` | Task orchestration and ambiguity resolution |
66
64
  | `test` | Test execution, analysis, and failure resolution via TDD |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "Pi extension — agent skill loader (skill tool + skills bundle)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -46,6 +46,6 @@
46
46
  "@earendil-works/pi-tui": "*"
47
47
  },
48
48
  "dependencies": {
49
- "@xynogen/pix-gate": "*"
49
+ "@xynogen/pix-gate": "^0.1.13"
50
50
  }
51
51
  }
package/src/directive.ts CHANGED
@@ -37,12 +37,7 @@ export function findCommandDirectives(content: string): CommandDirective[] {
37
37
  }
38
38
 
39
39
  /** Replace the [start, end) slice of `s` with `text`. */
40
- export function replaceSpan(
41
- s: string,
42
- start: number,
43
- end: number,
44
- text: string,
45
- ): string {
40
+ export function replaceSpan(s: string, start: number, end: number, text: string): string {
46
41
  return s.slice(0, start) + text + s.slice(end);
47
42
  }
48
43
 
package/src/index.test.ts CHANGED
@@ -46,9 +46,7 @@ describe("extractName", () => {
46
46
 
47
47
  describe("extractDescription", () => {
48
48
  it("reads description from frontmatter", () => {
49
- expect(extractDescription(FRONTMATTER)).toBe(
50
- "Split, write, and maintain commits.",
51
- );
49
+ expect(extractDescription(FRONTMATTER)).toBe("Split, write, and maintain commits.");
52
50
  });
53
51
 
54
52
  it("returns null when absent", () => {
@@ -67,9 +65,7 @@ describe("formatSkillSummary", () => {
67
65
 
68
66
  it("renders single skill as bold-accent name + muted description", () => {
69
67
  const out = formatSkillSummary(FRONTMATTER, tagTheme);
70
- expect(out).toBe(
71
- "[accent]<b>commit</b>[/] [muted]Split, write, and maintain commits.[/]",
72
- );
68
+ expect(out).toBe("[accent]<b>commit</b>[/] [muted]Split, write, and maintain commits.[/]");
73
69
  });
74
70
 
75
71
  it("falls back to (no description) when frontmatter has name only", () => {
@@ -83,9 +79,7 @@ describe("formatSkillSummary", () => {
83
79
  const lines = out.split("\n");
84
80
  expect(lines).toHaveLength(2);
85
81
  expect(lines[0]).toBe("[accent]<b>commit</b>[/] [muted]write commits[/]");
86
- expect(lines[1]).toBe(
87
- "[accent]<b>debug</b>[/] [muted]root cause analysis[/]",
88
- );
82
+ expect(lines[1]).toBe("[accent]<b>debug</b>[/] [muted]root cause analysis[/]");
89
83
  });
90
84
 
91
85
  it("passes non 'name: desc' lines through as muted", () => {
@@ -112,9 +106,10 @@ describe("findCommandDirectives", () => {
112
106
  });
113
107
 
114
108
  it("finds multiple", () => {
115
- expect(
116
- findCommandDirectives("!`pwd` !`git diff`").map((d) => d.command),
117
- ).toEqual(["pwd", "git diff"]);
109
+ expect(findCommandDirectives("!`pwd` !`git diff`").map((d) => d.command)).toEqual([
110
+ "pwd",
111
+ "git diff",
112
+ ]);
118
113
  });
119
114
  });
120
115
 
@@ -125,20 +120,7 @@ describe("replaceSpan", () => {
125
120
  });
126
121
 
127
122
  describe("hasShellMeta", () => {
128
- for (const ch of [
129
- ";",
130
- "|",
131
- "&",
132
- "$",
133
- "`",
134
- ">",
135
- "<",
136
- "(",
137
- ")",
138
- "{",
139
- "}",
140
- "\n",
141
- ]) {
123
+ for (const ch of [";", "|", "&", "$", "`", ">", "<", "(", ")", "{", "}", "\n"]) {
142
124
  it(`flags ${JSON.stringify(ch)}`, () => {
143
125
  expect(hasShellMeta(`git status ${ch}`)).toBe(true);
144
126
  });
package/src/index.ts CHANGED
@@ -198,8 +198,7 @@ export function formatSkillSummary(text: string, theme: ThemeLike): string {
198
198
  const ParamsSchema = Type.Object({
199
199
  name: Type.Optional(
200
200
  Type.String({
201
- description:
202
- 'Skill name, e.g. "commit", "debug". Omit to list all skills.',
201
+ description: 'Skill name, e.g. "commit", "debug". Omit to list all skills.',
203
202
  }),
204
203
  ),
205
204
  full: Type.Optional(
@@ -218,13 +217,7 @@ function registerSkillLoader(pi: ExtensionAPI): void {
218
217
  description:
219
218
  "Browse and load bundled skills. No args → list all skills with descriptions. name only → description for that skill. name + full=true → full instructions.",
220
219
  promptSnippet: "Browse and load bundled skill instructions",
221
- promptGuidelines: [
222
- "Skills are NOT pre-listed in this prompt. When a task may match a specialized procedure, call read_skills() first to discover what is available.",
223
- "Call read_skills() with no arguments to list all available skills and their descriptions.",
224
- "Call read_skills(name=<skill>) to read the description of a specific skill before deciding to load it.",
225
- "Call read_skills(name=<skill>, full=true) to load the full procedure for a skill before executing it.",
226
- "Prefer read_skills() over the read tool for skills — it resolves the correct path regardless of install location.",
227
- ],
220
+ promptGuidelines: ["Matching skill? Call read_skills() first."],
228
221
  executionMode: "sequential",
229
222
  parameters: ParamsSchema,
230
223
 
@@ -256,22 +249,16 @@ function registerSkillLoader(pi: ExtensionAPI): void {
256
249
  }
257
250
  });
258
251
 
259
- return ok(
260
- `Available skills (${skills.length}):\n\n${lines.join("\n")}`,
261
- );
252
+ return ok(`Available skills (${skills.length}):\n\n${lines.join("\n")}`);
262
253
  }
263
254
 
264
255
  // Resolve skill
265
256
  const skills = discoverSkills();
266
- const entry = skills.find(
267
- (s) => s.name === name || s.name === name.replace(/\.md$/, ""),
268
- );
257
+ const entry = skills.find((s) => s.name === name || s.name === name.replace(/\.md$/, ""));
269
258
 
270
259
  if (!entry) {
271
260
  const names = skills.map((s) => s.name).join(", ");
272
- return fail(
273
- `Skill "${name}" not found. Available: ${names || "(none)"}`,
274
- );
261
+ return fail(`Skill "${name}" not found. Available: ${names || "(none)"}`);
275
262
  }
276
263
 
277
264
  try {
@@ -280,9 +267,7 @@ function registerSkillLoader(pi: ExtensionAPI): void {
280
267
  // full=false (default) → description only
281
268
  if (!full) {
282
269
  const desc = extractDescription(content);
283
- return ok(
284
- desc ? `${entry.name}: ${desc}` : `${entry.name}: (no description)`,
285
- );
270
+ return ok(desc ? `${entry.name}: ${desc}` : `${entry.name}: (no description)`);
286
271
  }
287
272
 
288
273
  // full=true → interpolate !`cmd` directives (pix-gate-gated, no
@@ -292,9 +277,7 @@ function registerSkillLoader(pi: ExtensionAPI): void {
292
277
  return ok(expanded);
293
278
  } catch (err) {
294
279
  return fail(
295
- `Failed to read skill "${name}": ${
296
- err instanceof Error ? err.message : String(err)
297
- }`,
280
+ `Failed to read skill "${name}": ${err instanceof Error ? err.message : String(err)}`,
298
281
  );
299
282
  }
300
283
  },
package/src/run.test.ts CHANGED
@@ -3,9 +3,7 @@ import { runArgv } from "./run.ts";
3
3
 
4
4
  describe("runArgv", () => {
5
5
  it("captures stdout", async () => {
6
- expect(
7
- (await runArgv(["echo", "hello"], { cwd: process.cwd() })).trim(),
8
- ).toBe("hello");
6
+ expect((await runArgv(["echo", "hello"], { cwd: process.cwd() })).trim()).toBe("hello");
9
7
  });
10
8
 
11
9
  it("caps output at maxBytes", async () => {
package/src/run.ts CHANGED
@@ -40,9 +40,7 @@ export function runArgv(argv: string[], opts: RunOptions): Promise<string> {
40
40
  stdio: ["ignore", "pipe", "pipe"],
41
41
  });
42
42
  } catch (err) {
43
- finish(
44
- `[command failed: ${err instanceof Error ? err.message : String(err)}]`,
45
- );
43
+ finish(`[command failed: ${err instanceof Error ? err.message : String(err)}]`);
46
44
  return;
47
45
  }
48
46
 
@@ -73,7 +71,6 @@ function format(
73
71
  truncMarker = "[output truncated]",
74
72
  ): string {
75
73
  const combined = Buffer.concat(chunks).toString("utf-8").trimEnd();
76
- if (bytes > maxBytes)
77
- return `${combined.slice(0, maxBytes)}\n… ${truncMarker}`;
74
+ if (bytes > maxBytes) return `${combined.slice(0, maxBytes)}\n… ${truncMarker}`;
78
75
  return combined || "(no output)";
79
76
  }
package/skills/notion.md DELETED
@@ -1,117 +0,0 @@
1
- ---
2
- name: notion
3
- description: Efficient Notion workspace retrieval. Use when user asks to fetch, search, or read data from Notion — pages, databases, or project lists.
4
- disable-model-invocation: true
5
- ---
6
- # Notion Retrieval Directive
7
-
8
- ## Core Rule
9
-
10
- **Data already in context → answer immediately. Zero extra tool calls.**
11
- If a previous fetch/search already returned the rows, filter/reason over them inline.
12
- Only call MCP tools when data is genuinely absent from context.
13
-
14
- ## Tool Map
15
-
16
- | Goal | Tool | Notes |
17
- |---|---|---|
18
- | Find a database/page by name | `notion_notion-search` | filter `{"value":"database"}` for DBs |
19
- | Get schema + views of a DB | `notion_notion-fetch` with DB UUID | returns schema, SQLite DDL, view configs |
20
- | Get all rows with properties | batch `notion_notion-fetch` per page UUID | fetch all pages concurrently in ONE message |
21
- | Search within a data source | `notion_notion-search` with `data_source_url` | semantic; `filters.created_date_range` = creation date only, NOT schedule |
22
-
23
- ## Retrieval Protocol
24
-
25
- ### Step 1 — Locate (1 call)
26
-
27
- Search for the database:
28
-
29
- ```
30
- notion_notion-search(query="<name>", filter={value:"database"})
31
- ```
32
-
33
- Note the DB `id` and `data-source` collection URL from results.
34
-
35
- ### Step 2 — Schema (1 call, optional)
36
-
37
- Only if you need field names / option values:
38
-
39
- ```
40
- notion_notion-fetch(id="<db-uuid>")
41
- ```
42
-
43
- The response contains full schema + SQLite DDL — read it, don't re-fetch.
44
-
45
- ### Step 3 — Rows (1 batch)
46
-
47
- Fetch all known page UUIDs **concurrently in a single message** (parallel tool calls).
48
- Each call returns full `<properties>` block — Status, Category, Schedule, Stack, etc.
49
-
50
- **Never re-fetch a page whose properties are already in context.**
51
-
52
- ## Date / Schedule Filtering
53
-
54
- - `filters.created_date_range` in `notion_notion-search` = **page creation date**, not schedule field.
55
- - To filter by schedule/deadline: fetch all rows (Step 3), then filter in-context by `date:📅 Schedule:end` or `date:📅 Schedule:start`.
56
- - Pattern: `end = "YYYY-MM-30"` or range overlap check — do this mentally/inline, no extra calls.
57
-
58
- ## Answer Pattern
59
-
60
- Once rows are in context:
61
-
62
- ```
63
- Filter rows where Schedule.end overlaps target month → present table directly.
64
- ```
65
-
66
- No re-search, no re-fetch, no confirmation calls.
67
-
68
- ## Efficiency Rules
69
-
70
- 1. **Batch parallel**: all page fetches go in one message, not sequential calls.
71
- 2. **Schema once**: read the DDL from the DB fetch — never fetch schema twice.
72
- 3. **Search is fuzzy**: `notion_notion-search` is semantic. Use a representative keyword, not empty string (min length 1).
73
- 4. **Collection URL**: data source URL format is `collection://UUID` — use for `data_source_url` param in search.
74
- 5. **No re-fetch loop**: if a batch already ran and data is present, stop. Answer from context.
75
-
76
- ## Common Pitfalls
77
-
78
- - `notion_notion-search` with `query=""` → error (min 1 char). Use `"project"` or topic keyword.
79
- - `notion_notion-fetch` requires `id` param (UUID or collection:// URL), not `url`.
80
- - `filters.created_date_range` ≠ schedule filter — don't use it to find deadline-based rows.
81
- - Relying on `notion_notion-search` filters for any field-level filtering — internal search is broken, always dump + script.
82
- - Fetching the database again after already having rows in context = wasted call.
83
- - Running searches sequentially when they can be parallel = wasted turns.
84
-
85
- ## Default: Always Dump to File
86
-
87
- **Notion's internal search is unreliable** — date filters, keyword filters, and empty queries all behave inconsistently. Do not rely on search for filtering. Always:
88
-
89
- 1. **Fetch all rows** — batch all page UUIDs in one parallel message
90
- 2. **Dump to `/tmp/notion-<db-name>.json`** — write full properties as JSON array
91
- 3. **Query with Python/jq** — filter, sort, aggregate locally
92
- 4. **Answer from script output** — never re-fetch, never re-search
93
-
94
- ```python
95
- import json
96
- rows = json.load(open("/tmp/notion-projects.json"))
97
-
98
- # filter by deadline month
99
- june = [r for r in rows if r.get("date:📅 Schedule:end", "").startswith("2026-06")]
100
- for r in june:
101
- print(r["Name"], r["Status"], r["date:📅 Schedule:end"])
102
- ```
103
-
104
- **Write once, query many** — follow-up questions on same DB: reuse `/tmp/` file, run new script. Zero re-fetches.
105
-
106
- If `/tmp/notion-<db>.json` already exists from this session → skip fetch entirely, go straight to script.
107
-
108
- ## Minimal Call Budget
109
-
110
- | Task | Calls |
111
- |---|---|
112
- | List all projects | 2 (search DB → batch fetch → dump `/tmp/`) |
113
- | Filter by any field | 2 (fetch all → dump) + 1 (python script) |
114
- | Follow-up on same DB | 0 fetches (reuse `/tmp/`) + 1 (new script) |
115
- | Get one page's properties | 1 |
116
- | Get one page's properties | 1 |
117
- | Check schema only | 1 |
package/skills/standup.md DELETED
@@ -1,259 +0,0 @@
1
- ---
2
- name: standup
3
- description: This skill should be used when the user asks to "standup me", "buat standup", "create standup script", "generate standup", "standup hari ini", or any request to prepare a daily standup update. Handles fetching previous context from Notion, prompting the user, generating a script, and saving to Notion.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Standup Script Skill
8
-
9
- ## Overview
10
-
11
- Automate daily standup script creation: pull most recent standup from Notion as context, prompt user interactively, generate natural-language script, save today's standup back to Notion.
12
-
13
- ## Decision Tree
14
-
15
- ```
16
- User asks for standup
17
- ↓
18
- Check Notion MCP available?
19
- ├── NO → Prompt user manually, generate script, output only (no save)
20
- └── YES → Fetch most recent standup → Prompt user → Generate → Save to Notion
21
- ```
22
-
23
- ## Step-by-Step Workflow
24
-
25
- ### Step 0: Check Notion MCP Availability
26
-
27
- Before doing anything, verify Notion MCP reachable by calling `notion_notion-get-users` or any lightweight Notion tool.
28
-
29
- - **MCP fails or unavailable**: Inform user, then continue from Step 2 without Notion context. Skip Step 4.
30
- - **MCP available**: Proceed to Step 1.
31
-
32
- ---
33
-
34
- ### Step 1: Fetch Most Recent Standup from Notion
35
-
36
- Search for most recent standup page — do NOT assume yesterday (may be Friday, pre-holiday, etc.).
37
-
38
- 1. Search Notion with query `"Standup -"` scoped under Mei user page
39
- 2. Parse all result titles matching pattern `Standup - YYYY-MM-DD`
40
- 3. Pick one with **latest date**
41
- 4. Fetch its full content for context
42
-
43
- **No previous standup found**: skip to Step 2 with no prior context.
44
-
45
- ---
46
-
47
- ### Step 2: Prompt User with Questions
48
-
49
- Use `question` tool to ask all 3 questions at once (parallel — single tool call):
50
-
51
- | # | Header | Question |
52
- |---|--------|----------|
53
- | 1 | Yesterday | Did you finish the task from the last standup (`[last task]`), or is it still in progress? |
54
- | 2 | Today | What will you work on today? |
55
- | 3 | Blocker | Any updates on blockers from last standup? (resolved, still blocked, new blocker?) |
56
-
57
- Populate question options from last standup content where possible (e.g., "Finished", "Still in progress", "Different task").
58
-
59
- ---
60
-
61
- ### Step 3: Generate Script
62
-
63
- > 📌 Source of truth: **Standup Script** template page (`35d3d66a-a117-81b4-a276-f38a31b60c82`). Fetch it to copy EXACT callout structure, icons, color tokens — do NOT guess color values. Current tokens: `yellow_bg` / `green_bg` / `red_bg`.
64
-
65
- Compose natural Indonesian standup script from user's answers. Visual layout uses **three colored Notion callouts** (one per section) preceded by salam line:
66
-
67
- ```
68
- Assalamualaikum, saya [Nama].
69
-
70
- [💭 yellow_bg callout]
71
- Kemarin — [task dari standup terakhir, status: selesai / dilanjutkan]
72
-
73
- [🚀 green_bg callout]
74
- Hari ini — [today's task]
75
-
76
- [⛔ red_bg callout]
77
- Blocker — [blocker update atau "Tidak ada blocker"]
78
- ```
79
-
80
- Rules:
81
-
82
- - One callout per section — keep body to single short line where possible
83
- - Use natural Bahasa Indonesia
84
- - Salam + nama on single line at top (plain paragraph, not callout)
85
- - Callout color mapping fixed: 💭 yellow / 🚀 green / ⛔ red
86
- - Blocker resolved → mention explicitly ("Blocker sebelumnya sudah teratasi")
87
- - New blocker → state clearly
88
- - No blocker → body is "Tidak ada blocker"
89
-
90
- ---
91
-
92
- ### Step 4: Save to Notion (only if MCP available)
93
-
94
- Standups organized into **month folders** (one page per month, Bahasa Indonesia) under **Standup** page. Save must target folder matching **today's month**, not folder the most recent standup lived in.
95
-
96
- **Step 4a — Resolve month folder:**
97
-
98
- 1. Determine today's month from today's actual date (run `date +%F`).
99
- 2. Look under **Standup** page (`35d3d66a-a117-81d2-b521-d60d311aa96e`) for child page titled with Indonesian month name (e.g. `Mei`, `Juni`, `Juli`).
100
- 3. **Folder exists** → use its page ID as save parent.
101
- 4. **Does NOT exist** (new month) → create it first with `notion-create-pages`:
102
- - Parent: Standup page `35d3d66a-a117-81d2-b521-d60d311aa96e` (month folders are **siblings** at this level — NOT nested inside previous month's folder)
103
- - Title: Indonesian month name (e.g. `Juni`)
104
- - Icon: `📅`
105
- - Content: `*Standup notes — [English Month] [Year].*`
106
- - Use returned page ID as save parent.
107
-
108
- > ⚠️ Common mistake: saving today's standup into **previous** month's folder because that's where most recent standup was fetched from. Always re-resolve folder from today's month. Standup already created in wrong folder → move with `notion-move-pages` (param is `page_or_database_ids`, NOT `page_ids`).
109
-
110
- **Step 4b — Create standup page** under resolved month folder.
111
-
112
- **Title:** `Standup - YYYY-MM-DD` (use today's actual date)
113
-
114
- **Content (three callout blocks + intro paragraph):**
115
-
116
- 1. Paragraph: `Assalamualaikum, saya Fikri.`
117
- 2. Callout — icon `💭`, color `yellow_bg`, body: `**Kemarin** — [task dari standup terakhir, status: selesai / dilanjutkan]`
118
- 3. Callout — icon `🚀`, color `green_bg`, body: `**Hari ini** — [today's task dari user]`
119
- 4. Callout — icon `⛔`, color `red_bg`, body: `**Blocker** — [blocker update atau "Tidak ada blocker"]`
120
-
121
- > ⚠️ Color values MUST be Notion-flavored Markdown background tokens (`yellow_bg`, `green_bg`, `red_bg`) — NOT `*_background`. Wrong tokens silently dropped → callouts render colorless. Callout markdown form: `<callout icon="💭" color="yellow_bg">`.
122
-
123
- Use `notion-create-pages` with explicit block content for callouts (not just markdown). After saving, return Notion page URL to user.
124
-
125
- ---
126
-
127
- ## Notion Page IDs
128
-
129
- | Location | ID |
130
- |----------|----|
131
- | Work | `3363d66a-a117-8177-b3fb-eda2bfb94ebb` |
132
- | Standup (month folders live here) | `35d3d66a-a117-81d2-b521-d60d311aa96e` |
133
- | Standup Script (template / source of truth) | `35d3d66a-a117-81b4-a276-f38a31b60c82` |
134
-
135
- > Month folders (Indonesian names: `Mei`, `Juni`, `Juli`, …) are **siblings** directly under Standup page, each with icon 📅. Created on demand — resolve folder for **today's month** at save time (search under Standup page), create if missing. Do NOT hardcode month folder IDs.
136
-
137
- ---
138
-
139
- ## Edge Cases
140
-
141
- | Situation | Behavior |
142
- |-----------|----------|
143
- | Notion MCP unavailable | Skip fetch + save, generate script only |
144
- | No previous standup found | Prompt without pre-filled options |
145
- | Weekend gap (e.g., Monday standup) | Still pick most recent — could be Friday's |
146
- | User says "different task" | Ask follow-up: "Apa yang dikerjakan kemarin?" |
147
- | No blocker | Output: "Tidak ada blocker saat ini." |
148
- | New month, no folder yet | Create month folder (Indonesian name) under Standup page, then save standup inside it |
149
- | Standup saved in wrong month folder | Move it with `notion-move-pages` using `page_or_database_ids` param |
150
-
151
- ---
152
-
153
- ## Compact Workflow
154
-
155
- **Trigger:** User says `compact [bulan]` (e.g., `compact june`, `compact mei`, `compact bulan juni`).
156
-
157
- Ambil semua standup notes dari bulan tersebut → buat Notion database table per bulan.
158
-
159
- ### Decision Tree
160
-
161
- ```
162
- User: "compact [bulan]"
163
- ↓
164
- Resolve bulan → cari month folder di Standup page
165
- ↓
166
- Fetch semua child pages (Standup - YYYY-MM-DD)
167
- ↓
168
- Fetch isi tiap page → extract Kemarin / Hari Ini / Blocker
169
- ↓
170
- Cek apakah database "Standup [Bulan] [Tahun]" sudah ada di month folder?
171
- ├── SUDAH ADA → skip create, langsung insert rows yang belum ada
172
- └── BELUM ADA → create database → insert semua rows
173
- ↓
174
- Enable wrap cells
175
- ↓
176
- Return URL database ke user
177
- ```
178
-
179
- ### Step-by-Step
180
-
181
- #### Step 1 — Resolve Month Folder
182
-
183
- 1. Parse bulan dari input user (support Bahasa Indonesia & English, e.g. `juni` / `june` / `Juni` / `June`).
184
- 2. Search Notion untuk month folder di bawah Standup page (`35d3d66a-a117-81d2-b521-d60d311aa96e`).
185
- 3. **Jika folder tidak ada** → inform user bahwa belum ada standup untuk bulan tersebut. Stop.
186
-
187
- #### Step 2 — Fetch Semua Standup Pages
188
-
189
- 1. Fetch month folder page → ambil semua child pages dengan title pattern `Standup - YYYY-MM-DD`.
190
- 2. Fetch isi **setiap** child page secara paralel (batch dalam satu panggilan jika memungkinkan).
191
- 3. Dari tiap page, extract:
192
- - **Tanggal**: parse dari title (`YYYY-MM-DD`)
193
- - **Kemarin**: isi callout `yellow_bg` (strip bold marker `**Kemarin** —`)
194
- - **Hari Ini**: isi callout `green_bg` (strip bold marker `**Hari ini** —`)
195
- - **Blocker**: isi callout `red_bg` (strip bold marker `**Blocker** —`)
196
-
197
- #### Step 3 — Create atau Reuse Database
198
-
199
- Database title format: `Standup [IndonesianMonth] [Year]` (e.g., `Standup Mei 2026`).
200
-
201
- **Jika belum ada** → buat dengan `notion-create-database`:
202
-
203
- - Parent: month folder page ID
204
- - Schema:
205
-
206
- ```sql
207
- CREATE TABLE (
208
- "Name" TITLE,
209
- "Tanggal" DATE,
210
- "Kemarin" RICH_TEXT,
211
- "Hari Ini" RICH_TEXT,
212
- "Blocker" RICH_TEXT
213
- )
214
- ```
215
-
216
- - Setelah create, ambil `data_source_id` dari response (`collection://...`).
217
-
218
- **Jika sudah ada** → fetch database → ambil `data_source_id` + cek rows yang sudah ada (hindari duplikat berdasarkan `Name`).
219
-
220
- #### Step 4 — Insert Rows
221
-
222
- Gunakan `notion-create-pages` dengan `parent: { data_source_id: "..." }`.
223
-
224
- Per row:
225
-
226
- ```json
227
- {
228
- "Name": "Standup - YYYY-MM-DD",
229
- "date:Tanggal:start": "YYYY-MM-DD",
230
- "date:Tanggal:is_datetime": 0,
231
- "Kemarin": "[extracted text]",
232
- "Hari Ini": "[extracted text]",
233
- "Blocker": "[extracted text]"
234
- }
235
- ```
236
-
237
- Batch semua rows dalam **satu** `notion-create-pages` call (max 5 per call jika banyak — split jika perlu).
238
-
239
- #### Step 5 — Enable Wrap Cells
240
-
241
- Setelah database dibuat, fetch database → ambil `view_id` dari `<views>` → update view:
242
-
243
- ```
244
- notion-update-view: WRAP CELLS true
245
- ```
246
-
247
- #### Step 6 — Return ke User
248
-
249
- Return URL database Notion ke user.
250
-
251
- ### Rules & Edge Cases
252
-
253
- | Situasi | Behavior |
254
- |---------|----------|
255
- | Bulan tidak ditemukan di Notion | Inform user, stop |
256
- | Database sudah ada | Reuse, skip rows yang sudah ada (cek by Name) |
257
- | Page standup formatnya beda (ga ada callout) | Skip page tersebut, warn user |
258
- | Bulan belum selesai (current month) | Tetap compact — insert semua yang ada sampai hari ini |
259
- | Blocker kosong / "Belum Ada" | Tetap insert as-is |