agentleFS
akdevsaha-devakdevsaha-dev/factory-skills/skills/reflect/SKILL.md

reflect

Skill1 starsChanged 19 days agoMITView on GitHub

Learn from a demonstrated engineering failure, such as a failed test, a confirmed review defect, a repeated mistake, a manual correction, or a regression. Finds the root cause, decides whether it is systematic, and proposes the smallest durable prevention (a test, lint rule, or tooling first; an instruction change last), validated against real examples. Never changes instructions or skills without explicit approval. Use when the same kind of mistake recurs, a defect escaped existing checks, or the user asks to learn from a failure.

186 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-pstack, make-bot-ui and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • bnemaSkill

    setup-pstack

    Configure which Pi models pstack uses per role. Detects available provider/model specs and writes pstack's user configuration. Use for /setup-pstack, "configure pstack models", or changing pstack model choices.

    Also in 29 projects that use this

  • eryzerzSkill

    make-bot-ui

    Use when building a custom UI (page, dashboard, buttons) that should wake a Grok Bot over a webhook, when the user must provide a webhook sender key, or when exposing that UI on Tailscale.

    Also in 22 projects that use this

  • jaydubya818Skill

    poteto-mode

    Use when non-trivial work should follow the smallest rigorous Jstack workflow.

    Also in 34 projects that use this

  • jaydubya818Skill

    automate-me

    Use when the user wants working preferences captured in a reusable mode skill.

    Also in 47 projects that use this

  • +8 more from jaydubya818

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 168 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Reflect proposes; it never applies: Do not edit AGENTS.md, CLAUDE.md, skills, memory, lint configs, CI, or any other persistent rule until …

    line 12
  2. Distinctive:

    Do not run after a clean, successful task.

    line 21
  3. Distinctive:

    Decide whether it is systematic: Look for the same pattern elsewhere: in other occurrences in the code (git grep), in git log, and in …

    line 31
  4. Distinctive:

    Find the root cause: Ask why until you reach something that a check, a tool, or an instruction could change: a missing test category, a …

    line 32
  5. Very specific:

    When the user opts in, keep recurring findings in docs/engineering-findings.md in the project, one line each: date, pattern, where it was …

    line 43

“Common” is measured: kept by at least 6 in 10 of the 168 edited versions of this file we could read. “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

Reflect

Turn a real failure into a prevention that will catch the next one. Learn only from what was demonstrated: a failing check, a confirmed defect, or a correction. Never learn from assumptions or style preferences.

Read references/operating-rules.md first.

Reflect proposes; it never applies. Do not edit AGENTS.md, CLAUDE.md, skills, memory, lint configs, CI, or any other persistent rule until the user explicitly approves that specific change.

Use when

  • The same kind of defect or mistake happened twice
  • A defect reached review or the user that an automated check could have caught
  • A fix loop hit its limit
  • The user corrected the work, or asks to learn from a failure

Do not run after a clean, successful task.

Inputs

  • The failure, with its evidence: a failing test output, a confirmed finding, the user's correction, or the regression
  • The change it occurred in

Procedure

  1. State the failure. One sentence of what went wrong, with the evidence that shows it. With no evidence, stop: there is nothing to learn yet.
  2. Decide whether it is systematic. Look for the same pattern elsewhere: in other occurrences in the code (git grep), in git log, and in earlier findings in the findings log when one exists. One isolated slip is not systematic: report it and stop.
  3. Find the root cause. Ask why until you reach something that a check, a tool, or an instruction could change: a missing test category, a rule the linter could enforce, an instruction that was ambiguous, or a step that was skipped.
  4. Propose the smallest durable prevention, preferring in this order:
    1. A test that fails on the defect
    2. A static rule: a lint rule, type constraint, or schema
    3. Tooling: a script, CI step, or pre-commit check
    4. An instruction change, in the project's AGENTS.md or CLAUDE.md or in a skill, written as one precise rule
  5. Validate the proposal against realistic examples: show it catches the original failure (the test fails, or the rule flags the code) and passes on correct code. Validate without changing the project: run a candidate test or rule from a temporary directory, or state the exact validation when it cannot run. For an instruction change, show the before and after text and the case it would have changed.
  6. Ask for approval, with the exact diff of the proposed change.

Findings log

When the user opts in, keep recurring findings in docs/engineering-findings.md in the project, one line each: date, pattern, where it was seen, and the prevention status. Create the file only after the user agrees. Use it to spot recurrence; it is not a rule set.

Output

Failure      Refund route accepted another tenant's payment ID (confirmed finding, refund.test.ts)
Systematic   Yes: the same unscoped findById in invoices.ts:31 and payouts.ts:18
Root cause   Repositories expose findById without a tenant parameter; nothing enforces scoping
Prevention   Lint rule banning PaymentRepository.findById outside repositories, plus scoped
             findForTenant(tenantId, id); validated: flags 3 current call sites, passes on the fixed ones
Proposed     (diff of the rule and the call-site changes)
Approval     Waiting for your approval. Nothing has been changed.

Escalate

The prevention needs changes beyond the project, such as a shared skill or global instructions: propose them separately, and say who owns them.

Hand off

Approved test, lint, or tooling changes go to implement-feature. Approved instruction changes are applied exactly as approved, and nothing more.

Before you finish, check your list of available skills for each skill named in this section. If any is missing, end your report with the missing names, this command, and the question "Should I install them for you, or will you install them yourself?" Follow "Missing companion skills" in references/operating-rules.md for the rest.

npx skills add akdevsaha-dev/factory-skills --skill hungry-jack plan-change implement-feature verify-work simplify-code review-changes reflect

Done when

The failure is shown to be isolated, or a validated prevention is proposed and is waiting for approval, or was applied as approved.

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.