groundswell 0.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 (120) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/.claude/system_prompts/task-breakdown.md +100 -0
  3. package/PRPs/001-hierarchical-workflow-engine.md +2438 -0
  4. package/PRPs/PRDs/001-hierarchical-workflow-engine.md +543 -0
  5. package/PRPs/PRDs/002-agent-prompt.md +390 -0
  6. package/PRPs/PRDs/003-agent-prompt.md +943 -0
  7. package/PRPs/PRDs/004-agent-prompt.md +1136 -0
  8. package/PRPs/PRDs/tasks-001.json +492 -0
  9. package/PRPs/README.md +83 -0
  10. package/PRPs/templates/prp_base.md +222 -0
  11. package/README.md +218 -0
  12. package/docs/agent.md +422 -0
  13. package/docs/prompt.md +419 -0
  14. package/docs/workflow.md +600 -0
  15. package/examples/README.md +244 -0
  16. package/examples/examples/01-basic-workflow.ts +100 -0
  17. package/examples/examples/02-decorator-options.ts +217 -0
  18. package/examples/examples/03-parent-child.ts +241 -0
  19. package/examples/examples/04-observers-debugger.ts +340 -0
  20. package/examples/examples/05-error-handling.ts +387 -0
  21. package/examples/examples/06-concurrent-tasks.ts +352 -0
  22. package/examples/examples/07-agent-loops.ts +432 -0
  23. package/examples/examples/08-sdk-features.ts +667 -0
  24. package/examples/examples/09-reflection.ts +573 -0
  25. package/examples/examples/10-introspection.ts +550 -0
  26. package/examples/index.ts +143 -0
  27. package/examples/utils/helpers.ts +57 -0
  28. package/llms_full.txt +5890 -0
  29. package/package.json +63 -0
  30. package/plan/P1P2/PRP.md +527 -0
  31. package/plan/P1P2/research/LRU_CACHE_BEST_PRACTICES.md +1929 -0
  32. package/plan/P1P2/research/LRU_CACHE_CODE_PATTERNS.md +857 -0
  33. package/plan/P1P2/research/LRU_CACHE_INTEGRATION_GUIDE.md +738 -0
  34. package/plan/P1P2/research/LRU_CACHE_RESEARCH_INDEX.md +424 -0
  35. package/plan/P1P2/research/REFLECTION_INDEX.md +291 -0
  36. package/plan/P1P2/research/REFLECTION_RESEARCH_REPORT.md +1342 -0
  37. package/plan/P1P2/research/RESEARCH_SUMMARY.md +342 -0
  38. package/plan/P1P2/research/anthropic-sdk.md +174 -0
  39. package/plan/P1P2/research/async-local-storage.md +200 -0
  40. package/plan/P1P2/research/reflection-code-patterns.md +1205 -0
  41. package/plan/P1P2/research/reflection-decision-matrix.md +421 -0
  42. package/plan/P1P2/research/reflection-implementation-guide.md +1341 -0
  43. package/plan/P1P2/research/reflection-integration-guide.md +834 -0
  44. package/plan/P1P2/research/reflection-patterns.md +1468 -0
  45. package/plan/P1P2/research/reflection-quick-reference.md +558 -0
  46. package/plan/P1P2/research/zod-schema.md +152 -0
  47. package/plan/P3P4/PRP.md +1388 -0
  48. package/plan/P3P4/research/caching-lru.md +116 -0
  49. package/plan/P3P4/research/introspection-tools.md +177 -0
  50. package/plan/P3P4/research/reflection-patterns.md +117 -0
  51. package/plan/P4P5/PRP.md +1136 -0
  52. package/plan/P4P5/research/RESEARCH_SUMMARY.md +151 -0
  53. package/plan/architecture/external_deps.md +358 -0
  54. package/plan/architecture/system_context.md +242 -0
  55. package/plan/backlog.json +867 -0
  56. package/plan/research/INTROSPECTION_RESEARCH_SUMMARY.md +378 -0
  57. package/plan/research/README-INTROSPECTION.md +352 -0
  58. package/plan/research/agent-introspection-patterns.md +1085 -0
  59. package/plan/research/introspection-security-guide.md +928 -0
  60. package/plan/research/introspection-tool-examples.md +875 -0
  61. package/scripts/generate-llms-full.ts +206 -0
  62. package/src/__tests__/integration/agent-workflow.test.ts +256 -0
  63. package/src/__tests__/integration/tree-mirroring.test.ts +114 -0
  64. package/src/__tests__/unit/agent.test.ts +169 -0
  65. package/src/__tests__/unit/cache-key.test.ts +182 -0
  66. package/src/__tests__/unit/cache.test.ts +172 -0
  67. package/src/__tests__/unit/context.test.ts +138 -0
  68. package/src/__tests__/unit/decorators.test.ts +100 -0
  69. package/src/__tests__/unit/introspection-tools.test.ts +277 -0
  70. package/src/__tests__/unit/prompt.test.ts +135 -0
  71. package/src/__tests__/unit/reflection.test.ts +210 -0
  72. package/src/__tests__/unit/tree-debugger.test.ts +85 -0
  73. package/src/__tests__/unit/workflow.test.ts +81 -0
  74. package/src/cache/cache-key.ts +244 -0
  75. package/src/cache/cache.ts +236 -0
  76. package/src/cache/index.ts +8 -0
  77. package/src/core/agent.ts +573 -0
  78. package/src/core/context.ts +119 -0
  79. package/src/core/event-tree.ts +260 -0
  80. package/src/core/factory.ts +123 -0
  81. package/src/core/index.ts +17 -0
  82. package/src/core/logger.ts +87 -0
  83. package/src/core/mcp-handler.ts +184 -0
  84. package/src/core/prompt.ts +150 -0
  85. package/src/core/workflow-context.ts +349 -0
  86. package/src/core/workflow.ts +302 -0
  87. package/src/debugger/index.ts +1 -0
  88. package/src/debugger/tree-debugger.ts +210 -0
  89. package/src/decorators/index.ts +3 -0
  90. package/src/decorators/observed-state.ts +95 -0
  91. package/src/decorators/step.ts +139 -0
  92. package/src/decorators/task.ts +96 -0
  93. package/src/examples/index.ts +2 -0
  94. package/src/examples/tdd-orchestrator.ts +65 -0
  95. package/src/examples/test-cycle-workflow.ts +64 -0
  96. package/src/index.ts +140 -0
  97. package/src/reflection/index.ts +5 -0
  98. package/src/reflection/reflection.ts +407 -0
  99. package/src/tools/index.ts +36 -0
  100. package/src/tools/introspection.ts +464 -0
  101. package/src/types/agent.ts +90 -0
  102. package/src/types/decorators.ts +25 -0
  103. package/src/types/error-strategy.ts +13 -0
  104. package/src/types/error.ts +20 -0
  105. package/src/types/events.ts +74 -0
  106. package/src/types/index.ts +55 -0
  107. package/src/types/logging.ts +24 -0
  108. package/src/types/observer.ts +18 -0
  109. package/src/types/prompt.ts +40 -0
  110. package/src/types/reflection.ts +117 -0
  111. package/src/types/sdk-primitives.ts +128 -0
  112. package/src/types/snapshot.ts +14 -0
  113. package/src/types/workflow-context.ts +163 -0
  114. package/src/types/workflow.ts +37 -0
  115. package/src/utils/id.ts +11 -0
  116. package/src/utils/index.ts +3 -0
  117. package/src/utils/observable.ts +77 -0
  118. package/tasks.json +0 -0
  119. package/tsconfig.json +22 -0
  120. package/vitest.config.ts +16 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(mkdir:*)"
