{"id":"code-dev-readme-config-table-from-code","audience":"developers","category":"coding","track":"coding","technique":"grounding","title":"Write a README config table from the code, not the old docs","free":false,"task":"The README's config section is out of date. Write a replacement: the heading '## Configuration', then a markdown table with exactly the columns Variable | Required | Default | Purpose, one row per environment variable the code actually reads. Use yes or no for Required and - when there's no default, and keep each Purpose under 8 words. Nothing after the table, no code blocks, under 110 words.","materialLabel":"The config module and the old README section (attached to your prompt automatically)","material":"# app/config.py  (Python 3.12, Fernway booking API)\nimport os\n\nPORT = int(os.environ.get(\"PORT\", \"8080\"))\nDATABASE_URL = os.environ[\"DATABASE_URL\"]            # crash at startup if missing\nLOG_LEVEL = os.environ.get(\"LOG_LEVEL\", \"info\")\nSENTRY_DSN = os.environ.get(\"SENTRY_DSN\")            # errors not reported if unset\n\n# Redis was removed in v3.2 (sessions moved to Postgres)\n# REDIS_URL = os.environ[\"REDIS_URL\"]\n\n\n---- README.md (current) ----\n\n## Setup\n\nCopy .env.example to .env and set:\n\n- PORT - port to listen on (default 3000)\n- DATABASE_URL - Postgres connection string\n- REDIS_URL - Redis for sessions (required)\n\nThen run `make dev`.\n\n## Deploying\n\nSee docs/deploy.md.\n\n---- .env.example ----\nPORT=3000\nDATABASE_URL=postgres://localhost:5432/fernway\nREDIS_URL=redis://localhost:6379","rules":[{"type":"codeBlocks","count":0},{"type":"maxProseWords","max":110}],"mistakes":[{"title":"Trusting the old README","why":"The README and .env.example still say 3000 and list REDIS_URL, and the AI copies them.","fix":"Add: \"Use only what app/config.py reads, with its defaults.\"","checks":["r1","r2"]},{"title":"No fixed shape","why":"The AI writes bullets, prose or its own table columns.","fix":"Give it: \"## Configuration, then a table with columns Variable | Required | Default | Purpose.\"","checks":["r0"]},{"title":"A whole new README","why":"Asked to update the README, the AI rewrites every section, with code blocks.","fix":"Add: \"Only this section; nothing after the table; no code blocks.\"","checks":["codeBlocks","maxProseWords"]}],"promptHints":[{"label":"Says to trust the code","patterns":["config\\.py","from the code","not the (old )?readme","actually reads"]},{"label":"Gives the heading","patterns":["## configuration","heading"]},{"label":"Gives the table columns","patterns":["variable","required","default","purpose"]},{"label":"Mentions the removed variable","patterns":["redis"]},{"label":"Limits the section","patterns":["only (this|that|the) section","nothing (else|after)","no code"]}],"hint":"Docs drift; code is the truth. Tell the AI which file to trust, the exact heading and columns, and to stop after the table.","rubricLabels":["Starts with the heading ## Configuration followed by a table whose header row is exactly Variable | Required | Default | Purpose, with nothing after the table","Has exactly 4 rows, PORT, DATABASE_URL, LOG_LEVEL and SENTRY_DSN, and no REDIS_URL row","PORT's default is 8080 (not 3000), DATABASE_URL is Required yes with default -, LOG_LEVEL's default is info, and SENTRY_DSN is Required no with default -"]}