Skip to content

Commit 8726edd

Browse files
committed
Sync skills and rules from ~/.cursor
1 parent bc45aae commit 8726edd

File tree

16 files changed

+86
-109
lines changed

16 files changed

+86
-109
lines changed

.cursor/rules/typescript-standards.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Exception: Empty handlers are acceptable ONLY when the rejection is an expected
7373
<standard id="extract-helpers">Extract reusable helpers for common boilerplate patterns (e.g., "run at most once in parallel").</standard>
7474

7575
<standard id="precompute-outside-loops">Avoid calling expensive transformation functions (like `normalizeForSearch`, `toLowerCase`) inside loops when the input doesn't change per iteration. Pre-compute outside the loop.
76-
❌ `items.filter(item => searchTerms.every(term => normalize(item![1770928879881](image/typescript-standards/1770928879881.png)![1770928886532](image/typescript-standards/1770928886532.png).name).includes(term)))`
76+
❌ `items.filter(item => searchTerms.every(term => normalize(item.name).includes(term)))`
7777
✅ `items.filter(item => { const n = normalize(item.name); return searchTerms.every(term => n.includes(term)) })`
7878
</standard>
7979

.cursor/rules/workflow-halt-on-error.mdc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ alwaysApply: true
55

66
<rules description="Non-negotiable constraints.">
77

8+
<rule id="cursor-workflow-paths">All workflow-related skill definitions (`*.md` / `SKILL.md`) and workflow companion scripts (`*.sh`) are sourced from `~/.cursor/`. When executing skills, prefer explicit `~/.cursor/...` paths and do not assume repo-local workflow files unless the skill explicitly points to one.</rule>
9+
810
<rule id="skill-script-path-resolution">When a skill mentions a script path, resolve it under `~/.cursor/skills/<skill>/scripts/` unless the skill explicitly specifies an absolute path elsewhere. Do not assume repo-relative `scripts/` paths without verifying the skill directory contents.</rule>
911

10-
<rule id="halt-on-error">When ANY shell command fails (non-zero exit code) during a workflow:
12+
<rule id="halt-on-error">When ANY shell command fails (non-zero exit code) during a workflow (except where explicitly allowed by `auto-fix-verification-failures` or `companion-script-nonzero-contracts`):
1113
1. **STOP** — do not retry, work around, substitute, or continue the workflow.
1214
2. **Report** — show the user the exact command, exit code, and error output.
1315
3. **Diagnose** — classify the failure: missing tool (`command not found`), wrong path, permissions, or logic error.
@@ -47,6 +49,19 @@ Never auto-fix:
4749
- Any failure requiring destructive operations or workflow bypasses
4850
</rule>
4951

52+
<rule id="companion-script-nonzero-contracts">Respect documented companion script exit-code contracts. Non-zero does NOT always mean fatal.
53+
54+
For `~/.cursor/skills/im/scripts/lint-warnings.sh`:
55+
- `0` = no warnings
56+
- `1` = warnings found (expected actionable state)
57+
- `2` = execution error (fatal)
58+
59+
Required behavior:
60+
1. If exit `1`, continue workflow by fixing warnings before implementation.
61+
2. If warnings exist, commit warning fixes in a separate lint-fix commit immediately before feature commits.
62+
3. If exit `2`, apply `halt-on-error`.
63+
</rule>
64+
5065
<rule id="no-silent-substitution">Do NOT silently substitute an alternative tool or approach when a command fails. If `rg` is not found, do not fall back to `grep`. If a script exits non-zero, do not manually replicate what the script does. The failure is the signal — report it.</rule>
5166

5267
</rules>

.cursor/scripts/pr-watch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ while true; do
6464
NOW=$(date '+%H:%M:%S')
6565

6666
# Parse recommended interval from script output
67-
RECOMMENDED=$(echo "$OUTPUT" | grep -oP '(?<=^# interval:)\d+' || echo "")
67+
RECOMMENDED=$(echo "$OUTPUT" | sed -n 's/^# interval:\([0-9][0-9]*\)/\1/p' | head -n 1)
6868

6969
# Determine actual sleep interval
7070
if [[ -n "$INTERVAL" ]]; then

.cursor/scripts/push-env-key.sh

Lines changed: 0 additions & 63 deletions
This file was deleted.

