diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..db6e07f --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,15 @@ +# Pull Request Template + +## Description +Provide a concise summary of the changes, referenced work, or new research. + +## Checklist +- [ ] I followed the **COLLABORATION.md** workflow guidelines. +- [ ] All markdown files include a valid **front‑matter** block. +- [ ] The **ci‑pre-push.sh** script passed locally. +- [ ] I added an entry to `knowledge-base/index.md` if new knowledge was created. +- [ ] I updated or reviewed any relevant `AGENTS.md` files. +- [ ] No breaking changes were introduced. + +--- +*All automated processes will run on this PR before merging.* \ No newline at end of file diff --git a/knowledge-base/index.md b/knowledge-base/index.md new file mode 100644 index 0000000..32e3d47 --- /dev/null +++ b/knowledge-base/index.md @@ -0,0 +1,16 @@ +# Knowledge Base Index + +Curated index of all distilled knowledge entries. Each entry links to its source research or daily log. + +## Core Identity & Collaboration +- COLLABORATION.md: Complete agent collaboration playbook with forking, branching, PR process, CI checks, and communication channels +- knowledge-base/morpheus-identity.md: Morpheus agent identity, stack overview, active workstreams, and evolution suggestions + +## Tech Studies +- 2026-06-11-forgejo-url-change-and-repo-access.md: Forgejo URL migration analysis and repo access details + +## Daily Logs +*No entries yet – use `./scripts/new-study.sh "topic" "YYYY-MM-DD"` to add.* + +## Backups +- backups/hermes-memory-sanitized-2026-06-10.md: Sanitized memory snapshot \ No newline at end of file diff --git a/scripts/ci-pre-push.sh b/scripts/ci-pre-push.sh new file mode 100644 index 0000000..23e720b --- /dev/null +++ b/scripts/ci-pre-push.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# ci-pre-push.sh - Validate markdown files before push +set -euo pipefail + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +echo -e "${YELLOW}Running pre-push checks...${NC}" + +# Check if any markdown files changed +if [[ $(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(md|markdown)$' | wc -l) -eq 0 ]]; then + echo "No markdown files staged for commit." + exit 0 +fi + +ERRORS=0 + +# Validate each staged markdown file +while IFS= read -r file; do + echo "Checking $file..." + if [[ -f "$file" ]]; then + # Check front-matter existence (--- at start) + if ! head -n 1 "$file" | grep -q '^---$'; then + echo -e "${RED}ERROR: $file is missing front-matter (should start with ---)${NC}" + ((ERRORS++)) + else + # Extract front-matter block (lines between first and second ---) + front_matter=$(sed -n '2,/^---$/p' "$file" | head -n -1) + # Check for required fields + if ! echo "$front_matter" | grep -q '^title:'; then + echo -e "${RED}ERROR: $file missing title in front-matter${NC}" + ((ERRORS++)) + fi + if ! echo "$front_matter" | grep -q '^date:'; then + echo -e "${RED}ERROR: $file missing date in front-matter${NC}" + ((ERRORS++)) + fi + # Optional: check date format + date_line=$(echo "$front_matter" | grep '^date:' | sed 's/date: //') + if [[ -n "$date_line" && ! "$date_line" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then + echo -e "${YELLOW}WARNING: $file date format not YYYY-MM-DD: $date_line${NC}" + fi + fi + + # Spell check if aspell is available + if command -v aspell >/dev/null 2>&1; then + # Strip front-matter and code blocks, then spell check + content=$(sed '/^---$/,/^---$/d' "$file" | sed '/```.*/,/```/d') + if echo "$content" | aspell list | grep -v '^$' | head -n 5 | grep -q .; then + echo -e "${YELLOW}WARNING: $file has potential spelling errors (see above)${NC}" + # Don't fail on spelling + fi + fi + + # Check for TODO/FIXME comments (optional warning) + if grep -n -i 'TODO\|FIXME' "$file" | head -n 5 | grep -q .; then + echo -e "${YELLOW}INFO: $file contains TODO/FIXME comments${NC}" + fi + fi +done < <(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(md|markdown)$') + +if [[ $ERRORS -gt 0 ]]; then + echo -e "${RED}Pre-push checks failed. Fix errors above before committing.${NC}" + exit 1 +else + echo -e "${GREEN}All pre-push checks passed.${NC}" +fi \ No newline at end of file diff --git a/scripts/env.sh b/scripts/env.sh new file mode 100755 index 0000000..799bd9f --- /dev/null +++ b/scripts/env.sh @@ -0,0 +1 @@ +#!/bin/bash\nexport PATH=\$PATH:\$HOME/morpheus-brain/scripts diff --git a/scripts/new-study.sh b/scripts/new-study.sh new file mode 100644 index 0000000..7b17480 --- /dev/null +++ b/scripts/new-study.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# new-study.sh - Scaffold a new research markdown file +# Usage: ./scripts/new-study.sh [YYYY-MM-DD] +set -e +TOPIC="${1:?topic name required}" +DATE="${2:-$(date +%Y-%m-%d)}" +FILE="research/tech-study/${DATE}-${TOPIC}.md" +mkdir -p "$(dirname "$FILE")" + +cat > "$FILE" <> knowledge-base/index.md +echo "Appended entry to knowledge-base/index.md" \ No newline at end of file