@axis-bootstrap/cli 0.1.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 (38) hide show
  1. package/README.md +90 -0
  2. package/package.json +42 -0
  3. package/src/commands/audit.js +53 -0
  4. package/src/commands/cleanup.js +42 -0
  5. package/src/commands/doctor.js +137 -0
  6. package/src/commands/init.js +297 -0
  7. package/src/commands/link.js +31 -0
  8. package/src/commands/spdd.js +139 -0
  9. package/src/commands/state.js +21 -0
  10. package/src/index.js +113 -0
  11. package/src/lib/copy.js +19 -0
  12. package/src/lib/detect.js +70 -0
  13. package/src/lib/i18n.js +147 -0
  14. package/src/lib/paths.js +45 -0
  15. package/src/lib/ui.js +29 -0
  16. package/templates/CANVAS.md +48 -0
  17. package/templates/CONVENTIONS.md +43 -0
  18. package/templates/INSTRUCTIONS.md +49 -0
  19. package/templates/STATE.md +27 -0
  20. package/templates/bootstrap-skill/PLANNER.md +221 -0
  21. package/templates/bootstrap-skill/PROMPT-TEMPLATE.md +128 -0
  22. package/templates/bootstrap-skill/SKILL.md +56 -0
  23. package/templates/bootstrap-skill/references/CANVAS-REASONS.md +111 -0
  24. package/templates/bootstrap-skill/references/PATTERNS.md +372 -0
  25. package/templates/bootstrap-skill/references/PHASE-1-DISCOVERY.md +120 -0
  26. package/templates/bootstrap-skill/references/PHASE-2-SPEC.md +250 -0
  27. package/templates/bootstrap-skill/references/PHASE-3-HARNESS.md +331 -0
  28. package/templates/bootstrap-skill/references/PHASE-4-MEMORY.md +187 -0
  29. package/templates/bootstrap-skill/references/PHASE-5-VALIDATION.md +194 -0
  30. package/templates/bootstrap-skill/references/QUICKSTART.md +144 -0
  31. package/templates/bootstrap-skill/references/TEMPLATES.md +602 -0
  32. package/templates/bootstrap-skill/references/UNIVERSAL-MAP.md +216 -0
  33. package/templates/settings.json +29 -0
  34. package/templates/setup-ide-links.sh +33 -0
  35. package/templates/skills/abstraction-first.md +55 -0
  36. package/templates/skills/alignment.md +53 -0
  37. package/templates/skills/iterative-review.md +55 -0
  38. package/templates/skills/story-decompose.md +54 -0
