agentleFS
pyrite-wikipyrite-wiki/pyrite/.claude/skills/software-kb/SKILL.md

software-kb

Skill9 starsChanged 2 months agoMITView on GitHub

Use when working with a software-type Pyrite KB for development workflow: pulling work items, checking the board, claiming tasks, submitting for review, or managing backlog. Covers the full kanban cycle via sw_* MCP tools and CLI commands.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If sw_pull_next returns "reason": "WIP limit reached", finish existing in-progress work first.

    line 116
  2. Very specific:

    If sw_pull_next returns blocked items, check if you can unblock them by completing their dependencies.

    line 118
  3. Very specific:

    Before approving, verify agent_responsibility items: tests passing, clean working tree, KB docs updated

    line 134
  4. Very specific:

    If policy is enforce and a checker failed, the claim is rejected.

    line 209

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Software KB Skill

Pull-based development workflow for software-type Pyrite knowledge bases. Covers the kanban cycle from backlog to done, using sw_* MCP tools (for agents) and pyrite sw CLI commands (for humans).

Announce at start: "I'm using the software-kb skill."


The Development Loop

  Pull         Context       Claim         Work         Submit       Review
┌────────┐   ┌──────────┐  ┌──────────┐  ┌─────────┐  ┌──────────┐  ┌──────────┐
│ What's  │──>│ Gather   │──>│ Lock the │──>│ Do the  │──>│ Move to  │──>│ Approve  │
│ next?   │   │ context  │   │ item     │   │ work    │   │ review   │   │ or reject│
└────────┘   └──────────┘  └──────────┘  └─────────┘  └──────────┘  └──────────┘
sw_pull_next  sw_context    sw_claim       (you)        sw_submit     sw_review
              _for_item

Status Flow

proposed → accepted → in_progress → review → done
   ↑          ↑           ↑                    │
   │          │           └── changes_requested─┘
   │          └── in_progress (unclaim)
   └── accepted (demote)

Backward transitions: accepted → proposed, accepted → deferred, in_progress → accepted.

Side exits: proposed → wont_do, proposed → deferred → proposed, done → retired.


MCP Tools Quick Reference

Read tier (safe, no side effects)

ToolPurposeKey args
sw_boardKanban board — all items grouped by lanekb_name
sw_pull_nextRecommend highest-priority unblocked accepted itemkb_name
sw_review_queueItems awaiting review, sorted by wait timekb_name
sw_context_for_itemFull context bundle: linked ADRs, components, validations, conventions, reviewsitem_id, kb_name
sw_backlogList/filter backlog itemskb_name, status, priority, kind
sw_adrsList ADRskb_name, status
sw_milestonesMilestones with completion statskb_name
sw_componentFind component docskb_name, path, name
sw_validationsProgrammatic checks (pass/fail criteria)kb_name, category
sw_conventionsDevelopment conventions (judgment guidance)kb_name, category
sw_standardsAll standards (validations + conventions)kb_name, category
sw_check_readyCheck DoR for a single item without claimingitem_id, kb_name
sw_refineScan backlog for DoR gaps, sorted by prioritykb_name, status

Write tier (mutates state)

ToolPurposeKey args
sw_claimClaim item: accepted → in_progress + set assignee (CAS)item_id, kb_name, assignee
sw_submitSubmit for review: in_progress → reviewitem_id, kb_name
sw_reviewRecord review outcome: review → done or review → in_progressitem_id, kb_name, outcome, reviewer, feedback
sw_create_adrCreate auto-numbered ADRtitle, kb_name
sw_create_backlog_itemCreate backlog itemtitle, kind
sw_transitionTransition to any valid status (with gate check)item_id, kb_name, to_status, reason
sw_logLog work session: decisions, rejected approaches, open questionsitem_id, kb_name, summary

CLI Equivalents

