qwen-base 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 (71) hide show
  1. package/README.md +183 -0
  2. package/bin/install.js +227 -0
  3. package/package.json +42 -0
  4. package/src/commands/audit-claude-md.md +44 -0
  5. package/src/commands/audit-claude.md +45 -0
  6. package/src/commands/audit.md +33 -0
  7. package/src/commands/carl-hygiene.md +33 -0
  8. package/src/commands/groom.md +35 -0
  9. package/src/commands/history.md +27 -0
  10. package/src/commands/orientation/tasks/deep-why.md +132 -0
  11. package/src/commands/orientation/tasks/elevator-pitch.md +115 -0
  12. package/src/commands/orientation/tasks/initiatives.md +98 -0
  13. package/src/commands/orientation/tasks/key-values.md +130 -0
  14. package/src/commands/orientation/tasks/new-orientation.md +162 -0
  15. package/src/commands/orientation/tasks/north-star.md +97 -0
  16. package/src/commands/orientation/tasks/project-mapping.md +103 -0
  17. package/src/commands/orientation/tasks/reorientation.md +96 -0
  18. package/src/commands/orientation/tasks/surface-vision.md +113 -0
  19. package/src/commands/orientation/tasks/task-seeding.md +93 -0
  20. package/src/commands/orientation/templates/operator-json.md +88 -0
  21. package/src/commands/orientation.md +87 -0
  22. package/src/commands/pulse.md +33 -0
  23. package/src/commands/scaffold.md +33 -0
  24. package/src/commands/status.md +28 -0
  25. package/src/commands/surface-convert.md +35 -0
  26. package/src/commands/surface-create.md +34 -0
  27. package/src/commands/surface-list.md +27 -0
  28. package/src/commands/weekly-domain.md +34 -0
  29. package/src/commands/weekly.md +39 -0
  30. package/src/framework/context/base-principles.md +69 -0
  31. package/src/framework/frameworks/audit-strategies.md +53 -0
  32. package/src/framework/frameworks/claude-config-alignment.md +256 -0
  33. package/src/framework/frameworks/claudemd-strategy.md +158 -0
  34. package/src/framework/frameworks/satellite-registration.md +44 -0
  35. package/src/framework/tasks/audit-claude-md.md +171 -0
  36. package/src/framework/tasks/audit-claude.md +330 -0
  37. package/src/framework/tasks/audit.md +64 -0
  38. package/src/framework/tasks/carl-hygiene.md +142 -0
  39. package/src/framework/tasks/groom.md +157 -0
  40. package/src/framework/tasks/history.md +34 -0
  41. package/src/framework/tasks/pulse.md +83 -0
  42. package/src/framework/tasks/scaffold.md +389 -0
  43. package/src/framework/tasks/status.md +35 -0
  44. package/src/framework/tasks/surface-convert.md +143 -0
  45. package/src/framework/tasks/surface-create.md +184 -0
  46. package/src/framework/tasks/surface-list.md +42 -0
  47. package/src/framework/tasks/weekly-domain-create.md +173 -0
  48. package/src/framework/tasks/weekly.md +347 -0
  49. package/src/framework/templates/claudemd-template.md +102 -0
  50. package/src/framework/templates/workspace-json.md +96 -0
  51. package/src/framework/utils/scan-claude-dirs.py +549 -0
  52. package/src/hooks/_template.py +130 -0
  53. package/src/hooks/active-hook.py +178 -0
  54. package/src/hooks/apex-insights.py +169 -0
  55. package/src/hooks/backlog-hook.py +115 -0
  56. package/src/hooks/base-pulse-check.py +216 -0
  57. package/src/hooks/operator.py +53 -0
  58. package/src/hooks/psmm-injector.py +67 -0
  59. package/src/hooks/satellite-detection.py +320 -0
  60. package/src/packages/base-mcp/index.js +119 -0
  61. package/src/packages/base-mcp/package.json +10 -0
  62. package/src/packages/base-mcp/tools/entities.js +228 -0
  63. package/src/packages/base-mcp/tools/operator.js +106 -0
  64. package/src/packages/base-mcp/tools/projects.js +324 -0
  65. package/src/packages/base-mcp/tools/psmm.js +206 -0
  66. package/src/packages/base-mcp/tools/satellite.js +243 -0
  67. package/src/packages/base-mcp/tools/state.js +201 -0
  68. package/src/packages/base-mcp/tools/validate.js +121 -0
  69. package/src/skill/base.md +110 -0
  70. package/src/templates/operator.json +66 -0
  71. package/src/templates/workspace.json +76 -0