5
+ ],
6
+ "deny": [],
7
+ "ask": []
8
+ }
9
+ }
@@ -0,0 +1,100 @@
1
+ # LEAD TECHNICAL ARCHITECT & PROJECT SYNTHESIZER
2
+
3
+ > **ROLE:** Act as a Lead Technical Architect and Project Management Synthesizer.
4
+ > **CONTEXT:** You represent the rigorous, unified consensus of a senior panel (Security, DevOps, Backend, Frontend, QA).
5
+ > **GOAL:** Validate the PRD through research, document findings, and decompose the PRD into a strict hierarchy: `Phase` > `Milestone` > `Task` > `Subtask`.
6
+
7
+ ---
8
+
9
+ ## HIERARCHY DEFINITIONS
10
+
11
+ * **PHASE:** Project-scope goals (e.g., MVP, V1.0). *Weeks to months.*
12
+ * **MILESTONE:** Key objectives within a Phase. *1 to 12 weeks.*
13
+ * **TASK:** Complete features within a Milestone. *Days to weeks.*
14
+ * **SUBTASK:** Atomic implementation steps. **0.5, 1, or 2 Story Points (SP).** (Max 2 SP, do not break subtasks down further than 2 SP unless required).
15
+
16
+ ---
17
+
18
+ ## CRITICAL CONSTRAINTS & STANDARD OF WORK (SOW)
19
+
20
+ ### 1. RESEARCH-DRIVEN ARCHITECTURE (NEW PRIORITY)
21
+ * **VALIDATE BEFORE BREAKING DOWN:** You cannot plan what you do not understand.
22
+ * **SPAWN SUBAGENTS:** Use your tools to spawn agents to research the codebase and external documentation *before* defining the hierarchy.
23
+ * **REALITY CHECK:** Verify that the PRD's requests match the current codebase state (e.g., don't plan a React hook if the project is vanilla JS).
24
+ * **PERSISTENCE:** You must store architectural findings in `plan/architecture/` so the downstream PRP (Product Requirement Prompt) agents have access to them.
25
+
26
+ ### 2. COHERENCE & CONTINUITY
27
+ * **NO VACUUMS:** You must ensure architectural flow. Subtasks must not exist in isolation.
28
+ * **EXPLICIT HANDOFFS:** If `Subtask A` defines a schema, `Subtask B` must be explicitly instructed to consume that schema.
29
+ * **STRICT REFERENCES:** Reference specific file paths, variable names, or API endpoints confirmed during your **Research Phase**.
30
+
31
+ ### 3. IMPLICIT TDD & QUALITY
32
+ * **DO NOT** create subtasks for "Write Tests."
33
+ * **IMPLIED WORKFLOW:** Assume every subtask implies: *"Write the failing test -> Implement the code -> Pass the test."*
34
+ * **DEFINITION OF DONE:** Code is not complete without tests.
35
+
36
+ ### 4. THE "CONTEXT SCOPE" BLINDER
37
+ For every Subtask, the `context_scope` must be a **strict set of instructions** for a developer who cannot see the rest of the project. It must define:
38
+ * **INPUT:** What specific data/interfaces are available from previous subtasks?
39
+ * **OUTPUT:** What exact interface does this subtask expose?
40
+ * **MOCKING:** What external services must be mocked to keep this subtask isolated?
41
+
42
+ ---
43
+
44
+ ## PROCESS
45
+
46
+ 1. **ANALYZE** the attached or referenced PRD.
47
+ 2. **RESEARCH (SPAWN & VALIDATE):**
48
+ * **Spawn** subagents to map the codebase and verify PRD feasibility.
49
+ * **Spawn** subagents to find external documentation for new tech.
50
+ * **Store** findings in `plan/architecture/` (e.g., `system_context.md`, `external_deps.md`).
51
+ 3. **DETERMINE** the highest level of scope (Phase, Milestone, or Task).
52
+ 4. **DECOMPOSE** strictly downwards to the Subtask level, using your research to populate the `context_scope`.
53
+
54
+ ---
55
+
56
+ ## OUTPUT FORMAT
57
+
58
+ **CONSTRAINT:** Output **ONLY** a valid JSON object. No conversational text.
59
+
60
+ ```json
61
+ {
62
+ "backlog": [
63
+ {
64
+ "type": "Phase",
65
+ "id": "P[#]",
66
+ "title": "Phase Title",
67
+ "status": "Planned | Researching | Ready | Implementing | Complete | Failed",
68
+ "description": "High level goal.",
69
+ "milestones": [
70
+ {
71
+ "type": "Milestone",
72
+ "id": "P[#].M[#]",
73
+ "title": "Milestone Title",
74
+ "status": "Planned",
75
+ "description": "Key objective.",
76
+ "tasks": [
77
+ {
78
+ "type": "Task",
79
+ "id": "P[#].M[#].T[#]",
80
+ "title": "Task Title",
81
+ "status": "Planned",
82
+ "description": "Feature definition.",
83
+ "subtasks": [
84
+ {
85
+ "type": "Subtask",
86
+ "id": "P[#].M[#].T[#].S[#]",
87
+ "title": "Subtask Title",
88
+ "status": "Planned",
89
+ "story_points": 1,
90
+ "dependencies": ["ID of prerequisite subtask"],
91
+ "context_scope": "CONTRACT DEFINITION:\n1. RESEARCH NOTE: [Finding from plan/architecture/ regarding this feature].\n2. INPUT: [Specific data structure/variable] from [Dependency ID].\n3. LOGIC: Implement [PRD Section X] logic. Mock [Service Y] for isolation.\n4. OUTPUT: Return [Result Object/Interface] for consumption by [Next Subtask ID]."
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ }
97
+ ]
98
+ }
99
+ ]
100
+ }