ai-development-framework 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 (56) hide show
  1. package/.claude/agents/_template/AGENT.md +36 -0
  2. package/.claude/agents/architect-agent/AGENT.md +60 -0
  3. package/.claude/agents/architect-agent/decisions/log.md +18 -0
  4. package/.claude/agents/architect-agent/frontend/.gitkeep +0 -0
  5. package/.claude/agents/architect-agent/index.md +32 -0
  6. package/.claude/agents/architect-agent/modules/.gitkeep +0 -0
  7. package/.claude/agents/architect-agent/shared/patterns.md +19 -0
  8. package/.claude/agents/mobile-tester-agent/AGENT.md +46 -0
  9. package/.claude/agents/mobile-tester-agent/screen-patterns.md +42 -0
  10. package/.claude/agents/tester-agent/AGENT.md +44 -0
  11. package/.claude/agents/tester-agent/auth-state.md +22 -0
  12. package/.claude/agents/tester-agent/test-patterns.md +36 -0
  13. package/.claude/agents/ui-ux-analyzer/AGENT.md +75 -0
  14. package/.claude/commands/create-prd.md +55 -0
  15. package/.claude/commands/evolve.md +84 -0
  16. package/.claude/commands/execute.md +76 -0
  17. package/.claude/commands/plan-feature.md +100 -0
  18. package/.claude/commands/plan-project.md +110 -0
  19. package/.claude/commands/prime.md +71 -0
  20. package/.claude/commands/setup.md +81 -0
  21. package/.claude/commands/ship.md +73 -0
  22. package/.claude/commands/start.md +63 -0
  23. package/.claude/commands/validate.md +72 -0
  24. package/.claude/hooks/architect-sync.sh +18 -0
  25. package/.claude/hooks/branch-guard.sh +15 -0
  26. package/.claude/hooks/evolve-reminder.sh +13 -0
  27. package/.claude/hooks/plan-required.sh +20 -0
  28. package/.claude/hooks/session-primer.sh +38 -0
  29. package/.claude/references/claude-md-template.md +90 -0
  30. package/.claude/references/code-patterns.md +37 -0
  31. package/.claude/references/issue-template.md +56 -0
  32. package/.claude/references/plan-template.md +92 -0
  33. package/.claude/references/prd-template.md +119 -0
  34. package/.claude/rules/_global.md +22 -0
  35. package/.claude/rules/_template.md +23 -0
  36. package/.claude/rules/backend.md +29 -0
  37. package/.claude/rules/database.md +28 -0
  38. package/.claude/rules/frontend.md +34 -0
  39. package/.claude/rules/mobile.md +33 -0
  40. package/.claude/rules/testing.md +37 -0
  41. package/.claude/settings.local.json +27 -0
  42. package/.claude/skills/e2e-test/SKILL.md +87 -0
  43. package/.claude/skills/playwright-cli/SKILL.md +97 -0
  44. package/CLAUDE.md +65 -0
  45. package/README.md +83 -0
  46. package/cli/index.js +35 -0
  47. package/cli/init.js +219 -0
  48. package/cli/update.js +120 -0
  49. package/docs/command-reference.md +41 -0
  50. package/docs/customization.md +33 -0
  51. package/docs/getting-started.md +68 -0
  52. package/docs/methodology.md +78 -0
  53. package/docs/plans/2026-03-30-ai-development-framework-design.md +483 -0
  54. package/docs/plugin-install-guide.md +66 -0
  55. package/docs/superpowers/plans/2026-03-30-framework-implementation.md +3462 -0
  56. package/package.json +28 -0