@@ -0,0 +1,158 @@
1
+ # The CLAUDE.md Strategy
2
+
3
+ Composable framework for auditing and writing high-performance CLAUDE.md files. Source of truth for the `/base:audit-claude-md` workflow.
4
+
5
+ ---
6
+
7
+ ## The Structure: What, Why, Who, Where, How
8
+
9
+ Every CLAUDE.md follows five sections in this exact order. Each section answers one question. Together they give Claude complete operating context without bloat.
10
+
11
+ ### What
12
+ What this document is and what this workspace contains.
13
+
14
+ One line. Sets the contract. Claude knows this is its instruction set.
15
+
16
+ > "This file provides guidance to Claude Code when working with code in this repository."
17
+
18
+ ### Why
19
+ The philosophy. Identity context. Why this workspace exists.
20
+
21
+ This is where you separate identity from operations. CLAUDE.md answers the "who am I working with?" question. Operational details (how to run a specific project, current sprint status) live elsewhere and get referenced with `@` pointers.
22
+
23
+ ### Who
24
+ Business context. Who the user is, what they do, what matters to them.
25
+
26
+ Not a life story. Enough context that Claude can make relevant suggestions. Business name, what the business does, revenue model, team, tech stack. The goal: Claude should be able to answer "what does this person's business look like?" after reading this section.
27
+
28
+ ### Where
29
+ Workspace structure. The directory map.
30
+
31
+ This section serves double duty:
32
+ 1. Tells Claude where to find things
33
+ 2. Plants the blueprint for the workspace architecture — the Where section describes a structure that may or may not exist yet
34
+
35
+ Use a tree diagram. Include:
36
+ - Each top-level directory and its purpose
37
+ - Key subdirectories if they have meaning
38
+ - What goes where (decision guide)
39
+
40
+ ### How
41
+ Ecosystem strategy. Tool strategy. Git strategy. Quick references.
42
+
43
+ This is the operational layer:
44
+ - What systems/frameworks are in use (compact table with location pointers)
45
+ - Git strategy (what gets tracked, what gets ignored)
46
+ - Rules (see NEVER pattern below)
47
+ - Quick reference table for common actions
48
+
49
+ ---
50
+
51
+ ## The NEVER Pattern: Rules as Anti-Patterns
52
+
53
+ **The single most important discovery from 40+ sessions of compliance testing.**
54
+
55
+ ### The Pattern
56
+
57
+ ```
58
+ NEVER [wrong action] — [right action]
59
+ ```
60
+
61
+ Negative framing with absolute language gets near-perfect adherence. Every high-compliance rule follows this format.
62
+
63
+ ### Why This Works
64
+
65
+ It's a binary check. Claude can look at its own output and ask: "Did I do the forbidden thing or not?" No judgment call. No interpretation. No sliding scale.
66
+
67
+ | Framing | Compliance | Why |
68
+ |---------|-----------|-----|
69
+ | "Try to use templates when possible" | ~40% | Ambiguous. "When possible" is a judgment call Claude resolves toward skipping. |
70
+ | "Always use templates" | ~65% | Better, but "always" gets weighed against context. Claude may decide exceptions apply. |
71
+ | "NEVER create from scratch — use templates" | ~95% | Binary. The forbidden action is unambiguous. |
72
+
73
+ ### Rules for Writing Rules
74
+
75
+ 1. **One rule per line.** No compound rules. If it has "and" in it, split it.
76
+ 2. **The wrong action comes first.** Claude anchors on the first thing it reads. Make the forbidden action the anchor.
77
+ 3. **The right action is the alternative.** Not a lecture — a redirect. "Don't do X — do Y instead."
78
+ 4. **Defer complexity to reference docs.** The rule stays short. The details live in a separate file loaded on demand.
79
+
80
+ ---
81
+
82
+ ## The @ Reference System
83
+
84
+ CLAUDE.md stays lean by pointing to other files instead of inlining their content.
85
+
86
+ ```
87
+ @LINKS.md — Personal branding URLs
88
+ @projects/dashboard-build/PLANNING.md — Active project context
89
+ ```
90
+
91
+ Claude reads `@`-referenced files on demand. Your CLAUDE.md stays lean while still giving Claude access to deep context.
92
+
93
+ **What to inline vs what to reference:**
94
+ - **Inline:** Identity (who, what, why), workspace structure, rules, quick references
95
+ - **Reference:** Active project details, task lists, state files, detailed specs
96
+
97
+ ---
98
+
99
+ ## What Stays Out
100
+
101
+ The test: **if it changes every week, it doesn't belong in CLAUDE.md.**
102
+
103
+ CLAUDE.md is the constitution, not the daily newspaper.
104
+
105
+ | Doesn't belong | Where it goes |
106
+ |----------------|---------------|
107
+ | Task lists / current work | State files, project tracking systems |
108
+ | Project specs | Each project's PLANNING.md |
109
+ | Rules for specific domains | Domain-specific rule files loaded on demand (e.g., CARL) |
110
+ | Daily status updates | State files |
111
+ | Detailed framework docs | Separate files, `@`-referenced |
112
+
113
+ ---
114
+
115
+ ## Line Budget
116
+
117
+ Target: **under 100 lines.** This is a routing document, not a knowledge base.
118
+
119
+ If your CLAUDE.md is over 100 lines, content is being inlined that should be referenced or removed. Common offenders:
120
+ - Inline system/framework descriptions (replace with a compact table)
121
+ - Redundant location tables when a tree diagram already exists
122
+ - Documentation system descriptions (the tree covers this)
123
+ - Standalone sections for single rules (consolidate into Rules section)
124
+
125
+ ---
126
+
127
+ ## Audit Criteria
128
+
129
+ When auditing an existing CLAUDE.md, check:
130
+
131
+ ### Structure
132
+ - [ ] Follows What → Why → Who → Where → How order
133
+ - [ ] Each section is correctly labeled
134
+ - [ ] No orphan sections outside the five-section model
135
+
136
+ ### Content Placement
137
+ - [ ] Identity/philosophy in Why (not scattered)
138
+ - [ ] Business context in Who (not bloated)
139
+ - [ ] Directory map in Where (tree format, not just a table)
140
+ - [ ] All operational content in How (git, systems, rules, quick ref)
141
+ - [ ] No task lists, state files, or volatile data inlined
142
+
143
+ ### Rules
144
+ - [ ] All rules use NEVER pattern (not "always", "try to", "prefer")
145
+ - [ ] One rule per line, no compound rules
146
+ - [ ] Wrong action first, right action as redirect
147
+ - [ ] Complex rules defer to reference docs
148
+
149
+ ### Leanness
150
+ - [ ] Under 100 lines (excluding code blocks in Where tree)
151
+ - [ ] No redundant sections (e.g., key locations table + tree diagram)
152
+ - [ ] System descriptions are a compact table, not inline paragraphs
153
+ - [ ] `@` references used for anything that changes frequently
154
+
155
+ ### CARL Integration (if present)
156
+ - [ ] Operational rules that belong in domain-specific contexts are flagged for CARL migration
157
+ - [ ] CLAUDE.md rules are constitutional (identity-level), not operational
158
+ - [ ] No duplication between CLAUDE.md rules and CARL domain rules
@@ -0,0 +1,44 @@
1
+ # Satellite Registration Framework
2
+
3
+ ## What Are Satellites
4
+
5
+ Satellites are projects that live in their own git repos inside the workspace (e.g., `apps/*`). They run their own Claude Code sessions independently. BASE needs visibility into them without owning them.
6
+
7
+ ## Registration Flow
8
+
9
+ ### Automatic (via PAUL init)
10
+ When `/paul:init` runs in a subdirectory:
11
+ 1. Check if parent directory has `.base/workspace.json`
12
+ 2. If yes, write registration entry: project name, path, engine type, state file path, date
13
+ 3. Report: "Registered with BASE workspace: {workspace-name}"
14
+
15
+ ### Automatic (via BASE scaffold)
16
+ When `/base:scaffold` runs:
17
+ 1. Scan configured satellite directories (default: `apps/`)
18
+ 2. Detect existing `.paul/` directories
19
+ 3. Auto-register discovered projects
20
+ 4. Report: "Found {N} satellite projects. Registered."
21
+
22
+ ### Automatic (via BASE groom)
23
+ During groom:
24
+ 1. Read registered satellites from workspace.json
25
+ 2. Check each path exists (clean up broken registrations)
26
+ 3. Scan satellite directories for unregistered projects with `.paul/`
27
+ 4. Flag: "Found unregistered project: {name}. Register?"
28
+
29
+ ## Health Checks
30
+
31
+ During `/base:pulse` and `/base:groom`, for each satellite:
32
+ 1. Read the state file (e.g., `.paul/STATE.md`)
33
+ 2. Check last modification date
34
+ 3. Extract current phase/milestone if parseable
35
+ 4. Report health: active, stale, or unknown
36
+
37
+ BASE never modifies satellite state. It only reads and reports. PAUL (or whatever engine) manages the project. BASE manages the workspace those projects live in.
38
+
39
+ ## Deregistration
40
+
41
+ Satellites are deregistered when:
42
+ - The project directory no longer exists (auto-cleaned during groom)
43
+ - The user explicitly removes it during audit
44
+ - The project is archived (moved to `_archive/` or similar)
@@ -0,0 +1,171 @@
1
+ <purpose>
2
+ Audit an existing CLAUDE.md against the CLAUDE.md Strategy framework, then interactively rewrite it with user approval at each stage. Detects CARL installation and routes operational rules accordingly.
3
+ </purpose>
4
+
5
+ <user-story>
6
+ As an AI builder, I want my CLAUDE.md audited against a proven strategy so I get a compliant, lean configuration file — with operational rules properly routed to CARL or preserved as an artifact for later.
7
+ </user-story>
8
+
9
+ <when-to-use>
10
+ - During /base:scaffold (optional step)
11
+ - When user says "audit my claude.md", "improve my claude.md", "rewrite my claude.md"
12
+ - Entry point: /base:audit-claude-md
13
+ </when-to-use>
14
+
15
+ <context-files>
16
+ @{~/.qwen/commands/qwen-base/frameworks/claudemd-strategy.md}
17
+ @{~/.qwen/commands/qwen-base/templates/claudemd-template.md}
18
+ </context-files>
19
+
20
+ <steps>
21
+
22
+ <step name="load_strategy" priority="first">
23
+ Load the CLAUDE.md Strategy framework and template.
24
+
25
+ 1. Read `@{~/.qwen/commands/qwen-base/frameworks/claudemd-strategy.md}` — this is the source of truth
26
+ 2. Read `@{~/.qwen/commands/qwen-base/templates/claudemd-template.md}` — this is the structural reference
27
+ 3. Internalize: five-section model (What/Why/Who/Where/How), NEVER pattern, line budget, audit criteria
28
+
29
+ You MUST understand the full strategy before reading the user's file. The strategy defines what "correct" looks like.
30
+ </step>
31
+
32
+ <step name="read_and_catalog">
33
+ Read the user's existing CLAUDE.md and catalog every piece of content.
34
+
35
+ 1. Read `CLAUDE.md` from workspace root
36
+ 2. If no CLAUDE.md exists → skip to `generate_fresh` step
37
+ 3. For every section, paragraph, rule, table, and reference in the file, classify each as:
38
+ - **KEEP** — belongs in CLAUDE.md per the strategy (identity, structure, constitutional rules)
39
+ - **REMOVE** — doesn't belong (volatile data, task lists, state references, redundant sections)
40
+ - **RESTRUCTURE** — right content, wrong location or format (e.g., rule using "always" instead of NEVER pattern, operational content in wrong section)
41
+ - **CARL_CANDIDATE** — operational rule or domain-specific behavior that belongs in a rules engine, not CLAUDE.md
42
+
43
+ 4. Count total lines. Note if over 100-line budget.
44
+ </step>
45
+
46
+ <step name="present_audit">
47
+ Present the full audit to the user. This is INTERACTIVE — do not proceed without approval.
48
+
49
+ Present a structured report:
50
+
51
+ **Section Order Compliance:**
52
+ - Current order vs required order (What → Why → Who → Where → How)
53
+ - Orphan sections (content outside the five-section model)
54
+
55
+ **Content Classification:**
56
+ For each piece of existing content, show:
57
+ ```
58
+ [KEEP] "Business context section" → stays in Who
59
+ [REMOVE] "Active Work section" → volatile, belongs in state management
60
+ [RESTRUCTURE] "LSP rule" → move to How/Rules, convert to NEVER pattern
61
+ [CARL_CANDIDATE] "When writing tests, always..." → operational rule, not identity
62
+ ```
63
+
64
+ **Line Budget:**
65
+ - Current: {N} lines
66
+ - Target: under 100
67
+ - Reduction plan: what removal/restructuring achieves
68
+
69
+ **Missing Content:**
70
+ - Sections required by strategy that don't exist yet
71
+
72
+ Ask: **"Does this audit look right? Any items you want to reclassify before I proceed?"**
73
+
74
+ Wait for user response. Adjust classifications based on their feedback.
75
+ </step>
76
+
77
+ <step name="detect_carl">
78
+ Check for CARL installation to determine rule routing.
79
+
80
+ 1. Check for `.carl/manifest` in workspace root (workspace-level CARL)
81
+ 2. Check for `~/.carl/manifest` (global-level CARL)
82
+ 3. If CARL found:
83
+ - Report: "CARL detected at {location}. Operational rules will be proposed as CARL domain rules."
84
+ - Note which existing CARL domains overlap with CARL_CANDIDATE items
85
+ 4. If CARL not found:
86
+ - Report: "No CARL installation detected."
87
+ - Offer: "I can: (a) install CARL now and set up domains, or (b) save operational rules as an artifact in `.base/artifacts/` for later CARL setup"
88
+ - If user picks (b): rules go to `.base/artifacts/claudemd-audit-rules.md` (create `.base/artifacts/` if needed)
89
+ - If user picks (a): guide CARL installation, then route rules to domains
90
+
91
+ Wait for user decision before proceeding.
92
+ </step>
93
+
94
+ <step name="propose_rewrite">
95
+ Build the new CLAUDE.md section by section, presenting each for approval.
96
+
97
+ For EACH section (What, Why, Who, Where, How):
98
+
99
+ 1. **Show the proposed content** for that section
100
+ 2. **Show what changed** vs the original (additions, removals, restructuring)
101
+ 3. **Ask for approval**: "Accept this section? Or modify?"
102
+ 4. If user modifies → incorporate changes
103
+ 5. If user accepts → lock section, move to next
104
+
105
+ **Section-specific guidance:**
106
+
107
+ **What:** One-liner. Rarely needs changes unless missing entirely.
108
+
109
+ **Why:** Philosophy/identity. Pull from existing philosophy content. Strip operational routing details that belong in How.
110
+
111
+ **Who:** Business context. Preserve existing content. Trim if bloated. Ensure it answers "what does this person's business look like?"
112
+
113
+ **Where:** Scan actual filesystem with `ls` to verify tree accuracy. Update tree to match reality. Remove subdirectories that don't add meaning. Collapse verbose trees to stay within budget.
114
+
115
+ **How:** Assemble from:
116
+ - Systems table (compact, one row per system)
117
+ - Git strategy table (from existing or detected .gitignore)
118
+ - Rules (NEVER pattern only — constitutional rules stay here, operational rules route to CARL/artifact)
119
+ - Quick reference (common actions → instructions)
120
+ </step>
121
+
122
+ <step name="route_carl_candidates">
123
+ Handle operational rules that were classified as CARL_CANDIDATE.
124
+
125
+ **If CARL is installed:**
126
+ 1. Group candidates by likely CARL domain (DEVELOPMENT, CONTENT, CLIENTS, etc.)
127
+ 2. Present: "These rules are proposed for CARL domain `{domain}`:"
128
+ 3. Show each rule in NEVER pattern format
129
+ 4. Ask: "Approve these for CARL? Modify? Skip?"
130
+ 5. For approved rules: provide the exact CARL command to add them (do NOT execute without explicit permission)
131
+
132
+ **If CARL artifact path:**
133
+ 1. Write all CARL_CANDIDATE rules to `.base/artifacts/claudemd-audit-rules.md`
134
+ 2. Format: group by proposed domain, NEVER pattern, include rationale
135
+ 3. Tell user: "Rules saved to `.base/artifacts/claudemd-audit-rules.md`. When you're ready to set up CARL, run this file through Claude to create the domains."
136
+ </step>
137
+
138
+ <step name="write_and_finalize">
139
+ Write the approved CLAUDE.md.
140
+
141
+ 1. Assemble all approved sections into final document
142
+ 2. Verify line count (warn if over 100)
143
+ 3. Write to `CLAUDE.base.md` in workspace root (NEVER overwrite CLAUDE.md directly)
144
+ 4. Present final diff summary: sections added, removed, restructured, rules routed
145
+
146
+ Tell user:
147
+ - "Review `CLAUDE.base.md`. To adopt it: `mv CLAUDE.base.md CLAUDE.md`"
148
+ - "Your original CLAUDE.md is untouched."
149
+ - If CARL candidates were routed: "Operational rules are in {location}."
150
+ </step>
151
+
152
+ </steps>
153
+
154
+ <output>
155
+ - `CLAUDE.base.md` — strategy-compliant CLAUDE.md ready for adoption
156
+ - CARL domain rules (if CARL installed) or `.base/artifacts/claudemd-audit-rules.md` (if not)
157
+ - Original CLAUDE.md untouched
158
+ </output>
159
+
160
+ <acceptance-criteria>
161
+ - [ ] Strategy framework loaded and understood before audit begins
162
+ - [ ] Every line of existing CLAUDE.md classified (KEEP/REMOVE/RESTRUCTURE/CARL_CANDIDATE)
163
+ - [ ] Full audit presented to user with approval gate before rewriting
164
+ - [ ] CARL installation detected and rule routing decided with user
165
+ - [ ] Each section proposed individually with user approval
166
+ - [ ] All rules use NEVER pattern
167
+ - [ ] Final output under 100 lines
168
+ - [ ] Operational rules routed to CARL or saved as artifact
169
+ - [ ] Original CLAUDE.md never modified
170
+ - [ ] User informed of how to adopt and next steps
171
+ </acceptance-criteria>