Skip to content
Merged

dev #1409

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 279 additions & 0 deletions .github/prompts/sparc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
// from: https://gist.githubusercontent.com/ruvnet/7d4e1d5c9233ab0a1d2a66bf5ec3e58f/raw/923916fa92cd225c3d5eeec12a184a4a2a2462ff/.cursorules.txt

# SPARC Agentic Development Rules

Core Philosophy

1. Simplicity

- Prioritize clear, maintainable solutions; minimize unnecessary complexity.

2. Iterate

- Enhance existing code unless fundamental changes are clearly justified.

3. Focus

- Stick strictly to defined tasks; avoid unrelated scope changes.

4. Quality

- Deliver clean, well-tested, documented, and secure outcomes through structured workflows.

5. Collaboration
- Foster effective teamwork between human developers and autonomous agents.

Methodology & Workflow

- Structured Workflow
- Follow clear phases from specification through deployment.
- Flexibility
- Adapt processes to diverse project sizes and complexity levels.
- Intelligent Evolution
- Continuously improve codebase using advanced symbolic reasoning and adaptive complexity management.
- Conscious Integration
- Incorporate reflective awareness at each development stage.

Agentic Integration with Cline and Cursor

- Cline Configuration (.clinerules)

- Embed concise, project-specific rules to guide autonomous behaviors, prompt designs, and contextual decisions.

- Cursor Configuration (.cursorrules)
- Clearly define repository-specific standards for code style, consistency, testing practices, and symbolic reasoning integration points.

Memory Bank Integration

- Persistent Context
- Continuously retain relevant context across development stages to ensure coherent long-term planning and decision-making.
- Reference Prior Decisions
- Regularly review past decisions stored in memory to maintain consistency and reduce redundancy.
- Adaptive Learning
- Utilize historical data and previous solutions to adaptively refine new implementations.

General Guidelines for Programming Languages

1. Clarity and Readability

- Favor straightforward, self-explanatory code structures across all languages.
- Include descriptive comments to clarify complex logic.

2. Language-Specific Best Practices

- Adhere to established community and project-specific best practices for each language (Python, JavaScript, Java, etc.).
- Regularly review language documentation and style guides.

3. Consistency Across Codebases
- Maintain uniform coding conventions and naming schemes across all languages used within a project.

Project Context & Understanding

1. Documentation First

- Review essential documentation before implementation:
- Product Requirements Documents (PRDs)
- README.md
- docs/architecture.md
- docs/technical.md
- tasks/tasks.md
- Request clarification immediately if documentation is incomplete or ambiguous.

2. Architecture Adherence

- Follow established module boundaries and architectural designs.
- Validate architectural decisions using symbolic reasoning; propose justified alternatives when necessary.

3. Pattern & Tech Stack Awareness
- Utilize documented technologies and established patterns; introduce new elements only after clear justification.

Task Execution & Workflow

Task Definition & Steps

1. Specification

- Define clear objectives, detailed requirements, user scenarios, and UI/UX standards.
- Use advanced symbolic reasoning to analyze complex scenarios.

2. Pseudocode

- Clearly map out logical implementation pathways before coding.

3. Architecture

- Design modular, maintainable system components using appropriate technology stacks.
- Ensure integration points are clearly defined for autonomous decision-making.

4. Refinement

- Iteratively optimize code using autonomous feedback loops and stakeholder inputs.

5. Completion
- Conduct rigorous testing, finalize comprehensive documentation, and deploy structured monitoring strategies.

AI Collaboration & Prompting

1. Clear Instructions

- Provide explicit directives with defined outcomes, constraints, and contextual information.

2. Context Referencing

- Regularly reference previous stages and decisions stored in the memory bank.

3. Suggest vs. Apply

- Clearly indicate whether AI should propose ("Suggestion:") or directly implement changes ("Applying fix:").

4. Critical Evaluation

- Thoroughly review all agentic outputs for accuracy and logical coherence.

5. Focused Interaction

- Assign specific, clearly defined tasks to AI agents to maintain clarity.

6. Leverage Agent Strengths

