Add Feynman skill and memory to workflow template
- feynman/skills/workflow-bootstrap/SKILL.md - Bootstrap skill - feynman/memory-template.md - Memory template - feynman/README.md - Feynman configs documentation - scripts/setup.sh - Updated to auto-install Feynman configs if detected - docs/workflow/INDEX.md - Updated with Feynman integration info - README.md - Updated with Feynman integration section When running 'pnpm run setup': 1. Checks for Feynman installation 2. Installs workflow-bootstrap skill to ~/.feynman/agent/skills/ 3. Creates .feynman/memory.md from template 4. Gives two-layer nudge: skill (manual) + memory (automatic)
This commit is contained in:
18
README.md
18
README.md
@@ -15,14 +15,14 @@ rm -rf .git
|
|||||||
# Initialize git
|
# Initialize git
|
||||||
git init
|
git init
|
||||||
|
|
||||||
# Setup (installs pnpm if missing, dependencies, and pre-commit hook)
|
# Setup (installs pnpm, dependencies, pre-commit hook, and Feynman configs)
|
||||||
pnpm run setup
|
pnpm run setup
|
||||||
|
|
||||||
# Remove this README (it's the template's README)
|
# Remove this README (it's the template's README)
|
||||||
rm README.md
|
rm README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
**That's it.** The setup script handles everything.
|
**That's it.** The setup script handles everything—including installing the Feynman skill if Feynman is detected.
|
||||||
|
|
||||||
## What This Is
|
## What This Is
|
||||||
|
|
||||||
@@ -31,12 +31,26 @@ rm README.md
|
|||||||
- **Agents think out loud** in issue files, making reasoning visible
|
- **Agents think out loud** in issue files, making reasoning visible
|
||||||
- **Humans approve reasoning**, not code line-by-line
|
- **Humans approve reasoning**, not code line-by-line
|
||||||
- **Pre-commit hooks enforce** issue format before any commit
|
- **Pre-commit hooks enforce** issue format before any commit
|
||||||
|
- **Feynman integration** for automatic workflow bootstrapping
|
||||||
|
|
||||||
|
## Feynman Integration
|
||||||
|
|
||||||
|
If Feynman is installed on your system, the setup script will automatically:
|
||||||
|
|
||||||
|
1. Detect the Feynman installation
|
||||||
|
2. Install the `workflow-bootstrap` skill
|
||||||
|
3. Create `.feynman/memory.md` with workflow preferences
|
||||||
|
|
||||||
|
This gives you a two-layer nudge system:
|
||||||
|
- **Skill** (manual trigger): Say "feynman, set up the workflow" for new projects
|
||||||
|
- **Memory** (automatic nudge): Feynman reminds you if you forget
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- **Node.js** (recommended: https://nodejs.org)
|
- **Node.js** (recommended: https://nodejs.org)
|
||||||
- If you don't have Node.js, the setup script will install `pnpm` using `corepack` or `npm`
|
- If you don't have Node.js, the setup script will install `pnpm` using `corepack` or `npm`
|
||||||
- **Git**
|
- **Git**
|
||||||
|
- **Feynman** (optional, for automatic workflow bootstrapping)
|
||||||
|
|
||||||
No other dependencies required for the workflow itself.
|
No other dependencies required for the workflow itself.
|
||||||
|
|
||||||
|
|||||||
@@ -56,11 +56,19 @@ A workflow where:
|
|||||||
|
|
||||||
## Before Starting a New Project
|
## Before Starting a New Project
|
||||||
|
|
||||||
Tell your agent to set up the workflow:
|
If you have Feynman installed:
|
||||||
|
|
||||||
> "feynman, set up the workflow using the template from https://git.fbrns.co/shoko/workflow"
|
> "feynman, set up the workflow"
|
||||||
|
|
||||||
The agent will copy the structure and install the pre-commit hook automatically.
|
Feynman will clone the template, copy the structure, install the pre-commit hook, and set up its own skill and memory.
|
||||||
|
|
||||||
|
If Feynman is not installed, manually:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://git.fbrns.co/shoko/workflow.git my-new-project
|
||||||
|
cd my-new-project
|
||||||
|
pnpm run setup
|
||||||
|
```
|
||||||
|
|
||||||
## For New Team Members
|
## For New Team Members
|
||||||
|
|
||||||
|
|||||||
76
feynman/README.md
Normal file
76
feynman/README.md
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# Feynman Configuration
|
||||||
|
|
||||||
|
This directory contains Feynman-specific configurations that can be installed alongside the workflow.
|
||||||
|
|
||||||
|
## What's Included
|
||||||
|
|
||||||
|
```
|
||||||
|
feynman/
|
||||||
|
├── README.md ← This file
|
||||||
|
├── skills/
|
||||||
|
│ └── workflow-bootstrap/
|
||||||
|
│ └── SKILL.md ← Skill to bootstrap new projects
|
||||||
|
└── memory-template.md ← Memory template to load into Feynman
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
These are installed automatically by `pnpm run setup` if Feynman is detected.
|
||||||
|
|
||||||
|
### Manual Installation
|
||||||
|
|
||||||
|
**Skill:**
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.feynman/agent/skills
|
||||||
|
cp -r feynman/skills/* ~/.feynman/agent/skills/
|
||||||
|
```
|
||||||
|
|
||||||
|
**Memory:**
|
||||||
|
```bash
|
||||||
|
# Copy as memory.md in your project's .feynman directory
|
||||||
|
cp feynman/memory-template.md /path/to/your/project/.feynman/memory.md
|
||||||
|
|
||||||
|
# Or load into Feynman's persistent memory directly
|
||||||
|
```
|
||||||
|
|
||||||
|
## What the Skill Does
|
||||||
|
|
||||||
|
The `workflow-bootstrap` skill allows Feynman to set up the issue-based workflow for any new project:
|
||||||
|
|
||||||
|
1. Clone the workflow template from `https://git.fbrns.co/shoko/workflow`
|
||||||
|
2. Copy docs, issues structure, and hooks to the current project
|
||||||
|
3. Run the setup script
|
||||||
|
4. Summarize what was set up
|
||||||
|
|
||||||
|
**Trigger phrases:**
|
||||||
|
- "feynman, start a new project"
|
||||||
|
- "set up the workflow"
|
||||||
|
- "apply the workflow template"
|
||||||
|
- "initialize the issue-based workflow"
|
||||||
|
|
||||||
|
## What the Memory Does
|
||||||
|
|
||||||
|
The memory template contains:
|
||||||
|
- `pref.new_project_workflow`: Location and structure of the workflow template
|
||||||
|
- `lesson.workflow.new_project_nudge`: A nudge rule to remind you to use the workflow
|
||||||
|
|
||||||
|
This gives you a two-layer enforcement:
|
||||||
|
1. **Skill** (manual trigger): You say "new project" and Feynman sets it up
|
||||||
|
2. **Memory** (automatic nudge): If you forget, Feynman reminds you
|
||||||
|
|
||||||
|
## For Fresh Feynman Installations
|
||||||
|
|
||||||
|
If you're running Feynman on a new host:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Clone the workflow template (it includes feynman configs)
|
||||||
|
git clone https://git.fbrns.co/shoko/workflow.git my-project
|
||||||
|
cd my-project
|
||||||
|
|
||||||
|
# 2. Run setup (installs pnpm, hooks, and feynman configs)
|
||||||
|
pnpm run setup
|
||||||
|
|
||||||
|
# 3. Load the memory into Feynman
|
||||||
|
# In Feynman: /memory.md to load the memory template
|
||||||
|
# Or: copy feynman/memory-template.md to your project's .feynman/memory.md
|
||||||
|
```
|
||||||
17
feynman/memory-template.md
Normal file
17
feynman/memory-template.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Feynman Memory Template
|
||||||
|
|
||||||
|
Copy this file to your project's `.feynman/memory.md` or load it into Feynman's persistent memory.
|
||||||
|
|
||||||
|
## pref.new_project_workflow
|
||||||
|
Workflow template lives at: https://git.fbrns.co/shoko/workflow
|
||||||
|
Structure: /docs/workflow/ (INDEX, ISSUE-FORMAT, WORKFLOW, AGENT-PROMPTS), /.issues/ (INDEX + examples), /.hooks/ (issue-linter.js)
|
||||||
|
Two-layer enforcement: Skill (manual trigger) + Memory (nudge if forgotten)
|
||||||
|
Prefers file-based issues over external trackers like Gitea issues
|
||||||
|
Pre-commit hook enforces issue format before commit
|
||||||
|
Agent must think out loud: Plan, Status Log, Self-Verification in issue file
|
||||||
|
Human approves reasoning, not tasks. Human does not manually test unless edge case.
|
||||||
|
|
||||||
|
## lesson.workflow.new_project_nudge
|
||||||
|
When human mentions a new project, ALWAYS check memory for pref.new_project_workflow.
|
||||||
|
If template exists but not used, nudge: "Do you want to use the workflow template from shoko/workflow? I can set it up automatically."
|
||||||
|
Category: workflow
|
||||||
136
feynman/skills/SKILL.md
Normal file
136
feynman/skills/SKILL.md
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
# Workflow Bootstrap Skill
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Set up the issue-based workflow for a new project by cloning the template from `https://git.fbrns.co/shoko/workflow`.
|
||||||
|
|
||||||
|
**This skill is automatically installed** when you run `pnpm run setup` in a project cloned from the workflow template.
|
||||||
|
|
||||||
|
Use this skill when:
|
||||||
|
- Human asks to start a new project
|
||||||
|
- Human asks to "set up the workflow"
|
||||||
|
- Human asks to "apply the workflow template"
|
||||||
|
- Human asks to "initialize the issue-based workflow"
|
||||||
|
- Human is starting work in a new directory without the workflow structure
|
||||||
|
|
||||||
|
## Workflow Template Location
|
||||||
|
- URL: `https://git.fbrns.co/shoko/workflow`
|
||||||
|
- Clone: `https://git.fbrns.co/shoko/workflow.git`
|
||||||
|
- Template repo contains:
|
||||||
|
- `/docs/workflow/` — INDEX.md, ISSUE-FORMAT.md, WORKFLOW.md, AGENT-PROMPTS.md
|
||||||
|
- `/.issues/` — INDEX.md, example issues
|
||||||
|
- `/.hooks/` — issue-linter.js (pre-commit validator)
|
||||||
|
- `/feynman/` — This skill + memory template
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
### 1. Check if workflow already exists
|
||||||
|
```bash
|
||||||
|
# Check if /docs/workflow/INDEX.md exists
|
||||||
|
ls -la /docs/workflow/INDEX.md 2>/dev/null && echo "exists" || echo "not found"
|
||||||
|
```
|
||||||
|
|
||||||
|
If workflow already exists, tell the human and ask if they want to re-initialize or just proceed.
|
||||||
|
|
||||||
|
### 2. Fetch template from Gitea
|
||||||
|
```bash
|
||||||
|
# Clone the template repo
|
||||||
|
git clone https://git.fbrns.co/shoko/workflow.git /tmp/workflow-template
|
||||||
|
|
||||||
|
# Or download as archive
|
||||||
|
curl -L https://git.fbrns.co/shoko/workflow/archive/main.tar.gz | tar -xz -C /tmp/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Copy template structure to current directory
|
||||||
|
```bash
|
||||||
|
# Copy workflow docs
|
||||||
|
cp -r /tmp/workflow-template/docs/workflow/ ./docs/
|
||||||
|
|
||||||
|
# Copy issue structure (but not example files unless needed)
|
||||||
|
mkdir -p ./.issues
|
||||||
|
cp /tmp/workflow-template/.issues/INDEX.md ./.issues/
|
||||||
|
|
||||||
|
# Copy hooks
|
||||||
|
mkdir -p ./.hooks
|
||||||
|
cp /tmp/workflow-template/.hooks/issue-linter.js ./.hooks/
|
||||||
|
|
||||||
|
# Copy package.json scripts if they exist and merge with existing
|
||||||
|
if [ -f /tmp/workflow-template/package.json ]; then
|
||||||
|
# Merge workflow-scripts into existing package.json
|
||||||
|
echo "Template has package.json - review scripts manually"
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Initialize git hooks (pre-commit)
|
||||||
|
```bash
|
||||||
|
# Make hook executable
|
||||||
|
chmod +x ./.hooks/issue-linter.js
|
||||||
|
|
||||||
|
# Set up pre-commit hook
|
||||||
|
mkdir -p .git/hooks
|
||||||
|
cat > .git/hooks/pre-commit << 'EOF'
|
||||||
|
#!/bin/bash
|
||||||
|
node ./.hooks/issue-linter.js
|
||||||
|
EOF
|
||||||
|
chmod +x .git/hooks/pre-commit
|
||||||
|
|
||||||
|
# Or: install via husky if project uses it
|
||||||
|
# npx husky add .husky/pre-commit "node ./.hooks/issue-linter.js"
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Verify setup
|
||||||
|
```bash
|
||||||
|
# Check structure
|
||||||
|
ls -la docs/workflow/
|
||||||
|
ls -la .issues/
|
||||||
|
ls -la .hooks/
|
||||||
|
ls -la .git/hooks/pre-commit
|
||||||
|
|
||||||
|
# Test hook manually
|
||||||
|
echo "Testing pre-commit hook..."
|
||||||
|
# Create a dummy change and try to commit
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6. Create first issue index if needed
|
||||||
|
If `/.issues/INDEX.md` exists, review it and update if needed. If not, create it.
|
||||||
|
|
||||||
|
### 7. Summary for human
|
||||||
|
Tell the human:
|
||||||
|
- What was copied
|
||||||
|
- Where to find the docs
|
||||||
|
- How to start using it
|
||||||
|
- That the pre-commit hook is now active
|
||||||
|
|
||||||
|
Example output:
|
||||||
|
```
|
||||||
|
Workflow template installed. Structure:
|
||||||
|
|
||||||
|
docs/workflow/ ← READ THIS FIRST (INDEX.md)
|
||||||
|
.issues/ ← Your issues live here
|
||||||
|
.hooks/ ← Pre-commit validator active
|
||||||
|
|
||||||
|
Pre-commit hook is installed. Any code change without a valid issue file will be rejected.
|
||||||
|
|
||||||
|
To start working:
|
||||||
|
1. Read docs/workflow/INDEX.md
|
||||||
|
2. Create your first issue in .issues/
|
||||||
|
3. Follow the workflow stages defined there
|
||||||
|
|
||||||
|
Let me know when you're ready to create your first issue.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
|
||||||
|
| Error | What to do |
|
||||||
|
|---|---|
|
||||||
|
| Gitea repo not accessible | Tell human, offer to create structure manually from documentation |
|
||||||
|
| `.git/hooks/` already has pre-commit | Ask human whether to overwrite or merge |
|
||||||
|
| Not in a git repo | Tell human "This requires a git repository. Run `git init` first." |
|
||||||
|
| `node` not available for hook | Fall back to bash-based validator or skip hook with warning |
|
||||||
|
|
||||||
|
## Human Prompts That Trigger This Skill
|
||||||
|
|
||||||
|
- "feynman, start a new project"
|
||||||
|
- "set up the workflow"
|
||||||
|
- "apply the template"
|
||||||
|
- "initialize the issue-based workflow"
|
||||||
|
- "let's work on something new"
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
# - Installs pnpm if missing
|
# - Installs pnpm if missing
|
||||||
# - Installs dependencies
|
# - Installs dependencies
|
||||||
# - Sets up pre-commit hook
|
# - Sets up pre-commit hook
|
||||||
|
# - Installs Feynman skill and memory (if Feynman detected)
|
||||||
#
|
#
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -19,6 +20,33 @@ GREEN='\033[0;32m'
|
|||||||
YELLOW='\033[1;33m'
|
YELLOW='\033[1;33m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# ============================================
|
||||||
|
# Step 0: Check for feynman directory
|
||||||
|
# ============================================
|
||||||
|
FEYNMAN_DIR=""
|
||||||
|
FEYNMAN_SKILLS_DIR=""
|
||||||
|
FEYNMAN_DETECTED=false
|
||||||
|
|
||||||
|
# Check common feynman locations
|
||||||
|
if [ -d "$HOME/.feynman/agent/skills" ]; then
|
||||||
|
FEYNMAN_DIR="$HOME/.feynman"
|
||||||
|
FEYNMAN_SKILLS_DIR="$HOME/.feynman/agent/skills"
|
||||||
|
FEYNMAN_DETECTED=true
|
||||||
|
elif [ -d "$HOME/.config/feynman/agent/skills" ]; then
|
||||||
|
FEYNMAN_DIR="$HOME/.config/feynman"
|
||||||
|
FEYNMAN_SKILLS_DIR="$HOME/.config/feynman/agent/skills"
|
||||||
|
FEYNMAN_DETECTED=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if skill already installed
|
||||||
|
SKILL_INSTALLED=false
|
||||||
|
if [ -d "feynman/skills/workflow-bootstrap" ]; then
|
||||||
|
if [ "$FEYNMAN_DETECTED" = true ] && [ -d "$FEYNMAN_SKILLS_DIR/workflow-bootstrap" ]; then
|
||||||
|
SKILL_INSTALLED=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ============================================
|
||||||
# Step 1: Check/install pnpm
|
# Step 1: Check/install pnpm
|
||||||
echo "Checking for pnpm..."
|
echo "Checking for pnpm..."
|
||||||
|
|
||||||
@@ -89,7 +117,66 @@ chmod +x scripts/setup.sh
|
|||||||
echo -e "${GREEN}Pre-commit hook installed.${NC}"
|
echo -e "${GREEN}Pre-commit hook installed.${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Step 4: Summary
|
# ============================================
|
||||||
|
# Step 4: Install Feynman configs (if feynman detected)
|
||||||
|
# ============================================
|
||||||
|
if [ "$FEYNMAN_DETECTED" = true ] && [ "$SKILL_INSTALLED" = false ]; then
|
||||||
|
echo "=========================================="
|
||||||
|
echo "Feynman Detected"
|
||||||
|
echo "=========================================="
|
||||||
|
echo ""
|
||||||
|
echo -e "${YELLOW}Feynman installation found at: $FEYNMAN_DIR${NC}"
|
||||||
|
|
||||||
|
# Check if feynman directory is writable
|
||||||
|
if [ -w "$FEYNMAN_SKILLS_DIR" ]; then
|
||||||
|
echo "Installing workflow-bootstrap skill..."
|
||||||
|
mkdir -p "$FEYNMAN_SKILLS_DIR/workflow-bootstrap"
|
||||||
|
cp -f feynman/skills/workflow-bootstrap/SKILL.md "$FEYNMAN_SKILLS_DIR/workflow-bootstrap/"
|
||||||
|
echo -e "${GREEN}Skill installed to: $FEYNMAN_SKILLS_DIR/workflow-bootstrap/${NC}"
|
||||||
|
|
||||||
|
# Also create/update memory in the project if .feynman exists
|
||||||
|
if [ -d ".feynman" ]; then
|
||||||
|
if [ ! -f ".feynman/memory.md" ]; then
|
||||||
|
echo "Creating .feynman/memory.md..."
|
||||||
|
cp feynman/memory-template.md .feynman/memory.md
|
||||||
|
echo -e "${GREEN}Memory template installed to: .feynman/memory.md${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${YELLOW}.feynman/memory.md already exists. Skipping.${NC}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Feynman can now bootstrap this workflow for any new project."
|
||||||
|
echo "Trigger phrases:"
|
||||||
|
echo " - 'feynman, start a new project'"
|
||||||
|
echo " - 'set up the workflow'"
|
||||||
|
echo " - 'apply the workflow template'"
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo -e "${YELLOW}Warning: Feynman skills directory not writable.${NC}"
|
||||||
|
echo "To install the workflow-bootstrap skill manually:"
|
||||||
|
echo " mkdir -p $FEYNMAN_SKILLS_DIR/workflow-bootstrap"
|
||||||
|
echo " cp feynman/skills/workflow-bootstrap/SKILL.md $FEYNMAN_SKILLS_DIR/workflow-bootstrap/"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
elif [ "$SKILL_INSTALLED" = true ]; then
|
||||||
|
echo -e "${GREEN}Workflow-bootstrap skill already installed.${NC}"
|
||||||
|
else
|
||||||
|
echo "=========================================="
|
||||||
|
echo "Feynman Not Detected"
|
||||||
|
echo "=========================================="
|
||||||
|
echo ""
|
||||||
|
echo -e "${YELLOW}Feynman not found. The workflow-bootstrap skill was not installed.${NC}"
|
||||||
|
echo ""
|
||||||
|
echo "To install Feynman: https://github.com/your-org/feynman"
|
||||||
|
echo ""
|
||||||
|
echo "After installing Feynman, you can manually copy the skill:"
|
||||||
|
echo " mkdir -p ~/.feynman/agent/skills"
|
||||||
|
echo " cp -r feynman/skills/* ~/.feynman/agent/skills/"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 5: Summary
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo -e "${GREEN}Setup complete!${NC}"
|
echo -e "${GREEN}Setup complete!${NC}"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
|
|||||||
Reference in New Issue
Block a user