This commit was merged in pull request #105.
This commit is contained in:
@@ -48,7 +48,7 @@ committed instructions file from the repo, and you control what's in it.**
|
||||
> content if so. The principle outlives any one vendor's filename.
|
||||
|
||||
Without this file, you re-explain your project every session: "we use 4-space indent," "run the tests
|
||||
with `python -m unittest` before you say you're done," "don't touch the generated `tasks.json`." You say it,
|
||||
with `python3 -m unittest` before you say you're done," "don't touch the generated `tasks.json`." You say it,
|
||||
the AI complies, the session ends, the memory evaporates (Module 1's second seam), and tomorrow you
|
||||
say it all again. The instructions file is where that knowledge stops being something you retype and
|
||||
becomes something the project *carries*.
|
||||
@@ -62,7 +62,7 @@ a briefing for an agent that will edit this code. Keep it to what changes the AI
|
||||
uses. "Core logic lives in `tasks.py`; the CLI front end is `cli.py`; state persists to
|
||||
`tasks.json`."
|
||||
- **Build and test commands**: the exact commands, copy-pasteable. "Run the app with
|
||||
`python cli.py <command>`. Run tests with `python -m unittest`. Don't claim a change works until
|
||||
`python3 cli.py <command>`. Run tests with `python3 -m unittest`. Don't claim a change works until
|
||||
the tests pass." This single line stops the AI from inventing a test runner you don't use.
|
||||
- **Coding standards**: formatting, typing, error handling, the libraries you do and don't want.
|
||||
"Use the standard library only, no third-party packages. Type-hint public functions."
|
||||
@@ -83,7 +83,7 @@ useful for personal preferences, but it's the wrong home for project knowledge,
|
||||
lives: on *your* laptop, invisible to everyone else.
|
||||
|
||||
Picture a two-person project with no committed instructions file. You've trained your local setup to
|
||||
run `python -m unittest` and avoid `tasks.json`. Your teammate's setup hasn't, so their agent reformats whole files
|
||||
run `python3 -m unittest` and avoid `tasks.json`. Your teammate's setup hasn't, so their agent reformats whole files
|
||||
and hand-edits the generated JSON. You're both "using AI on the same repo," but you're getting
|
||||
different behavior, and neither of you can see the other's configuration. That's **drift**: the same
|
||||
codebase, diverging because the rules live in two heads instead of one file.
|
||||
@@ -215,7 +215,7 @@ editor-integrated AI (Module 4) for the part where the AI obeys the file.
|
||||
- The `tasks-app` repo from Module 2 (already a Git repo with some history).
|
||||
- Your agentic coding tool from Module 4, and knowledge of which filename it reads for repo-level
|
||||
instructions (check its docs; see the note in *Key concepts*).
|
||||
- Optionally, a test command for the AI to honor; Python's built-in `python -m unittest` works with
|
||||
- Optionally, a test command for the AI to honor; Python's built-in `python3 -m unittest` works with
|
||||
nothing to install (you'll write a real suite in Module 13; until then it simply reports no tests).
|
||||
|
||||
### Part A: Write the instructions file and let the AI commit the config
|
||||
@@ -321,7 +321,7 @@ Be honest about what a committed instructions file does and doesn't buy you:
|
||||
- **Bloat kills it.** A 300-line instructions file is read the way *you* read a 300-line terms-of-
|
||||
service: not really. Every line you add dilutes the rest. Keep it to what actually changes behavior,
|
||||
and prune lines the model already honors without being told.
|
||||
- **Stale instructions are worse than none.** A file that says "run the tests with `python -m
|
||||
- **Stale instructions are worse than none.** A file that says "run the tests with `python3 -m
|
||||
unittest`" after you've switched to a different runner will actively misdirect the AI. The file is
|
||||
code-adjacent: it has to be maintained like code, and reviewed like code. That's exactly why
|
||||
committing it (so changes are
|
||||
|
||||
@@ -25,8 +25,8 @@ minute but real enough to have more than one file. Keep it that way; don't grow
|
||||
|
||||
## Build and test commands
|
||||
|
||||
- Run the app: `python cli.py <command>` (e.g. `python cli.py list`).
|
||||
- Run the tests: `python -m unittest` <!-- EDIT: set this to your real test command, or delete if you have no tests yet -->
|
||||
- Run the app: `python3 cli.py <command>` (e.g. `python3 cli.py list`).
|
||||
- Run the tests: `python3 -m unittest` <!-- EDIT: set this to your real test command, or delete if you have no tests yet -->
|
||||
- Do not claim a change works until you have actually run it. If tests exist, they must pass first.
|
||||
|
||||
## Coding standards
|
||||
|
||||
@@ -15,11 +15,11 @@ This is the running example for **Module 1** (where you feel the copy-paste prob
|
||||
## Run it
|
||||
|
||||
```bash
|
||||
python cli.py add "read module 1"
|
||||
python cli.py add "set up my editor"
|
||||
python cli.py list
|
||||
python cli.py done 0
|
||||
python cli.py list
|
||||
python3 cli.py add "read module 1"
|
||||
python3 cli.py add "set up my editor"
|
||||
python3 cli.py list
|
||||
python3 cli.py done 0
|
||||
python3 cli.py list
|
||||
```
|
||||
|
||||
Requires Python 3.10+ (it uses `list[Task]` style type hints). No third-party packages.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""Tiny command-line front end for the demo task app.
|
||||
|
||||
Run it:
|
||||
python cli.py add "write the lesson"
|
||||
python cli.py list
|
||||
python3 cli.py add "write the lesson"
|
||||
python3 cli.py list
|
||||
|
||||
State is kept in tasks.json next to this file. It's intentionally minimal; the point of this app
|
||||
is to be a realistic-but-small thing you change with an AI, not a product.
|
||||
@@ -31,7 +31,7 @@ def save(tlist: TaskList) -> None:
|
||||
def main(argv: list[str]) -> int:
|
||||
tlist = load()
|
||||
if not argv:
|
||||
print("usage: python cli.py [add <title> | list | done <index> | count | delete <index>]")
|
||||
print("usage: python3 cli.py [add <title> | list | done <index> | count | delete <index>]")
|
||||
return 1
|
||||
|
||||
command = argv[0]
|
||||
|
||||
Reference in New Issue
Block a user