package/cli/update.js ADDED
@@ -0,0 +1,120 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { execFileSync } = require('child_process');
4
+
5
+ const REPO = 'cristian-robert/AIDevelopmentFramework';
6
+ const BRANCH = 'main';
7
+ const TARBALL_URL = 'https://github.com/' + REPO + '/archive/refs/heads/' + BRANCH + '.tar.gz';
8
+
9
+ // Files that are project-specific and should NOT be overwritten
10
+ var PROTECTED_FILES = [
11
+ '.claude/agents/architect-agent/index.md',
12
+ '.claude/agents/architect-agent/shared/patterns.md',
13
+ '.claude/agents/architect-agent/decisions/log.md',
14
+ '.claude/agents/tester-agent/test-patterns.md',
15
+ '.claude/agents/tester-agent/auth-state.md',
16
+ '.claude/agents/mobile-tester-agent/screen-patterns.md',
17
+ '.claude/references/code-patterns.md',
18
+ '.claude/settings.local.json',
19
+ ];
20
+
21
+ // Directories with project-specific content that should NOT be overwritten
22
+ var PROTECTED_DIRS = [
23
+ '.claude/agents/architect-agent/modules',
24
+ '.claude/agents/architect-agent/frontend',
25
+ ];
26
+
27
+ function copyDirRecursive(src, dest, protectedFiles, protectedDirs) {
28
+ if (!fs.existsSync(dest)) {
29
+ fs.mkdirSync(dest, { recursive: true });
30
+ }
31
+ var entries = fs.readdirSync(src, { withFileTypes: true });
32
+ for (var i = 0; i < entries.length; i++) {
33
+ var entry = entries[i];
34
+ var srcPath = path.join(src, entry.name);
35
+ var destPath = path.join(dest, entry.name);
36
+ var relativePath = path.relative(process.cwd(), destPath);
37
+
38
+ if (entry.isDirectory()) {
39
+ // Skip protected directories entirely
40
+ if (protectedDirs.some(function (d) { return relativePath.startsWith(d); })) {
41
+ continue;
42
+ }
43
+ copyDirRecursive(srcPath, destPath, protectedFiles, protectedDirs);
44
+ } else {
45
+ // Skip protected files
46
+ if (protectedFiles.indexOf(relativePath) !== -1) {
47
+ console.log(' Skipped (project-specific): ' + relativePath);
48
+ continue;
49
+ }
50
+ fs.copyFileSync(srcPath, destPath);
51
+ }
52
+ }
53
+ }
54
+
55
+ function main() {
56
+ console.log('');
57
+ console.log(' AIDevelopmentFramework — Update');
58
+ console.log('');
59
+
60
+ if (!fs.existsSync('.claude')) {
61
+ console.error('No .claude/ directory found. Run "npx ai-framework init" first.');
62
+ process.exit(1);
63
+ }
64
+
65
+ var tmpDir = path.join(require('os').tmpdir(), 'ai-framework-update-' + Date.now());
66
+ fs.mkdirSync(tmpDir, { recursive: true });
67
+
68
+ console.log('Downloading latest framework from GitHub...');
69
+
70
+ try {
71
+ execFileSync('curl', ['-sL', TARBALL_URL, '-o', path.join(tmpDir, 'framework.tar.gz')]);
72
+ execFileSync('tar', ['-xzf', path.join(tmpDir, 'framework.tar.gz'), '-C', tmpDir, '--strip-components=1']);
73
+
74
+ var sourceClaudeDir = path.join(tmpDir, '.claude');
75
+ var targetClaudeDir = path.join(process.cwd(), '.claude');
76
+
77
+ if (fs.existsSync(sourceClaudeDir)) {
78
+ console.log('Updating .claude/ (preserving project-specific files)...');
79
+ copyDirRecursive(sourceClaudeDir, targetClaudeDir, PROTECTED_FILES, PROTECTED_DIRS);
80
+ }
81
+
82
+ // Update docs (but not docs/plans/ which contains project plans)
83
+ var sourceDocsDir = path.join(tmpDir, 'docs');
84
+ var targetDocsDir = path.join(process.cwd(), 'docs');
85
+ if (fs.existsSync(sourceDocsDir)) {
86
+ console.log('Updating docs/...');
87
+ var docEntries = fs.readdirSync(sourceDocsDir, { withFileTypes: true });
88
+ for (var i = 0; i < docEntries.length; i++) {
89
+ var entry = docEntries[i];
90
+ if (entry.isFile()) {
91
+ fs.copyFileSync(
92
+ path.join(sourceDocsDir, entry.name),
93
+ path.join(targetDocsDir, entry.name)
94
+ );
95
+ }
96
+ // Skip docs/plans/ and docs/superpowers/ — project-specific
97
+ }
98
+ }
99
+
100
+ console.log('');
101
+ console.log('Update complete!');
102
+ console.log('');
103
+ console.log('Updated: commands, agent protocols, rules templates, hooks, skills, docs');
104
+ console.log('Preserved: agent knowledge bases, test patterns, auth state, code patterns, settings, plans');
105
+ console.log('');
106
+ console.log('Run /setup to check if new plugins are required.');
107
+ console.log('');
108
+ } catch (err) {
109
+ console.error('Update failed: ' + err.message);
110
+ process.exit(1);
111
+ } finally {
112
+ try {
113
+ fs.rmSync(tmpDir, { recursive: true, force: true });
114
+ } catch (e) {
115
+ // ignore cleanup errors
116
+ }
117
+ }
118
+ }
119
+
120
+ main();
@@ -0,0 +1,41 @@
1
+ # Command Reference
2
+
3
+ ## /start — Smart Router
4
+ **Phase:** Router | **Arguments:** None
5
+ Detects scope level and routes to the correct pipeline.
6
+
7
+ ## /prime — Context Loader
8
+ **Phase:** Plan | **Arguments:** None
9
+ Loads codebase context. Run at session start or after context reset.
10
+
11
+ ## /create-prd — PRD Generator
12
+ **Phase:** Plan (L0) | **Arguments:** Optional idea description
13
+ Brainstorms and generates a Product Requirements Document. Output: `docs/plans/PRD.md`
14
+
15
+ ## /plan-project — PRD Decomposer
16
+ **Phase:** Plan (L0) | **Arguments:** Optional PRD path (default: `docs/plans/PRD.md`)
17
+ Breaks PRD into GitHub milestones and issues. Output: GitHub issues + `docs/plans/roadmap.md`
18
+
19
+ ## /plan-feature — Feature Planner
20
+ **Phase:** Plan (L1/L2) | **Arguments:** Feature description or issue number (e.g., `#42`)
21
+ 5-phase analysis producing a detailed implementation plan. Output: `docs/plans/<feature>.md`
22
+
23
+ ## /execute — Plan Executor
24
+ **Phase:** Implement | **Arguments:** Optional plan path (auto-detected if omitted)
25
+ Executes plan task-by-task with TDD. Reads mandatory files, runs validation commands.
26
+
27
+ ## /validate — Verification Orchestrator
28
+ **Phase:** Validate | **Arguments:** None
29
+ Runs lint, tests, type-check, visual testing (tester agents), and code review.
30
+
31
+ ## /ship — Commit + Push + PR
32
+ **Phase:** Validate | **Arguments:** None
33
+ Stages, commits (conventional), pushes, creates PR linked to issue.
34
+
35
+ ## /evolve — Self-Improvement
36
+ **Phase:** Evolve | **Arguments:** None
37
+ Updates CLAUDE.md, architect knowledge base, rules, code patterns, test patterns.
38
+
39
+ ## /setup — Health Check
40
+ **Phase:** Utility | **Arguments:** None
41
+ Checks installed plugins, skills, MCP servers. Reports health and install commands.
@@ -0,0 +1,33 @@
1
+ # Customization Guide
2
+
3
+ ## Adding Custom Rules
4
+
5
+ 1. Copy `.claude/rules/_template.md` to `.claude/rules/your-domain.md`
6
+ 2. Set the `globs` pattern to match your file paths
7
+ 3. Add your conventions and skill chains
8
+ 4. Rules auto-load when editing matching files
9
+
10
+ ## Adding Custom Agents
11
+
12
+ 1. Copy `.claude/agents/_template/AGENT.md` to `.claude/agents/your-agent/AGENT.md`
13
+ 2. Define query types, tools, and response format
14
+ 3. Add knowledge base files as needed
15
+ 4. Reference the agent from your commands or rules
16
+
17
+ ## Customizing Commands
18
+
19
+ Commands are markdown files in `.claude/commands/`. Edit existing commands or add new ones. Commands are invoked as `/command-name` in Claude Code.
20
+
21
+ ## Customizing Hooks
22
+
23
+ Hooks are shell scripts in `.claude/hooks/`. Edit existing hooks or add new ones. Make sure hooks are executable (`chmod +x`).
24
+
25
+ ## Overriding Rules per Project
26
+
27
+ Each project gets its own `.claude/` folder. Customize CLAUDE.md, rules, and agent knowledge bases per project. The framework's commands stay the same.
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork the repository
32
+ 2. Add your contribution
33
+ 3. Submit a PR with description, usage, and testing notes
@@ -0,0 +1,68 @@
1
+ # Getting Started
2
+
3
+ ## Quick Start (Existing Project)
4
+
5
+ 1. Copy the `.claude/` folder into your project root
6
+ 2. Run `/setup` to check what plugins/skills you need
7
+ 3. Install missing dependencies (commands provided by /setup)
8
+ 4. Run `/prime` to load your codebase context
9
+ 5. Run `/start` to begin your first task
10
+
11
+ ## Quick Start (New Project)
12
+
13
+ 1. Copy the `.claude/` folder into your project root
14
+ 2. Run `/setup` to check dependencies
15
+ 3. Run `/start` — it will detect a new project and guide you through:
16
+ - `/create-prd` — brainstorm and define what you're building
17
+ - `/plan-project` — create GitHub issues from the PRD
18
+ - Per-issue implementation via the PIV+E loop
19
+
20
+ ## Your First Feature (Walkthrough)
21
+
22
+ ### 1. Start
23
+ ```
24
+ /start
25
+ > What are you working on? -> 3. Working on a specific GitHub issue
26
+ > Issue number? -> #1
27
+ ```
28
+
29
+ ### 2. Plan
30
+ ```
31
+ /plan-feature #1
32
+ ```
33
+ Review the plan. Adjust if needed.
34
+
35
+ ### 3. Implement
36
+ ```
37
+ /execute docs/plans/my-feature.md
38
+ ```
39
+
40
+ ### 4. Validate
41
+ ```
42
+ /validate
43
+ ```
44
+
45
+ ### 5. Ship
46
+ ```
47
+ /ship
48
+ ```
49
+
50
+ ### 6. Evolve (after merge)
51
+ ```
52
+ /evolve
53
+ ```
54
+
55
+ ## Commands Quick Reference
56
+
57
+ | Command | When to Use |
58
+ |---------|------------|
59
+ | `/start` | Beginning of any work session |
60
+ | `/prime` | Load/reload codebase context |
61
+ | `/create-prd` | Planning a new project from scratch |
62
+ | `/plan-project` | Breaking a PRD into GitHub issues |
63
+ | `/plan-feature` | Planning a specific feature |
64
+ | `/execute` | Implementing a plan |
65
+ | `/validate` | Verifying work before shipping |
66
+ | `/ship` | Committing, pushing, creating PR |
67
+ | `/evolve` | Updating the system after completing work |
68
+ | `/setup` | Checking framework health |
@@ -0,0 +1,78 @@
1
+ # PIV+E Methodology
2
+
3
+ A tool-agnostic methodology for reliable AI-assisted software development.
4
+
5
+ ## The Problem
6
+
7
+ AI coding assistants are powerful but unpredictable. They write code that looks right but subtly isn't. They lose context. They make the same mistakes repeatedly. The solution isn't a better AI — it's a better system around the AI.
8
+
9
+ ## The PIV+E Loop
10
+
11
+ ```
12
+ PLAN -> IMPLEMENT -> VALIDATE -> EVOLVE
13
+ ^ |
14
+ +-------------------------------+
15
+ System gets smarter
16
+ ```
17
+
18
+ ### Plan (Human decides, AI structures)
19
+
20
+ The human owns what gets built. The AI helps structure the thinking.
21
+
22
+ - **Brainstorm** the idea — explore alternatives, constraints, tradeoffs
23
+ - **Write a spec** (PRD for projects, plan for features)
24
+ - **Decompose** into implementable units (GitHub issues)
25
+
26
+ The key output is a plan document that passes the "no prior knowledge test."
27
+
28
+ ### Implement (AI executes, guided by plan)
29
+
30
+ The AI does the heavy lifting, constrained by the plan.
31
+
32
+ - **Test-Driven Development** — write the test first, then make it pass
33
+ - **Follow the plan** — don't improvise, don't add features, don't refactor unrelated code
34
+ - **Use specialists** — architecture agents, design skills, framework-specific tools
35
+ - **Commit frequently** — small, atomic commits after each task
36
+
37
+ ### Validate (Human + AI verify together)
38
+
39
+ Both human and AI verify the work.
40
+
41
+ - **Automated checks** — lint, type-check, test suite (AI runs these)
42
+ - **Visual verification** — browser/mobile testing agents (AI runs these)
43
+ - **Code review** — review agents flag issues (AI runs, human decides)
44
+ - **Human review** — the final authority (human approves the PR)
45
+
46
+ ### Evolve (System learns from each cycle)
47
+
48
+ The system improves after every cycle.
49
+
50
+ - **Update rules** — new patterns become rules, mistakes become warnings
51
+ - **Update knowledge base** — architecture agent learns new modules/endpoints
52
+ - **Update test patterns** — new pages/screens get added to test inventories
53
+ - **Record decisions** — why things were done this way
54
+
55
+ ## Context Management
56
+
57
+ - **Plans are artifacts** — they survive session boundaries
58
+ - **Context resets are a feature** — start fresh for implementation after heavy planning
59
+ - **Progressive disclosure** — load information as needed, not all at once
60
+ - **Knowledge bases** — structured information that agents can query
61
+
62
+ ## Discipline Scaling
63
+
64
+ | Complexity | Ceremony Level |
65
+ |-----------|---------------|
66
+ | XL (new module) | Full PIV+E with brainstorming, PRD, parallel agents |
67
+ | L (new feature) | Plan + TDD + testing agents |
68
+ | M (single task) | Quick plan + implement + verify |
69
+ | S (tweak) | Just do it + verify |
70
+ | Bug | Debug + fix + verify |
71
+
72
+ ## Principles
73
+
74
+ 1. Context is precious — manage it deliberately
75
+ 2. Plans are artifacts — they survive session boundaries
76
+ 3. Discipline scales with complexity
77
+ 4. The system self-improves — every mistake becomes a rule
78
+ 5. Human stays in control — AI assists, human decides