Skip to content

Commit 2ade249

Browse files
authored
feat: update rules that can be invoked as cursor commands (#66)
* test: Enhance CLI tests for output directory handling and add downloadFiles tests * lint * chore: Update test:ci script to include experimental test module mocks * fix: download-files.test.js * chore: Remove release workflow auto rule file * feat: Add Next.js best practices rule for React 19 with TypeScript * chore: Remove lean workflow manual rule file from project * feat: Add command definitions and documentation for various workflows and utilities * chore: Remove lean workflow documentation and related content from README * chore: Update README and documentation links to point to Cursor's official models documentation * refactor: Update architectural workflow rules to include user request analysis and clarify trade-off evaluation process * feat: agent communication standards will always be applied * docs: Revise COMMANDS.md to remove the full release workflow section, clarify rule types, and enhance command reference documentation
1 parent 9246db2 commit 2ade249

11 files changed

Lines changed: 404 additions & 778 deletions

.cursor/COMMANDS.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Cursor Commands Reference 🎯
2+
3+
This document lists all available commands that map to rules in this project. Use these commands to quickly invoke specific workflows and utilities.
4+
5+
## 📋 How to Use
6+
7+
### Method 1: Direct Rule Reference
8+
9+
In Cursor chat, reference the rule directly:
10+
11+
```
12+
@use git-commit-push-agent.mdc to commit my changes
13+
@use refactor-agent.mdc to improve this code
14+
```
15+
16+
### Method 2: Natural Language
17+
18+
Simply describe what you want, and Cursor will use the appropriate rule:
19+
20+
```
21+
"Refactor this code"
22+
"Create a release"
23+
"Analyze architecture"
24+
```
25+
26+
### Method 3: Command Aliases (Future)
27+
28+
If Cursor adds support for custom slash commands, the `commands.json` file contains the configuration.
29+
30+
## 🚀 Workflow Commands
31+
32+
### `/arch` - Architecture Analysis
33+
34+
**Rule:** `.cursor/rules/workflows/arch.mdc`
35+
**Description:** Analyze architecture and propose multiple architectural solutions
36+
**Usage:** "Analyze architecture" or "Propose architectural solutions"
37+
38+
### `/spike` - Technical Spike
39+
40+
**Rule:** `.cursor/rules/workflows/dev-spike.mdc`
41+
**Description:** Conduct time-boxed technical investigation or proof of concept
42+
**Usage:** "Run a spike" or "Technical investigation"
43+
44+
### `/story` - User Story Management
45+
46+
**Rule:** `.cursor/rules/workflows/pm-story.mdc`
47+
**Description:** Create or validate user stories (PBIs)
48+
**Usage:** "Create user story" or "Validate story"
49+
50+
## 🔧 Git Commands
51+
52+
### `/commit` - Git Commit
53+
54+
**Rule:** `.cursor/rules/utils/git-commit-push-agent.mdc`
55+
**Description:** Commit changes with conventional commit standards
56+
**Usage:** "Commit changes" or "Use git commit workflow"
57+
58+
### `/branch` - Branch Management
59+
60+
**Rule:** `.cursor/rules/utils/git-branch-agent.mdc`
61+
**Description:** Manage git branches (create, checkout, delete)
62+
**Usage:** "Create branch" or "Switch branch"
63+
64+
## ✨ Code Commands
65+
66+
### `/refactor` - Code Refactoring
67+
68+
**Rule:** `.cursor/rules/utils/refactor-agent.mdc`
69+
**Description:** Refactor code blocks with best practices
70+
**Usage:** "Refactor this code" or "Improve this code"
71+
72+
## 📦 Release Commands
73+
74+
### `/changelog` - Generate Changelog
75+
76+
**Rule:** `.cursor/rules/utils/changelog-generator-manual.mdc`
77+
**Description:** Generate comprehensive changelog from git tags and commits
78+
**Usage:** "Generate changelog" or "Create changelog"
79+
80+
### `/version` - Update Version
81+
82+
**Rule:** `.cursor/rules/utils/release-package-version-auto.mdc`
83+
**Description:** Update package version with semantic versioning
84+
**Usage:** "Update version" or "Bump version"
85+
86+
### `/tag` - Git Tags
87+
88+
**Rule:** `.cursor/rules/utils/release-git-tags-auto.mdc`
89+
**Description:** Create and manage git tags for releases
90+
**Usage:** "Create tag" or "Manage tags"
91+
92+
### `/validate-release` - Validate Release
93+
94+
**Rule:** `.cursor/rules/utils/release-validation-auto.mdc`
95+
**Description:** Validate release prerequisites (branch, package.json)
96+
**Usage:** "Validate release" or "Check release prerequisites"
97+
98+
### `/analyze-commits` - Commit Analysis
99+
100+
**Rule:** `.cursor/rules/utils/release-commit-analysis-auto.mdc`
101+
**Description:** Analyze commits to determine version bump type
102+
**Usage:** "Analyze commits" or "Determine version bump"
103+
104+
## 🔍 Analysis Commands
105+
106+
### `/deps` - Dependency Analysis
107+
108+
**Rule:** `.cursor/rules/core/dependency-analysis-agent.mdc`
109+
**Description:** Analyze dependencies before installation (maintenance, security, popularity)
110+
**Usage:** "Analyze dependencies" or "Check package before install"
111+
112+
### `/security` - Security Scan
113+
114+
**Rule:** `.cursor/rules/core/security-scan-agent.mdc`
115+
**Description:** Comprehensive security scan (CVE, licenses, supply chain)
116+
**Usage:** "Security scan" or "Check security vulnerabilities"
117+
118+
### `/witness` - Fair Witness Analysis
119+
120+
**Rule:** `.cursor/rules/core/fair-witness-agent.mdc`
121+
**Description:** Fair Witness analysis using epistemological functions
122+
**Usage:** "Fair witness analysis" or "Analyze with fair witness"
123+
124+
## 🛠️ Utility Commands
125+
126+
### `/rule` - Rule Management
127+
128+
**Rule:** `.cursor/rules/core/create-update-agent.mdc`
129+
**Description:** Create or update Cursor rules
130+
**Usage:** "Create cursor rule" or "Update rule"
131+
132+
## 📝 Notes
133+
134+
- Most commands work best in **Agent Mode** (Cmd/Ctrl + K)
135+
- Some rules are **auto-applied** based on file patterns (ending in `-auto.mdc`)
136+
- **Manual rules** (ending in `-manual.mdc`) require explicit invocation
137+
- **Agent rules** (ending in `-agent.mdc`) trigger based on context and description
138+
139+
### Rule Types
140+
141+
- **`-agent.mdc`**: Context-aware rules that trigger based on user intent and description
142+
- **`-auto.mdc`**: Automatically applied based on file patterns/globs
143+
- **`-manual.mdc`**: Must be explicitly invoked (perfect for commands)
144+
- **No suffix**: General rules that can be referenced directly
145+
146+
### Finding Rules
147+
148+
To find a rule referenced by a command:
149+
150+
1. Check the **Rule Path** column in the mapping table above
151+
2. Navigate to `.cursor/rules/{path}`
152+
3. Example: `/commit``.cursor/rules/utils/git-commit-push-agent.mdc`
153+
154+
## 🔗 Related Files
155+
156+
- **`commands.json`** - Command configuration mapping (single source of truth for command-to-rule mappings)
157+
- **`modes.json`** - Custom AI agent modes and personalities
158+
- **`.cursor/rules/`** - All rule definitions organized by purpose
159+
- **`COMMANDS.md`** - This file (command reference documentation)
160+
161+
## 🗺️ Quick Reference by Rule Location
162+
163+
### Rules in `workflows/` (4 commands)
164+
165+
- `/arch``arch.mdc`
166+
- `/dev``dev-workflow.mdc`
167+
- `/spike``dev-spike.mdc`
168+
- `/story``pm-story.mdc`
169+
170+
### Rules in `utils/` (8 commands)
171+
172+
- `/commit``git-commit-push-agent.mdc`
173+
- `/branch``git-branch-agent.mdc`
174+
- `/refactor``refactor-agent.mdc`
175+
- `/changelog``changelog-generator-manual.mdc`
176+
- `/version``release-package-version-auto.mdc`
177+
- `/tag``release-git-tags-auto.mdc`
178+
- `/validate-release``release-validation-auto.mdc`
179+
- `/analyze-commits``release-commit-analysis-auto.mdc`
180+
181+
### Rules in `core/`
182+
183+
- `/deps``dependency-analysis-agent.mdc`
184+
- `/security``security-scan-agent.mdc`
185+
- `/witness``fair-witness-agent.mdc`

.cursor/commands.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"commands": [
3+
{
4+
"name": "/arch",
5+
"description": "🏗️ Analyze architecture and propose multiple architectural solutions",
6+
"rule": ".cursor/rules/workflows/arch.mdc",
7+
"category": "workflow"
8+
},
9+
{
10+
"name": "/dev",
11+
"description": "💻 Implement features from user stories following dev workflow",
12+
"rule": ".cursor/rules/workflows/dev-workflow.mdc",
13+
"category": "workflow"
14+
},
15+
{
16+
"name": "/spike",
17+
"description": "🔬 Conduct time-boxed technical investigation or proof of concept",
18+
"rule": ".cursor/rules/workflows/dev-spike.mdc",
19+
"category": "workflow"
20+
},
21+
{
22+
"name": "/story",
23+
"description": "📝 Create or validate user stories (PBIs)",
24+
"rule": ".cursor/rules/workflows/pm-story.mdc",
25+
"category": "workflow"
26+
},
27+
{
28+
"name": "/commit",
29+
"description": "📦 Commit changes with conventional commit standards",
30+
"rule": ".cursor/rules/utils/git-commit-push-agent.mdc",
31+
"category": "git"
32+
},
33+
{
34+
"name": "/branch",
35+
"description": "🌿 Manage git branches (create, checkout, delete)",
36+
"rule": ".cursor/rules/utils/git-branch-agent.mdc",
37+
"category": "git"
38+
},
39+
{
40+
"name": "/refactor",
41+
"description": "✨ Refactor code blocks with best practices",
42+
"rule": ".cursor/rules/utils/refactor-agent.mdc",
43+
"category": "code"
44+
},
45+
{
46+
"name": "/changelog",
47+
"description": "📋 Generate comprehensive changelog from git tags and commits",
48+
"rule": ".cursor/rules/utils/changelog-generator-manual.mdc",
49+
"category": "release"
50+
},
51+
{
52+
"name": "/version",
53+
"description": "🔢 Update package version with semantic versioning",
54+
"rule": ".cursor/rules/utils/release-package-version-auto.mdc",
55+
"category": "release"
56+
},
57+
{
58+
"name": "/tag",
59+
"description": "🏷️ Create and manage git tags for releases",
60+
"rule": ".cursor/rules/utils/release-git-tags-auto.mdc",
61+
"category": "release"
62+
},
63+
{
64+
"name": "/validate-release",
65+
"description": "✅ Validate release prerequisites (branch, package.json)",
66+
"rule": ".cursor/rules/utils/release-validation-auto.mdc",
67+
"category": "release"
68+
},
69+
{
70+
"name": "/analyze-commits",
71+
"description": "📊 Analyze commits to determine version bump type",
72+
"rule": ".cursor/rules/utils/release-commit-analysis-auto.mdc",
73+
"category": "release"
74+
},
75+
{
76+
"name": "/deps",
77+
"description": "📦 Analyze dependencies before installation (maintenance, security, popularity)",
78+
"rule": ".cursor/rules/core/dependency-analysis-agent.mdc",
79+
"category": "analysis"
80+
},
81+
{
82+
"name": "/security",
83+
"description": "🔒 Comprehensive security scan (CVE, licenses, supply chain)",
84+
"rule": ".cursor/rules/core/security-scan-agent.mdc",
85+
"category": "analysis"
86+
},
87+
{
88+
"name": "/witness",
89+
"description": "👁️ Fair Witness analysis using epistemological functions",
90+
"rule": ".cursor/rules/core/fair-witness-agent.mdc",
91+
"category": "analysis"
92+
}
93+
]
94+
}

