agentleFS
sdbdssdbds/ACE-Step-1.5-for-windows/AGENTS.md

ACE-Step-1.5-for-windows

AGENTS.md101 starsChanged 8 months agoMITView on GitHub

Guidance for AI coding agents working in ace-step/ACE-Step-1.5. This document is aligned with the intent from: - Discussion #408: functional decomposition to reduce risk from large mixed-responsibility files. - Discussion #365: low-risk contribution workflow, minimal scope, and review rigor.

2 other projects use a version of this.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 2

    1. ace-step/ACE-Step-1.5★ 13k100% same
    2. PiMPStudios/ACE-Step-1.5★ 0100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository7 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

38 rules. About 0 are common, 28 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈28

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep changes safe and reviewable.

    line 11
  2. Distinctive:

    Prefer small, maintainable, decomposed modules.

    line 12
  3. Distinctive:

    Keep edits minimal: touch only files/functions required for the requested change.

    line 42
  4. Distinctive:

    Do not make drive-by refactors, formatting sweeps, or opportunistic cleanups.

    line 43
  5. Very specific:

    Do not alter non-target hardware/runtime paths (CPU/CUDA/MPS/XPU) unless required by the task.

    line 44
  6. Distinctive:

    If any cross-path change is necessary, isolate it and justify it in the PR notes.

    line 45
  7. Distinctive:

    Prefer single-responsibility modules with clear boundaries.

    line 50
  8. Distinctive:

    Do one thing at a time; if a function description naturally contains "and", split it.

    line 55
  9. Very specific:

    Keep data flow explicit (data in, data out).

    line 57
  10. Very specific:

    If a module would exceed 200 LOC:

    line 60
  11. Distinctive:

    Add a short justification in PR notes and include a concrete follow-up split plan.

    line 62
  12. Distinctive:

    Keep orchestrator/facade modules thin.

    line 63
  13. Distinctive:

    Add or update tests for every behavior change and bug fix.

    line 68
  14. Very specific:

    Use unittest-style tests.

    line 70
  15. Distinctive:

    Keep tests deterministic, fast, and scoped to changed behavior.

    line 72
  16. Very specific:

    Use unittest.mock.MagicMock and unittest.mock.patch for mocking.

    line 73
  17. Distinctive:

    If a change requires mocking a large portion of the system to test one unit, treat that as a decomposition smell and refactor boundaries.

    line 75
  18. Distinctive:

    Run targeted tests locally before submitting.

    line 80
  19. Distinctive:

    Type hints: Add type annotations for new/modified functions when practical.

    line 110
  20. Very specific:

    Avoid bare except: clauses.

    line 133
  21. Distinctive:

    Use custom exceptions for domain errors

    line 134
  22. Very specific:

    Use from loguru import logger and logger.info(), logger.error(), etc.

    line 139
  23. Distinctive:

    Keep logs actionable and debug-level for development

    line 140
  24. Very specific:

    Avoid print() in committed code except CLI output

    line 141
  25. Very specific:

    Use gpu_config.py for hardware detection

    line 144
  26. Distinctive:

    Do not alter non-target platform paths unless explicitly required

    line 145
  27. Distinctive:

    Do not expose unfinished or non-functional user-facing flows by default.

    line 150
  28. Distinctive:

    Keep default behavior stable.

    line 152
  29. Distinctive:

    Use explicit, readable code over clever shortcuts.

    line 156
  30. Distinctive:

    Add type hints for new/modified functions when practical.

    line 159
  31. Distinctive:

    Keep functions focused and short.

    line 160
  32. Distinctive:

    Use clear names that describe behavior, not implementation trivia.

    line 161
  33. Distinctive:

    Prefer pure functions for logic-heavy paths where possible.

    line 162
  34. Distinctive:

    Avoid duplicated logic, but do not introduce broad abstractions too early.

    line 163
  35. Very specific:

    Keep logging actionable; avoid noisy logs and print debugging in committed code.

    line 165
  36. Distinctive:

    Avoid hidden state and unintended side effects.

    line 166
  37. Distinctive:

    Write comments only where intent is non-obvious.

    line 167
  38. Distinctive:

    Add/update focused tests.

    line 174

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
AGENTS.md

AGENTS.md

Guidance for AI coding agents working in ace-step/ACE-Step-1.5.

This document is aligned with the intent from:

  • Discussion #408: functional decomposition to reduce risk from large mixed-responsibility files.
  • Discussion #365: low-risk contribution workflow, minimal scope, and review rigor.

Primary Objectives

  1. Keep changes safe and reviewable.
  2. Prefer small, maintainable, decomposed modules.
  3. Preserve behavior outside the target fix.
  4. Validate with focused Python unit tests.

Build, Lint, and Test Commands

# Install dependencies
uv sync

# Run all tests (unittest-based, discovery in */*_test.py and test_*.py)
uv run python -m unittest discover -s . -p "*_test.py"
uv run python -m unittest discover -s . -p "test_*.py"

# Run a single test file
uv run python -m unittest acestep.training.test_lora_utils

# Run a specific test class
uv run python -m unittest acestep.training.test_lora_utils.TestUnwrapDecoder

# Run a single test method
uv run python -m unittest acestep.training.test_lora_utils.TestUnwrapDecoder.test_returns_module_directly

# Run all tests in a directory
uv run python -m unittest discover -s acestep/training -p "*_test.py"

Scope and Change Control (Required)

  • Solve one problem per task/PR.
  • Keep edits minimal: touch only files/functions required for the requested change.
  • Do not make drive-by refactors, formatting sweeps, or opportunistic cleanups.
  • Do not alter non-target hardware/runtime paths (CPU/CUDA/MPS/XPU) unless required by the task.
  • If any cross-path change is necessary, isolate it and justify it in the PR notes.
  • Preserve existing public interfaces unless the task explicitly requires an interface change.

