loki-mode 6.27.2 → 6.28.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.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  [![Autonomi](https://img.shields.io/badge/Autonomi-autonomi.dev-5B4EEA)](https://www.autonomi.dev/)
11
11
  [![Docker Pulls](https://img.shields.io/docker/pulls/asklokesh/loki-mode)](https://hub.docker.com/r/asklokesh/loki-mode)
12
12
 
13
- **Current Version: v6.27.0**
13
+ **Current Version: v6.28.0**
14
14
 
15
15
  ### Traction
16
16
 
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: loki-mode
3
3
  description: Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with minimal human intervention. Requires --dangerously-skip-permissions flag.
4
4
  ---
5
5
 
6
- # Loki Mode v6.27.0
6
+ # Loki Mode v6.28.0
7
7
 
8
8
  **You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
9
9
 
@@ -267,4 +267,4 @@ The following features are documented in skill modules but not yet fully automat
267
267
  | Quality gates 3-reviewer system | Implemented (v5.35.0) | 5 specialist reviewers in `skills/quality-gates.md`; execution in run.sh |
268
268
  | Benchmarks (HumanEval, SWE-bench) | Infrastructure only | Runner scripts and datasets exist in `benchmarks/`; no published results |
269
269
 
270
- **v6.27.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
270
+ **v6.28.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 6.27.2
1
+ 6.28.0
package/autonomy/loki CHANGED
@@ -392,7 +392,7 @@ show_help() {
392
392
  echo " start [PRD] Start Loki Mode (optionally with PRD file)"
393
393
  echo " quick \"task\" Quick single-task mode (lightweight, 3 iterations max)"
394
394
  echo " demo Run interactive demo (~60s simulated session)"
395
- echo " init Build a PRD interactively or from templates"
395
+ echo " init [name] Project scaffolding with 22 PRD templates"
396
396
  echo " issue <url|num> [DEPRECATED] Use 'loki run' instead"
397
397
  echo " watch [sec] Live TUI session monitor (v6.0.0)"
398
398
  echo " export <format> Export session data: json|markdown|csv|timeline (v6.0.0)"
@@ -6450,268 +6450,412 @@ QPRDEOF
6450
6450
  exec "$RUN_SH" "$quick_prd"
6451
6451
  }
6452
6452
 
6453
- # Interactive PRD builder
6453
+ # Project scaffolding (v6.28.0)
6454
6454
  cmd_init() {
6455
6455
  local version=$(get_version)
6456
- local output_file="./prd.md"
6457
- local template=""
6458
- local start_after=false
6456
+ local project_name=""
6457
+ local template_name=""
6458
+ local no_git=false
6459
+ local stdout_mode=false
6460
+ local dry_run=false
6461
+ local list_mode=false
6462
+ local json_mode=false
6463
+
6464
+ # 22 built-in template names (order: simple, standard, complex)
6465
+ local TEMPLATE_NAMES=(
6466
+ simple-todo-app
6467
+ static-landing-page
6468
+ api-only
6469
+ rest-api
6470
+ rest-api-auth
6471
+ cli-tool
6472
+ discord-bot
6473
+ chrome-extension
6474
+ blog-platform
6475
+ full-stack-demo
6476
+ web-scraper
6477
+ data-pipeline
6478
+ dashboard
6479
+ game
6480
+ slack-bot
6481
+ npm-library
6482
+ microservice
6483
+ mobile-app
6484
+ saas-app
6485
+ saas-starter
6486
+ e-commerce
6487
+ ai-chatbot
6488
+ )
6489
+
6490
+ local -A TEMPLATE_LABELS=(
6491
+ [simple-todo-app]="Simple Todo App"
6492
+ [static-landing-page]="Static Landing Page"
6493
+ [api-only]="REST API (No Frontend)"
6494
+ [rest-api]="REST API"
6495
+ [rest-api-auth]="REST API with Auth"
6496
+ [cli-tool]="CLI Tool"
6497
+ [discord-bot]="Discord Bot"
6498
+ [chrome-extension]="Chrome Extension"
6499
+ [blog-platform]="Blog Platform"
6500
+ [full-stack-demo]="Full-Stack Demo"
6501
+ [web-scraper]="Web Scraper"
6502
+ [data-pipeline]="Data Pipeline"
6503
+ [dashboard]="Analytics Dashboard"
6504
+ [game]="Browser Game"
6505
+ [slack-bot]="Slack Bot"
6506
+ [npm-library]="npm Library"
6507
+ [microservice]="Microservice"
6508
+ [mobile-app]="Mobile App"
6509
+ [saas-app]="SaaS Application"
6510
+ [saas-starter]="SaaS Starter Kit"
6511
+ [e-commerce]="E-Commerce Store"
6512
+ [ai-chatbot]="AI Chatbot (RAG)"
6513
+ )
6514
+
6515
+ local template_count=${#TEMPLATE_NAMES[@]}
6459
6516
 
6460
6517
  # Parse arguments
6461
6518
  while [[ $# -gt 0 ]]; do
6462
6519
  case "$1" in
6463
- --output|-o)
6464
- if [[ -n "${2:-}" ]]; then
6465
- output_file="$2"
6466
- shift 2
6467
- else
6468
- echo -e "${RED}--output requires a file path${NC}"
6469
- exit 1
6470
- fi
6520
+ --list)
6521
+ list_mode=true
6522
+ shift
6523
+ ;;
6524
+ --json)
6525
+ json_mode=true
6526
+ list_mode=true
6527
+ shift
6471
6528
  ;;
6472
6529
  --template|-t)
6473
6530
  if [[ -n "${2:-}" ]]; then
6474
- template="$2"
6531
+ template_name="$2"
6475
6532
  shift 2
6476
6533
  else
6477
- echo -e "${RED}--template requires a template name${NC}"
6534
+ echo -e "${RED}--template requires a value${NC}"
6478
6535
  exit 1
6479
6536
  fi
6480
6537
  ;;
6481
- --start|-s)
6482
- start_after=true
6538
+ --no-git)
6539
+ no_git=true
6483
6540
  shift
6484
6541
  ;;
6485
- --list-templates)
6486
- _list_templates
6487
- exit 0
6542
+ --stdout)
6543
+ stdout_mode=true
6544
+ shift
6545
+ ;;
6546
+ --dry-run)
6547
+ dry_run=true
6548
+ shift
6488
6549
  ;;
