agentleFS
andraspandrasp/claude-code-flow/skills/flow-skill/SKILL.md

flow-skill

Skill1 starsChanged 11 months agoMITView on GitHub

Structured development workflow guidance. Auto-activates when user references a docs/context/ path. Provides guided workflows for feature development, refactoring, optimization, greenfield projects, and bugfixes. Use /flow command to start new work.

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. About 0 are common, 22 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈22

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the user references a context path:

    line 21
  2. Very specific:

    Create outcome.md at flow start with this structure:

    line 95
  3. Distinctive:

    All work types follow this general structure:

    line 120
  4. Distinctive:

    Note on autonomous mode: When running autonomously, references to "user feedback," "check in with the user," or "validate with user" should …

    line 122
  5. Very specific:

    If docs/context/.memory/ exists, read the files for relevant context:

    line 127
  6. Very specific:

    If .memory/ doesn't exist yet, skip this step - it will be created during your first flow completion.

    line 136
  7. Distinctive:

    Document findings in research.md (if selected)

    line 141
  8. Distinctive:

    Document in plan.md and tasks.md (if selected)

    line 150
  9. Distinctive:

    Update tasks.md (if selected) as work progresses

    line 156
  10. Distinctive:

    Update outcome.md after each significant change: - add to "Changes Made", note any patterns/gotchas discovered

    line 157
  11. Distinctive:

    Run multi-lens review (7 parallel reviewers)

    line 166
  12. Distinctive:

    Verify success criteria met

    line 178
  13. Distinctive:

    Update Status to ✅ Complete

    line 180
  14. Distinctive:

    Check existing entries to avoid duplicates.

    line 196
  15. Distinctive:

    Before completing implementation, run multi-lens validation to catch issues across different dimensions.

    line 239
  16. Distinctive:

    Read roadmap item for context (description, acceptance criteria)

    line 271
  17. Distinctive:

    Update roadmap item status: planned → in-progress

    line 278
  18. Distinctive:

    Add flow to roadmap item's Linked Flows section

    line 279
  19. Distinctive:

    When finalizing a flow that's linked to a roadmap item:

    line 283
  20. Distinctive:

    Update roadmap item's Linked Flows with outcome

    line 285
  21. Distinctive:

    Check acceptance criteria against accomplishments

    line 286
  22. Distinctive:

    If all criteria met: prompt to mark roadmap item completed

    line 287
  23. Distinctive:

    Update roadmap item's History section

    line 288
  24. Distinctive:

    If a work type file mentions a phase, apply that guidance in addition to the general phase guidance above

    line 319
  25. Distinctive:

    If a work type file omits a phase, use the general guidance from this skill

    line 320

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Flow - Structured Development Workflow Skill

This skill provides guidance for structured AI-assisted development workflows. It auto-activates when:

  • User references a docs/context/ path (e.g., "let's continue docs/context/feature/2025-01-15_user-auth")
  • User explicitly invokes /flow

How Flow Works

The context directory (docs/context/<type>/<date>_<topic>/) holds documentation, not code. The actual code lives elsewhere in the codebase. Once a workflow is active, the guidance applies to all work related to that context, regardless of which files are being edited.

The documents are your anchor. When you return to a session or context gets compacted, reading plan.md and tasks.md restores understanding of what you're doing and why. The code you're writing might be in src/, lib/, or anywhere else. The workflow guidance still applies.

Resuming Work

When the user references a context path:

  1. Parse the path to identify work type and context directory
  2. Read the context files (plan.md, tasks.md, etc.) from that directory
  3. Load the appropriate guidance based on work type (see table below)
  4. Summarize current state and ask if they want to continue
  5. Apply workflow guidance to all subsequent work for this context
Work TypeDirectory PatternGuidance
Greenfielddocs/context/greenfield/types/greenfield.md
Featuredocs/context/feature/types/feature.md
Integrationdocs/context/integration/types/integration.md
Refactordocs/context/refactor/types/refactor.md
Optimizationdocs/context/optimization/types/optimization.md
Bugfixdocs/context/bugfix/types/bugfix.md
Customdocs/context/custom/types/custom.md

Searching Past Flows

During active work, users may ask about past flows:

  • "Have I done something like this before?"
  • "What patterns did I use for authentication?"
  • "Show me past work on caching"
  • "How did I handle X last time?"

When you detect a search-like question:

  1. Spawn a search subagent (Task with subagent_type="Explore") to search docs/context/:
Search past flows for: "<extracted query>"