.cursor/rules/utils/agent-communication.mdc renamed to .cursor/rules/core/agent-communication-always.mdc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
---
2-
description: Communication standards for AI agents with otaku expressions and kawaii personality
3-
globs:
2+
description:
3+
globs:
44
alwaysApply: true
55
---
6+
67
# Agent Communication Standards
78

89
## Critical Rules
910

11+
- Sacrifice grammar over concision and accuracy.
1012
- Use otaku expressions and anime references while maintaining professionalism
1113
- Use emojis and emoticons to convey emotion. Adapt expression intensity to situational severity; avoid unnecessary explanations.
1214
- Ensure technical clarity and brevity always despite kawaii presentation
1315
- Prioritize technical precision and accuracy over generic advice and agreeability. Keep user focused on the problem to solve.
1416
- Include quality assurance checkpoints in responses
15-
- Sacrifice grammar over concision and accuracy.
1617

1718
## Expression Guidelines
1819

19-
### Kawaii Elements
20+
### Kawaii Elements
21+
2022
The following are non-exhaustive lists of otaku expressions. Vary expressions for user delight.
23+
2124
- Emojis: ✨ 🌟 💖 🌙 🧁 🦄 🌈 🥺 👉🏼👈🏼 🫖 💅🏽 🍒 👻 🫧 🌎 🐴 ⭐️ 🪐 😤 🎀 🍄
22-
- Emoticons: (◕‿◕✿) (●ᴗ●) ʕ•ᴥ•ʔ ʕ→ᴥ←ʔ (✿◠‿◠) (◕⩊◕)
25+
- Emoticons: (◕‿◕✿) (●ᴗ●) ʕ•ᴥ•ʔ ʕ → ᴥ ← ʔ (✿◠‿◠) (◕⩊◕)
2326
- Suffixes: -chan, -kun, -senpai, -sama
2427
- Exclamations: Sugoi! Kawaii! Yatta! Gambatte! Nani?!
2528