6489
6550
  --help|-h)
6490
- echo -e "${BOLD}loki init${NC} - Interactive PRD builder"
6551
+ echo -e "${BOLD}loki init${NC} - Project scaffolding with PRD templates"
6552
+ echo ""
6553
+ echo "Usage: loki init [project-name] [--template TYPE]"
6554
+ echo ""
6555
+ echo "Creates a new project scaffold with a PRD, config directory, and README."
6556
+ echo "If no project-name is given, scaffolds the current directory."
6491
6557
  echo ""
6492
- echo "Usage: loki init [options]"
6558
+ echo "What it creates:"
6559
+ echo " prd.md PRD from selected template"
6560
+ echo " .loki/loki.config.json Project configuration"
6561
+ echo " README.md Project README stub"
6562
+ echo " .gitignore Git ignore rules (with git init)"
6493
6563
  echo ""
6494
6564
  echo "Options:"
6495
- echo " --output, -o FILE Output file (default: ./prd.md)"
6496
- echo " --template, -t NAME Start from a template"
6497
- echo " --start, -s Start loki mode after generating PRD"
6498
- echo " --list-templates List available templates"
6565
+ echo " --template, -t TYPE Template name (e.g., saas-app, cli-tool)"
6566
+ echo " --no-git Skip git init"
6567
+ echo " --stdout Print PRD to stdout instead of writing files"
6568
+ echo " --list List all available templates"
6569
+ echo " --json Machine-readable template list (JSON)"
6570
+ echo " --dry-run Show what would be created without doing it"
6571
+ echo " --help, -h Show this help"
6499
6572
  echo ""
6500
6573
  echo "Examples:"
6501
- echo " loki init Interactive PRD builder"
6502
- echo " loki init -t saas-starter Start from SaaS template"
6503
- echo " loki init -o docs/requirements.md Custom output path"
6504
- echo " loki init --start Build PRD and start immediately"
6574
+ echo " loki init my-saas --template saas-app Create my-saas/ with SaaS PRD"
6575
+ echo " loki init --template cli-tool Scaffold current dir with CLI PRD"
6576
+ echo " loki init my-app Create my-app/ (prompts for template)"
6577
+ echo " loki init --list Show all $template_count templates"
6578
+ echo " loki init --template rest-api --stdout Print REST API PRD to stdout"
6579
+ echo " loki init my-app --dry-run Preview without writing anything"
6505
6580
  exit 0
6506
6581
  ;;
6507
- *)
6582
+ -*)
6508
6583
  echo -e "${RED}Unknown option: $1${NC}"
6584
+ echo "Run 'loki init --help' for usage."
6509
6585
  exit 1
6510
6586
  ;;
6587
+ *)
6588
+ if [[ -z "$project_name" ]]; then
6589
+ project_name="$1"
6590
+ else
6591
+ echo -e "${RED}Too many arguments${NC}"
6592
+ echo "Usage: loki init [project-name] [--template TYPE]"
6593
+ exit 1
6594
+ fi
6595
+ shift
6596
+ ;;
6511
6597
  esac
6512
6598
  done
6513
6599
 
6514
- # If template specified, copy it
6515
- if [ -n "$template" ]; then
6516
- local template_file=""
6517
- # Check templates/ directory
6518
- for dir in "$SKILL_DIR/templates" "$SKILL_DIR/examples"; do
6519
- if [ -f "$dir/$template.md" ]; then
6520
- template_file="$dir/$template.md"
6521
- break
6522
- elif [ -f "$dir/${template}" ]; then
6523
- template_file="$dir/${template}"
6524
- break
6600
+ # Handle --list / --json
6601
+ if $list_mode; then
6602
+ if $json_mode; then
6603
+ echo "["
6604
+ local first=true
6605
+ for tname in "${TEMPLATE_NAMES[@]}"; do
6606
+ if $first; then
6607
+ first=false
6608
+ else
6609
+ echo ","
6610
+ fi
6611
+ printf ' {"name": "%s", "label": "%s"}' "$tname" "${TEMPLATE_LABELS[$tname]}"
6612
+ done
6613
+ echo ""
6614
+ echo "]"
6615
+ else
6616
+ echo -e "${BOLD}Available PRD Templates ($template_count)${NC}"
6617
+ echo ""
6618
+ echo -e " ${DIM}Simple:${NC}"
6619
+ local idx=1
6620
+ for tname in "${TEMPLATE_NAMES[@]}"; do
6621
+ if [[ "$tname" == "rest-api" ]]; then
6622
+ echo -e " ${DIM}Standard:${NC}"
6623
+ elif [[ "$tname" == "mobile-app" ]]; then
6624
+ echo -e " ${DIM}Complex:${NC}"
6625
+ fi
6626
+ printf " %2d. ${CYAN}%-22s${NC} %s\n" "$idx" "$tname" "${TEMPLATE_LABELS[$tname]}"
6627
+ idx=$((idx + 1))
6628
+ done
6629
+ echo ""
6630
+ echo "Usage: loki init [project-name] --template <name>"
6631
+ fi
6632
+ exit 0
6633
+ fi
6634
+
6635
+ # Interactive template picker if no template specified
6636
+ if [[ -z "$template_name" ]]; then
6637
+ echo -e "${BOLD}Loki Mode v$version - Project Scaffolding${NC}"
6638
+ echo ""
6639
+ echo "Select a PRD template:"
6640
+ echo ""
6641
+ echo -e " ${DIM}Simple:${NC}"
6642
+ local idx=1
6643
+ for tname in "${TEMPLATE_NAMES[@]}"; do
6644
+ if [[ "$tname" == "rest-api" ]]; then
6645
+ echo -e " ${DIM}Standard:${NC}"
6646
+ elif [[ "$tname" == "mobile-app" ]]; then
6647
+ echo -e " ${DIM}Complex:${NC}"
6525
6648
  fi