1. Grep for keywords across docs/context/**/plan.md and outcome.md
2. For matches, extract Overview/Goals from plan.md and Summary/Lessons from outcome.md
3. Note path (contains type, date, topic) and status (has outcome.md = completed)
4. Return only genuinely relevant matches (max 5), sorted by relevance then recency
5. If nothing is truly relevant, say so - don't force matches
6. Do NOT return raw file contents - summarize
  1. Present results with citations:
Found 2 past flows related to "[query]":

1. **feature/2024-12-15_user-auth** (completed)
   Goal: Implement JWT authentication
   Outcome: Used refresh token rotation, noted cookie handling gotchas

2. **bugfix/2024-11-20_session-timeout** (completed)
   Goal: Fix premature session expiration
   Outcome: Root cause was timezone mismatch in token validation

Want me to dive deeper into any of these?
  1. If user wants details, read the full plan.md and outcome.md from that flow and summarize relevant insights.

Why subagent: Searching past flows can involve grepping many files. Doing this in the main session pollutes context with raw search output. The subagent does the heavy lifting and returns only the summary.

Core Documents

Workflows use these documents (user chooses which optional ones to create):

DocumentPurposeUsage
plan.mdImplementation plan, goals, success criteriaRequired - Always created
outcome.mdRecord of changes, learnings, and extracted memoryRequired - Created at start, updated continuously
research.mdAnalysis, findings, raw dataOptional - User chooses
tasks.mdGranular task tracking with checkboxesOptional - User chooses

Outcome Template

Create outcome.md at flow start with this structure:

# Outcome

## Status
🟡 In Progress

## Summary
[To be filled as work progresses]

## Changes Made
[Updated incrementally during implementation]

## Learnings Extracted
[Filled during finalization]

## Next Steps
[Discovered during implementation]

Update outcome.md continuously during implementation - not just at the end. After each significant change, add to "Changes Made" and note any patterns or gotchas discovered.

Workflow Phases

All work types follow this general structure:

Note on autonomous mode: When running autonomously, references to "user feedback," "check in with the user," or "validate with user" should be interpreted as consulting the Oversight Agent instead. See the autonomous-skill for decision-making guidance.

Phase 1: Understanding

First, check accumulated memory (if it exists): If docs/context/.memory/ exists, read the files for relevant context:

  • patterns.md - Established patterns to follow
  • lessons.md - Mistakes to avoid (especially high-severity ones)
  • gotchas.md - Non-obvious issues in this area
  • architecture.md - High-level structure
  • conventions.md - Coding standards

Extract entries relevant to this task's keywords and area. Use this context to inform exploration.

If .memory/ doesn't exist yet, skip this step - it will be created during your first flow completion.

Then explore:

  • Clarify requirements and scope
  • Explore relevant codebase areas (use hierarchical exploration for large codebases)
  • Document findings in research.md (if selected)

Also create outcome.md with the standard template at this point.

→ Validate with user: Does this understanding match reality? Any corrections before planning?

Phase 2: Planning

  • Define approach and architecture
  • Break down into tasks
  • Document in plan.md and tasks.md (if selected)

Iterative: refine with user feedback until the plan is solid.

Phase 3: Implementation

  • Execute the plan systematically
  • Update tasks.md (if selected) as work progresses
  • Update outcome.md after each significant change - add to "Changes Made", note any patterns/gotchas discovered
  • Maintain quality standards

Iterative: check in with the user at logical boundaries.

Phase 4: Validation

Validation is a distinct phase, not a one-time check. It automatically triggers after implementation:

  1. Run multi-lens review (7 parallel reviewers)
  2. Fix Critical/High issues based on reviewer feedback
  3. Repeat steps 1-2 until no Critical/High issues remain
  4. For Medium/Low issues, ask user whether to address or defer

See Validation for details.

Loop until clean or user overrides.

Phase 5: Completion

Finalize outcome.md:

  • Verify success criteria met
  • Polish the Summary section (should already have content from continuous updates)
  • Update Status to ✅ Complete

Extract learnings to memory: Analyze the work done and identify learnings for docs/context/.memory/:

  1. Patterns discovered - Design patterns, architectural patterns, conventions observed → Append to patterns.md with flow reference and confidence level
  2. Lessons learned - Mistakes made, unexpected issues, "aha moments" → Append to lessons.md with severity level
  3. Gotchas encountered - Non-obvious issues, environment quirks → Append to gotchas.md
  4. Architecture insights - New understanding of system structure → Update architecture.md if significant
  5. Conventions noticed - Coding standards observed → Append to conventions.md

Check existing entries to avoid duplicates. If similar entry exists, update its confidence level instead.

Fill in "Learnings Extracted" section of outcome.md:

## Learnings Extracted

