A declarative logic programming environment that knows what experienced programmers may already know is described. Programs are analyzed incrementally as each clause is added, and bugs that may have escaped the programmer's attention are noticed. The environment's knowledge is abstract, but it is domain specific: trees, lists, numbers, data flow dependencies, recursion, etc. The environment also knows about methodological prescriptions that the programmer in a nondeterministic language is advised to follow. They include possible redundant, underdefined, and nonexhaustive clauses, named but unused placeholders, functional dependencies, and open- and closed-world assumptions. The environment is called declarative because it diagnoses what may be wrong prior to execution rather than explaining how a buggy case came up during the execution. It improves the quality of code without mandating any restrictive programming methodology. Using Shapiro's algorithmic diagnosis as a measure of power, we sampled our environment on his buggy quick-sort (qsort) program. It prevented five of the six bugs and helped discover the last one with a convenient explanation tool. Two prototypes of the environment are implemented, one in the Edinburgh C-Prolog and the other in the MPROLOG system of Logicware, Inc.