From a060995755e5802a3ad0faa7b93eadd6525b8da9 Mon Sep 17 00:00:00 2001 From: Peter Tillemans Date: Thu, 14 Aug 2025 11:46:18 +0200 Subject: [PATCH] added project management and enabled prompt mgt --- .gitignore | 3 +- PLANNING.org | 28 ++++++++++++++++++ TASK.org | 15 ++++++++++ init.org | 36 +++++++++++++++--------- prompts/00-roles.org | 1 + prompts/00-use-org-mode.org | 1 + prompts/10-coding-behavior-rules.org | 1 + prompts/10-documentation.org | 1 + prompts/10-project-context.org | 1 + prompts/10-task-management.org | 1 + prompts/10-tool-usage.org | 1 + prompts/20-code-structure.org | 1 + prompts/20-human-coding-partner.org | 1 + prompts/20-python-style-conventions.org | 1 + prompts/30-python-tests.org | 1 + prompts/aaa-full-python-coder-prompt.org | 1 + prompts/add-context.md | 1 + prompts/auto-expert.md | 1 + prompts/categorize-responses.md | 1 + prompts/glados.md | 1 + prompts/gptel-default.md | 1 + prompts/medium-critic.md | 1 + prompts/medium-writer.md | 1 + prompts/slide-deck.md | 1 + prompts/sparqlizer.md | 1 + prompts/sql-sensei.md | 1 + prompts/tool-use.md | 1 + prompts/writing-helper.md | 1 + 28 files changed, 92 insertions(+), 14 deletions(-) create mode 100644 PLANNING.org create mode 100644 TASK.org create mode 120000 prompts/00-roles.org create mode 120000 prompts/00-use-org-mode.org create mode 120000 prompts/10-coding-behavior-rules.org create mode 120000 prompts/10-documentation.org create mode 120000 prompts/10-project-context.org create mode 120000 prompts/10-task-management.org create mode 120000 prompts/10-tool-usage.org create mode 120000 prompts/20-code-structure.org create mode 120000 prompts/20-human-coding-partner.org create mode 120000 prompts/20-python-style-conventions.org create mode 120000 prompts/30-python-tests.org create mode 120000 prompts/aaa-full-python-coder-prompt.org create mode 120000 prompts/add-context.md create mode 120000 prompts/auto-expert.md create mode 120000 prompts/categorize-responses.md create mode 120000 prompts/glados.md create mode 120000 prompts/gptel-default.md create mode 120000 prompts/medium-critic.md create mode 120000 prompts/medium-writer.md create mode 120000 prompts/slide-deck.md create mode 120000 prompts/sparqlizer.md create mode 120000 prompts/sql-sensei.md create mode 120000 prompts/tool-use.md create mode 120000 prompts/writing-helper.md diff --git a/.gitignore b/.gitignore index 1b04677..e6e3d28 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ !system-prompts/** !composable-prompts !composable-prompts/** - +!prompts +!prompts/** diff --git a/PLANNING.org b/PLANNING.org new file mode 100644 index 0000000..1eb5db5 --- /dev/null +++ b/PLANNING.org @@ -0,0 +1,28 @@ +* Project Vision +This repository provides a fully isolated, reproducible, and portable Emacs configuration, intended to be independent from any other desktop or dotfile management setup. + +* Project Architecture +- Overlay on top of [Crafted Emacs](https://github.com/SystemCrafters/crafted-emacs). +- All configuration lives in this repo; the user overlays, custom modules, and extensions are layered atop the base Crafted Emacs clone. +- Expected installation: Clone this repository into ~/.config/emacs, after Crafted Emacs is already installed (as per Crafted’s instructions). + +* Constraints +- This repository must not require modification of general dotfiles or system-wide config. +- Should be instantly usable on new systems with minimal post-clone setup. +- Must avoid platform-specific logic wherever possible. + +* Tooling & Stack +- Written in Emacs Lisp. +- Managed/documented in Org Mode (literate config is assumed or encouraged). +- Future: Optional make/auto-tangle system for build automation if needed. + +* Contribution Workflow +1. Fork this repo, work on feature branches. +2. PRs are reviewed for quality and clarity. +3. New features/fixes should be documented in README.org and tracked in TASK.org. + +* Open Questions +- Should we enforce any init.el tangling conventions or pre-commit hooks for Org files? + +* Next Steps +- See TASK.org for actionable next moves. diff --git a/TASK.org b/TASK.org new file mode 100644 index 0000000..0dcba31 --- /dev/null +++ b/TASK.org @@ -0,0 +1,15 @@ +* TASK.org: Active & Backlog Tasks +** [X] Bootstrap: Add PLANNING.org and TASK.org to repo [2024-06-12] + - Initial setup for project planning and task management org files. +** [ ] BACKLOG: Check for staleness of overlay config vs Crafted Emacs + - Automate a check: Warn if foundational Crafted Emacs or overlay is out of date, as envisioned in README.org TODOs. +** [ ] BACKLOG: Automate post-clone setup + - Create (optional) post-clone or first-run script for users: Ensures Crafted Emacs is present, overlays are loaded, and reports version status. +** [ ] BACKLOG: Enhance documentation + - Expand INSTALL and USAGE instructions in README.org; distinguish overlay logic, troubleshooting, etc. +** [ ] BACKLOG: Add Org tangling guidance + - Document how/when to tangle Org into init.el (if/when literate config is used). +** [ ] BACKLOG: package as a guix package +It would be nice to update the emacs config when doing a `guix home +reconfigure`. + diff --git a/init.org b/init.org index 2be5d30..b69da96 100644 --- a/init.org +++ b/init.org @@ -3112,7 +3112,7 @@ Tools. Most of the mind share seems to be around [[https://github.com/karthink/gptel][gptel]] as basis for LLM integration in Emacs. -*** Load and Configure Model +*** Load and Configure GPTel #+begin_src emacs-lisp (use-package gptel @@ -3127,7 +3127,7 @@ integration in Emacs. gptel-log-level 'info gptel--debug nil) - (add-to-list 'gptel-prompt-prefix-alist `(org-mode . ,(concat "*** pti " (format-time-string "[%Y-%m-%d]") "\n"))) + (add-to-list 'gptel-prompt-prefix-alist `(org-mode . ,(concat "*** pti " (format-time-string "[%Y-%m-%d %H:%M]") "\n"))) ;; follow output (add-hook 'gptel-post-stream-hook 'gptel-auto-scroll) @@ -3415,7 +3415,7 @@ integration in Emacs. :include t :function (lambda () (with-temp-buffer - (insert-file-contents (string-append user-emacs-directory "org-mode-syntax-cheat-sheet-for-llms.txt")) + (insert-file-contents (concat user-emacs-directory "org-mode-syntax-cheat-sheet-for-llms.txt")) (buffer-string))) :category: "reflection") @@ -3604,33 +3604,37 @@ integration in Emacs. : #s(gptel-tool #[(variable) ((let ((variable (if (symbolp variable) variable (intern variable)))) (if (boundp variable) (symbol-plist variable) (format "Variable %s is not bound" variable)))) (t)] "emacs_variable_properties" "Get properties on an Emacs variable. Use this to get documentation string for variables, as well as more obscure properties such as safety as local variable etc." ((:name "variable" :type "string" :description "the symbol")) nil "reflection" nil t) -*** TODO Load MCP.el - -placeholder +*** Load MCP.el check [[https://www.youtube.com/watch?v=Hkih7jaqOnE&t=544s][Agentic LLM use in Emacs using Model Context Protocol (MCP)]] of Gregg Grubbs for examples what to put here. -#+BEGIN_SRC emacs-lisp :tangle no +#+BEGIN_SRC emacs-lisp :tangle yes (use-package mcp :ensure t :after gptel :custom (mcp-hub-servers - `(("filesystem" . (:command "npx" :args ("-y" "@modelcontextprotocol/server-filesystem" "/home/lizqwer/MyProject/"))) + `(("filesystem" . (:command "npx" :args ("-y" "@modelcontextprotocol/server-filesystem" "/home/pti/Projects/"))) ("fetch" . (:command "uvx" :args ("mcp-server-fetch"))) - ("qdrant" . (:url "http://localhost:8000/sse")) + ;("qdrant" . (:url "http://localhost:8000/sse")) ("graphlit" . ( :command "npx" :args ("-y" "graphlit-mcp-server") :env ( - :GRAPHLIT_ORGANIZATION_ID "your-organization-id" - :GRAPHLIT_ENVIRONMENT_ID "your-environment-id" - :GRAPHLIT_JWT_SECRET "your-jwt-secret"))))) + :GRAPHLIT_ORGANIZATION_ID (auth-source-pass-get "organization-id" "snamellit/graphlit.dev") + :GRAPHLIT_ENVIRONMENT_ID (auth-source-pass-get "environment-id" "snamellit/graphlit.dev") + :GRAPHLIT_JWT_SECRET (auth-source-pass-get 'secret "snamellit/graphlit.dev")))) + ("terminal-controller" . ( + :command "uvx" + :args ("terminal_controller"))))) :config (require 'mcp-hub) :hook (after-init . mcp-hub-start-all-server)) #+END_SRC +#+RESULTS: +: [nil 26780 48702 422697 nil elpaca-process-queues nil nil 640000 nil] + *** Load jwiegley/gptel-prompts for prompt composability This package offers an alternative way to manage your ~gptel-directives~ variable, using files rather than customizing the variable directly. @@ -3641,15 +3645,19 @@ appropriately. #+begin_src emacs-lisp :tangle no (use-package gptel-prompts - :ensure t + :ensure (:host github :repo "jwiegley/gptel-prompts") :after (gptel) :demand t :config + (setq gptel-prompts-directory (concat user-emacs-directory "prompts")) (gptel-prompts-update) ;; Ensure prompts are updated if prompt files change (gptel-prompts-add-update-watchers)) #+end_src +#+RESULTS: +: [nil 26781 40675 800401 nil elpaca-process-queues nil nil 577000 nil] + **** Different prompt types @@ -3701,6 +3709,8 @@ file itself to use what is easiest to maintain in the editor. NOTE: If you wish to use the Prompt Poet format, you will need to install the Emacs dependencies yaml and templatel. + + ** Copilot Support #+BEGIN_SRC emacs-lisp diff --git a/prompts/00-roles.org b/prompts/00-roles.org new file mode 120000 index 0000000..c0801cb --- /dev/null +++ b/prompts/00-roles.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/00-roles.org \ No newline at end of file diff --git a/prompts/00-use-org-mode.org b/prompts/00-use-org-mode.org new file mode 120000 index 0000000..58146a2 --- /dev/null +++ b/prompts/00-use-org-mode.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/00-use-org-mode.org \ No newline at end of file diff --git a/prompts/10-coding-behavior-rules.org b/prompts/10-coding-behavior-rules.org new file mode 120000 index 0000000..0f19da9 --- /dev/null +++ b/prompts/10-coding-behavior-rules.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/10-coding-behavior-rules.org \ No newline at end of file diff --git a/prompts/10-documentation.org b/prompts/10-documentation.org new file mode 120000 index 0000000..4006330 --- /dev/null +++ b/prompts/10-documentation.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/10-documentation.org \ No newline at end of file diff --git a/prompts/10-project-context.org b/prompts/10-project-context.org new file mode 120000 index 0000000..a398f4f --- /dev/null +++ b/prompts/10-project-context.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/10-project-context.org \ No newline at end of file diff --git a/prompts/10-task-management.org b/prompts/10-task-management.org new file mode 120000 index 0000000..86ff570 --- /dev/null +++ b/prompts/10-task-management.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/10-task-management.org \ No newline at end of file diff --git a/prompts/10-tool-usage.org b/prompts/10-tool-usage.org new file mode 120000 index 0000000..d06c8bc --- /dev/null +++ b/prompts/10-tool-usage.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/10-tool-usage.org \ No newline at end of file diff --git a/prompts/20-code-structure.org b/prompts/20-code-structure.org new file mode 120000 index 0000000..e36fdd1 --- /dev/null +++ b/prompts/20-code-structure.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/20-code-structure.org \ No newline at end of file diff --git a/prompts/20-human-coding-partner.org b/prompts/20-human-coding-partner.org new file mode 120000 index 0000000..1767d67 --- /dev/null +++ b/prompts/20-human-coding-partner.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/20-human-coding-partner.org \ No newline at end of file diff --git a/prompts/20-python-style-conventions.org b/prompts/20-python-style-conventions.org new file mode 120000 index 0000000..17dad42 --- /dev/null +++ b/prompts/20-python-style-conventions.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/20-python-style-conventions.org \ No newline at end of file diff --git a/prompts/30-python-tests.org b/prompts/30-python-tests.org new file mode 120000 index 0000000..312d0e7 --- /dev/null +++ b/prompts/30-python-tests.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/30-python-tests.org \ No newline at end of file diff --git a/prompts/aaa-full-python-coder-prompt.org b/prompts/aaa-full-python-coder-prompt.org new file mode 120000 index 0000000..3593a89 --- /dev/null +++ b/prompts/aaa-full-python-coder-prompt.org @@ -0,0 +1 @@ +/home/pti/.config/emacs/composable-prompts/aaa-full-python-coder-prompt.org \ No newline at end of file diff --git a/prompts/add-context.md b/prompts/add-context.md new file mode 120000 index 0000000..f76d382 --- /dev/null +++ b/prompts/add-context.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/add-context.md \ No newline at end of file diff --git a/prompts/auto-expert.md b/prompts/auto-expert.md new file mode 120000 index 0000000..115eba6 --- /dev/null +++ b/prompts/auto-expert.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/auto-expert.md \ No newline at end of file diff --git a/prompts/categorize-responses.md b/prompts/categorize-responses.md new file mode 120000 index 0000000..c798525 --- /dev/null +++ b/prompts/categorize-responses.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/categorize-responses.md \ No newline at end of file diff --git a/prompts/glados.md b/prompts/glados.md new file mode 120000 index 0000000..20ffe01 --- /dev/null +++ b/prompts/glados.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/glados.md \ No newline at end of file diff --git a/prompts/gptel-default.md b/prompts/gptel-default.md new file mode 120000 index 0000000..92526eb --- /dev/null +++ b/prompts/gptel-default.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/gptel-default.md \ No newline at end of file diff --git a/prompts/medium-critic.md b/prompts/medium-critic.md new file mode 120000 index 0000000..cb6ac2a --- /dev/null +++ b/prompts/medium-critic.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/medium-critic.md \ No newline at end of file diff --git a/prompts/medium-writer.md b/prompts/medium-writer.md new file mode 120000 index 0000000..11070b9 --- /dev/null +++ b/prompts/medium-writer.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/medium-writer.md \ No newline at end of file diff --git a/prompts/slide-deck.md b/prompts/slide-deck.md new file mode 120000 index 0000000..1bf596c --- /dev/null +++ b/prompts/slide-deck.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/slide-deck.md \ No newline at end of file diff --git a/prompts/sparqlizer.md b/prompts/sparqlizer.md new file mode 120000 index 0000000..6deaad5 --- /dev/null +++ b/prompts/sparqlizer.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/sparqlizer.md \ No newline at end of file diff --git a/prompts/sql-sensei.md b/prompts/sql-sensei.md new file mode 120000 index 0000000..013ad86 --- /dev/null +++ b/prompts/sql-sensei.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/sql-sensei.md \ No newline at end of file diff --git a/prompts/tool-use.md b/prompts/tool-use.md new file mode 120000 index 0000000..58c5d39 --- /dev/null +++ b/prompts/tool-use.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/tool-use.md \ No newline at end of file diff --git a/prompts/writing-helper.md b/prompts/writing-helper.md new file mode 120000 index 0000000..2e0fd82 --- /dev/null +++ b/prompts/writing-helper.md @@ -0,0 +1 @@ +/home/pti/.config/emacs/system-prompts/writing-helper.md \ No newline at end of file