@@ -0,0 +1,216 @@
1
+ # Universal Map — Technical ↔ Non-Technical
2
+
3
+ The framework was originally designed for software projects, but its three layers (Spec, Harness, Memory) are **domain-agnostic**. This document maps technical concepts to universal equivalents, enabling application to any type of project.
4
+
5
+ ---
6
+
7
+ ## Translation Principle
8
+
9
+ | Layer | Universality | What changes |
10
+ | ----------- | -------------- | ------------------------------------------------------------------ |
11
+ | **Spec** | 100% universal | Only vocabulary (rules → protocols) |
12
+ | **Harness** | ~70% universal | Lint/test hooks do not apply; permissions and blocks do |
13
+ | **Memory** | 100% universal | Identical — STATE, CONVENTIONS work the same |
14
+
15
+ The layer that varies most is the **Harness**, and even there the core (behavior versioning, destructive blocking, sub-agents) remains intact.
16
+
17
+ ---
18
+
19
+ ## Concept-to-Concept Mapping
20
+
21
+ | Technical Concept | Universal Equivalent |
22
+ | ------------------------- | ------------------------------------------------------- |
23
+ | Technology stack | Tools and platforms |
24
+ | Programming language | Output format (markdown, spreadsheet, deck) |
25
+ | Framework | Methodology (PBL, BSC, OKR, ABNT) |
26
+ | Database | Data repository (spreadsheet, CMS, source library) |
27
+ | External API | Official source / stakeholder / vendor |
28
+ | Code rules | Quality protocols |
29
+ | Code style | Tone of voice / formatting |
30
+ | Test suite | Validation criteria |
31
+ | CI/CD | Review / approval pipeline |
32
+ | Lint hook | Automated checklist |
33
+ | Blocking hook | Pre-publication validation |
34
+ | Branches/commits | Versions / revisions |
35
+ | PR review | Peer review |
36
+ | Bug | Inconsistency / factual error |
37
+ | Refactoring | Reorganization / clarification |
38
+ | Deploy | Publication / delivery |
39
+ | Production | Final environment / client |
40
+
41
+ ---
42
+
43
+ ## Application by Project Type
44
+
45
+ ### Academic Research
46
+
47
+ ```text
48
+ .ai/
49
+ ├── INSTRUCTIONS.md (research question, methodology, deadline)
50
+ ├── skills/
51
+ │ ├── methodology/ (which method, why)
52
+ │ ├── data-collection/ (sources, how to access, how to process)
53
+ │ ├── analysis/ (techniques, formulas, software)
54
+ │ ├── academic-writing/ (structure, citations, tone)
55
+ │ └── review/ (validation checklist)
56
+ ├── rules/ (renamed protocols/)
57
+ │ ├── citations-apa.md
58
+ │ ├── paper-structure.md
59
+ │ └── reproducibility.md
60
+ └── docs/
61
+ ├── glossary.md (domain technical terms)
62
+ ├── sources.md (annotated bibliography)
63
+ ├── STATE.md (methodological decisions, collected data, gaps)
64
+ ```
65
+
66
+ **Applicable hooks:**
67
+ - ✅ Destructive blocking (universal)
68
+ - ✅ Citation validation before export
69
+ - ❌ Code linting (does not apply)
70
+
71
+ ---
72
+
73
+ ### Content / Marketing / Technical Docs
74
+
75
+ ```text
76
+ .ai/
77
+ ├── INSTRUCTIONS.md (audience, channels, calendar)
78
+ ├── skills/
79
+ │ ├── tone-of-voice/ (examples, words to avoid)
80
+ │ ├── article-structure/ (intro, body, closing; lengths)
81
+ │ ├── seo/ (keywords, meta, structure)
82
+ │ ├── fact-checking/ (reliable sources, process)
83
+ │ └── editorial/ (review, approvals)
84
+ ├── rules/
85
+ │ ├── style-guide.md (capitalization, formatting, lists)
86
+ │ └── compliance.md (GDPR, regulated claims, disclaimers)
87
+ └── docs/
88
+ ├── glossary.md
89
+ ├── personas.md
90
+ ├── STATE.md (editorial calendar, drafts, under review)
91
+ ```
92
+
93
+ **Applicable hooks:**
94
+ - ✅ Destructive blocking
95
+ - ✅ Spell check / markdown lint
96
+ - ✅ Broken link validation
97
+ - ❌ Test runner (does not apply)
98
+
99
+ ---
100
+
101
+ ### Business / Management
102
+
103
+ ```text
104
+ .ai/
105
+ ├── INSTRUCTIONS.md (objective, stakeholders, adopted frameworks)
106
+ ├── skills/
107
+ │ ├── executive-report/ (structure, audience, level)
108
+ │ ├── swot-analysis/ (template, guiding questions)
109
+ │ ├── okrs/ (definition, tracking, review)
110
+ │ ├── presentation-deck/ (visual principles, narrative)
111
+ │ └── financial-analysis/ (P&L, indicators, projections)
112
+ ├── rules/
113
+ │ ├── tone-for-board.md
114
+ │ └── confidentiality.md
115
+ └── docs/
116
+ ├── glossary.md (business terms)
117
+ ├── stakeholders.md (map, expectations)
118
+ ├── STATE.md (deals in progress, quarterly OKRs)
119
+ ```
120
+
121
+ ---
122
+
123
+ ### Legal / Compliance
124
+
125
+ ```text
126
+ .ai/
127
+ ├── INSTRUCTIONS.md (jurisdiction, areas, critical risks)
128
+ ├── skills/
129
+ │ ├── contract-drafting/ (clauses, standards)
130
+ │ ├── clause-analysis/ (risks, ambiguities)
131
+ │ ├── gdpr-compliance/ (DPIA, legal basis, rights)
132
+ │ └── legal-opinions/ (structure, legal reasoning)
133
+ ├── rules/
134
+ │ ├── legal-language.md
135
+ │ ├── case-law-citation.md
136
+ │ └── confidentiality.md (critical rule for LLMs)
137
+ └── docs/
138
+ ├── glossary.md
139
+ ├── case-law.md (relevant precedents)
140
+ ├── STATE.md (active cases, deadlines)
141
+ ```
142
+
143
+ **Especially relevant hooks:**
144
+ - ✅ Block accidental disclosure of confidential information
145
+ - ✅ Legal citation validation before export
146
+
147
+ ---
148
+
149
+ ### Educational
150
+
151
+ ```text
152
+ .ai/
153
+ ├── INSTRUCTIONS.md (audience, level, methodology, curriculum if K-12)
154
+ ├── skills/
155
+ │ ├── instructional-design/ (Bloom, ADDIE, models)
156
+ │ ├── lesson-plan/ (structure, objectives, activities)
157
+ │ ├── assessment/ (questions, rubrics, validation)
158
+ │ └── language-level/ (adapt for age/knowledge)
159
+ ├── rules/
160
+ │ ├── inclusion-accessibility.md
161
+ │ └── pedagogical-standard.md
162
+ └── docs/
163
+ ├── student-personas.md
164
+ └── STATE.md
165
+ ```
166
+
167
+ ---
168
+
169
+ ## When NOT to Use the Framework
170
+
171
+ Regardless of type:
172
+
173
+ - **Disposable work** (1 day, no continuity) — overhead > gain
174
+ - **Solo + 1 tool + 1 session** — a monolithic `CLAUDE.md` is sufficient
175
+ - **No expectation of evolution** — memory and specs lose their purpose
176
+ - **Purely creative domain without standards** (e.g., free art) — constraints get in the way
177
+
178
+ **Use when:**
179
+ - 3+ people (humans or agents) share the work
180
+ - More than one IDE/tool is involved
181
+ - Domain has rules, norms, or standards that must be respected
182
+ - Continuity between sessions matters (weeks or months)
183
+ - There is real cost to inconsistency (compliance, brand, quality)
184
+
185
+ ---
186
+
187
+ ## Common Adaptations
188
+
189
+ ### Folder substitutions
190
+
191
+ | Traditional | Universal alternative |
192
+ | ------------------------------ | -------------------------------------------------- |
193
+ | `.ai/rules/` | `.ai/protocols/` |
194
+ | `.ai/docs/architecture.md` | `.ai/docs/components.md` |
195
+ | `.ai/docs/database-schema.md` | `.ai/docs/data-model.md` or `.ai/docs/sources.md` |
196
+ | `setup-ide-links.sh` | keep the name — still relevant |
197
+
198
+ ### Hooks that always apply
199
+
200
+ - **Destructive command blocking** — universal
201
+ - **Versioning `settings.json`** in git — universal
202
+
203
+ ### Domain-dependent hooks
204
+
205
+ - Lint/format → exists for markdown, spreadsheets (validators), CSS, JSON, YAML — adapt to the output format
206
+ - Test runner → exists as "output validator" for any artifact (link checker, schema validator, fact-checker)
207
+
208
+ ---
209
+
210
+ ## Final Principle
211
+
212
+ The **Spec** layer describes **what the domain is**.
213
+ The **Harness** layer ensures **consistent behavior** regardless of domain.
214
+ The **Memory** layer preserves **continuity** regardless of domain.
215
+
216
+ The three concepts do not depend on programming — they depend on any human activity with **structured knowledge**, **repeatable standards**, and **continuity over time**. The framework is universal because these three properties are universal.
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "permissions": {
4
+ "allow": [
5
+ "Read(**)",
6
+ "Bash(ls:*)",
7
+ "Bash(find:*)",
8
+ "Bash(grep:*)",
9
+ "Bash(rg:*)",
10
+ "Bash(git status:*)",
11
+ "Bash(git diff:*)",
12
+ "Bash(git log:*)",
13
+ "Bash(git show:*)"
14
+ ],
15
+ "deny": [
16
+ "Bash(rm -rf:*)",
17
+ "Bash(git push --force:*)",
18
+ "Bash(git reset --hard:*)",
19
+ "Bash(sudo:*)",
20
+ "Read(.env)",
21
+ "Read(.env.*)"
22
+ ],
23
+ "ask": [
24
+ "Bash(git commit:*)",
25
+ "Bash(git push:*)",
26
+ "Write(**)"
27
+ ]
28
+ }
29
+ }
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env bash
2
+ # setup-ide-links.sh — Idempotent multi-IDE symlink installer for AXIS.
3
+ set -euo pipefail
4
+ cd "$(dirname "$0")"
5
+
6
+ if [ ! -d .ai ]; then
7
+ echo "error: .ai/ not found — run from project root" >&2
8
+ exit 1
9
+ fi
10
+
11
+ ln -sf .ai/INSTRUCTIONS.md AGENTS.md
12
+ ln -sf .ai/INSTRUCTIONS.md CLAUDE.md
13
+
14
+ mkdir -p .claude
15
+ ln -sf ../.ai/INSTRUCTIONS.md .claude/CLAUDE.md
16
+ ln -sf ../.ai/skills .claude/skills
17
+ [ -d .ai/rules ] && ln -sf ../.ai/rules .claude/rules || true
18
+
19
+ mkdir -p .cursor
20
+ ln -sf ../.ai/skills .cursor/skills
21
+ [ -d .ai/rules ] && ln -sf ../.ai/rules .cursor/rules || true
22
+
23
+ mkdir -p .agents
24
+ ln -sf ../.ai/INSTRUCTIONS.md .agents/AGENTS.md
25
+ ln -sf ../.ai/skills .agents/skills
26
+ [ -d .ai/rules ] && ln -sf ../.ai/rules .agents/rules || true
27
+
28
+ mkdir -p .github
29
+ ln -sf ../.ai/INSTRUCTIONS.md .github/copilot-instructions.md
30
+ ln -sf ../.ai/skills .github/skills
31
+ [ -d .ai/rules ] && ln -sf ../.ai/rules .github/instructions || true
32
+
33
+ echo "✓ symlinks installed"
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: abstraction-first
3
+ description: Design skill — forces clarity on objects, responsibilities, and boundaries
4
+ before any code is generated. Use before writing a REASONS Canvas, before starting
5
+ a feature with >2 interacting components, or when AI output shows structural drift
6
+ (duplicated logic, unclear ownership, inconsistent interfaces). Trigger terms:
7
+ design first, abstraction, domain model, OO design, layer boundaries, responsibility.
8
+ ---
9
+
10
+ # Abstraction First
11
+
12
+ Establish object design and layer boundaries before generating code. Without this, AI sprints on implementation while the structure falls apart.
13
+
14
+ ## When to Use
15
+
16
+ - Feature introduces a new domain concept or entity
17
+ - >2 components interact in the change
18
+ - AI output shows structural drift (duplicated logic, unclear ownership)
19
+
20
+ ## Design Questions (answer before Canvas O section)
21
+
22
+ 1. **What objects exist?** One noun = one responsibility.
23
+ 2. **How do they collaborate?** A calls B to get X, B asks C for Y.
24
+ 3. **Where are the layer boundaries?** What does each layer own? What can it NOT do?
25
+ 4. **What varies independently?** → Strategy / Factory / interface.
26
+ 5. **What stays the same?** → Canvas Safeguards.
27
+
28
+ ## Layer Boundary Rules
29
+
30
+ | Layer | Owns | Must NOT |
31
+ | ----- | ---- | -------- |
32
+ | Controller | Input parsing, routing | Business logic |
33
+ | Service | Business rules, orchestration | DB queries, HTTP calls |
34
+ | Repository | Data access | Business logic |
35
+ | Domain/Entity | State + invariants | Infrastructure |
36
+
37
+ ## Output (feed into Canvas E + A + S)
38
+
39
+ ```markdown
40
+ ### Entities
41
+ - <EntityA>: <single responsibility>
42
+ ### Collaboration
43
+ - <ServiceA> delegates to <RepositoryA>; dispatches to <CalculatorA|B> via Strategy
44
+ ### Variation Points
45
+ - Pricing varies by plan → Strategy pattern, interface: `PricingStrategy`
46
+ ### Invariants (→ Safeguards)
47
+ - Bill total is always non-negative
48
+ ```
49
+
50
+ ## Final Validation
51
+
52
+ - [ ] Every entity has a single stated responsibility
53
+ - [ ] No circular layer dependencies
54
+ - [ ] Variation points mapped to a named pattern
55
+ - [ ] Invariants listed and will appear as Canvas Safeguards
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: alignment
3
+ description: Intent-locking skill — makes "what we will do / what we won't do" explicit
4
+ and gets agreement on standards and constraints before implementation starts. Use
5
+ before writing the O section of a REASONS Canvas, before pairing with AI on a
6
+ complex task, or when PO and dev need to close the loop before a sprint. Trigger
7
+ terms: alignment, intent, scope, definition of done, constraints, agree before coding.
8
+ ---
9
+
10
+ # Alignment
11
+
12
+ Lock intent, scope, and constraints before generating code. Fast output with wrong intent produces slow rework.
13
+
14
+ ## When to Use
15
+
16
+ - About to generate code for a feature with business rules
17
+ - PO/BA/dev haven't explicitly agreed on scope boundaries
18
+ - Prior AI session drifted from original intent
19
+ - Canvas O (Operations) section is about to be written
20
+
21
+ ## Three Alignment Dimensions
22
+
23
+ **1. Core Logic** — business rules as 1-sentence invariants:
24
+ ```
25
+ - Standard plan: usage within quota is free; overage billed at model-specific rate
26
+ - Routing: plan type determines formula; must be extensible
27
+ ```
28
+
29
+ **2. Scope Boundaries** — explicit in/out:
30
+ ```
31
+ In: calculate current bill, support standard + premium plans
32
+ Out: customer CRUD, historical queries, subscription management
33
+ ```
34
+
35
+ **3. Definition of Done** — concrete scenarios with numbers:
36
+ ```
37
+ - 90K used of 100K quota + 30K tokens → 20K overage billed
38
+ - Missing field → HTTP 400; unknown entity → HTTP 404
39
+ ```
40
+
41
+ ## Alignment Checklist
42
+
43
+ - [ ] Core logic stated as testable invariants (not as code)
44
+ - [ ] Scope out is explicit — "we will NOT" list agreed by all parties
45
+ - [ ] DoD has ≥2 concrete scenarios with numeric expected values
46
+ - [ ] Canvas N + S reviewed and agreed
47
+ - [ ] No "TBD" in any section before generating code
48
+
49
+ ## Final Validation
50
+
51
+ - [ ] All three dimensions documented and agreed
52
+ - [ ] No open questions remain
53
+ - [ ] Canvas R and O have enough detail to generate code
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: iterative-review
3
+ description: Review skill — turns AI code output into a controlled engineering loop
4
+ instead of a one-shot draft. Use after AI generates code, when a code review reveals
5
+ issues beyond style, or when the team is stuck in "regenerate until it works" loops.
6
+ Covers the two-track review strategy: logic corrections (spec → code) vs. refactoring
7
+ (code → spec). Trigger terms: code review, AI output review, fix and iterate,
8
+ rework loop, review strategy, logic correction, refactoring sync.
9
+ ---
10
+
11
+ # Iterative Review
12
+
13
+ Turn AI output into a controlled engineering loop. Without a disciplined review-and-iterate cycle, teams either patch endlessly (solution drifts) or restart repeatedly (cost explodes).
14
+
15
+ ## When to Use
16
+
17
+ - AI just generated code from a Canvas
18
+ - Code review reveals structural or logic issues
19
+ - Team is stuck in a "keep regenerating" loop
20
+
21
+ ## Review Priority Order
22
+
23
+ 1. **Architecture** — correct layer structure?
24
+ 2. **Business logic** — matches Canvas ACs?
25
+ 3. **Scope** — diff confined to Canvas Structure?
26
+ 4. **Code quality** — magic numbers, naming, duplication
27
+
28
+ ## Two Tracks for Issues
29
+
30
+ **Track A — Logic Correction** (behavior changes) → direction: **spec → code**
31
+ 1. Identify mismatch between code and Canvas
32
+ 2. Update Canvas (R, O, or S section) with correct intent
33
+ 3. Regenerate only the affected Operations
34
+ 4. Verify only the targeted area changed
35
+
36
+ > Never patch code for a logic issue without updating the spec first.
37
+
38
+ **Track B — Refactoring** (no behavior change) → direction: **code → spec**
39
+ 1. Refactor code in small incremental steps
40
+ 2. Verify tests still pass
41
+ 3. Sync Canvas Operations/Structure to reflect the new structure
42
+
43
+ ## Iteration Checklist
44
+
45
+ - [ ] Architecture check — no layer violations
46
+ - [ ] All Canvas ACs verified with concrete values
47
+ - [ ] Scope check — diff only touches files in Canvas Structure
48
+ - [ ] Logic issues: Canvas updated before code patched
49
+ - [ ] Refactoring: tests green, Canvas synced after
50
+
51
+ ## Final Validation
52
+
53
+ - [ ] Canvas is accurate record of current code behavior
54
+ - [ ] Tests cover all Canvas Safeguards
55
+ - [ ] STATE.md updated with any new patterns or decisions
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: story-decompose
3
+ description: Decomposes large requirements into independent, deliverable user stories
4
+ following the INVEST principle (1-5 days of work each). Use when a feature is too
5
+ large to spec in one pass, when requirements come as a blob of business text, or
6
+ when a PO/BA needs to align with a dev before implementation. Trigger terms:
7
+ user story, INVEST, story split, requirement decomposition, acceptance criteria.
8
+ ---
9
+
10
+ # Story Decompose
11
+
12
+ Breaks a large requirement into INVEST stories with concrete Given/When/Then ACs, ready for domain analysis or REASONS Canvas.
13
+
14
+ ## When to Use
15
+
16
+ - Feature covers >2 user types, plans, or behavior variants
17
+ - Estimated at >5 days of work
18
+ - ACs are missing, vague, or written as technical tasks
19
+
20
+ ## INVEST Checklist (per story)
21
+
22
+ | Letter | Test |
23
+ | ------ | ---- |
24
+ | **I** ndependent | Deliverable without another story done first? |
25
+ | **N** egotiable | Details adjustable without losing core value? |
26
+ | **V** aluable | Visible business value on its own? |
27
+ | **E** stimable | Fits a rough effort estimate? |
28
+ | **S** mall | 1-5 days of work? |
29
+ | **T** estable | Has verifiable ACs? |
30
+
31
+ ## Story Template
32
+
33
+ ```markdown
34
+ ## Story <ID> — <Short title>
35
+ **Background:** <Why this story matters — 1 sentence>
36
+ **Scope in:** <What is included>
37
+ **Scope out:** <Explicit exclusions>
38
+ **Acceptance Criteria:**
39
+ - Given <context>, When <action>, Then <expected with concrete values>
40
+ ```
41
+
42
+ ## Process
43
+
44
+ 1. Read full requirement; identify vertical slices (by user type, plan, or behavior)
45
+ 2. Draft one story per slice
46
+ 3. Apply INVEST checklist; split any story that fails S or T
47
+ 4. Present with IDs; confirm with user before advancing to Domain Analysis
48
+
49
+ ## Final Validation
50
+
51
+ - [ ] Every story passes INVEST (S and T non-negotiable)
52
+ - [ ] No cross-story dependencies
53
+ - [ ] Each story has ≥2 ACs with concrete numeric values
54
+ - [ ] Stories cover 100% of original scope