claudify-agent 1.0.5 → 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.
@@ -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`.
package/CLAUDE.md CHANGED
@@ -20,6 +20,11 @@
20
20
  - Validation steps: `.claude/rules/plan-mode-validation.md`
21
21
  - Plan structure guide: `.claude/rules/plan-mode-structure.md`
22
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.
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`
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.5",
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`>