SuperAPI AI Directory

kf-g-code-how-what-why-why-not-principles

Coding & development

View repository

Updated 10-15 21:02

About this skill

How / What / Why / Why not — Responsibility Map

This skill is the entry point for the 4 principles. Detailed rules are delegated to each SoT skill.

4 Principles

Deliverable Principle Description SoT
Code How The code itself shows the method of realization (Guidelines of this skill only)
Test code What Show results, behavior, specifications, and contracts observable from the caller without depending on internal implementation tdd/SKILL.md, tdd/tests.md
Commit log Why Show why it was implemented or changed this way kf-g-git-commit-japanese-commit-message
Code comments Why not Show why alternatives were not adopted, and why it cannot be simplified or removed kf-g-code-comment-rules

How to Read Through

  1. Identify the principle row corresponding to the work target (code / test / commit / comment)
  2. Read the corresponding SoT skill
  3. How (code) has no SoT. The implementation itself shows the method

Required Steps by Work Type

Before writing or fixing code

  1. Confirm the responsibility of How in this skill
  2. Show the method through the implementation itself (do not offload How to comments or commits)

Before writing or fixing tests

  1. Confirm the responsibility of What in this skill
  2. tdd/SKILL.md Read
  3. If necessary, tdd/tests.md Read

Before writing a commit message

  1. Confirm the responsibility of Why in this skill
  2. kf-g-git-commit-japanese-commit-message Read
  3. When requesting a commit, kf-g-git-commit-staged-only-rules is also used together (canonical)
  4. User /genshijin-commit only when explicitly specified, genshijin-commit is used

Before writing or fixing code comments

  1. Confirm the responsibility of Why not in this skill
  2. kf-g-code-comment-rules Read

Final Check

  1. Each deliverable conforms to the corresponding principle (How / What / Why / Why not)
  2. Detailed rules are not duplicated in this skill
  3. The corresponding SoT skill has been read