.cursor/skills/asana-task-update/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: asana-task-update
33
description: Update Asana tasks via one reusable workflow (attach PRs, assign/unassign, set status, and update task fields). Use when any skill needs to modify Asana task state.
4-
compatibility: Requires jq. ASANA_TOKEN for Asana API updates. ASANA_GITHUB_SECRET for PR attach operations.
4+
compatibility: Requires jq. ASANA_TOKEN for Asana API updates. ASANA_GITHUB_SECRET for PR attach operations (obtain via https://github.integrations.asana.plus/auth?domainId=ghactions).
55
metadata:
66
author: j0ntz
77
---
@@ -11,7 +11,7 @@ metadata:
1111
<rules description="Non-negotiable constraints.">
1212
<rule id="use-companion-script">Use `~/.cursor/skills/asana-task-update/scripts/asana-task-update.sh` for all Asana task mutations. Do not call raw Asana APIs directly from skills that can delegate here.</rule>
1313
<rule id="task-required">Every operation requires `--task <task_gid>`.</rule>
14-
<rule id="attach-requires-secret">`--attach-pr` requires `ASANA_GITHUB_SECRET`. Other operations require `ASANA_TOKEN`.</rule>
14+
<rule id="attach-requires-secret">`--attach-pr` requires `ASANA_GITHUB_SECRET` (obtain via OAuth: https://github.integrations.asana.plus/auth?domainId=ghactions). Other operations require `ASANA_TOKEN`.</rule>
1515
<rule id="prompt-codes">If the script exits code 2 with `PROMPT_REVIEWER` or `PROMPT_IMPLEMENTOR`, ask the user and re-run with explicit `--reviewer` or `--implementor`.</rule>
1616
<rule id="script-timeouts">Asana updates can take time. Use `block_until_ms: 120000` for script calls.</rule>
1717
</rules>

.cursor/skills/asana-task-update/scripts/asana-task-update.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ fi
6969

7070
if $DO_ATTACH && [[ -z "${ASANA_GITHUB_SECRET:-}" ]]; then
7171
echo "Error: ASANA_GITHUB_SECRET not set (required for --attach-pr)" >&2
72+
echo "Obtain via OAuth: https://github.integrations.asana.plus/auth?domainId=ghactions" >&2
7273
exit 1
7374
fi
7475

@@ -90,6 +91,7 @@ status_to_gid() {
9091
"Review Needed") echo "$REVIEW_NEEDED_OPTION" ;;
9192
"Publish Needed") echo "$PUBLISH_NEEDED_OPTION" ;;
9293
"Verification Needed") echo "$VERIFICATION_NEEDED_OPTION" ;;
94+
# Passthrough: accepts raw GIDs from callers like asana-create-dep-task.sh
9395
*) echo "$1" ;;
9496
esac
9597
}

.cursor/skills/chat-audit/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ metadata:
1616
</rules>
1717

1818
<step id="1" name="Extract conversation data">
19-
Run the companion script on the user-provided export file:
19+
If no chat export file is provided, assume the user is asking for a chat audit of the current chat session.
20+
21+
If chat export file is provided, run the companion script on the user-provided export file:
2022

