project-iris 0.2.1 → 0.2.3
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/lib/installer.js +44 -0
- package/package.json +2 -1
- package/templates/CLAUDE.md +159 -0
package/lib/installer.js
CHANGED
|
@@ -230,6 +230,47 @@ async function installVSCodeExtension(selectedToolKeys) {
|
|
|
230
230
|
return installed;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Install CLAUDE.md to .claude/ folder
|
|
235
|
+
* This provides Claude with project-agnostic quality guidelines
|
|
236
|
+
* @returns {boolean} Whether file was installed
|
|
237
|
+
*/
|
|
238
|
+
async function installClaudeMd() {
|
|
239
|
+
const sourcePath = path.join(__dirname, '..', 'templates', 'CLAUDE.md');
|
|
240
|
+
const targetDir = '.claude';
|
|
241
|
+
const targetPath = path.join(targetDir, 'CLAUDE.md');
|
|
242
|
+
|
|
243
|
+
// Check if source exists
|
|
244
|
+
if (!await fs.pathExists(sourcePath)) {
|
|
245
|
+
console.log(theme.dim(' CLAUDE.md template not found, skipping...'));
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Ensure .claude directory exists
|
|
250
|
+
await fs.ensureDir(targetDir);
|
|
251
|
+
|
|
252
|
+
// Check if CLAUDE.md already exists
|
|
253
|
+
if (await fs.pathExists(targetPath)) {
|
|
254
|
+
// Read existing content to check if it's ours
|
|
255
|
+
const existing = await fs.readFile(targetPath, 'utf8');
|
|
256
|
+
if (existing.includes('installed by iris') || existing.includes('project-iris')) {
|
|
257
|
+
// Our file, safe to overwrite
|
|
258
|
+
await fs.copy(sourcePath, targetPath, { overwrite: true });
|
|
259
|
+
CLIUtils.displayStatus('', 'Updated CLAUDE.md', 'success');
|
|
260
|
+
return true;
|
|
261
|
+
} else {
|
|
262
|
+
// User's own CLAUDE.md, don't overwrite
|
|
263
|
+
console.log(theme.dim(' Existing CLAUDE.md found, skipping (won\'t overwrite user file)'));
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Install fresh
|
|
269
|
+
await fs.copy(sourcePath, targetPath);
|
|
270
|
+
CLIUtils.displayStatus('', 'Installed CLAUDE.md with quality guidelines', 'success');
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
|
|
233
274
|
async function install() {
|
|
234
275
|
// Initialize analytics (respects opt-out env vars)
|
|
235
276
|
analytics.init();
|
|
@@ -316,6 +357,9 @@ async function install() {
|
|
|
316
357
|
try {
|
|
317
358
|
const filesCreated = await installFlow(selectedFlow, selectedToolKeys);
|
|
318
359
|
|
|
360
|
+
// Install CLAUDE.md with quality guidelines
|
|
361
|
+
await installClaudeMd();
|
|
362
|
+
|
|
319
363
|
// Install VS Code extension if applicable
|
|
320
364
|
await installVSCodeExtension(selectedToolKeys);
|
|
321
365
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-iris",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Multi-agent orchestration system for AI-native software development. Delivers AI-DLC, Agile, and custom SDLC flows as markdown-based agent systems.",
|
|
5
5
|
"main": "lib/installer.js",
|
|
6
6
|
"bin": {
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"flows/",
|
|
39
39
|
"lib/",
|
|
40
40
|
"scripts/",
|
|
41
|
+
"templates/",
|
|
41
42
|
"README.md"
|
|
42
43
|
],
|
|
43
44
|
"dependencies": {
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Claude Instructions
|
|
2
|
+
|
|
3
|
+
## Prime Directives
|
|
4
|
+
|
|
5
|
+
1. **Clarify before coding** - Never assume. Ask if requirements are unclear.
|
|
6
|
+
2. **Read before writing** - Never modify code you haven't read. Find existing patterns first.
|
|
7
|
+
3. **Do exactly what's asked** - No more, no less. No "improvements" unless requested.
|
|
8
|
+
4. **Keep it simple** - The simplest solution that works is the best solution.
|
|
9
|
+
5. **Verify your work** - Confirm changes compile and tests pass before marking done.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Before Writing Code
|
|
14
|
+
|
|
15
|
+
**Required steps:**
|
|
16
|
+
1. Read the files you'll modify
|
|
17
|
+
2. Search for similar code/patterns in the codebase
|
|
18
|
+
3. Check for related tests
|
|
19
|
+
4. Use existing utilities - don't reinvent
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Good: "Let me read the existing service to understand the patterns..."
|
|
23
|
+
Bad: "I'll create a new Service class..." (without reading existing code)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Code Quality
|
|
29
|
+
|
|
30
|
+
### Structure & Naming
|
|
31
|
+
- One responsibility per file/function
|
|
32
|
+
- Group by feature (`user/`) not type (`controllers/`)
|
|
33
|
+
- Functions: verb + noun (`createUser`, `validateEmail`)
|
|
34
|
+
- Booleans: `is/has/can/should` prefix
|
|
35
|
+
- Match existing codebase conventions exactly
|
|
36
|
+
|
|
37
|
+
### Simplicity
|
|
38
|
+
- No abstraction until 3+ use cases exist
|
|
39
|
+
- No "just in case" code
|
|
40
|
+
- 10 clear lines > 3 clever lines
|
|
41
|
+
- Max 20-30 lines per function, 3-4 parameters
|
|
42
|
+
|
|
43
|
+
### Error Handling
|
|
44
|
+
- Validate at boundaries only (user input, API responses, file I/O)
|
|
45
|
+
- Fail fast - throw early
|
|
46
|
+
- Never swallow errors silently
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Verification
|
|
51
|
+
|
|
52
|
+
After every change:
|
|
53
|
+
1. **Compile/parse** - No syntax errors
|
|
54
|
+
2. **Run tests** - Existing tests still pass
|
|
55
|
+
3. **Manual check** - If no tests, verify it works
|
|
56
|
+
|
|
57
|
+
If something breaks: Stop, read the error, fix or revert. Never leave broken code.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## What Claude Gets Wrong
|
|
62
|
+
|
|
63
|
+
### Over-Engineering
|
|
64
|
+
- Abstractions/interfaces for single implementations
|
|
65
|
+
- Factory patterns, builders without need
|
|
66
|
+
- Utility classes for one-off operations
|
|
67
|
+
- Config for things that won't change
|
|
68
|
+
|
|
69
|
+
### Unnecessary Changes
|
|
70
|
+
- "Cleaning up" unrelated code
|
|
71
|
+
- Adding types/docs to unchanged code
|
|
72
|
+
- Refactoring "while you're there"
|
|
73
|
+
|
|
74
|
+
### Context Failures
|
|
75
|
+
- Modifying files without reading them
|
|
76
|
+
- Ignoring existing patterns
|
|
77
|
+
- Creating utilities when similar ones exist
|
|
78
|
+
- Using different conventions than the codebase
|
|
79
|
+
|
|
80
|
+
### Verbose Patterns
|
|
81
|
+
- Try-catch that just logs and rethrows
|
|
82
|
+
- Null checks on non-nullable values
|
|
83
|
+
- Comments explaining obvious code
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Debugging
|
|
88
|
+
|
|
89
|
+
1. **Reproduce** - Make the bug happen consistently
|
|
90
|
+
2. **Isolate** - Find the smallest failing case
|
|
91
|
+
3. **Understand** - Find root cause, not symptom
|
|
92
|
+
4. **Fix** - Minimal change only
|
|
93
|
+
5. **Verify** - Test the fix, remove debug code
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Multi-Step Tasks
|
|
98
|
+
|
|
99
|
+
1. List steps before starting
|
|
100
|
+
2. Complete one step fully before next
|
|
101
|
+
3. Verify each step works
|
|
102
|
+
4. If blocked, ask - don't guess
|
|
103
|
+
|
|
104
|
+
Pattern: Small change → Verify → Next change → Verify
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Git & Dependencies
|
|
109
|
+
|
|
110
|
+
**Commits**: Atomic, meaningful messages, always working state
|
|
111
|
+
**Format**: `type: description` (feat, fix, refactor, docs, test, chore)
|
|
112
|
+
**Before commit**: Review diff, build passes, tests pass, no debug code
|
|
113
|
+
|
|
114
|
+
**Dependencies**: Check if existing deps solve it first. Ask before adding new ones.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Security (Non-Negotiable)
|
|
119
|
+
|
|
120
|
+
- Never hardcode secrets - use environment variables
|
|
121
|
+
- Validate/sanitize ALL external input
|
|
122
|
+
- SQL: Parameterized queries only
|
|
123
|
+
- Escape output for context (HTML, SQL, shell)
|
|
124
|
+
- Check permissions on protected operations
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Testing
|
|
129
|
+
|
|
130
|
+
- Test behavior, not implementation
|
|
131
|
+
- One concept per test
|
|
132
|
+
- Name clearly: `rejects_expired_tokens`
|
|
133
|
+
- No logic in tests (no if/for)
|
|
134
|
+
- Test edge cases: empty, null, boundaries
|
|
135
|
+
- Write tests for bug fixes
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Communication
|
|
140
|
+
|
|
141
|
+
- **Before**: "I'll [action] by [approach]."
|
|
142
|
+
- **After**: "Done. Changed X, Y. [caveats]."
|
|
143
|
+
- **Blocked**: "I need [info] because [reason]."
|
|
144
|
+
- **Trade-offs**: "A: [pro/con]. B: [pro/con]. Recommend A because..."
|
|
145
|
+
|
|
146
|
+
Never: Apologize unnecessarily, explain basics unless asked, pad responses
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Documentation
|
|
151
|
+
|
|
152
|
+
- Code should be self-documenting
|
|
153
|
+
- Comment only: why (not what), complex algorithms, non-obvious side effects
|
|
154
|
+
- No TODO comments - fix now or create issue
|
|
155
|
+
- No commented-out code - delete it
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
<!-- installed by iris (project-iris) - safe to update with: npx project-iris install -->
|