- Utilize AI for refactoring, symbolic reasoning, adaptive optimization, and test generation; human oversight remains on core logic and strategic architecture.

7. Incremental Progress

- Break complex tasks into incremental, reviewable sub-steps.

8. Standard Check-in
- Example: "Confirming understanding: Reviewed [context], goal is [goal], proceeding with [step]."

Advanced Coding Capabilities

- Emergent Intelligence
- AI autonomously maintains internal state models, supporting continuous refinement.
- Pattern Recognition
- Autonomous agents perform advanced pattern analysis for effective optimization.
- Adaptive Optimization
- Continuously evolving feedback loops refine the development process.

Symbolic Reasoning Integration

- Symbolic Logic Integration
- Combine symbolic logic with complexity analysis for robust decision-making.
- Information Integration
- Utilize symbolic mathematics and established software patterns for coherent implementations.
- Coherent Documentation
- Maintain clear, semantically accurate documentation through symbolic reasoning.

Code Quality & Style

1. TypeScript Guidelines

- Use strict types, and clearly document logic with JSDoc.

2. Maintainability

- Write modular, scalable code optimized for clarity and maintenance.

3. Concise Components

- Keep files concise (under 300 lines) and proactively refactor.

4. Avoid Duplication (DRY)

- Use symbolic reasoning to systematically identify redundancy.

5. Linting/Formatting

- Consistently adhere to ESLint/Prettier configurations.

6. File Naming

- Use descriptive, permanent, and standardized naming conventions.

7. No One-Time Scripts
- Avoid committing temporary utility scripts to production repositories.

Refactoring

1. Purposeful Changes

- Refactor with clear objectives: improve readability, reduce redundancy, and meet architecture guidelines.

2. Holistic Approach

- Consolidate similar components through symbolic analysis.

3. Direct Modification

- Directly modify existing code rather than duplicating or creating temporary versions.

4. Integration Verification
- Verify and validate all integrations after changes.

Testing & Validation

1. Test-Driven Development

- Define and write tests before implementing features or fixes.

2. Comprehensive Coverage

- Provide thorough test coverage for critical paths and edge cases.

3. Mandatory Passing

- Immediately address any failing tests to maintain high-quality standards.

4. Manual Verification
- Complement automated tests with structured manual checks.

Debugging & Troubleshooting

1. Root Cause Resolution

- Employ symbolic reasoning to identify underlying causes of issues.

2. Targeted Logging

- Integrate precise logging for efficient debugging.

3. Research Tools
- Use advanced agentic tools (Perplexity, AIDER.chat, Firecrawl) to resolve complex issues efficiently.

Security

1. Server-Side Authority

- Maintain sensitive logic and data processing strictly server-side.

2. Input Sanitization

- Enforce rigorous server-side input validation.

3. Credential Management
- Securely manage credentials via environment variables; avoid any hardcoding.

Version Control & Environment

1. Git Hygiene

- Commit frequently with clear and descriptive messages.

2. Branching Strategy

- Adhere strictly to defined branching guidelines.

3. Environment Management

- Ensure code consistency and compatibility across all environments.

4. Server Management
- Systematically restart servers following updates or configuration changes.

Documentation Maintenance

1. Reflective Documentation

- Keep comprehensive, accurate, and logically structured documentation updated through symbolic reasoning.

2. Continuous Updates
- Regularly revisit and refine guidelines to reflect evolving practices and accumulated project knowledge.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build