pyrite sw context-for-item <item-id> -k <kb>  # Full context bundle (ADRs, components, deps, reviews, work logs)
pyrite sw board -k <kb>                # Kanban board
pyrite sw backlog -k <kb>              # List backlog
pyrite sw backlog -k <kb> --status accepted  # Filtered
pyrite sw review-queue -k <kb>         # Review queue
pyrite sw claim <item-id> -k <kb> --assignee <name>
pyrite sw submit <item-id> -k <kb>     # Submit for review
pyrite sw transition <item-id> <status> -k <kb>  # Transition with gate check
pyrite sw check-ready <item-id> -k <kb>        # Check DoR without claiming
pyrite sw refine -k <kb>                       # Scan backlog for DoR gaps
pyrite sw adrs -k <kb>                 # List ADRs
pyrite sw new-adr "..." -k <kb>        # Create ADR (title is positional)
pyrite sw components -k <kb>           # Component docs
pyrite sw validations -k <kb>          # Validations
pyrite sw conventions -k <kb>          # Conventions
pyrite sw milestones -k <kb>           # Milestones

Workflow Protocols

Starting Work (Agent)

1. sw_pull_next(kb_name=...)           → get recommendation
2. sw_context_for_item(item_id, kb)    → read linked ADRs, validations, reviews
3. sw_claim(item_id, kb, assignee=...) → lock the item (CAS — fails if already claimed)
   ↳ Read the `gate` field in the response (Definition of Ready)
