fix: repair cross-skill contract gaps and harden Tracker handling (v1.1.1)

- deploy: create "! Rule Needed" label on first deploy (was promised in
  frontmatter but never implemented; rule-review depends on it)
- rule-review: accept Bootstrap-mode entry (Phase: Bootstrap, no Tracker yet)
- survey: create the three artifacts before invoking handoff so handoff's
  sanity check no longer loops
- deploy: name manage_gmail_filter params explicitly (action/criteria/filter_action)
- rule-review: quote label query (label:"! Rule Needed")
- deploy: renumber execution-flow block to the 7 phases the body runs
- survey: frame Tracker About tab as a technical reference
- import + rule-review: de-duplicate rule_id before writing to Tracker
- survey/import/deploy/rule-review: document XLSX Tracker Drive round-trip
- all skills: use session date only in _status.md (no fabricated clock time)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jason Stedwell
2026-07-03 23:04:35 -05:00
co-authored by Claude Opus 4.8
parent 005c047eb6
commit 8723bb942e
6 changed files with 121 additions and 28 deletions
+36 -12
View File
@@ -67,12 +67,22 @@ and that requires the user to confirm it before Claude touches anything.
## Prerequisites
Before doing any other work, run Phase 1 (sanity check). This skill requires:
- `_status.md` exists with Phase = "Deploy" or "Maintenance" (first deploy must be complete)
- `_status.md` exists with Phase = "Deploy", "Maintenance", or "Bootstrap"
- `Bible.md` exists with taxonomy and bylaws
- Tracker exists (Google Sheet or XLSX)
- `! Rule Needed` label exists in Gmail (created automatically by the deploy skill on first deploy)
- Tracker exists (Google Sheet or XLSX)**except in Bootstrap mode**, where no Tracker
was created yet (see Bootstrap note below)
- `! Rule Needed` label exists in Gmail (created during the first deploy, or during survey
in Bootstrap mode)
If Phase is earlier than "Deploy":
**Bootstrap-mode entry:** A project set up in Bootstrap mode (survey with < 15 labels)
never ran deploy — its `_status.md` shows `Phase: Bootstrap` and `Bootstrap Mode: TRUE`,
and it was intentionally sent here as the return path ("review my rule needed folder").
This is valid. If there is no Tracker yet, create one on the first rule that gets approved:
confirm the Tracker format (Google Sheet vs. XLSX) with the user per the Bible's open
question, build it using the Tracker schema at the end of this skill, then proceed.
If Phase is "Survey complete" or "Handoff in progress" (a non-bootstrap project whose
first deploy hasn't happened yet):
> "It looks like your rules haven't been deployed yet. The `! Rule Needed` label gets
> created as part of the first deploy — once that's done, I can review flagged emails
> with you. Want to finish the deploy first?"
@@ -114,11 +124,13 @@ Phase 8 → Update _status.md and brief the user
Read `_status.md` from the project Drive folder.
Check:
1. Phase = "Deploy" or "Maintenance"
1. Phase = "Deploy", "Maintenance", or "Bootstrap"
2. `Bible Location` has a valid Drive URL
3. `Tracker Location` has a valid Drive URL or path
3. `Tracker Location` has a valid Drive URL or path — OR is "NONE" if `Bootstrap Mode: TRUE`
(a bootstrap project has no Tracker yet; that's expected — see Prerequisites)
If Phase is earlier than "Deploy" → redirect (see Prerequisites above).
If Phase is "Survey complete" or "Handoff in progress" (deploy hasn't run and this is not
a bootstrap project) → redirect (see Prerequisites above).
Read `Bible.md` — extract:
- The `! Rule Needed` label name (may have been customized; default is `! Rule Needed`)
@@ -135,10 +147,13 @@ that name everywhere in this skill. Do not hardcode `! Rule Needed`.
Search Gmail for all messages with the `! Rule Needed` label.
```
search_gmail_messages query: "label:! Rule Needed"
search_gmail_messages query: label:"! Rule Needed"
```
If the label name has spaces or special characters, quote it appropriately.
Because the label name contains a space, the label value must be quoted inside the query
(`label:"! Rule Needed"`) — an unquoted `label:! Rule Needed` will not match. Quote the
label value whenever the name has spaces or special characters, and substitute the actual
label name from Bible.md if it was customized.
Read message headers only: sender, sender domain, subject, date received, current labels.
Do NOT read message bodies — headers are sufficient for pattern identification.
@@ -342,11 +357,20 @@ complexity threshold not exceeded, user confirmed the rule.
Add the rule to the Tracker with enabled=FALSE.
**First, guarantee a unique rule_id.** Read the existing `rule_id` values from the Rules
sheet before writing. If the ID you generated already exists, append a numeric suffix
(`-2`, `-3`, …) until it is unique. Two sessions can easily generate the same ID
(e.g. `GF-VENDOR-RR-FEDEX`) for different rules — never overwrite or silently collide.
For a Google Sheet Tracker:
Call `append_table_rows` or `modify_sheet_values` to add the row to the Rules sheet.
For an XLSX Tracker:
Invoke the xlsx skill to append the row.
For an XLSX Tracker (round-trip required — the file lives in Drive, not locally):
Download the current file with `get_drive_file_content`, invoke the xlsx skill to append
the row to the Rules sheet, then upload it back to the same Drive location, replacing the
existing file (`update_drive_file` if available; otherwise re-create in the same folder and
confirm the old copy is replaced — never leave two Trackers). Verify the row count grew by
exactly the number of rules added.
Rule ID format for rule-review-authored rules:
```
@@ -462,7 +486,7 @@ After completing:
Update `_status.md`:
```
Last Updated: [timestamp]
Last Updated: [YYYY-MM-DD — today's date from the session; do not fabricate a clock time]
Last Agent: Claude (CoWork) — rule-review skill
Phase: Maintenance
Last Completed Step: Rule review session. [N] clusters reviewed.