agentleFS
Docat0209Docat0209/SoloForge/skills/pre-code/SKILL.md

pre-code

Skill1 starsChanged 7 months agoMITView on GitHub

Pre-coding readiness gate. Triggers ONLY when: about to write implementation code for a feature or fix. Do NOT trigger when: writing config files, documentation, scripts, or making quick single-line edits.

  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. About 0 are common, 15 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run this checklist BEFORE writing any implementation code.

    line 8
  2. Very specific:

    Run gh issue list --state open and confirm a matching issue exists.

    line 21
  3. Distinctive:

    If NO issue exists: STOP. Create one first using the issue-create skill.

    line 22
  4. Very specific:

    If the issue is for a new product or major feature: was biz-think or biz-validate run?

    line 28
  5. Distinctive:

    If you're about to spend days coding: step back and ask "is this the highest-value use of time right now?"

    line 29
  6. Distinctive:

    Run git branch --show-current to check.

    line 35
  7. Very specific:

    If on main: STOP. Never branch from main.

    line 37
  8. Very specific:

    If on dev: STOP. Do not commit directly to dev.

    line 38
  9. Very specific:

    If on an incorrectly named branch: rename it to follow the <type>/<short-name> convention.

    line 43
  10. Very specific:

    Run git log --oneline @{u}..

    line 48
  11. Distinctive:

    If the branch has no upstream: push immediately:

    line 49
  12. Distinctive:

    Every subsequent commit must also be pushed right after creation.

    line 53
  13. Distinctive:

    Read the linked GitHub issue body.

    line 58
  14. Distinctive:

    If criteria are vague or missing: STOP.

    line 59
  15. Distinctive:

    If the issue lacks technical notes on approach: confirm the intended approach with the user for non-trivial changes.

    line 60
  16. Very specific:

    If the issue body contains a ## Commit Plan or ## Test Plan section (added by the work-breakdown skill):

    line 64
  17. Distinctive:

    Before starting implementation, identify the boundaries of this issue:

    line 71
  18. Distinctive:

    Simple control flow (NASA Rule 1): Avoid deep nesting, no goto, minimize recursion.

    line 85
  19. Distinctive:

    Unit tests: always required. Identify what logic needs unit tests.

    line 94
  20. Distinctive:

    Technical feasibility: if the feature depends on third-party APIs, verify the API works BEFORE writing code.

    line 97
  21. Distinctive:

    No issue exists → "Run issue-create first"

    line 110
  22. Distinctive:

    All clear → "Proceed with implementation"

    line 111

≈ “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

Pre-Code Readiness Gate

Run this checklist BEFORE writing any implementation code. Every item must pass. If any item fails, STOP and resolve it before proceeding.


0. Skill Invocation Check

  • Was this skill loaded via the Skill("pre-code") tool call, not just mentioned in text?
  • If resuming from a previous session: have you re-evaluated the Skill Gate fresh? Previous invocations do not carry over.
  • If taking over from a failed sub-agent: you must still complete this full checklist. Changing executor does not bypass process.

1. Issue Check

  • A GitHub issue exists for this work.
  • Run gh issue list --state open and confirm a matching issue exists.
  • If NO issue exists: STOP. Create one first using the issue-create skill. Do not write code without a tracking issue.
  • Note the issue number for branch naming and PR linking.

1.5 Think Before Build

  • Has the core question "should this exist?" been answered BEFORE starting to code?
  • If the issue is for a new product or major feature: was biz-think or biz-validate run? If not, STOP. Don't build something whose existence hasn't been validated.
  • If you're about to spend days coding: step back and ask "is this the highest-value use of time right now?"
  • Building is expensive. Validating is cheap. Always validate first.

2. Branch Check

  • The current branch is a feature branch created from dev.
  • Run git branch --show-current to check.
  • Valid branch prefixes: feat/, fix/, chore/, refactor/, test/, docs/
  • If on main: STOP. Never branch from main. Switch to dev first, then create a feature branch.
  • If on dev: STOP. Do not commit directly to dev. Create a feature branch:
    git checkout dev && git pull origin dev
    git checkout -b <type>/<short-name>
  • If on an incorrectly named branch: rename it to follow the <type>/<short-name> convention.

