prompt_manager 0.5.8 → 1.0.1

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.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -1
  3. data/README.md +241 -501
  4. data/Rakefile +0 -8
  5. data/docs/api/configuration.md +31 -327
  6. data/docs/api/constants.md +60 -0
  7. data/docs/api/index.md +14 -0
  8. data/docs/api/metadata.md +99 -0
  9. data/docs/api/parsed.md +98 -0
  10. data/docs/api/pm-module.md +131 -0
  11. data/docs/api/render-context.md +51 -0
  12. data/docs/architecture/design-decisions.md +70 -0
  13. data/docs/architecture/index.md +6 -0
  14. data/docs/architecture/processing-pipeline.md +112 -0
  15. data/docs/assets/css/custom.css +1 -0
  16. data/docs/assets/images/prompt_manager.gif +0 -0
  17. data/docs/assets/images/prompt_manager.mp4 +0 -0
  18. data/docs/examples/ai-agent-prompts.md +173 -0
  19. data/docs/examples/code-review-prompt.md +107 -0
  20. data/docs/examples/index.md +7 -0
  21. data/docs/examples/multi-file-composition.md +123 -0
  22. data/docs/getting-started/configuration.md +106 -0
  23. data/docs/getting-started/index.md +7 -0
  24. data/docs/getting-started/installation.md +10 -73
  25. data/docs/getting-started/quick-start.md +50 -225
  26. data/docs/guides/comment-stripping.md +64 -0
  27. data/docs/guides/custom-directives.md +180 -0
  28. data/docs/guides/erb-rendering.md +102 -0
  29. data/docs/guides/includes.md +184 -0
  30. data/docs/guides/index.md +11 -0
  31. data/docs/guides/parameters.md +96 -0
  32. data/docs/guides/parsing.md +127 -0
  33. data/docs/guides/shell-expansion.md +108 -0
  34. data/docs/index.md +54 -214
  35. data/lib/pm/configuration.rb +17 -0
  36. data/lib/pm/core_directives.rb +51 -0
  37. data/lib/pm/directive.rb +144 -0
  38. data/lib/pm/directives.rb +33 -0
  39. data/lib/pm/metadata.rb +17 -0
  40. data/lib/pm/parsed.rb +59 -0
  41. data/lib/pm/shell.rb +57 -0
  42. data/lib/pm/version.rb +5 -0
  43. data/lib/pm.rb +126 -0
  44. data/lib/prompt_manager.rb +2 -27
  45. data/mkdocs.yml +101 -66
  46. metadata +44 -101
  47. data/docs/.keep +0 -0
  48. data/docs/advanced/custom-keywords.md +0 -421
  49. data/docs/advanced/dynamic-directives.md +0 -535
  50. data/docs/advanced/performance.md +0 -612
  51. data/docs/advanced/search-integration.md +0 -635
  52. data/docs/api/directive-processor.md +0 -431
  53. data/docs/api/prompt-class.md +0 -354
  54. data/docs/api/storage-adapters.md +0 -462
  55. data/docs/assets/favicon.ico +0 -1
  56. data/docs/assets/logo.svg +0 -24
  57. data/docs/core-features/comments.md +0 -48
  58. data/docs/core-features/directive-processing.md +0 -38
  59. data/docs/core-features/erb-integration.md +0 -68
  60. data/docs/core-features/error-handling.md +0 -197
  61. data/docs/core-features/parameter-history.md +0 -76
  62. data/docs/core-features/parameterized-prompts.md +0 -500
  63. data/docs/core-features/shell-integration.md +0 -79
  64. data/docs/development/architecture.md +0 -544
  65. data/docs/development/contributing.md +0 -425
  66. data/docs/development/roadmap.md +0 -234
  67. data/docs/development/testing.md +0 -822
  68. data/docs/examples/advanced.md +0 -523
  69. data/docs/examples/basic.md +0 -688
  70. data/docs/examples/real-world.md +0 -776
  71. data/docs/examples.md +0 -337
  72. data/docs/getting-started/basic-concepts.md +0 -318
  73. data/docs/migration/v0.9.0.md +0 -459
  74. data/docs/migration/v1.0.0.md +0 -591
  75. data/docs/storage/activerecord-adapter.md +0 -348
  76. data/docs/storage/custom-adapters.md +0 -176
  77. data/docs/storage/filesystem-adapter.md +0 -236
  78. data/docs/storage/overview.md +0 -427
  79. data/examples/advanced_integrations.rb +0 -52
  80. data/examples/directives.rb +0 -102
  81. data/examples/prompts_dir/advanced_demo.txt +0 -79
  82. data/examples/prompts_dir/directive_example.json +0 -1
  83. data/examples/prompts_dir/directive_example.txt +0 -8
  84. data/examples/prompts_dir/todo.json +0 -1
  85. data/examples/prompts_dir/todo.txt +0 -7
  86. data/examples/prompts_dir/toy/8-ball.txt +0 -4
  87. data/examples/rgfzf +0 -44
  88. data/examples/simple.rb +0 -160
  89. data/examples/using_search_proc.rb +0 -68
  90. data/improvement_plan.md +0 -996
  91. data/lib/prompt_manager/directive_processor.rb +0 -47
  92. data/lib/prompt_manager/prompt.rb +0 -195
  93. data/lib/prompt_manager/storage/active_record_adapter.rb +0 -157
  94. data/lib/prompt_manager/storage/file_system_adapter.rb +0 -339
  95. data/lib/prompt_manager/storage.rb +0 -34
  96. data/lib/prompt_manager/version.rb +0 -5
  97. data/prompt_manager_logo.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92890a2ce51edad60859a5e4c77936807a81fae1a00eca18bf7c6b6b9b066d37
