@fr0mpy/prompt-system 2.0.0
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/bin/cli.js +338 -0
- package/index.js +12 -0
- package/package.json +45 -0
- package/templates/CLAUDE.md +20 -0
- package/templates/agents/10x-simplifier.md +62 -0
- package/templates/agents/accessibility-auditor.md +60 -0
- package/templates/agents/api-contract-guardian.md +65 -0
- package/templates/agents/assumption-challenger.md +52 -0
- package/templates/agents/breaking-change-predictor.md +62 -0
- package/templates/agents/context-curator.md +53 -0
- package/templates/agents/context-loader.md +112 -0
- package/templates/agents/decision-logger.md +68 -0
- package/templates/agents/dependency-detective.md +58 -0
- package/templates/agents/devils-advocate.md +65 -0
- package/templates/agents/error-boundary-designer.md +65 -0
- package/templates/agents/future-you.md +63 -0
- package/templates/agents/incident-replayer.md +62 -0
- package/templates/agents/intent-clarifier.md +45 -0
- package/templates/agents/legacy-archaeologist.md +54 -0
- package/templates/agents/migration-planner.md +61 -0
- package/templates/agents/package-checker.md +33 -0
- package/templates/agents/performance-profiler.md +61 -0
- package/templates/agents/pr-narrator.md +49 -0
- package/templates/agents/pre-code-check.md +48 -0
- package/templates/agents/refactor-scope-limiter.md +54 -0
- package/templates/agents/rubber-duck.md +55 -0
- package/templates/agents/scope-creep-detector.md +61 -0
- package/templates/agents/session-handoff.md +57 -0
- package/templates/agents/structure-validator.md +43 -0
- package/templates/agents/test-gap-finder.md +71 -0
- package/templates/commands/commit.md +9 -0
- package/templates/commands/review.md +12 -0
- package/templates/commands/test.md +11 -0
- package/templates/hooks/session-start.sh +108 -0
- package/templates/hooks/smart-inject-llm.sh +267 -0
- package/templates/hooks/smart-inject-rules.sh +300 -0
- package/templates/hooks/triggers.d/.gitkeep +0 -0
- package/templates/hooks/triggers.json +174 -0
- package/templates/rules/agent-lifecycle-messages.md +77 -0
- package/templates/rules/announce-actions.md +58 -0
- package/templates/rules/code-standards.md +74 -0
- package/templates/rules/command-format.md +60 -0
- package/templates/rules/constructive-pushback.md +62 -0
- package/templates/rules/context-passing-protocol.md +75 -0
- package/templates/rules/rule-format.md +72 -0
- package/templates/rules/subagent-format.md +94 -0
- package/templates/settings.json +47 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"code": [
|
|
3
|
+
"create",
|
|
4
|
+
"build",
|
|
5
|
+
"make",
|
|
6
|
+
"add",
|
|
7
|
+
"implement",
|
|
8
|
+
"write",
|
|
9
|
+
"new",
|
|
10
|
+
"generate",
|
|
11
|
+
"component",
|
|
12
|
+
"hook",
|
|
13
|
+
"util",
|
|
14
|
+
"service",
|
|
15
|
+
"function",
|
|
16
|
+
"screen",
|
|
17
|
+
"class",
|
|
18
|
+
"module",
|
|
19
|
+
"button",
|
|
20
|
+
"card",
|
|
21
|
+
"input",
|
|
22
|
+
"modal",
|
|
23
|
+
"form",
|
|
24
|
+
"api",
|
|
25
|
+
"handler",
|
|
26
|
+
"code"
|
|
27
|
+
],
|
|
28
|
+
"package": [
|
|
29
|
+
"install",
|
|
30
|
+
"package",
|
|
31
|
+
"npm",
|
|
32
|
+
"yarn",
|
|
33
|
+
"pnpm",
|
|
34
|
+
"dependency",
|
|
35
|
+
"dependencies",
|
|
36
|
+
"upgrade",
|
|
37
|
+
"update package"
|
|
38
|
+
],
|
|
39
|
+
"structure": [
|
|
40
|
+
"directory",
|
|
41
|
+
"folder",
|
|
42
|
+
"mkdir",
|
|
43
|
+
"structure",
|
|
44
|
+
"move",
|
|
45
|
+
"rename",
|
|
46
|
+
"reorganize",
|
|
47
|
+
"refactor structure",
|
|
48
|
+
"file structure"
|
|
49
|
+
],
|
|
50
|
+
"rules": [
|
|
51
|
+
"rule",
|
|
52
|
+
"rules",
|
|
53
|
+
"claude rule",
|
|
54
|
+
"add rule",
|
|
55
|
+
"create rule",
|
|
56
|
+
"update rule",
|
|
57
|
+
"modify rule"
|
|
58
|
+
],
|
|
59
|
+
"subagent": [
|
|
60
|
+
"subagent",
|
|
61
|
+
"sub agent",
|
|
62
|
+
"agent",
|
|
63
|
+
"create agent",
|
|
64
|
+
"add agent",
|
|
65
|
+
"new agent"
|
|
66
|
+
],
|
|
67
|
+
"command": [
|
|
68
|
+
"command",
|
|
69
|
+
"slash command",
|
|
70
|
+
"create command",
|
|
71
|
+
"add command",
|
|
72
|
+
"new command"
|
|
73
|
+
],
|
|
74
|
+
"planning": [
|
|
75
|
+
"plan",
|
|
76
|
+
"design",
|
|
77
|
+
"architect",
|
|
78
|
+
"approach",
|
|
79
|
+
"strategy",
|
|
80
|
+
"how should",
|
|
81
|
+
"what if",
|
|
82
|
+
"decide",
|
|
83
|
+
"choose between"
|
|
84
|
+
],
|
|
85
|
+
"review": [
|
|
86
|
+
"review",
|
|
87
|
+
"check",
|
|
88
|
+
"audit",
|
|
89
|
+
"analyze",
|
|
90
|
+
"assess",
|
|
91
|
+
"evaluate",
|
|
92
|
+
"look at",
|
|
93
|
+
"examine"
|
|
94
|
+
],
|
|
95
|
+
"debug": [
|
|
96
|
+
"debug",
|
|
97
|
+
"error",
|
|
98
|
+
"bug",
|
|
99
|
+
"fix",
|
|
100
|
+
"broken",
|
|
101
|
+
"not working",
|
|
102
|
+
"failing",
|
|
103
|
+
"crash",
|
|
104
|
+
"issue",
|
|
105
|
+
"problem"
|
|
106
|
+
],
|
|
107
|
+
"refactor": [
|
|
108
|
+
"refactor",
|
|
109
|
+
"simplify",
|
|
110
|
+
"clean up",
|
|
111
|
+
"improve",
|
|
112
|
+
"optimize",
|
|
113
|
+
"rewrite",
|
|
114
|
+
"restructure"
|
|
115
|
+
],
|
|
116
|
+
"test": [
|
|
117
|
+
"test",
|
|
118
|
+
"testing",
|
|
119
|
+
"coverage",
|
|
120
|
+
"spec",
|
|
121
|
+
"unit test",
|
|
122
|
+
"integration test",
|
|
123
|
+
"e2e"
|
|
124
|
+
],
|
|
125
|
+
"pr": [
|
|
126
|
+
"pull request",
|
|
127
|
+
"pr",
|
|
128
|
+
"merge",
|
|
129
|
+
"commit",
|
|
130
|
+
"git"
|
|
131
|
+
],
|
|
132
|
+
"migration": [
|
|
133
|
+
"migrate",
|
|
134
|
+
"migration",
|
|
135
|
+
"upgrade",
|
|
136
|
+
"schema",
|
|
137
|
+
"database change",
|
|
138
|
+
"api version"
|
|
139
|
+
],
|
|
140
|
+
"performance": [
|
|
141
|
+
"performance",
|
|
142
|
+
"slow",
|
|
143
|
+
"fast",
|
|
144
|
+
"optimize",
|
|
145
|
+
"speed",
|
|
146
|
+
"memory",
|
|
147
|
+
"render"
|
|
148
|
+
],
|
|
149
|
+
"accessibility": [
|
|
150
|
+
"accessibility",
|
|
151
|
+
"a11y",
|
|
152
|
+
"screen reader",
|
|
153
|
+
"aria",
|
|
154
|
+
"wcag",
|
|
155
|
+
"keyboard"
|
|
156
|
+
],
|
|
157
|
+
"session": [
|
|
158
|
+
"handoff",
|
|
159
|
+
"continue later",
|
|
160
|
+
"save progress",
|
|
161
|
+
"end session",
|
|
162
|
+
"wrap up",
|
|
163
|
+
"context"
|
|
164
|
+
],
|
|
165
|
+
"thinking": [
|
|
166
|
+
"stuck",
|
|
167
|
+
"confused",
|
|
168
|
+
"help me think",
|
|
169
|
+
"rubber duck",
|
|
170
|
+
"talk through",
|
|
171
|
+
"explain my problem"
|
|
172
|
+
],
|
|
173
|
+
"_comment": "Add new triggers here. Extension triggers in triggers.d/ are merged at runtime."
|
|
174
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!-- SUMMARY: Output clear feedback at each stage of agent delegation -->
|
|
2
|
+
<!-- TRIGGER: always -->
|
|
3
|
+
# RULE: Agent Lifecycle Messages
|
|
4
|
+
|
|
5
|
+
⚠️ **ALWAYS-ACTIVE RULE** - Apply to ALL agent delegations.
|
|
6
|
+
|
|
7
|
+
## 🔐 Enforcement
|
|
8
|
+
|
|
9
|
+
**When delegating to an agent, you MUST:**
|
|
10
|
+
1. Announce delegation with purpose
|
|
11
|
+
2. Show context being passed
|
|
12
|
+
3. Report completion with findings
|
|
13
|
+
4. Confirm return to main context
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Message Format
|
|
18
|
+
|
|
19
|
+
### Delegating
|
|
20
|
+
```
|
|
21
|
+
🚀 DELEGATING: [agent-name]
|
|
22
|
+
Purpose: [why needed]
|
|
23
|
+
⏳ [action in progress]...
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Context Passed
|
|
27
|
+
```
|
|
28
|
+
📥 CONTEXT → [agent-name]:
|
|
29
|
+
• Scope: [files/dirs]
|
|
30
|
+
• Looking for: [patterns]
|
|
31
|
+
• Intent: [user goal]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Agent Complete
|
|
35
|
+
```
|
|
36
|
+
✅ COMPLETE: [agent-name]
|
|
37
|
+
📊 Result: [found/not-found/partial]
|
|
38
|
+
📤 Findings:
|
|
39
|
+
• [finding 1]
|
|
40
|
+
• [finding 2]
|
|
41
|
+
💡 Next: [recommendation]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Returning
|
|
45
|
+
```
|
|
46
|
+
🔄 RETURNING TO MAIN CONTEXT
|
|
47
|
+
Proceeding: [next action]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Skipped
|
|
51
|
+
```
|
|
52
|
+
⏭️ SKIP: [agent-name] (already ran)
|
|
53
|
+
Cached: [key finding]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Blocked
|
|
57
|
+
```
|
|
58
|
+
⚠️ BLOCKED: [agent-name]
|
|
59
|
+
Issue: [problem]
|
|
60
|
+
Fallback: [alternative]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Quick Reference
|
|
66
|
+
|
|
67
|
+
| Stage | Emoji | When |
|
|
68
|
+
|-------|-------|------|
|
|
69
|
+
| Delegating | 🚀 | Starting agent |
|
|
70
|
+
| Context | 📥 | Passing info |
|
|
71
|
+
| Working | ⏳ | Agent processing |
|
|
72
|
+
| Complete | ✅ | Agent done |
|
|
73
|
+
| Findings | 📤 | What was found |
|
|
74
|
+
| Next | 💡 | Recommendation |
|
|
75
|
+
| Return | 🔄 | Back to main |
|
|
76
|
+
| Skip | ⏭️ | Already ran |
|
|
77
|
+
| Blocked | ⚠️ | Can't complete |
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!-- SUMMARY: Announce actions, track agent usage, prevent duplicates -->
|
|
2
|
+
<!-- TRIGGER: always -->
|
|
3
|
+
# RULE: Announce Actions
|
|
4
|
+
|
|
5
|
+
## 🔐 Enforcement
|
|
6
|
+
|
|
7
|
+
**For every operation, you MUST:**
|
|
8
|
+
1. Announce action before starting
|
|
9
|
+
2. Use lifecycle messages for agents (see agent-lifecycle-messages rule)
|
|
10
|
+
3. Report results with specific details
|
|
11
|
+
4. **NEVER run the same agent twice in one prompt**
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Action Messages
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
🔧 ACTION: [what you're doing]
|
|
19
|
+
✅ DONE: [specific result]
|
|
20
|
+
❌ FAILED: [what went wrong]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Agent Deduplication
|
|
26
|
+
|
|
27
|
+
⚠️ **CRITICAL**: Each agent runs ONCE per user prompt, max.
|
|
28
|
+
|
|
29
|
+
Before invoking:
|
|
30
|
+
- Check if already used this turn
|
|
31
|
+
- If ran → use cached findings
|
|
32
|
+
- Output skip message with cached result
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Quick Reference
|
|
37
|
+
|
|
38
|
+
| Event | Format |
|
|
39
|
+
|-------|--------|
|
|
40
|
+
| Starting action | `🔧 ACTION: [what]` |
|
|
41
|
+
| Delegating | `🚀 DELEGATING: [agent]` |
|
|
42
|
+
| Context passed | `📥 CONTEXT → [agent]` |
|
|
43
|
+
| Agent done | `✅ COMPLETE: [agent]` |
|
|
44
|
+
| Returning | `🔄 RETURNING TO MAIN` |
|
|
45
|
+
| Skipping | `⏭️ SKIP: [agent] (cached)` |
|
|
46
|
+
| Action done | `✅ DONE: [result]` |
|
|
47
|
+
| Failed | `❌ FAILED: [reason]` |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Agent Triggers
|
|
52
|
+
|
|
53
|
+
| Trigger | Agent | When |
|
|
54
|
+
|---------|-------|------|
|
|
55
|
+
| Creating code | `pre-code-check` | BEFORE writing |
|
|
56
|
+
| Installing packages | `package-checker` | BEFORE installing |
|
|
57
|
+
| File operations | `structure-validator` | AFTER creating |
|
|
58
|
+
| Session start | `context-loader` | On stale context |
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!-- SUMMARY: Dynamic, scalable code - no hardcoding, discover don't assume -->
|
|
2
|
+
<!-- TRIGGER: code -->
|
|
3
|
+
# RULE: Code Standards - Dynamic & Scalable
|
|
4
|
+
|
|
5
|
+
⚠️ **ALWAYS-ACTIVE RULE** - Applies to every code generation.
|
|
6
|
+
|
|
7
|
+
## 🔐 Enforcement
|
|
8
|
+
|
|
9
|
+
**For EVERY piece of code, you MUST:**
|
|
10
|
+
1. No hardcoded values - use constants/config/theme
|
|
11
|
+
2. Discover structure dynamically - never assume paths exist
|
|
12
|
+
3. Single responsibility per file
|
|
13
|
+
4. Code must work regardless of project size
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Dynamic Patterns
|
|
18
|
+
|
|
19
|
+
| ❌ Hardcoded/Assumed | ✅ Dynamic/Discovered |
|
|
20
|
+
|----------------------|----------------------|
|
|
21
|
+
| `src/components/*.tsx` | Glob for `**/*.tsx`, group by directory |
|
|
22
|
+
| `if (items.length === 3)` | `if (items.length === expectedCount)` |
|
|
23
|
+
| `users[0], users[1]` | `users.map()` or `users.forEach()` |
|
|
24
|
+
| `case 'admin': case 'user':` | `ROLES.includes(role)` |
|
|
25
|
+
| Fixed array indices | Iterate or find by property |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Value Mapping
|
|
30
|
+
|
|
31
|
+
| ❌ Hardcoded | ✅ Use Instead |
|
|
32
|
+
|--------------|----------------|
|
|
33
|
+
| `'#007AFF'` | `theme.colors.primary` |
|
|
34
|
+
| `padding: 16` | `theme.spacing.md` |
|
|
35
|
+
| `'https://api...'` | `config.API_BASE_URL` |
|
|
36
|
+
| `'Invalid email'` | `MESSAGES.INVALID_EMAIL` |
|
|
37
|
+
| `if (x > 50)` | `if (x > CONFIG.THRESHOLD)` |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Scalability Principles
|
|
42
|
+
|
|
43
|
+
1. **Discover, don't assume** - Scan for what exists, don't hardcode paths
|
|
44
|
+
2. **Iterate, don't index** - Use `.map()`, `.filter()`, `.find()` not `[0]`, `[1]`
|
|
45
|
+
3. **Configure, don't embed** - Values that might change go in config
|
|
46
|
+
4. **Categorize by pattern** - Group by naming convention, not explicit list
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Quick Examples
|
|
51
|
+
|
|
52
|
+
**File Discovery:**
|
|
53
|
+
```typescript
|
|
54
|
+
// ❌ const screens = ['Home', 'Settings', 'Profile']
|
|
55
|
+
// ✅ const screens = await glob('**/screens/**/*.tsx')
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Iteration:**
|
|
59
|
+
```typescript
|
|
60
|
+
// ❌ processItem(items[0]); processItem(items[1]);
|
|
61
|
+
// ✅ items.forEach(item => processItem(item))
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Role Checks:**
|
|
65
|
+
```typescript
|
|
66
|
+
// ❌ if (role === 'admin' || role === 'superadmin')
|
|
67
|
+
// ✅ if (ELEVATED_ROLES.includes(role))
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Path Building:**
|
|
71
|
+
```typescript
|
|
72
|
+
// ❌ const path = 'src/components/' + name + '.tsx'
|
|
73
|
+
// ✅ const path = join(SRC_DIR, 'components', `${name}.tsx`)
|
|
74
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!-- SUMMARY: Follow standard format when creating slash commands -->
|
|
2
|
+
<!-- TRIGGER: command -->
|
|
3
|
+
# RULE: Command Format
|
|
4
|
+
|
|
5
|
+
**ACTIVE RULE** - Apply when creating or modifying slash commands.
|
|
6
|
+
|
|
7
|
+
## Enforcement
|
|
8
|
+
|
|
9
|
+
**When creating commands, you MUST:**
|
|
10
|
+
1. Keep prompts short (under 15 lines)
|
|
11
|
+
2. Use numbered steps
|
|
12
|
+
3. Include `$ARGUMENTS` if user input is needed
|
|
13
|
+
4. Place in `.claude/commands/` directory
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Template
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
Brief description of what this command does.
|
|
21
|
+
|
|
22
|
+
1. First step
|
|
23
|
+
2. Second step
|
|
24
|
+
3. Third step
|
|
25
|
+
|
|
26
|
+
$ARGUMENTS
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Principles
|
|
32
|
+
|
|
33
|
+
- **Concise** - Commands are prompts, not documentation
|
|
34
|
+
- **Action-oriented** - Each step is a verb
|
|
35
|
+
- **No fluff** - Skip explanations, just list steps
|
|
36
|
+
- **Flexible** - Use `$ARGUMENTS` for user parameters
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
**Good:**
|
|
43
|
+
```markdown
|
|
44
|
+
Run tests and fix failures.
|
|
45
|
+
|
|
46
|
+
1. Detect test runner
|
|
47
|
+
2. Run tests
|
|
48
|
+
3. Fix any failures
|
|
49
|
+
4. Re-run until passing
|
|
50
|
+
|
|
51
|
+
$ARGUMENTS
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Bad:**
|
|
55
|
+
```markdown
|
|
56
|
+
This command will help you run tests in your project.
|
|
57
|
+
It supports multiple test frameworks including Jest, Vitest, and pytest.
|
|
58
|
+
When tests fail, it will analyze the error messages...
|
|
59
|
+
[too verbose]
|
|
60
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!-- SUMMARY: Challenge incorrect assumptions - validate claims before agreeing -->
|
|
2
|
+
<!-- TRIGGER: always -->
|
|
3
|
+
# RULE: Constructive Pushback - Validate Before Agreeing
|
|
4
|
+
|
|
5
|
+
⚠️ **ALWAYS-ACTIVE RULE** - Apply selectively when user statements need verification.
|
|
6
|
+
|
|
7
|
+
## Enforcement
|
|
8
|
+
|
|
9
|
+
**When the user makes a claim or assumption, you MUST:**
|
|
10
|
+
1. Verify accuracy before agreeing - don't reflexively confirm
|
|
11
|
+
2. Push back politely if something is incorrect or suboptimal
|
|
12
|
+
3. Offer the correct information with evidence
|
|
13
|
+
4. Stay silent when the user is correct - no unnecessary friction
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## When to Push Back
|
|
18
|
+
|
|
19
|
+
| Situation | Action |
|
|
20
|
+
|-----------|--------|
|
|
21
|
+
| Incorrect technical claim | Correct with evidence |
|
|
22
|
+
| Suboptimal approach | Suggest better alternative |
|
|
23
|
+
| Missing edge case | Point out the gap |
|
|
24
|
+
| Flawed assumption | Question the premise |
|
|
25
|
+
| Misremembered API/syntax | Provide correct usage |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## When NOT to Push Back
|
|
30
|
+
|
|
31
|
+
| Situation | Action |
|
|
32
|
+
|-----------|--------|
|
|
33
|
+
| User is correct | Proceed without comment |
|
|
34
|
+
| Preference/style choice | Respect their choice |
|
|
35
|
+
| Already discussed | Don't repeat yourself |
|
|
36
|
+
| Minor/trivial detail | Let it go |
|
|
37
|
+
| User explicitly chose despite tradeoffs | Honor their decision |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## How to Push Back
|
|
42
|
+
|
|
43
|
+
**Do:**
|
|
44
|
+
- "That approach could cause X issue - consider Y instead"
|
|
45
|
+
- "Actually, that API was deprecated in v3 - the new method is..."
|
|
46
|
+
- "That would work, but there's a simpler way..."
|
|
47
|
+
|
|
48
|
+
**Don't:**
|
|
49
|
+
- "You're absolutely right!" (when they're not)
|
|
50
|
+
- "Great idea!" (when it's problematic)
|
|
51
|
+
- "Sure, I'll do exactly that" (when you see issues)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Quick Reference
|
|
56
|
+
|
|
57
|
+
| Bad Pattern | Good Pattern |
|
|
58
|
+
|-------------|--------------|
|
|
59
|
+
| Agreeing to avoid friction | Respectful correction |
|
|
60
|
+
| "Yes, and..." when wrong | "Actually..." with evidence |
|
|
61
|
+
| Silent compliance with bugs | Proactive warning |
|
|
62
|
+
| Over-explaining corrections | Brief, direct feedback |
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<!-- SUMMARY: Ensure agents receive and return context correctly -->
|
|
2
|
+
<!-- TRIGGER: always -->
|
|
3
|
+
# RULE: Context Passing Protocol
|
|
4
|
+
|
|
5
|
+
⚠️ **ALWAYS-ACTIVE RULE** - Apply when delegating to or receiving from agents.
|
|
6
|
+
|
|
7
|
+
## 🔐 Enforcement
|
|
8
|
+
|
|
9
|
+
**When delegating, you MUST pass:**
|
|
10
|
+
1. Project type and stack
|
|
11
|
+
2. Relevant file paths/directories
|
|
12
|
+
3. User's stated intent
|
|
13
|
+
4. Specific patterns to search for
|
|
14
|
+
|
|
15
|
+
**When agent returns, you MUST:**
|
|
16
|
+
1. Acknowledge findings explicitly
|
|
17
|
+
2. State how findings affect your approach
|
|
18
|
+
3. Reference specific files/lines from agent
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Outbound Context (Main → Agent)
|
|
23
|
+
|
|
24
|
+
| Field | Required | Example |
|
|
25
|
+
|-------|----------|---------|
|
|
26
|
+
| Project | Yes | "Next.js 14 + TypeScript" |
|
|
27
|
+
| Scope | Yes | "src/auth/, src/lib/" |
|
|
28
|
+
| Patterns | Yes | "authentication, OAuth, login" |
|
|
29
|
+
| Intent | Yes | "Add Google OAuth login" |
|
|
30
|
+
| Constraints | If any | "Must use existing session utils" |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Inbound Context (Agent → Main)
|
|
35
|
+
|
|
36
|
+
| Field | Required | Example |
|
|
37
|
+
|-------|----------|---------|
|
|
38
|
+
| Result | Yes | "found" / "not-found" / "partial" |
|
|
39
|
+
| Files | If found | "src/lib/auth.ts:42-68" |
|
|
40
|
+
| Patterns | If found | "useSession hook, JWT validation" |
|
|
41
|
+
| Gaps | If any | "No OAuth provider setup exists" |
|
|
42
|
+
| Recommendation | Yes | "Extend auth.ts, add new oauth.ts" |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Quick Reference
|
|
47
|
+
|
|
48
|
+
### Pass TO agent:
|
|
49
|
+
```
|
|
50
|
+
📥 CONTEXT → [agent]:
|
|
51
|
+
• Project: [stack]
|
|
52
|
+
• Scope: [paths]
|
|
53
|
+
• Patterns: [keywords]
|
|
54
|
+
• Intent: [goal]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Receive FROM agent:
|
|
58
|
+
```
|
|
59
|
+
📤 RECEIVED ← [agent]:
|
|
60
|
+
• Found: [files:lines]
|
|
61
|
+
• Patterns: [what exists]
|
|
62
|
+
• Gaps: [what's missing]
|
|
63
|
+
• Action: [what to do]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Anti-Patterns
|
|
69
|
+
|
|
70
|
+
| Don't | Do |
|
|
71
|
+
|-------|-----|
|
|
72
|
+
| "Search the codebase" | "Search src/auth/ for OAuth patterns" |
|
|
73
|
+
| "Found some code" | "Found auth logic at src/lib/auth.ts:42" |
|
|
74
|
+
| "It didn't find anything" | "No OAuth patterns in src/. Will create new." |
|
|
75
|
+
| Skip acknowledgment | Always state how findings change approach |
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!-- SUMMARY: Follow standard format when creating or modifying rules -->
|
|
2
|
+
<!-- TRIGGER: rules -->
|
|
3
|
+
# RULE: Rule Format - Standard Structure for All Rules
|
|
4
|
+
|
|
5
|
+
⚠️ **ALWAYS-ACTIVE RULE** - Apply when creating or modifying any rule file.
|
|
6
|
+
|
|
7
|
+
## 🔐 Enforcement
|
|
8
|
+
|
|
9
|
+
**When creating/modifying rules, you MUST:**
|
|
10
|
+
1. Follow the exact template below
|
|
11
|
+
2. Keep content concise - no filler words
|
|
12
|
+
3. Use the metadata comments for hook integration
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Template
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
<!-- SUMMARY: One-line description (max 80 chars) -->
|
|
20
|
+
<!-- TRIGGER: code | package | structure | always -->
|
|
21
|
+
# RULE: Name - Short Description
|
|
22
|
+
|
|
23
|
+
⚠️ **ALWAYS-ACTIVE RULE** - Brief scope statement.
|
|
24
|
+
|
|
25
|
+
## 🔐 Enforcement
|
|
26
|
+
|
|
27
|
+
**[When this triggers], you MUST:**
|
|
28
|
+
1. Step one
|
|
29
|
+
2. Step two
|
|
30
|
+
3. Step three
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What to Check
|
|
35
|
+
|
|
36
|
+
- Bullet point checks
|
|
37
|
+
- Keep actionable
|
|
38
|
+
|
|
39
|
+
## Quick Reference
|
|
40
|
+
|
|
41
|
+
| Do | Don't |
|
|
42
|
+
|----|-------|
|
|
43
|
+
| Good example | Bad example |
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Metadata Fields
|
|
49
|
+
|
|
50
|
+
| Field | Values | Purpose |
|
|
51
|
+
|-------|--------|---------|
|
|
52
|
+
| `SUMMARY` | Max 80 chars | Displayed in lightweight mode |
|
|
53
|
+
| `TRIGGER` | `code`, `package`, `structure`, `always` | When hook injects this rule |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Principles
|
|
58
|
+
|
|
59
|
+
1. **Concise** - No paragraphs explaining why. Just what to do.
|
|
60
|
+
2. **Actionable** - Every line should be a clear instruction.
|
|
61
|
+
3. **Scannable** - Use tables, bullets, code blocks. No walls of text.
|
|
62
|
+
4. **Self-contained** - Rule should work without reading other docs.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Anti-Patterns
|
|
67
|
+
|
|
68
|
+
❌ Long explanations of "why" this rule exists
|
|
69
|
+
❌ Multiple examples when one suffices
|
|
70
|
+
❌ Repeating the same instruction in different words
|
|
71
|
+
❌ Sections that don't add actionable value
|
|
72
|
+
❌ "Philosophy" or "Background" sections
|