claudify-agent 1.0.4 → 1.0.6
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/.claude/commands/learn.md +16 -0
- package/.claude/commands/spec-apply.md +14 -0
- package/.claude/commands/spec-archive.md +14 -0
- package/.claude/commands/spec-new.md +39 -0
- package/.claude/rules/context-tier-1.md +3 -3
- package/.claude/rules/context-tier-2.md +22 -22
- package/.claude/rules/general.md +1 -1
- package/.claude/rules/plan-mode-structure.md +4 -4
- package/.claude/rules/tool-strategy.md +1 -1
- package/CLAUDE.md +32 -27
- package/bin/cli.js +9 -0
- package/package.json +2 -1
- package/templates/spec/config.md +27 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Turn a mistake I just corrected into a rule so it never repeats
|
|
3
|
+
argument-hint: <what went wrong and what is right>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Lesson to learn: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
If the argument is empty, infer the lesson from the correction I made earlier in this conversation.
|
|
9
|
+
|
|
10
|
+
1. State the lesson as one imperative line: what to do (or never do) and when. Add a one-line why if not obvious.
|
|
11
|
+
2. Pick where it belongs, most specific first:
|
|
12
|
+
- business invariant of this project → Invariants in `spec/config.md`;
|
|
13
|
+
- a technology or practice covered by a skill → that `.claude/skills/<name>/SKILL.md`, under a `## Lessons` section;
|
|
14
|
+
- general working style → `.claude/rules/lessons.md` (always loaded, keep it under 30 lines).
|
|
15
|
+
3. Check the target for an existing rule that covers it; if so, sharpen that line instead of adding a duplicate.
|
|
16
|
+
4. Show me the exact diff and wait for my approval before writing.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Implement the next unchecked tasks of a spec change
|
|
3
|
+
argument-hint: <change-name> [task number]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Implement spec change: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
1. Read `spec/changes/<change-name>.md` and the Invariants in `spec/config.md`. Nothing else up front; read code only as each task needs it.
|
|
9
|
+
2. Take the requested task, or the first unchecked `- [ ]` task. Work one task at a time.
|
|
10
|
+
3. Implement it, then run its DoD. Fix until it passes (max 5 attempts, then stop and report).
|
|
11
|
+
4. Tick it `- [x]` in the change file. If reality differs from the spec, update the spec (Requirements/Design) in the same step and tell me.
|
|
12
|
+
5. Report in 2-3 lines: task done, proof run, next task. Continue to the next task only if I asked for more than one.
|
|
13
|
+
|
|
14
|
+
When every task is ticked, set `Status: done` and suggest `/spec-archive <change-name>`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Merge a finished change's requirements into the spec backbone and archive it
|
|
3
|
+
argument-hint: <change-name>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Archive spec change: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
1. Read `spec/changes/<change-name>.md`. Refuse if any task is unchecked; list them.
|
|
9
|
+
2. For each `### <capability>` block under Requirements, update `spec/specs/<capability>.md` (create if new):
|
|
10
|
+
- Keep only Requirements and Scenarios: the current truth of the system, no history, no tasks.
|
|
11
|
+
- ADDED → append. MODIFIED → replace the requirement of the same name in full. REMOVED → delete it.
|
|
12
|
+
- If a MODIFIED/REMOVED name does not exist in the backbone, stop and ask instead of guessing.
|
|
13
|
+
3. Move the change file to `spec/changes/archive/YYYY-MM-DD-<change-name>.md`.
|
|
14
|
+
4. Show me the diff of `spec/specs/` in a short summary.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Draft a lightweight spec for a new feature (single file, ~800 words)
|
|
3
|
+
argument-hint: <change-name> <what the feature should do>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Create a spec change for: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
1. Read `spec/config.md` (stop and offer to create it from the template if missing). Read only the `spec/specs/*.md` capabilities this feature touches, and only the source-of-truth sections it needs.
|
|
9
|
+
2. Ask me (one batched question) anything that changes scope. Do not guess scope.
|
|
10
|
+
3. Write `spec/changes/<change-name>.md` with exactly these sections, following the rules in `spec/config.md`:
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
# <change-name>
|
|
14
|
+
Status: draft | Depends on: <change or none>
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
## Scope
|
|
18
|
+
- In: ...
|
|
19
|
+
- Out (non-goals): ...
|
|
20
|
+
## Requirements
|
|
21
|
+
<!-- One block per affected capability, named like spec/specs/<capability>.md -->
|
|
22
|
+
### <capability> (new | modified)
|
|
23
|
+
#### ADDED Requirement: <name>
|
|
24
|
+
<statement with SHALL/MUST>
|
|
25
|
+
- Scenario <name>: GIVEN ... WHEN ... THEN ...
|
|
26
|
+
#### MODIFIED Requirement: <existing name>
|
|
27
|
+
<full new text, not just the diff>
|
|
28
|
+
#### REMOVED Requirement: <existing name>
|
|
29
|
+
<reason>
|
|
30
|
+
## Design
|
|
31
|
+
<only decisions not obvious from the code: data flow, schema, API, edge cases. Omit section if trivial.>
|
|
32
|
+
## Risks
|
|
33
|
+
## Tasks
|
|
34
|
+
- [ ] 1. <task> — files: ... — DoD: ...
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
4. Keep the whole file under ~800 words, plus ~300 per extra capability. No restating config, docs or code; link them.
|
|
38
|
+
If it still does not fit (e.g. more than 4 capabilities), propose splitting into smaller changes with `Depends on:` instead of one giant spec.
|
|
39
|
+
5. Do not write code. Finish by showing the task list and asking me to approve before `/spec-apply`.
|
|
@@ -29,9 +29,9 @@ npm run typecheck # After TypeScript changes
|
|
|
29
29
|
## Canonical Examples
|
|
30
30
|
|
|
31
31
|
```
|
|
32
|
-
Component pattern:
|
|
33
|
-
API route pattern:
|
|
34
|
-
Test pattern:
|
|
32
|
+
Component pattern: `components/Button.tsx`
|
|
33
|
+
API route pattern: `app/api/users/route.ts`
|
|
34
|
+
Test pattern: `__tests__/auth.test.ts`
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
---
|
|
@@ -33,9 +33,9 @@ npm run test:coverage # With coverage report
|
|
|
33
33
|
npm run test -- path/to # Specific file
|
|
34
34
|
|
|
35
35
|
## Test Examples
|
|
36
|
-
- Unit test:
|
|
37
|
-
- Integration:
|
|
38
|
-
- E2E:
|
|
36
|
+
- Unit test: `__tests__/auth.test.ts`
|
|
37
|
+
- Integration: `__tests__/api/users.test.ts`
|
|
38
|
+
- E2E: `e2e/checkout.spec.ts`
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
---
|
|
@@ -55,7 +55,7 @@ npm run test -- path/to # Specific file
|
|
|
55
55
|
- Export GET, POST, PUT, DELETE handlers
|
|
56
56
|
|
|
57
57
|
## Authentication
|
|
58
|
-
- Validate JWT with
|
|
58
|
+
- Validate JWT with `src/auth/validateToken.ts`
|
|
59
59
|
- Extract user from token claims
|
|
60
60
|
- Return 401 for unauthorized, 403 for forbidden
|
|
61
61
|
|
|
@@ -78,9 +78,9 @@ try {
|
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
## API Examples
|
|
81
|
-
- REST pattern:
|
|
82
|
-
- Error handling:
|
|
83
|
-
- Validation:
|
|
81
|
+
- REST pattern: `app/api/users/route.ts`
|
|
82
|
+
- Error handling: `app/api/orders/route.ts`
|
|
83
|
+
- Validation: `src/validators/orderSchema.ts`
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
---
|
|
@@ -124,9 +124,9 @@ export function Button({ variant = 'primary', children }: Props) {
|
|
|
124
124
|
- Test on multiple screen sizes
|
|
125
125
|
|
|
126
126
|
## UI Examples
|
|
127
|
-
- Button:
|
|
128
|
-
- Form:
|
|
129
|
-
- Layout:
|
|
127
|
+
- Button: `components/Button.tsx`
|
|
128
|
+
- Form: `components/forms/TextInput.tsx`
|
|
129
|
+
- Layout: `components/Layout.tsx`
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
---
|
|
@@ -152,9 +152,9 @@ export function Button({ variant = 'primary', children }: Props) {
|
|
|
152
152
|
- Lighthouse Performance: >90
|
|
153
153
|
|
|
154
154
|
## Performance Examples
|
|
155
|
-
- Memoization:
|
|
156
|
-
- Code splitting:
|
|
157
|
-
- Caching:
|
|
155
|
+
- Memoization: `components/ExpensiveList.tsx`
|
|
156
|
+
- Code splitting: `app/dashboard/page.tsx`
|
|
157
|
+
- Caching: `lib/react-query.ts`
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
---
|
|
@@ -179,9 +179,9 @@ export function Button({ variant = 'primary', children }: Props) {
|
|
|
179
179
|
- Index frequently queried fields
|
|
180
180
|
|
|
181
181
|
## Database Examples
|
|
182
|
-
- Schema:
|
|
183
|
-
- Query pattern:
|
|
184
|
-
- Migration:
|
|
182
|
+
- Schema: `prisma/schema.prisma`
|
|
183
|
+
- Query pattern: `src/db/queries/users.ts`
|
|
184
|
+
- Migration: `prisma/migrations/[latest]`
|
|
185
185
|
```
|
|
186
186
|
|
|
187
187
|
---
|
|
@@ -212,9 +212,9 @@ export function Button({ variant = 'primary', children }: Props) {
|
|
|
212
212
|
- Escape output to prevent XSS
|
|
213
213
|
|
|
214
214
|
## Security Examples
|
|
215
|
-
- Auth middleware:
|
|
216
|
-
- Password hashing:
|
|
217
|
-
- Input validation:
|
|
215
|
+
- Auth middleware: `src/middleware/auth.ts`
|
|
216
|
+
- Password hashing: `src/lib/password.ts`
|
|
217
|
+
- Input validation: `src/validators/userSchema.ts`
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
---
|
|
@@ -240,9 +240,9 @@ export function Button({ variant = 'primary', children }: Props) {
|
|
|
240
240
|
- Manual approval for production
|
|
241
241
|
|
|
242
242
|
## Deployment Examples
|
|
243
|
-
- CI config:
|
|
244
|
-
- Build script:
|
|
245
|
-
- Deploy:
|
|
243
|
+
- CI config: `.github/workflows/ci.yml`
|
|
244
|
+
- Build script: `scripts/build.ts`
|
|
245
|
+
- Deploy: `scripts/deploy.ts`
|
|
246
246
|
```
|
|
247
247
|
|
|
248
248
|
---
|
package/.claude/rules/general.md
CHANGED
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
- [ ] Tests passing (auto-run)
|
|
23
23
|
- [ ] Cost within budget (check `.claude/cost-dashboard.md`)
|
|
24
24
|
|
|
25
|
-
**Note**: See
|
|
25
|
+
**Note**: See `.claude/rules/` for task-specific rules. Anti-patterns: `.claude/rules/anti-patterns.md`
|
|
@@ -85,7 +85,7 @@ Add login button to header navigation following existing button patterns.
|
|
|
85
85
|
|
|
86
86
|
## Files to Modify
|
|
87
87
|
- `components/Header.tsx` - Add login button to nav
|
|
88
|
-
- Pattern: Follow
|
|
88
|
+
- Pattern: Follow `components/Button.tsx`
|
|
89
89
|
- Tools: Edit for edit, Lint check for validation
|
|
90
90
|
|
|
91
91
|
## Implementation Steps
|
|
@@ -119,13 +119,13 @@ Create user dashboard with stats, activity feed, and settings panel.
|
|
|
119
119
|
|
|
120
120
|
## Files to Create
|
|
121
121
|
- `app/dashboard/page.tsx` - Main dashboard page
|
|
122
|
-
- Pattern: Follow
|
|
122
|
+
- Pattern: Follow `app/profile/page.tsx`
|
|
123
123
|
- Tools: Write for new file
|
|
124
124
|
- `components/dashboard/StatsCard.tsx` - Stats component
|
|
125
|
-
- Pattern: Follow
|
|
125
|
+
- Pattern: Follow `components/Card.tsx`
|
|
126
126
|
- Tools: Write for new file
|
|
127
127
|
- `app/api/dashboard/stats/route.ts` - Stats API
|
|
128
|
-
- Pattern: Follow
|
|
128
|
+
- Pattern: Follow `app/api/users/route.ts`
|
|
129
129
|
- Tools: Write for new file
|
|
130
130
|
|
|
131
131
|
## Implementation Steps
|
package/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CLAUDE CORE OPERATING SYSTEM
|
|
2
2
|
|
|
3
|
-
> **Universal Directive:** You are an autonomous Senior Software Engineer operating via Claude Code / Anthropic Agent loop. Follow these concise, modular instructions. Do not load all guidelines into context;
|
|
3
|
+
> **Universal Directive:** You are an autonomous Senior Software Engineer operating via Claude Code / Anthropic Agent loop. Follow these concise, modular instructions. Do not load all guidelines into context; Read the referenced files only when the task needs them.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,43 +8,48 @@
|
|
|
8
8
|
- Keep responses concise and targeted. Never dump entire files when diffs suffice.
|
|
9
9
|
- Do NOT read whole directory trees. Inspect shallow structure first.
|
|
10
10
|
- Context Tiers (Inspect when prompted):
|
|
11
|
-
- **Tier 1 (Base):**
|
|
12
|
-
- **Tier 2 (Deep Task):**
|
|
13
|
-
- **Anti-Patterns:**
|
|
11
|
+
- **Tier 1 (Base):** `.claude/rules/context-tier-1.md`
|
|
12
|
+
- **Tier 2 (Deep Task):** `.claude/rules/context-tier-2.md`
|
|
13
|
+
- **Anti-Patterns:** `.claude/rules/anti-patterns.md`
|
|
14
14
|
|
|
15
15
|
## 2. 📋 Plan First Protocol (Anti-Drift)
|
|
16
16
|
- For tasks touching **>= 2 files** or core architecture:
|
|
17
17
|
- Generate a concise Plan before modifying files.
|
|
18
|
-
- Research protocol:
|
|
19
|
-
- Execution checklist:
|
|
20
|
-
- Validation steps:
|
|
21
|
-
- Plan structure guide:
|
|
18
|
+
- Research protocol: `.claude/rules/plan-mode-research.md`
|
|
19
|
+
- Execution checklist: `.claude/rules/plan-mode-execution.md`
|
|
20
|
+
- Validation steps: `.claude/rules/plan-mode-validation.md`
|
|
21
|
+
- Plan structure guide: `.claude/rules/plan-mode-structure.md`
|
|
22
|
+
|
|
23
|
+
## 2b. 📐 Spec Workflow (features only, opt-in by command)
|
|
24
|
+
- `/spec-new` → `/spec-apply` → `/spec-archive`. Specs live in `spec/` (config, changes, specs backbone).
|
|
25
|
+
- Bugs and small tasks: no spec, work directly.
|
|
26
|
+
- After the user corrects a mistake, suggest `/learn` so it never repeats.
|
|
22
27
|
|
|
23
28
|
## 3. 🧪 Zero-Token Local Verification Loop
|
|
24
29
|
After modifying code, execute local verification based on project stack:
|
|
25
30
|
- **Node/TS/NestJS:** `npm run lint:fix && npm run typecheck`
|
|
26
31
|
- **Go Backend:** `go vet ./... && go test -race ./...`
|
|
27
32
|
- **Solidity (SMC):** `forge test -vvv` hoặc `npx hardhat test`
|
|
28
|
-
- Core standards:
|
|
33
|
+
- Core standards: `.claude/rules/general.md` & `.claude/rules/security-critical.md`
|
|
29
34
|
|
|
30
35
|
## 4. 📚 On-Demand Skills Index (Load ONLY When Tech Is Used)
|
|
31
|
-
- **Backend Concurrency & Locking:**
|
|
32
|
-
- **NestJS Enterprise:**
|
|
33
|
-
- **Golang Backend:**
|
|
34
|
-
- **Solidity (Smart Contracts):**
|
|
35
|
-
- **Next.js:**
|
|
36
|
-
- **React:**
|
|
37
|
-
- **Python:**
|
|
38
|
-
- **Security (OWASP):**
|
|
39
|
-
- **Vite:**
|
|
40
|
-
- **MCP Mastery:**
|
|
41
|
-
- **Tool Selection:**
|
|
42
|
-
- **Debug Optimizer:**
|
|
43
|
-
- **Parallel Exploration:**
|
|
44
|
-
- **Learning Loop:**
|
|
36
|
+
- **Backend Concurrency & Locking:** `.claude/skills/backend-concurrency/SKILL.md`
|
|
37
|
+
- **NestJS Enterprise:** `.claude/skills/nestjs-guide/SKILL.md`
|
|
38
|
+
- **Golang Backend:** `.claude/skills/golang-guide/SKILL.md`
|
|
39
|
+
- **Solidity (Smart Contracts):** `.claude/skills/solidity-guide/SKILL.md`
|
|
40
|
+
- **Next.js:** `.claude/skills/nextjs-guide/SKILL.md`
|
|
41
|
+
- **React:** `.claude/skills/react-guide/SKILL.md`
|
|
42
|
+
- **Python:** `.claude/skills/python-guide/SKILL.md`
|
|
43
|
+
- **Security (OWASP):** `.claude/skills/security-guide/SKILL.md`
|
|
44
|
+
- **Vite:** `.claude/skills/vite-guide/SKILL.md`
|
|
45
|
+
- **MCP Mastery:** `.claude/skills/mcp-mastery/SKILL.md`
|
|
46
|
+
- **Tool Selection:** `.claude/skills/tool-selection/SKILL.md`
|
|
47
|
+
- **Debug Optimizer:** `.claude/skills/debug-optimizer/SKILL.md`
|
|
48
|
+
- **Parallel Exploration:** `.claude/skills/parallel-exploration/SKILL.md`
|
|
49
|
+
- **Learning Loop:** `.claude/skills/learning-loop/SKILL.md`
|
|
45
50
|
|
|
46
51
|
## 5. 🔌 Tool & MCP Strategy
|
|
47
|
-
- Auto Tool Selection:
|
|
48
|
-
- Tool Strategy:
|
|
49
|
-
- MCP Auto-Usage:
|
|
50
|
-
- MCP Integration Guide:
|
|
52
|
+
- Auto Tool Selection: `.claude/rules/tool-auto-selection.md`
|
|
53
|
+
- Tool Strategy: `.claude/rules/tool-strategy.md`
|
|
54
|
+
- MCP Auto-Usage: `.claude/rules/mcp-auto-use.md`
|
|
55
|
+
- MCP Integration Guide: `.claude/docs/MCP-INTEGRATION-GUIDE.md`
|
package/bin/cli.js
CHANGED
|
@@ -41,6 +41,15 @@ if (command === 'init') {
|
|
|
41
41
|
console.log(` ⚠️ Kept your existing .claude/settings.json — merge the "hooks" block from ${settingsSrc} manually.`);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
// 3. Scaffold spec/ for the feature workflow (never overwrite an existing config)
|
|
45
|
+
const specConfig = join(targetDir, 'spec', 'config.md');
|
|
46
|
+
if (existsSync(specConfig)) {
|
|
47
|
+
console.log(' ⚠️ Kept your existing spec/config.md');
|
|
48
|
+
} else {
|
|
49
|
+
await cp(join(packageRoot, 'templates', 'spec', 'config.md'), specConfig);
|
|
50
|
+
console.log(' ✅ Created spec/config.md (fill in context & invariants, then use /spec-new)');
|
|
51
|
+
}
|
|
52
|
+
|
|
44
53
|
console.log('\n🎉 Successfully initialized Claudify!');
|
|
45
54
|
console.log('👉 Next Steps:');
|
|
46
55
|
console.log(' - Review CLAUDE.md in your project root.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudify-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Enterprise-grade workflow & context optimization framework for Claude Code, Claude Desktop, and AI coding agents.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"CLAUDE.md",
|
|
17
17
|
".claude",
|
|
18
18
|
"bin",
|
|
19
|
+
"templates",
|
|
19
20
|
"README.md",
|
|
20
21
|
"package.json"
|
|
21
22
|
],
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Spec Config
|
|
2
|
+
|
|
3
|
+
> Read by `/spec-new` and `/spec-apply` only. Keep it short: every line here is paid for on each spec command.
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
- Project: <one or two lines: what the system does>
|
|
7
|
+
- Stack: <languages, frameworks>
|
|
8
|
+
- Sources of truth (read before writing a change): <design docs, ADRs>. If a change contradicts them, stop and say so.
|
|
9
|
+
|
|
10
|
+
## Invariants
|
|
11
|
+
<!-- Rules every change MUST respect. One line each. -->
|
|
12
|
+
- <e.g. money amounts are integers in base units, never floats>
|
|
13
|
+
|
|
14
|
+
## Style
|
|
15
|
+
- Language: <e.g. Vietnamese prose, English technical terms and spec keywords>
|
|
16
|
+
- Concise: bullets, tables, short snippets. Reference docs by section instead of copying them.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
### Proposal
|
|
20
|
+
- Must have Why, Scope (in / out = Non-goals), Depends on, Affected capabilities, Risks.
|
|
21
|
+
### Requirements
|
|
22
|
+
- `### Requirement: <name>` containing SHALL or MUST.
|
|
23
|
+
- Each has `#### Scenario:` GIVEN / WHEN / THEN with concrete values: at least one happy path and one failure.
|
|
24
|
+
### Tasks
|
|
25
|
+
- Each task fits in 2-4 hours, lists files/packages touched and its DoD.
|
|
26
|
+
- Tests ship with the task that adds the logic, not at the end.
|
|
27
|
+
- DoD default: <e.g. `npm run lint && npm run typecheck && npm test`>
|