4
- data.tar.gz: b22ac1517476e01b5f4b26007e8dcfd752ffbc84e0824fe0090f3b2f33643c72
3
+ metadata.gz: 8f6339dd195179a1d9d9f996d1dfc4d0c689a3ed4bb9415fe2d5d68eaaa761ba
4
+ data.tar.gz: 2b443af6d4ea259fd124c6ff9d225129d0e233fbffc0d9e86a42ce2189595f29
5
5
  SHA512:
6
- metadata.gz: 7b45b620e66f239bbcd3174f5100ce23defb7549e7035c685d9c92a9fd14f3f73c206aa293edec2f1e31258d7a376c3e2126ec8e9c4beca6d3b8218420fc8119
7
- data.tar.gz: '09939dc0cbcc53e36208d79096df3f57d7e6755fff0410b5ce8bb99482d2dce79e7fb3a210c4f2fca615890a19bbfe51b0a5449f23a3de61283711f821055e51'
6
+ metadata.gz: 26ec66ace02ff31ced22d3bd331884c0c74d5ee7356e138897759ed70be2be7d52dca239d3f1ac30c6599c8133446d199db7833de18fda7053e6fc977a1bde3b
7
+ data.tar.gz: a60049ad709699ec112b43c6f281dd50ae6b80d3774c5c9a58e56d6daebcb5ccfc647544461f62f3f6e4a23367421d1401b34988ae22657764b72bf387c03ff8
data/CHANGELOG.md CHANGED
@@ -1,6 +1,51 @@
1
- ## Unreleased
1
+ ### [1.0.1] - 2026-02-04
2
+
3
+ #### Added
4
+ - **`PM::Directive` base class** — class-based DSL for defining directive categories. Use `desc` before method definitions to mark them as directives, and `alias_method` for aliases. Subclass tracking, `register_all`, `category_name`, and `build_dispatch_block` are all built-in.
5
+ - **Built-in `insert` directive** (alias: `read`) — insert any file's raw content into a prompt. Unlike `include`, the inserted content is not parsed, shell-expanded, or ERB-rendered.
6
+ - New test file `directive_base_test.rb` with tests for the `PM::Directive` DSL, subclass tracking, category naming, and dispatch block building.
7
+ - New test fixtures for `insert`/`read` directive coverage.
8
+
9
+ #### Changed
10
+ - **`PM::CoreDirectives`** — built-in `include`, `insert`/`read` directives refactored as a `PM::Directive` subclass using the `desc` DSL.
11
+ - `PM.register` directive aliases now support registration via `alias_method` in `PM::Directive` subclasses, with automatic detection via `UnboundMethod#original_name`.
12
+ - Directive registry simplified; `PM.reset_directives!` now delegates to `PM::Directive.register_all`.
13
+ - Updated README and documentation guides for custom directives and includes.
2
14
 
