Access Granted

    AI Work Cycle
    Skill File

    One skill. Five phases. Works for code and knowledge-work deliverables.

    Quick Start (4 Steps)

    1. 1. Copy the SKILL.md below
    2. 2. Save as .claude/skills/ai-work-cycle/SKILL.md
    3. 3. Invoke with /ai-work-cycle [description or task ID]
    4. 4. Review at the triage pause, ship, and let the Learn phase compound
    Skill File

    AI Work Cycle Configuration

    Copy this entire file

    Save as .claude/skills/ai-work-cycle/SKILL.md in your repository

    .claude/skills/ai-work-cycle/SKILL.md
    ---
    name: ai-work-cycle
    description: Unified 5-phase cycle (Plan → Work → Review → Triage → Learn) for both coding and knowledge-work tasks. Auto-detects the work type and routes to specialized sub-pipelines. Survives context compaction via TodoWrite, blocks shipment on P1 findings.
    ---
    
    # AI Work Cycle
    
    One skill, two paths. This skill is a thin orchestrator — it classifies the work, routes to the right pipeline, and wraps the whole thing in a mandatory review gate plus a Learn phase that compounds.
    
    ## The Five Phases
    
    | # | Phase | Code path | Knowledge-work path |
    |---|-------|-----------|---------------------|
    | 1 | Plan | /yalla-plan (4-agent planning) | Task(knowledge-work:plan) |
    | 2 | Work | /yalla build OR inline + TodoWrite | Task(knowledge-work:create) |
    | 3 | Review | /yalla-review + Task(qa-validator) | Task(knowledge-work:review) |
    | 4 | Triage | Inline P1/P2/P3 consolidation | Task(knowledge-work:triage) |
    | 5 | Learn | INSERT INTO memory_knowledge | INSERT INTO memory_knowledge |
    
    Note: /yalla-plan, /yalla-review, and /yalla are the proven code pipelines you already have. The knowledge-work agents are specialized sub-agents. Swap for your own equivalents if you use different tools.
    
    ## How to Invoke
    
    /ai-work-cycle [description]
    /ai-work-cycle task-1234
    /ai-work-cycle mode=code [description]
    /ai-work-cycle mode=knowledge [description]
    
    If given a task ID, load context from dev_tasks first.
    
    ## Auto-Detect: Code or Knowledge Work?
    
    | Signal | Path |
    |--------|------|
    | Mentions files, functions, endpoints, tests, UI, database, bugs | Code |
    | Mentions strategy, analysis, deck, doc, research, brief, memo | Knowledge |
    | Ambiguous | Ask once, then route |
    
    Force path: mode=code or mode=knowledge.
    
    ## Phase 1: Plan
    
    Code: Skill /yalla-plan runs a 4-agent adversarial planning team (codebase-analyst, solution-architect, spec-validator, red-team) → plans/[feature].md
    Knowledge: Task knowledge-work:plan → brief with research, success criteria, outline
    
    Always: create a comprehensive TodoWrite list before Phase 2. Todos survive context compaction.
    
    ## Phase 2: Work
    
    Code: Skill /yalla handles track → plan → work → test → review → ship in one shot. Or implement manually from the plan with TodoWrite checkpoints.
    Knowledge: Task knowledge-work:create builds section by section against the brief.
    
    ## Phase 3: Review (Mandatory Gate)
    
    Code:
    1. Skill /yalla-review — binary pass/fail checks (security, types, tests, conventions)
    2. Task qa-validator — browser, database, API, user flows
    3. P1 findings BLOCK shipment (SQL injection, XSS, SSRF, data corruption, bypass, failing build, broken user flow)
    
    Knowledge:
    1. Task knowledge-work:review runs 12+ specialists in parallel:
       - clarity-maximizer, completeness-validator, structure-architect,
         professional-polish-editor, stakeholder-alignment-checker, impact-analyzer
    2. Output: severity-categorized findings
    
    ## Phase 4: Triage
    
    Code: Consolidate /yalla-review and qa-validator output into P1/P2/P3 with effort estimates.
    Knowledge: Task knowledge-work:triage → prioritized revision list with time estimates.
    
    Pause here. You decide what ships vs. what's deferred.
    
    ## Phase 5: Learn (Don't Skip)
    
    Extract 1-3 reusable patterns to memory_knowledge via SQL:
    
    INSERT INTO memory_knowledge (owner_id, type, title, content, tags, source, confidence, decay_score)
    VALUES ('you', 'pattern', 'Short title', 'What I learned and when to apply', '["tag"]'::jsonb, 'task-XXXX', 0.85, 1.0);
    
    Capture: non-obvious gotchas, reusable structures, decisions with rationale.
    Skip: "fixed typo" — not reusable.
    
    ## Override: Ship With Known P1s
    
    I accept risks: [list P1 issues]
    Business reason: [why ships now]
    Mitigation: [follow-up PR #XXXX]
    Acknowledged by: [your name]
    
    Goes into commit message. Audit trail.
    
    ## Execution Strategy
    
    - Phases 1 → 2 → 3: run automatically
    - Before Phase 4 (Triage): pause for your review
    - Phase 5 (Learn): quick, but explicit — do not skip
    
    Say "stop" to interrupt.
    
    ## Required Sub-Pipelines
    
    Code path:
    - Skill: /yalla-plan (4-agent adversarial planning)
    - Skill: /yalla (optional — full autonomous build pipeline)
    - Skill: /yalla-review (binary pass/fail review)
    - Agent: qa-validator
    
    Knowledge path:
    - Agent: knowledge-work:plan, create, review, triage
    
    If any missing, I fall back to inline execution and tell you what's unavailable.
    
    Phase Details

    What Each Phase Actually Does

    Planning produces a durable artifact — a plan file you can reload across sessions. This is what makes 50-minute sessions survive compaction.

    Code Path

    • • Technical approach
    • • Files affected
    • • Acceptance criteria
    • • Risk surface
    • • Output: plans/[feature].md

    Knowledge Path

    • • Background research (parallel)
    • • Success criteria
    • • Section outline
    • • Estimated time
    • • Output: structured brief document

    Want the Full System?

    The AI Work Cycle runs solo, but it shines inside a configured Second Brain — where the Learn phase writes to a memory layer that persists across every future session.

    Second Brain 2.0

    The complete Claude Code system. 30+ agents, memory that compounds, pre-configured MCPs, this skill pre-installed.

    DIY $197 · Kickstart $597 · DWY $2,497

    See Packages
    MemoryOS

    The memory layer the Learn phase writes to. Patterns persist and recall across every future session.

    Free · Standard $199/yr · Pro $349/yr

    Get MemoryOS