Skip to content

Instantly share code, notes, and snippets.

@michaellwest
Created April 8, 2026 15:00
Show Gist options
  • Select an option

  • Save michaellwest/e01127bbaeb820b18633447e19eb95c5 to your computer and use it in GitHub Desktop.

Select an option

Save michaellwest/e01127bbaeb820b18633447e19eb95c5 to your computer and use it in GitHub Desktop.
Global CLAUDE.md

Project Structure

This workspace contains multiple repositories under C:\Projects\github\sitecorepowershell\:

  • Book/ — Sitecore PowerShell Extensions book/documentation (SitecorePowerShell/Book)
  • mcp-server/ — MCP server for Sitecore PowerShell (SitecorePowerShell/mcp-server)
  • sitecorepowershell.com/ — Project website (SitecorePowerShell/sitecorepowershell.com)
  • Spe/ — Sitecore PowerShell Extensions module (SitecorePowerShell/Console)
  • tutorials/ — Tutorials (SitecorePowerShell/tutorials)

Execution Rule: Always confirm the active repository/project directory before executing searches or making file changes.

Custom Skills

  • /work: Trigger this skill for atomic feature development. You must strictly follow the State Machine protocol below.

Protocol: /work State Machine

Phase 1: Planning & Clarification

  1. Analyze: Parse the request against the current project structure.
  2. Clarify: Ask 2-3 targeted questions regarding edge cases, dependencies, or user preferences.
  3. Plan: Present a concise technical plan (Target branch, files to modify, testing strategy).
  4. Adversarial Review: Challenge the proposed plan. Identify potential security vulnerabilities, race conditions, attack surfaces, or failure modes. Document findings and adjust the plan.
  5. HALT: STOP token generation. Wait for the user's explicit approval before proceeding to Phase 2.

Phase 2: Execution

  1. Branching: a. Check for an existing release branch (e.g., release/[version]). If none exists, ask the user whether to create one, incrementing the version from the latest git tag. b. Create a feature branch (feature/[issue-or-concept]) from the release branch (or master if no release branch is used).
  2. TDD Red Phase: Write the failing test first to capture expected behavior. Execute the test to confirm failure.
  3. TDD Green Phase: Implement the code iteratively until the test passes.
  4. Testing & Diagnosis: Run relevant test suites. If a test fails:
    • Trivial syntax errors: Fix immediately.
    • Complex failures: Output 3 candidate explanations. State the most likely cause, implement the fix, and retest. Move to the next candidate if the failure persists.
  5. Documentation: Update relevant inline comments and README.md files.
  6. Commit Rules:
    • Squash related commits on the feature branch (especially when multiple issues are addressed in the same branch).
    • Do NOT use composite commands (e.g., chaining with && or ;).
    • Do NOT explicitly cd before git commands; assume you are executing from the repository root.
    • Commit changes with descriptive messages.
  7. HALT: STOP token generation. Instruct the user to perform manual testing. Wait for explicit approval before merging.

Phase 3: Merge & Persistence

  1. Merge: Upon user approval, merge the feature branch into the release branch (or master) using --no-ff to preserve a merge commit.
  2. Push: Use the AskUserQuestion tool to request permission to push upstream. Never push automatically.
  3. Logging: Update .claude_worklog.md using the format below.

Worklog Format (.claude_worklog.md)

Update this file upon completing Phase 1, pausing in Phase 2, and completing Phase 3.

Session ID: [Current session ID] Last Action: [Brief description of the last successful command/step] Next Action: [What needs to happen when execution resumes] State:

  • Phase 1: Plan Approved
  • Phase 2: Branch Created | Failing Test | Implemented | Documented | Manual Testing Approved
  • Phase 3: Merged

Recovery Protocol

If the session terminates or resets, your absolute first action MUST be: cat .claude_worklog.md to restore state before taking any other action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment