claudify-agent 1.0.5 → 1.0.7

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,20 @@
1
+ ---
2
+ description: Scan the project and draft BACKBONE.md (project map loaded every session)
3
+ argument-hint: [extra notes about the project]
4
+ ---
5
+
6
+ Draft or refresh `BACKBONE.md` at the project root. Notes from me: $ARGUMENTS
7
+
8
+ 1. Scan shallowly, do not read whole trees:
9
+ - manifests: package.json, go.mod, pyproject.toml, foundry.toml, Cargo.toml, docker/compose files;
10
+ - top-level dirs (and sub-repos if this is a multi-repo workspace);
11
+ - README, CLAUDE.md, `docs/` file names and first headings; `openspec/` or `spec/` if present;
12
+ - CI workflows for the real lint/test/build commands.
13
+ 2. Fill every section of the existing `BACKBONE.md` (or the template if missing):
14
+ - Docs index: one line per doc, with status. Mark a doc outdated only with evidence (superseded note, archive folder, version mismatch); otherwise ask.
15
+ - Capabilities: one line per `spec/specs/*.md` (or `openspec/specs/*/` if migrating from OpenSpec).
16
+ - Invariants: only rules found in docs or that I confirm. Never invent business rules.
17
+ 3. Keep it under ~80 lines. Link, never copy.
18
+ 4. List what you could not determine as questions, batched in one message.
19
+ 5. Set `Last synced: <HEAD short sha> (<date>)` so `/backbone-sync` can diff from here.
20
+ 6. Show the full diff and wait for my approval before writing.
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Re-sync BACKBONE.md with the current source after work done without specs
3
+ argument-hint: [area to focus on]
4
+ ---
5
+
6
+ Sync `BACKBONE.md` with the code as it is now. Focus: $ARGUMENTS
7
+
8
+ 1. Find what changed since the last sync:
9
+ - read the `Last synced:` commit in `BACKBONE.md`; run `git log --stat <commit>..HEAD` (and `git status` for uncommitted work);
10
+ - no commit recorded → fall back to the shallow scan of `/backbone-init`.
11
+ Read only the changed files that matter (manifests, new dirs, new docs, CI, public APIs); not every diff line.
12
+ 2. Compare against `BACKBONE.md` section by section and list gaps:
13
+ - Structure: new / moved / removed modules or repos;
14
+ - Docs index: new docs, docs that now contradict the code (candidate outdated);
15
+ - Commands: scripts or CI steps that changed;
16
+ - Capabilities: behaviour that exists in code but has no `spec/specs/*.md` entry;
17
+ - Open changes: entries whose `spec/changes/*.md` is gone or done.
18
+ 3. Also compare with `spec/specs/*.md` for the touched areas. Report code that contradicts an archived requirement, but do not edit specs: that is my call (fix the code or open a change).
19
+ 4. Ask me about anything you cannot decide from evidence, batched in one message. Never invent invariants.
20
+ 5. Show the `BACKBONE.md` diff, including `Last synced: <HEAD short sha> (<date>)`, and wait for my approval before writing.
@@ -0,0 +1,17 @@
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 or project-wide fact (e.g. a doc is outdated) → Invariants or Docs index in `BACKBONE.md`;
13
+ - how specs should be written → `spec/config.md`;
14
+ - a technology or practice covered by a skill → that `.claude/skills/<name>/SKILL.md`, under a `## Lessons` section;
15
+ - general working style → `.claude/rules/lessons.md` (always loaded, keep it under 30 lines).
16
+ 3. Check the target for an existing rule that covers it; if so, sharpen that line instead of adding a duplicate.
17
+ 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`; respect the Invariants in `BACKBONE.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,15 @@
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. Update `BACKBONE.md`: remove the change from "Open changes"; add or update the one-line entry under "Capabilities" for each capability touched.
15
+ 5. Show me the diff of `spec/specs/` in a short summary.
@@ -0,0 +1,40 @@
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. `BACKBONE.md` is already in context. Read `spec/config.md`, then only the `spec/specs/*.md` capabilities this feature touches and only the doc sections from the Docs index 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. Add the change as one line under "Open changes" in `BACKBONE.md`.
40
+ 6. Do not write code. Finish by showing the task list and asking me to approve before `/spec-apply`.
package/CLAUDE.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  ---
6
6
 
7
+ ## 0. 🗺️ Project Backbone (always loaded)
8
+ @BACKBONE.md
9
+
10
+ If it still holds `<placeholders>`, suggest `/backbone-init`. Follow its Invariants on every task.
11
+ If you finish work without a spec that changes structure, docs, commands or capabilities, suggest `/backbone-sync`.
12
+
7
13
  ## 1. 🛑 Context & Token Preservation (Sub-20 Line Core)
