praxis-agent 0.12.0 → 0.14.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.
@@ -0,0 +1,72 @@
1
+ const LEGACY_DESCRIPTION = 'Initialize a new CLAUDE.md file with codebase documentation';
2
+ const ENHANCED_DESCRIPTION = 'Initialize new CLAUDE.md file(s) and optional skills/hooks with codebase documentation';
3
+ const LEGACY_PROMPT = `Analyze this repository and create a CLAUDE.md that will guide future coding-agent sessions in this project.
4
+
5
+ Document only information that requires repository-wide investigation:
6
+ - the commands developers actually use to build, lint, test, and run one focused test;
7
+ - the high-level architecture and relationships that are not obvious from opening a single file.
8
+
9
+ Read the README, manifests, build configuration, and any existing instructions for Cursor, Copilot, Windsurf, Cline, or other coding agents. Preserve useful project-specific guidance from them.
10
+
11
+ If CLAUDE.md already exists, inspect it and propose targeted improvements instead of replacing it silently. Do not invent workflows, repeat facts, enumerate an easily discoverable file tree, or add generic advice about testing, security, clean code, or error handling.
12
+
13
+ When creating the file, begin with exactly:
14
+
15
+ # CLAUDE.md
16
+
17
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.`;
18
+ const ENHANCED_PROMPT = `Set up concise Claude Code instructions for this repository. The result may include a project CLAUDE.md, a private CLAUDE.local.md, project skills, and hooks, but only the artifacts the user chooses. Instructions load on every session, so retain only information whose absence would cause mistakes.
19
+
20
+ Phase 1 — choose the scope
21
+ Use AskUserQuestion to ask both of these before exploring:
22
+ 1. Which instruction files to configure: the team-shared project CLAUDE.md, the private CLAUDE.local.md, or both. Explain that the project file is committed and contains shared architecture, conventions, and workflows, while the local file is gitignored and contains personal role, sandbox, test-data, and communication preferences.
23
+ 2. Whether to add skills and hooks: both, skills only, hooks only, or neither. Explain that skills are invoked on demand and hooks are deterministic commands tied to tool events.
24
+ Do not label any scope choice as recommended.
25
+
26
+ Phase 2 — survey the repository
27
+ Launch an Agent to inspect relevant manifests, README and build files, CI, existing CLAUDE.md and .claude/rules, AGENTS.md, other coding-assistant instructions, .mcp.json, existing skills, formatter configuration, and git worktrees. Determine languages, frameworks, package manager, project layout, nonstandard build/test/lint commands, single-test syntax, style deviations, required environment setup, hidden gotchas, and whether personal instructions must work across sibling worktrees. Record only questions the files cannot answer.
28
+
29
+ Phase 3 — resolve unknowns and approve a proposal
30
+ Ask focused follow-up questions for facts that were not discoverable. Project questions concern team conventions and repository quirks; personal questions concern the user's role, familiarity, private test setup, and response preferences. If sibling or external worktrees exist, determine whether a shared home-directory personal-instructions file is required.
31
+
32
+ Build a compact proposal from the findings. Classify deterministic per-edit enforcement as a hook, reusable workflows as skills, and behavioral preferences as instruction-file notes. Treat the user's skills/hooks choice as a hard constraint and downgrade suggestions to an allowed artifact type when necessary. Present the proposal only through AskUserQuestion option previews: one concise markdown line per item, no separate preceding explanation, with short accept/drop labels.
33
+
34
+ Phase 4 — project instructions
35
+ If selected, create or improve the repository-root CLAUDE.md. Include only non-obvious commands, testing quirks, style differences, repository etiquette, required setup, architectural decisions, and important existing assistant rules. Prefer @path imports for long or frequently changing references. Do not include generic practices, tutorials, obvious manifest commands, exhaustive file listings, or invented sections. Begin a new file with:
36
+
37
+ # CLAUDE.md
38
+
39
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
40
+
41
+ If the file exists, show specific proposed diffs and explain them before editing. For separate concerns, offer scoped .claude/rules files; for monorepos, offer subdirectory CLAUDE.md files.
42
+
43
+ Phase 5 — personal instructions
44
+ If selected, create or improve a minimal repository-root CLAUDE.local.md and ensure CLAUDE.local.md is ignored by git. Store role, familiarity, private local setup, and personal communication/workflow preferences there. Never overwrite an existing file silently. For sibling or external worktrees, place the real private content in ~/.claude/<project-name>-instructions.md and make each CLAUDE.local.md a one-line @ import; never add that private import to the shared CLAUDE.md.
45
+
46
+ Phase 6 — skills
47
+ If selected, turn every approved skill proposal into .claude/skills/<name>/SKILL.md with valid name and description frontmatter and repository-specific instructions. Review existing skills first and never overwrite them. Add disable-model-invocation: true to side-effecting workflows and use $ARGUMENTS when input is needed. Suggest extra skills only for repeatable workflows or specialist reference knowledge genuinely present in this repository.
48
+
49
+ Phase 7 — environment and hooks
50
+ Check for GitHub remotes and gh, an appropriate linter, tests, and a formatter. Offer only missing, relevant improvements. If hooks were selected, consume approved hook proposals and optionally offer format-on-edit when a formatter exists. Choose project settings.json for shared hooks and settings.local.json for personal hooks; ask once if ambiguous. Map after-edit behavior to PostToolUse Write|Edit, end-of-turn behavior to Stop, and pre-shell behavior to PreToolUse Bash. A literal pre-commit check belongs in the repository's git hook system, not a Bash matcher. Use the update-config skill's hooks-only flow when it is available; otherwise apply the same deduplicate, construct, pipe-test, JSON-validate, live-proof, and cleanup sequence directly. Act on each accepted improvement before continuing.
51
+
52
+ Phase 8 — handoff
53
+ List every file created or changed and summarize its important contents. Tell the user to review and tune the result and that /init may be rerun. Then provide one prioritized list of repository-specific next improvements. Always mention the official skill-creator plugin for creating or evaluating skills and /plugin for browsing official plugins; suggest frontend-design or Playwright plugins only when the detected project makes them relevant.`;
54
+ function envEnabled(value) {
55
+ if (value === undefined)
56
+ return false;
57
+ return ['1', 'true', 'yes', 'on'].includes(value.trim().toLowerCase());
58
+ }
59
+ export function enhancedClaudeInitEnabled(environment = process.env) {
60
+ return envEnabled(environment.CLAUDE_CODE_NEW_INIT);
61
+ }
62
+ export function claudeInitDescription(environment = process.env) {
63
+ return enhancedClaudeInitEnabled(environment)
64
+ ? ENHANCED_DESCRIPTION
65
+ : LEGACY_DESCRIPTION;
66
+ }
67
+ export function claudeInitPrompt(environment = process.env) {
68
+ return enhancedClaudeInitEnabled(environment)
69
+ ? ENHANCED_PROMPT
70
+ : LEGACY_PROMPT;
71
+ }
72
+ //# sourceMappingURL=claude-init-command.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "praxis-agent",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Local-first, single-user general agent for the command line.",
5
5
  "license": "MIT",
6
6
  "author": "wuqisen",