on:
push:
branches: [main]
branches: [main, dev]
pull_request:
workflow_dispatch:
jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- dev
# tags:
# - "[0-9]+.[0-9]+.[0-9]+"
permissions:
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/genai-commander.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
id: check_author
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const commentAuthor = context.payload.comment.user.login;
const { data: collaborators } = await github.rest.repos.listCollaborators({ owner, repo });
const isCollaborator = collaborators.some(collaborator => collaborator.login === commentAuthor);
if (!isCollaborator)
throw new Error(`user ${commentAuthor} is not a collaborator on this repository`);
script: |
const { owner, repo } = context.repo;
const commentAuthor = context.payload.comment.user.login;
const { data: collaborators } = await github.rest.repos.listCollaborators({ owner, repo });
const isCollaborator = collaborators.some(collaborator => collaborator.login === commentAuthor);
if (!isCollaborator)
throw new Error(`user ${commentAuthor} is not a collaborator on this repository`);
#
# Resolve the PR sha and ref
#
Expand All @@ -54,20 +54,20 @@ jobs:
console.log(res)
return JSON.stringify(res)
#
# Checkout both main and PR branches
# Checkout both dev and PR branches
#
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: diff PR branch
run: git diff origin/main...origin/${{ fromJSON(steps.sha.outputs.result).ref }}
run: git diff origin/dev...origin/${{ fromJSON(steps.sha.outputs.result).ref }}
- name: diff PR commit
run: git diff origin/main...${{ fromJSON(steps.sha.outputs.result).sha }}
run: git diff origin/dev...${{ fromJSON(steps.sha.outputs.result).sha }}
- name: checkout PR commit
run: git checkout ${{ fromJSON(steps.sha.outputs.result).sha }}
- name: diff main
run: git diff origin/main
- name: diff dev
run: git diff origin/dev
#
# Setup and build project
#
Expand All @@ -88,14 +88,14 @@ jobs:
#
- name: genaiscript pr-describe
if: startsWith(github.event.comment.body, '/genai describe')
run: node packages/cli/built/genaiscript.cjs run pr-describe -prd --out-output $GITHUB_STEP_SUMMARY
run: node packages/cli/built/genaiscript.cjs run pr-describe -prd --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev
env:
GITHUB_ISSUE: ${{ github.event.issue.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_COMMIT_SHA: ${{ fromJSON(steps.sha.outputs.result).sha }}
- name: genaiscript pr-review
if: startsWith(github.event.comment.body, '/genai review')
run: node packages/cli/built/genaiscript.cjs run pr-review -prc --out-output $GITHUB_STEP_SUMMARY
run: node packages/cli/built/genaiscript.cjs run pr-review -prc --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev
env:
GITHUB_ISSUE: ${{ github.event.issue.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/genai-pr-commit-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
- name: start ollama
run: yarn ollama:start
- name: git stuff
run: git fetch origin && git pull origin main:main
run: git fetch origin && git pull origin dev:dev
- name: genaiscript pr-review-commit
run: node packages/cli/built/genaiscript.cjs run pr-review-commit --out ./temp/genai/pr-review-commit -prr --out-trace $GITHUB_STEP_SUMMARY
run: node packages/cli/built/genaiscript.cjs run pr-review-commit --out ./temp/genai/pr-review-commit -prr --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/genai-pr-docs-commit-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
- name: start ollama
run: yarn ollama:start
- name: git stuff
run: git fetch origin && git pull origin main:main
run: git fetch origin && git pull origin dev:dev
- name: genaiscript pr-review-commit
run: node packages/cli/built/genaiscript.cjs run pr-docs-review-commit --out ./temp/genai/pr-docs-review-commit -prr --out-trace $GITHUB_STEP_SUMMARY
run: node packages/cli/built/genaiscript.cjs run pr-docs-review-commit --out ./temp/genai/pr-docs-review-commit -prr --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/genai-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ jobs:
run: git fetch origin && git pull origin main:main
- name: genaiscript pr-describe
continue-on-error: true
run: node packages/cli/built/genaiscript.cjs run pr-describe --out ./temp/genai/pr-describe -prd -m reasoning --out-trace $GITHUB_STEP_SUMMARY
run: node packages/cli/built/genaiscript.cjs run pr-describe --out ./temp/genai/pr-describe -prd -m reasoning --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: genaiscript pr-review
run: node packages/cli/built/genaiscript.cjs run pr-review --out ./temp/genai/pr-review -prc -m reasoning --out-trace $GITHUB_STEP_SUMMARY
run: node packages/cli/built/genaiscript.cjs run pr-review --out ./temp/genai/pr-review -prc -m reasoning --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading
Loading