<PAGE>

                                                                    EXHIBIT 10.5

                                 THIRD AMENDMENT
                                       TO
                     LINE OF CREDIT AND TERM LOAN AGREEMENT

    THIS THIRD AMENDMENT TO LINE OF CREDIT AND TERM LOAN AGREEMENT (the "Third
Amendment") dated as of the 9th day of July, 2004 (the "Effective Date"), by and
between RIVIERA TOOL COMPANY, a Michigan corporation (the "Borrower"), and
COMERICA BANK, a Michigan banking corporation (the "Bank");

                                   WITNESSETH:

    WHEREAS, Borrower and Bank are parties to that certain Revolving Credit Loan
Agreement dated as of December 23, 2002 (as amended, the "Agreement"), under and
pursuant to which Bank agreed to make certain loan and credit facilities
available to Borrower, subject to and in accordance with the terms and
conditions of the Agreement; and

    WHEREAS, Borrower entered into a First Amendment to Line of Credit and Term
Loan Agreement as of November 24, 2003; and

    WHEREAS, Borrower entered into a Second Amendment to Line of Credit and Term
Loan Agreement as of June 16, 2004; and

    WHEREAS, Borrower and Bank desire to further amend the Agreement as herein
provided;

    NOW, THEREFORE, in consideration of the premises and the mutual covenants
herein contained, Borrower and Bank hereby agree as follows:

      1.    Section 7.11 of the Agreement is deleted in its entirety and the
following substituted therefor:

      7.11  Financial Covenants. Permit:

                  (a)   The Debt Service Coverage Ratio to be less than 1.50 to
      1.00 as of the end of each month on a twelve (12) month rolling average.

                  (b)   Its Tangible Effective Net Worth, to be less than the
      following described amounts as of the following described dates:

                        (i)   From the Effective Date, until August 30, 2004:
            $17,750,000;

                        (ii)  From August 31, 2004, until August 30, 2005:
            $18,250,000;

                        (iii) From August 31, 2005, until August 30, 2006:
            $19,250,000;

                        (iv)  From August 31, 2006, and at all times thereafter:
            $19,750,000.

                  (c)   The Debt to Worth Ratio to be greater than 1.25 to 1.0.

      2.    Borrower hereby represents and warrants that, after giving effect to
the amendments contained herein, (a) execution, delivery and performance of this
Third Amendment and any other documents and instruments required under this
Third Amendment or the Agreement are within Borrower's corporate powers and
authorities, have been duly authorized by all necessary or requisite corporate
action, are not in contravention of law or the terms of Borrower's Articles of
Incorporation, Bylaws, or other charter or other constitutional documents, and
do not

                                       14
<PAGE>

require the consent or approval of any governmental body, agency, or authority;
and this Third Amendment and any other documents and instruments required under
this Third Amendment or the Agreement will be valid and binding in accordance
with their terms; (b) the representations and warranties of Borrower as set
forth in Article 5 of the Agreement are true and correct on and as of the date
hereof with the same force and effect as if made on and as of the date hereof;
and (c) no Default or Event of Default has occurred and is continuing or exists
under the Agreement as of the date hereof.

      3.    Except as modified hereby, all of the terms and conditions of the
Agreement, and any amendments thereto, shall remain in full force and effect,
and Borrower's liabilities and obligations thereunder are hereby acknowledged,
ratified and affirmed.

      4.    All the terms used herein which are defined in the Agreement shall
have the same meanings as used therein, unless the context clearly requires
otherwise.

      5.    Borrower is responsible for all costs incurred by Bank, including,
without limit, reasonable attorney fees, with regard to the preparation and
execution of this Third Amendment.

      6.    This Third Amendment will be governed by and construed in accordance
with the internal laws of the State of Michigan. The parties hereto select the
state and federal courts of appropriate jurisdiction in the State of Michigan as
the sole proper forums having jurisdiction over all disputes arising from or in
connection with this Third Amendment or the Agreement. The parties hereto
consent to be subject to personal jurisdiction of the courts located in the
State of Michigan with respect to any such dispute.

      7.    The execution of this Third Amendment shall not be deemed to be a
waiver of any Default or Event of Default.

      8.    Borrower hereby waives, discharges, and forever releases Bank,
Bank's employees, officers, directors, attorneys, stockholders and successors
and assigns, from and of any and all claims, causes of action, allegations or
assertions that Borrower has or may have had at any time up through and
including the date of this Third Amendment, against any or all of the foregoing,
regardless of whether any such claims, causes of action, allegations or
assertions are known to Borrower or whether any such claims, causes of action,
allegations or assertions arose as a result of Bank's actions or omissions in
connection with the Agreement, or any amendments, extensions or modifications
thereto, or Bank's administration of debt evidenced by the Agreement or
otherwise.

    WITNESS the due execution hereof on the day and year first above written.

                                             COMERICA BANK

                                             By   /s/ Thomas J. Stritzinger
                                                  ------------------------------
                                                  Thomas J. Stritzinger
                                             Its: Vice President

                                             RIVIERA TOOL COMPANY

                                             By /s/ Peter C. Canepa
                                                --------------------------------
                                                Peter C. Canepa
                                             Its: Chief Financial Officer

                                       15