fraim-framework 2.0.27 → 2.0.30

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 (98) hide show
  1. package/.github/workflows/deploy-fraim.yml +1 -1
  2. package/dist/registry/scripts/build-scripts-generator.js +205 -0
  3. package/dist/registry/scripts/cleanup-branch.js +258 -0
  4. package/dist/registry/scripts/evaluate-code-quality.js +66 -0
  5. package/dist/registry/scripts/exec-with-timeout.js +142 -0
  6. package/dist/registry/scripts/fraim-config.js +61 -0
  7. package/dist/registry/scripts/generate-engagement-emails.js +630 -0
  8. package/dist/registry/scripts/generic-issues-api.js +100 -0
  9. package/dist/registry/scripts/newsletter-helpers.js +731 -0
  10. package/dist/registry/scripts/openapi-generator.js +664 -0
  11. package/dist/registry/scripts/performance/profile-server.js +390 -0
  12. package/dist/registry/scripts/run-thank-you-workflow.js +92 -0
  13. package/dist/registry/scripts/send-newsletter-simple.js +85 -0
  14. package/dist/registry/scripts/send-thank-you-emails.js +54 -0
  15. package/dist/registry/scripts/validate-openapi-limits.js +311 -0
  16. package/dist/registry/scripts/validate-test-coverage.js +262 -0
  17. package/dist/registry/scripts/verify-test-coverage.js +66 -0
  18. package/dist/src/cli/commands/init.js +14 -14
  19. package/dist/src/cli/commands/sync.js +4 -4
  20. package/dist/src/cli/fraim.js +24 -22
  21. package/dist/src/cli/setup/first-run.js +13 -6
  22. package/dist/src/fraim/db-service.js +26 -15
  23. package/dist/src/fraim/issues.js +67 -0
  24. package/dist/src/fraim-mcp-server.js +272 -18
  25. package/dist/src/utils/git-utils.js +1 -1
  26. package/dist/tests/debug-tools.js +79 -0
  27. package/dist/tests/esm-compat.js +11 -0
  28. package/dist/tests/test-chalk-esm-issue.js +159 -0
  29. package/dist/tests/test-chalk-real-world.js +265 -0
  30. package/dist/tests/test-chalk-regression.js +327 -0
  31. package/dist/tests/test-chalk-resolution-issue.js +304 -0
  32. package/dist/tests/test-fraim-install-chalk-issue.js +254 -0
  33. package/dist/tests/test-fraim-issues.js +59 -0
  34. package/dist/tests/test-genericization.js +1 -1
  35. package/dist/tests/test-mcp-connection.js +166 -0
  36. package/dist/tests/test-mcp-issue-integration.js +144 -0
  37. package/dist/tests/test-mcp-lifecycle-methods.js +312 -0
  38. package/dist/tests/test-node-compatibility.js +71 -0
  39. package/dist/tests/test-npm-install.js +66 -0
  40. package/dist/tests/test-npm-resolution-diagnostic.js +140 -0
  41. package/dist/tests/test-session-rehydration.js +145 -0
  42. package/dist/tests/test-standalone.js +2 -8
  43. package/dist/tests/test-telemetry.js +190 -0
  44. package/package.json +10 -8
  45. package/registry/agent-guardrails.md +62 -54
  46. package/registry/rules/agent-success-criteria.md +52 -0
  47. package/registry/rules/agent-testing-guidelines.md +502 -502
  48. package/registry/rules/communication.md +121 -121
  49. package/registry/rules/continuous-learning.md +54 -54
  50. package/registry/rules/ephemeral-execution.md +10 -5
  51. package/registry/rules/hitl-ppe-record-analysis.md +302 -302
  52. package/registry/rules/local-development.md +251 -251
  53. package/registry/rules/software-development-lifecycle.md +104 -104
  54. package/registry/rules/successful-debugging-patterns.md +482 -478
  55. package/registry/rules/telemetry.md +67 -0
  56. package/registry/scripts/build-scripts-generator.ts +216 -215
  57. package/registry/scripts/cleanup-branch.ts +303 -284
  58. package/registry/scripts/code-quality-check.sh +559 -559
  59. package/registry/scripts/detect-tautological-tests.sh +38 -38
  60. package/registry/scripts/evaluate-code-quality.ts +1 -1
  61. package/registry/scripts/generate-engagement-emails.ts +744 -744
  62. package/registry/scripts/generic-issues-api.ts +110 -150
  63. package/registry/scripts/newsletter-helpers.ts +874 -874
  64. package/registry/scripts/openapi-generator.ts +695 -693
  65. package/registry/scripts/performance/profile-server.ts +5 -3
  66. package/registry/scripts/prep-issue.sh +468 -455
  67. package/registry/scripts/validate-openapi-limits.ts +366 -365
  68. package/registry/scripts/validate-test-coverage.ts +280 -280
  69. package/registry/scripts/verify-pr-comments.sh +70 -70
  70. package/registry/scripts/verify-test-coverage.ts +1 -1
  71. package/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +53 -53
  72. package/registry/templates/evidence/Implementation-BugEvidence.md +85 -85
  73. package/registry/templates/evidence/Implementation-FeatureEvidence.md +120 -120
  74. package/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +66 -0
  75. package/registry/workflows/bootstrap/create-architecture.md +2 -2
  76. package/registry/workflows/bootstrap/evaluate-code-quality.md +3 -3
  77. package/registry/workflows/bootstrap/verify-test-coverage.md +2 -2
  78. package/registry/workflows/customer-development/insight-analysis.md +156 -156
  79. package/registry/workflows/customer-development/interview-preparation.md +421 -421
  80. package/registry/workflows/customer-development/strategic-brainstorming.md +146 -146
  81. package/registry/workflows/customer-development/thank-customers.md +193 -191
  82. package/registry/workflows/customer-development/weekly-newsletter.md +362 -352
  83. package/registry/workflows/improve-fraim/contribute.md +32 -0
  84. package/registry/workflows/improve-fraim/file-issue.md +32 -0
  85. package/registry/workflows/marketing/hbr-article.md +73 -0
  86. package/registry/workflows/performance/analyze-performance.md +63 -59
  87. package/registry/workflows/product-building/design.md +3 -2
  88. package/registry/workflows/product-building/implement.md +4 -3
  89. package/registry/workflows/product-building/prep-issue.md +28 -17
  90. package/registry/workflows/product-building/resolve.md +3 -2
  91. package/registry/workflows/product-building/retrospect.md +3 -2
  92. package/registry/workflows/product-building/spec.md +5 -4
  93. package/registry/workflows/product-building/test.md +3 -2
  94. package/registry/workflows/quality-assurance/iterative-improvement-cycle.md +562 -562
  95. package/registry/workflows/replicate/website-discovery-analysis.md +3 -3
  96. package/registry/workflows/reviewer/review-implementation-vs-design-spec.md +632 -632
  97. package/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +669 -669
  98. package/tsconfig.json +2 -1