3. Branch Pushed

  • The branch has been pushed to the remote.
  • Run git log --oneline @{u}.. 2>/dev/null to check tracking status.
  • If the branch has no upstream: push immediately:
    git push -u origin <branch-name>
  • Every subsequent commit must also be pushed right after creation. Never accumulate unpushed commits.

4. Requirements Clear

  • Acceptance criteria are understood and unambiguous.
  • Read the linked GitHub issue body. Check for acceptance criteria checkboxes.
  • If criteria are vague or missing: STOP. Ask the user to clarify before writing code. Do not guess at requirements.
  • If the issue lacks technical notes on approach: confirm the intended approach with the user for non-trivial changes.

Upstream Plan Check (if from work-breakdown)

If the issue body contains a ## Commit Plan or ## Test Plan section (added by the work-breakdown skill):

  • Read the planned commits — these are your implementation roadmap. Each planned commit = one focused coding session.
  • Read the planned test types — cross-reference with Section 6 below. The test plan here should match or refine what work-breakdown decided.
  • If the plan no longer makes sense after reading the code: update the issue body with the revised plan BEFORE starting implementation. Do not silently diverge.

Scope Boundaries

Before starting implementation, identify the boundaries of this issue:

  • List the files that SHOULD be modified for this issue (from Technical Notes or Commit Plan).
  • During implementation, do NOT modify files outside this list unless strictly necessary. If you must touch an out-of-scope file, note it and justify it.
  • During debugging, resist the urge to "fix" unrelated code you happen to see. Create a separate issue for it instead.
  • Platform configuration in scope? If this issue involves auth, payments, webhooks, or any third-party integration:
    • List the platform settings that need configuration (OAuth redirect URLs, webhook endpoints, API keys, environment variables)
    • These are NOT "deployment details for later" — they are part of the feature scope
    • Include platform config steps in the Commit Plan or Technical Notes
    • A feature that works in code but fails because of missing platform config is NOT done

5. Design Considerations (SOLID + Clean Code + NASA)

  • Design principles have been reviewed for this change.
  • Dependency Inversion (SOLID-D): High-level modules depend on abstractions, not concrete implementations. Inject dependencies; never instantiate collaborators directly inside business logic.
  • Simple control flow (NASA Rule 1): Avoid deep nesting, no goto, minimize recursion. Every function should be readable top-to-bottom with obvious flow.
  • No dynamic memory after init (NASA Rule 3): Allocate resources (connections, buffers, pools) at startup. Avoid runtime allocation in hot paths — prefer pre-allocated structures.
  • Single Responsibility (SOLID-S): Each module/class has ONE reason to change. If a module serves two masters, split it.
  • Threat model during design (OWASP A04): For security-sensitive features, identify threat vectors before coding. Consider: auth bypass, injection, data exposure, privilege escalation.
  • Input validation at system boundaries: Identify where untrusted data enters the system. Validate and sanitize at those boundaries, not deep inside business logic.

6. Test Plan

  • A test plan has been identified for this work.
  • Unit tests: always required. Identify what logic needs unit tests.
  • Integration tests: required if the code touches any external service (database, API, auth, storage). If API keys or env vars are needed, ask the user NOW — not after implementation.
  • E2E tests: required if the change completes a user-facing flow. Confirm Playwright is set up.
  • Technical feasibility: if the feature depends on third-party APIs, verify the API works BEFORE writing code. Run a proof-of-concept call. Check rate limits, TOS, platform restrictions. Do not design around an unverified API.
  • Tests go in the SAME branch and PR as the implementation. Never defer testing to a separate issue.

All Clear

Once every box is checked, proceed with implementation. Reference the issue number in commits using Conventional Commits format: <type>: <description> (#issue)

Next Steps

Report to user: "Pre-code ✅. Issue #[N], branch [name], scope: [N files]. Ready to implement."

Suggested next steps (user decides):

  • No issue exists → "Run issue-create first"
  • All clear → "Proceed with implementation"

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.