claudeforge-cli 1.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.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +431 -0
  3. package/bin/cli.js +155 -0
  4. package/package.json +43 -0
  5. package/src/commands/add.js +205 -0
  6. package/src/commands/create.js +218 -0
  7. package/src/commands/github.js +479 -0
  8. package/src/commands/init.js +107 -0
  9. package/src/commands/project.js +123 -0
  10. package/src/commands/status.js +183 -0
  11. package/src/commands/upgrade.js +114 -0
  12. package/src/index.js +6 -0
  13. package/src/logger.js +90 -0
  14. package/src/scaffolder.js +45 -0
  15. package/src/stack-detector.js +62 -0
  16. package/templates/.env.example.tpl +21 -0
  17. package/templates/.gitignore.tpl +40 -0
  18. package/templates/CLAUDE.local.md.tpl +32 -0
  19. package/templates/CLAUDE.md.tpl +112 -0
  20. package/templates/claude/README.md.tpl +94 -0
  21. package/templates/claude/agents/code-reviewer.md.tpl +142 -0
  22. package/templates/claude/commands/commit.md.tpl +34 -0
  23. package/templates/claude/commands/explain-codebase.md.tpl +37 -0
  24. package/templates/claude/commands/fix-issue.md.tpl +43 -0
  25. package/templates/claude/commands/memory-sync.md.tpl +49 -0
  26. package/templates/claude/commands/project-health.md.tpl +70 -0
  27. package/templates/claude/commands/review-pr.md.tpl +43 -0
  28. package/templates/claude/commands/scaffold-structure.md.tpl +308 -0
  29. package/templates/claude/commands/setup-project.md.tpl +253 -0
  30. package/templates/claude/commands/standup.md.tpl +34 -0
  31. package/templates/claude/hooks/post-tool-use.sh.tpl +44 -0
  32. package/templates/claude/hooks/pre-tool-use.sh.tpl +64 -0
  33. package/templates/claude/rules/no-sensitive-files.md.tpl +29 -0
  34. package/templates/claude/settings.json.tpl +50 -0
  35. package/templates/claude/settings.local.json.tpl +4 -0
  36. package/templates/claude/skills/project-conventions/SKILL.md.tpl +39 -0
  37. package/templates/mcp.json.tpl +9 -0
  38. package/templates/memory/MEMORY.md.tpl +37 -0
  39. package/templates/memory/feedback_communication.md.tpl +29 -0
  40. package/templates/memory/project_ai_workflow.md.tpl +43 -0
  41. package/templates/memory/user_profile.md.tpl +30 -0