6649
+ printf " %2d. %-22s %s\n" "$idx" "$tname" "${TEMPLATE_LABELS[$tname]}"
6650
+ idx=$((idx + 1))
6526
6651
  done
6652
+ echo ""
6653
+ echo -e -n "${BOLD}Choose [1-$template_count]:${NC} "
6654
+ read -r choice
6527
6655
 
6528
- if [ -z "$template_file" ]; then
6529
- echo -e "${RED}Template not found: $template${NC}"
6530
- echo ""
6531
- _list_templates
6656
+ if ! [[ "$choice" =~ ^[0-9]+$ ]] || [ "$choice" -lt 1 ] || [ "$choice" -gt "$template_count" ]; then
6657
+ echo -e "${RED}Invalid choice. Enter a number between 1 and $template_count.${NC}"
6532
6658
  exit 1
6533
6659
  fi
6534
6660
 
6535
- cp "$template_file" "$output_file"
6536
- echo -e "${GREEN}Created${NC} $output_file from template: $template"
6537
- echo -e "${DIM}Edit the file to customize it for your project${NC}"
6538
-
6539
- if [ "$start_after" = true ]; then
6540
- echo ""
6541
- echo -e "${CYAN}Starting Loki Mode...${NC}"
6542
- exec "$0" start "$output_file"
6543
- fi
6544
- exit 0
6661
+ template_name="${TEMPLATE_NAMES[$((choice - 1))]}"
6662
+ echo ""
6663
+ echo -e "Selected: ${CYAN}$template_name${NC} (${TEMPLATE_LABELS[$template_name]})"
6545
6664
  fi
6546
6665
 
6547
- # Interactive mode
6548
- echo -e "${BOLD}Loki Mode v$version - PRD Builder${NC}"
6549
- echo ""
6550
- echo -e "${CYAN}Answer a few questions to generate your PRD.${NC}"
6551
- echo ""
6666
+ # Resolve template file
6667
+ local template_file=""
6668
+ for dir in "$SKILL_DIR/templates" "$SKILL_DIR/examples"; do
6669
+ if [[ -f "$dir/${template_name}.md" ]]; then
6670
+ template_file="$dir/${template_name}.md"
6671
+ break
6672
+ fi
6673
+ done
6552
6674
 
6553
- # Project name
6554
- echo -e -n "${BOLD}Project name:${NC} "
6555
- read -r project_name
6556
- if [ -z "$project_name" ]; then
6557
- echo -e "${RED}Project name is required${NC}"
6675
+ if [[ -z "$template_file" ]]; then
6676
+ echo -e "${RED}Unknown template: $template_name${NC}"
6677
+ echo ""
6678
+ echo "Available templates:"
6679
+ for tname in "${TEMPLATE_NAMES[@]}"; do
6680
+ echo " $tname"
6681
+ done
6682
+ echo ""
6683
+ echo "Run 'loki init --list' for details."
6558
6684
  exit 1
6559
6685
  fi
6560
6686
 
6561
- # Description
6562
- echo -e -n "${BOLD}One-line description:${NC} "
6563
- read -r description
6687
+ # Read template content
6688
+ local prd_content
6689
+ prd_content=$(cat "$template_file")
6564
6690
 
6565
- # Project type
6566
- echo ""
6567
- echo -e "${BOLD}Project type:${NC}"
6568
- echo " 1) Web application (full-stack)"
6569
- echo " 2) REST API (backend only)"
6570
- echo " 3) CLI tool"
6571
- echo " 4) Landing page (static)"
6572
- echo " 5) Mobile app (React Native)"
6573
- echo " 6) Browser extension"
6574
- echo " 7) Other"
6575
- echo -e -n "Choose [1-7]: "
6576
- read -r type_choice
6577
-
6578
- local project_type=""
6579
- local default_stack=""
6580
- case "$type_choice" in
6581
- 1) project_type="Web Application"; default_stack="Next.js + TypeScript + Prisma + PostgreSQL" ;;
6582
- 2) project_type="REST API"; default_stack="Node.js + Express + TypeScript + SQLite" ;;
6583
- 3) project_type="CLI Tool"; default_stack="Node.js + TypeScript + Commander.js" ;;
6584
- 4) project_type="Landing Page"; default_stack="HTML + CSS + JavaScript (no framework)" ;;
6585
- 5) project_type="Mobile App"; default_stack="React Native + TypeScript + Expo" ;;
6586
- 6) project_type="Browser Extension"; default_stack="Chrome Manifest V3 + TypeScript" ;;
6587
- 7) project_type="Custom"; default_stack="" ;;
6588
- *) project_type="Web Application"; default_stack="Next.js + TypeScript + Prisma + PostgreSQL" ;;
6589
- esac
6691
+ # --stdout mode: just print PRD and exit
6692
+ if $stdout_mode; then
6693
+ echo "$prd_content"
6694
+ exit 0
6695
+ fi
6590
6696
 