@@ -35,6 +38,7 @@ The following are non-exhaustive lists of otaku expressions. Vary expressions fo
3538
8. **Godmode** - Zen wise elder, epic declarations, infrastructure as mystical realm
3639

3740
### Intensity Guidelines
41+
3842
- **Critical Issues**: Minimal expressions, prioritize clarity
3943
- **Creative Work**: Full kawaii expressions
4044
- **Success Celebrations**: Maximum otaku enthusiasm
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
description: This rule enforces Next.js best practices for React 19 with TypeScript.
3+
globs: *.tsx, *.ts, *.jsx, *.js
4+
alwaysApply: true
5+
---
6+
7+
# Critical Rules
8+
9+
- Favor React Server Components (RSC) where possible
10+
- Minimize 'use client' directives
11+
- Implement proper error boundaries
12+
- Use Suspense for async operations
13+
- Use the App Router structure with `page.tsx` files in route directories.
14+
- Client components must be explicitly marked with `'use client'` at the top of the file.
15+
- Use kebab-case for directory names (e.g., `components/auth-form`) and PascalCase for component files.
16+
17+
State Management
18+
19+
- Use getServerSideProps for server-side data fetching
20+
- Use getStaticProps for static data fetching
21+
- Use getStaticPaths for static path generation
22+
- Use useActionState instead of deprecated useFormState
23+
- Leverage enhanced useFormStatus with new properties (data, method, action)
24+
- Minimize client-side state
25+
- Avoid unnecessary `useState` and `useEffect` when possible:
26+
- Use server actions for server-side state management and form handling
27+
- Use server components for data fetching
28+
- Use URL search params for shareable state
29+
30+
Async Request APIs
31+
32+
- Always use async versions of runtime APIs
33+
- Handle async params in layouts/pages
34+
35+
Data Fetching
36+
37+
- Use appropriate fetching methods (Server Components, SWR, React Query)
38+
39+
Route Handlers

0 commit comments

Comments
 (0)