@@ -0,0 +1,40 @@
1
+ # ── Claude Code — personal / local files (not team-shared) ──────────────────
2
+ .claude/settings.local.json
3
+ CLAUDE.local.md
4
+
5
+ # Claude Code — runtime artifacts
6
+ .claude/backups/
7
+ .claude/cache/
8
+ .claude/debug/
9
+ .claude/history.jsonl
10
+
11
+ # ── MCP servers ──────────────────────────────────────────────────────────────
12
+ # .mcp.json is committed (team-shared server config)
13
+ .mcp.local.json
14
+
15
+ # ── Environment & secrets ────────────────────────────────────────────────────
16
+ .env
17
+ .env.local
18
+ .env.*.local
19
+
20
+ # ── Memory — personal files are gitignored, project files are shared ─────────
21
+ memory/user_profile.md
22
+
23
+ # ── OS artifacts ─────────────────────────────────────────────────────────────
24
+ .DS_Store
25
+ Thumbs.db
26
+ Desktop.ini
27
+
28
+ # ── Node ──────────────────────────────────────────────────────────────────────
29
+ node_modules/
30
+ npm-debug.log*
31
+ yarn-debug.log*
32
+ yarn-error.log*
33
+ *.log
34
+
35
+ # ── Build output ──────────────────────────────────────────────────────────────
36
+ dist/
37
+ build/
38
+ out/
39
+ .next/
40
+ .nuxt/
@@ -0,0 +1,32 @@
1
+ # Local Claude Context
2
+
3
+ > This file is **gitignored** — add personal context that should NOT be shared with the team.
4
+ > Complement `CLAUDE.md` (team-shared) with your own preferences and local environment notes.
5
+
6
+ ---
7
+
8
+ ## My Preferences
9
+
10
+ > Examples — replace with your actual preferences.
11
+
12
+ - [ ] I prefer terse responses — skip trailing summaries after completing tasks
13
+ - [ ] Always show the git diff before committing so I can review
14
+ - [ ] Explain *why* before making architectural changes
15
+
16
+ ---
17
+
18
+ ## Local Environment
19
+
20
+ > Document anything about your local setup that differs from the team default.
21
+
22
+ - [ ] e.g., "Local DB runs on port 5433 (not 5432) — already in my .env"
23
+ - [ ] e.g., "I use nvm — run `nvm use` before any node commands"
24
+ - [ ] e.g., "Docker Desktop is aliased as `d` in my shell"
25
+
26
+ ---
27
+
28
+ ## Personal Notes
29
+
30
+ > Scratch space for things you want Claude to know about your current work,
31
+ > but that don't belong in the shared project memory.
32
+
@@ -0,0 +1,112 @@
1
+ # [Project Name]
2
+
3
+ > One-line description of what this project does.
4
+
5
+ ---
6
+
7
+ ## Commands
8
+
9
+ Replace these with your project's actual commands.
10
+
11
+ | Command | Description |
12
+ |---------|-------------|
13
+ | `npm install` | Install dependencies |
14
+ | `npm run dev` | Start development server |
15
+ | `npm run build` | Production build |
16
+ | `npm test` | Run test suite |
17
+ | `npm run lint` | Lint and type-check |
18
+
19
+ ---
20
+
21
+ ## Architecture
22
+
23
+ ```
24
+ <project-root>/
25
+ src/ # Application source code
26
+ tests/ # Test files
27
+ .claude/ # Claude Code configuration (agents, commands, hooks, skills)
28
+ memory/ # Persistent project memory for Claude
29
+ .mcp.json # MCP server configuration (team-shared)
30
+ CLAUDE.md # This file — Claude's project context
31
+ ```
32
+
33
+ > Update this tree to reflect the actual structure after scaffolding.
34
+
35
+ ---
36
+
37
+ ## Key Files
38
+
39
+ | File | Purpose |
40
+ |------|---------|
41
+ | `CLAUDE.md` | This file — project context loaded by Claude automatically |
42
+ | `CLAUDE.local.md` | Personal context (gitignored) |
43
+ | `.claude/settings.json` | Claude Code permissions, model, and hooks (team-shared) |
44
+ | `.claude/settings.local.json` | Personal Claude settings override (gitignored) |
45
+ | `.mcp.json` | MCP server definitions (team-shared) |
46
+ | `memory/MEMORY.md` | Index of persistent memory files |
47
+
48
+ ---
49
+
50
+ ## Code Style
51
+
52
+ > Add your project's conventions here. Claude reads this before writing code.
53
+
54
+ - [ ] Language and version (e.g., TypeScript 5.x, Python 3.12)
55
+ - [ ] Formatter and rules (e.g., Prettier with 2-space indent, ESLint)
56
+ - [ ] Naming conventions (e.g., `camelCase` functions, `PascalCase` components)
57
+ - [ ] Import style (e.g., named exports only, no default exports)
58
+ - [ ] Test framework and patterns (e.g., Vitest, co-located `*.test.ts`)
59
+
60
+ ---
61
+
62
+ ## Environment Variables
63
+
64
+ Required variables (see `.env.example` for the full list):
65
+
66
+ | Variable | Description |
67
+ |----------|-------------|
68
+ | `NODE_ENV` | `development` or `production` |
69
+
70
+ Copy `.env.example` → `.env` and fill in values before running locally.
71
+
72
+ ---
73
+
74
+ ## Claude Workflow
75
+
76
+ ### Slash Commands
77
+
78
+ | Command | When to use |
79
+ |---------|------------|
80
+ | `/commit` | After completing a feature — stages and commits with conventional message |
81
+ | `/review-pr` | Before opening a PR — reviews the diff and flags issues |
82
+
83
+ ### Agents
84
+
85
+ | Agent | When to use |
86
+ |-------|------------|
87
+ | `code-reviewer` | After implementing a feature, before creating a PR |
88
+
89
+ ### Memory
90
+
91
+ Claude maintains persistent memory in `memory/`. Tell Claude to "remember" facts
92
+ and it will update the appropriate file. These persist across sessions.
93
+
94
+ ---
95
+
96
+ ## Gotchas
97
+
98
+ > Non-obvious things that cause issues. Add them as you discover them.
99
+
100
+ - [ ] Add known pitfalls here
101
+ - [ ] e.g., "Service X requires VPN — requests silently fail without it"
102
+ - [ ] e.g., "Always run migrations before starting the dev server"
103
+
104
+ ---
105
+
106
+ ## Resources
107
+
108
+ > Links to internal docs, design docs, runbooks, etc.
109
+
110
+ - [ ] Architecture decision records (ADRs)
111
+ - [ ] API documentation
112
+ - [ ] Deployment runbook
@@ -0,0 +1,94 @@
1
+ # .claude/ — Claude Code Configuration
2
+
3
+ This directory configures Claude Code for this project.
4
+ It is **team-shared** (committed to git), except for `settings.local.json`.
5
+
6
+ ---
7
+
8
+ ## Directory Structure
9
+
10
+ | Path | Purpose |
11
+ |------|---------|
12
+ | `settings.json` | Team settings: model, permissions, hooks |
13
+ | `settings.local.json` | Personal overrides — **gitignored, never commit** |
14
+ | `agents/` | Sub-agent definitions (`.md` files invoked via the Agent tool) |
15
+ | `commands/` | Slash command scripts — invoke with `/command-name` in Claude Code |
16
+ | `hooks/` | Shell scripts run automatically on tool events (PreToolUse, PostToolUse) |
17
+ | `rules/` | Reusable rule files referenced by agents or hooks |
18
+ | `skills/` | Skill definitions — each skill is a subdirectory containing `SKILL.md` |
19
+
20
+ ---
21
+
22
+ ## Settings Priority
23
+
24
+ Claude Code merges settings in this order (later wins):
25
+
26
+ 1. **Global** — `~/.claude/settings.json`
27
+ 2. **Project shared** — `.claude/settings.json` ← this file
28
+ 3. **Project local** — `.claude/settings.local.json` ← personal overrides (gitignored)
29
+
30
+ ---
31
+
32
+ ## Adding Slash Commands
33
+
34
+ Create a `.md` file in `commands/` with optional YAML frontmatter:
35
+
36
+ ```markdown
37
+ ---
38
+ description: What this command does (shown in the command palette)
39
+ allowed-tools: Bash(git:*), Read, Edit
40
+ ---
41
+
42
+ Instructions for Claude when this command is invoked...
43
+ ```
44
+
45
+ Invoke with `/command-name` in the Claude Code chat.
46
+
47
+ ---
48
+
49
+ ## Adding Sub-Agents
50
+
51
+ Create a `.md` file in `agents/` with YAML frontmatter:
52
+
53
+ ```markdown
54
+ ---
55
+ name: my-agent
56
+ description: When Claude should use this agent and what it does — be specific
57
+ model: sonnet
58
+ color: blue
59
+ ---
60
+
61
+ Agent system prompt here...
62
+ ```
63
+
64
+ Claude will automatically invoke agents when their description matches the task.
65
+
66
+ ---
67
+
68
+ ## Adding Skills
69
+
70
+ Create `skills/<skill-name>/SKILL.md` with frontmatter:
71
+
72
+ ```markdown
73
+ ---
74
+ name: skill-name
75
+ description: Specific trigger condition — when should Claude invoke this skill?
76
+ user-invocable: true
77
+ ---
78
+
79
+ Skill instructions...
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Hook Scripts
85
+
86
+ Hook scripts in `hooks/` receive a JSON blob on `stdin` describing the tool event
87
+ and can output JSON to `stdout` to influence Claude's behavior:
88
+
89
+ - `{"decision": "block", "reason": "..."}` — prevents the tool from running
90
+ - `{"decision": "warn", "reason": "..."}` — shows a warning but allows the tool
91
+ - `{"systemMessage": "..."}` — injects a message into Claude's context (PostToolUse)
92
+ - Empty output — allows the tool to proceed normally
93
+
94
+ See [Claude Code Hooks documentation](https://docs.anthropic.com/en/docs/claude-code/hooks) for the full schema.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: code-reviewer
3
+ description: Use this agent to review recently written or modified code. Invoke proactively after implementing any feature, fixing a bug, or before opening a pull request. Pass specific files to review, or it defaults to all unstaged changes. The agent checks correctness, security, performance, test coverage, style, and documentation — and gives actionable fixes, not just observations.
4
+ model: sonnet
5
+ color: green
6
+ ---
7
+
8
+ You are a senior code reviewer. Your job is to catch real problems before they reach production. You review code the way a staff engineer at a high-quality team would: methodically, specifically, and without ego.
9
+
10
+ ## Default Scope
11
+
12
+ Review `git diff HEAD` (all unstaged changes) unless the caller specifies particular files, a commit range, or a PR branch.
13
+
14
+ ---
15
+
16
+ ## Review Process
17
+
18
+ **Step 1 — Orient yourself**
19
+ Before reviewing, read:
20
+ 1. `CLAUDE.md` — project conventions, stack, style rules
21
+ 2. The surrounding context of each changed file (not just the diff)
22
+ 3. Any test files related to the changed code
23
+
24
+ **Step 2 — Check each category below**
25
+ Work through every category systematically. Do not skip categories even if the change looks small.
26
+
27
+ **Step 3 — Report findings**
28
+ Use the output format below. Every issue must have a file, line, and a concrete fix — not just an observation.
29
+
30
+ ---
31
+
32
+ ## Category 1 — Correctness
33
+
34
+ - [ ] Does the logic match the intended behavior? Trace the happy path manually.
35
+ - [ ] Are all edge cases handled? (empty input, null/nil/None, zero, negative numbers, empty arrays/maps)
36
+ - [ ] Off-by-one errors in loops, slices, pagination, or index arithmetic
37
+ - [ ] Incorrect operator precedence or boolean logic (`&&` vs `||`, `==` vs `===`)
38
+ - [ ] Mutation of shared state that should be immutable
39
+ - [ ] Incorrect handling of async/concurrent operations (missing await, race conditions)
40
+ - [ ] Wrong return type or missing return in a code path
41
+ - [ ] Shadowed variables or unintended variable reuse
42
+
43
+ ## Category 2 — Security
44
+
45
+ - [ ] Hardcoded secrets, API keys, tokens, or passwords in any form (including base64)
46
+ - [ ] User input passed to shell commands, SQL queries, or template engines without sanitization
47
+ - [ ] SQL injection risk — string concatenation into queries instead of parameterized queries
48
+ - [ ] Path traversal — user-controlled file paths not validated against a safe root
49
+ - [ ] Insecure deserialization (pickle, eval, exec, fromCharCode patterns)
50
+ - [ ] SSRF risk — URLs constructed from user input that hit internal services
51
+ - [ ] Missing authentication or authorization checks on sensitive endpoints
52
+ - [ ] Sensitive data (PII, tokens) logged to stdout or error messages
53
+ - [ ] Dependencies with known CVEs introduced in this change
54
+
55
+ ## Category 3 — Error Handling & Reliability
56
+
57
+ - [ ] Errors swallowed silently (`catch (_) {}`, bare `except:`, empty catch blocks)
58
+ - [ ] Missing error propagation — callers can't know an operation failed
59
+ - [ ] No timeout on external API calls, database queries, or network I/O
60
+ - [ ] No retry logic for transient failures (network, database connections)
61
+ - [ ] Resource leaks — files, connections, or handles opened but not closed in all paths
62
+ - [ ] Panics/exceptions from nil/null dereference on values that could be absent
63
+ - [ ] Missing circuit breaker pattern for calls to unreliable dependencies
64
+ - [ ] Error messages that expose internal stack traces to end users
65
+
66
+ ## Category 4 — Performance
67
+
68
+ - [ ] N+1 query problem — database query inside a loop
69
+ - [ ] Missing database index on columns used in WHERE, JOIN, or ORDER BY clauses
70
+ - [ ] Unnecessary data loading — fetching all columns/rows when only a subset is needed
71
+ - [ ] Repeated computation inside a loop that could be hoisted out
72
+ - [ ] Unbounded growth — lists/maps that accumulate without a cap or TTL
73
+ - [ ] Synchronous blocking call on a hot path that could be async
74
+ - [ ] Large payload serialized/deserialized unnecessarily
75
+ - [ ] O(n²) algorithm where O(n log n) or O(n) exists for the problem size
76
+
77
+ ## Category 5 — Test Coverage
78
+
79
+ - [ ] Is the new behavior covered by at least one test?
80
+ - [ ] Are the error paths tested, not just the happy path?
81
+ - [ ] Are edge cases tested (empty, nil/null, boundary values)?
82
+ - [ ] Do tests actually assert meaningful behavior, or just that the function runs?
83
+ - [ ] Are tests isolated — do they depend on external state, timing, or each other?
84
+ - [ ] Is there a test that would catch a regression if this code were reverted?
85
+ - [ ] Are mocks/stubs used correctly — do they verify call arguments, not just return values?
86
+
87
+ ## Category 6 — Code Style & Maintainability
88
+
89
+ - [ ] Does the code match the naming conventions in `CLAUDE.md` and surrounding files?
90
+ - [ ] Functions/methods longer than ~40 lines that could be decomposed
91
+ - [ ] Magic numbers or strings that should be named constants
92
+ - [ ] Comments that describe *what* the code does (redundant) instead of *why*
93
+ - [ ] Commented-out code or debug logging left in (`console.log`, `print`, `fmt.Println`)
94
+ - [ ] Duplicate logic that violates DRY and should be extracted
95
+ - [ ] Function/method names that are misleading or too vague (`handle`, `process`, `data`)
96
+ - [ ] Exported/public API that's wider than necessary (could be unexported/private)
97
+
98
+ ## Category 7 — Documentation
99
+
100
+ - [ ] Public functions/methods missing docstrings (if project convention requires them)
101
+ - [ ] Complex or non-obvious logic with no inline explanation
102
+ - [ ] API-facing changes not reflected in any docs, OpenAPI spec, or changelog
103
+ - [ ] `CLAUDE.md` or `memory/` files that should be updated to reflect this change
104
+
105
+ ---
106
+
107
+ ## Output Format
108
+
109
+ **Always start with the scope**: state which files and commits you reviewed.
110
+
111
+ For each issue:
112
+
113
+ ```
114
+ **[SEVERITY]** `path/to/file.ts:42`
115
+ **Category**: [one of: Correctness | Security | Error Handling | Performance | Tests | Style | Documentation]
116
+ **Issue**: [Clear, specific description of the problem]
117
+ **Fix**: [Concrete code change or action — not "consider refactoring", but "replace X with Y"]
118
+ ```
119
+
120
+ Severity levels:
121
+ - `CRITICAL` — bug, security vulnerability, or data loss risk. Must be fixed before merge.
122
+ - `WARNING` — likely causes problems under real conditions. Should be fixed before merge.
123
+ - `SUGGESTION` — improvement that would meaningfully reduce risk or improve clarity. Can be a follow-up.
124
+
125
+ **End every review with a verdict:**
126
+
127
+ | Verdict | Meaning |
128
+ |---------|---------|
129
+ | `✓ LGTM` | No issues found — ready to merge |
130
+ | `~ LGTM with suggestions` | Only SUGGESTION-level items — safe to merge, follow-ups welcome |
131
+ | `⚠ Address warnings` | One or more WARNING items — fix recommended before merge |
132
+ | `✗ Needs changes` | One or more CRITICAL items — must be fixed before merge |
133
+
134
+ ---
135
+
136
+ ## Important Rules
137
+
138
+ - If you find nothing wrong in a category, say "No issues found" for that category. Do not invent nitpicks.
139
+ - Every CRITICAL and WARNING must have a concrete fix, not just a description.
140
+ - If a fix requires reading another file you haven't seen, read it before reporting.
141
+ - Do not comment on style issues that are consistent with the rest of the codebase — only flag inconsistencies.
142
+ - If the change is in a test file, focus on test quality (Categories 5 and 6) rather than production code concerns.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Stage relevant changes and create a conventional git commit with a well-formed message
3
+ allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git add:*), Bash(git commit:*)
4
+ ---
5
+
6
+ ## Context
7
+
8
+ Review the current repository state before committing:
9
+
10
+ - Working tree status: !`git status`
11
+ - Full diff (staged + unstaged): !`git diff HEAD`
12
+ - Current branch: !`git branch --show-current`
13
+ - Recent commits (for message style reference): !`git log --oneline -10`
14
+
15
+ ## Task
16
+
17
+ Analyze the changes above and create a single commit:
18
+
19
+ 1. **Stage** only the files relevant to the current change (avoid staging unrelated files)
20
+ 2. **Write a commit message** following Conventional Commits format:
21
+ ```
22
+ type(scope): short description under 72 chars
23
+
24
+ Optional body explaining WHY, not what (the diff shows the what).
25
+ ```
26
+ Valid types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `ci`
27
+ 3. **Run the commit** in a single `git commit -m "..."` call
28
+
29
+ ## Rules
30
+
31
+ - Never use `git add .` or `git add -A` — stage files by name
32
+ - Never skip hooks with `--no-verify`
33
+ - If the diff is empty or nothing relevant is staged, report that instead of committing
34
+ - Subject line must be under 72 characters
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Get a thorough explanation of how this codebase is structured and how the key parts work. Useful when onboarding to a new project. Pass a specific area to focus on, or leave empty for a full overview.
3
+ allowed-tools: Read, Glob, Grep, Bash(ls:*), Bash(git log:*), Bash(find:*)
4
+ ---
5
+
6
+ ## Context
7
+
8
+ - Project root: !`ls -la`
9
+ - Source files: !`find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \) -not -path "*/node_modules/*" -not -path "*/.git/*" | head -40`
10
+ - CLAUDE.md: !`cat CLAUDE.md 2>/dev/null || echo "(no CLAUDE.md)"`
11
+ - Recent changes: !`git log --oneline -10 2>/dev/null`
12
+ - Entry points: !`cat package.json 2>/dev/null || cat go.mod 2>/dev/null || cat pyproject.toml 2>/dev/null || echo "(no manifest found)"`
13
+
14
+ **Focus area**: $ARGUMENTS
15
+
16
+ ## Task
17
+
18
+ Produce a clear explanation of this codebase tailored to someone who needs to contribute to it.
19
+
20
+ ### Structure
21
+ Start with the directory layout and what each top-level folder/file does.
22
+
23
+ ### How It Works
24
+ Explain the main flow: how a request/event/input enters the system and what happens to it. Trace the path through the key files.
25
+
26
+ ### Key Concepts
27
+ Explain any domain-specific patterns, abstractions, or conventions that aren't obvious from the code alone. What do you need to understand to make changes confidently?
28
+
29
+ ### Entry Points
30
+ Where does execution start? What are the main files someone would edit for common tasks (adding a feature, fixing a bug, adding a test)?
31
+
32
+ ### What to Read First
33
+ If someone is new and wants to understand the codebase in 30 minutes, which 3–5 files should they read and in what order?
34
+
35
+ ${ARGUMENTS ? `\nFocus especially on: ${ARGUMENTS}` : ''}
36
+
37
+ Keep the explanation practical — oriented toward making changes, not just describing what exists.
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Investigate and fix a bug or failing test. Pass the error message, issue number, or description of the problem. Usage: /fix-issue "TypeError: cannot read property of undefined in auth.ts:42"
3
+ allowed-tools: Read, Edit, MultiEdit, Bash(git status:*), Bash(git diff:*), Bash(npm test:*), Bash(pytest:*), Bash(go test:*), Grep, Glob
4
+ ---
5
+
6
+ ## Context
7
+
8
+ - Working state: !`git status --short`
9
+ - Recent changes that may have introduced the bug: !`git log --oneline -5`
10
+
11
+ **Issue**: $ARGUMENTS
12
+
13
+ ## Task
14
+
15
+ Investigate and fix the issue described above. Follow this process:
16
+
17
+ ### 1. Understand Before Changing
18
+
19
+ - Read the error message or description carefully
20
+ - Locate the relevant files (use Grep/Glob to find them)
21
+ - Read the failing code and understand what it's supposed to do
22
+ - Check git log for when this code last changed: `git log -p --follow <file>`
23
+ - Form a hypothesis before writing any code
24
+
25
+ ### 2. Minimal Fix
26
+
27
+ - Make the smallest change that fixes the root cause
28
+ - Do NOT refactor surrounding code, rename variables, or "improve" things you didn't break
29
+ - If the fix requires touching more than 3 files, pause and explain the approach first
30
+
31
+ ### 3. Verify
32
+
33
+ After the fix:
34
+ - Run the relevant tests to confirm the fix works
35
+ - Check that you haven't introduced regressions in related tests
36
+ - If no tests cover this behavior, note that a test should be added
37
+
38
+ ### 4. Explain
39
+
40
+ Briefly explain:
41
+ - What was wrong (root cause, not just symptom)
42
+ - What the fix does
43
+ - Whether a test should be added and why
@@ -0,0 +1,49 @@
1
+ ---
2
+ description: Update the memory files based on what you learned this session. Run at the end of a work session to persist context across future sessions.
3
+ allowed-tools: Read, Write, Edit
4
+ ---
5
+
6
+ ## Context
7
+
8
+ Read the current memory files to understand what's already recorded:
9
+
10
+ - Memory index: !`cat memory/MEMORY.md 2>/dev/null || echo "(not found)"`
11
+ - User profile: !`cat memory/user_profile.md 2>/dev/null || echo "(not found)"`
12
+ - Communication feedback: !`cat memory/feedback_communication.md 2>/dev/null || echo "(not found)"`
13
+ - Project workflow: !`cat memory/project_ai_workflow.md 2>/dev/null || echo "(not found)"`
14
+
15
+ ## Task
16
+
17
+ Review this conversation and update the memory files with anything worth persisting.
18
+
19
+ ### What to look for:
20
+
21
+ **user_profile.md** — Update if you learned:
22
+ - The user's role, team, or background
23
+ - Technical areas they're strong or weak in
24
+ - Working preferences they've stated or implied
25
+ - Communication style they prefer
26
+
27
+ **feedback_communication.md** — Update if you noticed:
28
+ - Something the user corrected ("don't do X", "stop doing Y")
29
+ - An approach they confirmed works well ("yes, exactly", "keep doing that")
30
+ - Response format preferences (terse vs. detailed, bullet lists vs. prose, etc.)
31
+ - Any non-obvious preferences worth remembering
32
+
33
+ **project_ai_workflow.md** — Update if you learned:
34
+ - New agents or commands created this session
35
+ - Project-specific conventions discovered while working
36
+ - External systems, APIs, or tools integrated
37
+ - Important architectural decisions made this session
38
+ - Deadlines, freezes, or priorities with dates
39
+
40
+ ### Rules for updating memory:
41
+
42
+ 1. **Lead with the rule/fact**, then add **Why:** and **How to apply:** lines
43
+ 2. **Don't duplicate** — check if the fact is already recorded before adding
44
+ 3. **Be specific** — "user prefers terse responses" is better than "user has preferences"
45
+ 4. **Convert relative dates** to absolute dates (e.g., "Thursday" → the actual date)
46
+ 5. **Update or remove** stale entries rather than appending contradictions
47
+ 6. **Keep MEMORY.md index concise** — one line per file, under 150 chars
48
+
49
+ After updating, print a brief summary of what was added or changed.
@@ -0,0 +1,70 @@
1
+ ---
2
+ description: Audit the Claude Code project setup and report what's missing, incomplete, or could be improved. Run this after init to see what still needs attention.
3
+ allowed-tools: Read, Bash(ls:*), Bash(cat:*), Bash(find:*), Glob, Grep
4
+ ---
5
+
6
+ ## Context
7
+
8
+ Gather the current project state:
9
+
10
+ - Root files: !`ls -la`
11
+ - .claude contents: !`find .claude -type f | sort 2>/dev/null || echo "(no .claude dir)"`
12
+ - Memory files: !`find memory -type f 2>/dev/null || echo "(no memory dir)"`
13
+ - Settings: !`cat .claude/settings.json 2>/dev/null || echo "(no settings.json)"`
14
+ - MCP config: !`cat .mcp.json 2>/dev/null || echo "(no .mcp.json)"`
15
+ - CLAUDE.md: !`cat CLAUDE.md 2>/dev/null || echo "(no CLAUDE.md)"`
16
+ - .gitignore: !`cat .gitignore 2>/dev/null || echo "(no .gitignore)"`
17
+ - Git status: !`git status 2>/dev/null || echo "(not a git repo)"`
18
+
19
+ ## Task
20
+
21
+ Audit the Claude Code setup and produce a **health report** with three sections:
22
+
23
+ ---
24
+
25
+ ### ✓ What's Working Well
26
+
27
+ List things that are properly configured. Be specific — mention file names and what's good about them.
28
+
29
+ ---
30
+
31
+ ### ⚠ Needs Attention
32
+
33
+ For each issue found, format as:
34
+
35
+ **[SEVERITY]** `path/to/file`
36
+ Issue: [what's wrong or missing]
37
+ Fix: [concrete action to take]
38
+
39
+ Check for:
40
+ - `CLAUDE.md` — is it still the generic template? Are commands real or placeholders?
41
+ - `.claude/settings.json` — is the model set? Are permissions appropriate for the stack?
42
+ - `.env.example` — does it have real variables or still generic?
43
+ - `.mcp.json` — is it just context7 or are there project-appropriate servers?
44
+ - `memory/` files — are they still empty templates (under 200 bytes)?
45
+ - `.claude/agents/` — are there only the defaults, or project-specific agents?
46
+ - `.claude/commands/` — are there only the defaults, or project-specific commands?
47
+ - `.claude/hooks/` — do the hook scripts exist and are they executable?
48
+ - `.gitignore` — does it cover secrets, local settings, and the tech stack?
49
+ - Missing `CLAUDE.local.md` — is the personal context file present?
50
+
51
+ ---
52
+
53
+ ### 🚀 Recommended Next Steps
54
+
55
+ Ordered by impact:
56
+
57
+ 1. [Highest impact action]
58
+ 2. [Second action]
59
+ 3. [etc.]
60
+
61
+ **Quick wins** (under 5 minutes):
62
+ - [Action 1]
63
+ - [Action 2]
64
+
65
+ **Bigger improvements**:
66
+ - [Description and why it matters]
67
+
68
+ ---
69
+
70
+ End with: "Run `claudeforge status` in the terminal for a machine-readable summary."