4. Address gate results:
   - checker failures → fix before proceeding (estimate effort, resolve blockers, decompose XL items)
   - judgment items → self-evaluate and fill gaps (add ## Acceptance Criteria, link to ADR, etc.)
   - If policy is "enforce" and checkers failed, the claim is rejected — fix and retry
5. Do the work
6. sw_submit(item_id, kb)              → move to review

If sw_pull_next returns "reason": "WIP limit reached", finish existing in-progress work first.

If sw_pull_next returns blocked items, check if you can unblock them by completing their dependencies.

Reviewing Work

1. sw_review_queue(kb_name=...)        → see what needs review
2. sw_context_for_item(item_id, kb)    → check prior reviews, linked validations
3. Evaluate the work against Definition of Done
4. sw_review(item_id, kb,
     outcome="approved"|"changes_requested",
     reviewer=...,
     feedback=...)                      → record outcome
  • approved → transitions to done (triggers DoD gate evaluation — check gate in response)
  • changes_requested → transitions back to in_progress (feedback required)
  • Before approving, verify agent_responsibility items: tests passing, clean working tree, KB docs updated
  • Prior review feedback is surfaced in sw_context_for_item so rework addresses specific issues
  • rework_count in the review queue shows how many times an item has been sent back

Logging Work Sessions

Record session context so the next agent doesn't repeat dead ends:

sw_log(item_id, kb_name, summary,
       decisions="...",       # what you chose and why
       rejected="...",        # what you tried and abandoned
       open_questions="...")   # what's unresolved for next session

The tool creates a work_log entry linked to the backlog item via session_for / has_session. These entries surface automatically in sw_context_for_item.

Log at the end of a work session, especially when:

  • You made non-obvious design choices
  • You tried an approach that didn't work
  • You're handing off unfinished work

Checking the Board

sw_board(kb_name=...)

Returns lanes with item counts and WIP limit status. Use this for situational awareness — where is work piling up?

Quality Gates (DoR / DoD)

sw_claim and sw_transition return a gate field containing quality criteria evaluated at transition boundaries:

  • DoR (Definition of Ready) fires at sw_claim / transition to in_progress
  • DoD (Definition of Done) fires at transition to done

Criterion types

TypeMeaningHow to handle
checkerProgrammatic check (pass/fail)Fix the underlying issue — add missing fields, resolve blockers, estimate effort
judgmentGuidance for self-evaluationReview the criterion and fill gaps yourself — add acceptance criteria, link to ADR, etc.
agent_responsibilityAgent must verify before proceedingConfirm the condition holds — tests passing, clean working tree, docs updated

Policy modes

  • warn — gate results are advisory; transition proceeds even if checkers fail
  • enforce — checker failures block the transition; fix issues and retry

Judgment and agent_responsibility criteria always pass structurally — they rely on the agent to self-evaluate honestly.

Example gate response

{
  "gate": {
    "gate_type": "dor",
    "policy": "warn",
    "passed": false,
    "criteria": [
      {"name": "has_effort_estimate", "type": "checker", "passed": false, "message": "Missing effort estimate"},
      {"name": "has_acceptance_criteria", "type": "judgment", "passed": true, "message": "Item should have clear acceptance criteria"},
      {"name": "tests_passing", "type": "agent_responsibility", "passed": true, "message": "All tests should pass before starting"}
    ]
  }
}

The self-check loop

claim → read gate → fix checker failures → self-evaluate judgment items → proceed

If policy is enforce and a checker failed, the claim is rejected. Fix the issue (e.g., pyrite update <id> -k <kb> -f effort=M) and retry the claim.

Backlog Refinement

Proactively prepare backlog items so they pass DoR before anyone claims them.

The refinement loop

1. pyrite sw refine -k <kb>              → scan for DoR gaps
2. For each item with gaps, highest priority first:
   a. Auto-fix what you can:
      - Add effort estimate based on scope analysis
      - Link to relevant ADRs/components
      - Add missing tags
      - Decompose XL items into subtasks
   b. Flag what needs human input:
      - Ambiguous requirements → add ## Open Questions to item body
      - Missing acceptance criteria needing product context → note it
      - Architectural questions → suggest creating an ADR
   c. pyrite sw check-ready <id> -k <kb>  → verify fixes
3. Transition ready items: proposed → accepted (if appropriate)
   - ALWAYS provide a descriptive reason that captures WHY the item is ready
   - Format: "Per refinement: <effort>, <risk>, <impact> (<rationale>)"
   - Example: "Per refinement: Small, low risk, high impact (unblocks backward transitions for blocked items)"
   - NEVER use generic reasons like "Ready per refinement" — the reason should help future readers understand the decision

What agents can fix autonomously

  • Effort estimates (analyze scope, set S/M/L)
  • Missing tags (infer from title/body)
  • ADR/component links (search KB for related entries)
  • Decomposition (create sub-items for XL work, link with blocked_by)

What needs human input

  • Acceptance criteria requiring product/business context
  • Priority decisions between competing items
  • Architectural choices not covered by existing ADRs
  • Scope questions ("should this include X?")

For these, add a ## Open Questions section to the item body with specific asks.


Backlog Item Fields

FieldValuesNotes
kindfeature, bug, tech_debt, improvement, spike, epicWhat type of work
statusproposed, accepted, in_progress, review, done, wont_doWhere in the flow
prioritycritical, high, medium, lowPull order
effortXS, S, M, L, XLT-shirt sizing
assigneestringSet by sw_claim

Priority Semantics

  • critical — blocking other work or production issue; pull immediately
  • high — important for current milestone; pull before medium
  • medium — default; pull in order
  • low — nice-to-have; pull when nothing else is available

sw_pull_next ranks by priority then age (oldest first within same priority).


Dependencies

Backlog items can have blocked_by / blocks relationships:

  • sw_pull_next skips blocked items automatically
  • sw_claim refuses to claim a blocked item
  • sw_context_for_item shows dependency status (resolved or not)
  • Blocked items appear in sw_pull_next response under blocked_items

To unblock work, complete the blocking item first.


Linking to Context

Backlog items gain value from links to other entries:

Link targetWhy
ADRsArchitectural decisions that constrain the work
ComponentsCode areas affected
ValidationsAutomated checks to run
ConventionsStyle/approach guidance to follow
MilestonesWhich milestone this contributes to
Work logsPrior session decisions, rejected approaches, open questions
Other backlog itemsblocked_by / blocks dependencies

sw_context_for_item assembles all of these in one call. Use it before starting work — it's the single source of truth for what an item needs.


Anti-patterns

Don'tDo instead
Skip sw_context_for_item before workingAlways gather context — prior reviews, linked validations, work logs, dependencies
Claim multiple items at onceRespect WIP limits; finish one before pulling another
Submit without running validationsCheck sw_context_for_item for linked programmatic validations; run them
Review without feedbackAlways provide feedback, even for approvals ("LGTM" is fine)
Ignore rework_countItems sent back multiple times likely need a different approach
Create items without kindKind drives board grouping and reporting
Hand-edit YAML frontmatter for field changesUse pyrite update <id> -k <kb> -f field=value — validates and syncs the index
End a session without logging contextUse sw_log to record decisions, rejected approaches, and open questions
Ignore gate results after claim/transitionRead every criterion; address checker failures and self-evaluate judgment items
Skip judgment criteria because they auto-passThey're guidance — verify them yourself
Invent acceptance criteria without domain knowledgeAdd ## Open Questions asking the human for specifics
Rubber-stamp items as ready without checkingRun pyrite sw check-ready and address every gap
Use generic transition reasons ("Ready per refinement")Write reasons that capture effort, risk, impact, and rationale for the decision

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.