Decomposition and Module Size Policy

  • Prefer single-responsibility modules with clear boundaries.
  • Target module size:
    • Optimal: <= 150 LOC
    • Hard cap: 200 LOC
  • Function decomposition rules:
    • Do one thing at a time; if a function description naturally contains "and", split it.
    • Split by responsibility, not by convenience.
    • Keep data flow explicit (data in, data out); side effects must be obvious and deliberate.
    • Push decisions up and push work down (orchestration at higher layers, execution details in lower layers).
    • The call graph should read clearly from top-level orchestration to leaf operations.
  • If a module would exceed 200 LOC:
    • Split by responsibility before merging, or
    • Add a short justification in PR notes and include a concrete follow-up split plan.
  • Keep orchestrator/facade modules thin. Move logic into focused helpers/services.
  • Preserve stable facade imports when splitting large files so external callers are not broken.

Python Unit Testing Expectations

  • Add or update tests for every behavior change and bug fix.
  • Match repository conventions:
    • Use unittest-style tests.
    • Name test files as *_test.py or test_*.py.
  • Keep tests deterministic, fast, and scoped to changed behavior.
  • Use unittest.mock.MagicMock and unittest.mock.patch for mocking.
  • Mock GPU, filesystem, network, and external services where possible.
  • If a change requires mocking a large portion of the system to test one unit, treat that as a decomposition smell and refactor boundaries.
  • Include at least:
    • One success-path test.
    • One regression/edge-case test for the bug being fixed.
    • One non-target behavior check when relevant.
  • Run targeted tests locally before submitting.

Code Style Guidelines

  • Python version: 3.11-3.12
  • Indentation: 4 spaces (no tabs)
  • Line length: Maximum 100 characters (recommended). See pyproject.toml for configured formatter limits. Exceptions allowed for URLs and long strings where wrapping would hurt readability.
  • Strings: Double quotes " preferred
  • Imports: Group by type (stdlib, third-party, local), sort alphabetically within groups
# Example import ordering
import os
import tempfile
from pathlib import Path
from typing import Any
from unittest.mock import MagicMock, patch

import torch
import torch.nn as nn

from acestep.training.lora_injection import inject_lora_into_dit

Naming conventions:

  • snake_case for functions, variables, and module names
  • PascalCase for classes
  • UPPER_SNAKE_CASE for constants
  • Prefix private/internal names with underscore: _internal_func, _private_var

Type hints: Add type annotations for new/modified functions when practical.

Docstrings: Mandatory for all modules, classes, and public functions. Use concise format:

def inject_lora_into_dit(
    dit: nn.Module,
    config: dict[str, Any],
    target_modules: list[str],
) -> nn.Module:
    """Inject LoRA adapters into DiT model for parameter-efficient fine-tuning.

    Args:
        dit: The Diffusion Transformer model to modify.
        config: LoRA configuration dictionary.
        target_modules: List of module names to apply LoRA to.

    Returns:
        The modified DiT model with LoRA adapters injected.
    """

Error handling:

  • Avoid bare except: clauses; catch specific exceptions
  • Use custom exceptions for domain errors
  • Log errors with loguru.logger (not print())
  • Let exceptions propagate for truly exceptional conditions

Logging:

  • Use from loguru import logger and logger.info(), logger.error(), etc.
  • Keep logs actionable and debug-level for development
  • Avoid print() in committed code except CLI output

Multi-platform support (CUDA, ROCm, Intel XPU, MPS, MLX, CPU):

  • Use gpu_config.py for hardware detection
  • Do not alter non-target platform paths unless explicitly required
  • Changes to CUDA code should not break MPS/XPU/CPU paths

Feature Gating and WIP Safety

  • Do not expose unfinished or non-functional user-facing flows by default.
  • Gate WIP or unstable UI/API paths behind explicit feature/release flags.
  • Keep default behavior stable; "coming soon" paths must not appear as usable functionality unless they are operational and tested.

Python Coding Best Practices

  • Use explicit, readable code over clever shortcuts.
  • Docstrings are mandatory for all new or modified Python modules, classes, and functions.
  • Docstrings must be concise and include purpose plus key inputs/outputs (and raised exceptions when relevant).
  • Add type hints for new/modified functions when practical.
  • Keep functions focused and short; extract helpers instead of nesting complexity.
  • Use clear names that describe behavior, not implementation trivia.
  • Prefer pure functions for logic-heavy paths where possible.
  • Avoid duplicated logic, but do not introduce broad abstractions too early; prefer simple local duplication over unstable premature abstraction.
  • Handle errors explicitly; avoid bare except.
  • Keep logging actionable; avoid noisy logs and print debugging in committed code.
  • Avoid hidden state and unintended side effects.
  • Write comments only where intent is non-obvious; keep comments concise and technical.

AI-Agent Workflow (Recommended)

  1. Understand the task and define explicit in-scope/out-of-scope boundaries.
  2. Propose a minimal patch plan before editing.
  3. Implement the smallest viable change.
  4. Add/update focused tests.
  5. Self-review only changed hunks for regressions and scope creep.
  6. Summarize risk, validation, and non-target impact in PR notes.

PR Readiness Checklist

  • Change is tightly scoped to one problem.
  • Non-target paths are unchanged, or changes are explicitly justified.
  • New/updated tests cover changed behavior and edge cases.
  • No unrelated refactor/formatting churn.
  • Required docstrings are present for all new/modified modules, classes, and functions.
  • WIP/unstable functionality is feature-flagged and not exposed as default-ready behavior.
  • Module LOC policy is met (<=150 target, <=200 hard cap or justified exception).

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.