8
14
  - Keep responses concise and targeted. Never dump entire files when diffs suffice.
9
15
  - Do NOT read whole directory trees. Inspect shallow structure first.
@@ -20,6 +26,11 @@
20
26
  - Validation steps: `.claude/rules/plan-mode-validation.md`
21
27
  - Plan structure guide: `.claude/rules/plan-mode-structure.md`
22
28
 
29
+ ## 2b. 📐 Spec Workflow (features only, opt-in by command)
30
+ - `/spec-new` → `/spec-apply` → `/spec-archive`. Specs live in `spec/` (config, changes, specs backbone).
31
+ - Bugs and small tasks: no spec, work directly.
32
+ - After the user corrects a mistake, suggest `/learn` so it never repeats.
33
+
23
34
  ## 3. 🧪 Zero-Token Local Verification Loop
24
35
  After modifying code, execute local verification based on project stack:
25
36
  - **Node/TS/NestJS:** `npm run lint:fix && npm run typecheck`
package/bin/cli.js CHANGED
@@ -41,6 +41,21 @@ 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 BACKBONE.md and spec/ (never overwrite existing files)
45
+ const templates = [
46
+ ['BACKBONE.md', 'project map loaded every session; run /backbone-init to fill it'],
47
+ ['spec/config.md', 'rules for /spec-new'],
48
+ ];
49
+ for (const [file, purpose] of templates) {
50
+ const dest = join(targetDir, file);
51
+ if (existsSync(dest)) {
52
+ console.log(` ⚠️ Kept your existing ${file}`);
53
+ } else {
54
+ await cp(join(packageRoot, 'templates', file), dest);
55
+ console.log(` ✅ Created ${file} (${purpose})`);
56
+ }
57
+ }
58
+
44
59
  console.log('\n🎉 Successfully initialized Claudify!');
45
60
  console.log('👉 Next Steps:');
46
61
  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.7",
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,40 @@
1
+ # Project Backbone
2
+
3
+ > Loaded every session. A map, not documentation: link to details, never copy them. Keep under ~80 lines.
4
+ > Fill with `/backbone-init`; kept in sync by `/spec-new`, `/spec-archive` and `/learn`; after work done without specs, run `/backbone-sync`.
5
+
6
+ Last synced: <commit> (<date>)
7
+
8
+ ## Overview
9
+ - What: <one or two lines: what the system does and for whom>
10
+ - Stack: <languages, frameworks, infra>
11
+
12
+ ## Structure
13
+ | Path / repo | Role |
14
+ |---|---|
15
+ | <path> | <what lives there> |
16
+
17
+ ## Docs index
18
+ | Doc | About | Status |
19
+ |---|---|---|
20
+ | <path> | <topic> | current / outdated (do not use for X) |
21
+
22
+ ## Capabilities
23
+ <!-- One line per spec/specs/<capability>.md -->
24
+ - <capability>: <one line>
25
+
26
+ ## Open changes
27
+ <!-- One line per spec/changes/<name>.md not yet archived -->
28
+ - none
29
+
30
+ ## Commands
31
+ - Install: <cmd>
32
+ - Verify (DoD default): <lint && typecheck && test>
33
+
34
+ ## Invariants
35
+ <!-- Rules every change MUST respect. One line each. -->
36
+ - <e.g. money amounts are integers in base units, never floats>
37
+
38
+ ## Conventions
39
+ - Branch / commit: <e.g. feat/<topic> from develop, conventional commits>
40
+ - Language & style: <e.g. Vietnamese prose, English technical terms>
@@ -0,0 +1,16 @@
1
+ # Spec Config
2
+
3
+ > Rules for writing spec changes, read by `/spec-new` only. Project context, invariants and commands live in `BACKBONE.md`.
4
+
5
+ ## Proposal
6
+ - Must have Why, Scope (in / out = Non-goals), Depends on, Risks.
7
+ - Reference docs by section instead of copying them.
8
+
9
+ ## Requirements
10
+ - `#### ADDED|MODIFIED|REMOVED Requirement: <name>` containing SHALL or MUST.
11
+ - Each has scenarios GIVEN / WHEN / THEN with concrete values: at least one happy path and one failure.
12
+
13
+ ## Tasks
14
+ - Each task fits in 2-4 hours, lists files/packages touched and its DoD.
15
+ - Tests ship with the task that adds the logic, not at the end.
16
+ - DoD default: the Verify command in `BACKBONE.md`.