Version: 1.0 Last Updated: 2025-12-12 Project Type: Static Web Application / PWA Target Platform: GitHub Pages
Table of Contents
- System Overview
- Architecture
- Technology Stack
- Repository Structure
- Installation & Setup
- Development Workflow
- Deployment
- Component Specifications
- PWA Configuration
- Maintenance & Troubleshooting
- API Reference
System Overview
Purpose
OrbitPrompt is a prompt archive and management system designed for AI interaction templates. It provides a searchable, production-ready interface for organizing and accessing prompt files with a sophisticated tagging system (D1xP5x style).
Key Features
- Zero Backend: Fully static, serverless architecture
- Real-time Search: Client-side filtering with D1xP5x tag support
- Progressive Web App (PWA): Installable, offline-capable
- Automated Indexing: GitHub Actions workflow for automatic file discovery
- Modern UI: Responsive design with dark mode support
- GitHub Pages Ready: One-click deployment
Target Users
- System architects implementing prompt management systems
- Development teams requiring AI prompt organization
- Content creators managing LLM interaction templates
- DevOps engineers deploying static documentation sites
Architecture
System Design
┌─────────────────────────────────────────────────┐
│ GitHub Pages │
│ (Static File Hosting) │
└──────────────────┬──────────────────────────────┘
│
┌──────────┴──────────┐
│ │
┌───────▼────────┐ ┌────────▼────────┐
│ index.html │ │ prompts/ │
│ (UI Layer) │ │ (Data Layer) │
└───────┬────────┘ └────────┬────────┘
│ │
│ ┌─────────────────┘
│ │
▼ ▼
┌─────────────────┐
│ index.json │
│ (Auto-generated)│
└─────────────────┘
▲
│
┌───────┴────────┐
│ GitHub Actions │
│ (CI/CD Layer) │
└────────────────┘
Data Flow
- Developer adds
.htmlprompt files toprompts/directory - GitHub Actions detects changes and regenerates
index.json - index.html fetches
index.jsonon page load - JavaScript parses filenames and renders the UI
- User searches and navigates prompts in real-time
Design Principles
- Convention over Configuration: Filenames encode metadata (D1xP5xL2xC3xE5 format)
- Fail-Safe: Graceful degradation without backend dependencies
- Performance First: Minimal dependencies, lazy loading
- Developer Experience: Single command to add new prompts
Technology Stack
Core Technologies
| Component | Technology | Version | Purpose |
|---|---|---|---|
| Frontend | HTML5, CSS3, JavaScript (ES6+) | Native | UI and business logic |
| Hosting | GitHub Pages | - | Static file serving |
| CI/CD | GitHub Actions | v4 | Automated indexing |
| PWA | Service Workers, Web Manifest | - | Offline support and installability |
| Indexing | Node.js | v20+ | Build-time file scanning |
| Data Format | JSON | - | Prompt file registry |
Dependencies
Runtime: None (Vanilla JavaScript)
Build/Dev Tools:
node(v20.19.6+) - For runninggenerate-index.jsjq- For JSON processing in GitHub Actions
Browser Support
- Modern Browsers: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- Mobile: iOS Safari 14+, Chrome Android 90+
- Features Used: ES6 modules, Fetch API, CSS Grid, Service Workers
Repository Structure
OrbitPrompt/
├── .github/
│ └── workflows/
│ └── update-index.yml # CI/CD: Auto-generates index.json
├── prompts/
│ ├── index.json # Auto-generated file list
│ ├── Gitgub-publishing.html # Example prompt file
│ └── D1xP5xL2xC3xE5.html # D1xP5x format prompt (example)
├── .gitignore # Git exclusions
├── README.md # User documentation
├── TECHNICAL_SPECIFICATIONS.md # This document
├── generate-index.js # Local indexing script
├── index.html # Main application UI
├── manifest.webmanifest # PWA manifest
├── orbitprompt-logo.png # Application icon (192x192)
└── sw.js # Service Worker for PWA
File Descriptions
Core Application Files
index.html (27 KB)
- Single-page application
- Embedded CSS and JavaScript (no external dependencies)
- Responsive grid layout with dark mode support
- Search functionality with real-time filtering
- PWA registration code
generate-index.js (721 bytes)
- Node.js script for local development
- Scans
prompts/directory for.htmlfiles - Generates
prompts/index.json - Sorts files alphabetically
sw.js (339 bytes)
- Service Worker for PWA
- Basic offline caching strategy
- Network-first, cache fallback
manifest.webmanifest (459 bytes)
- PWA configuration
- App name, icons, theme colors
- Display mode and start URL
Configuration Files
.github/workflows/update-index.yml
- Triggered on push to
prompts/*.html - Uses
jqto generate JSON fromlsoutput - Commits and pushes
index.jsonautomatically
.gitignore
- Excludes
node_modules/, OS files, editor configs
Content Files
prompts/
- Contains all prompt HTML files
- Supports two naming conventions:
- D1xP5x Format:
D{depth}xP{phase}xL{level}xC{category}xE{evidence}.html - Free Format: Any descriptive name (e.g.,
Gitgub-publishing.html)
Installation & Setup
Prerequisites
- Git (v2.0+)
- Node.js (v20.19.6+) - Optional, for local indexing
- GitHub Account - For repository hosting
- Text Editor - VS Code, Sublime, etc.
Step 1: Fork or Clone Repository
# Clone the repository
git clone https://github.com/dtslib1979/OrbitPrompt.git
cd OrbitPrompt
# Or fork and clone your fork
git clone https://github.com/YOUR_USERNAME/OrbitPrompt.git
cd OrbitPrompt
Step 2: Configure GitHub Pages
- Navigate to Settings → Pages in your GitHub repository
- Configure:
- Source: Deploy from branch
- Branch:
main(or your default branch) - Folder:
/ (root) - Click Save
- Wait 1-2 minutes for deployment
- Visit
https://YOUR_USERNAME.github.io/OrbitPrompt/
Step 3: Verify Installation
Check that the following URLs are accessible:
https://YOUR_USERNAME.github.io/OrbitPrompt/
https://YOUR_USERNAME.github.io/OrbitPrompt/prompts/index.json
https://YOUR_USERNAME.github.io/OrbitPrompt/manifest.webmanifest
Step 4: (Optional) Local Development Setup
# No npm install needed - vanilla JavaScript!
# To regenerate index.json locally:
node generate-index.js
# To test locally, use any HTTP server:
# Python 3:
python3 -m http.server 8000
# Node.js (npx):
npx serve .
# Then visit: http://localhost:8000
Development Workflow
Adding a New Prompt
Method 1: Direct File Creation
- Create a new
.htmlfile in theprompts/directory
cd prompts/
touch MyNewPrompt.html
# or
touch D2xP3xL2xC1xE4.html
- Add your prompt content (see Prompt File Format)
- Run the indexing script
node generate-index.js
- Commit and push
git add prompts/
git commit -m "Add new prompt: MyNewPrompt"
git push origin main
Method 2: Automatic Indexing (Recommended)
- Create and push the prompt file directly
cd prompts/
# Create your file
echo "<!DOCTYPE html>..." > NewPrompt.html
git add prompts/NewPrompt.html
git commit -m "Add NewPrompt"
git push origin main
- GitHub Actions will automatically:
- Detect the new file
- Update
index.json - Commit the changes
- Deploy to GitHub Pages
Prompt File Format
Minimal Structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Prompt Title</title>
</head>
<body>
<h1>Your Prompt Title</h1>
<p>Your prompt content here...</p>
</body>
</html>
Advanced Structure (Parksy Style)
See prompts/Gitgub-publishing.html for a full-featured example with:
- Custom CSS styling
- Interactive forms
- JavaScript-powered generation
- Responsive design
Naming Conventions
D1xP5x Format (Recommended for Structured Prompts)
Format: D{depth}xP{phase}xL{level}xC{category}xE{evidence}.html
Parameters:
- D (Depth): 1-9, complexity/depth of the prompt
- P (Phase): 1-9, project phase or iteration
- L (Level): 1-9, difficulty level (displayed as "L1", "L2", etc.)
- C (Category): 1-5, mode category
- 1: ENGINEERING
- 2: ARCHITECTURE
- 3: CRITICAL
- 4: EVIDENCE
- 5: SHAMAN
- E (Evidence): 1-9, evidence level or validation tier
Examples:
D1xP1xL1xC1xE1.html- Basic engineering promptD5xP3xL4xC2xE5.html- Complex architectural prompt
Free-Form Naming
Any descriptive name works:
Gitgub-publishing.htmlAPI-Documentation-Generator.htmlCode-Review-Assistant.html
Parsing Behavior:
- D1xP5x format files are automatically parsed for metadata
- Free-form files default to:
- Complexity: L1
- Mode: GENERAL
- Description: "Custom prompt template"
Testing Changes Locally
# Start local server
python3 -m http.server 8000
# Open browser
open http://localhost:8000
# Test search functionality
# Verify prompt links work
# Check responsive design
Deployment
Automatic Deployment (GitHub Pages)
Every push to the main branch triggers:
- GitHub Actions Workflow (
update-index.yml) - Runs when
prompts/*.htmlfiles change - Updates
prompts/index.json - Commits changes back to the repository
- GitHub Pages
- Detects changes to
mainbranch - Rebuilds and deploys the site
- Usually completes in 30-60 seconds
Deployment URL Pattern
https://{username}.github.io/{repository-name}/
Example:
https://dtslib1979.github.io/OrbitPrompt/
Custom Domain Setup
To use a custom domain:
- Add a
CNAMEfile to the repository root:
echo "prompts.yourdomain.com" > CNAME
git add CNAME
git commit -m "Add custom domain"
git push
- Configure DNS records at your domain provider:
Type: CNAME
Name: prompts (or @)
Value: your-username.github.io
- Wait for DNS propagation (5-60 minutes)
Monitoring Deployment
Check deployment status:
- Visit Actions tab in GitHub repository
- Look for "pages-build-deployment" workflow
- Green checkmark = successful deployment
Component Specifications
1. Search Interface (index.html)
Search Algorithm
filteredPrompts = allPrompts.filter(prompt =>
prompt.title.toLowerCase().includes(query) ||
prompt.description.toLowerCase().includes(query) ||
prompt.mode.toLowerCase().includes(query) ||
prompt.complexity.toLowerCase().includes(query)
);
Features:
- Real-time, case-insensitive substring matching
- Searches across: title, description, mode, complexity
- Updates statistics dynamically
- Shows empty state when no results
Parsing Logic
function parsePromptFile(filename) {
const base = filename.replace('.html', '');
// D1xP5x pattern matching
const pattern = /D(\d+)xP(\d+)xL(\d+)xC(\d+)xE(\d+)/i;
const match = base.match(pattern);
if (match) {
const [, d, p, l, c, e] = match;
return {
title: `D${d}P${p}L${l}C${c}E${e}`,
complexity: `L${l}`,
mode: getModeFromCode(c),
description: `Depth ${d} · Phase ${p} · Evidence ${e}`,
date: '2025-12-02'
};
}
// Fallback for non-standard names
return {
title: base,
complexity: 'L1',
mode: 'GENERAL',
description: 'Custom prompt template',
date: '2025-12-02'
};
}
Sorting Strategy
allPrompts.sort((a, b) => {
// Primary: Sort by complexity (descending)
const complexA = parseInt(a.complexity.replace('L', ''));
const complexB = parseInt(b.complexity.replace('L', ''));
if (complexA !== complexB) return complexB - complexA;
// Secondary: Alphabetical by title
return a.title.localeCompare(b.title);
});
2. Index Generator (generate-index.js)
Functionality
- Input:
prompts/directory - Output:
prompts/index.json - Filter: Only
.htmlfiles - Sort: Alphabetical order
Usage
# Run manually
node generate-index.js
# Output example:
# Generated index.json with 2 files:
# - D1xP5xL2xC3xE5.html
# - Gitgub-publishing.html
Generated JSON Format
[
"D1xP5xL2xC3xE5.html",
"Gitgub-publishing.html"
]
3. Service Worker (sw.js)
Caching Strategy
Strategy: Network-first with cache fallback
self.addEventListener('fetch', (event) => {
event.respondWith(
fetch(event.request).catch(() => caches.match(event.request))
);
});
Behavior:
- Try to fetch from network
- If offline, serve from cache
- No explicit caching in this implementation (browser manages cache)
Lifecycle
- Install: Immediate activation with
skipWaiting() - Activate: Claims all clients with
clients.claim()
PWA Configuration
Manifest File (manifest.webmanifest)
{
"name": "OrbitPrompt",
"short_name": "OrbitPrompt",
"start_url": "/OrbitPrompt/",
"display": "standalone",
"background_color": "#000000",
"theme_color": "#000000",
"icons": [
{
"src": "/OrbitPrompt/orbitprompt-logo.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/OrbitPrompt/orbitprompt-logo.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
}
Installation Requirements
For PWA installability, ensure:
- HTTPS: GitHub Pages provides this automatically
- Manifest: Present and linked in
index.html - Service Worker: Registered and active
- Icons: At least one icon (192x192 or larger)
- Start URL: Responds with 200 when offline
Testing PWA Features
Chrome DevTools:
- Open DevTools → Application tab
- Check "Manifest" section for errors
- Verify "Service Workers" are registered
- Test "Offline" mode in Network tab
Lighthouse:
# Run Lighthouse audit
npx lighthouse https://dtslib1979.github.io/OrbitPrompt/ --view
Maintenance & Troubleshooting
Common Issues
Issue: Prompts not appearing after adding new files
Symptoms:
- New
.htmlfile inprompts/directory - File doesn't show up on the website
Solutions:
- Check if
index.jsonwas updated
cat prompts/index.json
- Manually regenerate index
node generate-index.js
git add prompts/index.json
git commit -m "Update index"
git push
- Verify GitHub Actions workflow ran successfully
- Visit Actions tab
- Check "Update Prompt Index" workflow
- Clear browser cache and hard reload (Ctrl+Shift+R)
Issue: GitHub Pages not updating
Solutions:
- Check deployment status in Actions tab
- Verify Pages settings point to correct branch/folder
- Wait 2-3 minutes for propagation
- Check if there are any build errors
Issue: PWA not installing on mobile
Solutions:
- Verify HTTPS (GitHub Pages auto-provides)
- Check manifest.webmanifest is accessible
- Ensure icon file exists and is correct size
- Test with Chrome's "Add to Home Screen" prompt
Updating Dependencies
None required - This is a zero-dependency project!
To update Node.js for development:
# Check current version
node --version
# Update via your package manager
# macOS (Homebrew):
brew upgrade node
# Ubuntu/Debian:
sudo apt update && sudo apt upgrade nodejs
Backup and Recovery
# Create backup of prompts directory
tar -czf prompts-backup-$(date +%Y%m%d).tar.gz prompts/
# Restore from backup
tar -xzf prompts-backup-YYYYMMDD.tar.gz
# Git-based recovery
git checkout main -- prompts/
API Reference
JavaScript API (for extending index.html)
Core Functions
##### parsePromptFile(filename)
Parses a filename into structured metadata.
Parameters:
filename(string): The prompt filename (e.g., "D1xP5xL2xC3xE5.html")
Returns:
{
title: string, // Display name
complexity: string, // "L1" to "L9"
mode: string, // "ENGINEERING", "ARCHITECTURE", etc.
description: string, // Formatted description
date: string // ISO date string
}
##### getModeFromCode(code)
Maps category codes to mode names.
Parameters:
code(string): "1" through "5"
Returns:
- "ENGINEERING" (1)
- "ARCHITECTURE" (2)
- "CRITICAL" (3)
- "EVIDENCE" (4)
- "SHAMAN" (5)
- "GENERAL" (default)
##### createBar(prompt)
Generates HTML for a prompt list item.
Parameters:
prompt = {
filename: string,
title: string,
complexity: string,
mode: string,
description: string,
date: string
}
Returns: HTML string
##### loadPrompts()
Main initialization function. Fetches and renders prompts.
Async: Yes
Side Effects:
- Populates
allPromptsglobal array - Renders initial UI
- Hides loading spinner
##### renderPrompts(prompts)
Renders prompt list or empty state.
Parameters:
prompts(Array): Array of prompt objects to display
Data Formats
index.json Schema
[
"string", // filename with .html extension
"string",
...
]
Example:
[
"D1xP1xL1xC1xE1.html",
"D2xP3xL4xC5xE2.html",
"CustomPrompt.html"
]
Prompt Metadata Object
{
filename: "D1xP5xL2xC3xE5.html",
title: "D1P5L2C3E5",
complexity: "L2",
mode: "CRITICAL",
description: "Depth 1 · Phase 5 · Evidence 5",
date: "2025-12-02"
}
Performance Optimization
Current Performance
- Initial Load: < 500ms (excluding GitHub Pages CDN)
- Search Response: < 50ms for 100 prompts
- Bundle Size: 27KB (index.html)
- No External Dependencies: Zero network requests after first load
Optimization Tips
- Image Optimization: Compress
orbitprompt-logo.pngif needed
# Using ImageOptim or similar
optipng -o7 orbitprompt-logo.png
- Lazy Loading Prompts: For 1000+ prompts, implement pagination
// Add to index.html
const PAGE_SIZE = 50;
function renderPage(page) {
const start = page * PAGE_SIZE;
const end = start + PAGE_SIZE;
renderPrompts(filteredPrompts.slice(start, end));
}
- Service Worker Caching: Enhance
sw.jswith explicit caching
const CACHE_NAME = 'orbitprompt-v2';
const urlsToCache = ['/', '/index.html', '/prompts/index.json'];
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME)
.then(cache => cache.addAll(urlsToCache))
);
});
Security Considerations
Current Security Posture
- No Backend: Eliminates server-side vulnerabilities
- No User Input Storage: No database or persistence layer
- Static Content: XSS risk limited to prompt file content
- GitHub Pages: HTTPS enforced, DDoS protection included
Best Practices
- Content Sanitization: When adding prompts, avoid inline scripts
<!-- ❌ Avoid -->
<script>alert('xss')</script>
<!-- ✅ Use -->
<pre><script>alert('xss')</script></pre>
- Repository Permissions: Limit write access to trusted contributors
- Secrets Management: Never commit API keys or secrets
# Already configured in .gitignore
*.env
.env.local
Extension Points
Adding New Features
1. Category Filtering
Add dropdown filter in index.html:
<select id="categoryFilter">
<option value="">All Categories</option>
<option value="ENGINEERING">Engineering</option>
<option value="ARCHITECTURE">Architecture</option>
<!-- ... -->
</select>
document.getElementById('categoryFilter').addEventListener('change', (e) => {
const category = e.target.value;
filteredPrompts = category
? allPrompts.filter(p => p.mode === category)
: allPrompts;
renderPrompts(filteredPrompts);
});
2. Export Functionality
Add export to CSV:
function exportToCSV() {
const csv = [
['Title', 'Complexity', 'Mode', 'Description'],
...allPrompts.map(p => [p.title, p.complexity, p.mode, p.description])
].map(row => row.join(',')).join('\n');
const blob = new Blob([csv], { type: 'text/csv' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'prompts.csv';
a.click();
}
3. Dark Mode Toggle
Add manual dark mode toggle (currently auto-detected):
const darkModeToggle = document.createElement('button');
darkModeToggle.textContent = '🌙';
darkModeToggle.onclick = () => {
document.body.classList.toggle('dark-mode');
localStorage.setItem('darkMode', document.body.classList.contains('dark-mode'));
};
Conclusion
This technical specification provides a complete blueprint for understanding, replicating, and extending the OrbitPrompt system. The architecture prioritizes simplicity, performance, and maintainability through:
- Zero-configuration deployment via GitHub Pages
- Convention-driven design with filename-based metadata
- Progressive enhancement with PWA capabilities
- Developer-friendly workflow with automated indexing
For questions or contributions, refer to the repository's issue tracker or submit pull requests following the development workflow outlined above.
Document Maintainers:
- System Architects implementing prompt management systems
- Development teams requiring AI prompt organization
Related Resources:
- README.md - User-facing documentation
- GitHub Pages Documentation
- PWA Guide
- GitHub Actions Documentation