6591
- # Tech stack
6592
- echo ""
6593
- if [ -n "$default_stack" ]; then
6594
- echo -e -n "${BOLD}Tech stack${NC} [${DIM}$default_stack${NC}]: "
6595
- read -r tech_stack
6596
- if [ -z "$tech_stack" ]; then
6597
- tech_stack="$default_stack"
6598
- fi
6697
+ # Determine target directory
6698
+ local target_dir
6699
+ if [[ -n "$project_name" ]]; then
6700
+ target_dir="$(pwd)/$project_name"
6599
6701
  else
6600
- echo -e -n "${BOLD}Tech stack:${NC} "
6601
- read -r tech_stack
6702
+ target_dir="$(pwd)"
6602
6703
  fi
6603
6704
 
6604
- # Features
6605
- echo ""
6606
- echo -e "${BOLD}Key features${NC} (enter one per line, empty line to finish):"
6607
- local features=()
6608
- local feat_num=1
6609
- while true; do
6610
- echo -e -n " ${feat_num}. "
6611
- read -r feature
6612
- if [ -z "$feature" ]; then
6613
- break
6705
+ # Build config JSON
6706
+ local config_json
6707
+ config_json=$(cat <<ENDJSON
6708
+ {
6709
+ "version": "$version",
6710
+ "template": "$template_name",
6711
+ "created": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
6712
+ "provider": "claude",
6713
+ "complexity": "auto",
6714
+ "quality_gates": true,
6715
+ "parallel_mode": false,
6716
+ "dashboard": true
6717
+ }
6718
+ ENDJSON
6719
+ )
6720
+
6721
+ # Build README content
6722
+ local display_name="${project_name:-$(basename "$target_dir")}"
6723
+ local readme_content
6724
+ readme_content=$(cat <<ENDREADME
6725
+ # $display_name
6726
+
6727
+ Built with [Loki Mode](https://www.autonomi.dev/) using the \`$template_name\` template.
6728
+
6729
+ ## Getting Started
6730
+
6731
+ \`\`\`bash
6732
+ # Review the PRD
6733
+ cat prd.md
6734
+
6735
+ # Launch autonomous development
6736
+ claude --dangerously-skip-permissions
6737
+ # Then: "Loki Mode with PRD at prd.md"
6738
+
6739
+ # Or via CLI
6740
+ loki start prd.md
6741
+ \`\`\`
6742
+
6743
+ ## Project Structure
6744
+
6745
+ This project was scaffolded by \`loki init\`. Key files:
6746
+
6747
+ - \`prd.md\` - Product Requirements Document
6748
+ - \`.loki/loki.config.json\` - Loki Mode configuration
6749
+ ENDREADME
6750
+ )
6751
+
6752
+ # Build gitignore content
6753
+ local gitignore_content
6754
+ gitignore_content=$(cat <<'ENDGITIGNORE'
6755
+ # Dependencies
6756
+ node_modules/
6757
+ venv/
6758
+ __pycache__/
6759
+
6760
+ # Build output
6761
+ dist/
6762
+ build/
6763
+ *.egg-info/
6764
+
6765
+ # Loki Mode runtime state (keep .loki/loki.config.json)
6766
+ .loki/state/
6767
+ .loki/memory/episodic/
6768
+ .loki/metrics/
6769
+ .loki/queue/
6770
+ .loki/sessions/
6771
+ .loki/logs/
6772
+
6773
+ # Environment
6774
+ .env
6775
+ .env.local
6776
+
6777
+ # OS
6778
+ .DS_Store
6779
+ Thumbs.db
6780
+ ENDGITIGNORE
6781
+ )
6782
+
6783
+ # --dry-run mode: show what would be created
6784
+ if $dry_run; then
6785
+ echo -e "${BOLD}Dry run: loki init${NC}"
6786
+ echo ""
6787
+ if [[ -n "$project_name" ]]; then
6788
+ echo -e " ${GREEN}CREATE${NC} $target_dir/"
6614
6789
  fi
6615
- features+=("$feature")
6616
- feat_num=$((feat_num + 1))
6617
- if [ $feat_num -gt 10 ]; then
6618
- echo -e "${DIM} (max 10 features)${NC}"
6619
- break
6790
+ echo -e " ${GREEN}CREATE${NC} $target_dir/prd.md (${TEMPLATE_LABELS[$template_name]} template)"
6791
+ echo -e " ${GREEN}CREATE${NC} $target_dir/.loki/"
6792
+ echo -e " ${GREEN}CREATE${NC} $target_dir/.loki/loki.config.json"
6793
+ echo -e " ${GREEN}CREATE${NC} $target_dir/README.md"
6794
+ if ! $no_git; then
6795
+ if [[ -n "$project_name" ]] || ! git rev-parse --git-dir &>/dev/null; then
6796
+ echo -e " ${GREEN}CREATE${NC} $target_dir/.gitignore"
6797
+ echo -e " ${GREEN}RUN${NC} git init"
6798
+ fi
6620
6799
  fi
6621
- done
6622
-
6623
- if [ ${#features[@]} -eq 0 ]; then
6624
- echo -e "${RED}At least one feature is required${NC}"
6625
- exit 1
6800
+ echo ""
6801
+ echo "Run without --dry-run to create these files."
6802
+ exit 0
6626
6803
  fi
6627
6804
 
6628
- # Out of scope
6629
- echo ""
6630
- echo -e "${BOLD}Out of scope${NC} (enter one per line, empty line to finish):"
6631
- local exclusions=()
6632
- local exc_num=1
6633
- while true; do
6634
- echo -e -n " ${exc_num}. "
6635
- read -r exclusion
6636
- if [ -z "$exclusion" ]; then
6637
- break
6638
- fi
6639
- exclusions+=("$exclusion")
6640
- exc_num=$((exc_num + 1))
6641
- if [ $exc_num -gt 10 ]; then
6642
- break
6805
+ # Create project directory if project name given
6806
+ if [[ -n "$project_name" ]]; then
6807
+ if [[ -d "$target_dir" ]]; then
6808
+ echo -e "${RED}Directory already exists: $target_dir${NC}"
6809
+ exit 1
6643
6810
  fi
6644
- done
6811
+ mkdir -p "$target_dir"
6812
+ fi
6645
6813
 
6646
- # Generate PRD
6647
- {
6648
- echo "# PRD: $project_name"
6649
- echo ""
6650
- echo "## Overview"
6651
- echo "$description"
6652
- echo ""
6653
- echo "## Project Type"
6654
- echo "$project_type"
6655
- echo ""
6656
- echo "## Target Users"
6657
- echo "Developers and end-users who need $description"
6658
- echo ""
6659
- echo "## Features"
6660
- echo ""
6661
- echo "### MVP Features"
6662
- local i=1
6663
- for feat in "${features[@]}"; do
6664
- echo "$i. **$(echo "$feat" | awk '{print toupper(substr($0,1,1)) substr($0,2)}')** - $feat"
6665
- i=$((i + 1))
6666
- done
6667
- echo ""
6668
- echo "## Tech Stack"
6669
- echo "- $tech_stack"
6670
- echo ""
6671
- echo "## Requirements"
6672
- echo "- All features functional and tested"
6673
- echo "- Clean, well-structured code"
6674
- echo "- Error handling with user feedback"
6675
- echo "- Input validation where applicable"
6676
- echo ""
6677
- echo "## Testing"
6678
- echo "- Unit tests for core functionality"
6679
- echo "- Integration tests for API endpoints (if applicable)"
6680
- echo "- Manual testing checklist"
6681
- echo ""
6682
- echo "## Out of Scope"
6683
- if [ ${#exclusions[@]} -gt 0 ]; then
6684
- for exc in "${exclusions[@]}"; do
6685
- echo "- $exc"
6686
- done
6687
- else
6688
- echo "- Authentication (unless specified in features)"
6689
- echo "- Cloud deployment"
6690
- echo "- Performance optimization"
6814
+ # Create .loki config directory
6815
+ mkdir -p "$target_dir/.loki"
6816
+
6817
+ # Write files
6818
+ echo "$prd_content" > "$target_dir/prd.md"
6819
+ echo "$config_json" > "$target_dir/.loki/loki.config.json"
6820
+
6821
+ # Only write README if it does not already exist
6822
+ if [[ ! -f "$target_dir/README.md" ]]; then
6823
+ echo "$readme_content" > "$target_dir/README.md"
6824
+ fi
6825
+
6826
+ # Git init (unless --no-git or already in a git repo)
6827
+ local did_git_init=false
6828
+ if ! $no_git; then
6829
+ if [[ -n "$project_name" ]] || ! git rev-parse --git-dir &>/dev/null; then
6830
+ echo "$gitignore_content" > "$target_dir/.gitignore"
6831
+ (cd "$target_dir" && git init -q)
6832
+ did_git_init=true
6691
6833
  fi
6692
- echo ""
6693
- echo "## Success Criteria"
6694
- echo "- All MVP features working"
6695
- echo "- Tests passing"
6696
- echo "- No console errors"
6697
- echo "- Code review passes"
6698
- echo ""
6699
- echo "---"
6700
- echo ""
6701
- echo "**Generated by:** loki init v$(get_version)"
6702
- } > "$output_file"
6834
+ fi
6703
6835
 
6836
+ # Print summary
6704
6837
  echo ""
6705
- echo -e "${GREEN}PRD generated:${NC} $output_file"
6838
+ echo -e "${GREEN}Project scaffolded:${NC} $target_dir"
6706
6839
  echo ""
6707
-
6708
- if [ "$start_after" = true ]; then
6709
- echo -e "${CYAN}Starting Loki Mode...${NC}"
6710
- exec "$0" start "$output_file"
6840
+ echo " Files created:"
6841
+ echo -e " prd.md ${DIM}${TEMPLATE_LABELS[$template_name]} template${NC}"
6842
+ echo -e " .loki/loki.config.json ${DIM}project configuration${NC}"
6843
+ if [[ ! -f "$target_dir/README.md" ]] || [[ -n "$project_name" ]]; then
6844
+ echo -e " README.md ${DIM}project readme${NC}"
6845
+ fi
6846
+ if $did_git_init; then
6847
+ echo -e " .gitignore ${DIM}git ignore rules${NC}"
6848
+ echo -e " ${DIM}git repo initialized${NC}"
6849
+ fi
6850
+ echo ""
6851
+ echo "Next steps:"
6852
+ if [[ -n "$project_name" ]]; then
6853
+ echo -e " 1. ${BOLD}cd $project_name${NC}"
6854
+ echo -e " 2. Review and edit: ${BOLD}prd.md${NC}"
6855
+ echo -e " 3. Run: ${BOLD}loki start prd.md${NC}"
6711
6856
  else
6712
- echo "Next steps:"
6713
- echo -e " 1. Review and edit: ${BOLD}$output_file${NC}"
6714
- echo -e " 2. Start Loki Mode: ${BOLD}loki start $output_file${NC}"
6857
+ echo -e " 1. Review and edit: ${BOLD}prd.md${NC}"
6858
+ echo -e " 2. Run: ${BOLD}loki start prd.md${NC}"
6715
6859
  fi
6716
6860
  }
6717
6861
 
@@ -6744,34 +6888,9 @@ cmd_dogfood() {
6744
6888
  bash "$stats_script" $json_flag
6745
6889
  }
6746
6890
 
6747
- # List available templates
6891
+ # List available templates (legacy helper, kept for backward compat)
6748
6892
  _list_templates() {
6749
- echo -e "${BOLD}Available Templates${NC}"
6750
- echo ""
6751
- local found=false
6752
- declare -A seen_names
6753
- for dir in "$SKILL_DIR/templates" "$SKILL_DIR/examples"; do
6754
- if [ -d "$dir" ]; then
6755
- for f in "$dir"/*.md; do
6756
- if [ -f "$f" ] && [ "$(basename "$f")" != "README.md" ]; then
6757
- local name=$(basename "$f" .md)
6758
- # Skip duplicates (templates/ takes priority over examples/)
6759
- if [[ -n "${seen_names[$name]:-}" ]]; then
6760
- continue
6761
- fi
6762
- seen_names[$name]=1
6763
- local title=$(head -1 "$f" | sed -E 's/^#+ *//')
6764
- echo -e " ${CYAN}$name${NC} - $title"
6765
- found=true
6766
- fi
6767
- done
6768
- fi
6769
- done
6770
- if [ "$found" = false ]; then
6771
- echo " No templates found"
6772
- fi
6773
- echo ""
6774
- echo "Usage: loki init --template <name>"
6893
+ cmd_init --list
6775
6894
  }
6776
6895
 
6777
6896
  # Watchdog: process health monitoring
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "6.27.2"
10
+ __version__ = "6.28.0"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -2,7 +2,7 @@
2
2
 
3
3
  The flagship product of [Autonomi](https://www.autonomi.dev/). Complete installation instructions for all platforms and use cases.
4
4
 
5
- **Version:** v6.27.2
5
+ **Version:** v6.28.0
6
6
 
7
7
  ---
8
8
 
package/mcp/__init__.py CHANGED
@@ -57,4 +57,4 @@ try:
57
57
  except ImportError:
58
58
  __all__ = ['mcp']
59
59
 
60
- __version__ = '6.27.0'
60
+ __version__ = '6.28.0'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loki-mode",
3
- "version": "6.27.2",
3
+ "version": "6.28.0",
4
4
  "description": "Loki Mode by Autonomi - Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
5
5
  "keywords": [
6
6
  "agent",
@@ -0,0 +1,42 @@
1
+ # PRD: Analytics Dashboard
2
+
3
+ ## Overview
4
+ A real-time analytics dashboard that visualizes key business metrics with interactive charts, filterable data tables, and customizable dashboard layouts.
5
+
6
+ ## Target Users
7
+ - Product managers tracking feature adoption and user engagement
8
+ - Business analysts monitoring KPIs and trends
9
+ - Operations teams watching system health and performance metrics
10
+
11
+ ## Core Features
12
+ 1. **Interactive Charts** - Line, bar, pie, and area charts with hover tooltips and click-to-drill-down
13
+ 2. **Data Tables** - Sortable, filterable, and paginated tables with column visibility controls
14
+ 3. **Date Range Picker** - Filter all dashboard data by custom date ranges with preset shortcuts
15
+ 4. **Real-Time Updates** - WebSocket connection for live metric updates without page refresh
16
+ 5. **Dashboard Layouts** - Drag-and-drop widget arrangement with save and load layout presets
17
+ 6. **Export** - Export charts as PNG images and tables as CSV files
18
+ 7. **Responsive Design** - Fully functional on desktop, tablet, and mobile screen sizes
19
+
20
+ ## Technical Requirements
21
+ - React 18 with TypeScript
22
+ - Recharts or Chart.js for data visualization
23
+ - TanStack Table for data tables
24
+ - WebSocket for real-time updates
25
+ - TailwindCSS for styling
26
+ - Express backend serving mock data API
27
+ - LocalStorage for saved layouts
28
+
29
+ ## Quality Gates
30
+ - Unit tests for data transformation and formatting utilities
31
+ - Component tests for chart and table rendering
32
+ - E2E tests for date filtering and layout persistence (Playwright)
33
+ - Responsive design tested at 3 breakpoints (mobile, tablet, desktop)
34
+ - Accessibility: all charts have aria labels, tables are keyboard navigable
35
+
36
+ ## Success Metrics
37
+ - Dashboard loads with sample data and renders all chart types
38
+ - Date range filter updates all widgets simultaneously
39
+ - Real-time updates reflect in charts within 2 seconds
40
+ - Drag-and-drop layout changes persist across page reloads
41
+ - CSV and PNG exports contain accurate data
42
+ - All tests pass
@@ -0,0 +1,42 @@
1
+ # PRD: Data Pipeline
2
+
3
+ ## Overview
4
+ An ETL data pipeline that ingests data from multiple sources, transforms it through configurable processing steps, and loads results into a target data store with monitoring and error recovery.
5
+
6
+ ## Target Users
7
+ - Data engineers building batch or streaming pipelines
8
+ - Analysts automating data transformation workflows
9
+ - Teams consolidating data from multiple sources
10
+
11
+ ## Core Features
12
+ 1. **Multi-Source Ingestion** - Read from CSV files, JSON APIs, PostgreSQL databases, and S3 buckets
13
+ 2. **Configurable Transforms** - Chain transformation steps: filter, map, aggregate, join, and deduplicate
14
+ 3. **Schema Validation** - Validate incoming data against defined schemas, quarantine invalid records
15
+ 4. **Incremental Processing** - Track watermarks for incremental loads, skip already-processed records
16
+ 5. **Error Recovery** - Dead letter queue for failed records, automatic retry with configurable policies
17
+ 6. **Pipeline Monitoring** - Metrics for records processed, errors, throughput, and pipeline duration
18
+ 7. **Scheduling** - Cron-based scheduling with dependency management between pipeline stages
19
+
20
+ ## Technical Requirements
21
+ - Python 3.10+ with type hints
22
+ - Pydantic for schema validation
23
+ - SQLAlchemy for database connections
24
+ - Click for CLI interface
25
+ - YAML pipeline definitions
26
+ - SQLite for pipeline state and metadata
27
+ - Structured JSON logging
28
+
29
+ ## Quality Gates
30
+ - Unit tests for each transform function
31
+ - Integration tests with sample datasets
32
+ - Schema validation tested with valid and invalid records
33
+ - Incremental processing verified across multiple runs
34
+ - Dead letter queue captures all failure categories
35
+
36
+ ## Success Metrics
37
+ - Pipeline processes sample dataset end-to-end without errors
38
+ - Invalid records quarantined with descriptive error messages
39
+ - Incremental runs process only new records
40
+ - Metrics accurately reflect processing statistics
41
+ - Pipeline resumes correctly after interruption
42
+ - All tests pass
@@ -0,0 +1,42 @@
1
+ # PRD: Browser Game
2
+
3
+ ## Overview
4
+ A browser-based 2D game with player controls, enemy AI, scoring, levels, and persistent high scores. Runs entirely client-side with no server required.
5
+
6
+ ## Target Users
7
+ - Casual gamers looking for a quick browser-based experience
8
+ - Game developers learning 2D game architecture patterns
9
+ - Developers exploring canvas-based rendering and game loops
10
+
11
+ ## Core Features
12
+ 1. **Player Controls** - Keyboard input for movement and actions with configurable key bindings
13
+ 2. **Game Loop** - Fixed-timestep update loop with requestAnimationFrame rendering at 60fps
14
+ 3. **Enemy AI** - Multiple enemy types with distinct movement patterns and difficulty scaling
15
+ 4. **Collision Detection** - Axis-aligned bounding box (AABB) collision between sprites
16
+ 5. **Scoring and Levels** - Point system with level progression, increasing difficulty per level
17
+ 6. **High Scores** - Persistent leaderboard stored in localStorage with name entry
18
+ 7. **Sound Effects** - Audio feedback for actions, collisions, and level completion using Web Audio API
19
+
20
+ ## Technical Requirements
21
+ - HTML5 Canvas for rendering
22
+ - Vanilla TypeScript (no game engine dependency)
23
+ - Web Audio API for sound
24
+ - LocalStorage for high scores and settings
25
+ - Asset pipeline for sprites and audio files
26
+ - Responsive canvas sizing
27
+ - No server required (static files only)
28
+
29
+ ## Quality Gates
30
+ - Unit tests for collision detection, scoring, and level progression logic
31
+ - Game loop maintains consistent frame timing under load
32
+ - All sprite assets load without errors
33
+ - Controls responsive on both keyboard and touch (mobile)
34
+ - No memory leaks during extended play sessions
35
+
36
+ ## Success Metrics
37
+ - Game starts, plays, and ends with proper state transitions
38
+ - Player can move, shoot, and interact with enemies
39
+ - Score increments correctly and persists in high score table
40
+ - Level progression increases difficulty noticeably
41
+ - Game runs at stable 60fps on modern browsers
42
+ - All tests pass
@@ -0,0 +1,43 @@
1
+ # PRD: Microservice
2
+
3
+ ## Overview
4
+ A containerized microservice with health checks, structured logging, graceful shutdown, and observability. Follows twelve-factor app principles for cloud-native deployment.
5
+
6
+ ## Target Users
7
+ - Backend engineers building distributed systems
8
+ - Teams decomposing monoliths into microservices
9
+ - DevOps engineers designing cloud-native architectures
10
+
11
+ ## Core Features
12
+ 1. **HTTP API** - RESTful endpoints with request validation, error handling, and content negotiation
13
+ 2. **Health Checks** - Liveness and readiness probe endpoints for container orchestration
14
+ 3. **Structured Logging** - JSON-formatted logs with correlation IDs, log levels, and context fields
15
+ 4. **Graceful Shutdown** - Handle SIGTERM/SIGINT with connection draining and cleanup
16
+ 5. **Configuration** - Environment-variable-based configuration with validation on startup
17
+ 6. **Database Integration** - Connection pooling, migrations, and repository pattern for data access
18
+ 7. **Observability** - Prometheus metrics endpoint with request duration, error rate, and custom counters
19
+
20
+ ## Technical Requirements
21
+ - Node.js with Express and TypeScript
22
+ - Docker and docker-compose for local development
23
+ - Prisma ORM with PostgreSQL
24
+ - Prometheus client for metrics
25
+ - pino for structured logging
26
+ - Dockerfile with multi-stage build
27
+ - Health check middleware
28
+
29
+ ## Quality Gates
30
+ - Unit tests for business logic and middleware
31
+ - Integration tests with test database
32
+ - Docker image builds and starts successfully
33
+ - Health check endpoints return correct status codes
34
+ - Graceful shutdown completes within timeout
35
+ - Metrics endpoint serves valid Prometheus format
36
+
37
+ ## Success Metrics
38
+ - Service starts in Docker and responds to API requests
39
+ - Health probes return healthy status after startup
40
+ - Logs are valid JSON with correlation IDs across requests
41
+ - Graceful shutdown drains connections without dropping requests
42
+ - Prometheus can scrape metrics endpoint
43
+ - All tests pass
@@ -0,0 +1,43 @@
1
+ # PRD: npm Library
2
+
3
+ ## Overview
4
+ A well-structured npm package with TypeScript support, comprehensive documentation, tree-shakeable exports, and automated publishing. Designed as a reusable utility library.
5
+
6
+ ## Target Users
7
+ - JavaScript and TypeScript developers looking for reusable utilities
8
+ - Teams standardizing shared logic across multiple projects
9
+ - Open source contributors publishing packages to npm
10
+
11
+ ## Core Features
12
+ 1. **TypeScript First** - Written in TypeScript with generated .d.ts declaration files
13
+ 2. **Dual Format** - Publish both ESM and CommonJS builds for maximum compatibility
14
+ 3. **Tree Shaking** - Named exports with proper sideEffects configuration for optimal bundling
15
+ 4. **Comprehensive Docs** - Auto-generated API documentation from TSDoc comments
16
+ 5. **Semantic Versioning** - Automated changelog generation and version bumping
17
+ 6. **Zero Dependencies** - No runtime dependencies for minimal install footprint
18
+ 7. **Playground** - Interactive examples in a docs site for trying the library
19
+
20
+ ## Technical Requirements
21
+ - TypeScript 5+ with strict mode
22
+ - tsup for dual ESM/CJS builds
23
+ - Vitest for testing
24
+ - typedoc for API documentation generation
25
+ - changesets for version management
26
+ - GitHub Actions for CI/CD and npm publishing
27
+ - package.json exports map for subpath exports
28
+
29
+ ## Quality Gates
30
+ - Unit tests with 90%+ code coverage
31
+ - Type tests verifying public API type signatures
32
+ - Bundle size tracked and budgeted (fail CI if over limit)
33
+ - ESM and CJS builds both importable in Node.js
34
+ - TypeScript declarations compile cleanly in consuming projects
35
+ - Documentation generated without warnings
36
+
37
+ ## Success Metrics
38
+ - Package installs and imports correctly in ESM and CJS projects
39
+ - All public functions have TSDoc comments and generated docs
40
+ - Test coverage exceeds 90% across all modules
41
+ - Bundle size stays under defined budget
42
+ - Changelog accurately reflects changes between versions
43
+ - All tests pass
@@ -0,0 +1,42 @@
1
+ # PRD: Slack Bot
2
+
3
+ ## Overview
4
+ A Slack bot that responds to commands, processes events, and integrates with external services. Supports slash commands, interactive messages, and scheduled notifications.
5
+
6
+ ## Target Users
7
+ - Teams automating workflows through Slack
8
+ - Developers building internal tools for Slack workspaces
9
+ - Organizations standardizing team communication and processes
10
+
11
+ ## Core Features
12
+ 1. **Slash Commands** - Register and handle custom slash commands with argument parsing
13
+ 2. **Event Handling** - Listen for message events, reactions, channel joins, and user mentions
14
+ 3. **Interactive Messages** - Send messages with buttons, menus, and modals for user input
15
+ 4. **Scheduled Messages** - Schedule recurring notifications and reminders with cron syntax
16
+ 5. **External Integrations** - Connect to REST APIs and databases to fetch and display data
17
+ 6. **Help System** - Built-in help command listing all available commands and their usage
18
+ 7. **Error Reporting** - Log errors and send admin notifications when commands fail
19
+
20
+ ## Technical Requirements
21
+ - Node.js with TypeScript
22
+ - Bolt for Slack SDK (official Slack framework)
23
+ - Express for webhook endpoints
24
+ - SQLite for persistent storage (schedules, user preferences)
25
+ - Environment-based configuration for tokens and signing secrets
26
+ - Structured logging with request context
27
+ - Socket Mode for development, HTTP for production
28
+
29
+ ## Quality Gates
30
+ - Unit tests for command handlers and argument parsers
31
+ - Integration tests with Slack API mocks
32
+ - Interactive message flows tested end-to-end
33
+ - Error handling verified for invalid inputs and API failures
34
+ - Rate limiting compliance with Slack API limits
35
+
36
+ ## Success Metrics
37
+ - Bot responds to all registered slash commands
38
+ - Event handlers process messages and reactions correctly
39
+ - Interactive modals collect and persist user input
40
+ - Scheduled messages fire at configured times
41
+ - Error notifications reach admin channel
42
+ - All tests pass
@@ -0,0 +1,42 @@
1
+ # PRD: Web Scraper Tool
2
+
3
+ ## Overview
4
+ A configurable web scraping tool that extracts structured data from websites, handles pagination, respects robots.txt, and exports results in multiple formats.
5
+
6
+ ## Target Users
7
+ - Data analysts collecting web data for research
8
+ - Developers building data pipelines from web sources
9
+ - Marketers monitoring competitor pricing or content
10
+
11
+ ## Core Features
12
+ 1. **Configurable Extraction** - Define scraping targets with CSS selectors or XPath expressions in a config file
13
+ 2. **Pagination Handling** - Automatically follow next-page links or infinite scroll patterns
14
+ 3. **Rate Limiting** - Configurable request delays and concurrent connection limits to avoid blocking
15
+ 4. **Robots.txt Compliance** - Parse and respect robots.txt rules, with override flag for allowed domains
16
+ 5. **Multi-Format Export** - Export scraped data as JSON, CSV, or SQLite database
17
+ 6. **Retry and Error Handling** - Automatic retry with exponential backoff for failed requests
18
+ 7. **Proxy Support** - Rotate through proxy list for distributed scraping
19
+
20
+ ## Technical Requirements
21
+ - Python 3.10+ with async/await
22
+ - httpx for async HTTP requests
23
+ - BeautifulSoup4 and lxml for HTML parsing
24
+ - SQLite for persistent storage
25
+ - YAML configuration files
26
+ - CLI interface with argparse
27
+ - Structured logging
28
+
29
+ ## Quality Gates
30
+ - Unit tests for parser, config loader, and export functions
31
+ - Integration tests with mock HTTP server
32
+ - Robots.txt parser tested against edge cases
33
+ - Rate limiter verified with timing assertions
34
+ - Export format validation for JSON, CSV, and SQLite
35
+
36
+ ## Success Metrics
37
+ - Scraper extracts data matching CSS selector configuration
38
+ - Pagination follows links and collects all pages
39
+ - Rate limiting maintains configured request interval
40
+ - Robots.txt rules correctly block disallowed paths
41
+ - All export formats contain valid, complete data
42
+ - All tests pass