@@ -0,0 +1,32 @@
1
+ # Workflow: Contribute to FRAIM
2
+
3
+ **Path:** `workflows/improve-fraim/contribute.md`
4
+
5
+ ---
6
+
7
+ # Contribute Workflow
8
+
9
+ ## INTENT
10
+ Allows users to contribute new workflow ideas back to the FRAIM project. The agent collects necessary information and files a GitHub issue with the contribution details.
11
+
12
+ ## STEPS
13
+
14
+ ### Step 1: Gather Information
15
+ 1. Ask the user for the **Workflow Name**.
16
+ - Example: "What is the name of the workflow you would like to contribute?"
17
+ 2. Ask the user for the **Recommended Prompt** / Description.
18
+ - Example: "Please provide the recommended prompt or a detailed description of what this workflow should do."
19
+
20
+ ### Step 2: Confirmation
21
+ Confirm the details with the user before proceeding.
22
+ - "I am about to file a contribution for workflow '{workflow_name}' with the following prompt: '{workflow_prompt}'. Is this correct?"
23
+
24
+ ### Step 3: Execute Contribution
25
+ Call the `file_issue` tool with the details gathered.
26
+
27
+ - `title`: `"[CONTRIBUTION]: {workflow_name}"`
28
+ - `body`: `"{workflow_prompt}"`
29
+ - `labels`: `["enhancement", "workflow"]`
30
+
31
+ ### Step 4: Completion
32
+ Notify the user that the issue has been filed successfully. Summarize the information (title and body) that was filed. Do not provide the issue number or URL.
@@ -0,0 +1,32 @@
1
+ # Workflow: File Issue for FRAIM
2
+
3
+ **Path:** `workflows/improve-fraim/file-issue.md`
4
+
5
+ ---
6
+
7
+ # File Issue Workflow
8
+
9
+ ## INTENT
10
+ Allows users to easily file bugs or feature requests for the FRAIM framework directly from their working environment.
11
+
12
+ ## STEPS
13
+
14
+ ### Step 1: Gather Information
15
+ 1. Ask the user to describe the **Issue** (Bug or Feature Request).
16
+ - Example: "Please describe the bug you encountered or the feature you would like to request."
17
+
18
+ ### Step 2: Categorization (Optional)
19
+ Ask if this is a **Bug** or a **Feature**.
20
+ - If Bug: Use label `bug`.
21
+ - If Feature: Use label `enhancement`.
22
+ - Default: `triage`.
23
+
24
+ ### Step 3: Execute Issue Filing
25
+ Call the `file_issue` tool with the details gathered.
26
+
27
+ - `title`: `"[ISSUE]: <Short Summary>"`
28
+ - `body`: `"<Full Description>"`
29
+ - `labels`: `["<bug/enhancement>"]`
30
+
31
+ ### Step 4: Completion
32
+ Notify the user that the issue has been filed successfully. Summarize the information (title and body) that was filed. Do not provide the issue number or URL.
@@ -0,0 +1,73 @@
1
+ # Workflow: hbr-article
2
+
3
+ **Path:** `workflows/marketing/hbr-article.md`
4
+
5
+ ---
6
+
7
+ # Harvard Business Review Article Phase
8
+
9
+ ## INTENT
10
+ Design a repeatable reviewable process for researching, drafting, and submitting an HBR or similar thought-leadership article that follows the Harvard Business Review author guidelines and documents each review before publication.
11
+
12
+ ## PRINCIPLES
13
+ - **Strategy First** – Explain why the piece matters to HBR readers and how it advances the product roadmap.
14
+ - **Evidence-Led Storytelling** – Back every claim with customer insights, data, or experiments and include proper citations.
15
+ - **Executive Clarity** – Keep the tone structured, concise, and professional while still being compelling.
16
+ - **Review Discipline** – Require sign-offs during every milestone so the article progresses with confidence.
17
+
18
+ ## HARVARD BUSINESS REVIEW GUIDELINES SUMMARY
19
+ - **Audience & Outcome**: HBR serves ambitious senior leaders with rigorous, evidence-backed insights they can apply today.
20
+ - **Topic Scope**: Strategy, leadership, culture, operations, technology change, innovation, communication, decision-making, talent, and transitions.
21
+ - **Five Quality Criteria**: Expertise, evidence, originality (or a counterintuitive twist), practical usefulness, and excellent writing.
22
+ - **Responsible Storytelling**: Represent diverse organizations, avoid bias/stereotypes, disclose conflicts, and explain any generative AI usage.
23
+ - **Pitch Checklist** (covered during Step 2 and in the template): central message, importance/counterintuition, novelty, leader application, authority/backing, supporting research/examples, and relevant experiences.
24
+
25
+ ## HBR ARTICLE WORKFLOW
26
+
27
+ ### Step 1: Confirm the story belongs with HBR
28
+ - Articulate the insight, the proposed HBR section (Strategy, Leadership, Technology, etc.), and why the timing is right.
29
+ - Cite the HBR guidelines (https://hbr.org/guidelines-for-authors) for exclusivity, word count, bylines, and conflict-of-interest disclosures.
30
+ - Document how the story ties to the product roadmap, clarify the customer problem, and capture any embargo or exclusivity constraints with marketing and executive reviewers.
31
+
32
+ ### Step 2: Research & angle sharpening
33
+ - Gather customer data, experiments, interviews, or telemetry that demonstrate the thesis.
34
+ - Review two recent HBR pieces in the target section to understand structure, tone, and citation style.
35
+ - Identify outstanding sourcing needs (people, metrics, visuals) and schedule them before drafting.
36
+ - Use the HBR prompts to refine the story:
37
+ - What is the central message of the article?
38
+ - Why is it important, useful, or counterintuitive?
39
+ - What is new about the idea?
40
+ - Why do senior leaders need to know about it today, and how can they apply it?
41
+ - What is the source of the team’s authority (prior work, credentials, experience)?
42
+ - What research or examples will back the idea?
43
+ - What academic, professional, or personal experience will you draw on?
44
+
45
+ ### Step 3: Outline and structure guardrails
46
+ - Draft an outline covering:
47
+ - Hook and problem framing
48
+ - Diagnostic/evidence blocks (data, quotes, frameworks)
49
+ - Practice-ready recommendation and product-specific next steps
50
+ - Annotate each section with required references and attachments.
51
+ - Share the outline with product and marketing reviewers, collect feedback, and incorporate it prior to drafting.
52
+
53
+ ### Step 4: Draft, iterate, and polish
54
+ - Adhere to HBR word limits and formatting expectations; note disclosures, partnerships, or competing interests directly in the draft.
55
+ - Run two review passes: one focused on clarity (peer reviewer) and one on strategic voice (executive reviewer).
56
+ - Track edits through versioned drafts, doc comments, or PR history and finalize the headline/angle with the marketing lead.
57
+ - Capture approvals for accuracy, voice, and compliance before locking the draft.
58
+
59
+ ### Step 5: Finalize submission + collateral
60
+ - Verify the draft satisfies the HBR checklist (tone, length, references, conflicts) and secure the final sign-off.
61
+ - Draft the submission email (subject line, synopsis, attachments) and log it in `docs/marketing/hbr/submission-log.md` or an equivalent tracking document.
62
+ - Plan accompanying collateral (blog post, newsletter snippet, executive update) that repurposes the article's insight and assign owners.
63
+ - Note follow-up steps for publication tracking and audience engagement.
64
+
65
+ ## OUTPUT
66
+ - Thesis/angle memo that explains the fit for HBR.
67
+ - Approved outline and draft with reviewer notes and version history.
68
+ - Submission package (email, attachments, compliance checklist).
69
+ - Launch collateral plan with asset owners and delivery status.
70
+
71
+ ## DOCUMENT TEMPLATE STRUCTURE
72
+
73
+ Use `get_fraim_file({ path: "templates/marketing/HBR-ARTICLE-TEMPLATE.md" })` to capture the thesis, outline, draft, review log, submission log, and launch collateral plan for each HBR article.
@@ -1,59 +1,63 @@
1
- # Performance Analysis Phase
2
-
3
- ## INTENT
4
- To diagnose production performance issues (CPU, Memory, Swap) and provide actionable recommendations for stabilization without performing direct application or infrastructure modifications.
5
-
6
- ## PRINCIPLES
7
- - **Observational Only**: Do not modify code or infrastructure during this phase.
8
- - **Data-Driven**: Base all recommendations on metrics collected from the environment.
9
- - **Non-Invasive**: Use non-destructive commands that do not impact server stability.
10
- - **Actionable**: Provide clear, prioritized recommendations for remediation.
11
-
12
- ## ANALYSIS WORKFLOW
13
-
14
- ### Step 1: Run the Performance Profiler
15
- Execute the profiling script against the production environment to collect plan-level and process-level metrics.
16
- // turbo
17
- ```bash
18
- npx tsx .ai-agents/scripts/performance/profile-server.ts --prod
19
- ```
20
-
21
- ### Step 2: Inspect Automated Diagnosis
22
- Review the "Step 4: Automated Diagnosis" section of the output.
23
- It will specifically check for:
24
- - **Swap Death**: If >95% swap is used, the server is thrashing.
25
- - **Absent Application**: If `server.js` is missing, the infrastructure is healthy but the app is crashed/not starting.
26
- - **Infrastructure Hogs**: If Azure agents (Kudu/dotnet) are consuming excessive RAM.
27
-
28
- ### Step 3: Deep Dive Log Analysis
29
- If a crash loop or high operation frequency is suspected, collect and analyze application logs.
30
- ```bash
31
- npx tsx .ai-agents/scripts/performance/profile-server.ts --prod --logs
32
- ```
33
- Look for:
34
- - Frequency of initialization logs (e.g., "Ensured unique index").
35
- - Patterns indicative of OOM events or unhandled exceptions.
36
- - High volume of specific operations (e.g., decryptions) suggesting an infinite loop.
37
-
38
- ### Step 4: Formulate Recommendations
39
- Based on the diagnosis, provide specific recommendations in your response or an implementation plan (if a fix is needed in a subsequent phase).
40
- Examples:
41
- - **Restart**: If swap usage is high or rogue processes are detected.
42
- - **Upgrade Plan**: If physical memory is chronically saturated (B1 to P1v3).
43
- - **Code Optimization**: If log analysis reveals initialization loops or leaks.
44
-
45
- ## EXAMPLES
46
-
47
- ### Good Analysis
48
- > "The profiler shows 98% CPU usage and 'Swap Death'. The logs show 'Ensured unique index' occurring 100 times per minute. I recommend implementing an initialization guard in `PrismaDatabaseService` to break this loop."
49
-
50
- ### Bad Analysis (Do not do)
51
- > "I found a loop, so I've updated `server.ts` to fix it."
52
- > *Correction: Propose the fix first, do not implement it within the analysis workflow.*
53
-
54
- ## COMPLETION CHECKLIST
55
- - [ ] Profiler run successfully on production.
56
- - [ ] Resource bottlenecks (CPU/Mem/Swap) identified.
57
- - [ ] Application process stability verified.
58
- - [ ] Root cause hypothesis formulated based on metrics and logs.
59
- - [ ] Prioritized recommendations delivered to the user.
1
+ # Performance Analysis Phase
2
+
3
+ ## INTENT
4
+ To diagnose production performance issues (CPU, Memory, Swap) and provide actionable recommendations for stabilization without performing direct application or infrastructure modifications.
5
+
6
+ ## PRINCIPLES
7
+ - **Observational Only**: Do not modify code or infrastructure during this phase.
8
+ - **Data-Driven**: Base all recommendations on metrics collected from the environment.
9
+ - **Non-Invasive**: Use non-destructive commands that do not impact server stability.
10
+ - **Actionable**: Provide clear, prioritized recommendations for remediation.
11
+
12
+ ## ANALYSIS WORKFLOW
13
+
14
+ ### Step 1: Run the Performance Profiler
15
+ Execute the profiling script against the production environment to collect plan-level and process-level metrics.
16
+ // turbo
17
+ ```bash
18
+ # 1. Fetch profile-server.ts using get_fraim_file and save to machine temp
19
+ # (Agent implementation detail: use os.tmpdir())
20
+
21
+ # 2. Run from temp
22
+ npx tsx /path/to/temp/profile-server.ts --prod
23
+ ```
24
+
25
+ ### Step 2: Inspect Automated Diagnosis
26
+ Review the "Step 4: Automated Diagnosis" section of the output.
27
+ It will specifically check for:
28
+ - **Swap Death**: If >95% swap is used, the server is thrashing.
29
+ - **Absent Application**: If `server.js` is missing, the infrastructure is healthy but the app is crashed/not starting.
30
+ - **Infrastructure Hogs**: If Azure agents (Kudu/dotnet) are consuming excessive RAM.
31
+
32
+ ### Step 3: Deep Dive Log Analysis
33
+ If a crash loop or high operation frequency is suspected, collect and analyze application logs.
34
+ ```bash
35
+ npx tsx tmp/profile-server.ts --prod --logs
36
+ ```
37
+ Look for:
38
+ - Frequency of initialization logs (e.g., "Ensured unique index").
39
+ - Patterns indicative of OOM events or unhandled exceptions.
40
+ - High volume of specific operations (e.g., decryptions) suggesting an infinite loop.
41
+
42
+ ### Step 4: Formulate Recommendations
43
+ Based on the diagnosis, provide specific recommendations in your response or an implementation plan (if a fix is needed in a subsequent phase).
44
+ Examples:
45
+ - **Restart**: If swap usage is high or rogue processes are detected.
46
+ - **Upgrade Plan**: If physical memory is chronically saturated (B1 to P1v3).
47
+ - **Code Optimization**: If log analysis reveals initialization loops or leaks.
48
+
49
+ ## EXAMPLES
50
+
51
+ ### Good Analysis
52
+ > "The profiler shows 98% CPU usage and 'Swap Death'. The logs show 'Ensured unique index' occurring 100 times per minute. I recommend implementing an initialization guard in `PrismaDatabaseService` to break this loop."
53
+
54
+ ### Bad Analysis (Do not do)
55
+ > "I found a loop, so I've updated `server.ts` to fix it."
56
+ > *Correction: Propose the fix first, do not implement it within the analysis workflow.*
57
+
58
+ ## COMPLETION CHECKLIST
59
+ - [ ] Profiler run successfully on production.
60
+ - [ ] Resource bottlenecks (CPU/Mem/Swap) identified.
61
+ - [ ] Application process stability verified.
62
+ - [ ] Root cause hypothesis formulated based on metrics and logs.
63
+ - [ ] Prioritized recommendations delivered to the user.
@@ -10,13 +10,14 @@
10
10
  To create comprehensive, detailed technical design documents that plan solutions before implementation, ensuring proper architecture, clear requirements, and stakeholder alignment through structured RFCs and bug fix templates.
11
11
 
12
12
  ## PRINCIPLES
13
+ - **Success Criteria**: Optimize for Integrity, Correctness, Completeness, Independence, and Speed - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
13
14
  - **Design First**: Plan before implementing to avoid rework
14
15
  - **Template Consistency**: Use established templates for different types of changes
15
16
  - **Stakeholder Alignment**: Get review and approval before implementation
16
17
  - **Clear Documentation**: Create detailed, actionable design documents
17
18
  - **Iterative Refinement**: Incorporate feedback and iterate on designs
18
- - **Spike-First Development**: Follow "Spike-First Development" rule (retrieve via `get_fraim_file({ path: "rules/spike-first-development.md" })`) to validate technology compatibility before building complex solutions
19
- - **Simplicity**: Follow "Simplicity" principle (retrieve via `get_fraim_file({ path: "rules/simplicity.md" })`)
19
+ - **Spike-First Development**: Follow "Spike-First Development" rule (read `rules/spike-first-development.md` using `get_fraim_file`) to validate technology compatibility before building complex solutions
20
+ - **Simplicity**: Follow "Simplicity" principle (read `rules/simplicity.md` using `get_fraim_file`)
20
21
  - **Architecture**: Follow existing architecture - see `.fraim/config.json` for the path (`customizations.architectureDoc`)
21
22
 
22
23
  ## DESIGN WORKFLOW
@@ -11,14 +11,15 @@ To implement solutions based on approved design documents, ensuring minimal, tes
11
11
  Consult the architecture document for coding standards.
12
12
 
13
13
  ## PRINCIPLES
14
+ - **Success Criteria**: Optimize for Integrity (100pts), Correctness (50pts), Completeness (30pts), Independence (20pts), and Speed (10pts) - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
14
15
  - **Design-Driven**: Follow approved RFCs and design documents
15
16
  - **Minimal Implementation**: Write only the code needed for the issue
16
17
  - **Test-First**: Ensure comprehensive test coverage
17
18
  - **Quality Focus**: Maintain code quality and follow patterns
18
19
  - **Complete**: All aspects of technical spec are implemented, tested, validated
19
- - **Spike-First Development**: Follow "Spike-First Development" rule (retrieve via `get_fraim_file({ path: "rules/spike-first-development.md" })`) to validate technology compatibility before building complex solutions
20
- - **Debugging**: Use "Successful Debugging Patterns" (retrieve via `get_fraim_file({ path: "rules/successful-debugging-patterns.md" })`) when stuck
21
- - **Git Safety**: Follow "Git Safe Commands" (retrieve via `get_fraim_file({ path: "rules/git-safe-commands.md" })`)
20
+ - **Spike-First Development**: Follow "Spike-First Development" rule (read `rules/spike-first-development.md` via `get_fraim_file`) to validate technology compatibility before building complex solutions
21
+ - **Debugging**: Use "Successful Debugging Patterns" (read `rules/successful-debugging-patterns.md` via `get_fraim_file`) when stuck
22
+ - **Git Safety**: Follow "Git Safe Commands" (read `rules/git-safe-commands.md` via `get_fraim_file`)
22
23
  - **Architecture**: Follow existing architecture - see `.fraim/config.json` for the path (`customizations.architectureDoc`)
23
24
 
24
25
  ## IMPLEMENTATION WORKFLOW
@@ -9,36 +9,47 @@ This workflow prepares the local development environment for working on a specif
9
9
 
10
10
  ## Action Items
11
11
 
12
- 1. **Fetch the Preparation Script**:
13
- `ACTION: Call get_fraim_file({ path: "scripts/prep-issue.sh" })`
12
+ 1. **Execute Preparation Script**:
13
+ Fetch and run cleanup/setup scripts ephemerally.
14
+
15
+ ```javascript
16
+ // 1. Fetch script
17
+ const script = await get_fraim_file({ path: "scripts/prep-issue.sh" });
18
+
19
+ // 2. Save to machine temp
20
+ const os = require('os');
21
+ const path = require('path');
22
+ const fs = require('fs');
23
+ const fraimTmp = path.join(os.homedir(), '.fraim', 'tmp');
24
+ if (!fs.existsSync(fraimTmp)) fs.mkdirSync(fraimTmp, { recursive: true });
25
+ const tempPath = path.join(fraimTmp, 'prep-issue.sh');
26
+ fs.writeFileSync(tempPath, script);
27
+
28
+ // 3. Make executable (if needed) and run
29
+ await run_command({ command: `bash ${tempPath} ${issueNumber}` });
30
+ ```
14
31
 
15
- 2. **Execute Ephemerally**:
16
- You MUST execute the script according to the "Ephemeral Execution" rule (retrieve via `get_fraim_file({ path: "rules/ephemeral-execution.md" })`).
17
-
18
- > [!IMPORTANT]
19
- > Do NOT save this script to the project repository. Save it to your system's temp folder.
20
32
 
21
33
  3. **Verify Setup**:
22
34
  - **Clean Context**: Start fresh to avoid pollution
23
- - **Environment**: Follow "Local Development" guidelines (retrieve via `get_fraim_file({ path: "rules/local-development.md" })`).
35
+ - **Environment**: Follow "Local Development" guidelines (read `rules/local-development.md` using `get_fraim_file`).
24
36
  - [ ] Feature branch created and pushed to origin.
25
37
  - [ ] `npm install` completed.
26
38
  - [ ] Serena indexing completed (if applicable).
27
39
 
28
40
  ## Implementation Detail (Agent Guidance)
29
41
 
30
- When you receive the script content from `get_fraim_file`:
31
-
42
+ Execute:
32
43
  ```javascript
33
- // 1. Save to temp file
34
- const tempPath = path.join(os.tmpdir(), "prep-issue.sh");
44
+ const scriptContent = await get_fraim_file({ path: "scripts/prep-issue.sh" });
45
+ const os = require('os');
46
+ const path = require('path');
47
+ const fs = require('fs');
48
+ const fraimTmp = path.join(os.homedir(), '.fraim', 'tmp');
49
+ if (!fs.existsSync(fraimTmp)) fs.mkdirSync(fraimTmp, { recursive: true });
50
+ const tempPath = path.join(fraimTmp, 'prep-issue.sh');
35
51
  fs.writeFileSync(tempPath, scriptContent);
36
-
37
- // 2. Execute
38
52
  await run_command({ command: `bash ${tempPath} ${issueNumber}` });
39
-
40
- // 3. Cleanup
41
- fs.unlinkSync(tempPath);
42
53
  ```
43
54
 
44
55
  > [!NOTE]
@@ -10,15 +10,16 @@
10
10
  To provide a systematic approach to resolving issues from development through merge verification and cleanup, ensuring no work is lost and all changes are properly integrated into the main codebase.
11
11
 
12
12
  ## PRINCIPLES
13
+ - **Success Criteria**: Optimize for Integrity (Verify truthfully) and Completeness (Clean up fully) - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
13
14
  - **Verification First**: Always verify merges before closing issues
14
15
  - **Complete Cleanup**: Remove all traces of feature branches
15
16
  - **No Work Loss**: Prevent incidents like Issue #112 through proper verification
16
17
  - **Systematic Process**: Follow established steps in order
17
18
  - **Evidence-Based**: Provide concrete verification of completion
18
- - **Git Safety**: Follow "Git Safe Commands" (retrieve via `get_fraim_file({ path: "rules/git-safe-commands.md" })`)
19
+ - **Git Safety**: Follow "Git Safe Commands" (read `rules/git-safe-commands.md` using `get_fraim_file`)
19
20
 
20
21
  ## CRITICAL DEPENDENCY
21
- **This workflow MUST be used in conjunction with "Merge Requirements" rule** (retrieve via `get_fraim_file({ path: "rules/merge-requirements.md" })`) which contains:
22
+ **This workflow MUST be used in conjunction with "Merge Requirements" rule** (read `rules/merge-requirements.md` via `get_fraim_file`) which contains:
22
23
  - **Pre-Push Workflow** (for feature branches during development)
23
24
  - **PR Description Template** (for PR creation)
24
25
  - **Final Merge Process** (for merging to master - used in this workflow)
@@ -4,12 +4,13 @@
4
4
  To capture learnings and insights from completed issues, enabling continuous improvement and preventing future similar problems through systematic analysis and documentation.
5
5
 
6
6
  ## PRINCIPLES
7
+ - **Success Criteria**: Focus on Integrity (Self-reflection) and Independence (Learning from mistakes) - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
7
8
  - Every completed issue requires a retrospective
8
9
  - Focus on root causes, not just symptoms
9
10
  - Document both successes and failures
10
11
  - Create actionable prevention measures
11
12
  - Share learnings with other agents
12
- - Continuous Learning: Follow "Continuous Learning" principles (retrieve via `get_fraim_file({ path: "rules/continuous-learning.md" })`)
13
+ - Continuous Learning: Follow "Continuous Learning" principles (read `rules/continuous-learning.md` via `get_fraim_file`)
13
14
 
14
15
  ## WORKFLOW
15
16
 
@@ -30,7 +31,7 @@ To capture learnings and insights from completed issues, enabling continuous imp
30
31
 
31
32
  ### 1. Create Retrospective File
32
33
  - **File path**: `retrospectives/issue-{issue-number}-{kebab-title}-postmortem.md`
33
- - **Template**: Use Retrospective template (retrieve via `get_fraim_file({ path: "templates/retrospective/RETROSPECTIVE-TEMPLATE.md" })`) as the base
34
+ - **Template**: Use Retrospective template: `get_fraim_file({ path: "templates/retrospective/RETROSPECTIVE-TEMPLATE.md" })`
34
35
  - **Copy template**: Copy the template file and fill in the placeholders
35
36
 
36
37
  ### 2. Root Cause Analysis
@@ -10,10 +10,11 @@
10
10
  To create comprehensive, detailed product specifications that clarify the Why, What and User Experiences for new features.
11
11
 
12
12
  ## PRINCIPLES
13
+ - **Success Criteria**: Optimize for Integrity, Correctness, Completeness, Independence, and Speed - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
13
14
  - **Start with the User**: Understand the user's needs and experiences before implementing
14
15
  - **User Experience Matters**: Focus on creating a great user experience right from the beginning
15
16
  - **Validation Criteria**: Define clear validation criteria to ensure the feature meets user needs
16
- - **Simplicity**: Maintain simplicity in feature definition (retrieve via `get_fraim_file({ path: "rules/simplicity.md" })`)
17
+ - **Simplicity**: Maintain simplicity in feature definition (read `rules/simplicity.md` via `get_fraim_file`)
17
18
 
18
19
  ## SPECIFICATION WORKFLOW
19
20
 
@@ -40,7 +41,7 @@ You are already in the correct workspace prepared by the user. Confirm you're on
40
41
  Before creating any specification document, agents MUST:
41
42
 
42
43
  1. **Verify Template Selection**:
43
- - Use Feature Spec template (retrieve via `get_fraim_file({ path: "templates/specs/FEATURESPEC-TEMPLATE.md" })`)
44
+ - Use Feature Spec template: `get_fraim_file({ path: "templates/specs/FEATURESPEC-TEMPLATE.md" })`
44
45
 
45
46
  2. **Validate Naming Convention**:
46
47
  - Format: `docs/feature specs/{issue_number}-{kebab-title}.md`
@@ -79,8 +80,8 @@ Before committing your work, verify:
79
80
  ### Step 8: Submit for Review
80
81
  - Commit and sync your work
81
82
  - Label the issue 'status:needs-review' and remove 'status:wip'
82
- - Update the PR with a comment to include evidence - Use Spec Evidence template (retrieve via `get_fraim_file({ path: "templates/evidence/Spec-Evidence.md" })`)
83
- - **Next Step**: Switch to "Iterate on PR Comments" workflow (retrieve via `get_fraim_file({ path: "workflows/product-building/iterate-on-pr-comments.md" })`) to monitor actions and handle feedback.
83
+ - Update the PR with a comment to include evidence - Use Spec Evidence template: `get_fraim_file({ path: "templates/evidence/Spec-Evidence.md" })`
84
+ - **Next Step**: Switch to "Iterate on PR Comments" workflow: `get_fraim_file({ path: "workflows/product-building/iterate-on-pr-comments.md" })`
84
85
 
85
86
  ### Step 9: Iteration
86
87
  If workflow actions or reviewer feedback indicates more work is needed:
@@ -10,13 +10,14 @@
10
10
  To create comprehensive test coverage that accurately reproduces issues and validates solutions, ensuring robust testing through proper test structure, failure verification, and systematic test execution.
11
11
 
12
12
  ## PRINCIPLES
13
+ - **Success Criteria**: Optimize for Integrity (Honest reporting), Correctness (Coverage), Completeness, Independence, and Speed - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
13
14
  - **Test-Driven**: Write tests that reproduce the issue before fixing
14
15
  - **Comprehensive Coverage**: Ensure all scenarios are tested
15
16
  - **Failure Verification**: Confirm tests fail before implementation
16
17
  - **Proper Structure**: Use established test patterns and frameworks
17
18
  - **Systematic Execution**: Follow consistent testing procedures
18
- - **Testing Guidelines**: Follow "Agent Testing Guidelines" (retrieve via `get_fraim_file({ path: "rules/agent-testing-guidelines.md" })`)
19
- - **Integrity**: Adhere to "Integrity and Test Ethics" (retrieve via `get_fraim_file({ path: "rules/integrity-and-test-ethics.md" })`)
19
+ - **Testing Guidelines**: Follow "Agent Testing Guidelines" (read `rules/agent-testing-guidelines.md` via `get_fraim_file`)
20
+ - **Integrity**: Adhere to "Integrity and Test Ethics" (read `rules/integrity-and-test-ethics.md` via `get_fraim_file`)
20
21
  - **Architecture**: Follow existing architecture - see `.fraim/config.json` for the path (`customizations.architectureDoc`)
21
22
 
22
23
  ## TESTING WORKFLOW