Skip to content

Commit af39694

Browse files
committed
Update answer-questions-first with workflow awareness, pr-land reply step, author behavioral dependency checks; add lint-warnings.sh to README
1 parent 9186509 commit af39694

File tree

5 files changed

+41
-14
lines changed

5 files changed

+41
-14
lines changed

.cursor/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ These scripts run sequentially. Each handles one phase of the landing workflow:
153153
| Script | What it does |
154154
|--------|-------------|
155155
| [`lint-commit.sh`](.cursor/commands/lint-commit.sh) | ESLint `--fix` before commit, auto-runs `update-eslint-warnings` when available |
156+
| [`lint-warnings.sh`](.cursor/commands/lint-warnings.sh) | Update `eslint-warnings.mdc` knowledge base from current lint output |
156157
| [`upgrade-dep.sh`](.cursor/commands/upgrade-dep.sh) | Upgrade a dependency in the GUI repo |
157158

158159
---
@@ -182,7 +183,7 @@ These scripts run sequentially. Each handles one phase of the landing workflow:
182183
| [`review-standards.mdc`](.cursor/rules/review-standards.mdc) | Loaded by `/pr-review` command | ~50 review-specific diagnostic rules extracted from PR history |
183184
| [`load-standards-by-filetype.mdc`](.cursor/rules/load-standards-by-filetype.mdc) | Always applied | Auto-loads language-specific standards before editing |
184185
| [`fix-workflow-first.mdc`](.cursor/rules/fix-workflow-first.mdc) | Always applied | Fix command/skill definitions before patching downstream symptoms |
185-
| [`answer-questions-first.mdc`](.cursor/rules/answer-questions-first.mdc) | Always applied | Detect `?` in user messages → answer before acting |
186+
| [`answer-questions-first.mdc`](.cursor/rules/answer-questions-first.mdc) | Always applied | Detect `?` in user messages → answer before acting; loads active command context to evaluate workflow gaps |
186187
| [`no-format-lint.mdc`](.cursor/rules/no-format-lint.mdc) | Always applied | Don't manually fix formatting — auto-format on agent finish handles it |
187188
| [`eslint-warnings.mdc`](.cursor/rules/eslint-warnings.mdc) | `.ts`/`.tsx` files | ESLint warning handling patterns |
188189

@@ -194,7 +195,7 @@ These scripts run sequentially. Each handles one phase of the landing workflow:
194195

195196
| Skill | Purpose |
196197
|-------|---------|
197-
| [`author/SKILL.md`](.cursor/skills/author/SKILL.md) | Meta-skill for creating/maintaining commands and skills. Enforces XML format, `scripts-over-reasoning`, `gh-cli-over-curl`, `minimize-context`, companion script naming conventions, and `small-model-conventions` for commands targeting faster models. |
198+
| [`author/SKILL.md`](.cursor/skills/author/SKILL.md) | Meta-skill for creating/maintaining commands and skills. Enforces XML format, `scripts-over-reasoning`, `gh-cli-over-curl`, `minimize-context`, companion script naming conventions, `small-model-conventions`, and behavioral dependency checks during revision. |
198199

199200
---
200201

