diff --git a/README.md b/README.md index 42d6278..0256cd8 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,35 @@ Skills are contextual instructions loaded on demand via the `skill` tool. The ag |-------|-------------| | `ask-questions-if-underspecified` | Clarify requirements before implementing. Use when serious doubts arise. | +#### Example: ask-questions-if-underspecified + +**User request:** +> "Add authentication to the API" + +**Agent response (after loading the skill):** + +The agent recognizes this request has multiple interpretations and uses the `question` tool: + +``` +┌─ Authentication Approach ────────────────────────────────────────┐ +│ │ +│ Which authentication method should be implemented? │ +│ │ +│ ○ JWT tokens (Recommended) │ +│ ○ Session-based with cookies │ +│ ○ OAuth 2.0 / OpenID Connect │ +│ ○ API keys │ +│ ○ Other │ +│ │ +└──────────────────────────────────────────────────────────────────┘ +``` + +After the user selects "JWT tokens", the agent confirms: + +> "I'll add JWT-based authentication to the API endpoints using the existing Express middleware pattern. Success = all `/api/*` routes require a valid token, with a `/auth/login` endpoint for token generation." + +Then implementation begins. + ### Discovery Locations Skills are discovered from the following locations, in order of increasing priority: diff --git a/agent/code-simplifier.md b/agent/code-simplifier.md index a4a56c1..e1af06e 100644 --- a/agent/code-simplifier.md +++ b/agent/code-simplifier.md @@ -26,6 +26,7 @@ You do not introduce new features, fix bugs, or change logic. You only improve h ### 2. Scope discipline - Only simplify code that was **modified or introduced in the current session**. +- This includes **untracked files** (new files not yet committed) listed in the working tree. - Do not refactor adjacent or pre-existing code unless strictly required to simplify the modified section. - No cross-file refactors unless the change itself spans multiple files. @@ -61,11 +62,12 @@ Apply simplifications only when they clearly improve readability or maintainabil ## Execution process -1. Identify code that was added or modified in the current session. -2. Analyze it for unnecessary complexity, redundancy, or unclear structure. -3. Apply minimal, behavior-preserving refinements. -4. Re-check that functionality, outputs, and side effects are unchanged. -5. Produce the simplified code. +1. Identify code that was added or modified in the current session, **including untracked files listed in the diff**. +2. **Read the content of untracked files** using the Read tool before analyzing them. +3. Analyze the code for unnecessary complexity, redundancy, or unclear structure. +4. Apply minimal, behavior-preserving refinements. +5. Re-check that functionality, outputs, and side effects are unchanged. +6. Produce the simplified code. ## Output requirements diff --git a/command/diff-summary.md b/command/diff-summary.md index c9f8a3c..fc464a4 100644 --- a/command/diff-summary.md +++ b/command/diff-summary.md @@ -43,9 +43,8 @@ else git diff echo "" - echo "## Untracked Files Content" - git ls-files --others --exclude-standard | while read f; do - [ -f "$f" ] && echo "=== $f ===" && sed -n "1,50p" "$f" && sed -n "51p" "$f" | grep -q . && echo "... (truncated)" - done + echo "## Untracked Files (new)" + echo "These files are new and not yet tracked by git. Read them directly to see their content." + git ls-files --others --exclude-standard fi '` diff --git a/command/review-changes.md b/command/review-changes.md index 29e7f94..2254342 100644 --- a/command/review-changes.md +++ b/command/review-changes.md @@ -16,7 +16,8 @@ agent: code-reviewer !`git diff --stat` !`git diff` -## Untracked Files Content -!`bash -c 'git ls-files --others --exclude-standard | while read f; do [ -f "$f" ] && echo "=== $f ===" && sed -n "1,50p" "$f" && sed -n "51p" "$f" | grep -q . && echo "... (truncated)"; done'` +## Untracked Files (new) +These files are new and not yet tracked by git. Read them directly to see their content. +!`git ls-files --others --exclude-standard` Review the above changes for quality, correctness, and adherence to project guidelines.