<PAGE>
 
                                                                   EXHIBIT 10.31

                              CONSULTANT AGREEMENT

     This Agreement, effective as of January 1, 1999, is entered into by
Template Software, Inc., hereinafter referred to as Template Software, located
at 45365 Vintage Plaza Park, Suite 100, Dulles, Virginia  20166 and Alan B.
Salisbury, 1831 Michael Faraday Drive, Reston, Virginia  20190, hereinafter
referred to as the Consultant.  Consultant's Social Security Number is 136-32-
7068.  In consideration of the mutual covenants contained herein, the parties
hereto, intending to be legally bound, agree as follows:

ARTICLE I - TERM OF AGREEMENT

     The Term of this Agreement shall be from January 1, 1999 to December 31,
1999.  This Term may be extended as mutually agreed to by Template Software and
the Consultant.  Consultant is not obligated to perform services or incur
expenses and Template Software is not obligated to compensate Consultant for
services or expenses incurred or commitments made before or after these dates
and any extension thereof.

ARTICLE II - STATEMENT OF SERVICES

     The Consultant agrees to perform professional services in the area of
Template Software's government and telecommunications business units and with
respect to marketing, public relations and strategic planning.  Template
Software shall utilize the professional services of the Consultant on an "as-
tasked" basis, as mutually agreed to by the parties.  It is estimated that the
combination of all of the task statements hereunder shall require approximately
288 man-hours (approximately 36 days) for the Term.  The Consultant shall not be
obligated to perform and Template Software shall not be obligated to pay for any
services without a written task statement and Consultant shall not be obligated
to perform and Template Software shall not be obligated to pay for services in
excess of the estimated man-hours of any task statement without a written
modification thereto, signed by both parties.

ARTICLE III - COMPENSATION

     Compensation for the Consultant's professional services set forth in
Article II shall be on a monthly retainer basis at the rate set below.

               $4,800 per month, payable in accordance with Template Software's
regular payroll policies.


ARTICLE IV - EXPENSES

     While performing the professional services authorized hereunder, Template
Software shall reimburse Consultant for all expenses incurred as a result of
performing the tasks assigned by Template Software, including, without
limitation, paying expenses incurred by the Consultant for non-local travel in
accordance with the then current Federal Travel Regulations and local travel

                                       1
<PAGE>
 
from Consultant's facility to any other location specified herein at the rate
currently in effect in accordance with the Joint Travel Regulation plus parking
and tolls.

ARTICLE V - LOCATION OF SERVICES

     It is agreed that the Consultant shall provide professional services
primarily from Consultant's home at 2605 Geneva Hill Court, Oakton, VA  22124-
1534, but shall also be available to provide such services at Template
Software's executive headquarters at 45365 Vintage Park Plaza, Dulles, VA
20166, or at other locations that from time to time as may reasonably be
required for the performance of the services specified in Article II.

ARTICLE VI - AUTHORIZED REPRESENTATIVES

     The authorized representatives of Template Software with respect to this
Agreement are Joseph Fox, Chairman of the Board and Lin Pearce, President and
Chief Executive Officer.  In the course of performing services hereunder,
Consultant agrees that any Vice President in charge of a business unit that
Consultant is providing services for shall also be an authorized representative
of Template Software with respect to this Agreement.

ARTICLE VII - INVOICES AND PAYMENT

     The Consultant shall submit invoices on his own forms, no more frequently
than once a month, to an authorized representative of Template Software for
approval.  Payment to the Consultant for the services and expenses specified
herein shall be made within thirty days of receipt by Template Software. All
expenses to be reimbursed hereunder shall be supported with a copy of the
expense report and applicable receipts (hotel, car rental, airfare, etc.).

ARTICLE VIII - MODIFICATION

     No modification of this Agreement shall be valid or binding unless it is in
writing and signed by the Consultant and an authorized representative of
Template Software.

ARTICLE IX  TERMINATION

     Either Template Software or the Consultant may terminate this Agreement at
any time, for any reason, upon thirty (30) days prior written notice to the
other party.


     Template Software's sole responsibility to Consultant, in the event of
termination for any reason, is to compensate Consultant for actual hours worked
and expenses incurred through the termination date.

ARTICLE X  ASSIGNMENT

     Neither this Agreement nor any interest thereunder shall be assignable by
either Template Software or the Consultant unless such assignment is mutually
agreed to, in writing, by the parties hereto.  This Agreement shall be binding
on Template Software and Consultant and their successors and permitted assigns.

                                       2
<PAGE>
 
ARTICLE XI - INDEPENDENT CONTRACTOR RELATIONSHIP

     This Agreement, including the right to compensation hereunder, is personal
to the Consultant.  The Consultant warrants that all required federal, state and
local income taxes, self-employment taxes, and workman compensation, liability,
health and disability insurance shall be the sole responsibility of the
Consultant.  The Consultant is not, for any purpose, an employee or agent of
Template Software and the Consultant agrees not to make any representation to
the contrary, either expressly or implied.  The Consultant understands and
agrees that as an independent contractor, he does not have any authority to sign
contracts, notes, obligations, to make purchases, or to acquire or dispose of
any property for, or on behalf, of Template Software.