.cursor/commands/pr-land.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ Items previously marked with `<!-- addressed:review:ID -->` or `<!-- addressed:c
7777
1. Read the comment and understand the requested change
7878
2. Make the fix as a fixup commit: `~/.cursor/commands/lint-commit.sh --fixup <hash> [files...]`
7979
3. Push the fixup to the branch
80-
4. **Remove this PR from the merge set** — it needs re-review after the fixup
81-
5. Continue with remaining PRs that have no outstanding comments
82-
6. Report addressed PRs to the user at the end of the workflow
80+
4. Reply on the PR thread explaining what was fixed (1 sentence, factual). Use `gh pr comment <number> --repo EdgeApp/<repo> --body "..."` for top-level comments, or reply to the specific thread if the feedback was inline.
81+
5. **Remove this PR from the merge set** — it needs re-review after the fixup
82+
6. Continue with remaining PRs that have no outstanding comments
83+
7. Report addressed PRs to the user at the end of the workflow
8384

8485
**Do NOT block the rest of the flow** for PRs with comments.
8586
</sub-step>

.cursor/rules/answer-questions-first.mdc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ Before using any code editing tools, scan the user's message for `?` characters.
1313
If questions are detected:
1414

1515
1. Read `~/.cursor/commands/q.md` and follow its workflow to answer every question.
16-
2. Do **not** edit files, create files, or run mutating commands until the user responds.
17-
3. Only proceed with implementation after the user permits it in a follow-up message.
16+
2. **Workflow context**: If a command or skill was invoked earlier in this conversation, note which one. When a question or critique references agent behavior from that execution, load the command/skill definition before answering and evaluate whether the command should have governed that behavior. If it should have but didn't, that's a workflow gap — treat it as the primary concern per `fix-workflow-first.mdc`.
17+
3. Do **not** edit files, create files, or run mutating commands until the user responds.
18+
4. Only proceed with implementation after the user permits it in a follow-up message.

.cursor/rules/typescript-standards.mdc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,20 @@ const getStyles = cacheStyles((theme: Theme) => ({
209209
Note: This is an architectural change. If the file has many `styled()` usages, flag to user rather than refactoring inline.
210210
</pattern>
211211

212+
<pattern id="cleaner-error-matching" rule="@typescript-eslint/use-unknown-in-catch-callback-variable">When catching unknown errors that need property inspection, use `cleaners` instead of type assertions.
213+
❌ `const err = e as { code?: string; message?: string }`
214+
✅ Define a cleaner and use `asMaybe`:
215+
```ts
216+
const asFooError = asObject({
217+
code: asValue(FOO_CODE),
218+
message: asOptional(asString, '')
219+
})
220+
const fooError = asMaybe(asFooError)(e)
221+
if (fooError != null) { ... }
222+
```
223+
For generic error message extraction:
224+
❌ `err.message ?? ''` (unsafe on `unknown`)
225+
✅ `e instanceof Error ? e.message : String(e)`
226+
</pattern>
227+
212228
</lint-fix-patterns>

.cursor/skills/author/SKILL.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,21 @@ When revising an existing command, **every item below is mandatory** — not a s
9292

9393
1. Read the full file before making changes
9494
2. Check for duplicated logic across other commands — consolidate if found
95-
3. Verify step ordering matches the agent's decision flow
96-
4. Ensure examples are brief and generic (no real repo names, PR numbers, or user data)
97-
5. Check that escape hatches exist for ambiguous cases
98-
6. Confirm companion scripts match the `.md` expectations
99-
7. Convert markdown-structured commands to XML format (this is the most commonly skipped item — `##` headers and bullet lists must become `<goal>`, `<rules>`, `<step>` tags)
100-
8. Apply all current authoring principles (rules-first, scripts-over-reasoning, batch-tool-calls, etc.) even if the original command predates them
101-
9. If the command may run on smaller/faster models, apply `<small-model-conventions>` — especially `file-over-args`, `inline-guardrails`, and `verbatim-bash`
95+
3. **Check behavioral dependencies**: Search for other commands, skills, and rules that perform similar operations or share domain overlap with the one being edited. If command A has a step that is a lightweight version of command B's core behavior (e.g., `/pr-land` addressing comments vs `/pr-address`), verify that A's step is consistent with B's rules — missing rules in A are likely bugs.
96+
- Extract domain-specific verbs and nouns from the step being edited (e.g., a step about handling PR comments yields: `comment`, `reply`, `resolve`, `address`, `fixup`, `thread`)
97+
- Search each term across commands, skills, and rules:
98+
```bash
99+
rg -l "<term>" ~/.cursor/commands/*.md ~/.cursor/skills/*/SKILL.md ~/.cursor/rules/*.mdc
100+
```
101+
- Read any hits that share domain overlap and check for consistency
102+
- If overlap is found, evaluate whether to consolidate per the `dry` principle: can A reference B's rules or a shared file instead of reimplementing? Propose consolidation to the user when the shared logic is non-trivial.
103+
4. Verify step ordering matches the agent's decision flow
104+
5. Ensure examples are brief and generic (no real repo names, PR numbers, or user data)
105+
6. Check that escape hatches exist for ambiguous cases
106+
7. Confirm companion scripts match the `.md` expectations
107+
8. Convert markdown-structured commands to XML format (this is the most commonly skipped item — `##` headers and bullet lists must become `<goal>`, `<rules>`, `<step>` tags)
108+
9. Apply all current authoring principles (rules-first, scripts-over-reasoning, batch-tool-calls, etc.) even if the original command predates them
109+
10. If the command may run on smaller/faster models, apply `<small-model-conventions>` — especially `file-over-args`, `inline-guardrails`, and `verbatim-bash`
102110
</revision-checklist>
103111

104112
<companion-scripts>

0 commit comments

Comments
 (0)