3
15
  ## Released
16
+ ### [1.0.0] = 2026-02-03
17
+
18
+ **Complete rewrite** — repositioned from a prompt management system with storage adapters to a focused prompt parsing and rendering engine.
19
+
20
+ #### Breaking Changes
21
+ - **New `PM` module replaces `PromptManager`** — the entire codebase has been restructured under the `PM` namespace. A backward-compatibility alias (`PromptManager = PM`) is provided via `require 'prompt_manager'`.
22
+ - **Storage adapters removed** — `FileSystemAdapter`, `ActiveRecordAdapter`, and all database-backed persistence have been removed. The library now operates on strings, files, and Pathnames directly.
23
+ - **`Prompt` class removed** — replaced by the lightweight `PM::Parsed` struct.
24
+ - **`DirectiveProcessor` class removed** — replaced by a simple `PM.register` directive registration API.
25
+ - **Parameter history removed** — the library no longer tracks historical parameter values per keyword.
26
+ - **Configuration simplified** — only three settings remain: `prompts_dir`, `shell`, and `erb`. Options like `parameter_regex` and `search_proc` have been removed.
27
+
28
+ #### New Features
29
+ - **Symbol and single-word parsing** — `PM.parse(:code_review)` and `PM.parse('code_review')` automatically resolve to `code_review.md` in the configured `prompts_dir`.
30
+ - **Directive aliases** — `PM.register(:webpage, :website, :web) { |ctx, url| ... }` registers multiple names for a single directive with rollback on duplicate detection.
31
+ - **`PM::Metadata`** — OpenStruct-based metadata with automatic predicate methods for boolean fields (e.g., `metadata.shell?`).
32
+ - **`PM::Parsed`** — Struct-based result with `RenderContext` support and required-parameter validation in `to_s`.
33
+ - **Built-in `include` directive** — compose prompts from multiple files with loop protection.
34
+ - **Streamlined parsing pipeline** — strip HTML comments, extract YAML front matter, optional shell expansion (`$VAR`, `${VAR}`, `$(command)`), optional ERB rendering.
35
+
36
+ #### Removed
37
+ - `PromptManager::Prompt` class
38
+ - `PromptManager::DirectiveProcessor` class
39
+ - `PromptManager::Storage::FileSystemAdapter`
40
+ - `PromptManager::Storage::ActiveRecordAdapter`
41
+ - Custom error classes (`PromptManager::Error` hierarchy)
42
+ - Development dependencies on `activerecord`, `sqlite3`, and `tocer`
43
+
44
+ #### Added
45
+ - Runtime dependency on `ostruct`
46
+ - Comprehensive test suite (8 test files, 19 fixtures)
47
+ - Full documentation site under `docs/` with guides for parsing, shell expansion, ERB rendering, custom directives, and prompt composition
48
+
4
49
  ### [0.5.8] = 2025-09-01
5
50
  - fixed issue where removed keywords from prompt text were still being included in parameters if they existed in the JSON file (addresses AIA issue #105)
6
51
  - parameters now only include keywords currently present in the prompt text, while preserving historical values for existing keywords