### Added to Memory
- **patterns.md**: [what was added, or "nothing new"]
- **lessons.md**: [what was added, or "nothing new"]
- **gotchas.md**: [what was added, or "nothing new"]
- **architecture.md**: [what was added, or "nothing new"]
- **conventions.md**: [what was added, or "nothing new"]

### Rationale
[If nothing extracted: "Routine implementation following established patterns"]

A flow is not properly complete if the "Learnings Extracted" section is missing or unfilled.

Working Style: Explore First

Do not front-load questions. Most information can be discovered autonomously. Only ask the user when:

  • A workflow step explicitly calls for it (e.g., choosing work type or documents)
  • Genuine ambiguity exists that affects the approach
  • A decision requires user preference
  • You've exhausted available sources (codebase, databases, web search, docs) and still lack critical info

Bad: "What are the requirements? What patterns exist? What files are involved?" Good: Explore the codebase first, then "I found X and Y patterns. Should we follow X or try something new?"

Techniques

Reusable techniques that apply across work types and phases:

TechniqueWhen to UseReference
Hierarchical ExplorationLarge codebases, understanding patterns across modulestechniques/hierarchical-exploration.md
State Machine DiagramsComponents with multiple states, cross-system flows, design or verificationtechniques/state-machines.md

These techniques help manage context and force comprehensive thinking. Apply them proactively when the situation calls for it.

Validation

Before completing implementation, run multi-lens validation to catch issues across different dimensions.

Manual: User invokes /validate at any time.

Automatic: At the end of Phase 3 (Implementation), before transitioning to Completion.

The validation skill spawns parallel reviewer subagents, each examining changes through a different lens:

  • Security - Vulnerabilities, injection, auth issues
  • Architecture - Design patterns, coupling, layer violations
  • Quality - Duplication, naming, complexity, CLAUDE.md compliance
  • Performance - Algorithms, queries, bottlenecks
  • Scalability - Concurrency, state, distributed concerns
  • Testing - Coverage, test quality, edge cases
  • Error Handling - Robustness, graceful degradation

Results are aggregated by severity (Critical > High > Medium > Low). Critical issues block completion; High issues are recommended fixes; Medium/Low are advisory.

See /validate command and skills/validation-skill/ for implementation details.

Roadmap Integration

Flows can be linked to roadmap items for strategic tracking. Use /flow-roadmap to manage the strategic backlog.

Starting a Flow with Roadmap Link

/flow feature "implement user auth" --roadmap RM-001
# or reference directly
/flow work on RM-001

When a flow references a roadmap item:

  1. Read roadmap item for context (description, acceptance criteria)
  2. Add to plan.md:
    ## Roadmap Reference
    - **Item**: RM-001 (User Authentication System)
    - **Acceptance Criteria**: [copied from roadmap item]
  3. Update roadmap item status: planned → in-progress
  4. Add flow to roadmap item's Linked Flows section

Flow Completion with Roadmap Link

When finalizing a flow that's linked to a roadmap item:

  1. Update roadmap item's Linked Flows with outcome
  2. Check acceptance criteria against accomplishments
  3. If all criteria met: prompt to mark roadmap item completed
  4. Update roadmap item's History section

This is required behavior during flow finalization when a roadmap link exists.

Context Hygiene

Use /compact proactively at logical boundaries (after completing a phase, before starting a new one). Guide what to preserve:

/compact Preserve: the patterns we discovered, the implementation plan, current progress. Summarize: file exploration details and debugging attempts.

Use /clear between unrelated tasks. Context from the previous task is noise for the next one. Starting fresh is cheap; carrying forward pollution is expensive.

Delegate verbose operations. Anything that produces large output (running tests, analyzing logs, searching many files) belongs in a subagent that returns a summary.

Anti-Patterns

The yell-loop: Agent fails, you correct, agent fails again, you correct harder. Each iteration adds noise. The fix is /clear and restart with a cleaner prompt.

File dumps: Reading entire large files when you only need specific sections. Use targeted reads or delegate to a subagent.

Log accumulation: Build output, test results, and error logs piling up in context. Delegate test runs to subagents. Clear after resolving issues.

Lazy prompting: Quality degrades when you stop putting effort into prompts. If you're getting poor output, reflect on what context you're actually providing.

Type-Specific Guidance

The work type files provide additive guidance for specific work types. They do not override the phases and principles defined in this skill - they supplement them.

How to read work type files:

  • If a work type file mentions a phase, apply that guidance in addition to the general phase guidance above
  • If a work type file omits a phase, use the general guidance from this skill
  • Universal aspects (iterative nature, validation loop, memory extraction) always apply regardless of work type

For detailed guidance on each work type, see:

  • Greenfield Projects
  • Feature Development
  • Integration
  • Refactoring
  • Optimization
  • Bugfix
  • Custom

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.