2123
```bash
2224
scripts/cursor-chat-extract.js <export-file> --tools-only

.cursor/skills/convention-sync/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ metadata:
99
<goal>Sync cursor files between `~/.cursor/` and the `edge-conventions` repo, commit, push, and update PR description from README. Also maintains cross-tool compatibility: symlinks `~/.claude/skills``~/.cursor/skills` and generates `~/.claude/CLAUDE.md` from always-apply rules.</goal>
1010

1111
<rules>
12+
<rule id="local-is-canonical">`~/.cursor/` is the canonical source. Edits happen locally; the repo is the distribution copy. Default direction is `user-to-repo`. Use `--repo-to-user` only for onboarding or pulling changes authored by others. The script does not detect bidirectional conflicts — whichever direction you run overwrites the other side.</rule>
1213
<rule id="use-companion-script">Use `scripts/convention-sync.sh` for diffing and syncing. Do NOT manually diff or copy files.</rule>
1314
<rule id="dry-run-first">Always run without `--stage` first to show the summary. Only stage/commit after user confirms.</rule>
1415
<rule id="no-script-bypass">If the script fails, report the error and STOP.</rule>

.cursor/skills/convention-sync/scripts/convention-sync.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# outputs a structured JSON summary of new, modified, and deleted files.
66
# With --stage: copies changed files and stages them in git (or copies to user dir with --repo-to-user).
77
# With --commit: stages + commits (requires -m). Only valid for user-to-repo direction.
8+
#
9+
# Sync model: ~/.cursor/ is canonical. Default direction (user-to-repo) copies local
10+
# files into the repo. --repo-to-user is for onboarding or pulling others' changes.
11+
# No bidirectional conflict detection — the chosen direction overwrites the other side.
812

913
set -euo pipefail
1014

.cursor/skills/im/SKILL.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ metadata:
1111
<rules description="Non-negotiable constraints.">
1212
<rule id="read-coding-standards">Before writing ANY code, read `.cursor/rules/typescript-standards.mdc` and follow all rules and standards in it throughout the implementation.</rule>
1313
<rule id="no-impl-before-confirm">Do NOT begin implementation until the user confirms the `/asana-plan` output (Step 0).</rule>
14-
<rule id="lint-before-change">Before the first edit to ANY file, run `scripts/lint-warnings.sh <files...>` to check for warnings AND load matching fix patterns into context. If warnings exist, fix them in a separate commit IMMEDIATELY BEFORE the commit with actual changes. This applies to every file you touch, including ones discovered mid-implementation — not just the files you planned upfront.</rule>
14+
<rule id="lint-before-change">Before the first edit to ANY file, run `~/.cursor/skills/im/scripts/lint-warnings.sh <files...>` to check for warnings AND load matching fix patterns into context. If warnings exist, fix them in a separate commit IMMEDIATELY BEFORE the commit with actual changes. This applies to every file you touch, including ones discovered mid-implementation — not just the files you planned upfront.</rule>
1515
<rule id="no-manual-formatting">Do not manually fix formatting. `lint-commit.sh` runs `eslint --fix` (which includes Prettier) before committing. If you see a formatting lint after editing, do NOT make another edit to fix it.</rule>
1616
<rule id="commit-script">Always commit using `~/.cursor/skills/lint-commit.sh -m "message" [files...]` or `--fixup <hash>` for fixup commits.</rule>
1717
<rule id="clean-history">The final commit history must read as a clean, straight-line progression — as if every decision was made correctly up front. Never preserve the "squiggly path" of development (adding then removing code, temporary scaffolding, exploratory commits). If you introduce something in commit A and remove it in commit B, restructure so the final history never contains it. Plan commits proactively to avoid this; when it happens anyway, restructure the branch before finishing.</rule>
1818
<rule id="no-script-bypass">If a companion script fails, report the error and STOP. Do NOT fall back to raw `gh`, `curl`, or other workarounds.</rule>
19-
<rule id="script-timeouts">`asana-get-context.sh` can take up to 90s. Always set `block_until_ms: 120000` when invoking it to avoid unnecessary backgrounding and polling.</rule>
19+
<rule id="script-timeouts">`asana-get-context.sh` can take up to 90s and `install-deps.sh` can exceed 10s on repo prepare steps. Always use at least a 120000ms timeout for these scripts to avoid false failures from client-side time limits.</rule>
2020
</rules>
2121

2222
<step id="0" name="Planning handoff via /asana-plan">
@@ -34,7 +34,7 @@ If the task describes a regression (e.g. "broke in version X", "stopped working
3434
1. **Identify the breaking commit** using `git log`, `git bisect`, or version tag comparison. Don't take the reported version from the task at face value — verify by examining the actual commit history.
3535
2. **Review the original change's full intent.** Find the associated PR and any linked tasks/discussions. The regression-causing commit likely had legitimate goals (performance, refactoring, new features). Understand ALL of its intended effects, not just the one that broke.
3636
3. **Ensure the fix preserves the original intent.** The fix must not undo the beneficial changes introduced by the regression commit. If the fix conflicts with the original intent, flag this to the user with tradeoffs before proceeding.
37-
</step>
37+
</step>
3838

3939
<step id="1" name="Branch setup">
4040
After Step 0 determines the target repo (or if no Asana task, use the current repo):
@@ -47,7 +47,7 @@ After Step 0 determines the target repo (or if no Asana task, use the current re
4747
- **On the correct feature branch**: Continue.
4848
3. **Branch naming**: `$GIT_BRANCH_PREFIX/<short-description>` or `$GIT_BRANCH_PREFIX/fix/<short-description>` for bug fixes. Use kebab-case. Example: `<prefix>/some-feature` or `<prefix>/fix/some-bug`
4949
4. **Assume a new branch is needed** unless the current branch clearly matches the task. Do NOT ask for confirmation — the existing branch has its own committed work and is unaffected.
50-
5. **Install dependencies**: After creating or switching to the feature branch, run `~/.cursor/skills/install-deps.sh` to ensure dependencies match the base branch state.
50+
5. **Install dependencies**: After creating or switching to the feature branch, run `~/.cursor/skills/install-deps.sh` with a timeout of at least 120000ms to ensure dependencies match the base branch state without false timeout failures.
5151

5252
If the task spans multiple repos, note the additional repos but implement in the primary repo first.
5353
</step>
@@ -56,15 +56,17 @@ If the task spans multiple repos, note the additional repos but implement in the
5656
**Before writing ANY code**, run `lint-warnings.sh` on every file you plan to modify:
5757

5858
```bash
59-
scripts/lint-warnings.sh <file1> <file2> ...
59+
~/.cursor/skills/im/scripts/lint-warnings.sh <file1> <file2> ...
6060
```
6161

6262
This script:
63+
6364
1. Runs eslint and shows warnings grouped by rule
6465
2. Outputs matching fix patterns from `~/.cursor/rules/typescript-standards.mdc`
6566
3. Flags unmatched rules that need new patterns added
6667

6768
If warnings exist:
69+
6870
1. Apply fixes using the matched patterns in the output
6971
2. For **unmatched rules**: After fixing, add a new `<pattern id="..." rule="...">` to `typescript-standards.mdc` so future occurrences have guidance
7072
3. Commit lint fixes separately:
@@ -80,7 +82,7 @@ This ensures the subsequent feature commit introduces zero pre-existing warnings
8082
</step>
8183

8284
<step id="3" name="Implementation">
83-
1. **Lint-check newly discovered files**: If you need to modify a file not covered in Step 2, run `scripts/lint-warnings.sh <file>` before editing it. If pre-existing warnings exist, fix them using the matched patterns and commit as a `--fixup` to the lint-fix commit from Step 2 (use `git log --oneline` to find the hash). If no lint-fix commit exists yet, create one.
85+
1. **Lint-check newly discovered files**: If you need to modify a file not covered in Step 2, run `~/.cursor/skills/im/scripts/lint-warnings.sh <file>` before editing it. If pre-existing warnings exist, fix them using the matched patterns and commit as a `--fixup` to the lint-fix commit from Step 2 (use `git log --oneline` to find the hash). If no lint-fix commit exists yet, create one.
8486
2. Break up the feature into multiple commits if necessary. Commit messages should be a concise title without tags like "feat" and a short body.
8587
3. Open relevant ts/tsx files before writing code.
8688
4. Commit using `lint-commit.sh`:
@@ -135,7 +137,7 @@ Other repos only have `## Unreleased` — no staging distinction.
135137
- **Fixup commits exist**: Autosquash with `GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash <base-branch>`. Do this immediately — never leave fixup commits unsquashed.
136138
- **Structural issues** (add-then-remove cycles, misplaced changes, commits that should be squashed, CHANGELOG in intermediate commits): Use scripted `GIT_SEQUENCE_EDITOR` to drop, reorder, or squash commits, resolving conflicts as needed. Verify the final tree matches the pre-restructure state with `git diff`.
137139
- **Git lock conflicts**: VSCode's built-in git integration may race with rebase operations, creating `.git/index.lock` files. Always run `rm -f .git/index.lock` before any `git rebase` command to prevent stalls. If a rebase step fails with "index.lock: File exists", remove the lock and `git rebase --continue`.
138-
</step>
140+
</step>
139141

140142
<step id="5" name="Verification">
141143
Run full verification to catch issues that per-commit checks (`lint-commit.sh`) may have missed (e.g. transitive snapshot breakage, type errors across files):

0 commit comments

Comments
 (0)