ARTICLE XII - CONFIDENTIAL INFORMATION AND CLASSIFIED INFORMATION; PROPRIETARY
INFORMATION

     The Consultant hereby irrevocably transfers and assigns any and all of his
right, title, and interest in and to Designs and Materials (as defined below),
including but not limited to all copyrights, patent rights, trade secrets and
trademarks, to Template Software.  Designs and Materials will be the sole
property of Template Software and Template Software will have the sole right to
determine the treatment of any Designs and Materials, including the right to
keep them as trade secrets, to file and execute patent applications on them, to
use and disclose them without prior patent application, to file registrations
for copyright or trademark on them in its own name, or to follow any other
procedure that Template Software deems appropriate.  "Designs and Materials"
                                                      --------------------- 
shall mean all designs, discoveries, inventions, products, computer programs,
procedures, improvements, developments, drawings, notes, documents, information
and materials made, conceived or developed by the Consultant alone or with
others which result from or relate directly to the services rendered hereunder.

     The Consultant acknowledges that the Consultant will acquire information
and materials from Template Software and knowledge about the business, products,
programming techniques, experimental work, customers, clients and suppliers of
Template Software and that all such knowledge, information and materials
acquired, the existence, terms and conditions of this Agreement, and the Designs
and Materials, are and will be the trade secrets and confidential and
proprietary information of Template Software (collectively, "Confidential
                                                             ------------
Information").  Confidential Information will not include, however, any
-----------                                                            
information which is or becomes part of the public domain through no fault of
the Consultant or that Template Software regularly gives to third parties
without restriction on use or disclosure.  The Consultant agrees to hold all
such Confidential Information in strict confidence, not to disclose it to others
or use it in any way, commercially or otherwise, except in performing the
services, rendered hereunder, and not to allow any unauthorized person access to
it, either before or after expiration or termination of this Agreement.  The
Consultant further agrees to take all action reasonably necessary and
satisfactory to protect the confidentiality of the Confidential Information
including, without limitation, implementing and enforcing operating procedures
to minimize the possibility of unauthorized use or copying of the Confidential
Information.

     Should the nature of the services provided hereunder necessitate access to
classified 

                                       3
<PAGE>
 
information and materials, the Consultant agrees to comply with all of
applicable government rule, regulations and policies related to the access,
handling and disposition of such classified information and materials.


ARTICLE XIII - TITLE TO MATERIALS AND EQUIPMENT

     All materials and equipment furnished by Template Software, and all
materials and equipment authorized by Template Software as an allowable expense
hereunder, shall remain the sole property of Template Software.  Any such
materials and equipment shall be returned to Template Software within fifteen
(15) days after the expiration of the Term or earlier termination of this
Agreement.

ARTICLE XIV - NON EXCLUSIVITY

     This Agreement shall in no way limit or restrict the Consultant from
entering into similar agreements with other corporations, agencies, or
individuals so long as Template Software protections under Article XII and
Article XIII.

ARTICLE XV  COMPLIANCE

     The Consultant does agree to comply with all applicable laws, regulations,
and standards in performing under this Agreement.

ARTICLE XVI - GOVERNING LAW

     This Agreement shall be governed by and construed in accordance with the
laws of the Commonwealth of Virginia, without reference to conflict of laws
principles.

ARTICLE XVII  HEADINGS

     The headings that precede the text of the articles are inserted solely for
convenience of reference and shall not constitute a part of this Agreement, nor
shall they affect the meaning, construction, interpretation or effect of this
Agreement.

ARTICLE XVIII - SERVICE OF NOTICE

     No notice, consent, waiver or other communication required or permitted to
be sent under this Agreement shall be effective unless the same is in writing
and is delivered by registered or certified mail, return receipt requested,
first-class postage prepaid, to the address of the party first set forth in this
Agreement.  Such notices, if sent by registered or certified mail, shall be
deemed to have been given at the time of mailing.

ARTICLE XIX - ENTIRE AGREEMENT

     This document constitutes the entire Agreement between Buyer and Seller
with respect to the subject matter hereof and supersedes any and all prior
agreements, understandings and representations.

                                       4
<PAGE>
 
ARTICLE XX - PARTIAL INVALIDITY

     If any provision in this Agreement is held by a court of competent
jurisdiction to be invalid, void, or unenforceable, the remaining provisions
will nevertheless continue in full force without being impaired or invalidated
in any way.

                                       5
<PAGE>
 
     IN WITNESS WHEREOF, the parties hereto have executed this Agreement as of
the day and year first above written.

BUYER                                   CONSULTANT

TEMPLATE SOFTWARE, INC.                 ALAN B. SALISBURY

/s/ E. Linwood Pearce                   /s/ Alan B. Salisbury
-----------------------                 -----------------------
 

E. Linwood Pearce
-----------------------
Name

President and Chief Executive Officer
-------------------------------------
Title

                                       6